@@ -21,6 +21,51 @@ export default {
2121 options : [ 'sm' , 'md' , 'lg' ] ,
2222 control : { type : 'select' } ,
2323 } ,
24+ downshiftProps : {
25+ table : { disable : true } ,
26+ } ,
27+ compareItems : {
28+ table : { disable : true } ,
29+ } ,
30+ sortItems : {
31+ table : { disable : true } ,
32+ } ,
33+ initialSelectedItems : {
34+ table : { disable : true } ,
35+ } ,
36+ id : {
37+ table : { disable : true } ,
38+ } ,
39+ items : {
40+ table : { disable : true } ,
41+ } ,
42+ local : {
43+ table : { disable : true } ,
44+ } ,
45+ onChange : {
46+ table : { disable : true } ,
47+ } ,
48+ onMenuChange : {
49+ table : { disable : true } ,
50+ } ,
51+ itemToElement : {
52+ table : { disable : true } ,
53+ } ,
54+ itemToString : {
55+ table : { disable : true } ,
56+ } ,
57+ selectedItems : {
58+ table : { disable : true } ,
59+ } ,
60+ open : {
61+ table : { disable : true } ,
62+ } ,
63+ title : {
64+ table : { disable : true } ,
65+ } ,
66+ translateWithId : {
67+ table : { disable : true } ,
68+ } ,
2469 } ,
2570} ;
2671
@@ -52,7 +97,7 @@ const items = [
5297 } ,
5398] ;
5499
55- export const Default = ( args ) => {
100+ export const Playground = ( args ) => {
56101 return (
57102 < div style = { { width : 300 } } >
58103 < MultiSelect
@@ -69,7 +114,116 @@ export const Default = (args) => {
69114 ) ;
70115} ;
71116
72- export const WithInitialSelectedItems = ( args ) => {
117+ Playground . argTypes = {
118+ selectionFeedback : {
119+ options : [ 'top' , 'fixed' , 'top-after-reopen' ] ,
120+ control : { type : 'select' } ,
121+ } ,
122+ size : {
123+ options : [ 'sm' , 'md' , 'lg' ] ,
124+ control : { type : 'select' } ,
125+ defaultValue : 'md' ,
126+ } ,
127+ direction : {
128+ options : [ 'top' , 'bottom' ] ,
129+ control : { type : 'radio' } ,
130+ } ,
131+ type : {
132+ options : [ 'inline' , 'default' ] ,
133+ control : { type : 'radio' } ,
134+ defaultValue : 'default' ,
135+ } ,
136+ titleText : {
137+ control : {
138+ type : 'text' ,
139+ } ,
140+ defaultValue : 'This is a MultiSelect Title' ,
141+ } ,
142+ disabled : {
143+ control : {
144+ type : 'boolean' ,
145+ } ,
146+ defaultValue : false ,
147+ } ,
148+ hideLabel : {
149+ control : {
150+ type : 'boolean' ,
151+ } ,
152+ defaultValue : false ,
153+ } ,
154+ invalid : {
155+ control : {
156+ type : 'boolean' ,
157+ } ,
158+ defaultValue : false ,
159+ } ,
160+ light : {
161+ control : {
162+ type : 'boolean' ,
163+ } ,
164+ defaultValue : false ,
165+ } ,
166+ warn : {
167+ control : {
168+ type : 'boolean' ,
169+ } ,
170+ defaultValue : false ,
171+ } ,
172+ warnText : {
173+ control : {
174+ type : 'text' ,
175+ } ,
176+ defaultValue : 'whoopsie!' ,
177+ } ,
178+ invalidText : {
179+ control : {
180+ type : 'text' ,
181+ } ,
182+ defaultValue : 'whoopsie!' ,
183+ } ,
184+ label : {
185+ control : {
186+ type : 'text' ,
187+ } ,
188+ defaultValue : 'This is a label' ,
189+ } ,
190+ clearSelectionDescription : {
191+ control : {
192+ type : 'text' ,
193+ } ,
194+ defaultValue : 'Total items selected: ' ,
195+ } ,
196+ useTitleInItem : {
197+ control : {
198+ type : 'text' ,
199+ } ,
200+ defaultValue : 'this is the item title' ,
201+ } ,
202+ clearSelectionText : {
203+ control : {
204+ type : 'text' ,
205+ } ,
206+ defaultValue : 'To clear selection, press Delete or Backspace,' ,
207+ } ,
208+ } ;
209+
210+ export const Default = ( ) => {
211+ return (
212+ < div style = { { width : 300 } } >
213+ < MultiSelect
214+ label = "Multiselect Label"
215+ id = "carbon-multiselect-example"
216+ titleText = "Multiselect title"
217+ helperText = "This is helper text"
218+ items = { items }
219+ itemToString = { ( item ) => ( item ? item . text : '' ) }
220+ selectionFeedback = "top-after-reopen"
221+ />
222+ </ div >
223+ ) ;
224+ } ;
225+
226+ export const WithInitialSelectedItems = ( ) => {
73227 return (
74228 < div style = { { width : 300 } } >
75229 < MultiSelect
@@ -80,13 +234,12 @@ export const WithInitialSelectedItems = (args) => {
80234 itemToString = { ( item ) => ( item ? item . text : '' ) }
81235 initialSelectedItems = { [ items [ 0 ] , items [ 1 ] ] }
82236 selectionFeedback = "top-after-reopen"
83- { ...args }
84237 />
85238 </ div >
86239 ) ;
87240} ;
88241
89- export const _Filterable = ( args ) => {
242+ export const _Filterable = ( ) => {
90243 return (
91244 < div style = { { width : 300 } } >
92245 < FilterableMultiSelect
@@ -96,13 +249,12 @@ export const _Filterable = (args) => {
96249 items = { items }
97250 itemToString = { ( item ) => ( item ? item . text : '' ) }
98251 selectionFeedback = "top-after-reopen"
99- { ...args }
100252 />
101253 </ div >
102254 ) ;
103255} ;
104256
105- export const WithLayer = ( args ) => {
257+ export const WithLayer = ( ) => {
106258 return (
107259 < div style = { { width : 300 } } >
108260 < MultiSelect
@@ -113,7 +265,6 @@ export const WithLayer = (args) => {
113265 items = { items }
114266 itemToString = { ( item ) => ( item ? item . text : '' ) }
115267 selectionFeedback = "top-after-reopen"
116- { ...args }
117268 />
118269 < Layer >
119270 < MultiSelect
@@ -124,7 +275,6 @@ export const WithLayer = (args) => {
124275 items = { items }
125276 itemToString = { ( item ) => ( item ? item . text : '' ) }
126277 selectionFeedback = "top-after-reopen"
127- { ...args }
128278 />
129279 < Layer >
130280 < MultiSelect
@@ -135,15 +285,14 @@ export const WithLayer = (args) => {
135285 items = { items }
136286 itemToString = { ( item ) => ( item ? item . text : '' ) }
137287 selectionFeedback = "top-after-reopen"
138- { ...args }
139288 />
140289 </ Layer >
141290 </ Layer >
142291 </ div >
143292 ) ;
144293} ;
145294
146- export const _FilterableWithLayer = ( args ) => {
295+ export const _FilterableWithLayer = ( ) => {
147296 return (
148297 < div style = { { width : 300 } } >
149298 < FilterableMultiSelect
@@ -153,7 +302,6 @@ export const _FilterableWithLayer = (args) => {
153302 items = { items }
154303 itemToString = { ( item ) => ( item ? item . text : '' ) }
155304 selectionFeedback = "top-after-reopen"
156- { ...args }
157305 />
158306 < Layer >
159307 < FilterableMultiSelect
@@ -163,7 +311,6 @@ export const _FilterableWithLayer = (args) => {
163311 items = { items }
164312 itemToString = { ( item ) => ( item ? item . text : '' ) }
165313 selectionFeedback = "top-after-reopen"
166- { ...args }
167314 />
168315 < Layer >
169316 < FilterableMultiSelect
@@ -173,7 +320,6 @@ export const _FilterableWithLayer = (args) => {
173320 items = { items }
174321 itemToString = { ( item ) => ( item ? item . text : '' ) }
175322 selectionFeedback = "top-after-reopen"
176- { ...args }
177323 />
178324 </ Layer >
179325 </ Layer >
0 commit comments