@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.
Files changed (264) hide show
  1. package/build/common/hooks/useContainerSize.js +30 -0
  2. package/build/common/hooks/useContainerSize.js.map +1 -0
  3. package/build/common/hooks/useContainerSize.mjs +28 -0
  4. package/build/common/hooks/useContainerSize.mjs.map +1 -0
  5. package/build/common/hooks/useResizeObserver.js +3 -3
  6. package/build/common/hooks/useResizeObserver.js.map +1 -1
  7. package/build/common/hooks/useResizeObserver.mjs +3 -3
  8. package/build/common/hooks/useResizeObserver.mjs.map +1 -1
  9. package/build/criticalBanner/CriticalCommsBanner.js +3 -0
  10. package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
  11. package/build/criticalBanner/CriticalCommsBanner.mjs +3 -0
  12. package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
  13. package/build/field/Field.js +3 -2
  14. package/build/field/Field.js.map +1 -1
  15. package/build/field/Field.mjs +3 -2
  16. package/build/field/Field.mjs.map +1 -1
  17. package/build/i18n/cs.json +2 -0
  18. package/build/i18n/cs.json.js +2 -0
  19. package/build/i18n/cs.json.js.map +1 -1
  20. package/build/i18n/cs.json.mjs +2 -0
  21. package/build/i18n/cs.json.mjs.map +1 -1
  22. package/build/i18n/de.json +2 -0
  23. package/build/i18n/de.json.js +2 -0
  24. package/build/i18n/de.json.js.map +1 -1
  25. package/build/i18n/de.json.mjs +2 -0
  26. package/build/i18n/de.json.mjs.map +1 -1
  27. package/build/i18n/en.json +2 -0
  28. package/build/i18n/en.json.js +2 -0
  29. package/build/i18n/en.json.js.map +1 -1
  30. package/build/i18n/en.json.mjs +2 -0
  31. package/build/i18n/en.json.mjs.map +1 -1
  32. package/build/i18n/es.json +2 -0
  33. package/build/i18n/es.json.js +2 -0
  34. package/build/i18n/es.json.js.map +1 -1
  35. package/build/i18n/es.json.mjs +2 -0
  36. package/build/i18n/es.json.mjs.map +1 -1
  37. package/build/i18n/fr.json +2 -0
  38. package/build/i18n/fr.json.js +2 -0
  39. package/build/i18n/fr.json.js.map +1 -1
  40. package/build/i18n/fr.json.mjs +2 -0
  41. package/build/i18n/fr.json.mjs.map +1 -1
  42. package/build/i18n/hu.json +2 -0
  43. package/build/i18n/hu.json.js +2 -0
  44. package/build/i18n/hu.json.js.map +1 -1
  45. package/build/i18n/hu.json.mjs +2 -0
  46. package/build/i18n/hu.json.mjs.map +1 -1
  47. package/build/i18n/id.json +2 -0
  48. package/build/i18n/id.json.js +2 -0
  49. package/build/i18n/id.json.js.map +1 -1
  50. package/build/i18n/id.json.mjs +2 -0
  51. package/build/i18n/id.json.mjs.map +1 -1
  52. package/build/i18n/it.json +2 -0
  53. package/build/i18n/it.json.js +2 -0
  54. package/build/i18n/it.json.js.map +1 -1
  55. package/build/i18n/it.json.mjs +2 -0
  56. package/build/i18n/it.json.mjs.map +1 -1
  57. package/build/i18n/ja.json +2 -0
  58. package/build/i18n/ja.json.js +2 -0
  59. package/build/i18n/ja.json.js.map +1 -1
  60. package/build/i18n/ja.json.mjs +2 -0
  61. package/build/i18n/ja.json.mjs.map +1 -1
  62. package/build/i18n/nl.json +2 -0
  63. package/build/i18n/nl.json.js +2 -0
  64. package/build/i18n/nl.json.js.map +1 -1
  65. package/build/i18n/nl.json.mjs +2 -0
  66. package/build/i18n/nl.json.mjs.map +1 -1
  67. package/build/i18n/pl.json +2 -0
  68. package/build/i18n/pl.json.js +2 -0
  69. package/build/i18n/pl.json.js.map +1 -1
  70. package/build/i18n/pl.json.mjs +2 -0
  71. package/build/i18n/pl.json.mjs.map +1 -1
  72. package/build/i18n/pt.json +2 -0
  73. package/build/i18n/pt.json.js +2 -0
  74. package/build/i18n/pt.json.js.map +1 -1
  75. package/build/i18n/pt.json.mjs +2 -0
  76. package/build/i18n/pt.json.mjs.map +1 -1
  77. package/build/i18n/ro.json +2 -0
  78. package/build/i18n/ro.json.js +2 -0
  79. package/build/i18n/ro.json.js.map +1 -1
  80. package/build/i18n/ro.json.mjs +2 -0
  81. package/build/i18n/ro.json.mjs.map +1 -1
  82. package/build/i18n/ru.json +2 -0
  83. package/build/i18n/ru.json.js +2 -0
  84. package/build/i18n/ru.json.js.map +1 -1
  85. package/build/i18n/ru.json.mjs +2 -0
  86. package/build/i18n/ru.json.mjs.map +1 -1
  87. package/build/i18n/th.json +2 -0
  88. package/build/i18n/th.json.js +2 -0
  89. package/build/i18n/th.json.js.map +1 -1
  90. package/build/i18n/th.json.mjs +2 -0
  91. package/build/i18n/th.json.mjs.map +1 -1
  92. package/build/i18n/tr.json +2 -0
  93. package/build/i18n/tr.json.js +2 -0
  94. package/build/i18n/tr.json.js.map +1 -1
  95. package/build/i18n/tr.json.mjs +2 -0
  96. package/build/i18n/tr.json.mjs.map +1 -1
  97. package/build/i18n/zh-CN.json +2 -0
  98. package/build/i18n/zh-CN.json.js +2 -0
  99. package/build/i18n/zh-CN.json.js.map +1 -1
  100. package/build/i18n/zh-CN.json.mjs +2 -0
  101. package/build/i18n/zh-CN.json.mjs.map +1 -1
  102. package/build/i18n/zh-HK.json +2 -0
  103. package/build/i18n/zh-HK.json.js +2 -0
  104. package/build/i18n/zh-HK.json.js.map +1 -1
  105. package/build/i18n/zh-HK.json.mjs +2 -0
  106. package/build/i18n/zh-HK.json.mjs.map +1 -1
  107. package/build/index.js +2 -0
  108. package/build/index.js.map +1 -1
  109. package/build/index.mjs +1 -0
  110. package/build/index.mjs.map +1 -1
  111. package/build/listItem/Prompt/ListItemPrompt.js +3 -2
  112. package/build/listItem/Prompt/ListItemPrompt.js.map +1 -1
  113. package/build/listItem/Prompt/ListItemPrompt.mjs +3 -2
  114. package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -1
  115. package/build/logo/Logo.js +77 -25
  116. package/build/logo/Logo.js.map +1 -1
  117. package/build/logo/Logo.mjs +79 -27
  118. package/build/logo/Logo.mjs.map +1 -1
  119. package/build/logo/logo-assets.js +68 -97
  120. package/build/logo/logo-assets.js.map +1 -1
  121. package/build/logo/logo-assets.mjs +62 -90
  122. package/build/logo/logo-assets.mjs.map +1 -1
  123. package/build/main.css +225 -59
  124. package/build/prompt/ActionPrompt/ActionPrompt.js +8 -40
  125. package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
  126. package/build/prompt/ActionPrompt/ActionPrompt.mjs +8 -40
  127. package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
  128. package/build/prompt/CriticalBanner/CriticalBanner.js +143 -0
  129. package/build/prompt/CriticalBanner/CriticalBanner.js.map +1 -0
  130. package/build/prompt/CriticalBanner/CriticalBanner.mjs +141 -0
  131. package/build/prompt/CriticalBanner/CriticalBanner.mjs.map +1 -0
  132. package/build/prompt/CriticalBanner/helpers.js +29 -0
  133. package/build/prompt/CriticalBanner/helpers.js.map +1 -0
  134. package/build/prompt/CriticalBanner/helpers.mjs +26 -0
  135. package/build/prompt/CriticalBanner/helpers.mjs.map +1 -0
  136. package/build/prompt/InfoPrompt/InfoPrompt.js +3 -2
  137. package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
  138. package/build/prompt/InfoPrompt/InfoPrompt.mjs +3 -2
  139. package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
  140. package/build/prompt/PrimitivePrompt/PrimitivePrompt.js +11 -4
  141. package/build/prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -1
  142. package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs +11 -4
  143. package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -1
  144. package/build/prompt/common/Expander/Expander.js +35 -0
  145. package/build/prompt/common/Expander/Expander.js.map +1 -0
  146. package/build/prompt/common/Expander/Expander.messages.js +17 -0
  147. package/build/prompt/common/Expander/Expander.messages.js.map +1 -0
  148. package/build/prompt/common/Expander/Expander.messages.mjs +13 -0
  149. package/build/prompt/common/Expander/Expander.messages.mjs.map +1 -0
  150. package/build/prompt/common/Expander/Expander.mjs +33 -0
  151. package/build/prompt/common/Expander/Expander.mjs.map +1 -0
  152. package/build/prompt/helpers/promptMedia.js +52 -0
  153. package/build/prompt/helpers/promptMedia.js.map +1 -0
  154. package/build/prompt/helpers/promptMedia.mjs +50 -0
  155. package/build/prompt/helpers/promptMedia.mjs.map +1 -0
  156. package/build/styles/css/neptune.css +0 -1
  157. package/build/styles/logo/Logo.css +3 -23
  158. package/build/styles/main.css +225 -59
  159. package/build/styles/prompt/CriticalBanner/CriticalBanner.css +134 -0
  160. package/build/styles/prompt/CriticalBanner/CriticalBanner.vars.css +0 -0
  161. package/build/styles/prompt/InfoPrompt/InfoPrompt.css +24 -0
  162. package/build/styles/prompt/common/Expander/Expander.css +8 -0
  163. package/build/styles/styles/less/neptune.css +0 -1
  164. package/build/typeahead/Typeahead.js +3 -2
  165. package/build/typeahead/Typeahead.js.map +1 -1
  166. package/build/typeahead/Typeahead.mjs +3 -2
  167. package/build/typeahead/Typeahead.mjs.map +1 -1
  168. package/build/types/common/hooks/useContainerSize.d.ts +14 -0
  169. package/build/types/common/hooks/useContainerSize.d.ts.map +1 -0
  170. package/build/types/common/hooks/useResizeObserver.d.ts +1 -1
  171. package/build/types/common/hooks/useResizeObserver.d.ts.map +1 -1
  172. package/build/types/criticalBanner/CriticalCommsBanner.d.ts +3 -0
  173. package/build/types/criticalBanner/CriticalCommsBanner.d.ts.map +1 -1
  174. package/build/types/index.d.ts +2 -2
  175. package/build/types/index.d.ts.map +1 -1
  176. package/build/types/logo/Logo.d.ts +33 -1
  177. package/build/types/logo/Logo.d.ts.map +1 -1
  178. package/build/types/logo/logo-assets.d.ts +33 -9
  179. package/build/types/logo/logo-assets.d.ts.map +1 -1
  180. package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts +2 -11
  181. package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts.map +1 -1
  182. package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts +39 -0
  183. package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts.map +1 -0
  184. package/build/types/prompt/CriticalBanner/helpers.d.ts +18 -0
  185. package/build/types/prompt/CriticalBanner/helpers.d.ts.map +1 -0
  186. package/build/types/prompt/CriticalBanner/index.d.ts +3 -0
  187. package/build/types/prompt/CriticalBanner/index.d.ts.map +1 -0
  188. package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts.map +1 -1
  189. package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts +35 -3
  190. package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -1
  191. package/build/types/prompt/common/Expander/Expander.d.ts +20 -0
  192. package/build/types/prompt/common/Expander/Expander.d.ts.map +1 -0
  193. package/build/types/prompt/common/Expander/Expander.messages.d.ts +14 -0
  194. package/build/types/prompt/common/Expander/Expander.messages.d.ts.map +1 -0
  195. package/build/types/prompt/helpers/promptMedia.d.ts +22 -0
  196. package/build/types/prompt/helpers/promptMedia.d.ts.map +1 -0
  197. package/build/types/prompt/index.d.ts +2 -0
  198. package/build/types/prompt/index.d.ts.map +1 -1
  199. package/build/types/test-utils/index.d.ts +4 -0
  200. package/build/types/test-utils/index.d.ts.map +1 -1
  201. package/package.json +22 -18
  202. package/src/alert/Alert.story.tsx +30 -1
  203. package/src/avatarWrapper/AvatarWrapper.story.tsx +1 -1
  204. package/src/button/_stories/Button.story.tsx +11 -0
  205. package/src/common/hooks/useContainerSize.test.tsx +125 -0
  206. package/src/common/hooks/useContainerSize.ts +32 -0
  207. package/src/common/hooks/useResizeObserver.ts +3 -2
  208. package/src/criticalBanner/CriticalCommsBanner.story.tsx +4 -0
  209. package/src/criticalBanner/CriticalCommsBanner.test.story.tsx +1 -1
  210. package/src/criticalBanner/CriticalCommsBanner.tsx +3 -0
  211. package/src/i18n/cs.json +2 -0
  212. package/src/i18n/de.json +2 -0
  213. package/src/i18n/en.json +2 -0
  214. package/src/i18n/es.json +2 -0
  215. package/src/i18n/fr.json +2 -0
  216. package/src/i18n/hu.json +2 -0
  217. package/src/i18n/id.json +2 -0
  218. package/src/i18n/it.json +2 -0
  219. package/src/i18n/ja.json +2 -0
  220. package/src/i18n/nl.json +2 -0
  221. package/src/i18n/pl.json +2 -0
  222. package/src/i18n/pt.json +2 -0
  223. package/src/i18n/ro.json +2 -0
  224. package/src/i18n/ru.json +2 -0
  225. package/src/i18n/th.json +2 -0
  226. package/src/i18n/tr.json +2 -0
  227. package/src/i18n/zh-CN.json +2 -0
  228. package/src/i18n/zh-HK.json +2 -0
  229. package/src/index.ts +2 -2
  230. package/src/logo/Logo.css +3 -23
  231. package/src/logo/Logo.less +3 -29
  232. package/src/logo/Logo.story.tsx +117 -89
  233. package/src/logo/Logo.test.story.tsx +15 -24
  234. package/src/logo/Logo.tsx +90 -28
  235. package/src/logo/logo-assets.tsx +36 -92
  236. package/src/main.css +225 -59
  237. package/src/main.less +3 -1
  238. package/src/prompt/ActionPrompt/ActionPrompt.tsx +9 -62
  239. package/src/prompt/CriticalBanner/CriticalBanner.accessibility.docs.mdx +113 -0
  240. package/src/prompt/CriticalBanner/CriticalBanner.css +134 -0
  241. package/src/prompt/CriticalBanner/CriticalBanner.less +155 -0
  242. package/src/prompt/CriticalBanner/CriticalBanner.story.tsx +635 -0
  243. package/src/prompt/CriticalBanner/CriticalBanner.test.story.tsx +422 -0
  244. package/src/prompt/CriticalBanner/CriticalBanner.tsx +179 -0
  245. package/src/prompt/CriticalBanner/CriticalBanner.vars.css +0 -0
  246. package/src/prompt/CriticalBanner/CriticalBanner.vars.less +6 -0
  247. package/src/prompt/CriticalBanner/helpers.ts +39 -0
  248. package/src/prompt/CriticalBanner/index.ts +2 -0
  249. package/src/prompt/InfoPrompt/InfoPrompt.css +24 -0
  250. package/src/prompt/InfoPrompt/InfoPrompt.less +23 -0
  251. package/src/prompt/InfoPrompt/InfoPrompt.tsx +5 -1
  252. package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +56 -40
  253. package/src/prompt/common/Expander/Expander.css +8 -0
  254. package/src/prompt/common/Expander/Expander.less +9 -0
  255. package/src/prompt/common/Expander/Expander.messages.ts +14 -0
  256. package/src/prompt/common/Expander/Expander.test.tsx +167 -0
  257. package/src/prompt/common/Expander/Expander.tsx +83 -0
  258. package/src/prompt/helpers/promptMedia.tsx +79 -0
  259. package/src/prompt/index.ts +4 -0
  260. package/src/radio/Radio.story.tsx +1 -1
  261. package/src/section/Section.story.tsx +2 -8
  262. package/src/sentimentSurface/SentimentSurface.story.tsx +43 -17
  263. package/src/statusIcon/StatusIcon.test.tsx +0 -2
  264. package/src/styles/less/neptune.css +0 -1
@@ -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
- render: (args) => (
33
- <div
34
- style={{
35
- padding: '2rem',
36
- ...(args.inverse
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. <br />
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
- * Below `576px` the flag-only mark is shown; at `576px` and above the full wordmark is displayed.
92
+ * The `format="primary-lockup"` variant shows the product name inline alongside the wordmark.
103
93
  */
104
- export const Responsive: Story = {
94
+ export const PrimaryLockup: Story = {
105
95
  argTypes: {
106
96
  type: { table: { disable: true } },
107
- inverse: { table: { disable: true } },
97
+ format: { table: { disable: true } },
108
98
  },
109
99
  render: (args) => (
110
- <div style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}>
111
- <div>
112
- <span style={{ fontSize: '12px', opacity: 0.6, display: 'block', marginBottom: '0.5rem' }}>
113
- {'< 576px (flag only)'}
114
- </span>
115
- <div style={{ display: 'flex', gap: '3rem', alignItems: 'center' }}>
116
- {Object.values(LogoType).map((type) => (
117
- <span key={type} className="np-logo" style={{ display: 'inline-block' }}>
118
- <style>{`.responsive-sm .np-logo-svg--size-md { display: none !important; } .responsive-sm .np-logo-svg--size-sm { display: block !important; }`}</style>
119
- <span className="responsive-sm">
120
- <Logo type={type} />
121
- </span>
122
- </span>
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
- </div>
114
+ ))}
136
115
  </div>
137
116
  ),
138
117
  parameters: {
139
118
  docs: {
140
- source: { code: null },
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
- * All logo types on a dark background using the `inverse` prop, which renders a
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 Inverse: Story = {
131
+ export const SecondaryLockup: Story = {
150
132
  argTypes: {
151
133
  type: { table: { disable: true } },
152
- inverse: { table: { disable: true } },
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} inverse />
183
- <span style={{ fontSize: '12px', color: 'rgba(255,255,255,0.6)' }}>{type}</span>
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="WISE" inverse />
192
- <Logo type="WISE_BUSINESS" inverse />
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
- <Logo key={type} type={type} />
21
- ))}
22
- </div>
23
- <div
24
- style={{
25
- display: 'flex',
26
- gap: '2rem',
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 Variants: Story = {
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(['rtl']),
34
+ ...withVariantConfig(['default', 'dark', 'bright-green', 'forest-green'], {
35
+ parameters: {
36
+ padding: '',
37
+ },
38
+ }),
48
39
  };
49
40
 
50
- export const Zoom400: Story = {
41
+ export const Responsive: Story = {
51
42
  render: () => <AllVariants />,
52
- ...withVariantConfig(['400%']),
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
- LogoWise,
5
- LogoWiseInverse,
6
- LogoWisePlatform,
7
- LogoWisePlatformInverse,
8
- LogoFlag,
9
- LogoFlagInverse,
10
- LogoFlagPlatform,
11
- LogoFlagPlatformInverse,
4
+ WiseLogo,
5
+ WiseBusinessPrimary,
6
+ WiseBusinessSecondary,
7
+ WisePlatformPrimary,
8
+ WisePlatformSecondary,
9
+ FastFlag,
10
+ logoAssetsDimensions,
12
11
  } from './logo-assets';
13
-
14
- const svgPaths = {
15
- WISE: LogoWise,
16
- WISE_BUSINESS: LogoWise,
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({ className, inverse, type = 'WISE' }: LogoProps) {
61
- const LogoSm =
62
- svgPaths[`WISE_FLAG${type === 'WISE_PLATFORM' ? '_PLATFORM' : ''}${inverse ? '_INVERSE' : ''}`];
63
- const LogoMd = svgPaths[`${type}${inverse ? '_INVERSE' : ''}`];
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 aria-label={labelByType[type]} role="img" className={clsx(className, 'np-logo')}>
67
- <LogoSm className="np-logo-svg np-logo-svg--size-sm" />
68
- <LogoMd className="np-logo-svg np-logo-svg--size-md" />
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
+ }