@transferwise/components 0.0.0-experimental-92c557b → 0.0.0-experimental-97a6be6

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,9 +1,7 @@
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';
5
4
  import { withVariantConfig } from '../../.storybook/helpers';
6
- import Body from '../body';
7
5
 
8
6
  /**
9
7
  * **Design guidance**: <a href="https://wise.design/foundations/logo" target="_blank">wise.design/foundations/logo</a>
@@ -27,10 +25,6 @@ const meta: Meta<typeof Logo> = {
27
25
  control: 'radio',
28
26
  options: Object.values(LogoFormat),
29
27
  },
30
- size: {
31
- control: 'radio',
32
- options: [16, 18, 20, 24, 28, 36] satisfies LogoSize[],
33
- },
34
28
  inverse: { control: { disable: true } },
35
29
  },
36
30
  parameters: {
@@ -168,40 +162,6 @@ export const SecondaryLockup: Story = {
168
162
  },
169
163
  };
170
164
 
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
-
205
165
  /**
206
166
  * When `display` is `"compact"`, only the fast-flag mark is rendered regardless of type or other settings.
207
167
  */
@@ -1,10 +1,7 @@
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';
6
4
  import { withVariantConfig } from '../../.storybook/helpers';
7
- import Body from '../body';
8
5
 
9
6
  const meta: Meta<typeof Logo> = {
10
7
  component: Logo,
@@ -45,51 +42,3 @@ export const Responsive: Story = {
45
42
  render: () => <AllVariants />,
46
43
  ...withVariantConfig(['mobile']),
47
44
  };
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,8 +32,6 @@ 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
-
37
35
  export interface LogoProps {
38
36
  /** Extra classes applied to Logo */
39
37
  className?: string;
@@ -64,11 +62,6 @@ export interface LogoProps {
64
62
  * @default 'default'
65
63
  */
66
64
  format?: `${LogoFormat}`;
67
- /**
68
- * Controls the height and width of the logo in pixels.
69
- * @default 24
70
- */
71
- size?: LogoSize;
72
65
  /**
73
66
  * Override default ({@link labelByType}) screen reader messages
74
67
  */
@@ -101,7 +94,6 @@ export default function Logo({
101
94
  type = 'WISE',
102
95
  format = 'default',
103
96
  display = 'responsive',
104
- size = 24,
105
97
  'aria-label': ariaLabel,
106
98
  }: LogoProps) {
107
99
  const isScreenSm = !useScreenSize(Breakpoint.SMALL);
@@ -109,9 +101,7 @@ export default function Logo({
109
101
 
110
102
  const assetName = compact ? 'FastFlag' : getAssetName(type, format);
111
103
  const Asset = logoAssets[assetName];
112
- const sizes = logoAssetsDimensions[assetName];
113
- const { width, height } =
114
- logoAssetsDimensions[assetName][Number(size) as keyof typeof sizes] ?? sizes[24];
104
+ const { width, height } = logoAssetsDimensions[assetName];
115
105
 
116
106
  return (
117
107
  <span
@@ -1,64 +1,17 @@
1
1
  export const logoAssetsDimensions = {
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
- },
2
+ FastFlag: { width: 22, height: 24 },
3
+ WiseLogo: { width: 94, height: 24 },
4
+ WiseBusinessPrimary: { width: 210, height: 24 },
5
+ WiseBusinessSecondary: { width: 97, height: 46 },
6
+ WisePlatformPrimary: { width: 205, height: 24 },
7
+ WisePlatformSecondary: { width: 94, height: 46 },
50
8
  } as const;
51
9
 
52
10
  export type LogoAssetName = keyof typeof logoAssetsDimensions;
53
11
 
54
12
  function svgProps(name: LogoAssetName) {
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
- };
13
+ const { width, height } = logoAssetsDimensions[name];
14
+ return { xmlns: 'http://www.w3.org/2000/svg', width, height, viewBox: `0 0 ${width} ${height}` };
62
15
  }
63
16
 
64
17
  export function FastFlag() {
package/src/main.css CHANGED
@@ -29481,8 +29481,8 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
29481
29481
  gap: var(--size-4) var(--size-12);
29482
29482
  }
29483
29483
 
29484
- .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-noInfo-hasPrompt:not( :has(.wds-list-item-subtitle-value, .wds-list-item-subtitle)) .wds-list-item-prompt,
29485
- .wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-noInfo-hasPrompt:not( :has(.wds-list-item-subtitle-value, .wds-list-item-subtitle)) .wds-list-item-prompt {
29484
+ .wds-list-item-gridWrapper.wds-list-item-hasMedia-hasControl.wds-list-item-noInfo-hasPrompt:not(:has(.wds-list-item-subtitle-value, .wds-list-item-subtitle)) .wds-list-item-prompt,
29485
+ .wds-list-item-gridWrapper.wds-list-item-hasMedia-noControl.wds-list-item-noInfo-hasPrompt:not(:has(.wds-list-item-subtitle-value, .wds-list-item-subtitle)) .wds-list-item-prompt {
29486
29486
  margin-top: -2px;
29487
29487
  }
29488
29488
 
@@ -29490,8 +29490,6 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
29490
29490
  .wds-list-item-gridWrapper .wds-list-item-control-wrapper {
29491
29491
  height: var(--wds-list-item-control-wrapper-height);
29492
29492
  align-content: center;
29493
- display: grid;
29494
- align-items: center;
29495
29493
  }
29496
29494
  .wds-list-item-gridWrapper .wds-list-item-media-image {
29497
29495
  -o-object-position: center;
package/src/ssr.test.tsx CHANGED
@@ -183,7 +183,6 @@ 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 },
187
186
  ActionPrompt: { action: { label: 'Action', onClick: jest.fn(), href: '#' } },
188
187
  Alert: { children: undefined, message: 'Fluffy kittens', size: undefined },
189
188
  Card: { isExpanded: true },