@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.
package/build/index.js CHANGED
@@ -834,7 +834,7 @@ const ActionOption = ({
834
834
  });
835
835
  };
836
836
 
837
- var messages$b = reactIntl.defineMessages({
837
+ var messages$c = reactIntl.defineMessages({
838
838
  ariaLabel: {
839
839
  id: "neptune.CloseButton.ariaLabel"
840
840
  }
@@ -850,7 +850,7 @@ const CloseButton = /*#__PURE__*/React.forwardRef(function CloseButton({
850
850
  testId
851
851
  }, reference) {
852
852
  const intl = reactIntl.useIntl();
853
- ariaLabel ??= intl.formatMessage(messages$b.ariaLabel);
853
+ ariaLabel ??= intl.formatMessage(messages$c.ariaLabel);
854
854
  const Icon = filled ? icons.CrossCircleFill : icons.Cross;
855
855
  return /*#__PURE__*/jsxRuntime.jsx("button", {
856
856
  ref: reference,
@@ -870,7 +870,7 @@ const CloseButton = /*#__PURE__*/React.forwardRef(function CloseButton({
870
870
  });
871
871
  });
872
872
 
873
- var messages$a = reactIntl.defineMessages({
873
+ var messages$b = reactIntl.defineMessages({
874
874
  opensInNewTab: {
875
875
  id: "neptune.Link.opensInNewTab"
876
876
  }
@@ -899,7 +899,7 @@ const Link = ({
899
899
  onClick: onClick,
900
900
  ...props,
901
901
  children: [children, " ", isBlank && /*#__PURE__*/jsxRuntime.jsx(icons.NavigateAway, {
902
- title: formatMessage(messages$a.opensInNewTab)
902
+ title: formatMessage(messages$b.opensInNewTab)
903
903
  })]
904
904
  });
905
905
  };
@@ -2346,7 +2346,7 @@ ProcessIndicator.defaultProps = {
2346
2346
  };
2347
2347
  var ProcessIndicator$1 = ProcessIndicator;
2348
2348
 
2349
- var messages$9 = reactIntl.defineMessages({
2349
+ var messages$a = reactIntl.defineMessages({
2350
2350
  loadingAriaLabel: {
2351
2351
  id: "neptune.Button.loadingAriaLabel"
2352
2352
  }
@@ -2465,7 +2465,7 @@ const Button = /*#__PURE__*/React.forwardRef(({
2465
2465
  className: classes,
2466
2466
  ...props,
2467
2467
  "aria-live": loading ? 'polite' : 'off',
2468
- "aria-label": loading ? intl.formatMessage(messages$9.loadingAriaLabel) : rest['aria-label'],
2468
+ "aria-label": loading ? intl.formatMessage(messages$a.loadingAriaLabel) : rest['aria-label'],
2469
2469
  children: [children, loading && /*#__PURE__*/jsxRuntime.jsx(ProcessIndicator$1, {
2470
2470
  size: processIndicatorSize(),
2471
2471
  className: "btn-loader"
@@ -2758,7 +2758,7 @@ const Chip = ({
2758
2758
  }, value);
2759
2759
  };
2760
2760
 
2761
- var messages$8 = reactIntl.defineMessages({
2761
+ var messages$9 = reactIntl.defineMessages({
2762
2762
  ariaLabel: {
2763
2763
  id: "neptune.Chips.ariaLabel"
2764
2764
  }
@@ -2790,7 +2790,7 @@ const Chips = ({
2790
2790
  value: chip.value,
2791
2791
  label: chip.label,
2792
2792
  closeButton: {
2793
- 'aria-label': intl.formatMessage(messages$8.ariaLabel, {
2793
+ 'aria-label': intl.formatMessage(messages$9.ariaLabel, {
2794
2794
  choice: chip.label
2795
2795
  })
2796
2796
  },
@@ -2898,7 +2898,7 @@ const validDateObject = dateObject => dateObject instanceof Date && !isNaN(dateO
2898
2898
 
2899
2899
  const isMonthAndYearFormat = dateString => validDateString(dateString) && dateString.split('-').length < 3;
2900
2900
 
2901
- var messages$7 = reactIntl.defineMessages({
2901
+ var messages$8 = reactIntl.defineMessages({
2902
2902
  monthLabel: {
2903
2903
  id: "neptune.DateInput.month.label"
2904
2904
  },
@@ -2978,12 +2978,12 @@ const DateInput = ({
2978
2978
  const [month, setMonth] = React.useState(() => getExplodedDate('month'));
2979
2979
  const [year, setYear] = React.useState(() => getExplodedDate('year'));
2980
2980
  const [lastBroadcastedValue, setLastBroadcastedValue] = React.useState(getDateObject);
2981
- dayLabel = dayLabel || formatMessage(messages$7.dayLabel);
2982
- monthLabel = monthLabel || formatMessage(messages$7.monthLabel);
2983
- yearLabel = yearLabel || formatMessage(messages$7.yearLabel);
2981
+ dayLabel = dayLabel || formatMessage(messages$8.dayLabel);
2982
+ monthLabel = monthLabel || formatMessage(messages$8.monthLabel);
2983
+ yearLabel = yearLabel || formatMessage(messages$8.yearLabel);
2984
2984
  placeholders = {
2985
2985
  day: placeholders?.day || 'DD',
2986
- month: placeholders?.month || formatMessage(messages$7.monthLabel),
2986
+ month: placeholders?.month || formatMessage(messages$8.monthLabel),
2987
2987
  year: placeholders?.year || 'YYYY'
2988
2988
  };
2989
2989
  const getDateAsString = date => {
@@ -3516,7 +3516,7 @@ DateTrigger.defaultProps = {
3516
3516
  };
3517
3517
  var DateTrigger$1 = DateTrigger;
3518
3518
 
3519
- var messages$6 = reactIntl.defineMessages({
3519
+ var messages$7 = reactIntl.defineMessages({
3520
3520
  next: {
3521
3521
  id: "neptune.DateLookup.next"
3522
3522
  },
@@ -3562,7 +3562,7 @@ const DateHeader = ({
3562
3562
  children: /*#__PURE__*/jsxRuntime.jsx("button", {
3563
3563
  type: "button",
3564
3564
  className: `d-inline-flex ${buttonClasses}`,
3565
- "aria-label": `${intl.formatMessage(messages$6.previous)} ${dateMode}`,
3565
+ "aria-label": `${intl.formatMessage(messages$7.previous)} ${dateMode}`,
3566
3566
  onClick: onPreviousClick,
3567
3567
  children: /*#__PURE__*/jsxRuntime.jsx(Chevron$1, {
3568
3568
  orientation: exports.Position.LEFT,
@@ -3576,7 +3576,7 @@ const DateHeader = ({
3576
3576
  children: /*#__PURE__*/jsxRuntime.jsx("button", {
3577
3577
  type: "button",
3578
3578
  className: `tw-date-lookup-header-current ${buttonClasses}`,
3579
- "aria-label": intl.formatMessage(messages$6.goTo20YearView),
3579
+ "aria-label": intl.formatMessage(messages$7.goTo20YearView),
3580
3580
  onClick: onLabelClick,
3581
3581
  children: label
3582
3582
  })
@@ -3585,7 +3585,7 @@ const DateHeader = ({
3585
3585
  children: /*#__PURE__*/jsxRuntime.jsx("button", {
3586
3586
  type: "button",
3587
3587
  className: `d-inline-flex ${buttonClasses}`,
3588
- "aria-label": `${reactIntl.useIntl().formatMessage(messages$6.next)} ${dateMode}`,
3588
+ "aria-label": `${reactIntl.useIntl().formatMessage(messages$7.next)} ${dateMode}`,
3589
3589
  onClick: onNextClick,
3590
3590
  children: /*#__PURE__*/jsxRuntime.jsx(Chevron$1, {
3591
3591
  orientation: exports.Position.RIGHT,
@@ -3652,7 +3652,7 @@ const TableLink = ({
3652
3652
  };
3653
3653
  const calculateAriaLabel = () => {
3654
3654
  if (active) {
3655
- return `${longTitle || title || ''}, ${intl.formatMessage(messages$6.selected)} ${intl.formatMessage(messages$6[type])}`;
3655
+ return `${longTitle || title || ''}, ${intl.formatMessage(messages$7.selected)} ${intl.formatMessage(messages$7[type])}`;
3656
3656
  }
3657
3657
  return longTitle || title;
3658
3658
  };
@@ -3869,7 +3869,7 @@ class DayCalendar extends React.PureComponent {
3869
3869
  month: monthFormat,
3870
3870
  year: 'numeric'
3871
3871
  }),
3872
- dateMode: formatMessage(messages$6.month),
3872
+ dateMode: formatMessage(messages$7.month),
3873
3873
  onLabelClick: onLabelClick,
3874
3874
  onPreviousClick: this.selectPreviousMonth,
3875
3875
  onNextClick: this.selectNextMonth
@@ -4015,7 +4015,7 @@ class MonthCalendar extends React.PureComponent {
4015
4015
  } = this.props;
4016
4016
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
4017
4017
  children: [/*#__PURE__*/jsxRuntime.jsx(DateHeader$1, {
4018
- dateMode: formatMessage(messages$6.year),
4018
+ dateMode: formatMessage(messages$7.year),
4019
4019
  label: formatting.formatDate(new Date(viewYear, 0), locale, {
4020
4020
  year: 'numeric'
4021
4021
  }),
@@ -4161,7 +4161,7 @@ class YearCalendar extends React.PureComponent {
4161
4161
  } = this.props;
4162
4162
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
4163
4163
  children: [/*#__PURE__*/jsxRuntime.jsx(DateHeader$1, {
4164
- dateMode: formatMessage(messages$6.twentyYears),
4164
+ dateMode: formatMessage(messages$7.twentyYears),
4165
4165
  onPreviousClick: this.selectPreviousYears,
4166
4166
  onNextClick: this.selectNextYears
4167
4167
  }), /*#__PURE__*/jsxRuntime.jsx(YearCalendarTable$1, {
@@ -5813,7 +5813,7 @@ const Stepper = ({
5813
5813
  });
5814
5814
  };
5815
5815
 
5816
- var messages$5 = reactIntl.defineMessages({
5816
+ var messages$6 = reactIntl.defineMessages({
5817
5817
  back: {
5818
5818
  id: "neptune.FlowNavigation.back"
5819
5819
  }
@@ -5905,7 +5905,7 @@ const FlowNavigation = ({
5905
5905
  }),
5906
5906
  leftContent: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
5907
5907
  children: [isSmall && displayGoBack ? /*#__PURE__*/jsxRuntime.jsx(BackButton$1, {
5908
- "aria-label": intl.formatMessage(messages$5.back),
5908
+ "aria-label": intl.formatMessage(messages$6.back),
5909
5909
  onClick: onGoBack
5910
5910
  }) : logo, isSmall && /*#__PURE__*/jsxRuntime.jsx(AnimatedLabel, {
5911
5911
  className: "m-x-1",
@@ -6172,7 +6172,7 @@ const Popover$1 = ({
6172
6172
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
6173
6173
  className: isModern ? 'np-popover__content np-text-default-body' : 'np-popover__content',
6174
6174
  "aria-hidden": !open,
6175
- role: "tooltip",
6175
+ role: "dialog",
6176
6176
  children: [title && /*#__PURE__*/jsxRuntime.jsx(Title, {
6177
6177
  type: exports.Typography.TITLE_BODY,
6178
6178
  className: "m-b-1",
@@ -6211,6 +6211,12 @@ const deprecatedPlacements = {
6211
6211
  };
6212
6212
  var Popover$2 = Popover$1;
6213
6213
 
6214
+ var messages$5 = reactIntl.defineMessages({
6215
+ ariaLabel: {
6216
+ id: "neptune.Info.ariaLabel"
6217
+ }
6218
+ });
6219
+
6214
6220
  const Info = ({
6215
6221
  className = undefined,
6216
6222
  content = undefined,
@@ -6221,7 +6227,9 @@ const Info = ({
6221
6227
  'aria-label': ariaLabel,
6222
6228
  preferredPlacement = exports.Position.BOTTOM
6223
6229
  }) => {
6230
+ const intl = reactIntl.useIntl();
6224
6231
  const [open, setOpen] = React.useState(false);
6232
+ ariaLabel ??= intl.formatMessage(messages$5.ariaLabel);
6225
6233
  const isModal = presentation === exports.InfoPresentation.MODAL;
6226
6234
  const isSmall = size === exports.Size.SMALL;
6227
6235
  const buttonProps = {
@@ -10863,6 +10871,7 @@ var en = {
10863
10871
  "neptune.DateLookup.twentyYears": "20 years",
10864
10872
  "neptune.DateLookup.year": "year",
10865
10873
  "neptune.FlowNavigation.back": "back to previous step",
10874
+ "neptune.Info.ariaLabel": "More information",
10866
10875
  "neptune.Link.opensInNewTab": "(opens in new tab)",
10867
10876
  "neptune.MoneyInput.Select.placeholder": "Select an option...",
10868
10877
  "neptune.Select.searchPlaceholder": "Search...",
@@ -11464,7 +11473,6 @@ const Summary = ({
11464
11473
  help,
11465
11474
  icon,
11466
11475
  illustration = null,
11467
- // @ts-expect-error help is old and deprecated prop
11468
11476
  info = help,
11469
11477
  status,
11470
11478
  title
@@ -12501,6 +12509,7 @@ const Option = props => {
12501
12509
  children: /*#__PURE__*/jsxRuntime.jsxs("a", {
12502
12510
  className: "dropdown-item",
12503
12511
  href: "#",
12512
+ tabIndex: -1,
12504
12513
  onClick: onClick,
12505
12514
  children: [/*#__PURE__*/jsxRuntime.jsx("span", {
12506
12515
  children: hightlight(label, query)