@transferwise/components 45.26.1 → 45.26.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.
@@ -15,6 +15,7 @@
15
15
  "neptune.DateLookup.twentyYears": "20 years",
16
16
  "neptune.DateLookup.year": "year",
17
17
  "neptune.FlowNavigation.back": "back to previous step",
18
+ "neptune.Info.ariaLabel": "More information",
18
19
  "neptune.Link.opensInNewTab": "(opens in new tab)",
19
20
  "neptune.MoneyInput.Select.placeholder": "Select an option...",
20
21
  "neptune.Select.searchPlaceholder": "Search...",
@@ -800,7 +800,7 @@ const ActionOption = ({
800
800
  });
801
801
  };
802
802
 
803
- var messages$b = defineMessages({
803
+ var messages$c = defineMessages({
804
804
  ariaLabel: {
805
805
  id: "neptune.CloseButton.ariaLabel"
806
806
  }
@@ -816,7 +816,7 @@ const CloseButton = /*#__PURE__*/forwardRef(function CloseButton({
816
816
  testId
817
817
  }, reference) {
818
818
  const intl = useIntl();
819
- ariaLabel ??= intl.formatMessage(messages$b.ariaLabel);
819
+ ariaLabel ??= intl.formatMessage(messages$c.ariaLabel);
820
820
  const Icon = filled ? CrossCircleFill : Cross;
821
821
  return /*#__PURE__*/jsx("button", {
822
822
  ref: reference,
@@ -836,7 +836,7 @@ const CloseButton = /*#__PURE__*/forwardRef(function CloseButton({
836
836
  });
837
837
  });
838
838
 
839
- var messages$a = defineMessages({
839
+ var messages$b = defineMessages({
840
840
  opensInNewTab: {
841
841
  id: "neptune.Link.opensInNewTab"
842
842
  }
@@ -865,7 +865,7 @@ const Link = ({
865
865
  onClick: onClick,
866
866
  ...props,
867
867
  children: [children, " ", isBlank && /*#__PURE__*/jsx(NavigateAway, {
868
- title: formatMessage(messages$a.opensInNewTab)
868
+ title: formatMessage(messages$b.opensInNewTab)
869
869
  })]
870
870
  });
871
871
  };
@@ -2312,7 +2312,7 @@ ProcessIndicator.defaultProps = {
2312
2312
  };
2313
2313
  var ProcessIndicator$1 = ProcessIndicator;
2314
2314
 
2315
- var messages$9 = defineMessages({
2315
+ var messages$a = defineMessages({
2316
2316
  loadingAriaLabel: {
2317
2317
  id: "neptune.Button.loadingAriaLabel"
2318
2318
  }
@@ -2431,7 +2431,7 @@ const Button = /*#__PURE__*/forwardRef(({
2431
2431
  className: classes,
2432
2432
  ...props,
2433
2433
  "aria-live": loading ? 'polite' : 'off',
2434
- "aria-label": loading ? intl.formatMessage(messages$9.loadingAriaLabel) : rest['aria-label'],
2434
+ "aria-label": loading ? intl.formatMessage(messages$a.loadingAriaLabel) : rest['aria-label'],
2435
2435
  children: [children, loading && /*#__PURE__*/jsx(ProcessIndicator$1, {
2436
2436
  size: processIndicatorSize(),
2437
2437
  className: "btn-loader"
@@ -2724,7 +2724,7 @@ const Chip = ({
2724
2724
  }, value);
2725
2725
  };
2726
2726
 
2727
- var messages$8 = defineMessages({
2727
+ var messages$9 = defineMessages({
2728
2728
  ariaLabel: {
2729
2729
  id: "neptune.Chips.ariaLabel"
2730
2730
  }
@@ -2756,7 +2756,7 @@ const Chips = ({
2756
2756
  value: chip.value,
2757
2757
  label: chip.label,
2758
2758
  closeButton: {
2759
- 'aria-label': intl.formatMessage(messages$8.ariaLabel, {
2759
+ 'aria-label': intl.formatMessage(messages$9.ariaLabel, {
2760
2760
  choice: chip.label
2761
2761
  })
2762
2762
  },
@@ -2864,7 +2864,7 @@ const validDateObject = dateObject => dateObject instanceof Date && !isNaN(dateO
2864
2864
 
2865
2865
  const isMonthAndYearFormat = dateString => validDateString(dateString) && dateString.split('-').length < 3;
2866
2866
 
2867
- var messages$7 = defineMessages({
2867
+ var messages$8 = defineMessages({
2868
2868
  monthLabel: {
2869
2869
  id: "neptune.DateInput.month.label"
2870
2870
  },
@@ -2944,12 +2944,12 @@ const DateInput = ({
2944
2944
  const [month, setMonth] = useState(() => getExplodedDate('month'));
2945
2945
  const [year, setYear] = useState(() => getExplodedDate('year'));
2946
2946
  const [lastBroadcastedValue, setLastBroadcastedValue] = useState(getDateObject);
2947
- dayLabel = dayLabel || formatMessage(messages$7.dayLabel);
2948
- monthLabel = monthLabel || formatMessage(messages$7.monthLabel);
2949
- yearLabel = yearLabel || formatMessage(messages$7.yearLabel);
2947
+ dayLabel = dayLabel || formatMessage(messages$8.dayLabel);
2948
+ monthLabel = monthLabel || formatMessage(messages$8.monthLabel);
2949
+ yearLabel = yearLabel || formatMessage(messages$8.yearLabel);
2950
2950
  placeholders = {
2951
2951
  day: placeholders?.day || 'DD',
2952
- month: placeholders?.month || formatMessage(messages$7.monthLabel),
2952
+ month: placeholders?.month || formatMessage(messages$8.monthLabel),
2953
2953
  year: placeholders?.year || 'YYYY'
2954
2954
  };
2955
2955
  const getDateAsString = date => {
@@ -3482,7 +3482,7 @@ DateTrigger.defaultProps = {
3482
3482
  };
3483
3483
  var DateTrigger$1 = DateTrigger;
3484
3484
 
3485
- var messages$6 = defineMessages({
3485
+ var messages$7 = defineMessages({
3486
3486
  next: {
3487
3487
  id: "neptune.DateLookup.next"
3488
3488
  },
@@ -3528,7 +3528,7 @@ const DateHeader = ({
3528
3528
  children: /*#__PURE__*/jsx("button", {
3529
3529
  type: "button",
3530
3530
  className: `d-inline-flex ${buttonClasses}`,
3531
- "aria-label": `${intl.formatMessage(messages$6.previous)} ${dateMode}`,
3531
+ "aria-label": `${intl.formatMessage(messages$7.previous)} ${dateMode}`,
3532
3532
  onClick: onPreviousClick,
3533
3533
  children: /*#__PURE__*/jsx(Chevron$1, {
3534
3534
  orientation: Position.LEFT,
@@ -3542,7 +3542,7 @@ const DateHeader = ({
3542
3542
  children: /*#__PURE__*/jsx("button", {
3543
3543
  type: "button",
3544
3544
  className: `tw-date-lookup-header-current ${buttonClasses}`,
3545
- "aria-label": intl.formatMessage(messages$6.goTo20YearView),
3545
+ "aria-label": intl.formatMessage(messages$7.goTo20YearView),
3546
3546
  onClick: onLabelClick,
3547
3547
  children: label
3548
3548
  })
@@ -3551,7 +3551,7 @@ const DateHeader = ({
3551
3551
  children: /*#__PURE__*/jsx("button", {
3552
3552
  type: "button",
3553
3553
  className: `d-inline-flex ${buttonClasses}`,
3554
- "aria-label": `${useIntl().formatMessage(messages$6.next)} ${dateMode}`,
3554
+ "aria-label": `${useIntl().formatMessage(messages$7.next)} ${dateMode}`,
3555
3555
  onClick: onNextClick,
3556
3556
  children: /*#__PURE__*/jsx(Chevron$1, {
3557
3557
  orientation: Position.RIGHT,
@@ -3618,7 +3618,7 @@ const TableLink = ({
3618
3618
  };
3619
3619
  const calculateAriaLabel = () => {
3620
3620
  if (active) {
3621
- return `${longTitle || title || ''}, ${intl.formatMessage(messages$6.selected)} ${intl.formatMessage(messages$6[type])}`;
3621
+ return `${longTitle || title || ''}, ${intl.formatMessage(messages$7.selected)} ${intl.formatMessage(messages$7[type])}`;
3622
3622
  }
3623
3623
  return longTitle || title;
3624
3624
  };
@@ -3835,7 +3835,7 @@ class DayCalendar extends PureComponent {
3835
3835
  month: monthFormat,
3836
3836
  year: 'numeric'
3837
3837
  }),
3838
- dateMode: formatMessage(messages$6.month),
3838
+ dateMode: formatMessage(messages$7.month),
3839
3839
  onLabelClick: onLabelClick,
3840
3840
  onPreviousClick: this.selectPreviousMonth,
3841
3841
  onNextClick: this.selectNextMonth
@@ -3981,7 +3981,7 @@ class MonthCalendar extends PureComponent {
3981
3981
  } = this.props;
3982
3982
  return /*#__PURE__*/jsxs(Fragment, {
3983
3983
  children: [/*#__PURE__*/jsx(DateHeader$1, {
3984
- dateMode: formatMessage(messages$6.year),
3984
+ dateMode: formatMessage(messages$7.year),
3985
3985
  label: formatDate(new Date(viewYear, 0), locale, {
3986
3986
  year: 'numeric'
3987
3987
  }),
@@ -4127,7 +4127,7 @@ class YearCalendar extends PureComponent {
4127
4127
  } = this.props;
4128
4128
  return /*#__PURE__*/jsxs(Fragment, {
4129
4129
  children: [/*#__PURE__*/jsx(DateHeader$1, {
4130
- dateMode: formatMessage(messages$6.twentyYears),
4130
+ dateMode: formatMessage(messages$7.twentyYears),
4131
4131
  onPreviousClick: this.selectPreviousYears,
4132
4132
  onNextClick: this.selectNextYears
4133
4133
  }), /*#__PURE__*/jsx(YearCalendarTable$1, {
@@ -5779,7 +5779,7 @@ const Stepper = ({
5779
5779
  });
5780
5780
  };
5781
5781
 
5782
- var messages$5 = defineMessages({
5782
+ var messages$6 = defineMessages({
5783
5783
  back: {
5784
5784
  id: "neptune.FlowNavigation.back"
5785
5785
  }
@@ -5871,7 +5871,7 @@ const FlowNavigation = ({
5871
5871
  }),
5872
5872
  leftContent: /*#__PURE__*/jsxs(Fragment, {
5873
5873
  children: [isSmall && displayGoBack ? /*#__PURE__*/jsx(BackButton$1, {
5874
- "aria-label": intl.formatMessage(messages$5.back),
5874
+ "aria-label": intl.formatMessage(messages$6.back),
5875
5875
  onClick: onGoBack
5876
5876
  }) : logo, isSmall && /*#__PURE__*/jsx(AnimatedLabel, {
5877
5877
  className: "m-x-1",
@@ -6138,7 +6138,7 @@ const Popover$1 = ({
6138
6138
  children: /*#__PURE__*/jsxs("div", {
6139
6139
  className: isModern ? 'np-popover__content np-text-default-body' : 'np-popover__content',
6140
6140
  "aria-hidden": !open,
6141
- role: "tooltip",
6141
+ role: "dialog",
6142
6142
  children: [title && /*#__PURE__*/jsx(Title, {
6143
6143
  type: Typography.TITLE_BODY,
6144
6144
  className: "m-b-1",
@@ -6177,6 +6177,12 @@ const deprecatedPlacements = {
6177
6177
  };
6178
6178
  var Popover$2 = Popover$1;
6179
6179
 
6180
+ var messages$5 = defineMessages({
6181
+ ariaLabel: {
6182
+ id: "neptune.Info.ariaLabel"
6183
+ }
6184
+ });
6185
+
6180
6186
  const Info = ({
6181
6187
  className = undefined,
6182
6188
  content = undefined,
@@ -6187,7 +6193,9 @@ const Info = ({
6187
6193
  'aria-label': ariaLabel,
6188
6194
  preferredPlacement = Position.BOTTOM
6189
6195
  }) => {
6196
+ const intl = useIntl();
6190
6197
  const [open, setOpen] = useState(false);
6198
+ ariaLabel ??= intl.formatMessage(messages$5.ariaLabel);
6191
6199
  const isModal = presentation === InfoPresentation.MODAL;
6192
6200
  const isSmall = size === Size.SMALL;
6193
6201
  const buttonProps = {
@@ -10829,6 +10837,7 @@ var en = {
10829
10837
  "neptune.DateLookup.twentyYears": "20 years",
10830
10838
  "neptune.DateLookup.year": "year",
10831
10839
  "neptune.FlowNavigation.back": "back to previous step",
10840
+ "neptune.Info.ariaLabel": "More information",
10832
10841
  "neptune.Link.opensInNewTab": "(opens in new tab)",
10833
10842
  "neptune.MoneyInput.Select.placeholder": "Select an option...",
10834
10843
  "neptune.Select.searchPlaceholder": "Search...",
@@ -11430,7 +11439,6 @@ const Summary = ({
11430
11439
  help,
11431
11440
  icon,
11432
11441
  illustration = null,
11433
- // @ts-expect-error help is old and deprecated prop
11434
11442
  info = help,
11435
11443
  status,
11436
11444
  title
@@ -12467,6 +12475,7 @@ const Option = props => {
12467
12475
  children: /*#__PURE__*/jsxs("a", {
12468
12476
  className: "dropdown-item",
12469
12477
  href: "#",
12478
+ tabIndex: -1,
12470
12479
  onClick: onClick,
12471
12480
  children: [/*#__PURE__*/jsx("span", {
12472
12481
  children: hightlight(label, query)