@transferwise/components 0.0.0-experimental-1a9f157 → 0.0.0-experimental-3ab1d06
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/avatar/Avatar.js +0 -2
- package/build/avatar/Avatar.js.map +1 -1
- package/build/avatar/Avatar.mjs +0 -2
- package/build/avatar/Avatar.mjs.map +1 -1
- package/build/badge/Badge.js +0 -1
- package/build/badge/Badge.js.map +1 -1
- package/build/badge/Badge.mjs +0 -1
- package/build/badge/Badge.mjs.map +1 -1
- package/build/circularButton/CircularButton.js +1 -1
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/circularButton/CircularButton.mjs +1 -1
- package/build/circularButton/CircularButton.mjs.map +1 -1
- package/build/common/bottomSheet/BottomSheet.js +3 -1
- package/build/common/bottomSheet/BottomSheet.js.map +1 -1
- package/build/common/bottomSheet/BottomSheet.mjs +3 -1
- package/build/common/bottomSheet/BottomSheet.mjs.map +1 -1
- package/build/common/circle/Circle.js +3 -19
- package/build/common/circle/Circle.js.map +1 -1
- package/build/common/circle/Circle.mjs +3 -19
- package/build/common/circle/Circle.mjs.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.js +7 -1
- package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.mjs +7 -1
- package/build/common/responsivePanel/ResponsivePanel.mjs.map +1 -1
- package/build/main.css +22 -6
- package/build/popover/Popover.js +6 -1
- package/build/popover/Popover.js.map +1 -1
- package/build/popover/Popover.mjs +7 -2
- package/build/popover/Popover.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.js +4 -4
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +4 -4
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/styles/circularButton/CircularButton.css +2 -2
- package/build/styles/common/circle/Circle.css +0 -4
- package/build/styles/main.css +22 -6
- package/build/styles/statusIcon/StatusIcon.css +20 -0
- package/build/types/avatar/Avatar.d.ts.map +1 -1
- package/build/types/common/bottomSheet/BottomSheet.d.ts +1 -1
- package/build/types/common/bottomSheet/BottomSheet.d.ts.map +1 -1
- package/build/types/common/circle/Circle.d.ts +1 -9
- package/build/types/common/circle/Circle.d.ts.map +1 -1
- package/build/types/common/responsivePanel/ResponsivePanel.d.ts.map +1 -1
- package/build/types/popover/Popover.d.ts +6 -4
- package/build/types/popover/Popover.d.ts.map +1 -1
- package/build/types/statusIcon/StatusIcon.d.ts +2 -6
- package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/avatar/Avatar.spec.tsx +1 -3
- package/src/avatar/Avatar.tsx +0 -2
- package/src/avatarWrapper/__snapshots__/AvatarWrapper.spec.tsx.snap +11 -11
- package/src/badge/Badge.spec.tsx +1 -3
- package/src/badge/Badge.tsx +1 -1
- package/src/circularButton/CircularButton.css +2 -2
- package/src/circularButton/CircularButton.less +1 -1
- package/src/circularButton/CircularButton.tsx +1 -1
- package/src/circularButton/__snapshots__/CircularButton.spec.tsx.snap +20 -20
- package/src/common/bottomSheet/BottomSheet.tsx +4 -2
- package/src/common/circle/Circle.css +0 -4
- package/src/common/circle/Circle.less +0 -8
- package/src/common/circle/Circle.tsx +3 -36
- package/src/common/responsivePanel/ResponsivePanel.tsx +13 -3
- package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +4 -4
- package/src/main.css +22 -6
- package/src/overlayHeader/OverlayHeader.spec.tsx +1 -3
- package/src/overlayHeader/__snapshots__/OverlayHeader.spec.tsx.snap +2 -2
- package/src/popover/Popover.spec.tsx +64 -21
- package/src/popover/Popover.story.tsx +54 -42
- package/src/popover/Popover.tsx +12 -5
- package/src/popover/__snapshots__/Popover.spec.tsx.snap +2 -0
- package/src/promoCard/PromoCard.spec.tsx +1 -3
- package/src/radio/Radio.rtl.spec.tsx +1 -2
- package/src/radio/__snapshots__/Radio.rtl.spec.tsx.snap +2 -2
- package/src/statusIcon/StatusIcon.css +20 -0
- package/src/statusIcon/StatusIcon.less +17 -0
- package/src/statusIcon/StatusIcon.spec.tsx +21 -3
- package/src/statusIcon/StatusIcon.story.tsx +8 -31
- package/src/statusIcon/StatusIcon.tsx +6 -11
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
exports[`FlowNavigationAvatar with a name AND profileType FlowNavigationAvatar with a name AND profileType AND avatar url renders the image 1`] = `
|
|
4
4
|
<div
|
|
5
5
|
class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--thumbnail"
|
|
6
|
-
style="--circle-size: 48px;
|
|
6
|
+
style="--circle-size: 48px;"
|
|
7
7
|
>
|
|
8
8
|
<div
|
|
9
9
|
class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
|
|
10
|
-
style="--circle-size: 48px;
|
|
10
|
+
style="--circle-size: 48px;"
|
|
11
11
|
>
|
|
12
12
|
<img
|
|
13
13
|
alt=""
|
|
@@ -20,11 +20,11 @@ exports[`FlowNavigationAvatar with a name AND profileType FlowNavigationAvatar w
|
|
|
20
20
|
exports[`FlowNavigationAvatar with a name AND profileType FlowNavigationAvatar with a name AND profileType renders as BUSINESS profile type with an icon 1`] = `
|
|
21
21
|
<div
|
|
22
22
|
class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--icon"
|
|
23
|
-
style="--circle-size: 48px;
|
|
23
|
+
style="--circle-size: 48px;"
|
|
24
24
|
>
|
|
25
25
|
<div
|
|
26
26
|
class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
|
|
27
|
-
style="--circle-size: 48px;
|
|
27
|
+
style="--circle-size: 48px;"
|
|
28
28
|
>
|
|
29
29
|
<span
|
|
30
30
|
class="tw-icon tw-icon-briefcase "
|
|
@@ -51,11 +51,11 @@ exports[`FlowNavigationAvatar with a name AND profileType FlowNavigationAvatar w
|
|
|
51
51
|
exports[`FlowNavigationAvatar with a name AND profileType FlowNavigationAvatar with a name AND profileType renders as PERSONAL profile type with an icon 1`] = `
|
|
52
52
|
<div
|
|
53
53
|
class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--icon"
|
|
54
|
-
style="--circle-size: 48px;
|
|
54
|
+
style="--circle-size: 48px;"
|
|
55
55
|
>
|
|
56
56
|
<div
|
|
57
57
|
class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
|
|
58
|
-
style="--circle-size: 48px;
|
|
58
|
+
style="--circle-size: 48px;"
|
|
59
59
|
>
|
|
60
60
|
<span
|
|
61
61
|
class="tw-icon tw-icon-person "
|
|
@@ -88,11 +88,11 @@ exports[`FlowNavigationAvatar with a name AND profileType with a badge url passe
|
|
|
88
88
|
>
|
|
89
89
|
<div
|
|
90
90
|
class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--icon"
|
|
91
|
-
style="--circle-size: 48px;
|
|
91
|
+
style="--circle-size: 48px;"
|
|
92
92
|
>
|
|
93
93
|
<div
|
|
94
94
|
class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
|
|
95
|
-
style="--circle-size: 48px;
|
|
95
|
+
style="--circle-size: 48px;"
|
|
96
96
|
>
|
|
97
97
|
<span
|
|
98
98
|
class="tw-icon tw-icon-person "
|
|
@@ -117,7 +117,7 @@ exports[`FlowNavigationAvatar with a name AND profileType with a badge url passe
|
|
|
117
117
|
</div>
|
|
118
118
|
<div
|
|
119
119
|
class="np-circle d-flex align-items-center justify-content-center tw-badge__content"
|
|
120
|
-
style="--circle-size: 24px;
|
|
120
|
+
style="--circle-size: 24px;"
|
|
121
121
|
>
|
|
122
122
|
<img
|
|
123
123
|
alt="badge alt text"
|
|
@@ -130,11 +130,11 @@ exports[`FlowNavigationAvatar with a name AND profileType with a badge url passe
|
|
|
130
130
|
exports[`FlowNavigationAvatar with a name AND profileType with nothing passed renders a personal icon 1`] = `
|
|
131
131
|
<div
|
|
132
132
|
class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--icon"
|
|
133
|
-
style="--circle-size: 48px;
|
|
133
|
+
style="--circle-size: 48px;"
|
|
134
134
|
>
|
|
135
135
|
<div
|
|
136
136
|
class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
|
|
137
|
-
style="--circle-size: 48px;
|
|
137
|
+
style="--circle-size: 48px;"
|
|
138
138
|
>
|
|
139
139
|
<span
|
|
140
140
|
class="tw-icon tw-icon-person "
|
package/src/badge/Badge.spec.tsx
CHANGED
package/src/badge/Badge.tsx
CHANGED
|
@@ -58,7 +58,7 @@ const Badge = ({
|
|
|
58
58
|
return (
|
|
59
59
|
<div aria-label={ariaLabel} className={classes}>
|
|
60
60
|
<div className="tw-badge__children">{children}</div>
|
|
61
|
-
<Circle size={mapLegacySize[size]} fixedSize
|
|
61
|
+
<Circle size={mapLegacySize[size]} fixedSize className="tw-badge__content">
|
|
62
62
|
{badge}
|
|
63
63
|
</Circle>
|
|
64
64
|
</div>
|
|
@@ -7,8 +7,8 @@ exports[`CircularButton defaults renders a button of type accent and priority pr
|
|
|
7
7
|
>
|
|
8
8
|
<input
|
|
9
9
|
aria-label="Add money"
|
|
10
|
-
class="np-circle
|
|
11
|
-
style="--circle-size: var(--size-56);
|
|
10
|
+
class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-accent btn-priority-1"
|
|
11
|
+
style="--circle-size: var(--size-56);"
|
|
12
12
|
type="button"
|
|
13
13
|
/>
|
|
14
14
|
<span
|
|
@@ -45,8 +45,8 @@ exports[`CircularButton priorities renders primary buttons 1`] = `
|
|
|
45
45
|
>
|
|
46
46
|
<input
|
|
47
47
|
aria-label="Add money"
|
|
48
|
-
class="np-circle
|
|
49
|
-
style="--circle-size: var(--size-56);
|
|
48
|
+
class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-accent btn-priority-1"
|
|
49
|
+
style="--circle-size: var(--size-56);"
|
|
50
50
|
type="button"
|
|
51
51
|
/>
|
|
52
52
|
<span
|
|
@@ -83,8 +83,8 @@ exports[`CircularButton priorities renders primary buttons 2`] = `
|
|
|
83
83
|
>
|
|
84
84
|
<input
|
|
85
85
|
aria-label="Add money"
|
|
86
|
-
class="np-circle
|
|
87
|
-
style="--circle-size: var(--size-56);
|
|
86
|
+
class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-positive btn-priority-1"
|
|
87
|
+
style="--circle-size: var(--size-56);"
|
|
88
88
|
type="button"
|
|
89
89
|
/>
|
|
90
90
|
<span
|
|
@@ -121,8 +121,8 @@ exports[`CircularButton priorities renders primary buttons 3`] = `
|
|
|
121
121
|
>
|
|
122
122
|
<input
|
|
123
123
|
aria-label="Add money"
|
|
124
|
-
class="np-circle
|
|
125
|
-
style="--circle-size: var(--size-56);
|
|
124
|
+
class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-negative btn-priority-1"
|
|
125
|
+
style="--circle-size: var(--size-56);"
|
|
126
126
|
type="button"
|
|
127
127
|
/>
|
|
128
128
|
<span
|
|
@@ -159,8 +159,8 @@ exports[`CircularButton priorities renders secondary buttons 1`] = `
|
|
|
159
159
|
>
|
|
160
160
|
<input
|
|
161
161
|
aria-label="Add money"
|
|
162
|
-
class="np-circle
|
|
163
|
-
style="--circle-size: var(--size-56);
|
|
162
|
+
class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-accent btn-priority-2"
|
|
163
|
+
style="--circle-size: var(--size-56);"
|
|
164
164
|
type="button"
|
|
165
165
|
/>
|
|
166
166
|
<span
|
|
@@ -197,8 +197,8 @@ exports[`CircularButton priorities renders secondary buttons 2`] = `
|
|
|
197
197
|
>
|
|
198
198
|
<input
|
|
199
199
|
aria-label="Add money"
|
|
200
|
-
class="np-circle
|
|
201
|
-
style="--circle-size: var(--size-56);
|
|
200
|
+
class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-positive btn-priority-2"
|
|
201
|
+
style="--circle-size: var(--size-56);"
|
|
202
202
|
type="button"
|
|
203
203
|
/>
|
|
204
204
|
<span
|
|
@@ -235,8 +235,8 @@ exports[`CircularButton priorities renders secondary buttons 3`] = `
|
|
|
235
235
|
>
|
|
236
236
|
<input
|
|
237
237
|
aria-label="Add money"
|
|
238
|
-
class="np-circle
|
|
239
|
-
style="--circle-size: var(--size-56);
|
|
238
|
+
class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-negative btn-priority-2"
|
|
239
|
+
style="--circle-size: var(--size-56);"
|
|
240
240
|
type="button"
|
|
241
241
|
/>
|
|
242
242
|
<span
|
|
@@ -273,8 +273,8 @@ exports[`CircularButton types renders accent buttons 1`] = `
|
|
|
273
273
|
>
|
|
274
274
|
<input
|
|
275
275
|
aria-label="Add money"
|
|
276
|
-
class="np-circle
|
|
277
|
-
style="--circle-size: var(--size-56);
|
|
276
|
+
class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-accent btn-priority-1"
|
|
277
|
+
style="--circle-size: var(--size-56);"
|
|
278
278
|
type="button"
|
|
279
279
|
/>
|
|
280
280
|
<span
|
|
@@ -311,8 +311,8 @@ exports[`CircularButton types renders negative buttons 1`] = `
|
|
|
311
311
|
>
|
|
312
312
|
<input
|
|
313
313
|
aria-label="Add money"
|
|
314
|
-
class="np-circle
|
|
315
|
-
style="--circle-size: var(--size-56);
|
|
314
|
+
class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-negative btn-priority-1"
|
|
315
|
+
style="--circle-size: var(--size-56);"
|
|
316
316
|
type="button"
|
|
317
317
|
/>
|
|
318
318
|
<span
|
|
@@ -349,8 +349,8 @@ exports[`CircularButton types renders positive buttons 1`] = `
|
|
|
349
349
|
>
|
|
350
350
|
<input
|
|
351
351
|
aria-label="Add money"
|
|
352
|
-
class="np-circle
|
|
353
|
-
style="--circle-size: var(--size-56);
|
|
352
|
+
class="np-circle d-flex align-items-center justify-content-center btn np-btn m-b-1 btn-positive btn-priority-1"
|
|
353
|
+
style="--circle-size: var(--size-56);"
|
|
354
354
|
type="button"
|
|
355
355
|
/>
|
|
356
356
|
<span
|
|
@@ -32,7 +32,7 @@ export type BottomSheetProps = PropsWithChildren<
|
|
|
32
32
|
onClose?: (event: Event | SyntheticEvent) => void;
|
|
33
33
|
open: boolean;
|
|
34
34
|
} & CommonProps &
|
|
35
|
-
Pick<HTMLAttributes<HTMLDivElement>, 'role' | 'aria-labelledby'>
|
|
35
|
+
Pick<HTMLAttributes<HTMLDivElement>, 'role' | 'aria-labelledby' | 'aria-label'>
|
|
36
36
|
>;
|
|
37
37
|
|
|
38
38
|
/**
|
|
@@ -185,6 +185,7 @@ const BottomSheet = ({ role = 'dialog', ...props }: BottomSheetProps) => {
|
|
|
185
185
|
return is400Zoom ? (
|
|
186
186
|
<Drawer
|
|
187
187
|
aria-labelledby={props['aria-labelledby']}
|
|
188
|
+
aria-label={props['aria-label']}
|
|
188
189
|
role={role}
|
|
189
190
|
open={props.open}
|
|
190
191
|
className={props.className}
|
|
@@ -203,7 +204,8 @@ const BottomSheet = ({ role = 'dialog', ...props }: BottomSheetProps) => {
|
|
|
203
204
|
{/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}
|
|
204
205
|
<div
|
|
205
206
|
id={overlayId}
|
|
206
|
-
aria-labelledby={props['aria-labelledby']}
|
|
207
|
+
aria-labelledby={props['aria-labelledby'] || undefined}
|
|
208
|
+
aria-label={props['aria-label'] || undefined}
|
|
207
209
|
role={role}
|
|
208
210
|
aria-modal
|
|
209
211
|
onTouchStart={onSwipeStart}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes, forwardRef } from 'react';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
|
-
import { useMedia } from '../hooks/useMedia';
|
|
4
|
-
import { Breakpoint } from '../propsValues/breakpoint';
|
|
5
3
|
|
|
6
|
-
export type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 72;
|
|
4
|
+
export type ShapeSize = 16 | 24 | 32 | 40 | 48 | 56 | 64 | 72;
|
|
7
5
|
|
|
8
6
|
export type Props = {
|
|
9
7
|
/**
|
|
@@ -19,57 +17,26 @@ export type Props = {
|
|
|
19
17
|
* as those can be dynamic a at certain viewport sizes
|
|
20
18
|
*/
|
|
21
19
|
fixedSize?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* This property is temporary, as some components (e.g legacy Avatar) doesn't need new icon sizing, we delete it at some point
|
|
24
|
-
*/
|
|
25
|
-
iconSizing?: boolean;
|
|
26
20
|
} & HTMLAttributes<HTMLDivElement>;
|
|
27
21
|
|
|
28
|
-
/**
|
|
29
|
-
* circle like components has custom sizes for icons
|
|
30
|
-
*/
|
|
31
|
-
const MAP_ICON_SIZE = {
|
|
32
|
-
16: 12,
|
|
33
|
-
24: 16,
|
|
34
|
-
32: 18,
|
|
35
|
-
40: 20,
|
|
36
|
-
48: 24,
|
|
37
|
-
56: 28,
|
|
38
|
-
72: 36,
|
|
39
|
-
};
|
|
40
|
-
|
|
41
22
|
const Circle = forwardRef(function Circle(
|
|
42
23
|
{
|
|
43
24
|
as: Element = 'div',
|
|
44
25
|
children,
|
|
45
26
|
size = 48,
|
|
46
27
|
fixedSize = false,
|
|
47
|
-
iconSizing = true,
|
|
48
28
|
className,
|
|
49
29
|
style,
|
|
50
30
|
...props
|
|
51
31
|
}: Props,
|
|
52
32
|
ref,
|
|
53
33
|
) {
|
|
54
|
-
const isTinyViewport = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);
|
|
55
34
|
return (
|
|
56
35
|
<Element
|
|
57
36
|
{...props}
|
|
58
37
|
ref={ref}
|
|
59
|
-
style={{
|
|
60
|
-
|
|
61
|
-
'--circle-icon-size':
|
|
62
|
-
isTinyViewport && !fixedSize
|
|
63
|
-
? `${MAP_ICON_SIZE[size] / 2}px`
|
|
64
|
-
: `${MAP_ICON_SIZE[size]}px`,
|
|
65
|
-
...style,
|
|
66
|
-
}}
|
|
67
|
-
className={clsx(
|
|
68
|
-
'np-circle',
|
|
69
|
-
{ 'np-circle-icons-size': iconSizing },
|
|
70
|
-
'd-flex align-items-center justify-content-center',
|
|
71
|
-
className,
|
|
72
|
-
)}
|
|
38
|
+
style={{ ...style, '--circle-size': fixedSize ? `${size}px` : `var(--size-${size})` }}
|
|
39
|
+
className={clsx('np-circle', 'd-flex align-items-center justify-content-center', className)}
|
|
73
40
|
>
|
|
74
41
|
{children}
|
|
75
42
|
</Element>
|
|
@@ -3,8 +3,7 @@ import { forwardRef } from 'react';
|
|
|
3
3
|
import { Position } from '..';
|
|
4
4
|
import BottomSheet from '../bottomSheet';
|
|
5
5
|
import { useLayout } from '../hooks';
|
|
6
|
-
import Panel from '../panel';
|
|
7
|
-
import { PanelProps } from '../panel/Panel';
|
|
6
|
+
import Panel, { type PanelProps } from '../panel';
|
|
8
7
|
|
|
9
8
|
const ResponsivePanel = forwardRef<HTMLDivElement, PanelProps>(function ResponsivePanel(
|
|
10
9
|
{
|
|
@@ -17,13 +16,22 @@ const ResponsivePanel = forwardRef<HTMLDivElement, PanelProps>(function Responsi
|
|
|
17
16
|
open = false,
|
|
18
17
|
position = Position.BOTTOM,
|
|
19
18
|
anchorWidth = false,
|
|
19
|
+
'aria-label': ariaLabel,
|
|
20
|
+
'aria-labelledby': ariaLabelledBy,
|
|
20
21
|
}: PanelProps,
|
|
21
22
|
reference,
|
|
22
23
|
) {
|
|
23
24
|
const { isMobile } = useLayout();
|
|
24
25
|
if (isMobile) {
|
|
25
26
|
return (
|
|
26
|
-
<BottomSheet
|
|
27
|
+
<BottomSheet
|
|
28
|
+
key="bottomSheet"
|
|
29
|
+
aria-label={ariaLabel}
|
|
30
|
+
aria-labelledby={ariaLabelledBy}
|
|
31
|
+
open={open}
|
|
32
|
+
className={className}
|
|
33
|
+
onClose={onClose}
|
|
34
|
+
>
|
|
27
35
|
{children}
|
|
28
36
|
</BottomSheet>
|
|
29
37
|
);
|
|
@@ -38,6 +46,8 @@ const ResponsivePanel = forwardRef<HTMLDivElement, PanelProps>(function Responsi
|
|
|
38
46
|
position={position}
|
|
39
47
|
anchorWidth={anchorWidth}
|
|
40
48
|
anchorRef={anchorRef}
|
|
49
|
+
aria-label={ariaLabel}
|
|
50
|
+
aria-labelledby={ariaLabelledBy}
|
|
41
51
|
className={className}
|
|
42
52
|
onClose={onClose}
|
|
43
53
|
>
|
|
@@ -22,11 +22,11 @@ exports[`FlowNavigation on mobile renders as expected 1`] = `
|
|
|
22
22
|
>
|
|
23
23
|
<div
|
|
24
24
|
class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--initials np-text-title-body"
|
|
25
|
-
style="--circle-size: 48px;
|
|
25
|
+
style="--circle-size: 48px;"
|
|
26
26
|
>
|
|
27
27
|
<div
|
|
28
28
|
class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
|
|
29
|
-
style="--circle-size: 48px;
|
|
29
|
+
style="--circle-size: 48px;"
|
|
30
30
|
>
|
|
31
31
|
TM
|
|
32
32
|
</div>
|
|
@@ -139,11 +139,11 @@ exports[`FlowNavigation renders as expected 1`] = `
|
|
|
139
139
|
>
|
|
140
140
|
<div
|
|
141
141
|
class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--initials np-text-title-body"
|
|
142
|
-
style="--circle-size: 48px;
|
|
142
|
+
style="--circle-size: 48px;"
|
|
143
143
|
>
|
|
144
144
|
<div
|
|
145
145
|
class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
|
|
146
|
-
style="--circle-size: 48px;
|
|
146
|
+
style="--circle-size: 48px;"
|
|
147
147
|
>
|
|
148
148
|
TM
|
|
149
149
|
</div>
|
package/src/main.css
CHANGED
|
@@ -1013,8 +1013,8 @@ div.critical-comms .critical-comms-body {
|
|
|
1013
1013
|
}
|
|
1014
1014
|
@media (max-width: 320px) {
|
|
1015
1015
|
.np-circular-btn .tw-icon {
|
|
1016
|
-
top:
|
|
1017
|
-
top: var(--size-
|
|
1016
|
+
top: 8px;
|
|
1017
|
+
top: var(--size-8);
|
|
1018
1018
|
}
|
|
1019
1019
|
}
|
|
1020
1020
|
.np-circular-btn .tw-icon > svg {
|
|
@@ -1169,10 +1169,6 @@ div.critical-comms .critical-comms-body {
|
|
|
1169
1169
|
height: var(--circle-size);
|
|
1170
1170
|
flex-shrink: 0;
|
|
1171
1171
|
}
|
|
1172
|
-
.np-circle-icons-size .tw-icon > svg {
|
|
1173
|
-
height: var(--circle-icon-size);
|
|
1174
|
-
width: var(--circle-icon-size);
|
|
1175
|
-
}
|
|
1176
1172
|
.np-bottom-sheet {
|
|
1177
1173
|
border-radius: 10px 10px 0 0;
|
|
1178
1174
|
}
|
|
@@ -4159,6 +4155,12 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
4159
4155
|
transform: translateY(-24px);
|
|
4160
4156
|
}
|
|
4161
4157
|
}
|
|
4158
|
+
.status-icon > svg {
|
|
4159
|
+
height: 32px;
|
|
4160
|
+
height: var(--size-32);
|
|
4161
|
+
width: 32px;
|
|
4162
|
+
width: var(--size-32);
|
|
4163
|
+
}
|
|
4162
4164
|
.status-circle .light {
|
|
4163
4165
|
color: var(--color-contrast);
|
|
4164
4166
|
}
|
|
@@ -4174,6 +4176,20 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
4174
4176
|
.np-theme-personal .status-circle.pending .status-icon {
|
|
4175
4177
|
color: var(--color-dark);
|
|
4176
4178
|
}
|
|
4179
|
+
.status-circle-sm .status-icon > svg {
|
|
4180
|
+
height: 14px;
|
|
4181
|
+
height: var(--size-14);
|
|
4182
|
+
width: 14px;
|
|
4183
|
+
width: var(--size-14);
|
|
4184
|
+
}
|
|
4185
|
+
@media (max-width: 320px) {
|
|
4186
|
+
.status-circle-sm .status-icon > svg {
|
|
4187
|
+
width: 24px;
|
|
4188
|
+
width: var(--size-24);
|
|
4189
|
+
height: 24px;
|
|
4190
|
+
height: var(--size-24);
|
|
4191
|
+
}
|
|
4192
|
+
}
|
|
4177
4193
|
.status-circle.negative,
|
|
4178
4194
|
.status-circle.error {
|
|
4179
4195
|
background-color: var(--color-sentiment-negative);
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import Avatar, { AvatarType } from '../avatar';
|
|
2
2
|
import { Size } from '../common';
|
|
3
|
-
import { render
|
|
3
|
+
import { render } from '../test-utils';
|
|
4
4
|
|
|
5
5
|
import OverlayHeader from '.';
|
|
6
6
|
|
|
7
|
-
mockMatchMedia();
|
|
8
|
-
|
|
9
7
|
describe('OverlayHeader', () => {
|
|
10
8
|
const props = {
|
|
11
9
|
avatar: (
|
|
@@ -19,11 +19,11 @@ exports[`OverlayHeader renders as expected 1`] = `
|
|
|
19
19
|
>
|
|
20
20
|
<div
|
|
21
21
|
class="np-circle d-flex align-items-center justify-content-center tw-avatar tw-avatar--48 tw-avatar--initials np-text-title-body"
|
|
22
|
-
style="--circle-size: 48px;
|
|
22
|
+
style="--circle-size: 48px;"
|
|
23
23
|
>
|
|
24
24
|
<div
|
|
25
25
|
class="np-circle d-flex align-items-center justify-content-center tw-avatar__content"
|
|
26
|
-
style="--circle-size: 48px;
|
|
26
|
+
style="--circle-size: 48px;"
|
|
27
27
|
>
|
|
28
28
|
TM
|
|
29
29
|
</div>
|
|
@@ -35,27 +35,70 @@ describe('Popover', () => {
|
|
|
35
35
|
expect(getPanel()).toMatchSnapshot();
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
(
|
|
40
|
-
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
38
|
+
describe('title', () => {
|
|
39
|
+
it('renders title', async () => {
|
|
40
|
+
({ container, rerender } = render(
|
|
41
|
+
<Popover {...props}>
|
|
42
|
+
<button type="button">Open</button>
|
|
43
|
+
</Popover>,
|
|
44
|
+
));
|
|
45
|
+
|
|
46
|
+
await userEvent.click(screen.getByText('Open'));
|
|
47
|
+
await waitForPanel();
|
|
48
|
+
|
|
49
|
+
expect(getTitle()).toBeInTheDocument();
|
|
50
|
+
|
|
51
|
+
rerender(
|
|
52
|
+
<Popover {...props} title={undefined}>
|
|
53
|
+
<button type="button">Open</button>
|
|
54
|
+
</Popover>,
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
await userEvent.click(screen.getByText('Open'));
|
|
58
|
+
|
|
59
|
+
expect(getTitle()).not.toBeInTheDocument();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('should uses `title` as the accessible name', async () => {
|
|
63
|
+
render(
|
|
64
|
+
<Popover {...props}>
|
|
65
|
+
<button type="button">Open</button>
|
|
66
|
+
</Popover>,
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
await userEvent.click(screen.getByText('Open'));
|
|
70
|
+
await waitForPanel();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
describe('accessible name', () => {
|
|
74
|
+
const ACCESSIBLE_NAME = 'Accessible name';
|
|
75
|
+
|
|
76
|
+
it('should use `aria-label` as the accessible name', async () => {
|
|
77
|
+
render(
|
|
78
|
+
<Popover {...props} title={undefined} aria-label={ACCESSIBLE_NAME}>
|
|
79
|
+
<button type="button">Open</button>
|
|
80
|
+
</Popover>,
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
await userEvent.click(screen.getByText('Open'));
|
|
84
|
+
await waitForPanel();
|
|
85
|
+
|
|
86
|
+
expect(screen.getByRole('dialog', { name: ACCESSIBLE_NAME })).toBeInTheDocument();
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('should prioritise `aria-label` over `title` as the accessible name', async () => {
|
|
90
|
+
render(
|
|
91
|
+
<Popover {...props} aria-label={ACCESSIBLE_NAME}>
|
|
92
|
+
<button type="button">Open</button>
|
|
93
|
+
</Popover>,
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
await userEvent.click(screen.getByText('Open'));
|
|
97
|
+
await waitForPanel();
|
|
98
|
+
|
|
99
|
+
expect(screen.getByRole('dialog', { name: ACCESSIBLE_NAME })).toBeInTheDocument();
|
|
100
|
+
});
|
|
101
|
+
});
|
|
59
102
|
});
|
|
60
103
|
|
|
61
104
|
it('renders Panel onClick', async () => {
|