@pega/cosmos-react-core 3.0.0-dev.8.0 → 3.0.0-rc.1
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/lib/components/Actions/Actions.d.ts +5 -0
- package/lib/components/Actions/Actions.d.ts.map +1 -1
- package/lib/components/Actions/Actions.js +2 -2
- package/lib/components/Actions/Actions.js.map +1 -1
- package/lib/components/AdditionalInfo/AdditionalInfo.d.ts +11 -0
- package/lib/components/AdditionalInfo/AdditionalInfo.d.ts.map +1 -0
- package/lib/components/AdditionalInfo/AdditionalInfo.js +25 -0
- package/lib/components/AdditionalInfo/AdditionalInfo.js.map +1 -0
- package/lib/components/AdditionalInfo/index.d.ts +2 -0
- package/lib/components/AdditionalInfo/index.d.ts.map +1 -0
- package/lib/components/AdditionalInfo/index.js +2 -0
- package/lib/components/AdditionalInfo/index.js.map +1 -0
- package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.js +16 -8
- package/lib/components/AppShell/AppHeader.js.map +1 -1
- package/lib/components/AppShell/AppHeader.styles.d.ts +16 -0
- package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -0
- package/lib/components/AppShell/AppHeader.styles.js +155 -0
- package/lib/components/AppShell/AppHeader.styles.js.map +1 -0
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js +88 -217
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts +7 -48
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +48 -527
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.types.d.ts +27 -21
- package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.types.js.map +1 -1
- package/lib/components/AppShell/AppShellContext.d.ts +12 -6
- package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellContext.js +10 -5
- package/lib/components/AppShell/AppShellContext.js.map +1 -1
- package/lib/components/AppShell/AppShellList.d.ts +2 -2
- package/lib/components/AppShell/AppShellList.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellList.js +3 -1
- package/lib/components/AppShell/AppShellList.js.map +1 -1
- package/lib/components/AppShell/AppShellList.styles.d.ts +19 -0
- package/lib/components/AppShell/AppShellList.styles.d.ts.map +1 -0
- package/lib/components/AppShell/AppShellList.styles.js +141 -0
- package/lib/components/AppShell/AppShellList.styles.js.map +1 -0
- package/lib/components/AppShell/AppShellSearch.d.ts +9 -0
- package/lib/components/AppShell/AppShellSearch.d.ts.map +1 -0
- package/lib/components/AppShell/AppShellSearch.js +39 -0
- package/lib/components/AppShell/AppShellSearch.js.map +1 -0
- package/lib/components/AppShell/AppShellSearch.styles.d.ts +8 -0
- package/lib/components/AppShell/AppShellSearch.styles.d.ts.map +1 -0
- package/lib/components/AppShell/AppShellSearch.styles.js +193 -0
- package/lib/components/AppShell/AppShellSearch.styles.js.map +1 -0
- package/lib/components/AppShell/Drawer.d.ts +3 -1
- package/lib/components/AppShell/Drawer.d.ts.map +1 -1
- package/lib/components/AppShell/Drawer.js +14 -11
- package/lib/components/AppShell/Drawer.js.map +1 -1
- package/lib/components/AppShell/Drawer.styles.d.ts +15 -0
- package/lib/components/AppShell/Drawer.styles.d.ts.map +1 -0
- package/lib/components/AppShell/Drawer.styles.js +153 -0
- package/lib/components/AppShell/Drawer.styles.js.map +1 -0
- package/lib/components/AppShell/NavigationList.d.ts +6 -0
- package/lib/components/AppShell/NavigationList.d.ts.map +1 -0
- package/lib/components/AppShell/NavigationList.js +121 -0
- package/lib/components/AppShell/NavigationList.js.map +1 -0
- package/lib/components/AppShell/NavigationListItemWrapper.d.ts +5 -0
- package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -0
- package/lib/components/AppShell/NavigationListItemWrapper.js +157 -0
- package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -0
- package/lib/components/AppShell/Operator.js +4 -4
- package/lib/components/AppShell/Operator.js.map +1 -1
- package/lib/components/AppShell/index.d.ts +2 -3
- package/lib/components/AppShell/index.d.ts.map +1 -1
- package/lib/components/AppShell/index.js +1 -2
- package/lib/components/AppShell/index.js.map +1 -1
- package/lib/components/Avatar/Avatar.d.ts.map +1 -1
- package/lib/components/Avatar/Avatar.js +4 -4
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/Badges/Count.d.ts.map +1 -1
- package/lib/components/Badges/Count.js +37 -1
- package/lib/components/Badges/Count.js.map +1 -1
- package/lib/components/Badges/Keyboard.d.ts +9 -0
- package/lib/components/Badges/Keyboard.d.ts.map +1 -0
- package/lib/components/Badges/Keyboard.js +56 -0
- package/lib/components/Badges/Keyboard.js.map +1 -0
- package/lib/components/Badges/Selection.d.ts +1 -1
- package/lib/components/Badges/Selection.d.ts.map +1 -1
- package/lib/components/Badges/Selection.js +4 -2
- package/lib/components/Badges/Selection.js.map +1 -1
- package/lib/components/Badges/index.d.ts +2 -0
- package/lib/components/Badges/index.d.ts.map +1 -1
- package/lib/components/Badges/index.js +1 -0
- package/lib/components/Badges/index.js.map +1 -1
- package/lib/components/Banner/Banner.d.ts.map +1 -1
- package/lib/components/Banner/Banner.js +8 -2
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Boolean/BooleanDisplay.d.ts.map +1 -1
- package/lib/components/Boolean/BooleanDisplay.js +4 -12
- package/lib/components/Boolean/BooleanDisplay.js.map +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +2 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.js +44 -13
- package/lib/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/lib/components/Button/BareRoleButton.d.ts.map +1 -1
- package/lib/components/Button/BareRoleButton.js +3 -1
- package/lib/components/Button/BareRoleButton.js.map +1 -1
- package/lib/components/Checkbox/Checkbox.d.ts +3 -1
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.d.ts +2 -0
- package/lib/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.js +1 -1
- package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.js +68 -13
- package/lib/components/ComboBox/ComboBox.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.styles.d.ts +3 -1
- package/lib/components/ComboBox/ComboBox.styles.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.types.d.ts +11 -1
- package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
- package/lib/components/ComboBox/ComboBoxInput.d.ts +7 -0
- package/lib/components/ComboBox/ComboBoxInput.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBoxInput.js +5 -2
- package/lib/components/ComboBox/ComboBoxInput.js.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +116 -31
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.d.ts +10 -0
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.d.ts.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.js.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js +2 -2
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.d.ts +2 -0
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.d.ts.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.js.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.d.ts +5 -0
- package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -0
- package/lib/components/CompositeInput/CompositeInput.js +62 -0
- package/lib/components/CompositeInput/CompositeInput.js.map +1 -0
- package/lib/components/CompositeInput/CompositeInput.styles.d.ts +5 -0
- package/lib/components/CompositeInput/CompositeInput.styles.d.ts.map +1 -0
- package/lib/components/CompositeInput/CompositeInput.styles.js +57 -0
- package/lib/components/CompositeInput/CompositeInput.styles.js.map +1 -0
- package/lib/components/CompositeInput/CompositeInput.types.d.ts +52 -0
- package/lib/components/CompositeInput/CompositeInput.types.d.ts.map +1 -0
- package/lib/components/CompositeInput/CompositeInput.types.js +2 -0
- package/lib/components/CompositeInput/CompositeInput.types.js.map +1 -0
- package/lib/components/CompositeInput/index.d.ts +3 -0
- package/lib/components/CompositeInput/index.d.ts.map +1 -0
- package/lib/components/CompositeInput/index.js +2 -0
- package/lib/components/CompositeInput/index.js.map +1 -0
- package/lib/components/Configuration/Configuration.d.ts +14 -13
- package/lib/components/Configuration/Configuration.d.ts.map +1 -1
- package/lib/components/Configuration/Configuration.js +25 -14
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/Configuration/index.d.ts +0 -1
- package/lib/components/Configuration/index.d.ts.map +1 -1
- package/lib/components/Configuration/index.js +0 -1
- package/lib/components/Configuration/index.js.map +1 -1
- package/lib/components/CreditCard/CreditCard.types.d.ts +45 -0
- package/lib/components/CreditCard/CreditCard.types.d.ts.map +1 -1
- package/lib/components/CreditCard/CreditCard.types.js.map +1 -1
- package/lib/components/CreditCard/CreditCardInput.d.ts +6 -0
- package/lib/components/CreditCard/CreditCardInput.d.ts.map +1 -0
- package/lib/components/CreditCard/CreditCardInput.js +39 -0
- package/lib/components/CreditCard/CreditCardInput.js.map +1 -0
- package/lib/components/CreditCard/index.d.ts +3 -1
- package/lib/components/CreditCard/index.d.ts.map +1 -1
- package/lib/components/CreditCard/index.js +2 -0
- package/lib/components/CreditCard/index.js.map +1 -1
- package/lib/components/CreditCard/utils.d.ts +11 -0
- package/lib/components/CreditCard/utils.d.ts.map +1 -1
- package/lib/components/CreditCard/utils.js +20 -2
- package/lib/components/CreditCard/utils.js.map +1 -1
- package/lib/components/Currency/CurrencyDisplay.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyDisplay.js +2 -2
- package/lib/components/Currency/CurrencyDisplay.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.js +92 -25
- package/lib/components/Currency/CurrencyInput.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.d.ts +9 -1
- package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
- package/lib/components/Currency/utils.d.ts +7 -17
- package/lib/components/Currency/utils.d.ts.map +1 -1
- package/lib/components/Currency/utils.js +50 -51
- package/lib/components/Currency/utils.js.map +1 -1
- package/lib/components/DateTime/DateTime.types.d.ts +15 -9
- package/lib/components/DateTime/DateTime.types.d.ts.map +1 -1
- package/lib/components/DateTime/DateTime.types.js.map +1 -1
- package/lib/components/DateTime/DurationDisplay.js +3 -3
- package/lib/components/DateTime/DurationDisplay.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts +9 -2
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +27 -15
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.d.ts +18 -23
- package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.js +98 -83
- package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.js +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts +3 -0
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +28 -12
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +2 -0
- package/lib/components/DateTime/Input/DayOfWeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DayOfWeekInput.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.js +10 -2
- package/lib/components/DateTime/Input/Duration/DurationInput.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.types.d.ts +2 -0
- package/lib/components/DateTime/Input/Duration/DurationInput.types.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.types.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/NumberUnit.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/NumberUnit.js +30 -33
- package/lib/components/DateTime/Input/Duration/NumberUnit.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/Time.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/Time.js +5 -4
- package/lib/components/DateTime/Input/Duration/Time.js.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.d.ts +3 -0
- package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.js +23 -26
- package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
- package/lib/components/DateTime/Input/QuarterInput.d.ts +3 -0
- package/lib/components/DateTime/Input/QuarterInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/QuarterInput.js +24 -25
- package/lib/components/DateTime/Input/QuarterInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.d.ts +3 -0
- package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.js +21 -9
- package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts +46 -0
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts.map +1 -0
- package/lib/components/DateTime/Input/TimeRangeInput.js +74 -0
- package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -0
- package/lib/components/DateTime/Input/WeekInput.d.ts +3 -2
- package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.js +12 -7
- package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
- package/lib/components/DateTime/Input/usePickerButton.d.ts +1 -1
- package/lib/components/DateTime/Input/usePickerButton.d.ts.map +1 -1
- package/lib/components/DateTime/Input/utils.d.ts +6 -6
- package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Input/utils.js +2 -1
- package/lib/components/DateTime/Input/utils.js.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.js +20 -16
- package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.styles.d.ts +2 -4
- package/lib/components/DateTime/Picker/Calendar.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.styles.js +13 -55
- package/lib/components/DateTime/Picker/Calendar.styles.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.js +2 -1
- package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.styles.d.ts +3 -0
- package/lib/components/DateTime/Picker/DatePicker.styles.d.ts.map +1 -0
- package/lib/components/DateTime/Picker/DatePicker.styles.js +39 -0
- package/lib/components/DateTime/Picker/DatePicker.styles.js.map +1 -0
- package/lib/components/DateTime/Picker/DateRangePicker.js +1 -1
- package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.d.ts +1 -1
- package/lib/components/DateTime/Picker/TimePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.js +10 -5
- package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/Weeks.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Weeks.js +14 -6
- package/lib/components/DateTime/Picker/Weeks.js.map +1 -1
- package/lib/components/DateTime/Picker/utils.d.ts +1 -1
- package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
- package/lib/components/DateTime/index.d.ts +4 -0
- package/lib/components/DateTime/index.d.ts.map +1 -1
- package/lib/components/DateTime/index.js +3 -0
- package/lib/components/DateTime/index.js.map +1 -1
- package/lib/components/DateTime/utils.d.ts +2 -2
- package/lib/components/DateTime/utils.d.ts.map +1 -1
- package/lib/components/DateTime/utils.js +18 -4
- package/lib/components/DateTime/utils.js.map +1 -1
- package/lib/components/Dialog/Dialog.d.ts +32 -0
- package/lib/components/Dialog/Dialog.d.ts.map +1 -0
- package/lib/components/Dialog/Dialog.js +149 -0
- package/lib/components/Dialog/Dialog.js.map +1 -0
- package/lib/components/Dialog/index.d.ts +3 -0
- package/lib/components/Dialog/index.d.ts.map +1 -0
- package/lib/components/Dialog/index.js +3 -0
- package/lib/components/Dialog/index.js.map +1 -0
- package/lib/components/FieldGroup/FieldGroup.d.ts +7 -0
- package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.js +45 -41
- package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.js +6 -2
- package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.d.ts +13 -7
- package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.js +41 -13
- package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/FieldValueList/index.d.ts +3 -5
- package/lib/components/FieldValueList/index.d.ts.map +1 -1
- package/lib/components/FieldValueList/index.js +2 -4
- package/lib/components/FieldValueList/index.js.map +1 -1
- package/lib/components/File/utils.d.ts +1 -1
- package/lib/components/File/utils.d.ts.map +1 -1
- package/lib/components/File/utils.js.map +1 -1
- package/lib/components/Flex/Flex.d.ts +11 -10
- package/lib/components/Flex/Flex.d.ts.map +1 -1
- package/lib/components/Flex/Flex.js.map +1 -1
- package/lib/components/Form/Form.d.ts +5 -16
- package/lib/components/Form/Form.d.ts.map +1 -1
- package/lib/components/Form/Form.js +14 -11
- package/lib/components/Form/Form.js.map +1 -1
- package/lib/components/FormControl/FormControl.d.ts +12 -2
- package/lib/components/FormControl/FormControl.d.ts.map +1 -1
- package/lib/components/FormControl/FormControl.js +60 -35
- package/lib/components/FormControl/FormControl.js.map +1 -1
- package/lib/components/FormField/FormField.d.ts +5 -0
- package/lib/components/FormField/FormField.d.ts.map +1 -1
- package/lib/components/FormField/FormField.js +87 -16
- package/lib/components/FormField/FormField.js.map +1 -1
- package/lib/components/Grid/Grid.d.ts +1 -1
- package/lib/components/Grid/Grid.d.ts.map +1 -1
- package/lib/components/Grid/Grid.types.d.ts +11 -10
- package/lib/components/Grid/Grid.types.d.ts.map +1 -1
- package/lib/components/Grid/Grid.types.js.map +1 -1
- package/lib/components/HTML/HTML.d.ts.map +1 -1
- package/lib/components/HTML/HTML.js +61 -17
- package/lib/components/HTML/HTML.js.map +1 -1
- package/lib/components/Icon/Icon.d.ts.map +1 -1
- package/lib/components/Icon/Icon.js +1 -1
- package/lib/components/Icon/Icon.js.map +1 -1
- package/lib/components/Icon/iconNames.d.ts +2 -2
- package/lib/components/Icon/iconNames.d.ts.map +1 -1
- package/lib/components/Icon/iconNames.js +2 -1
- package/lib/components/Icon/iconNames.js.map +1 -1
- package/lib/components/Icon/icons/ai-assist.icon.js +1 -1
- package/lib/components/Icon/icons/ai-assist.icon.js.map +1 -1
- package/lib/components/Icon/icons/align-center.icon.js +1 -1
- package/lib/components/Icon/icons/align-center.icon.js.map +1 -1
- package/lib/components/Icon/icons/align-left.icon.js +1 -1
- package/lib/components/Icon/icons/align-left.icon.js.map +1 -1
- package/lib/components/Icon/icons/align-right.icon.js +1 -1
- package/lib/components/Icon/icons/align-right.icon.js.map +1 -1
- package/lib/components/Icon/icons/arrow-left.icon.js +1 -1
- package/lib/components/Icon/icons/arrow-left.icon.js.map +1 -1
- package/lib/components/Icon/icons/arrow-micro-down.icon.js +1 -1
- package/lib/components/Icon/icons/arrow-micro-down.icon.js.map +1 -1
- package/lib/components/Icon/icons/arrow-micro-left.icon.js +1 -1
- package/lib/components/Icon/icons/arrow-micro-left.icon.js.map +1 -1
- package/lib/components/Icon/icons/arrow-micro-right.icon.js +1 -1
- package/lib/components/Icon/icons/arrow-micro-right.icon.js.map +1 -1
- package/lib/components/Icon/icons/arrow-micro-up-down.icon.js +1 -1
- package/lib/components/Icon/icons/arrow-micro-up-down.icon.js.map +1 -1
- package/lib/components/Icon/icons/arrow-micro-up.icon.js +1 -1
- package/lib/components/Icon/icons/arrow-micro-up.icon.js.map +1 -1
- package/lib/components/Icon/icons/arrow-up-down.icon.js +1 -1
- package/lib/components/Icon/icons/arrow-up-down.icon.js.map +1 -1
- package/lib/components/Icon/icons/bars.icon.js +1 -1
- package/lib/components/Icon/icons/bars.icon.js.map +1 -1
- package/lib/components/Icon/icons/bell-solid.icon.js +1 -1
- package/lib/components/Icon/icons/bell-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/bell.icon.js +1 -1
- package/lib/components/Icon/icons/bell.icon.js.map +1 -1
- package/lib/components/Icon/icons/box-4-solid.icon.js +1 -1
- package/lib/components/Icon/icons/box-4-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/box-4.icon.js +1 -1
- package/lib/components/Icon/icons/box-4.icon.js.map +1 -1
- package/lib/components/Icon/icons/calendar-range.icon.js +1 -1
- package/lib/components/Icon/icons/calendar-range.icon.js.map +1 -1
- package/lib/components/Icon/icons/calendar-solid.icon.js +1 -1
- package/lib/components/Icon/icons/calendar-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/caret-down.icon.js +1 -1
- package/lib/components/Icon/icons/caret-down.icon.js.map +1 -1
- package/lib/components/Icon/icons/caret-left.icon.js +1 -1
- package/lib/components/Icon/icons/caret-left.icon.js.map +1 -1
- package/lib/components/Icon/icons/caret-right.icon.js +1 -1
- package/lib/components/Icon/icons/caret-right.icon.js.map +1 -1
- package/lib/components/Icon/icons/caret-up.icon.js +1 -1
- package/lib/components/Icon/icons/caret-up.icon.js.map +1 -1
- package/lib/components/Icon/icons/{script-solid.icon.d.ts → carrot.icon.d.ts} +2 -2
- package/lib/components/Icon/icons/carrot.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/carrot.icon.js +6 -0
- package/lib/components/Icon/icons/carrot.icon.js.map +1 -0
- package/lib/components/Icon/icons/case-solid.icon.js +1 -1
- package/lib/components/Icon/icons/case-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/case.icon.js +1 -1
- package/lib/components/Icon/icons/case.icon.js.map +1 -1
- package/lib/components/Icon/icons/chain.icon.js +1 -1
- package/lib/components/Icon/icons/chain.icon.js.map +1 -1
- package/lib/components/Icon/icons/chat-solid.icon.js +1 -1
- package/lib/components/Icon/icons/chat-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/chat.icon.js +1 -1
- package/lib/components/Icon/icons/chat.icon.js.map +1 -1
- package/lib/components/Icon/icons/check.icon.js +1 -1
- package/lib/components/Icon/icons/check.icon.js.map +1 -1
- package/lib/components/Icon/icons/clipboard-plus-solid.icon.js +1 -1
- package/lib/components/Icon/icons/clipboard-plus-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/clipboard-plus.icon.js +1 -1
- package/lib/components/Icon/icons/clipboard-plus.icon.js.map +1 -1
- package/lib/components/Icon/icons/clock-solid.icon.js +1 -1
- package/lib/components/Icon/icons/clock-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/clock.icon.js +1 -1
- package/lib/components/Icon/icons/clock.icon.js.map +1 -1
- package/lib/components/Icon/icons/code.icon.js +1 -1
- package/lib/components/Icon/icons/code.icon.js.map +1 -1
- package/lib/components/Icon/icons/dataviz-string-field.icon.d.ts +1 -1
- package/lib/components/Icon/icons/dataviz-string-field.icon.js +2 -2
- package/lib/components/Icon/icons/dataviz-string-field.icon.js.map +1 -1
- package/lib/components/Icon/icons/dock.icon.js +1 -1
- package/lib/components/Icon/icons/dock.icon.js.map +1 -1
- package/lib/components/Icon/icons/dot-9-solid.icon.js +1 -1
- package/lib/components/Icon/icons/dot-9-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/dot-9.icon.js +1 -1
- package/lib/components/Icon/icons/dot-9.icon.js.map +1 -1
- package/lib/components/Icon/icons/download.icon.js +1 -1
- package/lib/components/Icon/icons/download.icon.js.map +1 -1
- package/lib/components/Icon/icons/drag.icon.js +1 -1
- package/lib/components/Icon/icons/drag.icon.js.map +1 -1
- package/lib/components/Icon/icons/eye-off-solid.icon.js +1 -1
- package/lib/components/Icon/icons/eye-off-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/eye-off.icon.js +1 -1
- package/lib/components/Icon/icons/eye-off.icon.js.map +1 -1
- package/lib/components/Icon/icons/face-blank-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/icons/face-blank-solid.icon.js +1 -1
- package/lib/components/Icon/icons/face-blank-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/face-blank.icon.d.ts.map +1 -1
- package/lib/components/Icon/icons/face-blank.icon.js +1 -1
- package/lib/components/Icon/icons/face-blank.icon.js.map +1 -1
- package/lib/components/Icon/icons/face-happy-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/icons/face-happy-solid.icon.js +1 -1
- package/lib/components/Icon/icons/face-happy-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/face-happy.icon.d.ts.map +1 -1
- package/lib/components/Icon/icons/face-happy.icon.js +1 -1
- package/lib/components/Icon/icons/face-happy.icon.js.map +1 -1
- package/lib/components/Icon/icons/face-sad-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/icons/face-sad-solid.icon.js +1 -1
- package/lib/components/Icon/icons/face-sad-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/face-sad.icon.d.ts.map +1 -1
- package/lib/components/Icon/icons/face-sad.icon.js +1 -1
- package/lib/components/Icon/icons/face-sad.icon.js.map +1 -1
- package/lib/components/Icon/icons/fast-forward-solid.icon.js +1 -1
- package/lib/components/Icon/icons/fast-forward-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/filetype-text.icon.d.ts.map +1 -1
- package/lib/components/Icon/icons/filetype-text.icon.js +2 -2
- package/lib/components/Icon/icons/filetype-text.icon.js.map +1 -1
- package/lib/components/Icon/icons/filter-on.icon.js +1 -1
- package/lib/components/Icon/icons/filter-on.icon.js.map +1 -1
- package/lib/components/Icon/icons/filter.icon.js +1 -1
- package/lib/components/Icon/icons/filter.icon.js.map +1 -1
- package/lib/components/Icon/icons/folder-hierarchy-solid.icon.js +1 -1
- package/lib/components/Icon/icons/folder-hierarchy-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/folder-hierarchy.icon.js +1 -1
- package/lib/components/Icon/icons/folder-hierarchy.icon.js.map +1 -1
- package/lib/components/Icon/icons/forward-all-solid.icon.js +1 -1
- package/lib/components/Icon/icons/forward-all-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/forward-all.icon.js +1 -1
- package/lib/components/Icon/icons/forward-all.icon.js.map +1 -1
- package/lib/components/Icon/icons/forward-solid.icon.js +1 -1
- package/lib/components/Icon/icons/forward-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/forward.icon.js +1 -1
- package/lib/components/Icon/icons/forward.icon.js.map +1 -1
- package/lib/components/Icon/icons/galaxy.icon.d.ts.map +1 -1
- package/lib/components/Icon/icons/galaxy.icon.js +2 -2
- package/lib/components/Icon/icons/galaxy.icon.js.map +1 -1
- package/lib/components/Icon/icons/globe-solid.icon.js +1 -1
- package/lib/components/Icon/icons/globe-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/globe.icon.js +1 -1
- package/lib/components/Icon/icons/globe.icon.js.map +1 -1
- package/lib/components/Icon/icons/hand.icon.js +1 -1
- package/lib/components/Icon/icons/hand.icon.js.map +1 -1
- package/lib/components/Icon/icons/help-solid.icon.js +1 -1
- package/lib/components/Icon/icons/help-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/help.icon.js +1 -1
- package/lib/components/Icon/icons/help.icon.js.map +1 -1
- package/lib/components/Icon/icons/home-solid.icon.js +1 -1
- package/lib/components/Icon/icons/home-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/home.icon.js +1 -1
- package/lib/components/Icon/icons/home.icon.js.map +1 -1
- package/lib/components/Icon/icons/information-solid.icon.js +1 -1
- package/lib/components/Icon/icons/information-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/information.icon.js +1 -1
- package/lib/components/Icon/icons/information.icon.js.map +1 -1
- package/lib/components/Icon/icons/list-number.icon.d.ts.map +1 -1
- package/lib/components/Icon/icons/list-number.icon.js +2 -2
- package/lib/components/Icon/icons/list-number.icon.js.map +1 -1
- package/lib/components/Icon/icons/list.icon.d.ts.map +1 -1
- package/lib/components/Icon/icons/list.icon.js +2 -2
- package/lib/components/Icon/icons/list.icon.js.map +1 -1
- package/lib/components/Icon/icons/mail-solid.icon.js +1 -1
- package/lib/components/Icon/icons/mail-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/mail.icon.js +1 -1
- package/lib/components/Icon/icons/mail.icon.js.map +1 -1
- package/lib/components/Icon/icons/minus.icon.js +1 -1
- package/lib/components/Icon/icons/minus.icon.js.map +1 -1
- package/lib/components/Icon/icons/more.icon.js +1 -1
- package/lib/components/Icon/icons/more.icon.js.map +1 -1
- package/lib/components/Icon/icons/move-left-solid.icon.js +1 -1
- package/lib/components/Icon/icons/move-left-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/move-right-solid.icon.js +1 -1
- package/lib/components/Icon/icons/move-right-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/open.icon.js +1 -1
- package/lib/components/Icon/icons/open.icon.js.map +1 -1
- package/lib/components/Icon/icons/paper-clip.icon.js +1 -1
- package/lib/components/Icon/icons/paper-clip.icon.js.map +1 -1
- package/lib/components/Icon/icons/phone-solid.icon.js +1 -1
- package/lib/components/Icon/icons/phone-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/phone.icon.js +1 -1
- package/lib/components/Icon/icons/phone.icon.js.map +1 -1
- package/lib/components/Icon/icons/picture-solid.icon.js +1 -1
- package/lib/components/Icon/icons/picture-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/picture.icon.js +1 -1
- package/lib/components/Icon/icons/picture.icon.js.map +1 -1
- package/lib/components/Icon/icons/placeholder.icon.d.ts +4 -0
- package/lib/components/Icon/icons/placeholder.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/placeholder.icon.js +6 -0
- package/lib/components/Icon/icons/placeholder.icon.js.map +1 -0
- package/lib/components/Icon/icons/plus.icon.js +1 -1
- package/lib/components/Icon/icons/plus.icon.js.map +1 -1
- package/lib/components/Icon/icons/polaris-solid.icon.js +1 -1
- package/lib/components/Icon/icons/polaris-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/polaris.icon.js +1 -1
- package/lib/components/Icon/icons/polaris.icon.js.map +1 -1
- package/lib/components/Icon/icons/qr.icon.js +1 -1
- package/lib/components/Icon/icons/qr.icon.js.map +1 -1
- package/lib/components/Icon/icons/reply-all-solid.icon.js +1 -1
- package/lib/components/Icon/icons/reply-all-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/reply-all.icon.js +1 -1
- package/lib/components/Icon/icons/reply-all.icon.js.map +1 -1
- package/lib/components/Icon/icons/reply-solid.icon.js +1 -1
- package/lib/components/Icon/icons/reply-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/reply.icon.js +1 -1
- package/lib/components/Icon/icons/reply.icon.js.map +1 -1
- package/lib/components/Icon/icons/reset.icon.js +1 -1
- package/lib/components/Icon/icons/reset.icon.js.map +1 -1
- package/lib/components/Icon/icons/robot-happy-solid.icon.js +1 -1
- package/lib/components/Icon/icons/robot-happy-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/robot-happy.icon.js +1 -1
- package/lib/components/Icon/icons/robot-happy.icon.js.map +1 -1
- package/lib/components/Icon/icons/row-insert.icon.js +1 -1
- package/lib/components/Icon/icons/row-insert.icon.js.map +1 -1
- package/lib/components/Icon/icons/row.icon.js +1 -1
- package/lib/components/Icon/icons/row.icon.js.map +1 -1
- package/lib/components/Icon/icons/scale-down.icon.js +1 -1
- package/lib/components/Icon/icons/scale-down.icon.js.map +1 -1
- package/lib/components/Icon/icons/scale-up-solid.icon.js +1 -1
- package/lib/components/Icon/icons/scale-up-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/scale-up.icon.js +1 -1
- package/lib/components/Icon/icons/scale-up.icon.js.map +1 -1
- package/lib/components/Icon/icons/script.icon.js +1 -1
- package/lib/components/Icon/icons/script.icon.js.map +1 -1
- package/lib/components/Icon/icons/search-analytics-solid.icon.js +1 -1
- package/lib/components/Icon/icons/search-analytics-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/search-analytics.icon.js +1 -1
- package/lib/components/Icon/icons/search-analytics.icon.js.map +1 -1
- package/lib/components/Icon/icons/search.icon.js +1 -1
- package/lib/components/Icon/icons/search.icon.js.map +1 -1
- package/lib/components/Icon/icons/send-solid.icon.js +1 -1
- package/lib/components/Icon/icons/send-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/send.icon.js +1 -1
- package/lib/components/Icon/icons/send.icon.js.map +1 -1
- package/lib/components/Icon/icons/slideshow-solid.icon.js +1 -1
- package/lib/components/Icon/icons/slideshow-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/slideshow.icon.js +1 -1
- package/lib/components/Icon/icons/slideshow.icon.js.map +1 -1
- package/lib/components/Icon/icons/snow.icon.js +1 -1
- package/lib/components/Icon/icons/snow.icon.js.map +1 -1
- package/lib/components/Icon/icons/speaker-solid.icon.js +1 -1
- package/lib/components/Icon/icons/speaker-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/speaker.icon.js +1 -1
- package/lib/components/Icon/icons/speaker.icon.js.map +1 -1
- package/lib/components/Icon/icons/star-solid.icon.js +1 -1
- package/lib/components/Icon/icons/star-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/star.icon.js +1 -1
- package/lib/components/Icon/icons/star.icon.js.map +1 -1
- package/lib/components/Icon/icons/target-solid.icon.js +1 -1
- package/lib/components/Icon/icons/target-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/target.icon.js +1 -1
- package/lib/components/Icon/icons/target.icon.js.map +1 -1
- package/lib/components/Icon/icons/thumbs-up-solid.icon.js +1 -1
- package/lib/components/Icon/icons/thumbs-up-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/thumbs-up.icon.js +1 -1
- package/lib/components/Icon/icons/thumbs-up.icon.js.map +1 -1
- package/lib/components/Icon/icons/times.icon.js +1 -1
- package/lib/components/Icon/icons/times.icon.js.map +1 -1
- package/lib/components/Icon/icons/trash-solid.icon.js +1 -1
- package/lib/components/Icon/icons/trash-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/trash.icon.js +1 -1
- package/lib/components/Icon/icons/trash.icon.js.map +1 -1
- package/lib/components/Icon/icons/twitter.icon.js +1 -1
- package/lib/components/Icon/icons/twitter.icon.js.map +1 -1
- package/lib/components/Icon/icons/undock.icon.js +1 -1
- package/lib/components/Icon/icons/undock.icon.js.map +1 -1
- package/lib/components/Icon/icons/user-solid.icon.js +1 -1
- package/lib/components/Icon/icons/user-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/user-star-solid.icon.js +1 -1
- package/lib/components/Icon/icons/user-star-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/user-star.icon.js +1 -1
- package/lib/components/Icon/icons/user-star.icon.js.map +1 -1
- package/lib/components/Icon/icons/user.icon.js +1 -1
- package/lib/components/Icon/icons/user.icon.js.map +1 -1
- package/lib/components/Icon/icons/warn-solid.icon.js +1 -1
- package/lib/components/Icon/icons/warn-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/warn.icon.js +1 -1
- package/lib/components/Icon/icons/warn.icon.js.map +1 -1
- package/lib/components/Icon/index.d.ts +1 -1
- package/lib/components/Icon/index.d.ts.map +1 -1
- package/lib/components/Icon/index.js.map +1 -1
- package/lib/components/Input/Input.d.ts.map +1 -1
- package/lib/components/Input/Input.js +14 -2
- package/lib/components/Input/Input.js.map +1 -1
- package/lib/components/Input/Input.styles.d.ts +1 -0
- package/lib/components/Input/Input.styles.d.ts.map +1 -1
- package/lib/components/Input/Input.styles.js +31 -0
- package/lib/components/Input/Input.styles.js.map +1 -1
- package/lib/components/Link/Link.d.ts +4 -1
- package/lib/components/Link/Link.d.ts.map +1 -1
- package/lib/components/Link/Link.js +65 -26
- package/lib/components/Link/Link.js.map +1 -1
- package/lib/components/List/CommaSeparatedList.d.ts.map +1 -1
- package/lib/components/List/CommaSeparatedList.js +6 -14
- package/lib/components/List/CommaSeparatedList.js.map +1 -1
- package/lib/components/List/List.d.ts +2 -2
- package/lib/components/List/List.d.ts.map +1 -1
- package/lib/components/List/List.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.js +108 -53
- package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts +1 -0
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.js +38 -2
- package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.d.ts +28 -10
- package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
- package/lib/components/ListToolbar/PresetMenuPopover.d.ts +12 -0
- package/lib/components/ListToolbar/PresetMenuPopover.d.ts.map +1 -0
- package/lib/components/ListToolbar/PresetMenuPopover.js +36 -0
- package/lib/components/ListToolbar/PresetMenuPopover.js.map +1 -0
- package/lib/components/ListToolbar/QueryOptionPopover.d.ts.map +1 -1
- package/lib/components/ListToolbar/QueryOptionPopover.js +14 -44
- package/lib/components/ListToolbar/QueryOptionPopover.js.map +1 -1
- package/lib/components/Location/LocationInput.d.ts +3 -1
- package/lib/components/Location/LocationInput.d.ts.map +1 -1
- package/lib/components/Location/LocationInput.js +2 -2
- package/lib/components/Location/LocationInput.js.map +1 -1
- package/lib/components/Location/LocationView.d.ts +1 -1
- package/lib/components/Location/LocationView.d.ts.map +1 -1
- package/lib/components/Location/LocationView.js +16 -10
- package/lib/components/Location/LocationView.js.map +1 -1
- package/lib/components/Location/utils.d.ts +3 -2
- package/lib/components/Location/utils.d.ts.map +1 -1
- package/lib/components/Location/utils.js +17 -9
- package/lib/components/Location/utils.js.map +1 -1
- package/lib/components/Menu/Menu.d.ts.map +1 -1
- package/lib/components/Menu/Menu.js +10 -6
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
- package/lib/components/Menu/Menu.styles.js +4 -2
- package/lib/components/Menu/Menu.styles.js.map +1 -1
- package/lib/components/Menu/Menu.types.d.ts +13 -0
- package/lib/components/Menu/Menu.types.d.ts.map +1 -1
- package/lib/components/Menu/Menu.types.js.map +1 -1
- package/lib/components/Menu/MenuGroup.d.ts.map +1 -1
- package/lib/components/Menu/MenuGroup.js +3 -3
- package/lib/components/Menu/MenuGroup.js.map +1 -1
- package/lib/components/Menu/MenuItem.d.ts.map +1 -1
- package/lib/components/Menu/MenuItem.js +4 -8
- package/lib/components/Menu/MenuItem.js.map +1 -1
- package/lib/components/Menu/MenuList.d.ts.map +1 -1
- package/lib/components/Menu/MenuList.js +23 -14
- package/lib/components/Menu/MenuList.js.map +1 -1
- package/lib/components/Menu/NavItemsList.d.ts +2 -2
- package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
- package/lib/components/Menu/NavItemsList.js +12 -7
- package/lib/components/Menu/NavItemsList.js.map +1 -1
- package/lib/components/Menu/helpers.d.ts +7 -7
- package/lib/components/Menu/helpers.d.ts.map +1 -1
- package/lib/components/Menu/index.d.ts +1 -1
- package/lib/components/Menu/index.d.ts.map +1 -1
- package/lib/components/Menu/index.js +1 -1
- package/lib/components/Menu/index.js.map +1 -1
- package/lib/components/MetaList/MetaList.d.ts.map +1 -1
- package/lib/components/MetaList/MetaList.js +13 -10
- package/lib/components/MetaList/MetaList.js.map +1 -1
- package/lib/components/Modal/Contexts.d.ts.map +1 -1
- package/lib/components/Modal/Contexts.js +2 -3
- package/lib/components/Modal/Contexts.js.map +1 -1
- package/lib/components/Modal/DockedModals.d.ts.map +1 -1
- package/lib/components/Modal/DockedModals.js +1 -2
- package/lib/components/Modal/DockedModals.js.map +1 -1
- package/lib/components/Modal/MinimizedModal.d.ts.map +1 -1
- package/lib/components/Modal/MinimizedModal.js +3 -5
- package/lib/components/Modal/MinimizedModal.js.map +1 -1
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/Modal.js +3 -5
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/Modal.styles.d.ts.map +1 -1
- package/lib/components/Modal/Modal.styles.js +1 -0
- package/lib/components/Modal/Modal.styles.js.map +1 -1
- package/lib/components/Modal/Modal.types.d.ts +2 -6
- package/lib/components/Modal/Modal.types.d.ts.map +1 -1
- package/lib/components/Modal/Modal.types.js +1 -2
- package/lib/components/Modal/Modal.types.js.map +1 -1
- package/lib/components/Modal/ModalManager.d.ts +8 -2
- package/lib/components/Modal/ModalManager.d.ts.map +1 -1
- package/lib/components/Modal/ModalManager.js +14 -20
- package/lib/components/Modal/ModalManager.js.map +1 -1
- package/lib/components/Modal/index.d.ts +0 -1
- package/lib/components/Modal/index.d.ts.map +1 -1
- package/lib/components/Modal/index.js +0 -1
- package/lib/components/Modal/index.js.map +1 -1
- package/lib/components/MultiStepForm/FormProgress.d.ts +10 -0
- package/lib/components/MultiStepForm/FormProgress.d.ts.map +1 -0
- package/lib/components/{MultiStep/MultiStep.js → MultiStepForm/FormProgress.js} +8 -22
- package/lib/components/MultiStepForm/FormProgress.js.map +1 -0
- package/lib/components/{MultiStep/MultiStep.styles.d.ts → MultiStepForm/FormProgress.styles.d.ts} +2 -4
- package/lib/components/MultiStepForm/FormProgress.styles.d.ts.map +1 -0
- package/lib/components/{MultiStep/MultiStep.styles.js → MultiStepForm/FormProgress.styles.js} +3 -4
- package/lib/components/MultiStepForm/FormProgress.styles.js.map +1 -0
- package/lib/components/MultiStepForm/MultiStepForm.d.ts +9 -0
- package/lib/components/MultiStepForm/MultiStepForm.d.ts.map +1 -0
- package/lib/components/MultiStepForm/MultiStepForm.js +50 -0
- package/lib/components/MultiStepForm/MultiStepForm.js.map +1 -0
- package/lib/components/MultiStepForm/MultiStepForm.types.d.ts +48 -0
- package/lib/components/MultiStepForm/MultiStepForm.types.d.ts.map +1 -0
- package/lib/components/MultiStepForm/MultiStepForm.types.js +2 -0
- package/lib/components/MultiStepForm/MultiStepForm.types.js.map +1 -0
- package/lib/components/MultiStepForm/index.d.ts +2 -0
- package/lib/components/MultiStepForm/index.d.ts.map +1 -0
- package/lib/components/MultiStepForm/index.js +2 -0
- package/lib/components/MultiStepForm/index.js.map +1 -0
- package/lib/components/Number/NumberDisplay.d.ts +0 -5
- package/lib/components/Number/NumberDisplay.d.ts.map +1 -1
- package/lib/components/Number/NumberDisplay.js +8 -12
- package/lib/components/Number/NumberDisplay.js.map +1 -1
- package/lib/components/Number/NumberInput.d.ts +1 -1
- package/lib/components/Number/NumberInput.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.js +70 -40
- package/lib/components/Number/NumberInput.js.map +1 -1
- package/lib/components/Number/NumberInput.styles.d.ts +8 -5
- package/lib/components/Number/NumberInput.styles.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.styles.js +6 -3
- package/lib/components/Number/NumberInput.styles.js.map +1 -1
- package/lib/components/Number/NumberInput.types.d.ts +56 -19
- package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.types.js.map +1 -1
- package/lib/components/Number/NumberRangeInput.d.ts +6 -0
- package/lib/components/Number/NumberRangeInput.d.ts.map +1 -0
- package/lib/components/Number/NumberRangeInput.js +30 -0
- package/lib/components/Number/NumberRangeInput.js.map +1 -0
- package/lib/components/Number/index.d.ts +3 -2
- package/lib/components/Number/index.d.ts.map +1 -1
- package/lib/components/Number/index.js +1 -0
- package/lib/components/Number/index.js.map +1 -1
- package/lib/components/Number/utils.d.ts +4 -5
- package/lib/components/Number/utils.d.ts.map +1 -1
- package/lib/components/Number/utils.js +47 -41
- package/lib/components/Number/utils.js.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.d.ts +3 -3
- package/lib/components/PageTemplates/CategorySubPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.js.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.js +1 -4
- package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts +1 -2
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/Phone/PhoneInput.d.ts +1 -1
- package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
- package/lib/components/Phone/PhoneInput.js +29 -36
- package/lib/components/Phone/PhoneInput.js.map +1 -1
- package/lib/components/Phone/utils.d.ts +1 -2
- package/lib/components/Phone/utils.d.ts.map +1 -1
- package/lib/components/Phone/utils.js +3 -26
- package/lib/components/Phone/utils.js.map +1 -1
- package/lib/components/Popover/Popover.d.ts.map +1 -1
- package/lib/components/Popover/Popover.js +0 -6
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
- package/lib/components/Popover/Popover.styles.js +12 -57
- package/lib/components/Popover/Popover.styles.js.map +1 -1
- package/lib/components/RadioButton/RadioButton.d.ts +3 -1
- package/lib/components/RadioButton/RadioButton.d.ts.map +1 -1
- package/lib/components/RadioButton/RadioButton.js.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.d.ts +2 -0
- package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.js +2 -2
- package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts +3 -0
- package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.js +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
- package/lib/components/RadioCheckGroup/index.d.ts +1 -1
- package/lib/components/RadioCheckGroup/index.d.ts.map +1 -1
- package/lib/components/RadioCheckGroup/index.js +1 -1
- package/lib/components/RadioCheckGroup/index.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts +24 -8
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.js +127 -94
- package/lib/components/SearchInput/SearchInput.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.styles.d.ts +16 -0
- package/lib/components/SearchInput/SearchInput.styles.d.ts.map +1 -0
- package/lib/components/SearchInput/SearchInput.styles.js +129 -0
- package/lib/components/SearchInput/SearchInput.styles.js.map +1 -0
- package/lib/components/SearchInput/index.d.ts +1 -1
- package/lib/components/SearchInput/index.d.ts.map +1 -1
- package/lib/components/SearchInput/index.js +1 -1
- package/lib/components/SearchInput/index.js.map +1 -1
- package/lib/components/Select/Select.d.ts +4 -0
- package/lib/components/Select/Select.d.ts.map +1 -1
- package/lib/components/Select/Select.js +5 -3
- package/lib/components/Select/Select.js.map +1 -1
- package/lib/components/Skeleton/ParagraphSkeleton.d.ts.map +1 -1
- package/lib/components/Skeleton/ParagraphSkeleton.js +2 -2
- package/lib/components/Skeleton/ParagraphSkeleton.js.map +1 -1
- package/lib/components/SkipLinks/SkipLinks.d.ts +15 -0
- package/lib/components/SkipLinks/SkipLinks.d.ts.map +1 -0
- package/lib/components/SkipLinks/SkipLinks.js +67 -0
- package/lib/components/SkipLinks/SkipLinks.js.map +1 -0
- package/lib/components/SkipLinks/index.d.ts +4 -0
- package/lib/components/SkipLinks/index.d.ts.map +1 -0
- package/lib/components/SkipLinks/index.js +3 -0
- package/lib/components/SkipLinks/index.js.map +1 -0
- package/lib/components/Slider/Slider.styles.d.ts +1 -1
- package/lib/components/SummaryItem/SummaryItem.d.ts +2 -2
- package/lib/components/SummaryList/ViewAll.d.ts.map +1 -1
- package/lib/components/SummaryList/ViewAll.js +6 -2
- package/lib/components/SummaryList/ViewAll.js.map +1 -1
- package/lib/components/Tabs/Tab.d.ts.map +1 -1
- package/lib/components/Tabs/Tab.js +0 -1
- package/lib/components/Tabs/Tab.js.map +1 -1
- package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
- package/lib/components/Tabs/TabPanel.js +1 -7
- package/lib/components/Tabs/TabPanel.js.map +1 -1
- package/lib/components/Tabs/Tabs.d.ts.map +1 -1
- package/lib/components/Tabs/Tabs.js +2 -2
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/Text/Text.js +2 -2
- package/lib/components/Text/Text.js.map +1 -1
- package/lib/components/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.js +5 -2
- package/lib/components/TextArea/TextArea.js.map +1 -1
- package/lib/components/Toaster/Context.d.ts +7 -0
- package/lib/components/Toaster/Context.d.ts.map +1 -0
- package/lib/components/Toaster/Context.js +6 -0
- package/lib/components/Toaster/Context.js.map +1 -0
- package/lib/components/Toaster/Toaster.d.ts +8 -40
- package/lib/components/Toaster/Toaster.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.js +12 -12
- package/lib/components/Toaster/Toaster.js.map +1 -1
- package/lib/components/Toaster/Toaster.types.d.ts +31 -0
- package/lib/components/Toaster/Toaster.types.d.ts.map +1 -0
- package/lib/components/Toaster/Toaster.types.js +2 -0
- package/lib/components/Toaster/Toaster.types.js.map +1 -0
- package/lib/components/Toaster/index.d.ts +1 -2
- package/lib/components/Toaster/index.d.ts.map +1 -1
- package/lib/components/Toaster/index.js +0 -1
- package/lib/components/Toaster/index.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.d.ts +5 -0
- package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +23 -5
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/components/Tree/StandardTree.d.ts.map +1 -1
- package/lib/components/Tree/StandardTree.js +27 -13
- package/lib/components/Tree/StandardTree.js.map +1 -1
- package/lib/components/Tree/StandardTree.styles.js +3 -3
- package/lib/components/Tree/StandardTree.styles.js.map +1 -1
- package/lib/components/Tree/StandardTree.types.d.ts +1 -0
- package/lib/components/Tree/StandardTree.types.d.ts.map +1 -1
- package/lib/components/Tree/StandardTree.types.js.map +1 -1
- package/lib/hooks/index.d.ts +5 -0
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/index.js +5 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useActiveDescendant.d.ts +5 -1
- package/lib/hooks/useActiveDescendant.d.ts.map +1 -1
- package/lib/hooks/useActiveDescendant.js +174 -93
- package/lib/hooks/useActiveDescendant.js.map +1 -1
- package/lib/hooks/useAutoResize.d.ts +1 -1
- package/lib/hooks/useAutoResize.d.ts.map +1 -1
- package/lib/hooks/useAutoResize.js +14 -6
- package/lib/hooks/useAutoResize.js.map +1 -1
- package/lib/hooks/useBreakpoint.d.ts +3 -2
- package/lib/hooks/useBreakpoint.d.ts.map +1 -1
- package/lib/hooks/useBreakpoint.js +10 -13
- package/lib/hooks/useBreakpoint.js.map +1 -1
- package/lib/hooks/useConfiguration.d.ts +1 -0
- package/lib/hooks/useConfiguration.d.ts.map +1 -1
- package/lib/hooks/useConfiguration.js +9 -2
- package/lib/hooks/useConfiguration.js.map +1 -1
- package/lib/hooks/useDraggable.d.ts +1 -1
- package/lib/hooks/useDraggable.d.ts.map +1 -1
- package/lib/hooks/useDraggable.js +4 -2
- package/lib/hooks/useDraggable.js.map +1 -1
- package/lib/hooks/useFocusWithin.d.ts.map +1 -1
- package/lib/hooks/useFocusWithin.js +0 -8
- package/lib/hooks/useFocusWithin.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +130 -34
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useI18n.js +2 -1
- package/lib/hooks/useI18n.js.map +1 -1
- package/lib/hooks/useInputFormatter.d.ts +12 -0
- package/lib/hooks/useInputFormatter.d.ts.map +1 -0
- package/lib/hooks/useInputFormatter.js +89 -0
- package/lib/hooks/useInputFormatter.js.map +1 -0
- package/lib/hooks/useLongPress.d.ts +1 -1
- package/lib/hooks/useLongPress.d.ts.map +1 -1
- package/lib/hooks/useModalContext.d.ts +7 -0
- package/lib/hooks/useModalContext.d.ts.map +1 -0
- package/lib/hooks/useModalContext.js +12 -0
- package/lib/hooks/useModalContext.js.map +1 -0
- package/lib/hooks/useModalManager.d.ts +8 -0
- package/lib/hooks/useModalManager.d.ts.map +1 -0
- package/lib/hooks/useModalManager.js +16 -0
- package/lib/hooks/useModalManager.js.map +1 -0
- package/lib/hooks/useOS.d.ts +7 -0
- package/lib/hooks/useOS.d.ts.map +1 -0
- package/lib/hooks/useOS.js +27 -0
- package/lib/hooks/useOS.js.map +1 -0
- package/lib/hooks/useScrollStick.d.ts +1 -1
- package/lib/hooks/useScrollStick.d.ts.map +1 -1
- package/lib/hooks/useToaster.d.ts +8 -0
- package/lib/hooks/useToaster.d.ts.map +1 -0
- package/lib/hooks/useToaster.js +16 -0
- package/lib/hooks/useToaster.js.map +1 -0
- package/lib/hooks/useTransitionState.js +1 -1
- package/lib/hooks/useTransitionState.js.map +1 -1
- package/lib/i18n/default.d.ts +130 -34
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +153 -47
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +126 -698
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/i18n/translate.d.ts +3 -0
- package/lib/i18n/translate.d.ts.map +1 -1
- package/lib/i18n/translate.js.map +1 -1
- package/lib/index.d.ts +9 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +9 -2
- package/lib/index.js.map +1 -1
- package/lib/init.d.ts +8 -0
- package/lib/init.d.ts.map +1 -0
- package/lib/init.js +5 -0
- package/lib/init.js.map +1 -0
- package/lib/register-contexts.d.ts +2 -0
- package/lib/register-contexts.d.ts.map +1 -0
- package/lib/register-contexts.js +10 -0
- package/lib/register-contexts.js.map +1 -0
- package/lib/styles/gradients.d.ts +4 -1
- package/lib/styles/gradients.d.ts.map +1 -1
- package/lib/styles/gradients.js +46 -3
- package/lib/styles/gradients.js.map +1 -1
- package/lib/styles/utils.d.ts +1 -1
- package/lib/styles/utils.d.ts.map +1 -1
- package/lib/styles/utils.js.map +1 -1
- package/lib/theme/ThemeMachine.d.ts +11 -3
- package/lib/theme/ThemeMachine.d.ts.map +1 -1
- package/lib/theme/ThemeMachine.js +28 -26
- package/lib/theme/ThemeMachine.js.map +1 -1
- package/lib/theme/index.d.ts +1 -0
- package/lib/theme/index.d.ts.map +1 -1
- package/lib/theme/index.js +1 -0
- package/lib/theme/index.js.map +1 -1
- package/lib/theme/theme.d.ts +72 -0
- package/lib/theme/theme.d.ts.map +1 -1
- package/lib/theme/themeDefinition.json +43 -1
- package/lib/theme/themeOverrides.schema.json +9 -0
- package/lib/theme/themes/buildTheme.json +0 -3
- package/lib/theme/themes/darkTheme.json +9 -1
- package/lib/theme/themes/legacyBuildTheme.json +0 -3
- package/lib/theme/themes/wssTheme.json +6 -0
- package/lib/types/types.d.ts +3 -0
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/types.js.map +1 -1
- package/lib/utils/utils.d.ts +5 -0
- package/lib/utils/utils.d.ts.map +1 -1
- package/lib/utils/utils.js +23 -0
- package/lib/utils/utils.js.map +1 -1
- package/package.json +11 -6
- package/lib/components/AppShell/SkipNavigation.d.ts +0 -4
- package/lib/components/AppShell/SkipNavigation.d.ts.map +0 -1
- package/lib/components/AppShell/SkipNavigation.js +0 -61
- package/lib/components/AppShell/SkipNavigation.js.map +0 -1
- package/lib/components/Currency/currencyCodes.d.ts +0 -3
- package/lib/components/Currency/currencyCodes.d.ts.map +0 -1
- package/lib/components/Currency/currencyCodes.js +0 -182
- package/lib/components/Currency/currencyCodes.js.map +0 -1
- package/lib/components/DateTime/types.d.ts +0 -9
- package/lib/components/DateTime/types.d.ts.map +0 -1
- package/lib/components/DateTime/types.js +0 -2
- package/lib/components/DateTime/types.js.map +0 -1
- package/lib/components/Icon/icons/script-solid.icon.d.ts.map +0 -1
- package/lib/components/Icon/icons/script-solid.icon.js +0 -6
- package/lib/components/Icon/icons/script-solid.icon.js.map +0 -1
- package/lib/components/MultiStep/MultiStep.d.ts +0 -6
- package/lib/components/MultiStep/MultiStep.d.ts.map +0 -1
- package/lib/components/MultiStep/MultiStep.js.map +0 -1
- package/lib/components/MultiStep/MultiStep.styles.d.ts.map +0 -1
- package/lib/components/MultiStep/MultiStep.styles.js.map +0 -1
- package/lib/components/MultiStep/MultiStep.types.d.ts +0 -36
- package/lib/components/MultiStep/MultiStep.types.d.ts.map +0 -1
- package/lib/components/MultiStep/MultiStep.types.js +0 -2
- package/lib/components/MultiStep/MultiStep.types.js.map +0 -1
- package/lib/components/MultiStep/index.d.ts +0 -3
- package/lib/components/MultiStep/index.d.ts.map +0 -1
- package/lib/components/MultiStep/index.js +0 -2
- package/lib/components/MultiStep/index.js.map +0 -1
|
@@ -1 +1 @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,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG;IACvB,OAAO,EAAE,MAAM;IACf,GAAG,EAAE,SAAS;IACd,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,SAAS;CACT,CAAC;AACX,MAAM,YAAY,GAAG;IACnB,OAAO,EAAE,MAAM;IACf,GAAG,EAAE,SAAS;IACd,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,SAAS;CACP,CAAC;AAEX,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,IAAsB,EACtB,IAAkC,EAClC,MAAc,EACd,WAAiD,EACjD,IAAa,EACL,EAAE;IACV,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,IAAI,IAAI,KAAK,MAAM,EAAE;QACnB,QAAQ,GAAG,IAAI;YACb,CAAC,CAAC,GAAG,WAAW,CAAC,oBAAoB,CAAC,IAAI,WAAW,CAAC,WAAW,CAAC,IAAI,OAAO,CACzE,IAAI,EACJ,cAAc,CAAC,QAAQ,CACxB,KAAK,IAAI,CAAC,cAAc,EAAE,IAAI;YACjC,CAAC,CAAC,EAAE,CAAC;KACR;SAAM;QACL,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CACpC,MAAM,EACN,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,gBAAgB,CAClD,CAAC;QAEF,QAAQ,GAAG,IAAI;YACb,CAAC,CAAC,GAAG,WAAW,CAAC,oBAAoB,CAAC,IAAI,eAAe,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI;YAC/E,CAAC,CAAC,EAAE,CAAC;KACR;IAED,OAAO,GAAG,QAAQ,GAAG,WAAW,CAC9B,IAAI,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,2BAA2B,CAClE,EAAE,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { cap } from '../../../utils';\nimport type { TranslationFunction, TranslationPack } from '../../../i18n';\n\nimport { CALENDAR_TYPES, CALENDAR_TYPE_LOCALES } from './local';\n\n// https://weeknumber.net/how-to/javascript\nexport const getWeekYear = (date: Date): number => {\n const result = new Date(date.getTime());\n result.setUTCDate(result.getUTCDate() + 3 - ((result.getUTCDay() + 6) % 7));\n return result.getUTCFullYear();\n};\n\nexport const getDayOfWeek = (date: Date, calendarType = CALENDAR_TYPES.ISO_8601) => {\n const weekday = date.getUTCDay();\n\n switch (calendarType) {\n case CALENDAR_TYPES.ISO_8601:\n // Shifts days of the week so that Monday is 0, Sunday is 6\n return (weekday + 6) % 7;\n case CALENDAR_TYPES.ARABIC:\n return (weekday + 1) % 7;\n case CALENDAR_TYPES.HEBREW:\n case CALENDAR_TYPES.US:\n return weekday;\n default:\n throw new Error('Unsupported calendar type.');\n }\n};\n\nexport const getWeekdays = (calendarType: string) => {\n const date = new Date();\n const beginOfMonth = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), 1));\n const year = beginOfMonth.getUTCFullYear();\n const monthIndex = beginOfMonth.getUTCMonth();\n\n return Array.from({ length: 7 }, (v, weekDay) => {\n return new Date(year, monthIndex, weekDay + 1 - getDayOfWeek(beginOfMonth, calendarType));\n });\n};\n\n// https://weeknumber.net/how-to/javascript\nexport const getWeek = (date: Date, calendarType: string = CALENDAR_TYPES.ISO_8601): number => {\n const result = new Date(date.getTime());\n result.setUTCHours(0, 0, 0, 0);\n // Thursday in current week decides the year.\n\n result.setUTCDate(result.getUTCDate() + 3 - getDayOfWeek(result, calendarType));\n // January 4 is always in week 1.\n\n const week1 = new Date(result.getUTCFullYear(), 0, 4);\n // Adjust to Thursday in week 1 and count number of weeks from date to week1.\n return (\n 1 +\n Math.round(\n ((result.getTime() - week1.getTime()) / 86400000 - 3 + getDayOfWeek(result, calendarType)) / 7\n )\n );\n};\n\nexport const getCalendarTypeFromLocale = (localeTag?: string) => {\n const calendarType = Object.keys(CALENDAR_TYPE_LOCALES).find(type =>\n CALENDAR_TYPE_LOCALES[type].includes(localeTag ?? navigator.language)\n );\n\n return calendarType || CALENDAR_TYPES.ISO_8601;\n};\n\nexport const getDateOfISOWeek = (week: number, year: number): Date => {\n const dateOfWeek = new Date(Date.UTC(year, 0, 1 + (week - 1) * 7));\n const dayOfWeek = dateOfWeek.getUTCDay();\n const weekStartISO = dateOfWeek;\n if (dayOfWeek <= 4) weekStartISO.setUTCDate(dateOfWeek.getUTCDate() - dayOfWeek + 1);\n else weekStartISO.setUTCDate(dateOfWeek.getUTCDate() + 8 - dayOfWeek);\n return weekStartISO;\n};\n\nconst timeRegex = /^T?\\d{2}:\\d{2}/;\n\nexport const parseToDate = (value: string | number | Date): Date => {\n let result: Date = value as Date;\n\n if (typeof value === 'string') {\n let [year, month, day, hour, minute, second] = [1970, 1, 1, 0, 0, 0];\n if (timeRegex.test(value)) {\n [hour, minute, second = 0] = value\n .toString()\n .slice(Number(value.startsWith('T')))\n .split(/[.:/]/)\n .map(Number);\n } else {\n [year, month, day = 0, hour = 0, minute = 0, second = 0] = value\n .toString()\n .split(/[.: T+-]/)\n .map(Number);\n }\n result = new Date(Date.UTC(year, month - 1, day, hour, minute, second));\n } else if (typeof value === 'number') {\n result = new Date(value);\n }\n return result;\n};\n\nexport type QuarterNumber = 1 | 2 | 3 | 4;\n\nexport function getQuarter(date: string | number | Date): QuarterNumber {\n const parsedDate = parseToDate(date);\n const quarter: QuarterNumber[] = [1, 2, 3, 4];\n return quarter[Math.floor(parsedDate.getUTCMonth() / 3)];\n}\n\nexport const getDateFormat = (\n localeTag?: string,\n options?: Intl.DateTimeFormatOptions | undefined,\n labelFormat?: boolean\n) => {\n return new Intl.DateTimeFormat(localeTag, options).formatToParts().map(({ type, value }) => {\n switch (type) {\n case 'day':\n return 'DD';\n case 'month':\n return 'MM';\n case 'year':\n return 'YYYY';\n case 'hour':\n return 'hh';\n case 'minute':\n return 'mm';\n case 'second':\n return 'ss';\n case 'dayPeriod':\n if (labelFormat) return '';\n return value;\n case 'literal':\n return value;\n default:\n return '';\n }\n });\n};\n\nexport const getStartOfWeek = (date: Date, calendarType: string = CALENDAR_TYPES.ISO_8601) => {\n const startDate = new Date(date);\n const day = getDayOfWeek(startDate, calendarType);\n if (day !== 0) startDate.setUTCHours(-24 * day);\n return startDate;\n};\n\nexport const getEndOfWeek = (date: Date, calendarType: string = CALENDAR_TYPES.ISO_8601) => {\n const endDate = new Date(date);\n const day = getDayOfWeek(endDate, calendarType);\n if (day !== 6) endDate.setUTCHours(24 * (6 - day));\n return endDate;\n};\n\nexport type ClockFormat = 12 | 24;\n\nexport const is12HClockFormat = (localeTag?: string): boolean => {\n const meridiem = new Intl.DateTimeFormat(localeTag, {\n hour: 'numeric'\n })\n .formatToParts()\n .find(({ type }) => type === 'dayPeriod');\n\n return !!meridiem?.value;\n};\n\nconst objDate = new Date();\nobjDate.setUTCDate(1);\n\nexport const getLocalizedMonths = (localeTag?: string) => {\n return [...Array(12).keys()].map(monthNo => {\n objDate.setUTCMonth(monthNo);\n return cap(objDate.toLocaleString(localeTag, { month: 'long', timeZone: 'UTC' }));\n });\n};\n\nexport const getLocalizedWeekDays = (localeTag?: string) => {\n const calendarType = getCalendarTypeFromLocale(localeTag);\n return getWeekdays(calendarType).reduce((accumulator, dayDate, index) => {\n accumulator[index + 1] = cap(\n dayDate.toLocaleString(localeTag, {\n weekday: 'long'\n })\n );\n return accumulator;\n }, {} as { [key: number]: string });\n};\n\nexport const MS_IN_SECOND = 1000;\nexport const MS_IN_MINUTE = 1000 * 60;\nexport const MS_IN_HOUR = 1000 * 60 * 60;\nexport const MS_IN_DAY = 1000 * 60 * 60 * 24;\n\nexport const msToTimeFormat = (ms: number): { hour?: number; minute?: number; second?: number } => {\n if (ms < 0) {\n return { hour: undefined, minute: undefined, second: undefined };\n }\n return {\n hour: Math.floor(ms / MS_IN_HOUR),\n minute: Math.floor((ms / MS_IN_MINUTE) % 60),\n second: Math.floor((ms / MS_IN_SECOND) % 60)\n };\n};\n\nexport const timeFormatToMs = ({\n hour,\n minute,\n second\n}: {\n hour: number;\n minute: number;\n second: number;\n}): number => {\n if (hour < 0 || minute < 0 || second < 0) {\n return 0;\n }\n return second * MS_IN_SECOND + minute * MS_IN_MINUTE + hour * MS_IN_HOUR;\n};\n\nexport const msToTimeUnit = (ms: number, format: string): number => {\n if (ms < 0) {\n return 0;\n }\n switch (format) {\n case 'seconds':\n return Math.floor(ms / MS_IN_SECOND);\n case 'minutes':\n return Math.floor(ms / MS_IN_MINUTE);\n case 'hours':\n return Math.floor(ms / MS_IN_HOUR);\n case 'days':\n return Math.floor(ms / MS_IN_DAY);\n default:\n return 0;\n }\n};\n\nexport const timeUnitToMs = (count: number, format: string): number => {\n if (count < 0) {\n return 0;\n }\n switch (format) {\n case 'seconds':\n return count * MS_IN_SECOND;\n case 'minutes':\n return count * MS_IN_MINUTE;\n case 'hours':\n return count * MS_IN_HOUR;\n case 'days':\n return count * MS_IN_DAY;\n default:\n return 0;\n }\n};\n\nexport const getTimeOptions = (withSeconds: boolean, is12h: boolean = false) => {\n return {\n hour: 'numeric',\n minute: 'numeric',\n ...(withSeconds && ({ second: 'numeric' } as const)),\n hour12: is12h\n } as const;\n};\n\nexport const validateDate = (year: number, month: number, day: number) => {\n return !(month < 1 || month > 12 || day < 1 || day > new Date(year, month, 0).getDate());\n};\n\nexport const validateTime = (hour: number, minute: number, second: number, is12h: boolean) => {\n const hourMax = is12h ? 12 : 23;\n const hourMin = is12h ? 1 : 0;\n return !(hour > hourMax || hour < hourMin || minute > 59 || second > 59);\n};\n\nexport const toUTCDateString = (date: Date, format?: Intl.DateTimeFormat) => {\n const adjustedDate = new Date(date.getTime() + date.getTimezoneOffset() * 60000);\n return format?.format(adjustedDate) ?? adjustedDate.toDateString();\n};\n\nconst ISO_DATE_REG_EXP =\n /(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z))|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))/;\n\nexport const isISODate = (value: string): boolean => {\n return ISO_DATE_REG_EXP.test(value);\n};\n\nconst TIME_REG_EXP = /^([01]?\\d|2[0-3]):[0-5]?\\d(:[0-5]?\\d)?$/;\n\nexport const isTime = (value: string): boolean => {\n return TIME_REG_EXP.test(value);\n};\n\nexport const parseLocaleTextToDateParams = (value: string, localeTag: string) => {\n const template = getDateFormat(localeTag, {\n year: 'numeric',\n month: 'numeric',\n day: 'numeric'\n })\n .join('')\n .match(/\\w+/g);\n const valueParts = value.match(/\\d+/g);\n if (template && valueParts?.length === template?.length) {\n let year = 0;\n let month = 0;\n let day = 0;\n template.forEach((part, index) => {\n if (part === 'YYYY') {\n year = Number(valueParts[index]);\n } else if (part === 'MM') {\n month = Number((Number(valueParts[index]) - 1).toString().padStart(2, '0'));\n } else if (part === 'DD') {\n day = Number(valueParts[index].padStart(2, '0'));\n }\n });\n return [year, month, day];\n }\n return undefined;\n};\n\nexport const parsePastedTextToDate = (\n value: string,\n localeTag: string,\n currentDate: Date\n): Date | undefined => {\n let result;\n const dateParams = parseLocaleTextToDateParams(value, localeTag);\n if (isTime(value)) {\n const [hour, minute, second = 0] = value.split(':').map(Number);\n result = new Date(currentDate.getTime()); // clone currentDate object to avoid parameter manipulation\n result.setUTCHours(hour, minute, second);\n } else if (dateParams) {\n const [year, month, day] = dateParams;\n if (validateDate(year, month, day)) {\n result = new Date(currentDate.getTime());\n result.setUTCFullYear(year, month, day);\n }\n } else if (isISODate(value)) {\n result = new Date(value);\n }\n return result;\n};\n\nconst ariaDateTimeOpts = {\n weekday: 'long',\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit'\n} as const;\nconst ariaDateOpts = {\n weekday: 'long',\n day: 'numeric',\n month: 'long',\n year: 'numeric'\n} as const;\n\nexport const generatePickerButtonAriaLabel = (\n date: Date | undefined,\n type: 'date' | 'datetime' | 'week',\n locale: string,\n translateFn: TranslationFunction<TranslationPack>,\n open: boolean\n): string => {\n let datePart = '';\n if (type === 'week') {\n datePart = date\n ? `${translateFn('selected_date_a11y')} ${translateFn('week_text')} ${getWeek(\n date,\n CALENDAR_TYPES.ISO_8601\n )}, ${date.getUTCFullYear()}, `\n : '';\n } else {\n const ariaFormat = Intl.DateTimeFormat(\n locale,\n type === 'date' ? ariaDateOpts : ariaDateTimeOpts\n );\n\n datePart = date\n ? `${translateFn('selected_date_a11y')} ${toUTCDateString(date, ariaFormat)}, `\n : '';\n }\n\n return `${datePart}${translateFn(\n open ? 'close_calendar_button_a11y' : 'open_calendar_button_a11y'\n )}`;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAGrC,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEhE,2CAA2C;AAC3C,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAU,EAAU,EAAE;IAChD,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IACxC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC5E,OAAO,MAAM,CAAC,cAAc,EAAE,CAAC;AACjC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAU,EAAE,YAAY,GAAG,cAAc,CAAC,QAAQ,EAAE,EAAE;IACjF,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;IAEjC,QAA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AY,CAAC,IAAI,OAAO,CAC9E,IAAI,EACJ,cAAc,CAAC,QAAQ,CACxB,KAAK,IAAI,CAAC,cAAc,EAAE,IAAI;YACjC,CAAC,CAAC,EAAE,CAAC;KACR;SAAM;QACL,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CACpC,MAAM,EACN,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,gBAAgB,CAClD,CAAC;QAEF,QAAQ,GAAG,IAAI;YACb,CAAC,CAAC,GAAG,WAAW,CAAC,oBAAoB,CAAC,IAAI,eAAe,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI;YAC/E,CAAC,CAAC,EAAE,CAAC;KACR;IAED,OAAO,GAAG,QAAQ,GAAG,WAAW,CAC9B,IAAI,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,2BAA2B,CAClE,EAAE,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { cap } from '../../../utils';\nimport type { TranslationFunction, TranslationPack } from '../../../i18n';\n\nimport { CALENDAR_TYPES, CALENDAR_TYPE_LOCALES } from './local';\n\n// https://weeknumber.net/how-to/javascript\nexport const getWeekYear = (date: Date): number => {\n const result = new Date(date.getTime());\n result.setUTCDate(result.getUTCDate() + 3 - ((result.getUTCDay() + 6) % 7));\n return result.getUTCFullYear();\n};\n\nexport const getDayOfWeek = (date: Date, calendarType = CALENDAR_TYPES.ISO_8601) => {\n const weekday = date.getUTCDay();\n\n switch (calendarType) {\n case CALENDAR_TYPES.ISO_8601:\n // Shifts days of the week so that Monday is 0, Sunday is 6\n return (weekday + 6) % 7;\n case CALENDAR_TYPES.ARABIC:\n return (weekday + 1) % 7;\n case CALENDAR_TYPES.HEBREW:\n case CALENDAR_TYPES.US:\n return weekday;\n default:\n throw new Error('Unsupported calendar type.');\n }\n};\n\nexport const getWeekdays = (calendarType: string) => {\n const date = new Date();\n const beginOfMonth = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), 1));\n const year = beginOfMonth.getUTCFullYear();\n const monthIndex = beginOfMonth.getUTCMonth();\n\n return Array.from({ length: 7 }, (v, weekDay) => {\n return new Date(year, monthIndex, weekDay + 1 - getDayOfWeek(beginOfMonth, calendarType));\n });\n};\n\n// https://weeknumber.net/how-to/javascript\nexport const getWeek = (date: Date, calendarType: string = CALENDAR_TYPES.ISO_8601): number => {\n const result = new Date(date.getTime());\n result.setUTCHours(0, 0, 0, 0);\n // Thursday in current week decides the year.\n\n result.setUTCDate(result.getUTCDate() + 3 - getDayOfWeek(result, calendarType));\n // January 4 is always in week 1.\n\n const week1 = new Date(result.getUTCFullYear(), 0, 4);\n // Adjust to Thursday in week 1 and count number of weeks from date to week1.\n return (\n 1 +\n Math.round(\n ((result.getTime() - week1.getTime()) / 86400000 - 3 + getDayOfWeek(result, calendarType)) / 7\n )\n );\n};\n\nexport const getCalendarTypeFromLocale = (localeTag?: string) => {\n const calendarType = Object.keys(CALENDAR_TYPE_LOCALES).find(type =>\n CALENDAR_TYPE_LOCALES[type].includes(localeTag ?? navigator.language)\n );\n\n return calendarType || CALENDAR_TYPES.ISO_8601;\n};\n\nexport const getDateOfISOWeek = (week: number, year: number): Date => {\n const dateOfWeek = new Date(Date.UTC(year, 0, 1 + (week - 1) * 7));\n const dayOfWeek = dateOfWeek.getUTCDay();\n const weekStartISO = dateOfWeek;\n if (dayOfWeek <= 4) weekStartISO.setUTCDate(dateOfWeek.getUTCDate() - dayOfWeek + 1);\n else weekStartISO.setUTCDate(dateOfWeek.getUTCDate() + 8 - dayOfWeek);\n return weekStartISO;\n};\n\nconst timeRegex = /^T?\\d{2}:\\d{2}/;\n\nexport const parseToDate = (value: string | number | Date): Date => {\n let result: Date = value as Date;\n\n if (typeof value === 'string') {\n let [year, month, day, hour, minute, second] = [1970, 1, 1, 0, 0, 0];\n if (timeRegex.test(value)) {\n [hour, minute, second = 0] = value\n .toString()\n .slice(Number(value.startsWith('T')))\n .split(/[.:/]/)\n .map(Number);\n } else {\n [year, month, day = 0, hour = 0, minute = 0, second = 0] = value\n .toString()\n .split(/[.: T+-]/)\n .map(Number);\n }\n result = new Date(Date.UTC(year, month - 1, day, hour, minute, second));\n } else if (typeof value === 'number') {\n result = new Date(value);\n }\n return result;\n};\n\nexport type QuarterNumber = 1 | 2 | 3 | 4;\n\nexport function getQuarter(date: string | number | Date): QuarterNumber {\n const parsedDate = parseToDate(date);\n const quarter: QuarterNumber[] = [1, 2, 3, 4];\n return quarter[Math.floor(parsedDate.getUTCMonth() / 3)];\n}\n\nexport const getDateFormat = (\n localeTag?: string,\n options?: Intl.DateTimeFormatOptions | undefined,\n labelFormat?: boolean\n) => {\n return new Intl.DateTimeFormat(localeTag, options).formatToParts().map(({ type, value }) => {\n switch (type) {\n case 'day':\n return 'DD';\n case 'month':\n return 'MM';\n case 'year':\n return 'YYYY';\n case 'hour':\n return 'hh';\n case 'minute':\n return 'mm';\n case 'second':\n return 'ss';\n case 'dayPeriod':\n if (labelFormat) return '';\n return value;\n case 'literal':\n return value;\n default:\n return '';\n }\n });\n};\n\nexport const getStartOfWeek = (date: Date, calendarType: string = CALENDAR_TYPES.ISO_8601) => {\n const startDate = new Date(date);\n const day = getDayOfWeek(startDate, calendarType);\n if (day !== 0) startDate.setUTCHours(-24 * day);\n return startDate;\n};\n\nexport const getEndOfWeek = (date: Date, calendarType: string = CALENDAR_TYPES.ISO_8601) => {\n const endDate = new Date(date);\n const day = getDayOfWeek(endDate, calendarType);\n if (day !== 6) endDate.setUTCHours(24 * (6 - day));\n return endDate;\n};\n\nexport type ClockFormat = 12 | 24;\n\nexport const is12HClockFormat = (localeTag?: string): boolean => {\n const meridiem = new Intl.DateTimeFormat(localeTag, {\n hour: 'numeric'\n })\n .formatToParts()\n .find(({ type }) => type === 'dayPeriod');\n\n return !!meridiem?.value;\n};\n\nconst objDate = new Date();\nobjDate.setUTCDate(1);\n\nexport const getLocalizedMonths = (localeTag?: string) => {\n return [...Array(12).keys()].map(monthNo => {\n objDate.setUTCMonth(monthNo);\n return cap(objDate.toLocaleString(localeTag, { month: 'long', timeZone: 'UTC' }));\n });\n};\n\nexport const getLocalizedWeekDays = (localeTag?: string) => {\n const calendarType = getCalendarTypeFromLocale(localeTag);\n return getWeekdays(calendarType).reduce((accumulator, dayDate, index) => {\n accumulator[index + 1] = cap(\n dayDate.toLocaleString(localeTag, {\n weekday: 'long'\n })\n );\n return accumulator;\n }, {} as { [key: number]: string });\n};\n\nexport const MS_IN_SECOND = 1000;\nexport const MS_IN_MINUTE = 1000 * 60;\nexport const MS_IN_HOUR = 1000 * 60 * 60;\nexport const MS_IN_DAY = 1000 * 60 * 60 * 24;\n\nexport const msToTimeFormat = (ms: number): { hour?: number; minute?: number; second?: number } => {\n if (ms < 0) {\n return { hour: undefined, minute: undefined, second: undefined };\n }\n return {\n hour: Math.floor(ms / MS_IN_HOUR),\n minute: Math.floor((ms / MS_IN_MINUTE) % 60),\n second: Math.floor((ms / MS_IN_SECOND) % 60)\n };\n};\n\nexport const timeFormatToMs = ({\n hour,\n minute,\n second\n}: {\n hour: number;\n minute: number;\n second: number;\n}): number => {\n if (hour < 0 || minute < 0 || second < 0) {\n return 0;\n }\n return second * MS_IN_SECOND + minute * MS_IN_MINUTE + hour * MS_IN_HOUR;\n};\n\nexport const msToTimeUnit = (ms: number, format: string): number => {\n if (ms < 0) {\n return 0;\n }\n switch (format) {\n case 'seconds':\n return Math.floor(ms / MS_IN_SECOND);\n case 'minutes':\n return Math.floor(ms / MS_IN_MINUTE);\n case 'hours':\n return Math.floor(ms / MS_IN_HOUR);\n case 'days':\n return Math.floor(ms / MS_IN_DAY);\n default:\n return 0;\n }\n};\n\nexport const timeUnitToMs = (count: number, format: string): number => {\n if (count < 0) {\n return 0;\n }\n switch (format) {\n case 'seconds':\n return count * MS_IN_SECOND;\n case 'minutes':\n return count * MS_IN_MINUTE;\n case 'hours':\n return count * MS_IN_HOUR;\n case 'days':\n return count * MS_IN_DAY;\n default:\n return 0;\n }\n};\n\nexport const getTimeOptions = (withSeconds: boolean, is12h: boolean = false) => {\n return {\n hour: 'numeric',\n minute: 'numeric',\n ...(withSeconds && ({ second: 'numeric' } as const)),\n hour12: is12h\n } as const;\n};\n\nexport const validateDate = (year: number, month: number, day: number) => {\n return !(month < 1 || month > 12 || day < 1 || day > new Date(year, month, 0).getDate());\n};\n\nexport const validateTime = (hour: number, minute: number, second: number, is12h: boolean) => {\n const hourMax = is12h ? 12 : 23;\n const hourMin = is12h ? 1 : 0;\n return !(hour > hourMax || hour < hourMin || minute > 59 || second > 59);\n};\n\nexport const toUTCDateString = (date: Date, format?: Intl.DateTimeFormat) => {\n const adjustedDate = new Date(date.getTime() + date.getTimezoneOffset() * 60000);\n return format?.format(adjustedDate) ?? adjustedDate.toDateString();\n};\n\nconst ISO_DATE_REG_EXP =\n /(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z))|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))/;\n\nexport const isISODate = (value: string): boolean => {\n return ISO_DATE_REG_EXP.test(value);\n};\n\nconst TIME_REG_EXP = /^([01]?\\d|2[0-3]):[0-5]?\\d(:[0-5]?\\d)?$/;\n\nexport const isTime = (value: string): boolean => {\n return TIME_REG_EXP.test(value);\n};\n\nexport const parseLocaleTextToDateParams = (value: string, localeTag: string) => {\n const template = getDateFormat(localeTag, {\n year: 'numeric',\n month: 'numeric',\n day: 'numeric'\n })\n .join('')\n .match(/\\w+/g);\n const valueParts = value.match(/\\d+/g);\n if (template && valueParts?.length === template?.length) {\n let year = 0;\n let month = 0;\n let day = 0;\n template.forEach((part, index) => {\n if (part === 'YYYY') {\n year = Number(valueParts[index]);\n } else if (part === 'MM') {\n month = Number((Number(valueParts[index]) - 1).toString().padStart(2, '0'));\n } else if (part === 'DD') {\n day = Number(valueParts[index].padStart(2, '0'));\n }\n });\n return [year, month, day];\n }\n return undefined;\n};\n\nexport const parsePastedTextToDate = (\n value: string,\n localeTag: string,\n currentDate: Date\n): Date | undefined => {\n let result;\n const dateParams = parseLocaleTextToDateParams(value, localeTag);\n if (isTime(value)) {\n const [hour, minute, second = 0] = value.split(':').map(Number);\n result = new Date(currentDate.getTime()); // clone currentDate object to avoid parameter manipulation\n result.setUTCHours(hour, minute, second);\n } else if (dateParams) {\n const [year, month, day] = dateParams;\n if (validateDate(year, month, day)) {\n result = new Date(currentDate.getTime());\n result.setUTCFullYear(year, month, day);\n }\n } else if (isISODate(value)) {\n result = new Date(value);\n }\n return result;\n};\n\nconst ariaDateTimeOpts = {\n weekday: 'long',\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit'\n} as const;\nconst ariaDateOpts = {\n weekday: 'long',\n day: 'numeric',\n month: 'long',\n year: 'numeric'\n} as const;\n\nexport const generatePickerButtonAriaLabel = (\n date: Date | undefined,\n type: 'date' | 'datetime' | 'week',\n locale: string,\n translateFn: TranslationFunction<TranslationPack>,\n open: boolean\n): string => {\n let datePart = '';\n if (type === 'week') {\n const displayNames = new Intl.DisplayNames(locale, { style: 'long', type: 'dateTimeField' });\n datePart = date\n ? `${translateFn('selected_date_a11y')} ${displayNames.of('weekOfYear')} ${getWeek(\n date,\n CALENDAR_TYPES.ISO_8601\n )}, ${date.getUTCFullYear()}, `\n : '';\n } else {\n const ariaFormat = Intl.DateTimeFormat(\n locale,\n type === 'date' ? ariaDateOpts : ariaDateTimeOpts\n );\n\n datePart = date\n ? `${translateFn('selected_date_a11y')} ${toUTCDateString(date, ariaFormat)}, `\n : '';\n }\n\n return `${datePart}${translateFn(\n open ? 'close_calendar_button_a11y' : 'open_calendar_button_a11y'\n )}`;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/Calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAQlB,MAAM,OAAO,CAAC;AAYf,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/Calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAQlB,MAAM,OAAO,CAAC;AAYf,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAerD,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,EAAE,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,oFAAoF;IACpF,aAAa,CAAC,EAAE;QAAE,SAAS,EAAE,IAAI,GAAG,SAAS,CAAC;QAAC,OAAO,EAAE,IAAI,GAAG,SAAS,CAAA;KAAE,CAAC;IAC3E,iEAAiE;IACjE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,+DAA+D;IAC/D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAChC,gDAAgD;IAChD,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC/B,uGAAuG;IACvG,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wEAAwE;IACxE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC7B,wEAAwE;IACxE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC7B,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAID,QAAA,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,GAAG,YAAY,CA+T7D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -4,6 +4,7 @@ import Text from '../../Text';
|
|
|
4
4
|
import { CALENDAR_TYPES } from '../Input/local';
|
|
5
5
|
import { getCalendarTypeFromLocale, getDateOfISOWeek, getWeek, parseToDate, toUTCDateString } from '../Input/utils';
|
|
6
6
|
import { useConfiguration, useConsolidatedRef, useFocusWithin, useI18n } from '../../../hooks';
|
|
7
|
+
import { cap } from '../../../utils';
|
|
7
8
|
import { getDaysOfMonth, getLocalizedDays, getWeeksOfMonth } from './utils';
|
|
8
9
|
import { StyledColumnLabel, ScreenReaderOnly, StyledPick, StyledDay, StyledCalendar, StyledWeekGrid, StyledWeekLabel, StyledWeekNumber } from './Calendar.styles';
|
|
9
10
|
const ariaOpts = { day: 'numeric', month: 'long', year: 'numeric' };
|
|
@@ -95,13 +96,12 @@ const Calendar = forwardRef(({ selected, current = selected ? new Date(selected.
|
|
|
95
96
|
};
|
|
96
97
|
return betweenHighlightAndBoundary('startDate') || betweenHighlightAndBoundary('endDate');
|
|
97
98
|
};
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
if (hasFocus)
|
|
101
|
+
containerRef.current?.querySelector('button[tabindex="0"]')?.focus();
|
|
102
|
+
}, [hasFocus, focusedDay]);
|
|
98
103
|
const days = getDaysOfMonth(current, calendarType ?? CALENDAR_TYPES.ISO_8601).map(day => {
|
|
99
|
-
return (_jsx(StyledDay, {
|
|
100
|
-
? (focusedRef) => {
|
|
101
|
-
if (hasFocus)
|
|
102
|
-
focusedRef?.focus();
|
|
103
|
-
}
|
|
104
|
-
: undefined, tabIndex: isFocused(day) ? 0 : -1, disabled: disabled || mode === 'week' || isDisabled(day), current: toUTCDateString(day) === today, highlighted: isInRange(day) || isHighlighted(day), "aria-selected": isSelected(day) || undefined, "aria-current": isFocused(day) ? 'date' : undefined, dayInNexOrPrevMonth: day.getUTCMonth() !== current.getUTCMonth(), "aria-label": toUTCDateString(day, Intl.DateTimeFormat(locale, ariaOpts)), onMouseOver: showHighlight ? () => setHighlightBoundary(day) : undefined, onMouseOut: showHighlight ? () => setHighlightBoundary(undefined) : undefined, onMouseDown: () => {
|
|
104
|
+
return (_jsx(StyledDay, { tabIndex: isFocused(day) ? 0 : -1, disabled: disabled || mode === 'week' || isDisabled(day), current: toUTCDateString(day) === today, highlighted: isInRange(day) || isHighlighted(day), "aria-selected": isSelected(day) || undefined, "aria-current": isSelected(day) ? 'date' : undefined, dayInNexOrPrevMonth: day.getUTCMonth() !== current.getUTCMonth(), "aria-label": toUTCDateString(day, Intl.DateTimeFormat(locale, ariaOpts)), onMouseOver: showHighlight ? () => setHighlightBoundary(day) : undefined, onMouseOut: showHighlight ? () => setHighlightBoundary(undefined) : undefined, onClick: () => {
|
|
105
105
|
setFocusedDay(day);
|
|
106
106
|
onFocus?.(day);
|
|
107
107
|
onSelect?.(day);
|
|
@@ -109,26 +109,30 @@ const Calendar = forwardRef(({ selected, current = selected ? new Date(selected.
|
|
|
109
109
|
});
|
|
110
110
|
const names = useMemo(() => getLocalizedDays(calendarType, locale), [locale, calendarType]);
|
|
111
111
|
const t = useI18n();
|
|
112
|
-
const
|
|
112
|
+
const displayNames = new Intl.DisplayNames(locale, {
|
|
113
|
+
style: 'long',
|
|
114
|
+
type: 'dateTimeField'
|
|
115
|
+
});
|
|
116
|
+
const displayNamesShort = new Intl.DisplayNames(locale, {
|
|
117
|
+
style: 'short',
|
|
118
|
+
type: 'dateTimeField'
|
|
119
|
+
});
|
|
113
120
|
const weeks = getWeeksOfMonth(current, calendarType).map(weekNo => {
|
|
114
|
-
return (_jsxs(_Fragment, { children: [_jsx(Text, { as: StyledWeekNumber, "aria-hidden": 'true', children: weekNo.toString() }, weekNo), _jsx(ScreenReaderOnly, { children: `${
|
|
121
|
+
return (_jsxs(_Fragment, { children: [_jsx(Text, { as: StyledWeekNumber, "aria-hidden": 'true', children: weekNo.toString() }, weekNo), _jsx(ScreenReaderOnly, { children: `${displayNames.of('weekOfYear')} ${weekNo.toString()} ${current
|
|
122
|
+
.getUTCFullYear()
|
|
123
|
+
.toString()}` })] }));
|
|
115
124
|
});
|
|
116
125
|
const weeksButtons = getWeeksOfMonth(current, calendarType).map(weekNo => {
|
|
117
126
|
const dateOfISOWeek = getDateOfISOWeek(weekNo, current.getUTCFullYear());
|
|
118
127
|
const lastDayOfWeek = new Date(dateOfISOWeek);
|
|
119
128
|
lastDayOfWeek.setDate(dateOfISOWeek.getDate() + 6);
|
|
120
|
-
return (_jsxs(StyledPick, {
|
|
121
|
-
? (focusedRef) => {
|
|
122
|
-
if (hasFocus)
|
|
123
|
-
focusedRef?.focus();
|
|
124
|
-
}
|
|
125
|
-
: undefined, tabIndex: isWeekFocused(dateOfISOWeek) ? 0 : -1, disabled: disabled || mode === 'date' || isDisabled(dateOfISOWeek), "aria-selected": isWeekSelected(dateOfISOWeek) || undefined, "aria-label": `${t('week_label_a11y')} ${weekNo.toString()}, ${dateOfISOWeek.toLocaleDateString()} - ${lastDayOfWeek.toLocaleDateString()}`, "aria-current": isWeekFocused(dateOfISOWeek) ? 'date' : undefined, onMouseDown: () => {
|
|
129
|
+
return (_jsxs(StyledPick, { tabIndex: isWeekFocused(dateOfISOWeek) ? 0 : -1, disabled: disabled || mode === 'date' || isDisabled(dateOfISOWeek), "aria-selected": isWeekSelected(dateOfISOWeek) || undefined, "aria-label": `${displayNames.of('weekOfYear')} ${weekNo.toString()} ${toUTCDateString(dateOfISOWeek, Intl.DateTimeFormat(locale, ariaOpts))} - ${toUTCDateString(lastDayOfWeek, Intl.DateTimeFormat(locale, ariaOpts))}`, "aria-current": isWeekFocused(dateOfISOWeek) ? 'date' : undefined, onMouseDown: () => {
|
|
126
130
|
setFocusedDay(dateOfISOWeek);
|
|
127
131
|
onFocus?.(dateOfISOWeek);
|
|
128
132
|
onSelect?.(dateOfISOWeek);
|
|
129
|
-
}, children: [`${
|
|
133
|
+
}, children: [`${cap(displayNames.of('weekOfYear'))} `, weekNo.toString()] }, weekNo));
|
|
130
134
|
});
|
|
131
|
-
const weekLabel = mode === 'date' ? (_jsxs(_Fragment, { children: [_jsx(Text, { as: StyledWeekLabel, forwardedAs: 'abbr', title:
|
|
135
|
+
const weekLabel = mode === 'date' ? (_jsxs(_Fragment, { children: [_jsx(Text, { as: StyledWeekLabel, forwardedAs: 'abbr', title: cap(displayNames.of('weekOfYear')), "aria-hidden": 'true', children: cap(displayNamesShort.of('weekOfYear')) }), _jsx(ScreenReaderOnly, { children: displayNames.of('weekOfYear') })] })) : (_jsx(Text, { as: StyledWeekLabel, children: cap(displayNames.of('weekOfYear')) }));
|
|
132
136
|
const headerLabels = names.map(([name, abbr]) => (_jsxs("th", { role: 'columnheader', children: [_jsx(Text, { as: StyledColumnLabel, forwardedAs: 'abbr', title: name, "aria-hidden": 'true', children: abbr }, name), _jsx(ScreenReaderOnly, { children: name })] }, name)));
|
|
133
137
|
const splitToWeeks = (resultArray, item, index) => {
|
|
134
138
|
const chunkIndex = Math.floor(index / 7);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/Calendar.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,OAAO,EAGP,QAAQ,EACR,UAAU,EAGV,SAAS,EACT,WAAW,EACZ,MAAM,OAAO,CAAC;AAEf,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,eAAe,EAChB,MAAM,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R,0BAAQ,KAAK,GAAS,IACP,EACjB,KAAC,gBAAgB,iBAAW,QAAQ,EAAC,IAAI,EAAC,OAAO,YAC9C,CAAC,CAAC,iBAAiB,CAAC,GACJ,IAClB,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import {\n useMemo,\n FunctionComponent,\n KeyboardEvent,\n useState,\n forwardRef,\n PropsWithoutRef,\n Ref,\n useEffect,\n useCallback\n} from 'react';\n\nimport Text from '../../Text';\nimport { CALENDAR_TYPES } from '../Input/local';\nimport {\n getCalendarTypeFromLocale,\n getDateOfISOWeek,\n getWeek,\n parseToDate,\n toUTCDateString\n} from '../Input/utils';\nimport { useConfiguration, useConsolidatedRef, useFocusWithin, useI18n } from '../../../hooks';\nimport { ForwardProps } from '../../../types';\nimport { FormControlProps } from '../../FormControl';\n\nimport { getDaysOfMonth, getLocalizedDays, getWeeksOfMonth } from './utils';\nimport {\n StyledColumnLabel,\n ScreenReaderOnly,\n StyledPick,\n StyledDay,\n StyledCalendar,\n StyledWeekGrid,\n StyledWeekLabel,\n StyledWeekNumber\n} from './Calendar.styles';\n\nexport interface CalendarProps {\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /**\n * Defines default date that will be selected initially when the Calendar is visible.\n */\n selected?: Date;\n /**\n * Defines currently visible month.\n * @default new Date()\n */\n current?: Date;\n /** Defines dates range with start date and end date that can be set by the user. */\n selectedRange?: { startDate: Date | undefined; endDate: Date | undefined };\n /** Defines if days should be highlighted for range selection */\n showHighlight?: boolean;\n /** Defines if week numbers should be displayed in calendar */\n showWeekNumber?: boolean;\n /**\n * The mode of the calendar that will be rendered, ie. whether single date or week are selectable.\n * @default \"date\"\n */\n mode?: 'date' | 'week';\n /** Callback fired when new day is selected. */\n onSelect?: (date: Date) => void;\n /** Callback fired when user focuses new day. */\n onFocus?: (date: Date) => void;\n /** Sets the type of calendar to be used. This will be determined by locale if no value is provided. */\n calendarType?: string;\n /** Defines minimum available value that can be selected by the user. */\n min?: string | number | Date;\n /** Defines maximum available value that can be selected by the user. */\n max?: string | number | Date;\n /** Set the calendar to disabled state, ie. non-interactive. */\n disabled?: boolean;\n}\n\nconst ariaOpts = { day: 'numeric', month: 'long', year: 'numeric' } as const;\n\nconst Calendar: FunctionComponent<CalendarProps & ForwardProps> = forwardRef(\n (\n {\n selected,\n current = selected ? new Date(selected.getTime()) : new Date(),\n selectedRange,\n showHighlight,\n mode = 'date',\n showWeekNumber,\n calendarType: calendar = CALENDAR_TYPES.ISO_8601,\n onSelect,\n onFocus,\n disabled,\n min: minProp,\n max: maxProp\n }: PropsWithoutRef<CalendarProps>,\n ref: Ref<HTMLTableElement>\n ) => {\n const { locale } = useConfiguration();\n const min = minProp ? parseToDate(minProp) : -Infinity;\n const max = maxProp ? parseToDate(maxProp) : Infinity;\n\n const showWeekLabel = mode === 'week' ? false : showWeekNumber;\n const [focusedDay, setFocusedDay] = useState(current);\n useEffect(() => {\n setFocusedDay(current);\n }, [current.getUTCFullYear(), current.getUTCMonth()]);\n\n const calendarType = useMemo(\n () => calendar ?? getCalendarTypeFromLocale(locale),\n [locale, calendar]\n );\n\n const [highlightBoundary, setHighlightBoundary] = useState<Date>();\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent<HTMLElement>) => {\n if (\n (mode === 'date'\n ? ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight']\n : ['ArrowUp', 'ArrowDown']\n ).includes(e.key)\n ) {\n e.preventDefault();\n const newFocused = new Date(focusedDay);\n switch (e.key) {\n case 'ArrowUp':\n newFocused.setUTCDate(focusedDay.getUTCDate() - 7);\n break;\n case 'ArrowDown':\n newFocused.setUTCDate(focusedDay.getUTCDate() + 7);\n break;\n case 'ArrowRight':\n newFocused.setUTCDate(focusedDay.getUTCDate() + 1);\n break;\n case 'ArrowLeft':\n newFocused.setUTCDate(focusedDay.getUTCDate() - 1);\n break;\n default:\n }\n if (newFocused < min || newFocused > max) return;\n setFocusedDay(newFocused);\n onFocus?.(newFocused);\n setHighlightBoundary(newFocused);\n }\n if (e.key === 'Enter') {\n e.preventDefault();\n onSelect?.(focusedDay);\n }\n },\n [mode, focusedDay, onFocus, onSelect]\n );\n\n const containerRef = useConsolidatedRef<HTMLTableElement>(ref);\n const hasFocus = useFocusWithin([containerRef]);\n\n const today = toUTCDateString(new Date());\n\n const isDisabled = (day: Date) => {\n return min > day.getTime() || day.getTime() > max;\n };\n\n const isSelected = (day: Date) => {\n return [\n selected && toUTCDateString(selected),\n selectedRange?.startDate && toUTCDateString(selectedRange?.startDate),\n selectedRange?.endDate && toUTCDateString(selectedRange?.endDate)\n ].includes(toUTCDateString(day));\n };\n\n const isWeekSelected = (day: Date) => {\n return (\n selected &&\n toUTCDateString(day) ===\n toUTCDateString(getDateOfISOWeek(getWeek(selected, calendarType), selected.getFullYear()))\n );\n };\n\n const isFocused = (day: Date) => {\n return toUTCDateString(day) === toUTCDateString(focusedDay);\n };\n\n const isWeekFocused = (day: Date) => {\n return (\n toUTCDateString(day) ===\n toUTCDateString(\n getDateOfISOWeek(getWeek(focusedDay, calendarType), focusedDay.getFullYear())\n )\n );\n };\n\n const isInRange = (day: Date) => {\n return (\n selectedRange &&\n selectedRange.startDate &&\n selectedRange.endDate &&\n day >= selectedRange.startDate &&\n day <= selectedRange.endDate\n );\n };\n\n const isHighlighted = (day: Date) => {\n if (!selectedRange || !showHighlight || !highlightBoundary) return false;\n const betweenHighlightAndBoundary = (rangeBoundaryType: 'startDate' | 'endDate') => {\n const rangeBoundary = selectedRange[rangeBoundaryType];\n if (!rangeBoundary) return false;\n return !!(\n rangeBoundary &&\n ((day >= rangeBoundary && day <= highlightBoundary) ||\n (day <= rangeBoundary && day >= highlightBoundary))\n );\n };\n return betweenHighlightAndBoundary('startDate') || betweenHighlightAndBoundary('endDate');\n };\n\n const days = getDaysOfMonth(current, calendarType ?? CALENDAR_TYPES.ISO_8601).map(day => {\n return (\n <StyledDay\n key={day.getTime()}\n variant='simple'\n icon={false}\n type='button'\n loading={false}\n ref={\n isFocused(day)\n ? (focusedRef: HTMLButtonElement) => {\n if (hasFocus) focusedRef?.focus();\n }\n : undefined\n }\n tabIndex={isFocused(day) ? 0 : -1}\n disabled={disabled || mode === 'week' || isDisabled(day)}\n current={toUTCDateString(day) === today}\n highlighted={isInRange(day) || isHighlighted(day)}\n aria-selected={isSelected(day) || undefined}\n aria-current={isFocused(day) ? 'date' : undefined}\n dayInNexOrPrevMonth={day.getUTCMonth() !== current.getUTCMonth()}\n aria-label={toUTCDateString(day, Intl.DateTimeFormat(locale, ariaOpts))}\n onMouseOver={showHighlight ? () => setHighlightBoundary(day) : undefined}\n onMouseOut={showHighlight ? () => setHighlightBoundary(undefined) : undefined}\n onMouseDown={() => {\n setFocusedDay(day);\n onFocus?.(day);\n onSelect?.(day);\n }}\n >\n {day.getUTCDate()}\n </StyledDay>\n );\n });\n\n const names = useMemo(() => getLocalizedDays(calendarType, locale), [locale, calendarType]);\n\n const t = useI18n();\n\n const weekText = t('week_label_a11y');\n\n const weeks = getWeeksOfMonth(current, calendarType).map(weekNo => {\n return (\n <>\n <Text as={StyledWeekNumber} key={weekNo} aria-hidden='true'>\n {weekNo.toString()}\n </Text>\n <ScreenReaderOnly>\n {`${weekText} ${weekNo.toString()} ${current.getUTCFullYear().toString()}`}\n </ScreenReaderOnly>\n </>\n );\n });\n\n const weeksButtons = getWeeksOfMonth(current, calendarType).map(weekNo => {\n const dateOfISOWeek = getDateOfISOWeek(weekNo, current.getUTCFullYear());\n const lastDayOfWeek = new Date(dateOfISOWeek);\n lastDayOfWeek.setDate(dateOfISOWeek.getDate() + 6);\n return (\n <StyledPick\n key={weekNo}\n variant='simple'\n icon={false}\n type='button'\n loading={false}\n ref={\n isWeekFocused(dateOfISOWeek)\n ? (focusedRef: HTMLButtonElement) => {\n if (hasFocus) focusedRef?.focus();\n }\n : undefined\n }\n tabIndex={isWeekFocused(dateOfISOWeek) ? 0 : -1}\n disabled={disabled || mode === 'date' || isDisabled(dateOfISOWeek)}\n aria-selected={isWeekSelected(dateOfISOWeek) || undefined}\n aria-label={`${t(\n 'week_label_a11y'\n )} ${weekNo.toString()}, ${dateOfISOWeek.toLocaleDateString()} - ${lastDayOfWeek.toLocaleDateString()}`}\n aria-current={isWeekFocused(dateOfISOWeek) ? 'date' : undefined}\n onMouseDown={() => {\n setFocusedDay(dateOfISOWeek);\n onFocus?.(dateOfISOWeek);\n onSelect?.(dateOfISOWeek);\n }}\n >\n {`${weekText} `}\n {weekNo.toString()}\n </StyledPick>\n );\n });\n\n const weekLabel =\n mode === 'date' ? (\n <>\n <Text as={StyledWeekLabel} forwardedAs='abbr' title={weekText} aria-hidden='true'>\n {t('week_text_short')}\n </Text>\n <ScreenReaderOnly>{weekText}</ScreenReaderOnly>\n </>\n ) : (\n <Text as={StyledWeekLabel}>{weekText}</Text>\n );\n\n const headerLabels = names.map(([name, abbr]) => (\n <th role='columnheader' key={name}>\n <Text as={StyledColumnLabel} forwardedAs='abbr' key={name} title={name} aria-hidden='true'>\n {abbr}\n </Text>\n <ScreenReaderOnly>{name}</ScreenReaderOnly>\n </th>\n ));\n\n const splitToWeeks = (resultArray: JSX.Element[][], item: JSX.Element, index: number) => {\n const chunkIndex = Math.floor(index / 7);\n\n if (!resultArray[chunkIndex]) {\n resultArray[chunkIndex] = [] as JSX.Element[];\n }\n\n resultArray[chunkIndex].push(item);\n return resultArray;\n };\n\n const cells = days.reduce(splitToWeeks, []).map((week, index) => {\n const rowHeader = mode === 'week' ? weeksButtons[index] : weeks[index];\n return (\n // eslint-disable-next-line react/no-array-index-key\n <tr key={`week-${index}`}>\n {showWeekLabel && <th scope='row'>{rowHeader}</th>}\n {week.map((day, dayIndex) => {\n // eslint-disable-next-line react/no-array-index-key\n return <td key={`day-${dayIndex}`}>{day}</td>;\n })}\n </tr>\n );\n });\n\n const weeksCells = weeksButtons.map((week, index) => {\n return (\n // eslint-disable-next-line react/no-array-index-key\n <tr key={`week-${index}`}>\n <td>{week}</td>\n </tr>\n );\n });\n\n const weeksGrid = (\n <StyledWeekGrid role='grid' onKeyDown={onKeyDown} ref={containerRef}>\n <thead>\n <tr>\n <th>{weekLabel}</th>\n </tr>\n </thead>\n <tbody>{weeksCells}</tbody>\n </StyledWeekGrid>\n );\n\n return (\n <>\n {mode === 'week' && weeksGrid}\n <StyledCalendar\n ref={mode === 'date' ? containerRef : undefined}\n aria-label={current.toLocaleString(locale, {\n month: 'long',\n year: 'numeric',\n timeZone: 'UTC'\n })}\n onKeyDown={onKeyDown}\n aria-hidden={mode === 'week' ? true : undefined}\n role='grid'\n >\n <thead>\n <tr>\n {showWeekLabel && <th>{weekLabel}</th>}\n {headerLabels}\n </tr>\n </thead>\n <tbody>{cells}</tbody>\n </StyledCalendar>\n <ScreenReaderOnly aria-live='polite' role='alert'>\n {t('calendar_assist')}\n </ScreenReaderOnly>\n </>\n );\n }\n);\n\nexport default Calendar;\n"]}
|
|
1
|
+
{"version":3,"file":"Calendar.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/Calendar.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,OAAO,EAGP,QAAQ,EACR,UAAU,EAGV,SAAS,EACT,WAAW,EACZ,MAAM,OAAO,CAAC;AAEf,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,eAAe,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG/F,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAErC,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,EAC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BAAQ,KAAK,GAAS,IACP,EACjB,KAAC,gBAAgB,iBAAW,QAAQ,EAAC,IAAI,EAAC,OAAO,YAC9C,CAAC,CAAC,iBAAiB,CAAC,GACJ,IAClB,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import {\n useMemo,\n FunctionComponent,\n KeyboardEvent,\n useState,\n forwardRef,\n PropsWithoutRef,\n Ref,\n useEffect,\n useCallback\n} from 'react';\n\nimport Text from '../../Text';\nimport { CALENDAR_TYPES } from '../Input/local';\nimport {\n getCalendarTypeFromLocale,\n getDateOfISOWeek,\n getWeek,\n parseToDate,\n toUTCDateString\n} from '../Input/utils';\nimport { useConfiguration, useConsolidatedRef, useFocusWithin, useI18n } from '../../../hooks';\nimport { ForwardProps } from '../../../types';\nimport { FormControlProps } from '../../FormControl';\nimport { cap } from '../../../utils';\n\nimport { getDaysOfMonth, getLocalizedDays, getWeeksOfMonth } from './utils';\nimport {\n StyledColumnLabel,\n ScreenReaderOnly,\n StyledPick,\n StyledDay,\n StyledCalendar,\n StyledWeekGrid,\n StyledWeekLabel,\n StyledWeekNumber\n} from './Calendar.styles';\n\nexport interface CalendarProps {\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /**\n * Defines default date that will be selected initially when the Calendar is visible.\n */\n selected?: Date;\n /**\n * Defines currently visible month.\n * @default new Date()\n */\n current?: Date;\n /** Defines dates range with start date and end date that can be set by the user. */\n selectedRange?: { startDate: Date | undefined; endDate: Date | undefined };\n /** Defines if days should be highlighted for range selection */\n showHighlight?: boolean;\n /** Defines if week numbers should be displayed in calendar */\n showWeekNumber?: boolean;\n /**\n * The mode of the calendar that will be rendered, ie. whether single date or week are selectable.\n * @default \"date\"\n */\n mode?: 'date' | 'week';\n /** Callback fired when new day is selected. */\n onSelect?: (date: Date) => void;\n /** Callback fired when user focuses new day. */\n onFocus?: (date: Date) => void;\n /** Sets the type of calendar to be used. This will be determined by locale if no value is provided. */\n calendarType?: string;\n /** Defines minimum available value that can be selected by the user. */\n min?: string | number | Date;\n /** Defines maximum available value that can be selected by the user. */\n max?: string | number | Date;\n /** Set the calendar to disabled state, ie. non-interactive. */\n disabled?: boolean;\n}\n\nconst ariaOpts = { day: 'numeric', month: 'long', year: 'numeric' } as const;\n\nconst Calendar: FunctionComponent<CalendarProps & ForwardProps> = forwardRef(\n (\n {\n selected,\n current = selected ? new Date(selected.getTime()) : new Date(),\n selectedRange,\n showHighlight,\n mode = 'date',\n showWeekNumber,\n calendarType: calendar = CALENDAR_TYPES.ISO_8601,\n onSelect,\n onFocus,\n disabled,\n min: minProp,\n max: maxProp\n }: PropsWithoutRef<CalendarProps>,\n ref: Ref<HTMLTableElement>\n ) => {\n const { locale } = useConfiguration();\n const min = minProp ? parseToDate(minProp) : -Infinity;\n const max = maxProp ? parseToDate(maxProp) : Infinity;\n\n const showWeekLabel = mode === 'week' ? false : showWeekNumber;\n const [focusedDay, setFocusedDay] = useState(current);\n useEffect(() => {\n setFocusedDay(current);\n }, [current.getUTCFullYear(), current.getUTCMonth()]);\n\n const calendarType = useMemo(\n () => calendar ?? getCalendarTypeFromLocale(locale),\n [locale, calendar]\n );\n\n const [highlightBoundary, setHighlightBoundary] = useState<Date>();\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent<HTMLElement>) => {\n if (\n (mode === 'date'\n ? ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight']\n : ['ArrowUp', 'ArrowDown']\n ).includes(e.key)\n ) {\n e.preventDefault();\n const newFocused = new Date(focusedDay);\n switch (e.key) {\n case 'ArrowUp':\n newFocused.setUTCDate(focusedDay.getUTCDate() - 7);\n break;\n case 'ArrowDown':\n newFocused.setUTCDate(focusedDay.getUTCDate() + 7);\n break;\n case 'ArrowRight':\n newFocused.setUTCDate(focusedDay.getUTCDate() + 1);\n break;\n case 'ArrowLeft':\n newFocused.setUTCDate(focusedDay.getUTCDate() - 1);\n break;\n default:\n }\n if (newFocused < min || newFocused > max) return;\n setFocusedDay(newFocused);\n onFocus?.(newFocused);\n setHighlightBoundary(newFocused);\n }\n if (e.key === 'Enter') {\n e.preventDefault();\n onSelect?.(focusedDay);\n }\n },\n [mode, focusedDay, onFocus, onSelect]\n );\n\n const containerRef = useConsolidatedRef<HTMLTableElement>(ref);\n const hasFocus = useFocusWithin([containerRef]);\n\n const today = toUTCDateString(new Date());\n\n const isDisabled = (day: Date) => {\n return min > day.getTime() || day.getTime() > max;\n };\n\n const isSelected = (day: Date) => {\n return [\n selected && toUTCDateString(selected),\n selectedRange?.startDate && toUTCDateString(selectedRange?.startDate),\n selectedRange?.endDate && toUTCDateString(selectedRange?.endDate)\n ].includes(toUTCDateString(day));\n };\n\n const isWeekSelected = (day: Date) => {\n return (\n selected &&\n toUTCDateString(day) ===\n toUTCDateString(getDateOfISOWeek(getWeek(selected, calendarType), selected.getFullYear()))\n );\n };\n\n const isFocused = (day: Date) => {\n return toUTCDateString(day) === toUTCDateString(focusedDay);\n };\n\n const isWeekFocused = (day: Date) => {\n return (\n toUTCDateString(day) ===\n toUTCDateString(\n getDateOfISOWeek(getWeek(focusedDay, calendarType), focusedDay.getFullYear())\n )\n );\n };\n\n const isInRange = (day: Date) => {\n return (\n selectedRange &&\n selectedRange.startDate &&\n selectedRange.endDate &&\n day >= selectedRange.startDate &&\n day <= selectedRange.endDate\n );\n };\n\n const isHighlighted = (day: Date) => {\n if (!selectedRange || !showHighlight || !highlightBoundary) return false;\n const betweenHighlightAndBoundary = (rangeBoundaryType: 'startDate' | 'endDate') => {\n const rangeBoundary = selectedRange[rangeBoundaryType];\n if (!rangeBoundary) return false;\n return !!(\n rangeBoundary &&\n ((day >= rangeBoundary && day <= highlightBoundary) ||\n (day <= rangeBoundary && day >= highlightBoundary))\n );\n };\n return betweenHighlightAndBoundary('startDate') || betweenHighlightAndBoundary('endDate');\n };\n\n useEffect(() => {\n if (hasFocus)\n containerRef.current?.querySelector<HTMLButtonElement>('button[tabindex=\"0\"]')?.focus();\n }, [hasFocus, focusedDay]);\n\n const days = getDaysOfMonth(current, calendarType ?? CALENDAR_TYPES.ISO_8601).map(day => {\n return (\n <StyledDay\n key={day.getTime()}\n tabIndex={isFocused(day) ? 0 : -1}\n disabled={disabled || mode === 'week' || isDisabled(day)}\n current={toUTCDateString(day) === today}\n highlighted={isInRange(day) || isHighlighted(day)}\n aria-selected={isSelected(day) || undefined}\n aria-current={isSelected(day) ? 'date' : undefined}\n dayInNexOrPrevMonth={day.getUTCMonth() !== current.getUTCMonth()}\n aria-label={toUTCDateString(day, Intl.DateTimeFormat(locale, ariaOpts))}\n onMouseOver={showHighlight ? () => setHighlightBoundary(day) : undefined}\n onMouseOut={showHighlight ? () => setHighlightBoundary(undefined) : undefined}\n onClick={() => {\n setFocusedDay(day);\n onFocus?.(day);\n onSelect?.(day);\n }}\n >\n {day.getUTCDate()}\n </StyledDay>\n );\n });\n\n const names = useMemo(() => getLocalizedDays(calendarType, locale), [locale, calendarType]);\n\n const t = useI18n();\n\n const displayNames = new Intl.DisplayNames(locale, {\n style: 'long',\n type: 'dateTimeField'\n }) as Intl.DateTimeDisplayNames;\n const displayNamesShort = new Intl.DisplayNames(locale, {\n style: 'short',\n type: 'dateTimeField'\n }) as Intl.DateTimeDisplayNames;\n\n const weeks = getWeeksOfMonth(current, calendarType).map(weekNo => {\n return (\n <>\n <Text as={StyledWeekNumber} key={weekNo} aria-hidden='true'>\n {weekNo.toString()}\n </Text>\n <ScreenReaderOnly>\n {`${displayNames.of('weekOfYear')} ${weekNo.toString()} ${current\n .getUTCFullYear()\n .toString()}`}\n </ScreenReaderOnly>\n </>\n );\n });\n\n const weeksButtons = getWeeksOfMonth(current, calendarType).map(weekNo => {\n const dateOfISOWeek = getDateOfISOWeek(weekNo, current.getUTCFullYear());\n const lastDayOfWeek = new Date(dateOfISOWeek);\n lastDayOfWeek.setDate(dateOfISOWeek.getDate() + 6);\n return (\n <StyledPick\n key={weekNo}\n tabIndex={isWeekFocused(dateOfISOWeek) ? 0 : -1}\n disabled={disabled || mode === 'date' || isDisabled(dateOfISOWeek)}\n aria-selected={isWeekSelected(dateOfISOWeek) || undefined}\n aria-label={`${displayNames.of('weekOfYear')} ${weekNo.toString()} ${toUTCDateString(\n dateOfISOWeek,\n Intl.DateTimeFormat(locale, ariaOpts)\n )} - ${toUTCDateString(lastDayOfWeek, Intl.DateTimeFormat(locale, ariaOpts))}`}\n aria-current={isWeekFocused(dateOfISOWeek) ? 'date' : undefined}\n onMouseDown={() => {\n setFocusedDay(dateOfISOWeek);\n onFocus?.(dateOfISOWeek);\n onSelect?.(dateOfISOWeek);\n }}\n >\n {`${cap(displayNames.of('weekOfYear'))} `}\n {weekNo.toString()}\n </StyledPick>\n );\n });\n\n const weekLabel =\n mode === 'date' ? (\n <>\n <Text\n as={StyledWeekLabel}\n forwardedAs='abbr'\n title={cap(displayNames.of('weekOfYear'))}\n aria-hidden='true'\n >\n {cap(displayNamesShort.of('weekOfYear'))}\n </Text>\n <ScreenReaderOnly>{displayNames.of('weekOfYear')}</ScreenReaderOnly>\n </>\n ) : (\n <Text as={StyledWeekLabel}>{cap(displayNames.of('weekOfYear'))}</Text>\n );\n\n const headerLabels = names.map(([name, abbr]) => (\n <th role='columnheader' key={name}>\n <Text as={StyledColumnLabel} forwardedAs='abbr' key={name} title={name} aria-hidden='true'>\n {abbr}\n </Text>\n <ScreenReaderOnly>{name}</ScreenReaderOnly>\n </th>\n ));\n\n const splitToWeeks = (resultArray: JSX.Element[][], item: JSX.Element, index: number) => {\n const chunkIndex = Math.floor(index / 7);\n\n if (!resultArray[chunkIndex]) {\n resultArray[chunkIndex] = [] as JSX.Element[];\n }\n\n resultArray[chunkIndex].push(item);\n return resultArray;\n };\n\n const cells = days.reduce(splitToWeeks, []).map((week, index) => {\n const rowHeader = mode === 'week' ? weeksButtons[index] : weeks[index];\n return (\n // eslint-disable-next-line react/no-array-index-key\n <tr key={`week-${index}`}>\n {showWeekLabel && <th scope='row'>{rowHeader}</th>}\n {week.map((day, dayIndex) => {\n // eslint-disable-next-line react/no-array-index-key\n return <td key={`day-${dayIndex}`}>{day}</td>;\n })}\n </tr>\n );\n });\n\n const weeksCells = weeksButtons.map((week, index) => {\n return (\n // eslint-disable-next-line react/no-array-index-key\n <tr key={`week-${index}`}>\n <td>{week}</td>\n </tr>\n );\n });\n\n const weeksGrid = (\n <StyledWeekGrid role='grid' onKeyDown={onKeyDown} ref={containerRef}>\n <thead>\n <tr>\n <th>{weekLabel}</th>\n </tr>\n </thead>\n <tbody>{weeksCells}</tbody>\n </StyledWeekGrid>\n );\n\n return (\n <>\n {mode === 'week' && weeksGrid}\n <StyledCalendar\n ref={mode === 'date' ? containerRef : undefined}\n aria-label={current.toLocaleString(locale, {\n month: 'long',\n year: 'numeric',\n timeZone: 'UTC'\n })}\n onKeyDown={onKeyDown}\n aria-hidden={mode === 'week' ? true : undefined}\n role='grid'\n >\n <thead>\n <tr>\n {showWeekLabel && <th>{weekLabel}</th>}\n {headerLabels}\n </tr>\n </thead>\n <tbody>{cells}</tbody>\n </StyledCalendar>\n <ScreenReaderOnly aria-live='polite' role='alert'>\n {t('calendar_assist')}\n </ScreenReaderOnly>\n </>\n );\n }\n);\n\nexport default Calendar;\n"]}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
export declare const StyledPick: import("styled-components").StyledComponent<
|
|
2
|
-
export declare const StyledMonthPicker: import("styled-components").StyledComponent<"fieldset", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
-
export declare const StyledDatePicker: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
1
|
+
export declare const StyledPick: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../../Button").ButtonProps & import("../../..").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
4
2
|
export declare const StyledColumnLabel: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
5
3
|
export declare const ScreenReaderOnly: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
-
export declare const StyledDay: import("styled-components").StyledComponent<
|
|
4
|
+
export declare const StyledDay: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../../Button").ButtonProps & import("../../..").ForwardProps>, import("styled-components").DefaultTheme, {
|
|
7
5
|
current: boolean;
|
|
8
6
|
highlighted: boolean;
|
|
9
7
|
dayInNexOrPrevMonth: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/Calendar.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Calendar.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/Calendar.styles.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,UAAU,2MAiCrB,CAAC;AAIH,eAAO,MAAM,iBAAiB,0GAI7B,CAAC;AAIF,eAAO,MAAM,gBAAgB,0GAE5B,CAAC;AAEF,eAAO,MAAM,SAAS;aACX,OAAO;iBACH,OAAO;yBACC,OAAO;SAkC5B,CAAC;AAIH,eAAO,MAAM,eAAe,0GAc1B,CAAC;AAIH,eAAO,MAAM,gBAAgB,0GA8B3B,CAAC;AAIH,eAAO,MAAM,cAAc,2GAoBzB,CAAC;AAIH,eAAO,MAAM,cAAc,2GA2CzB,CAAC"}
|
|
@@ -1,72 +1,30 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { hideVisually, rgba
|
|
2
|
+
import { hideVisually, mix, readableColor, rgba, transparentize } from 'polished';
|
|
3
3
|
import { defaultThemeProp } from '../../../theme';
|
|
4
|
-
import { StyledSelect } from '../../Select/Select';
|
|
5
|
-
import { StyledButton } from '../../Button';
|
|
6
4
|
import { tryCatch } from '../../../utils';
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
import Button from '../../Button';
|
|
6
|
+
export const StyledPick = styled(Button)(props => {
|
|
7
|
+
const { theme: { base: { 'border-radius': borderRadius, palette: { interactive, dark }, spacing }, components: { card: { background } } } } = props;
|
|
8
|
+
const textColor = tryCatch(() => readableColor(interactive));
|
|
9
|
+
const disabledBackground = tryCatch(() => transparentize(0.5, mix(0.8, background, dark)));
|
|
9
10
|
return css `
|
|
10
11
|
height: 2.625rem;
|
|
11
12
|
border-radius: calc(0.5 * ${borderRadius});
|
|
12
13
|
padding: 0 ${spacing};
|
|
13
14
|
background-color: transparent;
|
|
14
15
|
|
|
15
|
-
& + & {
|
|
16
|
-
margin-inline-start: 0;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
16
|
&[aria-selected]:enabled {
|
|
20
17
|
background-color: ${interactive};
|
|
21
|
-
color: ${
|
|
18
|
+
color: ${textColor};
|
|
22
19
|
}
|
|
23
20
|
|
|
24
21
|
&:disabled {
|
|
25
|
-
background-color: ${
|
|
22
|
+
background-color: ${disabledBackground};
|
|
26
23
|
border-radius: 0;
|
|
27
24
|
}
|
|
28
|
-
|
|
29
|
-
&:focus {
|
|
30
|
-
outline: none;
|
|
31
|
-
box-shadow: inset 0 0 0 0.125rem ${colors.blue.light};
|
|
32
|
-
}
|
|
33
25
|
`;
|
|
34
26
|
});
|
|
35
27
|
StyledPick.defaultProps = defaultThemeProp;
|
|
36
|
-
export const StyledMonthPicker = styled.fieldset(props => {
|
|
37
|
-
const { theme: { base: { spacing, 'border-radius': baseBorderRadius, palette: { 'foreground-color': color } }, components: { 'form-control': formControl } } } = props;
|
|
38
|
-
return css `
|
|
39
|
-
margin: calc(2 * ${spacing}) calc(0.5 * ${spacing});
|
|
40
|
-
font-size: 0.875rem;
|
|
41
|
-
border: none;
|
|
42
|
-
|
|
43
|
-
${StyledSelect} {
|
|
44
|
-
border-radius: calc(${baseBorderRadius} * ${formControl['border-radius']});
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
${StyledButton} {
|
|
48
|
-
border-radius: calc(${baseBorderRadius} * ${formControl['border-radius']});
|
|
49
|
-
border: 0;
|
|
50
|
-
&:enabled {
|
|
51
|
-
color: ${color};
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
`;
|
|
55
|
-
});
|
|
56
|
-
StyledMonthPicker.defaultProps = defaultThemeProp;
|
|
57
|
-
export const StyledDatePicker = styled.div(props => {
|
|
58
|
-
const { theme: { base: { spacing }, components: { 'form-control': { 'foreground-color': foreground } } } } = props;
|
|
59
|
-
return css `
|
|
60
|
-
width: max-content;
|
|
61
|
-
|
|
62
|
-
${StyledButton} {
|
|
63
|
-
border: transparent;
|
|
64
|
-
color: ${foreground};
|
|
65
|
-
}
|
|
66
|
-
padding: 0 ${spacing} ${spacing} ${spacing};
|
|
67
|
-
`;
|
|
68
|
-
});
|
|
69
|
-
StyledDatePicker.defaultProps = defaultThemeProp;
|
|
70
28
|
export const StyledColumnLabel = styled.span `
|
|
71
29
|
text-align: center;
|
|
72
30
|
margin: 0 auto;
|
|
@@ -77,8 +35,8 @@ export const ScreenReaderOnly = styled.span `
|
|
|
77
35
|
${hideVisually}
|
|
78
36
|
`;
|
|
79
37
|
export const StyledDay = styled(StyledPick)(props => {
|
|
80
|
-
const { theme: { base: {
|
|
81
|
-
const highlightedBgColor = tryCatch(() =>
|
|
38
|
+
const { theme: { base: { palette: { interactive }, 'disabled-opacity': disabledOpacity } }, current, highlighted, dayInNexOrPrevMonth } = props;
|
|
39
|
+
const highlightedBgColor = tryCatch(() => rgba(interactive, 0.1));
|
|
82
40
|
return css `
|
|
83
41
|
background-color: ${highlighted ? highlightedBgColor : 'transparent'};
|
|
84
42
|
|
|
@@ -94,7 +52,6 @@ export const StyledDay = styled(StyledPick)(props => {
|
|
|
94
52
|
|
|
95
53
|
${current &&
|
|
96
54
|
css `
|
|
97
|
-
color: ${colors.slate.dark};
|
|
98
55
|
font-weight: bold;
|
|
99
56
|
`}
|
|
100
57
|
`;
|
|
@@ -112,12 +69,13 @@ export const StyledWeekLabel = styled(StyledColumnLabel)(props => {
|
|
|
112
69
|
});
|
|
113
70
|
StyledWeekLabel.defaultProps = defaultThemeProp;
|
|
114
71
|
export const StyledWeekNumber = styled.span(props => {
|
|
115
|
-
const { theme: { base: { breakpoints, spacing,
|
|
72
|
+
const { theme: { base: { breakpoints, spacing, 'disabled-opacity': disabledOpacity, palette: { dark } }, components: { card: { background: cardBackground } } } } = props;
|
|
73
|
+
const background = tryCatch(() => transparentize(0.5, mix(0.8, cardBackground, dark)));
|
|
116
74
|
return css `
|
|
117
75
|
line-height: 2.625rem;
|
|
118
76
|
padding: 0;
|
|
119
77
|
margin-inline-end: 0;
|
|
120
|
-
background-color: ${
|
|
78
|
+
background-color: ${background};
|
|
121
79
|
display: inline-block;
|
|
122
80
|
opacity: ${disabledOpacity};
|
|
123
81
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.styles.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/Calendar.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"Calendar.styles.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/Calendar.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAElF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,EAAE;IAC/C,MAAM,EACJ,KAAK,EAAE,EACL,IAAI,EAAE,EACJ,eAA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,CAAC;AAEjD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACjD,MAAM,EACJ,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,OAAO,EAAE,EAClB,EACF,GAAG,KAAK,CAAC;IACV,OAAO,GAAG,CAAA;;;;;;;0BAOc,OAAO;;;MAG3B,UAAU;2BACW,OAAO;;GAE/B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE/C,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACjD,MAAM,EACJ,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,eAAe,EAAE,YAAY,EAAE,OAAO,EAAE,EACjD,EACF,GAAG,KAAK,CAAC;IACV,OAAO,GAAG,CAAA;;;;;;;;;;;0BAWc,OAAO;;;;;;;;QAQzB,SAAS;;;;;;;UAOP,gBAAgB;sCACY,YAAY,gBAAgB,YAAY;;;;UAIpE,gBAAgB;0CACgB,YAAY,gBAAgB,YAAY;;;;GAI/E,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { hideVisually, mix, readableColor, rgba, transparentize } from 'polished';\n\nimport { defaultThemeProp } from '../../../theme';\nimport { tryCatch } from '../../../utils';\nimport Button from '../../Button';\n\nexport const StyledPick = styled(Button)(props => {\n const {\n theme: {\n base: {\n 'border-radius': borderRadius,\n palette: { interactive, dark },\n spacing\n },\n components: {\n card: { background }\n }\n }\n } = props;\n\n const textColor = tryCatch(() => readableColor(interactive));\n const disabledBackground = tryCatch(() => transparentize(0.5, mix(0.8, background, dark)));\n\n return css`\n height: 2.625rem;\n border-radius: calc(0.5 * ${borderRadius});\n padding: 0 ${spacing};\n background-color: transparent;\n\n &[aria-selected]:enabled {\n background-color: ${interactive};\n color: ${textColor};\n }\n\n &:disabled {\n background-color: ${disabledBackground};\n border-radius: 0;\n }\n `;\n});\n\nStyledPick.defaultProps = defaultThemeProp;\n\nexport const StyledColumnLabel = styled.span`\n text-align: center;\n margin: 0 auto;\n font-size: 0.75rem;\n`;\n\nStyledColumnLabel.defaultProps = defaultThemeProp;\n\nexport const ScreenReaderOnly = styled.span`\n ${hideVisually}\n`;\n\nexport const StyledDay = styled(StyledPick)<{\n current: boolean;\n highlighted: boolean;\n dayInNexOrPrevMonth: boolean;\n}>(props => {\n const {\n theme: {\n base: {\n palette: { interactive },\n 'disabled-opacity': disabledOpacity\n }\n },\n current,\n highlighted,\n dayInNexOrPrevMonth\n } = props;\n\n const highlightedBgColor = tryCatch(() => rgba(interactive, 0.1));\n\n return css`\n background-color: ${highlighted ? highlightedBgColor : 'transparent'};\n\n ${highlighted &&\n css`\n border-radius: 0;\n `}\n\n ${dayInNexOrPrevMonth &&\n css`\n opacity: ${disabledOpacity};\n `}\n\n ${current &&\n css`\n font-weight: bold;\n `}\n `;\n});\n\nStyledDay.defaultProps = defaultThemeProp;\n\nexport const StyledWeekLabel = styled(StyledColumnLabel)(props => {\n const {\n theme: {\n base: { spacing, breakpoints }\n }\n } = props;\n\n return css`\n margin-inline-end: 0;\n\n @media (min-width: ${breakpoints.sm}) {\n margin-inline-end: ${spacing};\n }\n `;\n});\n\nStyledWeekLabel.defaultProps = defaultThemeProp;\n\nexport const StyledWeekNumber = styled.span(props => {\n const {\n theme: {\n base: {\n breakpoints,\n spacing,\n 'disabled-opacity': disabledOpacity,\n palette: { dark }\n },\n components: {\n card: { background: cardBackground }\n }\n }\n } = props;\n\n const background = tryCatch(() => transparentize(0.5, mix(0.8, cardBackground, dark)));\n\n return css`\n line-height: 2.625rem;\n padding: 0;\n margin-inline-end: 0;\n background-color: ${background};\n display: inline-block;\n opacity: ${disabledOpacity};\n\n @media (min-width: ${breakpoints.sm}) {\n padding: 0 ${spacing};\n margin-inline-end: ${spacing};\n }\n `;\n});\n\nStyledWeekNumber.defaultProps = defaultThemeProp;\n\nexport const StyledWeekGrid = styled.table(props => {\n const {\n theme: {\n base: { spacing }\n }\n } = props;\n return css`\n table-layout: fixed;\n border-collapse: collapse;\n border-spacing: 0;\n\n thead {\n th {\n padding-bottom: ${spacing};\n }\n }\n ${StyledPick} {\n margin-inline-end: ${spacing};\n }\n `;\n});\n\nStyledWeekGrid.defaultProps = defaultThemeProp;\n\nexport const StyledCalendar = styled.table(props => {\n const {\n theme: {\n base: { 'border-radius': borderRadius, spacing }\n }\n } = props;\n return css`\n table-layout: fixed;\n border-collapse: collapse;\n border-spacing: 0;\n\n th {\n max-width: 2.625rem;\n }\n\n thead {\n th {\n padding-bottom: ${spacing};\n }\n }\n\n td {\n width: 2.625rem;\n max-width: 2.625rem;\n\n ${StyledDay} {\n width: 100%;\n }\n }\n\n tr {\n &:first-child {\n ${StyledWeekNumber} {\n border-radius: calc(0.5 * ${borderRadius}) calc(0.5 * ${borderRadius}) 0 0;\n }\n }\n &:last-child {\n ${StyledWeekNumber} {\n border-radius: 0 0 calc(0.5 * ${borderRadius}) calc(0.5 * ${borderRadius});\n }\n }\n }\n `;\n});\n\nStyledCalendar.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA+B,MAAM,OAAO,CAAC;AAavE,OAAO,eAAe,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA+B,MAAM,OAAO,CAAC;AAavE,OAAO,eAAe,MAAM,oBAAoB,CAAC;AAgBjD,QAAA,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,CA4FlD,CAAC;AAIF,eAAe,UAAU,CAAC"}
|
|
@@ -10,8 +10,9 @@ import { useConfiguration, useDirection, useI18n } from '../../../hooks';
|
|
|
10
10
|
import { getCalendarTypeFromLocale, toUTCDateString } from '../Input/utils';
|
|
11
11
|
import { CALENDAR_TYPES } from '../Input/local';
|
|
12
12
|
import Calendar from './Calendar';
|
|
13
|
-
import { ScreenReaderOnly
|
|
13
|
+
import { ScreenReaderOnly } from './Calendar.styles';
|
|
14
14
|
import { isValidDate } from './utils';
|
|
15
|
+
import { StyledDatePicker, StyledMonthPicker } from './DatePicker.styles';
|
|
15
16
|
registerIcon(caretLeftIcon, caretRightIcon);
|
|
16
17
|
const defaultProps = {
|
|
17
18
|
showWeekNumber: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/DatePicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAC7C,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,aAAa,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,cAAc,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"DatePicker.js","sourceRoot":"","sources":["../../../../src/components/Date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C;wBACzB,CAAC,gBACW,CAAC,CAAC,mBAAmB,CAAC,YAElC,KAAC,IAAI,IAAC,IAAI,EAAE,SAAS,GAAG,EAAE,GAAI,GACvB,IACJ,EACP,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAC,KAAK,YAC5C,KAAC,QAAQ,IACP,GAAG,EAAE,WAAW,EAChB,QAAQ,EAAE,QAAQ,IAAI,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EAClE,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,EACtE,cAAc,EAAE,cAAc,EAC9B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,IAAI,CAAC,EAAE;wBACd,UAAU,CAAC,IAAI,CAAC,CAAC;oBACnB,CAAC,EACD,QAAQ,EAAE,IAAI,CAAC,EAAE;wBACf,UAAU,CAAC,IAAI,CAAC,CAAC;wBACjB,WAAW,CAAC,IAAI,CAAC,CAAC;wBAClB,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;oBACnB,CAAC,EACD,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,GACR,GACG,IACU,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,UAAU,CAAC,YAAY,GAAG,YAAY,CAAC;AAEvC,eAAe,UAAU,CAAC","sourcesContent":["import { FunctionComponent, useState, useEffect, useRef } from 'react';\n\nimport Flex from '../../Flex';\nimport MonthInput from '../Input/MonthInput';\nimport Button from '../../Button';\nimport Icon, { registerIcon } from '../../Icon';\nimport * as caretLeftIcon from '../../Icon/icons/caret-left.icon';\nimport * as caretRightIcon from '../../Icon/icons/caret-right.icon';\nimport { useConfiguration, useDirection, useI18n } from '../../../hooks';\nimport { getCalendarTypeFromLocale, toUTCDateString } from '../Input/utils';\nimport { CALENDAR_TYPES } from '../Input/local';\n\nimport Calendar from './Calendar';\nimport DatePickerProps from './DatePicker.types';\nimport { ScreenReaderOnly } from './Calendar.styles';\nimport { isValidDate } from './utils';\nimport { StyledDatePicker, StyledMonthPicker } from './DatePicker.styles';\n\nregisterIcon(caretLeftIcon, caretRightIcon);\n\nconst defaultProps: Partial<DatePickerProps> = {\n showWeekNumber: false,\n mode: 'date'\n};\n\nfunction toDateString(date: Date | undefined) {\n return date ? toUTCDateString(date) : undefined;\n}\n\nconst DatePicker: FunctionComponent<DatePickerProps> = (props: DatePickerProps) => {\n const { locale } = useConfiguration();\n const { selected: initial, onChange, min, max, mode, showWeekNumber, ...restProps } = props;\n\n const [selected, setSelected] = useState(initial);\n const [current, setCurrent] = useState(selected && isValidDate(selected) ? selected : new Date());\n\n useEffect(() => {\n if (toDateString(initial) !== toDateString(selected)) {\n setSelected(initial);\n setCurrent(initial || new Date());\n }\n }, [toDateString(initial)]);\n\n const calendarRef = useRef<HTMLTableElement>(null);\n useEffect(() => {\n // need to postpone focusing to make sure onFocusWithin has been attached\n setTimeout(() => {\n calendarRef.current?.querySelector<HTMLElement>('button[tabindex=\"0\"]:enabled')?.focus();\n });\n }, []);\n\n const calendarType = getCalendarTypeFromLocale(locale);\n const t = useI18n();\n const { start, end } = useDirection();\n\n return (\n <StyledDatePicker aria-label={t('calendar')} role='region' {...restProps}>\n <Flex as={StyledMonthPicker} container={{ justify: 'between', alignItems: 'center' }}>\n <Button\n variant='simple'\n icon\n onClick={() => {\n const newCurrent = new Date(current);\n newCurrent.setUTCMonth(newCurrent.getUTCMonth() - 1);\n setCurrent(newCurrent);\n }}\n aria-label={t('picker_prev_month')}\n >\n <Icon name={`caret-${start}`} />\n </Button>\n <MonthInput\n value={current}\n required\n role='group'\n aria-label={t('picker_jump_to_month_and_year')}\n onChange={({ valueAsTimestamp }) => {\n const newCurrent = new Date(valueAsTimestamp!);\n newCurrent.setUTCDate(current.getUTCDate());\n setCurrent(newCurrent);\n }}\n min={min}\n max={max}\n />\n <ScreenReaderOnly aria-live='polite' role='alert'>\n {current.toLocaleString(locale, { month: 'long', year: 'numeric', timeZone: 'UTC' })}\n </ScreenReaderOnly>\n <Button\n variant='simple'\n icon\n onClick={() => {\n const newCurrent = new Date(current);\n newCurrent.setUTCMonth(newCurrent.getUTCMonth() + 1);\n setCurrent(newCurrent);\n }}\n aria-label={t('picker_next_month')}\n >\n <Icon name={`caret-${end}`} />\n </Button>\n </Flex>\n <Flex container={{ wrap: 'nowrap' }} dir='ltr'>\n <Calendar\n ref={calendarRef}\n selected={selected && isValidDate(selected) ? selected : undefined}\n current={current}\n calendarType={mode === 'date' ? calendarType : CALENDAR_TYPES.ISO_8601}\n showWeekNumber={showWeekNumber}\n mode={mode}\n onFocus={date => {\n setCurrent(date);\n }}\n onSelect={date => {\n setCurrent(date);\n setSelected(date);\n onChange?.(date);\n }}\n min={min}\n max={max}\n />\n </Flex>\n </StyledDatePicker>\n );\n};\n\nDatePicker.defaultProps = defaultProps;\n\nexport default DatePicker;\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const StyledMonthPicker: import("styled-components").StyledComponent<"fieldset", import("styled-components").DefaultTheme, {}, never>;
|
|
2
|
+
export declare const StyledDatePicker: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
+
//# sourceMappingURL=DatePicker.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePicker.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/DatePicker.styles.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,iBAAiB,8GA4B5B,CAAC;AAIH,eAAO,MAAM,gBAAgB,yGAkB3B,CAAC"}
|