@transferwise/components 46.36.1 → 46.37.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 +10 -31
- package/build/index.js.map +1 -1
- package/build/index.mjs +10 -31
- package/build/index.mjs.map +1 -1
- package/build/types/accordion/AccordionItem/AccordionItem.d.ts.map +1 -1
- package/build/types/actionOption/ActionOption.d.ts +5 -5
- package/build/types/actionOption/ActionOption.d.ts.map +1 -1
- package/build/types/alert/Alert.d.ts +1 -1
- package/build/types/alert/Alert.d.ts.map +1 -1
- package/build/types/body/Body.d.ts +1 -1
- package/build/types/body/Body.d.ts.map +1 -1
- package/build/types/chips/Chip.d.ts +2 -2
- package/build/types/chips/Chip.d.ts.map +1 -1
- package/build/types/chips/Chips.d.ts +2 -2
- package/build/types/chips/Chips.d.ts.map +1 -1
- package/build/types/common/bottomSheet/BottomSheet.d.ts +2 -2
- package/build/types/common/bottomSheet/BottomSheet.d.ts.map +1 -1
- package/build/types/common/closeButton/CloseButton.d.ts +1 -1
- package/build/types/common/closeButton/CloseButton.d.ts.map +1 -1
- package/build/types/common/flowHeader/FlowHeader.d.ts +1 -1
- package/build/types/common/flowHeader/FlowHeader.d.ts.map +1 -1
- package/build/types/common/hooks/useResizeObserver.d.ts +1 -1
- package/build/types/common/hooks/useResizeObserver.d.ts.map +1 -1
- package/build/types/common/panel/Panel.d.ts +3 -3
- package/build/types/common/panel/Panel.d.ts.map +1 -1
- package/build/types/common/polymorphicWithOverrides/PolymorphicWithOverrides.d.ts +1 -1
- package/build/types/common/polymorphicWithOverrides/PolymorphicWithOverrides.d.ts.map +1 -1
- package/build/types/common/responsivePanel/ResponsivePanel.d.ts +1 -1
- package/build/types/dimmer/Dimmer.d.ts +3 -3
- package/build/types/dimmer/Dimmer.d.ts.map +1 -1
- package/build/types/emphasis/Emphasis.d.ts +2 -2
- package/build/types/emphasis/Emphasis.d.ts.map +1 -1
- package/build/types/inputs/Input.d.ts +1 -1
- package/build/types/inputs/Input.d.ts.map +1 -1
- package/build/types/inputs/SearchInput.d.ts +1 -1
- package/build/types/inputs/SearchInput.d.ts.map +1 -1
- package/build/types/inputs/TextArea.d.ts +1 -1
- package/build/types/inputs/TextArea.d.ts.map +1 -1
- package/build/types/inputs/_BottomSheet.d.ts +1 -1
- package/build/types/inputs/_BottomSheet.d.ts.map +1 -1
- package/build/types/inputs/_ButtonInput.d.ts +1 -1
- package/build/types/inputs/_ButtonInput.d.ts.map +1 -1
- package/build/types/progress/Progress.d.ts +2 -2
- package/build/types/progress/Progress.d.ts.map +1 -1
- package/build/types/progressBar/ProgressBar.d.ts +2 -2
- package/build/types/progressBar/ProgressBar.d.ts.map +1 -1
- package/build/types/promoCard/PromoCard.d.ts +1 -1
- package/build/types/promoCard/PromoCard.d.ts.map +1 -1
- package/build/types/provider/direction/DirectionProvider.d.ts +2 -2
- package/build/types/provider/direction/DirectionProvider.d.ts.map +1 -1
- package/build/types/provider/language/LanguageProvider.d.ts +2 -2
- package/build/types/provider/language/LanguageProvider.d.ts.map +1 -1
- package/build/types/select/option/Option.d.ts +2 -1
- package/build/types/select/option/Option.d.ts.map +1 -1
- package/build/types/slidingPanel/SlidingPanel.d.ts +1 -1
- package/build/types/slidingPanel/SlidingPanel.d.ts.map +1 -1
- package/build/types/switchOption/SwitchOption.d.ts +4 -4
- package/build/types/switchOption/SwitchOption.d.ts.map +1 -1
- package/build/types/tabs/Tabs.d.ts +1 -1
- package/build/types/tabs/Tabs.d.ts.map +1 -1
- package/build/types/tooltip/Tooltip.d.ts.map +1 -1
- package/build/types/uploadInput/UploadInput.d.ts +2 -2
- package/build/types/uploadInput/UploadInput.d.ts.map +1 -1
- package/build/types/uploadInput/uploadItem/UploadItem.d.ts.map +1 -1
- package/build/types/withDisplayFormat/WithDisplayFormat.d.ts +4 -4
- package/build/types/withDisplayFormat/WithDisplayFormat.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/accordion/AccordionItem/AccordionItem.tsx +5 -2
- package/src/actionOption/ActionOption.tsx +4 -5
- package/src/alert/Alert.tsx +1 -1
- package/src/body/Body.tsx +4 -3
- package/src/chips/Chip.tsx +5 -6
- package/src/chips/Chips.tsx +1 -2
- package/src/common/bottomSheet/BottomSheet.tsx +2 -9
- package/src/common/closeButton/CloseButton.tsx +1 -1
- package/src/common/flowHeader/FlowHeader.tsx +1 -1
- package/src/common/hooks/useResizeObserver.ts +1 -1
- package/src/common/panel/Panel.spec.tsx +1 -1
- package/src/common/panel/Panel.tsx +7 -7
- package/src/common/polymorphicWithOverrides/PolymorphicWithOverrides.tsx +1 -1
- package/src/dimmer/Dimmer.tsx +2 -10
- package/src/emphasis/Emphasis.tsx +1 -3
- package/src/inputs/Input.tsx +1 -1
- package/src/inputs/SearchInput.tsx +1 -1
- package/src/inputs/SelectInput.tsx +4 -4
- package/src/inputs/TextArea.tsx +1 -1
- package/src/inputs/_BottomSheet.tsx +1 -1
- package/src/inputs/_ButtonInput.tsx +1 -1
- package/src/progress/Progress.tsx +3 -15
- package/src/progressBar/ProgressBar.tsx +1 -2
- package/src/promoCard/PromoCard.tsx +2 -2
- package/src/promoCard/PromoCardContext.spec.tsx +1 -1
- package/src/provider/direction/DirectionProvider.tsx +2 -5
- package/src/provider/language/LanguageProvider.tsx +2 -2
- package/src/segmentedControl/SegmentedControl.tsx +2 -2
- package/src/select/option/Option.tsx +6 -18
- package/src/slidingPanel/SlidingPanel.tsx +1 -1
- package/src/ssr.spec.js +6 -0
- package/src/switchOption/SwitchOption.tsx +5 -7
- package/src/tabs/Tabs.js +3 -3
- package/src/tooltip/Tooltip.tsx +2 -1
- package/src/uploadInput/UploadInput.tsx +2 -2
- package/src/uploadInput/uploadItem/UploadItem.tsx +3 -4
- package/src/withDisplayFormat/WithDisplayFormat.tsx +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MouseEvent
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
2
|
|
|
3
3
|
import Option from '../common/Option';
|
|
4
4
|
import Switch from '../switch';
|
|
@@ -6,15 +6,15 @@ import Switch from '../switch';
|
|
|
6
6
|
export type SwitchOptionProps = {
|
|
7
7
|
checked?: boolean;
|
|
8
8
|
complex?: boolean;
|
|
9
|
-
content?:
|
|
9
|
+
content?: React.ReactNode;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
showMediaCircle?: boolean;
|
|
12
12
|
showMediaAtAllSizes?: boolean;
|
|
13
13
|
isContainerAligned?: boolean;
|
|
14
14
|
id?: string;
|
|
15
|
-
media?:
|
|
15
|
+
media?: React.ReactNode;
|
|
16
16
|
onChange: (newValue: boolean) => void;
|
|
17
|
-
title:
|
|
17
|
+
title: React.ReactNode;
|
|
18
18
|
'aria-label': string;
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -22,9 +22,7 @@ const stopPropagation = (event?: MouseEvent<HTMLSpanElement>) => {
|
|
|
22
22
|
if (event) {
|
|
23
23
|
event.stopPropagation();
|
|
24
24
|
event.preventDefault();
|
|
25
|
-
|
|
26
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
27
|
-
}
|
|
25
|
+
event.nativeEvent?.stopImmediatePropagation?.();
|
|
28
26
|
}
|
|
29
27
|
};
|
|
30
28
|
|
package/src/tabs/Tabs.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Spring, SpringValue, animated } from '@react-spring/web';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import clamp from 'lodash.clamp';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import { Component, createRef, Fragment
|
|
6
|
+
import { Component, createRef, Fragment } from 'react';
|
|
7
7
|
|
|
8
8
|
import { Size, Width, Direction } from '../common';
|
|
9
9
|
import { DirectionContext } from '../provider/direction';
|
|
@@ -27,7 +27,7 @@ const enabledTabsFilter = (tab) => !tab.disabled;
|
|
|
27
27
|
const SpacerWidth = { default: 0, xs: 8, sm: 16, md: 24, lg: 32 };
|
|
28
28
|
|
|
29
29
|
class Tabs extends Component {
|
|
30
|
-
/** @type {RefObject<HTMLDivElement>} */
|
|
30
|
+
/** @type {React.RefObject<HTMLDivElement | null>} */
|
|
31
31
|
containerReference = createRef();
|
|
32
32
|
|
|
33
33
|
constructor(props) {
|
|
@@ -576,7 +576,6 @@ Tabs.propTypes = {
|
|
|
576
576
|
}),
|
|
577
577
|
).isRequired,
|
|
578
578
|
selected: PropTypes.number.isRequired,
|
|
579
|
-
onTabSelect: PropTypes.func.isRequired,
|
|
580
579
|
name: PropTypes.string.isRequired,
|
|
581
580
|
animatePanelsOnClick: PropTypes.bool,
|
|
582
581
|
changeTabOnSwipe: PropTypes.bool,
|
|
@@ -584,6 +583,7 @@ Tabs.propTypes = {
|
|
|
584
583
|
transitionSpacing: PropTypes.oneOf(['default', 'xs', 'sm', 'md', 'lg']),
|
|
585
584
|
headerWidth: PropTypes.oneOf(['auto', 'block']),
|
|
586
585
|
id: PropTypes.string,
|
|
586
|
+
onTabSelect: PropTypes.func.isRequired,
|
|
587
587
|
};
|
|
588
588
|
|
|
589
589
|
Tabs.defaultProps = {
|
package/src/tooltip/Tooltip.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import {
|
|
4
|
+
AriaAttributes,
|
|
4
5
|
PropsWithChildren,
|
|
5
6
|
ReactElement,
|
|
6
7
|
ReactNode,
|
|
@@ -84,7 +85,7 @@ const Tooltip = ({
|
|
|
84
85
|
onBlur={() => setOpen(false)}
|
|
85
86
|
>
|
|
86
87
|
{children
|
|
87
|
-
? cloneElement(children as ReactElement, {
|
|
88
|
+
? cloneElement(children as ReactElement<Pick<AriaAttributes, 'aria-describedby'>>, {
|
|
88
89
|
'aria-describedby': `${tooltipId}-tooltip`,
|
|
89
90
|
})
|
|
90
91
|
: null}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useTheme } from '@wise/components-theming';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import {
|
|
3
|
+
import { useEffect, useRef, useState } from 'react';
|
|
4
4
|
import { useIntl } from 'react-intl';
|
|
5
5
|
|
|
6
6
|
import Button from '../button';
|
|
@@ -127,7 +127,7 @@ const UploadInput = ({
|
|
|
127
127
|
id,
|
|
128
128
|
sizeLimitErrorMessage,
|
|
129
129
|
uploadButtonTitle,
|
|
130
|
-
}: UploadInputProps)
|
|
130
|
+
}: UploadInputProps) => {
|
|
131
131
|
const { isModern } = useTheme();
|
|
132
132
|
const [markedFileForDelete, setMarkedFileForDelete] = useState<UploadedFile | null>(null);
|
|
133
133
|
const [mounted, setMounted] = useState(false);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AlertCircle, CrossCircleFill } from '@transferwise/icons';
|
|
2
2
|
import { useTheme } from '@wise/components-theming';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import { ReactElement, MouseEvent } from 'react';
|
|
5
4
|
import { useIntl } from 'react-intl';
|
|
6
5
|
|
|
7
6
|
import Body from '../../body';
|
|
@@ -49,7 +48,7 @@ const UploadItem = ({
|
|
|
49
48
|
|
|
50
49
|
const isSucceeded = [Status.SUCCEEDED, undefined].includes(status) && !!url;
|
|
51
50
|
|
|
52
|
-
const getIcon = ()
|
|
51
|
+
const getIcon = () => {
|
|
53
52
|
if (error || status === Status.FAILED) {
|
|
54
53
|
return isModern ? (
|
|
55
54
|
<StatusIcon size={Size.SMALL} sentiment={Sentiment.NEGATIVE} />
|
|
@@ -58,7 +57,7 @@ const UploadItem = ({
|
|
|
58
57
|
);
|
|
59
58
|
}
|
|
60
59
|
|
|
61
|
-
let processIndicator:
|
|
60
|
+
let processIndicator: React.ReactNode;
|
|
62
61
|
|
|
63
62
|
switch (status) {
|
|
64
63
|
case Status.PROCESSING:
|
|
@@ -114,7 +113,7 @@ const UploadItem = ({
|
|
|
114
113
|
return filename || formatMessage(MESSAGES.uploadedFile);
|
|
115
114
|
};
|
|
116
115
|
|
|
117
|
-
const onDownloadFile = (event: MouseEvent): void => {
|
|
116
|
+
const onDownloadFile = (event: React.MouseEvent): void => {
|
|
118
117
|
if (onDownload) {
|
|
119
118
|
event.preventDefault();
|
|
120
119
|
onDownload(file);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
import { HistoryNavigator } from '../common';
|
|
4
4
|
import {
|
|
@@ -61,10 +61,10 @@ export interface WithDisplayFormatProps<T extends TextElementProps = TextElement
|
|
|
61
61
|
onChange?: (value: string) => void;
|
|
62
62
|
onBlur?: (value: string) => void;
|
|
63
63
|
onFocus?: (value: string) => void;
|
|
64
|
-
render: (renderProps: T) => JSX.Element;
|
|
64
|
+
render: (renderProps: T) => React.JSX.Element;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
class WithDisplayFormat<T extends TextElementProps> extends Component<
|
|
67
|
+
class WithDisplayFormat<T extends TextElementProps> extends React.Component<
|
|
68
68
|
WithDisplayFormatProps<T>,
|
|
69
69
|
WithDisplayFormatState
|
|
70
70
|
> {
|