@transferwise/components 0.0.0-experimental-58573b9 → 0.0.0-experimental-f4a3384
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.esm.js +25 -25
- package/build/index.esm.js.map +1 -1
- package/build/index.js +25 -25
- package/build/index.js.map +1 -1
- package/build/types/dateLookup/monthCalendar/table/MonthCalendarTable.d.ts.map +1 -1
- package/build/types/dateLookup/tableLink/TableLink.d.ts.map +1 -1
- package/build/types/dateLookup/yearCalendar/table/YearCalendarTable.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/dateLookup/DateLookup.story.js +2 -0
- package/src/dateLookup/monthCalendar/table/MonthCalendarTable.js +18 -22
- package/src/dateLookup/tableLink/TableLink.tsx +7 -3
- package/src/dateLookup/yearCalendar/table/YearCalendarTable.js +12 -17
package/build/index.esm.js
CHANGED
|
@@ -3512,7 +3512,11 @@ const TableLink = ({
|
|
|
3512
3512
|
children: /*#__PURE__*/jsx("button", {
|
|
3513
3513
|
ref: buttonRef,
|
|
3514
3514
|
type: "button",
|
|
3515
|
-
className: `tw-date-lookup-${type}-option
|
|
3515
|
+
className: classNames(`tw-date-lookup-${type}-option`, 'np-text-body-default-bold', {
|
|
3516
|
+
active: !!active
|
|
3517
|
+
}, {
|
|
3518
|
+
today: !!today
|
|
3519
|
+
}),
|
|
3516
3520
|
disabled: disabled,
|
|
3517
3521
|
"aria-label": calculateAriaLabel(),
|
|
3518
3522
|
"aria-pressed": active,
|
|
@@ -3769,18 +3773,16 @@ const MonthCalendarTable = ({
|
|
|
3769
3773
|
const {
|
|
3770
3774
|
locale
|
|
3771
3775
|
} = useIntl();
|
|
3772
|
-
const getLink = month => {
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
});
|
|
3783
|
-
};
|
|
3776
|
+
const getLink = month => /*#__PURE__*/jsx(TableLink$1, {
|
|
3777
|
+
item: month,
|
|
3778
|
+
type: "month",
|
|
3779
|
+
title: formatDate(new Date(viewYear, month), locale, MONTH_ONLY_FORMAT),
|
|
3780
|
+
active: !!(selectedDate && month === selectedDate.getMonth() && viewYear === selectedDate.getFullYear()),
|
|
3781
|
+
autofocus: autofocusMonth === month,
|
|
3782
|
+
disabled: isDisabled(month),
|
|
3783
|
+
today: viewYear === new Date().getFullYear() && month === new Date().getMonth(),
|
|
3784
|
+
onClick: onSelect
|
|
3785
|
+
});
|
|
3784
3786
|
const isDisabled = month => {
|
|
3785
3787
|
const date = new Date(viewYear, month);
|
|
3786
3788
|
return !!(min && date < new Date(min.getFullYear(), min.getMonth()) || max && date > new Date(max.getFullYear(), max.getMonth()));
|
|
@@ -3920,18 +3922,16 @@ const YearCalendarTable = ({
|
|
|
3920
3922
|
locale
|
|
3921
3923
|
} = useIntl();
|
|
3922
3924
|
const startYear = viewYear - viewYear % 20;
|
|
3923
|
-
const getLink = year => {
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
});
|
|
3934
|
-
};
|
|
3925
|
+
const getLink = year => /*#__PURE__*/jsx(TableLink$1, {
|
|
3926
|
+
item: year,
|
|
3927
|
+
type: "year",
|
|
3928
|
+
title: formatDate(new Date(year, 0), locale, YEAR_ONLY_FORMAT),
|
|
3929
|
+
active: !!(selectedDate && year === selectedDate.getFullYear()),
|
|
3930
|
+
disabled: isDisabled(year),
|
|
3931
|
+
today: year === new Date().getFullYear(),
|
|
3932
|
+
autofocus: autofocusYear === year,
|
|
3933
|
+
onClick: onSelect
|
|
3934
|
+
});
|
|
3935
3935
|
const isDisabled = year => {
|
|
3936
3936
|
return !!(min && year < min.getFullYear() || max && year > max.getFullYear());
|
|
3937
3937
|
};
|