@transferwise/components 46.137.0 → 46.138.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/i18n/cs.json +2 -0
- package/build/i18n/cs.json.js +2 -0
- package/build/i18n/cs.json.js.map +1 -1
- package/build/i18n/cs.json.mjs +2 -0
- package/build/i18n/cs.json.mjs.map +1 -1
- package/build/i18n/de.json +2 -0
- package/build/i18n/de.json.js +2 -0
- package/build/i18n/de.json.js.map +1 -1
- package/build/i18n/de.json.mjs +2 -0
- package/build/i18n/de.json.mjs.map +1 -1
- package/build/i18n/es.json +2 -0
- package/build/i18n/es.json.js +2 -0
- package/build/i18n/es.json.js.map +1 -1
- package/build/i18n/es.json.mjs +2 -0
- package/build/i18n/es.json.mjs.map +1 -1
- package/build/i18n/fr.json +2 -0
- package/build/i18n/fr.json.js +2 -0
- package/build/i18n/fr.json.js.map +1 -1
- package/build/i18n/fr.json.mjs +2 -0
- package/build/i18n/fr.json.mjs.map +1 -1
- package/build/i18n/hu.json +2 -0
- package/build/i18n/hu.json.js +2 -0
- package/build/i18n/hu.json.js.map +1 -1
- package/build/i18n/hu.json.mjs +2 -0
- package/build/i18n/hu.json.mjs.map +1 -1
- package/build/i18n/id.json +2 -0
- package/build/i18n/id.json.js +2 -0
- package/build/i18n/id.json.js.map +1 -1
- package/build/i18n/id.json.mjs +2 -0
- package/build/i18n/id.json.mjs.map +1 -1
- package/build/i18n/it.json +2 -0
- package/build/i18n/it.json.js +2 -0
- package/build/i18n/it.json.js.map +1 -1
- package/build/i18n/it.json.mjs +2 -0
- package/build/i18n/it.json.mjs.map +1 -1
- package/build/i18n/ja.json +2 -0
- package/build/i18n/ja.json.js +2 -0
- package/build/i18n/ja.json.js.map +1 -1
- package/build/i18n/ja.json.mjs +2 -0
- package/build/i18n/ja.json.mjs.map +1 -1
- package/build/i18n/nl.json +2 -0
- package/build/i18n/nl.json.js +2 -0
- package/build/i18n/nl.json.js.map +1 -1
- package/build/i18n/nl.json.mjs +2 -0
- package/build/i18n/nl.json.mjs.map +1 -1
- package/build/i18n/pl.json +2 -0
- package/build/i18n/pl.json.js +2 -0
- package/build/i18n/pl.json.js.map +1 -1
- package/build/i18n/pl.json.mjs +2 -0
- package/build/i18n/pl.json.mjs.map +1 -1
- package/build/i18n/pt.json +2 -0
- package/build/i18n/pt.json.js +2 -0
- package/build/i18n/pt.json.js.map +1 -1
- package/build/i18n/pt.json.mjs +2 -0
- package/build/i18n/pt.json.mjs.map +1 -1
- package/build/i18n/ro.json +2 -0
- package/build/i18n/ro.json.js +2 -0
- package/build/i18n/ro.json.js.map +1 -1
- package/build/i18n/ro.json.mjs +2 -0
- package/build/i18n/ro.json.mjs.map +1 -1
- package/build/i18n/ru.json +2 -0
- package/build/i18n/ru.json.js +2 -0
- package/build/i18n/ru.json.js.map +1 -1
- package/build/i18n/ru.json.mjs +2 -0
- package/build/i18n/ru.json.mjs.map +1 -1
- package/build/i18n/th.json +2 -0
- package/build/i18n/th.json.js +2 -0
- package/build/i18n/th.json.js.map +1 -1
- package/build/i18n/th.json.mjs +2 -0
- package/build/i18n/th.json.mjs.map +1 -1
- package/build/i18n/tr.json +2 -0
- package/build/i18n/tr.json.js +2 -0
- package/build/i18n/tr.json.js.map +1 -1
- package/build/i18n/tr.json.mjs +2 -0
- package/build/i18n/tr.json.mjs.map +1 -1
- package/build/i18n/uk.json +2 -0
- package/build/i18n/uk.json.js +2 -0
- package/build/i18n/uk.json.js.map +1 -1
- package/build/i18n/uk.json.mjs +2 -0
- package/build/i18n/uk.json.mjs.map +1 -1
- package/build/i18n/zh-CN.json +2 -0
- package/build/i18n/zh-CN.json.js +2 -0
- package/build/i18n/zh-CN.json.js.map +1 -1
- package/build/i18n/zh-CN.json.mjs +2 -0
- package/build/i18n/zh-CN.json.mjs.map +1 -1
- package/build/i18n/zh-HK.json +2 -0
- package/build/i18n/zh-HK.json.js +2 -0
- package/build/i18n/zh-HK.json.js.map +1 -1
- package/build/i18n/zh-HK.json.mjs +2 -0
- package/build/i18n/zh-HK.json.mjs.map +1 -1
- package/build/logo/Logo.js +3 -1
- package/build/logo/Logo.js.map +1 -1
- package/build/logo/Logo.mjs +3 -1
- package/build/logo/Logo.mjs.map +1 -1
- package/build/logo/logo-assets.js +147 -15
- package/build/logo/logo-assets.js.map +1 -1
- package/build/logo/logo-assets.mjs +147 -15
- package/build/logo/logo-assets.mjs.map +1 -1
- package/build/main.css +0 -1
- package/build/styles/css/neptune.css +0 -1
- package/build/styles/main.css +0 -1
- package/build/styles/styles/less/neptune.css +0 -1
- package/build/types/logo/Logo.d.ts +7 -1
- package/build/types/logo/Logo.d.ts.map +1 -1
- package/build/types/logo/logo-assets.d.ts +144 -12
- package/build/types/logo/logo-assets.d.ts.map +1 -1
- package/package.json +18 -14
- package/src/alert/Alert.story.tsx +30 -1
- package/src/avatarWrapper/AvatarWrapper.story.tsx +1 -1
- package/src/button/_stories/Button.story.tsx +11 -0
- package/src/i18n/cs.json +2 -0
- package/src/i18n/de.json +2 -0
- package/src/i18n/es.json +2 -0
- package/src/i18n/fr.json +2 -0
- package/src/i18n/hu.json +2 -0
- package/src/i18n/id.json +2 -0
- package/src/i18n/it.json +2 -0
- package/src/i18n/ja.json +2 -0
- package/src/i18n/nl.json +2 -0
- package/src/i18n/pl.json +2 -0
- package/src/i18n/pt.json +2 -0
- package/src/i18n/ro.json +2 -0
- package/src/i18n/ru.json +2 -0
- package/src/i18n/th.json +2 -0
- package/src/i18n/tr.json +2 -0
- package/src/i18n/uk.json +2 -0
- package/src/i18n/zh-CN.json +2 -0
- package/src/i18n/zh-HK.json +2 -0
- package/src/logo/Logo.story.tsx +40 -0
- package/src/logo/Logo.test.story.tsx +51 -0
- package/src/logo/Logo.tsx +11 -1
- package/src/logo/logo-assets.tsx +55 -8
- package/src/main.css +0 -1
- package/src/radio/Radio.story.tsx +1 -1
- package/src/section/Section.story.tsx +2 -8
- package/src/ssr.test.tsx +1 -0
- package/src/statusIcon/StatusIcon.test.tsx +0 -2
- package/src/styles/less/neptune.css +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
3
3
|
import { action } from 'storybook/actions';
|
|
4
4
|
import { ClockBorderless } from '@transferwise/icons';
|
|
5
|
+
import { createSandboxStory } from '../../.storybook/components/sandbox/SandboxEditor';
|
|
5
6
|
|
|
6
7
|
import { lorem40 } from '../test-utils';
|
|
7
8
|
import { Sentiment, Status } from '../common';
|
|
@@ -48,6 +49,34 @@ type Story = StoryObj<typeof Alert>;
|
|
|
48
49
|
|
|
49
50
|
export const Basic: Story = {};
|
|
50
51
|
|
|
52
|
+
export const Sandbox = createSandboxStory({
|
|
53
|
+
code: `const App = () => {
|
|
54
|
+
const [dismissed, setDismissed] = React.useState(false);
|
|
55
|
+
|
|
56
|
+
if (dismissed) {
|
|
57
|
+
return (
|
|
58
|
+
<Button v2 size="md" onClick={() => setDismissed(false)}>
|
|
59
|
+
Show alert again
|
|
60
|
+
</Button>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<Alert
|
|
66
|
+
action={{
|
|
67
|
+
'aria-label': 'Learn more',
|
|
68
|
+
text: 'Learn more',
|
|
69
|
+
href: '#',
|
|
70
|
+
}}
|
|
71
|
+
message="Payments sent to your bank details **today** might not arrive in time for the holidays."
|
|
72
|
+
onDismiss={() => setDismissed(true)}
|
|
73
|
+
type="positive"
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
};`,
|
|
77
|
+
scope: { Alert, Button, React },
|
|
78
|
+
});
|
|
79
|
+
|
|
51
80
|
export const Variants: Story = {
|
|
52
81
|
render: ({ message }) => {
|
|
53
82
|
const variants = [
|
|
@@ -81,7 +81,7 @@ export const All: Story = {
|
|
|
81
81
|
<div>
|
|
82
82
|
<AvatarWrapper
|
|
83
83
|
badgeStatusIcon={Sentiment.NEGATIVE}
|
|
84
|
-
url="https://wise.com/web-art/assets/flags/
|
|
84
|
+
url="https://wise.com/web-art/assets/flags/hr.svg"
|
|
85
85
|
profileType={ProfileType.BUSINESS}
|
|
86
86
|
avatarProps={avatarProps}
|
|
87
87
|
/>
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
import { fn } from 'storybook/test';
|
|
3
3
|
import { Freeze, ArrowRight, ChevronRight } from '@transferwise/icons';
|
|
4
|
+
import {
|
|
5
|
+
createSandboxStory,
|
|
6
|
+
globalScope,
|
|
7
|
+
} from '../../../.storybook/components/sandbox/SandboxEditor';
|
|
4
8
|
import { Flag } from '@wise/art';
|
|
5
9
|
import { lorem10, lorem20 } from '../../test-utils';
|
|
6
10
|
import SentimentSurface from '../../sentimentSurface';
|
|
@@ -317,6 +321,13 @@ export const Playground: StoryObj<PreviewStoryArgs> = {
|
|
|
317
321
|
},
|
|
318
322
|
};
|
|
319
323
|
|
|
324
|
+
export const Sandbox = createSandboxStory({
|
|
325
|
+
code: `<Button v2 size="md" onClick={console.log}>
|
|
326
|
+
Click me
|
|
327
|
+
</Button>`,
|
|
328
|
+
scope: globalScope,
|
|
329
|
+
});
|
|
330
|
+
|
|
320
331
|
/**
|
|
321
332
|
* There are two different types of button – default and negative – designed to emphasise the nature of the action. <br />
|
|
322
333
|
* **NB:** Sentiment only applies to `primary` and `secondary` priorities. <br />
|
package/src/i18n/cs.json
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"neptune.DateLookup.selected": "vybráno",
|
|
17
17
|
"neptune.DateLookup.twentyYears": "20 let",
|
|
18
18
|
"neptune.DateLookup.year": "rok",
|
|
19
|
+
"neptune.Expander.collapseAriaLabel": "Sbalit",
|
|
20
|
+
"neptune.Expander.expandAriaLabel": "Rozbalit",
|
|
19
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Napište měnu/zemi",
|
|
20
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Vybrat měnu",
|
|
21
23
|
"neptune.FlowNavigation.back": "zpět na předchozí krok",
|
package/src/i18n/de.json
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"neptune.DateLookup.selected": "ausgewählt",
|
|
17
17
|
"neptune.DateLookup.twentyYears": "20 Jahre",
|
|
18
18
|
"neptune.DateLookup.year": "Jahr",
|
|
19
|
+
"neptune.Expander.collapseAriaLabel": "Minimieren",
|
|
20
|
+
"neptune.Expander.expandAriaLabel": "Maximieren",
|
|
19
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Gib eine Währung / ein Land ein",
|
|
20
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Wähle eine Währung",
|
|
21
23
|
"neptune.FlowNavigation.back": "zurück zum vorherigen Schritt",
|
package/src/i18n/es.json
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"neptune.DateLookup.selected": "seleccionado",
|
|
17
17
|
"neptune.DateLookup.twentyYears": "20 años",
|
|
18
18
|
"neptune.DateLookup.year": "año",
|
|
19
|
+
"neptune.Expander.collapseAriaLabel": "Ocultar",
|
|
20
|
+
"neptune.Expander.expandAriaLabel": "Expandir",
|
|
19
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Indica una divisa/país",
|
|
20
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Seleccionar divisa",
|
|
21
23
|
"neptune.FlowNavigation.back": "volver al paso anterior",
|
package/src/i18n/fr.json
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"neptune.DateLookup.selected": "sélectionnée",
|
|
17
17
|
"neptune.DateLookup.twentyYears": "20 ans",
|
|
18
18
|
"neptune.DateLookup.year": "année",
|
|
19
|
+
"neptune.Expander.collapseAriaLabel": "Réduire",
|
|
20
|
+
"neptune.Expander.expandAriaLabel": "Développer",
|
|
19
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Entrez une devise/un pays",
|
|
20
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Sélectionnez une devise",
|
|
21
23
|
"neptune.FlowNavigation.back": "revenir à l'étape précédente",
|
package/src/i18n/hu.json
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"neptune.DateLookup.selected": "kiválasztva",
|
|
17
17
|
"neptune.DateLookup.twentyYears": "20 év",
|
|
18
18
|
"neptune.DateLookup.year": "év",
|
|
19
|
+
"neptune.Expander.collapseAriaLabel": "Rövidebben",
|
|
20
|
+
"neptune.Expander.expandAriaLabel": "Több",
|
|
19
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Írj be egy pénznemet/országot",
|
|
20
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Pénznem kiválasztása",
|
|
21
23
|
"neptune.FlowNavigation.back": "vissza az előző lépéshez",
|
package/src/i18n/id.json
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"neptune.DateLookup.selected": "terpilih",
|
|
17
17
|
"neptune.DateLookup.twentyYears": "20 tahun",
|
|
18
18
|
"neptune.DateLookup.year": "tahun",
|
|
19
|
+
"neptune.Expander.collapseAriaLabel": "Persempit",
|
|
20
|
+
"neptune.Expander.expandAriaLabel": "Perluas",
|
|
19
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Ketik mata uang/negara",
|
|
20
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Pilih mata uang",
|
|
21
23
|
"neptune.FlowNavigation.back": "kembali ke langkah sebelumnya",
|
package/src/i18n/it.json
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"neptune.DateLookup.selected": "selezionata",
|
|
17
17
|
"neptune.DateLookup.twentyYears": "20 anni",
|
|
18
18
|
"neptune.DateLookup.year": "anno",
|
|
19
|
+
"neptune.Expander.collapseAriaLabel": "Riduci",
|
|
20
|
+
"neptune.Expander.expandAriaLabel": "Espandi",
|
|
19
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Digita una valuta / paese",
|
|
20
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Scegli la valuta",
|
|
21
23
|
"neptune.FlowNavigation.back": "torna al passaggio precedente",
|
package/src/i18n/ja.json
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"neptune.DateLookup.selected": "選択済み",
|
|
17
17
|
"neptune.DateLookup.twentyYears": "20年",
|
|
18
18
|
"neptune.DateLookup.year": "年",
|
|
19
|
+
"neptune.Expander.collapseAriaLabel": "閉じる",
|
|
20
|
+
"neptune.Expander.expandAriaLabel": "開く",
|
|
19
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "通貨または国をご入力ください",
|
|
20
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "通貨の選択",
|
|
21
23
|
"neptune.FlowNavigation.back": "前のステップに戻る",
|
package/src/i18n/nl.json
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"neptune.DateLookup.selected": "geselecteerd",
|
|
17
17
|
"neptune.DateLookup.twentyYears": "20 jaar",
|
|
18
18
|
"neptune.DateLookup.year": "jaar",
|
|
19
|
+
"neptune.Expander.collapseAriaLabel": "Samenvouwen",
|
|
20
|
+
"neptune.Expander.expandAriaLabel": "Uitvouwen",
|
|
19
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Voer een valuta / land in",
|
|
20
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Selecteer valuta",
|
|
21
23
|
"neptune.FlowNavigation.back": "terug naar vorige stap",
|
package/src/i18n/pl.json
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"neptune.DateLookup.selected": "wybrano",
|
|
17
17
|
"neptune.DateLookup.twentyYears": "20 lat",
|
|
18
18
|
"neptune.DateLookup.year": "rok",
|
|
19
|
+
"neptune.Expander.collapseAriaLabel": "Schowaj",
|
|
20
|
+
"neptune.Expander.expandAriaLabel": "Rozwiń",
|
|
19
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Wpisz walutę / kraj",
|
|
20
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Wybierz walutę",
|
|
21
23
|
"neptune.FlowNavigation.back": "wróć do poprzedniego kroku",
|
package/src/i18n/pt.json
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"neptune.DateLookup.selected": "selecionada",
|
|
17
17
|
"neptune.DateLookup.twentyYears": "20 anos",
|
|
18
18
|
"neptune.DateLookup.year": "ano",
|
|
19
|
+
"neptune.Expander.collapseAriaLabel": "Ver menos",
|
|
20
|
+
"neptune.Expander.expandAriaLabel": "Ver mais",
|
|
19
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Digite uma moeda / país",
|
|
20
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Selecione a moeda",
|
|
21
23
|
"neptune.FlowNavigation.back": "voltar à etapa anterior",
|
package/src/i18n/ro.json
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"neptune.DateLookup.selected": "selectată",
|
|
17
17
|
"neptune.DateLookup.twentyYears": "20 de ani",
|
|
18
18
|
"neptune.DateLookup.year": "an",
|
|
19
|
+
"neptune.Expander.collapseAriaLabel": "Restrânge",
|
|
20
|
+
"neptune.Expander.expandAriaLabel": "Extinde",
|
|
19
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Tastează o monedă / țară",
|
|
20
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Selectează moneda",
|
|
21
23
|
"neptune.FlowNavigation.back": "înapoi la pasul anterior",
|
package/src/i18n/ru.json
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"neptune.DateLookup.selected": "выбрано",
|
|
17
17
|
"neptune.DateLookup.twentyYears": "20 лет",
|
|
18
18
|
"neptune.DateLookup.year": "год",
|
|
19
|
+
"neptune.Expander.collapseAriaLabel": "Свернуть",
|
|
20
|
+
"neptune.Expander.expandAriaLabel": "Развернуть",
|
|
19
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Введите валюту/страну",
|
|
20
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Выберите валюту",
|
|
21
23
|
"neptune.FlowNavigation.back": "вернуться к предыдущему шагу",
|
package/src/i18n/th.json
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"neptune.DateLookup.selected": "เลือกแล้ว",
|
|
17
17
|
"neptune.DateLookup.twentyYears": "20 ปี",
|
|
18
18
|
"neptune.DateLookup.year": "ปี",
|
|
19
|
+
"neptune.Expander.collapseAriaLabel": "ย่อ",
|
|
20
|
+
"neptune.Expander.expandAriaLabel": "ขยาย",
|
|
19
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "ป้อนสกุลเงิน / ประเทศ",
|
|
20
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "เลือกสกุลเงิน",
|
|
21
23
|
"neptune.FlowNavigation.back": "กลับไปที่ขั้นก่อนหน้า",
|
package/src/i18n/tr.json
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"neptune.DateLookup.selected": "seçili",
|
|
17
17
|
"neptune.DateLookup.twentyYears": "20 yıl",
|
|
18
18
|
"neptune.DateLookup.year": "yıl",
|
|
19
|
+
"neptune.Expander.collapseAriaLabel": "Küçült",
|
|
20
|
+
"neptune.Expander.expandAriaLabel": "Genişlet",
|
|
19
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Bir para birimi / ülke girin",
|
|
20
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Para birimi seçin",
|
|
21
23
|
"neptune.FlowNavigation.back": "önceki adıma dön",
|
package/src/i18n/uk.json
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"neptune.DateLookup.selected": "вибрано",
|
|
17
17
|
"neptune.DateLookup.twentyYears": "20 років",
|
|
18
18
|
"neptune.DateLookup.year": "рік",
|
|
19
|
+
"neptune.Expander.collapseAriaLabel": "Згорнути",
|
|
20
|
+
"neptune.Expander.expandAriaLabel": "Розгорнути",
|
|
19
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "Вкажіть валюту / країну",
|
|
20
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "Виберіть валюту",
|
|
21
23
|
"neptune.FlowNavigation.back": "назад до попереднього кроку",
|
package/src/i18n/zh-CN.json
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"neptune.DateLookup.selected": "已选",
|
|
17
17
|
"neptune.DateLookup.twentyYears": "20 年",
|
|
18
18
|
"neptune.DateLookup.year": "年",
|
|
19
|
+
"neptune.Expander.collapseAriaLabel": "收起",
|
|
20
|
+
"neptune.Expander.expandAriaLabel": "展开",
|
|
19
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "输入货币/国家/地区",
|
|
20
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "选择货币",
|
|
21
23
|
"neptune.FlowNavigation.back": "返回上一步",
|
package/src/i18n/zh-HK.json
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"neptune.DateLookup.selected": "已選",
|
|
17
17
|
"neptune.DateLookup.twentyYears": "20年",
|
|
18
18
|
"neptune.DateLookup.year": "年",
|
|
19
|
+
"neptune.Expander.collapseAriaLabel": "收起",
|
|
20
|
+
"neptune.Expander.expandAriaLabel": "展開",
|
|
19
21
|
"neptune.ExpressiveMoneyInput.currency.search.placeholder": "輸入貨幣或國家/地區",
|
|
20
22
|
"neptune.ExpressiveMoneyInput.currency.select.currency": "選擇貨幣",
|
|
21
23
|
"neptune.FlowNavigation.back": "返回上一個步驟",
|
package/src/logo/Logo.story.tsx
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
|
|
3
3
|
import Logo, { LogoType, LogoDisplay, LogoFormat } from './Logo';
|
|
4
|
+
import type { LogoSize } from './Logo';
|
|
4
5
|
import { withVariantConfig } from '../../.storybook/helpers';
|
|
6
|
+
import Body from '../body';
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* **Design guidance**: <a href="https://wise.design/foundations/logo" target="_blank">wise.design/foundations/logo</a>
|
|
@@ -25,6 +27,10 @@ const meta: Meta<typeof Logo> = {
|
|
|
25
27
|
control: 'radio',
|
|
26
28
|
options: Object.values(LogoFormat),
|
|
27
29
|
},
|
|
30
|
+
size: {
|
|
31
|
+
control: 'radio',
|
|
32
|
+
options: [16, 18, 20, 24, 28, 36] satisfies LogoSize[],
|
|
33
|
+
},
|
|
28
34
|
inverse: { control: { disable: true } },
|
|
29
35
|
},
|
|
30
36
|
parameters: {
|
|
@@ -162,6 +168,40 @@ export const SecondaryLockup: Story = {
|
|
|
162
168
|
},
|
|
163
169
|
};
|
|
164
170
|
|
|
171
|
+
/**
|
|
172
|
+
* Controls the height and width of the logo in pixels.
|
|
173
|
+
*/
|
|
174
|
+
export const Sizes: Story = {
|
|
175
|
+
argTypes: {
|
|
176
|
+
size: { table: { disable: true } },
|
|
177
|
+
},
|
|
178
|
+
render: (args) => (
|
|
179
|
+
<div style={{ display: 'flex', gap: '2rem', alignItems: 'flex-end', padding: '2rem' }}>
|
|
180
|
+
{([16, 18, 20, 24, 28, 36] as const).map((size) => (
|
|
181
|
+
<div
|
|
182
|
+
key={size}
|
|
183
|
+
style={{
|
|
184
|
+
display: 'flex',
|
|
185
|
+
flexDirection: 'column',
|
|
186
|
+
alignItems: 'center',
|
|
187
|
+
gap: '0.5rem',
|
|
188
|
+
}}
|
|
189
|
+
>
|
|
190
|
+
<Logo {...args} size={size} />
|
|
191
|
+
<Body>{size}</Body>
|
|
192
|
+
</div>
|
|
193
|
+
))}
|
|
194
|
+
</div>
|
|
195
|
+
),
|
|
196
|
+
parameters: {
|
|
197
|
+
docs: {
|
|
198
|
+
source: {
|
|
199
|
+
code: `<Logo size={..} />`,
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
};
|
|
204
|
+
|
|
165
205
|
/**
|
|
166
206
|
* When `display` is `"compact"`, only the fast-flag mark is rendered regardless of type or other settings.
|
|
167
207
|
*/
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
|
|
3
3
|
import Logo, { LogoType } from '.';
|
|
4
|
+
import { LogoFormat } from './Logo';
|
|
5
|
+
import type { LogoSize } from './Logo';
|
|
4
6
|
import { withVariantConfig } from '../../.storybook/helpers';
|
|
7
|
+
import Body from '../body';
|
|
5
8
|
|
|
6
9
|
const meta: Meta<typeof Logo> = {
|
|
7
10
|
component: Logo,
|
|
@@ -42,3 +45,51 @@ export const Responsive: Story = {
|
|
|
42
45
|
render: () => <AllVariants />,
|
|
43
46
|
...withVariantConfig(['mobile']),
|
|
44
47
|
};
|
|
48
|
+
|
|
49
|
+
const sizes: LogoSize[] = [16, 18, 20, 24, 28, 36];
|
|
50
|
+
|
|
51
|
+
export const Sizes = () => (
|
|
52
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '3rem' }}>
|
|
53
|
+
{(['compact', 'full'] as const).map((display) => (
|
|
54
|
+
<div key={display} style={{ display: 'flex', gap: '2rem', alignItems: 'flex-end' }}>
|
|
55
|
+
{sizes.map((size) => (
|
|
56
|
+
<div
|
|
57
|
+
key={size}
|
|
58
|
+
style={{
|
|
59
|
+
display: 'flex',
|
|
60
|
+
flexDirection: 'column',
|
|
61
|
+
alignItems: 'center',
|
|
62
|
+
gap: '0.5rem',
|
|
63
|
+
}}
|
|
64
|
+
>
|
|
65
|
+
<Logo type="WISE" size={size} display={display} />
|
|
66
|
+
<Body>{size}</Body>
|
|
67
|
+
</div>
|
|
68
|
+
))}
|
|
69
|
+
</div>
|
|
70
|
+
))}
|
|
71
|
+
{[LogoType.WISE_BUSINESS, LogoType.WISE_PLATFORM].map((type) =>
|
|
72
|
+
[LogoFormat.PRIMARY_LOCKUP, LogoFormat.SECONDARY_LOCKUP].map((format) => (
|
|
73
|
+
<div
|
|
74
|
+
key={`${type}-${format}`}
|
|
75
|
+
style={{ display: 'flex', gap: '2rem', alignItems: 'flex-end' }}
|
|
76
|
+
>
|
|
77
|
+
{sizes.map((size) => (
|
|
78
|
+
<div
|
|
79
|
+
key={size}
|
|
80
|
+
style={{
|
|
81
|
+
display: 'flex',
|
|
82
|
+
flexDirection: 'column',
|
|
83
|
+
alignItems: 'center',
|
|
84
|
+
gap: '0.5rem',
|
|
85
|
+
}}
|
|
86
|
+
>
|
|
87
|
+
<Logo type={type} format={format} size={size} display="full" />
|
|
88
|
+
<Body>{size}</Body>
|
|
89
|
+
</div>
|
|
90
|
+
))}
|
|
91
|
+
</div>
|
|
92
|
+
)),
|
|
93
|
+
)}
|
|
94
|
+
</div>
|
|
95
|
+
);
|
package/src/logo/Logo.tsx
CHANGED
|
@@ -32,6 +32,8 @@ export enum LogoFormat {
|
|
|
32
32
|
SECONDARY_LOCKUP = 'secondary-lockup',
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
export type LogoSize = 16 | 18 | 20 | 24 | 28 | 36 | '16' | '18' | '20' | '24' | '28' | '36';
|
|
36
|
+
|
|
35
37
|
export interface LogoProps {
|
|
36
38
|
/** Extra classes applied to Logo */
|
|
37
39
|
className?: string;
|
|
@@ -62,6 +64,11 @@ export interface LogoProps {
|
|
|
62
64
|
* @default 'default'
|
|
63
65
|
*/
|
|
64
66
|
format?: `${LogoFormat}`;
|
|
67
|
+
/**
|
|
68
|
+
* Controls the height and width of the logo in pixels.
|
|
69
|
+
* @default 24
|
|
70
|
+
*/
|
|
71
|
+
size?: LogoSize;
|
|
65
72
|
/**
|
|
66
73
|
* Override default ({@link labelByType}) screen reader messages
|
|
67
74
|
*/
|
|
@@ -94,6 +101,7 @@ export default function Logo({
|
|
|
94
101
|
type = 'WISE',
|
|
95
102
|
format = 'default',
|
|
96
103
|
display = 'responsive',
|
|
104
|
+
size = 24,
|
|
97
105
|
'aria-label': ariaLabel,
|
|
98
106
|
}: LogoProps) {
|
|
99
107
|
const isScreenSm = !useScreenSize(Breakpoint.SMALL);
|
|
@@ -101,7 +109,9 @@ export default function Logo({
|
|
|
101
109
|
|
|
102
110
|
const assetName = compact ? 'FastFlag' : getAssetName(type, format);
|
|
103
111
|
const Asset = logoAssets[assetName];
|
|
104
|
-
const
|
|
112
|
+
const sizes = logoAssetsDimensions[assetName];
|
|
113
|
+
const { width, height } =
|
|
114
|
+
logoAssetsDimensions[assetName][Number(size) as keyof typeof sizes] ?? sizes[24];
|
|
105
115
|
|
|
106
116
|
return (
|
|
107
117
|
<span
|
package/src/logo/logo-assets.tsx
CHANGED
|
@@ -1,17 +1,64 @@
|
|
|
1
1
|
export const logoAssetsDimensions = {
|
|
2
|
-
FastFlag: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
FastFlag: {
|
|
3
|
+
16: { width: 16, height: 16 },
|
|
4
|
+
18: { width: 18, height: 18 },
|
|
5
|
+
20: { width: 20, height: 20 },
|
|
6
|
+
24: { width: 24, height: 24 },
|
|
7
|
+
28: { width: 28, height: 28 },
|
|
8
|
+
36: { width: 36, height: 36 },
|
|
9
|
+
},
|
|
10
|
+
WiseLogo: {
|
|
11
|
+
16: { width: 64, height: 16 },
|
|
12
|
+
18: { width: 72, height: 18 },
|
|
13
|
+
20: { width: 80, height: 20 },
|
|
14
|
+
24: { width: 96, height: 24 },
|
|
15
|
+
28: { width: 112, height: 28 },
|
|
16
|
+
36: { width: 144, height: 36 },
|
|
17
|
+
},
|
|
18
|
+
WiseBusinessPrimary: {
|
|
19
|
+
16: { width: 140, height: 16 },
|
|
20
|
+
18: { width: 157.5, height: 18 },
|
|
21
|
+
20: { width: 175, height: 20 },
|
|
22
|
+
24: { width: 210, height: 24 },
|
|
23
|
+
28: { width: 245, height: 28 },
|
|
24
|
+
36: { width: 315, height: 36 },
|
|
25
|
+
},
|
|
26
|
+
WiseBusinessSecondary: {
|
|
27
|
+
16: { width: 68, height: 32 },
|
|
28
|
+
18: { width: 76.5, height: 36 },
|
|
29
|
+
20: { width: 85, height: 40 },
|
|
30
|
+
24: { width: 102, height: 48 },
|
|
31
|
+
28: { width: 119, height: 56 },
|
|
32
|
+
36: { width: 153, height: 72 },
|
|
33
|
+
},
|
|
34
|
+
WisePlatformPrimary: {
|
|
35
|
+
16: { width: 136, height: 16 },
|
|
36
|
+
18: { width: 153, height: 18 },
|
|
37
|
+
20: { width: 170, height: 20 },
|
|
38
|
+
24: { width: 204, height: 24 },
|
|
39
|
+
28: { width: 238, height: 28 },
|
|
40
|
+
36: { width: 306, height: 36 },
|
|
41
|
+
},
|
|
42
|
+
WisePlatformSecondary: {
|
|
43
|
+
16: { width: 64, height: 32 },
|
|
44
|
+
18: { width: 72, height: 36 },
|
|
45
|
+
20: { width: 80, height: 40 },
|
|
46
|
+
24: { width: 96, height: 48 },
|
|
47
|
+
28: { width: 112, height: 56 },
|
|
48
|
+
36: { width: 144, height: 72 },
|
|
49
|
+
},
|
|
8
50
|
} as const;
|
|
9
51
|
|
|
10
52
|
export type LogoAssetName = keyof typeof logoAssetsDimensions;
|
|
11
53
|
|
|
12
54
|
function svgProps(name: LogoAssetName) {
|
|
13
|
-
const { width, height } = logoAssetsDimensions[name];
|
|
14
|
-
return {
|
|
55
|
+
const { width, height } = logoAssetsDimensions[name][24];
|
|
56
|
+
return {
|
|
57
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
58
|
+
width: '100%',
|
|
59
|
+
height: '100%',
|
|
60
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
61
|
+
};
|
|
15
62
|
}
|
|
16
63
|
|
|
17
64
|
export function FastFlag() {
|
package/src/main.css
CHANGED
|
@@ -108,14 +108,8 @@ export const WithListItems = () => {
|
|
|
108
108
|
return (
|
|
109
109
|
<Section>
|
|
110
110
|
<Header title="Section with list items" />
|
|
111
|
-
<ListItem
|
|
112
|
-
|
|
113
|
-
control={<ListItem.Navigation onClick={() => action('Item 1')} />}
|
|
114
|
-
/>
|
|
115
|
-
<ListItem
|
|
116
|
-
title="Item 2"
|
|
117
|
-
control={<ListItem.Navigation onClick={() => action('Item 2')} />}
|
|
118
|
-
/>
|
|
111
|
+
<ListItem title="Item 1" control={<ListItem.Navigation onClick={() => action('Item 1')} />} />
|
|
112
|
+
<ListItem title="Item 2" control={<ListItem.Navigation onClick={() => action('Item 2')} />} />
|
|
119
113
|
</Section>
|
|
120
114
|
);
|
|
121
115
|
};
|
package/src/ssr.test.tsx
CHANGED
|
@@ -183,6 +183,7 @@ describe('Server side rendering', () => {
|
|
|
183
183
|
|
|
184
184
|
// Override props in case of name collision.
|
|
185
185
|
const overrideProps: Partial<Record<keyof ExposedLibraryItemsType, Record<string, unknown>>> = {
|
|
186
|
+
Logo: { size: 16 },
|
|
186
187
|
ActionPrompt: { action: { label: 'Action', onClick: jest.fn(), href: '#' } },
|
|
187
188
|
Alert: { children: undefined, message: 'Fluffy kittens', size: undefined },
|
|
188
189
|
Card: { isExpanded: true },
|
|
@@ -42,7 +42,6 @@ describe('StatusIcon', () => {
|
|
|
42
42
|
},
|
|
43
43
|
);
|
|
44
44
|
|
|
45
|
-
|
|
46
45
|
it.each([
|
|
47
46
|
[Sentiment.WARNING, 'alert-icon'],
|
|
48
47
|
[Sentiment.PENDING, 'clock-borderless-icon'],
|
|
@@ -61,7 +60,6 @@ describe('StatusIcon', () => {
|
|
|
61
60
|
},
|
|
62
61
|
);
|
|
63
62
|
|
|
64
|
-
|
|
65
63
|
describe('accessible name', () => {
|
|
66
64
|
it.each([
|
|
67
65
|
['Error', Sentiment.NEGATIVE],
|