File tree Expand file tree Collapse file tree
packages/ui/components/form/select Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { Canvas , Meta , Story , ArgsTable } from " @storybook/addon-docs" ;
1+ import { Canvas , Meta , Story } from " @storybook/addon-docs" ;
22
33import {
44 Examples ,
55 Example ,
6- Note ,
76 Title ,
87 CustomArgsTable ,
98 VariantRow ,
@@ -15,7 +14,7 @@ import { SelectField } from "./Select";
1514
1615<Meta title = " UI/Form/Select Field" component = { SelectField } />
1716
18- <Title title = " Select" suffix = " Brief" subtitle = " Version 2.0 — Last Update: 22 Aug 2022" />
17+ <Title title = " Select" suffix = " Brief" subtitle = " Version 2.0 — Last Update: 29 Aug 2022" />
1918
2019## Definition
2120
@@ -101,11 +100,31 @@ const GoodSelect = (props) => <Select {...props} components={{ Control }} />;
101100## Select Story
102101
103102<Canvas >
104- <Story name = " Default" >
105- <VariantsTable titles = { [" Default" ]} columnMinWidth = { 450 } >
106- <VariantRow >
107- <SelectField options = { options } label = { " Default Select" } />
108- </VariantRow >
109- </VariantsTable >
103+ <Story
104+ name = " Default"
105+ args = { {
106+ required: false ,
107+ name: " select-field" ,
108+ error: " Some error" ,
109+ variant: " default" ,
110+ label: " Select an item" ,
111+ isMulti: false ,
112+ options ,
113+ }}
114+ argTypes = { {
115+ variant: {
116+ control: {
117+ type: " select" ,
118+ options: [" default" , " checkbox" ],
119+ },
120+ },
121+ }} >
122+ { (args ) => (
123+ <VariantsTable titles = { [" Default" ]} columnMinWidth = { 300 } >
124+ <VariantRow >
125+ <SelectField { ... args } />
126+ </VariantRow >
127+ </VariantsTable >
128+ )}
110129 </Story >
111130</Canvas >
You can’t perform that action at this time.
0 commit comments