@pingux/astro 2.143.0-alpha.0 → 2.143.0-alpha.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/lib/cjs/components/AccordionGridGroup/AccordionGrid.styles.js +1 -2
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.stories.js +86 -5
- package/lib/cjs/components/AccordionGridItem/AccordionGridItemHeader.js +7 -5
- package/lib/cjs/components/AccordionGroup/AccordionGroup.js +5 -3
- package/lib/cjs/components/AccordionGroup/AccordionGroup.stories.js +3 -6
- package/lib/cjs/components/AccordionItem/AccordionItem.js +8 -4
- package/lib/cjs/components/AstroProvider/AstroProvider.js +3 -3
- package/lib/cjs/components/Breadcrumbs/Breadcrumbs.js +6 -2
- package/lib/cjs/components/Button/Button.stories.js +6 -3
- package/lib/cjs/components/Button/Buttons.styles.d.ts +40 -0
- package/lib/cjs/components/Button/Buttons.styles.js +2 -0
- package/lib/cjs/components/CollapsiblePanel/CollapsiblePanel.stories.js +5 -1
- package/lib/cjs/components/CopyText/CopyButton.js +4 -1
- package/lib/cjs/components/CopyText/CopyText.js +2 -1
- package/lib/cjs/components/GridList/GridList.stories.js +0 -1
- package/lib/cjs/components/Icon/Icon.js +2 -1
- package/lib/cjs/components/Icon/Icon.stories.js +1 -1
- package/lib/cjs/components/IconBadge/IconBadge.js +4 -4
- package/lib/cjs/components/IconBadge/IconBadge.stories.js +2 -2
- package/lib/cjs/components/Input/Input.styles.js +3 -0
- package/lib/cjs/components/ListView/ListView.stories.js +27 -10
- package/lib/cjs/components/ListView/ListViewItem.js +1 -1
- package/lib/cjs/components/Loader/Loader.js +71 -5
- package/lib/cjs/components/Loader/Loader.stories.js +17 -2
- package/lib/cjs/components/Loader/Loader.styles.d.ts +7 -0
- package/lib/cjs/components/Loader/Loader.styles.js +11 -1
- package/lib/cjs/components/MultivaluesField/CondensedMultivaluesField.js +6 -4
- package/lib/cjs/components/MultivaluesField/DefaultMultivaluesField.js +26 -15
- package/lib/cjs/components/PageHeader/PageHeader.js +5 -2
- package/lib/cjs/components/PanelHeader/PanelHeader.js +43 -10
- package/lib/cjs/components/PanelHeader/PanelHeader.stories.js +9 -4
- package/lib/cjs/components/PanelHeader/PanelHeader.styles.js +5 -0
- package/lib/cjs/components/PanelHeader/PanelHeader.test.js +22 -0
- package/lib/cjs/components/RequirementsList/RequirementsList.js +11 -8
- package/lib/cjs/components/Stepper/Step.js +1 -1
- package/lib/cjs/components/Stepper/Stepper.styles.js +1 -0
- package/lib/cjs/components/Switch/Switch.js +12 -2
- package/lib/cjs/components/Switch/Switch.styles.js +1 -1
- package/lib/cjs/components/SwitchField/SwitchField.js +7 -2
- package/lib/cjs/components/Tabs/Tabs.stories.js +23 -7
- package/lib/cjs/components/Text/Text.stories.d.ts +1 -0
- package/lib/cjs/components/Text/Text.stories.js +354 -1
- package/lib/cjs/components/Text/Text.styles.d.ts +10 -0
- package/lib/cjs/components/Text/Text.styles.js +5 -0
- package/lib/cjs/components/TextField/TextField.stories.js +12 -2
- package/lib/cjs/hooks/useCircularLoader/useCircularLoader.d.ts +23 -0
- package/lib/cjs/hooks/useCircularLoader/useCircularLoader.js +80 -0
- package/lib/cjs/hooks/useCircularLoader/useCircularLoader.test.d.ts +1 -0
- package/lib/cjs/hooks/useCircularLoader/useCircularLoader.test.js +136 -0
- package/lib/cjs/hooks/useField/useField.d.ts +6 -6
- package/lib/cjs/hooks/useGetTheme/useGetTheme.d.ts +75 -0
- package/lib/cjs/hooks/usePagination/usePagination.d.ts +4 -4
- package/lib/cjs/styles/colors.d.ts +6 -0
- package/lib/cjs/styles/colors.js +4 -1
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/colors.d.ts +36 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/colors.js +23 -2
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/customProperties/icons.d.ts +5 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/customProperties/index.d.ts +17 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/customProperties/index.js +7 -1
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/buttons.d.ts +66 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/buttons.js +18 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/forms.d.ts +15 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/forms.js +18 -1
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/input.d.ts +0 -8
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/input.js +9 -9
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/links.d.ts +14 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/links.js +15 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.d.ts +5 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.js +5 -0
- package/lib/cjs/styles/themes/astro/customProperties/icons.d.ts +5 -0
- package/lib/cjs/styles/themes/astro/customProperties/icons.js +11 -4
- package/lib/cjs/styles/themes/astro/customProperties/index.d.ts +18 -0
- package/lib/cjs/styles/themes/astro/customProperties/index.js +26 -1
- package/lib/cjs/styles/themes/next-gen/codeView/codeView.d.ts +2 -0
- package/lib/cjs/styles/themes/next-gen/codeView/codeView.js +4 -2
- package/lib/cjs/styles/themes/next-gen/colors/colors.d.ts +37 -0
- package/lib/cjs/styles/themes/next-gen/colors/colors.js +5 -2
- package/lib/cjs/styles/themes/next-gen/colors/iconWrapper.js +14 -35
- package/lib/cjs/styles/themes/next-gen/colors/twoTone.d.ts +37 -0
- package/lib/cjs/styles/themes/next-gen/colors/twoTone.js +46 -0
- package/lib/cjs/styles/themes/next-gen/convertedComponentList.d.ts +4 -1
- package/lib/cjs/styles/themes/next-gen/convertedComponentList.js +6 -3
- package/lib/cjs/styles/themes/next-gen/customProperties/customSizes.d.ts +10 -0
- package/lib/cjs/styles/themes/next-gen/customProperties/customSizes.js +22 -0
- package/lib/cjs/styles/themes/next-gen/customProperties/icons.d.ts +5 -0
- package/lib/cjs/styles/themes/next-gen/customProperties/icons.js +10 -3
- package/lib/cjs/styles/themes/next-gen/customProperties/index.d.ts +17 -0
- package/lib/cjs/styles/themes/next-gen/customProperties/index.js +26 -4
- package/lib/cjs/styles/themes/next-gen/customProperties/tShirtSizes.js +4 -4
- package/lib/cjs/styles/themes/next-gen/forms.d.ts +42 -0
- package/lib/cjs/styles/themes/next-gen/forms.js +5 -0
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +1151 -857
- package/lib/cjs/styles/themes/next-gen/next-gen.js +1 -1
- package/lib/cjs/styles/themes/next-gen/text.js +2 -2
- package/lib/cjs/styles/themes/next-gen/variants/accordion.d.ts +16 -0
- package/lib/cjs/styles/themes/next-gen/variants/accordion.js +26 -0
- package/lib/cjs/styles/themes/next-gen/variants/badges.d.ts +0 -17
- package/lib/cjs/styles/themes/next-gen/variants/badges.js +1 -3
- package/lib/cjs/styles/themes/next-gen/variants/button.d.ts +151 -105
- package/lib/cjs/styles/themes/next-gen/variants/button.js +38 -7
- package/lib/cjs/styles/themes/next-gen/variants/cards.js +1 -1
- package/lib/cjs/styles/themes/next-gen/variants/input.js +16 -5
- package/lib/cjs/styles/themes/next-gen/variants/label.js +5 -3
- package/lib/cjs/styles/themes/next-gen/variants/links.d.ts +4 -2
- package/lib/cjs/styles/themes/next-gen/variants/listview.js +1 -1
- package/lib/cjs/styles/themes/next-gen/variants/panelHeader.d.ts +16 -0
- package/lib/cjs/styles/themes/next-gen/variants/panelHeader.js +26 -0
- package/lib/cjs/styles/themes/next-gen/variants/stepper.d.ts +66 -0
- package/lib/cjs/styles/themes/next-gen/variants/stepper.js +74 -0
- package/lib/cjs/styles/themes/next-gen/variants/switch.d.ts +36 -0
- package/lib/cjs/styles/themes/next-gen/variants/switch.js +44 -0
- package/lib/cjs/styles/themes/next-gen/variants/text.d.ts +62 -0
- package/lib/cjs/styles/themes/next-gen/variants/text.js +67 -7
- package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +900 -743
- package/lib/cjs/styles/themes/next-gen/variants/variants.js +88 -38
- package/lib/cjs/types/loader.d.ts +5 -2
- package/lib/cjs/types/shared/style.d.ts +2 -0
- package/lib/components/AccordionGridGroup/AccordionGrid.styles.js +1 -2
- package/lib/components/AccordionGridGroup/AccordionGridGroup.stories.js +86 -5
- package/lib/components/AccordionGridItem/AccordionGridItemHeader.js +6 -4
- package/lib/components/AccordionGroup/AccordionGroup.js +5 -3
- package/lib/components/AccordionGroup/AccordionGroup.stories.js +3 -6
- package/lib/components/AccordionItem/AccordionItem.js +8 -4
- package/lib/components/AstroProvider/AstroProvider.js +3 -3
- package/lib/components/Breadcrumbs/Breadcrumbs.js +7 -3
- package/lib/components/Button/Button.stories.js +4 -1
- package/lib/components/Button/Buttons.styles.js +2 -0
- package/lib/components/CollapsiblePanel/CollapsiblePanel.stories.js +5 -1
- package/lib/components/CopyText/CopyButton.js +4 -1
- package/lib/components/CopyText/CopyText.js +2 -1
- package/lib/components/GridList/GridList.stories.js +0 -1
- package/lib/components/Icon/Icon.js +2 -1
- package/lib/components/Icon/Icon.stories.js +1 -1
- package/lib/components/IconBadge/IconBadge.js +4 -4
- package/lib/components/IconBadge/IconBadge.stories.js +2 -2
- package/lib/components/Input/Input.styles.js +3 -0
- package/lib/components/ListView/ListView.stories.js +28 -11
- package/lib/components/ListView/ListViewItem.js +1 -1
- package/lib/components/Loader/Loader.js +71 -3
- package/lib/components/Loader/Loader.stories.js +13 -0
- package/lib/components/Loader/Loader.styles.js +11 -1
- package/lib/components/MultivaluesField/CondensedMultivaluesField.js +6 -4
- package/lib/components/MultivaluesField/DefaultMultivaluesField.js +27 -16
- package/lib/components/PageHeader/PageHeader.js +5 -2
- package/lib/components/PanelHeader/PanelHeader.js +44 -11
- package/lib/components/PanelHeader/PanelHeader.stories.js +9 -4
- package/lib/components/PanelHeader/PanelHeader.styles.js +5 -0
- package/lib/components/PanelHeader/PanelHeader.test.js +23 -1
- package/lib/components/RequirementsList/RequirementsList.js +7 -4
- package/lib/components/Stepper/Step.js +1 -1
- package/lib/components/Stepper/Stepper.styles.js +1 -0
- package/lib/components/Switch/Switch.js +12 -2
- package/lib/components/Switch/Switch.styles.js +1 -1
- package/lib/components/SwitchField/SwitchField.js +7 -2
- package/lib/components/Tabs/Tabs.stories.js +23 -7
- package/lib/components/Text/Text.stories.js +352 -0
- package/lib/components/Text/Text.styles.js +5 -0
- package/lib/components/TextField/TextField.stories.js +12 -2
- package/lib/hooks/useCircularLoader/useCircularLoader.js +71 -0
- package/lib/hooks/useCircularLoader/useCircularLoader.test.js +129 -0
- package/lib/styles/colors.js +4 -1
- package/lib/styles/themeOverrides/nextGenDarkMode/colors.js +23 -2
- package/lib/styles/themeOverrides/nextGenDarkMode/customProperties/index.js +7 -1
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/buttons.js +18 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/forms.js +18 -1
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/input.js +9 -9
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/links.js +15 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/variants.js +5 -0
- package/lib/styles/themes/astro/customProperties/icons.js +12 -5
- package/lib/styles/themes/astro/customProperties/index.js +26 -1
- package/lib/styles/themes/next-gen/codeView/codeView.js +4 -2
- package/lib/styles/themes/next-gen/colors/colors.js +5 -2
- package/lib/styles/themes/next-gen/colors/iconWrapper.js +14 -35
- package/lib/styles/themes/next-gen/colors/twoTone.js +38 -0
- package/lib/styles/themes/next-gen/convertedComponentList.js +6 -3
- package/lib/styles/themes/next-gen/customProperties/customSizes.js +14 -0
- package/lib/styles/themes/next-gen/customProperties/icons.js +10 -3
- package/lib/styles/themes/next-gen/customProperties/index.js +26 -2
- package/lib/styles/themes/next-gen/customProperties/tShirtSizes.js +4 -4
- package/lib/styles/themes/next-gen/forms.js +5 -0
- package/lib/styles/themes/next-gen/next-gen.js +1 -1
- package/lib/styles/themes/next-gen/text.js +2 -2
- package/lib/styles/themes/next-gen/variants/accordion.js +18 -0
- package/lib/styles/themes/next-gen/variants/badges.js +1 -3
- package/lib/styles/themes/next-gen/variants/button.js +38 -7
- package/lib/styles/themes/next-gen/variants/cards.js +1 -1
- package/lib/styles/themes/next-gen/variants/input.js +16 -5
- package/lib/styles/themes/next-gen/variants/label.js +5 -3
- package/lib/styles/themes/next-gen/variants/listview.js +1 -1
- package/lib/styles/themes/next-gen/variants/panelHeader.js +18 -0
- package/lib/styles/themes/next-gen/variants/stepper.js +66 -0
- package/lib/styles/themes/next-gen/variants/switch.js +36 -0
- package/lib/styles/themes/next-gen/variants/text.js +67 -7
- package/lib/styles/themes/next-gen/variants/variants.js +82 -37
- package/package.json +1 -1
@@ -419,6 +419,358 @@ export var Default = function Default() {
|
|
419
419
|
});
|
420
420
|
}))));
|
421
421
|
};
|
422
|
+
export var Onyx = function Onyx() {
|
423
|
+
var _context7, _context8, _context9, _context10, _context11, _context12;
|
424
|
+
var fontSizesOnyx = {
|
425
|
+
xxx: '33.8px (xxx)',
|
426
|
+
xl: '22.5px (xl)',
|
427
|
+
lg: '18.8px (lg)',
|
428
|
+
md: '15px (md)',
|
429
|
+
sm: '12px (sm)',
|
430
|
+
xs: '11px (xs)',
|
431
|
+
h2: '26.3px (h2)'
|
432
|
+
};
|
433
|
+
var fontWeightsOnyx = {
|
434
|
+
'-1': '300 (-1)',
|
435
|
+
'0': '400 (0)',
|
436
|
+
'1': '500 (1)',
|
437
|
+
'2': '600 (2)',
|
438
|
+
'3': '700 (3)'
|
439
|
+
};
|
440
|
+
var headingVariants = {
|
441
|
+
H1: {
|
442
|
+
weight: fontWeightsOnyx[2],
|
443
|
+
fontSize: fontSizesOnyx.xxx,
|
444
|
+
example: ___EmotionJSX(Text, {
|
445
|
+
variant: "H1",
|
446
|
+
as: "h1"
|
447
|
+
}, '<Text variant="H1" as="H1"/>')
|
448
|
+
},
|
449
|
+
H2: {
|
450
|
+
weight: fontWeightsOnyx[2],
|
451
|
+
fontSize: fontSizesOnyx.h2,
|
452
|
+
example: ___EmotionJSX(Text, {
|
453
|
+
variant: "H2",
|
454
|
+
as: "h2"
|
455
|
+
}, '<Text variant="H2" as="H2"/>')
|
456
|
+
},
|
457
|
+
H3: {
|
458
|
+
weight: fontWeightsOnyx[2],
|
459
|
+
fontSize: fontSizesOnyx.xl,
|
460
|
+
example: ___EmotionJSX(Text, {
|
461
|
+
variant: "H3",
|
462
|
+
as: "h3"
|
463
|
+
}, '<Text variant="H3" as="H3"/>')
|
464
|
+
},
|
465
|
+
H4: {
|
466
|
+
weight: fontWeightsOnyx[2],
|
467
|
+
fontSize: fontSizesOnyx.lg,
|
468
|
+
example: ___EmotionJSX(Text, {
|
469
|
+
variant: "H4",
|
470
|
+
as: "h4"
|
471
|
+
}, '<Text variant="H4" as="H4"/>')
|
472
|
+
},
|
473
|
+
H5: {
|
474
|
+
weight: fontWeightsOnyx[2],
|
475
|
+
fontSize: fontSizesOnyx.md,
|
476
|
+
example: ___EmotionJSX(Text, {
|
477
|
+
variant: "H5",
|
478
|
+
as: "h5"
|
479
|
+
}, '<Text variant="H5" as="H5"/>')
|
480
|
+
},
|
481
|
+
H6: {
|
482
|
+
weight: fontWeightsOnyx[0],
|
483
|
+
fontSize: fontSizesOnyx.sm,
|
484
|
+
example: ___EmotionJSX(Text, {
|
485
|
+
variant: "H6",
|
486
|
+
as: "h6"
|
487
|
+
}, '<Text variant="H6" as="H6"/>')
|
488
|
+
}
|
489
|
+
};
|
490
|
+
var baseAndSubtitleVariants = {
|
491
|
+
'Base (default variant of Text)': {
|
492
|
+
weight: fontWeightsOnyx[0],
|
493
|
+
fontSize: fontSizesOnyx.md,
|
494
|
+
color: 'text.primary',
|
495
|
+
example: ___EmotionJSX(Text, {
|
496
|
+
variant: "base",
|
497
|
+
fontWeight: "0"
|
498
|
+
}, '<Text variant="base"/>')
|
499
|
+
},
|
500
|
+
Subtitle: {
|
501
|
+
weight: fontWeightsOnyx[0],
|
502
|
+
fontSize: fontSizesOnyx.sm,
|
503
|
+
color: 'text.secondary',
|
504
|
+
example: ___EmotionJSX(Text, {
|
505
|
+
variant: "subtitle"
|
506
|
+
}, '<Text variant="subtitle"/>')
|
507
|
+
}
|
508
|
+
};
|
509
|
+
var largeVariants = {
|
510
|
+
Bold: {
|
511
|
+
weight: fontWeightsOnyx[3],
|
512
|
+
fontSize: fontSizesOnyx.lg,
|
513
|
+
example: ___EmotionJSX(Text, {
|
514
|
+
fontSize: "lg",
|
515
|
+
fontWeight: "3"
|
516
|
+
}, '<Text fontSize="lg" fontWeight="3">')
|
517
|
+
},
|
518
|
+
Semibold: {
|
519
|
+
weight: fontWeightsOnyx[2],
|
520
|
+
fontSize: fontSizesOnyx.lg,
|
521
|
+
example: ___EmotionJSX(Text, {
|
522
|
+
fontSize: "lg",
|
523
|
+
fontWeight: "2"
|
524
|
+
}, '<Text fontSize="lg" fontWeight="2">')
|
525
|
+
},
|
526
|
+
Regular: {
|
527
|
+
weight: fontWeightsOnyx[0],
|
528
|
+
fontSize: fontSizesOnyx.lg,
|
529
|
+
example: ___EmotionJSX(Text, {
|
530
|
+
fontSize: "lg",
|
531
|
+
fontWeight: "0"
|
532
|
+
}, '<Text fontSize="lg" fontWeight="0">')
|
533
|
+
},
|
534
|
+
Light: {
|
535
|
+
weight: fontWeightsOnyx[-1],
|
536
|
+
fontSize: fontSizesOnyx.lg,
|
537
|
+
example: ___EmotionJSX(Text, {
|
538
|
+
fontSize: "lg",
|
539
|
+
fontWeight: "0"
|
540
|
+
}, '<Text fontSize="lg" fontWeight="0">')
|
541
|
+
}
|
542
|
+
};
|
543
|
+
var mediumVariants = {
|
544
|
+
Bold: {
|
545
|
+
weight: fontWeightsOnyx[3],
|
546
|
+
fontSize: fontSizesOnyx.md,
|
547
|
+
example: ___EmotionJSX(Text, {
|
548
|
+
fontSize: "md",
|
549
|
+
fontWeight: "3"
|
550
|
+
}, '<Text fontSize="md" fontWeight="3">')
|
551
|
+
},
|
552
|
+
Semibold: {
|
553
|
+
weight: fontWeightsOnyx[2],
|
554
|
+
fontSize: fontSizesOnyx.md,
|
555
|
+
example: ___EmotionJSX(Text, {
|
556
|
+
fontSize: "md",
|
557
|
+
fontWeight: "2"
|
558
|
+
}, '<Text fontSize="md" fontWeight="2">')
|
559
|
+
},
|
560
|
+
Regular: {
|
561
|
+
weight: fontWeightsOnyx[0],
|
562
|
+
fontSize: fontSizesOnyx.md,
|
563
|
+
example: ___EmotionJSX(Text, {
|
564
|
+
fontSize: "md",
|
565
|
+
fontWeight: "0"
|
566
|
+
}, '<Text fontSize="md" fontWeight="0">')
|
567
|
+
},
|
568
|
+
Light: {
|
569
|
+
weight: fontWeightsOnyx[-1],
|
570
|
+
fontSize: fontSizesOnyx.md,
|
571
|
+
example: ___EmotionJSX(Text, {
|
572
|
+
fontSize: "md",
|
573
|
+
fontWeight: "-1"
|
574
|
+
}, '<Text fontSize="md" fontWeight="-1">')
|
575
|
+
}
|
576
|
+
};
|
577
|
+
var smallVariants = {
|
578
|
+
Bold: {
|
579
|
+
weight: fontWeightsOnyx[3],
|
580
|
+
fontSize: fontSizesOnyx.sm,
|
581
|
+
example: ___EmotionJSX(Text, {
|
582
|
+
fontSize: "sm",
|
583
|
+
fontWeight: "3"
|
584
|
+
}, '<Text fontSize="sm" fontWeight="3">')
|
585
|
+
},
|
586
|
+
Semibold: {
|
587
|
+
weight: fontWeightsOnyx[2],
|
588
|
+
fontSize: fontSizesOnyx.sm,
|
589
|
+
example: ___EmotionJSX(Text, {
|
590
|
+
fontSize: "sm",
|
591
|
+
fontWeight: "2"
|
592
|
+
}, '<Text fontSize="sm" fontWeight="2">')
|
593
|
+
},
|
594
|
+
Regular: {
|
595
|
+
weight: fontWeightsOnyx[0],
|
596
|
+
fontSize: fontSizesOnyx.sm,
|
597
|
+
example: ___EmotionJSX(Text, {
|
598
|
+
fontSize: "sm",
|
599
|
+
fontWeight: "0"
|
600
|
+
}, '<Text fontSize="sm" fontWeight="0">')
|
601
|
+
},
|
602
|
+
Light: {
|
603
|
+
weight: fontWeightsOnyx[-1],
|
604
|
+
fontSize: fontSizesOnyx.sm,
|
605
|
+
example: ___EmotionJSX(Text, {
|
606
|
+
fontSize: "sm",
|
607
|
+
fontWeight: "-1"
|
608
|
+
}, '<Text fontSize="sm" fontWeight="-1">')
|
609
|
+
}
|
610
|
+
};
|
611
|
+
var xsmallVariants = {
|
612
|
+
Bold: {
|
613
|
+
weight: fontWeightsOnyx[3],
|
614
|
+
fontSize: fontSizesOnyx.xs,
|
615
|
+
example: ___EmotionJSX(Text, {
|
616
|
+
fontSize: "xs",
|
617
|
+
fontWeight: "3"
|
618
|
+
}, '<Text fontSize="xs" fontWeight="3">')
|
619
|
+
},
|
620
|
+
Semibold: {
|
621
|
+
weight: fontWeightsOnyx[2],
|
622
|
+
fontSize: fontSizesOnyx.xs,
|
623
|
+
example: ___EmotionJSX(Text, {
|
624
|
+
fontSize: "xs",
|
625
|
+
fontWeight: "2"
|
626
|
+
}, '<Text fontSize="xs" fontWeight="2">')
|
627
|
+
},
|
628
|
+
Regular: {
|
629
|
+
weight: fontWeightsOnyx[0],
|
630
|
+
fontSize: fontSizesOnyx.xs,
|
631
|
+
example: ___EmotionJSX(Text, {
|
632
|
+
fontSize: "xs",
|
633
|
+
fontWeight: "0"
|
634
|
+
}, '<Text fontSize="xs" fontWeight="0">')
|
635
|
+
},
|
636
|
+
Light: {
|
637
|
+
weight: fontWeightsOnyx[-1],
|
638
|
+
fontSize: fontSizesOnyx.xs,
|
639
|
+
example: ___EmotionJSX(Text, {
|
640
|
+
fontSize: "xs",
|
641
|
+
fontWeight: "-1"
|
642
|
+
}, '<Text fontSize="xs" fontWeight="-1">')
|
643
|
+
}
|
644
|
+
};
|
645
|
+
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(Table, {
|
646
|
+
mb: "xx"
|
647
|
+
}, ___EmotionJSX(TableHeading, {
|
648
|
+
title: "Heading"
|
649
|
+
}), ___EmotionJSX(TableBody, {
|
650
|
+
sx: sx.tableBody
|
651
|
+
}, _mapInstanceProperty(_context7 = _Object$entries(headingVariants)).call(_context7, function (_ref15) {
|
652
|
+
var _ref16 = _slicedToArray(_ref15, 2),
|
653
|
+
key = _ref16[0],
|
654
|
+
value = _ref16[1];
|
655
|
+
return ___EmotionJSX(TableData, {
|
656
|
+
variant: key,
|
657
|
+
value: value,
|
658
|
+
key: key
|
659
|
+
});
|
660
|
+
}))), ___EmotionJSX(Table, {
|
661
|
+
mb: "xx"
|
662
|
+
}, ___EmotionJSX(TableHead, null, ___EmotionJSX(TableRow, {
|
663
|
+
key: "head"
|
664
|
+
}, ___EmotionJSX(TableCell, {
|
665
|
+
sx: sx.cell,
|
666
|
+
isHeading: true,
|
667
|
+
width: "60%"
|
668
|
+
}, "Base and Subtitle"), ___EmotionJSX(TableCell, {
|
669
|
+
sx: sx.cell,
|
670
|
+
isHeading: true,
|
671
|
+
width: "20%"
|
672
|
+
}, "Weight"), ___EmotionJSX(TableCell, {
|
673
|
+
sx: sx.cell,
|
674
|
+
isHeading: true,
|
675
|
+
width: "30%"
|
676
|
+
}, "Size"), ___EmotionJSX(TableCell, {
|
677
|
+
sx: sx.cell,
|
678
|
+
isHeading: true,
|
679
|
+
width: "40%"
|
680
|
+
}, "Color"), ___EmotionJSX(TableCell, {
|
681
|
+
sx: sx.cell,
|
682
|
+
isHeading: true
|
683
|
+
}, "Example"))), ___EmotionJSX(TableBody, {
|
684
|
+
sx: sx.tableBody
|
685
|
+
}, _mapInstanceProperty(_context8 = _Object$entries(baseAndSubtitleVariants)).call(_context8, function (_ref17) {
|
686
|
+
var _ref18 = _slicedToArray(_ref17, 2),
|
687
|
+
key = _ref18[0],
|
688
|
+
value = _ref18[1];
|
689
|
+
return ___EmotionJSX(TableRow, {
|
690
|
+
sx: {
|
691
|
+
backgroundColor: 'transparent !important'
|
692
|
+
},
|
693
|
+
key: key
|
694
|
+
}, ___EmotionJSX(TableCell, {
|
695
|
+
sx: sx.cell,
|
696
|
+
width: "60%"
|
697
|
+
}, ___EmotionJSX(Text, null, key)), ___EmotionJSX(TableCell, {
|
698
|
+
sx: sx.cell,
|
699
|
+
width: "20%"
|
700
|
+
}, ___EmotionJSX(Text, null, value.weight)), ___EmotionJSX(TableCell, {
|
701
|
+
sx: sx.cell,
|
702
|
+
width: "30%"
|
703
|
+
}, ___EmotionJSX(Text, null, value.fontSize)), ___EmotionJSX(TableCell, {
|
704
|
+
sx: sx.cell,
|
705
|
+
width: "40%"
|
706
|
+
}, ___EmotionJSX(Text, null, value.color)), ___EmotionJSX(TableCell, {
|
707
|
+
sx: sx.cell
|
708
|
+
}, value.example));
|
709
|
+
}))), ___EmotionJSX(Table, {
|
710
|
+
mb: "xx"
|
711
|
+
}, ___EmotionJSX(TableHeading, {
|
712
|
+
title: "Large"
|
713
|
+
}), ___EmotionJSX(TableBody, {
|
714
|
+
sx: sx.tableBody
|
715
|
+
}, _mapInstanceProperty(_context9 = _Object$entries(largeVariants)).call(_context9, function (_ref19) {
|
716
|
+
var _ref20 = _slicedToArray(_ref19, 2),
|
717
|
+
key = _ref20[0],
|
718
|
+
value = _ref20[1];
|
719
|
+
return ___EmotionJSX(TableData, {
|
720
|
+
variant: key,
|
721
|
+
value: value,
|
722
|
+
key: key
|
723
|
+
});
|
724
|
+
}))), ___EmotionJSX(Table, {
|
725
|
+
mb: "xx"
|
726
|
+
}, ___EmotionJSX(TableHeading, {
|
727
|
+
title: "Medium"
|
728
|
+
}), ___EmotionJSX(TableBody, {
|
729
|
+
sx: sx.tableBody
|
730
|
+
}, _mapInstanceProperty(_context10 = _Object$entries(mediumVariants)).call(_context10, function (_ref21) {
|
731
|
+
var _ref22 = _slicedToArray(_ref21, 2),
|
732
|
+
key = _ref22[0],
|
733
|
+
value = _ref22[1];
|
734
|
+
return ___EmotionJSX(TableData, {
|
735
|
+
variant: key,
|
736
|
+
value: value,
|
737
|
+
key: key
|
738
|
+
});
|
739
|
+
}))), ___EmotionJSX(Table, {
|
740
|
+
mb: "xx"
|
741
|
+
}, ___EmotionJSX(TableHeading, {
|
742
|
+
title: "Small"
|
743
|
+
}), ___EmotionJSX(TableBody, {
|
744
|
+
sx: sx.tableBody
|
745
|
+
}, _mapInstanceProperty(_context11 = _Object$entries(smallVariants)).call(_context11, function (_ref23) {
|
746
|
+
var _ref24 = _slicedToArray(_ref23, 2),
|
747
|
+
key = _ref24[0],
|
748
|
+
value = _ref24[1];
|
749
|
+
return ___EmotionJSX(TableData, {
|
750
|
+
variant: key,
|
751
|
+
value: value,
|
752
|
+
key: key
|
753
|
+
});
|
754
|
+
}))), ___EmotionJSX(Table, {
|
755
|
+
mb: "xx"
|
756
|
+
}, ___EmotionJSX(TableHeading, {
|
757
|
+
title: "XSmall"
|
758
|
+
}), ___EmotionJSX(TableBody, {
|
759
|
+
sx: sx.tableBody
|
760
|
+
}, _mapInstanceProperty(_context12 = _Object$entries(xsmallVariants)).call(_context12, function (_ref25) {
|
761
|
+
var _ref26 = _slicedToArray(_ref25, 2),
|
762
|
+
key = _ref26[0],
|
763
|
+
value = _ref26[1];
|
764
|
+
return ___EmotionJSX(TableData, {
|
765
|
+
variant: key,
|
766
|
+
value: value,
|
767
|
+
key: key
|
768
|
+
});
|
769
|
+
}))));
|
770
|
+
};
|
771
|
+
Default.parameters = {
|
772
|
+
codesandbox: false
|
773
|
+
};
|
422
774
|
export var CustomWidth = function CustomWidth(args) {
|
423
775
|
return ___EmotionJSX(Box, {
|
424
776
|
width: 200
|
@@ -227,6 +227,11 @@ export var text = _objectSpread(_objectSpread(_objectSpread({
|
|
227
227
|
color: 'text.secondary',
|
228
228
|
fontFamily: 'standard'
|
229
229
|
},
|
230
|
+
pageHeaderBody: _objectSpread(_objectSpread({}, wordWrap), {}, {
|
231
|
+
fontSize: 'sm',
|
232
|
+
color: 'text.secondary',
|
233
|
+
fontFamily: 'standard'
|
234
|
+
}),
|
230
235
|
panelHeaderSubtext: _objectSpread(_objectSpread({}, listViewItemSubtext), textEllipsis),
|
231
236
|
panelHeaderText: _objectSpread(_objectSpread({}, listViewItemText), textEllipsis),
|
232
237
|
sectionTitle: sectionTitle,
|
@@ -17,6 +17,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
17
17
|
import React, { useState } from 'react';
|
18
18
|
import isEmpty from 'lodash/isEmpty';
|
19
19
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
20
|
+
import { useGetTheme } from '../../hooks';
|
20
21
|
import useCopyToClipboard from '../../hooks/useCopyToClipboard';
|
21
22
|
import { Box, TextField } from '../../index';
|
22
23
|
import { modes as labelModes } from '../../utils/devUtils/constants/labelModes';
|
@@ -260,6 +261,12 @@ export var WithSlots = function WithSlots() {
|
|
260
261
|
top: '5px',
|
261
262
|
height: '32px'
|
262
263
|
};
|
264
|
+
var onyxButtonSx = {
|
265
|
+
position: 'absolute',
|
266
|
+
right: 0,
|
267
|
+
top: '9px',
|
268
|
+
height: '32px'
|
269
|
+
};
|
263
270
|
var containerSx = {
|
264
271
|
sx: {
|
265
272
|
'& input': {
|
@@ -267,6 +274,9 @@ export var WithSlots = function WithSlots() {
|
|
267
274
|
}
|
268
275
|
}
|
269
276
|
};
|
277
|
+
var _useGetTheme = useGetTheme(),
|
278
|
+
themeState = _useGetTheme.themeState;
|
279
|
+
var isOnyx = themeState.isOnyx;
|
270
280
|
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(TextField, {
|
271
281
|
label: "Multiple Addresses",
|
272
282
|
labelMode: "float",
|
@@ -278,7 +288,7 @@ export var WithSlots = function WithSlots() {
|
|
278
288
|
slots: {
|
279
289
|
inContainer: ___EmotionJSX(CopyButton, {
|
280
290
|
onPress: copyAddressesToClipboard,
|
281
|
-
sx: buttonSx,
|
291
|
+
sx: isOnyx ? onyxButtonSx : buttonSx,
|
282
292
|
iconProps: {
|
283
293
|
sx: {
|
284
294
|
path: {
|
@@ -300,7 +310,7 @@ export var WithSlots = function WithSlots() {
|
|
300
310
|
slots: {
|
301
311
|
inContainer: ___EmotionJSX(CopyButton, {
|
302
312
|
onPress: copyJsonToClipboard,
|
303
|
-
sx: buttonSx,
|
313
|
+
sx: isOnyx ? onyxButtonSx : buttonSx,
|
304
314
|
iconProps: {
|
305
315
|
sx: {
|
306
316
|
path: {
|
@@ -0,0 +1,71 @@
|
|
1
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
2
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
3
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
4
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
5
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
6
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
7
|
+
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
8
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
9
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
10
|
+
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
11
|
+
var _excluded = ["mode", "size", "isAstro", "defaultLoaderSize", "progress"];
|
12
|
+
import _parseInt from "@babel/runtime-corejs3/core-js-stable/parse-int";
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
14
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
15
|
+
import useTShirtSize from '../useTShirtSize';
|
16
|
+
export var circularSizes = {
|
17
|
+
'sm': 16,
|
18
|
+
'md': 24,
|
19
|
+
'lg': 32
|
20
|
+
};
|
21
|
+
var useCircularLoader = function useCircularLoader(props) {
|
22
|
+
var mode = props.mode,
|
23
|
+
size = props.size,
|
24
|
+
isAstro = props.isAstro,
|
25
|
+
defaultLoaderSize = props.defaultLoaderSize,
|
26
|
+
_props$progress = props.progress,
|
27
|
+
progress = _props$progress === void 0 ? 75 : _props$progress,
|
28
|
+
others = _objectWithoutProperties(props, _excluded);
|
29
|
+
var _useTShirtSize = useTShirtSize({
|
30
|
+
size: size || defaultLoaderSize,
|
31
|
+
sizes: circularSizes
|
32
|
+
}),
|
33
|
+
sizeProps = _useTShirtSize.sizeProps;
|
34
|
+
if (mode === 'dots' || isAstro) {
|
35
|
+
return _objectSpread({
|
36
|
+
size: size || defaultLoaderSize,
|
37
|
+
isCircle: false,
|
38
|
+
radius: 0,
|
39
|
+
center: 0,
|
40
|
+
strokeWidth: 0,
|
41
|
+
dashLength: 0,
|
42
|
+
gapLength: 0
|
43
|
+
}, others);
|
44
|
+
}
|
45
|
+
var parsedSize = _parseInt(sizeProps.size, 10);
|
46
|
+
var actualSize = parsedSize * (10 / 12);
|
47
|
+
var strokeWidth = (parsedSize - actualSize) / 2;
|
48
|
+
|
49
|
+
// Calculate the radius, considering the strokeWidth to fit within the given size
|
50
|
+
var radius = (actualSize - strokeWidth) / 2;
|
51
|
+
|
52
|
+
// Center of the circle
|
53
|
+
var center = actualSize / 2;
|
54
|
+
|
55
|
+
// Calculate the circumference
|
56
|
+
var circumference = 2 * Math.PI * radius;
|
57
|
+
|
58
|
+
// Calculate the dash and gap lengths for the progress
|
59
|
+
var dashLength = progress / 100 * circumference;
|
60
|
+
var gapLength = circumference;
|
61
|
+
return _objectSpread({
|
62
|
+
center: center,
|
63
|
+
isCircle: true,
|
64
|
+
radius: radius,
|
65
|
+
strokeWidth: strokeWidth,
|
66
|
+
dashLength: dashLength,
|
67
|
+
gapLength: gapLength,
|
68
|
+
size: actualSize
|
69
|
+
}, others);
|
70
|
+
};
|
71
|
+
export default useCircularLoader;
|
@@ -0,0 +1,129 @@
|
|
1
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
2
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
3
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
4
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
5
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
6
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
7
|
+
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
8
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
9
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
10
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
11
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
12
|
+
import { renderHook } from '@testing-library/react';
|
13
|
+
import useCircularLoader, { circularSizes } from './useCircularLoader';
|
14
|
+
var nonCircleProps = {
|
15
|
+
isAstro: true,
|
16
|
+
defaultLoaderSize: 20
|
17
|
+
};
|
18
|
+
var circleProps = {
|
19
|
+
isAstro: false,
|
20
|
+
defaultLoaderSize: 20
|
21
|
+
};
|
22
|
+
var defaultProps = {
|
23
|
+
isAstro: false,
|
24
|
+
defaultLoaderSize: 20
|
25
|
+
};
|
26
|
+
test('astro theme returns isCircle = false ', function () {
|
27
|
+
var _renderHook = renderHook(function () {
|
28
|
+
return useCircularLoader(_objectSpread({}, nonCircleProps));
|
29
|
+
}),
|
30
|
+
result = _renderHook.result;
|
31
|
+
expect(result.current.isCircle).toEqual(false);
|
32
|
+
});
|
33
|
+
test('mode = "dots" returns returns isCircle = false ', function () {
|
34
|
+
var _renderHook2 = renderHook(function () {
|
35
|
+
return useCircularLoader(_objectSpread(_objectSpread({}, circleProps), {}, {
|
36
|
+
mode: 'dots'
|
37
|
+
}));
|
38
|
+
}),
|
39
|
+
result = _renderHook2.result;
|
40
|
+
expect(result.current.isCircle).toEqual(false);
|
41
|
+
});
|
42
|
+
test('numeric calcuations are correct', function () {
|
43
|
+
var _renderHook3 = renderHook(function () {
|
44
|
+
return useCircularLoader(_objectSpread(_objectSpread({}, circleProps), {}, {
|
45
|
+
size: 120
|
46
|
+
}));
|
47
|
+
}),
|
48
|
+
result = _renderHook3.result;
|
49
|
+
var current = result.current;
|
50
|
+
var radius = current.radius,
|
51
|
+
strokeWidth = current.strokeWidth,
|
52
|
+
center = current.center,
|
53
|
+
size = current.size;
|
54
|
+
expect(radius).toEqual(45);
|
55
|
+
expect(center).toEqual(50);
|
56
|
+
expect(strokeWidth).toEqual(10);
|
57
|
+
expect(size).toEqual(100);
|
58
|
+
});
|
59
|
+
test('returns isCircle = false when mode is "dots"', function () {
|
60
|
+
var _renderHook4 = renderHook(function () {
|
61
|
+
return useCircularLoader(_objectSpread(_objectSpread({}, defaultProps), {}, {
|
62
|
+
mode: 'dots'
|
63
|
+
}));
|
64
|
+
}),
|
65
|
+
result = _renderHook4.result;
|
66
|
+
expect(result.current.isCircle).toBe(false);
|
67
|
+
});
|
68
|
+
test('returns isCircle = false when isAstro is true', function () {
|
69
|
+
var _renderHook5 = renderHook(function () {
|
70
|
+
return useCircularLoader(_objectSpread(_objectSpread({}, defaultProps), {}, {
|
71
|
+
isAstro: true
|
72
|
+
}));
|
73
|
+
}),
|
74
|
+
result = _renderHook5.result;
|
75
|
+
expect(result.current.isCircle).toBe(false);
|
76
|
+
});
|
77
|
+
test('calculates correct values for circular loader with size "sm"', function () {
|
78
|
+
var _renderHook6 = renderHook(function () {
|
79
|
+
return useCircularLoader(_objectSpread(_objectSpread({}, defaultProps), {}, {
|
80
|
+
size: 'sm'
|
81
|
+
}));
|
82
|
+
}),
|
83
|
+
result = _renderHook6.result;
|
84
|
+
var size = result.current.size;
|
85
|
+
expect(size).toBeCloseTo(circularSizes.sm * (10 / 12)); // Adjust based on actual calculation
|
86
|
+
});
|
87
|
+
|
88
|
+
test('calculates correct values for circular loader with size "lg"', function () {
|
89
|
+
var _renderHook7 = renderHook(function () {
|
90
|
+
return useCircularLoader(_objectSpread(_objectSpread({}, defaultProps), {}, {
|
91
|
+
size: 'lg'
|
92
|
+
}));
|
93
|
+
}),
|
94
|
+
result = _renderHook7.result;
|
95
|
+
var size = result.current.size;
|
96
|
+
expect(size).toBeCloseTo(circularSizes.lg * (10 / 12)); // Adjust based on actual calculation
|
97
|
+
});
|
98
|
+
|
99
|
+
test('uses defaultLoaderSize when size is not provided', function () {
|
100
|
+
var _renderHook8 = renderHook(function () {
|
101
|
+
return useCircularLoader(_objectSpread({}, defaultProps));
|
102
|
+
}),
|
103
|
+
result = _renderHook8.result;
|
104
|
+
expect(result.current.size).toBe(defaultProps.defaultLoaderSize * (10 / 12));
|
105
|
+
});
|
106
|
+
test('calculates correct values for custom progress', function () {
|
107
|
+
var _renderHook9 = renderHook(function () {
|
108
|
+
return useCircularLoader(_objectSpread(_objectSpread({}, defaultProps), {}, {
|
109
|
+
size: 120,
|
110
|
+
progress: 50
|
111
|
+
}));
|
112
|
+
}),
|
113
|
+
result = _renderHook9.result;
|
114
|
+
var _result$current = result.current,
|
115
|
+
dashLength = _result$current.dashLength,
|
116
|
+
gapLength = _result$current.gapLength,
|
117
|
+
radius = _result$current.radius;
|
118
|
+
expect(dashLength).toBeCloseTo(50 / 100 * 2 * Math.PI * radius); // Progress = 50%
|
119
|
+
expect(gapLength).toBeCloseTo(2 * Math.PI * radius);
|
120
|
+
});
|
121
|
+
test('returns correct size when size is a custom number', function () {
|
122
|
+
var _renderHook10 = renderHook(function () {
|
123
|
+
return useCircularLoader(_objectSpread(_objectSpread({}, defaultProps), {}, {
|
124
|
+
size: 100
|
125
|
+
}));
|
126
|
+
}),
|
127
|
+
result = _renderHook10.result;
|
128
|
+
expect(result.current.size).toBeCloseTo(100 * (10 / 12)); // Adjust based on actual calculation
|
129
|
+
});
|
package/lib/styles/colors.js
CHANGED
@@ -120,7 +120,10 @@ export var text = {
|
|
120
120
|
export var shadow = chroma(neutral[10]).alpha(0.25).hex();
|
121
121
|
var badge = {
|
122
122
|
textColor: 'white',
|
123
|
-
background: neutral[10]
|
123
|
+
background: neutral[10],
|
124
|
+
readOnly: 'white',
|
125
|
+
iconBadge: 'white',
|
126
|
+
iconBadgeFill: accent[40]
|
124
127
|
};
|
125
128
|
var tooltip = accent[20];
|
126
129
|
var allColors = {
|
@@ -33,8 +33,8 @@ var badge = {
|
|
33
33
|
background: nextGenColors['gray-800'],
|
34
34
|
textColor: nextGenColors['gray-100']
|
35
35
|
};
|
36
|
-
var
|
37
|
-
|
36
|
+
var twoTone = {
|
37
|
+
bg: {
|
38
38
|
orange: nextGenColors['orange-500'],
|
39
39
|
cyan: nextGenColors['cyan-500'],
|
40
40
|
green: nextGenColors['green-500'],
|
@@ -51,6 +51,26 @@ var iconWrapper = {
|
|
51
51
|
lightYellow: nextGenColors['yellow-800'],
|
52
52
|
lightIndigo: nextGenColors['indigo-700']
|
53
53
|
},
|
54
|
+
text: {
|
55
|
+
orange: 'black',
|
56
|
+
cyan: 'black',
|
57
|
+
green: 'black',
|
58
|
+
purple: 'black',
|
59
|
+
pink: 'black',
|
60
|
+
red: 'black',
|
61
|
+
yellow: 'black',
|
62
|
+
teal: 'black',
|
63
|
+
blue: 'black',
|
64
|
+
indigo: 'black',
|
65
|
+
lightBlue: 'black',
|
66
|
+
lightPink: 'black',
|
67
|
+
lightGreen: 'black',
|
68
|
+
lightYellow: 'black',
|
69
|
+
lightIndigo: 'black'
|
70
|
+
}
|
71
|
+
};
|
72
|
+
var iconWrapper = {
|
73
|
+
wrapper: _objectSpread({}, twoTone.bg),
|
54
74
|
icon: {
|
55
75
|
orange: 'black',
|
56
76
|
cyan: 'black',
|
@@ -73,6 +93,7 @@ export var colors = _objectSpread(_objectSpread({
|
|
73
93
|
border: border,
|
74
94
|
iconWrapper: iconWrapper
|
75
95
|
}, overrides), {}, {
|
96
|
+
twoTone: twoTone,
|
76
97
|
light: nextGenColors['gray-900'],
|
77
98
|
secondary: nextGenColors['gray-400'],
|
78
99
|
dark: nextGenColors['gray-400'],
|
@@ -11,6 +11,12 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
|
|
11
11
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
12
12
|
import { nextGenThemeValues } from '../../../themes/next-gen/customProperties';
|
13
13
|
import icons from './icons';
|
14
|
+
var backgroundBaseColor = '#23282e';
|
15
|
+
var defaultIconColor = 'gray-400';
|
16
|
+
var iFrameContentDivBackgroundColor = backgroundBaseColor;
|
14
17
|
export var nextGenDarkThemeValues = _objectSpread(_objectSpread({}, nextGenThemeValues), {}, {
|
15
|
-
|
18
|
+
backgroundBaseColor: backgroundBaseColor,
|
19
|
+
iFrameContentDivBackgroundColor: iFrameContentDivBackgroundColor,
|
20
|
+
icons: icons,
|
21
|
+
defaultIconColor: defaultIconColor
|
16
22
|
});
|