@transferwise/components 45.26.1 → 45.26.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.
@@ -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,16 +5871,19 @@ 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
- }) : logo, isSmall && /*#__PURE__*/jsx(AnimatedLabel, {
5876
+ }) : /*#__PURE__*/jsx("div", {
5877
+ className: "np-flow-header__left",
5878
+ children: logo
5879
+ }), isSmall && /*#__PURE__*/jsx(AnimatedLabel, {
5877
5880
  className: "m-x-1",
5878
5881
  labels: steps.map(step => step.label),
5879
5882
  activeLabel: activeStep
5880
5883
  })]
5881
5884
  }),
5882
5885
  rightContent: /*#__PURE__*/jsxs("div", {
5883
- className: classNames('d-flex', 'align-items-center', {
5886
+ className: classNames('np-flow-header__right', 'd-flex', 'align-items-center', 'justify-content-end', {
5884
5887
  'order-2': isLarge
5885
5888
  }),
5886
5889
  children: [newAvatar, newAvatar && closeButton && /*#__PURE__*/jsx("span", {
@@ -6138,7 +6141,7 @@ const Popover$1 = ({
6138
6141
  children: /*#__PURE__*/jsxs("div", {
6139
6142
  className: isModern ? 'np-popover__content np-text-default-body' : 'np-popover__content',
6140
6143
  "aria-hidden": !open,
6141
- role: "tooltip",
6144
+ role: "dialog",
6142
6145
  children: [title && /*#__PURE__*/jsx(Title, {
6143
6146
  type: Typography.TITLE_BODY,
6144
6147
  className: "m-b-1",
@@ -6177,6 +6180,12 @@ const deprecatedPlacements = {
6177
6180
  };
6178
6181
  var Popover$2 = Popover$1;
6179
6182
 
6183
+ var messages$5 = defineMessages({
6184
+ ariaLabel: {
6185
+ id: "neptune.Info.ariaLabel"
6186
+ }
6187
+ });
6188
+
6180
6189
  const Info = ({
6181
6190
  className = undefined,
6182
6191
  content = undefined,
@@ -6187,7 +6196,9 @@ const Info = ({
6187
6196
  'aria-label': ariaLabel,
6188
6197
  preferredPlacement = Position.BOTTOM
6189
6198
  }) => {
6199
+ const intl = useIntl();
6190
6200
  const [open, setOpen] = useState(false);
6201
+ ariaLabel ??= intl.formatMessage(messages$5.ariaLabel);
6191
6202
  const isModal = presentation === InfoPresentation.MODAL;
6192
6203
  const isSmall = size === Size.SMALL;
6193
6204
  const buttonProps = {
@@ -10829,6 +10840,7 @@ var en = {
10829
10840
  "neptune.DateLookup.twentyYears": "20 years",
10830
10841
  "neptune.DateLookup.year": "year",
10831
10842
  "neptune.FlowNavigation.back": "back to previous step",
10843
+ "neptune.Info.ariaLabel": "More information",
10832
10844
  "neptune.Link.opensInNewTab": "(opens in new tab)",
10833
10845
  "neptune.MoneyInput.Select.placeholder": "Select an option...",
10834
10846
  "neptune.Select.searchPlaceholder": "Search...",
@@ -11430,7 +11442,6 @@ const Summary = ({
11430
11442
  help,
11431
11443
  icon,
11432
11444
  illustration = null,
11433
- // @ts-expect-error help is old and deprecated prop
11434
11445
  info = help,
11435
11446
  status,
11436
11447
  title
@@ -12467,6 +12478,7 @@ const Option = props => {
12467
12478
  children: /*#__PURE__*/jsxs("a", {
12468
12479
  className: "dropdown-item",
12469
12480
  href: "#",
12481
+ tabIndex: -1,
12470
12482
  onClick: onClick,
12471
12483
  children: [/*#__PURE__*/jsx("span", {
12472
12484
  children: hightlight(label, query)