@transferwise/components 46.160.6 → 46.160.8
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/Prompt/InfoPrompt/InfoPrompt.js +13 -6
- package/build/Prompt/InfoPrompt/InfoPrompt.js.map +1 -1
- package/build/Prompt/InfoPrompt/InfoPrompt.mjs +13 -6
- package/build/Prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
- package/build/Prompt/PrimitivePrompt/PrimitivePrompt.js +1 -0
- package/build/Prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -1
- package/build/Prompt/PrimitivePrompt/PrimitivePrompt.mjs +1 -0
- package/build/Prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -1
- package/build/main.css +859 -19
- package/build/styles/Inputs/Input/Input.css +88 -0
- package/build/styles/Inputs/TextArea/TextArea.css +88 -0
- package/build/styles/Popover/Popover.css +1 -0
- package/build/styles/Prompt/PrimitivePrompt/PrimitivePrompt.css +17 -0
- package/build/styles/_deprecated/Select/Select.css +29 -0
- package/build/styles/css/accordion.css +30 -0
- package/build/styles/css/button-groups.css +29 -0
- package/build/styles/css/buttons.css +29 -0
- package/build/styles/css/decision.css +30 -0
- package/build/styles/css/dropdowns.css +59 -0
- package/build/styles/css/droppable.css +29 -0
- package/build/styles/css/footer.css +63 -0
- package/build/styles/css/input-groups.css +189 -0
- package/build/styles/css/list-group.css +1 -0
- package/build/styles/css/navbar.css +59 -0
- package/build/styles/css/neptune-addons.css +3 -0
- package/build/styles/css/neptune-core.css +185 -0
- package/build/styles/css/neptune.css +705 -0
- package/build/styles/css/popovers.css +59 -0
- package/build/styles/css/tooltip.css +29 -0
- package/build/styles/main.css +859 -19
- package/build/styles/styles/less/accordion.css +30 -0
- package/build/styles/styles/less/button-groups.css +29 -0
- package/build/styles/styles/less/buttons.css +29 -0
- package/build/styles/styles/less/decision.css +30 -0
- package/build/styles/styles/less/dropdowns.css +59 -0
- package/build/styles/styles/less/droppable.css +29 -0
- package/build/styles/styles/less/footer.css +63 -0
- package/build/styles/styles/less/forms/bootstrap-forms.css +116 -0
- package/build/styles/styles/less/input-groups.css +189 -0
- package/build/styles/styles/less/list-group.css +1 -0
- package/build/styles/styles/less/navbar.css +59 -0
- package/build/styles/styles/less/neptune-addons.css +3 -0
- package/build/styles/styles/less/neptune-core.css +185 -0
- package/build/styles/styles/less/neptune.css +705 -0
- package/build/styles/styles/less/popovers.css +59 -0
- package/build/styles/styles/less/tooltip.css +29 -0
- package/build/types/Prompt/InfoPrompt/InfoPrompt.d.ts.map +1 -1
- package/build/types/Prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/Body/_stories/Body.test.story.tsx +81 -0
- package/src/Inputs/Input/Input.css +88 -0
- package/src/Inputs/TextArea/TextArea.css +88 -0
- package/src/Popover/Popover.css +1 -0
- package/src/Prompt/InfoPrompt/InfoPrompt.test.tsx +56 -2
- package/src/Prompt/InfoPrompt/InfoPrompt.tsx +14 -7
- package/src/Prompt/InfoPrompt/_stories/InfoPrompt.story.tsx +6 -1
- package/src/Prompt/PrimitivePrompt/PrimitivePrompt.css +17 -0
- package/src/Prompt/PrimitivePrompt/PrimitivePrompt.less +15 -0
- package/src/Prompt/PrimitivePrompt/PrimitivePrompt.tsx +1 -0
- package/src/_deprecated/Card/_stories/Card.test.story.tsx +1 -1
- package/src/_deprecated/CriticalBanner/_stories/CriticalCommsBanner.test.story.tsx +1 -1
- package/src/_deprecated/InlineAlert/_stories/InlineAlert.test.story.tsx +1 -1
- package/src/_deprecated/OverlayHeader/_stories/OverlayHeader.test.story.tsx +1 -1
- package/src/_deprecated/Select/Select.css +29 -0
- package/src/_deprecated/Select/_stories/Select.rtl.test.story.tsx +1 -1
- package/src/_deprecated/Select/_stories/Select.test.story.tsx +1 -1
- package/src/main.css +859 -19
- package/src/styles/less/accordion.css +30 -0
- package/src/styles/less/addons/_spacing-utilities.less +2 -0
- package/src/styles/less/button-groups.css +29 -0
- package/src/styles/less/buttons.css +29 -0
- package/src/styles/less/core/_typography.less +12 -0
- package/src/styles/less/decision.css +30 -0
- package/src/styles/less/dropdowns.css +59 -0
- package/src/styles/less/droppable.css +29 -0
- package/src/styles/less/footer.css +63 -0
- package/src/styles/less/forms/bootstrap-forms.css +116 -0
- package/src/styles/less/input-groups.css +189 -0
- package/src/styles/less/list-group.css +1 -0
- package/src/styles/less/navbar.css +59 -0
- package/src/styles/less/neptune-addons.css +3 -0
- package/src/styles/less/neptune-core.css +185 -0
- package/src/styles/less/neptune.css +705 -0
- package/src/styles/less/popovers.css +59 -0
- package/src/styles/less/tooltip.css +29 -0
|
@@ -72,6 +72,7 @@ button.close {
|
|
|
72
72
|
letter-spacing: -0.006em;
|
|
73
73
|
font-weight: 400;
|
|
74
74
|
font-weight: var(--font-weight-regular);
|
|
75
|
+
word-wrap: break-word;
|
|
75
76
|
background-color: #ffffff;
|
|
76
77
|
background-color: var(--color-background-screen);
|
|
77
78
|
background-clip: padding-box;
|
|
@@ -79,6 +80,34 @@ button.close {
|
|
|
79
80
|
box-shadow: 0 20px 66px 0 rgba(34, 48, 73, 0.2);
|
|
80
81
|
position: absolute;
|
|
81
82
|
}
|
|
83
|
+
@supports (hyphenate-limit-chars: 1) {
|
|
84
|
+
.popover {
|
|
85
|
+
hyphens: auto;
|
|
86
|
+
hyphenate-limit-chars: 7 3;
|
|
87
|
+
}
|
|
88
|
+
@media (min-width: 840px) {
|
|
89
|
+
.popover {
|
|
90
|
+
hyphenate-limit-chars: 8 3;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
@media (min-width: 1160px) {
|
|
94
|
+
.popover {
|
|
95
|
+
hyphenate-limit-chars: 10 4 3;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
@supports (not (hyphenate-limit-chars: 1)) and (-webkit-hyphenate-limit-before: 1) {
|
|
100
|
+
.popover {
|
|
101
|
+
hyphens: auto;
|
|
102
|
+
-webkit-hyphenate-limit-before: 3;
|
|
103
|
+
-webkit-hyphenate-limit-after: 3;
|
|
104
|
+
}
|
|
105
|
+
@media (min-width: 1160px) {
|
|
106
|
+
.popover {
|
|
107
|
+
-webkit-hyphenate-limit-before: 4;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
82
111
|
.np-theme-personal--forest-green .popover,
|
|
83
112
|
.np-theme-personal--bright-green .popover,
|
|
84
113
|
.np-theme-personal--dark .popover {
|
|
@@ -236,6 +265,7 @@ button.close {
|
|
|
236
265
|
line-height: 1.2;
|
|
237
266
|
line-height: var(--line-height-title);
|
|
238
267
|
letter-spacing: 0;
|
|
268
|
+
word-wrap: break-word;
|
|
239
269
|
font-size: 1.125rem;
|
|
240
270
|
font-size: var(--font-size-18);
|
|
241
271
|
font-weight: 600;
|
|
@@ -293,9 +323,38 @@ button.close {
|
|
|
293
323
|
letter-spacing: -0.006em;
|
|
294
324
|
font-weight: 400;
|
|
295
325
|
font-weight: var(--font-weight-regular);
|
|
326
|
+
word-wrap: break-word;
|
|
296
327
|
color: #5d7079;
|
|
297
328
|
color: var(--color-content-secondary);
|
|
298
329
|
}
|
|
330
|
+
@supports (hyphenate-limit-chars: 1) {
|
|
331
|
+
.popover-content {
|
|
332
|
+
hyphens: auto;
|
|
333
|
+
hyphenate-limit-chars: 7 3;
|
|
334
|
+
}
|
|
335
|
+
@media (min-width: 840px) {
|
|
336
|
+
.popover-content {
|
|
337
|
+
hyphenate-limit-chars: 8 3;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
@media (min-width: 1160px) {
|
|
341
|
+
.popover-content {
|
|
342
|
+
hyphenate-limit-chars: 10 4 3;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
@supports (not (hyphenate-limit-chars: 1)) and (-webkit-hyphenate-limit-before: 1) {
|
|
347
|
+
.popover-content {
|
|
348
|
+
hyphens: auto;
|
|
349
|
+
-webkit-hyphenate-limit-before: 3;
|
|
350
|
+
-webkit-hyphenate-limit-after: 3;
|
|
351
|
+
}
|
|
352
|
+
@media (min-width: 1160px) {
|
|
353
|
+
.popover-content {
|
|
354
|
+
-webkit-hyphenate-limit-before: 4;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
299
358
|
.popover-content > :last-child {
|
|
300
359
|
margin-block-end: 0;
|
|
301
360
|
}
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
letter-spacing: -0.006em;
|
|
52
52
|
font-weight: 400;
|
|
53
53
|
font-weight: var(--font-weight-regular);
|
|
54
|
+
word-wrap: break-word;
|
|
54
55
|
max-inline-size: 200px;
|
|
55
56
|
min-inline-size: 120px;
|
|
56
57
|
padding-block: 16px;
|
|
@@ -65,6 +66,34 @@
|
|
|
65
66
|
border-radius: 3px;
|
|
66
67
|
box-shadow: 0 1px 28px 0 rgba(34, 48, 73, 0.2);
|
|
67
68
|
}
|
|
69
|
+
@supports (hyphenate-limit-chars: 1) {
|
|
70
|
+
.tooltip-inner {
|
|
71
|
+
hyphens: auto;
|
|
72
|
+
hyphenate-limit-chars: 7 3;
|
|
73
|
+
}
|
|
74
|
+
@media (min-width: 840px) {
|
|
75
|
+
.tooltip-inner {
|
|
76
|
+
hyphenate-limit-chars: 8 3;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
@media (min-width: 1160px) {
|
|
80
|
+
.tooltip-inner {
|
|
81
|
+
hyphenate-limit-chars: 10 4 3;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
@supports (not (hyphenate-limit-chars: 1)) and (-webkit-hyphenate-limit-before: 1) {
|
|
86
|
+
.tooltip-inner {
|
|
87
|
+
hyphens: auto;
|
|
88
|
+
-webkit-hyphenate-limit-before: 3;
|
|
89
|
+
-webkit-hyphenate-limit-after: 3;
|
|
90
|
+
}
|
|
91
|
+
@media (min-width: 1160px) {
|
|
92
|
+
.tooltip-inner {
|
|
93
|
+
-webkit-hyphenate-limit-before: 4;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
68
97
|
.np-theme-personal--forest-green .tooltip-inner,
|
|
69
98
|
.np-theme-personal--bright-green .tooltip-inner,
|
|
70
99
|
.np-theme-personal--dark .tooltip-inner {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoPrompt.d.ts","sourceRoot":"","sources":["../../../../src/Prompt/InfoPrompt/InfoPrompt.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,cAAc,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"InfoPrompt.d.ts","sourceRoot":"","sources":["../../../../src/Prompt/InfoPrompt/InfoPrompt.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,cAAc,EAAE,SAAS,EAAwC,MAAM,OAAO,CAAC;AAElG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,KAAK,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI5E,OAAa,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAmB,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE3E,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC,GAAG;IAC9E;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B;;;OAGG;IACH,KAAK,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,MAAM,CAAC,GAChG,IAAI,CAAC,oBAAoB,EAAE,aAAa,CAAC,GAAG;IAC1C;;;OAGG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;OAGG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,EAAE,SAAS,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC;CACxB,CAAC;AAEJ;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,GAAI,wIAWxB,eAAe,gCAkGjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimitivePrompt.d.ts","sourceRoot":"","sources":["../../../../src/Prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"names":[],"mappings":"AAEA,OAAyB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAI/E,OAAO,EAAc,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAClE;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;gHAEgH;AAChH,eAAO,MAAM,eAAe;IA/B1B;;;OAGG;gBACS,SAAS;IACrB;;;OAGG;eACQ,QAAQ;IACnB;;OAEG;WACI,SAAS;IAChB;;OAEG;cACO,SAAS;IACnB;;OAEG;gBACS,MAAM,IAAI;IACtB;;OAEG;oBACa,MAAM;
|
|
1
|
+
{"version":3,"file":"PrimitivePrompt.d.ts","sourceRoot":"","sources":["../../../../src/Prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"names":[],"mappings":"AAEA,OAAyB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAI/E,OAAO,EAAc,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAClE;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;gHAEgH;AAChH,eAAO,MAAM,eAAe;IA/B1B;;;OAGG;gBACS,SAAS;IACrB;;;OAGG;eACQ,QAAQ;IACnB;;OAEG;WACI,SAAS;IAChB;;OAEG;cACO,SAAS;IACnB;;OAEG;gBACS,MAAM,IAAI;IACtB;;OAEG;oBACa,MAAM;kDAsDvB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "46.160.
|
|
3
|
+
"version": "46.160.8",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -92,8 +92,8 @@
|
|
|
92
92
|
"storybook-addon-tag-badges": "^3.1.0",
|
|
93
93
|
"storybook-addon-test-codegen": "^3.0.4",
|
|
94
94
|
"@transferwise/less-config": "3.2.0",
|
|
95
|
-
"@wise/
|
|
96
|
-
"@wise/
|
|
95
|
+
"@wise/wds-configs": "0.0.0",
|
|
96
|
+
"@wise/components-theming": "1.10.3"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
99
|
"@transferwise/icons": "^3 || ^4",
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
|
|
3
|
+
import Body from '../Body';
|
|
4
|
+
import Container from '../../Container';
|
|
5
|
+
import Title from '../../Title';
|
|
6
|
+
import { Typography } from '../../common/PropsValues/typography';
|
|
7
|
+
import { withVariantConfig } from '../../../.storybook/helpers';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: 'Typography/Body/Tests',
|
|
11
|
+
component: Body,
|
|
12
|
+
tags: ['!autodocs', '!manifest'],
|
|
13
|
+
} satisfies Meta<typeof Body>;
|
|
14
|
+
|
|
15
|
+
type Story = StoryObj<typeof Body>;
|
|
16
|
+
|
|
17
|
+
const HyphenationTest = {
|
|
18
|
+
render: () => (
|
|
19
|
+
<Container size="compact">
|
|
20
|
+
<Title type={Typography.TITLE_SUBSECTION}>German (de)</Title>
|
|
21
|
+
<div lang="de">
|
|
22
|
+
<Body as="p" type={Typography.BODY_DEFAULT}>
|
|
23
|
+
Donaudampfschifffahrtsgesellschaftskapitän Überweisungsgebühren
|
|
24
|
+
Rechtsschutzversicherungsgesellschaften Kraftfahrzeughaftpflichtversicherung
|
|
25
|
+
Geschwindigkeitsbeschränkung Aufmerksamkeitsdefizithyperaktivitätsstörung
|
|
26
|
+
Bundesausbildungsförderungsgesetz
|
|
27
|
+
Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz
|
|
28
|
+
</Body>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<Title type={Typography.TITLE_SUBSECTION}>Dutch (nl)</Title>
|
|
32
|
+
<div lang="nl">
|
|
33
|
+
<Body as="p" type={Typography.BODY_DEFAULT}>
|
|
34
|
+
Verzekeringsmaatschappij arbeidsongeschiktheidsverzekering
|
|
35
|
+
kindercarnavalsoptochtvoorbereidingswerkzaamheden aansprakelijkheidsverzekering
|
|
36
|
+
gemeenteraadsverkiezingen rijkswaterstaatwerkzaamheden ovaboratoriumonderzoeksresultaten
|
|
37
|
+
</Body>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<Title type={Typography.TITLE_SUBSECTION}>Ukrainian (uk)</Title>
|
|
41
|
+
<div lang="uk">
|
|
42
|
+
<Body as="p" type={Typography.BODY_DEFAULT}>
|
|
43
|
+
Найбільш міжнародний рахунок відповідальність працевлаштування перевантажувальний Найбільш
|
|
44
|
+
міжнародний рахунок відповідальність працевлаштування перевантажувальний Найбільш
|
|
45
|
+
міжнародний рахунок відповідальність працевлаштування перевантажувальний.
|
|
46
|
+
</Body>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<Title type={Typography.TITLE_SUBSECTION}>Japanese (ja) — no hyphens</Title>
|
|
50
|
+
<div lang="ja">
|
|
51
|
+
<Body as="p" type={Typography.BODY_DEFAULT}>
|
|
52
|
+
私たちは世界で最も国際的なアカウントを構築しています。送金手数料についてもっと知りたい方はこちらをご覧ください。
|
|
53
|
+
</Body>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<Title type={Typography.TITLE_SUBSECTION}>Chinese Simplified (zh-CN) — no hyphens</Title>
|
|
57
|
+
<div lang="zh-CN">
|
|
58
|
+
<Body as="p" type={Typography.BODY_DEFAULT}>
|
|
59
|
+
我们正在建设世界上最国际化的账户。如果您想了解更多关于汇款费用的信息请查看这里。
|
|
60
|
+
</Body>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<Title type={Typography.TITLE_SUBSECTION}>Thai (th) — no hyphens</Title>
|
|
64
|
+
<div lang="th">
|
|
65
|
+
<Body as="p" type={Typography.BODY_DEFAULT}>
|
|
66
|
+
เรากำลังสร้างบัญชีที่เป็นสากลที่สุดในโลก
|
|
67
|
+
หากคุณต้องการทราบข้อมูลเพิ่มเติมเกี่ยวกับค่าธรรมเนียมการโอนเงิน
|
|
68
|
+
</Body>
|
|
69
|
+
</div>
|
|
70
|
+
</Container>
|
|
71
|
+
),
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export const Hyphenation: Story = {
|
|
75
|
+
...HyphenationTest,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const HyphenationMobile: Story = {
|
|
79
|
+
...HyphenationTest,
|
|
80
|
+
...withVariantConfig(['mobile'], HyphenationTest),
|
|
81
|
+
};
|
|
@@ -45,11 +45,40 @@
|
|
|
45
45
|
font-size: var(--font-size-16);
|
|
46
46
|
line-height: 150%;
|
|
47
47
|
letter-spacing: -0.011em;
|
|
48
|
+
word-wrap: break-word;
|
|
48
49
|
padding-block-start: 12px;
|
|
49
50
|
padding-block-start: var(--size-12);
|
|
50
51
|
padding-block-end: 12px;
|
|
51
52
|
padding-block-end: var(--size-12);
|
|
52
53
|
}
|
|
54
|
+
@supports (hyphenate-limit-chars: 1) {
|
|
55
|
+
.np-form-control--size-auto {
|
|
56
|
+
hyphens: auto;
|
|
57
|
+
hyphenate-limit-chars: 7 3;
|
|
58
|
+
}
|
|
59
|
+
@media (min-width: 840px) {
|
|
60
|
+
.np-form-control--size-auto {
|
|
61
|
+
hyphenate-limit-chars: 8 3;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
@media (min-width: 1160px) {
|
|
65
|
+
.np-form-control--size-auto {
|
|
66
|
+
hyphenate-limit-chars: 10 4 3;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
@supports (not (hyphenate-limit-chars: 1)) and (-webkit-hyphenate-limit-before: 1) {
|
|
71
|
+
.np-form-control--size-auto {
|
|
72
|
+
hyphens: auto;
|
|
73
|
+
-webkit-hyphenate-limit-before: 3;
|
|
74
|
+
-webkit-hyphenate-limit-after: 3;
|
|
75
|
+
}
|
|
76
|
+
@media (min-width: 1160px) {
|
|
77
|
+
.np-form-control--size-auto {
|
|
78
|
+
-webkit-hyphenate-limit-before: 4;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
53
82
|
.np-form-control--size-sm,
|
|
54
83
|
.np-form-control--size-md,
|
|
55
84
|
.np-form-control--size-lg {
|
|
@@ -63,9 +92,38 @@
|
|
|
63
92
|
letter-spacing: -0.006em;
|
|
64
93
|
font-weight: 400;
|
|
65
94
|
font-weight: var(--font-weight-regular);
|
|
95
|
+
word-wrap: break-word;
|
|
66
96
|
block-size: 32px !important;
|
|
67
97
|
block-size: var(--size-32) !important;
|
|
68
98
|
}
|
|
99
|
+
@supports (hyphenate-limit-chars: 1) {
|
|
100
|
+
.np-form-control--size-sm {
|
|
101
|
+
hyphens: auto;
|
|
102
|
+
hyphenate-limit-chars: 7 3;
|
|
103
|
+
}
|
|
104
|
+
@media (min-width: 840px) {
|
|
105
|
+
.np-form-control--size-sm {
|
|
106
|
+
hyphenate-limit-chars: 8 3;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
@media (min-width: 1160px) {
|
|
110
|
+
.np-form-control--size-sm {
|
|
111
|
+
hyphenate-limit-chars: 10 4 3;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
@supports (not (hyphenate-limit-chars: 1)) and (-webkit-hyphenate-limit-before: 1) {
|
|
116
|
+
.np-form-control--size-sm {
|
|
117
|
+
hyphens: auto;
|
|
118
|
+
-webkit-hyphenate-limit-before: 3;
|
|
119
|
+
-webkit-hyphenate-limit-after: 3;
|
|
120
|
+
}
|
|
121
|
+
@media (min-width: 1160px) {
|
|
122
|
+
.np-form-control--size-sm {
|
|
123
|
+
-webkit-hyphenate-limit-before: 4;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
69
127
|
@media (max-width: 320px) {
|
|
70
128
|
.np-form-control--size-sm {
|
|
71
129
|
block-size: 64px !important;
|
|
@@ -79,9 +137,38 @@
|
|
|
79
137
|
font-size: var(--font-size-16);
|
|
80
138
|
line-height: 150%;
|
|
81
139
|
letter-spacing: -0.011em;
|
|
140
|
+
word-wrap: break-word;
|
|
82
141
|
block-size: 48px !important;
|
|
83
142
|
block-size: var(--size-48) !important;
|
|
84
143
|
}
|
|
144
|
+
@supports (hyphenate-limit-chars: 1) {
|
|
145
|
+
.np-form-control--size-md {
|
|
146
|
+
hyphens: auto;
|
|
147
|
+
hyphenate-limit-chars: 7 3;
|
|
148
|
+
}
|
|
149
|
+
@media (min-width: 840px) {
|
|
150
|
+
.np-form-control--size-md {
|
|
151
|
+
hyphenate-limit-chars: 8 3;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
@media (min-width: 1160px) {
|
|
155
|
+
.np-form-control--size-md {
|
|
156
|
+
hyphenate-limit-chars: 10 4 3;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
@supports (not (hyphenate-limit-chars: 1)) and (-webkit-hyphenate-limit-before: 1) {
|
|
161
|
+
.np-form-control--size-md {
|
|
162
|
+
hyphens: auto;
|
|
163
|
+
-webkit-hyphenate-limit-before: 3;
|
|
164
|
+
-webkit-hyphenate-limit-after: 3;
|
|
165
|
+
}
|
|
166
|
+
@media (min-width: 1160px) {
|
|
167
|
+
.np-form-control--size-md {
|
|
168
|
+
-webkit-hyphenate-limit-before: 4;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
85
172
|
@media (max-width: 320px) {
|
|
86
173
|
.np-form-control--size-md {
|
|
87
174
|
block-size: 72px !important;
|
|
@@ -95,6 +182,7 @@
|
|
|
95
182
|
line-height: 1.2;
|
|
96
183
|
line-height: var(--line-height-title);
|
|
97
184
|
letter-spacing: 0;
|
|
185
|
+
word-wrap: break-word;
|
|
98
186
|
margin-block-end: initial;
|
|
99
187
|
font-size: 1.375rem;
|
|
100
188
|
font-size: var(--font-size-22);
|
|
@@ -45,11 +45,40 @@
|
|
|
45
45
|
font-size: var(--font-size-16);
|
|
46
46
|
line-height: 150%;
|
|
47
47
|
letter-spacing: -0.011em;
|
|
48
|
+
word-wrap: break-word;
|
|
48
49
|
padding-block-start: 12px;
|
|
49
50
|
padding-block-start: var(--size-12);
|
|
50
51
|
padding-block-end: 12px;
|
|
51
52
|
padding-block-end: var(--size-12);
|
|
52
53
|
}
|
|
54
|
+
@supports (hyphenate-limit-chars: 1) {
|
|
55
|
+
.np-form-control--size-auto {
|
|
56
|
+
hyphens: auto;
|
|
57
|
+
hyphenate-limit-chars: 7 3;
|
|
58
|
+
}
|
|
59
|
+
@media (min-width: 840px) {
|
|
60
|
+
.np-form-control--size-auto {
|
|
61
|
+
hyphenate-limit-chars: 8 3;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
@media (min-width: 1160px) {
|
|
65
|
+
.np-form-control--size-auto {
|
|
66
|
+
hyphenate-limit-chars: 10 4 3;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
@supports (not (hyphenate-limit-chars: 1)) and (-webkit-hyphenate-limit-before: 1) {
|
|
71
|
+
.np-form-control--size-auto {
|
|
72
|
+
hyphens: auto;
|
|
73
|
+
-webkit-hyphenate-limit-before: 3;
|
|
74
|
+
-webkit-hyphenate-limit-after: 3;
|
|
75
|
+
}
|
|
76
|
+
@media (min-width: 1160px) {
|
|
77
|
+
.np-form-control--size-auto {
|
|
78
|
+
-webkit-hyphenate-limit-before: 4;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
53
82
|
.np-form-control--size-sm,
|
|
54
83
|
.np-form-control--size-md,
|
|
55
84
|
.np-form-control--size-lg {
|
|
@@ -63,9 +92,38 @@
|
|
|
63
92
|
letter-spacing: -0.006em;
|
|
64
93
|
font-weight: 400;
|
|
65
94
|
font-weight: var(--font-weight-regular);
|
|
95
|
+
word-wrap: break-word;
|
|
66
96
|
block-size: 32px !important;
|
|
67
97
|
block-size: var(--size-32) !important;
|
|
68
98
|
}
|
|
99
|
+
@supports (hyphenate-limit-chars: 1) {
|
|
100
|
+
.np-form-control--size-sm {
|
|
101
|
+
hyphens: auto;
|
|
102
|
+
hyphenate-limit-chars: 7 3;
|
|
103
|
+
}
|
|
104
|
+
@media (min-width: 840px) {
|
|
105
|
+
.np-form-control--size-sm {
|
|
106
|
+
hyphenate-limit-chars: 8 3;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
@media (min-width: 1160px) {
|
|
110
|
+
.np-form-control--size-sm {
|
|
111
|
+
hyphenate-limit-chars: 10 4 3;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
@supports (not (hyphenate-limit-chars: 1)) and (-webkit-hyphenate-limit-before: 1) {
|
|
116
|
+
.np-form-control--size-sm {
|
|
117
|
+
hyphens: auto;
|
|
118
|
+
-webkit-hyphenate-limit-before: 3;
|
|
119
|
+
-webkit-hyphenate-limit-after: 3;
|
|
120
|
+
}
|
|
121
|
+
@media (min-width: 1160px) {
|
|
122
|
+
.np-form-control--size-sm {
|
|
123
|
+
-webkit-hyphenate-limit-before: 4;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
69
127
|
@media (max-width: 320px) {
|
|
70
128
|
.np-form-control--size-sm {
|
|
71
129
|
block-size: 64px !important;
|
|
@@ -79,9 +137,38 @@
|
|
|
79
137
|
font-size: var(--font-size-16);
|
|
80
138
|
line-height: 150%;
|
|
81
139
|
letter-spacing: -0.011em;
|
|
140
|
+
word-wrap: break-word;
|
|
82
141
|
block-size: 48px !important;
|
|
83
142
|
block-size: var(--size-48) !important;
|
|
84
143
|
}
|
|
144
|
+
@supports (hyphenate-limit-chars: 1) {
|
|
145
|
+
.np-form-control--size-md {
|
|
146
|
+
hyphens: auto;
|
|
147
|
+
hyphenate-limit-chars: 7 3;
|
|
148
|
+
}
|
|
149
|
+
@media (min-width: 840px) {
|
|
150
|
+
.np-form-control--size-md {
|
|
151
|
+
hyphenate-limit-chars: 8 3;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
@media (min-width: 1160px) {
|
|
155
|
+
.np-form-control--size-md {
|
|
156
|
+
hyphenate-limit-chars: 10 4 3;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
@supports (not (hyphenate-limit-chars: 1)) and (-webkit-hyphenate-limit-before: 1) {
|
|
161
|
+
.np-form-control--size-md {
|
|
162
|
+
hyphens: auto;
|
|
163
|
+
-webkit-hyphenate-limit-before: 3;
|
|
164
|
+
-webkit-hyphenate-limit-after: 3;
|
|
165
|
+
}
|
|
166
|
+
@media (min-width: 1160px) {
|
|
167
|
+
.np-form-control--size-md {
|
|
168
|
+
-webkit-hyphenate-limit-before: 4;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
85
172
|
@media (max-width: 320px) {
|
|
86
173
|
.np-form-control--size-md {
|
|
87
174
|
block-size: 72px !important;
|
|
@@ -95,6 +182,7 @@
|
|
|
95
182
|
line-height: 1.2;
|
|
96
183
|
line-height: var(--line-height-title);
|
|
97
184
|
letter-spacing: 0;
|
|
185
|
+
word-wrap: break-word;
|
|
98
186
|
margin-block-end: initial;
|
|
99
187
|
font-size: 1.375rem;
|
|
100
188
|
font-size: var(--font-size-22);
|
package/src/Popover/Popover.css
CHANGED
|
@@ -274,11 +274,12 @@ describe('InfoPrompt', () => {
|
|
|
274
274
|
expect(window.location.assign).not.toHaveBeenCalled();
|
|
275
275
|
});
|
|
276
276
|
|
|
277
|
-
it('should
|
|
277
|
+
it('should call onClick on touch tap when action has no href', () => {
|
|
278
|
+
const onClick = jest.fn();
|
|
278
279
|
render(
|
|
279
280
|
<InfoPrompt
|
|
280
281
|
{...defaultProps}
|
|
281
|
-
action={{ label: 'Click me', onClick
|
|
282
|
+
action={{ label: 'Click me', onClick }}
|
|
282
283
|
data-testid="prompt"
|
|
283
284
|
/>,
|
|
284
285
|
);
|
|
@@ -286,8 +287,61 @@ describe('InfoPrompt', () => {
|
|
|
286
287
|
|
|
287
288
|
fireEvent.touchStart(prompt);
|
|
288
289
|
fireEvent.touchEnd(prompt);
|
|
290
|
+
expect(onClick).toHaveBeenCalledTimes(1);
|
|
289
291
|
expect(window.location.assign).not.toHaveBeenCalled();
|
|
290
292
|
expect(window.open).not.toHaveBeenCalled();
|
|
291
293
|
});
|
|
294
|
+
|
|
295
|
+
it('should call onClick and navigate when action has both href and onClick', () => {
|
|
296
|
+
const onClick = jest.fn();
|
|
297
|
+
render(
|
|
298
|
+
<InfoPrompt
|
|
299
|
+
{...defaultProps}
|
|
300
|
+
action={{ label: 'Learn more', href: '/learn-more', onClick }}
|
|
301
|
+
data-testid="prompt"
|
|
302
|
+
/>,
|
|
303
|
+
);
|
|
304
|
+
const prompt = screen.getByTestId('prompt');
|
|
305
|
+
|
|
306
|
+
fireEvent.touchStart(prompt);
|
|
307
|
+
fireEvent.touchEnd(prompt);
|
|
308
|
+
expect(onClick).toHaveBeenCalledTimes(1);
|
|
309
|
+
expect(window.location.assign).toHaveBeenCalledWith('/learn-more');
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
it('should not fire action when tapping dismiss button', () => {
|
|
313
|
+
const onClick = jest.fn();
|
|
314
|
+
render(
|
|
315
|
+
<InfoPrompt
|
|
316
|
+
{...defaultProps}
|
|
317
|
+
action={{ label: 'Learn more', href: '/learn-more', onClick }}
|
|
318
|
+
data-testid="prompt"
|
|
319
|
+
onDismiss={jest.fn()}
|
|
320
|
+
/>,
|
|
321
|
+
);
|
|
322
|
+
const dismissButton = screen.getByRole('button', { name: 'Close', hidden: true });
|
|
323
|
+
|
|
324
|
+
fireEvent.touchStart(dismissButton);
|
|
325
|
+
fireEvent.touchEnd(dismissButton);
|
|
326
|
+
expect(onClick).not.toHaveBeenCalled();
|
|
327
|
+
expect(window.location.assign).not.toHaveBeenCalled();
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
it('should not double-fire onClick when tapping the action element directly', () => {
|
|
331
|
+
const onClick = jest.fn();
|
|
332
|
+
render(
|
|
333
|
+
<InfoPrompt
|
|
334
|
+
{...defaultProps}
|
|
335
|
+
action={{ label: 'Learn more', href: '/learn-more', onClick }}
|
|
336
|
+
data-testid="prompt"
|
|
337
|
+
/>,
|
|
338
|
+
);
|
|
339
|
+
const actionLink = screen.getByRole('link', { name: 'Learn more', hidden: true });
|
|
340
|
+
|
|
341
|
+
fireEvent.touchStart(actionLink);
|
|
342
|
+
fireEvent.touchEnd(actionLink);
|
|
343
|
+
expect(onClick).not.toHaveBeenCalled();
|
|
344
|
+
expect(window.location.assign).not.toHaveBeenCalled();
|
|
345
|
+
});
|
|
292
346
|
});
|
|
293
347
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Children, HTMLAttributes, ReactNode, isValidElement, useState } from 'react';
|
|
1
|
+
import { Children, HTMLAttributes, ReactNode, TouchEvent, isValidElement, useState } from 'react';
|
|
2
2
|
import { LiveRegion, Sentiment, Typography } from '../../common';
|
|
3
3
|
import type { AriaLive } from '../../common';
|
|
4
4
|
import { GiftBox } from '@transferwise/icons';
|
|
@@ -103,16 +103,23 @@ export const InfoPrompt = ({
|
|
|
103
103
|
? Sentiment.POSITIVE
|
|
104
104
|
: (sentiment as Exclude<SurfaceSentiment, 'proposition'>);
|
|
105
105
|
|
|
106
|
-
const handleTouchStart = () => {
|
|
106
|
+
const handleTouchStart = (event: TouchEvent<HTMLDivElement>) => {
|
|
107
|
+
const target = event.target as HTMLElement;
|
|
108
|
+
if (target.closest('.wds-prompt__dismiss') || target.closest('.wds-info-prompt__action')) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
107
111
|
setShouldFire(true);
|
|
108
112
|
};
|
|
109
113
|
|
|
110
114
|
const handleTouchEnd = () => {
|
|
111
|
-
if (shouldFire && action
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
if (shouldFire && action) {
|
|
116
|
+
(action.onClick as (() => void) | undefined)?.();
|
|
117
|
+
if (action.href) {
|
|
118
|
+
if (action.target === '_blank') {
|
|
119
|
+
window.top?.open(action.href, '_blank', 'noopener, noreferrer');
|
|
120
|
+
} else {
|
|
121
|
+
window.top?.location.assign(action.href);
|
|
122
|
+
}
|
|
116
123
|
}
|
|
117
124
|
}
|
|
118
125
|
setShouldFire(false);
|
|
@@ -236,7 +236,11 @@ export const WithTitle: Story = {
|
|
|
236
236
|
|
|
237
237
|
/**
|
|
238
238
|
* Use the `action` prop to add a clickable link below the message.
|
|
239
|
-
* Actions can have an `href` for navigation
|
|
239
|
+
* Actions can have an `href` for navigation, an `onClick` for custom behavior, or both.
|
|
240
|
+
*
|
|
241
|
+
* On touch devices the entire prompt surface acts as a tap target for the action,
|
|
242
|
+
* making it easier to interact with on small screens. A scroll gesture (touch move)
|
|
243
|
+
* cancels the tap. Tapping the dismiss button does not trigger the action.
|
|
240
244
|
*/
|
|
241
245
|
export const WithAction: Story = {
|
|
242
246
|
render: (args: InfoPromptProps) => (
|
|
@@ -322,6 +326,7 @@ export const Dismissible: Story = {
|
|
|
322
326
|
sentiment="success"
|
|
323
327
|
title="Payment successful"
|
|
324
328
|
description="Your payment was successful."
|
|
329
|
+
action={{ label: 'Learn more', href: '#', target: '_blank' }}
|
|
325
330
|
onDismiss={() => setShowPrompt(false)}
|
|
326
331
|
/>
|
|
327
332
|
) : (
|
|
@@ -51,3 +51,20 @@
|
|
|
51
51
|
grid-column: span 3;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
+
.wds-prompt__dismiss {
|
|
55
|
+
position: relative;
|
|
56
|
+
}
|
|
57
|
+
.wds-prompt__dismiss:before {
|
|
58
|
+
--size: calc(var(--size-24) + var(--Prompt-padding-x, var(--padding-x-small)) * 2);
|
|
59
|
+
--offset: calc(-1 * var(--Prompt-padding-x, var(--padding-x-small)));
|
|
60
|
+
content: "";
|
|
61
|
+
position: absolute;
|
|
62
|
+
inset: calc(-1 * 8px);
|
|
63
|
+
inset: var(--offset);
|
|
64
|
+
inline-size: calc(24px + 8px * 2);
|
|
65
|
+
inline-size: var(--size);
|
|
66
|
+
block-size: calc(24px + 8px * 2);
|
|
67
|
+
block-size: var(--size);
|
|
68
|
+
border-radius: 10px;
|
|
69
|
+
border-radius: var(--Prompt-border-radius, var(--radius-small));
|
|
70
|
+
}
|
|
@@ -46,4 +46,19 @@
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
+
|
|
50
|
+
&__dismiss {
|
|
51
|
+
position: relative;
|
|
52
|
+
|
|
53
|
+
&:before {
|
|
54
|
+
--size: calc(var(--size-24) + var(--Prompt-padding-x, var(--padding-x-small)) * 2);
|
|
55
|
+
--offset: calc(-1 * var(--Prompt-padding-x, var(--padding-x-small)));
|
|
56
|
+
content: "";
|
|
57
|
+
position: absolute;
|
|
58
|
+
inset: var(--offset);
|
|
59
|
+
width: var(--size);
|
|
60
|
+
height: var(--size);
|
|
61
|
+
border-radius: var(--Prompt-border-radius, var(--radius-small));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
49
64
|
}
|