Skip to content

Commit b45229f

Browse files
committed
refactor: remove shape prop from meta and rename SWITCH_TEMPLATE to COMMON_SWITCH_TEMPLATE
1 parent 5cdff18 commit b45229f

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

src/stories/Switch.stories.tsx

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ const meta = {
4444
options: Object.keys(SWITCH_VARIANTS) as Array<keyof typeof SWITCH_VARIANTS>,
4545
control: { type: 'radio' },
4646
},
47-
shape: {
48-
options: ['rounded', 'square'],
49-
control: { type: 'radio' },
50-
},
5147
iconName: {
5248
options: [null, ...Object.keys(iconMap)],
5349
control: { type: 'select' },
@@ -79,7 +75,7 @@ const meta = {
7975

8076
type Story = StoryObj<typeof meta>
8177

82-
const SWITCH_TEMPLATE: Story = {
78+
const COMMON_SWITCH_TEMPLATE: Story = {
8379
args: {
8480
name: 'switch-story',
8581
dataTestId: 'switch-story',
@@ -88,15 +84,38 @@ const SWITCH_TEMPLATE: Story = {
8884
isDisabled: false,
8985
isLoading: false,
9086
tooltipContent: '',
91-
shape: 'rounded',
9287
ariaLabel: 'Toggle',
9388
},
9489
}
9590

96-
export const Default: Story = {
97-
...SWITCH_TEMPLATE,
91+
export const RoundedSwitch: Story = {
92+
...COMMON_SWITCH_TEMPLATE,
93+
argTypes: {
94+
...meta.argTypes,
95+
iconName: {
96+
options: [null],
97+
control: { type: 'select' },
98+
},
99+
},
100+
args: {
101+
...COMMON_SWITCH_TEMPLATE.args,
102+
shape: 'rounded',
103+
} satisfies BaseComponentPropsType,
104+
}
105+
106+
export const SquareSwitch: Story = {
107+
...COMMON_SWITCH_TEMPLATE,
108+
argTypes: {
109+
...meta.argTypes,
110+
indeterminate: {
111+
options: [false],
112+
control: { type: 'radio' },
113+
},
114+
},
98115
args: {
99-
...SWITCH_TEMPLATE.args,
116+
...COMMON_SWITCH_TEMPLATE.args,
117+
shape: 'square',
118+
iconName: 'ic-check',
100119
} satisfies BaseComponentPropsType,
101120
}
102121

0 commit comments

Comments
 (0)