@@ -2,6 +2,8 @@ import React from 'react';
2
2
// eslint-disable-next-line import/no-extraneous-dependencies
3
3
import { storiesOf } from '@storybook/react' ;
4
4
// eslint-disable-next-line import/no-extraneous-dependencies
5
+ import figmaDecorator from 'storybook-addon-figma' ;
6
+ // eslint-disable-next-line import/no-extraneous-dependencies
5
7
import { action } from '@storybook/addon-actions' ;
6
8
// eslint-disable-next-line import/no-extraneous-dependencies
7
9
import { boolean , number , object , text } from '@storybook/addon-knobs/react' ;
@@ -41,13 +43,20 @@ const item = i => {
41
43
} ;
42
44
} ;
43
45
44
- storiesOf ( 'Widgets/BooleanCheckbox' , module ) . addWithJSX ( 'Default' , ( ) => (
45
- < BooleanCheckbox
46
- fieldName = "ControlOne"
47
- label = { text ( 'BooleanCheckbox: label' , 'CheckBox' ) }
48
- onChange = { onChangeAction }
49
- />
50
- ) ) ;
46
+ storiesOf ( 'Widgets/BooleanCheckbox' , module )
47
+ . addDecorator (
48
+ figmaDecorator ( {
49
+ url :
50
+ 'https://www.figma.com/file/OqWgzAluHtsOd5uwm1lubFeH/Drupal-Design-system?node-id=2061%3A2386' ,
51
+ } ) ,
52
+ )
53
+ . addWithJSX ( 'Default' , ( ) => (
54
+ < BooleanCheckbox
55
+ fieldName = "ControlOne"
56
+ label = { text ( 'BooleanCheckbox: label' , 'CheckBox' ) }
57
+ onChange = { onChangeAction }
58
+ />
59
+ ) ) ;
51
60
52
61
storiesOf ( 'Widgets/DatetimeTimestamp' , module ) . addWithJSX ( 'Default' , ( ) => (
53
62
< DatetimeTimestamp
@@ -190,46 +199,68 @@ storiesOf('Widgets/NumberTextfield', module).addWithJSX('Default', () => (
190
199
/>
191
200
) ) ;
192
201
193
- storiesOf ( 'Widgets/OptionsSelect' , module ) . addWithJSX ( 'Default' , ( ) => (
194
- < OptionsSelect
195
- helpText = { text ( 'OptionsSelect:helpText' , 'Help text.' ) }
196
- fieldName = "option"
197
- inputProps = { object ( 'OptionsSelect:inputProps' , {
198
- allowed_values : {
199
- one : 'One' ,
200
- two : 'Two' ,
201
- three : 'Three' ,
202
- four : 'Four' ,
203
- } ,
204
- allowed_values_function : '' ,
205
- } ) }
206
- label = { text ( 'OptionsSelect:label' , 'A Simple Label' ) }
207
- onChange = { onChangeAction }
208
- schema = { object ( 'OptionsSelect: schema' , {
209
- enum : [ 'One' , 'Two' , 'Three' , 'Four' ] ,
210
- default : 'Two' ,
211
- } ) }
212
- value = { text ( 'OptionsSelect: value' , 'Entered text.' ) }
213
- />
214
- ) ) ;
215
- storiesOf ( 'Widgets/StringTextfield' , module ) . addWithJSX ( 'Default' , ( ) => (
216
- < StringTextfield
217
- fieldName = "userBio"
218
- label = { text ( 'StringTextfield: label' , 'A Simple Label' ) }
219
- onChange = { onChangeAction }
220
- value = { text ( 'StringTextfield: value' , 'Entered text.' ) }
221
- />
222
- ) ) ;
202
+ storiesOf ( 'Widgets/OptionsSelect' , module )
203
+ . addDecorator (
204
+ figmaDecorator ( {
205
+ url :
206
+ 'https://www.figma.com/file/OqWgzAluHtsOd5uwm1lubFeH/Drupal-Design-system?node-id=2061%3A1971' ,
207
+ } ) ,
208
+ )
209
+ . addWithJSX ( 'Default' , ( ) => (
210
+ < OptionsSelect
211
+ helpText = { text ( 'OptionsSelect:helpText' , 'Help text.' ) }
212
+ fieldName = "option"
213
+ inputProps = { object ( 'OptionsSelect:inputProps' , {
214
+ allowed_values : {
215
+ one : 'One' ,
216
+ two : 'Two' ,
217
+ three : 'Three' ,
218
+ four : 'Four' ,
219
+ } ,
220
+ allowed_values_function : '' ,
221
+ } ) }
222
+ label = { text ( 'OptionsSelect:label' , 'A Simple Label' ) }
223
+ onChange = { onChangeAction }
224
+ schema = { object ( 'OptionsSelect: schema' , {
225
+ enum : [ 'One' , 'Two' , 'Three' , 'Four' ] ,
226
+ default : 'Two' ,
227
+ } ) }
228
+ value = { text ( 'OptionsSelect: value' , 'Entered text.' ) }
229
+ />
230
+ ) ) ;
223
231
224
- storiesOf ( 'Widgets/TextTextarea' , module ) . addWithJSX ( 'Default' , ( ) => (
225
- < TextTextarea
226
- fieldName = "SummaryText"
227
- label = { text ( 'TextTextarea: label' , 'A Simple wysiwyg editor' ) }
228
- name = "summaryText"
229
- onChange = { onChangeAction }
230
- value = { object ( 'TextTextarea: value' , {
231
- value :
232
- 'Lorem ipsum dolor sit amet, <b>consectetur adipiscing elit</b>, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.' ,
233
- } ) }
234
- />
235
- ) ) ;
232
+ storiesOf ( 'Widgets/StringTextfield' , module )
233
+ . addDecorator (
234
+ figmaDecorator ( {
235
+ url :
236
+ 'https://www.figma.com/file/OqWgzAluHtsOd5uwm1lubFeH/Drupal-Design-system?node-id=2057%3A1349' ,
237
+ } ) ,
238
+ )
239
+ . addWithJSX ( 'Default' , ( ) => (
240
+ < StringTextfield
241
+ fieldName = "userBio"
242
+ label = { text ( 'StringTextfield: label' , 'A Simple Label' ) }
243
+ onChange = { onChangeAction }
244
+ value = { text ( 'StringTextfield: value' , 'Entered text.' ) }
245
+ />
246
+ ) ) ;
247
+
248
+ storiesOf ( 'Widgets/TextTextarea' , module )
249
+ . addDecorator (
250
+ figmaDecorator ( {
251
+ url :
252
+ 'https://www.figma.com/file/OqWgzAluHtsOd5uwm1lubFeH/Drupal-Design-system?node-id=2061%3A1805' ,
253
+ } ) ,
254
+ )
255
+ . addWithJSX ( 'Default' , ( ) => (
256
+ < TextTextarea
257
+ fieldName = "SummaryText"
258
+ label = { text ( 'TextTextarea: label' , 'A Simple wysiwyg editor' ) }
259
+ name = "summaryText"
260
+ onChange = { onChangeAction }
261
+ value = { object ( 'TextTextarea: value' , {
262
+ value :
263
+ 'Lorem ipsum dolor sit amet, <b>consectetur adipiscing elit</b>, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.' ,
264
+ } ) }
265
+ />
266
+ ) ) ;
0 commit comments