@transferwise/components 45.19.1 → 45.19.2

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.
@@ -14,6 +14,7 @@
14
14
  "neptune.DateLookup.selected": "selected",
15
15
  "neptune.DateLookup.twentyYears": "20 years",
16
16
  "neptune.DateLookup.year": "year",
17
+ "neptune.FlowNavigation.back": "back to previous step",
17
18
  "neptune.Link.opensInNewTab": "(opens in new tab)",
18
19
  "neptune.MoneyInput.Select.placeholder": "Select an option...",
19
20
  "neptune.Select.searchPlaceholder": "Search...",
@@ -789,7 +789,7 @@ const ActionOption = ({
789
789
  });
790
790
  };
791
791
 
792
- var messages$a = defineMessages({
792
+ var messages$b = defineMessages({
793
793
  ariaLabel: {
794
794
  id: "neptune.CloseButton.ariaLabel"
795
795
  }
@@ -805,7 +805,7 @@ const CloseButton = /*#__PURE__*/forwardRef(function CloseButton({
805
805
  testId
806
806
  }, reference) {
807
807
  const intl = useIntl();
808
- ariaLabel ??= intl.formatMessage(messages$a.ariaLabel);
808
+ ariaLabel ??= intl.formatMessage(messages$b.ariaLabel);
809
809
  const Icon = filled ? CrossCircleFill : Cross;
810
810
  return /*#__PURE__*/jsx("button", {
811
811
  ref: reference,
@@ -825,7 +825,7 @@ const CloseButton = /*#__PURE__*/forwardRef(function CloseButton({
825
825
  });
826
826
  });
827
827
 
828
- var messages$9 = defineMessages({
828
+ var messages$a = defineMessages({
829
829
  opensInNewTab: {
830
830
  id: "neptune.Link.opensInNewTab"
831
831
  }
@@ -854,7 +854,7 @@ const Link = ({
854
854
  onClick: onClick,
855
855
  ...props,
856
856
  children: [children, " ", isBlank && /*#__PURE__*/jsx(NavigateAway, {
857
- title: formatMessage(messages$9.opensInNewTab)
857
+ title: formatMessage(messages$a.opensInNewTab)
858
858
  })]
859
859
  });
860
860
  };
@@ -2216,7 +2216,7 @@ ProcessIndicator.defaultProps = {
2216
2216
  };
2217
2217
  var ProcessIndicator$1 = ProcessIndicator;
2218
2218
 
2219
- var messages$8 = defineMessages({
2219
+ var messages$9 = defineMessages({
2220
2220
  loadingAriaLabel: {
2221
2221
  id: "neptune.Button.loadingAriaLabel"
2222
2222
  }
@@ -2335,7 +2335,7 @@ const Button = /*#__PURE__*/forwardRef(({
2335
2335
  className: classes,
2336
2336
  ...props,
2337
2337
  "aria-live": loading ? 'polite' : 'off',
2338
- "aria-label": loading ? intl.formatMessage(messages$8.loadingAriaLabel) : undefined,
2338
+ "aria-label": loading ? intl.formatMessage(messages$9.loadingAriaLabel) : rest['aria-label'],
2339
2339
  children: [children, loading && /*#__PURE__*/jsx(ProcessIndicator$1, {
2340
2340
  size: processIndicatorSize(),
2341
2341
  className: "btn-loader"
@@ -2628,7 +2628,7 @@ const Chip = ({
2628
2628
  }, value);
2629
2629
  };
2630
2630
 
2631
- var messages$7 = defineMessages({
2631
+ var messages$8 = defineMessages({
2632
2632
  ariaLabel: {
2633
2633
  id: "neptune.Chips.ariaLabel"
2634
2634
  }
@@ -2660,7 +2660,7 @@ const Chips = ({
2660
2660
  value: chip.value,
2661
2661
  label: chip.label,
2662
2662
  closeButton: {
2663
- 'aria-label': intl.formatMessage(messages$7.ariaLabel, {
2663
+ 'aria-label': intl.formatMessage(messages$8.ariaLabel, {
2664
2664
  choice: chip.label
2665
2665
  })
2666
2666
  },
@@ -2768,7 +2768,7 @@ const validDateObject = dateObject => dateObject instanceof Date && !isNaN(dateO
2768
2768
 
2769
2769
  const isMonthAndYearFormat = dateString => validDateString(dateString) && dateString.split('-').length < 3;
2770
2770
 
2771
- var messages$6 = defineMessages({
2771
+ var messages$7 = defineMessages({
2772
2772
  monthLabel: {
2773
2773
  id: "neptune.DateInput.month.label"
2774
2774
  },
@@ -2846,12 +2846,12 @@ const DateInput = ({
2846
2846
  const [month, setMonth] = useState(() => getExplodedDate('month'));
2847
2847
  const [year, setYear] = useState(() => getExplodedDate('year'));
2848
2848
  const [lastBroadcastedValue, setLastBroadcastedValue] = useState(getDateObject);
2849
- dayLabel = dayLabel || formatMessage(messages$6.dayLabel);
2850
- monthLabel = monthLabel || formatMessage(messages$6.monthLabel);
2851
- yearLabel = yearLabel || formatMessage(messages$6.yearLabel);
2849
+ dayLabel = dayLabel || formatMessage(messages$7.dayLabel);
2850
+ monthLabel = monthLabel || formatMessage(messages$7.monthLabel);
2851
+ yearLabel = yearLabel || formatMessage(messages$7.yearLabel);
2852
2852
  placeholders = {
2853
2853
  day: placeholders?.day || 'DD',
2854
- month: placeholders?.month || formatMessage(messages$6.monthLabel),
2854
+ month: placeholders?.month || formatMessage(messages$7.monthLabel),
2855
2855
  year: placeholders?.year || 'YYYY'
2856
2856
  };
2857
2857
  const getDateAsString = date => {
@@ -3282,7 +3282,7 @@ const ResponsivePanel = /*#__PURE__*/forwardRef(({
3282
3282
  });
3283
3283
  var ResponsivePanel$1 = ResponsivePanel;
3284
3284
 
3285
- var messages$5 = defineMessages({
3285
+ var messages$6 = defineMessages({
3286
3286
  ariaLabel: {
3287
3287
  id: "neptune.ClearButton.ariaLabel"
3288
3288
  }
@@ -3345,7 +3345,7 @@ const DateTrigger = ({
3345
3345
  className: "input-group-addon",
3346
3346
  children: /*#__PURE__*/jsx(CloseButton, {
3347
3347
  className: `clear-btn clear-btn--${size}`,
3348
- "aria-label": formatMessage(messages$5.ariaLabel),
3348
+ "aria-label": formatMessage(messages$6.ariaLabel),
3349
3349
  size: Size.SMALL,
3350
3350
  onClick: event => {
3351
3351
  event.stopPropagation();
@@ -3375,7 +3375,7 @@ DateTrigger.defaultProps = {
3375
3375
  };
3376
3376
  var DateTrigger$1 = DateTrigger;
3377
3377
 
3378
- var messages$4 = defineMessages({
3378
+ var messages$5 = defineMessages({
3379
3379
  next: {
3380
3380
  id: "neptune.DateLookup.next"
3381
3381
  },
@@ -3418,7 +3418,7 @@ const DateHeader = ({
3418
3418
  children: /*#__PURE__*/jsx("button", {
3419
3419
  type: "button",
3420
3420
  className: `d-inline-flex ${buttonClasses}`,
3421
- "aria-label": `${intl.formatMessage(messages$4.previous)} ${dateMode}`,
3421
+ "aria-label": `${intl.formatMessage(messages$5.previous)} ${dateMode}`,
3422
3422
  onClick: onPreviousClick,
3423
3423
  children: /*#__PURE__*/jsx(Chevron$1, {
3424
3424
  orientation: Position.LEFT,
@@ -3429,7 +3429,7 @@ const DateHeader = ({
3429
3429
  }), label && /*#__PURE__*/jsx("button", {
3430
3430
  type: "button",
3431
3431
  className: `tw-date-lookup-header-current ${buttonClasses}`,
3432
- "aria-label": intl.formatMessage(messages$4.goTo20YearView),
3432
+ "aria-label": intl.formatMessage(messages$5.goTo20YearView),
3433
3433
  onClick: onLabelClick,
3434
3434
  children: label
3435
3435
  }), /*#__PURE__*/jsx("div", {
@@ -3437,7 +3437,7 @@ const DateHeader = ({
3437
3437
  children: /*#__PURE__*/jsx("button", {
3438
3438
  type: "button",
3439
3439
  className: `d-inline-flex ${buttonClasses}`,
3440
- "aria-label": `${useIntl().formatMessage(messages$4.next)} ${dateMode}`,
3440
+ "aria-label": `${useIntl().formatMessage(messages$5.next)} ${dateMode}`,
3441
3441
  onClick: onNextClick,
3442
3442
  children: /*#__PURE__*/jsx(Chevron$1, {
3443
3443
  orientation: Position.RIGHT,
@@ -3481,7 +3481,7 @@ class TableLink extends PureComponent {
3481
3481
  };
3482
3482
  calculateAriaLabel = (longTitle, title, active, type, formatMessage) => {
3483
3483
  if (active) {
3484
- return `${longTitle || title}, ${formatMessage(messages$4.selected)} ${formatMessage(messages$4[type])}`;
3484
+ return `${longTitle || title}, ${formatMessage(messages$5.selected)} ${formatMessage(messages$5[type])}`;
3485
3485
  }
3486
3486
  return longTitle || title;
3487
3487
  };
@@ -3704,7 +3704,7 @@ class DayCalendar extends PureComponent {
3704
3704
  month: monthFormat,
3705
3705
  year: 'numeric'
3706
3706
  }),
3707
- dateMode: formatMessage(messages$4.month),
3707
+ dateMode: formatMessage(messages$5.month),
3708
3708
  onLabelClick: onLabelClick,
3709
3709
  onPreviousClick: this.selectPreviousMonth,
3710
3710
  onNextClick: this.selectNextMonth
@@ -3832,7 +3832,7 @@ class MonthCalendar extends PureComponent {
3832
3832
  } = this.props;
3833
3833
  return /*#__PURE__*/jsxs(Fragment, {
3834
3834
  children: [/*#__PURE__*/jsx(DateHeader$1, {
3835
- dateMode: formatMessage(messages$4.year),
3835
+ dateMode: formatMessage(messages$5.year),
3836
3836
  label: formatDate(new Date(viewYear, 0), locale, {
3837
3837
  year: 'numeric'
3838
3838
  }),
@@ -3957,7 +3957,7 @@ class YearCalendar extends PureComponent {
3957
3957
  } = this.props;
3958
3958
  return /*#__PURE__*/jsxs(Fragment, {
3959
3959
  children: [/*#__PURE__*/jsx(DateHeader$1, {
3960
- dateMode: formatMessage(messages$4.twentyYears),
3960
+ dateMode: formatMessage(messages$5.twentyYears),
3961
3961
  onPreviousClick: this.selectPreviousYears,
3962
3962
  onNextClick: this.selectNextYears
3963
3963
  }), /*#__PURE__*/jsx(YearCalendarTable$1, {
@@ -5655,13 +5655,21 @@ const Stepper = ({
5655
5655
  });
5656
5656
  };
5657
5657
 
5658
+ var messages$4 = defineMessages({
5659
+ back: {
5660
+ id: "neptune.FlowNavigation.back"
5661
+ }
5662
+ });
5663
+
5658
5664
  const AnimatedLabel = ({
5659
5665
  activeLabel,
5660
5666
  className,
5661
- labels
5667
+ labels,
5668
+ 'aria-label': ariaLabel
5662
5669
  }) => {
5663
5670
  const numberLabels = labels.length - 1;
5664
5671
  return /*#__PURE__*/jsx("div", {
5672
+ "aria-label": ariaLabel,
5665
5673
  className: classNames('np-animated-label', 'np-text-body-large-bold', className),
5666
5674
  children: labels.map((label, index) => {
5667
5675
  const nextLabel = index - 1;
@@ -5675,15 +5683,6 @@ const AnimatedLabel = ({
5675
5683
  })
5676
5684
  });
5677
5685
  };
5678
- AnimatedLabel.propTypes = {
5679
- activeLabel: PropTypes.number.isRequired,
5680
- className: PropTypes.string,
5681
- labels: PropTypes.arrayOf(PropTypes.node).isRequired
5682
- };
5683
- AnimatedLabel.defaultProps = {
5684
- className: undefined
5685
- };
5686
- var AnimatedLabel$1 = AnimatedLabel;
5687
5686
 
5688
5687
  const BackButton = ({
5689
5688
  label,
@@ -5718,6 +5717,7 @@ const FlowNavigation = ({
5718
5717
  steps
5719
5718
  }) => {
5720
5719
  const reference = useRef(null);
5720
+ const intl = useIntl();
5721
5721
  const [clientWidth] = useClientWidth({
5722
5722
  ref: reference
5723
5723
  });
@@ -5731,10 +5731,11 @@ const FlowNavigation = ({
5731
5731
  const displayGoBack = onGoBack != null && activeStep > 0;
5732
5732
  return /*#__PURE__*/jsx(Fragment, {
5733
5733
  children: displayGoBack ? /*#__PURE__*/jsx(BackButton$1, {
5734
- label: /*#__PURE__*/jsx(AnimatedLabel$1, {
5734
+ label: /*#__PURE__*/jsx(AnimatedLabel, {
5735
5735
  className: "m-x-1",
5736
5736
  labels: steps.map(step => step.label),
5737
- activeLabel: activeStep - 1
5737
+ activeLabel: activeStep - 1,
5738
+ "aria-label": intl.formatMessage(messages$4.back)
5738
5739
  }),
5739
5740
  onClick: onGoBack
5740
5741
  }) : logo
@@ -6675,7 +6676,7 @@ function SelectInputClearButton({
6675
6676
  const intl = useIntl();
6676
6677
  return /*#__PURE__*/jsx("button", {
6677
6678
  type: "button",
6678
- "aria-label": intl.formatMessage(messages$5.ariaLabel),
6679
+ "aria-label": intl.formatMessage(messages$6.ariaLabel),
6679
6680
  className: classNames(className, 'np-select-input-addon np-select-input-addon--interactive'),
6680
6681
  onClick: onClick,
6681
6682
  children: /*#__PURE__*/jsx(Cross, {
@@ -10675,6 +10676,7 @@ var en = {
10675
10676
  "neptune.DateLookup.selected": "selected",
10676
10677
  "neptune.DateLookup.twentyYears": "20 years",
10677
10678
  "neptune.DateLookup.year": "year",
10679
+ "neptune.FlowNavigation.back": "back to previous step",
10678
10680
  "neptune.Link.opensInNewTab": "(opens in new tab)",
10679
10681
  "neptune.MoneyInput.Select.placeholder": "Select an option...",
10680
10682
  "neptune.Select.searchPlaceholder": "Search...",