@transferwise/components 46.28.0 → 46.29.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/index.js +130 -630
- package/build/index.js.map +1 -1
- package/build/index.mjs +132 -630
- package/build/index.mjs.map +1 -1
- package/build/main.css +16 -5
- package/build/styles/logo/Logo.css +16 -0
- package/build/styles/main.css +16 -5
- package/build/types/alert/Alert.d.ts.map +1 -1
- package/build/types/dimmer/Dimmer.d.ts.map +1 -1
- package/build/types/index.d.ts +0 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/inputs/_BottomSheet.d.ts.map +1 -1
- package/build/types/inputs/_Popover.d.ts.map +1 -1
- package/build/types/loader/Loader.d.ts.map +1 -1
- package/build/types/logo/Logo.d.ts.map +1 -1
- package/build/types/phoneNumberInput/PhoneNumberInput.d.ts.map +1 -1
- package/build/types/popover/Popover.d.ts.map +1 -1
- package/build/types/segmentedControl/SegmentedControl.d.ts +2 -2
- package/build/types/segmentedControl/SegmentedControl.d.ts.map +1 -1
- package/build/types/select/Select.d.ts.map +1 -1
- package/build/types/stepper/deviceDetection.d.ts.map +1 -1
- package/build/types/uploadInput/uploadButton/UploadButton.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/accordion/Accordion.story.tsx +1 -1
- package/src/alert/Alert.tsx +2 -1
- package/src/avatar/colors/colors.ts +1 -1
- package/src/body/Body.spec.tsx +1 -1
- package/src/body/Body.story.tsx +8 -8
- package/src/checkbox/Checkbox.js +1 -1
- package/src/checkboxButton/CheckboxButton.spec.tsx +0 -1
- package/src/common/Option/Option.tsx +1 -1
- package/src/common/deviceDetection/deviceDetection.js +1 -1
- package/src/common/deviceDetection/deviceDetection.spec.js +4 -2
- package/src/common/responsivePanel/ResponsivePanel.spec.js +11 -15
- package/src/decision/Decision.spec.js +0 -1
- package/src/dimmer/Dimmer.tsx +6 -2
- package/src/index.ts +0 -1
- package/src/inlineAlert/InlineAlert.story.tsx +8 -7
- package/src/inputs/SelectInput.tsx +1 -0
- package/src/inputs/_BottomSheet.tsx +33 -28
- package/src/inputs/_Popover.tsx +23 -20
- package/src/link/Link.story.tsx +16 -16
- package/src/loader/Loader.tsx +0 -1
- package/src/logo/Logo.css +16 -0
- package/src/logo/Logo.js +4 -9
- package/src/logo/Logo.less +16 -0
- package/src/logo/__snapshots__/Logo.spec.js.snap +104 -8
- package/src/main.css +16 -5
- package/src/main.less +0 -1
- package/src/moneyInput/MoneyInput.story.tsx +3 -3
- package/src/nudge/Nudge.spec.tsx +5 -5
- package/src/phoneNumberInput/PhoneNumberInput.tsx +2 -1
- package/src/phoneNumberInput/utils/cleanNumber/cleanNumber.ts +1 -1
- package/src/popover/Popover.tsx +2 -1
- package/src/promoCard/PromoCard.tsx +1 -1
- package/src/radioGroup/RadioGroup.spec.js +1 -1
- package/src/section/Section.story.tsx +2 -1
- package/src/segmentedControl/SegmentedControl.spec.tsx +88 -2
- package/src/segmentedControl/SegmentedControl.story.tsx +54 -16
- package/src/segmentedControl/SegmentedControl.tsx +21 -33
- package/src/select/Select.js +2 -3
- package/src/stepper/deviceDetection.js +1 -2
- package/src/stepper/deviceDetection.spec.js +8 -3
- package/src/test-utils/index.js +1 -1
- package/src/test-utils/story-config.ts +1 -1
- package/src/title/Title.spec.tsx +1 -1
- package/src/typeahead/Typeahead.spec.js +4 -2
- package/src/upload/Upload.spec.js +8 -4
- package/src/uploadInput/uploadButton/UploadButton.tsx +1 -0
- package/build/styles/dynamicFieldDefinitionList/FormattedValue/FormattedValue.css +0 -5
- package/build/types/common/requirements.d.ts +0 -3
- package/build/types/common/requirements.d.ts.map +0 -1
- package/build/types/dynamicFieldDefinitionList/DynamicFieldDefinitionList.d.ts +0 -21
- package/build/types/dynamicFieldDefinitionList/DynamicFieldDefinitionList.d.ts.map +0 -1
- package/build/types/dynamicFieldDefinitionList/FormattedValue/FormattedValue.d.ts +0 -12
- package/build/types/dynamicFieldDefinitionList/FormattedValue/FormattedValue.d.ts.map +0 -1
- package/build/types/dynamicFieldDefinitionList/FormattedValue/index.d.ts +0 -2
- package/build/types/dynamicFieldDefinitionList/FormattedValue/index.d.ts.map +0 -1
- package/build/types/dynamicFieldDefinitionList/index.d.ts +0 -2
- package/build/types/dynamicFieldDefinitionList/index.d.ts.map +0 -1
- package/build/types/dynamicFieldDefinitionList/utils/createDefinitions.d.ts +0 -2
- package/build/types/dynamicFieldDefinitionList/utils/createDefinitions.d.ts.map +0 -1
- package/build/types/dynamicFieldDefinitionList/utils/text-format.d.ts +0 -2
- package/build/types/dynamicFieldDefinitionList/utils/text-format.d.ts.map +0 -1
- package/src/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +0 -41
- package/src/dynamicFieldDefinitionList/DynamicFieldDefinitionList.spec.js +0 -21
- package/src/dynamicFieldDefinitionList/DynamicFieldDefinitionList.story.js +0 -134
- package/src/dynamicFieldDefinitionList/FormattedValue/FormattedValue.css +0 -5
- package/src/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +0 -73
- package/src/dynamicFieldDefinitionList/FormattedValue/FormattedValue.less +0 -4
- package/src/dynamicFieldDefinitionList/FormattedValue/FormattedValue.spec.js +0 -200
- package/src/dynamicFieldDefinitionList/FormattedValue/index.js +0 -1
- package/src/dynamicFieldDefinitionList/index.js +0 -1
- package/src/dynamicFieldDefinitionList/utils/createDefinitions.js +0 -33
- package/src/dynamicFieldDefinitionList/utils/createDefinitions.spec.js +0 -83
- package/src/dynamicFieldDefinitionList/utils/text-format.js +0 -46
- package/src/dynamicFieldDefinitionList/utils/text-format.spec.js +0 -43
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
useRole,
|
|
8
8
|
} from '@floating-ui/react';
|
|
9
9
|
import { Transition } from '@headlessui/react';
|
|
10
|
+
import { FocusScope } from '@react-aria/focus';
|
|
10
11
|
import { ThemeProvider, useTheme } from '@wise/components-theming';
|
|
11
12
|
import classNames from 'classnames';
|
|
12
13
|
import { useState } from 'react';
|
|
@@ -97,37 +98,41 @@ export function BottomSheet({
|
|
|
97
98
|
leave="np-bottom-sheet-v2-content--leave"
|
|
98
99
|
leaveTo="np-bottom-sheet-v2-content--leave-to"
|
|
99
100
|
>
|
|
100
|
-
<
|
|
101
|
-
<
|
|
102
|
-
key={floatingKey} // Force inner state invalidation on open
|
|
103
|
-
ref={refs.setFloating}
|
|
104
|
-
className="np-bottom-sheet-v2-content-inner-container"
|
|
105
|
-
{...getFloatingProps()}
|
|
106
|
-
>
|
|
107
|
-
<div className="np-bottom-sheet-v2-header">
|
|
108
|
-
<CloseButton
|
|
109
|
-
size={Size.SMALL}
|
|
110
|
-
onClick={() => {
|
|
111
|
-
onClose?.();
|
|
112
|
-
}}
|
|
113
|
-
/>
|
|
114
|
-
</div>
|
|
101
|
+
<FocusScope>
|
|
102
|
+
<FloatingFocusManager context={context} initialFocus={initialFocusRef}>
|
|
115
103
|
<div
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
'np-bottom-sheet-v2-content-inner--padding-md': padding === 'md',
|
|
121
|
-
},
|
|
122
|
-
)}
|
|
104
|
+
key={floatingKey} // Force inner state invalidation on open
|
|
105
|
+
ref={refs.setFloating}
|
|
106
|
+
className="np-bottom-sheet-v2-content-inner-container"
|
|
107
|
+
{...getFloatingProps()}
|
|
123
108
|
>
|
|
124
|
-
|
|
125
|
-
<
|
|
126
|
-
|
|
127
|
-
|
|
109
|
+
<div className="np-bottom-sheet-v2-header">
|
|
110
|
+
<CloseButton
|
|
111
|
+
size={Size.SMALL}
|
|
112
|
+
onClick={() => {
|
|
113
|
+
onClose?.();
|
|
114
|
+
}}
|
|
115
|
+
/>
|
|
116
|
+
</div>
|
|
117
|
+
<div
|
|
118
|
+
className={classNames(
|
|
119
|
+
'np-bottom-sheet-v2-content-inner',
|
|
120
|
+
title && 'np-bottom-sheet-v2-content-inner--has-title',
|
|
121
|
+
{
|
|
122
|
+
'np-bottom-sheet-v2-content-inner--padding-md': padding === 'md',
|
|
123
|
+
},
|
|
124
|
+
)}
|
|
125
|
+
>
|
|
126
|
+
{title ? (
|
|
127
|
+
<h2 className="np-bottom-sheet-v2-title np-text-title-body">{title}</h2>
|
|
128
|
+
) : null}
|
|
129
|
+
<div className="np-bottom-sheet-v2-body np-text-body-default">
|
|
130
|
+
{children}
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
128
133
|
</div>
|
|
129
|
-
</
|
|
130
|
-
</
|
|
134
|
+
</FloatingFocusManager>
|
|
135
|
+
</FocusScope>
|
|
131
136
|
</Transition.Child>
|
|
132
137
|
</div>
|
|
133
138
|
</Transition>
|
package/src/inputs/_Popover.tsx
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
useRole,
|
|
14
14
|
} from '@floating-ui/react';
|
|
15
15
|
import { Transition } from '@headlessui/react';
|
|
16
|
+
import { FocusScope } from '@react-aria/focus';
|
|
16
17
|
import { ThemeProvider, useTheme } from '@wise/components-theming';
|
|
17
18
|
import classNames from 'classnames';
|
|
18
19
|
import { useState } from 'react';
|
|
@@ -103,30 +104,32 @@ export function Popover({
|
|
|
103
104
|
}}
|
|
104
105
|
afterLeave={onCloseEnd}
|
|
105
106
|
>
|
|
106
|
-
<
|
|
107
|
-
<
|
|
108
|
-
key={floatingKey} // Force inner state invalidation on open
|
|
109
|
-
ref={refs.setFloating}
|
|
110
|
-
className={classNames('np-popover-v2-container', {
|
|
111
|
-
'np-popover-v2-container--size-md': size === 'md',
|
|
112
|
-
'np-popover-v2-container--size-lg': size === 'lg',
|
|
113
|
-
})}
|
|
114
|
-
// eslint-disable-next-line react/forbid-dom-props
|
|
115
|
-
style={floatingStyles}
|
|
116
|
-
{...getFloatingProps()}
|
|
117
|
-
>
|
|
107
|
+
<FocusScope>
|
|
108
|
+
<FloatingFocusManager context={context}>
|
|
118
109
|
<div
|
|
119
|
-
|
|
120
|
-
|
|
110
|
+
key={floatingKey} // Force inner state invalidation on open
|
|
111
|
+
ref={refs.setFloating}
|
|
112
|
+
className={classNames('np-popover-v2-container', {
|
|
113
|
+
'np-popover-v2-container--size-md': size === 'md',
|
|
114
|
+
'np-popover-v2-container--size-lg': size === 'lg',
|
|
121
115
|
})}
|
|
116
|
+
// eslint-disable-next-line react/forbid-dom-props
|
|
117
|
+
style={floatingStyles}
|
|
118
|
+
{...getFloatingProps()}
|
|
122
119
|
>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
<div
|
|
121
|
+
className={classNames('np-popover-v2', title && 'np-popover-v2--has-title', {
|
|
122
|
+
'np-popover-v2--padding-md': padding === 'md',
|
|
123
|
+
})}
|
|
124
|
+
>
|
|
125
|
+
{title ? (
|
|
126
|
+
<h2 className="np-popover-v2-title np-text-title-body">{title}</h2>
|
|
127
|
+
) : null}
|
|
128
|
+
<div className="np-popover-v2-content np-text-body-default">{children}</div>
|
|
129
|
+
</div>
|
|
127
130
|
</div>
|
|
128
|
-
</
|
|
129
|
-
</
|
|
131
|
+
</FloatingFocusManager>
|
|
132
|
+
</FocusScope>
|
|
130
133
|
</Transition>
|
|
131
134
|
</ThemeProvider>
|
|
132
135
|
</FloatingPortal>
|
package/src/link/Link.story.tsx
CHANGED
|
@@ -29,64 +29,64 @@ export const Basic = () => {
|
|
|
29
29
|
Links via <code>{'<Link />'}</code> component in all types of body copy
|
|
30
30
|
</Title>
|
|
31
31
|
<Body type={Typography.BODY_LARGE_BOLD} className="m-t-3">
|
|
32
|
-
We’re building the world
|
|
32
|
+
We’re building the world’s{' '}
|
|
33
33
|
<Link href="#" target="_blank">
|
|
34
34
|
most international account
|
|
35
35
|
</Link>
|
|
36
|
-
. We’re building the world
|
|
36
|
+
. We’re building the world’s most international account
|
|
37
37
|
</Body>
|
|
38
38
|
<Body type={Typography.BODY_LARGE} className="m-t-3">
|
|
39
|
-
We’re building the world
|
|
39
|
+
We’re building the world’s{' '}
|
|
40
40
|
<Link href="#" target="_blank">
|
|
41
41
|
most international account
|
|
42
42
|
</Link>
|
|
43
|
-
. We’re building the world
|
|
43
|
+
. We’re building the world’s most international account
|
|
44
44
|
</Body>
|
|
45
45
|
<Body type={Typography.BODY_DEFAULT_BOLD} className="m-t-3">
|
|
46
|
-
We’re building the world
|
|
46
|
+
We’re building the world’s{' '}
|
|
47
47
|
<Link href="#" target="_blank">
|
|
48
48
|
most international account
|
|
49
49
|
</Link>
|
|
50
|
-
. We’re building the world
|
|
50
|
+
. We’re building the world’s most international account
|
|
51
51
|
</Body>
|
|
52
52
|
<Body type={Typography.BODY_DEFAULT} className="m-t-3">
|
|
53
|
-
We’re building the world
|
|
53
|
+
We’re building the world’s{' '}
|
|
54
54
|
<Link href="#" target="_blank">
|
|
55
55
|
most international account
|
|
56
56
|
</Link>
|
|
57
|
-
. We’re building the world
|
|
57
|
+
. We’re building the world’s most international account
|
|
58
58
|
</Body>
|
|
59
59
|
|
|
60
60
|
<Title type={Typography.TITLE_SCREEN} className="m-t-3">
|
|
61
61
|
Links via <code>{'<a>'}</code> tag in all types of body copy
|
|
62
62
|
</Title>
|
|
63
63
|
<Body type={Typography.BODY_LARGE_BOLD} className="m-t-3">
|
|
64
|
-
We’re building the world
|
|
64
|
+
We’re building the world’s{' '}
|
|
65
65
|
<a href="#" target="_blank">
|
|
66
66
|
most international account
|
|
67
67
|
</a>
|
|
68
|
-
. We’re building the world
|
|
68
|
+
. We’re building the world’s most international account
|
|
69
69
|
</Body>
|
|
70
70
|
<Body type={Typography.BODY_LARGE} className="m-t-3">
|
|
71
|
-
We’re building the world
|
|
71
|
+
We’re building the world’s{' '}
|
|
72
72
|
<a href="#" target="_blank">
|
|
73
73
|
most international account
|
|
74
74
|
</a>
|
|
75
|
-
. We’re building the world
|
|
75
|
+
. We’re building the world’s most international account
|
|
76
76
|
</Body>
|
|
77
77
|
<Body type={Typography.BODY_DEFAULT_BOLD} className="m-t-3">
|
|
78
|
-
We’re building the world
|
|
78
|
+
We’re building the world’s{' '}
|
|
79
79
|
<a href="#" target="_blank">
|
|
80
80
|
most international account
|
|
81
81
|
</a>
|
|
82
|
-
. We’re building the world
|
|
82
|
+
. We’re building the world’s most international account
|
|
83
83
|
</Body>
|
|
84
84
|
<Body type={Typography.BODY_DEFAULT} className="m-t-3">
|
|
85
|
-
We’re building the world
|
|
85
|
+
We’re building the world’s{' '}
|
|
86
86
|
<a href="#" target="_blank">
|
|
87
87
|
most international account
|
|
88
88
|
</a>
|
|
89
|
-
. We’re building the world
|
|
89
|
+
. We’re building the world’s most international account
|
|
90
90
|
</Body>
|
|
91
91
|
</>
|
|
92
92
|
);
|
package/src/loader/Loader.tsx
CHANGED
package/src/logo/Logo.css
CHANGED
|
@@ -8,3 +8,19 @@
|
|
|
8
8
|
.np-theme-personal--dark .np-logo-svg path {
|
|
9
9
|
fill: var(--color-white);
|
|
10
10
|
}
|
|
11
|
+
.np-logo-svg--size-sm {
|
|
12
|
+
display: block;
|
|
13
|
+
}
|
|
14
|
+
@media (min-width: 576px) {
|
|
15
|
+
.np-logo-svg--size-sm {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
.np-logo-svg--size-md {
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
22
|
+
@media (min-width: 576px) {
|
|
23
|
+
.np-logo-svg--size-md {
|
|
24
|
+
display: block;
|
|
25
|
+
}
|
|
26
|
+
}
|
package/src/logo/Logo.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
|
-
import { Breakpoint } from '../common';
|
|
5
|
-
import { useScreenSize } from '../common/hooks/useScreenSize';
|
|
6
|
-
|
|
7
4
|
import { LogoType } from './logoTypes';
|
|
8
5
|
import { ReactComponent as LogoFlagInverse } from './svg/flag-inverse.svg';
|
|
9
6
|
import { ReactComponent as LogoFlagPlatformInverse } from './svg/flag-platform-white.svg';
|
|
@@ -34,22 +31,20 @@ const Logo = ({ className, inverse, type }) => {
|
|
|
34
31
|
];
|
|
35
32
|
const LogoMd = svgPaths[`${type}${inverse ? '_INVERSE' : ''}`];
|
|
36
33
|
|
|
37
|
-
const screenMd = useScreenSize(Breakpoint.MEDIUM);
|
|
38
|
-
|
|
39
34
|
return (
|
|
40
35
|
<span
|
|
41
36
|
aria-label={
|
|
42
37
|
type === LogoType.WISE
|
|
43
38
|
? 'Wise'
|
|
44
39
|
: 'Wise Business' | (type === LogoType.WISE_PLATFORM)
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
? 'Wise Platform'
|
|
41
|
+
: 'Wise Business'
|
|
47
42
|
}
|
|
48
43
|
role="img"
|
|
49
44
|
className={classNames(className, 'np-logo')}
|
|
50
45
|
>
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
<LogoSm className="np-logo-svg np-logo-svg--size-sm" />
|
|
47
|
+
<LogoMd className="np-logo-svg np-logo-svg--size-md" />
|
|
53
48
|
</span>
|
|
54
49
|
);
|
|
55
50
|
};
|
package/src/logo/Logo.less
CHANGED
|
@@ -8,7 +8,7 @@ exports[`Logo on mobile renders only fast flag 1`] = `
|
|
|
8
8
|
role="img"
|
|
9
9
|
>
|
|
10
10
|
<svg
|
|
11
|
-
class="np-logo-svg"
|
|
11
|
+
class="np-logo-svg np-logo-svg--size-sm"
|
|
12
12
|
fill="none"
|
|
13
13
|
height="24"
|
|
14
14
|
width="26"
|
|
@@ -19,6 +19,18 @@ exports[`Logo on mobile renders only fast flag 1`] = `
|
|
|
19
19
|
fill="#163300"
|
|
20
20
|
/>
|
|
21
21
|
</svg>
|
|
22
|
+
<svg
|
|
23
|
+
class="np-logo-svg np-logo-svg--size-md"
|
|
24
|
+
fill="none"
|
|
25
|
+
height="24"
|
|
26
|
+
width="106"
|
|
27
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
28
|
+
>
|
|
29
|
+
<path
|
|
30
|
+
d="M58.738.359h6.498l-3.27 23.322h-6.498L58.739.359Zm-8.193 0L46.16 13.794 44.247.359h-4.545L33.96 13.754 33.243.36h-6.299l2.193 23.322h5.223l6.458-14.75 2.272 14.75h5.143L56.725.359h-6.18Zm54.558 13.555H89.674c.08 3.03 1.894 5.023 4.565 5.023 2.014 0 3.608-1.077 4.844-3.13l5.208 2.368C102.501 21.702 98.729 24 94.08 24c-6.339 0-10.545-4.266-10.545-11.123C83.535 5.342 88.478 0 95.455 0c6.14 0 10.007 4.146 10.007 10.605 0 1.076-.12 2.152-.359 3.309Zm-5.78-4.466c0-2.71-1.516-4.425-3.947-4.425-2.512 0-4.585 1.794-5.144 4.425h9.09ZM6.632 7.387 0 15.139h11.844l1.33-3.655H8.1l3.1-3.586.01-.095-2.016-3.471h9.072l-7.032 19.35h4.812L24.538.358H2.6l4.033 7.028Zm69.168-2.364c2.292 0 4.3 1.233 6.055 3.346l.921-6.575C81.143.688 78.93 0 76 0c-5.82 0-9.09 3.409-9.09 7.734 0 3 1.675 4.834 4.426 6.02l1.315.598c2.452 1.047 3.11 1.565 3.11 2.671 0 1.146-1.106 1.874-2.79 1.874-2.782.01-5.034-1.415-6.728-3.847l-.94 6.699C67.234 23.22 69.708 24 72.97 24c5.532 0 8.93-3.19 8.93-7.615 0-3.01-1.335-4.943-4.704-6.458l-1.435-.678c-1.994-.887-2.671-1.375-2.671-2.352 0-1.056.927-1.874 2.71-1.874Z"
|
|
31
|
+
fill="#163300"
|
|
32
|
+
/>
|
|
33
|
+
</svg>
|
|
22
34
|
</span>
|
|
23
35
|
</div>
|
|
24
36
|
`;
|
|
@@ -31,7 +43,19 @@ exports[`Logo renders wise business logo 1`] = `
|
|
|
31
43
|
role="img"
|
|
32
44
|
>
|
|
33
45
|
<svg
|
|
34
|
-
class="np-logo-svg"
|
|
46
|
+
class="np-logo-svg np-logo-svg--size-sm"
|
|
47
|
+
fill="none"
|
|
48
|
+
height="24"
|
|
49
|
+
width="26"
|
|
50
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
51
|
+
>
|
|
52
|
+
<path
|
|
53
|
+
d="M6.826 7.232 0 15.21h12.188l1.37-3.762H8.335l3.191-3.69.01-.098L9.461 4.09h9.336L11.56 24h4.953L25.25 0H2.676l4.15 7.232Z"
|
|
54
|
+
fill="#163300"
|
|
55
|
+
/>
|
|
56
|
+
</svg>
|
|
57
|
+
<svg
|
|
58
|
+
class="np-logo-svg np-logo-svg--size-md"
|
|
35
59
|
fill="none"
|
|
36
60
|
height="24"
|
|
37
61
|
width="106"
|
|
@@ -54,7 +78,19 @@ exports[`Logo renders wise business logo inversed 1`] = `
|
|
|
54
78
|
role="img"
|
|
55
79
|
>
|
|
56
80
|
<svg
|
|
57
|
-
class="np-logo-svg"
|
|
81
|
+
class="np-logo-svg np-logo-svg--size-sm"
|
|
82
|
+
fill="none"
|
|
83
|
+
height="24"
|
|
84
|
+
width="26"
|
|
85
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
86
|
+
>
|
|
87
|
+
<path
|
|
88
|
+
d="M6.826 7.232 0 15.21h12.188l1.37-3.762H8.335l3.191-3.69.01-.098L9.461 4.09h9.336L11.56 24h4.953L25.25 0H2.676l4.15 7.232Z"
|
|
89
|
+
fill="#9FE870"
|
|
90
|
+
/>
|
|
91
|
+
</svg>
|
|
92
|
+
<svg
|
|
93
|
+
class="np-logo-svg np-logo-svg--size-md"
|
|
58
94
|
fill="none"
|
|
59
95
|
height="24"
|
|
60
96
|
width="106"
|
|
@@ -77,7 +113,19 @@ exports[`Logo renders wise logo 1`] = `
|
|
|
77
113
|
role="img"
|
|
78
114
|
>
|
|
79
115
|
<svg
|
|
80
|
-
class="np-logo-svg"
|
|
116
|
+
class="np-logo-svg np-logo-svg--size-sm"
|
|
117
|
+
fill="none"
|
|
118
|
+
height="24"
|
|
119
|
+
width="26"
|
|
120
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
121
|
+
>
|
|
122
|
+
<path
|
|
123
|
+
d="M6.826 7.232 0 15.21h12.188l1.37-3.762H8.335l3.191-3.69.01-.098L9.461 4.09h9.336L11.56 24h4.953L25.25 0H2.676l4.15 7.232Z"
|
|
124
|
+
fill="#163300"
|
|
125
|
+
/>
|
|
126
|
+
</svg>
|
|
127
|
+
<svg
|
|
128
|
+
class="np-logo-svg np-logo-svg--size-md"
|
|
81
129
|
fill="none"
|
|
82
130
|
height="24"
|
|
83
131
|
width="106"
|
|
@@ -100,7 +148,19 @@ exports[`Logo renders wise logo by default 1`] = `
|
|
|
100
148
|
role="img"
|
|
101
149
|
>
|
|
102
150
|
<svg
|
|
103
|
-
class="np-logo-svg"
|
|
151
|
+
class="np-logo-svg np-logo-svg--size-sm"
|
|
152
|
+
fill="none"
|
|
153
|
+
height="24"
|
|
154
|
+
width="26"
|
|
155
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
156
|
+
>
|
|
157
|
+
<path
|
|
158
|
+
d="M6.826 7.232 0 15.21h12.188l1.37-3.762H8.335l3.191-3.69.01-.098L9.461 4.09h9.336L11.56 24h4.953L25.25 0H2.676l4.15 7.232Z"
|
|
159
|
+
fill="#163300"
|
|
160
|
+
/>
|
|
161
|
+
</svg>
|
|
162
|
+
<svg
|
|
163
|
+
class="np-logo-svg np-logo-svg--size-md"
|
|
104
164
|
fill="none"
|
|
105
165
|
height="24"
|
|
106
166
|
width="106"
|
|
@@ -123,7 +183,19 @@ exports[`Logo renders wise logo inversed 1`] = `
|
|
|
123
183
|
role="img"
|
|
124
184
|
>
|
|
125
185
|
<svg
|
|
126
|
-
class="np-logo-svg"
|
|
186
|
+
class="np-logo-svg np-logo-svg--size-sm"
|
|
187
|
+
fill="none"
|
|
188
|
+
height="24"
|
|
189
|
+
width="26"
|
|
190
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
191
|
+
>
|
|
192
|
+
<path
|
|
193
|
+
d="M6.826 7.232 0 15.21h12.188l1.37-3.762H8.335l3.191-3.69.01-.098L9.461 4.09h9.336L11.56 24h4.953L25.25 0H2.676l4.15 7.232Z"
|
|
194
|
+
fill="#9FE870"
|
|
195
|
+
/>
|
|
196
|
+
</svg>
|
|
197
|
+
<svg
|
|
198
|
+
class="np-logo-svg np-logo-svg--size-md"
|
|
127
199
|
fill="none"
|
|
128
200
|
height="24"
|
|
129
201
|
width="106"
|
|
@@ -146,7 +218,19 @@ exports[`Logo renders wise platform logo 1`] = `
|
|
|
146
218
|
role="img"
|
|
147
219
|
>
|
|
148
220
|
<svg
|
|
149
|
-
class="np-logo-svg"
|
|
221
|
+
class="np-logo-svg np-logo-svg--size-sm"
|
|
222
|
+
fill="none"
|
|
223
|
+
height="18"
|
|
224
|
+
width="111"
|
|
225
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
226
|
+
>
|
|
227
|
+
<path
|
|
228
|
+
d="M4.887 5.92 0 11.525h8.726l.98-2.642H5.969L8.252 6.29l.008-.068-1.486-2.508h6.683L8.276 17.7h3.546L18.079.84H1.916l2.97 5.08Zm17.114 11.8V.792h6.15c1.341 0 2.454.24 3.334.719.882.48 1.541 1.134 1.979 1.963.438.83.657 1.762.657 2.798s-.22 1.976-.662 2.806c-.44.829-1.104 1.485-1.988 1.967-.885.482-1.995.723-3.331.723h-4.23V9.603h3.994c.848 0 1.536-.144 2.064-.434.528-.29.914-.684 1.162-1.186.248-.501.37-1.07.37-1.71 0-.639-.122-1.206-.37-1.702-.248-.497-.636-.885-1.166-1.165-.531-.282-1.228-.422-2.093-.422h-3.268v14.735H22h.001ZM38.823.793v16.926h-2.518V.793h2.518ZM45.712 18c-.82 0-1.561-.15-2.224-.45a3.665 3.665 0 0 1-1.572-1.31c-.385-.573-.576-1.275-.576-2.107 0-.717.14-1.307.42-1.768.281-.462.661-.83 1.138-1.1a6.036 6.036 0 0 1 1.6-.612c.59-.139 1.19-.243 1.802-.314.775-.088 1.404-.16 1.887-.218.482-.058.834-.153 1.052-.286.22-.132.33-.347.33-.644v-.058c0-.72-.208-1.28-.62-1.678-.412-.396-1.025-.595-1.84-.595-.813 0-1.514.183-2 .55-.486.366-.822.772-1.007 1.218L41.736 8.1c.28-.772.692-1.395 1.234-1.873a5.034 5.034 0 0 1 1.874-1.041 7.562 7.562 0 0 1 2.232-.327c.516 0 1.065.06 1.647.178a4.949 4.949 0 0 1 1.634.65c.509.313.925.76 1.25 1.342.325.58.49 1.334.49 2.26v8.43h-2.46v-1.736h-.101c-.163.32-.408.634-.733.942-.326.309-.744.565-1.255.77-.512.204-1.123.305-1.836.305Zm.547-1.984c.696 0 1.294-.135 1.79-.405.497-.27.876-.623 1.138-1.062a2.71 2.71 0 0 0 .392-1.409v-1.637c-.09.089-.262.17-.518.244a7.313 7.313 0 0 1-.871.19c-.327.054-.644.1-.952.14l-.774.104c-.489.06-.933.162-1.336.306-.4.144-.722.348-.96.616-.239.267-.358.62-.358 1.062 0 .612.23 1.073.69 1.385.46.31 1.048.466 1.76.466ZM60.833 5.025V7.01h-7.067V5.025h7.067Zm-5.172-3.04h2.518v12.008c0 .48.074.838.22 1.078a1.1 1.1 0 0 0 .568.488c.233.086.487.128.763.128.201 0 .378-.014.53-.04l.354-.066.455 2.041a4.53 4.53 0 0 1-.624.17c-.27.058-.607.09-1.01.095a4.509 4.509 0 0 1-1.853-.347 3.166 3.166 0 0 1-1.39-1.124c-.355-.506-.531-1.143-.531-1.91V1.985Zm13.846 3.041V7.01h-7.312V5.026h7.312ZM64.2 17.72V3.555c0-.794.177-1.453.531-1.98.354-.525.823-.92 1.406-1.18a4.615 4.615 0 0 1 1.904-.393A6.072 6.072 0 0 1 70.14.34l-.59 2c-.117-.034-.27-.074-.454-.12a2.81 2.81 0 0 0-.674-.07c-.612 0-1.048.148-1.309.445-.26.297-.392.728-.392 1.29V17.72H64.2Zm12.182.257c-1.213 0-2.27-.273-3.175-.818-.904-.545-1.606-1.31-2.106-2.289-.5-.981-.75-2.127-.75-3.438 0-1.312.25-2.469.75-3.455.5-.986 1.202-1.753 2.106-2.298.904-.545 1.963-.818 3.175-.818 1.213 0 2.271.273 3.176.818.904.545 1.605 1.312 2.106 2.298.499.986.75 2.138.75 3.455 0 1.316-.251 2.457-.75 3.438-.5.981-1.202 1.744-2.106 2.289-.905.545-1.963.818-3.176.818Zm.008-2.075c.787 0 1.438-.203 1.954-.611.517-.41.9-.95 1.15-1.628.25-.678.374-1.425.374-2.24 0-.815-.124-1.555-.374-2.236-.25-.68-.633-1.227-1.15-1.64-.516-.415-1.167-.62-1.954-.62-.786 0-1.448.206-1.967.62-.519.412-.904.96-1.153 1.64a6.43 6.43 0 0 0-.375 2.236c0 .81.125 1.562.375 2.24.25.677.634 1.22 1.153 1.627.52.408 1.176.613 1.967.613Zm8.044 1.818V5.026h2.434v2.016h.135a3.098 3.098 0 0 1 1.25-1.617 3.618 3.618 0 0 1 2.034-.591 10.677 10.677 0 0 1 1.071.058v2.363a5.1 5.1 0 0 0-.538-.095 5.6 5.6 0 0 0-.775-.054c-.595 0-1.124.122-1.588.368-.464.245-.83.583-1.1 1.017-.27.432-.405.924-.405 1.475v7.752h-2.518v.002Zm8.589 0V5.025h2.418v2.067h.16c.27-.7.71-1.246 1.322-1.641.612-.394 1.345-.592 2.2-.592.854 0 1.59.198 2.177.596.587.396 1.021.942 1.302 1.637h.135c.309-.678.8-1.22 1.474-1.624.674-.405 1.477-.607 2.409-.607 1.174 0 2.132.361 2.876 1.082.744.722 1.117 1.81 1.117 3.265v8.512h-2.519V9.44c0-.86-.239-1.483-.716-1.869-.477-.386-1.047-.578-1.71-.578-.82 0-1.457.246-1.912.739-.455.492-.683 1.125-.683 1.896v8.092h-2.509V9.283c0-.69-.219-1.243-.657-1.662-.437-.419-1.007-.627-1.71-.627-.477 0-.917.122-1.318.368a2.74 2.74 0 0 0-.969 1.02c-.243.435-.365.94-.365 1.513v7.826h-2.519l-.003-.001Z"
|
|
229
|
+
fill="#163300"
|
|
230
|
+
/>
|
|
231
|
+
</svg>
|
|
232
|
+
<svg
|
|
233
|
+
class="np-logo-svg np-logo-svg--size-md"
|
|
150
234
|
fill="none"
|
|
151
235
|
height="18"
|
|
152
236
|
width="172"
|
|
@@ -169,7 +253,19 @@ exports[`Logo renders wise platform logo inversed 1`] = `
|
|
|
169
253
|
role="img"
|
|
170
254
|
>
|
|
171
255
|
<svg
|
|
172
|
-
class="np-logo-svg"
|
|
256
|
+
class="np-logo-svg np-logo-svg--size-sm"
|
|
257
|
+
fill="none"
|
|
258
|
+
height="18"
|
|
259
|
+
width="111"
|
|
260
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
261
|
+
>
|
|
262
|
+
<path
|
|
263
|
+
d="M4.887 5.918 0 11.523h8.726l.98-2.642H5.969l2.284-2.593.008-.068-1.486-2.508h6.683L8.276 17.699h3.546L18.079.838H1.916l2.97 5.08Zm17.114 11.799V.791h6.15c1.341 0 2.454.24 3.334.719.882.48 1.541 1.134 1.979 1.963.438.83.657 1.762.657 2.798s-.22 1.976-.662 2.806c-.44.83-1.104 1.485-1.988 1.967-.885.482-1.995.723-3.331.723h-4.23V9.6h3.994c.848 0 1.536-.144 2.064-.434.528-.29.914-.684 1.162-1.186.248-.501.37-1.07.37-1.71 0-.639-.122-1.206-.37-1.702-.248-.497-.636-.885-1.166-1.165-.531-.282-1.228-.422-2.093-.422h-3.268v14.735H22h.001ZM38.823.791v16.926h-2.518V.791h2.518Zm6.889 17.207c-.82 0-1.561-.15-2.224-.45a3.665 3.665 0 0 1-1.572-1.31c-.385-.573-.576-1.275-.576-2.107 0-.716.14-1.307.42-1.768.281-.462.661-.83 1.138-1.1a6.036 6.036 0 0 1 1.6-.612c.59-.139 1.19-.243 1.802-.313.775-.09 1.404-.161 1.887-.22.482-.057.834-.152 1.052-.285.22-.132.33-.347.33-.644v-.058c0-.72-.208-1.28-.62-1.678-.412-.396-1.025-.595-1.84-.595-.813 0-1.514.183-2 .55-.486.366-.822.772-1.007 1.218l-2.366-.528c.28-.772.692-1.395 1.234-1.872a5.034 5.034 0 0 1 1.874-1.042 7.562 7.562 0 0 1 2.232-.327c.516 0 1.065.06 1.647.178a4.949 4.949 0 0 1 1.634.65c.509.313.925.76 1.25 1.342.325.58.49 1.334.49 2.26v8.43h-2.46V15.98h-.101c-.163.32-.408.634-.733.942-.326.309-.744.565-1.255.77-.512.204-1.123.305-1.836.305Zm.547-1.984c.696 0 1.294-.135 1.79-.405.497-.27.876-.623 1.138-1.062a2.71 2.71 0 0 0 .392-1.409v-1.637c-.09.089-.262.17-.518.245a7.313 7.313 0 0 1-.871.19 33.88 33.88 0 0 1-.952.14l-.774.103c-.489.06-.933.162-1.336.306-.4.144-.722.348-.96.616-.239.267-.358.62-.358 1.062 0 .612.23 1.073.69 1.385.46.31 1.048.466 1.76.466ZM60.833 5.023v1.984h-7.067V5.023h7.067Zm-5.172-3.04h2.518V13.99c0 .48.074.838.22 1.078a1.1 1.1 0 0 0 .568.488c.233.086.487.128.763.128.201 0 .378-.014.53-.04l.354-.066.455 2.041a4.518 4.518 0 0 1-.624.17c-.27.058-.607.09-1.01.095a4.509 4.509 0 0 1-1.853-.347 3.165 3.165 0 0 1-1.39-1.124c-.355-.506-.531-1.143-.531-1.91V1.983Zm13.846 3.041v1.984h-7.312V5.024h7.312ZM64.2 17.718V3.553c0-.794.177-1.453.531-1.98.354-.525.823-.92 1.406-1.18A4.615 4.615 0 0 1 68.041 0a6.072 6.072 0 0 1 2.098.338l-.59 2c-.117-.034-.27-.074-.454-.12a2.81 2.81 0 0 0-.674-.07c-.612 0-1.048.148-1.309.445-.26.297-.392.728-.392 1.29v13.835H64.2Zm12.182.257c-1.213 0-2.27-.273-3.175-.818-.904-.545-1.606-1.31-2.106-2.289-.5-.981-.75-2.127-.75-3.438 0-1.312.25-2.469.75-3.455.5-.986 1.202-1.753 2.106-2.298.904-.545 1.963-.818 3.175-.818 1.213 0 2.271.273 3.176.818.904.545 1.605 1.312 2.106 2.298.499.986.75 2.138.75 3.455 0 1.316-.251 2.457-.75 3.438-.5.981-1.202 1.744-2.106 2.289-.905.545-1.963.818-3.176.818Zm.008-2.074c.787 0 1.438-.204 1.954-.612.517-.41.9-.95 1.15-1.628.25-.678.374-1.425.374-2.24 0-.815-.124-1.555-.374-2.236-.25-.68-.633-1.227-1.15-1.64-.516-.415-1.167-.62-1.954-.62-.786 0-1.448.206-1.967.62-.519.412-.904.96-1.153 1.64a6.43 6.43 0 0 0-.375 2.236c0 .81.125 1.562.375 2.24.25.677.634 1.22 1.153 1.628.52.407 1.176.612 1.967.612Zm8.044 1.817V5.024h2.434V7.04h.135a3.098 3.098 0 0 1 1.25-1.617 3.619 3.619 0 0 1 2.034-.591 10.666 10.666 0 0 1 1.071.058v2.363a5.1 5.1 0 0 0-.538-.095 5.6 5.6 0 0 0-.775-.054c-.595 0-1.124.122-1.588.368-.464.245-.83.584-1.1 1.017-.27.432-.405.924-.405 1.475v7.752h-2.518v.002Zm8.589 0V5.023h2.418V7.09h.16c.27-.7.71-1.246 1.322-1.641.612-.394 1.345-.592 2.2-.592.854 0 1.59.198 2.177.596.587.396 1.021.942 1.302 1.637h.135c.309-.678.8-1.22 1.474-1.624.674-.405 1.477-.607 2.409-.607 1.174 0 2.132.361 2.876 1.082.744.722 1.117 1.81 1.117 3.265v8.512h-2.519v-8.28c0-.86-.239-1.483-.716-1.869-.477-.386-1.047-.578-1.71-.578-.82 0-1.457.246-1.912.739-.455.492-.683 1.125-.683 1.896v8.092h-2.509V9.281c0-.69-.219-1.242-.657-1.662-.437-.419-1.007-.627-1.71-.627-.477 0-.917.122-1.318.368a2.74 2.74 0 0 0-.969 1.02c-.243.435-.365.94-.365 1.513v7.826h-2.522Z"
|
|
264
|
+
fill="#fff"
|
|
265
|
+
/>
|
|
266
|
+
</svg>
|
|
267
|
+
<svg
|
|
268
|
+
class="np-logo-svg np-logo-svg--size-md"
|
|
173
269
|
fill="none"
|
|
174
270
|
height="18"
|
|
175
271
|
width="172"
|
package/src/main.css
CHANGED
|
@@ -1857,11 +1857,6 @@ button.np-option {
|
|
|
1857
1857
|
transition: opacity 150ms ease-in, height 150ms ease-in 150ms;
|
|
1858
1858
|
opacity: 0;
|
|
1859
1859
|
}
|
|
1860
|
-
.formatted-value__h3-custom-alignment {
|
|
1861
|
-
margin-bottom: 16px;
|
|
1862
|
-
margin-bottom: var(--size-16);
|
|
1863
|
-
line-height: 24px;
|
|
1864
|
-
}
|
|
1865
1860
|
.emphasis {
|
|
1866
1861
|
font-weight: 600;
|
|
1867
1862
|
font-weight: var(--font-weight-semi-bold);
|
|
@@ -3028,6 +3023,22 @@ a {
|
|
|
3028
3023
|
.np-theme-personal--dark .np-logo-svg path {
|
|
3029
3024
|
fill: var(--color-white);
|
|
3030
3025
|
}
|
|
3026
|
+
.np-logo-svg--size-sm {
|
|
3027
|
+
display: block;
|
|
3028
|
+
}
|
|
3029
|
+
@media (min-width: 576px) {
|
|
3030
|
+
.np-logo-svg--size-sm {
|
|
3031
|
+
display: none;
|
|
3032
|
+
}
|
|
3033
|
+
}
|
|
3034
|
+
.np-logo-svg--size-md {
|
|
3035
|
+
display: none;
|
|
3036
|
+
}
|
|
3037
|
+
@media (min-width: 576px) {
|
|
3038
|
+
.np-logo-svg--size-md {
|
|
3039
|
+
display: block;
|
|
3040
|
+
}
|
|
3041
|
+
}
|
|
3031
3042
|
.tw-modal--scrollable {
|
|
3032
3043
|
max-height: 100%;
|
|
3033
3044
|
/* mobile viewport bug fix */
|
package/src/main.less
CHANGED
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
@import "./dimmer/Dimmer.less";
|
|
23
23
|
@import "./drawer/Drawer.less";
|
|
24
24
|
@import "./dropFade/DropFade.less";
|
|
25
|
-
@import "./dynamicFieldDefinitionList/FormattedValue/FormattedValue.less";
|
|
26
25
|
@import "./emphasis/Emphasis.less";
|
|
27
26
|
@import "./flowNavigation/animatedLabel/AnimatedLabel.less";
|
|
28
27
|
@import "./flowNavigation/backButton/BackButton.less";
|
|
@@ -16,7 +16,7 @@ export default {
|
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
18
|
<>
|
|
19
|
-
<label htmlFor={args.id
|
|
19
|
+
<label htmlFor={args.id}>Editable money input label</label>
|
|
20
20
|
<MoneyInput
|
|
21
21
|
{...args}
|
|
22
22
|
selectedCurrency={selectedCurrency}
|
|
@@ -160,13 +160,13 @@ export const SmallInput: Story = {
|
|
|
160
160
|
render: (args) => {
|
|
161
161
|
return (
|
|
162
162
|
<>
|
|
163
|
-
<label htmlFor={args.id
|
|
163
|
+
<label htmlFor={args.id}>Money inputs</label>
|
|
164
164
|
<MoneyInput {...args} {...SingleCurrency.args} />
|
|
165
165
|
<br />
|
|
166
166
|
<MoneyInput {...args} {...MultipleCurrencies.args} />
|
|
167
167
|
<hr />
|
|
168
168
|
<div className="has-error">
|
|
169
|
-
<label htmlFor={args.id
|
|
169
|
+
<label htmlFor={args.id}>Error states</label>
|
|
170
170
|
<MoneyInput {...args} {...SingleCurrency.args} />
|
|
171
171
|
<br />
|
|
172
172
|
<MoneyInput {...args} {...MultipleCurrencies.args} />
|
package/src/nudge/Nudge.spec.tsx
CHANGED
|
@@ -51,14 +51,14 @@ describe('Nudge', () => {
|
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
it('does NOT render a nudge if localStorage has been set with the id of the nudge', () => {
|
|
54
|
-
jest.spyOn(
|
|
54
|
+
jest.spyOn(Storage.prototype, 'getItem').mockReturnValue('["CAKE","TEST"]');
|
|
55
55
|
|
|
56
56
|
render(<Nudge {...defaultProps} id="TEST" persistDismissal />);
|
|
57
57
|
expect(screen.queryByText('A nudge title')).not.toBeInTheDocument();
|
|
58
58
|
});
|
|
59
59
|
|
|
60
60
|
it('does NOT render a nudge if localStorage has been set with the id of the nudge AND calls is previously dismissed with TRUE', () => {
|
|
61
|
-
jest.spyOn(
|
|
61
|
+
jest.spyOn(Storage.prototype, 'getItem').mockReturnValue('["CAKE","TEST"]');
|
|
62
62
|
const isPreviouslyDismissed = jest.fn();
|
|
63
63
|
|
|
64
64
|
render(
|
|
@@ -75,7 +75,7 @@ describe('Nudge', () => {
|
|
|
75
75
|
});
|
|
76
76
|
|
|
77
77
|
it('shows a nudge if localStorage has been set with a different id for a different nudge and calls is previously dismissed with FALSE', () => {
|
|
78
|
-
jest.spyOn(
|
|
78
|
+
jest.spyOn(Storage.prototype, 'getItem').mockReturnValue('["BANANA"]');
|
|
79
79
|
const isPreviouslyDismissed = jest.fn();
|
|
80
80
|
|
|
81
81
|
render(
|
|
@@ -92,8 +92,8 @@ describe('Nudge', () => {
|
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
it('calls local storage with updated dismissed nudges value', () => {
|
|
95
|
-
jest.spyOn(
|
|
96
|
-
const setItem = jest.spyOn(
|
|
95
|
+
jest.spyOn(Storage.prototype, 'getItem').mockReturnValue('["BANANA"]');
|
|
96
|
+
const setItem = jest.spyOn(Storage.prototype, 'setItem');
|
|
97
97
|
|
|
98
98
|
render(<Nudge {...defaultProps} id="TEST" persistDismissal />);
|
|
99
99
|
expect(screen.getByText('A nudge title')).toBeInTheDocument();
|
|
@@ -110,7 +110,8 @@ const PhoneNumberInput = ({
|
|
|
110
110
|
|
|
111
111
|
useEffect(() => {
|
|
112
112
|
if (broadcastedValue === null) {
|
|
113
|
-
|
|
113
|
+
setBroadcastedValue(internalValue);
|
|
114
|
+
return;
|
|
114
115
|
}
|
|
115
116
|
|
|
116
117
|
const internalPhoneNumber = `${internalValue.prefix ?? ''}${internalValue.suffix}`;
|
package/src/popover/Popover.tsx
CHANGED
|
@@ -38,8 +38,9 @@ function resolvePlacement(preferredPlacement: PopoverPreferredPlacement) {
|
|
|
38
38
|
case 'bottom-left':
|
|
39
39
|
case 'bottom-right':
|
|
40
40
|
return 'bottom';
|
|
41
|
+
default:
|
|
42
|
+
return preferredPlacement;
|
|
41
43
|
}
|
|
42
|
-
return preferredPlacement;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
export default function Popover({
|
|
@@ -298,7 +298,7 @@ const PromoCard: FunctionComponent<PromoCardProps> = forwardRef(
|
|
|
298
298
|
...commonProps,
|
|
299
299
|
'aria-checked':
|
|
300
300
|
type === 'radio' ? value === state : type === 'checkbox' ? checked : undefined,
|
|
301
|
-
'aria-describedby': `${componentId}-title
|
|
301
|
+
'aria-describedby': `${componentId}-title`,
|
|
302
302
|
'aria-disabled': isDisabled,
|
|
303
303
|
'data-value': value ?? undefined,
|
|
304
304
|
role: type === 'checkbox' || type === 'radio' ? type : undefined,
|
|
@@ -34,7 +34,7 @@ const RADIOS = [
|
|
|
34
34
|
|
|
35
35
|
describe('RadioGroup', () => {
|
|
36
36
|
it('renders null if no radios are provided', () => {
|
|
37
|
-
expect(shallow(<RadioGroup radios={[]} {...props} />).
|
|
37
|
+
expect(shallow(<RadioGroup radios={[]} {...props} />).isEmptyRender()).toBe(true);
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
it('renders radio options', () => {
|