@transferwise/components 0.0.0-experimental-416f4de → 0.0.0-experimental-238cf3d

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.
@@ -1,21 +1,14 @@
1
- import { AriaAttributes } from 'react';
2
1
  export declare enum LogoType {
3
2
  WISE = "WISE",
4
3
  WISE_BUSINESS = "WISE_BUSINESS",
5
4
  WISE_PLATFORM = "WISE_PLATFORM"
6
5
  }
7
- export declare enum LogoDisplay {
8
- RESPONSIVE = "responsive",
9
- COMPACT = "compact",
10
- FULL = "full"
11
- }
12
6
  export interface LogoProps {
13
7
  /** Extra classes applied to Logo */
14
8
  className?: string;
15
9
  /**
16
10
  * Renders a light-coloured version suited for dark backgrounds.
17
11
  * @default false
18
- * @deprecated dark mode comes out of the box, this property has no effect
19
12
  */
20
13
  inverse?: boolean;
21
14
  /**
@@ -23,28 +16,6 @@ export interface LogoProps {
23
16
  * @default 'WISE'
24
17
  */
25
18
  type?: `${LogoType}`;
26
- /**
27
- * Controls which logo variant is shown.
28
- * - `"responsive"` (default): full wordmark on large screens, fast-flag mark on small screens (<600 px).
29
- * - `"compact"`: always renders the fast-flag mark regardless of screen size.
30
- * - `"full"`: always renders the full wordmark/lockup regardless of screen size.
31
- * @default 'responsive'
32
- */
33
- display?: `${LogoDisplay}`;
34
- /**
35
- * Show the product name alongside the Wise wordmark (e.g. "Wise Business", "Wise Platform").
36
- * @default false
37
- */
38
- lockup?: boolean;
39
- /**
40
- * Use the stacked (two-line) logo variant. Requires `lockup` to be true.
41
- * @default false
42
- */
43
- secondary?: boolean;
44
- /**
45
- * Override default ({@link labelByType}) screen reader messages
46
- */
47
- 'aria-label'?: AriaAttributes['aria-label'];
48
19
  }
49
20
  /**
50
21
  * Renders the Wise wordmark logo. Responsive — shows the flag-only mark on small viewports
@@ -52,5 +23,5 @@ export interface LogoProps {
52
23
  *
53
24
  * @see {@link https://wise.design/foundations/logo Design Spec}
54
25
  */
55
- export default function Logo({ className, type, lockup, secondary, display, 'aria-label': ariaLabel, }: LogoProps): import("react").JSX.Element;
26
+ export default function Logo({ className, inverse, type }: LogoProps): import("react").JSX.Element;
56
27
  //# sourceMappingURL=Logo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Logo.d.ts","sourceRoot":"","sources":["../../../src/logo/Logo.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;CAChC;AAED,oBAAY,WAAW;IACrB,UAAU,eAAe;IACzB,OAAO,YAAY;IACnB,IAAI,SAAS;CACd;AAED,MAAM,WAAW,SAAS;IACxB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,GAAG,QAAQ,EAAE,CAAC;IACrB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,GAAG,WAAW,EAAE,CAAC;IAC3B;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,YAAY,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;CAC7C;AAiBD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAC3B,SAAS,EACT,IAAa,EACb,MAAc,EACd,SAAiB,EACjB,OAAsB,EACtB,YAAY,EAAE,SAAS,GACxB,EAAE,SAAS,+BAuBX"}
1
+ {"version":3,"file":"Logo.d.ts","sourceRoot":"","sources":["../../../src/logo/Logo.tsx"],"names":[],"mappings":"AA0BA,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;CAChC;AAED,MAAM,WAAW,SAAS;IACxB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,GAAG,QAAQ,EAAE,CAAC;CACtB;AAQD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAa,EAAE,EAAE,SAAS,+BAW5E"}
@@ -1,34 +1,10 @@
1
- export declare const logoAssetsDimensions: {
2
- readonly FastFlag: {
3
- readonly width: 22;
4
- readonly height: 24;
5
- };
6
- readonly WiseLogo: {
7
- readonly width: 94;
8
- readonly height: 24;
9
- };
10
- readonly WiseBusinessPrimary: {
11
- readonly width: 210;
12
- readonly height: 24;
13
- };
14
- readonly WiseBusinessSecondary: {
15
- readonly width: 97;
16
- readonly height: 46;
17
- };
18
- readonly WisePlatformPrimary: {
19
- readonly width: 205;
20
- readonly height: 24;
21
- };
22
- readonly WisePlatformSecondary: {
23
- readonly width: 94;
24
- readonly height: 46;
25
- };
26
- };
27
- export type LogoAssetName = keyof typeof logoAssetsDimensions;
28
- export declare function FastFlag(): import("react").JSX.Element;
29
- export declare function WiseLogo(): import("react").JSX.Element;
30
- export declare function WiseBusinessPrimary(): import("react").JSX.Element;
31
- export declare function WiseBusinessSecondary(): import("react").JSX.Element;
32
- export declare function WisePlatformPrimary(): import("react").JSX.Element;
33
- export declare function WisePlatformSecondary(): import("react").JSX.Element;
1
+ import { CommonProps } from '../common';
2
+ export declare function LogoFlagInverse({ className }: CommonProps): import("react").JSX.Element;
3
+ export declare function LogoFlagPlatformInverse({ className }: CommonProps): import("react").JSX.Element;
4
+ export declare function LogoFlagPlatform({ className }: CommonProps): import("react").JSX.Element;
5
+ export declare function LogoFlag({ className }: CommonProps): import("react").JSX.Element;
6
+ export declare function LogoWiseInverse({ className }: CommonProps): import("react").JSX.Element;
7
+ export declare function LogoWisePlatformInverse({ className }: CommonProps): import("react").JSX.Element;
8
+ export declare function LogoWisePlatform({ className }: CommonProps): import("react").JSX.Element;
9
+ export declare function LogoWise({ className }: CommonProps): import("react").JSX.Element;
34
10
  //# sourceMappingURL=logo-assets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logo-assets.d.ts","sourceRoot":"","sources":["../../../src/logo/logo-assets.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;CAOvB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,oBAAoB,CAAC;AAO9D,wBAAgB,QAAQ,gCASvB;AAED,wBAAgB,QAAQ,gCASvB;AAED,wBAAgB,mBAAmB,gCASlC;AAED,wBAAgB,qBAAqB,gCASpC;AAED,wBAAgB,mBAAmB,gCASlC;AAED,wBAAgB,qBAAqB,gCASpC"}
1
+ {"version":3,"file":"logo-assets.d.ts","sourceRoot":"","sources":["../../../src/logo/logo-assets.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,EAAE,WAAW,+BAezD;AAED,wBAAgB,uBAAuB,CAAC,EAAE,SAAS,EAAE,EAAE,WAAW,+BAejE;AAED,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,EAAE,WAAW,+BAe1D;AAED,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,EAAE,WAAW,+BAelD;AAED,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,EAAE,WAAW,+BAezD;AAED,wBAAgB,uBAAuB,CAAC,EAAE,SAAS,EAAE,EAAE,WAAW,+BAejE;AAED,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,EAAE,WAAW,+BAe1D;AAED,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,EAAE,WAAW,+BAelD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-416f4de",
3
+ "version": "0.0.0-experimental-238cf3d",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
package/src/logo/Logo.css CHANGED
@@ -1,6 +1,26 @@
1
1
  .np-logo {
2
2
  display: inline-block;
3
- color: var(--color-interactive-primary);
4
- width: var(--wds-logo-width);
5
- height: var(--wds-logo-height);
3
+ }
4
+ .np-theme-personal--forest-green .np-logo-svg path,
5
+ .np-theme-personal--bright-green .np-logo-svg path {
6
+ fill: var(--color-interactive-primary);
7
+ }
8
+ .np-theme-personal--dark .np-logo-svg path {
9
+ fill: var(--color-white);
10
+ }
11
+ .np-logo-svg--size-sm {
12
+ display: block;
13
+ }
14
+ @media (min-width: 576px) {
15
+ .np-logo-svg--size-sm {
16
+ display: none;
17
+ }
18
+ }
19
+ .np-logo-svg--size-md {
20
+ display: none;
21
+ }
22
+ @media (min-width: 576px) {
23
+ .np-logo-svg--size-md {
24
+ display: block;
25
+ }
6
26
  }
@@ -1,6 +1,32 @@
1
1
  .np-logo {
2
2
  display: inline-block;
3
- color: var(--color-interactive-primary);
4
- width: var(--wds-logo-width);
5
- height: var(--wds-logo-height);
3
+ }
4
+
5
+ .np-logo-svg {
6
+ path {
7
+ .np-theme-personal--forest-green &,
8
+ .np-theme-personal--bright-green & {
9
+ fill: var(--color-interactive-primary);
10
+ }
11
+
12
+ .np-theme-personal--dark & {
13
+ fill: var(--color-white);
14
+ }
15
+ }
16
+
17
+ &--size-sm {
18
+ display: block;
19
+
20
+ @media (--screen-sm) {
21
+ display: none;
22
+ }
23
+ }
24
+
25
+ &--size-md {
26
+ display: none;
27
+
28
+ @media (--screen-sm) {
29
+ display: block;
30
+ }
31
+ }
6
32
  }
@@ -1,7 +1,6 @@
1
1
  import { Meta, StoryObj } from '@storybook/react-webpack5';
2
2
 
3
- import Logo, { LogoType, LogoDisplay } from './Logo';
4
- import { withVariantConfig } from '../../.storybook/helpers';
3
+ import Logo, { LogoType } from '.';
5
4
 
6
5
  /**
7
6
  * **Design guidance**: <a href="https://wise.design/foundations/logo" target="_blank">wise.design/foundations/logo</a>
@@ -11,17 +10,13 @@ const meta: Meta<typeof Logo> = {
11
10
  title: 'Content/Logo',
12
11
  args: {
13
12
  type: 'WISE',
14
- secondary: false,
13
+ inverse: false,
15
14
  },
16
15
  argTypes: {
17
16
  type: {
18
17
  control: 'radio',
19
18
  options: Object.values(LogoType),
20
19
  },
21
- display: {
22
- control: 'radio',
23
- options: Object.values(LogoDisplay),
24
- },
25
20
  },
26
21
  parameters: {
27
22
  docs: { toc: true },
@@ -34,15 +29,23 @@ type Story = StoryObj<typeof Logo>;
34
29
 
35
30
  /** Explore all props via the controls panel. */
36
31
  export const Playground: Story = {
37
- args: {
38
- type: 'WISE',
39
- lockup: true,
40
- },
41
- render: (args) => <Logo {...args} />,
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
+ ),
42
44
  };
43
45
 
44
46
  /**
45
- * The three logo types: standard Wise, Wise Business, and Wise Platform.
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".
46
49
  */
47
50
  export const Types: Story = {
48
51
  argTypes: {
@@ -56,6 +59,9 @@ export const Types: Story = {
56
59
  alignItems: 'center',
57
60
  padding: '2rem',
58
61
  borderRadius: '8px',
62
+ ...(args.inverse
63
+ ? { backgroundColor: 'var(--color-background-screen-dark, #0e0f0c)' }
64
+ : {}),
59
65
  }}
60
66
  >
61
67
  {Object.values(LogoType).map((type) => (
@@ -69,6 +75,14 @@ export const Types: Story = {
69
75
  }}
70
76
  >
71
77
  <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>
72
86
  </div>
73
87
  ))}
74
88
  </div>
@@ -85,138 +99,99 @@ export const Types: Story = {
85
99
  };
86
100
 
87
101
  /**
88
- * The `lockup` prop shows the product name alongside the wordmark.
102
+ * Below `576px` the flag-only mark is shown; at `576px` and above the full wordmark is displayed.
89
103
  */
90
- export const Lockup: Story = {
104
+ export const Responsive: Story = {
91
105
  argTypes: {
92
106
  type: { table: { disable: true } },
93
- lockup: { table: { disable: true } },
107
+ inverse: { table: { disable: true } },
94
108
  },
95
109
  render: (args) => (
96
- <div style={{ display: 'flex', gap: '3rem', alignItems: 'center', padding: '2rem' }}>
97
- {Object.values(LogoType).map((type) => (
98
- <div key={type} style={{ display: 'flex', gap: '3rem', alignItems: 'center' }}>
99
- <div
100
- style={{
101
- display: 'flex',
102
- flexDirection: 'column',
103
- alignItems: 'center',
104
- gap: '0.5rem',
105
- }}
106
- >
107
- <Logo {...args} type={type} lockup />
108
- </div>
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
+ ))}
109
124
  </div>
110
- ))}
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
+ ))}
134
+ </div>
135
+ </div>
111
136
  </div>
112
137
  ),
113
138
  parameters: {
114
139
  docs: {
115
- source: {
116
- code: `<Logo type="WISE" lockup />
117
- <Logo type="WISE_BUSINESS" lockup />
118
- <Logo type="WISE_PLATFORM" lockup />`,
119
- },
140
+ source: { code: null },
120
141
  },
121
142
  },
122
143
  };
123
144
 
124
145
  /**
125
- * The `secondary` prop (combined with `lockup`) uses a stacked two-line layout.
146
+ * All logo types on a dark background using the `inverse` prop, which renders a
147
+ * light-coloured version suited for dark surfaces.
126
148
  */
127
- export const Secondary: Story = {
149
+ export const Inverse: Story = {
128
150
  argTypes: {
129
151
  type: { table: { disable: true } },
130
- lockup: { table: { disable: true } },
131
- secondary: { table: { disable: true } },
152
+ inverse: { table: { disable: true } },
132
153
  },
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
+ ],
133
170
  render: (args) => (
134
- <div style={{ display: 'flex', gap: '3rem', alignItems: 'flex-end', padding: '2rem' }}>
135
- {Object.values(LogoType).map((type) => (
136
- <div key={type} style={{ display: 'flex', gap: '3rem', alignItems: 'flex-end' }}>
137
- <div
138
- style={{
139
- display: 'flex',
140
- flexDirection: 'column',
141
- alignItems: 'center',
142
- gap: '0.5rem',
143
- }}
144
- >
145
- <Logo {...args} type={type} lockup secondary />
146
- </div>
147
- </div>
148
- ))}
149
- </div>
150
- ),
151
- parameters: {
152
- docs: {
153
- source: {
154
- code: `<Logo type="WISE" lockup secondary />
155
- <Logo type="WISE_BUSINESS" lockup secondary />
156
- <Logo type="WISE_PLATFORM" lockup secondary />`,
157
- },
158
- },
159
- },
160
- };
161
-
162
- /**
163
- * When `display` is `"compact"`, only the fast-flag mark is rendered regardless of type or other settings.
164
- */
165
- export const Compact: Story = {
166
- render: (args) => (
167
- <div style={{ display: 'flex', gap: '3rem', alignItems: 'center', padding: '2rem' }}>
171
+ <>
168
172
  {Object.values(LogoType).map((type) => (
169
173
  <div
170
174
  key={type}
171
- style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '0.5rem' }}
175
+ style={{
176
+ display: 'flex',
177
+ flexDirection: 'column',
178
+ alignItems: 'center',
179
+ gap: '0.5rem',
180
+ }}
172
181
  >
173
- <Logo {...args} type={type} lockup display="compact" />
174
- <Logo {...args} type={type} lockup secondary display="compact" />
182
+ <Logo type={type} inverse />
183
+ <span style={{ fontSize: '12px', color: 'rgba(255,255,255,0.6)' }}>{type}</span>
175
184
  </div>
176
185
  ))}
177
- </div>
186
+ </>
178
187
  ),
179
188
  parameters: {
180
189
  docs: {
181
190
  source: {
182
- code: `<Logo type=".." lockup display="compact" />
183
- <Logo type=".." lockup secondary display="compact" />`,
191
+ code: `<Logo type="WISE" inverse />
192
+ <Logo type="WISE_BUSINESS" inverse />
193
+ <Logo type="WISE_PLATFORM" inverse />`,
184
194
  },
185
195
  },
186
196
  },
187
197
  };
188
-
189
- /**
190
- * When `display` is `"full"`, the full wordmark/lockup is rendered regardless of screen width.
191
- */
192
- export const Full: Story = {
193
- render: (args) => (
194
- <div style={{ display: 'flex', gap: '3rem', alignItems: 'flex-end', padding: '2rem' }}>
195
- {Object.values(LogoType).map((type) => (
196
- <div key={type} style={{ display: 'flex', gap: '3rem', alignItems: 'flex-end' }}>
197
- <div
198
- style={{
199
- display: 'flex',
200
- flexDirection: 'column',
201
- alignItems: 'center',
202
- gap: '0.5rem',
203
- }}
204
- >
205
- <Logo {...args} type={type} lockup display="full" />
206
- <Logo {...args} type={type} lockup secondary display="full" />
207
- </div>
208
- </div>
209
- ))}
210
- </div>
211
- ),
212
- ...withVariantConfig(['mobile'], {
213
- parameters: {
214
- docs: {
215
- source: {
216
- code: `<Logo type=".." lockup display="compact" />
217
- <Logo type=".." lockup secondary display="compact" />`,
218
- },
219
- },
220
- },
221
- }),
222
- };
@@ -17,13 +17,21 @@ 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
- <div key={type}>
21
- <Logo type={type} className="d-block" lockup />
22
- <Logo type={type} className="d-block" lockup secondary />
23
- <Logo type={type} className="d-block" lockup display="compact" />
24
- <Logo type={type} className="d-block" lockup display="full" />
25
- <Logo type={type} className="d-block" lockup display="responsive" />
26
- </div>
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 />
27
35
  ))}
28
36
  </div>
29
37
  </div>
@@ -31,14 +39,15 @@ const AllVariants = () => (
31
39
 
32
40
  export const Variants: Story = {
33
41
  render: () => <AllVariants />,
34
- ...withVariantConfig(['default', 'dark', 'bright-green', 'forest-green'], {
35
- parameters: {
36
- padding: '',
37
- },
38
- }),
42
+ ...withVariantConfig(['default', 'dark', 'bright-green', 'forest-green']),
43
+ };
44
+
45
+ export const RTL: Story = {
46
+ render: () => <AllVariants />,
47
+ ...withVariantConfig(['rtl']),
39
48
  };
40
49
 
41
- export const Responsive: Story = {
50
+ export const Zoom400: Story = {
42
51
  render: () => <AllVariants />,
43
- ...withVariantConfig(['mobile']),
52
+ ...withVariantConfig(['400%']),
44
53
  };