Skip to content

Commit

Permalink
feat(Checkbox): deprecate readOnly prop. Use disabled instead
Browse files Browse the repository at this point in the history
  • Loading branch information
DSil committed Oct 21, 2024
1 parent b840686 commit e9952b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
13 changes: 1 addition & 12 deletions packages/orbit-components/src/Checkbox/Checkbox.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const meta: Meta<typeof Checkbox> = {
checked: false,
hasError: false,
disabled: false,
readOnly: false,
name: "name",
onChange: action("onChange"),
},
Expand All @@ -41,7 +40,7 @@ export const Default: Story = {
parameters: {
info: "Checkbox needs only label and onChange by default.",
controls: {
exclude: ["info", "hasError", "disabled", "readOnly", "name", "value", "onChange"],
exclude: ["info", "hasError", "disabled", "name", "value", "onChange"],
},
},

Expand Down Expand Up @@ -126,16 +125,6 @@ export const WithTooltip: Story = {
},
};

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

parameters: {
info: "This is a preview of this component in read-only state.",
},
};

export const Rtl: Story = {
render: args => (
<RenderInRtl>
Expand Down
3 changes: 3 additions & 0 deletions packages/orbit-components/src/Checkbox/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export interface Props extends Common.Globals {
readonly name?: string;
readonly info?: React.ReactNode;
readonly tabIndex?: string | number;
/**
* @deprecated Radio does not support `readOnly` prop. Use `disabled` instead.
*/
readonly readOnly?: boolean;
readonly tooltip?: React.ReactNode | null;
// Should be InputEvent type
Expand Down

0 comments on commit e9952b0

Please sign in to comment.