@transferwise/components 0.0.0-experimental-9f03da2 → 0.0.0-experimental-8b2286f
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 +21 -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/expressiveMoneyInput/ExpressiveMoneyInput.css +2 -0
- package/build/styles/expressiveMoneyInput/amountInput/AmountInput.css +2 -0
- package/build/styles/main.css +21 -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.css +2 -0
- package/src/expressiveMoneyInput/ExpressiveMoneyInput.test.story.tsx +43 -0
- package/src/expressiveMoneyInput/amountInput/AmountInput.css +2 -0
- package/src/expressiveMoneyInput/amountInput/AmountInput.less +2 -0
- package/src/expressiveMoneyInput/amountInput/AmountInput.tsx +1 -1
- package/src/main.css +21 -5
- package/src/styles/less/core/_typography.less +28 -6
- package/src/styles/less/neptune.css +15 -1
package/src/avatarView/Dot.less
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
&-mask {
|
|
7
7
|
mask-image: radial-gradient(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
circle at bottom calc(100% - calc(var(--np-dot-size) / 2))
|
|
9
|
+
left calc(100% - calc(var(--np-dot-size) / 2)),
|
|
10
|
+
transparent 0,
|
|
11
|
+
transparent calc(var(--np-dot-size) / 2 + var(--np-dot-offset)),
|
|
12
|
+
black 0
|
|
13
13
|
);
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
height: var(--np-dot-size);
|
|
20
20
|
border-radius: var(--radius-full);
|
|
21
21
|
right: 0;
|
|
22
|
-
|
|
22
|
+
|
|
23
23
|
&-notification {
|
|
24
24
|
background-color: var(--color-sentiment-negative);
|
|
25
25
|
}
|
package/src/avatarView/Dot.tsx
CHANGED
|
@@ -18,8 +18,6 @@ const MAP_STYLE_CONFIG = {
|
|
|
18
18
|
48: { size: 14, offset: 2 },
|
|
19
19
|
56: { size: 16, offset: 3 },
|
|
20
20
|
72: { size: 20, offset: 3 },
|
|
21
|
-
88: { size: 24, offset: 4 },
|
|
22
|
-
96: { size: 24, offset: 4 },
|
|
23
21
|
};
|
|
24
22
|
|
|
25
23
|
export default function Dot({ children, avatarSize = 48, variant = 'notification' }: DotProps) {
|
|
@@ -3,7 +3,7 @@ import { clsx } from 'clsx';
|
|
|
3
3
|
import { useMedia } from '../hooks/useMedia';
|
|
4
4
|
import { Breakpoint } from '../propsValues/breakpoint';
|
|
5
5
|
|
|
6
|
-
export type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 72
|
|
6
|
+
export type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 72;
|
|
7
7
|
|
|
8
8
|
export type Props = {
|
|
9
9
|
/**
|
|
@@ -33,8 +33,6 @@ const MAP_ICON_SIZE = {
|
|
|
33
33
|
48: 24,
|
|
34
34
|
56: 28,
|
|
35
35
|
72: 36,
|
|
36
|
-
88: 44,
|
|
37
|
-
96: 48,
|
|
38
36
|
};
|
|
39
37
|
|
|
40
38
|
/**
|
|
@@ -50,8 +48,6 @@ const MAP_FONT_SIZE = {
|
|
|
50
48
|
48: 22,
|
|
51
49
|
56: 26,
|
|
52
50
|
72: 30,
|
|
53
|
-
88: 36,
|
|
54
|
-
96: 40,
|
|
55
51
|
};
|
|
56
52
|
|
|
57
53
|
const Circle = forwardRef(function Circle(
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
flex-grow: 1;
|
|
22
22
|
text-align: right;
|
|
23
23
|
background-color: transparent;
|
|
24
|
+
line-height: inherit;
|
|
24
25
|
}
|
|
25
26
|
.wds-amount-input-input:focus-visible {
|
|
26
27
|
outline: none;
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
flex-grow: 0;
|
|
30
31
|
display: flex;
|
|
31
32
|
align-items: center;
|
|
33
|
+
line-height: inherit;
|
|
32
34
|
}
|
|
33
35
|
.wds-currency-selector:disabled {
|
|
34
36
|
opacity: 1 !important;
|
|
@@ -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
|
+
);
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
flex-grow: 1;
|
|
22
22
|
text-align: right;
|
|
23
23
|
background-color: transparent;
|
|
24
|
+
line-height: inherit;
|
|
24
25
|
}
|
|
25
26
|
.wds-amount-input-input:focus-visible {
|
|
26
27
|
outline: none;
|
|
@@ -29,4 +30,5 @@
|
|
|
29
30
|
flex-grow: 0;
|
|
30
31
|
display: flex;
|
|
31
32
|
align-items: center;
|
|
33
|
+
line-height: inherit;
|
|
32
34
|
}
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
flex-grow: 1;
|
|
30
30
|
text-align: right;
|
|
31
31
|
background-color: transparent;
|
|
32
|
+
line-height: inherit;
|
|
32
33
|
|
|
33
34
|
&:focus-visible {
|
|
34
35
|
outline: none;
|
|
@@ -39,5 +40,6 @@
|
|
|
39
40
|
flex-grow: 0;
|
|
40
41
|
display: flex;
|
|
41
42
|
align-items: center;
|
|
43
|
+
line-height: inherit;
|
|
42
44
|
}
|
|
43
45
|
}
|
|
@@ -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 {
|
|
@@ -31052,6 +31066,7 @@ button.np-link {
|
|
|
31052
31066
|
flex-grow: 1;
|
|
31053
31067
|
text-align: right;
|
|
31054
31068
|
background-color: transparent;
|
|
31069
|
+
line-height: inherit;
|
|
31055
31070
|
}
|
|
31056
31071
|
|
|
31057
31072
|
.wds-amount-input-input:focus-visible {
|
|
@@ -31062,6 +31077,7 @@ button.np-link {
|
|
|
31062
31077
|
flex-grow: 0;
|
|
31063
31078
|
display: flex;
|
|
31064
31079
|
align-items: center;
|
|
31080
|
+
line-height: inherit;
|
|
31065
31081
|
}
|
|
31066
31082
|
|
|
31067
31083
|
.wds-currency-selector:disabled {
|
|
@@ -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 */
|