@transferwise/components 46.127.1 → 46.128.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/alert/Alert.js +3 -0
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +3 -0
- package/build/alert/Alert.mjs.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/index.mjs +1 -1
- package/build/inputs/SelectInput.js +81 -12
- package/build/inputs/SelectInput.js.map +1 -1
- package/build/inputs/SelectInput.mjs +81 -13
- package/build/inputs/SelectInput.mjs.map +1 -1
- package/build/listItem/Button/ListItemButton.js +4 -3
- package/build/listItem/Button/ListItemButton.js.map +1 -1
- package/build/listItem/Button/ListItemButton.mjs +5 -4
- package/build/listItem/Button/ListItemButton.mjs.map +1 -1
- package/build/main.css +15 -7
- package/build/prompt/ActionPrompt/ActionPrompt.js +6 -4
- package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.mjs +6 -4
- package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.js +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.mjs +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.mjs.map +1 -1
- package/build/styles/main.css +15 -7
- package/build/styles/prompt/ActionPrompt/ActionPrompt.css +4 -0
- package/build/styles/prompt/InfoPrompt/InfoPrompt.css +7 -5
- package/build/styles/prompt/InlinePrompt/InlinePrompt.css +3 -2
- package/build/styles/prompt/PrimitivePrompt/PrimitivePrompt.css +1 -0
- package/build/types/alert/Alert.d.ts +15 -0
- package/build/types/alert/Alert.d.ts.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts +19 -0
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/listItem/Button/ListItemButton.d.ts +7 -4
- package/build/types/listItem/Button/ListItemButton.d.ts.map +1 -1
- package/build/types/listItem/ListItem.d.ts +4 -4
- package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts +7 -0
- package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts.map +1 -1
- package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts +4 -2
- package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/alert/Alert.story.tsx +4 -0
- package/src/alert/Alert.test.story.tsx +1 -1
- package/src/alert/Alert.tsx +16 -0
- package/src/iconButton/IconButton.story.tsx +173 -48
- package/src/iconButton/IconButton.test.story.tsx +194 -0
- package/src/index.ts +1 -0
- package/src/inputs/SelectInput.story.tsx +33 -20
- package/src/inputs/SelectInput.test.story.tsx +1285 -5
- package/src/inputs/SelectInput.tsx +93 -15
- package/src/listItem/Button/ListItemButton.tsx +30 -28
- package/src/listItem/_stories/ListItem.story.tsx +0 -1
- package/src/main.css +15 -7
- package/src/prompt/ActionPrompt/ActionPrompt.accessibility.docs.mdx +2 -18
- package/src/prompt/ActionPrompt/ActionPrompt.css +4 -0
- package/src/prompt/ActionPrompt/ActionPrompt.less +5 -1
- package/src/prompt/ActionPrompt/ActionPrompt.story.tsx +323 -108
- package/src/prompt/ActionPrompt/ActionPrompt.test.story.tsx +86 -3
- package/src/prompt/ActionPrompt/ActionPrompt.tsx +17 -6
- package/src/prompt/InfoPrompt/InfoPrompt.accessibility.docs.mdx +79 -0
- package/src/prompt/InfoPrompt/InfoPrompt.css +7 -5
- package/src/prompt/InfoPrompt/InfoPrompt.less +8 -8
- package/src/prompt/InfoPrompt/InfoPrompt.story.tsx +112 -82
- package/src/prompt/InfoPrompt/InfoPrompt.test.story.tsx +54 -1
- package/src/prompt/InfoPrompt/InfoPrompt.tsx +4 -2
- package/src/prompt/InlinePrompt/InlinePrompt.accessibility.docs.mdx +63 -0
- package/src/prompt/InlinePrompt/InlinePrompt.css +3 -2
- package/src/prompt/InlinePrompt/InlinePrompt.less +2 -2
- package/src/prompt/InlinePrompt/InlinePrompt.story.tsx +25 -30
- package/src/prompt/InlinePrompt/InlinePrompt.test.story.tsx +21 -0
- package/src/prompt/InlinePrompt/InlinePrompt.test.tsx +10 -3
- package/src/prompt/InlinePrompt/InlinePrompt.tsx +1 -1
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.css +1 -0
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.less +2 -1
- package/src/sentimentSurface/SentimentSurface.docs.mdx +1 -1
- package/src/sentimentSurface/SentimentSurface.story.tsx +1 -1
- package/src/sentimentSurface/SentimentSurface.test.story.tsx +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
3
3
|
import { action } from 'storybook/actions';
|
|
4
|
-
import { Clock,
|
|
4
|
+
import { Clock, Taxi, Travel } from '@transferwise/icons';
|
|
5
5
|
import { lorem5 } from '../../test-utils';
|
|
6
6
|
import Link from '../../link';
|
|
7
7
|
import { InlinePrompt, InlinePromptProps } from './InlinePrompt';
|
|
@@ -144,7 +144,6 @@ export const Sentiments: StoryObj<PreviewStoryArgs> = {
|
|
|
144
144
|
</>
|
|
145
145
|
);
|
|
146
146
|
},
|
|
147
|
-
decorators: [withComponentGrid()],
|
|
148
147
|
};
|
|
149
148
|
|
|
150
149
|
/**
|
|
@@ -164,6 +163,30 @@ export const Loading: StoryObj<PreviewStoryArgs> = {
|
|
|
164
163
|
},
|
|
165
164
|
};
|
|
166
165
|
|
|
166
|
+
/**
|
|
167
|
+
* Inline prompt is usually associated with a different component, such as `Input` or `ListItem`.
|
|
168
|
+
* When those components are disabled, the prompt is often used to communicate to the user why they
|
|
169
|
+
* cannot interact with them. For that reason, the prompt cannot inherit the usual disabled visual
|
|
170
|
+
* style, and it must retain its interactivity. To bring these 2 components visually closer to each
|
|
171
|
+
* other, `muted` prop introduces slightly reduced opacity and luminosity as well as a special
|
|
172
|
+
* backslash circle icon.
|
|
173
|
+
*/
|
|
174
|
+
export const Muted: StoryObj<PreviewStoryArgs> = {
|
|
175
|
+
argTypes: previewArgTypes,
|
|
176
|
+
args: {
|
|
177
|
+
muted: true,
|
|
178
|
+
previewMedia: false,
|
|
179
|
+
},
|
|
180
|
+
render: (args: PreviewStoryArgs) => {
|
|
181
|
+
const [props, previewProps] = getPropsForPreview(args);
|
|
182
|
+
return (
|
|
183
|
+
<InlinePrompt {...props} {...previewProps}>
|
|
184
|
+
Please <Link href="#">confirm your residential address</Link> to activate this feature.
|
|
185
|
+
</InlinePrompt>
|
|
186
|
+
);
|
|
187
|
+
},
|
|
188
|
+
};
|
|
189
|
+
|
|
167
190
|
/**
|
|
168
191
|
* `InlinePrompt` can include a single instance of the `Link` component, which can be rendered as
|
|
169
192
|
* either HTML anchor or button. That element will spread across the whole surface of the Prompt
|
|
@@ -194,31 +217,6 @@ export const Interactivity: StoryObj<PreviewStoryArgs> = {
|
|
|
194
217
|
</InlinePrompt>
|
|
195
218
|
</>
|
|
196
219
|
),
|
|
197
|
-
decorators: [withComponentGrid()],
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Inline prompt is usually associated with a different component, such as `Input` or `ListItem`.
|
|
202
|
-
* When those components are disabled, the prompt is often used to communicate to the user why they
|
|
203
|
-
* cannot interact with them. For that reason, the prompt cannot inherit the usual disabled visual
|
|
204
|
-
* style, and it must retain its interactivity. To bring these 2 components visually closer to each
|
|
205
|
-
* other, `muted` prop introduces slightly reduced opacity and luminosity as well as a special
|
|
206
|
-
* backslash circle icon.
|
|
207
|
-
*/
|
|
208
|
-
export const Muted: StoryObj<PreviewStoryArgs> = {
|
|
209
|
-
argTypes: previewArgTypes,
|
|
210
|
-
args: {
|
|
211
|
-
muted: true,
|
|
212
|
-
previewMedia: false,
|
|
213
|
-
},
|
|
214
|
-
render: (args: PreviewStoryArgs) => {
|
|
215
|
-
const [props, previewProps] = getPropsForPreview(args);
|
|
216
|
-
return (
|
|
217
|
-
<InlinePrompt {...props} {...previewProps}>
|
|
218
|
-
Please <Link href="#">confirm your residential address</Link> to activate this feature.
|
|
219
|
-
</InlinePrompt>
|
|
220
|
-
);
|
|
221
|
-
},
|
|
222
220
|
};
|
|
223
221
|
|
|
224
222
|
/**
|
|
@@ -250,7 +248,6 @@ export const IconOverrides: StoryObj<PreviewStoryArgs> = {
|
|
|
250
248
|
</>
|
|
251
249
|
);
|
|
252
250
|
},
|
|
253
|
-
decorators: [withComponentGrid()],
|
|
254
251
|
};
|
|
255
252
|
|
|
256
253
|
/**
|
|
@@ -281,7 +278,6 @@ export const SizingStrategies: StoryObj<PreviewStoryArgs> = {
|
|
|
281
278
|
</>
|
|
282
279
|
);
|
|
283
280
|
},
|
|
284
|
-
decorators: [withComponentGrid()],
|
|
285
281
|
};
|
|
286
282
|
|
|
287
283
|
/**
|
|
@@ -309,5 +305,4 @@ export const SentimentAwareness: StoryObj<PreviewStoryArgs> = {
|
|
|
309
305
|
</>
|
|
310
306
|
);
|
|
311
307
|
},
|
|
312
|
-
decorators: [withComponentGrid()],
|
|
313
308
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { Travel } from '@transferwise/icons';
|
|
3
|
+
import { InlinePrompt } from './InlinePrompt';
|
|
4
|
+
import { withVariantConfig } from '../../../.storybook/helpers';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Prompts/InlinePrompt/Tests',
|
|
8
|
+
component: InlinePrompt,
|
|
9
|
+
tags: ['!autodocs'],
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type Story = StoryObj<typeof InlinePrompt>;
|
|
13
|
+
|
|
14
|
+
export const TinyScreen: Story = {
|
|
15
|
+
render: () => (
|
|
16
|
+
<InlinePrompt sentiment="positive" media={<Travel />}>
|
|
17
|
+
Your travel money account is now active and ready to use for international transactions.
|
|
18
|
+
</InlinePrompt>
|
|
19
|
+
),
|
|
20
|
+
...withVariantConfig(['400%']),
|
|
21
|
+
};
|
|
@@ -136,9 +136,16 @@ describe('InlinePrompt', () => {
|
|
|
136
136
|
expect(screen.getByTestId('prompt')).not.toHaveClass('wds-inline-prompt--full-width');
|
|
137
137
|
});
|
|
138
138
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
describe('width', () => {
|
|
140
|
+
it('applies auto width class by default', () => {
|
|
141
|
+
render(<InlinePrompt {...defaultProps} data-testid="prompt" />);
|
|
142
|
+
expect(screen.getByTestId('prompt')).toHaveClass('wds-inline-prompt--auto-width');
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it('strips the class if `width` is set to `full`', () => {
|
|
146
|
+
render(<InlinePrompt {...defaultProps} width="full" data-testid="prompt" />);
|
|
147
|
+
expect(screen.getByTestId('prompt')).not.toHaveClass('wds-inline-prompt--auto-width');
|
|
148
|
+
});
|
|
142
149
|
});
|
|
143
150
|
});
|
|
144
151
|
});
|
|
@@ -94,7 +94,7 @@ export const InlinePrompt = ({
|
|
|
94
94
|
className={clsx(
|
|
95
95
|
'wds-inline-prompt',
|
|
96
96
|
{
|
|
97
|
-
'wds-inline-prompt--
|
|
97
|
+
'wds-inline-prompt--auto-width': width !== 'full',
|
|
98
98
|
'wds-inline-prompt--muted': muted,
|
|
99
99
|
'wds-inline-prompt--loading': loading,
|
|
100
100
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta, Source, Canvas } from '@storybook/addon-docs/blocks';
|
|
2
2
|
import * as stories from './SentimentSurface.story';
|
|
3
3
|
|
|
4
|
-
<Meta title="
|
|
4
|
+
<Meta title="Foundations/SentimentSurface/Developer Guide" />
|
|
5
5
|
|
|
6
6
|
# Developer Guide
|
|
7
7
|
|
|
@@ -31,7 +31,7 @@ const withComponentGrid = (Story: () => JSX.Element) => (
|
|
|
31
31
|
*/
|
|
32
32
|
const meta: Meta<typeof SentimentSurface> = {
|
|
33
33
|
component: SentimentSurface,
|
|
34
|
-
title: '
|
|
34
|
+
title: 'Foundations/SentimentSurface',
|
|
35
35
|
argTypes: {
|
|
36
36
|
sentiment: {
|
|
37
37
|
control: 'select',
|
|
@@ -21,7 +21,7 @@ const screenModes: Theming['screenMode'][] = ['light', 'dark'];
|
|
|
21
21
|
|
|
22
22
|
export default {
|
|
23
23
|
component: SentimentSurface,
|
|
24
|
-
title: '
|
|
24
|
+
title: 'Foundations/SentimentSurface/Tests',
|
|
25
25
|
tags: ['!autodocs', '!manifest'],
|
|
26
26
|
} satisfies Meta<typeof SentimentSurface>;
|
|
27
27
|
|