@transferwise/components 0.0.0-experimental-28eac06 → 0.0.0-experimental-9b6d886
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 +17 -17
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +14 -14
- package/build/alert/Alert.mjs.map +1 -1
- package/build/avatarLayout/AvatarLayout.js +2 -9
- package/build/avatarLayout/AvatarLayout.js.map +1 -1
- package/build/avatarLayout/AvatarLayout.mjs +2 -9
- package/build/avatarLayout/AvatarLayout.mjs.map +1 -1
- package/build/button/Button.js +79 -86
- package/build/button/Button.js.map +1 -1
- package/build/button/Button.mjs +80 -87
- package/build/button/Button.mjs.map +1 -1
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/circularButton/CircularButton.mjs.map +1 -1
- package/build/common/action/Action.js +15 -26
- package/build/common/action/Action.js.map +1 -1
- package/build/common/action/Action.mjs +15 -26
- package/build/common/action/Action.mjs.map +1 -1
- package/build/common/propsValues/sentiment.js +0 -1
- package/build/common/propsValues/sentiment.js.map +1 -1
- package/build/common/propsValues/sentiment.mjs +0 -1
- package/build/common/propsValues/sentiment.mjs.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js +73 -10
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs +74 -11
- package/build/criticalBanner/CriticalCommsBanner.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 +0 -1
- package/build/i18n/en.json.js +0 -1
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/en.json.mjs +0 -1
- package/build/i18n/en.json.mjs.map +1 -1
- package/build/i18n/ja.json +1 -0
- package/build/i18n/ja.json.js +1 -0
- package/build/i18n/ja.json.js.map +1 -1
- package/build/i18n/ja.json.mjs +1 -0
- package/build/i18n/ja.json.mjs.map +1 -1
- package/build/i18n/pt.json +1 -0
- package/build/i18n/pt.json.js +1 -0
- package/build/i18n/pt.json.js.map +1 -1
- package/build/i18n/pt.json.mjs +1 -0
- package/build/i18n/pt.json.mjs.map +1 -1
- package/build/i18n/ru.json +1 -0
- package/build/i18n/ru.json.js +1 -0
- package/build/i18n/ru.json.js.map +1 -1
- package/build/i18n/ru.json.mjs +1 -0
- package/build/i18n/ru.json.mjs.map +1 -1
- package/build/i18n/zh-HK.json +1 -0
- package/build/i18n/zh-HK.json.js +1 -0
- package/build/i18n/zh-HK.json.js.map +1 -1
- package/build/i18n/zh-HK.json.mjs +1 -0
- package/build/i18n/zh-HK.json.mjs.map +1 -1
- package/build/index.js +2 -2
- package/build/index.mjs +1 -1
- package/build/link/Link.js +3 -8
- package/build/link/Link.js.map +1 -1
- package/build/link/Link.mjs +3 -8
- package/build/link/Link.mjs.map +1 -1
- package/build/main.css +70 -267
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js +4 -2
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js.map +1 -1
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs +4 -2
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs.map +1 -1
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.js +5 -3
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.js.map +1 -1
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs +5 -3
- 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 +1 -5
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.messages.js +0 -3
- package/build/statusIcon/StatusIcon.messages.js.map +1 -1
- package/build/statusIcon/StatusIcon.messages.mjs +0 -3
- package/build/statusIcon/StatusIcon.messages.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +1 -5
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/styles/avatarLayout/AvatarLayout.css +0 -11
- package/build/styles/button/Button.css +15 -230
- package/build/styles/criticalBanner/CriticalCommsBanner.css +73 -21
- package/build/styles/main.css +70 -267
- package/build/types/alert/Alert.d.ts +4 -3
- 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 +23 -2
- package/build/types/button/Button.d.ts.map +1 -1
- package/build/types/button/index.d.ts +2 -2
- package/build/types/button/index.d.ts.map +1 -1
- package/build/types/circularButton/CircularButton.d.ts.map +1 -1
- package/build/types/common/action/Action.d.ts +2 -5
- package/build/types/common/action/Action.d.ts.map +1 -1
- package/build/types/common/propsValues/sentiment.d.ts +0 -1
- package/build/types/common/propsValues/sentiment.d.ts.map +1 -1
- package/build/types/criticalBanner/CriticalCommsBanner.d.ts.map +1 -1
- package/build/types/index.d.ts +1 -0
- package/build/types/index.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 +2 -6
- 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 +0 -5
- package/build/types/statusIcon/StatusIcon.messages.d.ts.map +1 -1
- package/build/types/test-utils/index.d.ts +0 -2
- 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/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/package.json +3 -3
- package/src/alert/Alert.spec.tsx +30 -0
- package/src/alert/Alert.story.tsx +1 -34
- package/src/alert/Alert.tests.story.tsx +1 -1
- package/src/alert/Alert.tsx +15 -20
- package/src/avatarLayout/AvatarLayout.css +0 -11
- package/src/avatarLayout/AvatarLayout.less +1 -18
- package/src/avatarLayout/AvatarLayout.tsx +2 -10
- package/src/button/Button.css +15 -230
- package/src/button/Button.less +14 -242
- package/src/button/Button.spec.tsx +226 -215
- package/src/button/Button.story.tsx +134 -761
- package/src/button/Button.tsx +132 -103
- package/src/button/__snapshots__/Button.spec.tsx.snap +309 -0
- package/src/button/index.ts +3 -2
- package/src/circularButton/CircularButton.tsx +0 -1
- package/src/common/action/Action.tsx +22 -40
- package/src/common/propsValues/sentiment.ts +0 -1
- package/src/criticalBanner/CriticalCommsBanner.css +73 -21
- package/src/criticalBanner/CriticalCommsBanner.less +70 -24
- package/src/criticalBanner/CriticalCommsBanner.story.tsx +4 -26
- package/src/criticalBanner/CriticalCommsBanner.tsx +50 -8
- package/src/field/Field.story.tsx +1 -1
- package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +2 -1
- package/src/i18n/en.json +0 -1
- package/src/i18n/ja.json +1 -0
- package/src/i18n/pt.json +1 -0
- package/src/i18n/ru.json +1 -0
- package/src/i18n/zh-HK.json +1 -0
- package/src/index.ts +1 -0
- package/src/inputs/SelectInput.story.tsx +1 -1
- package/src/label/Label.story.tsx +1 -1
- package/src/link/Link.tsx +6 -15
- package/src/main.css +70 -267
- package/src/main.less +0 -1
- package/src/primitives/PrimitiveAnchor/src/PrimitiveAnchor.tsx +8 -2
- package/src/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.ts +2 -7
- package/src/primitives/PrimitiveAnchor/test/PrimitiveAnchor.spec.tsx +3 -1
- package/src/primitives/PrimitiveButton/src/PrimitiveButton.tsx +12 -4
- package/src/primitives/PrimitiveButton/test/PrimitiveButton.spec.tsx +13 -16
- package/src/radio/Radio.spec.tsx +73 -0
- package/src/radio/Radio.story.tsx +22 -52
- package/src/radioGroup/RadioGroup.spec.tsx +91 -0
- package/src/radioGroup/RadioGroup.story.tsx +3 -5
- package/src/statusIcon/StatusIcon.less +0 -1
- package/src/statusIcon/StatusIcon.messages.ts +0 -6
- package/src/statusIcon/StatusIcon.tsx +1 -8
- package/src/test-utils/Parameters.d.ts +1 -9
- package/src/test-utils/story-config.ts +1 -10
- package/build/button/Button.resolver.js +0 -74
- package/build/button/Button.resolver.js.map +0 -1
- package/build/button/Button.resolver.mjs +0 -72
- package/build/button/Button.resolver.mjs.map +0 -1
- package/build/button/LegacyButton.js +0 -114
- package/build/button/LegacyButton.js.map +0 -1
- package/build/button/LegacyButton.mjs +0 -112
- package/build/button/LegacyButton.mjs.map +0 -1
- package/build/styles/button/Button.vars.css +0 -46
- package/build/styles/button/LegacyButton.css +0 -23
- package/build/types/button/Button.resolver.d.ts +0 -35
- package/build/types/button/Button.resolver.d.ts.map +0 -1
- package/build/types/button/Button.types.d.ts +0 -70
- package/build/types/button/Button.types.d.ts.map +0 -1
- package/build/types/button/LegacyButton.d.ts +0 -44
- package/build/types/button/LegacyButton.d.ts.map +0 -1
- package/src/button/Button.accessibility.docs.mdx +0 -103
- package/src/button/Button.resolver.tsx +0 -73
- package/src/button/Button.tests.story.tsx +0 -27
- package/src/button/Button.types.ts +0 -92
- package/src/button/Button.vars.css +0 -46
- package/src/button/Button.vars.less +0 -55
- package/src/button/LegacyButton.css +0 -23
- package/src/button/LegacyButton.less +0 -24
- package/src/button/LegacyButton.spec.tsx +0 -147
- package/src/button/LegacyButton.story.tsx +0 -228
- package/src/button/LegacyButton.tsx +0 -177
- package/src/radio/Radio.rtl.spec.tsx +0 -24
- package/src/radio/Radio.spec.js +0 -76
- package/src/radio/__snapshots__/Radio.rtl.spec.tsx.snap +0 -49
- package/src/radioGroup/RadioGroup.rtl.spec.tsx +0 -30
- package/src/radioGroup/RadioGroup.spec.js +0 -90
package/src/main.css
CHANGED
|
@@ -1,25 +1,77 @@
|
|
|
1
|
-
.critical-comms
|
|
2
|
-
color: var(--color-
|
|
3
|
-
|
|
1
|
+
div.critical-comms {
|
|
2
|
+
--critical-comms-background-color: var(--color-background-negative);
|
|
3
|
+
--critical-comms-title-color: var(--color-content-negative);
|
|
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;
|
|
4
12
|
}
|
|
5
|
-
.
|
|
6
|
-
|
|
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);
|
|
7
22
|
}
|
|
8
|
-
.critical-comms .
|
|
9
|
-
|
|
10
|
-
|
|
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);
|
|
11
26
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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;
|
|
18
44
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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;
|
|
54
|
+
}
|
|
55
|
+
@media (max-width: 767px) {
|
|
56
|
+
div.critical-comms .critical-comms--cta {
|
|
57
|
+
padding-left: var(--critical-comms-subtitle-color-padding-left);
|
|
58
|
+
padding-top: var(--critical-comms-vertical-spacing);
|
|
59
|
+
min-width: 100%;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
div.critical-comms .critical-comms-body {
|
|
63
|
+
display: flex;
|
|
64
|
+
width: 100%;
|
|
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;
|
|
23
75
|
}
|
|
24
76
|
}
|
|
25
77
|
.tw-date-lookup-calendar > tbody > tr > td.weekend button {
|
|
@@ -466,18 +518,10 @@
|
|
|
466
518
|
-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);
|
|
467
519
|
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);
|
|
468
520
|
}
|
|
469
|
-
[dir="rtl"] .np-avatar-layout-diagonal-mask {
|
|
470
|
-
-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);
|
|
471
|
-
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);
|
|
472
|
-
}
|
|
473
521
|
.np-avatar-layout-diagonal-child {
|
|
474
522
|
margin-left: calc(var(--np-avatar-layout-size) - var(--np-avatar-size) * 2);
|
|
475
523
|
margin-top: calc(var(--np-avatar-layout-size) - var(--np-avatar-size));
|
|
476
524
|
}
|
|
477
|
-
[dir="rtl"] .np-avatar-layout-diagonal-child {
|
|
478
|
-
margin-left: 0;
|
|
479
|
-
margin-right: calc(var(--np-avatar-layout-size) - var(--np-avatar-size) * 2);
|
|
480
|
-
}
|
|
481
525
|
.np-avatar-layout-horizontal {
|
|
482
526
|
width: calc(var(--np-avatar-size) * var(--np-avatar-avatars-count) - (var(--np-avatar-offset) * (var(--np-avatar-avatars-count) - 1)));
|
|
483
527
|
width: calc(var(--np-avatar-size) * var(--np-avatar-avatars-count) - calc(var(--np-avatar-offset) * calc(var(--np-avatar-avatars-count) - 1)));
|
|
@@ -492,9 +536,6 @@
|
|
|
492
536
|
.np-avatar-layout-horizontal-child {
|
|
493
537
|
margin-left: calc(var(--np-avatar-offset) * -1);
|
|
494
538
|
}
|
|
495
|
-
[dir="rtl"] .np-avatar-layout-horizontal-child {
|
|
496
|
-
margin-right: calc(var(--np-avatar-offset) * -1);
|
|
497
|
-
}
|
|
498
539
|
.np-icon-button {
|
|
499
540
|
border: none;
|
|
500
541
|
}
|
|
@@ -665,244 +706,6 @@
|
|
|
665
706
|
.np-btn.disabled[class] {
|
|
666
707
|
pointer-events: auto;
|
|
667
708
|
}
|
|
668
|
-
.wds-Button {
|
|
669
|
-
--Button-background: var(--color-interactive-accent);
|
|
670
|
-
--Button-background-hover: var(--color-interactive-accent-hover);
|
|
671
|
-
--Button-background-active: var(--color-interactive-accent-active);
|
|
672
|
-
--Button-color: var(--color-interactive-control);
|
|
673
|
-
--Button-border-radius: var(--radius-full);
|
|
674
|
-
--Button-label-gap: var(--size-4);
|
|
675
|
-
--Button-large-padding: var(--size-12) var(--size-16);
|
|
676
|
-
--Button-medium-padding: var(--size-8) var(--size-12);
|
|
677
|
-
--Button-small-padding: var(--size-5) var(--size-12);
|
|
678
|
-
--Button-avatar-border-color: var(--color-border-neutral);
|
|
679
|
-
--Button-transition-duration: 150ms;
|
|
680
|
-
--Button-transition-easing: ease-in-out;
|
|
681
|
-
--Button-secondary-background: var(--color-interactive-neutral);
|
|
682
|
-
--Button-secondary-background-hover: var(--color-interactive-neutral-hover);
|
|
683
|
-
--Button-secondary-background-active: var(--color-interactive-neutral-active);
|
|
684
|
-
--Button-secondary-color: var(--color-interactive-primary);
|
|
685
|
-
--Button-tertiary-background: var(--color-background-neutral);
|
|
686
|
-
--Button-tertiary-background-hover: var(--color-background-neutral-hover);
|
|
687
|
-
--Button-tertiary-background-active: var(--color-background-neutral-active);
|
|
688
|
-
--Button-tertiary-color: var(--color-content-primary);
|
|
689
|
-
--Button-minimal-background: transparent;
|
|
690
|
-
--Button-minimal-background-hover: var(--color-background-screen-hover);
|
|
691
|
-
--Button-minimal-background-active: var(--color-background-screen-active);
|
|
692
|
-
--Button-minimal-color: var(--color-interactive-primary);
|
|
693
|
-
--Button-primary-negative-background: var(--color-sentiment-negative-primary);
|
|
694
|
-
--Button-primary-negative-background-hover: var(--color-sentiment-negative-primary-hover);
|
|
695
|
-
--Button-primary-negative-background-active: var(--color-sentiment-negative-primary-active);
|
|
696
|
-
--Button-primary-negative-color: var(--color-contrast-overlay);
|
|
697
|
-
--Button-secondary-negative-background: var(--color-sentiment-negative-secondary);
|
|
698
|
-
--Button-secondary-negative-background-hover: var(--color-sentiment-negative-secondary-hover);
|
|
699
|
-
--Button-secondary-negative-background-active: var(--color-sentiment-negative-secondary-active);
|
|
700
|
-
--Button-secondary-negative-color: var(--color-sentiment-negative-primary);
|
|
701
|
-
}
|
|
702
|
-
.np-theme-personal--bright-green .wds-Button {
|
|
703
|
-
--Button-primary-negative-color: var(--color-white);
|
|
704
|
-
--Button-secondary-color: var(--color-interactive-control);
|
|
705
|
-
--Button-secondary-negative-color: var(--color-white);
|
|
706
|
-
}
|
|
707
|
-
.np-theme-personal--forest-green .wds-Button {
|
|
708
|
-
--Button-secondary-background: var(--color-interactive-neutral);
|
|
709
|
-
--Button-secondary-negative-background: var(--color-sentiment-negative-primary);
|
|
710
|
-
--Button-secondary-negative-background-hover: var(--color-sentiment-negative-primary-hover);
|
|
711
|
-
--Button-secondary-negative-background-active: var(--color-sentiment-negative-primary-active);
|
|
712
|
-
--Button-secondary-negative-color: var(--color-contrast-overlay);
|
|
713
|
-
}
|
|
714
|
-
/* Button Styles */
|
|
715
|
-
.wds-Button {
|
|
716
|
-
display: inline-flex;
|
|
717
|
-
flex: none;
|
|
718
|
-
width: auto;
|
|
719
|
-
align-items: center;
|
|
720
|
-
justify-content: center;
|
|
721
|
-
vertical-align: middle;
|
|
722
|
-
text-align: center;
|
|
723
|
-
white-space: nowrap;
|
|
724
|
-
word-wrap: break-word;
|
|
725
|
-
-webkit-appearance: none;
|
|
726
|
-
-moz-appearance: none;
|
|
727
|
-
appearance: none;
|
|
728
|
-
background-color: var(--Button-background);
|
|
729
|
-
border: none;
|
|
730
|
-
border-radius: var(--Button-border-radius);
|
|
731
|
-
color: var(--Button-color);
|
|
732
|
-
cursor: pointer;
|
|
733
|
-
transition: color, background-color var(--Button-transition-duration) var(--Button-transition-easing);
|
|
734
|
-
}
|
|
735
|
-
.wds-Button,
|
|
736
|
-
.wds-Button:hover,
|
|
737
|
-
.wds-Button:active,
|
|
738
|
-
.wds-Button:focus {
|
|
739
|
-
-webkit-text-decoration: none;
|
|
740
|
-
text-decoration: none;
|
|
741
|
-
}
|
|
742
|
-
.wds-Button:hover {
|
|
743
|
-
background-color: var(--Button-background-hover);
|
|
744
|
-
}
|
|
745
|
-
.wds-Button:active {
|
|
746
|
-
background-color: var(--Button-background-active);
|
|
747
|
-
}
|
|
748
|
-
.wds-Button.wds-Button--disabled,
|
|
749
|
-
.wds-Button:disabled {
|
|
750
|
-
filter: none;
|
|
751
|
-
mix-blend-mode: luminosity;
|
|
752
|
-
opacity: 0.45;
|
|
753
|
-
cursor: not-allowed;
|
|
754
|
-
}
|
|
755
|
-
.wds-Button.wds-Button--disabled,
|
|
756
|
-
.wds-Button:disabled,
|
|
757
|
-
.wds-Button.wds-Button--disabled:hover,
|
|
758
|
-
.wds-Button:disabled:hover,
|
|
759
|
-
.wds-Button.wds-Button--disabled:active,
|
|
760
|
-
.wds-Button:disabled:active {
|
|
761
|
-
background-color: var(--Button-background);
|
|
762
|
-
}
|
|
763
|
-
.wds-Button--secondary {
|
|
764
|
-
--Button-background: var(--Button-secondary-background);
|
|
765
|
-
--Button-background-hover: var(--Button-secondary-background-hover);
|
|
766
|
-
--Button-background-active: var(--Button-secondary-background-active);
|
|
767
|
-
--Button-color: var(--Button-secondary-color);
|
|
768
|
-
}
|
|
769
|
-
.wds-Button--tertiary {
|
|
770
|
-
--Button-background: var(--Button-tertiary-background);
|
|
771
|
-
--Button-background-hover: var(--Button-tertiary-background-hover);
|
|
772
|
-
--Button-background-active: var(--Button-tertiary-background-active);
|
|
773
|
-
--Button-color: var(--Button-tertiary-color);
|
|
774
|
-
}
|
|
775
|
-
.wds-Button--tertiary .wds-Button-icon--end {
|
|
776
|
-
color: var(--color-interactive-primary);
|
|
777
|
-
}
|
|
778
|
-
.wds-Button--minimal {
|
|
779
|
-
--Button-background: var(--Button-minimal-background);
|
|
780
|
-
--Button-background-hover: var(--Button-minimal-background-hover);
|
|
781
|
-
--Button-background-active: var(--Button-minimal-background-active);
|
|
782
|
-
--Button-color: var(--Button-minimal-color);
|
|
783
|
-
}
|
|
784
|
-
.wds-Button--minimal,
|
|
785
|
-
.wds-Button--minimal:hover,
|
|
786
|
-
.wds-Button--minimal:active,
|
|
787
|
-
.wds-Button--minimal:focus {
|
|
788
|
-
-webkit-text-decoration: underline;
|
|
789
|
-
text-decoration: underline;
|
|
790
|
-
text-underline-offset: 3px;
|
|
791
|
-
text-decoration-thickness: 1px;
|
|
792
|
-
}
|
|
793
|
-
.wds-Button--negative.wds-Button--primary {
|
|
794
|
-
--Button-background: var(--Button-primary-negative-background);
|
|
795
|
-
--Button-background-hover: var(--Button-primary-negative-background-hover);
|
|
796
|
-
--Button-background-active: var(--Button-primary-negative-background-active);
|
|
797
|
-
--Button-color: var(--Button-primary-negative-color);
|
|
798
|
-
}
|
|
799
|
-
.wds-Button--negative.wds-Button--secondary {
|
|
800
|
-
--Button-background: var(--Button-secondary-negative-background);
|
|
801
|
-
--Button-background-hover: var(--Button-secondary-negative-background-hover);
|
|
802
|
-
--Button-background-active: var(--Button-secondary-negative-background-active);
|
|
803
|
-
--Button-color: var(--Button-secondary-negative-color);
|
|
804
|
-
}
|
|
805
|
-
.wds-Button--large {
|
|
806
|
-
padding: var(--Button-large-padding);
|
|
807
|
-
}
|
|
808
|
-
.wds-Button--medium {
|
|
809
|
-
padding: var(--Button-medium-padding);
|
|
810
|
-
}
|
|
811
|
-
.wds-Button--medium:has(.wds-Button-avatars) {
|
|
812
|
-
padding-inline-start: 8px;
|
|
813
|
-
padding-inline-start: var(--size-8);
|
|
814
|
-
}
|
|
815
|
-
.wds-Button--medium:has(.wds-Button-icon--end) {
|
|
816
|
-
padding-inline-end: 8px;
|
|
817
|
-
padding-inline-end: var(--size-8);
|
|
818
|
-
}
|
|
819
|
-
.wds-Button--medium .wds-Button-icon--start {
|
|
820
|
-
margin-inline-end: var(--Button-label-gap);
|
|
821
|
-
}
|
|
822
|
-
.wds-Button--small {
|
|
823
|
-
padding: var(--Button-small-padding);
|
|
824
|
-
}
|
|
825
|
-
.wds-Button--small:has(.wds-Button-icon--start) {
|
|
826
|
-
padding-inline-start: 8px;
|
|
827
|
-
padding-inline-start: var(--size-8);
|
|
828
|
-
}
|
|
829
|
-
.wds-Button--small:has(.wds-Button-icon--end) {
|
|
830
|
-
padding-inline-end: 8px;
|
|
831
|
-
padding-inline-end: var(--size-8);
|
|
832
|
-
}
|
|
833
|
-
.wds-Button--block {
|
|
834
|
-
width: 100%;
|
|
835
|
-
}
|
|
836
|
-
.wds-Button-avatars {
|
|
837
|
-
display: inline-flex;
|
|
838
|
-
}
|
|
839
|
-
.wds-Button-avatars .np-avatar-view .np-avatar-view-content {
|
|
840
|
-
color: var(--Button-color);
|
|
841
|
-
}
|
|
842
|
-
.wds-Button-icon {
|
|
843
|
-
display: inline-block;
|
|
844
|
-
}
|
|
845
|
-
.wds-Button-icon--md {
|
|
846
|
-
--Button-iconSize: calc(var(--size-10) + var(--size-8));
|
|
847
|
-
}
|
|
848
|
-
.wds-Button-icon--sm {
|
|
849
|
-
--Button-iconSize: var(--size-16);
|
|
850
|
-
}
|
|
851
|
-
.wds-Button-icon svg {
|
|
852
|
-
width: var(--Button-iconSize);
|
|
853
|
-
height: var(--Button-iconSize);
|
|
854
|
-
}
|
|
855
|
-
.wds-Button-content {
|
|
856
|
-
position: relative;
|
|
857
|
-
}
|
|
858
|
-
.wds-Button-content--loading .wds-Button-label,
|
|
859
|
-
.wds-Button-content--loading .wds-Button-media,
|
|
860
|
-
.wds-Button-content--loading .wds-Button-icon {
|
|
861
|
-
visibility: hidden;
|
|
862
|
-
opacity: 0;
|
|
863
|
-
}
|
|
864
|
-
.wds-Button-label {
|
|
865
|
-
display: flex;
|
|
866
|
-
justify-content: center;
|
|
867
|
-
align-items: center;
|
|
868
|
-
gap: var(--Button-label-gap);
|
|
869
|
-
position: relative;
|
|
870
|
-
}
|
|
871
|
-
.wds-Button-loader {
|
|
872
|
-
position: absolute;
|
|
873
|
-
width: 100%;
|
|
874
|
-
height: 100%;
|
|
875
|
-
}
|
|
876
|
-
.wds-Button-loader .process-circle {
|
|
877
|
-
stroke: var(--Button-color);
|
|
878
|
-
}
|
|
879
|
-
/* Avatar border transparency */
|
|
880
|
-
/* dark buttons get 20% transparency, light buttons get 12% */
|
|
881
|
-
.wds-Button-avatars .np-circle {
|
|
882
|
-
--circle-border-color: color-mix(in srgb, var(--Button-color) 20%, transparent);
|
|
883
|
-
}
|
|
884
|
-
.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,
|
|
885
|
-
.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,
|
|
886
|
-
.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,
|
|
887
|
-
.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 {
|
|
888
|
-
--circle-border-color: color-mix(in srgb, var(--Button-color) 12%, transparent);
|
|
889
|
-
}
|
|
890
|
-
.np-theme-personal--dark .wds-Button--primary .wds-Button-avatars .np-circle,
|
|
891
|
-
.np-theme-personal--dark .wds-Button--primary.wds-Button--negative .wds-Button-avatars .np-circle,
|
|
892
|
-
.np-theme-personal--forest-green .wds-Button--primary .wds-Button-avatars .np-circle,
|
|
893
|
-
.np-theme-personal--forest-green .wds-Button--primary.wds-Button--negative .wds-Button-avatars .np-circle {
|
|
894
|
-
--circle-border-color: color-mix(in srgb, var(--Button-color) 12%, transparent);
|
|
895
|
-
}
|
|
896
|
-
.np-theme-personal--bright-green .wds-Button--tertiary .wds-Button-avatars .np-circle,
|
|
897
|
-
.np-theme-personal--bright-green .wds-Button--minimal .wds-Button-avatars .np-circle {
|
|
898
|
-
--circle-border-color: color-mix(in srgb, var(--Button-color) 12%, transparent);
|
|
899
|
-
}
|
|
900
|
-
.critical-comms .wds-Button {
|
|
901
|
-
--Button-background: var(--color-contrast-overlay);
|
|
902
|
-
}
|
|
903
|
-
[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 {
|
|
904
|
-
scale: -1 1;
|
|
905
|
-
}
|
|
906
709
|
.np-card {
|
|
907
710
|
overflow: hidden;
|
|
908
711
|
transition-property: transform, box-shadow;
|
package/src/main.less
CHANGED
|
@@ -30,7 +30,13 @@ const PrimitiveAnchor = forwardRef<HTMLAnchorElement, PrimitiveAnchorProps>(
|
|
|
30
30
|
},
|
|
31
31
|
ref,
|
|
32
32
|
) => {
|
|
33
|
-
const anchorClasses = clsx(
|
|
33
|
+
const anchorClasses = clsx(
|
|
34
|
+
'wds-Anchor',
|
|
35
|
+
{
|
|
36
|
+
'wds-Anchor--disabled': disabled,
|
|
37
|
+
},
|
|
38
|
+
className,
|
|
39
|
+
);
|
|
34
40
|
|
|
35
41
|
const handleClick = useCallback(
|
|
36
42
|
(event: React.MouseEvent<HTMLAnchorElement>) => {
|
|
@@ -90,7 +96,7 @@ const PrimitiveAnchor = forwardRef<HTMLAnchorElement, PrimitiveAnchorProps>(
|
|
|
90
96
|
* https://www.scottohara.me/blog/2021/05/28/disabled-links.html
|
|
91
97
|
*/
|
|
92
98
|
const anchorProps = {
|
|
93
|
-
'aria-disabled': disabled
|
|
99
|
+
'aria-disabled': disabled,
|
|
94
100
|
className: anchorClasses,
|
|
95
101
|
'data-testid': testId,
|
|
96
102
|
href: disabled ? undefined : href,
|
|
@@ -13,21 +13,16 @@ 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'> {
|
|
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;
|
|
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'];
|
|
33
28
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/react';
|
|
2
|
-
import PrimitiveAnchor from '
|
|
2
|
+
import PrimitiveAnchor from '..';
|
|
3
3
|
|
|
4
4
|
describe('PrimitiveAnchor', () => {
|
|
5
5
|
const defaultProps = {
|
|
@@ -27,6 +27,7 @@ describe('PrimitiveAnchor', () => {
|
|
|
27
27
|
renderAnchor(props);
|
|
28
28
|
|
|
29
29
|
const link = screen.getByRole('link');
|
|
30
|
+
expect(link).toHaveClass('wds-Anchor');
|
|
30
31
|
expect(link).toHaveClass('custom-class');
|
|
31
32
|
});
|
|
32
33
|
|
|
@@ -40,6 +41,7 @@ describe('PrimitiveAnchor', () => {
|
|
|
40
41
|
|
|
41
42
|
const link = screen.getByRole('link');
|
|
42
43
|
expect(link).toHaveAttribute('aria-disabled', 'true');
|
|
44
|
+
expect(link).toHaveClass('wds-Anchor--disabled');
|
|
43
45
|
expect(link).not.toHaveAttribute('href', 'https://example.com');
|
|
44
46
|
});
|
|
45
47
|
|
|
@@ -35,7 +35,14 @@ const PrimitiveButton = forwardRef<HTMLButtonElement, PrimitiveButtonProps>(
|
|
|
35
35
|
ref,
|
|
36
36
|
) => {
|
|
37
37
|
const intl = useIntl();
|
|
38
|
-
const classNames = clsx(
|
|
38
|
+
const classNames = clsx(
|
|
39
|
+
'wds-Button',
|
|
40
|
+
{
|
|
41
|
+
'wds-Button--disabled': disabled,
|
|
42
|
+
'wds-Button--loading': loading,
|
|
43
|
+
},
|
|
44
|
+
className,
|
|
45
|
+
);
|
|
39
46
|
|
|
40
47
|
const handleClick = useCallback(
|
|
41
48
|
(event: React.MouseEvent<HTMLButtonElement>) => {
|
|
@@ -95,9 +102,10 @@ const PrimitiveButton = forwardRef<HTMLButtonElement, PrimitiveButtonProps>(
|
|
|
95
102
|
* by assistive technologies, set to 'polite' during loading.
|
|
96
103
|
*/
|
|
97
104
|
const buttonProps = {
|
|
98
|
-
'aria-disabled':
|
|
99
|
-
'aria-
|
|
100
|
-
|
|
105
|
+
'aria-disabled': disabled || loading,
|
|
106
|
+
'aria-label': loading
|
|
107
|
+
? intl.formatMessage(messages.loadingAriaLabel as MessageDescriptor)
|
|
108
|
+
: props['aria-label'],
|
|
101
109
|
'aria-live': (loading ? 'polite' : 'off') as 'polite' | 'off' | 'assertive' | undefined,
|
|
102
110
|
className: classNames,
|
|
103
111
|
'data-testid': testId,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { screen } from '@testing-library/react';
|
|
1
|
+
import { fireEvent, screen } from '@testing-library/react';
|
|
2
|
+
import { userEvent } from '@testing-library/user-event';
|
|
3
|
+
import PrimitiveButton from '..';
|
|
4
|
+
import messages from '../../../i18n/commonMessages/Button.messages';
|
|
2
5
|
import { render } from '../../../test-utils';
|
|
3
|
-
import PrimitiveButton from '../src';
|
|
4
|
-
import allMessages from '../../../i18n';
|
|
5
6
|
|
|
6
7
|
describe('Button', () => {
|
|
7
8
|
const defaultProps = {
|
|
@@ -11,7 +12,7 @@ describe('Button', () => {
|
|
|
11
12
|
const renderButton = (
|
|
12
13
|
props?: Partial<typeof defaultProps>,
|
|
13
14
|
locale = 'en',
|
|
14
|
-
localeMessages =
|
|
15
|
+
localeMessages = messages,
|
|
15
16
|
) => {
|
|
16
17
|
return render(
|
|
17
18
|
<PrimitiveButton {...defaultProps} {...props} />,
|
|
@@ -35,6 +36,7 @@ describe('Button', () => {
|
|
|
35
36
|
renderButton(props);
|
|
36
37
|
|
|
37
38
|
const button = screen.getByRole('button');
|
|
39
|
+
expect(button).toHaveClass('wds-Button');
|
|
38
40
|
expect(button).toHaveClass('custom-class');
|
|
39
41
|
});
|
|
40
42
|
|
|
@@ -47,20 +49,10 @@ describe('Button', () => {
|
|
|
47
49
|
renderButton(props);
|
|
48
50
|
|
|
49
51
|
const button = screen.getByRole('button');
|
|
52
|
+
expect(button).toHaveClass('wds-Button--disabled');
|
|
50
53
|
expect(button).toBeDisabled();
|
|
51
54
|
});
|
|
52
55
|
|
|
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
|
-
|
|
64
56
|
it('sets data-testid attribute', () => {
|
|
65
57
|
const props = {
|
|
66
58
|
...defaultProps,
|
|
@@ -109,7 +101,12 @@ describe('Button', () => {
|
|
|
109
101
|
loading: true,
|
|
110
102
|
};
|
|
111
103
|
|
|
112
|
-
|
|
104
|
+
const spanishMessages = {
|
|
105
|
+
...messages,
|
|
106
|
+
'neptune.Button.loadingAriaLabel': 'cargando',
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
renderButton(props, 'es', spanishMessages);
|
|
113
110
|
|
|
114
111
|
const button = screen.getByRole('button');
|
|
115
112
|
expect(button).toHaveAttribute('aria-label', 'cargando');
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import AvatarView from '../avatarView';
|
|
2
|
+
import { render, screen, mockMatchMedia } from '../test-utils';
|
|
3
|
+
import { userEvent } from '@testing-library/user-event';
|
|
4
|
+
|
|
5
|
+
import Radio from '.';
|
|
6
|
+
|
|
7
|
+
jest.mock('../common/hooks');
|
|
8
|
+
mockMatchMedia();
|
|
9
|
+
|
|
10
|
+
describe('Radio', () => {
|
|
11
|
+
const props = {
|
|
12
|
+
label: 'This is a label',
|
|
13
|
+
name: 'name',
|
|
14
|
+
onChange: jest.fn(),
|
|
15
|
+
checked: false,
|
|
16
|
+
disabled: false,
|
|
17
|
+
secondary: '',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
it('shows the avatar when supplied', () => {
|
|
21
|
+
render(<Radio {...props} avatar={<AvatarView profileName="High Def" />} />);
|
|
22
|
+
expect(screen.getByText('HD')).toBeInTheDocument();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('displays the given label', () => {
|
|
26
|
+
render(<Radio {...props} />);
|
|
27
|
+
expect(screen.getByText(props.label)).toBeInTheDocument();
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('passes radio button id', () => {
|
|
31
|
+
render(<Radio {...props} id="some-id" />);
|
|
32
|
+
expect(screen.getByRole('radio')).toHaveAttribute('id', 'some-id');
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('passes radio button name', () => {
|
|
36
|
+
render(<Radio {...props} name="a-name" />);
|
|
37
|
+
expect(screen.getByRole('radio')).toHaveAttribute('name', 'a-name');
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('handles checked state correctly', () => {
|
|
41
|
+
render(<Radio {...props} checked />);
|
|
42
|
+
expect(screen.getByRole('radio')).toBeChecked();
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('handles unchecked state correctly', () => {
|
|
46
|
+
render(<Radio {...props} checked={false} />);
|
|
47
|
+
expect(screen.getByRole('radio')).not.toBeChecked();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('handles disabled state correctly', () => {
|
|
51
|
+
render(<Radio {...props} disabled />);
|
|
52
|
+
expect(screen.getByRole('radio')).toBeDisabled();
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('displays secondary text when supplied', () => {
|
|
56
|
+
render(<Radio {...props} secondary="additional info" />);
|
|
57
|
+
expect(screen.getByText('additional info')).toBeInTheDocument();
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('calls onChange when clicked', async () => {
|
|
61
|
+
const onChange = jest.fn();
|
|
62
|
+
render(<Radio {...props} onChange={onChange} />);
|
|
63
|
+
await userEvent.click(screen.getByRole('radio'));
|
|
64
|
+
expect(onChange).toHaveBeenCalled();
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('does not call onChange when disabled', async () => {
|
|
68
|
+
const onChange = jest.fn();
|
|
69
|
+
render(<Radio {...props} disabled onChange={onChange} />);
|
|
70
|
+
await userEvent.click(screen.getByRole('radio'));
|
|
71
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
72
|
+
});
|
|
73
|
+
});
|