@transferwise/components 0.0.0-experimental-9f03da2 → 0.0.0-experimental-fdc8cd1
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/avatarLayout/AvatarLayout.js +1 -15
- package/build/avatarLayout/AvatarLayout.js.map +1 -1
- package/build/avatarLayout/AvatarLayout.mjs +1 -15
- package/build/avatarLayout/AvatarLayout.mjs.map +1 -1
- package/build/avatarView/AvatarView.js +2 -6
- package/build/avatarView/AvatarView.js.map +1 -1
- package/build/avatarView/AvatarView.mjs +2 -6
- package/build/avatarView/AvatarView.mjs.map +1 -1
- package/build/avatarView/Dot.js +0 -8
- package/build/avatarView/Dot.js.map +1 -1
- package/build/avatarView/Dot.mjs +0 -8
- package/build/avatarView/Dot.mjs.map +1 -1
- package/build/common/circle/Circle.js +2 -6
- package/build/common/circle/Circle.js.map +1 -1
- package/build/common/circle/Circle.mjs +2 -6
- package/build/common/circle/Circle.mjs.map +1 -1
- package/build/expressiveMoneyInput/amountInput/AmountInput.js +1 -1
- package/build/expressiveMoneyInput/amountInput/AmountInput.js.map +1 -1
- package/build/expressiveMoneyInput/amountInput/AmountInput.mjs +1 -1
- package/build/expressiveMoneyInput/amountInput/AmountInput.mjs.map +1 -1
- package/build/main.css +19 -5
- package/build/styles/avatarView/AvatarView.css +4 -4
- package/build/styles/avatarView/Dot.css +4 -4
- package/build/styles/css/neptune.css +15 -1
- package/build/styles/main.css +19 -5
- package/build/styles/styles/less/neptune.css +15 -1
- package/build/types/avatarView/AvatarView.d.ts +1 -1
- package/build/types/avatarView/AvatarView.d.ts.map +1 -1
- package/build/types/avatarView/Dot.d.ts.map +1 -1
- package/build/types/common/circle/Circle.d.ts +1 -1
- package/build/types/common/circle/Circle.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/avatarLayout/AvatarLayout.story.tsx +1 -1
- package/src/avatarLayout/AvatarLayout.tsx +0 -4
- package/src/avatarView/AvatarView.css +4 -4
- package/src/avatarView/AvatarView.story.tsx +13 -17
- package/src/avatarView/AvatarView.tsx +1 -5
- package/src/avatarView/Dot.css +4 -4
- package/src/avatarView/Dot.less +6 -6
- package/src/avatarView/Dot.tsx +0 -2
- package/src/common/circle/Circle.tsx +1 -5
- package/src/expressiveMoneyInput/ExpressiveMoneyInput.test.story.tsx +43 -0
- package/src/expressiveMoneyInput/amountInput/AmountInput.tsx +1 -1
- package/src/main.css +19 -5
- package/src/styles/less/core/_typography.less +28 -6
- package/src/styles/less/neptune.css +15 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { fn } from 'storybook/test';
|
|
2
3
|
import ExpressiveMoneyInput, { Props as ExpressiveMoneyInputProps } from './ExpressiveMoneyInput';
|
|
3
4
|
|
|
4
5
|
const meta: Meta<typeof ExpressiveMoneyInput> = {
|
|
@@ -21,3 +22,45 @@ export const WithAutofocus: Story = {
|
|
|
21
22
|
autoFocus: true,
|
|
22
23
|
},
|
|
23
24
|
};
|
|
25
|
+
|
|
26
|
+
const locales = [
|
|
27
|
+
{ lang: 'en', label: 'English', currency: 'GBP' },
|
|
28
|
+
{ lang: 'cs', label: 'Czech', currency: 'CZK' },
|
|
29
|
+
{ lang: 'de', label: 'German', currency: 'EUR' },
|
|
30
|
+
{ lang: 'es', label: 'Spanish', currency: 'EUR' },
|
|
31
|
+
{ lang: 'fr', label: 'French', currency: 'EUR' },
|
|
32
|
+
{ lang: 'hu', label: 'Hungarian', currency: 'HUF', supportsDecimals: false },
|
|
33
|
+
{ lang: 'id', label: 'Indonesian', currency: 'IDR', supportsDecimals: false },
|
|
34
|
+
{ lang: 'it', label: 'Italian', currency: 'EUR' },
|
|
35
|
+
{ lang: 'ja', label: 'Japanese', currency: 'JPY', supportsDecimals: false },
|
|
36
|
+
{ lang: 'nl', label: 'Dutch', currency: 'EUR' },
|
|
37
|
+
{ lang: 'pl', label: 'Polish', currency: 'PLN' },
|
|
38
|
+
{ lang: 'pt', label: 'Portuguese', currency: 'EUR' },
|
|
39
|
+
{ lang: 'ro', label: 'Romanian', currency: 'RON' },
|
|
40
|
+
{ lang: 'ru', label: 'Russian', currency: 'RUB' },
|
|
41
|
+
{ lang: 'th', label: 'Thai', currency: 'THB' },
|
|
42
|
+
{ lang: 'tr', label: 'Turkish', currency: 'TRY' },
|
|
43
|
+
{ lang: 'uk', label: 'Ukrainian', currency: 'UAH' },
|
|
44
|
+
{ lang: 'zh-CN', label: 'Simplified Chinese', currency: 'CNY' },
|
|
45
|
+
{ lang: 'zh-HK', label: 'Traditional Chinese', currency: 'HKD' },
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Verifies that the .wds-text-display--forced class correctly overrides locale-specific
|
|
50
|
+
* font restrictions (ja, zh-HK, zh-CN, th) so amounts render in Wise Sans across all
|
|
51
|
+
* supported locales. Each row represents a different language context.
|
|
52
|
+
*/
|
|
53
|
+
export const LocaleFontOverride = () => (
|
|
54
|
+
<>
|
|
55
|
+
{locales.map(({ lang, label, currency, supportsDecimals = true }) => (
|
|
56
|
+
<div key={lang} lang={lang} className="m-b-4">
|
|
57
|
+
<ExpressiveMoneyInput
|
|
58
|
+
label={`${label} locale (${lang})`}
|
|
59
|
+
currency={currency}
|
|
60
|
+
amount={supportsDecimals ? 1234.56 : 123456}
|
|
61
|
+
onAmountChange={fn()}
|
|
62
|
+
/>
|
|
63
|
+
</div>
|
|
64
|
+
))}
|
|
65
|
+
</>
|
|
66
|
+
);
|
|
@@ -291,7 +291,7 @@ export const AmountInput = ({
|
|
|
291
291
|
return (
|
|
292
292
|
<div className="wds-amount-input-container">
|
|
293
293
|
<div
|
|
294
|
-
className={clsx('wds-amount-input-input-container', 'np-text-display-large')}
|
|
294
|
+
className={clsx('wds-amount-input-input-container', 'np-text-display-large--forced')}
|
|
295
295
|
style={style}
|
|
296
296
|
>
|
|
297
297
|
<input
|
package/src/main.css
CHANGED
|
@@ -3238,7 +3238,16 @@ a,
|
|
|
3238
3238
|
.np-text-display-extra-large,
|
|
3239
3239
|
.np-text-display-large,
|
|
3240
3240
|
.np-text-display-medium,
|
|
3241
|
-
.np-text-display-small
|
|
3241
|
+
.np-text-display-small,
|
|
3242
|
+
.display-1--forced,
|
|
3243
|
+
.display-2--forced,
|
|
3244
|
+
.display-3--forced,
|
|
3245
|
+
.display-4--forced,
|
|
3246
|
+
.display-5--forced,
|
|
3247
|
+
.np-text-display-extra-large--forced,
|
|
3248
|
+
.np-text-display-large--forced,
|
|
3249
|
+
.np-text-display-medium--forced,
|
|
3250
|
+
.np-text-display-small--forced {
|
|
3242
3251
|
font-family: 'Wise Sans', 'Inter', sans-serif;
|
|
3243
3252
|
font-family: var(--font-family-display);
|
|
3244
3253
|
font-synthesis: none;
|
|
@@ -3285,9 +3294,14 @@ a,
|
|
|
3285
3294
|
* of Japanese ones for the logged out ones (exposed by the Editorial DS). Unfortunately,
|
|
3286
3295
|
* font files are browser-cached and we carried over to launchpad, where it causes issues
|
|
3287
3296
|
* for unsupported locales, especially those that share glyphs, like Japanese and Chinese.
|
|
3297
|
+
* There are exceptions for small UI parts where Wise Sans is fine or expected — e.g. the
|
|
3298
|
+
* numeric input of ExpressiveMoneyInput.
|
|
3299
|
+
* Add `--forced` BEM modifier to the original class name to guarantee it.
|
|
3288
3300
|
*/
|
|
3289
3301
|
font-family: 'Inter', Helvetica, Arial, sans-serif;
|
|
3290
3302
|
font-family: var(--font-family-regular);
|
|
3303
|
+
line-height: 1.2;
|
|
3304
|
+
line-height: var(--line-height-title);
|
|
3291
3305
|
}
|
|
3292
3306
|
|
|
3293
3307
|
/* DEPRECATED(.np-text-display-extra-large): use .np-text-display-large instead */
|
|
@@ -26633,10 +26647,10 @@ a[data-toggle="tooltip"] {
|
|
|
26633
26647
|
}
|
|
26634
26648
|
|
|
26635
26649
|
.np-dot-mask {
|
|
26636
|
-
-webkit-mask-image: radial-gradient(circle at bottom calc(100% - (var(--np-dot-size) / 2)) left calc(100% - (var(--np-dot-size) / 2)), transparent 0, transparent calc(var(--np-dot-size) / 2 + var(--np-dot-offset)), black
|
|
26637
|
-
mask-image: radial-gradient(circle at bottom calc(100% - (var(--np-dot-size) / 2)) left calc(100% - (var(--np-dot-size) / 2)), transparent 0, transparent calc(var(--np-dot-size) / 2 + var(--np-dot-offset)), black
|
|
26638
|
-
-webkit-mask-image: radial-gradient(circle at bottom calc(100% - calc(var(--np-dot-size) / 2)) left calc(100% - calc(var(--np-dot-size) / 2)), transparent 0, transparent calc(var(--np-dot-size) / 2 + var(--np-dot-offset)), black
|
|
26639
|
-
mask-image: radial-gradient(circle at bottom calc(100% - calc(var(--np-dot-size) / 2)) left calc(100% - calc(var(--np-dot-size) / 2)), transparent 0, transparent calc(var(--np-dot-size) / 2 + var(--np-dot-offset)), black
|
|
26650
|
+
-webkit-mask-image: radial-gradient(circle at bottom calc(100% - (var(--np-dot-size) / 2)) left calc(100% - (var(--np-dot-size) / 2)), transparent 0, transparent calc(var(--np-dot-size) / 2 + var(--np-dot-offset)), black 0);
|
|
26651
|
+
mask-image: radial-gradient(circle at bottom calc(100% - (var(--np-dot-size) / 2)) left calc(100% - (var(--np-dot-size) / 2)), transparent 0, transparent calc(var(--np-dot-size) / 2 + var(--np-dot-offset)), black 0);
|
|
26652
|
+
-webkit-mask-image: radial-gradient(circle at bottom calc(100% - calc(var(--np-dot-size) / 2)) left calc(100% - calc(var(--np-dot-size) / 2)), transparent 0, transparent calc(var(--np-dot-size) / 2 + var(--np-dot-offset)), black 0);
|
|
26653
|
+
mask-image: radial-gradient(circle at bottom calc(100% - calc(var(--np-dot-size) / 2)) left calc(100% - calc(var(--np-dot-size) / 2)), transparent 0, transparent calc(var(--np-dot-size) / 2 + var(--np-dot-offset)), black 0);
|
|
26640
26654
|
}
|
|
26641
26655
|
|
|
26642
26656
|
.np-dot-badge {
|
|
@@ -8,7 +8,17 @@
|
|
|
8
8
|
|
|
9
9
|
/* DEPRECATED: use .np-text-*-title instead */
|
|
10
10
|
/* stylelint-disable-next-line selector-list-comma-newline-after */
|
|
11
|
-
.h1,
|
|
11
|
+
.h1,
|
|
12
|
+
.h2,
|
|
13
|
+
.h3,
|
|
14
|
+
.h4,
|
|
15
|
+
.h5,
|
|
16
|
+
.h6,
|
|
17
|
+
.title-1,
|
|
18
|
+
.title-2,
|
|
19
|
+
.title-3,
|
|
20
|
+
.title-4,
|
|
21
|
+
.title-5,
|
|
12
22
|
h1,
|
|
13
23
|
h2,
|
|
14
24
|
h3,
|
|
@@ -114,8 +124,12 @@ h6,
|
|
|
114
124
|
|
|
115
125
|
/* DEPRECATED: use .np-text-body-default instead */
|
|
116
126
|
/* stylelint-disable-next-line selector-list-comma-newline-after */
|
|
117
|
-
.body-2,
|
|
118
|
-
body,
|
|
127
|
+
.body-2,
|
|
128
|
+
.body-3,
|
|
129
|
+
.small,
|
|
130
|
+
.tiny,
|
|
131
|
+
body,
|
|
132
|
+
small,
|
|
119
133
|
.np-text-body-default {
|
|
120
134
|
font-size: var(--font-size-14);
|
|
121
135
|
line-height: 155%;
|
|
@@ -139,7 +153,8 @@ body, small,
|
|
|
139
153
|
|
|
140
154
|
/* DEPRECATED: use .np-text-body-large instead */
|
|
141
155
|
/* stylelint-disable-next-line selector-list-comma-newline-after */
|
|
142
|
-
.body-1,
|
|
156
|
+
.body-1,
|
|
157
|
+
.value,
|
|
143
158
|
.np-text-body-large {
|
|
144
159
|
font-weight: var(--font-weight-regular);
|
|
145
160
|
font-size: var(--font-size-16);
|
|
@@ -204,8 +219,11 @@ a,
|
|
|
204
219
|
.np-text-display-large,
|
|
205
220
|
.np-text-display-medium,
|
|
206
221
|
.np-text-display-small {
|
|
207
|
-
|
|
208
|
-
|
|
222
|
+
&,
|
|
223
|
+
&--forced {
|
|
224
|
+
font-family: var(--font-family-display);
|
|
225
|
+
font-synthesis: none;
|
|
226
|
+
}
|
|
209
227
|
|
|
210
228
|
:lang(ja) &,
|
|
211
229
|
:lang(th) &,
|
|
@@ -216,8 +234,12 @@ a,
|
|
|
216
234
|
* of Japanese ones for the logged out ones (exposed by the Editorial DS). Unfortunately,
|
|
217
235
|
* font files are browser-cached and we carried over to launchpad, where it causes issues
|
|
218
236
|
* for unsupported locales, especially those that share glyphs, like Japanese and Chinese.
|
|
237
|
+
* There are exceptions for small UI parts where Wise Sans is fine or expected — e.g. the
|
|
238
|
+
* numeric input of ExpressiveMoneyInput.
|
|
239
|
+
* Add `--forced` BEM modifier to the original class name to guarantee it.
|
|
219
240
|
*/
|
|
220
241
|
font-family: var(--font-family-regular);
|
|
242
|
+
line-height: var(--line-height-title);
|
|
221
243
|
}
|
|
222
244
|
}
|
|
223
245
|
|
|
@@ -3238,7 +3238,16 @@ a,
|
|
|
3238
3238
|
.np-text-display-extra-large,
|
|
3239
3239
|
.np-text-display-large,
|
|
3240
3240
|
.np-text-display-medium,
|
|
3241
|
-
.np-text-display-small
|
|
3241
|
+
.np-text-display-small,
|
|
3242
|
+
.display-1--forced,
|
|
3243
|
+
.display-2--forced,
|
|
3244
|
+
.display-3--forced,
|
|
3245
|
+
.display-4--forced,
|
|
3246
|
+
.display-5--forced,
|
|
3247
|
+
.np-text-display-extra-large--forced,
|
|
3248
|
+
.np-text-display-large--forced,
|
|
3249
|
+
.np-text-display-medium--forced,
|
|
3250
|
+
.np-text-display-small--forced {
|
|
3242
3251
|
font-family: 'Wise Sans', 'Inter', sans-serif;
|
|
3243
3252
|
font-family: var(--font-family-display);
|
|
3244
3253
|
font-synthesis: none;
|
|
@@ -3285,9 +3294,14 @@ a,
|
|
|
3285
3294
|
* of Japanese ones for the logged out ones (exposed by the Editorial DS). Unfortunately,
|
|
3286
3295
|
* font files are browser-cached and we carried over to launchpad, where it causes issues
|
|
3287
3296
|
* for unsupported locales, especially those that share glyphs, like Japanese and Chinese.
|
|
3297
|
+
* There are exceptions for small UI parts where Wise Sans is fine or expected — e.g. the
|
|
3298
|
+
* numeric input of ExpressiveMoneyInput.
|
|
3299
|
+
* Add `--forced` BEM modifier to the original class name to guarantee it.
|
|
3288
3300
|
*/
|
|
3289
3301
|
font-family: 'Inter', Helvetica, Arial, sans-serif;
|
|
3290
3302
|
font-family: var(--font-family-regular);
|
|
3303
|
+
line-height: 1.2;
|
|
3304
|
+
line-height: var(--line-height-title);
|
|
3291
3305
|
}
|
|
3292
3306
|
|
|
3293
3307
|
/* DEPRECATED(.np-text-display-extra-large): use .np-text-display-large instead */
|