@desynova-digital/components 8.19.63 → 9.0.1
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.
- package/atoms/avatar/avatar.js +1 -1
- package/atoms/avatar/avatar.story.js +46 -14
- package/atoms/badge/badge.js +13 -13
- package/atoms/badge/badge.story.js +91 -29
- package/atoms/button/button.js +81 -85
- package/atoms/button/button.story.js +342 -2
- package/atoms/card/card.js +43 -39
- package/atoms/card/card.story.js +74 -48
- package/atoms/cardStack/cardStack.js +182 -155
- package/atoms/cardStack/cardStack.story.js +131 -18
- package/atoms/cardV2/cardV2.js +23 -23
- package/atoms/cardV2/cardV2.story.js +196 -45
- package/atoms/cardV2/content.js +109 -87
- package/atoms/cardV2/thumbnail.js +85 -72
- package/atoms/cardV2/timeline.js +119 -107
- package/atoms/checkbox/checkbox.js +41 -32
- package/atoms/checkbox/checkbox.story.js +220 -99
- package/atoms/customSelect/customSelect.story.js +820 -582
- package/atoms/datePicker/datePicker.js +77 -83
- package/atoms/datePicker/datePicker.story.js +167 -1
- package/atoms/dateTime/dateTime.story.js +26 -1
- package/atoms/draftInputText/draftInputText.js +358 -0
- package/atoms/draftInputText/draftInputText.story.js +251 -0
- package/atoms/draftInputText/index.js +13 -0
- package/atoms/dropdown/dropdown.story.js +146 -18
- package/atoms/dropdownList/dropdownList.story.js +1598 -1091
- package/atoms/graphs/barGraph/barGraph.js +143 -130
- package/atoms/graphs/barGraph/barGraph.story.js +74 -40
- package/atoms/graphs/circleDonut/circleDonut.story.js +374 -220
- package/atoms/graphs/circleGraph/circleGraph.js +84 -80
- package/atoms/graphs/circleGraph/circleGraph.story.js +38 -26
- package/atoms/graphs/circleNested/circleNested.story.js +98 -103
- package/atoms/graphs/pieChart/pieChart.story.js +160 -81
- package/atoms/graphs/verticalBarGraph/verticalBarGraph.story.js +30 -28
- package/atoms/icon/icon.story.js +220 -163
- package/atoms/inputText/inputText.js +52 -49
- package/atoms/label/label.js +29 -29
- package/atoms/label/label.story.js +42 -30
- package/atoms/loader/CircleLoader.js +13 -4
- package/atoms/loader/CircleLoader.jsx +10 -4
- package/atoms/loader/ThreeDotLoader.js +8 -4
- package/atoms/loader/ThreeDotLoader.jsx +4 -4
- package/atoms/loader/loader.js +29 -30
- package/atoms/loader/loader.story.js +38 -23
- package/atoms/loader/spinningLoader.js +7 -4
- package/atoms/loader/spinningLoader.jsx +5 -5
- package/atoms/popup/popup.js +11 -11
- package/atoms/popup/popup.story.js +36 -4
- package/atoms/radio/radio.story.js +140 -2
- package/atoms/sideBar/sidebar.js +19 -5
- package/atoms/sideBar/sidebar.jsx +13 -8
- package/atoms/switch/switch.js +72 -66
- package/atoms/switch/switch.story.js +323 -78
- package/atoms/tag/tag.js +39 -39
- package/atoms/tag/tag.story.js +83 -2
- package/atoms/textarea/textarea.js +36 -34
- package/atoms/timeCodeInput/timCodeInput.story.js +10 -9
- package/atoms/timeCodeInput/timeCodeInput.js +108 -100
- package/atoms/timer/timer.js +127 -126
- package/atoms/toast/toast.js +24 -14
- package/atoms/toast/toast.story.js +22 -0
- package/atoms/videoCard/videoCard.js +226 -203
- package/atoms/videoCard/videoCard.story.js +547 -186
- package/components.js +69 -66
- package/index.js +5 -4
- package/molecules/carousel/carousel.js +55 -67
- package/molecules/filter/filter.js +133 -106
- package/molecules/filter/filter.story.js +215 -173
- package/molecules/graphCard/graphCard.js +34 -24
- package/molecules/graphCard/graphCard.story.js +169 -82
- package/molecules/graphDetailCard/graphDetailCard.js +207 -182
- package/molecules/pageHeader/pageHeader.js +3 -2
- package/molecules/pageHeader/pageHeader.story.js +40 -18
- package/molecules/pagination/pagination.js +66 -14
- package/molecules/pagination/pagination.story.js +24 -2
- package/molecules/table/table.js +368 -316
- package/molecules/table/table.story.js +404 -208
- package/molecules/tabs/tabs.js +15 -6
- package/molecules/tabs/tabs.story.js +26 -0
- package/package.json +2 -2
|
@@ -12,7 +12,7 @@ var _components = require('../../components');
|
|
|
12
12
|
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
|
|
15
|
-
(0, _react3.storiesOf)('Button').add('
|
|
15
|
+
(0, _react3.storiesOf)('Button').add('light theme', function () {
|
|
16
16
|
return _react2.default.createElement(
|
|
17
17
|
_storyHelpers.Example,
|
|
18
18
|
{ title: 'Appearances' },
|
|
@@ -21,7 +21,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
21
21
|
null,
|
|
22
22
|
_react2.default.createElement(
|
|
23
23
|
_components.Button,
|
|
24
|
-
|
|
24
|
+
null,
|
|
25
25
|
'Button'
|
|
26
26
|
),
|
|
27
27
|
_react2.default.createElement(
|
|
@@ -169,4 +169,344 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
169
169
|
})
|
|
170
170
|
)
|
|
171
171
|
);
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
(0, _react3.storiesOf)('Button').add('dark theme', function () {
|
|
175
|
+
return _react2.default.createElement(
|
|
176
|
+
_storyHelpers.Example,
|
|
177
|
+
{ title: 'Appearances Dark', background: 'black' },
|
|
178
|
+
_react2.default.createElement(
|
|
179
|
+
_storyHelpers.Stack,
|
|
180
|
+
null,
|
|
181
|
+
_react2.default.createElement(
|
|
182
|
+
_components.Button,
|
|
183
|
+
{ theme: 'dark' },
|
|
184
|
+
'Button'
|
|
185
|
+
),
|
|
186
|
+
_react2.default.createElement(
|
|
187
|
+
_components.Button,
|
|
188
|
+
{ theme: 'dark', appearance: 'default' },
|
|
189
|
+
'Default'
|
|
190
|
+
),
|
|
191
|
+
_react2.default.createElement(
|
|
192
|
+
_components.Button,
|
|
193
|
+
{ theme: 'dark', appearance: 'primary' },
|
|
194
|
+
'Primary'
|
|
195
|
+
),
|
|
196
|
+
_react2.default.createElement(
|
|
197
|
+
_components.Button,
|
|
198
|
+
{ theme: 'dark', appearance: 'bordered' },
|
|
199
|
+
'Bordered'
|
|
200
|
+
),
|
|
201
|
+
_react2.default.createElement(
|
|
202
|
+
_components.Button,
|
|
203
|
+
{ theme: 'dark', appearance: 'cta', display: 'rounded' },
|
|
204
|
+
'CTA'
|
|
205
|
+
)
|
|
206
|
+
),
|
|
207
|
+
_react2.default.createElement(
|
|
208
|
+
_storyHelpers.Stack,
|
|
209
|
+
null,
|
|
210
|
+
_react2.default.createElement(
|
|
211
|
+
_components.Button,
|
|
212
|
+
{ theme: 'dark', display: 'rounded', isLoading: true, showLoader: true, stretchWidth: true },
|
|
213
|
+
'Button'
|
|
214
|
+
),
|
|
215
|
+
_react2.default.createElement(
|
|
216
|
+
_components.Button,
|
|
217
|
+
{ theme: 'dark', appearance: 'primary', display: 'rounded' },
|
|
218
|
+
'Primary'
|
|
219
|
+
),
|
|
220
|
+
_react2.default.createElement(
|
|
221
|
+
_components.Button,
|
|
222
|
+
{ theme: 'dark', appearance: 'bordered', display: 'rounded' },
|
|
223
|
+
'Bordered'
|
|
224
|
+
)
|
|
225
|
+
),
|
|
226
|
+
_react2.default.createElement(
|
|
227
|
+
_storyHelpers.Stack,
|
|
228
|
+
null,
|
|
229
|
+
_react2.default.createElement(
|
|
230
|
+
_components.Button,
|
|
231
|
+
{ theme: 'dark', display: 'rounded', disabled: true },
|
|
232
|
+
'Disabled'
|
|
233
|
+
),
|
|
234
|
+
_react2.default.createElement(
|
|
235
|
+
_components.Button,
|
|
236
|
+
{ theme: 'dark', appearance: 'primary', disabled: true },
|
|
237
|
+
'Disabled'
|
|
238
|
+
),
|
|
239
|
+
_react2.default.createElement(
|
|
240
|
+
_components.Button,
|
|
241
|
+
{ theme: 'dark', appearance: 'bordered', disabled: true },
|
|
242
|
+
'Disabled'
|
|
243
|
+
)
|
|
244
|
+
),
|
|
245
|
+
_react2.default.createElement(
|
|
246
|
+
_storyHelpers.Stack,
|
|
247
|
+
null,
|
|
248
|
+
_react2.default.createElement(
|
|
249
|
+
_components.Button,
|
|
250
|
+
{ theme: 'dark', appearance: 'link', display: 'rounded', href: 'https://www.google.co.in/' },
|
|
251
|
+
'Link'
|
|
252
|
+
),
|
|
253
|
+
_react2.default.createElement(
|
|
254
|
+
_components.Button,
|
|
255
|
+
{ theme: 'dark', appearance: 'link', href: 'https://www.google.co.in/' },
|
|
256
|
+
'Link'
|
|
257
|
+
),
|
|
258
|
+
_react2.default.createElement(
|
|
259
|
+
_components.Button,
|
|
260
|
+
{ theme: 'dark', appearance: 'link', href: 'https://www.google.co.in/' },
|
|
261
|
+
'Link'
|
|
262
|
+
)
|
|
263
|
+
),
|
|
264
|
+
_react2.default.createElement(
|
|
265
|
+
_storyHelpers.Stack,
|
|
266
|
+
null,
|
|
267
|
+
_react2.default.createElement(
|
|
268
|
+
_components.Button,
|
|
269
|
+
{
|
|
270
|
+
theme: 'dark',
|
|
271
|
+
display: 'rounded',
|
|
272
|
+
icon: 'arrow-right',
|
|
273
|
+
iconWidth: 20,
|
|
274
|
+
iconHeight: 14,
|
|
275
|
+
iconBackground: false
|
|
276
|
+
},
|
|
277
|
+
'Next'
|
|
278
|
+
),
|
|
279
|
+
_react2.default.createElement(
|
|
280
|
+
_components.Button,
|
|
281
|
+
{ theme: 'dark', display: 'rounded', icon: 'arrow-right', iconWidth: 20, iconHeight: 14 },
|
|
282
|
+
'Submit'
|
|
283
|
+
),
|
|
284
|
+
_react2.default.createElement(_components.Button, {
|
|
285
|
+
theme: 'dark',
|
|
286
|
+
display: 'rounded',
|
|
287
|
+
icon: 'arrow-right',
|
|
288
|
+
iconWidth: 20,
|
|
289
|
+
iconHeight: 14
|
|
290
|
+
}),
|
|
291
|
+
_react2.default.createElement(
|
|
292
|
+
_components.Button,
|
|
293
|
+
{
|
|
294
|
+
theme: 'dark',
|
|
295
|
+
appearance: 'bordered',
|
|
296
|
+
display: 'rounded',
|
|
297
|
+
iconLocation: 'left',
|
|
298
|
+
iconBackground: false,
|
|
299
|
+
iconHover: true,
|
|
300
|
+
icon: 'okta-logo',
|
|
301
|
+
iconWidth: 30,
|
|
302
|
+
iconHeight: 30
|
|
303
|
+
},
|
|
304
|
+
'Sign In with Okta'
|
|
305
|
+
),
|
|
306
|
+
_react2.default.createElement(_components.Button, { theme: 'dark', appearance: 'cta', icon: 'search', iconWidth: 16, iconHeight: 16 }),
|
|
307
|
+
_react2.default.createElement(_components.Button, {
|
|
308
|
+
theme: 'dark',
|
|
309
|
+
appearance: 'cta',
|
|
310
|
+
icon: 'search',
|
|
311
|
+
iconWidth: 16,
|
|
312
|
+
iconHeight: 16,
|
|
313
|
+
width: 40,
|
|
314
|
+
height: 40
|
|
315
|
+
}),
|
|
316
|
+
_react2.default.createElement(_components.Button, {
|
|
317
|
+
theme: 'dark',
|
|
318
|
+
key: 'storyboard',
|
|
319
|
+
display: 'rounded',
|
|
320
|
+
icon: 'storyboard',
|
|
321
|
+
width: 30,
|
|
322
|
+
appearance: 'cta',
|
|
323
|
+
height: 30,
|
|
324
|
+
iconWidth: 13,
|
|
325
|
+
iconHeight: 13
|
|
326
|
+
}),
|
|
327
|
+
_react2.default.createElement(_components.Button, {
|
|
328
|
+
theme: 'dark',
|
|
329
|
+
key: 'archive',
|
|
330
|
+
display: 'rounded',
|
|
331
|
+
icon: 'archive',
|
|
332
|
+
width: 30,
|
|
333
|
+
appearance: 'cta',
|
|
334
|
+
height: 30,
|
|
335
|
+
label: 'Archive',
|
|
336
|
+
disabled: true,
|
|
337
|
+
iconWidth: 13,
|
|
338
|
+
iconHeight: 13
|
|
339
|
+
})
|
|
340
|
+
)
|
|
341
|
+
);
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
(0, _react3.storiesOf)('Button').add('nexc theme', function () {
|
|
345
|
+
return _react2.default.createElement(
|
|
346
|
+
_storyHelpers.Example,
|
|
347
|
+
{ title: 'Appearances Dark', background: 'black' },
|
|
348
|
+
_react2.default.createElement(
|
|
349
|
+
_storyHelpers.Stack,
|
|
350
|
+
null,
|
|
351
|
+
_react2.default.createElement(
|
|
352
|
+
_components.Button,
|
|
353
|
+
{ theme: 'nexc' },
|
|
354
|
+
'Button'
|
|
355
|
+
),
|
|
356
|
+
_react2.default.createElement(
|
|
357
|
+
_components.Button,
|
|
358
|
+
{ theme: 'nexc', appearance: 'default' },
|
|
359
|
+
'Default'
|
|
360
|
+
),
|
|
361
|
+
_react2.default.createElement(
|
|
362
|
+
_components.Button,
|
|
363
|
+
{ theme: 'nexc', appearance: 'primary' },
|
|
364
|
+
'Primary'
|
|
365
|
+
),
|
|
366
|
+
_react2.default.createElement(
|
|
367
|
+
_components.Button,
|
|
368
|
+
{ theme: 'nexc', appearance: 'bordered' },
|
|
369
|
+
'Bordered'
|
|
370
|
+
),
|
|
371
|
+
_react2.default.createElement(
|
|
372
|
+
_components.Button,
|
|
373
|
+
{ theme: 'nexc', appearance: 'cta', display: 'rounded' },
|
|
374
|
+
'CTA'
|
|
375
|
+
)
|
|
376
|
+
),
|
|
377
|
+
_react2.default.createElement(
|
|
378
|
+
_storyHelpers.Stack,
|
|
379
|
+
null,
|
|
380
|
+
_react2.default.createElement(
|
|
381
|
+
_components.Button,
|
|
382
|
+
{ theme: 'nexc', display: 'rounded', isLoading: true, showLoader: true, stretchWidth: true },
|
|
383
|
+
'Button'
|
|
384
|
+
),
|
|
385
|
+
_react2.default.createElement(
|
|
386
|
+
_components.Button,
|
|
387
|
+
{ theme: 'nexc', appearance: 'primary', display: 'rounded' },
|
|
388
|
+
'Primary'
|
|
389
|
+
),
|
|
390
|
+
_react2.default.createElement(
|
|
391
|
+
_components.Button,
|
|
392
|
+
{ theme: 'nexc', appearance: 'bordered', display: 'rounded' },
|
|
393
|
+
'Bordered'
|
|
394
|
+
)
|
|
395
|
+
),
|
|
396
|
+
_react2.default.createElement(
|
|
397
|
+
_storyHelpers.Stack,
|
|
398
|
+
null,
|
|
399
|
+
_react2.default.createElement(
|
|
400
|
+
_components.Button,
|
|
401
|
+
{ theme: 'nexc', display: 'rounded', disabled: true },
|
|
402
|
+
'Disabled'
|
|
403
|
+
),
|
|
404
|
+
_react2.default.createElement(
|
|
405
|
+
_components.Button,
|
|
406
|
+
{ theme: 'nexc', appearance: 'primary', disabled: true },
|
|
407
|
+
'Disabled'
|
|
408
|
+
),
|
|
409
|
+
_react2.default.createElement(
|
|
410
|
+
_components.Button,
|
|
411
|
+
{ theme: 'nexc', appearance: 'bordered', disabled: true },
|
|
412
|
+
'Disabled'
|
|
413
|
+
)
|
|
414
|
+
),
|
|
415
|
+
_react2.default.createElement(
|
|
416
|
+
_storyHelpers.Stack,
|
|
417
|
+
null,
|
|
418
|
+
_react2.default.createElement(
|
|
419
|
+
_components.Button,
|
|
420
|
+
{ theme: 'nexc', appearance: 'link', display: 'rounded', href: 'https://www.google.co.in/' },
|
|
421
|
+
'Link'
|
|
422
|
+
),
|
|
423
|
+
_react2.default.createElement(
|
|
424
|
+
_components.Button,
|
|
425
|
+
{ theme: 'nexc', appearance: 'link', href: 'https://www.google.co.in/' },
|
|
426
|
+
'Link'
|
|
427
|
+
),
|
|
428
|
+
_react2.default.createElement(
|
|
429
|
+
_components.Button,
|
|
430
|
+
{ theme: 'nexc', appearance: 'link', href: 'https://www.google.co.in/' },
|
|
431
|
+
'Link'
|
|
432
|
+
)
|
|
433
|
+
),
|
|
434
|
+
_react2.default.createElement(
|
|
435
|
+
_storyHelpers.Stack,
|
|
436
|
+
null,
|
|
437
|
+
_react2.default.createElement(
|
|
438
|
+
_components.Button,
|
|
439
|
+
{
|
|
440
|
+
theme: 'nexc',
|
|
441
|
+
display: 'rounded',
|
|
442
|
+
icon: 'arrow-right',
|
|
443
|
+
iconWidth: 20,
|
|
444
|
+
iconHeight: 14,
|
|
445
|
+
iconBackground: false
|
|
446
|
+
},
|
|
447
|
+
'Next'
|
|
448
|
+
),
|
|
449
|
+
_react2.default.createElement(
|
|
450
|
+
_components.Button,
|
|
451
|
+
{ theme: 'nexc', display: 'rounded', icon: 'arrow-right', iconWidth: 20, iconHeight: 14 },
|
|
452
|
+
'Submit'
|
|
453
|
+
),
|
|
454
|
+
_react2.default.createElement(_components.Button, {
|
|
455
|
+
theme: 'nexc',
|
|
456
|
+
display: 'rounded',
|
|
457
|
+
icon: 'arrow-right',
|
|
458
|
+
iconWidth: 20,
|
|
459
|
+
iconHeight: 14
|
|
460
|
+
}),
|
|
461
|
+
_react2.default.createElement(
|
|
462
|
+
_components.Button,
|
|
463
|
+
{
|
|
464
|
+
theme: 'nexc',
|
|
465
|
+
appearance: 'bordered',
|
|
466
|
+
display: 'rounded',
|
|
467
|
+
iconLocation: 'left',
|
|
468
|
+
iconBackground: false,
|
|
469
|
+
iconHover: true,
|
|
470
|
+
icon: 'okta-logo',
|
|
471
|
+
iconWidth: 30,
|
|
472
|
+
iconHeight: 30
|
|
473
|
+
},
|
|
474
|
+
'Sign In with Okta'
|
|
475
|
+
),
|
|
476
|
+
_react2.default.createElement(_components.Button, { theme: 'nexc', appearance: 'cta', icon: 'search', iconWidth: 16, iconHeight: 16 }),
|
|
477
|
+
_react2.default.createElement(_components.Button, {
|
|
478
|
+
theme: 'nexc',
|
|
479
|
+
appearance: 'cta',
|
|
480
|
+
icon: 'search',
|
|
481
|
+
iconWidth: 16,
|
|
482
|
+
iconHeight: 16,
|
|
483
|
+
width: 40,
|
|
484
|
+
height: 40
|
|
485
|
+
}),
|
|
486
|
+
_react2.default.createElement(_components.Button, {
|
|
487
|
+
theme: 'nexc',
|
|
488
|
+
key: 'storyboard',
|
|
489
|
+
display: 'rounded',
|
|
490
|
+
icon: 'storyboard',
|
|
491
|
+
width: 30,
|
|
492
|
+
appearance: 'cta',
|
|
493
|
+
height: 30,
|
|
494
|
+
iconWidth: 13,
|
|
495
|
+
iconHeight: 13
|
|
496
|
+
}),
|
|
497
|
+
_react2.default.createElement(_components.Button, {
|
|
498
|
+
theme: 'nexc',
|
|
499
|
+
key: 'archive',
|
|
500
|
+
display: 'rounded',
|
|
501
|
+
icon: 'archive',
|
|
502
|
+
width: 30,
|
|
503
|
+
appearance: 'cta',
|
|
504
|
+
height: 30,
|
|
505
|
+
label: 'Archive',
|
|
506
|
+
disabled: true,
|
|
507
|
+
iconWidth: 13,
|
|
508
|
+
iconHeight: 13
|
|
509
|
+
})
|
|
510
|
+
)
|
|
511
|
+
);
|
|
172
512
|
});
|
package/atoms/card/card.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
4
|
+
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.StyledCard = undefined;
|
|
7
7
|
|
|
8
|
-
var _templateObject = _taggedTemplateLiteral(['\n font-family: \'SFUIText-Medium\';\n width:100%;\n background: ', ' ; \n border-radius: ', ';\n\n height: ', ';\n'], ['\n font-family: \'SFUIText-Medium\';\n width:100%;\n background: ', ' ; \n border-radius: ', ';\n\n height: ', ';\n']),
|
|
9
|
-
_templateObject2 = _taggedTemplateLiteral(['\n
|
|
8
|
+
var _templateObject = _taggedTemplateLiteral(['\n font-family: \'SFUIText-Medium\';\n width:100%;\n background: ', ' ; \n border-radius: ', ';\n\n height: ', ';\n color ', '\n'], ['\n font-family: \'SFUIText-Medium\';\n width:100%;\n background: ', ' ; \n border-radius: ', ';\n\n height: ', ';\n color ', '\n']),
|
|
9
|
+
_templateObject2 = _taggedTemplateLiteral(['\n display: inline-block;\n vertical-align: top;\n padding-top: ', ';\n padding-bottom: ', ';\n padding-left: ', ';\n padding-right: ', ';\n\n width: ', ';\n\n ', '\n'], ['\n display: inline-block;\n vertical-align: top;\n padding-top: ', ';\n padding-bottom: ', ';\n padding-left: ', ';\n padding-right: ', ';\n\n width: ', ';\n\n ', '\n']);
|
|
10
10
|
|
|
11
11
|
var _react = require('react');
|
|
12
12
|
|
|
@@ -27,61 +27,65 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
27
27
|
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
28
28
|
|
|
29
29
|
var StyledCard = _styledComponents2.default.div(_templateObject, function (props) {
|
|
30
|
-
|
|
30
|
+
return _tokens.colors[props.theme].card.background;
|
|
31
31
|
}, function (props) {
|
|
32
|
-
|
|
32
|
+
return props.radius + 'px';
|
|
33
33
|
}, function (props) {
|
|
34
|
-
|
|
34
|
+
return props.height + 'px';
|
|
35
|
+
}, function (props) {
|
|
36
|
+
if (props.theme == 'dark') return _tokens.colors.light.card.background;else {
|
|
37
|
+
return _tokens.colors.dark.card.background;
|
|
38
|
+
}
|
|
35
39
|
});
|
|
36
40
|
|
|
37
41
|
var StyledCardBox = _styledComponents2.default.div(_templateObject2, function (props) {
|
|
38
|
-
|
|
42
|
+
return props.paddingTop ? props.paddingTop + 'px' : props.paddingTopBottom ? props.paddingTopBottom + 'px' : '';
|
|
39
43
|
}, function (props) {
|
|
40
|
-
|
|
44
|
+
return props.paddingBottom ? props.paddingBottom + 'px' : props.paddingTopBottom ? props.paddingTopBottom + 'px' : '';
|
|
41
45
|
}, function (props) {
|
|
42
|
-
|
|
46
|
+
return props.paddingLeft ? props.paddingLeft + 'px' : props.paddingLeftRight ? props.paddingLeftRight + 'px' : '';
|
|
43
47
|
}, function (props) {
|
|
44
|
-
|
|
48
|
+
return props.paddingRight ? props.paddingRight + 'px' : props.paddingLeftRight ? props.paddingLeftRight + 'px' : '';
|
|
45
49
|
}, function (props) {
|
|
46
|
-
|
|
50
|
+
return props.width && (props.width + '').split('%').length == 2 ? props.width : props.width + 'px';
|
|
47
51
|
}, function (props) {
|
|
48
|
-
|
|
52
|
+
return props.padding ? 'padding:' + props.padding + 'px' : '';
|
|
49
53
|
});
|
|
50
54
|
|
|
51
55
|
var Card = function Card(props) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
56
|
+
return _react2.default.createElement(
|
|
57
|
+
StyledCardBox,
|
|
58
|
+
{
|
|
59
|
+
paddingTopBottom: props.paddingTopBottom,
|
|
60
|
+
paddingTop: props.paddingTop,
|
|
61
|
+
paddingBottom: props.paddingBottom,
|
|
62
|
+
paddingLeftRight: props.paddingLeftRight,
|
|
63
|
+
paddingLeft: props.paddingLeft,
|
|
64
|
+
paddingRight: props.paddingRight,
|
|
65
|
+
width: props.width,
|
|
66
|
+
className: 'card-box'
|
|
67
|
+
},
|
|
68
|
+
_react2.default.createElement(
|
|
69
|
+
StyledCard,
|
|
70
|
+
props,
|
|
71
|
+
props.children
|
|
72
|
+
)
|
|
73
|
+
);
|
|
70
74
|
};
|
|
71
75
|
|
|
72
76
|
Card.propTypes = {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
/** The visual style used to convey the label's purpose */
|
|
78
|
+
theme: _propTypes2.default.oneOf(['light', 'dark', 'nexc']),
|
|
79
|
+
width: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
|
|
80
|
+
height: _propTypes2.default.number,
|
|
81
|
+
radius: _propTypes2.default.number
|
|
78
82
|
};
|
|
79
83
|
|
|
80
84
|
Card.defaultProps = {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
theme: 'light',
|
|
86
|
+
width: 100,
|
|
87
|
+
height: 100,
|
|
88
|
+
radius: 0
|
|
85
89
|
};
|
|
86
90
|
|
|
87
91
|
exports.default = Card;
|
package/atoms/card/card.story.js
CHANGED
|
@@ -12,54 +12,80 @@ var _components = require('../../components');
|
|
|
12
12
|
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
|
|
15
|
-
(0, _react3.storiesOf)('Card').add('
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
15
|
+
(0, _react3.storiesOf)('Card').add('light theme', function () {
|
|
16
|
+
return _react2.default.createElement(
|
|
17
|
+
_storyHelpers.Example,
|
|
18
|
+
{ title: 'Appearances Light', background: 'default' },
|
|
19
|
+
_react2.default.createElement(
|
|
20
|
+
_storyHelpers.Stack,
|
|
21
|
+
null,
|
|
22
|
+
_react2.default.createElement(
|
|
23
|
+
_components.Card,
|
|
24
|
+
null,
|
|
25
|
+
'Light Theme'
|
|
26
|
+
),
|
|
27
|
+
_react2.default.createElement(
|
|
28
|
+
_components.Card,
|
|
29
|
+
{ width: '100%', radius: 5 },
|
|
30
|
+
'Radius Light Theme'
|
|
31
|
+
),
|
|
32
|
+
_react2.default.createElement(
|
|
33
|
+
_components.Card,
|
|
34
|
+
null,
|
|
35
|
+
'Dark Theme'
|
|
36
|
+
)
|
|
37
|
+
)
|
|
38
|
+
);
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
(0, _react3.storiesOf)('Card').add('
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
41
|
+
(0, _react3.storiesOf)('Card').add('dark theme', function () {
|
|
42
|
+
return _react2.default.createElement(
|
|
43
|
+
_storyHelpers.Example,
|
|
44
|
+
{ title: 'Appearances Dark', background: 'black' },
|
|
45
|
+
_react2.default.createElement(
|
|
46
|
+
_storyHelpers.Stack,
|
|
47
|
+
null,
|
|
48
|
+
_react2.default.createElement(
|
|
49
|
+
_components.Card,
|
|
50
|
+
{ theme: 'dark' },
|
|
51
|
+
'Light Theme'
|
|
52
|
+
),
|
|
53
|
+
_react2.default.createElement(
|
|
54
|
+
_components.Card,
|
|
55
|
+
{ theme: 'dark', radius: 5 },
|
|
56
|
+
'Radius Light Theme'
|
|
57
|
+
),
|
|
58
|
+
_react2.default.createElement(
|
|
59
|
+
_components.Card,
|
|
60
|
+
{ theme: 'dark' },
|
|
61
|
+
'Dark Theme'
|
|
62
|
+
)
|
|
63
|
+
)
|
|
64
|
+
);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
(0, _react3.storiesOf)('Card').add('nexc theme', function () {
|
|
68
|
+
return _react2.default.createElement(
|
|
69
|
+
_storyHelpers.Example,
|
|
70
|
+
{ title: 'Appearances Dark', background: 'black' },
|
|
71
|
+
_react2.default.createElement(
|
|
72
|
+
_storyHelpers.Stack,
|
|
73
|
+
null,
|
|
74
|
+
_react2.default.createElement(
|
|
75
|
+
_components.Card,
|
|
76
|
+
{ theme: 'nexc' },
|
|
77
|
+
'Light Theme'
|
|
78
|
+
),
|
|
79
|
+
_react2.default.createElement(
|
|
80
|
+
_components.Card,
|
|
81
|
+
{ theme: 'nexc', radius: 5 },
|
|
82
|
+
'Radius Light Theme'
|
|
83
|
+
),
|
|
84
|
+
_react2.default.createElement(
|
|
85
|
+
_components.Card,
|
|
86
|
+
{ theme: 'nexc' },
|
|
87
|
+
'Dark Theme'
|
|
88
|
+
)
|
|
89
|
+
)
|
|
90
|
+
);
|
|
65
91
|
});
|