@@ -44,10 +44,6 @@ const meta = {
44
44
options : Object . keys ( SWITCH_VARIANTS ) as Array < keyof typeof SWITCH_VARIANTS > ,
45
45
control : { type : 'radio' } ,
46
46
} ,
47
- shape : {
48
- options : [ 'rounded' , 'square' ] ,
49
- control : { type : 'radio' } ,
50
- } ,
51
47
iconName : {
52
48
options : [ null , ...Object . keys ( iconMap ) ] ,
53
49
control : { type : 'select' } ,
@@ -79,7 +75,7 @@ const meta = {
79
75
80
76
type Story = StoryObj < typeof meta >
81
77
82
- const SWITCH_TEMPLATE : Story = {
78
+ const COMMON_SWITCH_TEMPLATE : Story = {
83
79
args : {
84
80
name : 'switch-story' ,
85
81
dataTestId : 'switch-story' ,
@@ -88,15 +84,38 @@ const SWITCH_TEMPLATE: Story = {
88
84
isDisabled : false ,
89
85
isLoading : false ,
90
86
tooltipContent : '' ,
91
- shape : 'rounded' ,
92
87
ariaLabel : 'Toggle' ,
93
88
} ,
94
89
}
95
90
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
+ } ,
98
115
args : {
99
- ...SWITCH_TEMPLATE . args ,
116
+ ...COMMON_SWITCH_TEMPLATE . args ,
117
+ shape : 'square' ,
118
+ iconName : 'ic-check' ,
100
119
} satisfies BaseComponentPropsType ,
101
120
}
102
121
0 commit comments