@transferwise/components 46.136.1 → 46.137.1
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/common/hooks/useContainerSize.js +30 -0
- package/build/common/hooks/useContainerSize.js.map +1 -0
- package/build/common/hooks/useContainerSize.mjs +28 -0
- package/build/common/hooks/useContainerSize.mjs.map +1 -0
- package/build/common/hooks/useResizeObserver.js +3 -3
- package/build/common/hooks/useResizeObserver.js.map +1 -1
- package/build/common/hooks/useResizeObserver.mjs +3 -3
- package/build/common/hooks/useResizeObserver.mjs.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js +3 -0
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs +3 -0
- package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
- package/build/field/Field.js +3 -2
- package/build/field/Field.js.map +1 -1
- package/build/field/Field.mjs +3 -2
- package/build/field/Field.mjs.map +1 -1
- 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/en.json +2 -0
- package/build/i18n/en.json.js +2 -0
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/en.json.mjs +2 -0
- package/build/i18n/en.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/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/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/index.mjs +1 -0
- package/build/index.mjs.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.js +3 -2
- package/build/listItem/Prompt/ListItemPrompt.js.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.mjs +3 -2
- package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -1
- package/build/logo/Logo.js +77 -25
- package/build/logo/Logo.js.map +1 -1
- package/build/logo/Logo.mjs +79 -27
- package/build/logo/Logo.mjs.map +1 -1
- package/build/logo/logo-assets.js +68 -97
- package/build/logo/logo-assets.js.map +1 -1
- package/build/logo/logo-assets.mjs +62 -90
- package/build/logo/logo-assets.mjs.map +1 -1
- package/build/main.css +225 -59
- package/build/prompt/ActionPrompt/ActionPrompt.js +8 -40
- package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.mjs +8 -40
- package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
- package/build/prompt/CriticalBanner/CriticalBanner.js +143 -0
- package/build/prompt/CriticalBanner/CriticalBanner.js.map +1 -0
- package/build/prompt/CriticalBanner/CriticalBanner.mjs +141 -0
- package/build/prompt/CriticalBanner/CriticalBanner.mjs.map +1 -0
- package/build/prompt/CriticalBanner/helpers.js +29 -0
- package/build/prompt/CriticalBanner/helpers.js.map +1 -0
- package/build/prompt/CriticalBanner/helpers.mjs +26 -0
- package/build/prompt/CriticalBanner/helpers.mjs.map +1 -0
- package/build/prompt/InfoPrompt/InfoPrompt.js +3 -2
- package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.mjs +3 -2
- package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.js +11 -4
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -1
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs +11 -4
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -1
- package/build/prompt/common/Expander/Expander.js +35 -0
- package/build/prompt/common/Expander/Expander.js.map +1 -0
- package/build/prompt/common/Expander/Expander.messages.js +17 -0
- package/build/prompt/common/Expander/Expander.messages.js.map +1 -0
- package/build/prompt/common/Expander/Expander.messages.mjs +13 -0
- package/build/prompt/common/Expander/Expander.messages.mjs.map +1 -0
- package/build/prompt/common/Expander/Expander.mjs +33 -0
- package/build/prompt/common/Expander/Expander.mjs.map +1 -0
- package/build/prompt/helpers/promptMedia.js +52 -0
- package/build/prompt/helpers/promptMedia.js.map +1 -0
- package/build/prompt/helpers/promptMedia.mjs +50 -0
- package/build/prompt/helpers/promptMedia.mjs.map +1 -0
- package/build/styles/css/neptune.css +0 -1
- package/build/styles/logo/Logo.css +3 -23
- package/build/styles/main.css +225 -59
- package/build/styles/prompt/CriticalBanner/CriticalBanner.css +134 -0
- package/build/styles/prompt/CriticalBanner/CriticalBanner.vars.css +0 -0
- package/build/styles/prompt/InfoPrompt/InfoPrompt.css +24 -0
- package/build/styles/prompt/common/Expander/Expander.css +8 -0
- package/build/styles/styles/less/neptune.css +0 -1
- package/build/typeahead/Typeahead.js +3 -2
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.mjs +3 -2
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/types/common/hooks/useContainerSize.d.ts +14 -0
- package/build/types/common/hooks/useContainerSize.d.ts.map +1 -0
- package/build/types/common/hooks/useResizeObserver.d.ts +1 -1
- package/build/types/common/hooks/useResizeObserver.d.ts.map +1 -1
- package/build/types/criticalBanner/CriticalCommsBanner.d.ts +3 -0
- package/build/types/criticalBanner/CriticalCommsBanner.d.ts.map +1 -1
- package/build/types/index.d.ts +2 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/logo/Logo.d.ts +33 -1
- package/build/types/logo/Logo.d.ts.map +1 -1
- package/build/types/logo/logo-assets.d.ts +33 -9
- package/build/types/logo/logo-assets.d.ts.map +1 -1
- package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts +2 -11
- package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts.map +1 -1
- package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts +39 -0
- package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts.map +1 -0
- package/build/types/prompt/CriticalBanner/helpers.d.ts +18 -0
- package/build/types/prompt/CriticalBanner/helpers.d.ts.map +1 -0
- package/build/types/prompt/CriticalBanner/index.d.ts +3 -0
- package/build/types/prompt/CriticalBanner/index.d.ts.map +1 -0
- package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts.map +1 -1
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts +35 -3
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -1
- package/build/types/prompt/common/Expander/Expander.d.ts +20 -0
- package/build/types/prompt/common/Expander/Expander.d.ts.map +1 -0
- package/build/types/prompt/common/Expander/Expander.messages.d.ts +14 -0
- package/build/types/prompt/common/Expander/Expander.messages.d.ts.map +1 -0
- package/build/types/prompt/helpers/promptMedia.d.ts +22 -0
- package/build/types/prompt/helpers/promptMedia.d.ts.map +1 -0
- package/build/types/prompt/index.d.ts +2 -0
- package/build/types/prompt/index.d.ts.map +1 -1
- package/build/types/test-utils/index.d.ts +4 -0
- package/build/types/test-utils/index.d.ts.map +1 -1
- package/package.json +22 -18
- 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/common/hooks/useContainerSize.test.tsx +125 -0
- package/src/common/hooks/useContainerSize.ts +32 -0
- package/src/common/hooks/useResizeObserver.ts +3 -2
- package/src/criticalBanner/CriticalCommsBanner.story.tsx +4 -0
- package/src/criticalBanner/CriticalCommsBanner.test.story.tsx +1 -1
- package/src/criticalBanner/CriticalCommsBanner.tsx +3 -0
- package/src/i18n/cs.json +2 -0
- package/src/i18n/de.json +2 -0
- package/src/i18n/en.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/zh-CN.json +2 -0
- package/src/i18n/zh-HK.json +2 -0
- package/src/index.ts +2 -2
- package/src/logo/Logo.css +3 -23
- package/src/logo/Logo.less +3 -29
- package/src/logo/Logo.story.tsx +117 -89
- package/src/logo/Logo.test.story.tsx +15 -24
- package/src/logo/Logo.tsx +90 -28
- package/src/logo/logo-assets.tsx +36 -92
- package/src/main.css +225 -59
- package/src/main.less +3 -1
- package/src/prompt/ActionPrompt/ActionPrompt.tsx +9 -62
- package/src/prompt/CriticalBanner/CriticalBanner.accessibility.docs.mdx +113 -0
- package/src/prompt/CriticalBanner/CriticalBanner.css +134 -0
- package/src/prompt/CriticalBanner/CriticalBanner.less +155 -0
- package/src/prompt/CriticalBanner/CriticalBanner.story.tsx +635 -0
- package/src/prompt/CriticalBanner/CriticalBanner.test.story.tsx +422 -0
- package/src/prompt/CriticalBanner/CriticalBanner.tsx +179 -0
- package/src/prompt/CriticalBanner/CriticalBanner.vars.css +0 -0
- package/src/prompt/CriticalBanner/CriticalBanner.vars.less +6 -0
- package/src/prompt/CriticalBanner/helpers.ts +39 -0
- package/src/prompt/CriticalBanner/index.ts +2 -0
- package/src/prompt/InfoPrompt/InfoPrompt.css +24 -0
- package/src/prompt/InfoPrompt/InfoPrompt.less +23 -0
- package/src/prompt/InfoPrompt/InfoPrompt.tsx +5 -1
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +56 -40
- package/src/prompt/common/Expander/Expander.css +8 -0
- package/src/prompt/common/Expander/Expander.less +9 -0
- package/src/prompt/common/Expander/Expander.messages.ts +14 -0
- package/src/prompt/common/Expander/Expander.test.tsx +167 -0
- package/src/prompt/common/Expander/Expander.tsx +83 -0
- package/src/prompt/helpers/promptMedia.tsx +79 -0
- package/src/prompt/index.ts +4 -0
- package/src/radio/Radio.story.tsx +1 -1
- package/src/section/Section.story.tsx +2 -8
- package/src/sentimentSurface/SentimentSurface.story.tsx +43 -17
- package/src/statusIcon/StatusIcon.test.tsx +0 -2
- package/src/styles/less/neptune.css +0 -1
package/src/logo/Logo.story.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
|
|
3
|
-
import Logo, { LogoType } from '
|
|
3
|
+
import Logo, { LogoType, LogoDisplay, LogoFormat } from './Logo';
|
|
4
|
+
import { withVariantConfig } from '../../.storybook/helpers';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* **Design guidance**: <a href="https://wise.design/foundations/logo" target="_blank">wise.design/foundations/logo</a>
|
|
@@ -10,13 +11,21 @@ const meta: Meta<typeof Logo> = {
|
|
|
10
11
|
title: 'Content/Logo',
|
|
11
12
|
args: {
|
|
12
13
|
type: 'WISE',
|
|
13
|
-
inverse: false,
|
|
14
14
|
},
|
|
15
15
|
argTypes: {
|
|
16
16
|
type: {
|
|
17
17
|
control: 'radio',
|
|
18
18
|
options: Object.values(LogoType),
|
|
19
19
|
},
|
|
20
|
+
display: {
|
|
21
|
+
control: 'radio',
|
|
22
|
+
options: Object.values(LogoDisplay),
|
|
23
|
+
},
|
|
24
|
+
format: {
|
|
25
|
+
control: 'radio',
|
|
26
|
+
options: Object.values(LogoFormat),
|
|
27
|
+
},
|
|
28
|
+
inverse: { control: { disable: true } },
|
|
20
29
|
},
|
|
21
30
|
parameters: {
|
|
22
31
|
docs: { toc: true },
|
|
@@ -29,23 +38,15 @@ type Story = StoryObj<typeof Logo>;
|
|
|
29
38
|
|
|
30
39
|
/** Explore all props via the controls panel. */
|
|
31
40
|
export const Playground: Story = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
? { backgroundColor: 'var(--color-background-screen-dark, #0e0f0c)' }
|
|
38
|
-
: {}),
|
|
39
|
-
}}
|
|
40
|
-
>
|
|
41
|
-
<Logo {...args} />
|
|
42
|
-
</div>
|
|
43
|
-
),
|
|
41
|
+
args: {
|
|
42
|
+
type: 'WISE',
|
|
43
|
+
format: 'primary-lockup',
|
|
44
|
+
},
|
|
45
|
+
render: (args) => <Logo {...args} />,
|
|
44
46
|
};
|
|
45
47
|
|
|
46
48
|
/**
|
|
47
|
-
* The three logo types: standard Wise, Wise Business, and Wise Platform.
|
|
48
|
-
* `WISE_BUSINESS` renders the same SVG as `WISE` but with the accessible label "Wise Business".
|
|
49
|
+
* The three logo types: standard Wise, Wise Business, and Wise Platform.
|
|
49
50
|
*/
|
|
50
51
|
export const Types: Story = {
|
|
51
52
|
argTypes: {
|
|
@@ -59,9 +60,6 @@ export const Types: Story = {
|
|
|
59
60
|
alignItems: 'center',
|
|
60
61
|
padding: '2rem',
|
|
61
62
|
borderRadius: '8px',
|
|
62
|
-
...(args.inverse
|
|
63
|
-
? { backgroundColor: 'var(--color-background-screen-dark, #0e0f0c)' }
|
|
64
|
-
: {}),
|
|
65
63
|
}}
|
|
66
64
|
>
|
|
67
65
|
{Object.values(LogoType).map((type) => (
|
|
@@ -75,14 +73,6 @@ export const Types: Story = {
|
|
|
75
73
|
}}
|
|
76
74
|
>
|
|
77
75
|
<Logo {...args} type={type} />
|
|
78
|
-
<span
|
|
79
|
-
style={{
|
|
80
|
-
fontSize: '12px',
|
|
81
|
-
...(args.inverse ? { color: 'rgba(255,255,255,0.6)' } : { opacity: 0.6 }),
|
|
82
|
-
}}
|
|
83
|
-
>
|
|
84
|
-
{type}
|
|
85
|
-
</span>
|
|
86
76
|
</div>
|
|
87
77
|
))}
|
|
88
78
|
</div>
|
|
@@ -99,99 +89,137 @@ export const Types: Story = {
|
|
|
99
89
|
};
|
|
100
90
|
|
|
101
91
|
/**
|
|
102
|
-
*
|
|
92
|
+
* The `format="primary-lockup"` variant shows the product name inline alongside the wordmark.
|
|
103
93
|
*/
|
|
104
|
-
export const
|
|
94
|
+
export const PrimaryLockup: Story = {
|
|
105
95
|
argTypes: {
|
|
106
96
|
type: { table: { disable: true } },
|
|
107
|
-
|
|
97
|
+
format: { table: { disable: true } },
|
|
108
98
|
},
|
|
109
99
|
render: (args) => (
|
|
110
|
-
<div style={{ display: 'flex',
|
|
111
|
-
|
|
112
|
-
<
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
))}
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
|
-
<div>
|
|
127
|
-
<span style={{ fontSize: '12px', opacity: 0.6, display: 'block', marginBottom: '0.5rem' }}>
|
|
128
|
-
{'\u2265 576px (full wordmark)'}
|
|
129
|
-
</span>
|
|
130
|
-
<div style={{ display: 'flex', gap: '3rem', alignItems: 'center' }}>
|
|
131
|
-
{Object.values(LogoType).map((type) => (
|
|
132
|
-
<Logo key={type} type={type} />
|
|
133
|
-
))}
|
|
100
|
+
<div style={{ display: 'flex', gap: '3rem', alignItems: 'center', padding: '2rem' }}>
|
|
101
|
+
{Object.values(LogoType).map((type) => (
|
|
102
|
+
<div key={type} style={{ display: 'flex', gap: '3rem', alignItems: 'center' }}>
|
|
103
|
+
<div
|
|
104
|
+
style={{
|
|
105
|
+
display: 'flex',
|
|
106
|
+
flexDirection: 'column',
|
|
107
|
+
alignItems: 'center',
|
|
108
|
+
gap: '0.5rem',
|
|
109
|
+
}}
|
|
110
|
+
>
|
|
111
|
+
<Logo {...args} type={type} format="primary-lockup" />
|
|
112
|
+
</div>
|
|
134
113
|
</div>
|
|
135
|
-
|
|
114
|
+
))}
|
|
136
115
|
</div>
|
|
137
116
|
),
|
|
138
117
|
parameters: {
|
|
139
118
|
docs: {
|
|
140
|
-
source: {
|
|
119
|
+
source: {
|
|
120
|
+
code: `<Logo type="WISE" format="primary-lockup" />
|
|
121
|
+
<Logo type="WISE_BUSINESS" format="primary-lockup" />
|
|
122
|
+
<Logo type="WISE_PLATFORM" format="primary-lockup" />`,
|
|
123
|
+
},
|
|
141
124
|
},
|
|
142
125
|
},
|
|
143
126
|
};
|
|
144
127
|
|
|
145
128
|
/**
|
|
146
|
-
*
|
|
147
|
-
* light-coloured version suited for dark surfaces.
|
|
129
|
+
* The `format="secondary-lockup"` variant uses a stacked two-line layout with the product name.
|
|
148
130
|
*/
|
|
149
|
-
export const
|
|
131
|
+
export const SecondaryLockup: Story = {
|
|
150
132
|
argTypes: {
|
|
151
133
|
type: { table: { disable: true } },
|
|
152
|
-
|
|
134
|
+
format: { table: { disable: true } },
|
|
153
135
|
},
|
|
154
|
-
decorators: [
|
|
155
|
-
(Story) => (
|
|
156
|
-
<div
|
|
157
|
-
style={{
|
|
158
|
-
display: 'flex',
|
|
159
|
-
gap: '3rem',
|
|
160
|
-
alignItems: 'center',
|
|
161
|
-
backgroundColor: 'var(--color-background-screen-dark, #0e0f0c)',
|
|
162
|
-
padding: '2rem',
|
|
163
|
-
borderRadius: '8px',
|
|
164
|
-
}}
|
|
165
|
-
>
|
|
166
|
-
<Story />
|
|
167
|
-
</div>
|
|
168
|
-
),
|
|
169
|
-
],
|
|
170
136
|
render: (args) => (
|
|
171
|
-
|
|
137
|
+
<div style={{ display: 'flex', gap: '3rem', alignItems: 'flex-end', padding: '2rem' }}>
|
|
138
|
+
{Object.values(LogoType).map((type) => (
|
|
139
|
+
<div key={type} style={{ display: 'flex', gap: '3rem', alignItems: 'flex-end' }}>
|
|
140
|
+
<div
|
|
141
|
+
style={{
|
|
142
|
+
display: 'flex',
|
|
143
|
+
flexDirection: 'column',
|
|
144
|
+
alignItems: 'center',
|
|
145
|
+
gap: '0.5rem',
|
|
146
|
+
}}
|
|
147
|
+
>
|
|
148
|
+
<Logo {...args} type={type} format="secondary-lockup" />
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
))}
|
|
152
|
+
</div>
|
|
153
|
+
),
|
|
154
|
+
parameters: {
|
|
155
|
+
docs: {
|
|
156
|
+
source: {
|
|
157
|
+
code: `<Logo type="WISE" format="secondary-lockup" />
|
|
158
|
+
<Logo type="WISE_BUSINESS" format="secondary-lockup" />
|
|
159
|
+
<Logo type="WISE_PLATFORM" format="secondary-lockup" />`,
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* When `display` is `"compact"`, only the fast-flag mark is rendered regardless of type or other settings.
|
|
167
|
+
*/
|
|
168
|
+
export const Compact: Story = {
|
|
169
|
+
render: (args) => (
|
|
170
|
+
<div style={{ display: 'flex', gap: '3rem', alignItems: 'center', padding: '2rem' }}>
|
|
172
171
|
{Object.values(LogoType).map((type) => (
|
|
173
172
|
<div
|
|
174
173
|
key={type}
|
|
175
|
-
style={{
|
|
176
|
-
display: 'flex',
|
|
177
|
-
flexDirection: 'column',
|
|
178
|
-
alignItems: 'center',
|
|
179
|
-
gap: '0.5rem',
|
|
180
|
-
}}
|
|
174
|
+
style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '0.5rem' }}
|
|
181
175
|
>
|
|
182
|
-
<Logo type={type}
|
|
183
|
-
<
|
|
176
|
+
<Logo {...args} type={type} format="primary-lockup" display="compact" />
|
|
177
|
+
<Logo {...args} type={type} format="secondary-lockup" display="compact" />
|
|
184
178
|
</div>
|
|
185
179
|
))}
|
|
186
|
-
|
|
180
|
+
</div>
|
|
187
181
|
),
|
|
188
182
|
parameters: {
|
|
189
183
|
docs: {
|
|
190
184
|
source: {
|
|
191
|
-
code: `<Logo type="
|
|
192
|
-
<Logo type="
|
|
193
|
-
<Logo type="WISE_PLATFORM" inverse />`,
|
|
185
|
+
code: `<Logo type=".." format="primary-lockup" display="compact" />
|
|
186
|
+
<Logo type=".." format="secondary-lockup" display="compact" />`,
|
|
194
187
|
},
|
|
195
188
|
},
|
|
196
189
|
},
|
|
197
190
|
};
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* When `display` is `"full"`, the full wordmark/lockup is rendered regardless of screen width.
|
|
194
|
+
*/
|
|
195
|
+
export const Full: Story = {
|
|
196
|
+
render: (args) => (
|
|
197
|
+
<div style={{ display: 'flex', gap: '3rem', alignItems: 'flex-end', padding: '2rem' }}>
|
|
198
|
+
{Object.values(LogoType).map((type) => (
|
|
199
|
+
<div key={type} style={{ display: 'flex', gap: '3rem', alignItems: 'flex-end' }}>
|
|
200
|
+
<div
|
|
201
|
+
style={{
|
|
202
|
+
display: 'flex',
|
|
203
|
+
flexDirection: 'column',
|
|
204
|
+
alignItems: 'center',
|
|
205
|
+
gap: '0.5rem',
|
|
206
|
+
}}
|
|
207
|
+
>
|
|
208
|
+
<Logo {...args} type={type} format="primary-lockup" display="full" />
|
|
209
|
+
<Logo {...args} type={type} format="secondary-lockup" display="full" />
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
))}
|
|
213
|
+
</div>
|
|
214
|
+
),
|
|
215
|
+
...withVariantConfig(['mobile'], {
|
|
216
|
+
parameters: {
|
|
217
|
+
docs: {
|
|
218
|
+
source: {
|
|
219
|
+
code: `<Logo type=".." format="primary-lockup" display="full" />
|
|
220
|
+
<Logo type=".." format="secondary-lockup" display="full" />`,
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
}),
|
|
225
|
+
};
|
|
@@ -17,37 +17,28 @@ const AllVariants = () => (
|
|
|
17
17
|
<div style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}>
|
|
18
18
|
<div style={{ display: 'flex', gap: '2rem', alignItems: 'center' }}>
|
|
19
19
|
{Object.values(LogoType).map((type) => (
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
alignItems: 'center',
|
|
28
|
-
backgroundColor: 'var(--color-content-primary)',
|
|
29
|
-
padding: '1rem',
|
|
30
|
-
borderRadius: '8px',
|
|
31
|
-
}}
|
|
32
|
-
>
|
|
33
|
-
{Object.values(LogoType).map((type) => (
|
|
34
|
-
<Logo key={type} type={type} inverse />
|
|
20
|
+
<div key={type}>
|
|
21
|
+
<Logo type={type} className="d-block" format="primary-lockup" />
|
|
22
|
+
<Logo type={type} className="d-block" format="secondary-lockup" />
|
|
23
|
+
<Logo type={type} className="d-block" format="primary-lockup" display="compact" />
|
|
24
|
+
<Logo type={type} className="d-block" format="primary-lockup" display="full" />
|
|
25
|
+
<Logo type={type} className="d-block" format="primary-lockup" display="responsive" />
|
|
26
|
+
</div>
|
|
35
27
|
))}
|
|
36
28
|
</div>
|
|
37
29
|
</div>
|
|
38
30
|
);
|
|
39
31
|
|
|
40
|
-
export const
|
|
41
|
-
render: () => <AllVariants />,
|
|
42
|
-
...withVariantConfig(['default', 'dark', 'bright-green', 'forest-green']),
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const RTL: Story = {
|
|
32
|
+
export const Themes: Story = {
|
|
46
33
|
render: () => <AllVariants />,
|
|
47
|
-
...withVariantConfig(['
|
|
34
|
+
...withVariantConfig(['default', 'dark', 'bright-green', 'forest-green'], {
|
|
35
|
+
parameters: {
|
|
36
|
+
padding: '',
|
|
37
|
+
},
|
|
38
|
+
}),
|
|
48
39
|
};
|
|
49
40
|
|
|
50
|
-
export const
|
|
41
|
+
export const Responsive: Story = {
|
|
51
42
|
render: () => <AllVariants />,
|
|
52
|
-
...withVariantConfig(['
|
|
43
|
+
...withVariantConfig(['mobile']),
|
|
53
44
|
};
|
package/src/logo/Logo.tsx
CHANGED
|
@@ -1,28 +1,18 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
LogoFlagPlatformInverse,
|
|
4
|
+
WiseLogo,
|
|
5
|
+
WiseBusinessPrimary,
|
|
6
|
+
WiseBusinessSecondary,
|
|
7
|
+
WisePlatformPrimary,
|
|
8
|
+
WisePlatformSecondary,
|
|
9
|
+
FastFlag,
|
|
10
|
+
logoAssetsDimensions,
|
|
12
11
|
} from './logo-assets';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
WISE_INVERSE: LogoWiseInverse,
|
|
18
|
-
WISE_BUSINESS_INVERSE: LogoWiseInverse,
|
|
19
|
-
WISE_PLATFORM: LogoWisePlatform,
|
|
20
|
-
WISE_PLATFORM_INVERSE: LogoWisePlatformInverse,
|
|
21
|
-
WISE_FLAG: LogoFlag,
|
|
22
|
-
WISE_FLAG_INVERSE: LogoFlagInverse,
|
|
23
|
-
WISE_FLAG_PLATFORM: LogoFlagPlatform,
|
|
24
|
-
WISE_FLAG_PLATFORM_INVERSE: LogoFlagPlatformInverse,
|
|
25
|
-
};
|
|
12
|
+
import type { LogoAssetName } from './logo-assets';
|
|
13
|
+
import { Breakpoint } from '../common';
|
|
14
|
+
import { useScreenSize } from '../common/hooks/useScreenSize';
|
|
15
|
+
import { AriaAttributes } from 'react';
|
|
26
16
|
|
|
27
17
|
export enum LogoType {
|
|
28
18
|
WISE = 'WISE',
|
|
@@ -30,12 +20,25 @@ export enum LogoType {
|
|
|
30
20
|
WISE_PLATFORM = 'WISE_PLATFORM',
|
|
31
21
|
}
|
|
32
22
|
|
|
23
|
+
export enum LogoDisplay {
|
|
24
|
+
RESPONSIVE = 'responsive',
|
|
25
|
+
COMPACT = 'compact',
|
|
26
|
+
FULL = 'full',
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export enum LogoFormat {
|
|
30
|
+
DEFAULT = 'default',
|
|
31
|
+
PRIMARY_LOCKUP = 'primary-lockup',
|
|
32
|
+
SECONDARY_LOCKUP = 'secondary-lockup',
|
|
33
|
+
}
|
|
34
|
+
|
|
33
35
|
export interface LogoProps {
|
|
34
36
|
/** Extra classes applied to Logo */
|
|
35
37
|
className?: string;
|
|
36
38
|
/**
|
|
37
39
|
* Renders a light-coloured version suited for dark backgrounds.
|
|
38
40
|
* @default false
|
|
41
|
+
* @deprecated dark mode comes out of the box, this property has no effect
|
|
39
42
|
*/
|
|
40
43
|
inverse?: boolean;
|
|
41
44
|
/**
|
|
@@ -43,6 +46,26 @@ export interface LogoProps {
|
|
|
43
46
|
* @default 'WISE'
|
|
44
47
|
*/
|
|
45
48
|
type?: `${LogoType}`;
|
|
49
|
+
/**
|
|
50
|
+
* Controls which logo variant is shown.
|
|
51
|
+
* - `"responsive"` (default): full wordmark on large screens, fast-flag mark on small screens (<600 px).
|
|
52
|
+
* - `"compact"`: always renders the fast-flag mark regardless of screen size.
|
|
53
|
+
* - `"full"`: always renders the full wordmark/lockup regardless of screen size.
|
|
54
|
+
* @default 'responsive'
|
|
55
|
+
*/
|
|
56
|
+
display?: `${LogoDisplay}`;
|
|
57
|
+
/**
|
|
58
|
+
* Controls the format of the logo.
|
|
59
|
+
* - `"default"`: plain Wise wordmark, no product name.
|
|
60
|
+
* - `"primary-lockup"`: product name shown inline alongside the wordmark.
|
|
61
|
+
* - `"secondary-lockup"`: stacked (two-line) variant with the product name.
|
|
62
|
+
* @default 'default'
|
|
63
|
+
*/
|
|
64
|
+
format?: `${LogoFormat}`;
|
|
65
|
+
/**
|
|
66
|
+
* Override default ({@link labelByType}) screen reader messages
|
|
67
|
+
*/
|
|
68
|
+
'aria-label'?: AriaAttributes['aria-label'];
|
|
46
69
|
}
|
|
47
70
|
|
|
48
71
|
const labelByType = {
|
|
@@ -51,21 +74,60 @@ const labelByType = {
|
|
|
51
74
|
WISE_PLATFORM: 'Wise Platform',
|
|
52
75
|
} satisfies Record<`${LogoType}`, string>;
|
|
53
76
|
|
|
77
|
+
const logoAssets: Record<LogoAssetName, () => JSX.Element> = {
|
|
78
|
+
FastFlag,
|
|
79
|
+
WiseLogo,
|
|
80
|
+
WiseBusinessPrimary,
|
|
81
|
+
WiseBusinessSecondary,
|
|
82
|
+
WisePlatformPrimary,
|
|
83
|
+
WisePlatformSecondary,
|
|
84
|
+
};
|
|
85
|
+
|
|
54
86
|
/**
|
|
55
87
|
* Renders the Wise wordmark logo. Responsive — shows the flag-only mark on small viewports
|
|
56
88
|
* and the full wordmark on ≥576px (small breakpoint and above).
|
|
57
89
|
*
|
|
58
90
|
* @see {@link https://wise.design/foundations/logo Design Spec}
|
|
59
91
|
*/
|
|
60
|
-
export default function Logo({
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
92
|
+
export default function Logo({
|
|
93
|
+
className,
|
|
94
|
+
type = 'WISE',
|
|
95
|
+
format = 'default',
|
|
96
|
+
display = 'responsive',
|
|
97
|
+
'aria-label': ariaLabel,
|
|
98
|
+
}: LogoProps) {
|
|
99
|
+
const isScreenSm = !useScreenSize(Breakpoint.SMALL);
|
|
100
|
+
const compact = display === 'compact' || (display === 'responsive' && isScreenSm);
|
|
101
|
+
|
|
102
|
+
const assetName = compact ? 'FastFlag' : getAssetName(type, format);
|
|
103
|
+
const Asset = logoAssets[assetName];
|
|
104
|
+
const { width, height } = logoAssetsDimensions[assetName];
|
|
64
105
|
|
|
65
106
|
return (
|
|
66
|
-
<span
|
|
67
|
-
|
|
68
|
-
|
|
107
|
+
<span
|
|
108
|
+
className={clsx('np-logo', className)}
|
|
109
|
+
role="img"
|
|
110
|
+
aria-label={ariaLabel ?? labelByType[type]}
|
|
111
|
+
style={
|
|
112
|
+
{
|
|
113
|
+
'--wds-logo-width': `${width}px`,
|
|
114
|
+
'--wds-logo-height': `${height}px`,
|
|
115
|
+
} as React.CSSProperties
|
|
116
|
+
}
|
|
117
|
+
>
|
|
118
|
+
<Asset />
|
|
69
119
|
</span>
|
|
70
120
|
);
|
|
71
121
|
}
|
|
122
|
+
|
|
123
|
+
function getAssetName(type: `${LogoType}`, format: `${LogoFormat}`): LogoAssetName {
|
|
124
|
+
if (format !== 'default') {
|
|
125
|
+
if (type === 'WISE_BUSINESS') {
|
|
126
|
+
return format === 'secondary-lockup' ? 'WiseBusinessSecondary' : 'WiseBusinessPrimary';
|
|
127
|
+
}
|
|
128
|
+
if (type === 'WISE_PLATFORM') {
|
|
129
|
+
return format === 'secondary-lockup' ? 'WisePlatformSecondary' : 'WisePlatformPrimary';
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return 'WiseLogo';
|
|
133
|
+
}
|