@transferwise/components 0.0.0-experimental-6528439 → 0.0.0-experimental-1ffdc56
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/build/alert/Alert.js +33 -17
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +30 -14
- package/build/alert/Alert.mjs.map +1 -1
- package/build/avatarLayout/AvatarLayout.js +9 -2
- package/build/avatarLayout/AvatarLayout.js.map +1 -1
- package/build/avatarLayout/AvatarLayout.mjs +9 -2
- package/build/avatarLayout/AvatarLayout.mjs.map +1 -1
- package/build/button/Button.js +86 -79
- package/build/button/Button.js.map +1 -1
- package/build/button/Button.mjs +87 -80
- package/build/button/Button.mjs.map +1 -1
- package/build/button/Button.resolver.js +74 -0
- package/build/button/Button.resolver.js.map +1 -0
- package/build/button/Button.resolver.mjs +72 -0
- package/build/button/Button.resolver.mjs.map +1 -0
- package/build/button/LegacyButton.js +114 -0
- package/build/button/LegacyButton.js.map +1 -0
- package/build/button/LegacyButton.mjs +112 -0
- package/build/button/LegacyButton.mjs.map +1 -0
- package/build/common/action/Action.js +26 -15
- package/build/common/action/Action.js.map +1 -1
- package/build/common/action/Action.mjs +26 -15
- package/build/common/action/Action.mjs.map +1 -1
- package/build/common/propsValues/sentiment.js +1 -0
- package/build/common/propsValues/sentiment.js.map +1 -1
- package/build/common/propsValues/sentiment.mjs +1 -0
- package/build/common/propsValues/sentiment.mjs.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js +10 -73
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs +11 -74
- package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
- package/build/dimmer/Dimmer.js +67 -41
- package/build/dimmer/Dimmer.js.map +1 -1
- package/build/dimmer/Dimmer.mjs +69 -43
- package/build/dimmer/Dimmer.mjs.map +1 -1
- package/build/header/Header.js +2 -2
- package/build/header/Header.js.map +1 -1
- package/build/header/Header.mjs +1 -1
- package/build/i18n/en.json +1 -0
- package/build/i18n/en.json.js +1 -0
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/en.json.mjs +1 -0
- package/build/i18n/en.json.mjs.map +1 -1
- package/build/index.js +2 -2
- package/build/index.mjs +1 -1
- package/build/inputs/_BottomSheet.js +8 -1
- package/build/inputs/_BottomSheet.js.map +1 -1
- package/build/inputs/_BottomSheet.mjs +9 -2
- package/build/inputs/_BottomSheet.mjs.map +1 -1
- package/build/inputs/_Popover.js +8 -1
- package/build/inputs/_Popover.js.map +1 -1
- package/build/inputs/_Popover.mjs +9 -2
- package/build/inputs/_Popover.mjs.map +1 -1
- package/build/link/Link.js +8 -3
- package/build/link/Link.js.map +1 -1
- package/build/link/Link.mjs +8 -3
- package/build/link/Link.mjs.map +1 -1
- package/build/main.css +250 -72
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js +2 -4
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js.map +1 -1
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs +2 -4
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs.map +1 -1
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.js +3 -5
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.js.map +1 -1
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs +3 -5
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs.map +1 -1
- package/build/select/Select.js +2 -2
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.mjs +1 -1
- package/build/statusIcon/StatusIcon.js +5 -1
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.messages.js +3 -0
- package/build/statusIcon/StatusIcon.messages.js.map +1 -1
- package/build/statusIcon/StatusIcon.messages.mjs +3 -0
- package/build/statusIcon/StatusIcon.messages.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +5 -1
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/styles/avatarLayout/AvatarLayout.css +11 -0
- package/build/styles/button/Button.css +220 -15
- package/build/styles/button/Button.vars.css +46 -0
- package/build/styles/button/LegacyButton.css +23 -0
- package/build/styles/criticalBanner/CriticalCommsBanner.css +7 -72
- package/build/styles/main.css +250 -72
- package/build/styles/statusIcon/StatusIcon.css +4 -0
- package/build/types/alert/Alert.d.ts +2 -1
- package/build/types/alert/Alert.d.ts.map +1 -1
- package/build/types/avatarLayout/AvatarLayout.d.ts.map +1 -1
- package/build/types/button/Button.d.ts +2 -23
- package/build/types/button/Button.d.ts.map +1 -1
- package/build/types/button/Button.resolver.d.ts +35 -0
- package/build/types/button/Button.resolver.d.ts.map +1 -0
- package/build/types/button/Button.types.d.ts +70 -0
- package/build/types/button/Button.types.d.ts.map +1 -0
- package/build/types/button/LegacyButton.d.ts +44 -0
- package/build/types/button/LegacyButton.d.ts.map +1 -0
- package/build/types/button/index.d.ts +2 -2
- package/build/types/button/index.d.ts.map +1 -1
- package/build/types/common/action/Action.d.ts +4 -1
- package/build/types/common/action/Action.d.ts.map +1 -1
- package/build/types/common/propsValues/sentiment.d.ts +1 -0
- package/build/types/common/propsValues/sentiment.d.ts.map +1 -1
- package/build/types/criticalBanner/CriticalCommsBanner.d.ts.map +1 -1
- package/build/types/dimmer/Dimmer.d.ts.map +1 -1
- package/build/types/inputs/_BottomSheet.d.ts.map +1 -1
- package/build/types/inputs/_Popover.d.ts.map +1 -1
- package/build/types/link/Link.d.ts +2 -2
- package/build/types/link/Link.d.ts.map +1 -1
- package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.d.ts.map +1 -1
- package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.d.ts +6 -2
- package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.d.ts.map +1 -1
- package/build/types/primitives/PrimitiveButton/src/PrimitiveButton.d.ts.map +1 -1
- package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
- package/build/types/statusIcon/StatusIcon.messages.d.ts +5 -0
- package/build/types/statusIcon/StatusIcon.messages.d.ts.map +1 -1
- package/build/types/test-utils/index.d.ts +2 -0
- package/build/types/test-utils/index.d.ts.map +1 -1
- package/build/types/test-utils/story-config.d.ts +1 -1
- package/build/types/test-utils/story-config.d.ts.map +1 -1
- package/build/types/withNextPortal/withNextPortal.d.ts.map +1 -1
- package/build/upload/steps/completeStep/completeStep.js +2 -2
- package/build/upload/steps/completeStep/completeStep.js.map +1 -1
- package/build/upload/steps/completeStep/completeStep.mjs +1 -1
- package/build/upload/steps/processingStep/processingStep.js +2 -2
- package/build/upload/steps/processingStep/processingStep.js.map +1 -1
- package/build/upload/steps/processingStep/processingStep.mjs +1 -1
- package/build/uploadInput/UploadInput.js +3 -3
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +1 -1
- package/build/withNextPortal/withNextPortal.js +2 -5
- package/build/withNextPortal/withNextPortal.js.map +1 -1
- package/build/withNextPortal/withNextPortal.mjs +2 -5
- package/build/withNextPortal/withNextPortal.mjs.map +1 -1
- package/package.json +5 -5
- package/src/alert/Alert.story.tsx +36 -0
- package/src/alert/Alert.tests.story.tsx +1 -1
- package/src/alert/Alert.tsx +37 -8
- package/src/avatarLayout/AvatarLayout.css +11 -0
- package/src/avatarLayout/AvatarLayout.less +18 -1
- package/src/avatarLayout/AvatarLayout.tsx +10 -2
- package/src/button/Button.accessibility.docs.mdx +103 -0
- package/src/button/Button.css +220 -15
- package/src/button/Button.less +228 -13
- package/src/button/Button.resolver.tsx +73 -0
- package/src/button/Button.spec.tsx +215 -226
- package/src/button/Button.story.tsx +761 -134
- package/src/button/Button.tests.story.tsx +27 -0
- package/src/button/Button.tsx +99 -132
- package/src/button/Button.types.ts +92 -0
- package/src/button/Button.vars.css +46 -0
- package/src/button/Button.vars.less +57 -0
- package/src/button/LegacyButton.css +23 -0
- package/src/button/LegacyButton.less +24 -0
- package/src/button/LegacyButton.spec.tsx +147 -0
- package/src/button/LegacyButton.story.tsx +228 -0
- package/src/button/LegacyButton.tsx +177 -0
- package/src/button/index.ts +2 -3
- package/src/common/action/Action.tsx +39 -21
- package/src/common/bottomSheet/BottomSheet.spec.tsx +3 -6
- package/src/common/bottomSheet/__snapshots__/BottomSheet.spec.tsx.snap +1 -5
- package/src/common/propsValues/sentiment.ts +1 -0
- package/src/criticalBanner/CriticalCommsBanner.css +7 -72
- package/src/criticalBanner/CriticalCommsBanner.less +12 -73
- package/src/criticalBanner/CriticalCommsBanner.story.tsx +13 -9
- package/src/criticalBanner/CriticalCommsBanner.tsx +8 -50
- package/src/dimmer/Dimmer.tsx +72 -44
- package/src/field/Field.story.tsx +1 -1
- package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +1 -2
- package/src/i18n/en.json +1 -0
- package/src/inputs/SelectInput.story.tsx +1 -1
- package/src/inputs/_BottomSheet.tsx +9 -3
- package/src/inputs/_Popover.tsx +10 -4
- package/src/label/Label.story.tsx +1 -1
- package/src/link/Link.tsx +15 -6
- package/src/main.css +250 -72
- package/src/main.less +1 -0
- package/src/primitives/PrimitiveAnchor/src/PrimitiveAnchor.tsx +2 -8
- package/src/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.ts +7 -2
- package/src/primitives/PrimitiveAnchor/test/PrimitiveAnchor.spec.tsx +1 -3
- package/src/primitives/PrimitiveButton/src/PrimitiveButton.tsx +4 -12
- package/src/primitives/PrimitiveButton/test/PrimitiveButton.spec.tsx +16 -13
- package/src/statusIcon/StatusIcon.css +4 -0
- package/src/statusIcon/StatusIcon.less +4 -0
- package/src/statusIcon/StatusIcon.messages.ts +6 -0
- package/src/statusIcon/StatusIcon.tsx +8 -1
- package/src/test-utils/Parameters.d.ts +9 -1
- package/src/test-utils/story-config.ts +10 -1
- package/src/withNextPortal/withNextPortal.tsx +1 -10
- package/src/button/__snapshots__/Button.spec.tsx.snap +0 -309
package/src/main.css
CHANGED
|
@@ -1,78 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
--critical-comms-subtitle-color: var(--color-content-secondary);
|
|
5
|
-
--critical-comms-subtitle-color-padding-left: var(--size-16);
|
|
6
|
-
--critical-comms-vertical-spacing: var(--size-8);
|
|
7
|
-
background-color: rgba(255,135,135,0.10196);
|
|
8
|
-
background-color: var(--critical-comms-background-color);
|
|
9
|
-
display: flex;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
align-items: center;
|
|
12
|
-
}
|
|
13
|
-
.np-theme-personal div.critical-comms,
|
|
14
|
-
.np-theme-personal--dark div.critical-comms {
|
|
15
|
-
--critical-comms-background-color: var(--color-sentiment-negative);
|
|
16
|
-
--critical-comms-title-color: var(--color-contrast);
|
|
17
|
-
--critical-comms-subtitle-color: var(--color-contrast);
|
|
18
|
-
--critical-comms-subtitle-color-padding-left: 0;
|
|
19
|
-
--critical-comms-vertical-spacing: var(--size-16);
|
|
20
|
-
padding: 24px;
|
|
21
|
-
padding: var(--padding-medium);
|
|
22
|
-
}
|
|
23
|
-
.np-theme-personal div.critical-comms .tw-icon-alert-circle-fill,
|
|
24
|
-
.np-theme-personal--dark div.critical-comms .tw-icon-alert-circle-fill {
|
|
25
|
-
color: var(--color-contrast);
|
|
26
|
-
}
|
|
27
|
-
.np-theme-personal div.critical-comms .tw-icon-alert-circle-fill svg,
|
|
28
|
-
.np-theme-personal--dark div.critical-comms .tw-icon-alert-circle-fill svg {
|
|
29
|
-
width: 48px;
|
|
30
|
-
height: 48px;
|
|
31
|
-
}
|
|
32
|
-
.np-theme-personal div.critical-comms .cta-btn,
|
|
33
|
-
.np-theme-personal--dark div.critical-comms .cta-btn {
|
|
34
|
-
background-color: var(--color-contrast);
|
|
35
|
-
}
|
|
36
|
-
.np-theme-personal div.critical-comms .cta-btn:not(.disabled):not(:disabled):focus,
|
|
37
|
-
.np-theme-personal--dark div.critical-comms .cta-btn:not(.disabled):not(:disabled):focus {
|
|
38
|
-
outline-color: var(--color-contrast);
|
|
39
|
-
}
|
|
40
|
-
@media (max-width: 767px) {
|
|
41
|
-
div.critical-comms {
|
|
42
|
-
display: inline;
|
|
43
|
-
display: initial;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
div.critical-comms .critical-comms--title {
|
|
47
|
-
color: var(--critical-comms-title-color);
|
|
48
|
-
}
|
|
49
|
-
div.critical-comms .critical-comms--subtitle {
|
|
50
|
-
color: var(--critical-comms-subtitle-color);
|
|
51
|
-
}
|
|
52
|
-
div.critical-comms .critical-comms--cta {
|
|
53
|
-
padding-left: 0;
|
|
1
|
+
.np-theme-personal .critical-comms .alert-critical {
|
|
2
|
+
color: var(--color-contrast-overlay);
|
|
3
|
+
background-color: var(--color-sentiment-negative) !important;
|
|
54
4
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
padding-left: var(--critical-comms-subtitle-color-padding-left);
|
|
58
|
-
padding-top: var(--critical-comms-vertical-spacing);
|
|
59
|
-
min-width: 100%;
|
|
60
|
-
}
|
|
5
|
+
.np-theme-personal .critical-comms .alert-critical .np-text-title-body {
|
|
6
|
+
color: var(--color-contrast-overlay);
|
|
61
7
|
}
|
|
62
|
-
|
|
8
|
+
.np-theme-personal .critical-comms .action__desktop {
|
|
63
9
|
display: flex;
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
@media (max-width: 767px) {
|
|
67
|
-
div.critical-comms .critical-comms-body {
|
|
68
|
-
flex-direction: column;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
@media (max-width: 767px) {
|
|
72
|
-
div.critical-comms .critical-comms-content {
|
|
73
|
-
padding-top: var(--critical-comms-vertical-spacing);
|
|
74
|
-
flex-wrap: wrap;
|
|
75
|
-
}
|
|
10
|
+
align-items: center;
|
|
76
11
|
}
|
|
77
12
|
.tw-date-lookup-calendar > tbody > tr > td.weekend button {
|
|
78
13
|
font-size: 0.875rem;
|
|
@@ -518,10 +453,18 @@ div.critical-comms .critical-comms-body {
|
|
|
518
453
|
-webkit-mask-image: radial-gradient(circle at bottom calc(100% - var(--np-avatar-size) - var(--np-avatar-offset)) right calc(100% - var(--np-avatar-size) - var(--np-avatar-offset)), transparent 0, transparent calc(var(--np-avatar-size) / 2 + 2px), black 0);
|
|
519
454
|
mask-image: radial-gradient(circle at bottom calc(100% - var(--np-avatar-size) - var(--np-avatar-offset)) right calc(100% - var(--np-avatar-size) - var(--np-avatar-offset)), transparent 0, transparent calc(var(--np-avatar-size) / 2 + 2px), black 0);
|
|
520
455
|
}
|
|
456
|
+
[dir="rtl"] .np-avatar-layout-diagonal-mask {
|
|
457
|
+
-webkit-mask-image: radial-gradient(circle at bottom calc(100% - var(--np-avatar-size) - var(--np-avatar-offset)) left calc(100% - var(--np-avatar-size) - var(--np-avatar-offset)), transparent 0, transparent calc(var(--np-avatar-size) / 2 + 2px), black 0);
|
|
458
|
+
mask-image: radial-gradient(circle at bottom calc(100% - var(--np-avatar-size) - var(--np-avatar-offset)) left calc(100% - var(--np-avatar-size) - var(--np-avatar-offset)), transparent 0, transparent calc(var(--np-avatar-size) / 2 + 2px), black 0);
|
|
459
|
+
}
|
|
521
460
|
.np-avatar-layout-diagonal-child {
|
|
522
461
|
margin-left: calc(var(--np-avatar-layout-size) - var(--np-avatar-size) * 2);
|
|
523
462
|
margin-top: calc(var(--np-avatar-layout-size) - var(--np-avatar-size));
|
|
524
463
|
}
|
|
464
|
+
[dir="rtl"] .np-avatar-layout-diagonal-child {
|
|
465
|
+
margin-left: 0;
|
|
466
|
+
margin-right: calc(var(--np-avatar-layout-size) - var(--np-avatar-size) * 2);
|
|
467
|
+
}
|
|
525
468
|
.np-avatar-layout-horizontal {
|
|
526
469
|
width: calc(var(--np-avatar-size) * var(--np-avatar-avatars-count) - (var(--np-avatar-offset) * (var(--np-avatar-avatars-count) - 1)));
|
|
527
470
|
width: calc(var(--np-avatar-size) * var(--np-avatar-avatars-count) - calc(var(--np-avatar-offset) * calc(var(--np-avatar-avatars-count) - 1)));
|
|
@@ -536,6 +479,9 @@ div.critical-comms .critical-comms-body {
|
|
|
536
479
|
.np-avatar-layout-horizontal-child {
|
|
537
480
|
margin-left: calc(var(--np-avatar-offset) * -1);
|
|
538
481
|
}
|
|
482
|
+
[dir="rtl"] .np-avatar-layout-horizontal-child {
|
|
483
|
+
margin-right: calc(var(--np-avatar-offset) * -1);
|
|
484
|
+
}
|
|
539
485
|
.np-icon-button {
|
|
540
486
|
border: none;
|
|
541
487
|
}
|
|
@@ -706,6 +652,234 @@ div.critical-comms .critical-comms-body {
|
|
|
706
652
|
.np-btn.disabled[class] {
|
|
707
653
|
pointer-events: auto;
|
|
708
654
|
}
|
|
655
|
+
.wds-Button {
|
|
656
|
+
--Button-background: var(--color-interactive-accent);
|
|
657
|
+
--Button-background-hover: var(--color-interactive-accent-hover);
|
|
658
|
+
--Button-background-active: var(--color-interactive-accent-active);
|
|
659
|
+
--Button-color: var(--color-interactive-control);
|
|
660
|
+
--Button-border-radius: var(--radius-full);
|
|
661
|
+
--Button-label-gap: var(--size-4);
|
|
662
|
+
--Button-large-padding: var(--size-12) var(--size-16);
|
|
663
|
+
--Button-medium-padding: var(--size-8) var(--size-12);
|
|
664
|
+
--Button-small-padding: var(--size-5) var(--size-12);
|
|
665
|
+
--Button-avatar-border-color: var(--color-border-neutral);
|
|
666
|
+
--Button-transition-duration: 150ms;
|
|
667
|
+
--Button-transition-easing: ease-in-out;
|
|
668
|
+
--Button-secondary-background: var(--color-interactive-neutral);
|
|
669
|
+
--Button-secondary-background-hover: var(--color-interactive-neutral-hover);
|
|
670
|
+
--Button-secondary-background-active: var(--color-interactive-neutral-active);
|
|
671
|
+
--Button-secondary-color: var(--color-interactive-primary);
|
|
672
|
+
--Button-tertiary-background: var(--color-background-neutral);
|
|
673
|
+
--Button-tertiary-background-hover: var(--color-background-neutral-hover);
|
|
674
|
+
--Button-tertiary-background-active: var(--color-background-neutral-active);
|
|
675
|
+
--Button-tertiary-color: var(--color-content-primary);
|
|
676
|
+
--Button-minimal-background: transparent;
|
|
677
|
+
--Button-minimal-background-hover: var(--color-background-screen-hover);
|
|
678
|
+
--Button-minimal-background-active: var(--color-background-screen-active);
|
|
679
|
+
--Button-minimal-color: var(--color-interactive-primary);
|
|
680
|
+
--Button-primary-negative-background: var(--color-sentiment-negative-primary);
|
|
681
|
+
--Button-primary-negative-background-hover: var(--color-sentiment-negative-primary-hover);
|
|
682
|
+
--Button-primary-negative-background-active: var(--color-sentiment-negative-primary-active);
|
|
683
|
+
--Button-primary-negative-color: var(--color-contrast-overlay);
|
|
684
|
+
--Button-secondary-negative-background: var(--color-sentiment-negative-secondary);
|
|
685
|
+
--Button-secondary-negative-background-hover: var(--color-sentiment-negative-secondary-hover);
|
|
686
|
+
--Button-secondary-negative-background-active: var(--color-sentiment-negative-secondary-active);
|
|
687
|
+
--Button-secondary-negative-color: var(--color-sentiment-negative-primary);
|
|
688
|
+
}
|
|
689
|
+
.np-theme-personal--bright-green .wds-Button {
|
|
690
|
+
--Button-primary-negative-color: var(--color-white);
|
|
691
|
+
--Button-secondary-color: var(--color-interactive-control);
|
|
692
|
+
--Button-secondary-negative-color: var(--color-white);
|
|
693
|
+
}
|
|
694
|
+
.np-theme-personal--forest-green .wds-Button {
|
|
695
|
+
--Button-secondary-background: var(--color-interactive-neutral);
|
|
696
|
+
--Button-secondary-negative-background: var(--color-sentiment-negative-primary);
|
|
697
|
+
--Button-secondary-negative-background-hover: var(--color-sentiment-negative-primary-hover);
|
|
698
|
+
--Button-secondary-negative-background-active: var(--color-sentiment-negative-primary-active);
|
|
699
|
+
--Button-secondary-negative-color: var(--color-contrast-overlay);
|
|
700
|
+
}
|
|
701
|
+
/* Button Styles */
|
|
702
|
+
.wds-Button {
|
|
703
|
+
display: inline-flex;
|
|
704
|
+
flex: none;
|
|
705
|
+
width: auto;
|
|
706
|
+
align-items: center;
|
|
707
|
+
justify-content: center;
|
|
708
|
+
vertical-align: middle;
|
|
709
|
+
text-align: center;
|
|
710
|
+
white-space: nowrap;
|
|
711
|
+
word-wrap: break-word;
|
|
712
|
+
-webkit-appearance: none;
|
|
713
|
+
-moz-appearance: none;
|
|
714
|
+
appearance: none;
|
|
715
|
+
background-color: var(--Button-background);
|
|
716
|
+
border: none;
|
|
717
|
+
border-radius: var(--Button-border-radius);
|
|
718
|
+
color: var(--Button-color);
|
|
719
|
+
cursor: pointer;
|
|
720
|
+
transition: color, background-color var(--Button-transition-duration) var(--Button-transition-easing);
|
|
721
|
+
}
|
|
722
|
+
.wds-Button,
|
|
723
|
+
.wds-Button:hover,
|
|
724
|
+
.wds-Button:active,
|
|
725
|
+
.wds-Button:focus {
|
|
726
|
+
-webkit-text-decoration: none;
|
|
727
|
+
text-decoration: none;
|
|
728
|
+
}
|
|
729
|
+
.wds-Button:hover {
|
|
730
|
+
background-color: var(--Button-background-hover);
|
|
731
|
+
}
|
|
732
|
+
.wds-Button:active {
|
|
733
|
+
background-color: var(--Button-background-active);
|
|
734
|
+
}
|
|
735
|
+
.wds-Button.wds-Button--disabled,
|
|
736
|
+
.wds-Button:disabled {
|
|
737
|
+
filter: none;
|
|
738
|
+
mix-blend-mode: luminosity;
|
|
739
|
+
opacity: 0.45;
|
|
740
|
+
cursor: not-allowed;
|
|
741
|
+
}
|
|
742
|
+
.wds-Button.wds-Button--disabled,
|
|
743
|
+
.wds-Button:disabled,
|
|
744
|
+
.wds-Button.wds-Button--disabled:hover,
|
|
745
|
+
.wds-Button:disabled:hover,
|
|
746
|
+
.wds-Button.wds-Button--disabled:active,
|
|
747
|
+
.wds-Button:disabled:active {
|
|
748
|
+
background-color: var(--Button-background);
|
|
749
|
+
}
|
|
750
|
+
.wds-Button--secondary {
|
|
751
|
+
--Button-background: var(--Button-secondary-background);
|
|
752
|
+
--Button-background-hover: var(--Button-secondary-background-hover);
|
|
753
|
+
--Button-background-active: var(--Button-secondary-background-active);
|
|
754
|
+
--Button-color: var(--Button-secondary-color);
|
|
755
|
+
}
|
|
756
|
+
.wds-Button--tertiary {
|
|
757
|
+
--Button-background: var(--Button-tertiary-background);
|
|
758
|
+
--Button-background-hover: var(--Button-tertiary-background-hover);
|
|
759
|
+
--Button-background-active: var(--Button-tertiary-background-active);
|
|
760
|
+
--Button-color: var(--Button-tertiary-color);
|
|
761
|
+
}
|
|
762
|
+
.wds-Button--tertiary .wds-Button-icon--end {
|
|
763
|
+
color: var(--color-interactive-primary);
|
|
764
|
+
}
|
|
765
|
+
.wds-Button--minimal {
|
|
766
|
+
--Button-background: var(--Button-minimal-background);
|
|
767
|
+
--Button-background-hover: var(--Button-minimal-background-hover);
|
|
768
|
+
--Button-background-active: var(--Button-minimal-background-active);
|
|
769
|
+
--Button-color: var(--Button-minimal-color);
|
|
770
|
+
}
|
|
771
|
+
.wds-Button--minimal,
|
|
772
|
+
.wds-Button--minimal:hover,
|
|
773
|
+
.wds-Button--minimal:active,
|
|
774
|
+
.wds-Button--minimal:focus {
|
|
775
|
+
-webkit-text-decoration: underline;
|
|
776
|
+
text-decoration: underline;
|
|
777
|
+
text-underline-offset: 3px;
|
|
778
|
+
text-decoration-thickness: 1px;
|
|
779
|
+
}
|
|
780
|
+
.wds-Button--negative.wds-Button--primary {
|
|
781
|
+
--Button-background: var(--Button-primary-negative-background);
|
|
782
|
+
--Button-background-hover: var(--Button-primary-negative-background-hover);
|
|
783
|
+
--Button-background-active: var(--Button-primary-negative-background-active);
|
|
784
|
+
--Button-color: var(--Button-primary-negative-color);
|
|
785
|
+
}
|
|
786
|
+
.wds-Button--negative.wds-Button--secondary {
|
|
787
|
+
--Button-background: var(--Button-secondary-negative-background);
|
|
788
|
+
--Button-background-hover: var(--Button-secondary-negative-background-hover);
|
|
789
|
+
--Button-background-active: var(--Button-secondary-negative-background-active);
|
|
790
|
+
--Button-color: var(--Button-secondary-negative-color);
|
|
791
|
+
}
|
|
792
|
+
.wds-Button--large {
|
|
793
|
+
padding: var(--Button-large-padding);
|
|
794
|
+
}
|
|
795
|
+
.wds-Button--medium {
|
|
796
|
+
padding: var(--Button-medium-padding);
|
|
797
|
+
}
|
|
798
|
+
.wds-Button--medium:has(.wds-Button-avatars) {
|
|
799
|
+
padding-inline-start: 8px;
|
|
800
|
+
padding-inline-start: var(--size-8);
|
|
801
|
+
}
|
|
802
|
+
.wds-Button--medium:has(.wds-Button-icon--end) {
|
|
803
|
+
padding-inline-end: 8px;
|
|
804
|
+
padding-inline-end: var(--size-8);
|
|
805
|
+
}
|
|
806
|
+
.wds-Button--medium .wds-Button-icon--start {
|
|
807
|
+
margin-inline-end: var(--Button-label-gap);
|
|
808
|
+
}
|
|
809
|
+
.wds-Button--small {
|
|
810
|
+
padding: var(--Button-small-padding);
|
|
811
|
+
}
|
|
812
|
+
.wds-Button--small:has(.wds-Button-icon--start) {
|
|
813
|
+
padding-inline-start: 8px;
|
|
814
|
+
padding-inline-start: var(--size-8);
|
|
815
|
+
}
|
|
816
|
+
.wds-Button--small:has(.wds-Button-icon--end) {
|
|
817
|
+
padding-inline-end: 8px;
|
|
818
|
+
padding-inline-end: var(--size-8);
|
|
819
|
+
}
|
|
820
|
+
.wds-Button--block {
|
|
821
|
+
width: 100%;
|
|
822
|
+
}
|
|
823
|
+
.wds-Button-avatars {
|
|
824
|
+
display: inline-flex;
|
|
825
|
+
}
|
|
826
|
+
.wds-Button-avatars .np-avatar-view .np-avatar-view-content {
|
|
827
|
+
color: var(--Button-color);
|
|
828
|
+
}
|
|
829
|
+
.wds-Button-icon {
|
|
830
|
+
display: inline-block;
|
|
831
|
+
}
|
|
832
|
+
.wds-Button-content {
|
|
833
|
+
position: relative;
|
|
834
|
+
}
|
|
835
|
+
.wds-Button-content--loading .wds-Button-label,
|
|
836
|
+
.wds-Button-content--loading .wds-Button-media,
|
|
837
|
+
.wds-Button-content--loading .wds-Button-icon {
|
|
838
|
+
visibility: hidden;
|
|
839
|
+
opacity: 0;
|
|
840
|
+
}
|
|
841
|
+
.wds-Button-label {
|
|
842
|
+
display: flex;
|
|
843
|
+
justify-content: center;
|
|
844
|
+
align-items: center;
|
|
845
|
+
gap: var(--Button-label-gap);
|
|
846
|
+
position: relative;
|
|
847
|
+
}
|
|
848
|
+
.wds-Button-loader {
|
|
849
|
+
position: absolute;
|
|
850
|
+
width: 100%;
|
|
851
|
+
height: 100%;
|
|
852
|
+
}
|
|
853
|
+
.wds-Button-loader .process-circle {
|
|
854
|
+
stroke: var(--Button-color);
|
|
855
|
+
}
|
|
856
|
+
/* Avatar border transparency */
|
|
857
|
+
/* dark buttons get 20% transparency, light buttons get 12% */
|
|
858
|
+
.wds-Button-avatars .np-circle {
|
|
859
|
+
--circle-border-color: color-mix(in srgb, var(--Button-color) 20%, transparent);
|
|
860
|
+
}
|
|
861
|
+
.np-theme-personal:not(.np-theme-personal--dark):not(.np-theme-personal--forest-green):not(.np-theme-personal--bright-green) .wds-Button--secondary.wds-Button--negative .wds-Button-avatars .np-circle,
|
|
862
|
+
.np-theme-personal:not(.np-theme-personal--dark):not(.np-theme-personal--forest-green):not(.np-theme-personal--bright-green) .wds-Button--secondary .wds-Button-avatars .np-circle,
|
|
863
|
+
.np-theme-personal:not(.np-theme-personal--dark):not(.np-theme-personal--forest-green):not(.np-theme-personal--bright-green) .wds-Button--tertiary .wds-Button-avatars .np-circle,
|
|
864
|
+
.np-theme-personal:not(.np-theme-personal--dark):not(.np-theme-personal--forest-green):not(.np-theme-personal--bright-green) .wds-Button--minimal .wds-Button-avatars .np-circle {
|
|
865
|
+
--circle-border-color: color-mix(in srgb, var(--Button-color) 12%, transparent);
|
|
866
|
+
}
|
|
867
|
+
.np-theme-personal--dark .wds-Button--primary .wds-Button-avatars .np-circle,
|
|
868
|
+
.np-theme-personal--dark .wds-Button--primary.wds-Button--negative .wds-Button-avatars .np-circle,
|
|
869
|
+
.np-theme-personal--forest-green .wds-Button--primary .wds-Button-avatars .np-circle,
|
|
870
|
+
.np-theme-personal--forest-green .wds-Button--primary.wds-Button--negative .wds-Button-avatars .np-circle {
|
|
871
|
+
--circle-border-color: color-mix(in srgb, var(--Button-color) 12%, transparent);
|
|
872
|
+
}
|
|
873
|
+
.np-theme-personal--bright-green .wds-Button--tertiary .wds-Button-avatars .np-circle,
|
|
874
|
+
.np-theme-personal--bright-green .wds-Button--minimal .wds-Button-avatars .np-circle {
|
|
875
|
+
--circle-border-color: color-mix(in srgb, var(--Button-color) 12%, transparent);
|
|
876
|
+
}
|
|
877
|
+
.critical-comms .wds-Button {
|
|
878
|
+
--Button-background: var(--color-contrast-overlay);
|
|
879
|
+
}
|
|
880
|
+
[dir="rtl"] .wds-Button .tw-icon-chevron-right,[dir="rtl"] .wds-Button .tw-icon-arrow-right,[dir="rtl"] .wds-Button .tw-icon-chevron-left,[dir="rtl"] .wds-Button .tw-icon-arrow-left,[dir="rtl"] .wds-Button .tw-icon-arrow-diagonal-down,[dir="rtl"] .wds-Button .tw-icon-arrow-diagonal-up,[dir="rtl"] .wds-Button .tw-icon-list,[dir="rtl"] .wds-Button .tw-icon-activity {
|
|
881
|
+
scale: -1 1;
|
|
882
|
+
}
|
|
709
883
|
.np-card {
|
|
710
884
|
overflow: hidden;
|
|
711
885
|
transition-property: transform, box-shadow;
|
|
@@ -4241,6 +4415,10 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
4241
4415
|
.status-circle.error {
|
|
4242
4416
|
background-color: var(--color-sentiment-negative);
|
|
4243
4417
|
}
|
|
4418
|
+
.status-circle.critical {
|
|
4419
|
+
background-color: #ffffff;
|
|
4420
|
+
background-color: var(--color-background-screen);
|
|
4421
|
+
}
|
|
4244
4422
|
.status-circle.neutral {
|
|
4245
4423
|
background-color: #5d7079;
|
|
4246
4424
|
background-color: var(--color-content-secondary);
|
package/src/main.less
CHANGED
|
@@ -30,13 +30,7 @@ const PrimitiveAnchor = forwardRef<HTMLAnchorElement, PrimitiveAnchorProps>(
|
|
|
30
30
|
},
|
|
31
31
|
ref,
|
|
32
32
|
) => {
|
|
33
|
-
const anchorClasses = clsx(
|
|
34
|
-
'wds-Anchor',
|
|
35
|
-
{
|
|
36
|
-
'wds-Anchor--disabled': disabled,
|
|
37
|
-
},
|
|
38
|
-
className,
|
|
39
|
-
);
|
|
33
|
+
const anchorClasses = clsx(className);
|
|
40
34
|
|
|
41
35
|
const handleClick = useCallback(
|
|
42
36
|
(event: React.MouseEvent<HTMLAnchorElement>) => {
|
|
@@ -96,7 +90,7 @@ const PrimitiveAnchor = forwardRef<HTMLAnchorElement, PrimitiveAnchorProps>(
|
|
|
96
90
|
* https://www.scottohara.me/blog/2021/05/28/disabled-links.html
|
|
97
91
|
*/
|
|
98
92
|
const anchorProps = {
|
|
99
|
-
'aria-disabled': disabled,
|
|
93
|
+
'aria-disabled': disabled || undefined,
|
|
100
94
|
className: anchorClasses,
|
|
101
95
|
'data-testid': testId,
|
|
102
96
|
href: disabled ? undefined : href,
|
|
@@ -13,16 +13,21 @@ export type PrimitiveAnchorElementRef = React.Ref<HTMLAnchorElement>;
|
|
|
13
13
|
export interface PrimitiveAnchorProps
|
|
14
14
|
extends BasePrimitiveProps,
|
|
15
15
|
StyleProp,
|
|
16
|
-
Omit<PrimitiveAnchorAttributes, 'role'> {
|
|
16
|
+
Omit<PrimitiveAnchorAttributes, 'role' | 'type'> {
|
|
17
17
|
/** Content of the anchor */
|
|
18
18
|
children?: ReactNode;
|
|
19
19
|
|
|
20
20
|
/** The URL to navigate to when the anchor is clicked */
|
|
21
|
-
href
|
|
21
|
+
href?: string | undefined;
|
|
22
22
|
|
|
23
23
|
/** Disable the anchor */
|
|
24
24
|
disabled?: boolean;
|
|
25
25
|
|
|
26
26
|
/** Reference to the anchor element */
|
|
27
27
|
ref?: PrimitiveAnchorElementRef;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* HTML anchor `target` attribute. If set to `_blank`, `rel="noopener noreferrer"` is automatically added to the rendered node.
|
|
31
|
+
*/
|
|
32
|
+
target?: HTMLAnchorElement['target'];
|
|
28
33
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/react';
|
|
2
|
-
import PrimitiveAnchor from '
|
|
2
|
+
import PrimitiveAnchor from '../src';
|
|
3
3
|
|
|
4
4
|
describe('PrimitiveAnchor', () => {
|
|
5
5
|
const defaultProps = {
|
|
@@ -27,7 +27,6 @@ describe('PrimitiveAnchor', () => {
|
|
|
27
27
|
renderAnchor(props);
|
|
28
28
|
|
|
29
29
|
const link = screen.getByRole('link');
|
|
30
|
-
expect(link).toHaveClass('wds-Anchor');
|
|
31
30
|
expect(link).toHaveClass('custom-class');
|
|
32
31
|
});
|
|
33
32
|
|
|
@@ -41,7 +40,6 @@ describe('PrimitiveAnchor', () => {
|
|
|
41
40
|
|
|
42
41
|
const link = screen.getByRole('link');
|
|
43
42
|
expect(link).toHaveAttribute('aria-disabled', 'true');
|
|
44
|
-
expect(link).toHaveClass('wds-Anchor--disabled');
|
|
45
43
|
expect(link).not.toHaveAttribute('href', 'https://example.com');
|
|
46
44
|
});
|
|
47
45
|
|
|
@@ -35,14 +35,7 @@ const PrimitiveButton = forwardRef<HTMLButtonElement, PrimitiveButtonProps>(
|
|
|
35
35
|
ref,
|
|
36
36
|
) => {
|
|
37
37
|
const intl = useIntl();
|
|
38
|
-
const classNames = clsx(
|
|
39
|
-
'wds-Button',
|
|
40
|
-
{
|
|
41
|
-
'wds-Button--disabled': disabled,
|
|
42
|
-
'wds-Button--loading': loading,
|
|
43
|
-
},
|
|
44
|
-
className,
|
|
45
|
-
);
|
|
38
|
+
const classNames = clsx(className);
|
|
46
39
|
|
|
47
40
|
const handleClick = useCallback(
|
|
48
41
|
(event: React.MouseEvent<HTMLButtonElement>) => {
|
|
@@ -102,10 +95,9 @@ const PrimitiveButton = forwardRef<HTMLButtonElement, PrimitiveButtonProps>(
|
|
|
102
95
|
* by assistive technologies, set to 'polite' during loading.
|
|
103
96
|
*/
|
|
104
97
|
const buttonProps = {
|
|
105
|
-
'aria-disabled':
|
|
106
|
-
'aria-
|
|
107
|
-
|
|
108
|
-
: props['aria-label'],
|
|
98
|
+
'aria-disabled': loading || undefined,
|
|
99
|
+
'aria-busy': loading || undefined,
|
|
100
|
+
'aria-label': loading ? intl.formatMessage(messages.loadingAriaLabel) : props['aria-label'],
|
|
109
101
|
'aria-live': (loading ? 'polite' : 'off') as 'polite' | 'off' | 'assertive' | undefined,
|
|
110
102
|
className: classNames,
|
|
111
103
|
'data-testid': testId,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { userEvent } from '@testing-library/user-event';
|
|
3
|
-
import PrimitiveButton from '..';
|
|
4
|
-
import messages from '../../../i18n/commonMessages/Button.messages';
|
|
1
|
+
import { screen } from '@testing-library/react';
|
|
5
2
|
import { render } from '../../../test-utils';
|
|
3
|
+
import PrimitiveButton from '../src';
|
|
4
|
+
import allMessages from '../../../i18n';
|
|
6
5
|
|
|
7
6
|
describe('Button', () => {
|
|
8
7
|
const defaultProps = {
|
|
@@ -12,7 +11,7 @@ describe('Button', () => {
|
|
|
12
11
|
const renderButton = (
|
|
13
12
|
props?: Partial<typeof defaultProps>,
|
|
14
13
|
locale = 'en',
|
|
15
|
-
localeMessages =
|
|
14
|
+
localeMessages = allMessages.en,
|
|
16
15
|
) => {
|
|
17
16
|
return render(
|
|
18
17
|
<PrimitiveButton {...defaultProps} {...props} />,
|
|
@@ -36,7 +35,6 @@ describe('Button', () => {
|
|
|
36
35
|
renderButton(props);
|
|
37
36
|
|
|
38
37
|
const button = screen.getByRole('button');
|
|
39
|
-
expect(button).toHaveClass('wds-Button');
|
|
40
38
|
expect(button).toHaveClass('custom-class');
|
|
41
39
|
});
|
|
42
40
|
|
|
@@ -49,10 +47,20 @@ describe('Button', () => {
|
|
|
49
47
|
renderButton(props);
|
|
50
48
|
|
|
51
49
|
const button = screen.getByRole('button');
|
|
52
|
-
expect(button).toHaveClass('wds-Button--disabled');
|
|
53
50
|
expect(button).toBeDisabled();
|
|
54
51
|
});
|
|
55
52
|
|
|
53
|
+
it('disables and announces the button as busy in loading mode', () => {
|
|
54
|
+
const props = {
|
|
55
|
+
...defaultProps,
|
|
56
|
+
loading: true,
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
renderButton(props);
|
|
60
|
+
|
|
61
|
+
expect(screen.getByRole('button', { busy: true })).toHaveAttribute('aria-disabled', 'true');
|
|
62
|
+
});
|
|
63
|
+
|
|
56
64
|
it('sets data-testid attribute', () => {
|
|
57
65
|
const props = {
|
|
58
66
|
...defaultProps,
|
|
@@ -101,12 +109,7 @@ describe('Button', () => {
|
|
|
101
109
|
loading: true,
|
|
102
110
|
};
|
|
103
111
|
|
|
104
|
-
|
|
105
|
-
...messages,
|
|
106
|
-
'neptune.Button.loadingAriaLabel': 'cargando',
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
renderButton(props, 'es', spanishMessages);
|
|
112
|
+
renderButton(props, 'es', allMessages.es);
|
|
110
113
|
|
|
111
114
|
const button = screen.getByRole('button');
|
|
112
115
|
expect(button).toHaveAttribute('aria-label', 'cargando');
|
|
@@ -17,6 +17,10 @@
|
|
|
17
17
|
.status-circle.error {
|
|
18
18
|
background-color: var(--color-sentiment-negative);
|
|
19
19
|
}
|
|
20
|
+
.status-circle.critical {
|
|
21
|
+
background-color: #ffffff;
|
|
22
|
+
background-color: var(--color-background-screen);
|
|
23
|
+
}
|
|
20
24
|
.status-circle.neutral {
|
|
21
25
|
background-color: #5d7079;
|
|
22
26
|
background-color: var(--color-content-secondary);
|
|
@@ -19,6 +19,12 @@ export default defineMessages({
|
|
|
19
19
|
description:
|
|
20
20
|
'Visually hidden label read by screen readers, describing the Warning icon – normally a prefix to remaining visible content, e.g. validation result.',
|
|
21
21
|
},
|
|
22
|
+
criticalLabel: {
|
|
23
|
+
id: 'neptune.StatusIcon.iconLabel.critical',
|
|
24
|
+
defaultMessage: 'Critical:',
|
|
25
|
+
description:
|
|
26
|
+
'Visually hidden label read by screen readers, describing the Critical icon – normally a prefix to remaining visible content, e.g. validation result.',
|
|
27
|
+
},
|
|
22
28
|
pendingLabel: {
|
|
23
29
|
id: 'neptune.StatusIcon.iconLabel.pending',
|
|
24
30
|
defaultMessage: 'Pending:',
|
|
@@ -52,6 +52,10 @@ const StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 40, iconLabel }: S
|
|
|
52
52
|
Icon: Alert,
|
|
53
53
|
defaultIconLabel: intl.formatMessage(messages.warningLabel),
|
|
54
54
|
},
|
|
55
|
+
[Sentiment.CRITICAL]: {
|
|
56
|
+
Icon: Alert,
|
|
57
|
+
defaultIconLabel: intl.formatMessage(messages.criticalLabel),
|
|
58
|
+
},
|
|
55
59
|
[Sentiment.PENDING]: {
|
|
56
60
|
Icon: ClockBorderless,
|
|
57
61
|
defaultIconLabel: intl.formatMessage(messages.pendingLabel),
|
|
@@ -76,7 +80,10 @@ const StatusIcon = ({ sentiment = 'neutral', size: sizeProp = 40, iconLabel }: S
|
|
|
76
80
|
};
|
|
77
81
|
const { Icon, defaultIconLabel } = iconMetaBySentiment[sentiment];
|
|
78
82
|
|
|
79
|
-
const iconColor =
|
|
83
|
+
const iconColor =
|
|
84
|
+
sentiment === 'warning' || sentiment === 'pending' || sentiment === 'critical'
|
|
85
|
+
? 'dark'
|
|
86
|
+
: 'light';
|
|
80
87
|
const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);
|
|
81
88
|
const size = mapLegacySize[sizeProp] ?? sizeProp;
|
|
82
89
|
return (
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
declare module '@storybook/react' {
|
|
2
2
|
interface Parameters {
|
|
3
3
|
/** Prefer using `storyConfig` for configuring variants */
|
|
4
|
-
variants?: (
|
|
4
|
+
variants?: (
|
|
5
|
+
| 'default'
|
|
6
|
+
| 'light'
|
|
7
|
+
| 'dark'
|
|
8
|
+
| 'bright-green'
|
|
9
|
+
| 'forest-green'
|
|
10
|
+
| 'rtl'
|
|
11
|
+
| (string & Record<string, unknown>)
|
|
12
|
+
)[];
|
|
5
13
|
/** Used by Chromatic */
|
|
6
14
|
chromatic?: ChromaticParameters;
|
|
7
15
|
viewport?: {
|
|
@@ -30,7 +30,16 @@ interface StoryConfig {
|
|
|
30
30
|
*
|
|
31
31
|
* @default undefined
|
|
32
32
|
*/
|
|
33
|
-
variants?: (
|
|
33
|
+
variants?: (
|
|
34
|
+
| 'default'
|
|
35
|
+
| 'light'
|
|
36
|
+
| 'dark'
|
|
37
|
+
| 'bright-green'
|
|
38
|
+
| 'forest-green'
|
|
39
|
+
| 'rtl'
|
|
40
|
+
| 'mobile'
|
|
41
|
+
| '400%'
|
|
42
|
+
)[];
|
|
34
43
|
}
|
|
35
44
|
|
|
36
45
|
const getViewportWidth = (viewport: (typeof viewports)[keyof typeof viewports]) => {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ThemedLayer } from '@wise/components-theming';
|
|
2
1
|
import { useState, useEffect } from 'react';
|
|
3
2
|
import { createPortal } from 'react-dom';
|
|
4
3
|
|
|
@@ -11,14 +10,6 @@ export default function withNextPortalWrapper<T extends Record<string, any>>(
|
|
|
11
10
|
useEffect(() => {
|
|
12
11
|
setMounted(true);
|
|
13
12
|
}, [setMounted]);
|
|
14
|
-
|
|
15
|
-
return mounted
|
|
16
|
-
? createPortal(
|
|
17
|
-
<ThemedLayer>
|
|
18
|
-
<Component {...props} />
|
|
19
|
-
</ThemedLayer>,
|
|
20
|
-
document.body,
|
|
21
|
-
)
|
|
22
|
-
: null;
|
|
13
|
+
return mounted ? createPortal(<Component {...props} />, document.body) : null;
|
|
23
14
|
};
|
|
24
15
|
}
|