@transferwise/components 0.0.0-experimental-3759445 → 0.0.0-experimental-cc11279
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 +20 -15
- package/build/index.js.map +1 -1
- package/build/index.mjs +20 -15
- package/build/index.mjs.map +1 -1
- package/build/types/alert/Alert.d.ts.map +1 -1
- package/build/types/dimmer/Dimmer.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/loader/Loader.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/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/inlineAlert/InlineAlert.story.tsx +8 -7
- package/src/inputs/SelectInput.tsx +1 -0
- package/src/link/Link.story.tsx +16 -16
- package/src/loader/Loader.tsx +0 -1
- package/src/logo/Logo.js +2 -2
- 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 +2 -2
- 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/index.mjs
CHANGED
|
@@ -62,7 +62,7 @@ var HistoryNavigator$1 = HistoryNavigator;
|
|
|
62
62
|
function isIosDevice() {
|
|
63
63
|
const sampleTouchDevices = ['iphone', 'ipad', 'ipod'];
|
|
64
64
|
const matchString = sampleTouchDevices.map(device => `(${device})`).join('|');
|
|
65
|
-
const regex = new RegExp(matchString, '
|
|
65
|
+
const regex = new RegExp(matchString, 'gi');
|
|
66
66
|
return typeof navigator !== 'undefined' && !!navigator.userAgent.match(regex);
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -908,8 +908,9 @@ function resolveType(type) {
|
|
|
908
908
|
return 'neutral';
|
|
909
909
|
case 'error':
|
|
910
910
|
return 'negative';
|
|
911
|
+
default:
|
|
912
|
+
return type;
|
|
911
913
|
}
|
|
912
|
-
return type;
|
|
913
914
|
}
|
|
914
915
|
function Alert({
|
|
915
916
|
arrow,
|
|
@@ -1055,7 +1056,7 @@ const hashSeed = seed => {
|
|
|
1055
1056
|
const modulo = avatarColors.length;
|
|
1056
1057
|
let hashValue = 0;
|
|
1057
1058
|
let basePow = 1;
|
|
1058
|
-
for (let i = 0; i < seed.length; i
|
|
1059
|
+
for (let i = 0; i < seed.length; i += 1) {
|
|
1059
1060
|
hashValue = (hashValue + seed.charCodeAt(i) * basePow) % modulo;
|
|
1060
1061
|
basePow = basePow * base % modulo;
|
|
1061
1062
|
}
|
|
@@ -1347,11 +1348,15 @@ const Dimmer = ({
|
|
|
1347
1348
|
}, [onClose]);
|
|
1348
1349
|
const onEnter = () => {
|
|
1349
1350
|
setHasNotExited(true);
|
|
1350
|
-
|
|
1351
|
+
if (dimmerReference.current) {
|
|
1352
|
+
dimmerManager.add(dimmerReference.current);
|
|
1353
|
+
}
|
|
1351
1354
|
};
|
|
1352
1355
|
const onExited = () => {
|
|
1353
1356
|
setHasNotExited(false);
|
|
1354
|
-
|
|
1357
|
+
if (dimmerReference.current) {
|
|
1358
|
+
dimmerManager.remove(dimmerReference.current);
|
|
1359
|
+
}
|
|
1355
1360
|
};
|
|
1356
1361
|
useEffect(() => {
|
|
1357
1362
|
const localReferenceCopy = dimmerReference.current;
|
|
@@ -4666,7 +4671,6 @@ const Tooltip = ({
|
|
|
4666
4671
|
|
|
4667
4672
|
function supportsTouchEvents() {
|
|
4668
4673
|
const onTouchStartIsDefined = typeof window !== 'undefined' && window.ontouchstart !== undefined;
|
|
4669
|
-
// eslint-disable-next-line compat/compat
|
|
4670
4674
|
const maxTouchPointsIsDefined = typeof navigator !== 'undefined' && navigator.maxTouchPoints;
|
|
4671
4675
|
const documentTouchIsDefined = typeof window !== 'undefined' && window.DocumentTouch && document instanceof window.DocumentTouch;
|
|
4672
4676
|
return !!(onTouchStartIsDefined || maxTouchPointsIsDefined || documentTouchIsDefined);
|
|
@@ -4674,7 +4678,7 @@ function supportsTouchEvents() {
|
|
|
4674
4678
|
function userAgentSuggestsTouchDevice() {
|
|
4675
4679
|
const sampleTouchDevices = ['android', 'iemobile', 'iphone', 'ipad', 'ipod', 'blackberry', 'bada'];
|
|
4676
4680
|
const matchString = sampleTouchDevices.map(device => `(${device})`).join('|');
|
|
4677
|
-
const regex = new RegExp(matchString, '
|
|
4681
|
+
const regex = new RegExp(matchString, 'gi');
|
|
4678
4682
|
return typeof navigator !== 'undefined' && !!navigator.userAgent.match(regex);
|
|
4679
4683
|
}
|
|
4680
4684
|
// Important: this is not fool-proof! It gives false positives and negatives, and will be outdated.
|
|
@@ -5080,8 +5084,9 @@ function resolvePlacement(preferredPlacement) {
|
|
|
5080
5084
|
case 'bottom-left':
|
|
5081
5085
|
case 'bottom-right':
|
|
5082
5086
|
return 'bottom';
|
|
5087
|
+
default:
|
|
5088
|
+
return preferredPlacement;
|
|
5083
5089
|
}
|
|
5084
|
-
return preferredPlacement;
|
|
5085
5090
|
}
|
|
5086
5091
|
function Popover$1({
|
|
5087
5092
|
children,
|
|
@@ -5735,6 +5740,7 @@ const defaultRenderTrigger = ({
|
|
|
5735
5740
|
})
|
|
5736
5741
|
})]
|
|
5737
5742
|
}),
|
|
5743
|
+
initialContentWidth: 24 + 4,
|
|
5738
5744
|
padding: 'sm'
|
|
5739
5745
|
},
|
|
5740
5746
|
disabled: disabled,
|
|
@@ -6644,7 +6650,6 @@ const Loader = ({
|
|
|
6644
6650
|
}, 1000);
|
|
6645
6651
|
}
|
|
6646
6652
|
return () => {
|
|
6647
|
-
// eslint-disable-next-line fp/no-mutation
|
|
6648
6653
|
cancelled = true;
|
|
6649
6654
|
clearTimeout(timeout);
|
|
6650
6655
|
};
|
|
@@ -8581,7 +8586,7 @@ const explodeNumberModel = number => {
|
|
|
8581
8586
|
};
|
|
8582
8587
|
};
|
|
8583
8588
|
|
|
8584
|
-
const DIGITS_MATCH = /^$|^(\+)|(
|
|
8589
|
+
const DIGITS_MATCH = /^$|^(\+)|(\d+)/g;
|
|
8585
8590
|
const cleanNumber = number => number.match(DIGITS_MATCH)?.join('') ?? '';
|
|
8586
8591
|
|
|
8587
8592
|
function sortArrayByProperty(arrayToSort, property) {
|
|
@@ -8667,7 +8672,8 @@ const PhoneNumberInput = ({
|
|
|
8667
8672
|
};
|
|
8668
8673
|
useEffect(() => {
|
|
8669
8674
|
if (broadcastedValue === null) {
|
|
8670
|
-
|
|
8675
|
+
setBroadcastedValue(internalValue);
|
|
8676
|
+
return;
|
|
8671
8677
|
}
|
|
8672
8678
|
const internalPhoneNumber = `${internalValue.prefix ?? ''}${internalValue.suffix}`;
|
|
8673
8679
|
const broadcastedPhoneNumber = `${broadcastedValue.prefix ?? ''}${broadcastedValue.suffix}`;
|
|
@@ -8940,7 +8946,7 @@ const PromoCard = /*#__PURE__*/forwardRef(({
|
|
|
8940
8946
|
const checkedProps = (type === 'checkbox' || type === 'radio') && !href ? {
|
|
8941
8947
|
...commonProps,
|
|
8942
8948
|
'aria-checked': type === 'radio' ? value === state : type === 'checkbox' ? checked : undefined,
|
|
8943
|
-
'aria-describedby': `${componentId}-title
|
|
8949
|
+
'aria-describedby': `${componentId}-title`,
|
|
8944
8950
|
'aria-disabled': isDisabled,
|
|
8945
8951
|
'data-value': value ?? undefined,
|
|
8946
8952
|
role: type === 'checkbox' || type === 'radio' ? type : undefined,
|
|
@@ -9593,8 +9599,8 @@ function Select({
|
|
|
9593
9599
|
}
|
|
9594
9600
|
};
|
|
9595
9601
|
function selectKeyboardFocusedOption() {
|
|
9596
|
-
if (keyboardFocusedOptionIndex != null) {
|
|
9597
|
-
|
|
9602
|
+
if (keyboardFocusedOptionIndex != null && selectableOptions.length > 0) {
|
|
9603
|
+
selectOption(selectableOptions[keyboardFocusedOptionIndex]);
|
|
9598
9604
|
}
|
|
9599
9605
|
}
|
|
9600
9606
|
function moveFocusWithDifference(difference) {
|
|
@@ -9821,7 +9827,6 @@ function Select({
|
|
|
9821
9827
|
disabled: disabled,
|
|
9822
9828
|
"aria-controls": listboxId,
|
|
9823
9829
|
"aria-expanded": open,
|
|
9824
|
-
"aria-autocomplete": "none",
|
|
9825
9830
|
onClick: handleOnClick,
|
|
9826
9831
|
...buttonProps,
|
|
9827
9832
|
children: [selected ? /*#__PURE__*/jsx(Option$1, {
|