@transferwise/components 46.149.1 → 46.150.0
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/avatar/Avatar.js.map +1 -1
- package/build/avatar/Avatar.mjs.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
- package/build/card/Card.js.map +1 -1
- package/build/card/Card.mjs.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
- package/build/index.js +17 -14
- package/build/index.js.map +1 -1
- package/build/index.mjs +9 -8
- package/build/index.mjs.map +1 -1
- package/build/inlineAlert/InlineAlert.js.map +1 -1
- package/build/inlineAlert/InlineAlert.mjs.map +1 -1
- package/build/main.css +11 -39
- package/build/navigationOption/NavigationOption.js.map +1 -1
- package/build/navigationOption/NavigationOption.mjs.map +1 -1
- package/build/navigationOptionsList/NavigationOptionsList.js.map +1 -1
- package/build/navigationOptionsList/NavigationOptionsList.mjs.map +1 -1
- package/build/prompt/CriticalBanner/CriticalBanner.js +1 -7
- package/build/prompt/CriticalBanner/CriticalBanner.js.map +1 -1
- package/build/prompt/CriticalBanner/CriticalBanner.mjs +1 -7
- package/build/prompt/CriticalBanner/CriticalBanner.mjs.map +1 -1
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.mjs.map +1 -1
- package/build/styles/main.css +11 -39
- package/build/styles/prompt/CriticalBanner/CriticalBanner.css +11 -36
- package/build/types/avatar/Avatar.d.ts +9 -0
- package/build/types/avatar/Avatar.d.ts.map +1 -1
- package/build/types/avatar/index.d.ts +1 -1
- package/build/types/avatar/index.d.ts.map +1 -1
- package/build/types/avatarWrapper/AvatarWrapper.d.ts +3 -0
- package/build/types/avatarWrapper/AvatarWrapper.d.ts.map +1 -1
- package/build/types/avatarWrapper/index.d.ts +2 -2
- package/build/types/avatarWrapper/index.d.ts.map +1 -1
- package/build/types/button/Button.types.d.ts +1 -1
- package/build/types/button/Button.types.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/card/Card.d.ts +3 -0
- package/build/types/card/Card.d.ts.map +1 -1
- package/build/types/carousel/index.d.ts +1 -1
- package/build/types/carousel/index.d.ts.map +1 -1
- package/build/types/checkboxButton/index.d.ts +1 -0
- package/build/types/checkboxButton/index.d.ts.map +1 -1
- package/build/types/checkboxOption/index.d.ts +1 -0
- package/build/types/checkboxOption/index.d.ts.map +1 -1
- package/build/types/chevron/index.d.ts +1 -0
- package/build/types/chevron/index.d.ts.map +1 -1
- package/build/types/chips/index.d.ts +2 -0
- package/build/types/chips/index.d.ts.map +1 -1
- package/build/types/common/Option/index.d.ts +1 -0
- package/build/types/common/Option/index.d.ts.map +1 -1
- package/build/types/criticalBanner/CriticalCommsBanner.d.ts +6 -0
- package/build/types/criticalBanner/CriticalCommsBanner.d.ts.map +1 -1
- package/build/types/criticalBanner/index.d.ts +1 -1
- package/build/types/criticalBanner/index.d.ts.map +1 -1
- package/build/types/decision/index.d.ts +1 -0
- package/build/types/decision/index.d.ts.map +1 -1
- package/build/types/definitionList/index.d.ts +1 -1
- package/build/types/definitionList/index.d.ts.map +1 -1
- package/build/types/expressiveMoneyInput/index.d.ts +1 -1
- package/build/types/expressiveMoneyInput/index.d.ts.map +1 -1
- package/build/types/index.d.ts +34 -19
- package/build/types/index.d.ts.map +1 -1
- package/build/types/inlineAlert/InlineAlert.d.ts +3 -0
- package/build/types/inlineAlert/InlineAlert.d.ts.map +1 -1
- package/build/types/inlineAlert/index.d.ts +1 -0
- package/build/types/inlineAlert/index.d.ts.map +1 -1
- package/build/types/instructionsList/index.d.ts +1 -1
- package/build/types/instructionsList/index.d.ts.map +1 -1
- package/build/types/listItem/ListItem.d.ts +1 -1
- package/build/types/logo/index.d.ts +2 -1
- package/build/types/logo/index.d.ts.map +1 -1
- package/build/types/navigationOption/NavigationOption.d.ts +3 -0
- package/build/types/navigationOption/NavigationOption.d.ts.map +1 -1
- package/build/types/navigationOption/index.d.ts +1 -0
- package/build/types/navigationOption/index.d.ts.map +1 -1
- package/build/types/navigationOptionsList/NavigationOptionsList.d.ts +3 -0
- package/build/types/navigationOptionsList/NavigationOptionsList.d.ts.map +1 -1
- package/build/types/nudge/index.d.ts +1 -0
- package/build/types/nudge/index.d.ts.map +1 -1
- package/build/types/phoneNumberInput/index.d.ts +1 -0
- package/build/types/phoneNumberInput/index.d.ts.map +1 -1
- package/build/types/promoCard/index.d.ts +2 -0
- package/build/types/promoCard/index.d.ts.map +1 -1
- package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts.map +1 -1
- package/build/types/select/Select.d.ts +3 -0
- package/build/types/select/Select.d.ts.map +1 -1
- package/build/types/snackbar/index.d.ts +2 -0
- package/build/types/snackbar/index.d.ts.map +1 -1
- package/build/types/statusIcon/index.d.ts +1 -1
- package/build/types/statusIcon/index.d.ts.map +1 -1
- package/build/types/table/index.d.ts +4 -3
- package/build/types/table/index.d.ts.map +1 -1
- package/build/types/tabs/index.d.ts +3 -0
- package/build/types/tabs/index.d.ts.map +1 -1
- package/build/types/tile/index.d.ts +1 -0
- package/build/types/tile/index.d.ts.map +1 -1
- package/build/types/uploadInput/index.d.ts +1 -0
- package/build/types/uploadInput/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/avatar/Avatar.tsx +9 -2
- package/src/avatar/index.ts +1 -1
- package/src/avatarWrapper/AvatarWrapper.tsx +3 -0
- package/src/avatarWrapper/index.ts +2 -3
- package/src/button/Button.types.ts +1 -1
- package/src/button/index.ts +14 -2
- package/src/card/Card.tsx +3 -0
- package/src/carousel/index.ts +7 -1
- package/src/checkboxButton/index.ts +2 -0
- package/src/checkboxOption/index.ts +2 -0
- package/src/chevron/index.ts +2 -0
- package/src/chips/index.ts +3 -0
- package/src/common/Option/index.ts +1 -0
- package/src/criticalBanner/CriticalCommsBanner.tsx +6 -0
- package/src/criticalBanner/index.ts +1 -1
- package/src/decision/index.ts +2 -0
- package/src/definitionList/index.ts +1 -1
- package/src/expressiveMoneyInput/index.ts +1 -1
- package/src/index.ts +66 -18
- package/src/inlineAlert/InlineAlert.tsx +3 -0
- package/src/inlineAlert/index.ts +2 -0
- package/src/instructionsList/index.ts +1 -1
- package/src/logo/index.ts +2 -1
- package/src/main.css +11 -39
- package/src/navigationOption/NavigationOption.tsx +3 -0
- package/src/navigationOption/index.ts +2 -0
- package/src/navigationOptionsList/NavigationOptionsList.tsx +3 -0
- package/src/nudge/index.ts +2 -0
- package/src/phoneNumberInput/index.ts +2 -0
- package/src/promoCard/index.ts +8 -0
- package/src/prompt/CriticalBanner/CriticalBanner.accessibility.docs.mdx +1 -4
- package/src/prompt/CriticalBanner/CriticalBanner.css +11 -36
- package/src/prompt/CriticalBanner/CriticalBanner.less +17 -49
- package/src/prompt/CriticalBanner/CriticalBanner.story.tsx +1 -43
- package/src/prompt/CriticalBanner/CriticalBanner.test.story.tsx +0 -21
- package/src/prompt/CriticalBanner/CriticalBanner.test.tsx +3 -11
- package/src/prompt/CriticalBanner/CriticalBanner.tsx +1 -5
- package/src/select/Select.tsx +3 -0
- package/src/snackbar/index.ts +3 -0
- package/src/ssr.test.tsx +6 -3
- package/src/statusIcon/index.ts +1 -1
- package/src/table/index.ts +5 -2
- package/src/tabs/index.ts +3 -0
- package/src/tile/index.ts +1 -0
- package/src/uploadInput/index.ts +2 -0
- package/build/avatarWrapper/index.js +0 -10
- package/build/avatarWrapper/index.js.map +0 -1
- package/build/avatarWrapper/index.mjs +0 -6
- package/build/avatarWrapper/index.mjs.map +0 -1
package/src/main.css
CHANGED
|
@@ -32099,30 +32099,22 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
32099
32099
|
inline-size: 100%;
|
|
32100
32100
|
}
|
|
32101
32101
|
|
|
32102
|
-
.wds-critical-banner__entry-mask {
|
|
32103
|
-
display: grid;
|
|
32104
|
-
grid-template-rows: 0fr;
|
|
32105
|
-
overflow: hidden;
|
|
32106
|
-
animation: wds-critical-banner-reveal-height 400ms cubic-bezier(0.3, 0, 0.1, 1) 500ms both;
|
|
32107
|
-
}
|
|
32108
|
-
|
|
32109
32102
|
@container critical-banner-overhang (max-width: 600px) {
|
|
32110
|
-
.wds-critical-
|
|
32103
|
+
.wds-critical-banner-overhang-query .wds-critical-banner-overhang {
|
|
32111
32104
|
--critical-banner-mobile-overhang-size: 32px;
|
|
32112
32105
|
--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
|
-
|
|
32114
|
-
|
|
32115
|
-
|
|
32116
|
-
|
|
32117
|
-
|
|
32118
|
-
|
|
32119
|
-
|
|
32120
|
-
|
|
32121
|
-
|
|
32122
|
-
.wds-critical-banner__entry-mask .wds-critical-banner-overhang {
|
|
32106
|
+
var(--critical-banner-mobile-overhang-size) no-repeat,
|
|
32107
|
+
radial-gradient(
|
|
32108
|
+
circle at 0% 100%,
|
|
32109
|
+
transparent var(--critical-banner-mobile-overhang-size),
|
|
32110
|
+
#000 var(--critical-banner-mobile-overhang-size)
|
|
32111
|
+
)
|
|
32112
|
+
100% 0 / var(--critical-banner-mobile-overhang-size)
|
|
32113
|
+
var(--critical-banner-mobile-overhang-size) no-repeat;
|
|
32114
|
+
margin-bottom: 32px;
|
|
32123
32115
|
margin-bottom: var(--critical-banner-mobile-overhang-size);
|
|
32124
32116
|
}
|
|
32125
|
-
.wds-critical-
|
|
32117
|
+
.wds-critical-banner-overhang-query .wds-critical-banner-overhang::after {
|
|
32126
32118
|
content: "";
|
|
32127
32119
|
position: absolute;
|
|
32128
32120
|
right: 0;
|
|
@@ -32136,21 +32128,6 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
32136
32128
|
}
|
|
32137
32129
|
}
|
|
32138
32130
|
|
|
32139
|
-
.wds-critical-banner__entry-track {
|
|
32140
|
-
min-height: 0;
|
|
32141
|
-
}
|
|
32142
|
-
|
|
32143
|
-
@keyframes wds-critical-banner-reveal-height {
|
|
32144
|
-
from {
|
|
32145
|
-
grid-template-rows: 0fr;
|
|
32146
|
-
overflow: hidden;
|
|
32147
|
-
}
|
|
32148
|
-
to {
|
|
32149
|
-
grid-template-rows: 1fr;
|
|
32150
|
-
overflow: visible;
|
|
32151
|
-
}
|
|
32152
|
-
}
|
|
32153
|
-
|
|
32154
32131
|
@media (prefers-reduced-motion: reduce) {
|
|
32155
32132
|
.wds-critical-banner__description,
|
|
32156
32133
|
.wds-critical-banner__title,
|
|
@@ -32158,11 +32135,6 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
32158
32135
|
.wds-critical-banner__toggle {
|
|
32159
32136
|
transition: none !important;
|
|
32160
32137
|
}
|
|
32161
|
-
.wds-critical-banner__entry-mask {
|
|
32162
|
-
animation: none;
|
|
32163
|
-
grid-template-rows: 1fr;
|
|
32164
|
-
overflow: visible;
|
|
32165
|
-
}
|
|
32166
32138
|
}
|
|
32167
32139
|
|
|
32168
32140
|
.wds-expander-toggle {
|
|
@@ -6,6 +6,9 @@ import { Position } from '../common';
|
|
|
6
6
|
import Option from '../common/Option';
|
|
7
7
|
import { OptionProps, ReferenceType } from '../common/Option/Option';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use ListItem and associated typings
|
|
11
|
+
*/
|
|
9
12
|
export type NavigationOptionProps = OptionProps;
|
|
10
13
|
|
|
11
14
|
/**
|
package/src/nudge/index.ts
CHANGED
package/src/promoCard/index.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
export { default } from './PromoCard';
|
|
2
2
|
export { default as PromoCardGroup } from './PromoCardGroup';
|
|
3
|
+
|
|
4
|
+
export type {
|
|
5
|
+
PromoCardCommonProps,
|
|
6
|
+
PromoCardLinkProps,
|
|
7
|
+
PromoCardCheckedProps,
|
|
8
|
+
PromoCardProps,
|
|
9
|
+
} from './PromoCard';
|
|
10
|
+
export type { PromoCardGroupProps } from './PromoCardGroup';
|
|
@@ -66,10 +66,7 @@ Screen readers announce the banner content whenever:
|
|
|
66
66
|
|
|
67
67
|
## Reduced Motion
|
|
68
68
|
|
|
69
|
-
`CriticalBanner` respects the user's reduced motion preference. When reduced motion is on, the component does not show
|
|
70
|
-
|
|
71
|
-
- the entry animation that reveals the banner from above when it first appears
|
|
72
|
-
- the collapse and expand animation used when the user toggles the banner content
|
|
69
|
+
`CriticalBanner` respects the user's reduced motion preference. When reduced motion is on, the component does not show the collapse and expand animation used when the user toggles the banner content.
|
|
73
70
|
|
|
74
71
|
The same content is still rendered and announced. Reduced motion only removes the visual movement.
|
|
75
72
|
|
|
@@ -127,29 +127,22 @@
|
|
|
127
127
|
container-type: inline-size;
|
|
128
128
|
inline-size: 100%;
|
|
129
129
|
}
|
|
130
|
-
.wds-critical-banner__entry-mask {
|
|
131
|
-
display: grid;
|
|
132
|
-
grid-template-rows: 0fr;
|
|
133
|
-
overflow: hidden;
|
|
134
|
-
animation: wds-critical-banner-reveal-height 400ms cubic-bezier(0.3, 0, 0.1, 1) 500ms both;
|
|
135
|
-
}
|
|
136
130
|
@container critical-banner-overhang (max-width: 600px) {
|
|
137
|
-
.wds-critical-
|
|
131
|
+
.wds-critical-banner-overhang-query .wds-critical-banner-overhang {
|
|
138
132
|
--critical-banner-mobile-overhang-size: 32px;
|
|
139
133
|
--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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
.wds-critical-banner__entry-mask .wds-critical-banner-overhang {
|
|
134
|
+
var(--critical-banner-mobile-overhang-size) no-repeat,
|
|
135
|
+
radial-gradient(
|
|
136
|
+
circle at 0% 100%,
|
|
137
|
+
transparent var(--critical-banner-mobile-overhang-size),
|
|
138
|
+
#000 var(--critical-banner-mobile-overhang-size)
|
|
139
|
+
)
|
|
140
|
+
100% 0 / var(--critical-banner-mobile-overhang-size)
|
|
141
|
+
var(--critical-banner-mobile-overhang-size) no-repeat;
|
|
142
|
+
margin-bottom: 32px;
|
|
150
143
|
margin-bottom: var(--critical-banner-mobile-overhang-size);
|
|
151
144
|
}
|
|
152
|
-
.wds-critical-
|
|
145
|
+
.wds-critical-banner-overhang-query .wds-critical-banner-overhang::after {
|
|
153
146
|
content: "";
|
|
154
147
|
position: absolute;
|
|
155
148
|
right: 0;
|
|
@@ -162,19 +155,6 @@
|
|
|
162
155
|
mask: var(--critical-banner-overhang-mask);
|
|
163
156
|
}
|
|
164
157
|
}
|
|
165
|
-
.wds-critical-banner__entry-track {
|
|
166
|
-
min-height: 0;
|
|
167
|
-
}
|
|
168
|
-
@keyframes wds-critical-banner-reveal-height {
|
|
169
|
-
from {
|
|
170
|
-
grid-template-rows: 0fr;
|
|
171
|
-
overflow: hidden;
|
|
172
|
-
}
|
|
173
|
-
to {
|
|
174
|
-
grid-template-rows: 1fr;
|
|
175
|
-
overflow: visible;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
158
|
@media (prefers-reduced-motion: reduce) {
|
|
179
159
|
.wds-critical-banner__description,
|
|
180
160
|
.wds-critical-banner__title,
|
|
@@ -182,9 +162,4 @@
|
|
|
182
162
|
.wds-critical-banner__toggle {
|
|
183
163
|
transition: none !important;
|
|
184
164
|
}
|
|
185
|
-
.wds-critical-banner__entry-mask {
|
|
186
|
-
animation: none;
|
|
187
|
-
grid-template-rows: 1fr;
|
|
188
|
-
overflow: visible;
|
|
189
|
-
}
|
|
190
165
|
}
|
|
@@ -151,40 +151,30 @@
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
// Entry animation: after a 500ms delay, reveal the already-positioned banner
|
|
155
|
-
// over 400ms. The mask clips only during the reveal, then becomes visible so the
|
|
156
|
-
// overhang and actions are not clipped after the animation.
|
|
157
154
|
.wds-critical-banner-overhang-query {
|
|
158
155
|
container-name: critical-banner-overhang;
|
|
159
156
|
container-type: inline-size;
|
|
160
157
|
inline-size: 100%;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.wds-critical-banner__entry-mask {
|
|
164
|
-
display: grid;
|
|
165
|
-
grid-template-rows: 0fr;
|
|
166
|
-
overflow: hidden;
|
|
167
|
-
animation: wds-critical-banner-reveal-height 400ms cubic-bezier(0.3, 0, 0.1, 1) 500ms both;
|
|
168
158
|
|
|
169
159
|
@container critical-banner-overhang (max-width: @wds-critical-banner-mobile-overhang-max) {
|
|
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;
|
|
186
|
-
|
|
187
160
|
.wds-critical-banner-overhang {
|
|
161
|
+
--critical-banner-mobile-overhang-size: 32px;
|
|
162
|
+
--critical-banner-overhang-mask:
|
|
163
|
+
radial-gradient(
|
|
164
|
+
circle at 100% 100%,
|
|
165
|
+
transparent var(--critical-banner-mobile-overhang-size),
|
|
166
|
+
#000 var(--critical-banner-mobile-overhang-size)
|
|
167
|
+
)
|
|
168
|
+
0 0 / var(--critical-banner-mobile-overhang-size)
|
|
169
|
+
var(--critical-banner-mobile-overhang-size) no-repeat,
|
|
170
|
+
radial-gradient(
|
|
171
|
+
circle at 0% 100%,
|
|
172
|
+
transparent var(--critical-banner-mobile-overhang-size),
|
|
173
|
+
#000 var(--critical-banner-mobile-overhang-size)
|
|
174
|
+
)
|
|
175
|
+
100% 0 / var(--critical-banner-mobile-overhang-size)
|
|
176
|
+
var(--critical-banner-mobile-overhang-size) no-repeat;
|
|
177
|
+
|
|
188
178
|
margin-bottom: var(--critical-banner-mobile-overhang-size);
|
|
189
179
|
|
|
190
180
|
&::after {
|
|
@@ -203,22 +193,6 @@
|
|
|
203
193
|
}
|
|
204
194
|
}
|
|
205
195
|
|
|
206
|
-
.wds-critical-banner__entry-track {
|
|
207
|
-
min-height: 0;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
@keyframes wds-critical-banner-reveal-height {
|
|
211
|
-
from {
|
|
212
|
-
grid-template-rows: 0fr;
|
|
213
|
-
overflow: hidden;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
to {
|
|
217
|
-
grid-template-rows: 1fr;
|
|
218
|
-
overflow: visible;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
196
|
// Reduced motion support
|
|
223
197
|
@media (prefers-reduced-motion: reduce) {
|
|
224
198
|
.wds-critical-banner__description,
|
|
@@ -227,10 +201,4 @@
|
|
|
227
201
|
.wds-critical-banner__toggle {
|
|
228
202
|
transition: none !important;
|
|
229
203
|
}
|
|
230
|
-
|
|
231
|
-
.wds-critical-banner__entry-mask {
|
|
232
|
-
animation: none;
|
|
233
|
-
grid-template-rows: 1fr;
|
|
234
|
-
overflow: visible;
|
|
235
|
-
}
|
|
236
204
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState, useEffect,
|
|
1
|
+
import { useState, useEffect, useRef, type ReactNode } from 'react';
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
import { Meta, StoryObj, Decorator } from '@storybook/react-webpack5';
|
|
4
4
|
import { fn } from 'storybook/test';
|
|
@@ -137,29 +137,6 @@ const hiddenArgTypes = {
|
|
|
137
137
|
'data-testid': { table: { disable: true } },
|
|
138
138
|
} as const;
|
|
139
139
|
|
|
140
|
-
const AnimatedEntryPreview = (args: CriticalBannerProps) => {
|
|
141
|
-
const { id = 'animated-entry' } = args;
|
|
142
|
-
const [bannerInstance, setBannerInstance] = useState(0);
|
|
143
|
-
const animatedBanner = useMemo(
|
|
144
|
-
() => ({
|
|
145
|
-
...args,
|
|
146
|
-
id: `${id}-${bannerInstance}`,
|
|
147
|
-
}),
|
|
148
|
-
[args, bannerInstance, id],
|
|
149
|
-
);
|
|
150
|
-
|
|
151
|
-
return (
|
|
152
|
-
<>
|
|
153
|
-
<CriticalBanner key={animatedBanner.id} {...animatedBanner} />
|
|
154
|
-
<div className="p-t-3">
|
|
155
|
-
<Button block v2 onClick={() => setBannerInstance((current) => current + 1)}>
|
|
156
|
-
Replay
|
|
157
|
-
</Button>
|
|
158
|
-
</div>
|
|
159
|
-
</>
|
|
160
|
-
);
|
|
161
|
-
};
|
|
162
|
-
|
|
163
140
|
/** Renders children inside an iframe that inherits the parent page's stylesheets. */
|
|
164
141
|
function IframeContainer({ width, children }: { width: number; children: ReactNode }) {
|
|
165
142
|
const iframeRef = useRef<HTMLIFrameElement>(null);
|
|
@@ -608,25 +585,6 @@ export const MobileOverhang: Story = {
|
|
|
608
585
|
},
|
|
609
586
|
};
|
|
610
587
|
|
|
611
|
-
/**
|
|
612
|
-
* Mobile-only entry animation: the banner reveals from above.
|
|
613
|
-
*/
|
|
614
|
-
export const AnimatedEntry: Story = {
|
|
615
|
-
args: {
|
|
616
|
-
title: 'Your account is restricted.',
|
|
617
|
-
description: 'Review your personal details to get your account active again.',
|
|
618
|
-
action: { label: 'Review details', onClick: fn() },
|
|
619
|
-
},
|
|
620
|
-
argTypes: hiddenArgTypes,
|
|
621
|
-
render: (args) => <AnimatedEntryPreview {...args} />,
|
|
622
|
-
parameters: {
|
|
623
|
-
layout: 'fullscreen',
|
|
624
|
-
docs: {
|
|
625
|
-
canvas: { sourceState: 'hidden' },
|
|
626
|
-
},
|
|
627
|
-
},
|
|
628
|
-
};
|
|
629
|
-
|
|
630
588
|
/**
|
|
631
589
|
* The text container is capped at 480px for optimal readability, even though
|
|
632
590
|
* the banner itself stretches to the full available width.
|
|
@@ -21,7 +21,6 @@ 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
|
|
25
24
|
|
|
26
25
|
const longDescription =
|
|
27
26
|
'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.';
|
|
@@ -198,7 +197,6 @@ export const BackgroundIsNotTransparent: Story = {
|
|
|
198
197
|
|
|
199
198
|
if (scrollContainer) {
|
|
200
199
|
scrollContainer.scrollTop = 250;
|
|
201
|
-
await wait(ENTRY_ANIMATION_DURATION);
|
|
202
200
|
}
|
|
203
201
|
},
|
|
204
202
|
...withVariantConfig(['mobile'], {
|
|
@@ -208,25 +206,6 @@ export const BackgroundIsNotTransparent: Story = {
|
|
|
208
206
|
}),
|
|
209
207
|
};
|
|
210
208
|
|
|
211
|
-
/** Mobile entry animation visual regression test. */
|
|
212
|
-
export const AnimatedEntryMobile: Story = {
|
|
213
|
-
render: function Render() {
|
|
214
|
-
return (
|
|
215
|
-
<CriticalBanner
|
|
216
|
-
sentiment="negative"
|
|
217
|
-
title="Your account is restricted."
|
|
218
|
-
description="Review your personal details to get your account active again."
|
|
219
|
-
action={{ label: 'Review details', onClick: fn() }}
|
|
220
|
-
/>
|
|
221
|
-
);
|
|
222
|
-
},
|
|
223
|
-
...withVariantConfig(['mobile'], {
|
|
224
|
-
parameters: {
|
|
225
|
-
chromatic: { pauseAnimationAtEnd: true },
|
|
226
|
-
},
|
|
227
|
-
}),
|
|
228
|
-
};
|
|
229
|
-
|
|
230
209
|
/**
|
|
231
210
|
* Tests keyboard navigation and interaction:
|
|
232
211
|
* - Tab focuses the first chevron toggle button
|
|
@@ -15,7 +15,7 @@ describe('CriticalBanner', () => {
|
|
|
15
15
|
resetLiveRegionAnnouncementQueue();
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
it('
|
|
18
|
+
it('renders mobile overhang markup without entry animation markup', () => {
|
|
19
19
|
const { container } = render(
|
|
20
20
|
<CriticalBanner {...defaultProps} data-testid="critical-banner" />,
|
|
21
21
|
);
|
|
@@ -23,15 +23,7 @@ describe('CriticalBanner', () => {
|
|
|
23
23
|
expect(screen.getByTestId('critical-banner')).toBeInTheDocument();
|
|
24
24
|
expect(container.querySelector('.wds-critical-banner-overhang')).toBeInTheDocument();
|
|
25
25
|
expect(container.querySelector('.wds-critical-banner-overhang-query')).toBeInTheDocument();
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
it('wraps the banner in the css entry animation structure', () => {
|
|
29
|
-
const { container } = render(
|
|
30
|
-
<CriticalBanner {...defaultProps} data-testid="critical-banner" />,
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
expect(screen.getByTestId('critical-banner')).toBeInTheDocument();
|
|
34
|
-
expect(container.querySelector('.wds-critical-banner__entry-mask')).toBeInTheDocument();
|
|
35
|
-
expect(container.querySelector('.wds-critical-banner__entry-track')).toBeInTheDocument();
|
|
26
|
+
expect(container.querySelector('.wds-critical-banner__entry-mask')).not.toBeInTheDocument();
|
|
27
|
+
expect(container.querySelector('.wds-critical-banner__entry-track')).not.toBeInTheDocument();
|
|
36
28
|
});
|
|
37
29
|
});
|
|
@@ -179,11 +179,7 @@ export const CriticalBanner = ({
|
|
|
179
179
|
actionSecondaryLabel: actionSecondary?.label,
|
|
180
180
|
})}
|
|
181
181
|
>
|
|
182
|
-
<div className="wds-critical-banner-overhang-query">
|
|
183
|
-
<div className="wds-critical-banner__entry-mask">
|
|
184
|
-
<div className="wds-critical-banner__entry-track">{bannerSurface}</div>
|
|
185
|
-
</div>
|
|
186
|
-
</div>
|
|
182
|
+
<div className="wds-critical-banner-overhang-query">{bannerSurface}</div>
|
|
187
183
|
</LiveRegion>
|
|
188
184
|
);
|
|
189
185
|
};
|
package/src/select/Select.tsx
CHANGED
|
@@ -98,6 +98,9 @@ const getUniqueIdForOption = (parentId: string | undefined, option: SelectItem |
|
|
|
98
98
|
return `option-${parentId ?? ''}-${uniqueOptionId}`;
|
|
99
99
|
};
|
|
100
100
|
|
|
101
|
+
/**
|
|
102
|
+
* @deprecated Use SelectInput and associated typings
|
|
103
|
+
*/
|
|
101
104
|
export interface SelectProps {
|
|
102
105
|
placeholder?: string;
|
|
103
106
|
id?: string;
|
package/src/snackbar/index.ts
CHANGED
package/src/ssr.test.tsx
CHANGED
|
@@ -92,9 +92,7 @@ describe('Server side rendering', () => {
|
|
|
92
92
|
|
|
93
93
|
// stick all possible properties we might need to render all components in here
|
|
94
94
|
const allProps: Record<string, unknown> = {
|
|
95
|
-
actionPrimary: { label: 'Action', onClick: jest.fn(), href: '#' },
|
|
96
95
|
currencies: [],
|
|
97
|
-
currencySelector: { options: [] },
|
|
98
96
|
steps: [],
|
|
99
97
|
stepper: {
|
|
100
98
|
steps: [],
|
|
@@ -184,7 +182,11 @@ describe('Server side rendering', () => {
|
|
|
184
182
|
// Override props in case of name collision.
|
|
185
183
|
const overrideProps: Partial<Record<keyof ExposedLibraryItemsType, Record<string, unknown>>> = {
|
|
186
184
|
Logo: { size: 16 },
|
|
187
|
-
|
|
185
|
+
BadgeAssets: { status: undefined },
|
|
186
|
+
ActionPrompt: {
|
|
187
|
+
actionPrimary: { label: 'Action', onClick: jest.fn(), href: '#' },
|
|
188
|
+
action: { label: 'Action', onClick: jest.fn(), href: '#' },
|
|
189
|
+
},
|
|
188
190
|
Alert: { children: undefined, message: 'Fluffy kittens', size: undefined },
|
|
189
191
|
Card: { isExpanded: true },
|
|
190
192
|
CheckboxButton: { children: undefined, onChange: jest.fn() },
|
|
@@ -193,6 +195,7 @@ describe('Server side rendering', () => {
|
|
|
193
195
|
TextareaWithDisplayFormat: { displayPattern: '**-**' },
|
|
194
196
|
Sticky: { position: 'top' },
|
|
195
197
|
MoneyInput: { selectedCurrency: { currency: 'EUR' } },
|
|
198
|
+
ExpressiveMoneyInput: { currencySelector: { options: [] } },
|
|
196
199
|
Tabs: { selected: 1, onTabSelect: jest.fn() },
|
|
197
200
|
Markdown: { children: '# Markdown string' },
|
|
198
201
|
SnackbarConsumer: {
|
package/src/statusIcon/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from './StatusIcon';
|
|
2
|
-
export type { StatusIconProps } from './StatusIcon';
|
|
2
|
+
export type { StatusIconProps, StatusIconSentiment } from './StatusIcon';
|
package/src/table/index.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
export { default } from './Table';
|
|
2
2
|
export type { TableProps } from './Table';
|
|
3
|
-
export type { TableRowType, TableRowClickableType } from './TableRow';
|
|
4
|
-
export type { TableHeaderType } from './TableHeader';
|
|
3
|
+
export type { TableRowType, TableRowClickableType, TableRowProps } from './TableRow';
|
|
4
|
+
export type { TableHeaderType, TableHeaderProps } from './TableHeader';
|
|
5
5
|
export type {
|
|
6
6
|
TableCellLeading,
|
|
7
7
|
TableCellText,
|
|
8
8
|
TableCellCurrency,
|
|
9
9
|
TableCellStatus,
|
|
10
10
|
TableCellType,
|
|
11
|
+
TableCellMedia,
|
|
12
|
+
TableCellProps,
|
|
11
13
|
} from './TableCell';
|
|
14
|
+
export type { TableStatusTextProps } from './TableStatusText';
|
package/src/tabs/index.ts
CHANGED
package/src/tile/index.ts
CHANGED
package/src/uploadInput/index.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|