@pega/cosmos-react-core 4.0.0-dev.1.2 → 4.0.0-dev.10.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.map +1 -1
- package/lib/components/Actions/Actions.js +11 -5
- package/lib/components/Actions/Actions.js.map +1 -1
- package/lib/components/AdditionalInfo/AdditionalInfo.d.ts +2 -0
- package/lib/components/AdditionalInfo/AdditionalInfo.d.ts.map +1 -1
- package/lib/components/AdditionalInfo/AdditionalInfo.js +24 -15
- package/lib/components/AdditionalInfo/AdditionalInfo.js.map +1 -1
- package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.js +4 -3
- package/lib/components/AppShell/AppHeader.js.map +1 -1
- package/lib/components/AppShell/AppHeader.styles.d.ts +2 -0
- package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.styles.js +43 -33
- package/lib/components/AppShell/AppHeader.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js +37 -13
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts +4 -1
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +57 -20
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.types.d.ts +30 -0
- 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 +2 -0
- package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellContext.js +2 -0
- package/lib/components/AppShell/AppShellContext.js.map +1 -1
- package/lib/components/AppShell/AppShellList.d.ts +1 -1
- package/lib/components/AppShell/AppShellList.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellList.js +6 -2
- package/lib/components/AppShell/AppShellList.js.map +1 -1
- package/lib/components/AppShell/AppShellList.styles.d.ts +1 -1
- package/lib/components/AppShell/AppShellList.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellList.styles.js +21 -19
- package/lib/components/AppShell/AppShellList.styles.js.map +1 -1
- package/lib/components/AppShell/AppShellSearch.styles.js +1 -1
- package/lib/components/AppShell/AppShellSearch.styles.js.map +1 -1
- package/lib/components/AppShell/ContextSwitcher.d.ts +6 -0
- package/lib/components/AppShell/ContextSwitcher.d.ts.map +1 -0
- package/lib/components/AppShell/ContextSwitcher.js +18 -0
- package/lib/components/AppShell/ContextSwitcher.js.map +1 -0
- package/lib/components/AppShell/Drawer.d.ts.map +1 -1
- package/lib/components/AppShell/Drawer.js +8 -9
- package/lib/components/AppShell/Drawer.js.map +1 -1
- package/lib/components/AppShell/Drawer.styles.d.ts.map +1 -1
- package/lib/components/AppShell/Drawer.styles.js +7 -4
- package/lib/components/AppShell/Drawer.styles.js.map +1 -1
- package/lib/components/AppShell/NavigationList.d.ts.map +1 -1
- package/lib/components/AppShell/NavigationList.js +15 -12
- package/lib/components/AppShell/NavigationList.js.map +1 -1
- package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -1
- package/lib/components/AppShell/NavigationListItemWrapper.js +4 -2
- package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -1
- package/lib/components/AppShell/index.d.ts +2 -1
- package/lib/components/AppShell/index.d.ts.map +1 -1
- package/lib/components/AppShell/index.js +1 -0
- package/lib/components/AppShell/index.js.map +1 -1
- package/lib/components/Avatar/Avatar.d.ts +1 -1
- package/lib/components/Avatar/Avatar.d.ts.map +1 -1
- package/lib/components/Backdrop/Backdrop.d.ts.map +1 -1
- package/lib/components/Backdrop/Backdrop.js +22 -2
- package/lib/components/Backdrop/Backdrop.js.map +1 -1
- package/lib/components/Badges/Count.d.ts +2 -2
- package/lib/components/Badges/Count.d.ts.map +1 -1
- package/lib/components/Badges/Count.js +22 -25
- package/lib/components/Badges/Count.js.map +1 -1
- package/lib/components/Badges/Selection.js +1 -1
- package/lib/components/Badges/Selection.js.map +1 -1
- package/lib/components/Badges/Tag.js +1 -1
- package/lib/components/Badges/Tag.js.map +1 -1
- package/lib/components/Banner/Banner.d.ts +28 -21
- package/lib/components/Banner/Banner.d.ts.map +1 -1
- package/lib/components/Banner/Banner.js +138 -96
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Banner/index.d.ts +1 -1
- package/lib/components/Banner/index.d.ts.map +1 -1
- package/lib/components/Banner/index.js.map +1 -1
- package/lib/components/Button/Button.d.ts +1 -1
- package/lib/components/Button/Button.d.ts.map +1 -1
- package/lib/components/Card/Card.d.ts +4 -7
- package/lib/components/Card/Card.d.ts.map +1 -1
- package/lib/components/Card/Card.js +2 -9
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.styles.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.styles.js +0 -3
- package/lib/components/ComboBox/ComboBox.styles.js.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +1 -3
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
- package/lib/components/Configuration/Configuration.d.ts +4 -1
- package/lib/components/Configuration/Configuration.d.ts.map +1 -1
- package/lib/components/Configuration/Configuration.js +2 -0
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/CreditCard/CreditCard.types.d.ts +1 -1
- package/lib/components/CreditCard/CreditCard.types.d.ts.map +1 -1
- package/lib/components/DateTime/DateTime.types.d.ts +10 -7
- 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/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +19 -4
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.d.ts +4 -2
- package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.js +71 -34
- package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +26 -5
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +1 -1
- package/lib/components/DateTime/Input/DayOfWeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/NumberUnit.d.ts +1 -1
- package/lib/components/DateTime/Input/Duration/NumberUnit.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/Time.d.ts +1 -1
- package/lib/components/DateTime/Input/Duration/Time.d.ts.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.js +8 -3
- package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
- package/lib/components/DateTime/Input/PartInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/PartInput.js +2 -2
- package/lib/components/DateTime/Input/PartInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.js +13 -3
- package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts +4 -2
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.js +70 -27
- package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.js +7 -2
- package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
- package/lib/components/DateTime/Input/usePickerButton.d.ts.map +1 -1
- package/lib/components/DateTime/Input/usePickerButton.js +19 -27
- package/lib/components/DateTime/Input/usePickerButton.js.map +1 -1
- package/lib/components/DateTime/Input/utils.d.ts +2 -2
- package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Input/utils.js +6 -17
- 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 +3 -1
- package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.js +2 -8
- package/lib/components/DateTime/Picker/DatePicker.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 +1 -1
- package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
- package/lib/components/Dialog/Dialog.d.ts +3 -30
- package/lib/components/Dialog/Dialog.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.js +7 -147
- package/lib/components/Dialog/Dialog.js.map +1 -1
- package/lib/components/Dialog/Dialog.styles.d.ts +3 -0
- package/lib/components/Dialog/Dialog.styles.d.ts.map +1 -0
- package/lib/components/Dialog/Dialog.styles.js +18 -0
- package/lib/components/Dialog/Dialog.styles.js.map +1 -0
- package/lib/components/Dialog/Dialog.types.d.ts +87 -0
- package/lib/components/Dialog/Dialog.types.d.ts.map +1 -0
- package/lib/components/Dialog/Dialog.types.js +3 -0
- package/lib/components/Dialog/Dialog.types.js.map +1 -0
- package/lib/components/Dialog/FormDialog.d.ts +7 -0
- package/lib/components/Dialog/FormDialog.d.ts.map +1 -0
- package/lib/components/Dialog/FormDialog.js +58 -0
- package/lib/components/Dialog/FormDialog.js.map +1 -0
- package/lib/components/Dialog/InfoDialog.d.ts +6 -0
- package/lib/components/Dialog/InfoDialog.d.ts.map +1 -0
- package/lib/components/Dialog/InfoDialog.js +43 -0
- package/lib/components/Dialog/InfoDialog.js.map +1 -0
- package/lib/components/Dialog/index.d.ts +3 -2
- package/lib/components/Dialog/index.d.ts.map +1 -1
- package/lib/components/Dialog/index.js +2 -2
- package/lib/components/Dialog/index.js.map +1 -1
- package/lib/components/Drawer/Drawer.d.ts +1 -1
- package/lib/components/Drawer/Drawer.d.ts.map +1 -1
- package/lib/components/EmojiPicker/EmojiPicker.d.ts +1 -1
- package/lib/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.js +2 -1
- package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.d.ts +2 -2
- package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.js +5 -36
- package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/FieldValueList/index.d.ts +1 -1
- package/lib/components/FieldValueList/index.d.ts.map +1 -1
- 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/Flex/Flex.d.ts +2 -2
- package/lib/components/Flex/Flex.d.ts.map +1 -1
- package/lib/components/FormControl/FormControl.d.ts +4 -0
- package/lib/components/FormControl/FormControl.d.ts.map +1 -1
- package/lib/components/FormControl/FormControl.js +3 -1
- package/lib/components/FormControl/FormControl.js.map +1 -1
- package/lib/components/FormControl/index.d.ts +1 -0
- package/lib/components/FormControl/index.d.ts.map +1 -1
- package/lib/components/FormControl/index.js.map +1 -1
- package/lib/components/Grid/Grid.types.d.ts +2 -2
- package/lib/components/Grid/Grid.types.d.ts.map +1 -1
- package/lib/components/HTML/HTML.d.ts.map +1 -1
- package/lib/components/HTML/HTML.js +1 -0
- package/lib/components/HTML/HTML.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 -0
- package/lib/components/Icon/iconNames.js.map +1 -1
- package/lib/components/Icon/icons/user-question-mark-solid.icon.d.ts +4 -0
- package/lib/components/Icon/icons/user-question-mark-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/user-question-mark-solid.icon.js +6 -0
- package/lib/components/Icon/icons/user-question-mark-solid.icon.js.map +1 -0
- package/lib/components/Icon/icons/user-question-mark.icon.d.ts +4 -0
- package/lib/components/Icon/icons/user-question-mark.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/user-question-mark.icon.js +6 -0
- package/lib/components/Icon/icons/user-question-mark.icon.js.map +1 -0
- package/lib/components/Lightbox/Lightbox.styles.js +2 -2
- package/lib/components/Lightbox/Lightbox.styles.js.map +1 -1
- package/lib/components/Link/Link.d.ts.map +1 -1
- package/lib/components/Link/Link.js +13 -4
- 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 +5 -37
- package/lib/components/List/CommaSeparatedList.js.map +1 -1
- package/lib/components/List/List.d.ts.map +1 -1
- package/lib/components/List/List.js +11 -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 +106 -68
- package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts +5 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.js +50 -5
- package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.d.ts +5 -5
- package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
- package/lib/components/LiveLog/Context.d.ts +3 -0
- package/lib/components/LiveLog/Context.d.ts.map +1 -0
- package/lib/components/LiveLog/Context.js +9 -0
- package/lib/components/LiveLog/Context.js.map +1 -0
- package/lib/components/LiveLog/LiveLog.d.ts +10 -0
- package/lib/components/LiveLog/LiveLog.d.ts.map +1 -0
- package/lib/components/LiveLog/LiveLog.js +99 -0
- package/lib/components/LiveLog/LiveLog.js.map +1 -0
- package/lib/components/LiveLog/LiveLog.styles.d.ts +3 -0
- package/lib/components/LiveLog/LiveLog.styles.d.ts.map +1 -0
- package/lib/components/LiveLog/LiveLog.styles.js +9 -0
- package/lib/components/LiveLog/LiveLog.styles.js.map +1 -0
- package/lib/components/LiveLog/LiveLog.types.d.ts +93 -0
- package/lib/components/LiveLog/LiveLog.types.d.ts.map +1 -0
- package/lib/components/LiveLog/LiveLog.types.js +2 -0
- package/lib/components/LiveLog/LiveLog.types.js.map +1 -0
- package/lib/components/LiveLog/index.d.ts +4 -0
- package/lib/components/LiveLog/index.d.ts.map +1 -0
- package/lib/components/LiveLog/index.js +3 -0
- package/lib/components/LiveLog/index.js.map +1 -0
- package/lib/components/Location/CurrentLocationButton.d.ts +1 -1
- package/lib/components/Location/CurrentLocationButton.d.ts.map +1 -1
- package/lib/components/Location/LocationInput.d.ts.map +1 -1
- package/lib/components/Location/LocationInput.js +1 -2
- package/lib/components/Location/LocationInput.js.map +1 -1
- package/lib/components/Location/LocationView.d.ts.map +1 -1
- package/lib/components/Location/LocationView.js +4 -4
- package/lib/components/Location/LocationView.js.map +1 -1
- package/lib/components/Location/MapsContext.d.ts +1 -1
- package/lib/components/Location/MapsContext.d.ts.map +1 -1
- package/lib/components/Location/utils.d.ts +1 -1
- package/lib/components/Location/utils.d.ts.map +1 -1
- package/lib/components/Location/utils.js.map +1 -1
- package/lib/components/Menu/Menu.js +3 -3
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/Menu.styles.js +1 -1
- package/lib/components/Menu/Menu.styles.js.map +1 -1
- package/lib/components/Menu/Menu.types.d.ts +3 -5
- 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/MenuList.d.ts.map +1 -1
- package/lib/components/Menu/MenuList.js +4 -3
- package/lib/components/Menu/MenuList.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +26 -5
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/Modal.js +6 -8
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/Modal.types.d.ts +2 -1
- package/lib/components/Modal/Modal.types.d.ts.map +1 -1
- package/lib/components/Modal/Modal.types.js.map +1 -1
- package/lib/components/Number/NumberInput.types.d.ts +3 -1
- 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.map +1 -1
- package/lib/components/Number/NumberRangeInput.js +71 -4
- package/lib/components/Number/NumberRangeInput.js.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.js +15 -4
- package/lib/components/PageTemplates/CategorySubPage.js.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.styles.d.ts.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.styles.js +5 -0
- package/lib/components/PageTemplates/CategorySubPage.styles.js.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.js +16 -2
- package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js +20 -3
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/Popover/Popover.d.ts +1 -1
- package/lib/components/Popover/Popover.d.ts.map +1 -1
- package/lib/components/Popover/Popover.js +2 -5
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/Popover.styles.d.ts +0 -1
- package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
- package/lib/components/Popover/Popover.styles.js +0 -6
- package/lib/components/Popover/Popover.styles.js.map +1 -1
- package/lib/components/Popover/modifiers.d.ts +0 -2
- package/lib/components/Popover/modifiers.d.ts.map +1 -1
- package/lib/components/Popover/modifiers.js +1 -32
- package/lib/components/Popover/modifiers.js.map +1 -1
- package/lib/components/Progress/Bar.d.ts +0 -3
- package/lib/components/Progress/Bar.d.ts.map +1 -1
- package/lib/components/Progress/Bar.js +1 -54
- package/lib/components/Progress/Bar.js.map +1 -1
- package/lib/components/Progress/Ellipsis.d.ts +0 -1
- package/lib/components/Progress/Ellipsis.d.ts.map +1 -1
- package/lib/components/Progress/Ellipsis.js +1 -72
- package/lib/components/Progress/Ellipsis.js.map +1 -1
- package/lib/components/Progress/Progress.d.ts.map +1 -1
- package/lib/components/Progress/Progress.js +99 -60
- package/lib/components/Progress/Progress.js.map +1 -1
- package/lib/components/Progress/Progress.styles.d.ts +12 -0
- package/lib/components/Progress/Progress.styles.d.ts.map +1 -0
- package/lib/components/Progress/Progress.styles.js +217 -0
- package/lib/components/Progress/Progress.styles.js.map +1 -0
- package/lib/components/Progress/Progress.types.d.ts +19 -2
- package/lib/components/Progress/Progress.types.d.ts.map +1 -1
- package/lib/components/Progress/Progress.types.js.map +1 -1
- package/lib/components/Progress/Ring.d.ts +0 -3
- package/lib/components/Progress/Ring.d.ts.map +1 -1
- package/lib/components/Progress/Ring.js +1 -58
- package/lib/components/Progress/Ring.js.map +1 -1
- package/lib/components/Progress/index.d.ts +1 -3
- package/lib/components/Progress/index.d.ts.map +1 -1
- package/lib/components/Progress/index.js +1 -3
- package/lib/components/Progress/index.js.map +1 -1
- package/lib/components/QRCode/QRCode.d.ts +14 -0
- package/lib/components/QRCode/QRCode.d.ts.map +1 -0
- package/lib/components/QRCode/QRCode.js +39 -0
- package/lib/components/QRCode/QRCode.js.map +1 -0
- package/lib/components/QRCode/index.d.ts +3 -0
- package/lib/components/QRCode/index.d.ts.map +1 -0
- package/lib/components/QRCode/index.js +2 -0
- package/lib/components/QRCode/index.js.map +1 -0
- package/lib/components/RadioCheck/RadioCheck.js +1 -1
- package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts +2 -2
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.js +28 -8
- package/lib/components/SearchInput/SearchInput.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.styles.js +1 -1
- package/lib/components/SearchInput/SearchInput.styles.js.map +1 -1
- package/lib/components/ShowMoreLess/ShowMoreLess.d.ts +9 -0
- package/lib/components/ShowMoreLess/ShowMoreLess.d.ts.map +1 -0
- package/lib/components/ShowMoreLess/ShowMoreLess.js +41 -0
- package/lib/components/ShowMoreLess/ShowMoreLess.js.map +1 -0
- package/lib/components/ShowMoreLess/index.d.ts +3 -0
- package/lib/components/ShowMoreLess/index.d.ts.map +1 -0
- package/lib/components/ShowMoreLess/index.js +2 -0
- package/lib/components/ShowMoreLess/index.js.map +1 -0
- package/lib/components/SkipLinks/SkipLinks.d.ts.map +1 -1
- package/lib/components/SkipLinks/SkipLinks.js +3 -26
- package/lib/components/SkipLinks/SkipLinks.js.map +1 -1
- package/lib/components/Slider/Slider.styles.d.ts +1 -1
- package/lib/components/Slider/Slider.styles.d.ts.map +1 -1
- package/lib/components/Tabs/Tab.js +2 -2
- package/lib/components/Tabs/Tab.js.map +1 -1
- package/lib/components/Tabs/Tabs.d.ts.map +1 -1
- package/lib/components/Tabs/Tabs.js +8 -10
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/TextArea/TextArea.js +2 -2
- package/lib/components/TextArea/TextArea.js.map +1 -1
- package/lib/components/Toaster/Context.d.ts +1 -0
- package/lib/components/Toaster/Context.d.ts.map +1 -1
- package/lib/components/Toaster/Context.js.map +1 -1
- package/lib/components/Toaster/Toaster.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.js +6 -2
- package/lib/components/Toaster/Toaster.js.map +1 -1
- package/lib/components/Tree/StandardTree.d.ts.map +1 -1
- package/lib/components/Tree/StandardTree.js +70 -27
- package/lib/components/Tree/StandardTree.js.map +1 -1
- package/lib/components/Tree/StandardTree.styles.d.ts +1 -0
- package/lib/components/Tree/StandardTree.styles.d.ts.map +1 -1
- package/lib/components/Tree/StandardTree.styles.js +32 -18
- package/lib/components/Tree/StandardTree.styles.js.map +1 -1
- package/lib/components/Tree/StandardTree.types.d.ts +28 -1
- package/lib/components/Tree/StandardTree.types.d.ts.map +1 -1
- package/lib/components/Tree/StandardTree.types.js.map +1 -1
- package/lib/components/Tree/Tree.d.ts +2 -2
- package/lib/components/Tree/Tree.d.ts.map +1 -1
- package/lib/components/Tree/helpers.d.ts +11 -9
- package/lib/components/Tree/helpers.d.ts.map +1 -1
- package/lib/components/Tree/helpers.js +25 -5
- package/lib/components/Tree/helpers.js.map +1 -1
- package/lib/components/Tree/index.d.ts +1 -1
- package/lib/components/Tree/index.d.ts.map +1 -1
- package/lib/components/Tree/index.js.map +1 -1
- package/lib/components/URL/URLDisplay.d.ts +2 -2
- package/lib/components/URL/URLDisplay.d.ts.map +1 -1
- package/lib/components/URL/URLDisplay.js +8 -1
- package/lib/components/URL/URLDisplay.js.map +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useActiveDescendant.d.ts +2 -2
- package/lib/hooks/useActiveDescendant.d.ts.map +1 -1
- package/lib/hooks/useArrows.d.ts.map +1 -1
- package/lib/hooks/useArrows.js +3 -3
- package/lib/hooks/useArrows.js.map +1 -1
- package/lib/hooks/useBreakpoint.d.ts.map +1 -1
- package/lib/hooks/useBreakpoint.js +3 -2
- package/lib/hooks/useBreakpoint.js.map +1 -1
- package/lib/hooks/useEvent.d.ts +2 -2
- package/lib/hooks/useEvent.d.ts.map +1 -1
- package/lib/hooks/useI18n.d.ts +88 -19
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useLiveLog.d.ts +8 -0
- package/lib/hooks/useLiveLog.d.ts.map +1 -0
- package/lib/hooks/useLiveLog.js +16 -0
- package/lib/hooks/useLiveLog.js.map +1 -0
- package/lib/hooks/useOverride.d.ts +1 -1
- package/lib/hooks/useOverride.d.ts.map +1 -1
- package/lib/hooks/useScrollStick.d.ts +1 -1
- package/lib/hooks/useScrollStick.d.ts.map +1 -1
- package/lib/i18n/default.d.ts +88 -19
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +98 -27
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +90 -21
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/i18n/translate.d.ts +1 -1
- package/lib/i18n/translate.d.ts.map +1 -1
- package/lib/index.d.ts +6 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +6 -1
- package/lib/index.js.map +1 -1
- package/lib/register-contexts.js +2 -0
- package/lib/register-contexts.js.map +1 -1
- package/lib/styles/gradients.d.ts +1 -1
- package/lib/styles/gradients.d.ts.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 +10 -10
- package/lib/styles/utils.js.map +1 -1
- package/lib/theme/ThemeMachine.d.ts +3 -3
- package/lib/theme/ThemeMachine.d.ts.map +1 -1
- package/lib/theme/ThemeMachine.js +30 -30
- package/lib/theme/ThemeMachine.js.map +1 -1
- package/lib/theme/theme.d.ts +45 -75
- package/lib/theme/theme.d.ts.map +1 -1
- package/lib/theme/themeDefinition.json +14 -30
- package/lib/theme/themeOverrides.schema.json +1 -4
- package/lib/theme/themes/darkTheme.json +4 -1
- package/lib/theme/themes/legacyBuildTheme.json +2 -3
- package/lib/types/types.d.ts +19 -11
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/types.js.map +1 -1
- package/lib/utils/bindAll.d.ts +4 -0
- package/lib/utils/bindAll.d.ts.map +1 -0
- package/lib/utils/bindAll.js +9 -0
- package/lib/utils/bindAll.js.map +1 -0
- package/lib/utils/cap.d.ts +4 -0
- package/lib/utils/cap.d.ts.map +1 -0
- package/lib/utils/cap.js +6 -0
- package/lib/utils/cap.js.map +1 -0
- package/lib/utils/createStringMatcher.d.ts +10 -0
- package/lib/utils/createStringMatcher.d.ts.map +1 -0
- package/lib/utils/createStringMatcher.js +21 -0
- package/lib/utils/createStringMatcher.js.map +1 -0
- package/lib/utils/createUID.d.ts +4 -0
- package/lib/utils/createUID.d.ts.map +1 -0
- package/lib/utils/createUID.js +6 -0
- package/lib/utils/createUID.js.map +1 -0
- package/lib/utils/debounce.d.ts +4 -0
- package/lib/utils/debounce.d.ts.map +1 -0
- package/lib/utils/debounce.js +14 -0
- package/lib/utils/debounce.js.map +1 -0
- package/lib/utils/deepGet.d.ts +3 -0
- package/lib/utils/deepGet.d.ts.map +1 -0
- package/lib/utils/deepGet.js +15 -0
- package/lib/utils/deepGet.js.map +1 -0
- package/lib/utils/deepObjectComparison.d.ts +4 -0
- package/lib/utils/deepObjectComparison.d.ts.map +1 -0
- package/lib/utils/deepObjectComparison.js +35 -0
- package/lib/utils/deepObjectComparison.js.map +1 -0
- package/lib/utils/defineSmartGetter.d.ts +3 -0
- package/lib/utils/defineSmartGetter.d.ts.map +1 -0
- package/lib/utils/defineSmartGetter.js +14 -0
- package/lib/utils/defineSmartGetter.js.map +1 -0
- package/lib/utils/documentIsAvailable.d.ts +3 -0
- package/lib/utils/documentIsAvailable.d.ts.map +1 -0
- package/lib/utils/documentIsAvailable.js +3 -0
- package/lib/utils/documentIsAvailable.js.map +1 -0
- package/lib/utils/escapeRegExp.d.ts +8 -0
- package/lib/utils/escapeRegExp.d.ts.map +1 -0
- package/lib/utils/escapeRegExp.js +8 -0
- package/lib/utils/escapeRegExp.js.map +1 -0
- package/lib/utils/focusHeadingOrContainer.d.ts +8 -0
- package/lib/utils/focusHeadingOrContainer.d.ts.map +1 -0
- package/lib/utils/focusHeadingOrContainer.js +29 -0
- package/lib/utils/focusHeadingOrContainer.js.map +1 -0
- package/lib/utils/formatListToLocaleString.d.ts +15 -0
- package/lib/utils/formatListToLocaleString.d.ts.map +1 -0
- package/lib/utils/formatListToLocaleString.js +17 -0
- package/lib/utils/formatListToLocaleString.js.map +1 -0
- package/lib/utils/getActiveElement.d.ts +8 -0
- package/lib/utils/getActiveElement.d.ts.map +1 -0
- package/lib/utils/getActiveElement.js +18 -0
- package/lib/utils/getActiveElement.js.map +1 -0
- package/lib/utils/getFocusables.d.ts +9 -0
- package/lib/utils/getFocusables.d.ts.map +1 -0
- package/lib/utils/getFocusables.js +15 -0
- package/lib/utils/getFocusables.js.map +1 -0
- package/lib/utils/getScrollbarWidth.d.ts +4 -0
- package/lib/utils/getScrollbarWidth.d.ts.map +1 -0
- package/lib/utils/getScrollbarWidth.js +17 -0
- package/lib/utils/getScrollbarWidth.js.map +1 -0
- package/lib/utils/hasProp.d.ts +4 -0
- package/lib/utils/hasProp.d.ts.map +1 -0
- package/lib/utils/hasProp.js +6 -0
- package/lib/utils/hasProp.js.map +1 -0
- package/lib/utils/index.d.ts +27 -1
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +27 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/loadScript.d.ts +3 -0
- package/lib/utils/loadScript.d.ts.map +1 -0
- package/lib/utils/loadScript.js +9 -0
- package/lib/utils/loadScript.js.map +1 -0
- package/lib/utils/navigatorIsAvailable.d.ts +3 -0
- package/lib/utils/navigatorIsAvailable.d.ts.map +1 -0
- package/lib/utils/navigatorIsAvailable.js +3 -0
- package/lib/utils/navigatorIsAvailable.js.map +1 -0
- package/lib/utils/normalizeElements.d.ts +9 -0
- package/lib/utils/normalizeElements.d.ts.map +1 -0
- package/lib/utils/normalizeElements.js +14 -0
- package/lib/utils/normalizeElements.js.map +1 -0
- package/lib/utils/range.d.ts +4 -0
- package/lib/utils/range.d.ts.map +1 -0
- package/lib/utils/range.js +8 -0
- package/lib/utils/range.js.map +1 -0
- package/lib/utils/reflow.d.ts +4 -0
- package/lib/utils/reflow.d.ts.map +1 -0
- package/lib/utils/reflow.js +7 -0
- package/lib/utils/reflow.js.map +1 -0
- package/lib/utils/replaceMatchWithElement.d.ts +4 -0
- package/lib/utils/replaceMatchWithElement.d.ts.map +1 -0
- package/lib/utils/replaceMatchWithElement.js +32 -0
- package/lib/utils/replaceMatchWithElement.js.map +1 -0
- package/lib/utils/sameOrigin.d.ts +7 -0
- package/lib/utils/sameOrigin.d.ts.map +1 -0
- package/lib/utils/sameOrigin.js +25 -0
- package/lib/utils/sameOrigin.js.map +1 -0
- package/lib/utils/testElForOverflow.d.ts +4 -0
- package/lib/utils/testElForOverflow.d.ts.map +1 -0
- package/lib/utils/testElForOverflow.js +6 -0
- package/lib/utils/testElForOverflow.js.map +1 -0
- package/lib/utils/triple.d.ts +12 -0
- package/lib/utils/triple.d.ts.map +1 -0
- package/lib/utils/triple.js +13 -0
- package/lib/utils/triple.js.map +1 -0
- package/lib/utils/tryCatch.d.ts +5 -0
- package/lib/utils/tryCatch.d.ts.map +1 -0
- package/lib/utils/tryCatch.js +16 -0
- package/lib/utils/tryCatch.js.map +1 -0
- package/lib/utils/windowIsAvailable.d.ts +3 -0
- package/lib/utils/windowIsAvailable.d.ts.map +1 -0
- package/lib/utils/windowIsAvailable.js +3 -0
- package/lib/utils/windowIsAvailable.js.map +1 -0
- package/package.json +4 -2
- package/lib/components/ListToolbar/QueryOptionPopover.d.ts +0 -12
- package/lib/components/ListToolbar/QueryOptionPopover.d.ts.map +0 -1
- package/lib/components/ListToolbar/QueryOptionPopover.js +0 -36
- package/lib/components/ListToolbar/QueryOptionPopover.js.map +0 -1
- package/lib/utils/utils.d.ts +0 -93
- package/lib/utils/utils.d.ts.map +0 -1
- package/lib/utils/utils.js +0 -287
- package/lib/utils/utils.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
2
|
import { BaseProps, ForwardProps } from '../../../types';
|
|
3
3
|
import { ClockFormat } from '../Input/utils';
|
|
4
|
-
export
|
|
4
|
+
export type MinuteInterval = 15 | 30 | 60;
|
|
5
5
|
export interface TimePickerProps extends BaseProps {
|
|
6
6
|
/**
|
|
7
7
|
* Defines default time that will be selected when the Time Picker is opened.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/TimePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA2C,MAAM,OAAO,CAAC;AAInF,OAAO,EAAE,SAAS,EAAU,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGjE,OAAO,EAAE,WAAW,EAAoB,MAAM,gBAAgB,CAAC;AAI/D,
|
|
1
|
+
{"version":3,"file":"TimePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/TimePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA2C,MAAM,OAAO,CAAC;AAInF,OAAO,EAAE,SAAS,EAAU,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGjE,OAAO,EAAE,WAAW,EAAoB,MAAM,gBAAgB,CAAC;AAI/D,MAAM,MAAM,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAE1C,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD;;;OAGG;IACH,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,kDAAkD;IAClD,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAqDD,QAAA,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,GAAG,YAAY,CA+GjE,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -42,7 +42,7 @@ const StyledTimeButton = styled.button `
|
|
|
42
42
|
|
|
43
43
|
&:enabled:focus,
|
|
44
44
|
&:not([disabled]):focus {
|
|
45
|
-
box-shadow:
|
|
45
|
+
box-shadow: ${props => props.theme.base.shadow['focus-inset']};
|
|
46
46
|
}
|
|
47
47
|
`;
|
|
48
48
|
StyledTimeButton.defaultProps = defaultThemeProp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimePicker.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/TimePicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACnF,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAe,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAuB/C,MAAM,gBAAgB,GAAG,MAAM,CAAC,EAAE,CAAA;;;;;CAKjC,CAAC;AAEF,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEjD,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAiB;;;;;;;;;;;sBAWjC,KAAK,CAAC,EAAE,CAC1B,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa;;;;;6BAKnD,CAAC,EAAE,KAAK,EAAE,EAAE,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C,cAAc,IAAC,IAAI,EAAC,cAAc,YACjC,KAAC,gBAAgB,IACf,IAAI,EAAC,UAAU,EACf,EAAE,EAAE,MAAM,EACV,OAAO,EAAC,QAAQ,EAChB,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,gBAC9B,IAAI,EAChB,QAAQ,EAAE,UAAU,CAAC,IAAI,CAAC,kBACZ,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EACnD,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,EACzB,OAAO,EAAE,GAAG,EAAE;wBACZ,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;oBACnB,CAAC,EACD,QAAQ,EAAC,IAAI,YAEZ,UAAU,CAAC,IAAI,CAAC,GACA,IAhBoB,EAAE,CAiB1B,CAClB,CAAC;QACJ,CAAC,CAAC,GACe,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { FunctionComponent, useCallback, useEffect, useMemo, useRef } from 'react';\nimport styled from 'styled-components';\n\nimport { defaultThemeProp } from '../../../theme';\nimport { BaseProps, Action, ForwardProps } from '../../../types';\nimport Button from '../../Button';\nimport { useArrows, useConfiguration, useElement } from '../../../hooks';\nimport { ClockFormat, is12HClockFormat } from '../Input/utils';\n\nimport { getIntervalGenerator } from './utils';\n\nexport type MinuteInterval = 15 | 30 | 60;\n\nexport interface TimePickerProps extends BaseProps {\n /**\n * Defines default time that will be selected when the Time Picker is opened.\n * @default new Date()\n */\n selected?: Date;\n /** Callback fired when selected value changes. */\n onSelect: (date: Date) => void;\n /**\n * Defines interval for time picker options (in minutes).\n * @default 30\n */\n interval?: MinuteInterval;\n /**\n * Defines clock format that overrides locale based format\n */\n clockFormat?: ClockFormat;\n}\n\nconst StyledTimePicker = styled.ul`\n list-style: none;\n max-height: 10rem;\n overflow: auto;\n width: 100%;\n`;\n\nStyledTimePicker.defaultProps = defaultThemeProp;\n\nconst StyledTimeButton = styled.button<TimePickerProps>`\n color: black;\n width: 100%;\n border-radius: inherit;\n overflow: hidden;\n text-align: start;\n text-overflow: ellipsis;\n white-space: nowrap;\n border-width: 0;\n justify-content: start;\n padding: 0;\n background-color: ${props =>\n props.selected ? props.theme.base.colors.blue['extra-light'] : 'transparent'};\n\n > span {\n margin-inline-end: 0.125rem;\n &:first-child {\n margin-inline-start: ${({ theme }) => theme.components['form-control']['border-width']};\n }\n &:nth-child(2) {\n margin-inline-start: 0.125rem;\n }\n &:first-child,\n &:nth-child(3) {\n padding-inline-start: 0.5rem;\n }\n }\n\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: inset ${props => props.theme.base.shadow.focus};\n }\n`;\n\nStyledTimeButton.defaultProps = defaultThemeProp;\n\nconst StyledTimeItem = styled.li`\n border-radius: 0;\n`;\n\nStyledTimeItem.defaultProps = defaultThemeProp;\n\nconst TimePicker: FunctionComponent<TimePickerProps & ForwardProps> = (props: TimePickerProps) => {\n const { locale } = useConfiguration();\n const { selected = new Date(0), interval = 30, clockFormat, onSelect, ...restProps } = props;\n\n const intervalInMS = interval * 60000;\n\n const { hourCycle: defaultHourCycle } = useMemo(\n () =>\n new Intl.DateTimeFormat(locale, {\n hour: '2-digit',\n hour12: clockFormat ? clockFormat === 12 : is12HClockFormat(locale)\n }).resolvedOptions(),\n [clockFormat, locale]\n );\n\n const actionsList = Array.from(getIntervalGenerator(intervalInMS), time => {\n const date = new Date(selected);\n date.setUTCHours(time.getUTCHours(), time.getUTCMinutes());\n return {\n id: date.getTime().toString(),\n text: Intl.DateTimeFormat(locale, {\n hour: '2-digit',\n minute: '2-digit',\n timeZone: 'UTC',\n /** Use this to fix Chrome https://bugs.chromium.org/p/chromium/issues/detail?id=1045791 */\n hourCycle: defaultHourCycle === 'h24' ? 'h23' : defaultHourCycle\n }).format(date)\n };\n });\n\n const isSelected = (date: Date) => {\n return (\n selected?.getUTCHours() === date.getUTCHours() &&\n selected?.getUTCMinutes() === date.getUTCMinutes()\n );\n };\n\n const [buttonEl, setButtonEl] = useElement<HTMLElement>();\n const menuRef = useRef<HTMLUListElement>(null);\n\n useArrows(menuRef, {\n selector: 'button',\n cycle: true,\n dir: 'up-down',\n allowTabFocus: false\n });\n\n const renderTime = (text: string) => {\n const [hour, minute, meridiem] = text.split(/:| /);\n return (\n <>\n <span>{hour}</span>:<span>{minute}</span>\n {meridiem && <span>{meridiem}</span>}\n </>\n );\n };\n\n const setTabIndexes = useCallback(() => {\n const focusEl = menuRef.current;\n if (!focusEl) return;\n const focusableElements = Array.from(focusEl.querySelectorAll('button'));\n\n if (focusableElements.length > 0) {\n let isChecked = false;\n focusableElements.slice(1).forEach(item => {\n const checked = (item as HTMLInputElement).checked;\n if (checked) {\n isChecked = true;\n item.tabIndex = 0;\n } else item.tabIndex = -1;\n });\n\n if (!isChecked) {\n (focusableElements[0] as HTMLElement).tabIndex = 0;\n focusableElements[0].focus();\n }\n }\n }, [selected]);\n\n useEffect(() => {\n buttonEl?.focus();\n setTabIndexes();\n }, [buttonEl]);\n\n return (\n <StyledTimePicker role='menu' tabIndex={-1} ref={menuRef} {...restProps}>\n {actionsList.map(({ text, id }: Action) => {\n const item = new Date(Number(id));\n return (\n <StyledTimeItem role='presentation' key={id}>\n <StyledTimeButton\n role='menuitem'\n as={Button}\n variant='simple'\n ref={isSelected(item) ? setButtonEl : null}\n aria-label={text}\n selected={isSelected(item)}\n aria-current={isSelected(item) ? 'time' : undefined}\n checked={isSelected(item)}\n onClick={() => {\n onSelect?.(item);\n }}\n tabIndex='-1'\n >\n {renderTime(text)}\n </StyledTimeButton>\n </StyledTimeItem>\n );\n })}\n </StyledTimePicker>\n );\n};\n\nexport default TimePicker;\n"]}
|
|
1
|
+
{"version":3,"file":"TimePicker.js","sourceRoot":"","sources":["../../../../src/components/DateTime/Picker/TimePicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,WAAW,EAA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C;oBACnB,CAAC,EACD,QAAQ,EAAC,IAAI,YAEZ,UAAU,CAAC,IAAI,CAAC,GACA,IAhBoB,EAAE,CAiB1B,CAClB,CAAC;QACJ,CAAC,CAAC,GACe,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { FunctionComponent, useCallback, useEffect, useMemo, useRef } from 'react';\nimport styled from 'styled-components';\n\nimport { defaultThemeProp } from '../../../theme';\nimport { BaseProps, Action, ForwardProps } from '../../../types';\nimport Button from '../../Button';\nimport { useArrows, useConfiguration, useElement } from '../../../hooks';\nimport { ClockFormat, is12HClockFormat } from '../Input/utils';\n\nimport { getIntervalGenerator } from './utils';\n\nexport type MinuteInterval = 15 | 30 | 60;\n\nexport interface TimePickerProps extends BaseProps {\n /**\n * Defines default time that will be selected when the Time Picker is opened.\n * @default new Date()\n */\n selected?: Date;\n /** Callback fired when selected value changes. */\n onSelect: (date: Date) => void;\n /**\n * Defines interval for time picker options (in minutes).\n * @default 30\n */\n interval?: MinuteInterval;\n /**\n * Defines clock format that overrides locale based format\n */\n clockFormat?: ClockFormat;\n}\n\nconst StyledTimePicker = styled.ul`\n list-style: none;\n max-height: 10rem;\n overflow: auto;\n width: 100%;\n`;\n\nStyledTimePicker.defaultProps = defaultThemeProp;\n\nconst StyledTimeButton = styled.button<TimePickerProps>`\n color: black;\n width: 100%;\n border-radius: inherit;\n overflow: hidden;\n text-align: start;\n text-overflow: ellipsis;\n white-space: nowrap;\n border-width: 0;\n justify-content: start;\n padding: 0;\n background-color: ${props =>\n props.selected ? props.theme.base.colors.blue['extra-light'] : 'transparent'};\n\n > span {\n margin-inline-end: 0.125rem;\n &:first-child {\n margin-inline-start: ${({ theme }) => theme.components['form-control']['border-width']};\n }\n &:nth-child(2) {\n margin-inline-start: 0.125rem;\n }\n &:first-child,\n &:nth-child(3) {\n padding-inline-start: 0.5rem;\n }\n }\n\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: ${props => props.theme.base.shadow['focus-inset']};\n }\n`;\n\nStyledTimeButton.defaultProps = defaultThemeProp;\n\nconst StyledTimeItem = styled.li`\n border-radius: 0;\n`;\n\nStyledTimeItem.defaultProps = defaultThemeProp;\n\nconst TimePicker: FunctionComponent<TimePickerProps & ForwardProps> = (props: TimePickerProps) => {\n const { locale } = useConfiguration();\n const { selected = new Date(0), interval = 30, clockFormat, onSelect, ...restProps } = props;\n\n const intervalInMS = interval * 60000;\n\n const { hourCycle: defaultHourCycle } = useMemo(\n () =>\n new Intl.DateTimeFormat(locale, {\n hour: '2-digit',\n hour12: clockFormat ? clockFormat === 12 : is12HClockFormat(locale)\n }).resolvedOptions(),\n [clockFormat, locale]\n );\n\n const actionsList = Array.from(getIntervalGenerator(intervalInMS), time => {\n const date = new Date(selected);\n date.setUTCHours(time.getUTCHours(), time.getUTCMinutes());\n return {\n id: date.getTime().toString(),\n text: Intl.DateTimeFormat(locale, {\n hour: '2-digit',\n minute: '2-digit',\n timeZone: 'UTC',\n /** Use this to fix Chrome https://bugs.chromium.org/p/chromium/issues/detail?id=1045791 */\n hourCycle: defaultHourCycle === 'h24' ? 'h23' : defaultHourCycle\n }).format(date)\n };\n });\n\n const isSelected = (date: Date) => {\n return (\n selected?.getUTCHours() === date.getUTCHours() &&\n selected?.getUTCMinutes() === date.getUTCMinutes()\n );\n };\n\n const [buttonEl, setButtonEl] = useElement<HTMLElement>();\n const menuRef = useRef<HTMLUListElement>(null);\n\n useArrows(menuRef, {\n selector: 'button',\n cycle: true,\n dir: 'up-down',\n allowTabFocus: false\n });\n\n const renderTime = (text: string) => {\n const [hour, minute, meridiem] = text.split(/:| /);\n return (\n <>\n <span>{hour}</span>:<span>{minute}</span>\n {meridiem && <span>{meridiem}</span>}\n </>\n );\n };\n\n const setTabIndexes = useCallback(() => {\n const focusEl = menuRef.current;\n if (!focusEl) return;\n const focusableElements = Array.from(focusEl.querySelectorAll('button'));\n\n if (focusableElements.length > 0) {\n let isChecked = false;\n focusableElements.slice(1).forEach(item => {\n const checked = (item as HTMLInputElement).checked;\n if (checked) {\n isChecked = true;\n item.tabIndex = 0;\n } else item.tabIndex = -1;\n });\n\n if (!isChecked) {\n (focusableElements[0] as HTMLElement).tabIndex = 0;\n focusableElements[0].focus();\n }\n }\n }, [selected]);\n\n useEffect(() => {\n buttonEl?.focus();\n setTabIndexes();\n }, [buttonEl]);\n\n return (\n <StyledTimePicker role='menu' tabIndex={-1} ref={menuRef} {...restProps}>\n {actionsList.map(({ text, id }: Action) => {\n const item = new Date(Number(id));\n return (\n <StyledTimeItem role='presentation' key={id}>\n <StyledTimeButton\n role='menuitem'\n as={Button}\n variant='simple'\n ref={isSelected(item) ? setButtonEl : null}\n aria-label={text}\n selected={isSelected(item)}\n aria-current={isSelected(item) ? 'time' : undefined}\n checked={isSelected(item)}\n onClick={() => {\n onSelect?.(item);\n }}\n tabIndex='-1'\n >\n {renderTime(text)}\n </StyledTimeButton>\n </StyledTimeItem>\n );\n })}\n </StyledTimePicker>\n );\n};\n\nexport default TimePicker;\n"]}
|
|
@@ -1,32 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export interface DialogProps extends BaseProps {
|
|
5
|
-
target: HTMLElement | null;
|
|
6
|
-
placement?: PopoverProps['placement'];
|
|
7
|
-
children: PopoverProps['children'];
|
|
8
|
-
heading: string;
|
|
9
|
-
headingHidden?: boolean;
|
|
10
|
-
onSubmit?: (arg: {
|
|
11
|
-
close: () => void;
|
|
12
|
-
}) => void;
|
|
13
|
-
onClose?: () => void;
|
|
14
|
-
onOpen?: () => void;
|
|
15
|
-
loading?: boolean;
|
|
16
|
-
ref?: Ref<HTMLDivElement>;
|
|
17
|
-
}
|
|
18
|
-
export declare const StyledDialog: import("styled-components").StyledComponent<"dialog", import("styled-components").DefaultTheme, {}, never>;
|
|
19
|
-
export declare const StyledDialogTitle: import("styled-components").StyledComponent<FunctionComponent<import("../Text").TextProps & ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
20
|
-
export declare const useDialog: () => {
|
|
21
|
-
target: HTMLElement | null;
|
|
22
|
-
loading: boolean;
|
|
23
|
-
setLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
24
|
-
events: {
|
|
25
|
-
onMouseDown: (e: ReactMouseEvent) => void;
|
|
26
|
-
onKeyDown: (e: ReactKeyboardEvent) => void;
|
|
27
|
-
};
|
|
28
|
-
setTargetWithEvent: (e: ReactMouseEvent | ReactKeyboardEvent) => void;
|
|
29
|
-
};
|
|
30
|
-
declare const Dialog: FunctionComponent<DialogProps & ForwardProps>;
|
|
1
|
+
import { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { DialogProps } from './Dialog.types';
|
|
3
|
+
declare const Dialog: FC<DialogProps & HTMLAttributes<HTMLDivElement>>;
|
|
31
4
|
export default Dialog;
|
|
32
5
|
//# sourceMappingURL=Dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAKxE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,QAAA,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,GAAG,cAAc,CAAC,cAAc,CAAC,CAkC5D,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,150 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import { forwardRef
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { CardContent, CardFooter, CardHeader } from '../Card';
|
|
9
|
-
import Icon from '../Icon';
|
|
10
|
-
import Popover from '../Popover';
|
|
11
|
-
import Progress from '../Progress';
|
|
12
|
-
import Text from '../Text';
|
|
13
|
-
import VisuallyHiddenText from '../VisuallyHiddenText';
|
|
14
|
-
export const StyledDialog = styled.dialog(({ theme: { base: { 'content-width': contentWidth, palette: { 'foreground-color': foregroundColor } } } }) => {
|
|
15
|
-
return css `
|
|
16
|
-
border: none;
|
|
17
|
-
min-width: ${contentWidth.sm};
|
|
18
|
-
max-width: ${contentWidth.lg};
|
|
19
|
-
color: ${foregroundColor};
|
|
20
|
-
`;
|
|
21
|
-
});
|
|
22
|
-
StyledDialog.defaultProps = defaultThemeProp;
|
|
23
|
-
export const StyledDialogTitle = styled(Text)(({ theme: { base: { shadow, 'border-radius': borderRadius } } }) => {
|
|
24
|
-
return css `
|
|
25
|
-
position: relative;
|
|
26
|
-
::after {
|
|
27
|
-
content: '';
|
|
28
|
-
border-radius: ${borderRadius};
|
|
29
|
-
position: absolute;
|
|
30
|
-
inset: -0.25rem;
|
|
31
|
-
}
|
|
32
|
-
:focus-visible {
|
|
33
|
-
outline: none;
|
|
34
|
-
::after {
|
|
35
|
-
box-shadow: ${shadow.focus}, inset ${shadow['focus-solid']};
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
39
|
-
});
|
|
40
|
-
StyledDialogTitle.defaultProps = defaultThemeProp;
|
|
41
|
-
export const useDialog = () => {
|
|
42
|
-
const [target, setTarget] = useState(null);
|
|
43
|
-
const [loading, setLoading] = useState(false);
|
|
44
|
-
const setTargetWithEvent = (e) => {
|
|
45
|
-
if (e.target instanceof HTMLElement) {
|
|
46
|
-
setTarget(e.target);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
return {
|
|
50
|
-
target,
|
|
51
|
-
loading,
|
|
52
|
-
setLoading,
|
|
53
|
-
events: {
|
|
54
|
-
onMouseDown: (e) => {
|
|
55
|
-
setTargetWithEvent(e);
|
|
56
|
-
},
|
|
57
|
-
onKeyDown: (e) => {
|
|
58
|
-
if (e.key === 'Enter') {
|
|
59
|
-
setTargetWithEvent(e);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
setTargetWithEvent
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
const Dialog = forwardRef(({ target, placement, heading, headingHidden = false, onSubmit, onClose, onOpen, loading, children, ...restProps }, ref) => {
|
|
67
|
-
const t = useI18n();
|
|
68
|
-
const headingId = useUID();
|
|
69
|
-
const [popoverEl, setPopoverEl] = useElement();
|
|
70
|
-
const popoverRef = useConsolidatedRef(ref, setPopoverEl);
|
|
71
|
-
const headingRef = useRef(null);
|
|
72
|
-
const [currentTarget, setCurrentTarget] = useState(() => target);
|
|
73
|
-
const [show, setShow] = useState(false);
|
|
74
|
-
const skipChangeShow = useRef(false);
|
|
75
|
-
const prevTarget = usePrevious(target);
|
|
76
|
-
useEscape(() => {
|
|
77
|
-
if (show) {
|
|
78
|
-
setShow(false);
|
|
79
|
-
}
|
|
80
|
-
}, undefined, [show, setShow]);
|
|
81
|
-
useOuterEvent('mousedown', [target, popoverEl], () => {
|
|
82
|
-
if (target && popoverEl && show) {
|
|
83
|
-
setShow(false);
|
|
84
|
-
onClose?.();
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
useFocusTrap(popoverRef);
|
|
88
|
-
useEffect(() => {
|
|
89
|
-
if (!show) {
|
|
90
|
-
currentTarget?.focus();
|
|
91
|
-
}
|
|
92
|
-
}, [show]);
|
|
93
|
-
useEffect(() => {
|
|
94
|
-
if (show && popoverEl) {
|
|
95
|
-
if (headingRef.current) {
|
|
96
|
-
headingRef.current.focus();
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
const focusables = getFocusables(popoverRef);
|
|
100
|
-
focusables[0]?.focus();
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}, [show, popoverEl]);
|
|
104
|
-
useLayoutEffect(() => {
|
|
105
|
-
const onTargetClick = (e) => {
|
|
106
|
-
setCurrentTarget(prev => (e.target ? e.target : prev));
|
|
107
|
-
if (!skipChangeShow.current) {
|
|
108
|
-
setShow(prev => !prev);
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
skipChangeShow.current = false;
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
if (target instanceof HTMLElement) {
|
|
115
|
-
target.addEventListener('click', onTargetClick);
|
|
116
|
-
}
|
|
117
|
-
return () => {
|
|
118
|
-
if (target instanceof HTMLElement) {
|
|
119
|
-
target.removeEventListener('click', onTargetClick);
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
}, [target]);
|
|
123
|
-
useEffect(() => {
|
|
124
|
-
if (show) {
|
|
125
|
-
onOpen?.();
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
onClose?.();
|
|
129
|
-
}
|
|
130
|
-
}, [show]);
|
|
131
|
-
useEffect(() => {
|
|
132
|
-
/* If our target is changing and the popover is already open we will want
|
|
133
|
-
to skip the next change. The next show change would come from a click on the new button,
|
|
134
|
-
the popover should stay open. */
|
|
135
|
-
if (target !== prevTarget && show) {
|
|
136
|
-
skipChangeShow.current = true;
|
|
137
|
-
}
|
|
138
|
-
}, [target, show]);
|
|
139
|
-
const onTitleKeyDown = (e) => {
|
|
140
|
-
const focusables = getFocusables(popoverRef);
|
|
141
|
-
if (e.shiftKey && e.key === 'Tab') {
|
|
142
|
-
e.preventDefault();
|
|
143
|
-
focusables[focusables.length - 1].focus();
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
const progress = loading ? _jsx(Progress, { placement: 'local' }) : null;
|
|
147
|
-
return (_jsxs(Popover, { ...restProps, as: StyledDialog, ref: popoverRef, target: currentTarget, placement: placement, show: show, open: show, "aria-labelledby": headingId, children: [_jsx(CardHeader, { actions: !onSubmit ? (_jsx(Button, { icon: true, variant: 'simple', onClick: () => setShow(false), "aria-label": t('close'), children: _jsx(Icon, { name: 'times' }) })) : undefined, children: headingHidden ? (_jsx(VisuallyHiddenText, { id: headingId, children: heading })) : (_jsx(StyledDialogTitle, { variant: 'h2', tabIndex: -1, ref: headingRef, onKeyDown: onTitleKeyDown, id: headingId, children: heading })) }), _jsxs(CardContent, { children: [children, progress] }), onSubmit && (_jsxs(CardFooter, { justify: 'between', children: [_jsx(Button, { variant: 'secondary', onClick: () => setShow(false), children: t('cancel') }), _jsx(Button, { variant: 'primary', onClick: () => onSubmit({ close: () => setShow(false) }), disabled: loading, children: t('submit') })] }))] }));
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { useConsolidatedRef } from '../../hooks';
|
|
4
|
+
import { StyledDialog } from './Dialog.styles';
|
|
5
|
+
const Dialog = forwardRef(({ target, labelledbyId, portal, strategy, placement, children, progress, ...restProps }, ref) => {
|
|
6
|
+
const dialogRef = useConsolidatedRef(ref);
|
|
7
|
+
return (_jsx(StyledDialog, { ...restProps, role: 'dialog', "aria-modal": 'false', "aria-labelledby": labelledbyId, "aria-busy": progress ? 'true' : 'false', ref: dialogRef, target: target, portal: portal, strategy: strategy, placement: placement, arrow: true, children: children }));
|
|
148
8
|
});
|
|
149
9
|
export default Dialog;
|
|
150
10
|
//# sourceMappingURL=Dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAIV,SAAS,EACT,eAAe,EACf,MAAM,EACN,QAAQ,EAGT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,YAAY,EACZ,OAAO,EACP,aAAa,EACb,WAAW,EACX,MAAM,EACP,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE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E,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,EACxD,QAAQ,EAAE,OAAO,YAEhB,CAAC,CAAC,QAAQ,CAAC,GACL,IACE,CACd,IACO,CACX,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n MouseEvent as ReactMouseEvent,\n KeyboardEvent as ReactKeyboardEvent\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n useConsolidatedRef,\n useElement,\n useEscape,\n useFocusTrap,\n useI18n,\n useOuterEvent,\n usePrevious,\n useUID\n} from '../../hooks';\nimport { defaultThemeProp } from '../../theme';\nimport { BaseProps, ForwardProps } from '../../types';\nimport { getFocusables } from '../../utils';\nimport Button from '../Button';\nimport { CardContent, CardFooter, CardHeader } from '../Card';\nimport Icon from '../Icon';\nimport Popover, { PopoverProps } from '../Popover';\nimport Progress from '../Progress';\nimport Text from '../Text';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\n\nexport interface DialogProps extends BaseProps {\n target: HTMLElement | null;\n placement?: PopoverProps['placement'];\n children: PopoverProps['children'];\n heading: string;\n headingHidden?: boolean;\n onSubmit?: (arg: { close: () => void }) => void;\n onClose?: () => void;\n onOpen?: () => void;\n loading?: boolean;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledDialog = styled.dialog(\n ({\n theme: {\n base: {\n 'content-width': contentWidth,\n palette: { 'foreground-color': foregroundColor }\n }\n }\n }) => {\n return css`\n border: none;\n min-width: ${contentWidth.sm};\n max-width: ${contentWidth.lg};\n color: ${foregroundColor};\n `;\n }\n);\n\nStyledDialog.defaultProps = defaultThemeProp;\n\nexport const StyledDialogTitle = styled(Text)(\n ({\n theme: {\n base: { shadow, 'border-radius': borderRadius }\n }\n }) => {\n return css`\n position: relative;\n ::after {\n content: '';\n border-radius: ${borderRadius};\n position: absolute;\n inset: -0.25rem;\n }\n :focus-visible {\n outline: none;\n ::after {\n box-shadow: ${shadow.focus}, inset ${shadow['focus-solid']};\n }\n }\n `;\n }\n);\n\nStyledDialogTitle.defaultProps = defaultThemeProp;\n\nexport const useDialog = () => {\n const [target, setTarget] = useState<HTMLElement | null>(null);\n const [loading, setLoading] = useState(false);\n\n const setTargetWithEvent = (e: ReactMouseEvent | ReactKeyboardEvent) => {\n if (e.target instanceof HTMLElement) {\n setTarget(e.target);\n }\n };\n\n return {\n target,\n loading,\n setLoading,\n events: {\n onMouseDown: (e: ReactMouseEvent) => {\n setTargetWithEvent(e);\n },\n onKeyDown: (e: ReactKeyboardEvent) => {\n if (e.key === 'Enter') {\n setTargetWithEvent(e);\n }\n }\n },\n setTargetWithEvent\n };\n};\n\nconst Dialog: FunctionComponent<DialogProps & ForwardProps> = forwardRef(\n (\n {\n target,\n placement,\n heading,\n headingHidden = false,\n onSubmit,\n onClose,\n onOpen,\n loading,\n children,\n ...restProps\n }: PropsWithoutRef<DialogProps>,\n ref: DialogProps['ref']\n ) => {\n const t = useI18n();\n const headingId = useUID();\n const [popoverEl, setPopoverEl] = useElement<HTMLDivElement>();\n const popoverRef = useConsolidatedRef(ref, setPopoverEl);\n const headingRef = useRef<HTMLSpanElement>(null);\n const [currentTarget, setCurrentTarget] = useState(() => target);\n const [show, setShow] = useState(false);\n const skipChangeShow = useRef(false);\n const prevTarget = usePrevious(target);\n useEscape(\n () => {\n if (show) {\n setShow(false);\n }\n },\n undefined,\n [show, setShow]\n );\n useOuterEvent('mousedown', [target, popoverEl], () => {\n if (target && popoverEl && show) {\n setShow(false);\n onClose?.();\n }\n });\n useFocusTrap(popoverRef);\n\n useEffect(() => {\n if (!show) {\n currentTarget?.focus();\n }\n }, [show]);\n\n useEffect(() => {\n if (show && popoverEl) {\n if (headingRef.current) {\n headingRef.current.focus();\n } else {\n const focusables = getFocusables(popoverRef);\n focusables[0]?.focus();\n }\n }\n }, [show, popoverEl]);\n\n useLayoutEffect(() => {\n const onTargetClick = (e: MouseEvent) => {\n setCurrentTarget(prev => (e.target ? (e.target as HTMLElement) : prev));\n if (!skipChangeShow.current) {\n setShow(prev => !prev);\n } else {\n skipChangeShow.current = false;\n }\n };\n if (target instanceof HTMLElement) {\n target.addEventListener('click', onTargetClick);\n }\n return () => {\n if (target instanceof HTMLElement) {\n target.removeEventListener('click', onTargetClick);\n }\n };\n }, [target]);\n\n useEffect(() => {\n if (show) {\n onOpen?.();\n } else {\n onClose?.();\n }\n }, [show]);\n\n useEffect(() => {\n /* If our target is changing and the popover is already open we will want\n to skip the next change. The next show change would come from a click on the new button,\n the popover should stay open. */\n if (target !== prevTarget && show) {\n skipChangeShow.current = true;\n }\n }, [target, show]);\n\n const onTitleKeyDown = (e: ReactKeyboardEvent) => {\n const focusables = getFocusables(popoverRef);\n if (e.shiftKey && e.key === 'Tab') {\n e.preventDefault();\n focusables[focusables.length - 1].focus();\n }\n };\n\n const progress = loading ? <Progress placement='local' /> : null;\n\n return (\n <Popover\n {...restProps}\n as={StyledDialog}\n ref={popoverRef}\n target={currentTarget}\n placement={placement}\n show={show}\n open={show}\n aria-labelledby={headingId}\n >\n <CardHeader\n actions={\n !onSubmit ? (\n <Button icon variant='simple' onClick={() => setShow(false)} aria-label={t('close')}>\n <Icon name='times' />\n </Button>\n ) : undefined\n }\n >\n {headingHidden ? (\n <VisuallyHiddenText id={headingId}>{heading}</VisuallyHiddenText>\n ) : (\n <StyledDialogTitle\n variant='h2'\n tabIndex={-1}\n ref={headingRef}\n onKeyDown={onTitleKeyDown}\n id={headingId}\n >\n {heading}\n </StyledDialogTitle>\n )}\n </CardHeader>\n <CardContent>\n {children}\n {progress}\n </CardContent>\n {onSubmit && (\n <CardFooter justify='between'>\n <Button variant='secondary' onClick={() => setShow(false)}>\n {t('cancel')}\n </Button>\n <Button\n variant='primary'\n onClick={() => onSubmit({ close: () => setShow(false) })}\n disabled={loading}\n >\n {t('submit')}\n </Button>\n </CardFooter>\n )}\n </Popover>\n );\n }\n);\n\nexport default Dialog;\n"]}
|
|
1
|
+
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAuC,MAAM,OAAO,CAAC;AAExE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,MAAM,MAAM,GAAqD,UAAU,CACzE,CACE,EACE,MAAM,EACN,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,GAAG,SAAS,EACiB,EAC/B,GAAuB,EACvB,EAAE;IACF,MAAM,SAAS,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAE1C,OAAO,CACL,KAAC,YAAY,OACP,SAAS,EACb,IAAI,EAAC,QAAQ,gBACF,OAAO,qBACD,YAAY,eAClB,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EACtC,GAAG,EAAE,SAAS,EACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,KAAK,kBAEJ,QAAQ,GACI,CAChB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { forwardRef, PropsWithoutRef, FC, HTMLAttributes } from 'react';\n\nimport { useConsolidatedRef } from '../../hooks';\n\nimport { StyledDialog } from './Dialog.styles';\nimport { DialogProps } from './Dialog.types';\n\nconst Dialog: FC<DialogProps & HTMLAttributes<HTMLDivElement>> = forwardRef(\n (\n {\n target,\n labelledbyId,\n portal,\n strategy,\n placement,\n children,\n progress,\n ...restProps\n }: PropsWithoutRef<DialogProps>,\n ref: DialogProps['ref']\n ) => {\n const dialogRef = useConsolidatedRef(ref);\n\n return (\n <StyledDialog\n {...restProps}\n role='dialog'\n aria-modal='false'\n aria-labelledby={labelledbyId}\n aria-busy={progress ? 'true' : 'false'}\n ref={dialogRef}\n target={target}\n portal={portal}\n strategy={strategy}\n placement={placement}\n arrow\n >\n {children}\n </StyledDialog>\n );\n }\n);\n\nexport default Dialog;\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const StyledChildrenWrap: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
2
|
+
export declare const StyledDialog: import("styled-components").StyledComponent<(<Modifiers extends string = string>(props: import("../Popover").PopoverProps<Modifiers> & import("../..").ForwardProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null), import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
+
//# sourceMappingURL=Dialog.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kBAAkB,yGAAe,CAAC;AAE/C,eAAO,MAAM,YAAY,8TAWvB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { defaultThemeProp } from '../../theme';
|
|
3
|
+
import Popover from '../Popover';
|
|
4
|
+
export const StyledChildrenWrap = styled.div ``;
|
|
5
|
+
export const StyledDialog = styled(Popover)(({ theme }) => {
|
|
6
|
+
return css `
|
|
7
|
+
min-width: ${theme.base['content-width'].sm};
|
|
8
|
+
max-width: ${theme.base['content-width'].lg};
|
|
9
|
+
|
|
10
|
+
&[aria-busy='true'] {
|
|
11
|
+
${StyledChildrenWrap} {
|
|
12
|
+
visibility: hidden;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
});
|
|
17
|
+
StyledDialog.defaultProps = defaultThemeProp;
|
|
18
|
+
//# sourceMappingURL=Dialog.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog.styles.js","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAE/C,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACxD,OAAO,GAAG,CAAA;iBACK,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE;iBAC9B,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE;;;QAGvC,kBAAkB;;;;GAIvB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,YAAY,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport Popover from '../Popover';\n\nexport const StyledChildrenWrap = styled.div``;\n\nexport const StyledDialog = styled(Popover)(({ theme }) => {\n return css`\n min-width: ${theme.base['content-width'].sm};\n max-width: ${theme.base['content-width'].lg};\n\n &[aria-busy='true'] {\n ${StyledChildrenWrap} {\n visibility: hidden;\n }\n }\n `;\n});\n\nStyledDialog.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { OmitStrict } from '../../types';
|
|
2
|
+
import { PopoverProps } from '../Popover';
|
|
3
|
+
import { ProgressProps } from '../Progress';
|
|
4
|
+
export interface BaseDialogProps {
|
|
5
|
+
/**
|
|
6
|
+
* A string to indicate context for the dialog. The dialog will be labelled by this value.
|
|
7
|
+
*/
|
|
8
|
+
heading: string;
|
|
9
|
+
/**
|
|
10
|
+
* In specific circumstances the heading can be visually hidden.
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
headingHidden?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* An element the dialog is contextually and visually associated with. Normally a triggering button.
|
|
16
|
+
* Components rendering Dialog should mount and unmount instances based on this value.
|
|
17
|
+
*/
|
|
18
|
+
target: HTMLElement;
|
|
19
|
+
/**
|
|
20
|
+
* Content for the dialog. Avoid form control buttons within as those should be rendered by way of onCancel and onSubmit with FormDialog.
|
|
21
|
+
*/
|
|
22
|
+
children: PopoverProps['children'];
|
|
23
|
+
/**
|
|
24
|
+
* If there is a progress state either on opening, or after submit, you must indicate as such. A custom message is supported as well.
|
|
25
|
+
*/
|
|
26
|
+
progress?: boolean | ProgressProps['message'];
|
|
27
|
+
/** Optionally render the dialog element at the end of the body or within a specified element. */
|
|
28
|
+
portal?: PopoverProps['portal'];
|
|
29
|
+
/** Positioning strategy for solving rendering scenarios. */
|
|
30
|
+
strategy?: PopoverProps['strategy'];
|
|
31
|
+
/**
|
|
32
|
+
* Intended positioning placement for the dialog element.
|
|
33
|
+
* Placement may auto adjust based on screen position and other layout variables.
|
|
34
|
+
*/
|
|
35
|
+
placement?: PopoverProps['placement'];
|
|
36
|
+
/**
|
|
37
|
+
* Reference to the dialog's root element.
|
|
38
|
+
*/
|
|
39
|
+
ref?: PopoverProps['ref'];
|
|
40
|
+
}
|
|
41
|
+
export interface DialogProps extends OmitStrict<BaseDialogProps, 'heading' | 'headingHidden'> {
|
|
42
|
+
/**
|
|
43
|
+
* The DOM id for the dialog's labelling element.
|
|
44
|
+
*/
|
|
45
|
+
labelledbyId: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A simple callback or an object to customize a subset button properties.
|
|
49
|
+
*/
|
|
50
|
+
type FormAction = (() => void) | {
|
|
51
|
+
text?: string;
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
handler: () => void;
|
|
54
|
+
};
|
|
55
|
+
export interface FormDialogProps extends BaseDialogProps {
|
|
56
|
+
/**
|
|
57
|
+
* Called when the user presses escape or clicks away.
|
|
58
|
+
*/
|
|
59
|
+
onDismiss?: () => void;
|
|
60
|
+
/**
|
|
61
|
+
* Renders a standard design system cancel button.
|
|
62
|
+
* If onDismiss is not provided, onCancel will be invoked when the user presses the Escape key or clicks outside of the dialog.
|
|
63
|
+
* Invocation of this indicates the user wishes to cancel any changes and close the dialog.
|
|
64
|
+
*/
|
|
65
|
+
onCancel: FormAction;
|
|
66
|
+
/**
|
|
67
|
+
* Renders a standard design system submit button.
|
|
68
|
+
* Invocation of this indicates the user wishes to submit any changes and close the dialog. Please consider progress states after submit.
|
|
69
|
+
*/
|
|
70
|
+
onSubmit: FormAction;
|
|
71
|
+
}
|
|
72
|
+
export interface InfoDialogProps extends BaseDialogProps {
|
|
73
|
+
/**
|
|
74
|
+
* Renders a standard design system dismiss button to close the dialog when the user clicks this button, presses escape or clicks away.
|
|
75
|
+
*/
|
|
76
|
+
onDismiss: () => void;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Components which render Dialog internally may need to offer some control to consuming components.
|
|
80
|
+
* Use this interface to offer an imperative handle for shared control.
|
|
81
|
+
*/
|
|
82
|
+
export interface DialogHandleValue {
|
|
83
|
+
open: () => void;
|
|
84
|
+
close: () => void;
|
|
85
|
+
}
|
|
86
|
+
export {};
|
|
87
|
+
//# sourceMappingURL=Dialog.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog.types.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;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@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog.types.js","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.types.ts"],"names":[],"mappings":"AAAA,wBAAwB","sourcesContent":["// cSpell:words dialog's\n\nimport { OmitStrict } from '../../types';\nimport { PopoverProps } from '../Popover';\nimport { ProgressProps } from '../Progress';\n\nexport interface BaseDialogProps {\n /**\n * A string to indicate context for the dialog. The dialog will be labelled by this value.\n */\n heading: string;\n\n /**\n * In specific circumstances the heading can be visually hidden.\n * @default false\n */\n headingHidden?: boolean;\n\n /**\n * An element the dialog is contextually and visually associated with. Normally a triggering button.\n * Components rendering Dialog should mount and unmount instances based on this value.\n */\n target: HTMLElement;\n\n /**\n * Content for the dialog. Avoid form control buttons within as those should be rendered by way of onCancel and onSubmit with FormDialog.\n */\n children: PopoverProps['children'];\n\n /**\n * If there is a progress state either on opening, or after submit, you must indicate as such. A custom message is supported as well.\n */\n progress?: boolean | ProgressProps['message'];\n\n /** Optionally render the dialog element at the end of the body or within a specified element. */\n portal?: PopoverProps['portal'];\n\n /** Positioning strategy for solving rendering scenarios. */\n strategy?: PopoverProps['strategy'];\n\n /**\n * Intended positioning placement for the dialog element.\n * Placement may auto adjust based on screen position and other layout variables.\n */\n placement?: PopoverProps['placement'];\n\n /**\n * Reference to the dialog's root element.\n */\n ref?: PopoverProps['ref'];\n}\n\nexport interface DialogProps extends OmitStrict<BaseDialogProps, 'heading' | 'headingHidden'> {\n /**\n * The DOM id for the dialog's labelling element.\n */\n labelledbyId: string;\n}\n\n/**\n * A simple callback or an object to customize a subset button properties.\n */\ntype FormAction =\n | (() => void)\n | {\n text?: string;\n disabled?: boolean;\n handler: () => void;\n };\n\nexport interface FormDialogProps extends BaseDialogProps {\n /**\n * Called when the user presses escape or clicks away.\n */\n onDismiss?: () => void;\n\n /**\n * Renders a standard design system cancel button.\n * If onDismiss is not provided, onCancel will be invoked when the user presses the Escape key or clicks outside of the dialog.\n * Invocation of this indicates the user wishes to cancel any changes and close the dialog.\n */\n onCancel: FormAction;\n\n /**\n * Renders a standard design system submit button.\n * Invocation of this indicates the user wishes to submit any changes and close the dialog. Please consider progress states after submit.\n */\n onSubmit: FormAction;\n}\n\nexport interface InfoDialogProps extends BaseDialogProps {\n /**\n * Renders a standard design system dismiss button to close the dialog when the user clicks this button, presses escape or clicks away.\n */\n onDismiss: () => void;\n}\n\n/**\n * Components which render Dialog internally may need to offer some control to consuming components.\n * Use this interface to offer an imperative handle for shared control.\n */\nexport interface DialogHandleValue {\n open: () => void;\n close: () => void;\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { OmitStrict } from '../../types';
|
|
3
|
+
import { FormDialogProps } from './Dialog.types';
|
|
4
|
+
export declare const StyledFormDialog: import("styled-components").StyledComponent<FC<import("./Dialog.types").DialogProps & HTMLAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
+
declare const FormDialog: FC<FormDialogProps & OmitStrict<HTMLAttributes<HTMLDivElement>, 'onSubmit'>>;
|
|
6
|
+
export default FormDialog;
|
|
7
|
+
//# sourceMappingURL=FormDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormDialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/FormDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuC,EAAE,EAAa,cAAc,EAAE,MAAM,OAAO,CAAC;AAiB3F,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjD,eAAO,MAAM,gBAAgB,6KAAmB,CAAC;AAEjD,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,GAAG,UAAU,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CA6G1F,CAAC;AAEJ,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useRef, useEffect } from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { useConsolidatedRef, useEscape, useFocusTrap, useI18n, useOuterEvent, useUID } from '../../hooks';
|
|
5
|
+
import { getFocusables } from '../../utils';
|
|
6
|
+
import Button from '../Button';
|
|
7
|
+
import Text from '../Text';
|
|
8
|
+
import { CardContent, CardFooter, CardHeader } from '../Card';
|
|
9
|
+
import Progress from '../Progress';
|
|
10
|
+
import VisuallyHiddenText from '../VisuallyHiddenText';
|
|
11
|
+
import { StyledChildrenWrap } from './Dialog.styles';
|
|
12
|
+
import Dialog from './Dialog';
|
|
13
|
+
export const StyledFormDialog = styled(Dialog) ``;
|
|
14
|
+
const FormDialog = forwardRef(({ target, heading, headingHidden = false, children, progress, onDismiss, onCancel, onSubmit, ...restProps }, ref) => {
|
|
15
|
+
const t = useI18n();
|
|
16
|
+
const headingId = useUID();
|
|
17
|
+
const dialogRef = useConsolidatedRef(ref);
|
|
18
|
+
const cancelButtonRef = useRef(null);
|
|
19
|
+
const onCancelHandler = typeof onCancel === 'function' ? onCancel : onCancel.handler;
|
|
20
|
+
useEscape(() => {
|
|
21
|
+
if (onDismiss) {
|
|
22
|
+
onDismiss();
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
onCancelHandler();
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
useOuterEvent('mousedown', [target, dialogRef], () => {
|
|
29
|
+
if (onDismiss) {
|
|
30
|
+
onDismiss();
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
onCancelHandler();
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
useFocusTrap(dialogRef);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (!progress) {
|
|
39
|
+
const focusables = getFocusables(dialogRef);
|
|
40
|
+
if (focusables[0])
|
|
41
|
+
focusables[0].focus();
|
|
42
|
+
}
|
|
43
|
+
}, [progress]);
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
return () => {
|
|
46
|
+
if (document.contains(target)) {
|
|
47
|
+
target.focus();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}, []);
|
|
51
|
+
return (_jsxs(StyledFormDialog, { ...restProps, target: target, labelledbyId: headingId, progress: progress, ref: dialogRef, children: [_jsx(CardHeader, { forwardedAs: 'div', children: headingHidden ? (_jsx(VisuallyHiddenText, { forwardedAs: 'h2', id: headingId, children: heading })) : (_jsx(Text, { id: headingId, variant: 'h2', children: heading })) }), _jsxs(CardContent, { children: [children && _jsx(StyledChildrenWrap, { children: children }), _jsx(Progress, { visible: !!progress, focusOnVisible: true, placement: children ? 'local' : 'block', message: typeof progress === 'string' ? progress : undefined })] }), _jsxs(CardFooter, { justify: 'between', forwardedAs: 'div', children: [_jsx(Button, { onClick: () => {
|
|
52
|
+
onCancelHandler();
|
|
53
|
+
}, disabled: typeof onCancel !== 'function' ? onCancel.disabled : undefined, ref: cancelButtonRef, children: typeof onCancel !== 'function' && onCancel.text ? onCancel.text : t('cancel') }), _jsx(Button, { variant: 'primary', onClick: () => {
|
|
54
|
+
(typeof onSubmit !== 'function' ? onSubmit.handler : onSubmit)();
|
|
55
|
+
}, disabled: typeof onSubmit !== 'function' ? onSubmit.disabled : undefined, children: typeof onSubmit !== 'function' && onSubmit.text ? onSubmit.text : t('submit') })] })] }));
|
|
56
|
+
});
|
|
57
|
+
export default FormDialog;
|
|
58
|
+
//# sourceMappingURL=FormDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormDialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/FormDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,EAAM,SAAS,EAAkB,MAAM,OAAO,CAAC;AAC3F,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAC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CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EACvC,OAAO,EAAE,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,GAC5D,IACU,EAEd,MAAC,UAAU,IAAC,OAAO,EAAC,SAAS,EAAC,WAAW,EAAC,KAAK,aAC7C,KAAC,MAAM,IACL,OAAO,EAAE,GAAG,EAAE;4BACZ,eAAe,EAAE,CAAC;wBACpB,CAAC,EACD,QAAQ,EAAE,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EACxE,GAAG,EAAE,eAAe,YAEnB,OAAO,QAAQ,KAAK,UAAU,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GACvE,EAET,KAAC,MAAM,IACL,OAAO,EAAC,SAAS,EACjB,OAAO,EAAE,GAAG,EAAE;4BACZ,CAAC,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;wBACnE,CAAC,EACD,QAAQ,EAAE,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,YAEvE,OAAO,QAAQ,KAAK,UAAU,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GACvE,IACE,IACI,CACpB,CAAC;AACJ,CAAC,CACF,CAAC;AAEJ,eAAe,UAAU,CAAC","sourcesContent":["import { forwardRef, PropsWithoutRef, useRef, FC, useEffect, HTMLAttributes } from 'react';\nimport styled from 'styled-components';\n\nimport {\n useConsolidatedRef,\n useEscape,\n useFocusTrap,\n useI18n,\n useOuterEvent,\n useUID\n} from '../../hooks';\nimport { getFocusables } from '../../utils';\nimport Button from '../Button';\nimport Text from '../Text';\nimport { CardContent, CardFooter, CardHeader } from '../Card';\nimport Progress from '../Progress';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\nimport { OmitStrict } from '../../types';\n\nimport { StyledChildrenWrap } from './Dialog.styles';\nimport { FormDialogProps } from './Dialog.types';\nimport Dialog from './Dialog';\n\nexport const StyledFormDialog = styled(Dialog)``;\n\nconst FormDialog: FC<FormDialogProps & OmitStrict<HTMLAttributes<HTMLDivElement>, 'onSubmit'>> =\n forwardRef(\n (\n {\n target,\n heading,\n headingHidden = false,\n children,\n progress,\n onDismiss,\n onCancel,\n onSubmit,\n ...restProps\n }: PropsWithoutRef<FormDialogProps>,\n ref: FormDialogProps['ref']\n ) => {\n const t = useI18n();\n const headingId = useUID();\n const dialogRef = useConsolidatedRef(ref);\n const cancelButtonRef = useRef<HTMLButtonElement>(null);\n const onCancelHandler = typeof onCancel === 'function' ? onCancel : onCancel.handler;\n\n useEscape(() => {\n if (onDismiss) {\n onDismiss();\n } else {\n onCancelHandler();\n }\n });\n\n useOuterEvent('mousedown', [target, dialogRef], () => {\n if (onDismiss) {\n onDismiss();\n } else {\n onCancelHandler();\n }\n });\n\n useFocusTrap(dialogRef);\n\n useEffect(() => {\n if (!progress) {\n const focusables = getFocusables(dialogRef);\n if (focusables[0]) focusables[0].focus();\n }\n }, [progress]);\n\n useEffect(() => {\n return () => {\n if (document.contains(target)) {\n target.focus();\n }\n };\n }, []);\n\n return (\n <StyledFormDialog\n {...restProps}\n target={target}\n labelledbyId={headingId}\n progress={progress}\n ref={dialogRef}\n >\n <CardHeader forwardedAs='div'>\n {headingHidden ? (\n <VisuallyHiddenText forwardedAs='h2' id={headingId}>\n {heading}\n </VisuallyHiddenText>\n ) : (\n <Text id={headingId} variant='h2'>\n {heading}\n </Text>\n )}\n </CardHeader>\n\n <CardContent>\n {children && <StyledChildrenWrap>{children}</StyledChildrenWrap>}\n <Progress\n visible={!!progress}\n focusOnVisible\n placement={children ? 'local' : 'block'}\n message={typeof progress === 'string' ? progress : undefined}\n />\n </CardContent>\n\n <CardFooter justify='between' forwardedAs='div'>\n <Button\n onClick={() => {\n onCancelHandler();\n }}\n disabled={typeof onCancel !== 'function' ? onCancel.disabled : undefined}\n ref={cancelButtonRef}\n >\n {typeof onCancel !== 'function' && onCancel.text ? onCancel.text : t('cancel')}\n </Button>\n\n <Button\n variant='primary'\n onClick={() => {\n (typeof onSubmit !== 'function' ? onSubmit.handler : onSubmit)();\n }}\n disabled={typeof onSubmit !== 'function' ? onSubmit.disabled : undefined}\n >\n {typeof onSubmit !== 'function' && onSubmit.text ? onSubmit.text : t('submit')}\n </Button>\n </CardFooter>\n </StyledFormDialog>\n );\n }\n );\n\nexport default FormDialog;\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { InfoDialogProps } from './Dialog.types';
|
|
3
|
+
export declare const StyledInfoDialog: import("styled-components").StyledComponent<FC<import("./Dialog.types").DialogProps & HTMLAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
+
declare const InfoDialog: FC<InfoDialogProps & HTMLAttributes<HTMLDivElement>>;
|
|
5
|
+
export default InfoDialog;
|
|
6
|
+
//# sourceMappingURL=InfoDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoDialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/InfoDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuC,EAAE,EAAa,cAAc,EAAE,MAAM,OAAO,CAAC;AAoB3F,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,eAAO,MAAM,gBAAgB,6KAAmB,CAAC;AAEjD,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,GAAG,cAAc,CAAC,cAAc,CAAC,CAyFpE,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useRef, useEffect } from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { useConsolidatedRef, useEscape, useFocusTrap, useI18n, useOuterEvent, useUID } from '../../hooks';
|
|
5
|
+
import Button from '../Button';
|
|
6
|
+
import Text from '../Text';
|
|
7
|
+
import { CardContent, CardHeader } from '../Card';
|
|
8
|
+
import Icon from '../Icon';
|
|
9
|
+
import Progress from '../Progress';
|
|
10
|
+
import VisuallyHiddenText from '../VisuallyHiddenText';
|
|
11
|
+
import Dialog from './Dialog';
|
|
12
|
+
import { StyledChildrenWrap } from './Dialog.styles';
|
|
13
|
+
export const StyledInfoDialog = styled(Dialog) ``;
|
|
14
|
+
const InfoDialog = forwardRef(({ target, heading, headingHidden = false, children, progress, onDismiss, ...restProps }, ref) => {
|
|
15
|
+
const t = useI18n();
|
|
16
|
+
const headingId = useUID();
|
|
17
|
+
const dialogRef = useConsolidatedRef(ref);
|
|
18
|
+
const closeButtonRef = useRef(null);
|
|
19
|
+
useEscape(() => {
|
|
20
|
+
onDismiss?.();
|
|
21
|
+
});
|
|
22
|
+
useOuterEvent('mousedown', [target, dialogRef], () => {
|
|
23
|
+
onDismiss?.();
|
|
24
|
+
});
|
|
25
|
+
useFocusTrap(dialogRef);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (!progress) {
|
|
28
|
+
closeButtonRef.current?.focus();
|
|
29
|
+
}
|
|
30
|
+
}, [progress]);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
return () => {
|
|
33
|
+
if (document.contains(target)) {
|
|
34
|
+
target.focus();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}, []);
|
|
38
|
+
return (_jsxs(StyledInfoDialog, { ...restProps, target: target, labelledbyId: headingId, progress: progress, ref: dialogRef, children: [_jsx(CardHeader, { forwardedAs: 'div', actions: _jsx(Button, { icon: true, variant: 'simple', onClick: () => {
|
|
39
|
+
onDismiss();
|
|
40
|
+
}, label: t('close'), ref: closeButtonRef, children: _jsx(Icon, { name: 'times' }) }), children: headingHidden ? (_jsx(VisuallyHiddenText, { forwardedAs: 'h2', id: headingId, children: heading })) : (_jsx(Text, { id: headingId, variant: 'h2', children: heading })) }), _jsxs(CardContent, { children: [children && _jsx(StyledChildrenWrap, { children: children }), _jsx(Progress, { visible: !!progress, focusOnVisible: true, placement: children ? 'local' : 'block', message: typeof progress === 'string' ? progress : undefined })] })] }));
|
|
41
|
+
});
|
|
42
|
+
export default InfoDialog;
|
|
43
|
+
//# sourceMappingURL=InfoDialog.js.map
|