@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
package/build/index.mjs
CHANGED
|
@@ -2402,7 +2402,7 @@ const Chip = ({
|
|
|
2402
2402
|
isModern
|
|
2403
2403
|
} = useTheme();
|
|
2404
2404
|
const closeButtonReference = useRef(null);
|
|
2405
|
-
const previousCloseButtonShown = useRef();
|
|
2405
|
+
const previousCloseButtonShown = useRef(undefined);
|
|
2406
2406
|
useEffect(() => {
|
|
2407
2407
|
if (closeButtonReference.current != null && previousCloseButtonShown.current === false) {
|
|
2408
2408
|
closeButtonReference.current?.focus();
|
|
@@ -2430,7 +2430,7 @@ const Chip = ({
|
|
|
2430
2430
|
}), onRemove ? /*#__PURE__*/jsx(CloseButton, {
|
|
2431
2431
|
ref: closeButtonReference,
|
|
2432
2432
|
className: isModern ? `btn-unstyled` : `btn-unstyled m-l-1`,
|
|
2433
|
-
"aria-label": closeButton
|
|
2433
|
+
"aria-label": closeButton?.['aria-label'],
|
|
2434
2434
|
size: "sm",
|
|
2435
2435
|
filled: isModern,
|
|
2436
2436
|
onClick: onRemove
|
|
@@ -6067,7 +6067,7 @@ const getCursorPositionAfterActionStroke = (action, selectionStart, selectionEnd
|
|
|
6067
6067
|
return cursorPosition;
|
|
6068
6068
|
};
|
|
6069
6069
|
|
|
6070
|
-
class WithDisplayFormat extends Component {
|
|
6070
|
+
class WithDisplayFormat extends React.Component {
|
|
6071
6071
|
static defaultProps = {
|
|
6072
6072
|
autoComplete: 'off',
|
|
6073
6073
|
displayPattern: '',
|
|
@@ -9422,16 +9422,11 @@ const Progress = ({
|
|
|
9422
9422
|
id,
|
|
9423
9423
|
progress
|
|
9424
9424
|
}) => {
|
|
9425
|
-
const [value, setValue] = useState(0);
|
|
9426
|
-
useEffect(() => {
|
|
9427
|
-
setValue(progress.value);
|
|
9428
|
-
});
|
|
9429
9425
|
return /*#__PURE__*/jsxs("progress", {
|
|
9430
9426
|
id: id,
|
|
9431
9427
|
className: classNames('np-progress d-block', className),
|
|
9432
9428
|
...progress,
|
|
9433
|
-
|
|
9434
|
-
children: [value, "%"]
|
|
9429
|
+
children: [Math.floor(progress.value / progress.max * 100), "%"]
|
|
9435
9430
|
});
|
|
9436
9431
|
};
|
|
9437
9432
|
|
|
@@ -9925,12 +9920,8 @@ function Option$1({
|
|
|
9925
9920
|
note = '',
|
|
9926
9921
|
secondary = '',
|
|
9927
9922
|
icon,
|
|
9928
|
-
classNames = {},
|
|
9929
9923
|
selected = false
|
|
9930
9924
|
}) {
|
|
9931
|
-
const {
|
|
9932
|
-
isModern
|
|
9933
|
-
} = useTheme();
|
|
9934
9925
|
const iconElement = icon ? /*#__PURE__*/cloneElement(icon, {
|
|
9935
9926
|
size: 24,
|
|
9936
9927
|
className: 'tw-icon'
|
|
@@ -9944,22 +9935,12 @@ function Option$1({
|
|
|
9944
9935
|
className: selected ? 'text-ellipsis' : undefined,
|
|
9945
9936
|
children: [label, note && /*#__PURE__*/jsx(Body, {
|
|
9946
9937
|
as: "span",
|
|
9947
|
-
className:
|
|
9938
|
+
className: "m-l-1",
|
|
9948
9939
|
children: note
|
|
9949
9940
|
})]
|
|
9950
9941
|
});
|
|
9951
|
-
const secondaryElementClassNames = () => {
|
|
9952
|
-
let classes = undefined;
|
|
9953
|
-
if (selected) {
|
|
9954
|
-
classes = 'text-ellipsis';
|
|
9955
|
-
}
|
|
9956
|
-
if (isModern) {
|
|
9957
|
-
return classes;
|
|
9958
|
-
}
|
|
9959
|
-
return `${classes ? classes + ' ' : ''}body-2`;
|
|
9960
|
-
};
|
|
9961
9942
|
const secondaryElement = secondary && /*#__PURE__*/jsx(Body, {
|
|
9962
|
-
className:
|
|
9943
|
+
className: classNames(selected && 'text-ellipsis'),
|
|
9963
9944
|
children: secondary
|
|
9964
9945
|
});
|
|
9965
9946
|
return iconElement ? /*#__PURE__*/jsxs("div", {
|
|
@@ -10922,9 +10903,7 @@ const stopPropagation = event => {
|
|
|
10922
10903
|
if (event) {
|
|
10923
10904
|
event.stopPropagation();
|
|
10924
10905
|
event.preventDefault();
|
|
10925
|
-
|
|
10926
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
10927
|
-
}
|
|
10906
|
+
event.nativeEvent?.stopImmediatePropagation?.();
|
|
10928
10907
|
}
|
|
10929
10908
|
};
|
|
10930
10909
|
const SwitchOption = ({
|
|
@@ -11126,7 +11105,7 @@ const SpacerWidth = {
|
|
|
11126
11105
|
lg: 32
|
|
11127
11106
|
};
|
|
11128
11107
|
class Tabs extends Component {
|
|
11129
|
-
/** @type {RefObject<HTMLDivElement>} */
|
|
11108
|
+
/** @type {React.RefObject<HTMLDivElement | null>} */
|
|
11130
11109
|
containerReference = /*#__PURE__*/createRef();
|
|
11131
11110
|
constructor(props) {
|
|
11132
11111
|
super(props);
|
|
@@ -11613,14 +11592,14 @@ Tabs.propTypes = {
|
|
|
11613
11592
|
disabled: PropTypes.bool.isRequired
|
|
11614
11593
|
})).isRequired,
|
|
11615
11594
|
selected: PropTypes.number.isRequired,
|
|
11616
|
-
onTabSelect: PropTypes.func.isRequired,
|
|
11617
11595
|
name: PropTypes.string.isRequired,
|
|
11618
11596
|
animatePanelsOnClick: PropTypes.bool,
|
|
11619
11597
|
changeTabOnSwipe: PropTypes.bool,
|
|
11620
11598
|
className: PropTypes.string,
|
|
11621
11599
|
transitionSpacing: PropTypes.oneOf(['default', 'xs', 'sm', 'md', 'lg']),
|
|
11622
11600
|
headerWidth: PropTypes.oneOf(['auto', 'block']),
|
|
11623
|
-
id: PropTypes.string
|
|
11601
|
+
id: PropTypes.string,
|
|
11602
|
+
onTabSelect: PropTypes.func.isRequired
|
|
11624
11603
|
};
|
|
11625
11604
|
Tabs.defaultProps = {
|
|
11626
11605
|
animatePanelsOnClick: false,
|