@transferwise/components 46.36.0 → 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 +11 -35
- package/build/index.js.map +1 -1
- package/build/index.mjs +11 -35
- 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/moneyInput/MoneyInput.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/moneyInput/MoneyInput.story.tsx +40 -2
- package/src/moneyInput/MoneyInput.tsx +1 -4
- 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: '',
|
|
@@ -7432,13 +7432,10 @@ const parseNumber = ({
|
|
|
7432
7432
|
locale,
|
|
7433
7433
|
maxLengthOverride
|
|
7434
7434
|
}) => {
|
|
7435
|
-
if (!maxLengthOverride) {
|
|
7436
|
-
return parseAmount(amount, currency, locale);
|
|
7437
|
-
}
|
|
7438
7435
|
if (maxLengthOverride && amount.length > maxLengthOverride) {
|
|
7439
7436
|
return 0;
|
|
7440
7437
|
}
|
|
7441
|
-
return
|
|
7438
|
+
return parseAmount(amount, currency, locale);
|
|
7442
7439
|
};
|
|
7443
7440
|
const allowedInputKeys = new Set(['Backspace', 'Delete', ',', '.', 'ArrowDown', 'ArrowUp', 'ArrowLeft', 'ArrowRight', 'Enter', 'Escape', 'Tab']);
|
|
7444
7441
|
class MoneyInput extends Component {
|
|
@@ -9425,16 +9422,11 @@ const Progress = ({
|
|
|
9425
9422
|
id,
|
|
9426
9423
|
progress
|
|
9427
9424
|
}) => {
|
|
9428
|
-
const [value, setValue] = useState(0);
|
|
9429
|
-
useEffect(() => {
|
|
9430
|
-
setValue(progress.value);
|
|
9431
|
-
});
|
|
9432
9425
|
return /*#__PURE__*/jsxs("progress", {
|
|
9433
9426
|
id: id,
|
|
9434
9427
|
className: classNames('np-progress d-block', className),
|
|
9435
9428
|
...progress,
|
|
9436
|
-
|
|
9437
|
-
children: [value, "%"]
|
|
9429
|
+
children: [Math.floor(progress.value / progress.max * 100), "%"]
|
|
9438
9430
|
});
|
|
9439
9431
|
};
|
|
9440
9432
|
|
|
@@ -9928,12 +9920,8 @@ function Option$1({
|
|
|
9928
9920
|
note = '',
|
|
9929
9921
|
secondary = '',
|
|
9930
9922
|
icon,
|
|
9931
|
-
classNames = {},
|
|
9932
9923
|
selected = false
|
|
9933
9924
|
}) {
|
|
9934
|
-
const {
|
|
9935
|
-
isModern
|
|
9936
|
-
} = useTheme();
|
|
9937
9925
|
const iconElement = icon ? /*#__PURE__*/cloneElement(icon, {
|
|
9938
9926
|
size: 24,
|
|
9939
9927
|
className: 'tw-icon'
|
|
@@ -9947,22 +9935,12 @@ function Option$1({
|
|
|
9947
9935
|
className: selected ? 'text-ellipsis' : undefined,
|
|
9948
9936
|
children: [label, note && /*#__PURE__*/jsx(Body, {
|
|
9949
9937
|
as: "span",
|
|
9950
|
-
className:
|
|
9938
|
+
className: "m-l-1",
|
|
9951
9939
|
children: note
|
|
9952
9940
|
})]
|
|
9953
9941
|
});
|
|
9954
|
-
const secondaryElementClassNames = () => {
|
|
9955
|
-
let classes = undefined;
|
|
9956
|
-
if (selected) {
|
|
9957
|
-
classes = 'text-ellipsis';
|
|
9958
|
-
}
|
|
9959
|
-
if (isModern) {
|
|
9960
|
-
return classes;
|
|
9961
|
-
}
|
|
9962
|
-
return `${classes ? classes + ' ' : ''}body-2`;
|
|
9963
|
-
};
|
|
9964
9942
|
const secondaryElement = secondary && /*#__PURE__*/jsx(Body, {
|
|
9965
|
-
className:
|
|
9943
|
+
className: classNames(selected && 'text-ellipsis'),
|
|
9966
9944
|
children: secondary
|
|
9967
9945
|
});
|
|
9968
9946
|
return iconElement ? /*#__PURE__*/jsxs("div", {
|
|
@@ -10925,9 +10903,7 @@ const stopPropagation = event => {
|
|
|
10925
10903
|
if (event) {
|
|
10926
10904
|
event.stopPropagation();
|
|
10927
10905
|
event.preventDefault();
|
|
10928
|
-
|
|
10929
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
10930
|
-
}
|
|
10906
|
+
event.nativeEvent?.stopImmediatePropagation?.();
|
|
10931
10907
|
}
|
|
10932
10908
|
};
|
|
10933
10909
|
const SwitchOption = ({
|
|
@@ -11129,7 +11105,7 @@ const SpacerWidth = {
|
|
|
11129
11105
|
lg: 32
|
|
11130
11106
|
};
|
|
11131
11107
|
class Tabs extends Component {
|
|
11132
|
-
/** @type {RefObject<HTMLDivElement>} */
|
|
11108
|
+
/** @type {React.RefObject<HTMLDivElement | null>} */
|
|
11133
11109
|
containerReference = /*#__PURE__*/createRef();
|
|
11134
11110
|
constructor(props) {
|
|
11135
11111
|
super(props);
|
|
@@ -11616,14 +11592,14 @@ Tabs.propTypes = {
|
|
|
11616
11592
|
disabled: PropTypes.bool.isRequired
|
|
11617
11593
|
})).isRequired,
|
|
11618
11594
|
selected: PropTypes.number.isRequired,
|
|
11619
|
-
onTabSelect: PropTypes.func.isRequired,
|
|
11620
11595
|
name: PropTypes.string.isRequired,
|
|
11621
11596
|
animatePanelsOnClick: PropTypes.bool,
|
|
11622
11597
|
changeTabOnSwipe: PropTypes.bool,
|
|
11623
11598
|
className: PropTypes.string,
|
|
11624
11599
|
transitionSpacing: PropTypes.oneOf(['default', 'xs', 'sm', 'md', 'lg']),
|
|
11625
11600
|
headerWidth: PropTypes.oneOf(['auto', 'block']),
|
|
11626
|
-
id: PropTypes.string
|
|
11601
|
+
id: PropTypes.string,
|
|
11602
|
+
onTabSelect: PropTypes.func.isRequired
|
|
11627
11603
|
};
|
|
11628
11604
|
Tabs.defaultProps = {
|
|
11629
11605
|
animatePanelsOnClick: false,
|