@pega/cosmos-react-core 4.0.0-dev.13.0 → 4.0.0-dev.14.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/README.md +2 -2
- package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.styles.js +0 -2
- package/lib/components/AppShell/AppHeader.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +10 -16
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.types.d.ts +12 -11
- 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 +1 -1
- package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
- 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.map +1 -1
- package/lib/components/AppShell/AppShellList.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellList.styles.js +1 -2
- package/lib/components/AppShell/AppShellList.styles.js.map +1 -1
- package/lib/components/AppShell/NavigationList.d.ts.map +1 -1
- 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 +31 -11
- package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -1
- package/lib/components/AppShell/Operator.d.ts.map +1 -1
- package/lib/components/AppShell/Operator.js +1 -3
- package/lib/components/AppShell/Operator.js.map +1 -1
- package/lib/components/Avatar/Avatar.d.ts +2 -2
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/Backdrop/Backdrop.d.ts +9 -21
- package/lib/components/Backdrop/Backdrop.d.ts.map +1 -1
- package/lib/components/Backdrop/Backdrop.js +0 -2
- package/lib/components/Backdrop/Backdrop.js.map +1 -1
- package/lib/components/Badges/Count.d.ts +1 -1
- package/lib/components/Badges/Count.js.map +1 -1
- package/lib/components/Banner/Banner.d.ts +1 -1
- package/lib/components/Banner/Banner.d.ts.map +1 -1
- package/lib/components/Banner/Banner.js +3 -3
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Boolean/BooleanDisplay.d.ts +2 -2
- package/lib/components/Boolean/BooleanDisplay.js +2 -2
- package/lib/components/Boolean/BooleanDisplay.js.map +1 -1
- package/lib/components/Button/BareButton.d.ts +1 -1
- package/lib/components/Button/BareButton.js.map +1 -1
- package/lib/components/Button/Button.d.ts +7 -9
- package/lib/components/Button/Button.d.ts.map +1 -1
- package/lib/components/Button/Button.js +168 -142
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/lib/components/ColorPicker/ColorPicker.js +1 -1
- package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts +1 -1
- package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.test-ids.js +5 -1
- package/lib/components/ColorPicker/ColorPicker.test-ids.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.js +2 -10
- package/lib/components/ComboBox/ComboBox.js.map +1 -1
- package/lib/components/ComboBox/ComboxBox.test-ids.d.ts +1 -1
- package/lib/components/ComboBox/ComboxBox.test-ids.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboxBox.test-ids.js +2 -1
- package/lib/components/ComboBox/ComboxBox.test-ids.js.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.js +8 -10
- package/lib/components/CompositeInput/CompositeInput.js.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts +1 -1
- package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.test-ids.js +5 -1
- package/lib/components/CompositeInput/CompositeInput.test-ids.js.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.types.d.ts +2 -6
- package/lib/components/CompositeInput/CompositeInput.types.d.ts.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.types.js.map +1 -1
- package/lib/components/Configuration/Configuration.d.ts +9 -27
- package/lib/components/Configuration/Configuration.d.ts.map +1 -1
- package/lib/components/Configuration/Configuration.js +5 -1
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/CreditCard/utils.d.ts +1 -1
- package/lib/components/CreditCard/utils.d.ts.map +1 -1
- package/lib/components/CreditCard/utils.js +1 -1
- package/lib/components/CreditCard/utils.js.map +1 -1
- package/lib/components/Currency/Currency.test-ids.d.ts +1 -1
- package/lib/components/Currency/Currency.test-ids.d.ts.map +1 -1
- package/lib/components/Currency/Currency.test-ids.js +5 -1
- package/lib/components/Currency/Currency.test-ids.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.js +1 -1
- package/lib/components/Currency/CurrencyInput.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.d.ts +3 -7
- package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
- package/lib/components/DateTime/DateTimeDisplay.d.ts +4 -10
- package/lib/components/DateTime/DateTimeDisplay.d.ts.map +1 -1
- package/lib/components/DateTime/DateTimeDisplay.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +25 -32
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.d.ts +1 -0
- package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.js +3 -0
- package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts +1 -3
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +20 -27
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.d.ts +1 -3
- package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.js +1 -9
- package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts +1 -3
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts.map +1 -1
- 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 +11 -17
- package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
- package/lib/components/DateTime/Input/usePickerButton.js +3 -3
- package/lib/components/DateTime/Input/usePickerButton.js.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.d.ts +4 -6
- package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.js +1 -1
- package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.types.d.ts +2 -4
- package/lib/components/DateTime/Picker/DatePicker.types.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.types.js.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.d.ts +1 -3
- package/lib/components/DateTime/Picker/TimePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/Weeks.d.ts +1 -3
- package/lib/components/DateTime/Picker/Weeks.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Weeks.js +1 -1
- package/lib/components/DateTime/Picker/Weeks.js.map +1 -1
- package/lib/components/DateTime/Picker/utils.js +1 -1
- package/lib/components/DateTime/Picker/utils.js.map +1 -1
- package/lib/components/DateTime/utils.d.ts.map +1 -1
- package/lib/components/DateTime/utils.js +8 -6
- package/lib/components/DateTime/utils.js.map +1 -1
- package/lib/components/Dialog/Dialog.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.js +2 -2
- 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 -1
- package/lib/components/Dialog/Dialog.styles.js +29 -2
- package/lib/components/Dialog/Dialog.styles.js.map +1 -1
- package/lib/components/Dialog/Dialog.types.d.ts +34 -34
- package/lib/components/Dialog/Dialog.types.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.types.js +0 -1
- package/lib/components/Dialog/Dialog.types.js.map +1 -1
- package/lib/components/Dialog/FormDialog.d.ts +4 -1
- package/lib/components/Dialog/FormDialog.d.ts.map +1 -1
- package/lib/components/Dialog/FormDialog.js +4 -5
- package/lib/components/Dialog/FormDialog.js.map +1 -1
- package/lib/components/Dialog/InfoDialog.d.ts +0 -1
- package/lib/components/Dialog/InfoDialog.d.ts.map +1 -1
- package/lib/components/Dialog/InfoDialog.js +15 -13
- package/lib/components/Dialog/InfoDialog.js.map +1 -1
- package/lib/components/Dialog/InfoDialog.styles.d.ts +6 -0
- package/lib/components/Dialog/InfoDialog.styles.d.ts.map +1 -0
- package/lib/components/Dialog/InfoDialog.styles.js +18 -0
- package/lib/components/Dialog/InfoDialog.styles.js.map +1 -0
- package/lib/components/Drawer/Drawer.d.ts +9 -9
- package/lib/components/Drawer/Drawer.d.ts.map +1 -1
- package/lib/components/Drawer/Drawer.js.map +1 -1
- package/lib/components/Email/EmailDisplay.d.ts +1 -1
- package/lib/components/Email/EmailDisplay.js.map +1 -1
- package/lib/components/EmojiPicker/EmojiPicker.styles.d.ts.map +1 -1
- package/lib/components/EmojiPicker/EmojiPicker.styles.js +2 -7
- package/lib/components/EmojiPicker/EmojiPicker.styles.js.map +1 -1
- package/lib/components/ExpandCollapse/ExpandCollapse.d.ts +6 -6
- package/lib/components/ExpandCollapse/ExpandCollapse.d.ts.map +1 -1
- package/lib/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.d.ts +1 -3
- package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.d.ts +5 -3
- package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.test-ids.d.ts +2 -2
- package/lib/components/FieldValueList/FieldValueList.test-ids.d.ts.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/File.test-ids.d.ts +1 -1
- package/lib/components/File/File.test-ids.d.ts.map +1 -1
- package/lib/components/File/File.test-ids.js +6 -1
- package/lib/components/File/File.test-ids.js.map +1 -1
- package/lib/components/File/FileDisplay.d.ts +2 -2
- package/lib/components/File/FileDisplay.d.ts.map +1 -1
- package/lib/components/File/FileDisplay.js.map +1 -1
- package/lib/components/File/FileInput.d.ts +1 -3
- package/lib/components/File/FileInput.d.ts.map +1 -1
- package/lib/components/File/FileInput.js +1 -1
- package/lib/components/File/FileInput.js.map +1 -1
- package/lib/components/Flex/Flex.d.ts +7 -1
- package/lib/components/Flex/Flex.d.ts.map +1 -1
- package/lib/components/Flex/Flex.js +37 -10
- package/lib/components/Flex/Flex.js.map +1 -1
- package/lib/components/FormControl/FormControl.d.ts +3 -2
- package/lib/components/FormControl/FormControl.d.ts.map +1 -1
- package/lib/components/FormControl/FormControl.js.map +1 -1
- package/lib/components/FormField/FormField.d.ts +4 -3
- package/lib/components/FormField/FormField.d.ts.map +1 -1
- package/lib/components/FormField/FormField.js +10 -14
- package/lib/components/FormField/FormField.js.map +1 -1
- package/lib/components/FormField/FormField.test-ids.d.ts +2 -1
- package/lib/components/FormField/FormField.test-ids.d.ts.map +1 -1
- package/lib/components/FormField/FormField.test-ids.js +3 -2
- package/lib/components/FormField/FormField.test-ids.js.map +1 -1
- package/lib/components/Grid/Grid.d.ts.map +1 -1
- package/lib/components/Grid/Grid.js +0 -3
- package/lib/components/Grid/Grid.js.map +1 -1
- package/lib/components/Grid/Grid.types.d.ts +6 -6
- package/lib/components/Grid/Grid.types.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/phone-merge-solid.icon.d.ts +4 -0
- package/lib/components/Icon/icons/phone-merge-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/phone-merge-solid.icon.js +6 -0
- package/lib/components/Icon/icons/phone-merge-solid.icon.js.map +1 -0
- package/lib/components/Icon/icons/phone-merge.icon.d.ts +4 -0
- package/lib/components/Icon/icons/phone-merge.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/phone-merge.icon.js +6 -0
- package/lib/components/Icon/icons/phone-merge.icon.js.map +1 -0
- package/lib/components/IconPicker/IconPicker.js +2 -2
- package/lib/components/IconPicker/IconPicker.js.map +1 -1
- package/lib/components/Input/Input.d.ts +1 -1
- package/lib/components/Input/Input.js +1 -1
- package/lib/components/Input/Input.js.map +1 -1
- package/lib/components/Input/Input.test-ids.d.ts +1 -1
- package/lib/components/Input/Input.test-ids.d.ts.map +1 -1
- package/lib/components/Input/Input.test-ids.js +2 -1
- package/lib/components/Input/Input.test-ids.js.map +1 -1
- package/lib/components/Label/Label.d.ts +1 -1
- package/lib/components/Label/Label.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.types.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.types.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.types.js.map +1 -1
- package/lib/components/Link/Link.d.ts +1 -1
- package/lib/components/Link/Link.js.map +1 -1
- 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 +1 -1
- package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.js +49 -17
- package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts +3 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.js +2 -3
- package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts +2 -0
- package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts.map +1 -0
- package/lib/components/ListToolbar/ListToolbar.test-ids.js +7 -0
- package/lib/components/ListToolbar/ListToolbar.test-ids.js.map +1 -0
- package/lib/components/ListToolbar/ListToolbar.types.d.ts +32 -9
- 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/helpers.d.ts +10 -0
- package/lib/components/ListToolbar/helpers.d.ts.map +1 -0
- package/lib/components/ListToolbar/helpers.js +46 -0
- package/lib/components/ListToolbar/helpers.js.map +1 -0
- package/lib/components/ListToolbar/index.d.ts +1 -0
- package/lib/components/ListToolbar/index.d.ts.map +1 -1
- package/lib/components/ListToolbar/index.js +1 -0
- package/lib/components/ListToolbar/index.js.map +1 -1
- package/lib/components/LiveLog/LiveLog.d.ts.map +1 -1
- package/lib/components/LiveLog/LiveLog.js +17 -16
- package/lib/components/LiveLog/LiveLog.js.map +1 -1
- package/lib/components/Location/Location.test-ids.d.ts +1 -1
- package/lib/components/Location/Location.test-ids.d.ts.map +1 -1
- package/lib/components/Location/Location.test-ids.js +5 -1
- package/lib/components/Location/Location.test-ids.js.map +1 -1
- package/lib/components/Location/LocationDisplay.d.ts +1 -1
- package/lib/components/Location/LocationDisplay.js.map +1 -1
- package/lib/components/Location/LocationInput.js +1 -1
- package/lib/components/Location/LocationInput.js.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 +1 -1
- package/lib/components/Location/utils.js.map +1 -1
- package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
- package/lib/components/Menu/Menu.styles.js +1 -4
- package/lib/components/Menu/Menu.styles.js.map +1 -1
- package/lib/components/Menu/Menu.test-ids.d.ts +2 -2
- package/lib/components/Menu/Menu.test-ids.d.ts.map +1 -1
- package/lib/components/Menu/Menu.types.d.ts +6 -12
- 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/NavItemsList.d.ts.map +1 -1
- package/lib/components/Menu/NavItemsList.js +2 -0
- package/lib/components/Menu/NavItemsList.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.d.ts +3 -3
- package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +6 -4
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.test-ids.d.ts +2 -0
- package/lib/components/MenuButton/MenuButton.test-ids.d.ts.map +1 -0
- package/lib/components/MenuButton/MenuButton.test-ids.js +3 -0
- package/lib/components/MenuButton/MenuButton.test-ids.js.map +1 -0
- package/lib/components/MetaList/MetaList.test-ids.d.ts +1 -1
- package/lib/components/MetaList/MetaList.test-ids.d.ts.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.js +1 -1
- package/lib/components/Modal/Modal.styles.js.map +1 -1
- package/lib/components/Modal/Modal.types.d.ts +25 -71
- package/lib/components/Modal/Modal.types.d.ts.map +1 -1
- package/lib/components/Modal/Modal.types.js.map +1 -1
- package/lib/components/Modal/ModalManager.d.ts.map +1 -1
- package/lib/components/Modal/ModalManager.js +5 -2
- package/lib/components/Modal/ModalManager.js.map +1 -1
- package/lib/components/MultiStepForm/HorizontalFormProgress.d.ts.map +1 -1
- package/lib/components/MultiStepForm/HorizontalFormProgress.js +4 -0
- package/lib/components/MultiStepForm/HorizontalFormProgress.js.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.d.ts.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.js +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.js.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.types.d.ts +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.types.js.map +1 -1
- package/lib/components/Number/Number.test-ids.d.ts +2 -2
- package/lib/components/Number/Number.test-ids.d.ts.map +1 -1
- package/lib/components/Number/Number.test-ids.js +8 -2
- package/lib/components/Number/Number.test-ids.js.map +1 -1
- package/lib/components/Number/NumberInput.js +1 -1
- package/lib/components/Number/NumberInput.js.map +1 -1
- package/lib/components/Number/NumberRangeInput.js +1 -1
- package/lib/components/Number/NumberRangeInput.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js +2 -2
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/Phone/Phone.test-ids.d.ts +1 -1
- package/lib/components/Phone/Phone.test-ids.d.ts.map +1 -1
- package/lib/components/Phone/Phone.test-ids.js +3 -1
- package/lib/components/Phone/Phone.test-ids.js.map +1 -1
- package/lib/components/Phone/PhoneDisplay.d.ts +1 -1
- package/lib/components/Phone/PhoneDisplay.js.map +1 -1
- package/lib/components/Phone/PhoneInput.js +2 -2
- package/lib/components/Phone/PhoneInput.js.map +1 -1
- package/lib/components/Popover/Popover.d.ts +4 -3
- package/lib/components/Popover/Popover.d.ts.map +1 -1
- package/lib/components/Popover/Popover.js +36 -24
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/PopoverManager.d.ts.map +1 -1
- package/lib/components/Popover/PopoverManager.js +11 -10
- package/lib/components/Popover/PopoverManager.js.map +1 -1
- package/lib/components/Popover/modifiers.d.ts +1 -0
- package/lib/components/Popover/modifiers.d.ts.map +1 -1
- package/lib/components/Popover/modifiers.js +116 -1
- package/lib/components/Popover/modifiers.js.map +1 -1
- package/lib/components/Progress/Progress.styles.d.ts.map +1 -1
- package/lib/components/Progress/Progress.styles.js +25 -20
- package/lib/components/Progress/Progress.styles.js.map +1 -1
- package/lib/components/Progress/Progress.types.d.ts +2 -2
- package/lib/components/Progress/Progress.types.js.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.js +2 -2
- package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.js +1 -9
- package/lib/components/SearchInput/SearchInput.js.map +1 -1
- package/lib/components/Select/Select.js +2 -2
- package/lib/components/Select/Select.js.map +1 -1
- package/lib/components/Select/Select.test-ids.d.ts +1 -1
- package/lib/components/Select/Select.test-ids.d.ts.map +1 -1
- package/lib/components/Select/Select.test-ids.js +2 -1
- package/lib/components/Select/Select.test-ids.js.map +1 -1
- package/lib/components/Skeleton/LineSkeleton.d.ts +2 -2
- package/lib/components/Skeleton/LineSkeleton.js.map +1 -1
- package/lib/components/Skeleton/RectangleSkeleton.d.ts +3 -3
- package/lib/components/Skeleton/RectangleSkeleton.js.map +1 -1
- package/lib/components/Slider/Slider.js +1 -1
- package/lib/components/Slider/Slider.js.map +1 -1
- package/lib/components/Slider/Slider.styles.d.ts.map +1 -1
- package/lib/components/Slider/Slider.styles.js +114 -128
- package/lib/components/Slider/Slider.styles.js.map +1 -1
- package/lib/components/Slider/Slider.test-ids.d.ts +1 -1
- package/lib/components/Slider/Slider.test-ids.d.ts.map +1 -1
- package/lib/components/Slider/Slider.test-ids.js +2 -1
- package/lib/components/Slider/Slider.test-ids.js.map +1 -1
- package/lib/components/Slider/Slider.types.d.ts +3 -9
- package/lib/components/Slider/Slider.types.d.ts.map +1 -1
- package/lib/components/Slider/Slider.types.js.map +1 -1
- package/lib/components/Slider/utils.d.ts.map +1 -1
- package/lib/components/Slider/utils.js +0 -1
- package/lib/components/Slider/utils.js.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.d.ts +2 -1
- package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.test-ids.d.ts +1 -1
- package/lib/components/SummaryItem/SummaryItem.test-ids.d.ts.map +1 -1
- package/lib/components/SummaryList/SummaryList.d.ts +2 -2
- package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
- package/lib/components/SummaryList/SummaryList.js.map +1 -1
- package/lib/components/Table/Table.d.ts +1 -1
- package/lib/components/Table/Table.js.map +1 -1
- package/lib/components/Tabs/Tab.d.ts.map +1 -1
- package/lib/components/Tabs/Tab.js +21 -18
- package/lib/components/Tabs/Tab.js.map +1 -1
- package/lib/components/Tabs/TabPanel.d.ts +1 -1
- package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
- package/lib/components/Tabs/TabPanel.js.map +1 -1
- package/lib/components/Tabs/Tabs.types.d.ts +1 -1
- package/lib/components/Tabs/Tabs.types.js.map +1 -1
- package/lib/components/Text/Text.d.ts +2 -4
- package/lib/components/Text/Text.d.ts.map +1 -1
- package/lib/components/Text/Text.js.map +1 -1
- package/lib/components/TextArea/TextArea.js +1 -1
- package/lib/components/TextArea/TextArea.js.map +1 -1
- package/lib/components/TextArea/TextArea.test-ids.d.ts +1 -1
- package/lib/components/TextArea/TextArea.test-ids.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.test-ids.js +2 -1
- package/lib/components/TextArea/TextArea.test-ids.js.map +1 -1
- package/lib/components/Toaster/Toaster.types.d.ts +1 -1
- package/lib/components/Toaster/Toaster.types.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.types.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.d.ts +3 -3
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/components/URL/URLDisplay.d.ts +1 -1
- package/lib/components/URL/URLDisplay.js +2 -2
- 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/useArrows.js +1 -1
- package/lib/hooks/useArrows.js.map +1 -1
- package/lib/hooks/useBreakpoint.d.ts.map +1 -1
- package/lib/hooks/useBreakpoint.js +4 -1
- package/lib/hooks/useBreakpoint.js.map +1 -1
- package/lib/hooks/useChToPxConversionFactor.d.ts +3 -0
- package/lib/hooks/useChToPxConversionFactor.d.ts.map +1 -0
- package/lib/hooks/useChToPxConversionFactor.js +13 -0
- package/lib/hooks/useChToPxConversionFactor.js.map +1 -0
- package/lib/hooks/useElement.d.ts +1 -1
- package/lib/hooks/useElement.d.ts.map +1 -1
- package/lib/hooks/useI18n.d.ts +13 -0
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useScrollToggle.d.ts.map +1 -1
- package/lib/hooks/useScrollToggle.js +0 -1
- package/lib/hooks/useScrollToggle.js.map +1 -1
- package/lib/hooks/useTestIds.d.ts +1 -1
- package/lib/hooks/useTestIds.d.ts.map +1 -1
- package/lib/hooks/useTestIds.js +3 -0
- package/lib/hooks/useTestIds.js.map +1 -1
- package/lib/i18n/default.d.ts +13 -0
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +14 -0
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +13 -0
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/i18n/translate.d.ts +2 -6
- package/lib/i18n/translate.d.ts.map +1 -1
- package/lib/i18n/translate.js.map +1 -1
- package/lib/styles/gradients.d.ts.map +1 -1
- package/lib/styles/gradients.js.map +1 -1
- package/lib/theme/ThemeMachine.js.map +1 -1
- package/lib/types/types.d.ts +7 -2
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/types.js.map +1 -1
- package/lib/utils/createTestIds.d.ts +1 -6
- package/lib/utils/createTestIds.d.ts.map +1 -1
- package/lib/utils/createTestIds.js +2 -4
- package/lib/utils/createTestIds.js.map +1 -1
- package/lib/utils/debounce.d.ts +2 -2
- package/lib/utils/debounce.d.ts.map +1 -1
- package/lib/utils/debounce.js +9 -10
- package/lib/utils/debounce.js.map +1 -1
- package/lib/utils/getEdge.d.ts +7 -0
- package/lib/utils/getEdge.d.ts.map +1 -0
- package/lib/utils/getEdge.js +9 -0
- package/lib/utils/getEdge.js.map +1 -0
- package/lib/utils/index.d.ts +2 -1
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +2 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/kebabToCamel.d.ts +1 -3
- package/lib/utils/kebabToCamel.d.ts.map +1 -1
- package/lib/utils/kebabToCamel.js +1 -3
- package/lib/utils/kebabToCamel.js.map +1 -1
- package/lib/utils/throttle.d.ts +4 -0
- package/lib/utils/throttle.d.ts.map +1 -0
- package/lib/utils/throttle.js +15 -0
- package/lib/utils/throttle.js.map +1 -0
- package/package.json +2 -2
|
@@ -2,9 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { useConsolidatedRef } from '../../hooks';
|
|
4
4
|
import { StyledDialog } from './Dialog.styles';
|
|
5
|
-
const Dialog = forwardRef(({ target, labelledbyId, portal, strategy, placement, children, progress, ...restProps }, ref) => {
|
|
5
|
+
const Dialog = forwardRef(({ arrow = true, target, labelledbyId, ariaLabel, portal, strategy, placement, children, progress, ...restProps }, ref) => {
|
|
6
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,
|
|
7
|
+
return (_jsx(StyledDialog, { ...restProps, role: 'dialog', arrow: arrow, "aria-modal": 'false', "aria-labelledby": labelledbyId, "aria-label": ariaLabel, "aria-busy": progress ? 'true' : 'false', ref: dialogRef, target: target, portal: portal, strategy: strategy, placement: placement, children: children }));
|
|
8
8
|
});
|
|
9
9
|
export default Dialog;
|
|
10
10
|
//# sourceMappingURL=Dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,KAAK,GAAG,IAAI,EACZ,MAAM,EACN,YAAY,EACZ,SAAS,EACT,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,EACb,KAAK,EAAE,KAAK,gBACD,OAAO,qBACD,YAAY,gBACjB,SAAS,eACV,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,YAEnB,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 arrow = true,\n target,\n labelledbyId,\n ariaLabel,\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 arrow={arrow}\n aria-modal='false'\n aria-labelledby={labelledbyId}\n aria-label={ariaLabel}\n aria-busy={progress ? 'true' : 'false'}\n ref={dialogRef}\n target={target}\n portal={portal}\n strategy={strategy}\n placement={placement}\n >\n {children}\n </StyledDialog>\n );\n }\n);\n\nexport default Dialog;\n"]}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export declare const StyledChildrenWrap: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
2
|
+
export declare const StyledDialogHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
+
export declare const StyledDialogContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
+
export declare const StyledDialogFooter: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
2
5
|
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
6
|
//# sourceMappingURL=Dialog.styles.d.ts.map
|
|
@@ -1 +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,
|
|
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,kBAAkB,yGAAe,CAAC;AAE/C,eAAO,MAAM,mBAAmB,yGAe9B,CAAC;AAIH,eAAO,MAAM,kBAAkB,yGAAe,CAAC;AAE/C,eAAO,MAAM,YAAY,8TAmBvB,CAAC"}
|
|
@@ -2,10 +2,37 @@ import styled, { css } from 'styled-components';
|
|
|
2
2
|
import { defaultThemeProp } from '../../theme';
|
|
3
3
|
import Popover from '../Popover';
|
|
4
4
|
export const StyledChildrenWrap = styled.div ``;
|
|
5
|
+
export const StyledDialogHeader = styled.div ``;
|
|
6
|
+
export const StyledDialogContent = styled.div(({ theme }) => {
|
|
7
|
+
return css `
|
|
8
|
+
position: relative;
|
|
9
|
+
overflow: auto;
|
|
10
|
+
padding: calc(2 * ${theme.base.spacing});
|
|
11
|
+
|
|
12
|
+
/* Small amount of block padding accounts for focus ring clipping within overflow auto. */
|
|
13
|
+
${StyledDialogHeader} + & {
|
|
14
|
+
padding-block-start: calc(0.5 * ${theme.base.spacing});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&:not(:last-child) {
|
|
18
|
+
padding-block-end: calc(0.5 * ${theme.base.spacing});
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
21
|
+
});
|
|
22
|
+
StyledDialogContent.defaultProps = defaultThemeProp;
|
|
23
|
+
export const StyledDialogFooter = styled.div ``;
|
|
5
24
|
export const StyledDialog = styled(Popover)(({ theme }) => {
|
|
6
25
|
return css `
|
|
7
|
-
|
|
8
|
-
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
|
|
29
|
+
/*
|
|
30
|
+
* For fixed position, which most popovers should be, 100% will be relative to viewport and avoid an annoying 100vw scrollbar nuance.
|
|
31
|
+
* https://stackoverflow.com/questions/29551606/why-does-vw-include-the-scrollbar-as-part-of-the-viewport
|
|
32
|
+
*/
|
|
33
|
+
min-width: min(${theme.base['content-width'].sm}, calc(100% - 2rem));
|
|
34
|
+
max-width: min(${theme.base['content-width'].lg}, calc(100% - 2rem));
|
|
35
|
+
max-height: calc(100% - 2rem);
|
|
9
36
|
|
|
10
37
|
&[aria-busy='true'] {
|
|
11
38
|
${StyledChildrenWrap} {
|
|
@@ -1 +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;A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,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE;;;;QAI3C,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 StyledDialogHeader = styled.div``;\n\nexport const StyledDialogContent = styled.div(({ theme }) => {\n return css`\n position: relative;\n overflow: auto;\n padding: calc(2 * ${theme.base.spacing});\n\n /* Small amount of block padding accounts for focus ring clipping within overflow auto. */\n ${StyledDialogHeader} + & {\n padding-block-start: calc(0.5 * ${theme.base.spacing});\n }\n\n &:not(:last-child) {\n padding-block-end: calc(0.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledDialogContent.defaultProps = defaultThemeProp;\n\nexport const StyledDialogFooter = styled.div``;\n\nexport const StyledDialog = styled(Popover)(({ theme }) => {\n return css`\n display: flex;\n flex-direction: column;\n\n /*\n * For fixed position, which most popovers should be, 100% will be relative to viewport and avoid an annoying 100vw scrollbar nuance.\n * https://stackoverflow.com/questions/29551606/why-does-vw-include-the-scrollbar-as-part-of-the-viewport\n */\n min-width: min(${theme.base['content-width'].sm}, calc(100% - 2rem));\n max-width: min(${theme.base['content-width'].lg}, calc(100% - 2rem));\n max-height: calc(100% - 2rem);\n\n &[aria-busy='true'] {\n ${StyledChildrenWrap} {\n visibility: hidden;\n }\n }\n `;\n});\n\nStyledDialog.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1,28 +1,22 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { OmitStrict } from '../../types';
|
|
2
3
|
import { PopoverProps } from '../Popover';
|
|
3
4
|
import { ProgressProps } from '../Progress';
|
|
4
5
|
export interface BaseDialogProps {
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
+
* Certain uses of dialogs require a linear edge with an input like control.
|
|
8
|
+
* There an arrow is not desired.
|
|
9
|
+
* @default true
|
|
7
10
|
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* In specific circumstances the heading can be visually hidden.
|
|
11
|
-
* @default false
|
|
12
|
-
*/
|
|
13
|
-
headingHidden?: boolean;
|
|
11
|
+
arrow?: PopoverProps['arrow'];
|
|
14
12
|
/**
|
|
15
13
|
* An element the dialog is contextually and visually associated with. Normally a triggering button.
|
|
16
14
|
* Components rendering Dialog should mount and unmount instances based on this value.
|
|
17
15
|
*/
|
|
18
16
|
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
|
-
*/
|
|
17
|
+
/** Content for the dialog. Avoid form control buttons within as those should be rendered by way of onCancel and onSubmit with FormDialog. */
|
|
22
18
|
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
|
-
*/
|
|
19
|
+
/** If there is a progress state either on opening, or after submit, you must indicate as such. A custom message is supported as well. */
|
|
26
20
|
progress?: boolean | ProgressProps['message'];
|
|
27
21
|
/** Optionally render the dialog element at the end of the body or within a specified element. */
|
|
28
22
|
portal?: PopoverProps['portal'];
|
|
@@ -33,29 +27,23 @@ export interface BaseDialogProps {
|
|
|
33
27
|
* Placement may auto adjust based on screen position and other layout variables.
|
|
34
28
|
*/
|
|
35
29
|
placement?: PopoverProps['placement'];
|
|
36
|
-
/**
|
|
37
|
-
* Reference to the dialog's root element.
|
|
38
|
-
*/
|
|
30
|
+
/** Reference to the dialog's root element. */
|
|
39
31
|
ref?: PopoverProps['ref'];
|
|
40
32
|
}
|
|
41
|
-
export
|
|
42
|
-
/**
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* A simple callback or an object to customize a subset button properties.
|
|
49
|
-
*/
|
|
33
|
+
export type DialogProps = BaseDialogProps & {
|
|
34
|
+
/** The DOM id for the dialog's visible labelling element. */
|
|
35
|
+
labelledbyId?: string;
|
|
36
|
+
/** Provide a contextually sufficient aria label if a visible labelling element is not present. */
|
|
37
|
+
ariaLabel?: string;
|
|
38
|
+
};
|
|
39
|
+
/** A simple callback or an object to customize a subset button properties. */
|
|
50
40
|
type FormAction = (() => void) | {
|
|
51
41
|
text?: string;
|
|
52
42
|
disabled?: boolean;
|
|
53
43
|
handler: () => void;
|
|
54
44
|
};
|
|
55
|
-
export
|
|
56
|
-
/**
|
|
57
|
-
* Called when the user presses escape or clicks away.
|
|
58
|
-
*/
|
|
45
|
+
export type FormDialogProps = BaseDialogProps & {
|
|
46
|
+
/** Called when the user presses escape or clicks away. */
|
|
59
47
|
onDismiss?: () => void;
|
|
60
48
|
/**
|
|
61
49
|
* Renders a standard design system cancel button.
|
|
@@ -68,11 +56,23 @@ export interface FormDialogProps extends BaseDialogProps {
|
|
|
68
56
|
* Invocation of this indicates the user wishes to submit any changes and close the dialog. Please consider progress states after submit.
|
|
69
57
|
*/
|
|
70
58
|
onSubmit: FormAction;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
59
|
+
} & ({
|
|
60
|
+
/** A string to indicate context for the dialog. The dialog will be labelled by this value. */
|
|
61
|
+
heading: string;
|
|
62
|
+
ariaLabel?: never;
|
|
63
|
+
} | {
|
|
64
|
+
/** Provide a contextually sufficient aria label if a visible heading is not provided. */
|
|
65
|
+
heading?: never;
|
|
66
|
+
ariaLabel: string;
|
|
67
|
+
});
|
|
68
|
+
export interface InfoDialogProps extends OmitStrict<BaseDialogProps, 'arrow'> {
|
|
69
|
+
/** A string or summary item like props to indicate context for the dialog. The dialog will be labelled by either the heading element or primary property. */
|
|
70
|
+
heading?: string | {
|
|
71
|
+
primary: string;
|
|
72
|
+
secondary?: string;
|
|
73
|
+
visual?: ReactNode;
|
|
74
|
+
};
|
|
75
|
+
/** Renders a standard design system dismiss button to close the dialog when the user clicks this button, presses escape or clicks away. */
|
|
76
76
|
onDismiss: () => void;
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.types.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Dialog.types.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,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;;;;OAIG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAE9B;;;OAGG;IACH,MAAM,EAAE,WAAW,CAAC;IAEpB,6IAA6I;IAC7I,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IAEnC,yIAAyI;IACzI,QAAQ,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;IAE9C,iGAAiG;IACjG,MAAM,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IAEhC,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IAEpC;;;OAGG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IAEtC,8CAA8C;IAC9C,GAAG,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC;CAC3B;AAED,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG;IAC1C,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,kGAAkG;IAClG,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,8EAA8E;AAC9E,KAAK,UAAU,GACX,CAAC,MAAM,IAAI,CAAC,GACZ;IACE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEN,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG;IAC9C,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IAEvB;;;;OAIG;IACH,QAAQ,EAAE,UAAU,CAAC;IAErB;;;OAGG;IACH,QAAQ,EAAE,UAAU,CAAC;CACtB,GAAG,CACE;IACE,8FAA8F;IAC9F,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,GACD;IACE,yFAAyF;IACzF,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB,CACJ,CAAC;AAEJ,MAAM,WAAW,eAAgB,SAAQ,UAAU,CAAC,eAAe,EAAE,OAAO,CAAC;IAC3E,6JAA6J;IAC7J,OAAO,CAAC,EACJ,MAAM,GACN;QACE,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,SAAS,CAAC;KACpB,CAAC;IAEN,2IAA2I;IAC3I,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.types.js","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Dialog.types.js","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactNode } from 'react';\n\nimport { OmitStrict } from '../../types';\nimport { PopoverProps } from '../Popover';\nimport { ProgressProps } from '../Progress';\n\nexport interface BaseDialogProps {\n /**\n * Certain uses of dialogs require a linear edge with an input like control.\n * There an arrow is not desired.\n * @default true\n */\n arrow?: PopoverProps['arrow'];\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 /** Content for the dialog. Avoid form control buttons within as those should be rendered by way of onCancel and onSubmit with FormDialog. */\n children: PopoverProps['children'];\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 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 /** Reference to the dialog's root element. */\n ref?: PopoverProps['ref'];\n}\n\nexport type DialogProps = BaseDialogProps & {\n /** The DOM id for the dialog's visible labelling element. */\n labelledbyId?: string;\n\n /** Provide a contextually sufficient aria label if a visible labelling element is not present. */\n ariaLabel?: string;\n};\n\n/** A simple callback or an object to customize a subset button properties. */\ntype FormAction =\n | (() => void)\n | {\n text?: string;\n disabled?: boolean;\n handler: () => void;\n };\n\nexport type FormDialogProps = BaseDialogProps & {\n /** Called when the user presses escape or clicks away. */\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 | {\n /** A string to indicate context for the dialog. The dialog will be labelled by this value. */\n heading: string;\n ariaLabel?: never;\n }\n | {\n /** Provide a contextually sufficient aria label if a visible heading is not provided. */\n heading?: never;\n ariaLabel: string;\n }\n );\n\nexport interface InfoDialogProps extends OmitStrict<BaseDialogProps, 'arrow'> {\n /** A string or summary item like props to indicate context for the dialog. The dialog will be labelled by either the heading element or primary property. */\n heading?:\n | string\n | {\n primary: string;\n secondary?: string;\n visual?: ReactNode;\n };\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 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"]}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { FC, HTMLAttributes } from 'react';
|
|
2
2
|
import { OmitStrict } from '../../types';
|
|
3
3
|
import { FormDialogProps } from './Dialog.types';
|
|
4
|
-
export declare const StyledFormDialog: import("styled-components").StyledComponent<FC<import("./Dialog.types").
|
|
4
|
+
export declare const StyledFormDialog: import("styled-components").StyledComponent<FC<import("./Dialog.types").BaseDialogProps & {
|
|
5
|
+
labelledbyId?: string | undefined;
|
|
6
|
+
ariaLabel?: string | undefined;
|
|
7
|
+
} & HTMLAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
5
8
|
declare const FormDialog: FC<FormDialogProps & OmitStrict<HTMLAttributes<HTMLDivElement>, 'onSubmit'>>;
|
|
6
9
|
export default FormDialog;
|
|
7
10
|
//# sourceMappingURL=FormDialog.d.ts.map
|
|
@@ -1 +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;
|
|
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;AAe3F,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AASzC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjD,eAAO,MAAM,gBAAgB;;;yFAAmB,CAAC;AAEjD,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,GAAG,UAAU,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAmH1F,CAAC;AAEJ,eAAe,UAAU,CAAC"}
|
|
@@ -5,13 +5,12 @@ import { useConsolidatedRef, useEscape, useFocusTrap, useI18n, useOuterEvent, us
|
|
|
5
5
|
import { getFocusables } from '../../utils';
|
|
6
6
|
import Button from '../Button';
|
|
7
7
|
import Text from '../Text';
|
|
8
|
-
import { CardContent, CardFooter, CardHeader } from '../Card';
|
|
9
8
|
import Progress from '../Progress';
|
|
10
|
-
import
|
|
11
|
-
import { StyledChildrenWrap } from './Dialog.styles';
|
|
9
|
+
import Flex from '../Flex';
|
|
10
|
+
import { StyledChildrenWrap, StyledDialogContent, StyledDialogFooter, StyledDialogHeader } from './Dialog.styles';
|
|
12
11
|
import Dialog from './Dialog';
|
|
13
12
|
export const StyledFormDialog = styled(Dialog) ``;
|
|
14
|
-
const FormDialog = forwardRef(({ target, heading,
|
|
13
|
+
const FormDialog = forwardRef(({ arrow = true, target, heading, ariaLabel, children, progress, onDismiss, onCancel, onSubmit, ...restProps }, ref) => {
|
|
15
14
|
const t = useI18n();
|
|
16
15
|
const headingId = useUID();
|
|
17
16
|
const dialogRef = useConsolidatedRef(ref);
|
|
@@ -48,7 +47,7 @@ const FormDialog = forwardRef(({ target, heading, headingHidden = false, childre
|
|
|
48
47
|
}
|
|
49
48
|
};
|
|
50
49
|
}, []);
|
|
51
|
-
return (_jsxs(StyledFormDialog, { ...restProps,
|
|
50
|
+
return (_jsxs(StyledFormDialog, { ...restProps, ...(heading === undefined ? { ariaLabel } : { labelledbyId: headingId }), arrow: arrow, target: target, progress: progress, ref: dialogRef, children: [heading !== undefined && (_jsx(Flex, { container: { alignItems: 'center', justify: 'between', pad: 2 }, item: { shrink: 0 }, as: StyledDialogHeader, children: _jsx(Text, { id: headingId, variant: 'h2', children: heading }) })), _jsxs(Flex, { item: { grow: 1 }, as: StyledDialogContent, children: [children && _jsx(StyledChildrenWrap, { children: children }), _jsx(Progress, { visible: !!progress, focusOnVisible: true, placement: children ? 'local' : 'block', message: typeof progress === 'string' ? progress : undefined })] }), _jsxs(Flex, { container: { alignItems: 'center', justify: 'between', pad: 2 }, item: { shrink: 0 }, as: StyledDialogFooter, children: [_jsx(Button, { onClick: () => {
|
|
52
51
|
onCancelHandler();
|
|
53
52
|
}, 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
53
|
(typeof onSubmit !== 'function' ? onSubmit.handler : onSubmit)();
|
|
@@ -1 +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,EACL,kBAAkB,EAClB,SAAS,EACT,YAAY,EACZ,OAAO,EACP,aAAa,EACb,MAAM,EACP,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,
|
|
1
|
+
{"version":3,"file":"FormDialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/FormDialog.tsx"],"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AAC;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,IACJ,IACU,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 Progress from '../Progress';\nimport { OmitStrict } from '../../types';\nimport Flex from '../Flex';\n\nimport {\n StyledChildrenWrap,\n StyledDialogContent,\n StyledDialogFooter,\n StyledDialogHeader\n} 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 arrow = true,\n target,\n heading,\n ariaLabel,\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 {...(heading === undefined ? { ariaLabel } : { labelledbyId: headingId })}\n arrow={arrow}\n target={target}\n progress={progress}\n ref={dialogRef}\n >\n {heading !== undefined && (\n <Flex\n container={{ alignItems: 'center', justify: 'between', pad: 2 }}\n item={{ shrink: 0 }}\n as={StyledDialogHeader}\n >\n <Text id={headingId} variant='h2'>\n {heading}\n </Text>\n </Flex>\n )}\n\n <Flex item={{ grow: 1 }} as={StyledDialogContent}>\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 </Flex>\n\n <Flex\n container={{ alignItems: 'center', justify: 'between', pad: 2 }}\n item={{ shrink: 0 }}\n as={StyledDialogFooter}\n >\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 </Flex>\n </StyledFormDialog>\n );\n }\n );\n\nexport default FormDialog;\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FC, HTMLAttributes } from 'react';
|
|
2
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
3
|
declare const InfoDialog: FC<InfoDialogProps & HTMLAttributes<HTMLDivElement>>;
|
|
5
4
|
export default InfoDialog;
|
|
6
5
|
//# sourceMappingURL=InfoDialog.d.ts.map
|
|
@@ -1 +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;
|
|
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;AAiB3F,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjD,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,GAAG,cAAc,CAAC,cAAc,CAAC,CAgHpE,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useRef, useEffect } from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
3
|
import { useConsolidatedRef, useEscape, useFocusTrap, useI18n, useOuterEvent, useUID } from '../../hooks';
|
|
5
|
-
import Button from '../Button';
|
|
6
4
|
import Text from '../Text';
|
|
7
|
-
import { CardContent, CardHeader } from '../Card';
|
|
8
5
|
import Icon from '../Icon';
|
|
9
6
|
import Progress from '../Progress';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { StyledChildrenWrap } from './Dialog.styles';
|
|
13
|
-
|
|
14
|
-
const InfoDialog = forwardRef(({ target, heading
|
|
7
|
+
import Flex from '../Flex';
|
|
8
|
+
import SummaryItem from '../SummaryItem';
|
|
9
|
+
import { StyledChildrenWrap, StyledDialogContent, StyledDialogHeader } from './Dialog.styles';
|
|
10
|
+
import { StyledDismissButton, StyledInfoDialog } from './InfoDialog.styles';
|
|
11
|
+
const InfoDialog = forwardRef(({ target, heading: headingProp, children, progress: progressProp, onDismiss, ...restProps }, ref) => {
|
|
15
12
|
const t = useI18n();
|
|
16
13
|
const headingId = useUID();
|
|
17
14
|
const dialogRef = useConsolidatedRef(ref);
|
|
@@ -24,10 +21,10 @@ const InfoDialog = forwardRef(({ target, heading, headingHidden = false, childre
|
|
|
24
21
|
});
|
|
25
22
|
useFocusTrap(dialogRef);
|
|
26
23
|
useEffect(() => {
|
|
27
|
-
if (!
|
|
24
|
+
if (!progressProp) {
|
|
28
25
|
closeButtonRef.current?.focus();
|
|
29
26
|
}
|
|
30
|
-
}, [
|
|
27
|
+
}, [progressProp]);
|
|
31
28
|
useEffect(() => {
|
|
32
29
|
return () => {
|
|
33
30
|
if (document.contains(target)) {
|
|
@@ -35,9 +32,14 @@ const InfoDialog = forwardRef(({ target, heading, headingHidden = false, childre
|
|
|
35
32
|
}
|
|
36
33
|
};
|
|
37
34
|
}, []);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
const heading = headingProp ? (_jsx(Text, { id: headingId, variant: 'h2', children: typeof headingProp === 'string' ? headingProp : headingProp.primary })) : null;
|
|
36
|
+
const progress = (_jsx(Progress, { visible: !!progressProp, focusOnVisible: true, placement: children ? 'local' : 'block', message: typeof progressProp === 'string' ? progressProp : undefined }));
|
|
37
|
+
const dismissButton = (_jsx(StyledDismissButton, { icon: true, variant: 'simple', onClick: () => {
|
|
38
|
+
onDismiss();
|
|
39
|
+
}, label: t('close'), ref: closeButtonRef, children: _jsx(Icon, { name: 'times' }) }));
|
|
40
|
+
return (_jsxs(StyledInfoDialog, { ...restProps, ...(typeof headingProp === 'string'
|
|
41
|
+
? { labelledbyId: headingId }
|
|
42
|
+
: { ariaLabel: headingProp?.primary }), arrow: true, target: target, progress: progressProp, ref: dialogRef, children: [headingProp && heading && (_jsxs(Flex, { container: { alignItems: 'center', justify: 'between', pad: 2, gap: 1 }, item: { shrink: 0 }, as: StyledDialogHeader, children: [typeof headingProp === 'string' ? (heading) : (_jsx(SummaryItem, { primary: heading, secondary: headingProp.secondary ? (_jsx(Text, { variant: 'secondary', children: headingProp.secondary })) : undefined, visual: headingProp.visual })), dismissButton] })), _jsxs(Flex, { container: { direction: 'column' }, item: { grow: 1 }, as: StyledDialogContent, children: [!headingProp && dismissButton, children && _jsx(StyledChildrenWrap, { children: children }), progress] })] }));
|
|
41
43
|
});
|
|
42
44
|
export default InfoDialog;
|
|
43
45
|
//# sourceMappingURL=InfoDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoDialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/InfoDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,EAAM,SAAS,EAAkB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"InfoDialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/InfoDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,EAAM,SAAS,EAAkB,MAAM,OAAO,CAAC;AAE3F,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,YAAY,EACZ,OAAO,EACP,aAAa,EACb,MAAM,EACP,MAAM,aAAa,CAAC;AACrB,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE9F,OAAO,EAAE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V,OAAO,EAAE,OAAO,EAChB,SAAS,EACP,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CACtB,KAAC,IAAI,IAAC,OAAO,EAAC,WAAW,YAAE,WAAW,CAAC,SAAS,GAAQ,CACzD,CAAC,CAAC,CAAC,SAAS,EAEf,MAAM,EAAE,WAAW,CAAC,MAAM,GAC1B,CACH,EACA,aAAa,IACT,CACR,EAED,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,mBAAmB,aACjF,CAAC,WAAW,IAAI,aAAa,EAC7B,QAAQ,IAAI,KAAC,kBAAkB,cAAE,QAAQ,GAAsB,EAC/D,QAAQ,IACJ,IACU,CACpB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { forwardRef, PropsWithoutRef, useRef, FC, useEffect, HTMLAttributes } from 'react';\n\nimport {\n useConsolidatedRef,\n useEscape,\n useFocusTrap,\n useI18n,\n useOuterEvent,\n useUID\n} from '../../hooks';\nimport Text from '../Text';\nimport Icon from '../Icon';\nimport Progress from '../Progress';\nimport Flex from '../Flex';\nimport SummaryItem from '../SummaryItem';\n\nimport { StyledChildrenWrap, StyledDialogContent, StyledDialogHeader } from './Dialog.styles';\nimport { InfoDialogProps } from './Dialog.types';\nimport { StyledDismissButton, StyledInfoDialog } from './InfoDialog.styles';\n\nconst InfoDialog: FC<InfoDialogProps & HTMLAttributes<HTMLDivElement>> = forwardRef(\n (\n {\n target,\n heading: headingProp,\n children,\n progress: progressProp,\n onDismiss,\n ...restProps\n }: PropsWithoutRef<InfoDialogProps>,\n ref: InfoDialogProps['ref']\n ) => {\n const t = useI18n();\n const headingId = useUID();\n const dialogRef = useConsolidatedRef(ref);\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n\n useEscape(() => {\n onDismiss?.();\n });\n\n useOuterEvent('mousedown', [target, dialogRef], () => {\n onDismiss?.();\n });\n\n useFocusTrap(dialogRef);\n\n useEffect(() => {\n if (!progressProp) {\n closeButtonRef.current?.focus();\n }\n }, [progressProp]);\n\n useEffect(() => {\n return () => {\n if (document.contains(target)) {\n target.focus();\n }\n };\n }, []);\n\n const heading = headingProp ? (\n <Text id={headingId} variant='h2'>\n {typeof headingProp === 'string' ? headingProp : headingProp.primary}\n </Text>\n ) : null;\n\n const progress = (\n <Progress\n visible={!!progressProp}\n focusOnVisible\n placement={children ? 'local' : 'block'}\n message={typeof progressProp === 'string' ? progressProp : undefined}\n />\n );\n\n const dismissButton = (\n <StyledDismissButton\n icon\n variant='simple'\n onClick={() => {\n onDismiss();\n }}\n label={t('close')}\n ref={closeButtonRef}\n >\n <Icon name='times' />\n </StyledDismissButton>\n );\n\n return (\n <StyledInfoDialog\n {...restProps}\n {...(typeof headingProp === 'string'\n ? { labelledbyId: headingId }\n : { ariaLabel: headingProp?.primary })}\n arrow\n target={target}\n progress={progressProp}\n ref={dialogRef}\n >\n {headingProp && heading && (\n <Flex\n container={{ alignItems: 'center', justify: 'between', pad: 2, gap: 1 }}\n item={{ shrink: 0 }}\n as={StyledDialogHeader}\n >\n {typeof headingProp === 'string' ? (\n heading\n ) : (\n <SummaryItem\n primary={heading}\n secondary={\n headingProp.secondary ? (\n <Text variant='secondary'>{headingProp.secondary}</Text>\n ) : undefined\n }\n visual={headingProp.visual}\n />\n )}\n {dismissButton}\n </Flex>\n )}\n\n <Flex container={{ direction: 'column' }} item={{ grow: 1 }} as={StyledDialogContent}>\n {!headingProp && dismissButton}\n {children && <StyledChildrenWrap>{children}</StyledChildrenWrap>}\n {progress}\n </Flex>\n </StyledInfoDialog>\n );\n }\n);\n\nexport default InfoDialog;\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const StyledDismissButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Button").ButtonProps & import("../..").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
2
|
+
export declare const StyledInfoDialog: import("styled-components").StyledComponent<import("react").FC<import("./Dialog.types").BaseDialogProps & {
|
|
3
|
+
labelledbyId?: string | undefined;
|
|
4
|
+
ariaLabel?: string | undefined;
|
|
5
|
+
} & import("react").HTMLAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
+
//# sourceMappingURL=InfoDialog.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoDialog.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/InfoDialog.styles.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,mBAAmB,qMAAmB,CAAC;AAEpD,eAAO,MAAM,gBAAgB;;;yGAS3B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { defaultThemeProp } from '../../theme';
|
|
3
|
+
import Button from '../Button';
|
|
4
|
+
import Dialog from './Dialog';
|
|
5
|
+
import { StyledDialogContent } from './Dialog.styles';
|
|
6
|
+
export const StyledDismissButton = styled(Button) ``;
|
|
7
|
+
export const StyledInfoDialog = styled(Dialog)(({ theme }) => {
|
|
8
|
+
return css `
|
|
9
|
+
/* When a header is not rendered(e.g. progress state) the button must positioned atop. */
|
|
10
|
+
${StyledDialogContent} > ${StyledDismissButton} {
|
|
11
|
+
position: relative;
|
|
12
|
+
z-index: calc(${theme.base['z-index'].backdrop} + 1);
|
|
13
|
+
align-self: end;
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
});
|
|
17
|
+
StyledInfoDialog.defaultProps = defaultThemeProp;
|
|
18
|
+
//# sourceMappingURL=InfoDialog.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoDialog.styles.js","sourceRoot":"","sources":["../../../src/components/Dialog/InfoDialog.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,MAAM,MAAM,WAAW,CAAC;AAE/B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA,EAAE,CAAC;AAEpD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3D,OAAO,GAAG,CAAA;;MAEN,mBAAmB,MAAM,mBAAmB;;sBAE5B,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ;;;GAGjD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport Button from '../Button';\n\nimport Dialog from './Dialog';\nimport { StyledDialogContent } from './Dialog.styles';\n\nexport const StyledDismissButton = styled(Button)``;\n\nexport const StyledInfoDialog = styled(Dialog)(({ theme }) => {\n return css`\n /* When a header is not rendered(e.g. progress state) the button must positioned atop. */\n ${StyledDialogContent} > ${StyledDismissButton} {\n position: relative;\n z-index: calc(${theme.base['z-index'].backdrop} + 1);\n align-self: end;\n }\n `;\n});\n\nStyledInfoDialog.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -15,33 +15,33 @@ export interface DrawerProps extends AsProp, BaseProps {
|
|
|
15
15
|
shadow?: boolean;
|
|
16
16
|
/**
|
|
17
17
|
* Used to determine which side of the viewport the Drawer should open from.
|
|
18
|
-
* @default
|
|
18
|
+
* @default 'right'
|
|
19
19
|
*/
|
|
20
20
|
placement?: 'top' | 'right' | 'bottom' | 'left';
|
|
21
21
|
/**
|
|
22
22
|
* The position of the Drawer.
|
|
23
|
-
* @default
|
|
23
|
+
* @default 'absolute'
|
|
24
24
|
*/
|
|
25
25
|
position?: 'absolute' | 'fixed';
|
|
26
26
|
/**
|
|
27
27
|
* Determines the speed of the transition. This value comes from `theme.base.animation.speed`.
|
|
28
|
-
* @default
|
|
28
|
+
* @default '0.25s'
|
|
29
29
|
*/
|
|
30
30
|
transitionSpeed?: string;
|
|
31
31
|
/**
|
|
32
32
|
* The width or height that the Drawer will open to, depending on its placement.
|
|
33
|
-
* @default
|
|
33
|
+
* @default '100%'
|
|
34
34
|
*/
|
|
35
35
|
size?: string;
|
|
36
|
-
/**
|
|
36
|
+
/** Callback fired after Drawer opens. */
|
|
37
37
|
onAfterOpen?: () => void;
|
|
38
|
-
/**
|
|
38
|
+
/** Callback fired after Drawer closes. */
|
|
39
39
|
onAfterClose?: () => void;
|
|
40
|
-
/**
|
|
40
|
+
/** Callback fired before Drawer opens. */
|
|
41
41
|
onBeforeOpen?: () => void;
|
|
42
|
-
/** Callback fired before Drawer closes.
|
|
42
|
+
/** Callback fired before Drawer closes. */
|
|
43
43
|
onBeforeClose?: () => void;
|
|
44
|
-
/** Callback fired when a click action occurs outside of the Drawer.
|
|
44
|
+
/** Callback fired when a click action occurs outside of the Drawer. */
|
|
45
45
|
onOuterClick?: () => void;
|
|
46
46
|
/**
|
|
47
47
|
* If true, removes the component from the real DOM when closed. For full virtual DOM unmount(if necessary), perform at a parent level.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAEjB,SAAS,EAGV,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI9D,MAAM,WAAW,WAAY,SAAQ,MAAM,EAAE,SAAS;IACpD;;;OAGG;IACH,IAAI,EAAE,OAAO,CAAC;IACd,6BAA6B;IA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AAE,aAAa,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC;IAErF,MAAM,eAAe,GAAG,WAAW,CACjC,CAAC,CAAkB,EAAQ,EAAE;QAC3B,IAAI,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,OAAO,IAAI,CAAC,CAAC,YAAY,KAAK,WAAW;YAAE,OAAO;QAC7E,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACrC,CAAC,EACD,CAAC,IAAI,CAAC,CACP,CAAC;IAEF,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,IAAI,IAAI,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC5D,KAAC,YAAY,IACX,GAAG,EAAE,SAAS,EACd,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,IAAI,IAAI,EACtB,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,eAAe,KAC5B,SAAS,YAEZ,QAAQ,GACI,CAChB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import {\n useEffect,\n Ref,\n useCallback,\n FunctionComponent,\n forwardRef,\n ReactNode,\n TransitionEvent,\n useState\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { useOuterEvent, useConsolidatedRef, usePrevious } from '../../hooks';\nimport { AsProp, BaseProps, ForwardProps } from '../../types';\nimport { reflow } from '../../utils';\nimport { defaultThemeProp } from '../../theme';\n\nexport interface DrawerProps extends AsProp, BaseProps {\n /**\n * If true, the Drawer will be visible.\n * @default false\n */\n open: boolean;\n /** Content of the Drawer. */\n children?: ReactNode;\n /**\n * Determines whether a drop shadow should be visible along the edge of the Drawer for contrast purposes.\n * @default false\n */\n shadow?: boolean;\n /**\n * Used to determine which side of the viewport the Drawer should open from.\n * @default
|
|
1
|
+
{"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EAET,WAAW,EAEX,UAAU,EAGV,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE7E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAsD/C,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAA0C,KAAK,CAAC,EAAE;IACtF,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACnF,IAAI,SAAS,GAAG,YAAY,CAAC;IAC7B,IAAI,IAAI,GAAG,GAAG,CAAC;IACf,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,IAAI,SAAS,KAAK,KAAK,IAAI,SAAS,KAAK,QAAQ,EAAE;QACjD,SAAS,GAAG,UAAU,CAAC;QACvB,IAAI,GAAG,GAAG,CAAC;QACX,MAAM,GAAG,MAAM,CAAC;KACjB;IAED,MAAM,SAAS,GAAG,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACvE,MAAM,KAAK,GAAG,eAAe,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;IAE5D,OAAO,GAAG,CAAA;eACG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM;gBAC3B,QAAQ;MAClB,SAAS;MACT,MAAM;cACE,SAAS,KA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;IAEF,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,IAAI,IAAI,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC5D,KAAC,YAAY,IACX,GAAG,EAAE,SAAS,EACd,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,IAAI,IAAI,EACtB,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,eAAe,KAC5B,SAAS,YAEZ,QAAQ,GACI,CAChB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import {\n useEffect,\n Ref,\n useCallback,\n FunctionComponent,\n forwardRef,\n ReactNode,\n TransitionEvent,\n useState\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { useOuterEvent, useConsolidatedRef, usePrevious } from '../../hooks';\nimport { AsProp, BaseProps, ForwardProps } from '../../types';\nimport { reflow } from '../../utils';\nimport { defaultThemeProp } from '../../theme';\n\nexport interface DrawerProps extends AsProp, BaseProps {\n /**\n * If true, the Drawer will be visible.\n * @default false\n */\n open: boolean;\n /** Content of the Drawer. */\n children?: ReactNode;\n /**\n * Determines whether a drop shadow should be visible along the edge of the Drawer for contrast purposes.\n * @default false\n */\n shadow?: boolean;\n /**\n * Used to determine which side of the viewport the Drawer should open from.\n * @default 'right'\n */\n placement?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * The position of the Drawer.\n * @default 'absolute'\n */\n position?: 'absolute' | 'fixed';\n /**\n * Determines the speed of the transition. This value comes from `theme.base.animation.speed`.\n * @default '0.25s'\n */\n transitionSpeed?: string;\n /**\n * The width or height that the Drawer will open to, depending on its placement.\n * @default '100%'\n */\n size?: string;\n /** Callback fired after Drawer opens. */\n onAfterOpen?: () => void;\n /** Callback fired after Drawer closes. */\n onAfterClose?: () => void;\n /** Callback fired before Drawer opens. */\n onBeforeOpen?: () => void;\n /** Callback fired before Drawer closes. */\n onBeforeClose?: () => void;\n /** Callback fired when a click action occurs outside of the Drawer. */\n onOuterClick?: () => void;\n /**\n * If true, removes the component from the real DOM when closed. For full virtual DOM unmount(if necessary), perform at a parent level.\n * @default false\n */\n nullWhenClosed?: boolean;\n}\n\ntype State = 'open' | 'closed' | 'opening' | 'closing';\n\nexport const StyledDrawer = styled.div<Partial<DrawerProps & { state: State }>>(props => {\n const { state, shadow, position, placement, transitionSpeed, size, theme } = props;\n let dimension = 'horizontal';\n let axis = 'X';\n let anchor = 'top';\n\n if (placement === 'top' || placement === 'bottom') {\n dimension = 'vertical';\n axis = 'Y';\n anchor = 'left';\n }\n\n const translate = state === 'open' || state === 'opening' ? 0 : '100%';\n const speed = transitionSpeed || theme.base.animation.speed;\n\n return css`\n z-index: ${theme.base['z-index'].drawer};\n position: ${position};\n ${placement}: 0;\n ${anchor}: 0;\n height: ${dimension === 'vertical' ? size : '100%'};\n width: ${dimension === 'horizontal' ? size : '100%'};\n transition-property: transform, box-shadow, opacity;\n transition-duration: max(${speed}, 0.0001s);\n transition-timing-function: ${theme.base.animation.timing.ease};\n transform: ${state === 'open'\n ? 'none'\n : `translate${axis}(${placement === 'top' || placement === 'left' ? '-' : ''}${translate})`};\n\n ${shadow &&\n css`\n box-shadow: ${theme.base.shadow.high};\n `}\n `;\n});\n\nStyledDrawer.defaultProps = defaultThemeProp;\n\nconst Drawer: FunctionComponent<DrawerProps & ForwardProps> = forwardRef(\n (props: DrawerProps, ref: Ref<HTMLElement>) => {\n const {\n open = false,\n shadow = false,\n position = 'absolute',\n children,\n placement = 'right',\n transitionSpeed,\n size = '100%',\n onAfterOpen,\n onAfterClose,\n onBeforeOpen,\n onBeforeClose,\n onOuterClick,\n nullWhenClosed = false,\n ...restProps\n } = props;\n\n const drawerRef = useConsolidatedRef(ref);\n\n const [state, setState] = useState<State>(open ? 'open' : 'closed');\n\n let prevState = usePrevious(state);\n if (!prevState) prevState = state;\n\n useOuterEvent(\n 'mousedown',\n [drawerRef.current],\n useCallback(() => {\n if (open) onOuterClick?.();\n }, [open, onOuterClick])\n );\n\n useEffect(() => {\n if (open && (state === 'closed' || state === 'closing')) {\n onBeforeOpen?.();\n reflow(drawerRef.current);\n setState('opening');\n } else if (!open && (state === 'open' || state === 'opening')) {\n onBeforeClose?.();\n setState('closing');\n } else if (open && state === 'open' && prevState !== 'open') {\n onAfterOpen?.();\n } else if (!open && state === 'closed' && prevState !== 'closed') {\n onAfterClose?.();\n }\n }, [open, state, prevState, onBeforeOpen, onBeforeClose, onAfterOpen, onAfterClose]);\n\n const onTransitionEnd = useCallback(\n (e: TransitionEvent): void => {\n if (e.target !== drawerRef.current || e.propertyName !== 'transform') return;\n setState(open ? 'open' : 'closed');\n },\n [open]\n );\n\n return state === 'closed' && !open && nullWhenClosed ? null : (\n <StyledDrawer\n ref={drawerRef}\n position={position}\n shadow={shadow && open}\n transitionSpeed={transitionSpeed}\n placement={placement}\n size={size}\n open={open}\n state={state}\n onTransitionEnd={onTransitionEnd}\n {...restProps}\n >\n {children}\n </StyledDrawer>\n );\n }\n);\n\nexport default Drawer;\n"]}
|