@transferwise/components 46.132.1 → 46.133.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/chips/Chips.js.map +1 -1
- package/build/chips/Chips.mjs.map +1 -1
- package/build/inputs/InputGroup.js +10 -1
- package/build/inputs/InputGroup.js.map +1 -1
- package/build/inputs/InputGroup.mjs +10 -1
- package/build/inputs/InputGroup.mjs.map +1 -1
- package/build/label/Label.js +1 -1
- package/build/label/Label.js.map +1 -1
- package/build/label/Label.mjs +1 -1
- package/build/label/Label.mjs.map +1 -1
- package/build/logo/Logo.js +6 -0
- package/build/logo/Logo.js.map +1 -1
- package/build/logo/Logo.mjs +6 -0
- package/build/logo/Logo.mjs.map +1 -1
- package/build/main.css +22 -6
- package/build/phoneNumberInput/PhoneNumberInput.js +6 -1
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs +6 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/styles/inputs/InputGroup.css +10 -2
- package/build/styles/listItem/ListItem.css +4 -4
- package/build/styles/listItem/ListItem.grid.css +3 -3
- package/build/styles/main.css +22 -6
- package/build/styles/phoneNumberInput/PhoneNumberInput.css +5 -0
- package/build/types/chips/Chips.d.ts +1 -1
- package/build/types/chips/Chips.d.ts.map +1 -1
- package/build/types/common/commonProps.d.ts +0 -6
- package/build/types/common/commonProps.d.ts.map +1 -1
- package/build/types/label/Label.d.ts.map +1 -1
- package/build/types/logo/Logo.d.ts +10 -1
- package/build/types/logo/Logo.d.ts.map +1 -1
- package/build/types/phoneNumberInput/PhoneNumberInput.d.ts.map +1 -1
- package/package.json +19 -19
- package/src/button/_stories/Button.accessibility.docs.mdx +10 -6
- package/src/button/_stories/Button.story.tsx +15 -7
- package/src/checkboxButton/CheckboxButton.story.tsx +125 -44
- package/src/checkboxButton/CheckboxButton.test.story.tsx +236 -0
- package/src/chips/Chips.story.tsx +141 -102
- package/src/chips/Chips.test.story.tsx +177 -0
- package/src/chips/Chips.tsx +1 -1
- package/src/circularButton/CircularButton.story.tsx +261 -49
- package/src/circularButton/CircularButton.test.story.tsx +192 -2
- package/src/common/bottomSheet/BottomSheet.story.tsx +11 -9
- package/src/common/bottomSheet/BottomSheet.test.story.tsx +28 -15
- package/src/common/commonProps.ts +0 -6
- package/src/divider/Divider.accessibility.docs.mdx +1 -10
- package/src/divider/Divider.story.tsx +0 -1
- package/src/expressiveMoneyInput/ExpressiveMoneyInput.story.tsx +1 -2
- package/src/header/Header.accessibility.docs.mdx +9 -5
- package/src/iconButton/IconButton.story.tsx +315 -110
- package/src/iconButton/IconButton.test.story.tsx +217 -44
- package/src/inputs/InputGroup.css +10 -2
- package/src/inputs/InputGroup.less +12 -2
- package/src/inputs/InputGroup.story.tsx +27 -0
- package/src/inputs/InputGroup.tsx +10 -0
- package/src/inputs/SelectInput/_stories/SelectInput.story.tsx +0 -1
- package/src/label/Label.tsx +1 -2
- package/src/legacylistItem/LegacyListItem.test.story.tsx +1 -1
- package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.story.tsx +0 -1
- package/src/listItem/AvatarLayout/ListItemAvatarLayout.story.tsx +0 -1
- package/src/listItem/AvatarView/ListItemAvatarView.story.tsx +0 -1
- package/src/listItem/Button/ListItemButton.story.tsx +0 -1
- package/src/listItem/Checkbox/ListItemCheckbox.story.tsx +0 -1
- package/src/listItem/IconButton/ListItemIconButton.story.tsx +0 -1
- package/src/listItem/ListItem.css +4 -4
- package/src/listItem/ListItem.grid.css +3 -3
- package/src/listItem/ListItem.grid.less +5 -3
- package/src/listItem/ListItem.less +1 -1
- package/src/listItem/ListItem.vars.less +2 -2
- package/src/listItem/Navigation/ListItemNavigation.story.tsx +0 -1
- package/src/listItem/Prompt/ListItemPrompt.story.tsx +0 -1
- package/src/listItem/Radio/ListItemRadio.story.tsx +0 -1
- package/src/listItem/Switch/ListItemSwitch.story.tsx +0 -1
- package/src/listItem/_stories/ListItem.layout.test.story.tsx +55 -0
- package/src/listItem/_stories/ListItem.story.tsx +1 -0
- package/src/logo/Logo.story.tsx +181 -21
- package/src/logo/Logo.test.story.tsx +40 -7
- package/src/logo/Logo.tsx +10 -1
- package/src/main.css +22 -6
- package/src/phoneNumberInput/PhoneNumberInput.css +5 -0
- package/src/phoneNumberInput/PhoneNumberInput.less +7 -0
- package/src/phoneNumberInput/PhoneNumberInput.tsx +10 -1
- package/src/prompt/InlinePrompt/InlinePrompt.story.tsx +0 -1
- package/src/section/Section.story.tsx +12 -7
- package/src/sentimentSurface/SentimentSurface.story.tsx +1 -1
- package/src/snackbar/Snackbar.test.story.tsx +16 -104
- package/src/summary/Summary.test.story.tsx +1 -1
- package/src/switch/Switch.story.tsx +64 -42
- package/src/switch/Switch.test.story.tsx +123 -0
- package/src/switchOption/SwitchOption.story.tsx +0 -1
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
@container (
|
|
17
|
+
@container (width > @wds-list-item-cq-max) {
|
|
18
18
|
.wds-list-item-control-wrapper {
|
|
19
19
|
height: var(--wds-list-item-control-wrapper-height);
|
|
20
20
|
align-content: center;
|
|
@@ -169,7 +169,9 @@
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
|
|
172
|
+
// LESS struggles with ranged container queries so
|
|
173
|
+
// we need to escape the interpolated expression.
|
|
174
|
+
@container (~"@{wds-list-item-cq-min} < width <= @{wds-list-item-cq-max}") {
|
|
173
175
|
.wds-list-item-media-image{
|
|
174
176
|
object-position: bottom left;
|
|
175
177
|
}
|
|
@@ -404,7 +406,7 @@
|
|
|
404
406
|
}
|
|
405
407
|
}
|
|
406
408
|
|
|
407
|
-
@container (
|
|
409
|
+
@container (width <= @wds-list-item-cq-min) {
|
|
408
410
|
.wds-list-item-control-wrapper {
|
|
409
411
|
align-content: start;
|
|
410
412
|
}
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
// `packages/components/src/listItem/constants.ts`
|
|
8
8
|
//
|
|
9
9
|
// @see https://storybook.wise.design/?path=/story/content-listitem--responsiveness
|
|
10
|
-
@wds-list-item-cq-min:
|
|
11
|
-
@wds-list-item-cq-max:
|
|
10
|
+
@wds-list-item-cq-min: 240px;
|
|
11
|
+
@wds-list-item-cq-max: 308px;
|
|
@@ -225,3 +225,58 @@ export const ImageAlignment: StoryObj<PreviewStoryArgs> = {
|
|
|
225
225
|
);
|
|
226
226
|
},
|
|
227
227
|
};
|
|
228
|
+
|
|
229
|
+
// Our container queries left 1px gap between breakpoint definitions.
|
|
230
|
+
// This test makes sure that LI placed in a parent of {width} still
|
|
231
|
+
// works fine, where: {breakpoint} < {width} < {breakpoint} + 1px
|
|
232
|
+
export const SubPixelWidths: StoryObj<PreviewStoryArgs> = {
|
|
233
|
+
parameters: {
|
|
234
|
+
controls: { disable: false },
|
|
235
|
+
},
|
|
236
|
+
args: {
|
|
237
|
+
title: lorem5,
|
|
238
|
+
subtitle: lorem10,
|
|
239
|
+
previewImageSize: 48,
|
|
240
|
+
previewWithLineGuides: true,
|
|
241
|
+
previewPrompt: false,
|
|
242
|
+
},
|
|
243
|
+
argTypes: previewArgTypes,
|
|
244
|
+
render: (args: PreviewStoryArgs) => {
|
|
245
|
+
const [props] = getPropsForPreview(args);
|
|
246
|
+
|
|
247
|
+
return (
|
|
248
|
+
<>
|
|
249
|
+
<List
|
|
250
|
+
style={{
|
|
251
|
+
display: 'grid',
|
|
252
|
+
gridTemplateColumns: '1fr 1fr',
|
|
253
|
+
width: `${2 * LISTITEM_CQ.MIN + 1}px`,
|
|
254
|
+
}}
|
|
255
|
+
>
|
|
256
|
+
<ListItem
|
|
257
|
+
{...props}
|
|
258
|
+
title={`This list item is ${LISTITEM_CQ.MIN + 0.5}px wide`}
|
|
259
|
+
subtitle="this translates to '@wds-list-item-cq-min + 0.5px'"
|
|
260
|
+
media={<ListItem.Image src={portraitImage} alt="portrait image" />}
|
|
261
|
+
/>
|
|
262
|
+
<li />
|
|
263
|
+
</List>
|
|
264
|
+
<List
|
|
265
|
+
style={{
|
|
266
|
+
display: 'grid',
|
|
267
|
+
gridTemplateColumns: '1fr 1fr',
|
|
268
|
+
width: `${2 * LISTITEM_CQ.MAX + 1}px`,
|
|
269
|
+
}}
|
|
270
|
+
>
|
|
271
|
+
<ListItem
|
|
272
|
+
{...props}
|
|
273
|
+
title={`This list item is ${LISTITEM_CQ.MAX + 0.5}px wide`}
|
|
274
|
+
subtitle="this translates to '@wds-list-item-cq-max + 0.5px'"
|
|
275
|
+
media={<ListItem.Image src={portraitImage} alt="portrait image" />}
|
|
276
|
+
/>
|
|
277
|
+
<li />
|
|
278
|
+
</List>
|
|
279
|
+
</>
|
|
280
|
+
);
|
|
281
|
+
},
|
|
282
|
+
};
|
package/src/logo/Logo.story.tsx
CHANGED
|
@@ -2,36 +2,196 @@ import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
|
2
2
|
|
|
3
3
|
import Logo, { LogoType } from '.';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* **Design guidance**: <a href="https://wise.design/foundations/logo" target="_blank">wise.design/foundations/logo</a>
|
|
7
|
+
*/
|
|
8
|
+
const meta: Meta<typeof Logo> = {
|
|
6
9
|
component: Logo,
|
|
7
10
|
title: 'Content/Logo',
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
args: {
|
|
12
|
+
type: 'WISE',
|
|
13
|
+
inverse: false,
|
|
14
|
+
},
|
|
15
|
+
argTypes: {
|
|
16
|
+
type: {
|
|
17
|
+
control: 'radio',
|
|
18
|
+
options: Object.values(LogoType),
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
parameters: {
|
|
22
|
+
docs: { toc: true },
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default meta;
|
|
27
|
+
|
|
28
|
+
type Story = StoryObj<typeof Logo>;
|
|
29
|
+
|
|
30
|
+
/** Explore all props via the controls panel. */
|
|
31
|
+
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
|
+
),
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
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
|
+
*/
|
|
50
|
+
export const Types: Story = {
|
|
51
|
+
argTypes: {
|
|
52
|
+
type: { table: { disable: true } },
|
|
53
|
+
},
|
|
54
|
+
render: (args) => (
|
|
55
|
+
<div
|
|
56
|
+
style={{
|
|
57
|
+
display: 'flex',
|
|
58
|
+
gap: '3rem',
|
|
59
|
+
alignItems: 'center',
|
|
60
|
+
padding: '2rem',
|
|
61
|
+
borderRadius: '8px',
|
|
62
|
+
...(args.inverse
|
|
63
|
+
? { backgroundColor: 'var(--color-background-screen-dark, #0e0f0c)' }
|
|
64
|
+
: {}),
|
|
65
|
+
}}
|
|
66
|
+
>
|
|
67
|
+
{Object.values(LogoType).map((type) => (
|
|
68
|
+
<div
|
|
69
|
+
key={type}
|
|
70
|
+
style={{
|
|
71
|
+
display: 'flex',
|
|
72
|
+
flexDirection: 'column',
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
gap: '0.5rem',
|
|
75
|
+
}}
|
|
76
|
+
>
|
|
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>
|
|
86
|
+
</div>
|
|
87
|
+
))}
|
|
88
|
+
</div>
|
|
89
|
+
),
|
|
90
|
+
parameters: {
|
|
91
|
+
docs: {
|
|
92
|
+
source: {
|
|
93
|
+
code: `<Logo type="WISE" />
|
|
94
|
+
<Logo type="WISE_BUSINESS" />
|
|
95
|
+
<Logo type="WISE_PLATFORM" />`,
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Below `576px` the flag-only mark is shown; at `576px` and above the full wordmark is displayed.
|
|
103
|
+
*/
|
|
104
|
+
export const Responsive: Story = {
|
|
105
|
+
argTypes: {
|
|
106
|
+
type: { table: { disable: true } },
|
|
107
|
+
inverse: { table: { disable: true } },
|
|
108
|
+
},
|
|
109
|
+
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' }}>
|
|
12
116
|
{Object.values(LogoType).map((type) => (
|
|
13
|
-
<
|
|
14
|
-
<
|
|
15
|
-
|
|
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>
|
|
16
123
|
))}
|
|
17
124
|
</div>
|
|
18
|
-
|
|
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' }}>
|
|
19
131
|
{Object.values(LogoType).map((type) => (
|
|
20
|
-
<
|
|
21
|
-
<Logo type={type} inverse />
|
|
22
|
-
</div>
|
|
132
|
+
<Logo key={type} type={type} />
|
|
23
133
|
))}
|
|
24
134
|
</div>
|
|
25
|
-
|
|
26
|
-
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
),
|
|
138
|
+
parameters: {
|
|
139
|
+
docs: {
|
|
140
|
+
source: { code: null },
|
|
141
|
+
},
|
|
27
142
|
},
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
type Story = StoryObj<typeof Logo>;
|
|
143
|
+
};
|
|
31
144
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
145
|
+
/**
|
|
146
|
+
* All logo types on a dark background using the `inverse` prop, which renders a
|
|
147
|
+
* light-coloured version suited for dark surfaces.
|
|
148
|
+
*/
|
|
149
|
+
export const Inverse: Story = {
|
|
150
|
+
argTypes: {
|
|
151
|
+
type: { table: { disable: true } },
|
|
152
|
+
inverse: { table: { disable: true } },
|
|
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
|
+
],
|
|
170
|
+
render: (args) => (
|
|
171
|
+
<>
|
|
172
|
+
{Object.values(LogoType).map((type) => (
|
|
173
|
+
<div
|
|
174
|
+
key={type}
|
|
175
|
+
style={{
|
|
176
|
+
display: 'flex',
|
|
177
|
+
flexDirection: 'column',
|
|
178
|
+
alignItems: 'center',
|
|
179
|
+
gap: '0.5rem',
|
|
180
|
+
}}
|
|
181
|
+
>
|
|
182
|
+
<Logo type={type} inverse />
|
|
183
|
+
<span style={{ fontSize: '12px', color: 'rgba(255,255,255,0.6)' }}>{type}</span>
|
|
184
|
+
</div>
|
|
185
|
+
))}
|
|
186
|
+
</>
|
|
187
|
+
),
|
|
188
|
+
parameters: {
|
|
189
|
+
docs: {
|
|
190
|
+
source: {
|
|
191
|
+
code: `<Logo type="WISE" inverse />
|
|
192
|
+
<Logo type="WISE_BUSINESS" inverse />
|
|
193
|
+
<Logo type="WISE_PLATFORM" inverse />`,
|
|
194
|
+
},
|
|
195
|
+
},
|
|
36
196
|
},
|
|
37
197
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import Logo, { LogoType } from '.';
|
|
3
4
|
import { withVariantConfig } from '../../.storybook/helpers';
|
|
4
5
|
|
|
5
6
|
const meta: Meta<typeof Logo> = {
|
|
@@ -7,14 +8,46 @@ const meta: Meta<typeof Logo> = {
|
|
|
7
8
|
tags: ['!autodocs', '!manifest'],
|
|
8
9
|
title: 'Content/Logo/Tests',
|
|
9
10
|
};
|
|
11
|
+
|
|
10
12
|
export default meta;
|
|
11
13
|
|
|
12
14
|
type Story = StoryObj<typeof Logo>;
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const AllVariants = () => (
|
|
17
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}>
|
|
18
|
+
<div style={{ display: 'flex', gap: '2rem', alignItems: 'center' }}>
|
|
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 />
|
|
35
|
+
))}
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
export const Variants: Story = {
|
|
41
|
+
render: () => <AllVariants />,
|
|
42
|
+
...withVariantConfig(['default', 'dark', 'bright-green', 'forest-green']),
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const RTL: Story = {
|
|
46
|
+
render: () => <AllVariants />,
|
|
47
|
+
...withVariantConfig(['rtl']),
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const Zoom400: Story = {
|
|
51
|
+
render: () => <AllVariants />,
|
|
52
|
+
...withVariantConfig(['400%']),
|
|
20
53
|
};
|
package/src/logo/Logo.tsx
CHANGED
|
@@ -33,7 +33,10 @@ export enum LogoType {
|
|
|
33
33
|
export interface LogoProps {
|
|
34
34
|
/** Extra classes applied to Logo */
|
|
35
35
|
className?: string;
|
|
36
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* Renders a light-coloured version suited for dark backgrounds.
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
37
40
|
inverse?: boolean;
|
|
38
41
|
/**
|
|
39
42
|
* What type of logo to display
|
|
@@ -48,6 +51,12 @@ const labelByType = {
|
|
|
48
51
|
WISE_PLATFORM: 'Wise Platform',
|
|
49
52
|
} satisfies Record<`${LogoType}`, string>;
|
|
50
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Renders the Wise wordmark logo. Responsive — shows the flag-only mark on small viewports
|
|
56
|
+
* and the full wordmark on ≥576px (small breakpoint and above).
|
|
57
|
+
*
|
|
58
|
+
* @see {@link https://wise.design/foundations/logo Design Spec}
|
|
59
|
+
*/
|
|
51
60
|
export default function Logo({ className, inverse, type = 'WISE' }: LogoProps) {
|
|
52
61
|
const LogoSm =
|
|
53
62
|
svgPaths[`WISE_FLAG${type === 'WISE_PLATFORM' ? '_PLATFORM' : ''}${inverse ? '_INVERSE' : ''}`];
|
package/src/main.css
CHANGED
|
@@ -29430,7 +29430,7 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
29430
29430
|
margin-top: -2px;
|
|
29431
29431
|
}
|
|
29432
29432
|
|
|
29433
|
-
@container (
|
|
29433
|
+
@container (width > 308px) {
|
|
29434
29434
|
.wds-list-item-gridWrapper .wds-list-item-control-wrapper {
|
|
29435
29435
|
height: var(--wds-list-item-control-wrapper-height);
|
|
29436
29436
|
align-content: center;
|
|
@@ -29527,7 +29527,7 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
29527
29527
|
}
|
|
29528
29528
|
}
|
|
29529
29529
|
|
|
29530
|
-
@container (
|
|
29530
|
+
@container (240px < width <= 308px) {
|
|
29531
29531
|
.wds-list-item-gridWrapper .wds-list-item-media-image {
|
|
29532
29532
|
-o-object-position: bottom left;
|
|
29533
29533
|
object-position: bottom left;
|
|
@@ -29659,7 +29659,7 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
29659
29659
|
}
|
|
29660
29660
|
}
|
|
29661
29661
|
|
|
29662
|
-
@container (
|
|
29662
|
+
@container (width <= 240px) {
|
|
29663
29663
|
.wds-list-item-gridWrapper .wds-list-item-control-wrapper {
|
|
29664
29664
|
align-content: start;
|
|
29665
29665
|
}
|
|
@@ -29987,7 +29987,7 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
29987
29987
|
justify-content: center;
|
|
29988
29988
|
}
|
|
29989
29989
|
|
|
29990
|
-
@container (
|
|
29990
|
+
@container (width > 308px) {
|
|
29991
29991
|
.wds-list-item-titles,
|
|
29992
29992
|
.wds-list-item-value {
|
|
29993
29993
|
min-height: 100%;
|
|
@@ -30167,6 +30167,11 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
30167
30167
|
grid-row-start: 1;
|
|
30168
30168
|
}
|
|
30169
30169
|
|
|
30170
|
+
.np-input-group .np-input-addon--avatar + fieldset .form-control.np-form-control.np-form-control--size-md.np-button-input {
|
|
30171
|
+
padding-left: 48px;
|
|
30172
|
+
padding-left: var(--size-48);
|
|
30173
|
+
}
|
|
30174
|
+
|
|
30170
30175
|
.np-input-addon {
|
|
30171
30176
|
pointer-events: none;
|
|
30172
30177
|
z-index: 10;
|
|
@@ -30179,16 +30184,21 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
|
|
|
30179
30184
|
transition-duration: 150ms;
|
|
30180
30185
|
}
|
|
30181
30186
|
|
|
30187
|
+
.np-input-addon.np-input-addon--avatar > .np-avatar-view {
|
|
30188
|
+
margin-right: 8px;
|
|
30189
|
+
margin-right: var(--size-8);
|
|
30190
|
+
}
|
|
30191
|
+
|
|
30182
30192
|
.np-input-group:disabled .np-input-addon:not(.np-input-addon--interactive) {
|
|
30183
30193
|
opacity: 0.45;
|
|
30184
30194
|
mix-blend-mode: luminosity;
|
|
30185
30195
|
}
|
|
30186
30196
|
|
|
30187
|
-
.np-input-group:has( > :is(input,button,select):focus-visible) .np-input-addon {
|
|
30197
|
+
.np-input-group:has( > :is(input, button, select):focus-visible) .np-input-addon {
|
|
30188
30198
|
color: var(--color-interactive-primary);
|
|
30189
30199
|
}
|
|
30190
30200
|
|
|
30191
|
-
.np-input-group:has( > :is(input,button,select):hover) .np-input-addon {
|
|
30201
|
+
.np-input-group:has( > :is(input, button, select):hover) .np-input-addon {
|
|
30192
30202
|
color: #b5b7ba;
|
|
30193
30203
|
color: var(--color-interactive-secondary-hover);
|
|
30194
30204
|
}
|
|
@@ -31687,6 +31697,12 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
31687
31697
|
width: 100%;
|
|
31688
31698
|
}
|
|
31689
31699
|
|
|
31700
|
+
.tw-telephone__country-select--with-input-group-addon-start .np-button-input {
|
|
31701
|
+
padding-inline-start: 48px;
|
|
31702
|
+
padding-inline-start: var(--size-48);
|
|
31703
|
+
padding-inline-end: 26px !important;
|
|
31704
|
+
}
|
|
31705
|
+
|
|
31690
31706
|
.tw-telephone__number-input {
|
|
31691
31707
|
flex: auto 1 1;
|
|
31692
31708
|
}
|
|
@@ -18,6 +18,11 @@
|
|
|
18
18
|
.tw-telephone__country-select .np-input-group {
|
|
19
19
|
width: 100%;
|
|
20
20
|
}
|
|
21
|
+
.tw-telephone__country-select--with-input-group-addon-start .np-button-input {
|
|
22
|
+
padding-inline-start: 48px;
|
|
23
|
+
padding-inline-start: var(--size-48);
|
|
24
|
+
padding-inline-end: 26px !important;
|
|
25
|
+
}
|
|
21
26
|
.tw-telephone__number-input {
|
|
22
27
|
flex: auto 1 1;
|
|
23
28
|
}
|
|
@@ -19,6 +19,13 @@
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
.tw-telephone__country-select--with-input-group-addon-start {
|
|
23
|
+
.np-button-input {
|
|
24
|
+
padding-inline-start: var(--size-48);
|
|
25
|
+
padding-inline-end: 26px !important;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
22
29
|
.tw-telephone__number-input {
|
|
23
30
|
flex: auto 1 1;
|
|
24
31
|
}
|
|
@@ -3,6 +3,7 @@ import { useIntl } from 'react-intl';
|
|
|
3
3
|
|
|
4
4
|
import { Size, SizeLarge, SizeMedium, SizeSmall } from '../common';
|
|
5
5
|
import { useFieldLabelRef, useInputAttributes } from '../inputs/contexts';
|
|
6
|
+
import { useInputPaddings } from '../inputs/InputGroup';
|
|
6
7
|
import { SelectInput, SelectInputOptionContent, SelectInputProps } from '../inputs/SelectInput';
|
|
7
8
|
import messages from './PhoneNumberInput.messages';
|
|
8
9
|
import countries from './data/countries';
|
|
@@ -67,6 +68,8 @@ const PhoneNumberInput = ({
|
|
|
67
68
|
const countryCodeSelectRef = useRef<HTMLButtonElement>(null);
|
|
68
69
|
const phoneNumberInputRef = useRef<HTMLInputElement>(null);
|
|
69
70
|
const inputAttributes = useInputAttributes({ nonLabelable: true });
|
|
71
|
+
const { paddingInlineStart } = useInputPaddings();
|
|
72
|
+
const hasInputGroupAddonStart = paddingInlineStart != null;
|
|
70
73
|
const fieldLabelRef = useFieldLabelRef();
|
|
71
74
|
const ariaLabelledBy = ariaLabelledByProp ?? inputAttributes['aria-labelledby'];
|
|
72
75
|
|
|
@@ -197,7 +200,13 @@ const PhoneNumberInput = ({
|
|
|
197
200
|
<label className="sr-only" id={ids.countryCode.label} htmlFor={ids.countryCode.select}>
|
|
198
201
|
{formatMessage(messages.countryCodeLabel)}
|
|
199
202
|
</label>
|
|
200
|
-
<div
|
|
203
|
+
<div
|
|
204
|
+
className={`tw-telephone__country-select${
|
|
205
|
+
hasInputGroupAddonStart
|
|
206
|
+
? ' tw-telephone__country-select--with-input-group-addon-start'
|
|
207
|
+
: ''
|
|
208
|
+
}`}
|
|
209
|
+
>
|
|
201
210
|
<SelectInput
|
|
202
211
|
triggerRef={countryCodeSelectRef}
|
|
203
212
|
placeholder={formatMessage(messages.selectInputPlaceholder)}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { FastFlag as FastFlagIcon } from '@transferwise/icons';
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
|
|
3
|
+
import { action } from 'storybook/actions';
|
|
4
4
|
import Accordion from '../accordion';
|
|
5
5
|
import Card from '../card';
|
|
6
6
|
import Header from '../header';
|
|
7
|
-
import
|
|
8
|
-
|
|
7
|
+
import ListItem from '../listItem';
|
|
9
8
|
import Section from './Section';
|
|
10
9
|
|
|
11
10
|
export default {
|
|
@@ -105,12 +104,18 @@ export const WithCards = () => {
|
|
|
105
104
|
);
|
|
106
105
|
};
|
|
107
106
|
|
|
108
|
-
export const
|
|
107
|
+
export const WithListItems = () => {
|
|
109
108
|
return (
|
|
110
109
|
<Section>
|
|
111
|
-
<Header title="Section with
|
|
112
|
-
<
|
|
113
|
-
|
|
110
|
+
<Header title="Section with list items" />
|
|
111
|
+
<ListItem
|
|
112
|
+
title="Item 1"
|
|
113
|
+
control={<ListItem.Navigation onClick={() => action('Item 1')} />}
|
|
114
|
+
/>
|
|
115
|
+
<ListItem
|
|
116
|
+
title="Item 2"
|
|
117
|
+
control={<ListItem.Navigation onClick={() => action('Item 2')} />}
|
|
118
|
+
/>
|
|
114
119
|
</Section>
|
|
115
120
|
);
|
|
116
121
|
};
|
|
@@ -32,6 +32,7 @@ const withComponentGrid = (Story: () => JSX.Element) => (
|
|
|
32
32
|
const meta: Meta<typeof SentimentSurface> = {
|
|
33
33
|
component: SentimentSurface,
|
|
34
34
|
title: 'Foundations/SentimentSurface',
|
|
35
|
+
tags: ['early-access'],
|
|
35
36
|
argTypes: {
|
|
36
37
|
sentiment: {
|
|
37
38
|
control: 'select',
|
|
@@ -124,7 +125,6 @@ export const Playground: Story = {
|
|
|
124
125
|
</div>
|
|
125
126
|
),
|
|
126
127
|
},
|
|
127
|
-
tags: ['!autodocs'],
|
|
128
128
|
};
|
|
129
129
|
|
|
130
130
|
const sentiments: Sentiment[] = ['negative', 'warning', 'neutral', 'success', 'proposition'];
|