@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
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { useState, useCallback, useEffect, KeyboardEvent } from 'react';
|
|
2
|
+
|
|
3
|
+
import { MonthFormat } from '../common';
|
|
4
|
+
import { isWithinRange, moveToWithinRange, returnDateView } from '../common/dateUtils';
|
|
5
|
+
import DayCalendar from './dayCalendar';
|
|
6
|
+
import { getStartOfDay } from './getStartOfDay';
|
|
7
|
+
import MonthCalendar from './monthCalendar';
|
|
8
|
+
import YearCalendar from './yearCalendar';
|
|
9
|
+
|
|
10
|
+
export interface CalendarProps {
|
|
11
|
+
value: Date | null;
|
|
12
|
+
min?: Date | null;
|
|
13
|
+
max?: Date | null;
|
|
14
|
+
monthFormat?: `${MonthFormat}`;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
onChange: (date: Date | null) => void;
|
|
17
|
+
onSelect?: (date: Date) => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const Calendar = ({
|
|
21
|
+
value,
|
|
22
|
+
min: minProp = null,
|
|
23
|
+
max: maxProp = null,
|
|
24
|
+
monthFormat = MonthFormat.LONG,
|
|
25
|
+
placeholder,
|
|
26
|
+
onChange,
|
|
27
|
+
onSelect,
|
|
28
|
+
}: CalendarProps) => {
|
|
29
|
+
const selectedDate = getStartOfDay(value);
|
|
30
|
+
const min = getStartOfDay(minProp);
|
|
31
|
+
const max = getStartOfDay(maxProp);
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (selectedDate && !isWithinRange(selectedDate, min, max)) {
|
|
35
|
+
onChange(moveToWithinRange(selectedDate, min, max));
|
|
36
|
+
}
|
|
37
|
+
}, [selectedDate?.getTime(), min?.getTime(), max?.getTime(), onChange]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
38
|
+
|
|
39
|
+
const dateView = returnDateView(selectedDate, min, max);
|
|
40
|
+
const [viewMonth, setViewMonth] = useState(dateView.getMonth());
|
|
41
|
+
const [viewYear, setViewYear] = useState(dateView.getFullYear());
|
|
42
|
+
const [mode, setMode] = useState<'day' | 'month' | 'year'>('day');
|
|
43
|
+
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
const view = returnDateView(selectedDate, min, max);
|
|
46
|
+
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
47
|
+
setViewMonth(view.getMonth());
|
|
48
|
+
|
|
49
|
+
setViewYear(view.getFullYear());
|
|
50
|
+
}, [selectedDate?.getTime(), min?.getTime(), max?.getTime()]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
51
|
+
|
|
52
|
+
const handleViewDateUpdate = useCallback(
|
|
53
|
+
// eslint-disable-next-line react-hooks/preserve-manual-memoization
|
|
54
|
+
({ month, year }: { month?: number; year?: number }) => {
|
|
55
|
+
if (month !== undefined) setViewMonth(month);
|
|
56
|
+
if (year !== undefined) setViewYear(year);
|
|
57
|
+
},
|
|
58
|
+
[],
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
const switchToDays = useCallback(() => setMode('day'), []);
|
|
62
|
+
const switchToMonths = useCallback(() => setMode('month'), []);
|
|
63
|
+
const switchToYears = useCallback(() => setMode('year'), []);
|
|
64
|
+
|
|
65
|
+
const handleSelectedDateUpdate = useCallback(
|
|
66
|
+
(date: Date) => {
|
|
67
|
+
if (onSelect) {
|
|
68
|
+
onSelect(date);
|
|
69
|
+
} else {
|
|
70
|
+
onChange(date);
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
[onChange, onSelect],
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
const adjustDate = useCallback(
|
|
77
|
+
(daysToAdd: number, monthsToAdd: number, yearsToAdd: number) => {
|
|
78
|
+
let date: Date | null;
|
|
79
|
+
if (selectedDate) {
|
|
80
|
+
date = new Date(
|
|
81
|
+
mode === 'year' ? selectedDate.getFullYear() + yearsToAdd : selectedDate.getFullYear(),
|
|
82
|
+
mode === 'month' ? selectedDate.getMonth() + monthsToAdd : selectedDate.getMonth(),
|
|
83
|
+
mode === 'day' ? selectedDate.getDate() + daysToAdd : selectedDate.getDate(),
|
|
84
|
+
);
|
|
85
|
+
} else {
|
|
86
|
+
date = getStartOfDay(new Date());
|
|
87
|
+
}
|
|
88
|
+
date &&= moveToWithinRange(date, min, max);
|
|
89
|
+
if (date?.getTime() !== selectedDate?.getTime()) {
|
|
90
|
+
onChange(date);
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
[selectedDate, min, max, mode, onChange],
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
const handleKeyDown = useCallback(
|
|
97
|
+
(event: KeyboardEvent<HTMLDivElement>) => {
|
|
98
|
+
switch (event.key) {
|
|
99
|
+
case 'ArrowLeft':
|
|
100
|
+
adjustDate(-1, -1, -1);
|
|
101
|
+
event.preventDefault();
|
|
102
|
+
break;
|
|
103
|
+
case 'ArrowUp':
|
|
104
|
+
adjustDate(-7, -4, -4);
|
|
105
|
+
event.preventDefault();
|
|
106
|
+
break;
|
|
107
|
+
case 'ArrowRight':
|
|
108
|
+
adjustDate(1, 1, 1);
|
|
109
|
+
event.preventDefault();
|
|
110
|
+
break;
|
|
111
|
+
case 'ArrowDown':
|
|
112
|
+
adjustDate(7, 4, 4);
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
break;
|
|
115
|
+
default:
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
[adjustDate],
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
124
|
+
<div onKeyDown={handleKeyDown}>
|
|
125
|
+
{mode === 'day' && (
|
|
126
|
+
<DayCalendar
|
|
127
|
+
selectedDate={selectedDate}
|
|
128
|
+
min={min}
|
|
129
|
+
max={max}
|
|
130
|
+
viewMonth={viewMonth}
|
|
131
|
+
viewYear={viewYear}
|
|
132
|
+
monthFormat={monthFormat}
|
|
133
|
+
onSelect={handleSelectedDateUpdate}
|
|
134
|
+
onLabelClick={switchToYears}
|
|
135
|
+
onViewDateUpdate={handleViewDateUpdate}
|
|
136
|
+
/>
|
|
137
|
+
)}
|
|
138
|
+
{mode === 'month' && (
|
|
139
|
+
<MonthCalendar
|
|
140
|
+
selectedDate={selectedDate}
|
|
141
|
+
min={min}
|
|
142
|
+
max={max}
|
|
143
|
+
viewYear={viewYear}
|
|
144
|
+
{...(placeholder != null && { placeholder })}
|
|
145
|
+
onSelect={switchToDays}
|
|
146
|
+
onLabelClick={switchToYears}
|
|
147
|
+
onViewDateUpdate={handleViewDateUpdate}
|
|
148
|
+
/>
|
|
149
|
+
)}
|
|
150
|
+
{mode === 'year' && (
|
|
151
|
+
<YearCalendar
|
|
152
|
+
selectedDate={selectedDate}
|
|
153
|
+
min={min}
|
|
154
|
+
max={max}
|
|
155
|
+
viewYear={viewYear}
|
|
156
|
+
{...(placeholder != null && { placeholder })}
|
|
157
|
+
onSelect={switchToMonths}
|
|
158
|
+
onViewDateUpdate={handleViewDateUpdate}
|
|
159
|
+
/>
|
|
160
|
+
)}
|
|
161
|
+
</div>
|
|
162
|
+
);
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export default Calendar;
|
|
@@ -4,7 +4,7 @@ import { useIntl } from 'react-intl';
|
|
|
4
4
|
import { Typography } from '../../common';
|
|
5
5
|
import { useLayout } from '../../common/hooks';
|
|
6
6
|
import Title from '../../title';
|
|
7
|
-
import messages from '../
|
|
7
|
+
import messages from '../Calendar.messages';
|
|
8
8
|
import Button from '../../button/Button';
|
|
9
9
|
import { ChevronDown, ChevronLeft, ChevronRight } from '@transferwise/icons';
|
|
10
10
|
import IconButton from '../../iconButton';
|
|
@@ -3,7 +3,7 @@ import { PureComponent } from 'react';
|
|
|
3
3
|
import { injectIntl, WrappedComponentProps } from 'react-intl';
|
|
4
4
|
|
|
5
5
|
import { MonthFormat } from '../../common';
|
|
6
|
-
import messages from '../
|
|
6
|
+
import messages from '../Calendar.messages';
|
|
7
7
|
import DateHeader from '../dateHeader';
|
|
8
8
|
|
|
9
9
|
import DayCalendarTable from './table';
|
|
@@ -2,7 +2,7 @@ import { formatDate } from '@transferwise/formatting';
|
|
|
2
2
|
import { PureComponent } from 'react';
|
|
3
3
|
import { injectIntl, WrappedComponentProps } from 'react-intl';
|
|
4
4
|
|
|
5
|
-
import messages from '../
|
|
5
|
+
import messages from '../Calendar.messages';
|
|
6
6
|
import DateHeader from '../dateHeader';
|
|
7
7
|
|
|
8
8
|
import MonthCalendarTable from './table';
|
|
@@ -12,7 +12,7 @@ interface MonthCalendarProps extends WrappedComponentProps {
|
|
|
12
12
|
min: Date | null;
|
|
13
13
|
max: Date | null;
|
|
14
14
|
viewYear: number;
|
|
15
|
-
placeholder
|
|
15
|
+
placeholder?: string;
|
|
16
16
|
onSelect: () => void;
|
|
17
17
|
onLabelClick: () => void;
|
|
18
18
|
onViewDateUpdate: (date: { year?: number; month?: number }) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PureComponent } from 'react';
|
|
2
2
|
import { injectIntl, WrappedComponentProps } from 'react-intl';
|
|
3
3
|
|
|
4
|
-
import messages from '../
|
|
4
|
+
import messages from '../Calendar.messages';
|
|
5
5
|
import DateHeader from '../dateHeader';
|
|
6
6
|
|
|
7
7
|
import YearCalendarTable from './table';
|
|
@@ -11,7 +11,7 @@ interface YearCalendarProps extends WrappedComponentProps {
|
|
|
11
11
|
min: Date | null;
|
|
12
12
|
max: Date | null;
|
|
13
13
|
viewYear: number;
|
|
14
|
-
placeholder
|
|
14
|
+
placeholder?: string;
|
|
15
15
|
onSelect: () => void;
|
|
16
16
|
onViewDateUpdate: (date: { year: number }) => void;
|
|
17
17
|
}
|
|
@@ -9,7 +9,7 @@ import { Label } from '../label/Label';
|
|
|
9
9
|
/**
|
|
10
10
|
* Use <a href="?path=/docs/forms-checkbox--docs">Checkbox</a> component instead when pairing with a label. Only use CheckboxButton when you need a standalone checkbox (e.g. settings matrix) and provide an `aria-label`.
|
|
11
11
|
*
|
|
12
|
-
* **Design guidance**: <a href="https://wise.design/components/checkbox" target="_blank">wise.design/components/checkbox</a>
|
|
12
|
+
* **Design guidance**: <a href="https://docs.wise.design/components/checkbox" target="_blank">wise.design/components/checkbox</a>
|
|
13
13
|
*/
|
|
14
14
|
export default {
|
|
15
15
|
component: CheckboxButton,
|
|
@@ -20,7 +20,7 @@ export type CheckboxOptionProps = Omit<BaseOptionProps, 'onChange'> & {
|
|
|
20
20
|
* @deprecatedSince 46.104.0
|
|
21
21
|
* @see [Source](../listItem/ListItem.tsx)
|
|
22
22
|
* @see [Storybook](https://storybook.wise.design/?path=/docs/content-listitem--docs)
|
|
23
|
-
* @see [Design docs](https://wise.design/components/list-item)
|
|
23
|
+
* @see [Design docs](https://docs.wise.design/components/list-item)
|
|
24
24
|
* @see [Release notes](https://transferwise.atlassian.net/wiki/spaces/DS/pages/3647251055/List+Item+release+notes)
|
|
25
25
|
*/
|
|
26
26
|
const CheckboxOption = forwardRef<ReferenceType, CheckboxOptionProps>(
|
|
@@ -8,7 +8,7 @@ import { storySourceWithoutNoise } from '../../.storybook/helpers';
|
|
|
8
8
|
/**
|
|
9
9
|
* Can be used for making a <a href="?path=/story/actions-chips--choice">choice</a>, or as a <a href="?path=/story/actions-chips--filter">filter</a> with multiple options.
|
|
10
10
|
*
|
|
11
|
-
* **Design guidance**: <a href="https://wise.design/components/chip" target="_blank">wise.design/components/chip</a>
|
|
11
|
+
* **Design guidance**: <a href="https://docs.wise.design/components/chip" target="_blank">wise.design/components/chip</a>
|
|
12
12
|
*/
|
|
13
13
|
export default {
|
|
14
14
|
component: Chips,
|
|
@@ -93,7 +93,7 @@ export const Playground: Story = storySourceWithoutNoise<typeof Chips>({
|
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
95
|
* The user can select any number of chips with the selected prop as an array (`multiple` prop set to `true`). <br />
|
|
96
|
-
* <a href="https://wise.design/components/chip#filter-chips" target="_blank">Design documentation</a>
|
|
96
|
+
* <a href="https://docs.wise.design/components/chip#filter-chips" target="_blank">Design documentation</a>
|
|
97
97
|
*/
|
|
98
98
|
export const Filter: Story = storySourceWithoutNoise<typeof Chips>({
|
|
99
99
|
args: {
|
|
@@ -124,7 +124,7 @@ export const Filter: Story = storySourceWithoutNoise<typeof Chips>({
|
|
|
124
124
|
|
|
125
125
|
/**
|
|
126
126
|
* The user can only select one chip with the selected prop as a single value (`multiple` prop set to `false`). <br />
|
|
127
|
-
* <a href="https://wise.design/components/chip#choice-chips" target="_blank">Design documentation</a>
|
|
127
|
+
* <a href="https://docs.wise.design/components/chip#choice-chips" target="_blank">Design documentation</a>
|
|
128
128
|
*/
|
|
129
129
|
export const Choice: Story = storySourceWithoutNoise<typeof Chips>({
|
|
130
130
|
args: {
|
|
@@ -9,7 +9,7 @@ import SentimentSurface from '../sentimentSurface';
|
|
|
9
9
|
/**
|
|
10
10
|
* An <a href="?path=/docs/actions-iconbutton--docs">IconButton</a> with a text label below it.
|
|
11
11
|
*
|
|
12
|
-
* **Design guidance**: <a href="https://wise.design/components/circular-button" target="_blank">wise.design/components/circular-button</a>
|
|
12
|
+
* **Design guidance**: <a href="https://docs.wise.design/components/circular-button" target="_blank">wise.design/components/circular-button</a>
|
|
13
13
|
*/
|
|
14
14
|
export default {
|
|
15
15
|
component: CircularButton,
|
|
@@ -45,7 +45,7 @@ export const Playground: Story = {};
|
|
|
45
45
|
/**
|
|
46
46
|
* Priorities set a visual hierarchy amongst the buttons displayed on the
|
|
47
47
|
* screen to help more important buttons to take precedence over others. <br />
|
|
48
|
-
* [Design documentation](https://wise.design/components/circular-button#priority)
|
|
48
|
+
* [Design documentation](https://docs.wise.design/components/circular-button#priority)
|
|
49
49
|
*/
|
|
50
50
|
export const Priority: Story = {
|
|
51
51
|
args: {
|
|
@@ -83,7 +83,7 @@ export const Priority: Story = {
|
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* There are two different types of button – default and negative – designed to emphasise the nature of the action. <br />
|
|
86
|
-
* [Design documentation](https://wise.design/components/circular-button#types)
|
|
86
|
+
* [Design documentation](https://docs.wise.design/components/circular-button#types)
|
|
87
87
|
*/
|
|
88
88
|
export const Type: Story = {
|
|
89
89
|
args: {
|
|
@@ -163,7 +163,7 @@ export const Disabled: Story = {
|
|
|
163
163
|
/**
|
|
164
164
|
* `CircularButton` is sentiment-aware and will automatically adjust its colours if wrapped inside
|
|
165
165
|
* the <a href="?path=/docs/foundations-sentimentsurface--docs">SentimentSurface</a> component. <br />
|
|
166
|
-
* [Design documentation](https://wise.design/components/circular-button)
|
|
166
|
+
* [Design documentation](https://docs.wise.design/components/circular-button)
|
|
167
167
|
*/
|
|
168
168
|
export const SentimentAwareness: Story = {
|
|
169
169
|
render: () => {
|
|
@@ -17,7 +17,7 @@ export type ContainerProps<T extends ElementType = 'div'> = PropsWithChildren<
|
|
|
17
17
|
/**
|
|
18
18
|
* Centers page content within a responsive max-width boundary, with automatic horizontal padding that adapts to the viewport size.
|
|
19
19
|
*
|
|
20
|
-
* **Design guidance**: <a href="https://wise.design/foundations/grid" target="_blank">wise.design/foundations/grid</a>
|
|
20
|
+
* **Design guidance**: <a href="https://docs.wise.design/foundations/grid" target="_blank">wise.design/foundations/grid</a>
|
|
21
21
|
*/
|
|
22
22
|
const Container = <T extends ElementType = 'div'>({
|
|
23
23
|
size = 'standard',
|
|
@@ -1,93 +1,3 @@
|
|
|
1
1
|
.tw-date-lookup-menu {
|
|
2
2
|
width: 400px;
|
|
3
3
|
}
|
|
4
|
-
.tw-date-lookup-calendar {
|
|
5
|
-
min-width: 300px;
|
|
6
|
-
text-align: center;
|
|
7
|
-
table-layout: fixed;
|
|
8
|
-
background-color: inherit;
|
|
9
|
-
}
|
|
10
|
-
.tw-date-lookup-calendar > tbody > tr > td.weekend button {
|
|
11
|
-
color: #5d7079;
|
|
12
|
-
color: var(--color-content-secondary);
|
|
13
|
-
}
|
|
14
|
-
.tw-date-lookup-calendar > tbody > tr > td {
|
|
15
|
-
padding: 4px;
|
|
16
|
-
padding: var(--size-4);
|
|
17
|
-
}
|
|
18
|
-
@media (max-width: 320px) {
|
|
19
|
-
.tw-date-lookup-calendar > tbody > tr > td {
|
|
20
|
-
padding: 0;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
.tw-date-lookup-calendar > tbody > tr > td:has(.tw-date-lookup-day-option) {
|
|
24
|
-
padding: 1px;
|
|
25
|
-
}
|
|
26
|
-
.tw-date-lookup-calendar > tbody > tr > td button {
|
|
27
|
-
width: 100%;
|
|
28
|
-
padding: 4px 0;
|
|
29
|
-
padding: var(--size-4) 0;
|
|
30
|
-
color: #0097c7;
|
|
31
|
-
color: var(--color-content-accent);
|
|
32
|
-
border: transparent;
|
|
33
|
-
border-radius: 10px;
|
|
34
|
-
border-radius: var(--radius-small);
|
|
35
|
-
background-color: transparent;
|
|
36
|
-
font-weight: 600;
|
|
37
|
-
font-weight: var(--font-weight-semi-bold);
|
|
38
|
-
color: #37517e;
|
|
39
|
-
color: var(--color-content-primary);
|
|
40
|
-
}
|
|
41
|
-
@media (max-width: 320px) {
|
|
42
|
-
.tw-date-lookup-calendar > tbody > tr > td button {
|
|
43
|
-
padding: 0;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
.tw-date-lookup-calendar > tbody > tr > td button.tw-date-lookup-day-option {
|
|
47
|
-
height: 40px;
|
|
48
|
-
height: var(--size-40);
|
|
49
|
-
border-radius: 9999px;
|
|
50
|
-
border-radius: var(--radius-full);
|
|
51
|
-
line-height: 40px;
|
|
52
|
-
line-height: var(--size-40);
|
|
53
|
-
width: 40px;
|
|
54
|
-
width: var(--size-40);
|
|
55
|
-
padding: 0;
|
|
56
|
-
display: inline-flex;
|
|
57
|
-
align-items: center;
|
|
58
|
-
justify-content: center;
|
|
59
|
-
}
|
|
60
|
-
.tw-date-lookup-calendar > tbody > tr > td button.tw-date-lookup-day-option.today {
|
|
61
|
-
-webkit-text-decoration: underline;
|
|
62
|
-
text-decoration: underline;
|
|
63
|
-
text-decoration-thickness: 2px;
|
|
64
|
-
text-underline-offset: 4px;
|
|
65
|
-
}
|
|
66
|
-
.tw-date-lookup-calendar > tbody > tr > td:not(.disabled):not(:disabled) button.show-focus,
|
|
67
|
-
.tw-date-lookup-calendar > tbody > tr > td:hover button:not(.disabled):not(:disabled) {
|
|
68
|
-
background-color: var(--color-background-screen-hover);
|
|
69
|
-
}
|
|
70
|
-
.tw-date-lookup-calendar > tbody > tr > td:not(.disabled):not(:disabled) button.active {
|
|
71
|
-
background-color: var(--color-interactive-primary);
|
|
72
|
-
color: var(--color-interactive-contrast);
|
|
73
|
-
}
|
|
74
|
-
.tw-date-lookup-calendar abbr {
|
|
75
|
-
-webkit-text-decoration: none;
|
|
76
|
-
text-decoration: none;
|
|
77
|
-
}
|
|
78
|
-
.tw-date-lookup-header-current-container {
|
|
79
|
-
display: inline;
|
|
80
|
-
}
|
|
81
|
-
.np-theme-personal.tw-date-lookup-menu .table-bordered,
|
|
82
|
-
.np-theme-personal .tw-date-lookup-menu .table-bordered {
|
|
83
|
-
border: none;
|
|
84
|
-
}
|
|
85
|
-
.np-theme-personal.tw-date-lookup-menu thead,
|
|
86
|
-
.np-theme-personal .tw-date-lookup-menu thead {
|
|
87
|
-
background-color: transparent;
|
|
88
|
-
background-color: initial;
|
|
89
|
-
}
|
|
90
|
-
.np-theme-personal.tw-date-lookup-menu td,
|
|
91
|
-
.np-theme-personal .tw-date-lookup-menu td {
|
|
92
|
-
border: none;
|
|
93
|
-
}
|
|
@@ -1,94 +1,3 @@
|
|
|
1
|
-
@import (reference) "./../styles/variables/neptune-tokens.less";
|
|
2
|
-
|
|
3
1
|
.tw-date-lookup-menu {
|
|
4
2
|
width: 400px;
|
|
5
3
|
}
|
|
6
|
-
|
|
7
|
-
.tw-date-lookup-calendar {
|
|
8
|
-
min-width: 300px;
|
|
9
|
-
text-align: center;
|
|
10
|
-
table-layout: fixed;
|
|
11
|
-
|
|
12
|
-
> tbody > tr > td.weekend button {
|
|
13
|
-
color: var(--color-content-secondary);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
> tbody > tr > td {
|
|
17
|
-
padding: var(--size-4);
|
|
18
|
-
@media (--screen-400-zoom) {
|
|
19
|
-
padding: 0;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
&:has(.tw-date-lookup-day-option) {
|
|
23
|
-
padding: 1px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
button {
|
|
27
|
-
width: 100%;
|
|
28
|
-
padding: var(--size-4) 0;
|
|
29
|
-
@media (--screen-400-zoom) {
|
|
30
|
-
padding: 0;
|
|
31
|
-
}
|
|
32
|
-
color: var(--color-content-accent);
|
|
33
|
-
border: transparent;
|
|
34
|
-
border-radius: var(--radius-small);
|
|
35
|
-
background-color: transparent;
|
|
36
|
-
font-weight: var(--font-weight-semi-bold);
|
|
37
|
-
color: var(--color-content-primary);
|
|
38
|
-
|
|
39
|
-
&.tw-date-lookup-day-option {
|
|
40
|
-
height: var(--size-40);
|
|
41
|
-
border-radius: var(--radius-full);
|
|
42
|
-
line-height: var(--size-40);
|
|
43
|
-
width: var(--size-40);
|
|
44
|
-
padding: 0;
|
|
45
|
-
display: inline-flex;
|
|
46
|
-
align-items: center;
|
|
47
|
-
justify-content: center;
|
|
48
|
-
|
|
49
|
-
&.today {
|
|
50
|
-
text-decoration: underline;
|
|
51
|
-
text-decoration-thickness: 2px;
|
|
52
|
-
text-underline-offset: 4px;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&:not(.disabled, :disabled) button.show-focus,
|
|
58
|
-
&:hover button:not(.disabled, :disabled) {
|
|
59
|
-
background-color: var(--color-background-screen-hover);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&:not(.disabled, :disabled) button.active {
|
|
63
|
-
background-color: var(--color-interactive-primary);
|
|
64
|
-
color: var(--color-interactive-contrast);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
abbr {
|
|
69
|
-
text-decoration: none;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
background-color: inherit;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.tw-date-lookup-header-current-container {
|
|
76
|
-
display: inline;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.np-theme-personal {
|
|
80
|
-
&.tw-date-lookup-menu,
|
|
81
|
-
.tw-date-lookup-menu {
|
|
82
|
-
.table-bordered {
|
|
83
|
-
border: none;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
thead {
|
|
87
|
-
background-color: unset;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
td {
|
|
91
|
-
border: none;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
@@ -198,28 +198,6 @@ describe('DateLookup', () => {
|
|
|
198
198
|
expect(handleChange).toHaveBeenCalledWith(initialValue);
|
|
199
199
|
});
|
|
200
200
|
});
|
|
201
|
-
|
|
202
|
-
it('limits min value', async () => {
|
|
203
|
-
const min = new Date(initialValue);
|
|
204
|
-
min.setDate(min.getDate() - 1);
|
|
205
|
-
const handleChange = jest.fn();
|
|
206
|
-
await setupAndOpenWithMouse({ min, onChange: handleChange });
|
|
207
|
-
|
|
208
|
-
await user.keyboard('{ArrowLeft}{ArrowLeft}');
|
|
209
|
-
|
|
210
|
-
expect(handleChange).toHaveBeenCalledWith(min);
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
it('limits max value', async () => {
|
|
214
|
-
const max = new Date(initialValue);
|
|
215
|
-
max.setDate(max.getDate() + 1);
|
|
216
|
-
const handleChange = jest.fn();
|
|
217
|
-
await setupAndOpenWithMouse({ max, onChange: handleChange });
|
|
218
|
-
|
|
219
|
-
await user.keyboard('{ArrowRight}{ArrowRight}');
|
|
220
|
-
|
|
221
|
-
expect(handleChange).toHaveBeenCalledWith(max);
|
|
222
|
-
});
|
|
223
201
|
});
|
|
224
202
|
|
|
225
203
|
describe('DateLookup propTypes', () => {
|
|
@@ -296,75 +274,6 @@ describe('DateLookup (events)', () => {
|
|
|
296
274
|
);
|
|
297
275
|
};
|
|
298
276
|
|
|
299
|
-
it('switches to years', async () => {
|
|
300
|
-
const view = await setup();
|
|
301
|
-
await openDateLookup();
|
|
302
|
-
await clickDateButton();
|
|
303
|
-
|
|
304
|
-
expect(getActiveYearButton(view)).toHaveFocus();
|
|
305
|
-
|
|
306
|
-
await closeDateLookup(view);
|
|
307
|
-
});
|
|
308
|
-
|
|
309
|
-
it('has aria-label for 20 years', async () => {
|
|
310
|
-
const view = await setup();
|
|
311
|
-
await openDateLookup();
|
|
312
|
-
await clickDateButton();
|
|
313
|
-
|
|
314
|
-
expect(getButtonByAriaLabel('next 20 years')).toBeInTheDocument();
|
|
315
|
-
expect(getButtonByAriaLabel('previous 20 years')).toBeInTheDocument();
|
|
316
|
-
|
|
317
|
-
await closeDateLookup(view);
|
|
318
|
-
});
|
|
319
|
-
|
|
320
|
-
it('switches to months', async () => {
|
|
321
|
-
const view = await setup();
|
|
322
|
-
await openDateLookup();
|
|
323
|
-
await clickDateButton();
|
|
324
|
-
await userEvent.click(getActiveYearButton(view));
|
|
325
|
-
|
|
326
|
-
expect(getActiveMonthButton(view)).toHaveFocus();
|
|
327
|
-
|
|
328
|
-
await closeDateLookup(view);
|
|
329
|
-
});
|
|
330
|
-
|
|
331
|
-
it('has aria label for year', async () => {
|
|
332
|
-
const view = await setup();
|
|
333
|
-
await openDateLookup();
|
|
334
|
-
await clickDateButton();
|
|
335
|
-
await userEvent.click(getActiveYearButton(view));
|
|
336
|
-
|
|
337
|
-
expect(getButtonByAriaLabel('next year')).toBeInTheDocument();
|
|
338
|
-
expect(getButtonByAriaLabel('previous year')).toBeInTheDocument();
|
|
339
|
-
|
|
340
|
-
await closeDateLookup(view);
|
|
341
|
-
});
|
|
342
|
-
|
|
343
|
-
it('switches to days', async () => {
|
|
344
|
-
const view = await setup();
|
|
345
|
-
await openDateLookup();
|
|
346
|
-
await clickDateButton();
|
|
347
|
-
await userEvent.click(getActiveYearButton(view));
|
|
348
|
-
await userEvent.click(getActiveMonthButton(view));
|
|
349
|
-
|
|
350
|
-
expect(getActiveDayButton(view)).toHaveFocus();
|
|
351
|
-
|
|
352
|
-
await closeDateLookup(view);
|
|
353
|
-
});
|
|
354
|
-
|
|
355
|
-
it('has aria label for month', async () => {
|
|
356
|
-
const view = await setup();
|
|
357
|
-
await openDateLookup();
|
|
358
|
-
await clickDateButton();
|
|
359
|
-
await userEvent.click(getActiveYearButton(view));
|
|
360
|
-
await userEvent.click(getActiveMonthButton(view));
|
|
361
|
-
|
|
362
|
-
expect(getButtonByAriaLabel('next month')).toBeInTheDocument();
|
|
363
|
-
expect(getButtonByAriaLabel('previous month')).toBeInTheDocument();
|
|
364
|
-
|
|
365
|
-
await closeDateLookup(view);
|
|
366
|
-
});
|
|
367
|
-
|
|
368
277
|
it('has aria label on selected date', async () => {
|
|
369
278
|
const view = await setup();
|
|
370
279
|
await openDateLookup();
|
|
@@ -440,44 +349,11 @@ describe('DateLookup (events)', () => {
|
|
|
440
349
|
});
|
|
441
350
|
};
|
|
442
351
|
|
|
443
|
-
const getDateButton = () => {
|
|
444
|
-
return screen.getByRole('button', {
|
|
445
|
-
name: /Go to 20 year view/i,
|
|
446
|
-
});
|
|
447
|
-
};
|
|
448
|
-
|
|
449
352
|
const openDateLookup = async () => userEvent.click(getOpenButton(labelProp));
|
|
450
353
|
|
|
451
|
-
const clickDateButton = async () => userEvent.click(getDateButton());
|
|
452
|
-
|
|
453
354
|
// Close dateLookup and removes events attached to documents.
|
|
454
355
|
const closeDateLookup = async (view: RenderResult) => userEvent.click(view.container);
|
|
455
356
|
|
|
456
357
|
// @ts-expect-error getClearButton returns node
|
|
457
358
|
const clickClearButton = async (view: RenderResult) => userEvent.click(getClearButton(view));
|
|
458
|
-
|
|
459
|
-
const getActiveYearButton = (view: RenderResult) => {
|
|
460
|
-
return screen.getByRole('button', {
|
|
461
|
-
name: /selected year/i,
|
|
462
|
-
pressed: true,
|
|
463
|
-
});
|
|
464
|
-
};
|
|
465
|
-
|
|
466
|
-
const getActiveMonthButton = (view: RenderResult) => {
|
|
467
|
-
return screen.getByRole('button', {
|
|
468
|
-
name: /selected month/i,
|
|
469
|
-
pressed: true,
|
|
470
|
-
});
|
|
471
|
-
};
|
|
472
|
-
|
|
473
|
-
const getActiveDayButton = (view: RenderResult) => {
|
|
474
|
-
return screen.getByRole('button', {
|
|
475
|
-
name: /selected day/i,
|
|
476
|
-
pressed: true,
|
|
477
|
-
});
|
|
478
|
-
};
|
|
479
|
-
|
|
480
|
-
const getButtonByAriaLabel = (ariaLabel: string) => {
|
|
481
|
-
return screen.getByRole('button', { name: ariaLabel });
|
|
482
|
-
};
|
|
483
359
|
});
|