diff --git a/.changeset/breezy-avocados-destroy.md b/.changeset/breezy-avocados-destroy.md new file mode 100644 index 0000000000..d046ef495c --- /dev/null +++ b/.changeset/breezy-avocados-destroy.md @@ -0,0 +1,5 @@ +--- +'@commercetools-uikit/radio-field': patch +--- + +Widen `RadioField` value prop type to `string | boolean` diff --git a/packages/components/fields/radio-field/README.md b/packages/components/fields/radio-field/README.md index 2f23cb687c..c6e1ba0504 100644 --- a/packages/components/fields/radio-field/README.md +++ b/packages/components/fields/radio-field/README.md @@ -61,7 +61,7 @@ export default Example; | `isRequired` | `boolean` | | | Indicates if the value is required. Shows an the "required asterisk" if so. | | `touched` | `boolean` | | | Indicates whether the field was touched. Errors will only be shown when the field was touched. | | `name` | `string` | | | Used as HTML name of the input component. | -| `value` | `string` | ✅ | | Value of the input component. | +| `value` | `string` or `boolean` | ✅ | | Value of the input component. | | `onChange` | `ChangeEventHandler` | | | Called with an event containing the new value. Required when input is not read only. Parent should pass it back as value. | | `onBlur` | `FocusEventHandler` | | | Called when input is blurred | | `onFocus` | `FocusEventHandler` | | | Called when input is focused | diff --git a/packages/components/fields/radio-field/src/radio-field.tsx b/packages/components/fields/radio-field/src/radio-field.tsx index 06a076979c..501900e621 100644 --- a/packages/components/fields/radio-field/src/radio-field.tsx +++ b/packages/components/fields/radio-field/src/radio-field.tsx @@ -99,7 +99,7 @@ export type TRadioFieldProps = { /** * Value of the input component. */ - value: string; + value: string | boolean; /** * Called with an event containing the new value. Required when input is not read only. Parent should pass it back as value. */