@transferwise/components 46.65.0 → 46.67.0
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/decision/Decision.js +4 -0
- package/build/decision/Decision.js.map +1 -1
- package/build/decision/Decision.mjs +4 -0
- package/build/decision/Decision.mjs.map +1 -1
- package/build/i18n/en.json +1 -0
- package/build/i18n/en.json.js +1 -0
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/en.json.mjs +1 -0
- package/build/i18n/en.json.mjs.map +1 -1
- package/build/inputs/SelectInput.js +4 -0
- package/build/inputs/SelectInput.js.map +1 -1
- package/build/inputs/SelectInput.mjs +4 -0
- package/build/inputs/SelectInput.mjs.map +1 -1
- package/build/main.css +0 -24
- package/build/moneyInput/MoneyInput.js +8 -1
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.messages.js +3 -0
- package/build/moneyInput/MoneyInput.messages.js.map +1 -1
- package/build/moneyInput/MoneyInput.messages.mjs +3 -0
- package/build/moneyInput/MoneyInput.messages.mjs.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +8 -1
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/stepper/Stepper.js +12 -1
- package/build/stepper/Stepper.js.map +1 -1
- package/build/stepper/Stepper.mjs +12 -1
- package/build/stepper/Stepper.mjs.map +1 -1
- package/build/styles/main.css +0 -24
- package/build/styles/stepper/Stepper.css +0 -24
- package/build/tile/Tile.js +2 -0
- package/build/tile/Tile.js.map +1 -1
- package/build/tile/Tile.mjs +2 -0
- package/build/tile/Tile.mjs.map +1 -1
- package/build/types/decision/Decision.d.ts +1 -0
- package/build/types/decision/Decision.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts +3 -1
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.messages.d.ts +5 -0
- package/build/types/moneyInput/MoneyInput.messages.d.ts.map +1 -1
- package/build/types/stepper/Stepper.d.ts.map +1 -1
- package/build/types/tile/Tile.d.ts +3 -1
- package/build/types/tile/Tile.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/decision/Decision.spec.tsx +166 -0
- package/src/decision/Decision.story.tsx +208 -202
- package/src/decision/Decision.tsx +26 -2
- package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +1 -2
- package/src/i18n/en.json +1 -0
- package/src/inputs/SelectInput.tsx +8 -3
- package/src/main.css +0 -24
- package/src/moneyInput/MoneyInput.docs.mdx +34 -0
- package/src/moneyInput/MoneyInput.messages.ts +5 -0
- package/src/moneyInput/MoneyInput.rtl.spec.tsx +47 -0
- package/src/moneyInput/MoneyInput.spec.js +0 -11
- package/src/moneyInput/MoneyInput.story.tsx +10 -7
- package/src/moneyInput/MoneyInput.tsx +8 -1
- package/src/stepper/Stepper.css +0 -24
- package/src/stepper/Stepper.less +0 -17
- package/src/stepper/Stepper.spec.js +11 -5
- package/src/stepper/Stepper.tsx +13 -2
- package/src/tile/Tile.tsx +4 -0
- package/src/withId/withId.story.tsx +1 -0
- package/src/decision/Decision.spec.js +0 -127
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import Avatar from '../avatar';
|
|
2
|
+
import { Breakpoint, Size } from '../common';
|
|
3
|
+
import { mockMatchMedia } from '../mocks';
|
|
4
|
+
import { render, screen } from '../test-utils';
|
|
5
|
+
|
|
6
|
+
import Decision, { DecisionPresentation, DecisionType } from '.';
|
|
7
|
+
import { DecisionProps } from './Decision';
|
|
8
|
+
|
|
9
|
+
mockMatchMedia(jest);
|
|
10
|
+
|
|
11
|
+
describe('Decision', () => {
|
|
12
|
+
const commonProps: DecisionProps = {
|
|
13
|
+
options: [
|
|
14
|
+
{
|
|
15
|
+
media: {
|
|
16
|
+
list: <Avatar type="initials">HM</Avatar>,
|
|
17
|
+
block: <img src="img.jpg" alt="alt" />,
|
|
18
|
+
},
|
|
19
|
+
href: '#href',
|
|
20
|
+
title: 'title',
|
|
21
|
+
description: 'description',
|
|
22
|
+
'aria-label': 'A label',
|
|
23
|
+
onClick: jest.fn(),
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
presentation: DecisionPresentation.LIST_BLOCK,
|
|
27
|
+
type: DecisionType.NAVIGATION,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const initialInnerWidth = window.innerWidth;
|
|
31
|
+
const resetClientWidth = (width: number) => {
|
|
32
|
+
window.innerWidth = width;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
afterAll(() => {
|
|
36
|
+
window.innerWidth = initialInnerWidth;
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
beforeEach(() => {
|
|
40
|
+
resetClientWidth(Breakpoint.EXTRA_SMALL - 1);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
describe(`when presentation is ${DecisionPresentation.LIST_BLOCK}`, () => {
|
|
44
|
+
const props = { ...commonProps };
|
|
45
|
+
|
|
46
|
+
it('renders only Navigation Option before first breakpoint', () => {
|
|
47
|
+
render(<Decision {...props} />);
|
|
48
|
+
const element = screen.getByLabelText('A label');
|
|
49
|
+
expect(element).toBeInTheDocument();
|
|
50
|
+
|
|
51
|
+
expectElementToBeNavigationOption(element);
|
|
52
|
+
expectElementNotToBeTile(element);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('renders only Tile after first breakpoint', () => {
|
|
56
|
+
resetClientWidth(Breakpoint.SMALL);
|
|
57
|
+
|
|
58
|
+
render(<Decision {...props} />);
|
|
59
|
+
const element = screen.getByLabelText('A label');
|
|
60
|
+
expect(element).toBeInTheDocument();
|
|
61
|
+
|
|
62
|
+
expectElementNotToBeNavigationOption(element);
|
|
63
|
+
expectElementToBeTile(element);
|
|
64
|
+
expectElementNotToBeSmallTile(element);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
describe(`when presentation is ${DecisionPresentation.LIST_BLOCK_GRID}`, () => {
|
|
69
|
+
const props = { ...commonProps, presentation: DecisionPresentation.LIST_BLOCK_GRID };
|
|
70
|
+
|
|
71
|
+
it('renders only Navigation Option before first breakpoint', () => {
|
|
72
|
+
render(<Decision {...props} />);
|
|
73
|
+
const element = screen.getByLabelText('A label');
|
|
74
|
+
expect(element).toBeInTheDocument();
|
|
75
|
+
|
|
76
|
+
expectElementToBeNavigationOption(element);
|
|
77
|
+
expectElementNotToBeTile(element);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('renders only Tile after first breakpoint', () => {
|
|
81
|
+
resetClientWidth(Breakpoint.SMALL);
|
|
82
|
+
|
|
83
|
+
render(<Decision {...props} />);
|
|
84
|
+
const element = screen.getByLabelText('A label');
|
|
85
|
+
expect(element).toBeInTheDocument();
|
|
86
|
+
|
|
87
|
+
expectElementNotToBeNavigationOption(element);
|
|
88
|
+
expectElementToBeTile(element);
|
|
89
|
+
expectElementNotToBeSmallTile(element);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('renders container as a grid', () => {
|
|
93
|
+
resetClientWidth(Breakpoint.SMALL);
|
|
94
|
+
|
|
95
|
+
render(<Decision {...props} />);
|
|
96
|
+
const element = screen.getByLabelText('A label').parentElement;
|
|
97
|
+
|
|
98
|
+
expect(element).toHaveClass('np-decision');
|
|
99
|
+
expect(element).toHaveClass('np-decision--grid');
|
|
100
|
+
expect(element).toHaveClass('flex-wrap');
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
describe(`when presentation is ${DecisionPresentation.LIST_BLOCK} and size is Small`, () => {
|
|
105
|
+
const props: DecisionProps = {
|
|
106
|
+
...commonProps,
|
|
107
|
+
presentation: DecisionPresentation.LIST_BLOCK,
|
|
108
|
+
size: Size.SMALL,
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
it('renders only Navigation Option before breakpoint', () => {
|
|
112
|
+
render(<Decision {...props} />);
|
|
113
|
+
const element = screen.getByLabelText('A label');
|
|
114
|
+
expect(element).toBeInTheDocument();
|
|
115
|
+
|
|
116
|
+
expectElementToBeNavigationOption(element);
|
|
117
|
+
expectElementNotToBeTile(element);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it('renders Small Tile after breakpoint', () => {
|
|
121
|
+
resetClientWidth(Breakpoint.EXTRA_SMALL);
|
|
122
|
+
|
|
123
|
+
render(<Decision {...props} />);
|
|
124
|
+
const element = screen.getByLabelText('A label');
|
|
125
|
+
expect(element).toBeInTheDocument();
|
|
126
|
+
|
|
127
|
+
expectElementNotToBeNavigationOption(element);
|
|
128
|
+
expectElementToBeTile(element);
|
|
129
|
+
expectElementToBeSmallTile(element);
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
describe(`when presentation is ${DecisionPresentation.LIST}`, () => {
|
|
134
|
+
const props = { ...commonProps, presentation: DecisionPresentation.LIST };
|
|
135
|
+
|
|
136
|
+
it('renders Navigation Option before breakpoint', () => {
|
|
137
|
+
render(<Decision {...props} />);
|
|
138
|
+
const element = screen.getByLabelText('A label');
|
|
139
|
+
expect(element).toBeInTheDocument();
|
|
140
|
+
|
|
141
|
+
expectElementToBeNavigationOption(element);
|
|
142
|
+
expectElementNotToBeTile(element);
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
const expectElementToBeNavigationOption = (element: HTMLElement) => {
|
|
147
|
+
expect(element).toHaveClass('np-navigation-option');
|
|
148
|
+
};
|
|
149
|
+
const expectElementNotToBeNavigationOption = (element: HTMLElement) => {
|
|
150
|
+
expect(element).not.toHaveClass('np-navigation-option');
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const expectElementToBeTile = (element: HTMLElement) => {
|
|
154
|
+
expect(element).toHaveClass('np-tile');
|
|
155
|
+
};
|
|
156
|
+
const expectElementNotToBeTile = (element: HTMLElement) => {
|
|
157
|
+
expect(element).not.toHaveClass('np-tile');
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const expectElementToBeSmallTile = (element: HTMLElement) => {
|
|
161
|
+
expect(element).toHaveClass('np-tile--small');
|
|
162
|
+
};
|
|
163
|
+
const expectElementNotToBeSmallTile = (element: HTMLElement) => {
|
|
164
|
+
expect(element).not.toHaveClass('np-tile--small');
|
|
165
|
+
};
|
|
166
|
+
});
|
|
@@ -24,63 +24,64 @@ export const Basic = () => {
|
|
|
24
24
|
const size = select('size', [Size.MEDIUM, Size.SMALL], Size.MEDIUM);
|
|
25
25
|
|
|
26
26
|
return (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
),
|
|
42
|
-
},
|
|
43
|
-
title: 'Hank Miller',
|
|
27
|
+
<Decision
|
|
28
|
+
options={[
|
|
29
|
+
{
|
|
30
|
+
description: 'Short text test.',
|
|
31
|
+
onClick: action('clicked'),
|
|
32
|
+
href: '#href1',
|
|
33
|
+
disabled,
|
|
34
|
+
media: {
|
|
35
|
+
block: <Illustration name="globe" alt="" disablePadding />,
|
|
36
|
+
list: (
|
|
37
|
+
<Avatar size="md" type="initials">
|
|
38
|
+
HM
|
|
39
|
+
</Avatar>
|
|
40
|
+
),
|
|
44
41
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
42
|
+
'aria-label': 'Click to see something',
|
|
43
|
+
title: 'Hank Miller',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
description:
|
|
47
|
+
"Click here to send money to Hank Miller. Money will be sent directly to Han Miller's multi-currency account.",
|
|
48
|
+
onClick: action('clicked'),
|
|
49
|
+
disabled,
|
|
50
|
+
href: '#href2',
|
|
51
|
+
media: {
|
|
52
|
+
block: <Illustration name="confetti" alt="" disablePadding />,
|
|
53
|
+
list: (
|
|
54
|
+
<Avatar size="md" type="initials">
|
|
55
|
+
HM
|
|
56
|
+
</Avatar>
|
|
57
|
+
),
|
|
60
58
|
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
59
|
+
'aria-label': 'Click here to send money to Hank Miller.',
|
|
60
|
+
title: 'Hank Miller',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
description: "I'm disabled and don't require an onClick or href.",
|
|
64
|
+
media: {
|
|
65
|
+
block: <Illustration name="briefcase" alt="" disablePadding />,
|
|
66
|
+
list: (
|
|
67
|
+
<img
|
|
68
|
+
src="https://wise.com/public-resources/assets/illustrations/business_account_web_small.svg"
|
|
69
|
+
alt=""
|
|
70
|
+
width="100"
|
|
71
|
+
/>
|
|
72
|
+
),
|
|
75
73
|
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
74
|
+
'aria-label': 'This option is disabled.',
|
|
75
|
+
disabled: true,
|
|
76
|
+
title: 'Hank Miller',
|
|
77
|
+
},
|
|
78
|
+
]}
|
|
79
|
+
presentation={presentation}
|
|
80
|
+
type={DecisionType.NAVIGATION}
|
|
81
|
+
showMediaCircleInList={showMediaCircleInList}
|
|
82
|
+
isContainerAligned={isContainerAligned}
|
|
83
|
+
size={size}
|
|
84
|
+
/>
|
|
84
85
|
);
|
|
85
86
|
};
|
|
86
87
|
|
|
@@ -94,160 +95,165 @@ export const grid = () => {
|
|
|
94
95
|
const size = select('size', [Size.MEDIUM, Size.SMALL], Size.MEDIUM);
|
|
95
96
|
|
|
96
97
|
return (
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
),
|
|
117
|
-
},
|
|
118
|
-
title: 'Hank Miller',
|
|
98
|
+
<Decision
|
|
99
|
+
options={[
|
|
100
|
+
{
|
|
101
|
+
description: 'Short text test.',
|
|
102
|
+
onClick: action('clicked'),
|
|
103
|
+
href: '#href1',
|
|
104
|
+
disabled,
|
|
105
|
+
media: {
|
|
106
|
+
block: (
|
|
107
|
+
<img
|
|
108
|
+
src="https://wise.com/public-resources/assets/bank-details/bank-details-flow/finish.svg"
|
|
109
|
+
alt=""
|
|
110
|
+
/>
|
|
111
|
+
),
|
|
112
|
+
list: (
|
|
113
|
+
<Avatar size="md" type="initials">
|
|
114
|
+
HM
|
|
115
|
+
</Avatar>
|
|
116
|
+
),
|
|
119
117
|
},
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
118
|
+
'aria-label': 'Click to see something',
|
|
119
|
+
title: 'Hank Miller',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
description:
|
|
123
|
+
"Click here to send money to Hank Miller. Money will be sent directly to Han Miller's multi-currency account.",
|
|
124
|
+
onClick: action('clicked'),
|
|
125
|
+
disabled,
|
|
126
|
+
href: '#href2',
|
|
127
|
+
media: {
|
|
128
|
+
block: (
|
|
129
|
+
<img
|
|
130
|
+
src="https://wise.com/public-resources/assets/bank-details/bank-details-flow/finish.svg"
|
|
131
|
+
alt=""
|
|
132
|
+
/>
|
|
133
|
+
),
|
|
134
|
+
list: (
|
|
135
|
+
<Avatar size="md" type="initials">
|
|
136
|
+
HM
|
|
137
|
+
</Avatar>
|
|
138
|
+
),
|
|
140
139
|
},
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
140
|
+
'aria-label': 'Click here to send money to Hank Miller.',
|
|
141
|
+
title: 'Hank Miller',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
description:
|
|
145
|
+
"Click here to send money to Hank Miller. Money will be sent directly to Han Miller's multi-currency account.",
|
|
146
|
+
onClick: action('clicked'),
|
|
147
|
+
href: '#href3',
|
|
148
|
+
media: {
|
|
149
|
+
block: (
|
|
150
|
+
<img
|
|
151
|
+
src="https://wise.com/public-resources/assets/bank-details/bank-details-flow/finish.svg"
|
|
152
|
+
alt=""
|
|
153
|
+
/>
|
|
154
|
+
),
|
|
155
|
+
list: (
|
|
156
|
+
<Avatar size="md" type="initials">
|
|
157
|
+
HM
|
|
158
|
+
</Avatar>
|
|
159
|
+
),
|
|
161
160
|
},
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
161
|
+
'aria-label': 'Click here to send money to Hank Miller.',
|
|
162
|
+
disabled,
|
|
163
|
+
title: 'Hank Miller',
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
description:
|
|
167
|
+
"Click here to send money to Hank Miller. Money will be sent directly to Hank Miller's multi-currency account.",
|
|
168
|
+
onClick: action('clicked'),
|
|
169
|
+
href: '#href1',
|
|
170
|
+
disabled,
|
|
171
|
+
media: {
|
|
172
|
+
block: (
|
|
173
|
+
<img
|
|
174
|
+
src="https://wise.com/public-resources/assets/bank-details/bank-details-flow/finish.svg"
|
|
175
|
+
alt=""
|
|
176
|
+
/>
|
|
177
|
+
),
|
|
178
|
+
list: (
|
|
179
|
+
<Avatar size="md" type="initials">
|
|
180
|
+
HM
|
|
181
|
+
</Avatar>
|
|
182
|
+
),
|
|
182
183
|
},
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
184
|
+
'aria-label': 'Click here to send money to Hank Miller.',
|
|
185
|
+
title: 'Hank Miller',
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
description:
|
|
189
|
+
"Click here to send money to Hank Miller. Money will be sent directly to Hank Miller's multi-currency account.",
|
|
190
|
+
onClick: action('clicked'),
|
|
191
|
+
href: '#href1',
|
|
192
|
+
disabled,
|
|
193
|
+
media: {
|
|
194
|
+
block: (
|
|
195
|
+
<img
|
|
196
|
+
src="https://wise.com/public-resources/assets/bank-details/bank-details-flow/finish.svg"
|
|
197
|
+
alt=""
|
|
198
|
+
/>
|
|
199
|
+
),
|
|
200
|
+
list: (
|
|
201
|
+
<Avatar size="md" type="initials">
|
|
202
|
+
HM
|
|
203
|
+
</Avatar>
|
|
204
|
+
),
|
|
203
205
|
},
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
206
|
+
'aria-label': 'Click here to send money to Hank Miller.',
|
|
207
|
+
title: 'Hank Miller',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
description:
|
|
211
|
+
"Click here to send money to Hank Miller. Money will be sent directly to Hank Miller's multi-currency account.",
|
|
212
|
+
onClick: action('clicked'),
|
|
213
|
+
href: '#href1',
|
|
214
|
+
disabled,
|
|
215
|
+
media: {
|
|
216
|
+
block: (
|
|
217
|
+
<img
|
|
218
|
+
src="https://wise.com/public-resources/assets/bank-details/bank-details-flow/finish.svg"
|
|
219
|
+
alt=""
|
|
220
|
+
/>
|
|
221
|
+
),
|
|
222
|
+
list: (
|
|
223
|
+
<Avatar size="md" type="initials">
|
|
224
|
+
HM
|
|
225
|
+
</Avatar>
|
|
226
|
+
),
|
|
224
227
|
},
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
228
|
+
'aria-label': 'Click here to send money to Hank Miller.',
|
|
229
|
+
title: 'Hank Miller',
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
description:
|
|
233
|
+
"Click here to send money to Hank Miller. Money will be sent directly to Hank Miller's multi-currency account.",
|
|
234
|
+
onClick: action('clicked'),
|
|
235
|
+
href: '#href1',
|
|
236
|
+
disabled,
|
|
237
|
+
media: {
|
|
238
|
+
block: (
|
|
239
|
+
<img
|
|
240
|
+
src="https://wise.com/public-resources/assets/bank-details/bank-details-flow/finish.svg"
|
|
241
|
+
alt=""
|
|
242
|
+
/>
|
|
243
|
+
),
|
|
244
|
+
list: (
|
|
245
|
+
<Avatar size="md" type="initials">
|
|
246
|
+
HM
|
|
247
|
+
</Avatar>
|
|
248
|
+
),
|
|
245
249
|
},
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
250
|
+
'aria-label': 'Click here to send money to Hank Miller.',
|
|
251
|
+
title: 'Hank Miller',
|
|
252
|
+
},
|
|
253
|
+
]}
|
|
254
|
+
presentation={presentation}
|
|
255
|
+
type={DecisionType.NAVIGATION}
|
|
256
|
+
size={size}
|
|
257
|
+
/>
|
|
252
258
|
);
|
|
253
259
|
};
|
|
@@ -6,6 +6,7 @@ import NavigationOption from '../navigationOption';
|
|
|
6
6
|
import Tile from '../tile';
|
|
7
7
|
|
|
8
8
|
interface DecisionOption {
|
|
9
|
+
'aria-label'?: string;
|
|
9
10
|
description?: React.ReactNode;
|
|
10
11
|
disabled?: boolean;
|
|
11
12
|
href?: string;
|
|
@@ -58,10 +59,23 @@ const Decision = ({
|
|
|
58
59
|
|
|
59
60
|
if (type === DecisionType.NAVIGATION) {
|
|
60
61
|
const renderedOptions = options.map(
|
|
61
|
-
(
|
|
62
|
+
(
|
|
63
|
+
{
|
|
64
|
+
'aria-label': ariaLabel,
|
|
65
|
+
title,
|
|
66
|
+
description,
|
|
67
|
+
disabled,
|
|
68
|
+
href,
|
|
69
|
+
target,
|
|
70
|
+
media: { list },
|
|
71
|
+
onClick,
|
|
72
|
+
},
|
|
73
|
+
key,
|
|
74
|
+
) => (
|
|
62
75
|
<NavigationOption
|
|
63
76
|
// eslint-disable-next-line react/no-array-index-key
|
|
64
77
|
key={`nav-${key}`}
|
|
78
|
+
aria-label={ariaLabel}
|
|
65
79
|
complex={false}
|
|
66
80
|
content={description}
|
|
67
81
|
disabled={disabled}
|
|
@@ -100,7 +114,16 @@ const Decision = ({
|
|
|
100
114
|
{breakpoint
|
|
101
115
|
? options.map(
|
|
102
116
|
(
|
|
103
|
-
{
|
|
117
|
+
{
|
|
118
|
+
'aria-label': ariaLabel,
|
|
119
|
+
description,
|
|
120
|
+
disabled,
|
|
121
|
+
href,
|
|
122
|
+
target,
|
|
123
|
+
media: { block },
|
|
124
|
+
onClick,
|
|
125
|
+
title,
|
|
126
|
+
},
|
|
104
127
|
key,
|
|
105
128
|
) => (
|
|
106
129
|
<Tile
|
|
@@ -109,6 +132,7 @@ const Decision = ({
|
|
|
109
132
|
className={clsx(`np-decision__tile${isSmall ? '--small' : ''}`, {
|
|
110
133
|
'np-decision__tile--fixed-width': isGrid,
|
|
111
134
|
})}
|
|
135
|
+
aria-label={ariaLabel}
|
|
112
136
|
description={description}
|
|
113
137
|
disabled={disabled}
|
|
114
138
|
href={href}
|