@transferwise/components 46.149.0 → 46.149.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/build/main.css +21 -14
- package/build/styles/avatarView/AvatarView.css +1 -0
- package/build/styles/main.css +21 -14
- package/build/styles/prompt/CriticalBanner/CriticalBanner.css +19 -12
- package/package.json +1 -1
- package/src/avatarView/AvatarView.css +1 -0
- package/src/avatarView/AvatarView.less +3 -1
- package/src/main.css +21 -14
- package/src/prompt/CriticalBanner/CriticalBanner.css +19 -12
- package/src/prompt/CriticalBanner/CriticalBanner.less +33 -25
- package/src/prompt/CriticalBanner/CriticalBanner.story.tsx +21 -10
- package/src/prompt/CriticalBanner/CriticalBanner.test.story.tsx +71 -0
package/build/main.css
CHANGED
|
@@ -26549,6 +26549,7 @@ a[data-toggle="tooltip"] {
|
|
|
26549
26549
|
}
|
|
26550
26550
|
|
|
26551
26551
|
.np-avatar-view .np-avatar-view-content {
|
|
26552
|
+
--circle-border-color: var(--color-sentiment-border-overlay, var(--color-border-neutral));
|
|
26552
26553
|
color: #37517e;
|
|
26553
26554
|
color: var(--color-sentiment-content-primary, var(--color-content-primary));
|
|
26554
26555
|
}
|
|
@@ -31955,6 +31956,9 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31955
31956
|
--Prompt-actions-gap: var(--size-8);
|
|
31956
31957
|
--Prompt-gap: var(--size-10) var(--size-16);
|
|
31957
31958
|
--Prompt-border-radius: 0;
|
|
31959
|
+
--critical-banner-background-base: transparent;
|
|
31960
|
+
--critical-banner-background-surface: var(--color-sentiment-background-surface);
|
|
31961
|
+
--critical-banner-background: linear-gradient(var(--critical-banner-background-surface), var(--critical-banner-background-surface)), var(--critical-banner-background-base);
|
|
31958
31962
|
container-type: inline-size;
|
|
31959
31963
|
position: relative;
|
|
31960
31964
|
--critical-banner-easing: cubic-bezier(0.9, 0, 0.7, 1);
|
|
@@ -31963,6 +31967,11 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31963
31967
|
actions only go full-width below mobile-max token (container query) */
|
|
31964
31968
|
}
|
|
31965
31969
|
|
|
31970
|
+
.wds-critical-banner.wds-prompt--neutral {
|
|
31971
|
+
--critical-banner-background-base: var(--color-background-elevated);
|
|
31972
|
+
background: var(--critical-banner-background);
|
|
31973
|
+
}
|
|
31974
|
+
|
|
31966
31975
|
.wds-critical-banner--media-image {
|
|
31967
31976
|
width: 48px;
|
|
31968
31977
|
width: var(--size-48);
|
|
@@ -32028,19 +32037,6 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
32028
32037
|
min-width: 0;
|
|
32029
32038
|
max-width: 480px;
|
|
32030
32039
|
height: 100%;
|
|
32031
|
-
padding-top: 3px;
|
|
32032
|
-
}
|
|
32033
|
-
|
|
32034
|
-
@media (max-width: 320px) {
|
|
32035
|
-
.wds-critical-banner__text-wrapper {
|
|
32036
|
-
padding-top: 0;
|
|
32037
|
-
}
|
|
32038
|
-
}
|
|
32039
|
-
|
|
32040
|
-
@container (width < 320px) {
|
|
32041
|
-
.wds-critical-banner__text-wrapper {
|
|
32042
|
-
padding-top: 0;
|
|
32043
|
-
}
|
|
32044
32040
|
}
|
|
32045
32041
|
|
|
32046
32042
|
.wds-critical-banner--collapsed .wds-critical-banner__title,
|
|
@@ -32113,6 +32109,15 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
32113
32109
|
@container critical-banner-overhang (max-width: 600px) {
|
|
32114
32110
|
.wds-critical-banner__entry-mask {
|
|
32115
32111
|
--critical-banner-mobile-overhang-size: 32px;
|
|
32112
|
+
--critical-banner-overhang-mask: radial-gradient(circle at 100% 100%, transparent var(--critical-banner-mobile-overhang-size), #000 var(--critical-banner-mobile-overhang-size)) 0 0 / var(--critical-banner-mobile-overhang-size)
|
|
32113
|
+
var(--critical-banner-mobile-overhang-size) no-repeat,
|
|
32114
|
+
radial-gradient(
|
|
32115
|
+
circle at 0% 100%,
|
|
32116
|
+
transparent var(--critical-banner-mobile-overhang-size),
|
|
32117
|
+
#000 var(--critical-banner-mobile-overhang-size)
|
|
32118
|
+
)
|
|
32119
|
+
100% 0 / var(--critical-banner-mobile-overhang-size)
|
|
32120
|
+
var(--critical-banner-mobile-overhang-size) no-repeat;
|
|
32116
32121
|
}
|
|
32117
32122
|
.wds-critical-banner__entry-mask .wds-critical-banner-overhang {
|
|
32118
32123
|
margin-bottom: var(--critical-banner-mobile-overhang-size);
|
|
@@ -32125,7 +32130,9 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
32125
32130
|
left: 0;
|
|
32126
32131
|
height: var(--critical-banner-mobile-overhang-size);
|
|
32127
32132
|
pointer-events: none;
|
|
32128
|
-
background:
|
|
32133
|
+
background: var(--critical-banner-background);
|
|
32134
|
+
-webkit-mask: var(--critical-banner-overhang-mask);
|
|
32135
|
+
mask: var(--critical-banner-overhang-mask);
|
|
32129
32136
|
}
|
|
32130
32137
|
}
|
|
32131
32138
|
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
background-color: var(--color-interactive-accent);
|
|
26
26
|
}
|
|
27
27
|
.np-avatar-view .np-avatar-view-content {
|
|
28
|
+
--circle-border-color: var(--color-sentiment-border-overlay, var(--color-border-neutral));
|
|
28
29
|
color: #37517e;
|
|
29
30
|
color: var(--color-sentiment-content-primary, var(--color-content-primary));
|
|
30
31
|
}
|
package/build/styles/main.css
CHANGED
|
@@ -26549,6 +26549,7 @@ a[data-toggle="tooltip"] {
|
|
|
26549
26549
|
}
|
|
26550
26550
|
|
|
26551
26551
|
.np-avatar-view .np-avatar-view-content {
|
|
26552
|
+
--circle-border-color: var(--color-sentiment-border-overlay, var(--color-border-neutral));
|
|
26552
26553
|
color: #37517e;
|
|
26553
26554
|
color: var(--color-sentiment-content-primary, var(--color-content-primary));
|
|
26554
26555
|
}
|
|
@@ -31955,6 +31956,9 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31955
31956
|
--Prompt-actions-gap: var(--size-8);
|
|
31956
31957
|
--Prompt-gap: var(--size-10) var(--size-16);
|
|
31957
31958
|
--Prompt-border-radius: 0;
|
|
31959
|
+
--critical-banner-background-base: transparent;
|
|
31960
|
+
--critical-banner-background-surface: var(--color-sentiment-background-surface);
|
|
31961
|
+
--critical-banner-background: linear-gradient(var(--critical-banner-background-surface), var(--critical-banner-background-surface)), var(--critical-banner-background-base);
|
|
31958
31962
|
container-type: inline-size;
|
|
31959
31963
|
position: relative;
|
|
31960
31964
|
--critical-banner-easing: cubic-bezier(0.9, 0, 0.7, 1);
|
|
@@ -31963,6 +31967,11 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31963
31967
|
actions only go full-width below mobile-max token (container query) */
|
|
31964
31968
|
}
|
|
31965
31969
|
|
|
31970
|
+
.wds-critical-banner.wds-prompt--neutral {
|
|
31971
|
+
--critical-banner-background-base: var(--color-background-elevated);
|
|
31972
|
+
background: var(--critical-banner-background);
|
|
31973
|
+
}
|
|
31974
|
+
|
|
31966
31975
|
.wds-critical-banner--media-image {
|
|
31967
31976
|
width: 48px;
|
|
31968
31977
|
width: var(--size-48);
|
|
@@ -32028,19 +32037,6 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
32028
32037
|
min-width: 0;
|
|
32029
32038
|
max-width: 480px;
|
|
32030
32039
|
height: 100%;
|
|
32031
|
-
padding-top: 3px;
|
|
32032
|
-
}
|
|
32033
|
-
|
|
32034
|
-
@media (max-width: 320px) {
|
|
32035
|
-
.wds-critical-banner__text-wrapper {
|
|
32036
|
-
padding-top: 0;
|
|
32037
|
-
}
|
|
32038
|
-
}
|
|
32039
|
-
|
|
32040
|
-
@container (width < 320px) {
|
|
32041
|
-
.wds-critical-banner__text-wrapper {
|
|
32042
|
-
padding-top: 0;
|
|
32043
|
-
}
|
|
32044
32040
|
}
|
|
32045
32041
|
|
|
32046
32042
|
.wds-critical-banner--collapsed .wds-critical-banner__title,
|
|
@@ -32113,6 +32109,15 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
32113
32109
|
@container critical-banner-overhang (max-width: 600px) {
|
|
32114
32110
|
.wds-critical-banner__entry-mask {
|
|
32115
32111
|
--critical-banner-mobile-overhang-size: 32px;
|
|
32112
|
+
--critical-banner-overhang-mask: radial-gradient(circle at 100% 100%, transparent var(--critical-banner-mobile-overhang-size), #000 var(--critical-banner-mobile-overhang-size)) 0 0 / var(--critical-banner-mobile-overhang-size)
|
|
32113
|
+
var(--critical-banner-mobile-overhang-size) no-repeat,
|
|
32114
|
+
radial-gradient(
|
|
32115
|
+
circle at 0% 100%,
|
|
32116
|
+
transparent var(--critical-banner-mobile-overhang-size),
|
|
32117
|
+
#000 var(--critical-banner-mobile-overhang-size)
|
|
32118
|
+
)
|
|
32119
|
+
100% 0 / var(--critical-banner-mobile-overhang-size)
|
|
32120
|
+
var(--critical-banner-mobile-overhang-size) no-repeat;
|
|
32116
32121
|
}
|
|
32117
32122
|
.wds-critical-banner__entry-mask .wds-critical-banner-overhang {
|
|
32118
32123
|
margin-bottom: var(--critical-banner-mobile-overhang-size);
|
|
@@ -32125,7 +32130,9 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
32125
32130
|
left: 0;
|
|
32126
32131
|
height: var(--critical-banner-mobile-overhang-size);
|
|
32127
32132
|
pointer-events: none;
|
|
32128
|
-
background:
|
|
32133
|
+
background: var(--critical-banner-background);
|
|
32134
|
+
-webkit-mask: var(--critical-banner-overhang-mask);
|
|
32135
|
+
mask: var(--critical-banner-overhang-mask);
|
|
32129
32136
|
}
|
|
32130
32137
|
}
|
|
32131
32138
|
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
--Prompt-actions-gap: var(--size-8);
|
|
5
5
|
--Prompt-gap: var(--size-10) var(--size-16);
|
|
6
6
|
--Prompt-border-radius: 0;
|
|
7
|
+
--critical-banner-background-base: transparent;
|
|
8
|
+
--critical-banner-background-surface: var(--color-sentiment-background-surface);
|
|
9
|
+
--critical-banner-background: linear-gradient(var(--critical-banner-background-surface), var(--critical-banner-background-surface)), var(--critical-banner-background-base);
|
|
7
10
|
container-type: inline-size;
|
|
8
11
|
position: relative;
|
|
9
12
|
--critical-banner-easing: cubic-bezier(0.9, 0, 0.7, 1);
|
|
@@ -11,6 +14,10 @@
|
|
|
11
14
|
/* Override PrimitivePrompt's --screen-sm-max actions behaviour:
|
|
12
15
|
actions only go full-width below mobile-max token (container query) */
|
|
13
16
|
}
|
|
17
|
+
.wds-critical-banner.wds-prompt--neutral {
|
|
18
|
+
--critical-banner-background-base: var(--color-background-elevated);
|
|
19
|
+
background: var(--critical-banner-background);
|
|
20
|
+
}
|
|
14
21
|
.wds-critical-banner--media-image {
|
|
15
22
|
width: 48px;
|
|
16
23
|
width: var(--size-48);
|
|
@@ -68,17 +75,6 @@
|
|
|
68
75
|
min-width: 0;
|
|
69
76
|
max-width: 480px;
|
|
70
77
|
height: 100%;
|
|
71
|
-
padding-top: 3px;
|
|
72
|
-
}
|
|
73
|
-
@media (max-width: 320px) {
|
|
74
|
-
.wds-critical-banner__text-wrapper {
|
|
75
|
-
padding-top: 0;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
@container (width < 320px) {
|
|
79
|
-
.wds-critical-banner__text-wrapper {
|
|
80
|
-
padding-top: 0;
|
|
81
|
-
}
|
|
82
78
|
}
|
|
83
79
|
.wds-critical-banner--collapsed .wds-critical-banner__title,
|
|
84
80
|
.wds-critical-banner--collapsed .wds-critical-banner__description {
|
|
@@ -140,6 +136,15 @@
|
|
|
140
136
|
@container critical-banner-overhang (max-width: 600px) {
|
|
141
137
|
.wds-critical-banner__entry-mask {
|
|
142
138
|
--critical-banner-mobile-overhang-size: 32px;
|
|
139
|
+
--critical-banner-overhang-mask: radial-gradient(circle at 100% 100%, transparent var(--critical-banner-mobile-overhang-size), #000 var(--critical-banner-mobile-overhang-size)) 0 0 / var(--critical-banner-mobile-overhang-size)
|
|
140
|
+
var(--critical-banner-mobile-overhang-size) no-repeat,
|
|
141
|
+
radial-gradient(
|
|
142
|
+
circle at 0% 100%,
|
|
143
|
+
transparent var(--critical-banner-mobile-overhang-size),
|
|
144
|
+
#000 var(--critical-banner-mobile-overhang-size)
|
|
145
|
+
)
|
|
146
|
+
100% 0 / var(--critical-banner-mobile-overhang-size)
|
|
147
|
+
var(--critical-banner-mobile-overhang-size) no-repeat;
|
|
143
148
|
}
|
|
144
149
|
.wds-critical-banner__entry-mask .wds-critical-banner-overhang {
|
|
145
150
|
margin-bottom: var(--critical-banner-mobile-overhang-size);
|
|
@@ -152,7 +157,9 @@
|
|
|
152
157
|
left: 0;
|
|
153
158
|
height: var(--critical-banner-mobile-overhang-size);
|
|
154
159
|
pointer-events: none;
|
|
155
|
-
background:
|
|
160
|
+
background: var(--critical-banner-background);
|
|
161
|
+
-webkit-mask: var(--critical-banner-overhang-mask);
|
|
162
|
+
mask: var(--critical-banner-overhang-mask);
|
|
156
163
|
}
|
|
157
164
|
}
|
|
158
165
|
.wds-critical-banner__entry-track {
|
package/package.json
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
background-color: var(--color-interactive-accent);
|
|
26
26
|
}
|
|
27
27
|
.np-avatar-view .np-avatar-view-content {
|
|
28
|
+
--circle-border-color: var(--color-sentiment-border-overlay, var(--color-border-neutral));
|
|
28
29
|
color: #37517e;
|
|
29
30
|
color: var(--color-sentiment-content-primary, var(--color-content-primary));
|
|
30
31
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import "./Dot.less";
|
|
2
2
|
|
|
3
3
|
.np-avatar-view {
|
|
4
4
|
.np-avatar-view-content {
|
|
5
|
+
--circle-border-color: var(--color-sentiment-border-overlay, var(--color-border-neutral));
|
|
6
|
+
|
|
5
7
|
color: var(--color-sentiment-content-primary, var(--color-content-primary));
|
|
6
8
|
}
|
|
7
9
|
|
package/src/main.css
CHANGED
|
@@ -26549,6 +26549,7 @@ a[data-toggle="tooltip"] {
|
|
|
26549
26549
|
}
|
|
26550
26550
|
|
|
26551
26551
|
.np-avatar-view .np-avatar-view-content {
|
|
26552
|
+
--circle-border-color: var(--color-sentiment-border-overlay, var(--color-border-neutral));
|
|
26552
26553
|
color: #37517e;
|
|
26553
26554
|
color: var(--color-sentiment-content-primary, var(--color-content-primary));
|
|
26554
26555
|
}
|
|
@@ -31955,6 +31956,9 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31955
31956
|
--Prompt-actions-gap: var(--size-8);
|
|
31956
31957
|
--Prompt-gap: var(--size-10) var(--size-16);
|
|
31957
31958
|
--Prompt-border-radius: 0;
|
|
31959
|
+
--critical-banner-background-base: transparent;
|
|
31960
|
+
--critical-banner-background-surface: var(--color-sentiment-background-surface);
|
|
31961
|
+
--critical-banner-background: linear-gradient(var(--critical-banner-background-surface), var(--critical-banner-background-surface)), var(--critical-banner-background-base);
|
|
31958
31962
|
container-type: inline-size;
|
|
31959
31963
|
position: relative;
|
|
31960
31964
|
--critical-banner-easing: cubic-bezier(0.9, 0, 0.7, 1);
|
|
@@ -31963,6 +31967,11 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31963
31967
|
actions only go full-width below mobile-max token (container query) */
|
|
31964
31968
|
}
|
|
31965
31969
|
|
|
31970
|
+
.wds-critical-banner.wds-prompt--neutral {
|
|
31971
|
+
--critical-banner-background-base: var(--color-background-elevated);
|
|
31972
|
+
background: var(--critical-banner-background);
|
|
31973
|
+
}
|
|
31974
|
+
|
|
31966
31975
|
.wds-critical-banner--media-image {
|
|
31967
31976
|
width: 48px;
|
|
31968
31977
|
width: var(--size-48);
|
|
@@ -32028,19 +32037,6 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
32028
32037
|
min-width: 0;
|
|
32029
32038
|
max-width: 480px;
|
|
32030
32039
|
height: 100%;
|
|
32031
|
-
padding-top: 3px;
|
|
32032
|
-
}
|
|
32033
|
-
|
|
32034
|
-
@media (max-width: 320px) {
|
|
32035
|
-
.wds-critical-banner__text-wrapper {
|
|
32036
|
-
padding-top: 0;
|
|
32037
|
-
}
|
|
32038
|
-
}
|
|
32039
|
-
|
|
32040
|
-
@container (width < 320px) {
|
|
32041
|
-
.wds-critical-banner__text-wrapper {
|
|
32042
|
-
padding-top: 0;
|
|
32043
|
-
}
|
|
32044
32040
|
}
|
|
32045
32041
|
|
|
32046
32042
|
.wds-critical-banner--collapsed .wds-critical-banner__title,
|
|
@@ -32113,6 +32109,15 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
32113
32109
|
@container critical-banner-overhang (max-width: 600px) {
|
|
32114
32110
|
.wds-critical-banner__entry-mask {
|
|
32115
32111
|
--critical-banner-mobile-overhang-size: 32px;
|
|
32112
|
+
--critical-banner-overhang-mask: radial-gradient(circle at 100% 100%, transparent var(--critical-banner-mobile-overhang-size), #000 var(--critical-banner-mobile-overhang-size)) 0 0 / var(--critical-banner-mobile-overhang-size)
|
|
32113
|
+
var(--critical-banner-mobile-overhang-size) no-repeat,
|
|
32114
|
+
radial-gradient(
|
|
32115
|
+
circle at 0% 100%,
|
|
32116
|
+
transparent var(--critical-banner-mobile-overhang-size),
|
|
32117
|
+
#000 var(--critical-banner-mobile-overhang-size)
|
|
32118
|
+
)
|
|
32119
|
+
100% 0 / var(--critical-banner-mobile-overhang-size)
|
|
32120
|
+
var(--critical-banner-mobile-overhang-size) no-repeat;
|
|
32116
32121
|
}
|
|
32117
32122
|
.wds-critical-banner__entry-mask .wds-critical-banner-overhang {
|
|
32118
32123
|
margin-bottom: var(--critical-banner-mobile-overhang-size);
|
|
@@ -32125,7 +32130,9 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
32125
32130
|
left: 0;
|
|
32126
32131
|
height: var(--critical-banner-mobile-overhang-size);
|
|
32127
32132
|
pointer-events: none;
|
|
32128
|
-
background:
|
|
32133
|
+
background: var(--critical-banner-background);
|
|
32134
|
+
-webkit-mask: var(--critical-banner-overhang-mask);
|
|
32135
|
+
mask: var(--critical-banner-overhang-mask);
|
|
32129
32136
|
}
|
|
32130
32137
|
}
|
|
32131
32138
|
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
--Prompt-actions-gap: var(--size-8);
|
|
5
5
|
--Prompt-gap: var(--size-10) var(--size-16);
|
|
6
6
|
--Prompt-border-radius: 0;
|
|
7
|
+
--critical-banner-background-base: transparent;
|
|
8
|
+
--critical-banner-background-surface: var(--color-sentiment-background-surface);
|
|
9
|
+
--critical-banner-background: linear-gradient(var(--critical-banner-background-surface), var(--critical-banner-background-surface)), var(--critical-banner-background-base);
|
|
7
10
|
container-type: inline-size;
|
|
8
11
|
position: relative;
|
|
9
12
|
--critical-banner-easing: cubic-bezier(0.9, 0, 0.7, 1);
|
|
@@ -11,6 +14,10 @@
|
|
|
11
14
|
/* Override PrimitivePrompt's --screen-sm-max actions behaviour:
|
|
12
15
|
actions only go full-width below mobile-max token (container query) */
|
|
13
16
|
}
|
|
17
|
+
.wds-critical-banner.wds-prompt--neutral {
|
|
18
|
+
--critical-banner-background-base: var(--color-background-elevated);
|
|
19
|
+
background: var(--critical-banner-background);
|
|
20
|
+
}
|
|
14
21
|
.wds-critical-banner--media-image {
|
|
15
22
|
width: 48px;
|
|
16
23
|
width: var(--size-48);
|
|
@@ -68,17 +75,6 @@
|
|
|
68
75
|
min-width: 0;
|
|
69
76
|
max-width: 480px;
|
|
70
77
|
height: 100%;
|
|
71
|
-
padding-top: 3px;
|
|
72
|
-
}
|
|
73
|
-
@media (max-width: 320px) {
|
|
74
|
-
.wds-critical-banner__text-wrapper {
|
|
75
|
-
padding-top: 0;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
@container (width < 320px) {
|
|
79
|
-
.wds-critical-banner__text-wrapper {
|
|
80
|
-
padding-top: 0;
|
|
81
|
-
}
|
|
82
78
|
}
|
|
83
79
|
.wds-critical-banner--collapsed .wds-critical-banner__title,
|
|
84
80
|
.wds-critical-banner--collapsed .wds-critical-banner__description {
|
|
@@ -140,6 +136,15 @@
|
|
|
140
136
|
@container critical-banner-overhang (max-width: 600px) {
|
|
141
137
|
.wds-critical-banner__entry-mask {
|
|
142
138
|
--critical-banner-mobile-overhang-size: 32px;
|
|
139
|
+
--critical-banner-overhang-mask: radial-gradient(circle at 100% 100%, transparent var(--critical-banner-mobile-overhang-size), #000 var(--critical-banner-mobile-overhang-size)) 0 0 / var(--critical-banner-mobile-overhang-size)
|
|
140
|
+
var(--critical-banner-mobile-overhang-size) no-repeat,
|
|
141
|
+
radial-gradient(
|
|
142
|
+
circle at 0% 100%,
|
|
143
|
+
transparent var(--critical-banner-mobile-overhang-size),
|
|
144
|
+
#000 var(--critical-banner-mobile-overhang-size)
|
|
145
|
+
)
|
|
146
|
+
100% 0 / var(--critical-banner-mobile-overhang-size)
|
|
147
|
+
var(--critical-banner-mobile-overhang-size) no-repeat;
|
|
143
148
|
}
|
|
144
149
|
.wds-critical-banner__entry-mask .wds-critical-banner-overhang {
|
|
145
150
|
margin-bottom: var(--critical-banner-mobile-overhang-size);
|
|
@@ -152,7 +157,9 @@
|
|
|
152
157
|
left: 0;
|
|
153
158
|
height: var(--critical-banner-mobile-overhang-size);
|
|
154
159
|
pointer-events: none;
|
|
155
|
-
background:
|
|
160
|
+
background: var(--critical-banner-background);
|
|
161
|
+
-webkit-mask: var(--critical-banner-overhang-mask);
|
|
162
|
+
mask: var(--critical-banner-overhang-mask);
|
|
156
163
|
}
|
|
157
164
|
}
|
|
158
165
|
.wds-critical-banner__entry-track {
|
|
@@ -7,6 +7,16 @@
|
|
|
7
7
|
--Prompt-actions-gap: var(--size-8);
|
|
8
8
|
--Prompt-gap: var(--size-10) var(--size-16);
|
|
9
9
|
--Prompt-border-radius: 0;
|
|
10
|
+
--critical-banner-background-base: transparent;
|
|
11
|
+
--critical-banner-background-surface: var(--color-sentiment-background-surface);
|
|
12
|
+
// The sentiment surface can be translucent, so layer it over an opaque base
|
|
13
|
+
// for neutral banners and their mobile overhang.
|
|
14
|
+
--critical-banner-background:
|
|
15
|
+
linear-gradient(
|
|
16
|
+
var(--critical-banner-background-surface),
|
|
17
|
+
var(--critical-banner-background-surface)
|
|
18
|
+
),
|
|
19
|
+
var(--critical-banner-background-base);
|
|
10
20
|
container-type: inline-size;
|
|
11
21
|
position: relative;
|
|
12
22
|
|
|
@@ -14,6 +24,11 @@
|
|
|
14
24
|
--critical-banner-easing: cubic-bezier(0.9, 0, 0.7, 1);
|
|
15
25
|
--critical-banner-duration: 150ms;
|
|
16
26
|
|
|
27
|
+
&.wds-prompt--neutral {
|
|
28
|
+
--critical-banner-background-base: var(--color-background-elevated);
|
|
29
|
+
background: var(--critical-banner-background);
|
|
30
|
+
}
|
|
31
|
+
|
|
17
32
|
&--media-image {
|
|
18
33
|
width: var(--size-48);
|
|
19
34
|
height: var(--size-48);
|
|
@@ -79,16 +94,6 @@
|
|
|
79
94
|
min-width: 0;
|
|
80
95
|
max-width: 480px;
|
|
81
96
|
height: 100%;
|
|
82
|
-
|
|
83
|
-
// Padding prevents text shifting when collapsing/expanding layout shift
|
|
84
|
-
padding-top: 3px;
|
|
85
|
-
|
|
86
|
-
@media (--screen-400-zoom) {
|
|
87
|
-
padding-top: 0;
|
|
88
|
-
}
|
|
89
|
-
@container (width < @screen-xs-min) {
|
|
90
|
-
padding-top: 0;
|
|
91
|
-
}
|
|
92
97
|
}
|
|
93
98
|
|
|
94
99
|
&--collapsed &__title,
|
|
@@ -163,6 +168,21 @@
|
|
|
163
168
|
|
|
164
169
|
@container critical-banner-overhang (max-width: @wds-critical-banner-mobile-overhang-max) {
|
|
165
170
|
--critical-banner-mobile-overhang-size: 32px;
|
|
171
|
+
--critical-banner-overhang-mask:
|
|
172
|
+
radial-gradient(
|
|
173
|
+
circle at 100% 100%,
|
|
174
|
+
transparent var(--critical-banner-mobile-overhang-size),
|
|
175
|
+
#000 var(--critical-banner-mobile-overhang-size)
|
|
176
|
+
)
|
|
177
|
+
0 0 / var(--critical-banner-mobile-overhang-size)
|
|
178
|
+
var(--critical-banner-mobile-overhang-size) no-repeat,
|
|
179
|
+
radial-gradient(
|
|
180
|
+
circle at 0% 100%,
|
|
181
|
+
transparent var(--critical-banner-mobile-overhang-size),
|
|
182
|
+
#000 var(--critical-banner-mobile-overhang-size)
|
|
183
|
+
)
|
|
184
|
+
100% 0 / var(--critical-banner-mobile-overhang-size)
|
|
185
|
+
var(--critical-banner-mobile-overhang-size) no-repeat;
|
|
166
186
|
|
|
167
187
|
.wds-critical-banner-overhang {
|
|
168
188
|
margin-bottom: var(--critical-banner-mobile-overhang-size);
|
|
@@ -175,21 +195,9 @@
|
|
|
175
195
|
left: 0;
|
|
176
196
|
height: var(--critical-banner-mobile-overhang-size);
|
|
177
197
|
pointer-events: none;
|
|
178
|
-
background:
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
transparent var(--critical-banner-mobile-overhang-size),
|
|
182
|
-
var(--color-sentiment-background-surface) var(--critical-banner-mobile-overhang-size)
|
|
183
|
-
)
|
|
184
|
-
0 0 / var(--critical-banner-mobile-overhang-size)
|
|
185
|
-
var(--critical-banner-mobile-overhang-size) no-repeat,
|
|
186
|
-
radial-gradient(
|
|
187
|
-
circle at 0% 100%,
|
|
188
|
-
transparent var(--critical-banner-mobile-overhang-size),
|
|
189
|
-
var(--color-sentiment-background-surface) var(--critical-banner-mobile-overhang-size)
|
|
190
|
-
)
|
|
191
|
-
100% 0 / var(--critical-banner-mobile-overhang-size)
|
|
192
|
-
var(--critical-banner-mobile-overhang-size) no-repeat;
|
|
198
|
+
background: var(--critical-banner-background);
|
|
199
|
+
-webkit-mask: var(--critical-banner-overhang-mask);
|
|
200
|
+
mask: var(--critical-banner-overhang-mask);
|
|
193
201
|
}
|
|
194
202
|
}
|
|
195
203
|
}
|
|
@@ -351,12 +351,17 @@ export const Actions: Story = {
|
|
|
351
351
|
* Each sentiment has a default status icon. Override it with a custom image or an AvatarView.
|
|
352
352
|
*/
|
|
353
353
|
export const MediaTypes: Story = {
|
|
354
|
+
args: {
|
|
355
|
+
sentiment: 'neutral',
|
|
356
|
+
},
|
|
354
357
|
decorators: [ContainerDecorator('2rem')],
|
|
355
358
|
parameters: {
|
|
356
359
|
docs: {
|
|
357
360
|
source: {
|
|
358
|
-
code: `{/*
|
|
359
|
-
|
|
361
|
+
code: `{/* Change sentiment using the story controls */}
|
|
362
|
+
|
|
363
|
+
{/* Default — sentiment icon */}
|
|
364
|
+
<CriticalBanner sentiment={sentiment} />
|
|
360
365
|
|
|
361
366
|
{/* Custom image */}
|
|
362
367
|
<CriticalBanner media={{ imgSrc: '/card.svg', 'aria-label': 'Wise card' }} ... />
|
|
@@ -375,8 +380,14 @@ export const MediaTypes: Story = {
|
|
|
375
380
|
},
|
|
376
381
|
},
|
|
377
382
|
},
|
|
378
|
-
argTypes:
|
|
379
|
-
|
|
383
|
+
argTypes: {
|
|
384
|
+
...hiddenArgTypes,
|
|
385
|
+
sentiment: {
|
|
386
|
+
control: 'radio',
|
|
387
|
+
options: ['negative', 'warning', 'neutral', 'success'],
|
|
388
|
+
},
|
|
389
|
+
},
|
|
390
|
+
render: function Render({ sentiment }) {
|
|
380
391
|
const [expandedStates, setExpandedStates] = useState<Record<string, boolean>>({
|
|
381
392
|
default: true,
|
|
382
393
|
image: true,
|
|
@@ -392,7 +403,7 @@ export const MediaTypes: Story = {
|
|
|
392
403
|
return (
|
|
393
404
|
<>
|
|
394
405
|
<CriticalBanner
|
|
395
|
-
sentiment=
|
|
406
|
+
sentiment={sentiment}
|
|
396
407
|
title="Default status icon"
|
|
397
408
|
description="When no media is provided, the sentiment's default icon is displayed."
|
|
398
409
|
action={{ label: 'Continue', onClick: fn() }}
|
|
@@ -400,7 +411,7 @@ export const MediaTypes: Story = {
|
|
|
400
411
|
onToggle={() => toggle('default')}
|
|
401
412
|
/>
|
|
402
413
|
<CriticalBanner
|
|
403
|
-
sentiment=
|
|
414
|
+
sentiment={sentiment}
|
|
404
415
|
title="Custom image"
|
|
405
416
|
description="Your card has been blocked for security reasons."
|
|
406
417
|
media={{ imgSrc: '../../wise-card.svg', 'aria-label': 'Wise debit card' }}
|
|
@@ -409,7 +420,7 @@ export const MediaTypes: Story = {
|
|
|
409
420
|
onToggle={() => toggle('image')}
|
|
410
421
|
/>
|
|
411
422
|
<CriticalBanner
|
|
412
|
-
sentiment=
|
|
423
|
+
sentiment={sentiment}
|
|
413
424
|
title="Avatar with photo"
|
|
414
425
|
description="The default badge is the status icon for the sentiment."
|
|
415
426
|
media={{ avatar: { imgSrc: '../../avatar-rectangle-fox.webp' } }}
|
|
@@ -418,7 +429,7 @@ export const MediaTypes: Story = {
|
|
|
418
429
|
onToggle={() => toggle('avatarPhoto')}
|
|
419
430
|
/>
|
|
420
431
|
<CriticalBanner
|
|
421
|
-
sentiment=
|
|
432
|
+
sentiment={sentiment}
|
|
422
433
|
title="Avatar with initials"
|
|
423
434
|
description="The default badge is the status icon for the sentiment."
|
|
424
435
|
media={{ avatar: { profileName: 'John Doe' } }}
|
|
@@ -427,7 +438,7 @@ export const MediaTypes: Story = {
|
|
|
427
438
|
onToggle={() => toggle('avatarInitials')}
|
|
428
439
|
/>
|
|
429
440
|
<CriticalBanner
|
|
430
|
-
sentiment=
|
|
441
|
+
sentiment={sentiment}
|
|
431
442
|
title="Avatar with custom icon"
|
|
432
443
|
description="The default badge is the status icon for the sentiment."
|
|
433
444
|
media={{ avatar: { asset: <Bank title="Bank account" /> } }}
|
|
@@ -436,7 +447,7 @@ export const MediaTypes: Story = {
|
|
|
436
447
|
onToggle={() => toggle('avatarIcon')}
|
|
437
448
|
/>
|
|
438
449
|
<CriticalBanner
|
|
439
|
-
sentiment=
|
|
450
|
+
sentiment={sentiment}
|
|
440
451
|
title="Business profile with badge"
|
|
441
452
|
description="Your business account requires additional documentation."
|
|
442
453
|
media={{ avatar: { profileType: 'BUSINESS', badge: { flagCode: 'GB' } } }}
|
|
@@ -21,10 +21,24 @@ const wait = async (ms: number) =>
|
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
const ANIMATION_DURATION = 200; // 150ms animation + 50ms buffer
|
|
24
|
+
const ENTRY_ANIMATION_DURATION = 950; // 500ms delay + 400ms animation + 50ms buffer
|
|
24
25
|
|
|
25
26
|
const longDescription =
|
|
26
27
|
'We have detected unusual activity on your account that does not match your typical usage patterns. To protect your funds and personal information, we have temporarily restricted access. Please verify your identity to restore full access to your account.';
|
|
27
28
|
|
|
29
|
+
const BACKGROUND_SCROLL_CONTENT = [
|
|
30
|
+
'Manage your card settings, limits, and delivery details from this page.',
|
|
31
|
+
'Your recent payments, subscriptions, and cash withdrawals will appear here.',
|
|
32
|
+
'Freeze your card any time if it is lost, stolen, or somewhere unexpected.',
|
|
33
|
+
'Set spending limits for online, in-store, and contactless payments.',
|
|
34
|
+
'Add your card to a digital wallet for quicker checkout in supported stores.',
|
|
35
|
+
'Choose the currency balance you want to spend from before you travel.',
|
|
36
|
+
'Review fees before using an ATM or paying in a currency you do not hold.',
|
|
37
|
+
'Order a replacement card if yours is damaged or about to expire.',
|
|
38
|
+
'Keep your delivery address up to date so new cards arrive in the right place.',
|
|
39
|
+
'Contact support if a card payment looks unfamiliar or incorrect.',
|
|
40
|
+
];
|
|
41
|
+
|
|
28
42
|
function AllVariants({ gap = '1rem' }: { gap?: string }) {
|
|
29
43
|
const [states, setStates] = useState({
|
|
30
44
|
negativeExpanded: true,
|
|
@@ -137,6 +151,63 @@ export const MobileVariants: Story = {
|
|
|
137
151
|
...withVariantConfig(['mobile']),
|
|
138
152
|
};
|
|
139
153
|
|
|
154
|
+
/** Neutral background regression test with page content scrolled under the mobile overhang. */
|
|
155
|
+
export const BackgroundIsNotTransparent: Story = {
|
|
156
|
+
args: {
|
|
157
|
+
sentiment: 'neutral',
|
|
158
|
+
},
|
|
159
|
+
argTypes: {
|
|
160
|
+
sentiment: {
|
|
161
|
+
control: 'radio',
|
|
162
|
+
options: ['negative', 'warning', 'neutral', 'success'],
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
render: function Render({ sentiment }) {
|
|
166
|
+
return (
|
|
167
|
+
<div
|
|
168
|
+
data-testid="background-scroll-container"
|
|
169
|
+
style={{
|
|
170
|
+
width: 350,
|
|
171
|
+
height: 640,
|
|
172
|
+
overflowY: 'auto',
|
|
173
|
+
border: '1px solid var(--color-border-neutral)',
|
|
174
|
+
}}
|
|
175
|
+
>
|
|
176
|
+
<div style={{ position: 'sticky', top: 0, zIndex: 1 }}>
|
|
177
|
+
<CriticalBanner
|
|
178
|
+
sentiment={sentiment}
|
|
179
|
+
title="Your account requires verification"
|
|
180
|
+
description="Please verify your identity to continue using all features."
|
|
181
|
+
action={{ label: 'Verify now', onClick: fn() }}
|
|
182
|
+
/>
|
|
183
|
+
</div>
|
|
184
|
+
<main style={{ padding: 'var(--size-24) var(--size-16) var(--size-48)' }}>
|
|
185
|
+
<h1 style={{ margin: '0 0 var(--size-8)', fontSize: 32, lineHeight: 1.1 }}>Debit card</h1>
|
|
186
|
+
<p style={{ margin: '0 0 var(--size-24)' }}>Spend in 150+ currencies</p>
|
|
187
|
+
{BACKGROUND_SCROLL_CONTENT.map((paragraph) => (
|
|
188
|
+
<p key={paragraph}>{paragraph}</p>
|
|
189
|
+
))}
|
|
190
|
+
</main>
|
|
191
|
+
</div>
|
|
192
|
+
);
|
|
193
|
+
},
|
|
194
|
+
play: async ({ canvasElement }) => {
|
|
195
|
+
const scrollContainer = canvasElement.querySelector(
|
|
196
|
+
'[data-testid="background-scroll-container"]',
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
if (scrollContainer) {
|
|
200
|
+
scrollContainer.scrollTop = 250;
|
|
201
|
+
await wait(ENTRY_ANIMATION_DURATION);
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
...withVariantConfig(['mobile'], {
|
|
205
|
+
parameters: {
|
|
206
|
+
controls: { include: ['sentiment'] },
|
|
207
|
+
},
|
|
208
|
+
}),
|
|
209
|
+
};
|
|
210
|
+
|
|
140
211
|
/** Mobile entry animation visual regression test. */
|
|
141
212
|
export const AnimatedEntryMobile: Story = {
|
|
142
213
|
render: function Render() {
|