@pareto-engineering/design-system 2.0.0-alpha.52 → 2.0.0-alpha.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/cjs/a/AppContext/Context.js +16 -0
  2. package/dist/cjs/a/AppContext/ContextProvider.js +96 -0
  3. package/dist/cjs/a/AppContext/index.js +39 -0
  4. package/dist/cjs/a/AppContext/useApp.js +16 -0
  5. package/dist/cjs/a/AppContext/useTheme.js +45 -0
  6. package/dist/cjs/a/index.js +8 -8
  7. package/dist/cjs/b/Page/common/PageHelmet/PageHelmet.js +1 -1
  8. package/dist/cjs/b/SocialMediaButton/SocialMediaButton.js +4 -4
  9. package/dist/cjs/b/ThemeSelector/ThemeSelector.js +1 -1
  10. package/dist/cjs/f/FormInput/FormInput.js +1 -1
  11. package/dist/cjs/f/common/Description/Description.js +20 -14
  12. package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +0 -2
  13. package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +5 -9
  14. package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +5 -9
  15. package/dist/cjs/f/fields/SelectInput/SelectInput.js +16 -8
  16. package/dist/cjs/f/fields/TextInput/TextInput.js +18 -9
  17. package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +16 -8
  18. package/dist/es/a/AppContext/Context.js +2 -0
  19. package/dist/es/a/AppContext/ContextProvider.js +78 -0
  20. package/dist/es/a/AppContext/index.js +5 -0
  21. package/dist/es/a/AppContext/useApp.js +3 -0
  22. package/dist/es/a/AppContext/useTheme.js +34 -0
  23. package/dist/es/a/index.js +1 -1
  24. package/dist/es/b/Page/common/PageHelmet/PageHelmet.js +2 -2
  25. package/dist/es/b/SocialMediaButton/SocialMediaButton.js +5 -5
  26. package/dist/es/b/ThemeSelector/ThemeSelector.js +2 -2
  27. package/dist/es/f/FormInput/FormInput.js +1 -1
  28. package/dist/es/f/common/Description/Description.js +19 -14
  29. package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +0 -2
  30. package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +5 -9
  31. package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +5 -9
  32. package/dist/es/f/fields/SelectInput/SelectInput.js +16 -8
  33. package/dist/es/f/fields/TextInput/TextInput.js +18 -9
  34. package/dist/es/f/fields/TextareaInput/TextareaInput.js +16 -8
  35. package/package.json +1 -1
  36. package/src/__snapshots__/Storyshots.test.js.snap +1528 -1385
  37. package/src/stories/a/{SiteContext.stories.jsx → AppContext.stories.jsx} +8 -8
  38. package/src/stories/a/DotInfo.stories.jsx +12 -12
  39. package/src/stories/a/ProgressBar.stories.jsx +12 -6
  40. package/src/stories/a/Timestamp.stories.jsx +32 -38
  41. package/src/stories/b/Logo.stories.jsx +13 -13
  42. package/src/stories/b/QuestionDropdown.stories.jsx +17 -30
  43. package/src/stories/b/SocialMediaButton.stories.jsx +34 -52
  44. package/src/stories/b/ThemeSelector.stories.jsx +5 -5
  45. package/src/stories/b/Title.stories.jsx +11 -13
  46. package/src/stories/c/ContentSlides.stories.jsx +30 -300
  47. package/src/stories/f/ChoicesInput.stories.jsx +62 -129
  48. package/src/stories/f/Description.stories.jsx +12 -2
  49. package/src/stories/f/RatingsInput.stories.jsx +21 -22
  50. package/src/stories/f/SelectInput.stories.jsx +35 -75
  51. package/src/stories/f/TextInput.stories.jsx +55 -52
  52. package/src/stories/f/TextareaInput.stories.jsx +31 -46
  53. package/src/ui/a/{SiteContext → AppContext}/Context.js +0 -0
  54. package/src/ui/a/{SiteContext → AppContext}/ContextProvider.jsx +8 -7
  55. package/src/ui/a/AppContext/index.js +5 -0
  56. package/src/ui/a/{SiteContext/useSite.js → AppContext/useApp.js} +0 -0
  57. package/src/ui/a/{SiteContext → AppContext}/useTheme.js +0 -0
  58. package/src/ui/a/index.js +4 -4
  59. package/src/ui/b/Page/common/PageHelmet/PageHelmet.jsx +2 -2
  60. package/src/ui/b/SocialMediaButton/SocialMediaButton.jsx +4 -4
  61. package/src/ui/b/ThemeSelector/ThemeSelector.jsx +2 -2
  62. package/src/ui/f/FormInput/FormInput.jsx +1 -0
  63. package/src/ui/f/common/Description/Description.jsx +34 -29
  64. package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +1 -2
  65. package/src/ui/f/fields/QueryCombobox/common/Combobox/Combobox.jsx +1 -11
  66. package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +1 -11
  67. package/src/ui/f/fields/SelectInput/SelectInput.jsx +16 -9
  68. package/src/ui/f/fields/TextInput/TextInput.jsx +13 -7
  69. package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +9 -8
  70. package/src/ui/a/SiteContext/index.js +0 -5
@@ -3,12 +3,12 @@ import * as React from 'react'
3
3
 
4
4
  import {
5
5
  ContentSlides,
6
- SiteContextProvider,
6
+ AppContextProvider,
7
7
  Shapes,
8
8
  useContentSlides,
9
9
  Title,
10
10
  Logo,
11
- useSite,
11
+ useApp,
12
12
  } from 'ui'
13
13
 
14
14
  // import Router from 'stories/utils/Router'
@@ -26,15 +26,15 @@ export default {
26
26
  decorators:[
27
27
  (storyfn) => <Router>{ storyfn() }</Router>,
28
28
  (storyfn) => (
29
- <SiteContextProvider config={{
30
- SITE:{
29
+ <AppContextProvider config={{
30
+ APP:{
31
31
  NAME :'name of my site',
32
32
  CANONICAL:'https://mysite.com',
33
33
  },
34
34
  }}
35
35
  >
36
36
  { storyfn() }
37
- </SiteContextProvider>
37
+ </AppContextProvider>
38
38
  ),
39
39
  ],
40
40
  argTypes:{
@@ -42,9 +42,11 @@ export default {
42
42
  },
43
43
  }
44
44
 
45
- export const Base = () => {
45
+ const Template = (args) => {
46
46
  const Main = () => {
47
- const { userTheme } = useSite()
47
+ const { isSimple, hasBackgroundShape } = args || {}
48
+ const { userTheme } = useApp()
49
+ const { isLastStep } = useContentSlides()
48
50
 
49
51
  const steps = [
50
52
  {
@@ -75,13 +77,24 @@ export const Base = () => {
75
77
 
76
78
  return (
77
79
  <div className={`ui-${userTheme}`} style={{ height: '100%' }}>
78
- <ContentSlides className="y-background1 b-dark-y" steps={steps}>
80
+ <ContentSlides className="y-background1 b-dark-y" steps={steps} simple={isSimple}>
81
+ {!isSimple && (
79
82
  <ContentSlides.Sidebar
80
83
  header={(
81
84
  <Logo color="paragraph" />
82
85
  )}
83
86
  />
84
- <ContentSlides.HorizontalMenu />
87
+ )}
88
+ {hasBackgroundShape && (
89
+ <Shapes
90
+ className="y-background4 b-light-y"
91
+ height="65em"
92
+ verticalAlign="center"
93
+ horizontalAlign="flex-start"
94
+ shape="spiral"
95
+ />
96
+ )}
97
+ <ContentSlides.HorizontalMenu hideBackIcon={isLastStep} />
85
98
  <main>
86
99
  <ContentSlides.Slide
87
100
  index={0}
@@ -203,298 +216,15 @@ export const Base = () => {
203
216
  )
204
217
  }
205
218
 
206
- export const Simple = () => {
207
- const steps = [
208
- {
209
- id :'welcome',
210
- title :'Welcome',
211
- progress:40,
212
- location:'welcome',
213
- },
214
- {
215
- id :'plan',
216
- title :'Choose your plan',
217
- progress:60,
218
- location:'select-plan',
219
- },
220
- {
221
- id :'details',
222
- title :'Personal details',
223
- progress:70,
224
- location:'personal-details',
225
- },
226
- {
227
- id :'payment',
228
- title :'Payment',
229
- progress:90,
230
- location:'payment',
231
- },
232
- ]
233
-
234
- const Main = () => {
235
- const { isLastStep } = useContentSlides()
236
-
237
- return (
238
- <>
239
- <ContentSlides.HorizontalMenu hideBackIcon={isLastStep} />
240
- {' '}
241
- <main>
242
- <ContentSlides.Slide
243
- index={0}
244
- >
245
- <Title
246
- heading="Welcome"
247
- headingAs="h1"
248
- headingClassName="small"
249
- subtitle="Welcome to this site. We hope you will have an amazing experience here."
250
- />
251
- <ContentSlides.Navigator />
252
- </ContentSlides.Slide
253
- >
254
- <ContentSlides.Slide
255
- index={1}
256
- >
257
- <Title
258
- heading="Part 2"
259
- headingAs="h1"
260
- headingClassName="small"
261
- subtitle="Welcome to this site. We hope you will have an amazing experience here."
262
- />
263
- <p>
264
- In ut sollicitudin elit. Maecenas tempor ex aliquet enim egestas,
265
- non sollicitudin mi tempor. Pellentesque fermentum, massa in cursus faucibus,
266
- enim tortor fringilla ligula, sit amet tincidunt neque orci et tellus.
267
- Nam dignissim tristique justo. Cras nulla sem, dictum pellentesque libero eget,
268
- porta placerat leo.
269
- Donec scelerisque enim risus, in pharetra purus fringilla eu.
270
- Cras placerat ac enim viverra rhoncus.
271
- Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
272
- Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
273
- Nullam vel porttitor mi, ut vestibulum arcu.
274
- {' '}
275
- </p>
276
- <p>
277
- In ut sollicitudin elit. Maecenas tempor ex aliquet enim egestas,
278
- non sollicitudin mi tempor. Pellentesque fermentum, massa in cursus faucibus,
279
- enim tortor fringilla ligula, sit amet tincidunt neque orci et tellus.
280
- Nam dignissim tristique justo. Cras nulla sem, dictum pellentesque libero eget,
281
- porta placerat leo.
282
- Donec scelerisque enim risus, in pharetra purus fringilla eu.
283
- Cras placerat ac enim viverra rhoncus.
284
- Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
285
- Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
286
- Nullam vel porttitor mi, ut vestibulum arcu.
287
- {' '}
288
- </p>
289
- <p>
290
- In ut sollicitudin elit. Maecenas tempor ex aliquet enim egestas,
291
- non sollicitudin mi tempor. Pellentesque fermentum, massa in cursus faucibus,
292
- enim tortor fringilla ligula, sit amet tincidunt neque orci et tellus.
293
- Nam dignissim tristique justo. Cras nulla sem, dictum pellentesque libero eget,
294
- porta placerat leo.
295
- Donec scelerisque enim risus, in pharetra purus fringilla eu.
296
- Cras placerat ac enim viverra rhoncus.
297
- Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
298
- Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
299
- Nullam vel porttitor mi, ut vestibulum arcu.
300
- {' '}
301
- </p>
302
- <p>
303
- In ut sollicitudin elit. Maecenas tempor ex aliquet enim egestas,
304
- non sollicitudin mi tempor. Pellentesque fermentum, massa in cursus faucibus,
305
- enim tortor fringilla ligula, sit amet tincidunt neque orci et tellus.
306
- Nam dignissim tristique justo. Cras nulla sem, dictum pellentesque libero eget,
307
- porta placerat leo.
308
- Donec scelerisque enim risus, in pharetra purus fringilla eu.
309
- Cras placerat ac enim viverra rhoncus.
310
- Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
311
- Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
312
- Nullam vel porttitor mi, ut vestibulum arcu.
313
- {' '}
314
- </p>
219
+ export const Base = Template.bind({})
315
220
 
316
- <ContentSlides.Navigator />
317
- </ContentSlides.Slide>
318
- <ContentSlides.Slide
319
- index={2}
320
- >
321
- <Title
322
- heading="Part 3"
323
- headingAs="h1"
324
- headingClassName="small"
325
- subtitle="Welcome to this site. We hope you will have an amazing experience here."
326
- />
327
- <ContentSlides.Navigator />
328
- </ContentSlides.Slide>
329
- <ContentSlides.Slide
330
- index={3}
331
- >
332
- <Title
333
- heading="Part 4"
334
- headingAs="h1"
335
- headingClassName="small"
336
- subtitle="Welcome to this site. We hope you will have an amazing experience here."
337
- />
338
- <ContentSlides.Navigator />
339
- </ContentSlides.Slide>
340
- </main>
341
- </>
342
- )
343
- }
344
- return (
345
- <ContentSlides className="y-background1 b-dark-y" steps={steps} simple>
346
- <Main />
347
- </ContentSlides>
348
- )
221
+ export const Simple = Template.bind({})
222
+ Simple.args = {
223
+ isSimple:true,
349
224
  }
350
225
 
351
- export const WithBackgroundShape = () => {
352
- const steps = [
353
- {
354
- id :'welcome',
355
- title :'Welcome',
356
- progress:40,
357
- location:'welcome',
358
- },
359
- {
360
- id :'plan',
361
- title :'Choose your plan',
362
- progress:60,
363
- location:'select-plan',
364
- },
365
- {
366
- id :'details',
367
- title :'Personal details',
368
- progress:70,
369
- location:'personal-details',
370
- },
371
- {
372
- id :'payment',
373
- title :'Payment',
374
- progress:90,
375
- location:'payment',
376
- },
377
- ]
378
-
379
- const Main = () => {
380
- const { isLastStep } = useContentSlides()
381
-
382
- return (
383
- <>
384
- <ContentSlides.HorizontalMenu hideBackIcon={isLastStep} />
385
- {' '}
386
- <main>
387
- <ContentSlides.Slide
388
- index={0}
389
- >
390
- <Title
391
- heading="Welcome"
392
- headingAs="h1"
393
- headingClassName="small"
394
- subtitle="Welcome to this site. We hope you will have an amazing experience here."
395
- />
396
- <ContentSlides.Navigator />
397
- </ContentSlides.Slide
398
- >
399
- <ContentSlides.Slide
400
- index={1}
401
- >
402
- <Title
403
- heading="Part 2"
404
- headingAs="h1"
405
- headingClassName="small"
406
- subtitle="Welcome to this site. We hope you will have an amazing experience here."
407
- />
408
- <p>
409
- In ut sollicitudin elit. Maecenas tempor ex aliquet enim egestas,
410
- non sollicitudin mi tempor. Pellentesque fermentum, massa in cursus faucibus,
411
- enim tortor fringilla ligula, sit amet tincidunt neque orci et tellus.
412
- Nam dignissim tristique justo. Cras nulla sem, dictum pellentesque libero eget,
413
- porta placerat leo.
414
- Donec scelerisque enim risus, in pharetra purus fringilla eu.
415
- Cras placerat ac enim viverra rhoncus.
416
- Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
417
- Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
418
- Nullam vel porttitor mi, ut vestibulum arcu.
419
- {' '}
420
- </p>
421
- <p>
422
- In ut sollicitudin elit. Maecenas tempor ex aliquet enim egestas,
423
- non sollicitudin mi tempor. Pellentesque fermentum, massa in cursus faucibus,
424
- enim tortor fringilla ligula, sit amet tincidunt neque orci et tellus.
425
- Nam dignissim tristique justo. Cras nulla sem, dictum pellentesque libero eget,
426
- porta placerat leo.
427
- Donec scelerisque enim risus, in pharetra purus fringilla eu.
428
- Cras placerat ac enim viverra rhoncus.
429
- Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
430
- Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
431
- Nullam vel porttitor mi, ut vestibulum arcu.
432
- {' '}
433
- </p>
434
- <p>
435
- In ut sollicitudin elit. Maecenas tempor ex aliquet enim egestas,
436
- non sollicitudin mi tempor. Pellentesque fermentum, massa in cursus faucibus,
437
- enim tortor fringilla ligula, sit amet tincidunt neque orci et tellus.
438
- Nam dignissim tristique justo. Cras nulla sem, dictum pellentesque libero eget,
439
- porta placerat leo.
440
- Donec scelerisque enim risus, in pharetra purus fringilla eu.
441
- Cras placerat ac enim viverra rhoncus.
442
- Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
443
- Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
444
- Nullam vel porttitor mi, ut vestibulum arcu.
445
- {' '}
446
- </p>
447
- <p>
448
- In ut sollicitudin elit. Maecenas tempor ex aliquet enim egestas,
449
- non sollicitudin mi tempor. Pellentesque fermentum, massa in cursus faucibus,
450
- enim tortor fringilla ligula, sit amet tincidunt neque orci et tellus.
451
- Nam dignissim tristique justo. Cras nulla sem, dictum pellentesque libero eget,
452
- porta placerat leo.
453
- Donec scelerisque enim risus, in pharetra purus fringilla eu.
454
- Cras placerat ac enim viverra rhoncus.
455
- Cras sagittis euismod orci eget aliquam. Nulla et mi non enim aliquam consequat.
456
- Cras volutpat porta convallis. Mauris ullamcorper vitae sapien ac rhoncus.
457
- Nullam vel porttitor mi, ut vestibulum arcu.
458
- {' '}
459
- </p>
460
-
461
- <ContentSlides.Navigator />
462
- </ContentSlides.Slide>
463
- <ContentSlides.Slide
464
- index={2}
465
- >
466
- <Title
467
- heading="Part 3"
468
- headingAs="h1"
469
- headingClassName="small"
470
- subtitle="Welcome to this site. We hope you will have an amazing experience here."
471
- />
472
- <ContentSlides.Navigator />
473
- </ContentSlides.Slide>
474
- <ContentSlides.Slide
475
- index={3}
476
- >
477
- <Title
478
- heading="Part 4"
479
- headingAs="h1"
480
- headingClassName="small"
481
- subtitle="Welcome to this site. We hope you will have an amazing experience here."
482
- />
483
- <ContentSlides.Navigator />
484
- </ContentSlides.Slide>
485
- </main>
486
- </>
487
- )
488
- }
489
- return (
490
- <ContentSlides className="y-background4 b-light-y" steps={steps} simple>
491
- <Shapes
492
- height="65em"
493
- verticalAlign="center"
494
- horizontalAlign="flex-start"
495
- shape="spiral"
496
- />
497
- <Main />
498
- </ContentSlides>
499
- )
226
+ export const WithBackgroundShape = Template.bind({})
227
+ WithBackgroundShape.args = {
228
+ ...Simple.args,
229
+ hasBackgroundShape:true,
500
230
  }
@@ -26,143 +26,76 @@ export default {
26
26
  },
27
27
  }
28
28
 
29
- export const Base = () => {
30
- const optionsMap = [
31
- {
32
- value:'red',
33
- label:'Color Red',
34
- },
35
- {
36
- value:'blue',
37
- label:'Color Blue',
38
- },
39
- {
40
- value:'green',
41
- label:'Color Green',
42
- },
43
- ]
29
+ const Template = (args) => (
30
+ <>
31
+ <ChoicesInput {...args} />
32
+ <FormDebugger />
33
+ </>
34
+ )
44
35
 
45
- return (
36
+ export const Base = Template.bind({})
37
+ const optionsMap = [
38
+ {
39
+ value:'red',
40
+ label:'Color Red',
41
+ },
42
+ {
43
+ value:'blue',
44
+ label:'Color Blue',
45
+ },
46
+ {
47
+ value:'green',
48
+ label:'Color Green',
49
+ },
50
+ {
51
+ value:'yellow',
52
+ label:'Color Yellow',
53
+ },
54
+ {
55
+ value:'oarnge',
56
+ label:'Color Orange',
57
+ },
58
+ {
59
+ value:'violet',
60
+ label:'Color Violet',
61
+ },
62
+ {
63
+ value:'brown',
64
+ label:'Color Brown',
65
+ },
66
+ {
67
+ value:'black',
68
+ label:'Color Black',
69
+ },
70
+ ]
46
71
 
47
- <>
48
- <ChoicesInput id="colors" options={optionsMap} name="color" />
49
- <FormDebugger />
50
- </>
51
- )
72
+ Base.args = {
73
+ id :'colors',
74
+ options:optionsMap,
75
+ name :'color',
52
76
  }
53
77
 
54
- export const Multiple = () => {
55
- const optionsMap = [
56
- {
57
- value:'red',
58
- label:'Color Red',
59
- },
60
- {
61
- value:'blue',
62
- label:'Color Blue',
63
- },
64
- {
65
- value:'green',
66
- label:'Color Green',
67
- },
68
- ]
69
-
70
- return (
71
- <>
72
- <ChoicesInput id="colors" options={optionsMap} name="color" multiple />
73
- <FormDebugger />
74
- </>
75
- )
78
+ export const Multiple = Template.bind({})
79
+ Multiple.args = {
80
+ ...Base.args,
81
+ multiple:true,
76
82
  }
77
83
 
78
- export const MultipleWithGrid = () => {
79
- const optionsMap = [
80
- {
81
- value:'red',
82
- label:'Color Red',
83
- },
84
- {
85
- value:'blue',
86
- label:'Color Blue',
87
- },
88
- {
89
- value:'green',
90
- label:'Color Green',
91
- },
92
- {
93
- value:'yellow',
94
- label:'Color Yellow',
95
- },
96
- {
97
- value:'oarnge',
98
- label:'Color Orange',
99
- },
100
- {
101
- value:'violet',
102
- label:'Color Violet',
103
- },
104
- {
105
- value:'brown',
106
- label:'Color Brown',
107
- },
108
- {
109
- value:'black',
110
- label:'Color Black',
111
- },
112
- ]
113
-
114
- return (
115
- <>
116
- <ChoicesInput id="colors" options={optionsMap} name="color" multiple gridColumnsDesktop={2} />
117
- <FormDebugger />
118
- </>
119
- )
84
+ export const MultipleWithGrid = Template.bind({})
85
+ MultipleWithGrid.args = {
86
+ ...Base.args,
87
+ multiple :true,
88
+ gridColumnsDesktop:2,
120
89
  }
121
90
 
122
- export const ChoicesWithLabel = () => {
123
- const optionsMap = [
124
- {
125
- value:'triangle',
126
- label:'Triangle',
127
- },
128
- {
129
- value:'square',
130
- label:'Square',
131
- },
132
- {
133
- value:'rectangle',
134
- label:'Rectangle',
135
- },
136
- ]
137
-
138
- return (
139
- <>
140
- <ChoicesInput id="shapes" options={optionsMap} name="shape" label="Geometric Shapes" />
141
- <FormDebugger />
142
- </>
143
- )
91
+ export const ChoicesWithLabel = Template.bind({})
92
+ ChoicesWithLabel.args = {
93
+ ...Base.args,
94
+ label:'Select color',
144
95
  }
145
96
 
146
- export const DisabledChoicesInput = () => {
147
- const optionsMap = [
148
- {
149
- value:'triangle',
150
- label:'Triangle',
151
- },
152
- {
153
- value:'square',
154
- label:'Square',
155
- },
156
- {
157
- value:'rectangle',
158
- label:'Rectangle',
159
- },
160
- ]
161
-
162
- return (
163
- <>
164
- <ChoicesInput id="shapes" options={optionsMap} name="shape" label="Geometric Shapes" disabled />
165
- <FormDebugger />
166
- </>
167
- )
97
+ export const DisabledChoicesInput = Template.bind({})
98
+ DisabledChoicesInput.args = {
99
+ ...ChoicesWithLabel.args,
100
+ disabled:true,
168
101
  }
@@ -3,6 +3,8 @@ import * as React from 'react'
3
3
 
4
4
  import { FormDescription as Description } from 'ui'
5
5
 
6
+ import { Formik, Form } from 'formik'
7
+
6
8
  export default {
7
9
  title :'f/common/Description',
8
10
  component :Description,
@@ -10,7 +12,15 @@ export default {
10
12
  // Item:Description.Item
11
13
  },
12
14
  decorators:[
13
- // storyfn => <div className="">{ storyfn() }</div>,
15
+ (storyfn) => (
16
+ <Formik
17
+ initialValues={{ email: '' }}
18
+ >
19
+ <Form>
20
+ { storyfn() }
21
+ </Form>
22
+ </Formik>
23
+ ),
14
24
  ],
15
25
  argTypes:{
16
26
  backgroundColor:{ control: 'color' },
@@ -18,5 +28,5 @@ export default {
18
28
  }
19
29
 
20
30
  export const Base = () => (
21
- <Description>Sample Description</Description>
31
+ <Description description="Sample Description" name="email" />
22
32
  )
@@ -27,31 +27,30 @@ export default {
27
27
  },
28
28
  }
29
29
 
30
- export const Base = () => (
30
+ const Template = (args) => (
31
31
  <>
32
- <RatingsInput ratingCount={5} name="ratings" label="Your Rating" />
32
+ <RatingsInput {...args} />
33
33
  <FormDebugger />
34
34
  </>
35
35
  )
36
36
 
37
- export const Numbers = () => (
38
- <>
39
- <RatingsInput ratingCount={10} name="ratings" showRatingValue label="Your Rating" />
40
- <FormDebugger />
41
- </>
42
- )
37
+ export const Base = Template.bind({})
38
+ Base.args = {
39
+ ratingCount:5,
40
+ name :'ratings',
41
+ label :'Your Rating',
42
+ }
43
43
 
44
- export const Labels = () => (
45
- <>
46
- <RatingsInput
47
- label="Your Rating"
48
- labelMax="very satisfied."
49
- labelMin="not satisfied."
50
- ratingCount={10}
51
- name="ratings"
52
- showRatingValue
53
- displayRatingsLabel
54
- />
55
- <FormDebugger />
56
- </>
57
- )
44
+ export const Numbers = Template.bind({})
45
+ Numbers.args = {
46
+ ...Base.args,
47
+ showRatingValue:true,
48
+ }
49
+
50
+ export const Labels = Template.bind({})
51
+ Labels.args = {
52
+ ...Numbers.args,
53
+ labelMax :'very satisfied.',
54
+ labelMin :'not satisfied.',
55
+ displayRatingsLabel:true,
56
+ }