@transferwise/components 46.144.0 → 46.145.0
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/README.md +2 -2
- package/build/actionOption/ActionOption.js.map +1 -1
- package/build/actionOption/ActionOption.mjs.map +1 -1
- package/build/calendar/Calendar.js +159 -0
- package/build/calendar/Calendar.js.map +1 -0
- package/build/{dateLookup/DateLookup.messages.js → calendar/Calendar.messages.js} +1 -1
- package/build/calendar/Calendar.messages.js.map +1 -0
- package/build/{dateLookup/DateLookup.messages.mjs → calendar/Calendar.messages.mjs} +1 -1
- package/build/calendar/Calendar.messages.mjs.map +1 -0
- package/build/calendar/Calendar.mjs +155 -0
- package/build/calendar/Calendar.mjs.map +1 -0
- package/build/{dateLookup → calendar}/dateHeader/DateHeader.js +4 -4
- package/build/calendar/dateHeader/DateHeader.js.map +1 -0
- package/build/{dateLookup → calendar}/dateHeader/DateHeader.mjs +1 -1
- package/build/calendar/dateHeader/DateHeader.mjs.map +1 -0
- package/build/{dateLookup → calendar}/dayCalendar/DayCalendar.js +2 -2
- package/build/calendar/dayCalendar/DayCalendar.js.map +1 -0
- package/build/{dateLookup → calendar}/dayCalendar/DayCalendar.mjs +1 -1
- package/build/calendar/dayCalendar/DayCalendar.mjs.map +1 -0
- package/build/calendar/dayCalendar/table/DayCalendarTable.js.map +1 -0
- package/build/calendar/dayCalendar/table/DayCalendarTable.mjs.map +1 -0
- package/build/calendar/getFocusableTime/getFocusableTime.js.map +1 -0
- package/build/calendar/getFocusableTime/getFocusableTime.mjs.map +1 -0
- package/build/calendar/getStartOfDay/getStartOfDay.js.map +1 -0
- package/build/calendar/getStartOfDay/getStartOfDay.mjs.map +1 -0
- package/build/{dateLookup → calendar}/monthCalendar/MonthCalendar.js +2 -2
- package/build/calendar/monthCalendar/MonthCalendar.js.map +1 -0
- package/build/{dateLookup → calendar}/monthCalendar/MonthCalendar.mjs +1 -1
- package/build/calendar/monthCalendar/MonthCalendar.mjs.map +1 -0
- package/build/calendar/monthCalendar/table/MonthCalendarTable.js.map +1 -0
- package/build/calendar/monthCalendar/table/MonthCalendarTable.mjs.map +1 -0
- package/build/{dateLookup → calendar}/tableLink/TableLink.js +2 -2
- package/build/calendar/tableLink/TableLink.js.map +1 -0
- package/build/{dateLookup → calendar}/tableLink/TableLink.mjs +1 -1
- package/build/calendar/tableLink/TableLink.mjs.map +1 -0
- package/build/{dateLookup → calendar}/yearCalendar/YearCalendar.js +2 -2
- package/build/calendar/yearCalendar/YearCalendar.js.map +1 -0
- package/build/{dateLookup → calendar}/yearCalendar/YearCalendar.mjs +1 -1
- package/build/calendar/yearCalendar/YearCalendar.mjs.map +1 -0
- package/build/calendar/yearCalendar/table/YearCalendarTable.js.map +1 -0
- package/build/calendar/yearCalendar/table/YearCalendarTable.mjs.map +1 -0
- package/build/checkboxOption/CheckboxOption.js.map +1 -1
- package/build/checkboxOption/CheckboxOption.mjs.map +1 -1
- package/build/container/Container.js.map +1 -1
- package/build/container/Container.mjs.map +1 -1
- package/build/dateLookup/DateLookup.js +28 -168
- package/build/dateLookup/DateLookup.js.map +1 -1
- package/build/dateLookup/DateLookup.mjs +29 -169
- package/build/dateLookup/DateLookup.mjs.map +1 -1
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/index.mjs +1 -0
- package/build/index.mjs.map +1 -1
- package/build/legacylistItem/LegacyListItem.js.map +1 -1
- package/build/legacylistItem/LegacyListItem.mjs.map +1 -1
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.js.map +1 -1
- package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs.map +1 -1
- package/build/listItem/AvatarView/ListItemAvatarView.js.map +1 -1
- package/build/listItem/AvatarView/ListItemAvatarView.mjs.map +1 -1
- package/build/listItem/Button/ListItemButton.js.map +1 -1
- package/build/listItem/Button/ListItemButton.mjs.map +1 -1
- package/build/listItem/Checkbox/ListItemCheckbox.js.map +1 -1
- package/build/listItem/Checkbox/ListItemCheckbox.mjs.map +1 -1
- package/build/listItem/IconButton/ListItemIconButton.js.map +1 -1
- package/build/listItem/IconButton/ListItemIconButton.mjs.map +1 -1
- package/build/listItem/Image/ListItemImage.js.map +1 -1
- package/build/listItem/Image/ListItemImage.mjs.map +1 -1
- package/build/listItem/ListItem.js.map +1 -1
- package/build/listItem/ListItem.mjs.map +1 -1
- package/build/listItem/Navigation/ListItemNavigation.js.map +1 -1
- package/build/listItem/Navigation/ListItemNavigation.mjs.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.js.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -1
- package/build/listItem/Radio/ListItemRadio.js.map +1 -1
- package/build/listItem/Radio/ListItemRadio.mjs.map +1 -1
- package/build/listItem/Switch/ListItemSwitch.js.map +1 -1
- package/build/listItem/Switch/ListItemSwitch.mjs.map +1 -1
- package/build/loader/Loader.js +1 -1
- package/build/loader/Loader.js.map +1 -1
- package/build/loader/Loader.mjs +1 -1
- package/build/loader/Loader.mjs.map +1 -1
- package/build/logo/Logo.js +1 -1
- package/build/logo/Logo.js.map +1 -1
- package/build/logo/Logo.mjs +1 -1
- package/build/logo/Logo.mjs.map +1 -1
- package/build/main.css +108 -117
- package/build/navigationOption/NavigationOption.js.map +1 -1
- package/build/navigationOption/NavigationOption.mjs.map +1 -1
- package/build/navigationOptionsList/NavigationOptionsList.js.map +1 -1
- package/build/navigationOptionsList/NavigationOptionsList.mjs.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
- package/build/prompt/CriticalBanner/CriticalBanner.js.map +1 -1
- package/build/prompt/CriticalBanner/CriticalBanner.mjs.map +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
- package/build/radioOption/RadioOption.js.map +1 -1
- package/build/radioOption/RadioOption.mjs.map +1 -1
- package/build/segmentedControl/SegmentedControl.js +1 -1
- package/build/segmentedControl/SegmentedControl.js.map +1 -1
- package/build/segmentedControl/SegmentedControl.mjs +1 -1
- package/build/segmentedControl/SegmentedControl.mjs.map +1 -1
- package/build/styles/calendar/Calendar.css +83 -0
- package/build/styles/css/neptune.css +11 -11
- package/build/styles/dateLookup/DateLookup.css +0 -90
- package/build/styles/less/legacy-variables.less +1 -1
- package/build/styles/less/neptune-tokens.less +2 -2
- package/build/styles/main.css +108 -117
- package/build/styles/props/custom-media.css +1 -1
- package/build/styles/props/neptune-tokens.css +1 -1
- package/build/styles/styles/less/neptune.css +11 -11
- package/build/summary/Summary.js +1 -1
- package/build/summary/Summary.js.map +1 -1
- package/build/summary/Summary.mjs +1 -1
- package/build/summary/Summary.mjs.map +1 -1
- package/build/switchOption/SwitchOption.js +1 -1
- package/build/switchOption/SwitchOption.js.map +1 -1
- package/build/switchOption/SwitchOption.mjs +1 -1
- package/build/switchOption/SwitchOption.mjs.map +1 -1
- package/build/types/actionOption/ActionOption.d.ts +1 -1
- package/build/types/calendar/Calendar.d.ts +13 -0
- package/build/types/calendar/Calendar.d.ts.map +1 -0
- package/build/types/{dateLookup/DateLookup.messages.d.ts → calendar/Calendar.messages.d.ts} +1 -1
- package/build/types/calendar/Calendar.messages.d.ts.map +1 -0
- package/build/types/calendar/dateHeader/DateHeader.d.ts.map +1 -0
- package/build/types/calendar/dateHeader/index.d.ts.map +1 -0
- package/build/types/calendar/dayCalendar/DayCalendar.d.ts.map +1 -0
- package/build/types/calendar/dayCalendar/index.d.ts.map +1 -0
- package/build/types/calendar/dayCalendar/table/DayCalendarTable.d.ts.map +1 -0
- package/build/types/calendar/dayCalendar/table/index.d.ts.map +1 -0
- package/build/types/calendar/getFocusableTime/getFocusableTime.d.ts.map +1 -0
- package/build/types/calendar/getStartOfDay/getStartOfDay.d.ts.map +1 -0
- package/build/types/calendar/getStartOfDay/index.d.ts.map +1 -0
- package/build/types/calendar/index.d.ts +3 -0
- package/build/types/calendar/index.d.ts.map +1 -0
- package/build/types/{dateLookup → calendar}/monthCalendar/MonthCalendar.d.ts +1 -1
- package/build/types/calendar/monthCalendar/MonthCalendar.d.ts.map +1 -0
- package/build/types/calendar/monthCalendar/index.d.ts.map +1 -0
- package/build/types/{dateLookup → calendar}/monthCalendar/table/MonthCalendarTable.d.ts +1 -1
- package/build/types/calendar/monthCalendar/table/MonthCalendarTable.d.ts.map +1 -0
- package/build/types/calendar/monthCalendar/table/index.d.ts.map +1 -0
- package/build/types/calendar/tableLink/TableLink.d.ts.map +1 -0
- package/build/types/calendar/tableLink/index.d.ts.map +1 -0
- package/build/types/{dateLookup → calendar}/yearCalendar/YearCalendar.d.ts +1 -1
- package/build/types/calendar/yearCalendar/YearCalendar.d.ts.map +1 -0
- package/build/types/calendar/yearCalendar/index.d.ts.map +1 -0
- package/build/types/{dateLookup → calendar}/yearCalendar/table/YearCalendarTable.d.ts +1 -1
- package/build/types/calendar/yearCalendar/table/YearCalendarTable.d.ts.map +1 -0
- package/build/types/calendar/yearCalendar/table/index.d.ts.map +1 -0
- package/build/types/checkboxOption/CheckboxOption.d.ts +1 -1
- package/build/types/container/Container.d.ts +1 -1
- package/build/types/dateLookup/DateLookup.d.ts +2 -26
- package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
- package/build/types/index.d.ts +2 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/legacylistItem/LegacyListItem.d.ts +1 -1
- package/build/types/listItem/AvatarLayout/ListItemAvatarLayout.d.ts +1 -1
- package/build/types/listItem/AvatarView/ListItemAvatarView.d.ts +1 -1
- package/build/types/listItem/Button/ListItemButton.d.ts +1 -1
- package/build/types/listItem/Checkbox/ListItemCheckbox.d.ts +1 -1
- package/build/types/listItem/IconButton/ListItemIconButton.d.ts +1 -1
- package/build/types/listItem/Image/ListItemImage.d.ts +1 -1
- package/build/types/listItem/ListItem.d.ts +1 -1
- package/build/types/listItem/Navigation/ListItemNavigation.d.ts +1 -1
- package/build/types/listItem/Prompt/ListItemPrompt.d.ts +1 -1
- package/build/types/listItem/Radio/ListItemRadio.d.ts +1 -1
- package/build/types/listItem/Switch/ListItemSwitch.d.ts +1 -1
- package/build/types/logo/Logo.d.ts +1 -1
- package/build/types/navigationOption/NavigationOption.d.ts +1 -1
- package/build/types/navigationOptionsList/NavigationOptionsList.d.ts +1 -1
- package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts +1 -1
- package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts +1 -1
- package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts +1 -1
- package/build/types/radioOption/RadioOption.d.ts +1 -1
- package/build/types/summary/Summary.d.ts +1 -1
- package/build/types/switchOption/SwitchOption.d.ts +1 -1
- package/package.json +22 -23
- package/src/actionButton/ActionButton.story.tsx +1 -1
- package/src/actionOption/ActionOption.tsx +1 -1
- package/src/button/_stories/Button.accessibility.docs.mdx +1 -1
- package/src/button/_stories/Button.story.tsx +6 -6
- package/src/calendar/Calendar.css +83 -0
- package/src/calendar/Calendar.less +79 -0
- package/src/calendar/Calendar.story.tsx +92 -0
- package/src/calendar/Calendar.test.tsx +138 -0
- package/src/calendar/Calendar.tsx +165 -0
- package/src/{dateLookup → calendar}/dateHeader/DateHeader.tsx +1 -1
- package/src/{dateLookup → calendar}/dayCalendar/DayCalendar.tsx +1 -1
- package/src/calendar/index.ts +2 -0
- package/src/{dateLookup → calendar}/monthCalendar/MonthCalendar.tsx +2 -2
- package/src/{dateLookup → calendar}/monthCalendar/table/MonthCalendarTable.tsx +1 -1
- package/src/{dateLookup → calendar}/tableLink/TableLink.tsx +1 -1
- package/src/{dateLookup → calendar}/yearCalendar/YearCalendar.tsx +2 -2
- package/src/{dateLookup → calendar}/yearCalendar/table/YearCalendarTable.tsx +1 -1
- package/src/checkboxButton/CheckboxButton.story.tsx +1 -1
- package/src/checkboxOption/CheckboxOption.tsx +1 -1
- package/src/chips/Chips.story.tsx +3 -3
- package/src/circularButton/CircularButton.story.tsx +4 -4
- package/src/container/Container.tsx +1 -1
- package/src/dateLookup/DateLookup.css +0 -90
- package/src/dateLookup/DateLookup.less +0 -91
- package/src/dateLookup/DateLookup.test.tsx +0 -124
- package/src/dateLookup/DateLookup.tsx +31 -161
- package/src/divider/Divider.story.tsx +2 -2
- package/src/header/Header.accessibility.docs.mdx +1 -1
- package/src/header/Header.story.tsx +1 -1
- package/src/iconButton/IconButton.story.tsx +4 -4
- package/src/index.ts +2 -0
- package/src/legacylistItem/LegacyListItem.tsx +1 -1
- package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.story.tsx +1 -1
- package/src/listItem/AvatarLayout/ListItemAvatarLayout.story.tsx +1 -1
- package/src/listItem/AvatarLayout/ListItemAvatarLayout.tsx +1 -1
- package/src/listItem/AvatarView/ListItemAvatarView.story.tsx +3 -3
- package/src/listItem/AvatarView/ListItemAvatarView.tsx +1 -1
- package/src/listItem/Button/ListItemButton.story.tsx +3 -3
- package/src/listItem/Button/ListItemButton.tsx +1 -1
- package/src/listItem/Checkbox/ListItemCheckbox.tsx +1 -1
- package/src/listItem/IconButton/ListItemIconButton.story.tsx +4 -4
- package/src/listItem/IconButton/ListItemIconButton.tsx +1 -1
- package/src/listItem/Image/ListItemImage.tsx +1 -1
- package/src/listItem/ListItem.tsx +1 -1
- package/src/listItem/Navigation/ListItemNavigation.tsx +1 -1
- package/src/listItem/Prompt/ListItemPrompt.tsx +1 -1
- package/src/listItem/Radio/ListItemRadio.tsx +1 -1
- package/src/listItem/Switch/ListItemSwitch.tsx +1 -1
- package/src/listItem/_stories/ListItem.disabled.story.tsx +1 -1
- package/src/listItem/_stories/ListItem.story.tsx +5 -5
- package/src/loader/Loader.tsx +1 -1
- package/src/logo/Logo.story.tsx +1 -1
- package/src/logo/Logo.tsx +1 -1
- package/src/main.css +108 -117
- package/src/main.less +1 -0
- package/src/navigationOption/NavigationOption.tsx +1 -1
- package/src/navigationOptionsList/NavigationOptionsList.tsx +1 -1
- package/src/prompt/ActionPrompt/ActionPrompt.story.tsx +1 -1
- package/src/prompt/ActionPrompt/ActionPrompt.tsx +1 -1
- package/src/prompt/CriticalBanner/CriticalBanner.story.tsx +1 -1
- package/src/prompt/CriticalBanner/CriticalBanner.tsx +1 -1
- package/src/prompt/InfoPrompt/InfoPrompt.story.tsx +1 -1
- package/src/prompt/InfoPrompt/InfoPrompt.tsx +1 -1
- package/src/radioOption/RadioOption.tsx +1 -1
- package/src/segmentedControl/SegmentedControl.test.tsx +1 -1
- package/src/segmentedControl/SegmentedControl.tsx +1 -1
- package/src/styles/less/neptune.css +11 -11
- package/src/summary/Summary.tsx +1 -1
- package/src/switch/Switch.story.tsx +1 -1
- package/src/switchOption/SwitchOption.tsx +1 -1
- package/build/dateLookup/DateLookup.messages.js.map +0 -1
- package/build/dateLookup/DateLookup.messages.mjs.map +0 -1
- package/build/dateLookup/dateHeader/DateHeader.js.map +0 -1
- package/build/dateLookup/dateHeader/DateHeader.mjs.map +0 -1
- package/build/dateLookup/dayCalendar/DayCalendar.js.map +0 -1
- package/build/dateLookup/dayCalendar/DayCalendar.mjs.map +0 -1
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.js.map +0 -1
- package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs.map +0 -1
- package/build/dateLookup/getFocusableTime/getFocusableTime.js.map +0 -1
- package/build/dateLookup/getFocusableTime/getFocusableTime.mjs.map +0 -1
- package/build/dateLookup/getStartOfDay/getStartOfDay.js.map +0 -1
- package/build/dateLookup/getStartOfDay/getStartOfDay.mjs.map +0 -1
- package/build/dateLookup/monthCalendar/MonthCalendar.js.map +0 -1
- package/build/dateLookup/monthCalendar/MonthCalendar.mjs.map +0 -1
- package/build/dateLookup/monthCalendar/table/MonthCalendarTable.js.map +0 -1
- package/build/dateLookup/monthCalendar/table/MonthCalendarTable.mjs.map +0 -1
- package/build/dateLookup/tableLink/TableLink.js.map +0 -1
- package/build/dateLookup/tableLink/TableLink.mjs.map +0 -1
- package/build/dateLookup/yearCalendar/YearCalendar.js.map +0 -1
- package/build/dateLookup/yearCalendar/YearCalendar.mjs.map +0 -1
- package/build/dateLookup/yearCalendar/table/YearCalendarTable.js.map +0 -1
- package/build/dateLookup/yearCalendar/table/YearCalendarTable.mjs.map +0 -1
- package/build/types/dateLookup/DateLookup.messages.d.ts.map +0 -1
- package/build/types/dateLookup/dateHeader/DateHeader.d.ts.map +0 -1
- package/build/types/dateLookup/dateHeader/index.d.ts.map +0 -1
- package/build/types/dateLookup/dayCalendar/DayCalendar.d.ts.map +0 -1
- package/build/types/dateLookup/dayCalendar/index.d.ts.map +0 -1
- package/build/types/dateLookup/dayCalendar/table/DayCalendarTable.d.ts.map +0 -1
- package/build/types/dateLookup/dayCalendar/table/index.d.ts.map +0 -1
- package/build/types/dateLookup/getFocusableTime/getFocusableTime.d.ts.map +0 -1
- package/build/types/dateLookup/getStartOfDay/getStartOfDay.d.ts.map +0 -1
- package/build/types/dateLookup/getStartOfDay/index.d.ts.map +0 -1
- package/build/types/dateLookup/monthCalendar/MonthCalendar.d.ts.map +0 -1
- package/build/types/dateLookup/monthCalendar/index.d.ts.map +0 -1
- package/build/types/dateLookup/monthCalendar/table/MonthCalendarTable.d.ts.map +0 -1
- package/build/types/dateLookup/monthCalendar/table/index.d.ts.map +0 -1
- package/build/types/dateLookup/tableLink/TableLink.d.ts.map +0 -1
- package/build/types/dateLookup/tableLink/index.d.ts.map +0 -1
- package/build/types/dateLookup/yearCalendar/YearCalendar.d.ts.map +0 -1
- package/build/types/dateLookup/yearCalendar/index.d.ts.map +0 -1
- package/build/types/dateLookup/yearCalendar/table/YearCalendarTable.d.ts.map +0 -1
- package/build/types/dateLookup/yearCalendar/table/index.d.ts.map +0 -1
- /package/build/{dateLookup → calendar}/dayCalendar/table/DayCalendarTable.js +0 -0
- /package/build/{dateLookup → calendar}/dayCalendar/table/DayCalendarTable.mjs +0 -0
- /package/build/{dateLookup → calendar}/getFocusableTime/getFocusableTime.js +0 -0
- /package/build/{dateLookup → calendar}/getFocusableTime/getFocusableTime.mjs +0 -0
- /package/build/{dateLookup → calendar}/getStartOfDay/getStartOfDay.js +0 -0
- /package/build/{dateLookup → calendar}/getStartOfDay/getStartOfDay.mjs +0 -0
- /package/build/{dateLookup → calendar}/monthCalendar/table/MonthCalendarTable.js +0 -0
- /package/build/{dateLookup → calendar}/monthCalendar/table/MonthCalendarTable.mjs +0 -0
- /package/build/{dateLookup → calendar}/yearCalendar/table/YearCalendarTable.js +0 -0
- /package/build/{dateLookup → calendar}/yearCalendar/table/YearCalendarTable.mjs +0 -0
- /package/build/types/{dateLookup → calendar}/dateHeader/DateHeader.d.ts +0 -0
- /package/build/types/{dateLookup → calendar}/dateHeader/index.d.ts +0 -0
- /package/build/types/{dateLookup → calendar}/dayCalendar/DayCalendar.d.ts +0 -0
- /package/build/types/{dateLookup → calendar}/dayCalendar/index.d.ts +0 -0
- /package/build/types/{dateLookup → calendar}/dayCalendar/table/DayCalendarTable.d.ts +0 -0
- /package/build/types/{dateLookup → calendar}/dayCalendar/table/index.d.ts +0 -0
- /package/build/types/{dateLookup → calendar}/getFocusableTime/getFocusableTime.d.ts +0 -0
- /package/build/types/{dateLookup → calendar}/getStartOfDay/getStartOfDay.d.ts +0 -0
- /package/build/types/{dateLookup → calendar}/getStartOfDay/index.d.ts +0 -0
- /package/build/types/{dateLookup → calendar}/monthCalendar/index.d.ts +0 -0
- /package/build/types/{dateLookup → calendar}/monthCalendar/table/index.d.ts +0 -0
- /package/build/types/{dateLookup → calendar}/tableLink/TableLink.d.ts +0 -0
- /package/build/types/{dateLookup → calendar}/tableLink/index.d.ts +0 -0
- /package/build/types/{dateLookup → calendar}/yearCalendar/index.d.ts +0 -0
- /package/build/types/{dateLookup → calendar}/yearCalendar/table/index.d.ts +0 -0
- /package/src/{dateLookup/DateLookup.messages.ts → calendar/Calendar.messages.ts} +0 -0
- /package/src/{dateLookup → calendar}/dateHeader/index.ts +0 -0
- /package/src/{dateLookup → calendar}/dayCalendar/index.ts +0 -0
- /package/src/{dateLookup → calendar}/dayCalendar/table/DayCalendarTable.tsx +0 -0
- /package/src/{dateLookup → calendar}/dayCalendar/table/index.ts +0 -0
- /package/src/{dateLookup → calendar}/getFocusableTime/getFocusable.test.ts +0 -0
- /package/src/{dateLookup → calendar}/getFocusableTime/getFocusableTime.tsx +0 -0
- /package/src/{dateLookup → calendar}/getStartOfDay/getStartOfDay.test.js +0 -0
- /package/src/{dateLookup → calendar}/getStartOfDay/getStartOfDay.tsx +0 -0
- /package/src/{dateLookup → calendar}/getStartOfDay/index.ts +0 -0
- /package/src/{dateLookup → calendar}/monthCalendar/index.ts +0 -0
- /package/src/{dateLookup → calendar}/monthCalendar/table/index.ts +0 -0
- /package/src/{dateLookup → calendar}/tableLink/index.ts +0 -0
- /package/src/{dateLookup → calendar}/yearCalendar/index.ts +0 -0
- /package/src/{dateLookup → calendar}/yearCalendar/table/index.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "46.
|
|
3
|
+
"version": "46.145.0",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -41,20 +41,20 @@
|
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@babel/core": "^7.29.0",
|
|
43
43
|
"@babel/plugin-transform-runtime": "^7.29.0",
|
|
44
|
-
"@babel/preset-env": "^7.29.
|
|
44
|
+
"@babel/preset-env": "^7.29.5",
|
|
45
45
|
"@babel/preset-react": "^7.28.5",
|
|
46
46
|
"@babel/preset-typescript": "^7.28.5",
|
|
47
|
-
"@formatjs/cli": "^6.
|
|
47
|
+
"@formatjs/cli": "^6.16.0",
|
|
48
48
|
"@rollup/plugin-babel": "^7.0.0",
|
|
49
49
|
"@rollup/plugin-json": "^6.1.0",
|
|
50
50
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
51
51
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
52
52
|
"@rollup/plugin-url": "^8.0.2",
|
|
53
|
-
"@storybook/addon-a11y": "^10.
|
|
54
|
-
"@storybook/addon-docs": "^10.
|
|
53
|
+
"@storybook/addon-a11y": "^10.4.0",
|
|
54
|
+
"@storybook/addon-docs": "^10.4.0",
|
|
55
55
|
"@storybook/addon-mcp": "^0.6.0",
|
|
56
56
|
"@storybook/addon-webpack5-compiler-babel": "^4.0.1",
|
|
57
|
-
"@storybook/react-webpack5": "^10.
|
|
57
|
+
"@storybook/react-webpack5": "^10.4.0",
|
|
58
58
|
"@testing-library/dom": "^10.4.1",
|
|
59
59
|
"@testing-library/jest-dom": "^6.9.1",
|
|
60
60
|
"@testing-library/react": "^16.3.2",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@tsconfig/recommended": "^1.0.13",
|
|
64
64
|
"@types/babel__core": "^7.20.5",
|
|
65
65
|
"@types/commonmark": "^0.27.10",
|
|
66
|
-
"@types/jest": "^
|
|
66
|
+
"@types/jest": "^29.5.14",
|
|
67
67
|
"@types/lodash": "4.17.24",
|
|
68
68
|
"@types/lodash.clamp": "^4.0.9",
|
|
69
69
|
"@types/lodash.debounce": "^4.0.9",
|
|
@@ -73,32 +73,31 @@
|
|
|
73
73
|
"@monaco-editor/react": "^4.7.0",
|
|
74
74
|
"monaco-editor": "^0.55.1",
|
|
75
75
|
"monaco-editor-webpack-plugin": "^7.1.1",
|
|
76
|
-
"@wise/art": "^2.30.
|
|
76
|
+
"@wise/art": "^2.30.3",
|
|
77
77
|
"@wise/eslint-config": "^14.2.1",
|
|
78
78
|
"babel-plugin-formatjs": "^10.5.41",
|
|
79
79
|
"eslint": "^9.39.4",
|
|
80
|
-
"eslint-plugin-storybook": "^10.
|
|
80
|
+
"eslint-plugin-storybook": "^10.4.0",
|
|
81
81
|
"gulp": "^5.0.1",
|
|
82
|
-
"jest": "^
|
|
82
|
+
"jest": "^29.7.0",
|
|
83
83
|
"jest-environment-jsdom": "^29.7.0",
|
|
84
84
|
"jest-fetch-mock": "^3.0.3",
|
|
85
85
|
"jsdom-testing-mocks": "^1.16.0",
|
|
86
86
|
"lodash.times": "^4.3.2",
|
|
87
87
|
"react-intl": "^7.1.14",
|
|
88
88
|
"react-live": "^4.1.8",
|
|
89
|
-
"rollup": "^4.60.
|
|
89
|
+
"rollup": "^4.60.4",
|
|
90
90
|
"rollup-preserve-directives": "^1.1.3",
|
|
91
|
-
"storybook": "^10.
|
|
91
|
+
"storybook": "^10.4.0",
|
|
92
92
|
"storybook-addon-tag-badges": "^3.1.0",
|
|
93
93
|
"storybook-addon-test-codegen": "^3.0.1",
|
|
94
94
|
"@transferwise/less-config": "3.1.2",
|
|
95
|
-
"@
|
|
96
|
-
"@wise/components-theming": "1.10.2"
|
|
97
|
-
"@wise/wds-configs": "0.0.0"
|
|
95
|
+
"@wise/wds-configs": "0.0.0",
|
|
96
|
+
"@wise/components-theming": "1.10.2"
|
|
98
97
|
},
|
|
99
98
|
"peerDependencies": {
|
|
100
99
|
"@transferwise/icons": "^3 || ^4",
|
|
101
|
-
"@wise/art": "^2.30",
|
|
100
|
+
"@wise/art": "^2.30.3",
|
|
102
101
|
"@wise/components-theming": "^1.10.1",
|
|
103
102
|
"framer-motion": "^12.23.26",
|
|
104
103
|
"react": ">=18",
|
|
@@ -112,8 +111,8 @@
|
|
|
112
111
|
"@react-aria/focus": "^3.22.0",
|
|
113
112
|
"@react-aria/overlays": "^3.32.0",
|
|
114
113
|
"@transferwise/formatting": "^2.14.1",
|
|
115
|
-
"@transferwise/neptune-tokens": "^8.
|
|
116
|
-
"@transferwise/neptune-validation": "^3.3.
|
|
114
|
+
"@transferwise/neptune-tokens": "^8.24.0",
|
|
115
|
+
"@transferwise/neptune-validation": "^3.3.4",
|
|
117
116
|
"clsx": "^2.1.1",
|
|
118
117
|
"commonmark": "^0.31.2",
|
|
119
118
|
"core-js": "^3.49.0",
|
|
@@ -134,18 +133,18 @@
|
|
|
134
133
|
"dev:translations": "pnpm build:crowdin-source-file",
|
|
135
134
|
"storybook:dev": "storybook dev -p 4477",
|
|
136
135
|
"storybook:build": "storybook build --stats-json",
|
|
137
|
-
"build:css": "gulp compileLess --dest=src",
|
|
138
136
|
"build": "npm-run-all build:*",
|
|
139
137
|
"build:clean": "rm -rf lib build",
|
|
138
|
+
"build:css-main": "gulp compileLess --dest=src",
|
|
139
|
+
"build:css-utils": "npm-run-all build:css-utils:*",
|
|
140
|
+
"build:css-utils:copy-brand-assets": "cpx 'src/styles/img/**' build/styles/img && cpx 'src/styles/fonts/*' build/styles/fonts",
|
|
141
|
+
"build:css-utils:compile": "gulp compileLess --src='src/styles/less' --dest=build/styles/css",
|
|
142
|
+
"build:css-utils:copy-vars": "gulp copyPropsAndVars --src='src/styles/props' --dest='build/styles/props' && gulp copyPropsAndVars --src='src/styles/variables' --dest='build/styles/less'",
|
|
140
143
|
"build:crowdin-source-file": "formatjs extract 'src/**/*.messages.+(js|ts|tsx)' --out-file src/i18n/en.json --format simple && prettier --write src/i18n/*.json",
|
|
141
144
|
"build:js": "rollup --config --sourcemap",
|
|
142
145
|
"build:copy-files": "cpx 'src/**/!(db)/*.{json,svg}' build",
|
|
143
146
|
"build:copy-css": "cpx 'src/main.css' build/ & cpx 'src/**/*.css' build/styles/",
|
|
144
147
|
"build:copy-lang": "cpx 'src/i18n/*.json' build/i18n && cpx 'src/i18n/index.js' build/i18n",
|
|
145
|
-
"build:neptune-css": "npm-run-all build:neptune-css:*",
|
|
146
|
-
"build:neptune-css:copy-brand-assets": "cpx 'src/styles/img/**' build/styles/img && cpx 'src/styles/fonts/*' build/styles/fonts",
|
|
147
|
-
"build:neptune-css:compile": "gulp compileLess --src='src/styles/less' --dest=build/styles/css",
|
|
148
|
-
"build:neptune-css:copy-vars": "gulp copyPropsAndVars --src='src/styles/props' --dest='build/styles/props' && gulp copyPropsAndVars --src='src/styles/variables' --dest='build/styles/less'",
|
|
149
148
|
"docs": "pnpm build",
|
|
150
149
|
"test": "TZ=UTC jest",
|
|
151
150
|
"test:watch": "TZ=UTC jest --watch",
|
|
@@ -7,7 +7,7 @@ import { withVariantConfig } from '../../.storybook/helpers';
|
|
|
7
7
|
/**
|
|
8
8
|
* This component is deprecated please use new [Button](?path=/docs/actions-button--docs).
|
|
9
9
|
*
|
|
10
|
-
* For more details please refer to the [release notes](https://transferwise.atlassian.net/wiki/spaces/DS/pages/3542158737/Button+Updates+New+sizes+Loader+and+Cue) and the [design spec](https://wise.design/components/button).
|
|
10
|
+
* For more details please refer to the [release notes](https://transferwise.atlassian.net/wiki/spaces/DS/pages/3542158737/Button+Updates+New+sizes+Loader+and+Cue) and the [design spec](https://docs.wise.design/components/button).
|
|
11
11
|
*/
|
|
12
12
|
export default {
|
|
13
13
|
component: ActionButton,
|
|
@@ -40,7 +40,7 @@ export type ActionOptionProps = {
|
|
|
40
40
|
* @deprecatedSince 46.104.0
|
|
41
41
|
* @see [Source](../listItem/ListItem.tsx)
|
|
42
42
|
* @see [Storybook](https://storybook.wise.design/?path=/docs/content-listitem--docs)
|
|
43
|
-
* @see [Design docs](https://wise.design/components/list-item)
|
|
43
|
+
* @see [Design docs](https://docs.wise.design/components/list-item)
|
|
44
44
|
* @see [Release notes](https://transferwise.atlassian.net/wiki/spaces/DS/pages/3647251055/List+Item+release+notes)
|
|
45
45
|
*/
|
|
46
46
|
const ActionOption = ({
|
|
@@ -12,7 +12,7 @@ Given the `Button` is a widely used and highly sensitive component, there are so
|
|
|
12
12
|
<ListItem
|
|
13
13
|
title="Design guidance"
|
|
14
14
|
subtitle="Before you start, familiarise yourself with the dedicated accessibility documentation."
|
|
15
|
-
control={<ListItem.Navigation href="https://wise.design/components/button#accessibility" />}
|
|
15
|
+
control={<ListItem.Navigation href="https://docs.wise.design/components/button#accessibility" />}
|
|
16
16
|
media={
|
|
17
17
|
<ListItem.AvatarView>
|
|
18
18
|
<Bulb />
|
|
@@ -149,7 +149,7 @@ const getPropsForPreview = (args: PreviewStoryArgs) => {
|
|
|
149
149
|
};
|
|
150
150
|
|
|
151
151
|
/**
|
|
152
|
-
* The stories below document the new Button API, which requires `v2` prop to function. <br />For more details please refer to the [release notes](https://transferwise.atlassian.net/wiki/spaces/DS/pages/3542158737/Button+Updates+New+sizes+Loader+and+Cue) and the [design spec](https://wise.design/components/button). <br />
|
|
152
|
+
* The stories below document the new Button API, which requires `v2` prop to function. <br />For more details please refer to the [release notes](https://transferwise.atlassian.net/wiki/spaces/DS/pages/3542158737/Button+Updates+New+sizes+Loader+and+Cue) and the [design spec](https://docs.wise.design/components/button). <br />
|
|
153
153
|
* You can still find the old Button documentation under [Legacy Button](?path=/docs/actions-button-legacy--docs)
|
|
154
154
|
*
|
|
155
155
|
*
|
|
@@ -331,7 +331,7 @@ export const Sandbox = createSandboxStory({
|
|
|
331
331
|
/**
|
|
332
332
|
* There are two different types of button – default and negative – designed to emphasise the nature of the action. <br />
|
|
333
333
|
* **NB:** Sentiment only applies to `primary` and `secondary` priorities. <br />
|
|
334
|
-
* [Design documentation](https://wise.design/components/button#types)
|
|
334
|
+
* [Design documentation](https://docs.wise.design/components/button#types)
|
|
335
335
|
*/
|
|
336
336
|
export const Sentiment: StoryObj<PreviewStoryArgs> = {
|
|
337
337
|
render: function Render(args: PreviewStoryArgs) {
|
|
@@ -377,7 +377,7 @@ export const Sentiment: StoryObj<PreviewStoryArgs> = {
|
|
|
377
377
|
/**
|
|
378
378
|
* Priorities set a visual hierarchy amongst the buttons displayed on the
|
|
379
379
|
* screen to help more important buttons to take precedence over others. <br />
|
|
380
|
-
* [Design documentation](https://wise.design/components/button#priorities)
|
|
380
|
+
* [Design documentation](https://docs.wise.design/components/button#priorities)
|
|
381
381
|
*/
|
|
382
382
|
export const Priority: StoryObj<PreviewStoryArgs> = {
|
|
383
383
|
render: function Render(args: PreviewStoryArgs) {
|
|
@@ -413,7 +413,7 @@ export const Priority: StoryObj<PreviewStoryArgs> = {
|
|
|
413
413
|
|
|
414
414
|
/**
|
|
415
415
|
* There are three different button sizes – small (`sm`), medium (`md`) and large (`lg`) – each used for different purposes. <br />
|
|
416
|
-
* [Design documentation](https://wise.design/components/button#sizes)
|
|
416
|
+
* [Design documentation](https://docs.wise.design/components/button#sizes)
|
|
417
417
|
*/
|
|
418
418
|
export const Size: StoryObj<PreviewStoryArgs> = {
|
|
419
419
|
render: function Render(args: PreviewStoryArgs) {
|
|
@@ -536,7 +536,7 @@ export const DisplayBlock: StoryObj<PreviewStoryArgs> = {
|
|
|
536
536
|
|
|
537
537
|
/**
|
|
538
538
|
* Icons are only supported for `sm` and `md` size Buttons. <br />
|
|
539
|
-
* [Design documentation](https://wise.design/components/button#accessories)
|
|
539
|
+
* [Design documentation](https://docs.wise.design/components/button#accessories)
|
|
540
540
|
*/
|
|
541
541
|
export const WithIcons: StoryObj<PreviewStoryArgs> = {
|
|
542
542
|
render: function Render(args: PreviewStoryArgs) {
|
|
@@ -595,7 +595,7 @@ export const WithIcons: StoryObj<PreviewStoryArgs> = {
|
|
|
595
595
|
|
|
596
596
|
/**
|
|
597
597
|
* Avatars are only supported by the `md` size Buttons and are only allowed before the label. <br />
|
|
598
|
-
* [Design documentation](https://wise.design/components/button#accessories)
|
|
598
|
+
* [Design documentation](https://docs.wise.design/components/button#accessories)
|
|
599
599
|
*/
|
|
600
600
|
export const WithAvatars: StoryObj<PreviewStoryArgs> = {
|
|
601
601
|
render: function Render(args: PreviewStoryArgs) {
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
.tw-date-lookup-calendar {
|
|
2
|
+
min-width: 300px;
|
|
3
|
+
text-align: center;
|
|
4
|
+
table-layout: fixed;
|
|
5
|
+
border: none;
|
|
6
|
+
background-color: inherit;
|
|
7
|
+
}
|
|
8
|
+
.tw-date-lookup-calendar thead {
|
|
9
|
+
background-color: transparent;
|
|
10
|
+
background-color: initial;
|
|
11
|
+
}
|
|
12
|
+
.tw-date-lookup-calendar > tbody > tr > td.weekend button {
|
|
13
|
+
color: #5d7079;
|
|
14
|
+
color: var(--color-content-secondary);
|
|
15
|
+
}
|
|
16
|
+
.tw-date-lookup-calendar > tbody > tr > td {
|
|
17
|
+
border: none;
|
|
18
|
+
padding: 4px;
|
|
19
|
+
padding: var(--size-4);
|
|
20
|
+
}
|
|
21
|
+
@media (max-width: 320px) {
|
|
22
|
+
.tw-date-lookup-calendar > tbody > tr > td {
|
|
23
|
+
padding: 0;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
.tw-date-lookup-calendar > tbody > tr > td:has(.tw-date-lookup-day-option) {
|
|
27
|
+
padding: 1px;
|
|
28
|
+
}
|
|
29
|
+
.tw-date-lookup-calendar > tbody > tr > td button {
|
|
30
|
+
width: 100%;
|
|
31
|
+
padding: 4px 0;
|
|
32
|
+
padding: var(--size-4) 0;
|
|
33
|
+
color: #0097c7;
|
|
34
|
+
color: var(--color-content-accent);
|
|
35
|
+
border: transparent;
|
|
36
|
+
border-radius: 10px;
|
|
37
|
+
border-radius: var(--radius-small);
|
|
38
|
+
background-color: transparent;
|
|
39
|
+
font-weight: 600;
|
|
40
|
+
font-weight: var(--font-weight-semi-bold);
|
|
41
|
+
color: #37517e;
|
|
42
|
+
color: var(--color-content-primary);
|
|
43
|
+
}
|
|
44
|
+
@media (max-width: 320px) {
|
|
45
|
+
.tw-date-lookup-calendar > tbody > tr > td button {
|
|
46
|
+
padding: 0;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
.tw-date-lookup-calendar > tbody > tr > td button.tw-date-lookup-day-option {
|
|
50
|
+
height: 40px;
|
|
51
|
+
height: var(--size-40);
|
|
52
|
+
border-radius: 9999px;
|
|
53
|
+
border-radius: var(--radius-full);
|
|
54
|
+
line-height: 40px;
|
|
55
|
+
line-height: var(--size-40);
|
|
56
|
+
width: 40px;
|
|
57
|
+
width: var(--size-40);
|
|
58
|
+
padding: 0;
|
|
59
|
+
display: inline-flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
}
|
|
63
|
+
.tw-date-lookup-calendar > tbody > tr > td button.tw-date-lookup-day-option.today {
|
|
64
|
+
-webkit-text-decoration: underline;
|
|
65
|
+
text-decoration: underline;
|
|
66
|
+
text-decoration-thickness: 2px;
|
|
67
|
+
text-underline-offset: 4px;
|
|
68
|
+
}
|
|
69
|
+
.tw-date-lookup-calendar > tbody > tr > td:not(.disabled):not(:disabled) button.show-focus,
|
|
70
|
+
.tw-date-lookup-calendar > tbody > tr > td:hover button:not(.disabled):not(:disabled) {
|
|
71
|
+
background-color: var(--color-background-screen-hover);
|
|
72
|
+
}
|
|
73
|
+
.tw-date-lookup-calendar > tbody > tr > td:not(.disabled):not(:disabled) button.active {
|
|
74
|
+
background-color: var(--color-interactive-primary);
|
|
75
|
+
color: var(--color-interactive-contrast);
|
|
76
|
+
}
|
|
77
|
+
.tw-date-lookup-calendar abbr {
|
|
78
|
+
-webkit-text-decoration: none;
|
|
79
|
+
text-decoration: none;
|
|
80
|
+
}
|
|
81
|
+
.tw-date-lookup-header-current-container {
|
|
82
|
+
display: inline;
|
|
83
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
@import (reference) "./../styles/variables/neptune-tokens.less";
|
|
2
|
+
|
|
3
|
+
.tw-date-lookup-calendar {
|
|
4
|
+
min-width: 300px;
|
|
5
|
+
text-align: center;
|
|
6
|
+
table-layout: fixed;
|
|
7
|
+
border: none;
|
|
8
|
+
|
|
9
|
+
thead {
|
|
10
|
+
background-color: unset;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
> tbody > tr > td.weekend button {
|
|
14
|
+
color: var(--color-content-secondary);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
> tbody > tr > td {
|
|
18
|
+
border: none;
|
|
19
|
+
padding: var(--size-4);
|
|
20
|
+
@media (--screen-400-zoom) {
|
|
21
|
+
padding: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:has(.tw-date-lookup-day-option) {
|
|
25
|
+
padding: 1px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
button {
|
|
29
|
+
width: 100%;
|
|
30
|
+
padding: var(--size-4) 0;
|
|
31
|
+
@media (--screen-400-zoom) {
|
|
32
|
+
padding: 0;
|
|
33
|
+
}
|
|
34
|
+
color: var(--color-content-accent);
|
|
35
|
+
border: transparent;
|
|
36
|
+
border-radius: var(--radius-small);
|
|
37
|
+
background-color: transparent;
|
|
38
|
+
font-weight: var(--font-weight-semi-bold);
|
|
39
|
+
color: var(--color-content-primary);
|
|
40
|
+
|
|
41
|
+
&.tw-date-lookup-day-option {
|
|
42
|
+
height: var(--size-40);
|
|
43
|
+
border-radius: var(--radius-full);
|
|
44
|
+
line-height: var(--size-40);
|
|
45
|
+
width: var(--size-40);
|
|
46
|
+
padding: 0;
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
|
|
51
|
+
&.today {
|
|
52
|
+
text-decoration: underline;
|
|
53
|
+
text-decoration-thickness: 2px;
|
|
54
|
+
text-underline-offset: 4px;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&:not(.disabled, :disabled) button.show-focus,
|
|
60
|
+
&:hover button:not(.disabled, :disabled) {
|
|
61
|
+
background-color: var(--color-background-screen-hover);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&:not(.disabled, :disabled) button.active {
|
|
65
|
+
background-color: var(--color-interactive-primary);
|
|
66
|
+
color: var(--color-interactive-contrast);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
abbr {
|
|
71
|
+
text-decoration: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
background-color: inherit;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.tw-date-lookup-header-current-container {
|
|
78
|
+
display: inline;
|
|
79
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { StoryObj } from '@storybook/react-webpack5';
|
|
3
|
+
import { userEvent, within } from 'storybook/test';
|
|
4
|
+
import Calendar, { type CalendarProps } from './Calendar';
|
|
5
|
+
import Modal from '../modal';
|
|
6
|
+
import Button from '../button';
|
|
7
|
+
|
|
8
|
+
/** Inline calendar for selecting a single date, with optional min/max bounds. */
|
|
9
|
+
export default {
|
|
10
|
+
component: Calendar,
|
|
11
|
+
title: 'Forms/Calendar',
|
|
12
|
+
decorators: [
|
|
13
|
+
(Story: React.ComponentType) => (
|
|
14
|
+
<div style={{ maxWidth: 500, margin: '0 auto' }}>
|
|
15
|
+
<Story />
|
|
16
|
+
</div>
|
|
17
|
+
),
|
|
18
|
+
],
|
|
19
|
+
argTypes: {
|
|
20
|
+
monthFormat: { control: 'select', options: ['long', 'short'] },
|
|
21
|
+
min: { control: 'date' },
|
|
22
|
+
max: { control: 'date' },
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
type Story = StoryObj<typeof Calendar>;
|
|
27
|
+
|
|
28
|
+
const epoch = new Date('2011-01-01');
|
|
29
|
+
const theFuture = new Date(epoch);
|
|
30
|
+
theFuture.setUTCDate(epoch.getUTCDate() + 10);
|
|
31
|
+
const thePast = new Date(epoch);
|
|
32
|
+
thePast.setUTCDate(epoch.getUTCDate() - 10);
|
|
33
|
+
|
|
34
|
+
export const Basic: Story = {
|
|
35
|
+
render: (args: CalendarProps) => {
|
|
36
|
+
const [value, setValue] = useState<Date | null>(epoch);
|
|
37
|
+
return (
|
|
38
|
+
<Calendar
|
|
39
|
+
{...args}
|
|
40
|
+
min={args.min ? new Date(args.min) : thePast}
|
|
41
|
+
max={args.max ? new Date(args.max) : theFuture}
|
|
42
|
+
value={value}
|
|
43
|
+
onChange={(v) => setValue(v)}
|
|
44
|
+
/>
|
|
45
|
+
);
|
|
46
|
+
},
|
|
47
|
+
args: {
|
|
48
|
+
monthFormat: 'long',
|
|
49
|
+
min: thePast,
|
|
50
|
+
max: theFuture,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const WithoutConstraints: Story = {
|
|
55
|
+
render: () => {
|
|
56
|
+
const [value, setValue] = useState<Date | null>(epoch);
|
|
57
|
+
return <Calendar value={value} onChange={(v) => setValue(v)} />;
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const NullValue: Story = {
|
|
62
|
+
render: () => {
|
|
63
|
+
const [value, setValue] = useState<Date | null>(null);
|
|
64
|
+
return <Calendar value={value} min={thePast} max={theFuture} onChange={(v) => setValue(v)} />;
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const InsideModal: Story = {
|
|
69
|
+
render: () => {
|
|
70
|
+
const [open, setOpen] = useState(false);
|
|
71
|
+
const [value, setValue] = useState<Date | null>(epoch);
|
|
72
|
+
return (
|
|
73
|
+
<>
|
|
74
|
+
<Button size="sm" v2 type="button" onClick={() => setOpen(true)}>
|
|
75
|
+
Open modal
|
|
76
|
+
</Button>
|
|
77
|
+
<Modal
|
|
78
|
+
open={open}
|
|
79
|
+
title="Select a date"
|
|
80
|
+
body={
|
|
81
|
+
<Calendar value={value} min={thePast} max={theFuture} onChange={(v) => setValue(v)} />
|
|
82
|
+
}
|
|
83
|
+
onClose={() => setOpen(false)}
|
|
84
|
+
/>
|
|
85
|
+
</>
|
|
86
|
+
);
|
|
87
|
+
},
|
|
88
|
+
play: async ({ canvasElement }) => {
|
|
89
|
+
const canvas = within(canvasElement);
|
|
90
|
+
await userEvent.click(canvas.getByRole('button', { name: 'Open modal' }));
|
|
91
|
+
},
|
|
92
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { mockMatchMedia, render, screen, userEvent } from '../test-utils';
|
|
2
|
+
import Calendar from './Calendar';
|
|
3
|
+
|
|
4
|
+
mockMatchMedia();
|
|
5
|
+
|
|
6
|
+
const user = userEvent.setup();
|
|
7
|
+
|
|
8
|
+
const initialValue = new Date(2000, 0, 1);
|
|
9
|
+
|
|
10
|
+
describe('Calendar', () => {
|
|
11
|
+
describe('in day view', () => {
|
|
12
|
+
it.each([
|
|
13
|
+
['{ArrowLeft}', -1],
|
|
14
|
+
['{ArrowRight}', +1],
|
|
15
|
+
['{ArrowUp}', -7],
|
|
16
|
+
['{ArrowDown}', +7],
|
|
17
|
+
])("handles '%s' to step %d day(s)", async (text: string, step: number) => {
|
|
18
|
+
const handleChange = jest.fn();
|
|
19
|
+
render(<Calendar value={initialValue} onChange={handleChange} />);
|
|
20
|
+
|
|
21
|
+
await user.click(screen.getByRole('button', { name: /selected day/iu }));
|
|
22
|
+
await user.keyboard(text);
|
|
23
|
+
|
|
24
|
+
const expected = new Date(initialValue);
|
|
25
|
+
expected.setDate(initialValue.getDate() + step);
|
|
26
|
+
expect(handleChange).toHaveBeenCalledWith(expected);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('selects a day on click', async () => {
|
|
30
|
+
const handleChange = jest.fn();
|
|
31
|
+
render(<Calendar value={initialValue} onChange={handleChange} />);
|
|
32
|
+
|
|
33
|
+
await user.click(screen.getByText('15'));
|
|
34
|
+
|
|
35
|
+
expect(handleChange).toHaveBeenCalledWith(new Date(2000, 0, 15));
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('calls onSelect instead of onChange when clicking a day', async () => {
|
|
39
|
+
const handleChange = jest.fn();
|
|
40
|
+
const handleSelect = jest.fn();
|
|
41
|
+
render(<Calendar value={initialValue} onChange={handleChange} onSelect={handleSelect} />);
|
|
42
|
+
|
|
43
|
+
await user.click(screen.getByText('15'));
|
|
44
|
+
|
|
45
|
+
expect(handleSelect).toHaveBeenCalledWith(new Date(2000, 0, 15));
|
|
46
|
+
expect(handleChange).not.toHaveBeenCalled();
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
describe('in year view', () => {
|
|
51
|
+
it.each([
|
|
52
|
+
['{ArrowLeft}', -1],
|
|
53
|
+
['{ArrowRight}', +1],
|
|
54
|
+
['{ArrowUp}', -4],
|
|
55
|
+
['{ArrowDown}', +4],
|
|
56
|
+
])("handles '%s' to step %d year(s)", async (text: string, step: number) => {
|
|
57
|
+
const handleChange = jest.fn();
|
|
58
|
+
render(<Calendar value={initialValue} onChange={handleChange} />);
|
|
59
|
+
|
|
60
|
+
await user.click(screen.getByRole('button', { name: /year view/iu }));
|
|
61
|
+
await user.keyboard(text);
|
|
62
|
+
|
|
63
|
+
const expected = new Date(initialValue);
|
|
64
|
+
expected.setFullYear(initialValue.getFullYear() + step);
|
|
65
|
+
expect(handleChange).toHaveBeenCalledWith(expected);
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
describe('in month view', () => {
|
|
70
|
+
it.each([
|
|
71
|
+
['{ArrowLeft}', -1],
|
|
72
|
+
['{ArrowRight}', +1],
|
|
73
|
+
['{ArrowUp}', -4],
|
|
74
|
+
['{ArrowDown}', +4],
|
|
75
|
+
])("handles '%s' to step %d month(s)", async (text: string, step: number) => {
|
|
76
|
+
const handleChange = jest.fn();
|
|
77
|
+
render(<Calendar value={initialValue} onChange={handleChange} />);
|
|
78
|
+
|
|
79
|
+
await user.click(screen.getByRole('button', { name: /year view/iu }));
|
|
80
|
+
await user.keyboard(' ');
|
|
81
|
+
await user.keyboard(text);
|
|
82
|
+
|
|
83
|
+
const expected = new Date(initialValue);
|
|
84
|
+
expected.setMonth(initialValue.getMonth() + step);
|
|
85
|
+
expect(handleChange).toHaveBeenCalledWith(expected);
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
describe('min/max clamping', () => {
|
|
90
|
+
it('limits navigation to min value', async () => {
|
|
91
|
+
const min = new Date(initialValue);
|
|
92
|
+
min.setDate(min.getDate() - 1);
|
|
93
|
+
const handleChange = jest.fn();
|
|
94
|
+
render(<Calendar value={initialValue} min={min} onChange={handleChange} />);
|
|
95
|
+
|
|
96
|
+
await user.click(screen.getByRole('button', { name: /selected day/iu }));
|
|
97
|
+
await user.keyboard('{ArrowLeft}{ArrowLeft}');
|
|
98
|
+
|
|
99
|
+
expect(handleChange).toHaveBeenLastCalledWith(min);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it('limits navigation to max value', async () => {
|
|
103
|
+
const max = new Date(initialValue);
|
|
104
|
+
max.setDate(max.getDate() + 1);
|
|
105
|
+
const handleChange = jest.fn();
|
|
106
|
+
render(<Calendar value={initialValue} max={max} onChange={handleChange} />);
|
|
107
|
+
|
|
108
|
+
await user.click(screen.getByRole('button', { name: /selected day/iu }));
|
|
109
|
+
await user.keyboard('{ArrowRight}{ArrowRight}');
|
|
110
|
+
|
|
111
|
+
expect(handleChange).toHaveBeenLastCalledWith(max);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it('clamps value to range when value is outside min/max', () => {
|
|
115
|
+
const min = new Date(2000, 0, 5);
|
|
116
|
+
const max = new Date(2000, 0, 20);
|
|
117
|
+
const handleChange = jest.fn();
|
|
118
|
+
render(<Calendar value={initialValue} min={min} max={max} onChange={handleChange} />);
|
|
119
|
+
|
|
120
|
+
expect(handleChange).toHaveBeenCalledWith(min);
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
describe('view switching', () => {
|
|
125
|
+
it('switches to year view and back to day view', async () => {
|
|
126
|
+
render(<Calendar value={initialValue} onChange={jest.fn()} />);
|
|
127
|
+
|
|
128
|
+
await user.click(screen.getByRole('button', { name: /year view/iu }));
|
|
129
|
+
expect(screen.getByRole('button', { name: /selected year/iu })).toBeInTheDocument();
|
|
130
|
+
|
|
131
|
+
await user.click(screen.getByRole('button', { name: /selected year/iu }));
|
|
132
|
+
expect(screen.getByRole('button', { name: /selected month/iu })).toBeInTheDocument();
|
|
133
|
+
|
|
134
|
+
await user.click(screen.getByRole('button', { name: /selected month/iu }));
|
|
135
|
+
expect(screen.getByRole('button', { name: /next month/iu })).toBeInTheDocument();
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
});
|