Skip to content

Commit

Permalink
feat(Radio): deprecate readOnly prop. Use disabled instead
Browse files Browse the repository at this point in the history
  • Loading branch information
DSil committed Oct 22, 2024
1 parent 1101cf2 commit e9327f4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
1 change: 0 additions & 1 deletion packages/orbit-components/src/Radio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Table below contains all types of the props available in Radio component.
| tabIndex | `string \| number` | | Specifies the tab order of an element |
| tooltip | `Element<Tooltip>` | | Optional property when you need to attach Tooltip to the Radio. [See Functional specs](#functional-specs) |
| value | `string` | | The value of the Radio. |
| readOnly | `boolean` | | If `true`, the Radio will be set up as readOnly. |

## Functional specs

Expand Down
17 changes: 2 additions & 15 deletions packages/orbit-components/src/Radio/Radio.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const meta: Meta<typeof Radio> = {
checked: false,
disabled: false,
hasError: false,
readOnly: false,
tabIndex: 0,
onChange: action("changed"),
},
Expand Down Expand Up @@ -73,7 +72,7 @@ export const WithError: Story = {
parameters: {
info: "Error state of Radio component. Check Orbit.Kiwi for more detailed guidelines.",
controls: {
exclude: ["disabled", "readOnly", "onChange", "tabIndex"],
exclude: ["disabled", "onChange", "tabIndex"],
},
},
};
Expand All @@ -93,7 +92,7 @@ export const WithTextLinkInLabel: Story = {

parameters: {
controls: {
exclude: ["onChange", "hasError", "disabled", "label", "readOnly", "tabIndex"],
exclude: ["onChange", "hasError", "disabled", "label", "tabIndex"],
},
},
};
Expand All @@ -108,18 +107,6 @@ export const WithTooltip: Story = {
/>
),

parameters: {
controls: {
exclude: ["onChange", "hasError", "disabled", "readOnly", "tabIndex"],
},
},
};

export const ReadOnly: Story = {
args: {
readOnly: true,
},

parameters: {
controls: {
exclude: ["onChange", "hasError", "disabled", "tabIndex"],
Expand Down
3 changes: 3 additions & 0 deletions packages/orbit-components/src/Radio/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export interface Props extends Common.Globals {
readonly defaultChecked?: boolean;
readonly info?: React.ReactNode;
readonly tooltip?: React.ReactElement<typeof Tooltip>;
/**
* @deprecated Radio does not support `readOnly` prop. Use `disabled` instead.
*/
readonly readOnly?: boolean;
readonly tabIndex?: string | number;
// InputEvent
Expand Down

0 comments on commit e9327f4

Please sign in to comment.