@transferwise/components 46.17.2 → 46.17.3

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.
Files changed (77) hide show
  1. package/build/index.esm.js +16 -15
  2. package/build/index.esm.js.map +1 -1
  3. package/build/index.js +15 -14
  4. package/build/index.js.map +1 -1
  5. package/build/types/accordion/Accordion.d.ts +1 -1
  6. package/build/types/accordion/Accordion.d.ts.map +1 -1
  7. package/build/types/chips/Chips.d.ts +2 -2
  8. package/build/types/chips/Chips.d.ts.map +1 -1
  9. package/build/types/dateLookup/getFocusableTime/getFocusableTime.d.ts +1 -1
  10. package/build/types/dateLookup/getFocusableTime/getFocusableTime.d.ts.map +1 -1
  11. package/build/types/decision/Decision.d.ts +1 -1
  12. package/build/types/decision/Decision.d.ts.map +1 -1
  13. package/build/types/flowNavigation/FlowNavigation.d.ts +1 -1
  14. package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
  15. package/build/types/flowNavigation/animatedLabel/AnimatedLabel.d.ts +1 -1
  16. package/build/types/flowNavigation/animatedLabel/AnimatedLabel.d.ts.map +1 -1
  17. package/build/types/instructionsList/InstructionsList.d.ts +4 -4
  18. package/build/types/instructionsList/InstructionsList.d.ts.map +1 -1
  19. package/build/types/markdown/Markdown.d.ts +2 -2
  20. package/build/types/markdown/Markdown.d.ts.map +1 -1
  21. package/build/types/phoneNumberInput/PhoneNumberInput.d.ts +1 -1
  22. package/build/types/phoneNumberInput/PhoneNumberInput.d.ts.map +1 -1
  23. package/build/types/phoneNumberInput/utils/excludeCountries/excludeCountries.d.ts +1 -1
  24. package/build/types/phoneNumberInput/utils/excludeCountries/excludeCountries.d.ts.map +1 -1
  25. package/build/types/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.d.ts +1 -1
  26. package/build/types/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.d.ts.map +1 -1
  27. package/build/types/phoneNumberInput/utils/longestMatchingPrefix/index.d.ts +1 -1
  28. package/build/types/phoneNumberInput/utils/longestMatchingPrefix/index.d.ts.map +1 -1
  29. package/build/types/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.d.ts +1 -1
  30. package/build/types/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.d.ts.map +1 -1
  31. package/build/types/radioGroup/RadioGroup.d.ts +1 -1
  32. package/build/types/radioGroup/RadioGroup.d.ts.map +1 -1
  33. package/build/types/segmentedControl/SegmentedControl.d.ts +3 -3
  34. package/build/types/segmentedControl/SegmentedControl.d.ts.map +1 -1
  35. package/build/types/slidingPanel/SlidingPanel.d.ts.map +1 -1
  36. package/build/types/stepper/Stepper.d.ts +1 -1
  37. package/build/types/stepper/Stepper.d.ts.map +1 -1
  38. package/build/types/typeahead/Typeahead.d.ts +5 -5
  39. package/build/types/typeahead/Typeahead.d.ts.map +1 -1
  40. package/build/types/typeahead/typeaheadInput/TypeaheadInput.d.ts +1 -1
  41. package/build/types/typeahead/typeaheadInput/TypeaheadInput.d.ts.map +1 -1
  42. package/build/types/uploadInput/UploadInput.d.ts +1 -1
  43. package/build/types/uploadInput/UploadInput.d.ts.map +1 -1
  44. package/build/types/uploadInput/uploadButton/UploadButton.d.ts +1 -1
  45. package/build/types/uploadInput/uploadButton/UploadButton.d.ts.map +1 -1
  46. package/build/types/uploadInput/uploadButton/getAllowedFileTypes.d.ts +1 -1
  47. package/build/types/uploadInput/uploadButton/getAllowedFileTypes.d.ts.map +1 -1
  48. package/package.json +1 -1
  49. package/src/accordion/Accordion.tsx +1 -1
  50. package/src/chips/Chips.story.tsx +2 -2
  51. package/src/chips/Chips.tsx +2 -2
  52. package/src/dateLookup/dateTrigger/DateTrigger.js +1 -1
  53. package/src/dateLookup/dateTrigger/DateTrigger.spec.js +11 -3
  54. package/src/dateLookup/getFocusableTime/getFocusableTime.tsx +1 -1
  55. package/src/decision/Decision.tsx +1 -1
  56. package/src/flowNavigation/FlowNavigation.tsx +1 -1
  57. package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +6 -0
  58. package/src/flowNavigation/animatedLabel/AnimatedLabel.tsx +1 -1
  59. package/src/instructionsList/InstructionsList.tsx +4 -4
  60. package/src/markdown/Markdown.tsx +3 -3
  61. package/src/moneyInput/MoneyInput.tsx +3 -3
  62. package/src/phoneNumberInput/PhoneNumberInput.tsx +1 -1
  63. package/src/phoneNumberInput/utils/excludeCountries/excludeCountries.ts +5 -2
  64. package/src/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.ts +1 -1
  65. package/src/phoneNumberInput/utils/longestMatchingPrefix/index.ts +1 -1
  66. package/src/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.ts +1 -1
  67. package/src/promoCard/PromoCardGroup.tsx +1 -1
  68. package/src/radioGroup/RadioGroup.tsx +1 -1
  69. package/src/segmentedControl/SegmentedControl.tsx +3 -3
  70. package/src/slidingPanel/SlidingPanel.js +1 -0
  71. package/src/stepper/Stepper.spec.js +16 -0
  72. package/src/stepper/Stepper.tsx +2 -1
  73. package/src/typeahead/Typeahead.tsx +6 -6
  74. package/src/typeahead/typeaheadInput/TypeaheadInput.tsx +1 -1
  75. package/src/uploadInput/UploadInput.tsx +6 -6
  76. package/src/uploadInput/uploadButton/UploadButton.tsx +5 -7
  77. package/src/uploadInput/uploadButton/getAllowedFileTypes.ts +1 -1
@@ -1,7 +1,7 @@
1
1
  import classNames from 'classnames';
2
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import * as React from 'react';
4
- import React__default, { forwardRef, cloneElement, useState, useRef, useMemo, useEffect, useCallback, useLayoutEffect, createContext, useContext, Component, PureComponent, createRef, Children, Fragment as Fragment$1 } from 'react';
4
+ import React__default, { forwardRef, cloneElement, useState, useRef, useMemo, useEffect, useCallback, useLayoutEffect, createContext, useContext, createElement, Component, PureComponent, createRef, Children, Fragment as Fragment$1 } from 'react';
5
5
  import { useId } from '@radix-ui/react-id';
6
6
  import { ChevronUp, CrossCircleFill, Cross, NavigateAway, Check, Info as Info$1, Alert as Alert$2, ClockBorderless, CheckCircle, InfoCircle, Warning, CrossCircle, Clock, Briefcase, Person, ArrowLeft, QuestionMarkCircle, AlertCircle, Search, ChevronDown, CheckCircleFill, ArrowRight, Download, ClockFill, Upload as Upload$2, Document, Plus, PlusCircle, AlertCircleFill } from '@transferwise/icons';
7
7
  import { defineMessages, useIntl, injectIntl, IntlProvider } from 'react-intl';
@@ -1778,8 +1778,9 @@ const SlidingPanel = /*#__PURE__*/forwardRef(({
1778
1778
  }, reference) => {
1779
1779
  /** @type {RefObject<HTMLDivElement>} */
1780
1780
  const localReference = useRef(null);
1781
- return /*#__PURE__*/jsx(CSSTransition, {
1781
+ return /*#__PURE__*/createElement(CSSTransition, {
1782
1782
  ...rest,
1783
+ key: `sliding-panel--open-${position}`,
1783
1784
  nodeRef: localReference,
1784
1785
  in: open
1785
1786
  // Wait for animation to finish before unmount.
@@ -1792,13 +1793,12 @@ const SlidingPanel = /*#__PURE__*/forwardRef(({
1792
1793
  'sliding-panel--fixed': slidingPanelPositionFixed
1793
1794
  }, 'sliding-panel'),
1794
1795
  appear: true,
1795
- unmountOnExit: true,
1796
- children: /*#__PURE__*/jsx("div", {
1797
- ref: mergeRefs([reference, localReference]),
1798
- className: classNames('sliding-panel', `sliding-panel--open-${position}`, className),
1799
- children: children
1800
- })
1801
- });
1796
+ unmountOnExit: true
1797
+ }, /*#__PURE__*/jsx("div", {
1798
+ ref: mergeRefs([reference, localReference]),
1799
+ className: classNames('sliding-panel', `sliding-panel--open-${position}`, className),
1800
+ children: children
1801
+ }));
1802
1802
  });
1803
1803
  SlidingPanel.propTypes = {
1804
1804
  children: PropTypes.node,
@@ -3261,7 +3261,7 @@ const DateTrigger = ({
3261
3261
  className: "input-group-addon",
3262
3262
  children: /*#__PURE__*/jsx(CloseButton, {
3263
3263
  className: `clear-btn clear-btn--${size}`,
3264
- "aria-label": formatMessage(dateTriggerMessages.ariaLabel),
3264
+ "aria-label": `${formatMessage(dateTriggerMessages.ariaLabel)} ${label}`,
3265
3265
  size: Size.SMALL,
3266
3266
  onClick: event => {
3267
3267
  event.stopPropagation();
@@ -5434,6 +5434,7 @@ const Stepper = ({
5434
5434
  });
5435
5435
  return /*#__PURE__*/jsx("li", {
5436
5436
  className: classNames('hidden-xs', 'tw-stepper__step', active ? 'np-text-body-default-bold tw-stepper__step--active' : 'np-text-body-default', clickable && 'tw-stepper__step--clickable', step.hoverLabel && 'tw-stepper__step--has-tooltip'),
5437
+ "aria-current": active ? 'step' : false,
5437
5438
  style: isRTL ? {
5438
5439
  right: `${index * stepPercentage * 100}%`
5439
5440
  } : {
@@ -7859,7 +7860,7 @@ function contains(property, query) {
7859
7860
  return property && property.toLowerCase().includes(query.toLowerCase());
7860
7861
  }
7861
7862
  function sortOptionsLabelsToFirst(options, query) {
7862
- return options.sort((first, second) => {
7863
+ return [...options].sort((first, second) => {
7863
7864
  const firstContains = contains(first.label, query);
7864
7865
  const secondContains = contains(second.label, query);
7865
7866
  if (firstContains && secondContains) {
@@ -12333,7 +12334,7 @@ class Typeahead extends Component {
12333
12334
  selected,
12334
12335
  errorState
12335
12336
  }, () => {
12336
- onChange(selected);
12337
+ onChange([...selected]);
12337
12338
  });
12338
12339
  };
12339
12340
  clear = event => {
@@ -13476,7 +13477,7 @@ const UploadButton = ({
13476
13477
  if (fileTypes === '*') {
13477
13478
  return fileTypes;
13478
13479
  }
13479
- return Array.isArray(fileTypes) ? getAllowedFileTypes(fileTypes).join(', ') : getAllowedFileTypes([fileTypes]).join(', ');
13480
+ return getAllowedFileTypes(Array.isArray(fileTypes) ? fileTypes : [fileTypes]).join(', ');
13480
13481
  };
13481
13482
  function getDescription() {
13482
13483
  if (description) {
@@ -13492,7 +13493,7 @@ const UploadButton = ({
13492
13493
  function getAcceptedTypes() {
13493
13494
  const areAllFilesAllowed = getFileTypesDescription() === '*';
13494
13495
  if (areAllFilesAllowed) {
13495
- return null; //file input by default allows all files
13496
+ return {}; //file input by default allows all files
13496
13497
  }
13497
13498
  if (Array.isArray(fileTypes)) {
13498
13499
  return {
@@ -13958,7 +13959,7 @@ const UploadInput = ({
13958
13959
  }, []);
13959
13960
  useEffect(() => {
13960
13961
  if (onFilesChange && mounted) {
13961
- onFilesChange(uploadedFiles);
13962
+ onFilesChange([...uploadedFiles]);
13962
13963
  }
13963
13964
  }, [onFilesChange, uploadedFiles]); // eslint-disable-line react-hooks/exhaustive-deps
13964
13965
  return /*#__PURE__*/jsxs(Fragment, {