@transferwise/components 46.93.1 → 46.94.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/button/LegacyButton.js +0 -2
- package/build/button/LegacyButton.js.map +1 -1
- package/build/button/LegacyButton.mjs +0 -2
- package/build/button/LegacyButton.mjs.map +1 -1
- package/build/carousel/Carousel.js +1 -3
- package/build/carousel/Carousel.js.map +1 -1
- package/build/carousel/Carousel.mjs +1 -3
- package/build/carousel/Carousel.mjs.map +1 -1
- package/build/checkbox/Checkbox.js.map +1 -1
- package/build/checkbox/Checkbox.mjs.map +1 -1
- package/build/checkboxButton/CheckboxButton.js +1 -1
- package/build/checkboxButton/CheckboxButton.js.map +1 -1
- package/build/checkboxButton/CheckboxButton.mjs +1 -1
- package/build/checkboxButton/CheckboxButton.mjs.map +1 -1
- package/build/checkboxOption/CheckboxOption.js.map +1 -1
- package/build/checkboxOption/CheckboxOption.mjs.map +1 -1
- package/build/common/bottomSheet/BottomSheet.js.map +1 -1
- package/build/common/bottomSheet/BottomSheet.mjs.map +1 -1
- package/build/common/dateUtils/isDateValid/isDateValid.js +3 -3
- package/build/common/dateUtils/isDateValid/isDateValid.js.map +1 -1
- package/build/common/dateUtils/isDateValid/isDateValid.mjs +3 -3
- package/build/common/dateUtils/isDateValid/isDateValid.mjs.map +1 -1
- package/build/common/panel/Panel.js +3 -8
- package/build/common/panel/Panel.js.map +1 -1
- package/build/common/panel/Panel.mjs +3 -8
- package/build/common/panel/Panel.mjs.map +1 -1
- package/build/dimmer/dimmerManager/DimmerManager.js.map +1 -1
- package/build/dimmer/dimmerManager/DimmerManager.mjs.map +1 -1
- package/build/dropFade/DropFade.js.map +1 -1
- package/build/dropFade/DropFade.mjs.map +1 -1
- package/build/emphasis/EmphasisHtmlTransformer.js.map +1 -1
- package/build/emphasis/EmphasisHtmlTransformer.mjs.map +1 -1
- package/build/inputs/Input.js +1 -3
- package/build/inputs/Input.js.map +1 -1
- package/build/inputs/Input.mjs +1 -3
- package/build/inputs/Input.mjs.map +1 -1
- package/build/inputs/SelectInput.js +1 -3
- package/build/inputs/SelectInput.js.map +1 -1
- package/build/inputs/SelectInput.mjs +1 -3
- package/build/inputs/SelectInput.mjs.map +1 -1
- package/build/inputs/_ButtonInput.js +1 -3
- package/build/inputs/_ButtonInput.js.map +1 -1
- package/build/inputs/_ButtonInput.mjs +1 -3
- package/build/inputs/_ButtonInput.mjs.map +1 -1
- package/build/inputs/_Popover.js +1 -3
- package/build/inputs/_Popover.js.map +1 -1
- package/build/inputs/_Popover.mjs +1 -3
- package/build/inputs/_Popover.mjs.map +1 -1
- package/build/moneyInput/currencyFormatting.js +2 -2
- package/build/moneyInput/currencyFormatting.js.map +1 -1
- package/build/moneyInput/currencyFormatting.mjs +2 -2
- package/build/moneyInput/currencyFormatting.mjs.map +1 -1
- package/build/nudge/Nudge.js +0 -2
- package/build/nudge/Nudge.js.map +1 -1
- package/build/nudge/Nudge.mjs +0 -2
- package/build/nudge/Nudge.mjs.map +1 -1
- package/build/promoCard/PromoCardContext.js +0 -1
- package/build/promoCard/PromoCardContext.js.map +1 -1
- package/build/promoCard/PromoCardContext.mjs +0 -1
- package/build/promoCard/PromoCardContext.mjs.map +1 -1
- package/build/promoCard/PromoCardGroup.js +0 -1
- package/build/promoCard/PromoCardGroup.js.map +1 -1
- package/build/promoCard/PromoCardGroup.mjs +0 -1
- package/build/promoCard/PromoCardGroup.mjs.map +1 -1
- package/build/select/Select.js +19 -25
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.mjs +19 -25
- package/build/select/Select.mjs.map +1 -1
- package/build/table/Table.js +1 -3
- package/build/table/Table.js.map +1 -1
- package/build/table/Table.mjs +1 -3
- package/build/table/Table.mjs.map +1 -1
- package/build/tooltip/Tooltip.js +2 -6
- package/build/tooltip/Tooltip.js.map +1 -1
- package/build/tooltip/Tooltip.mjs +2 -6
- package/build/tooltip/Tooltip.mjs.map +1 -1
- package/build/types/button/LegacyButton.d.ts.map +1 -1
- package/build/types/carousel/Carousel.d.ts.map +1 -1
- package/build/types/checkbox/Checkbox.d.ts.map +1 -1
- package/build/types/checkboxOption/CheckboxOption.d.ts +1 -2
- package/build/types/checkboxOption/CheckboxOption.d.ts.map +1 -1
- package/build/types/common/bottomSheet/BottomSheet.d.ts.map +1 -1
- package/build/types/common/dateUtils/isDateValid/isDateValid.d.ts.map +1 -1
- package/build/types/common/panel/Panel.d.ts.map +1 -1
- package/build/types/dimmer/dimmerManager/DimmerManager.d.ts +1 -1
- package/build/types/dimmer/dimmerManager/DimmerManager.d.ts.map +1 -1
- package/build/types/dropFade/DropFade.d.ts.map +1 -1
- package/build/types/emphasis/EmphasisHtmlTransformer.d.ts +2 -2
- package/build/types/emphasis/EmphasisHtmlTransformer.d.ts.map +1 -1
- package/build/types/inputs/Input.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/inputs/_ButtonInput.d.ts.map +1 -1
- package/build/types/inputs/_Popover.d.ts.map +1 -1
- package/build/types/nudge/Nudge.d.ts.map +1 -1
- package/build/types/promoCard/PromoCardContext.d.ts.map +1 -1
- package/build/types/promoCard/PromoCardGroup.d.ts.map +1 -1
- package/build/types/select/Select.d.ts.map +1 -1
- package/build/types/table/Table.d.ts.map +1 -1
- package/build/types/tooltip/Tooltip.d.ts.map +1 -1
- package/build/types/withId/story/source.d.ts +1 -1
- package/build/types/withId/story/source.d.ts.map +1 -1
- package/build/upload/steps/completeStep/completeStep.js +1 -0
- package/build/upload/steps/completeStep/completeStep.js.map +1 -1
- package/build/upload/steps/completeStep/completeStep.mjs +1 -0
- package/build/upload/steps/completeStep/completeStep.mjs.map +1 -1
- package/build/upload/steps/processingStep/processingStep.js +1 -0
- package/build/upload/steps/processingStep/processingStep.js.map +1 -1
- package/build/upload/steps/processingStep/processingStep.mjs +1 -0
- package/build/upload/steps/processingStep/processingStep.mjs.map +1 -1
- package/package.json +7 -4
- package/src/accordion/Accordion.story.tsx +2 -2
- package/src/accordion/AccordionItem/__snapshots__/AccordionItem.spec.js.snap +6 -2
- package/src/alert/Alert.story.tsx +4 -4
- package/src/alert/Alert.tests.story.tsx +3 -3
- package/src/avatarWrapper/__snapshots__/AvatarWrapper.spec.tsx.snap +12 -4
- package/src/button/LegacyButton.tsx +0 -2
- package/src/carousel/Carousel.spec.tsx +0 -4
- package/src/carousel/Carousel.tsx +0 -1
- package/src/checkbox/Checkbox.tsx +0 -1
- package/src/checkboxButton/CheckboxButton.story.tsx +0 -2
- package/src/checkboxButton/CheckboxButton.tsx +1 -1
- package/src/checkboxOption/CheckboxOption.tsx +1 -2
- package/src/chips/__snapshots__/Chips.spec.tsx.snap +1 -1
- package/src/common/bottomSheet/BottomSheet.spec.tsx +0 -1
- package/src/common/bottomSheet/BottomSheet.story.tsx +1 -1
- package/src/common/bottomSheet/BottomSheet.tsx +0 -1
- package/src/common/bottomSheet/__snapshots__/BottomSheet.spec.tsx.snap +1 -1
- package/src/common/closeButton/__snapshots__/CloseButton.spec.tsx.snap +1 -1
- package/src/common/dateUtils/isDateValid/isDateValid.ts +5 -3
- package/src/common/hooks/useHasIntersected/useHasIntersected.spec.js +0 -2
- package/src/common/panel/Panel.tsx +2 -13
- package/src/dimmer/Dimmer.spec.tsx +3 -1
- package/src/dimmer/Dimmer.story.tsx +3 -2
- package/src/dimmer/dimmerManager/DimmerManager.ts +1 -1
- package/src/display/Display.story.tsx +0 -2
- package/src/drawer/Drawer.story.tsx +6 -4
- package/src/dropFade/DropFade.story.tsx +1 -2
- package/src/dropFade/DropFade.tsx +0 -1
- package/src/emphasis/EmphasisHtmlTransformer.spec.tsx +4 -4
- package/src/emphasis/EmphasisHtmlTransformer.ts +2 -2
- package/src/flowNavigation/FlowNavigation.story.tsx +6 -1
- package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +5 -3
- package/src/inputs/Input.tsx +0 -1
- package/src/inputs/SelectInput.story.tsx +6 -2
- package/src/inputs/SelectInput.tsx +1 -7
- package/src/inputs/_ButtonInput.tsx +0 -1
- package/src/inputs/_Popover.tsx +0 -1
- package/src/link/Link.story.tsx +0 -1
- package/src/listItem/ListItem.story.tsx +0 -2
- package/src/markdown/Markdown.spec.tsx +0 -1
- package/src/modal/Modal.story.tsx +14 -4
- package/src/moneyInput/currencyFormatting.ts +3 -3
- package/src/nudge/Nudge.tsx +0 -2
- package/src/overlayHeader/__snapshots__/OverlayHeader.spec.tsx.snap +1 -1
- package/src/popover/Popover.story.tsx +10 -2
- package/src/promoCard/PromoCardContext.tsx +0 -1
- package/src/promoCard/PromoCardGroup.story.tsx +3 -15
- package/src/promoCard/PromoCardGroup.tsx +0 -1
- package/src/provider/theme/ThemeProvider.story.tsx +3 -5
- package/src/select/Select.spec.tsx +0 -1
- package/src/select/Select.tsx +0 -3
- package/src/select/option/Option.spec.js +2 -2
- package/src/selectOption/SelectOption.story.tsx +1 -2
- package/src/slidingPanel/SlidingPanel.story.tsx +1 -1
- package/src/table/Table.tsx +0 -1
- package/src/test-utils/jest.setup.ts +0 -1
- package/src/tooltip/Tooltip.tsx +0 -2
- package/src/upload/Upload.events.spec.js +4 -4
- package/src/upload/steps/completeStep/completeStep.tsx +1 -1
- package/src/upload/steps/processingStep/processingStep.tsx +1 -1
- package/src/withId/story/source.tsx +1 -1
- package/src/withId/withId.story.tsx +3 -1
|
@@ -43,7 +43,9 @@ exports[`AccordionItem open / close renders an item closed 1`] = `
|
|
|
43
43
|
width="24"
|
|
44
44
|
>
|
|
45
45
|
<path
|
|
46
|
-
|
|
46
|
+
clip-rule="evenodd"
|
|
47
|
+
d="m12 9.414 7.293 7.293 1.414-1.414L12.714 7.3a1.01 1.01 0 0 0-1.428 0l-7.993 7.993 1.414 1.414z"
|
|
48
|
+
fill-rule="evenodd"
|
|
47
49
|
/>
|
|
48
50
|
</svg>
|
|
49
51
|
</span>
|
|
@@ -97,7 +99,9 @@ exports[`AccordionItem open / close renders an item open 1`] = `
|
|
|
97
99
|
width="24"
|
|
98
100
|
>
|
|
99
101
|
<path
|
|
100
|
-
|
|
102
|
+
clip-rule="evenodd"
|
|
103
|
+
d="m12 9.414 7.293 7.293 1.414-1.414L12.714 7.3a1.01 1.01 0 0 0-1.428 0l-7.993 7.993 1.414 1.414z"
|
|
104
|
+
fill-rule="evenodd"
|
|
101
105
|
/>
|
|
102
106
|
</svg>
|
|
103
107
|
</span>
|
|
@@ -213,7 +213,7 @@ export const DynamicRender: Story = {
|
|
|
213
213
|
|
|
214
214
|
return (
|
|
215
215
|
<>
|
|
216
|
-
<Button
|
|
216
|
+
<Button v2 onClick={() => setIsOneActive(true)}>
|
|
217
217
|
Trigger Alert
|
|
218
218
|
</Button>
|
|
219
219
|
|
|
@@ -248,7 +248,7 @@ function Render(args) {
|
|
|
248
248
|
|
|
249
249
|
return (
|
|
250
250
|
<>
|
|
251
|
-
<Button
|
|
251
|
+
<Button v2 onClick={() => setIsOneActive(true)}>
|
|
252
252
|
Trigger Alert
|
|
253
253
|
</Button>
|
|
254
254
|
|
|
@@ -325,7 +325,7 @@ export const MultipleDynamicAlerts: Story = {
|
|
|
325
325
|
</Button>
|
|
326
326
|
|
|
327
327
|
{alerts.map((props) => (
|
|
328
|
-
<Alert
|
|
328
|
+
<Alert key={props.title} {...props} className="m-t-3" />
|
|
329
329
|
))}
|
|
330
330
|
</>
|
|
331
331
|
);
|
|
@@ -352,8 +352,8 @@ function Render() {
|
|
|
352
352
|
|
|
353
353
|
{alerts.map(props => (
|
|
354
354
|
<Alert
|
|
355
|
-
{...props}
|
|
356
355
|
key={props.title}
|
|
356
|
+
{...props}
|
|
357
357
|
className="m-t-3"
|
|
358
358
|
/>
|
|
359
359
|
))}
|
|
@@ -37,7 +37,7 @@ export const SimpleTrigger: Story = {
|
|
|
37
37
|
|
|
38
38
|
return (
|
|
39
39
|
<>
|
|
40
|
-
<Button
|
|
40
|
+
<Button v2 onClick={() => setIsActive(true)}>
|
|
41
41
|
Trigger Alert
|
|
42
42
|
</Button>
|
|
43
43
|
|
|
@@ -119,12 +119,12 @@ export const MultipleDynamicAlerts: Story = {
|
|
|
119
119
|
|
|
120
120
|
return (
|
|
121
121
|
<>
|
|
122
|
-
<Button
|
|
122
|
+
<Button v2 onClick={() => setAlerts(getAlerts())}>
|
|
123
123
|
Generate dynamic alerts
|
|
124
124
|
</Button>
|
|
125
125
|
|
|
126
126
|
{alerts.map((props) => (
|
|
127
|
-
<Alert
|
|
127
|
+
<Alert key={props.title} {...props} className="m-t-3" />
|
|
128
128
|
))}
|
|
129
129
|
</>
|
|
130
130
|
);
|
|
@@ -36,7 +36,9 @@ exports[`FlowNavigationAvatar with a name AND profileType FlowNavigationAvatar w
|
|
|
36
36
|
width="24"
|
|
37
37
|
>
|
|
38
38
|
<path
|
|
39
|
-
|
|
39
|
+
clip-rule="evenodd"
|
|
40
|
+
d="M9.01 3A1.01 1.01 0 0 0 8 4.01V7H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3V4.01A1.01 1.01 0 0 0 14.99 3zM14 7V5h-4v2zm-4 2h4v9h-4zM8 9H5v9h3zm8 9V9h3v9z"
|
|
41
|
+
fill-rule="evenodd"
|
|
40
42
|
/>
|
|
41
43
|
</svg>
|
|
42
44
|
</span>
|
|
@@ -65,7 +67,9 @@ exports[`FlowNavigationAvatar with a name AND profileType FlowNavigationAvatar w
|
|
|
65
67
|
width="24"
|
|
66
68
|
>
|
|
67
69
|
<path
|
|
68
|
-
|
|
70
|
+
clip-rule="evenodd"
|
|
71
|
+
d="M8 8a4 4 0 1 1 8 0 4 4 0 0 1-8 0m7.557 4.832a6 6 0 1 0-7.114 0A8 8 0 0 0 4 20v2h2v-2a6 6 0 0 1 12 0v2h2v-2a8 8 0 0 0-4.443-7.168"
|
|
72
|
+
fill-rule="evenodd"
|
|
69
73
|
/>
|
|
70
74
|
</svg>
|
|
71
75
|
</span>
|
|
@@ -100,7 +104,9 @@ exports[`FlowNavigationAvatar with a name AND profileType with a badge url passe
|
|
|
100
104
|
width="24"
|
|
101
105
|
>
|
|
102
106
|
<path
|
|
103
|
-
|
|
107
|
+
clip-rule="evenodd"
|
|
108
|
+
d="M8 8a4 4 0 1 1 8 0 4 4 0 0 1-8 0m7.557 4.832a6 6 0 1 0-7.114 0A8 8 0 0 0 4 20v2h2v-2a6 6 0 0 1 12 0v2h2v-2a8 8 0 0 0-4.443-7.168"
|
|
109
|
+
fill-rule="evenodd"
|
|
104
110
|
/>
|
|
105
111
|
</svg>
|
|
106
112
|
</span>
|
|
@@ -139,7 +145,9 @@ exports[`FlowNavigationAvatar with a name AND profileType with nothing passed re
|
|
|
139
145
|
width="24"
|
|
140
146
|
>
|
|
141
147
|
<path
|
|
142
|
-
|
|
148
|
+
clip-rule="evenodd"
|
|
149
|
+
d="M8 8a4 4 0 1 1 8 0 4 4 0 0 1-8 0m7.557 4.832a6 6 0 1 0-7.114 0A8 8 0 0 0 4 20v2h2v-2a6 6 0 0 1 12 0v2h2v-2a8 8 0 0 0-4.443-7.168"
|
|
150
|
+
fill-rule="evenodd"
|
|
143
151
|
/>
|
|
144
152
|
</svg>
|
|
145
153
|
</span>
|
|
@@ -133,10 +133,8 @@ const LegacyButton = forwardRef<ButtonReferenceType, LegacyButtonProps>(
|
|
|
133
133
|
disabled,
|
|
134
134
|
},
|
|
135
135
|
// @ts-expect-error fix when refactor `typeClassMap` to TypeScript
|
|
136
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
137
136
|
typeClassMap[newType],
|
|
138
137
|
// @ts-expect-error fix when refactor `typeClassMap` to TypeScript
|
|
139
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
140
138
|
priorityClassMap[newPriority],
|
|
141
139
|
className,
|
|
142
140
|
);
|
|
@@ -47,9 +47,7 @@ describe('Carousel', () => {
|
|
|
47
47
|
const scrollBy = jest.fn();
|
|
48
48
|
|
|
49
49
|
beforeEach(() => {
|
|
50
|
-
// eslint-disable-next-line functional/immutable-data
|
|
51
50
|
window.HTMLElement.prototype.scrollIntoView = focusSpy;
|
|
52
|
-
// eslint-disable-next-line functional/immutable-data
|
|
53
51
|
window.HTMLElement.prototype.scrollBy = scrollBy;
|
|
54
52
|
});
|
|
55
53
|
|
|
@@ -198,13 +196,11 @@ describe('Carousel', () => {
|
|
|
198
196
|
});
|
|
199
197
|
|
|
200
198
|
const mockPositions = (scrollWidth: number, offsetWidth: number) => {
|
|
201
|
-
// eslint-disable-next-line functional/immutable-data
|
|
202
199
|
Object.defineProperty(HTMLElement.prototype, 'scrollWidth', {
|
|
203
200
|
configurable: true,
|
|
204
201
|
value: scrollWidth,
|
|
205
202
|
});
|
|
206
203
|
|
|
207
|
-
// eslint-disable-next-line functional/immutable-data
|
|
208
204
|
Object.defineProperty(HTMLElement.prototype, 'offsetWidth', {
|
|
209
205
|
configurable: true,
|
|
210
206
|
value: offsetWidth,
|
|
@@ -228,7 +228,6 @@ const Carousel: React.FC<CarouselProps> = ({ header, className, cards, onClick }
|
|
|
228
228
|
className={clsx('carousel__card-content', {
|
|
229
229
|
[card.className ?? '']: !!card.className,
|
|
230
230
|
})}
|
|
231
|
-
// eslint-disable-next-line react/forbid-dom-props
|
|
232
231
|
style={card.styles}
|
|
233
232
|
>
|
|
234
233
|
{card.content}
|
|
@@ -44,7 +44,6 @@ export default function Checkbox({
|
|
|
44
44
|
const innerDisabled = disabled || readOnly;
|
|
45
45
|
return (
|
|
46
46
|
<div id={id} className={classList}>
|
|
47
|
-
{/* eslint-disable-next-line jsx-a11y/label-has-for */}
|
|
48
47
|
<label className={clsx({ disabled })}>
|
|
49
48
|
<CheckboxButton
|
|
50
49
|
className="p-r-2"
|
|
@@ -23,7 +23,6 @@ export const Basic: Story = {
|
|
|
23
23
|
'aria-label': 'Toggle email updates',
|
|
24
24
|
},
|
|
25
25
|
render: (args) => {
|
|
26
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
27
26
|
const [checked, setChecked] = useState(true);
|
|
28
27
|
|
|
29
28
|
return <CheckboxButton {...args} checked={checked} onChange={() => setChecked(!checked)} />;
|
|
@@ -36,7 +35,6 @@ export const Indeterminate: Story = {
|
|
|
36
35
|
indeterminate: true,
|
|
37
36
|
},
|
|
38
37
|
render: (args) => {
|
|
39
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
40
38
|
const [indeterminate, setIndeterminate] = useState(true);
|
|
41
39
|
|
|
42
40
|
return (
|
|
@@ -19,7 +19,7 @@ const CheckboxButton = forwardRef<HTMLInputElement, CheckboxButtonProps>(functio
|
|
|
19
19
|
|
|
20
20
|
useEffect(() => {
|
|
21
21
|
if (internalRef.current) {
|
|
22
|
-
// eslint-disable-next-line functional/immutable-data
|
|
22
|
+
// eslint-disable-next-line functional/immutable-data
|
|
23
23
|
internalRef.current.indeterminate = indeterminate;
|
|
24
24
|
}
|
|
25
25
|
}, [indeterminate, reference]);
|
|
@@ -2,8 +2,7 @@ import { forwardRef } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import CheckboxButton from '../checkboxButton';
|
|
4
4
|
import Option from '../common/Option';
|
|
5
|
-
import { ReferenceType } from '../common/Option/Option';
|
|
6
|
-
import { BaseOptionProps } from '../common/Option/Option';
|
|
5
|
+
import { ReferenceType, BaseOptionProps } from '../common/Option/Option';
|
|
7
6
|
|
|
8
7
|
export type CheckboxOptionProps = Omit<BaseOptionProps, 'onChange'> & {
|
|
9
8
|
/**
|
|
@@ -140,7 +140,7 @@ exports[`Chips Filter Chips renders as expected 1`] = `
|
|
|
140
140
|
width="16"
|
|
141
141
|
>
|
|
142
142
|
<path
|
|
143
|
-
d="
|
|
143
|
+
d="m12 13.414-7.293 7.293-1.414-1.414L10.586 12 3.293 4.707l1.414-1.414L12 10.586l7.293-7.293 1.414 1.414L13.414 12l7.293 7.293-1.414 1.414z"
|
|
144
144
|
/>
|
|
145
145
|
</svg>
|
|
146
146
|
</span>
|
|
@@ -19,8 +19,8 @@ export default {
|
|
|
19
19
|
open: true,
|
|
20
20
|
},
|
|
21
21
|
render: (args) => {
|
|
22
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
23
22
|
const [open, setOpen] = useState(args.open);
|
|
23
|
+
|
|
24
24
|
return (
|
|
25
25
|
<div style={{ height: '2000px' }}>
|
|
26
26
|
<Button onClick={() => setOpen(true)}>Open BottomSheet</Button>
|
|
@@ -201,7 +201,6 @@ const BottomSheet = ({ role = 'dialog', ...props }: BottomSheetProps) => {
|
|
|
201
201
|
position={Position.BOTTOM}
|
|
202
202
|
className={clsx('np-bottom-sheet', props.className)}
|
|
203
203
|
>
|
|
204
|
-
{/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}
|
|
205
204
|
<div
|
|
206
205
|
id={overlayId}
|
|
207
206
|
aria-labelledby={props['aria-labelledby'] || undefined}
|
|
@@ -52,7 +52,7 @@ exports[`BottomSheet renders content when open 1`] = `
|
|
|
52
52
|
width="16"
|
|
53
53
|
>
|
|
54
54
|
<path
|
|
55
|
-
d="
|
|
55
|
+
d="m12 13.414-7.293 7.293-1.414-1.414L10.586 12 3.293 4.707l1.414-1.414L12 10.586l7.293-7.293 1.414 1.414L13.414 12l7.293 7.293-1.414 1.414z"
|
|
56
56
|
/>
|
|
57
57
|
</svg>
|
|
58
58
|
</span>
|
|
@@ -21,7 +21,7 @@ exports[`CloseButton renders as expected 1`] = `
|
|
|
21
21
|
width="24"
|
|
22
22
|
>
|
|
23
23
|
<path
|
|
24
|
-
d="
|
|
24
|
+
d="m12 13.414-7.293 7.293-1.414-1.414L10.586 12 3.293 4.707l1.414-1.414L12 10.586l7.293-7.293 1.414 1.414L13.414 12l7.293 7.293-1.414 1.414z"
|
|
25
25
|
/>
|
|
26
26
|
</svg>
|
|
27
27
|
</span>
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export const isDateValid = (date: Date | string | null) => {
|
|
2
2
|
if (date === null) {
|
|
3
3
|
return false;
|
|
4
|
-
}
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
if (date instanceof Date) {
|
|
5
7
|
return validDateObject(date);
|
|
6
|
-
} else {
|
|
7
|
-
return validDateString(date);
|
|
8
8
|
}
|
|
9
|
+
|
|
10
|
+
return validDateString(date);
|
|
9
11
|
};
|
|
10
12
|
|
|
11
13
|
export const validDateString = (dateString: string) => validDateObject(new Date(dateString));
|
|
@@ -65,7 +65,6 @@ describe('useHasIntersected', () => {
|
|
|
65
65
|
});
|
|
66
66
|
|
|
67
67
|
it('calls observer', () => {
|
|
68
|
-
// eslint-disable-next-line jest/prefer-spy-on
|
|
69
68
|
window.IntersectionObserver = jest.fn(() => ({
|
|
70
69
|
observe,
|
|
71
70
|
unobserve,
|
|
@@ -107,7 +106,6 @@ describe('useHasIntersected', () => {
|
|
|
107
106
|
});
|
|
108
107
|
|
|
109
108
|
const setupIntersectionObserver = (isIntersecting) => {
|
|
110
|
-
// eslint-disable-next-line jest/prefer-spy-on
|
|
111
109
|
window.IntersectionObserver = jest.fn((callback) => {
|
|
112
110
|
callback([{ isIntersecting }], { unobserve });
|
|
113
111
|
return {
|
|
@@ -119,26 +119,15 @@ const Panel = forwardRef<HTMLDivElement, PanelProps>(function Panel(
|
|
|
119
119
|
{...rest}
|
|
120
120
|
ref={setPopperElement}
|
|
121
121
|
role="dialog"
|
|
122
|
-
// eslint-disable-next-line react/forbid-dom-props
|
|
123
122
|
style={{ ...styles.popper }}
|
|
124
123
|
{...attributes.popper}
|
|
125
124
|
className={clsx('np-panel', { 'np-panel--open': open }, rest.className)}
|
|
126
125
|
>
|
|
127
|
-
<div
|
|
128
|
-
ref={reference}
|
|
129
|
-
/* eslint-disable-next-line react/forbid-dom-props */
|
|
130
|
-
style={contentStyle}
|
|
131
|
-
className={clsx('np-panel__content')}
|
|
132
|
-
>
|
|
126
|
+
<div ref={reference} style={contentStyle} className={clsx('np-panel__content')}>
|
|
133
127
|
{children}
|
|
134
128
|
{/* Arrow has to stay inside content to get the same animations as the "dialog" and to get hidden when panel is closed. */}
|
|
135
129
|
{arrow && (
|
|
136
|
-
<div
|
|
137
|
-
ref={setArrowElement}
|
|
138
|
-
className={clsx('np-panel__arrow')}
|
|
139
|
-
// eslint-disable-next-line react/forbid-dom-props
|
|
140
|
-
style={styles.arrow}
|
|
141
|
-
/>
|
|
130
|
+
<div ref={setArrowElement} className={clsx('np-panel__arrow')} style={styles.arrow} />
|
|
142
131
|
)}
|
|
143
132
|
</div>
|
|
144
133
|
</div>
|
|
@@ -33,7 +33,9 @@ describe('Dimmer', () => {
|
|
|
33
33
|
it('does not call onClose if the dimmer content is clicked', async () => {
|
|
34
34
|
render(
|
|
35
35
|
<Dimmer {...props}>
|
|
36
|
-
<Button onClick={() => {}}>
|
|
36
|
+
<Button v2 onClick={() => {}}>
|
|
37
|
+
McClicky
|
|
38
|
+
</Button>
|
|
37
39
|
</Dimmer>,
|
|
38
40
|
);
|
|
39
41
|
await userEvent.click(screen.getByRole('button'));
|
|
@@ -18,12 +18,13 @@ type Story = StoryObj<typeof Dimmer>;
|
|
|
18
18
|
|
|
19
19
|
export const Basic: Story = {
|
|
20
20
|
render: (args) => {
|
|
21
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
22
21
|
const [open, setOpen] = useState(false);
|
|
23
22
|
|
|
24
23
|
return (
|
|
25
24
|
<>
|
|
26
|
-
<Button onClick={() => setOpen((isOpen) => !isOpen)}>
|
|
25
|
+
<Button v2 onClick={() => setOpen((isOpen) => !isOpen)}>
|
|
26
|
+
Toggle dimmer
|
|
27
|
+
</Button>
|
|
27
28
|
<Dimmer
|
|
28
29
|
{...args}
|
|
29
30
|
open={open}
|
|
@@ -18,7 +18,7 @@ export const Basic = () => {
|
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
20
|
<>
|
|
21
|
-
<Button disabled={false} block={false} onClick={() => setOpenDrawer(true)}>
|
|
21
|
+
<Button v2 disabled={false} block={false} onClick={() => setOpenDrawer(true)}>
|
|
22
22
|
Open drawer
|
|
23
23
|
</Button>
|
|
24
24
|
<Drawer
|
|
@@ -27,10 +27,10 @@ export const Basic = () => {
|
|
|
27
27
|
headerTitle="This is the title of the drawer"
|
|
28
28
|
footerContent={
|
|
29
29
|
<>
|
|
30
|
-
<Button block onClick={() => {}}>
|
|
30
|
+
<Button v2 block onClick={() => {}}>
|
|
31
31
|
Action 1
|
|
32
32
|
</Button>
|
|
33
|
-
<Button block priority={Priority.SECONDARY} onClick={() => {}}>
|
|
33
|
+
<Button v2 block priority={Priority.SECONDARY} onClick={() => {}}>
|
|
34
34
|
Action 2
|
|
35
35
|
</Button>
|
|
36
36
|
</>
|
|
@@ -50,7 +50,9 @@ export const Basic = () => {
|
|
|
50
50
|
<Section className="m-t-2">
|
|
51
51
|
<Input />
|
|
52
52
|
<p className="m-t-3">Cat ipsum dolor sit amet, purr when being pet.</p>
|
|
53
|
-
<Button onClick={() => setOpenModal(true)}>
|
|
53
|
+
<Button v2 onClick={() => setOpenModal(true)}>
|
|
54
|
+
Open Modal
|
|
55
|
+
</Button>
|
|
54
56
|
<Modal
|
|
55
57
|
body={
|
|
56
58
|
<p className="m-t-4">
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable react/forbid-dom-props */
|
|
2
1
|
import { action } from '@storybook/addon-actions';
|
|
3
2
|
import { useState } from 'react';
|
|
4
3
|
|
|
@@ -35,7 +34,7 @@ export const Basic = () => {
|
|
|
35
34
|
}}
|
|
36
35
|
/>
|
|
37
36
|
</DropFade>
|
|
38
|
-
<Button className="m-t-3" block onClick={() => setOpen(true)}>
|
|
37
|
+
<Button v2 className="m-t-3" block onClick={() => setOpen(true)}>
|
|
39
38
|
Some other content
|
|
40
39
|
</Button>
|
|
41
40
|
</div>
|
|
@@ -26,7 +26,6 @@ const DropFade = ({ children, show }: { children: ReactElement; show: boolean })
|
|
|
26
26
|
setHeight(0);
|
|
27
27
|
}}
|
|
28
28
|
>
|
|
29
|
-
{/* eslint-disable-next-line react/forbid-dom-props */}
|
|
30
29
|
<div ref={reference} style={{ height }} className="np-dropfade">
|
|
31
30
|
{clonedChild}
|
|
32
31
|
</div>
|
|
@@ -7,7 +7,7 @@ describe('creates safe, enphasised html', () => {
|
|
|
7
7
|
emphasisHtmlTransformer.transform(
|
|
8
8
|
'<script>something malicious</script><p>some text & more text</p>',
|
|
9
9
|
),
|
|
10
|
-
).
|
|
10
|
+
).toBe(
|
|
11
11
|
'<script>something malicious</script><p>some text & more text</p>',
|
|
12
12
|
);
|
|
13
13
|
});
|
|
@@ -18,7 +18,7 @@ describe('creates safe, enphasised html', () => {
|
|
|
18
18
|
emphasisHtmlTransformer.transform(
|
|
19
19
|
'<script>something malicious</script><positive>hello</positive><negative>world</negative><positive>!</positive>',
|
|
20
20
|
),
|
|
21
|
-
).
|
|
21
|
+
).toBe(
|
|
22
22
|
'<script>something malicious</script><em class="emphasis emphasis--positive">hello</em><em class="emphasis emphasis--negative">world</em><em class="emphasis emphasis--positive">!</em>',
|
|
23
23
|
);
|
|
24
24
|
});
|
|
@@ -26,11 +26,11 @@ describe('creates safe, enphasised html', () => {
|
|
|
26
26
|
describe('supports new line characters', () => {
|
|
27
27
|
it('supports slash n in the string', () => {
|
|
28
28
|
const emphasisHtmlTransformer = new EmphasisHtmlTransformer();
|
|
29
|
-
expect(emphasisHtmlTransformer.transform('hello\\nworld')).
|
|
29
|
+
expect(emphasisHtmlTransformer.transform('hello\\nworld')).toBe('hello<br />world');
|
|
30
30
|
});
|
|
31
31
|
it('supports new line characters', () => {
|
|
32
32
|
const emphasisHtmlTransformer = new EmphasisHtmlTransformer();
|
|
33
|
-
expect(emphasisHtmlTransformer.transform('hello\nworld')).
|
|
33
|
+
expect(emphasisHtmlTransformer.transform('hello\nworld')).toBe('hello<br />world');
|
|
34
34
|
});
|
|
35
35
|
});
|
|
36
36
|
});
|
|
@@ -13,9 +13,9 @@ type Tags = {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
class EmphasisHtmlTransformer {
|
|
16
|
-
tags:
|
|
16
|
+
tags: Tags[];
|
|
17
17
|
|
|
18
|
-
constructor(whitelistedTags?:
|
|
18
|
+
constructor(whitelistedTags?: string[]) {
|
|
19
19
|
this.tags = (whitelistedTags || []).map((tag) => {
|
|
20
20
|
return {
|
|
21
21
|
transformed: {
|
|
@@ -235,7 +235,12 @@ export const SendFlow = () => {
|
|
|
235
235
|
|
|
236
236
|
<Sticky>
|
|
237
237
|
<div className="d-flex justify-content-center align-items-center p-a-3">
|
|
238
|
-
<Button
|
|
238
|
+
<Button
|
|
239
|
+
v2
|
|
240
|
+
disabled={activeStep === 3}
|
|
241
|
+
block
|
|
242
|
+
onClick={() => setActiveStep(activeStep + 1)}
|
|
243
|
+
>
|
|
239
244
|
Continue
|
|
240
245
|
</Button>
|
|
241
246
|
</div>
|
|
@@ -29,7 +29,9 @@ exports[`FlowNavigation on mobile renders as expected 1`] = `
|
|
|
29
29
|
width="16"
|
|
30
30
|
>
|
|
31
31
|
<path
|
|
32
|
-
|
|
32
|
+
clip-rule="evenodd"
|
|
33
|
+
d="m5.414 11 6.293-6.293-1.414-1.414L2.3 11.286a1.01 1.01 0 0 0 0 1.428l7.993 7.993 1.414-1.414L5.414 13H22v-2z"
|
|
34
|
+
fill-rule="evenodd"
|
|
33
35
|
/>
|
|
34
36
|
</svg>
|
|
35
37
|
</span>
|
|
@@ -74,7 +76,7 @@ exports[`FlowNavigation on mobile renders as expected 1`] = `
|
|
|
74
76
|
width="24"
|
|
75
77
|
>
|
|
76
78
|
<path
|
|
77
|
-
d="
|
|
79
|
+
d="m12 13.414-7.293 7.293-1.414-1.414L10.586 12 3.293 4.707l1.414-1.414L12 10.586l7.293-7.293 1.414 1.414L13.414 12l7.293 7.293-1.414 1.414z"
|
|
78
80
|
/>
|
|
79
81
|
</svg>
|
|
80
82
|
</span>
|
|
@@ -190,7 +192,7 @@ exports[`FlowNavigation renders as expected 1`] = `
|
|
|
190
192
|
width="24"
|
|
191
193
|
>
|
|
192
194
|
<path
|
|
193
|
-
d="
|
|
195
|
+
d="m12 13.414-7.293 7.293-1.414-1.414L10.586 12 3.293 4.707l1.414-1.414L12 10.586l7.293-7.293 1.414 1.414L13.414 12l7.293 7.293-1.414 1.414z"
|
|
194
196
|
/>
|
|
195
197
|
</svg>
|
|
196
198
|
</span>
|
package/src/inputs/Input.tsx
CHANGED
|
@@ -31,7 +31,6 @@ export const Input = forwardRef(function Input(
|
|
|
31
31
|
'np-input--shape-rectangle': shape === 'rectangle',
|
|
32
32
|
'np-input--shape-pill': shape === 'pill',
|
|
33
33
|
})}
|
|
34
|
-
// eslint-disable-next-line react/forbid-dom-props
|
|
35
34
|
style={inputPaddings}
|
|
36
35
|
{...inputAttributes}
|
|
37
36
|
{...restProps}
|
|
@@ -464,7 +464,9 @@ export const WithinDrawer: Story<Currency> = {
|
|
|
464
464
|
const [open, setOpen] = useState(context.viewMode === 'story');
|
|
465
465
|
return (
|
|
466
466
|
<>
|
|
467
|
-
<Button onClick={() => setOpen(true)}>
|
|
467
|
+
<Button v2 onClick={() => setOpen(true)}>
|
|
468
|
+
Open drawer
|
|
469
|
+
</Button>
|
|
468
470
|
<Drawer
|
|
469
471
|
open={open}
|
|
470
472
|
headerTitle="This is the title of the drawer"
|
|
@@ -485,7 +487,9 @@ export const WithinModal: Story<Currency> = {
|
|
|
485
487
|
const [open, setOpen] = useState(context.viewMode === 'story');
|
|
486
488
|
return (
|
|
487
489
|
<>
|
|
488
|
-
<Button onClick={() => setOpen(true)}>
|
|
490
|
+
<Button v2 onClick={() => setOpen(true)}>
|
|
491
|
+
Open modal
|
|
492
|
+
</Button>
|
|
489
493
|
<Modal open={open} body={<Story />} onClose={() => setOpen(false)} />
|
|
490
494
|
</>
|
|
491
495
|
);
|
|
@@ -629,13 +629,7 @@ function SelectInputOptions<T = string>({
|
|
|
629
629
|
const getItemNode = (index: number) => {
|
|
630
630
|
const item = filteredItems[index];
|
|
631
631
|
return (
|
|
632
|
-
<SelectInputItemView
|
|
633
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
634
|
-
key={index}
|
|
635
|
-
item={item}
|
|
636
|
-
renderValue={renderValue}
|
|
637
|
-
needle={needle}
|
|
638
|
-
/>
|
|
632
|
+
<SelectInputItemView key={index} item={item} renderValue={renderValue} needle={needle} />
|
|
639
633
|
);
|
|
640
634
|
};
|
|
641
635
|
|
|
@@ -19,7 +19,6 @@ export const ButtonInput = forwardRef(function ButtonInput(
|
|
|
19
19
|
ref={ref}
|
|
20
20
|
type="button"
|
|
21
21
|
className={clsx(className, inputClassNameBase({ size }), 'np-button-input')}
|
|
22
|
-
// eslint-disable-next-line react/forbid-dom-props
|
|
23
22
|
style={{ ...inputPaddings, ...style }}
|
|
24
23
|
{...restProps}
|
|
25
24
|
/>
|
package/src/inputs/_Popover.tsx
CHANGED
|
@@ -113,7 +113,6 @@ export function Popover({
|
|
|
113
113
|
'np-popover-v2-container--size-md': size === 'md',
|
|
114
114
|
'np-popover-v2-container--size-lg': size === 'lg',
|
|
115
115
|
})}
|
|
116
|
-
// eslint-disable-next-line react/forbid-dom-props
|
|
117
116
|
style={floatingStyles}
|
|
118
117
|
{...getFloatingProps()}
|
|
119
118
|
>
|
package/src/link/Link.story.tsx
CHANGED