@transferwise/components 0.0.0-experimental-35d02b6 → 0.0.0-experimental-8f9699a

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.
@@ -3599,12 +3599,10 @@ const TableLink = ({
3599
3599
  disabled,
3600
3600
  today,
3601
3601
  autofocus,
3602
- onClick,
3603
- intl: {
3604
- formatMessage
3605
- }
3602
+ onClick
3606
3603
  }) => {
3607
3604
  const buttonRef = useRef(null);
3605
+ const intl = useIntl();
3608
3606
  useEffect(() => {
3609
3607
  if (autofocus) {
3610
3608
  setTimeout(() => {
@@ -3620,7 +3618,7 @@ const TableLink = ({
3620
3618
  };
3621
3619
  const calculateAriaLabel = () => {
3622
3620
  if (active) {
3623
- return `${longTitle || title || ''}, ${formatMessage(messages$6.selected)} ${formatMessage(messages$6[type])}`;
3621
+ return `${longTitle || title || ''}, ${intl.formatMessage(messages$6.selected)} ${intl.formatMessage(messages$6[type])}`;
3624
3622
  }
3625
3623
  return longTitle || title;
3626
3624
  };
@@ -3642,7 +3640,6 @@ const TableLink = ({
3642
3640
  })
3643
3641
  });
3644
3642
  };
3645
- var TableLink$1 = injectIntl(TableLink);
3646
3643
 
3647
3644
  const SHORT_DAY_FORMAT = {
3648
3645
  day: 'numeric'
@@ -3744,7 +3741,7 @@ class DayCalendarTable extends PureComponent {
3744
3741
  children: [/*#__PURE__*/jsx("thead", {
3745
3742
  children: /*#__PURE__*/jsx("tr", {
3746
3743
  children: this.days.map((day, index) => /*#__PURE__*/jsxs("th", {
3747
- className: "text-xs-center np-text-body-default-bold",
3744
+ className: index > 4 ? 'text-xs-center np-text-body-default' : 'text-xs-center np-text-body-default-bold',
3748
3745
  children: [/*#__PURE__*/jsx("span", {
3749
3746
  className: "hidden-xs",
3750
3747
  children: /*#__PURE__*/jsx("abbr", {
@@ -3763,8 +3760,8 @@ class DayCalendarTable extends PureComponent {
3763
3760
  }), /*#__PURE__*/jsx("tbody", {
3764
3761
  children: weeks.map((week, weekIndex) => /*#__PURE__*/jsx("tr", {
3765
3762
  children: week.map((day, dayIndex) => /*#__PURE__*/jsx("td", {
3766
- className: dayIndex > 4 ? 'default' : '',
3767
- children: day && /*#__PURE__*/jsx(TableLink$1, {
3763
+ className: dayIndex > 4 ? 'weekend' : '',
3764
+ children: day && /*#__PURE__*/jsx(TableLink, {
3768
3765
  item: day,
3769
3766
  type: "day",
3770
3767
  title: formatDate(new Date(viewYear, viewMonth, day), locale, SHORT_DAY_FORMAT),
@@ -3888,7 +3885,7 @@ const MonthCalendarTable = ({
3888
3885
  locale
3889
3886
  } = useIntl();
3890
3887
  const getLink = month => {
3891
- return /*#__PURE__*/jsx(TableLink$1, {
3888
+ return /*#__PURE__*/jsx(TableLink, {
3892
3889
  item: month,
3893
3890
  type: "month",
3894
3891
  title: formatDate(new Date(viewYear, month), locale, MONTH_ONLY_FORMAT),
@@ -4037,19 +4034,19 @@ const YearCalendarTable = ({
4037
4034
  } = useIntl();
4038
4035
  const startYear = viewYear - viewYear % 20;
4039
4036
  const getLink = year => {
4040
- return /*#__PURE__*/jsx(TableLink$1, {
4037
+ return /*#__PURE__*/jsx(TableLink, {
4041
4038
  item: year,
4042
4039
  type: "year",
4043
4040
  title: formatDate(new Date(year, 0), locale, YEAR_ONLY_FORMAT),
4044
- active: !!(selectedDate && year === selectedDate.getFullYear()),
4041
+ active: isActive(year),
4045
4042
  disabled: isDisabled(year),
4046
- today: year === new Date().getFullYear(),
4043
+ today: isThisYear(year),
4047
4044
  autofocus: autofocusYear === year,
4048
4045
  onClick: onSelect
4049
4046
  });
4050
4047
  };
4051
4048
  const isActive = year => {
4052
- return selectedDate && year === selectedDate.getFullYear();
4049
+ return !!(selectedDate && year === selectedDate.getFullYear());
4053
4050
  };
4054
4051
  const isThisYear = year => {
4055
4052
  return year === new Date().getFullYear();