@transferwise/components 46.83.3 → 46.84.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/common/closeButton/CloseButton.js.map +1 -1
- package/build/common/closeButton/CloseButton.mjs.map +1 -1
- package/build/flowNavigation/FlowNavigation.js +8 -3
- package/build/flowNavigation/FlowNavigation.js.map +1 -1
- package/build/flowNavigation/FlowNavigation.mjs +8 -3
- package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
- package/build/i18n/de.json +5 -0
- package/build/i18n/de.json.js +5 -0
- package/build/i18n/de.json.js.map +1 -1
- package/build/i18n/de.json.mjs +5 -0
- package/build/i18n/de.json.mjs.map +1 -1
- package/build/iconButton/IconButton.js +41 -0
- package/build/iconButton/IconButton.js.map +1 -0
- package/build/iconButton/IconButton.mjs +39 -0
- package/build/iconButton/IconButton.mjs.map +1 -0
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/index.mjs +1 -0
- package/build/index.mjs.map +1 -1
- package/build/main.css +86 -32
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js +83 -0
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js.map +1 -0
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs +81 -0
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs.map +1 -0
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.js +90 -0
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.js.map +1 -0
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs +88 -0
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs.map +1 -0
- package/build/styles/iconButton/IconButton.css +82 -0
- package/build/styles/main.css +86 -32
- package/build/styles/summary/Summary.css +4 -0
- package/build/summary/Summary.js +3 -3
- package/build/summary/Summary.js.map +1 -1
- package/build/summary/Summary.mjs +3 -3
- package/build/summary/Summary.mjs.map +1 -1
- package/build/types/common/closeButton/CloseButton.d.ts +3 -0
- package/build/types/common/closeButton/CloseButton.d.ts.map +1 -1
- package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
- package/build/types/iconButton/IconButton.d.ts +15 -0
- package/build/types/iconButton/IconButton.d.ts.map +1 -0
- package/build/types/iconButton/index.d.ts +3 -0
- package/build/types/iconButton/index.d.ts.map +1 -0
- package/build/types/index.d.ts +2 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/summary/Summary.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/common/closeButton/CloseButton.tsx +3 -0
- package/src/flowNavigation/FlowNavigation.spec.js +7 -8
- package/src/flowNavigation/FlowNavigation.tsx +11 -2
- package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +27 -3
- package/src/i18n/de.json +5 -0
- package/src/iconButton/IconButton.css +82 -0
- package/src/iconButton/IconButton.less +55 -0
- package/src/iconButton/IconButton.story.tsx +107 -0
- package/src/iconButton/IconButton.tsx +51 -0
- package/src/iconButton/index.ts +2 -0
- package/src/index.ts +2 -0
- package/src/inputs/SelectInput.story.tsx +68 -24
- package/src/main.css +86 -32
- package/src/main.less +1 -1
- package/src/primitives/PrimitiveAnchor/stories/PrimitiveAnchor.tests.story.tsx +81 -32
- package/src/primitives/PrimitiveButton/stories/PrimitiveButton.tests.story.tsx +124 -42
- package/src/summary/Summary.css +4 -0
- package/src/summary/Summary.less +3 -0
- package/src/summary/Summary.story.tsx +13 -3
- package/src/summary/Summary.tsx +13 -11
- package/build/flowNavigation/backButton/BackButton.js +0 -30
- package/build/flowNavigation/backButton/BackButton.js.map +0 -1
- package/build/flowNavigation/backButton/BackButton.mjs +0 -28
- package/build/flowNavigation/backButton/BackButton.mjs.map +0 -1
- package/build/styles/flowNavigation/backButton/BackButton.css +0 -32
- package/build/types/flowNavigation/backButton/BackButton.d.ts +0 -7
- package/build/types/flowNavigation/backButton/BackButton.d.ts.map +0 -1
- package/build/types/flowNavigation/backButton/index.d.ts +0 -3
- package/build/types/flowNavigation/backButton/index.d.ts.map +0 -1
- package/src/flowNavigation/backButton/BackButton.css +0 -32
- package/src/flowNavigation/backButton/BackButton.less +0 -36
- package/src/flowNavigation/backButton/BackButton.tsx +0 -29
- package/src/flowNavigation/backButton/index.ts +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
|
-
import { userEvent, within, expect } from '@storybook/test';
|
|
2
|
+
import { userEvent, within, expect, waitFor } from '@storybook/test';
|
|
3
3
|
import { Meta, StoryObj } from '@storybook/react';
|
|
4
|
-
import PrimitiveButton from '
|
|
4
|
+
import PrimitiveButton from '../src';
|
|
5
5
|
|
|
6
6
|
const meta = {
|
|
7
7
|
title: 'Primitives/Button/Tests',
|
|
@@ -22,11 +22,17 @@ const wait = async (duration = 500) =>
|
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
export const ClickInteraction: Story = {
|
|
25
|
-
play: async ({ canvasElement }) => {
|
|
25
|
+
play: async ({ canvasElement, step }) => {
|
|
26
26
|
const canvas = within(canvasElement);
|
|
27
27
|
const button = canvas.getByRole('button');
|
|
28
|
-
|
|
29
|
-
await
|
|
28
|
+
|
|
29
|
+
await step('Click the button', async () => {
|
|
30
|
+
await userEvent.click(button);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
await step('Check if button text changes to "Clicked!"', async () => {
|
|
34
|
+
await waitFor(async () => expect(button).toHaveTextContent('Clicked!'));
|
|
35
|
+
});
|
|
30
36
|
},
|
|
31
37
|
render: function Render(args) {
|
|
32
38
|
const [clicked, setClicked] = useState(false);
|
|
@@ -40,12 +46,18 @@ export const ClickInteraction: Story = {
|
|
|
40
46
|
};
|
|
41
47
|
|
|
42
48
|
export const FocusInteraction: Story = {
|
|
43
|
-
play: async ({ canvasElement }) => {
|
|
49
|
+
play: async ({ canvasElement, step }) => {
|
|
44
50
|
const canvas = within(canvasElement);
|
|
45
51
|
const button = canvas.getByRole('button');
|
|
46
|
-
|
|
47
|
-
await
|
|
48
|
-
|
|
52
|
+
|
|
53
|
+
await step('Tab to the button', async () => {
|
|
54
|
+
await userEvent.tab();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
await step('Check if button has focus and text changes to "Focused!"', async () => {
|
|
58
|
+
await waitFor(async () => expect(button).toHaveFocus());
|
|
59
|
+
await waitFor(async () => expect(button).toHaveTextContent('Focused!'));
|
|
60
|
+
});
|
|
49
61
|
},
|
|
50
62
|
render: function Render(args) {
|
|
51
63
|
const [focused, setFocused] = useState(false);
|
|
@@ -59,14 +71,26 @@ export const FocusInteraction: Story = {
|
|
|
59
71
|
};
|
|
60
72
|
|
|
61
73
|
export const BlurInteraction: Story = {
|
|
62
|
-
play: async ({ canvasElement }) => {
|
|
74
|
+
play: async ({ canvasElement, step }) => {
|
|
63
75
|
const canvas = within(canvasElement);
|
|
64
76
|
const button = canvas.getByRole('button');
|
|
65
|
-
|
|
66
|
-
await
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
77
|
+
|
|
78
|
+
await step('Tab to the button', async () => {
|
|
79
|
+
await userEvent.tab();
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
await step('Check if button has focus', async () => {
|
|
83
|
+
await waitFor(async () => expect(button).toHaveFocus());
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
await step('Tab away from the button', async () => {
|
|
87
|
+
await userEvent.tab();
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
await step('Check if button loses focus and text changes to "Blurred!"', async () => {
|
|
91
|
+
await waitFor(async () => expect(button).not.toHaveFocus());
|
|
92
|
+
await waitFor(async () => expect(button).toHaveTextContent('Blurred!'));
|
|
93
|
+
});
|
|
70
94
|
},
|
|
71
95
|
render: function Render(args) {
|
|
72
96
|
const [blurred, setBlurred] = useState(false);
|
|
@@ -80,11 +104,17 @@ export const BlurInteraction: Story = {
|
|
|
80
104
|
};
|
|
81
105
|
|
|
82
106
|
export const MouseEnterInteraction: Story = {
|
|
83
|
-
play: async ({ canvasElement }) => {
|
|
107
|
+
play: async ({ canvasElement, step }) => {
|
|
84
108
|
const canvas = within(canvasElement);
|
|
85
109
|
const button = canvas.getByRole('button');
|
|
86
|
-
|
|
87
|
-
await
|
|
110
|
+
|
|
111
|
+
await step('Hover over the button', async () => {
|
|
112
|
+
await userEvent.hover(button);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
await step('Check if button text changes to "Hovered!"', async () => {
|
|
116
|
+
await waitFor(async () => expect(button).toHaveTextContent('Hovered!'));
|
|
117
|
+
});
|
|
88
118
|
},
|
|
89
119
|
render: function Render(args) {
|
|
90
120
|
const [hovered, setHovered] = useState(false);
|
|
@@ -98,11 +128,21 @@ export const MouseEnterInteraction: Story = {
|
|
|
98
128
|
};
|
|
99
129
|
|
|
100
130
|
export const MouseLeaveInteraction: Story = {
|
|
101
|
-
play: async ({ canvasElement }) => {
|
|
131
|
+
play: async ({ canvasElement, step }) => {
|
|
102
132
|
const canvas = within(canvasElement);
|
|
103
133
|
const button = canvas.getByRole('button');
|
|
104
|
-
|
|
105
|
-
await
|
|
134
|
+
|
|
135
|
+
await step('Hover over the button', async () => {
|
|
136
|
+
await userEvent.hover(button);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
await step('Unhover the button', async () => {
|
|
140
|
+
await userEvent.unhover(button);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
await step('Check if button text changes to "Left!"', async () => {
|
|
144
|
+
await waitFor(async () => expect(button).toHaveTextContent('Left!'));
|
|
145
|
+
});
|
|
106
146
|
},
|
|
107
147
|
render: function Render(args) {
|
|
108
148
|
const [left, setLeft] = useState(false);
|
|
@@ -116,11 +156,17 @@ export const MouseLeaveInteraction: Story = {
|
|
|
116
156
|
};
|
|
117
157
|
|
|
118
158
|
export const KeyDownInteraction: Story = {
|
|
119
|
-
play: async ({ canvasElement }) => {
|
|
159
|
+
play: async ({ canvasElement, step }) => {
|
|
120
160
|
const canvas = within(canvasElement);
|
|
121
161
|
const button = canvas.getByRole('button');
|
|
122
|
-
|
|
123
|
-
await
|
|
162
|
+
|
|
163
|
+
await step('Press Enter key on the button', async () => {
|
|
164
|
+
await userEvent.type(button, '{enter}');
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
await step('Check if button text changes to "Key Pressed!"', async () => {
|
|
168
|
+
await waitFor(async () => expect(button).toHaveTextContent('Key Pressed!'));
|
|
169
|
+
});
|
|
124
170
|
},
|
|
125
171
|
render: function Render(args) {
|
|
126
172
|
const [keyPressed, setKeyPressed] = useState(false);
|
|
@@ -134,11 +180,17 @@ export const KeyDownInteraction: Story = {
|
|
|
134
180
|
};
|
|
135
181
|
|
|
136
182
|
export const DisabledClickInteraction: Story = {
|
|
137
|
-
play: async ({ canvasElement }) => {
|
|
183
|
+
play: async ({ canvasElement, step }) => {
|
|
138
184
|
const canvas = within(canvasElement);
|
|
139
185
|
const button = canvas.getByRole('button');
|
|
140
|
-
|
|
141
|
-
await
|
|
186
|
+
|
|
187
|
+
await step('Click the disabled button', async () => {
|
|
188
|
+
await userEvent.click(button);
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
await step('Check if button text remains "Button text"', async () => {
|
|
192
|
+
await waitFor(async () => expect(button).toHaveTextContent('Button text'));
|
|
193
|
+
});
|
|
142
194
|
},
|
|
143
195
|
render: function Render(args) {
|
|
144
196
|
return (
|
|
@@ -150,11 +202,17 @@ export const DisabledClickInteraction: Story = {
|
|
|
150
202
|
};
|
|
151
203
|
|
|
152
204
|
export const DisabledFocusInteraction: Story = {
|
|
153
|
-
play: async ({ canvasElement }) => {
|
|
205
|
+
play: async ({ canvasElement, step }) => {
|
|
154
206
|
const canvas = within(canvasElement);
|
|
155
207
|
const button = canvas.getByRole('button');
|
|
156
|
-
|
|
157
|
-
await
|
|
208
|
+
|
|
209
|
+
await step('Tab to the disabled button', async () => {
|
|
210
|
+
await userEvent.tab();
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
await step('Check if button does not have focus', async () => {
|
|
214
|
+
await waitFor(async () => expect(button).not.toHaveFocus());
|
|
215
|
+
});
|
|
158
216
|
},
|
|
159
217
|
render: function Render(args) {
|
|
160
218
|
return (
|
|
@@ -166,11 +224,17 @@ export const DisabledFocusInteraction: Story = {
|
|
|
166
224
|
};
|
|
167
225
|
|
|
168
226
|
export const DisabledBlurInteraction: Story = {
|
|
169
|
-
play: async ({ canvasElement }) => {
|
|
227
|
+
play: async ({ canvasElement, step }) => {
|
|
170
228
|
const canvas = within(canvasElement);
|
|
171
229
|
const button = canvas.getByRole('button');
|
|
172
|
-
|
|
173
|
-
await
|
|
230
|
+
|
|
231
|
+
await step('Tab to the disabled button', async () => {
|
|
232
|
+
await userEvent.tab();
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
await step('Check if button does not have focus', async () => {
|
|
236
|
+
await waitFor(async () => expect(button).not.toHaveFocus());
|
|
237
|
+
});
|
|
174
238
|
},
|
|
175
239
|
render: function Render(args) {
|
|
176
240
|
return (
|
|
@@ -182,11 +246,17 @@ export const DisabledBlurInteraction: Story = {
|
|
|
182
246
|
};
|
|
183
247
|
|
|
184
248
|
export const DisabledKeyDownInteraction: Story = {
|
|
185
|
-
play: async ({ canvasElement }) => {
|
|
249
|
+
play: async ({ canvasElement, step }) => {
|
|
186
250
|
const canvas = within(canvasElement);
|
|
187
251
|
const button = canvas.getByRole('button');
|
|
188
|
-
|
|
189
|
-
await
|
|
252
|
+
|
|
253
|
+
await step('Press Enter key on the disabled button', async () => {
|
|
254
|
+
await userEvent.type(button, '{enter}');
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
await step('Check if button text remains "Button text"', async () => {
|
|
258
|
+
await waitFor(async () => expect(button).toHaveTextContent('Button text'));
|
|
259
|
+
});
|
|
190
260
|
},
|
|
191
261
|
render: function Render(args) {
|
|
192
262
|
return (
|
|
@@ -198,11 +268,17 @@ export const DisabledKeyDownInteraction: Story = {
|
|
|
198
268
|
};
|
|
199
269
|
|
|
200
270
|
export const DisabledMouseEnterInteraction: Story = {
|
|
201
|
-
play: async ({ canvasElement }) => {
|
|
271
|
+
play: async ({ canvasElement, step }) => {
|
|
202
272
|
const canvas = within(canvasElement);
|
|
203
273
|
const button = canvas.getByRole('button');
|
|
204
|
-
|
|
205
|
-
await
|
|
274
|
+
|
|
275
|
+
await step('Hover over the disabled button', async () => {
|
|
276
|
+
await userEvent.hover(button);
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
await step('Check if button text remains "Button text"', async () => {
|
|
280
|
+
await waitFor(async () => expect(button).toHaveTextContent('Button text'));
|
|
281
|
+
});
|
|
206
282
|
},
|
|
207
283
|
render: function Render(args) {
|
|
208
284
|
return (
|
|
@@ -214,11 +290,17 @@ export const DisabledMouseEnterInteraction: Story = {
|
|
|
214
290
|
};
|
|
215
291
|
|
|
216
292
|
export const DisabledMouseLeaveInteraction: Story = {
|
|
217
|
-
play: async ({ canvasElement }) => {
|
|
293
|
+
play: async ({ canvasElement, step }) => {
|
|
218
294
|
const canvas = within(canvasElement);
|
|
219
295
|
const button = canvas.getByRole('button');
|
|
220
|
-
|
|
221
|
-
await
|
|
296
|
+
|
|
297
|
+
await step('Unhover the disabled button', async () => {
|
|
298
|
+
await userEvent.unhover(button);
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
await step('Check if button text remains "Button text"', async () => {
|
|
302
|
+
await waitFor(async () => expect(button).toHaveTextContent('Button text'));
|
|
303
|
+
});
|
|
222
304
|
},
|
|
223
305
|
render: function Render(args) {
|
|
224
306
|
return (
|
package/src/summary/Summary.css
CHANGED
package/src/summary/Summary.less
CHANGED
|
@@ -38,7 +38,7 @@ export const Basic = () => {
|
|
|
38
38
|
'aria-label': ' Click here to change address',
|
|
39
39
|
}}
|
|
40
40
|
as="li"
|
|
41
|
-
description=
|
|
41
|
+
description={description}
|
|
42
42
|
info={{
|
|
43
43
|
title: 'You entered your address',
|
|
44
44
|
content: 'Your address has been verified, no more actions are required.',
|
|
@@ -58,7 +58,7 @@ export const Basic = () => {
|
|
|
58
58
|
'aria-label': ' Click here to change address',
|
|
59
59
|
}}
|
|
60
60
|
as="li"
|
|
61
|
-
description=
|
|
61
|
+
description={description}
|
|
62
62
|
info={{
|
|
63
63
|
title: 'Address verification pending',
|
|
64
64
|
content:
|
|
@@ -80,11 +80,21 @@ export const Basic = () => {
|
|
|
80
80
|
target: '_blank',
|
|
81
81
|
}}
|
|
82
82
|
as="li"
|
|
83
|
-
description=
|
|
83
|
+
description={description}
|
|
84
84
|
icon={<HomeIcon size={24} />}
|
|
85
85
|
title="We’re verifying your address"
|
|
86
86
|
status={Status.PENDING}
|
|
87
87
|
/>
|
|
88
|
+
<Summary
|
|
89
|
+
action={{
|
|
90
|
+
text: actionText,
|
|
91
|
+
href: '#change-address',
|
|
92
|
+
'aria-label': ' Click here to change address',
|
|
93
|
+
}}
|
|
94
|
+
as="li"
|
|
95
|
+
description={description}
|
|
96
|
+
title={title}
|
|
97
|
+
/>
|
|
88
98
|
</ul>
|
|
89
99
|
);
|
|
90
100
|
};
|
package/src/summary/Summary.tsx
CHANGED
|
@@ -124,16 +124,18 @@ const Summary = ({
|
|
|
124
124
|
// @ts-expect-error we check whether `status` is not null before index `statusLabels` and `messages`
|
|
125
125
|
aria-label={status && intl.formatMessage(messages[statusLabels[status]])}
|
|
126
126
|
>
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
127
|
+
{icon && (
|
|
128
|
+
<div className="np-summary__icon">
|
|
129
|
+
{media}
|
|
130
|
+
{Badge && (
|
|
131
|
+
<div>
|
|
132
|
+
{/* @ts-expect-error it's okey to pass `undefined` into `sentiment` prop */}
|
|
133
|
+
<StatusIcon size={Size.SMALL} sentiment={statusMapping[status]} />
|
|
134
|
+
</div>
|
|
135
|
+
)}
|
|
136
|
+
</div>
|
|
137
|
+
)}
|
|
138
|
+
<div className={`np-summary__body ${icon ? 'm-l-2' : ''}`}>
|
|
137
139
|
<div className="np-summary__title d-flex">
|
|
138
140
|
<Body
|
|
139
141
|
as="span"
|
|
@@ -161,7 +163,7 @@ const Summary = ({
|
|
|
161
163
|
<Body
|
|
162
164
|
as="span"
|
|
163
165
|
type={Typography.BODY_DEFAULT}
|
|
164
|
-
className=
|
|
166
|
+
className={`d-block ${icon ? 'np-summary__description' : 'np-summary__description-icon'}`}
|
|
165
167
|
>
|
|
166
168
|
{description}
|
|
167
169
|
</Body>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var icons = require('@transferwise/icons');
|
|
4
|
-
var clsx = require('clsx');
|
|
5
|
-
var avatarTypes = require('../../avatar/avatarTypes.js');
|
|
6
|
-
var Avatar = require('../../avatar/Avatar.js');
|
|
7
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
-
|
|
9
|
-
function BackButton({
|
|
10
|
-
className,
|
|
11
|
-
onClick,
|
|
12
|
-
'aria-label': ariaLabel
|
|
13
|
-
}) {
|
|
14
|
-
return /*#__PURE__*/jsxRuntime.jsx(Avatar, {
|
|
15
|
-
type: avatarTypes.AvatarType.ICON,
|
|
16
|
-
size: 40,
|
|
17
|
-
children: /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
18
|
-
type: "button",
|
|
19
|
-
"aria-label": ariaLabel,
|
|
20
|
-
className: clsx.clsx('np-back-button', 'btn-unstyled', className),
|
|
21
|
-
onClick: onClick,
|
|
22
|
-
children: /*#__PURE__*/jsxRuntime.jsx(icons.ArrowLeft, {
|
|
23
|
-
size: 24
|
|
24
|
-
})
|
|
25
|
-
})
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
module.exports = BackButton;
|
|
30
|
-
//# sourceMappingURL=BackButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BackButton.js","sources":["../../../src/flowNavigation/backButton/BackButton.tsx"],"sourcesContent":["import { ArrowLeft as ArrowLeftIcon } from '@transferwise/icons';\nimport { clsx } from 'clsx';\n\nimport Avatar, { AvatarType } from '../../avatar';\n\nexport interface BackButtonProps {\n 'aria-label': string;\n className?: string;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n}\n\nexport default function BackButton({\n className,\n onClick,\n 'aria-label': ariaLabel,\n}: BackButtonProps) {\n return (\n <Avatar type={AvatarType.ICON} size={40}>\n <button\n type=\"button\"\n aria-label={ariaLabel}\n className={clsx('np-back-button', 'btn-unstyled', className)}\n onClick={onClick}\n >\n <ArrowLeftIcon size={24} />\n </button>\n </Avatar>\n );\n}\n"],"names":["BackButton","className","onClick","ariaLabel","_jsx","Avatar","type","AvatarType","ICON","size","children","clsx","ArrowLeftIcon"],"mappings":";;;;;;;;AAWwB,SAAAA,UAAUA,CAAC;EACjCC,SAAS;EACTC,OAAO;AACP,EAAA,YAAY,EAAEC,SAAAA;AACE,CAAA,EAAA;EAChB,oBACEC,cAAA,CAACC,MAAM,EAAA;IAACC,IAAI,EAAEC,sBAAU,CAACC,IAAK;AAACC,IAAAA,IAAI,EAAE,EAAG;AAAAC,IAAAA,QAAA,eACtCN,cAAA,CAAA,QAAA,EAAA;AACEE,MAAAA,IAAI,EAAC,QAAQ;AACb,MAAA,YAAA,EAAYH,SAAU;MACtBF,SAAS,EAAEU,SAAI,CAAC,gBAAgB,EAAE,cAAc,EAAEV,SAAS,CAAE;AAC7DC,MAAAA,OAAO,EAAEA,OAAQ;MAAAQ,QAAA,eAEjBN,cAAA,CAACQ,eAAa,EAAA;AAACH,QAAAA,IAAI,EAAE,EAAA;OACvB,CAAA;KAAQ,CAAA;AACV,GAAQ,CAAC,CAAA;AAEb;;;;"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ArrowLeft } from '@transferwise/icons';
|
|
2
|
-
import { clsx } from 'clsx';
|
|
3
|
-
import { AvatarType } from '../../avatar/avatarTypes.mjs';
|
|
4
|
-
import Avatar from '../../avatar/Avatar.mjs';
|
|
5
|
-
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
function BackButton({
|
|
8
|
-
className,
|
|
9
|
-
onClick,
|
|
10
|
-
'aria-label': ariaLabel
|
|
11
|
-
}) {
|
|
12
|
-
return /*#__PURE__*/jsx(Avatar, {
|
|
13
|
-
type: AvatarType.ICON,
|
|
14
|
-
size: 40,
|
|
15
|
-
children: /*#__PURE__*/jsx("button", {
|
|
16
|
-
type: "button",
|
|
17
|
-
"aria-label": ariaLabel,
|
|
18
|
-
className: clsx('np-back-button', 'btn-unstyled', className),
|
|
19
|
-
onClick: onClick,
|
|
20
|
-
children: /*#__PURE__*/jsx(ArrowLeft, {
|
|
21
|
-
size: 24
|
|
22
|
-
})
|
|
23
|
-
})
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export { BackButton as default };
|
|
28
|
-
//# sourceMappingURL=BackButton.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BackButton.mjs","sources":["../../../src/flowNavigation/backButton/BackButton.tsx"],"sourcesContent":["import { ArrowLeft as ArrowLeftIcon } from '@transferwise/icons';\nimport { clsx } from 'clsx';\n\nimport Avatar, { AvatarType } from '../../avatar';\n\nexport interface BackButtonProps {\n 'aria-label': string;\n className?: string;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n}\n\nexport default function BackButton({\n className,\n onClick,\n 'aria-label': ariaLabel,\n}: BackButtonProps) {\n return (\n <Avatar type={AvatarType.ICON} size={40}>\n <button\n type=\"button\"\n aria-label={ariaLabel}\n className={clsx('np-back-button', 'btn-unstyled', className)}\n onClick={onClick}\n >\n <ArrowLeftIcon size={24} />\n </button>\n </Avatar>\n );\n}\n"],"names":["BackButton","className","onClick","ariaLabel","_jsx","Avatar","type","AvatarType","ICON","size","children","clsx","ArrowLeftIcon"],"mappings":";;;;;;AAWwB,SAAAA,UAAUA,CAAC;EACjCC,SAAS;EACTC,OAAO;AACP,EAAA,YAAY,EAAEC,SAAAA;AACE,CAAA,EAAA;EAChB,oBACEC,GAAA,CAACC,MAAM,EAAA;IAACC,IAAI,EAAEC,UAAU,CAACC,IAAK;AAACC,IAAAA,IAAI,EAAE,EAAG;AAAAC,IAAAA,QAAA,eACtCN,GAAA,CAAA,QAAA,EAAA;AACEE,MAAAA,IAAI,EAAC,QAAQ;AACb,MAAA,YAAA,EAAYH,SAAU;MACtBF,SAAS,EAAEU,IAAI,CAAC,gBAAgB,EAAE,cAAc,EAAEV,SAAS,CAAE;AAC7DC,MAAAA,OAAO,EAAEA,OAAQ;MAAAQ,QAAA,eAEjBN,GAAA,CAACQ,SAAa,EAAA;AAACH,QAAAA,IAAI,EAAE,EAAA;OACvB,CAAA;KAAQ,CAAA;AACV,GAAQ,CAAC,CAAA;AAEb;;;;"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
.np-back-button {
|
|
2
|
-
color: #00a2dd;
|
|
3
|
-
color: var(--color-interactive-accent);
|
|
4
|
-
display: flex !important;
|
|
5
|
-
}
|
|
6
|
-
.np-back-button:hover {
|
|
7
|
-
color: #008fc9;
|
|
8
|
-
color: var(--color-interactive-accent-hover);
|
|
9
|
-
}
|
|
10
|
-
.np-back-button:active {
|
|
11
|
-
color: #0081ba;
|
|
12
|
-
color: var(--color-interactive-accent-active);
|
|
13
|
-
}
|
|
14
|
-
.np-theme-personal .np-back-button {
|
|
15
|
-
color: #37517e;
|
|
16
|
-
color: var(--color-content-primary);
|
|
17
|
-
}
|
|
18
|
-
.np-theme-personal .np-back-button:hover {
|
|
19
|
-
color: var(--color-content-primary-hover);
|
|
20
|
-
}
|
|
21
|
-
.np-theme-personal .np-back-button:active {
|
|
22
|
-
color: var(--color-content-primary-active);
|
|
23
|
-
}
|
|
24
|
-
.np-theme-personal .np-back-button .tw-icon {
|
|
25
|
-
color: var(--color-interactive-primary);
|
|
26
|
-
}
|
|
27
|
-
.np-theme-personal .np-back-button .tw-icon:hover {
|
|
28
|
-
color: var(--color-interactive-primary-hover);
|
|
29
|
-
}
|
|
30
|
-
.np-theme-personal .np-back-button .tw-icon:active {
|
|
31
|
-
color: var(--color-interactive-primary-active);
|
|
32
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export interface BackButtonProps {
|
|
2
|
-
'aria-label': string;
|
|
3
|
-
className?: string;
|
|
4
|
-
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
5
|
-
}
|
|
6
|
-
export default function BackButton({ className, onClick, 'aria-label': ariaLabel, }: BackButtonProps): import("react").JSX.Element;
|
|
7
|
-
//# sourceMappingURL=BackButton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BackButton.d.ts","sourceRoot":"","sources":["../../../../src/flowNavigation/backButton/BackButton.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CACtD;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,SAAS,EACT,OAAO,EACP,YAAY,EAAE,SAAS,GACxB,EAAE,eAAe,+BAajB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/flowNavigation/backButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
.np-back-button {
|
|
2
|
-
color: #00a2dd;
|
|
3
|
-
color: var(--color-interactive-accent);
|
|
4
|
-
display: flex !important;
|
|
5
|
-
}
|
|
6
|
-
.np-back-button:hover {
|
|
7
|
-
color: #008fc9;
|
|
8
|
-
color: var(--color-interactive-accent-hover);
|
|
9
|
-
}
|
|
10
|
-
.np-back-button:active {
|
|
11
|
-
color: #0081ba;
|
|
12
|
-
color: var(--color-interactive-accent-active);
|
|
13
|
-
}
|
|
14
|
-
.np-theme-personal .np-back-button {
|
|
15
|
-
color: #37517e;
|
|
16
|
-
color: var(--color-content-primary);
|
|
17
|
-
}
|
|
18
|
-
.np-theme-personal .np-back-button:hover {
|
|
19
|
-
color: var(--color-content-primary-hover);
|
|
20
|
-
}
|
|
21
|
-
.np-theme-personal .np-back-button:active {
|
|
22
|
-
color: var(--color-content-primary-active);
|
|
23
|
-
}
|
|
24
|
-
.np-theme-personal .np-back-button .tw-icon {
|
|
25
|
-
color: var(--color-interactive-primary);
|
|
26
|
-
}
|
|
27
|
-
.np-theme-personal .np-back-button .tw-icon:hover {
|
|
28
|
-
color: var(--color-interactive-primary-hover);
|
|
29
|
-
}
|
|
30
|
-
.np-theme-personal .np-back-button .tw-icon:active {
|
|
31
|
-
color: var(--color-interactive-primary-active);
|
|
32
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
.np-back-button {
|
|
2
|
-
color: var(--color-interactive-accent);
|
|
3
|
-
display: flex !important;
|
|
4
|
-
|
|
5
|
-
&:hover {
|
|
6
|
-
color: var(--color-interactive-accent-hover);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
&:active {
|
|
10
|
-
color: var(--color-interactive-accent-active);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.np-theme-personal & {
|
|
14
|
-
color: var(--color-content-primary);
|
|
15
|
-
|
|
16
|
-
&:hover {
|
|
17
|
-
color: var(--color-content-primary-hover);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&:active {
|
|
21
|
-
color: var(--color-content-primary-active);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
& .tw-icon {
|
|
25
|
-
color: var(--color-interactive-primary);
|
|
26
|
-
|
|
27
|
-
&:hover {
|
|
28
|
-
color: var(--color-interactive-primary-hover);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&:active {
|
|
32
|
-
color: var(--color-interactive-primary-active);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ArrowLeft as ArrowLeftIcon } from '@transferwise/icons';
|
|
2
|
-
import { clsx } from 'clsx';
|
|
3
|
-
|
|
4
|
-
import Avatar, { AvatarType } from '../../avatar';
|
|
5
|
-
|
|
6
|
-
export interface BackButtonProps {
|
|
7
|
-
'aria-label': string;
|
|
8
|
-
className?: string;
|
|
9
|
-
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default function BackButton({
|
|
13
|
-
className,
|
|
14
|
-
onClick,
|
|
15
|
-
'aria-label': ariaLabel,
|
|
16
|
-
}: BackButtonProps) {
|
|
17
|
-
return (
|
|
18
|
-
<Avatar type={AvatarType.ICON} size={40}>
|
|
19
|
-
<button
|
|
20
|
-
type="button"
|
|
21
|
-
aria-label={ariaLabel}
|
|
22
|
-
className={clsx('np-back-button', 'btn-unstyled', className)}
|
|
23
|
-
onClick={onClick}
|
|
24
|
-
>
|
|
25
|
-
<ArrowLeftIcon size={24} />
|
|
26
|
-
</button>
|
|
27
|
-
</Avatar>
|
|
28
|
-
);
|
|
29
|
-
}
|