@pega/cosmos-react-core 7.0.0-build.3.4 → 7.0.0-build.30.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/AIButton/AIButton.d.ts +30 -2
- package/lib/components/AIButton/AIButton.d.ts.map +1 -1
- package/lib/components/AIButton/AIButton.js +7 -6
- package/lib/components/AIButton/AIButton.js.map +1 -1
- package/lib/components/Actions/Actions.d.ts +1 -1
- package/lib/components/Actions/Actions.d.ts.map +1 -1
- package/lib/components/Actions/Actions.js +6 -3
- package/lib/components/Actions/Actions.js.map +1 -1
- package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.js +9 -7
- package/lib/components/AppShell/AppHeader.js.map +1 -1
- package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.styles.js +27 -20
- 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 +16 -4
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts +5 -1
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +52 -13
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.types.d.ts +4 -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 +3 -1
- package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellContext.js +3 -1
- package/lib/components/AppShell/AppShellContext.js.map +1 -1
- package/lib/components/AppShell/AppShellList.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellList.styles.js +1 -0
- 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 +3 -3
- 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 +1 -0
- package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -1
- package/lib/components/AppShell/Operator.d.ts +1 -1
- package/lib/components/AppShell/style-utils.d.ts +3 -0
- package/lib/components/AppShell/style-utils.d.ts.map +1 -1
- package/lib/components/AppShell/style-utils.js +42 -3
- package/lib/components/AppShell/style-utils.js.map +1 -1
- package/lib/components/Avatar/Avatar.d.ts +2 -2
- package/lib/components/Avatar/Avatar.d.ts.map +1 -1
- package/lib/components/Avatar/Avatar.js +21 -20
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/Avatar/Avatar.test-ids.d.ts +1 -1
- package/lib/components/Avatar/Avatar.test-ids.d.ts.map +1 -1
- package/lib/components/Backdrop/Backdrop.d.ts +1 -1
- package/lib/components/Backdrop/Backdrop.test-ids.d.ts +1 -1
- package/lib/components/Backdrop/Backdrop.test-ids.d.ts.map +1 -1
- package/lib/components/Badges/Alert.d.ts +1 -1
- package/lib/components/Badges/Badges.test-ids.d.ts +6 -6
- package/lib/components/Badges/Badges.test-ids.d.ts.map +1 -1
- package/lib/components/Badges/Count.d.ts +1 -1
- package/lib/components/Badges/Keyboard.d.ts +1 -1
- package/lib/components/Badges/Keyboard.d.ts.map +1 -1
- package/lib/components/Badges/Keyboard.js +9 -8
- package/lib/components/Badges/Keyboard.js.map +1 -1
- package/lib/components/Badges/Selection.d.ts +1 -1
- package/lib/components/Badges/Selection.d.ts.map +1 -1
- package/lib/components/Badges/Selection.js +3 -1
- package/lib/components/Badges/Selection.js.map +1 -1
- package/lib/components/Badges/Status.d.ts +1 -1
- package/lib/components/Badges/Status.d.ts.map +1 -1
- package/lib/components/Badges/Status.js +0 -1
- package/lib/components/Badges/Status.js.map +1 -1
- package/lib/components/Badges/Tag.d.ts +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 +5 -2
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Banner/Banner.test-ids.d.ts +1 -1
- package/lib/components/Banner/Banner.test-ids.d.ts.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/Button/Button.js +142 -53
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Card/Card.d.ts.map +1 -1
- package/lib/components/Card/Card.js +8 -0
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Checkbox/Checkbox.d.ts +3 -33
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/Checkbox.js +1 -5
- package/lib/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.d.ts +6 -23
- package/lib/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.js +3 -4
- 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/ComboBox/ComboBox.d.ts +2 -4
- package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.js +8 -5
- package/lib/components/ComboBox/ComboBox.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.styles.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.styles.js +7 -1
- package/lib/components/ComboBox/ComboBox.styles.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.types.d.ts +8 -26
- package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
- package/lib/components/ComboBox/ComboxBox.test-ids.d.ts +1 -1
- package/lib/components/ComboBox/ComboxBox.test-ids.d.ts.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +10 -2
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.d.ts +2 -3
- package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.js +2 -3
- 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.types.d.ts +4 -13
- 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 +1 -0
- package/lib/components/Configuration/Configuration.d.ts.map +1 -1
- package/lib/components/Configuration/Configuration.js +58 -30
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/Configuration/ThemeOverride.d.ts +11 -0
- package/lib/components/Configuration/ThemeOverride.d.ts.map +1 -0
- package/lib/components/Configuration/ThemeOverride.js +23 -0
- package/lib/components/Configuration/ThemeOverride.js.map +1 -0
- package/lib/components/Configuration/connected-watcher.d.ts +17 -0
- package/lib/components/Configuration/connected-watcher.d.ts.map +1 -0
- package/lib/components/Configuration/connected-watcher.js +13 -0
- package/lib/components/Configuration/connected-watcher.js.map +1 -0
- package/lib/components/Configuration/index.d.ts +1 -0
- package/lib/components/Configuration/index.d.ts.map +1 -1
- package/lib/components/Configuration/index.js +1 -0
- package/lib/components/Configuration/index.js.map +1 -1
- package/lib/components/Configuration/withConfiguration.d.ts.map +1 -1
- package/lib/components/Configuration/withConfiguration.js.map +1 -1
- package/lib/components/CreditCard/CreditCard.types.d.ts +5 -25
- package/lib/components/CreditCard/CreditCard.types.d.ts.map +1 -1
- package/lib/components/CreditCard/CreditCard.types.js.map +1 -1
- package/lib/components/CreditCard/CreditCardDisplay.d.ts +2 -4
- package/lib/components/CreditCard/CreditCardDisplay.d.ts.map +1 -1
- package/lib/components/CreditCard/CreditCardDisplay.js +1 -2
- package/lib/components/CreditCard/CreditCardDisplay.js.map +1 -1
- package/lib/components/CreditCard/CreditCardInput.d.ts +15 -5
- package/lib/components/CreditCard/CreditCardInput.d.ts.map +1 -1
- package/lib/components/CreditCard/CreditCardInput.js +1 -2
- package/lib/components/CreditCard/CreditCardInput.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/CurrencyInput.d.ts +1 -1
- package/lib/components/Currency/CurrencyInput.js +1 -1
- package/lib/components/Currency/CurrencyInput.js.map +1 -1
- package/lib/components/DangerButton/DangerButton.js +2 -2
- package/lib/components/DangerButton/DangerButton.js.map +1 -1
- package/lib/components/DateTime/DateTime.test-ids.d.ts +11 -11
- package/lib/components/DateTime/DateTime.test-ids.d.ts.map +1 -1
- package/lib/components/DateTime/DateTime.test-ids.js +5 -1
- package/lib/components/DateTime/DateTime.test-ids.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +30 -30
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.d.ts +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.js +2 -2
- package/lib/components/DateTime/Input/DateRangeInput.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 +24 -16
- package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +28 -22
- 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/Duration/DurationInput.d.ts +1 -1
- package/lib/components/DateTime/Input/MonthInput.d.ts +1 -1
- package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.js +23 -12
- package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
- package/lib/components/DateTime/Input/PartInput.d.ts +1 -1
- package/lib/components/DateTime/Input/PartInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/PartInput.js +13 -7
- package/lib/components/DateTime/Input/PartInput.js.map +1 -1
- package/lib/components/DateTime/Input/QuarterInput.d.ts +1 -1
- package/lib/components/DateTime/Input/TimeInput.d.ts +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.js +3 -3
- package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.d.ts +1 -1
- package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.js +17 -6
- package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
- package/lib/components/DateTime/Input/utils.d.ts +3 -2
- package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Input/utils.js +9 -2
- 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 +5 -4
- package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.styles.js +2 -1
- package/lib/components/DateTime/Picker/Calendar.styles.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.d.ts +1 -1
- package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.js +31 -19
- package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.styles.d.ts +1 -0
- package/lib/components/DateTime/Picker/DatePicker.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.styles.js +13 -5
- package/lib/components/DateTime/Picker/DatePicker.styles.js.map +1 -1
- package/lib/components/DateTime/Picker/DateRangePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DateRangePicker.js +18 -11
- package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.js +2 -1
- package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/utils.d.ts +9 -0
- package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/utils.js +16 -0
- package/lib/components/DateTime/Picker/utils.js.map +1 -1
- package/lib/components/DateTime/index.d.ts +1 -1
- package/lib/components/DateTime/index.d.ts.map +1 -1
- package/lib/components/DateTime/index.js +1 -1
- package/lib/components/DateTime/index.js.map +1 -1
- package/lib/components/DateTime/utils.d.ts +5 -0
- package/lib/components/DateTime/utils.d.ts.map +1 -1
- package/lib/components/DateTime/utils.js +21 -11
- package/lib/components/DateTime/utils.js.map +1 -1
- package/lib/components/Email/EmailDisplay.d.ts.map +1 -1
- package/lib/components/Email/EmailDisplay.js +2 -2
- package/lib/components/Email/EmailDisplay.js.map +1 -1
- package/lib/components/EmptyState/EmptyState.d.ts.map +1 -1
- package/lib/components/EmptyState/EmptyState.js +5 -2
- package/lib/components/EmptyState/EmptyState.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.d.ts +6 -0
- package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.js +36 -14
- package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts +1 -0
- package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.js +18 -18
- package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.d.ts +14 -10
- package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.js +13 -5
- 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/CompactList.d.ts +15 -0
- package/lib/components/File/CompactList.d.ts.map +1 -0
- package/lib/components/File/CompactList.js +21 -0
- package/lib/components/File/CompactList.js.map +1 -0
- 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/FileDisplay.d.ts +5 -0
- package/lib/components/File/FileDisplay.d.ts.map +1 -1
- package/lib/components/File/FileDisplay.js +2 -2
- package/lib/components/File/FileDisplay.js.map +1 -1
- package/lib/components/File/FileDisplayList.d.ts +10 -0
- package/lib/components/File/FileDisplayList.d.ts.map +1 -0
- package/lib/components/File/FileDisplayList.js +14 -0
- package/lib/components/File/FileDisplayList.js.map +1 -0
- package/lib/components/File/FileInput.d.ts +38 -9
- package/lib/components/File/FileInput.d.ts.map +1 -1
- package/lib/components/File/FileInput.js +183 -72
- package/lib/components/File/FileInput.js.map +1 -1
- package/lib/components/File/FileInput.styles.d.ts +26 -0
- package/lib/components/File/FileInput.styles.d.ts.map +1 -0
- package/lib/components/File/FileInput.styles.js +166 -0
- package/lib/components/File/FileInput.styles.js.map +1 -0
- package/lib/components/File/FileItem.d.ts +18 -4
- package/lib/components/File/FileItem.d.ts.map +1 -1
- package/lib/components/File/FileItem.js +84 -30
- package/lib/components/File/FileItem.js.map +1 -1
- package/lib/components/File/FileList.d.ts +20 -0
- package/lib/components/File/FileList.d.ts.map +1 -0
- package/lib/components/File/FileList.js +66 -0
- package/lib/components/File/FileList.js.map +1 -0
- package/lib/components/File/FileUploadItem.d.ts +4 -0
- package/lib/components/File/FileUploadItem.d.ts.map +1 -1
- package/lib/components/File/FileUploadItem.js +42 -38
- package/lib/components/File/FileUploadItem.js.map +1 -1
- package/lib/components/File/index.d.ts +4 -0
- package/lib/components/File/index.d.ts.map +1 -1
- package/lib/components/File/index.js +2 -0
- package/lib/components/File/index.js.map +1 -1
- package/lib/components/Flex/Flex.js.map +1 -1
- package/lib/components/Form/Form.d.ts +1 -1
- package/lib/components/Form/Form.test-ids.d.ts +1 -1
- package/lib/components/Form/Form.test-ids.d.ts.map +1 -1
- package/lib/components/FormField/FormField.d.ts +2 -2
- package/lib/components/FormField/FormField.d.ts.map +1 -1
- package/lib/components/FormField/FormField.js +45 -60
- package/lib/components/FormField/FormField.js.map +1 -1
- package/lib/components/FormField/FormField.test-ids.d.ts +1 -1
- package/lib/components/FormField/FormField.test-ids.d.ts.map +1 -1
- package/lib/components/Fullscreen/Fullscreen.d.ts +18 -0
- package/lib/components/Fullscreen/Fullscreen.d.ts.map +1 -0
- package/lib/components/Fullscreen/Fullscreen.js +56 -0
- package/lib/components/Fullscreen/Fullscreen.js.map +1 -0
- package/lib/components/Fullscreen/Fullscreen.test-ids.d.ts +2 -0
- package/lib/components/Fullscreen/Fullscreen.test-ids.d.ts.map +1 -0
- package/lib/components/Fullscreen/Fullscreen.test-ids.js +3 -0
- package/lib/components/Fullscreen/Fullscreen.test-ids.js.map +1 -0
- package/lib/components/Fullscreen/FullscreenButton.d.ts +6 -0
- package/lib/components/Fullscreen/FullscreenButton.d.ts.map +1 -0
- package/lib/components/Fullscreen/FullscreenButton.js +33 -0
- package/lib/components/Fullscreen/FullscreenButton.js.map +1 -0
- package/lib/components/Fullscreen/index.d.ts +4 -0
- package/lib/components/Fullscreen/index.d.ts.map +1 -0
- package/lib/components/Fullscreen/index.js +4 -0
- package/lib/components/Fullscreen/index.js.map +1 -0
- package/lib/components/HTML/HTML.d.ts +1 -1
- package/lib/components/HTML/HTML.test-ids.d.ts +1 -1
- package/lib/components/HTML/HTML.test-ids.d.ts.map +1 -1
- package/lib/components/Icon/Icon.d.ts.map +1 -1
- package/lib/components/Icon/Icon.js +1 -1
- package/lib/components/Icon/Icon.js.map +1 -1
- package/lib/components/Icon/iconNames.d.ts +1 -1
- 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/calendar-now.icon.d.ts +5 -0
- package/lib/components/Icon/icons/calendar-now.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/calendar-now.icon.js +7 -0
- package/lib/components/Icon/icons/calendar-now.icon.js.map +1 -0
- package/lib/components/Icon/icons/preview.icon.d.ts +5 -0
- package/lib/components/Icon/icons/preview.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/preview.icon.js +7 -0
- package/lib/components/Icon/icons/preview.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/arrow-down.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-down.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-left.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-left.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-down.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-down.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-left.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-left.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-right.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-right.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-up.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-up.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-right.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-right.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-up.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-up.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/calendar-now.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/calendar-now.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/calendar-now.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/calendar-now.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/caret-down.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/caret-down.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/caret-left.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/caret-left.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/caret-right.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/caret-right.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/caret-up.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/caret-up.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/case-solid.icon.d.ts +1 -1
- package/lib/components/Icon/streamline-icons/case-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/case-solid.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/case-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/clipboard-pencil-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/clipboard-pencil-solid.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/clipboard-pencil-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/clock-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/clock-solid.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/clock-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/disc-stack-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/disc-stack-solid.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/disc-stack-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/dock.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/dock.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/dock.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/dock.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/drag.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/drag.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/expression.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/expression.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/expression.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/expression.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/indent.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/indent.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/indent.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/indent.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/information-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/information-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/information-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/information-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/list-number.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/list-number.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/list-number.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/list-number.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-down.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-down.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-down.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-down.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-left.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-left.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-left.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-left.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-right.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-right.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-right.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-right.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-up.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-up.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-up.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-up.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/minus.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/minus.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/minus.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/open.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/open.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/plus.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/plus.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/plus.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/rule-library-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/rule-library-solid.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/rule-library-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/search-analytics-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/search-analytics-solid.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/search-analytics-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/times.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/times.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/times.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/undock.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/undock.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/undock.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/undock.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/unindent.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/unindent.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/unindent.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/unindent.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/warn-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/warn-solid.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/warn-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamlineIconNames.d.ts +1 -1
- package/lib/components/Icon/streamlineIconNames.d.ts.map +1 -1
- package/lib/components/Icon/streamlineIconNames.js +12 -0
- package/lib/components/Icon/streamlineIconNames.js.map +1 -1
- package/lib/components/IconPicker/IconPicker.d.ts +7 -1
- package/lib/components/IconPicker/IconPicker.d.ts.map +1 -1
- package/lib/components/IconPicker/IconPicker.js +20 -14
- package/lib/components/IconPicker/IconPicker.js.map +1 -1
- package/lib/components/Input/Input.d.ts +5 -8
- package/lib/components/Input/Input.d.ts.map +1 -1
- package/lib/components/Input/Input.js +2 -3
- 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/Label/Label.js +2 -2
- package/lib/components/Label/Label.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.js +21 -12
- package/lib/components/Lightbox/Lightbox.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.styles.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.test-ids.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.test-ids.d.ts.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 +5 -2
- package/lib/components/Link/Link.d.ts.map +1 -1
- package/lib/components/Link/Link.js +28 -16
- package/lib/components/Link/Link.js.map +1 -1
- package/lib/components/Link/Link.test-ids.d.ts +1 -1
- package/lib/components/Link/Link.test-ids.d.ts.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 +9 -8
- package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.js +6 -9
- package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts +1 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.js +4 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.d.ts +7 -3
- package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
- package/lib/components/ListToolbar/PresetMenuPopover.d.ts.map +1 -1
- package/lib/components/ListToolbar/PresetMenuPopover.js +2 -2
- package/lib/components/ListToolbar/PresetMenuPopover.js.map +1 -1
- package/lib/components/ListToolbar/helpers.d.ts.map +1 -1
- package/lib/components/ListToolbar/helpers.js.map +1 -1
- package/lib/components/Location/CurrentLocationButton.d.ts +1 -6
- package/lib/components/Location/CurrentLocationButton.d.ts.map +1 -1
- package/lib/components/Location/CurrentLocationButton.js +10 -20
- package/lib/components/Location/CurrentLocationButton.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.types.d.ts +49 -17
- package/lib/components/Location/Location.types.d.ts.map +1 -1
- package/lib/components/Location/Location.types.js +9 -1
- package/lib/components/Location/Location.types.js.map +1 -1
- package/lib/components/Location/LocationDisplay.d.ts +5 -4
- package/lib/components/Location/LocationDisplay.d.ts.map +1 -1
- package/lib/components/Location/LocationDisplay.js +17 -4
- package/lib/components/Location/LocationDisplay.js.map +1 -1
- package/lib/components/Location/LocationInput.d.ts +23 -18
- package/lib/components/Location/LocationInput.d.ts.map +1 -1
- package/lib/components/Location/LocationInput.js +37 -15
- package/lib/components/Location/LocationInput.js.map +1 -1
- package/lib/components/Location/LocationView.d.ts +26 -12
- package/lib/components/Location/LocationView.d.ts.map +1 -1
- package/lib/components/Location/LocationView.js +103 -50
- package/lib/components/Location/LocationView.js.map +1 -1
- package/lib/components/Location/index.d.ts +2 -2
- package/lib/components/Location/index.d.ts.map +1 -1
- package/lib/components/Location/index.js +1 -1
- package/lib/components/Location/index.js.map +1 -1
- package/lib/components/Location/utils.d.ts +20 -2
- package/lib/components/Location/utils.d.ts.map +1 -1
- package/lib/components/Location/utils.js +184 -41
- package/lib/components/Location/utils.js.map +1 -1
- package/lib/components/Menu/Menu.context.d.ts.map +1 -1
- package/lib/components/Menu/Menu.context.js +1 -0
- package/lib/components/Menu/Menu.context.js.map +1 -1
- package/lib/components/Menu/Menu.d.ts +1 -1
- package/lib/components/Menu/Menu.d.ts.map +1 -1
- package/lib/components/Menu/Menu.js +6 -2
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/Menu.styles.d.ts +0 -1
- package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
- package/lib/components/Menu/Menu.styles.js +5 -12
- 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 +14 -2
- 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/Menu.utils.d.ts +4 -0
- package/lib/components/Menu/Menu.utils.d.ts.map +1 -0
- package/lib/components/Menu/Menu.utils.js +6 -0
- package/lib/components/Menu/Menu.utils.js.map +1 -0
- package/lib/components/Menu/MenuGroup.js +2 -2
- package/lib/components/Menu/MenuGroup.js.map +1 -1
- package/lib/components/Menu/MenuItem.d.ts +1 -1
- package/lib/components/Menu/MenuItem.d.ts.map +1 -1
- package/lib/components/Menu/MenuItem.js +3 -3
- package/lib/components/Menu/MenuItem.js.map +1 -1
- package/lib/components/Menu/MenuList.d.ts.map +1 -1
- package/lib/components/Menu/MenuList.js +3 -3
- package/lib/components/Menu/MenuList.js.map +1 -1
- package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
- package/lib/components/Menu/NavItemsList.js +1 -3
- package/lib/components/Menu/NavItemsList.js.map +1 -1
- package/lib/components/Menu/index.d.ts +1 -0
- package/lib/components/Menu/index.d.ts.map +1 -1
- package/lib/components/Menu/index.js +1 -0
- package/lib/components/Menu/index.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.d.ts +8 -1
- package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +15 -5
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.test-ids.d.ts +1 -1
- package/lib/components/MenuButton/MenuButton.test-ids.d.ts.map +1 -1
- package/lib/components/MetaList/MetaList.d.ts +1 -1
- 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 +10 -3
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/Modal.styles.d.ts.map +1 -1
- package/lib/components/Modal/Modal.styles.js +24 -3
- package/lib/components/Modal/Modal.styles.js.map +1 -1
- package/lib/components/Modal/ModalManager.d.ts.map +1 -1
- package/lib/components/Modal/ModalManager.js +5 -1
- package/lib/components/Modal/ModalManager.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/NumberInput.d.ts +1 -1
- package/lib/components/Number/NumberInput.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.js +11 -3
- package/lib/components/Number/NumberInput.js.map +1 -1
- package/lib/components/Number/NumberRangeInput.d.ts +1 -1
- package/lib/components/Number/NumberRangeInput.d.ts.map +1 -1
- package/lib/components/Number/NumberRangeInput.js +5 -69
- package/lib/components/Number/NumberRangeInput.js.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.styles.d.ts +3 -1
- package/lib/components/PageTemplates/CategorySubPage.styles.d.ts.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.styles.js +3 -2
- 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 +41 -6
- package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts +1 -0
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js +84 -31
- 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/PhoneDisplay.d.ts.map +1 -1
- package/lib/components/Phone/PhoneDisplay.js +2 -2
- package/lib/components/Phone/PhoneDisplay.js.map +1 -1
- package/lib/components/Phone/PhoneInput.d.ts +1 -1
- package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
- package/lib/components/Phone/PhoneInput.js +8 -3
- package/lib/components/Phone/PhoneInput.js.map +1 -1
- package/lib/components/Popover/Popover.d.ts +2 -0
- package/lib/components/Popover/Popover.d.ts.map +1 -1
- package/lib/components/Popover/Popover.js +20 -3
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
- package/lib/components/Popover/Popover.styles.js +2 -2
- package/lib/components/Popover/Popover.styles.js.map +1 -1
- package/lib/components/Popover/modifiers.d.ts.map +1 -1
- package/lib/components/Popover/modifiers.js +11 -5
- package/lib/components/Popover/modifiers.js.map +1 -1
- package/lib/components/Progress/Progress.d.ts.map +1 -1
- package/lib/components/Progress/Progress.js +2 -2
- package/lib/components/Progress/Progress.js.map +1 -1
- package/lib/components/Progress/Progress.styles.d.ts +1 -1
- package/lib/components/Progress/Progress.styles.d.ts.map +1 -1
- package/lib/components/Progress/Progress.styles.js +9 -9
- package/lib/components/Progress/Progress.styles.js.map +1 -1
- package/lib/components/Progress/Progress.types.d.ts +4 -0
- package/lib/components/Progress/Progress.types.d.ts.map +1 -1
- package/lib/components/Progress/Progress.types.js.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.d.ts +6 -30
- package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.js +3 -4
- package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts +19 -6
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.js +5 -1
- package/lib/components/SearchInput/SearchInput.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.styles.d.ts +3 -3
- package/lib/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.styles.js +15 -15
- package/lib/components/SearchInput/SearchInput.styles.js.map +1 -1
- package/lib/components/Select/Select.d.ts +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/Slider/Slider.d.ts +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/SummaryItem/SummaryItem.d.ts +6 -1
- package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.js +13 -5
- 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.map +1 -1
- package/lib/components/SummaryList/SummaryList.js +9 -9
- package/lib/components/SummaryList/SummaryList.js.map +1 -1
- package/lib/components/Switch/Switch.js +2 -2
- package/lib/components/Switch/Switch.js.map +1 -1
- package/lib/components/Tabs/Tab.d.ts +7 -3
- package/lib/components/Tabs/Tab.d.ts.map +1 -1
- package/lib/components/Tabs/Tab.js +83 -23
- package/lib/components/Tabs/Tab.js.map +1 -1
- package/lib/components/Tabs/TabPanel.d.ts +13 -2
- package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
- package/lib/components/Tabs/TabPanel.js +60 -5
- package/lib/components/Tabs/TabPanel.js.map +1 -1
- package/lib/components/Tabs/Tabs.d.ts +0 -1
- package/lib/components/Tabs/Tabs.d.ts.map +1 -1
- package/lib/components/Tabs/Tabs.js +97 -35
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/Tabs/Tabs.styles.d.ts +17 -0
- package/lib/components/Tabs/Tabs.styles.d.ts.map +1 -0
- package/lib/components/Tabs/Tabs.styles.js +110 -0
- package/lib/components/Tabs/Tabs.styles.js.map +1 -0
- package/lib/components/Tabs/TabsContext.d.ts +6 -0
- package/lib/components/Tabs/TabsContext.d.ts.map +1 -0
- package/lib/components/Tabs/TabsContext.js +6 -0
- package/lib/components/Tabs/TabsContext.js.map +1 -0
- package/lib/components/Tabs/index.d.ts +1 -0
- package/lib/components/Tabs/index.d.ts.map +1 -1
- package/lib/components/Tabs/index.js +1 -0
- package/lib/components/Tabs/index.js.map +1 -1
- package/lib/components/Text/Text.js +1 -1
- package/lib/components/Text/Text.js.map +1 -1
- package/lib/components/TextArea/TextArea.d.ts +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/Toaster/Toaster.d.ts +1 -1
- package/lib/components/Toaster/Toaster.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.js +88 -19
- package/lib/components/Toaster/Toaster.js.map +1 -1
- package/lib/components/Toaster/Toaster.test-ids.d.ts +1 -1
- package/lib/components/Toaster/Toaster.test-ids.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.types.d.ts +17 -4
- 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.d.ts.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +19 -4
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.test-ids.d.ts +1 -1
- package/lib/components/Tooltip/Tooltip.test-ids.d.ts.map +1 -1
- package/lib/components/Tree/StandardTree.styles.d.ts +1 -1
- package/lib/components/Tree/Tree.d.ts +1 -1
- package/lib/components/Tree/Tree.test-ids.d.ts +2 -2
- package/lib/components/Tree/Tree.test-ids.d.ts.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.d.ts.map +1 -1
- package/lib/hooks/useArrows.js +3 -1
- package/lib/hooks/useArrows.js.map +1 -1
- package/lib/hooks/useEvent.d.ts +5 -0
- package/lib/hooks/useEvent.d.ts.map +1 -1
- package/lib/hooks/useEvent.js.map +1 -1
- package/lib/hooks/useFocusWithin.d.ts.map +1 -1
- package/lib/hooks/useFocusWithin.js +14 -8
- package/lib/hooks/useFocusWithin.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +146 -3
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useScrollStick.d.ts +3 -3
- package/lib/hooks/useScrollStick.d.ts.map +1 -1
- package/lib/hooks/useScrollStick.js +6 -5
- package/lib/hooks/useScrollStick.js.map +1 -1
- package/lib/hooks/useScrollToggle.d.ts.map +1 -1
- package/lib/hooks/useScrollToggle.js +1 -0
- package/lib/hooks/useScrollToggle.js.map +1 -1
- package/lib/hooks/useSimpleStoreInstance.d.ts +9 -0
- package/lib/hooks/useSimpleStoreInstance.d.ts.map +1 -0
- package/lib/hooks/useSimpleStoreInstance.js +13 -0
- package/lib/hooks/useSimpleStoreInstance.js.map +1 -0
- package/lib/hooks/useTestIds.d.ts +1 -1
- package/lib/hooks/useTestIds.d.ts.map +1 -1
- package/lib/hooks/useTestIds.js +1 -1
- package/lib/hooks/useTestIds.js.map +1 -1
- package/lib/i18n/default.d.ts +146 -3
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +169 -11
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +146 -3
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/styles/GlobalStyle.d.ts +1 -1
- package/lib/styles/GlobalStyle.d.ts.map +1 -1
- package/lib/styles/GlobalStyle.js +6 -1
- package/lib/styles/GlobalStyle.js.map +1 -1
- package/lib/styles/mixins.d.ts +3 -0
- package/lib/styles/mixins.d.ts.map +1 -0
- package/lib/styles/mixins.js +14 -0
- package/lib/styles/mixins.js.map +1 -0
- package/lib/styles/utils.d.ts +11 -5
- package/lib/styles/utils.d.ts.map +1 -1
- package/lib/styles/utils.js +28 -12
- package/lib/styles/utils.js.map +1 -1
- package/lib/theme/ThemeMachine.d.ts.map +1 -1
- package/lib/theme/ThemeMachine.js.map +1 -1
- package/lib/theme/theme.d.ts +18 -0
- package/lib/theme/theme.d.ts.map +1 -1
- package/lib/theme/themeDefinition.json +9 -2
- package/lib/theme/themeOverrides.schema.json +13 -0
- package/lib/types/types.d.ts +4 -2
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/types.js.map +1 -1
- package/lib/utils/formatListToLocaleString.d.ts.map +1 -1
- package/lib/utils/formatListToLocaleString.js +5 -2
- package/lib/utils/formatListToLocaleString.js.map +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/isPositionWithinRect.d.ts +12 -0
- package/lib/utils/isPositionWithinRect.d.ts.map +1 -0
- package/lib/utils/isPositionWithinRect.js +11 -0
- package/lib/utils/isPositionWithinRect.js.map +1 -0
- package/lib/utils/withTestIds.d.ts +1 -1
- package/package.json +9 -6
- package/lib/components/Location/types.d.ts +0 -45
- package/lib/components/Location/types.d.ts.map +0 -1
- package/lib/components/Location/types.js +0 -10
- package/lib/components/Location/types.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC/F,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC/F,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default } from './Menu';
|
|
2
2
|
export { StyledMenuListWrapper, StyledMenuItem, StyledMenuListContainer } from './Menu.styles';
|
|
3
|
+
export { default as isMenuGroupProps } from './Menu.utils';
|
|
3
4
|
export { default as menuHelpers } from './helpers';
|
|
4
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAE/F,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export { default } from './Menu';\nexport { StyledMenuListWrapper, StyledMenuItem, StyledMenuListContainer } from './Menu.styles';\nexport type { MenuItemProps, MenuProps, MenuGroupProps } from './Menu.types';\nexport { default as menuHelpers } from './helpers';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAE/F,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export { default } from './Menu';\nexport { StyledMenuListWrapper, StyledMenuItem, StyledMenuListContainer } from './Menu.styles';\nexport type { MenuItemProps, MenuProps, MenuGroupProps } from './Menu.types';\nexport { default as isMenuGroupProps } from './Menu.utils';\nexport { default as menuHelpers } from './helpers';\n"]}
|
|
@@ -30,9 +30,16 @@ export interface MenuButtonProps extends BaseProps, NoChildrenProp, TestIdProp {
|
|
|
30
30
|
ref?: ButtonProps['ref'];
|
|
31
31
|
/** The keydown handler for the MenuButton. */
|
|
32
32
|
onKeyDown?: KeyboardEventHandler;
|
|
33
|
+
/**
|
|
34
|
+
* Whether to display an arrow when only the icon is displayed.
|
|
35
|
+
* Only applies when `iconOnly` is true.
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
showArrow?: boolean;
|
|
33
39
|
}
|
|
40
|
+
export declare const StyledMenuButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
34
41
|
declare const _default: FunctionComponent<ForwardProps & MenuButtonProps> & {
|
|
35
|
-
getTestIds: (testIdProp?: string | undefined) => import("../../types").TestIdsRecord<readonly []>;
|
|
42
|
+
getTestIds: (testIdProp?: string | null | undefined) => import("../../types").TestIdsRecord<readonly []>;
|
|
36
43
|
};
|
|
37
44
|
export default _default;
|
|
38
45
|
//# sourceMappingURL=MenuButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuButton.d.ts","sourceRoot":"","sources":["../../../src/components/MenuButton/MenuButton.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OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,gBAAgB,4GAiB5B,CAAC;;;;AAwKF,wBAA6D"}
|
|
@@ -14,7 +14,7 @@ import { Count } from '../Badges';
|
|
|
14
14
|
import { withTestIds } from '../../utils';
|
|
15
15
|
import { getMenuButtonTestIds } from './MenuButton.test-ids';
|
|
16
16
|
registerIcon(arrowMicroDownIcon);
|
|
17
|
-
const StyledMenuButton = styled.button(({ theme: { base: { spacing } } }) => {
|
|
17
|
+
export const StyledMenuButton = styled.button(({ theme: { base: { spacing } } }) => {
|
|
18
18
|
return css `
|
|
19
19
|
gap: ${spacing};
|
|
20
20
|
flex-shrink: 0;
|
|
@@ -27,10 +27,20 @@ const StyledMenuButton = styled.button(({ theme: { base: { spacing } } }) => {
|
|
|
27
27
|
`;
|
|
28
28
|
});
|
|
29
29
|
StyledMenuButton.defaultProps = defaultThemeProp;
|
|
30
|
-
const StyledMenuButtonChildren = styled.span(({ theme }) => {
|
|
30
|
+
const StyledMenuButtonChildren = styled.span(({ theme, padIcon }) => {
|
|
31
|
+
const { base: { 'hit-area': { 'mouse-min': hitAreaMouse, 'finger-min': hitAreaFinger } }, components: { icon: { size: { s: iconSize } } } } = theme;
|
|
31
32
|
return css `
|
|
32
33
|
max-width: 100%;
|
|
33
34
|
|
|
35
|
+
${padIcon &&
|
|
36
|
+
css `
|
|
37
|
+
padding-inline-start: calc((${hitAreaMouse} - ${iconSize}) / 2);
|
|
38
|
+
|
|
39
|
+
@media (pointer: coarse) {
|
|
40
|
+
padding-inline-start: calc(${hitAreaFinger} - ${iconSize} * 2);
|
|
41
|
+
}
|
|
42
|
+
`}
|
|
43
|
+
|
|
34
44
|
${StyledText} {
|
|
35
45
|
text-overflow: ellipsis;
|
|
36
46
|
overflow: hidden;
|
|
@@ -47,7 +57,7 @@ const StyledMenuButtonPopover = styled(Popover) `
|
|
|
47
57
|
`;
|
|
48
58
|
const MenuButton = forwardRef(function MenuButton(props, ref) {
|
|
49
59
|
const uid = useUID();
|
|
50
|
-
const { testId, id = uid, text, menu, popover, onClick, icon, count, iconOnly = false, ...restProps } = props;
|
|
60
|
+
const { testId, id = uid, text, menu, popover, onClick, icon, count, iconOnly = false, showArrow = false, ...restProps } = props;
|
|
51
61
|
const testIds = useTestIds(testId, getMenuButtonTestIds);
|
|
52
62
|
const [isOpen, setIsOpen] = useState(false);
|
|
53
63
|
const buttonRef = useConsolidatedRef(ref);
|
|
@@ -82,14 +92,14 @@ const MenuButton = forwardRef(function MenuButton(props, ref) {
|
|
|
82
92
|
if (!isOpen || mouseClick) {
|
|
83
93
|
onClick?.(e);
|
|
84
94
|
}
|
|
85
|
-
}, icon: iconOnly, children: _jsxs(Flex, { as: StyledMenuButtonChildren, container: { alignItems: 'center', gap: 1 }, children: [icon && _jsx(Icon, { name: icon }), !iconOnly && (_jsxs(_Fragment, { children: [
|
|
95
|
+
}, icon: iconOnly, children: _jsxs(Flex, { as: StyledMenuButtonChildren, container: { alignItems: 'center', gap: 1 }, padIcon: iconOnly && showArrow, children: [icon && _jsx(Icon, { name: icon }), !iconOnly && (_jsxs(_Fragment, { children: [_jsx(Text, { children: text }), typeof count === 'number' && _jsx(Count, { children: count })] })), (!iconOnly || showArrow) && _jsx(Icon, { name: 'arrow-micro-down' })] }) }), _jsx(StyledMenuButtonPopover, { placement: rtl ? 'bottom-end' : 'bottom-start', hideOnTargetHidden: true, ...popover, id: `${id}-popover`, show: !!menu && isOpen, target: buttonRef.current, ref: popoverRef, children: menu && (_jsx(Menu, { testId: testIds.root, ...menu, ref: menuRef, items: menu.items, onItemClick: (itemId, e) => {
|
|
86
96
|
if (menu.mode !== 'multi-select' &&
|
|
87
97
|
e
|
|
88
98
|
.detail > 0) {
|
|
89
99
|
setIsOpen(false);
|
|
90
100
|
}
|
|
91
101
|
menu.onItemClick?.(itemId, e);
|
|
92
|
-
}, focusControlEl: buttonRef.current || undefined })) })] }));
|
|
102
|
+
}, focusControlEl: menu.focusControlEl || buttonRef.current || undefined })) })] }));
|
|
93
103
|
});
|
|
94
104
|
export default withTestIds(MenuButton, getMenuButtonTestIds);
|
|
95
105
|
//# sourceMappingURL=MenuButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuButton.js","sourceRoot":"","sources":["../../../src/components/MenuButton/MenuButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAS1D,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,kBAAkB,EAClB,MAAM,EACN,cAAc,EACd,YAAY,EACZ,UAAU,EACV,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,OAAO,EAAE,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,kBAAkB,MAAM,qCAAqC,CAAC;AAC1E,OAAO,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAE7D,YAAY,CAAC,kBAAkB,CAAC,CAAC;AA8BjC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CACpC,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,OAAO,EAAE,EAClB,EACF,EAAE,EAAE;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I,IAAI,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,GAAI,EAC5B,CAAC,QAAQ,IAAI,CACZ,8BACG,IAAI,IAAI,KAAC,IAAI,cAAE,IAAI,GAAQ,EAC3B,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAC,KAAK,cAAE,KAAK,GAAS,EACnD,IAAI,IAAI,KAAC,IAAI,IAAC,IAAI,EAAC,kBAAkB,GAAG,IACxC,CACJ,IACI,GACA,EACT,KAAC,uBAAuB,IACtB,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,EAC9C,kBAAkB,WACd,OAAO,EACX,EAAE,EAAE,GAAG,EAAE,UAAU,EACnB,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,MAAM,EACtB,MAAM,EAAE,SAAS,CAAC,OAAO,EACzB,GAAG,EAAE,UAAU,YAEd,IAAI,IAAI,CACP,KAAC,IAAI,IACH,MAAM,EAAE,OAAO,CAAC,IAAI,KAChB,IAAI,EACR,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;wBACzB,IACE,IAAI,CAAC,IAAI,KAAK,cAAc;4BAC3B,CAAgF;iCAC9E,MAAM,GAAG,CAAC,EACb;4BACA,SAAS,CAAC,KAAK,CAAC,CAAC;yBAClB;wBACD,IAAI,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;oBAChC,CAAC,EACD,cAAc,EAAE,SAAS,CAAC,OAAO,IAAI,SAAS,GAC9C,CACH,GACuB,IACzB,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,UAAU,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import { forwardRef, useState, useCallback } from 'react';\nimport type {\n FunctionComponent,\n MouseEventHandler,\n MouseEvent,\n UIEvent,\n PropsWithoutRef,\n KeyboardEventHandler\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport type { BaseProps, ForwardProps, NoChildrenProp, OmitStrict, TestIdProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport {\n useConsolidatedRef,\n useUID,\n useFocusWithin,\n useDirection,\n useTestIds,\n useEscape\n} from '../../hooks';\nimport Button, { StyledButton } from '../Button';\nimport type { ButtonProps } from '../Button';\nimport Popover, { StyledPopover } from '../Popover';\nimport type { PopoverProps } from '../Popover';\nimport Menu from '../Menu';\nimport type { AcceptedMouseEventElement, MenuProps } from '../Menu/Menu.types';\nimport Icon, { registerIcon, StyledIcon } from '../Icon';\nimport * as arrowMicroDownIcon from '../Icon/icons/arrow-micro-down.icon';\nimport Text, { StyledText } from '../Text';\nimport Flex from '../Flex';\nimport { Count } from '../Badges';\nimport type { CountProps } from '../Badges/Count';\nimport { withTestIds } from '../../utils';\n\nimport { getMenuButtonTestIds } from './MenuButton.test-ids';\n\nregisterIcon(arrowMicroDownIcon);\n\nexport interface MenuButtonProps extends BaseProps, NoChildrenProp, TestIdProp {\n /** The text for the MenuButton also used to set the aria-label. */\n text: string;\n /**\n * Determines the Button variant for the MenuButton.\n * @default 'secondary'\n */\n variant?: ButtonProps['variant'];\n /** The name of the icon for the MenuButton. */\n icon?: string;\n /** Only display the icon. The text prop will be forwarded to a tooltip. */\n iconOnly?: ButtonProps['icon'];\n /** The total count representing the list data which was selected. */\n count?: CountProps['children'];\n /** The click handler for the MenuButton. */\n onClick?: MouseEventHandler;\n /** Menu related props. */\n menu?: MenuProps;\n /** Popover related props. */\n popover?: OmitStrict<PopoverProps, 'show' | 'target' | 'children'>;\n /** DOM id for the button element. */\n id?: string;\n /** Ref for the button element. */\n ref?: ButtonProps['ref'];\n /** The keydown handler for the MenuButton. */\n onKeyDown?: KeyboardEventHandler;\n}\n\nconst StyledMenuButton = styled.button(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n return css`\n gap: ${spacing};\n flex-shrink: 0;\n white-space: nowrap;\n max-width: 100%;\n\n & + ${StyledPopover} + ${StyledButton} {\n margin-inline-start: ${spacing};\n }\n `;\n }\n);\n\nStyledMenuButton.defaultProps = defaultThemeProp;\n\nconst StyledMenuButtonChildren = styled.span(({ theme }) => {\n return css`\n max-width: 100%;\n\n ${StyledText} {\n text-overflow: ellipsis;\n overflow: hidden;\n }\n\n ${StyledIcon}:last-child:not(:first-child) {\n /* Offsets the flex gap to make the down arrow appear to trail the text. */\n margin-inline-start: -${theme.base.spacing};\n }\n `;\n});\n\nconst StyledMenuButtonPopover = styled(Popover)`\n min-width: 20ch;\n`;\n\nconst MenuButton: FunctionComponent<ForwardProps & MenuButtonProps> = forwardRef(\n function MenuButton(props: PropsWithoutRef<MenuButtonProps>, ref: MenuButtonProps['ref']) {\n const uid = useUID();\n const {\n testId,\n id = uid,\n text,\n menu,\n popover,\n onClick,\n icon,\n count,\n iconOnly = false,\n ...restProps\n } = props;\n const testIds = useTestIds(testId, getMenuButtonTestIds);\n const [isOpen, setIsOpen] = useState(false);\n\n const buttonRef = useConsolidatedRef(ref);\n const popoverRef = useConsolidatedRef<HTMLDivElement>(popover?.ref);\n const menuRef = useConsolidatedRef<HTMLDivElement>(menu?.ref);\n\n // FIXME: Type assertion required for issue in useFocusWithin generic\n useFocusWithin<HTMLElement>(\n [popoverRef, buttonRef],\n useCallback(isFocused => {\n if (!isFocused) setIsOpen(false);\n }, [])\n );\n\n useEscape(e => {\n if (isOpen) {\n setIsOpen(false);\n e.stopPropagation();\n }\n }, buttonRef);\n\n const { rtl } = useDirection();\n\n return (\n <>\n <Button\n data-testid={testIds.root}\n as={StyledMenuButton}\n aria-label={text}\n {...restProps}\n id={id}\n ref={buttonRef}\n aria-expanded={isOpen}\n aria-haspopup='menu'\n aria-controls={`${id}-popover`}\n label={iconOnly && !isOpen ? text : undefined}\n onClick={(e: MouseEvent<HTMLButtonElement> & UIEvent<HTMLButtonElement>) => {\n // e.detail is 0 when triggered by keyboard.\n const mouseClick = e.detail > 0;\n\n // Close the menu if it is open and either:\n // It is a *mouse* click on the button.\n // Or, the menu mode is not multiselect.\n if (isOpen && (mouseClick || menu?.mode !== 'multi-select')) {\n setIsOpen(false);\n } else {\n setIsOpen(true);\n }\n\n // If the menu is closed or the user mouse clicks.\n // This avoids Enter key firing onClick when selecting a menu item.\n if (!isOpen || mouseClick) {\n onClick?.(e);\n }\n }}\n icon={iconOnly}\n >\n <Flex as={StyledMenuButtonChildren} container={{ alignItems: 'center', gap: 1 }}>\n {icon && <Icon name={icon} />}\n {!iconOnly && (\n <>\n {text && <Text>{text}</Text>}\n {typeof count === 'number' && <Count>{count}</Count>}\n {text && <Icon name='arrow-micro-down' />}\n </>\n )}\n </Flex>\n </Button>\n <StyledMenuButtonPopover\n placement={rtl ? 'bottom-end' : 'bottom-start'}\n hideOnTargetHidden\n {...popover}\n id={`${id}-popover`}\n show={!!menu && isOpen}\n target={buttonRef.current}\n ref={popoverRef}\n >\n {menu && (\n <Menu\n testId={testIds.root}\n {...menu}\n ref={menuRef}\n items={menu.items}\n onItemClick={(itemId, e) => {\n if (\n menu.mode !== 'multi-select' &&\n (e as MouseEvent<AcceptedMouseEventElement> & UIEvent<AcceptedMouseEventElement>)\n .detail > 0\n ) {\n setIsOpen(false);\n }\n menu.onItemClick?.(itemId, e);\n }}\n focusControlEl={buttonRef.current || undefined}\n />\n )}\n </StyledMenuButtonPopover>\n </>\n );\n }\n);\n\nexport default withTestIds(MenuButton, getMenuButtonTestIds);\n"]}
|
|
1
|
+
{"version":3,"file":"MenuButton.js","sourceRoot":"","sources":["../../../src/components/MenuButton/MenuButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAS1D,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,kBAAkB,EAClB,MAAM,E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C5B,CAAC,QAAQ,IAAI,CACZ,8BACE,KAAC,IAAI,cAAE,IAAI,GAAQ,EAClB,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAC,KAAK,cAAE,KAAK,GAAS,IACnD,CACJ,EACA,CAAC,CAAC,QAAQ,IAAI,SAAS,CAAC,IAAI,KAAC,IAAI,IAAC,IAAI,EAAC,kBAAkB,GAAG,IACxD,GACA,EAET,KAAC,uBAAuB,IACtB,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,EAC9C,kBAAkB,WACd,OAAO,EACX,EAAE,EAAE,GAAG,EAAE,UAAU,EACnB,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,MAAM,EACtB,MAAM,EAAE,SAAS,CAAC,OAAO,EACzB,GAAG,EAAE,UAAU,YAEd,IAAI,IAAI,CACP,KAAC,IAAI,IACH,MAAM,EAAE,OAAO,CAAC,IAAI,KAChB,IAAI,EACR,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;wBACzB,IACE,IAAI,CAAC,IAAI,KAAK,cAAc;4BAC3B,CAAgF;iCAC9E,MAAM,GAAG,CAAC,EACb;4BACA,SAAS,CAAC,KAAK,CAAC,CAAC;yBAClB;wBACD,IAAI,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;oBAChC,CAAC,EACD,cAAc,EAAE,IAAI,CAAC,cAAc,IAAI,SAAS,CAAC,OAAO,IAAI,SAAS,GACrE,CACH,GACuB,IACzB,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,UAAU,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import { forwardRef, useState, useCallback } from 'react';\nimport type {\n FunctionComponent,\n MouseEventHandler,\n MouseEvent,\n UIEvent,\n PropsWithoutRef,\n KeyboardEventHandler\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport type { BaseProps, ForwardProps, NoChildrenProp, OmitStrict, TestIdProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport {\n useConsolidatedRef,\n useUID,\n useFocusWithin,\n useDirection,\n useTestIds,\n useEscape\n} from '../../hooks';\nimport Button, { StyledButton } from '../Button';\nimport type { ButtonProps } from '../Button';\nimport Popover, { StyledPopover } from '../Popover';\nimport type { PopoverProps } from '../Popover';\nimport Menu from '../Menu';\nimport type { AcceptedMouseEventElement, MenuProps } from '../Menu/Menu.types';\nimport Icon, { registerIcon, StyledIcon } from '../Icon';\nimport * as arrowMicroDownIcon from '../Icon/icons/arrow-micro-down.icon';\nimport Text, { StyledText } from '../Text';\nimport Flex from '../Flex';\nimport { Count } from '../Badges';\nimport type { CountProps } from '../Badges/Count';\nimport { withTestIds } from '../../utils';\n\nimport { getMenuButtonTestIds } from './MenuButton.test-ids';\n\nregisterIcon(arrowMicroDownIcon);\n\nexport interface MenuButtonProps extends BaseProps, NoChildrenProp, TestIdProp {\n /** The text for the MenuButton also used to set the aria-label. */\n text: string;\n /**\n * Determines the Button variant for the MenuButton.\n * @default 'secondary'\n */\n variant?: ButtonProps['variant'];\n /** The name of the icon for the MenuButton. */\n icon?: string;\n /** Only display the icon. The text prop will be forwarded to a tooltip. */\n iconOnly?: ButtonProps['icon'];\n /** The total count representing the list data which was selected. */\n count?: CountProps['children'];\n /** The click handler for the MenuButton. */\n onClick?: MouseEventHandler;\n /** Menu related props. */\n menu?: MenuProps;\n /** Popover related props. */\n popover?: OmitStrict<PopoverProps, 'show' | 'target' | 'children'>;\n /** DOM id for the button element. */\n id?: string;\n /** Ref for the button element. */\n ref?: ButtonProps['ref'];\n /** The keydown handler for the MenuButton. */\n onKeyDown?: KeyboardEventHandler;\n /**\n * Whether to display an arrow when only the icon is displayed.\n * Only applies when `iconOnly` is true.\n * @default false\n */\n showArrow?: boolean;\n}\n\nexport const StyledMenuButton = styled.button(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n return css`\n gap: ${spacing};\n flex-shrink: 0;\n white-space: nowrap;\n max-width: 100%;\n\n & + ${StyledPopover} + ${StyledButton} {\n margin-inline-start: ${spacing};\n }\n `;\n }\n);\n\nStyledMenuButton.defaultProps = defaultThemeProp;\n\nconst StyledMenuButtonChildren = styled.span<{ padIcon?: boolean }>(({ theme, padIcon }) => {\n const {\n base: {\n 'hit-area': { 'mouse-min': hitAreaMouse, 'finger-min': hitAreaFinger }\n },\n components: {\n icon: {\n size: { s: iconSize }\n }\n }\n } = theme;\n\n return css`\n max-width: 100%;\n\n ${padIcon &&\n css`\n padding-inline-start: calc((${hitAreaMouse} - ${iconSize}) / 2);\n\n @media (pointer: coarse) {\n padding-inline-start: calc(${hitAreaFinger} - ${iconSize} * 2);\n }\n `}\n\n ${StyledText} {\n text-overflow: ellipsis;\n overflow: hidden;\n }\n\n ${StyledIcon}:last-child:not(:first-child) {\n /* Offsets the flex gap to make the down arrow appear to trail the text. */\n margin-inline-start: -${theme.base.spacing};\n }\n `;\n});\n\nconst StyledMenuButtonPopover = styled(Popover)`\n min-width: 20ch;\n`;\n\nconst MenuButton: FunctionComponent<ForwardProps & MenuButtonProps> = forwardRef(\n function MenuButton(props: PropsWithoutRef<MenuButtonProps>, ref: MenuButtonProps['ref']) {\n const uid = useUID();\n const {\n testId,\n id = uid,\n text,\n menu,\n popover,\n onClick,\n icon,\n count,\n iconOnly = false,\n showArrow = false,\n ...restProps\n } = props;\n const testIds = useTestIds(testId, getMenuButtonTestIds);\n const [isOpen, setIsOpen] = useState(false);\n\n const buttonRef = useConsolidatedRef(ref);\n const popoverRef = useConsolidatedRef<HTMLDivElement>(popover?.ref);\n const menuRef = useConsolidatedRef<HTMLDivElement>(menu?.ref);\n\n // FIXME: Type assertion required for issue in useFocusWithin generic\n useFocusWithin<HTMLElement>(\n [popoverRef, buttonRef],\n useCallback(isFocused => {\n if (!isFocused) setIsOpen(false);\n }, [])\n );\n\n useEscape(e => {\n if (isOpen) {\n setIsOpen(false);\n e.stopPropagation();\n }\n }, buttonRef);\n\n const { rtl } = useDirection();\n\n return (\n <>\n <Button\n data-testid={testIds.root}\n as={StyledMenuButton}\n aria-label={text}\n {...restProps}\n id={id}\n ref={buttonRef}\n aria-expanded={isOpen}\n aria-haspopup='menu'\n aria-controls={`${id}-popover`}\n label={iconOnly && !isOpen ? text : undefined}\n onClick={(e: MouseEvent<HTMLButtonElement> & UIEvent<HTMLButtonElement>) => {\n // e.detail is 0 when triggered by keyboard.\n const mouseClick = e.detail > 0;\n\n // Close the menu if it is open and either:\n // It is a *mouse* click on the button.\n // Or, the menu mode is not multiselect.\n if (isOpen && (mouseClick || menu?.mode !== 'multi-select')) {\n setIsOpen(false);\n } else {\n setIsOpen(true);\n }\n\n // If the menu is closed or the user mouse clicks.\n // This avoids Enter key firing onClick when selecting a menu item.\n if (!isOpen || mouseClick) {\n onClick?.(e);\n }\n }}\n icon={iconOnly}\n >\n <Flex\n as={StyledMenuButtonChildren}\n container={{ alignItems: 'center', gap: 1 }}\n padIcon={iconOnly && showArrow}\n >\n {icon && <Icon name={icon} />}\n {!iconOnly && (\n <>\n <Text>{text}</Text>\n {typeof count === 'number' && <Count>{count}</Count>}\n </>\n )}\n {(!iconOnly || showArrow) && <Icon name='arrow-micro-down' />}\n </Flex>\n </Button>\n\n <StyledMenuButtonPopover\n placement={rtl ? 'bottom-end' : 'bottom-start'}\n hideOnTargetHidden\n {...popover}\n id={`${id}-popover`}\n show={!!menu && isOpen}\n target={buttonRef.current}\n ref={popoverRef}\n >\n {menu && (\n <Menu\n testId={testIds.root}\n {...menu}\n ref={menuRef}\n items={menu.items}\n onItemClick={(itemId, e) => {\n if (\n menu.mode !== 'multi-select' &&\n (e as MouseEvent<AcceptedMouseEventElement> & UIEvent<AcceptedMouseEventElement>)\n .detail > 0\n ) {\n setIsOpen(false);\n }\n menu.onItemClick?.(itemId, e);\n }}\n focusControlEl={menu.focusControlEl || buttonRef.current || undefined}\n />\n )}\n </StyledMenuButtonPopover>\n </>\n );\n }\n);\n\nexport default withTestIds(MenuButton, getMenuButtonTestIds);\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const getMenuButtonTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly []>;
|
|
1
|
+
export declare const getMenuButtonTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly []>;
|
|
2
2
|
//# sourceMappingURL=MenuButton.test-ids.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuButton.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/MenuButton/MenuButton.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"MenuButton.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/MenuButton/MenuButton.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,wFAA4C,CAAC"}
|
|
@@ -18,7 +18,7 @@ export declare const StyledMetaListItem: import("styled-components").StyledCompo
|
|
|
18
18
|
wrapItems: boolean;
|
|
19
19
|
}, never>;
|
|
20
20
|
declare const _default: FunctionComponent<MetaListProps & ForwardProps> & {
|
|
21
|
-
getTestIds: (testIdProp?: string | undefined) => import("../../types").TestIdsRecord<readonly []>;
|
|
21
|
+
getTestIds: (testIdProp?: string | null | undefined) => import("../../types").TestIdsRecord<readonly []>;
|
|
22
22
|
};
|
|
23
23
|
export default _default;
|
|
24
24
|
//# sourceMappingURL=MetaList.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const getMetaListTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly []>;
|
|
1
|
+
export declare const getMetaListTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly []>;
|
|
2
2
|
//# sourceMappingURL=MetaList.test-ids.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetaList.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/MetaList/MetaList.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"MetaList.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/MetaList/MetaList.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,wFAA0C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EAKlB,MAAM,OAAO,CAAC;AAOf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAoBhD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAWhD,QAAA,MAAM,KAAK,EAAE,iBAAiB,CAAC,UAAU,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EAKlB,MAAM,OAAO,CAAC;AAOf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAoBhD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAWhD,QAAA,MAAM,KAAK,EAAE,iBAAiB,CAAC,UAAU,GAAG,YAAY,CA2StD,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useEffect, useRef, useCallback } from 'react';
|
|
3
|
-
import Progress from '../Progress';
|
|
2
|
+
import { forwardRef, useEffect, useRef, useCallback, useState } from 'react';
|
|
3
|
+
import Progress, {} from '../Progress';
|
|
4
4
|
import { getFocusables } from '../../utils';
|
|
5
5
|
import Backdrop from '../Backdrop';
|
|
6
6
|
import Flex from '../Flex';
|
|
@@ -26,6 +26,7 @@ const Modal = forwardRef(function Modal(props, ref) {
|
|
|
26
26
|
const previousState = usePrevious(state);
|
|
27
27
|
const id = useUID();
|
|
28
28
|
const t = useI18n();
|
|
29
|
+
const [progressMessage, setProgressMessage] = useState(undefined);
|
|
29
30
|
const tryDismiss = () => {
|
|
30
31
|
if (onRequestDismiss?.() !== false) {
|
|
31
32
|
dismiss();
|
|
@@ -97,6 +98,12 @@ const Modal = forwardRef(function Modal(props, ref) {
|
|
|
97
98
|
if (!progress) {
|
|
98
99
|
setFocus();
|
|
99
100
|
}
|
|
101
|
+
if (typeof progress === 'object' && progress.message !== progressMessage) {
|
|
102
|
+
setProgressMessage(progress.message);
|
|
103
|
+
}
|
|
104
|
+
else if (progress === true) {
|
|
105
|
+
setProgressMessage(t('loading'));
|
|
106
|
+
}
|
|
100
107
|
}, [progress]);
|
|
101
108
|
const maximized = stretch || state === 'maximized';
|
|
102
109
|
const modal = (_jsxs(Flex, { ...restProps, container: { direction: 'column' }, ref: modalRef, as: StyledModal, forwardedAs: as, onClick: (e) => e.stopPropagation(), onKeyDown: onModalKeyDown, alert: alert, role: alert ? 'alertdialog' : 'dialog', stretch: maximized, center: center, "aria-labelledby": `${id}-heading`, "aria-describedby": alert ? `${id}-content` : undefined, "aria-modal": state === 'docked' ? 'false' : 'true', state: state, "aria-busy": progress ? 'true' : 'false', children: [_jsxs(Flex, { container: { justify: 'between', alignItems: 'center', gap: 1 }, item: { shrink: 0 }, as: StyledModalHeader, hasAction: minimizable || dismissible, children: [_jsxs(Flex, { container: { alignItems: 'center', gap: 1 }, as: Text, variant: 'h2', id: `${id}-heading`, children: [_jsx("span", { children: heading }), typeof count === 'number' && _jsx(Count, { children: count })] }), _jsxs(Flex, { container: true, children: [maximizable && !alert && state !== 'maximized' && (_jsx(Button, { icon: true, variant: 'simple', label: t('maximize'), "aria-label": t('modal_maximize'), onKeyDown: onHeaderActionKeyDown, onClick: () => {
|
|
@@ -113,7 +120,7 @@ const Modal = forwardRef(function Modal(props, ref) {
|
|
|
113
120
|
}
|
|
114
121
|
}, children: _jsx(Icon, { name: 'minus' }) })), dismissible && !alert && (_jsx(Button, { icon: true, variant: 'simple', label: t('close'), "aria-label": t('modal_close'), onKeyDown: onHeaderActionKeyDown, onClick: tryDismiss, ref: closeButtonRef, children: _jsx(Icon, { name: 'times' }) }))] })] }), _jsxs(Flex, { item: { grow: 1 }, as: StyledModalContent, ref: modalContentRef, style: modalContentRef.current
|
|
115
122
|
? { '--scroll-top': `${modalContentRef.current.scrollTop}px` }
|
|
116
|
-
: undefined, children: [children && (_jsx(StyledModalChildrenWrap, { id: `${id}-content`, inert: progress ? '' : undefined, children: children })), _jsx(Progress, { visible: !!progress, focusOnVisible: true, placement: 'local', message:
|
|
123
|
+
: undefined, children: [children && (_jsx(StyledModalChildrenWrap, { id: `${id}-content`, inert: progress ? '' : undefined, children: children })), _jsx(Progress, { visible: !!progress, focusOnVisible: true, delay: true, placement: 'local', message: progressMessage, onTransitionEndOut: () => setProgressMessage(undefined) })] }), actions && (_jsx(Flex, { container: { justify: 'between' }, item: { shrink: 0 }, as: StyledModalActions, children: actions }))] }));
|
|
117
124
|
const renderModal = state === 'docked' ? (modal) : (_jsx(Backdrop, { ref: backdropRef, container: {
|
|
118
125
|
alignItems: center || maximized ? 'center' : 'start'
|
|
119
126
|
}, transitionSpeed: 'slow', open: state === 'open' || state === 'maximized', onBeforeTransitionIn: onBeforeOpen, onAfterTransitionIn: onAfterOpen, onBeforeTransitionOut: onBeforeClose, onAfterTransitionOut: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AASnE,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,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ef, useEffect, useRef, useCallback } from 'react';\nimport type {\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n MouseEvent,\n KeyboardEvent as ReactKeyboardEvent\n} from 'react';\n\nimport Progress from '../Progress';\nimport { getFocusables } from '../../utils';\nimport Backdrop from '../Backdrop';\nimport Flex from '../Flex';\nimport Button from '../Button';\nimport type { ForwardProps } from '../../types';\nimport {\n useConsolidatedRef,\n useI18n,\n useOuterEvent,\n useUID,\n useFocusTrap,\n usePrevious,\n useModalContext,\n useEvent\n} from '../../hooks';\nimport Icon, { registerIcon } from '../Icon';\nimport * as timesIcon from '../Icon/icons/times.icon';\nimport * as minusIcon from '../Icon/icons/minus.icon';\nimport * as dockIcon from '../Icon/icons/dock.icon';\nimport * as undockIcon from '../Icon/icons/undock.icon';\nimport Text from '../Text';\nimport { Count } from '../Badges';\n\nimport MinimizedModal from './MinimizedModal';\nimport type { ModalProps } from './Modal.types';\nimport {\n StyledModal,\n StyledModalHeader,\n StyledModalContent,\n StyledModalActions,\n StyledModalChildrenWrap\n} from './Modal.styles';\n\nregisterIcon(timesIcon, minusIcon, dockIcon, undockIcon);\n\nconst Modal: FunctionComponent<ModalProps & ForwardProps> = forwardRef(function Modal(\n props: PropsWithoutRef<ModalProps>,\n ref: Ref<HTMLElement>\n) {\n const {\n as,\n progress = false,\n heading,\n count,\n children,\n actions,\n stretch = false,\n center = false,\n defaultFocus,\n onBeforeOpen,\n onAfterOpen,\n onBeforeClose,\n onAfterClose,\n onRequestDismiss,\n onRequestMinimize,\n onRequestMaximize,\n onRequestDock,\n onRequestActivate,\n ...restProps\n } = props;\n\n const {\n alert,\n dismissible,\n minimizable,\n maximizable,\n dockable,\n state,\n dismiss,\n minimize,\n maximize,\n dock,\n unmount,\n top\n } = useModalContext();\n\n const modalRef = useConsolidatedRef(ref);\n const modalContentRef = useRef<HTMLDivElement>(null);\n const backdropRef = useRef<HTMLDivElement>(null);\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n const previousState = usePrevious(state);\n const id = useUID();\n const t = useI18n();\n\n const tryDismiss = () => {\n if (onRequestDismiss?.() !== false) {\n dismiss();\n }\n };\n\n const setFocus = () => {\n if (progress) return;\n\n const focusables = getFocusables(modalRef);\n\n if (defaultFocus?.current) {\n defaultFocus.current.focus();\n } else {\n const focusable =\n focusables.find(el => {\n return modalContentRef.current?.contains(el);\n }) ??\n closeButtonRef.current ??\n focusables[0];\n\n focusable?.focus();\n }\n };\n\n useFocusTrap(modalRef, false);\n useEvent('shortcut', e => e.stopPropagation(), { eventOptions: { capture: true } });\n\n useOuterEvent('mousedown', [modalRef], e => {\n if (['minimized', 'docked', 'closed'].includes(state)) return;\n\n if (dismissible) {\n if (e.target === backdropRef.current) {\n tryDismiss();\n }\n } else {\n modalRef.current?.focus();\n }\n });\n\n useEffect(() => {\n if (state === 'minimized') return;\n if (state === 'open' || state === 'maximized' || state === 'docked') setFocus();\n\n // This won't actually run until potential changes to docked modal handling.\n if (state === 'closed' && previousState === 'docked') {\n onBeforeClose?.();\n unmount();\n onAfterClose?.();\n }\n }, [state]);\n\n useEffect(() => {\n // If a modal is already in a closed state on initial mount, unmount it.\n // This only happens when a docked modal closes since the ModalManager\n // remounts it outside of the DockedModals container if state !== 'docked'.\n if (state === 'closed') {\n onBeforeClose?.();\n unmount();\n onAfterClose?.();\n }\n }, []);\n\n // Dismiss on Escape needs to be handled using React event handling to be cancelable using SyntheticEvent.stopPropagation.\n const onModalKeyDown = useCallback(\n (e: ReactKeyboardEvent) => {\n if (dismissible && (state === 'open' || state === 'maximized') && e.key === 'Escape' && top) {\n tryDismiss();\n }\n },\n [dismissible, state, top, tryDismiss]\n );\n\n const onHeaderActionKeyDown = useCallback((e: ReactKeyboardEvent<HTMLButtonElement>) => {\n if (e.repeat && (e.key === 'Enter' || e.key === ' ')) e.preventDefault();\n }, []);\n\n useEffect(() => {\n if (!progress) {\n setFocus();\n }\n }, [progress]);\n\n const maximized = stretch || state === 'maximized';\n\n const modal = (\n <Flex\n {...restProps}\n container={{ direction: 'column' }}\n ref={modalRef}\n as={StyledModal}\n forwardedAs={as}\n onClick={(e: MouseEvent) => e.stopPropagation()}\n onKeyDown={onModalKeyDown}\n alert={alert}\n role={alert ? 'alertdialog' : 'dialog'}\n stretch={maximized}\n center={center}\n aria-labelledby={`${id}-heading`}\n aria-describedby={alert ? `${id}-content` : undefined}\n aria-modal={state === 'docked' ? 'false' : 'true'}\n state={state}\n aria-busy={progress ? 'true' : 'false'}\n >\n <Flex\n container={{ justify: 'between', alignItems: 'center', gap: 1 }}\n item={{ shrink: 0 }}\n as={StyledModalHeader}\n hasAction={minimizable || dismissible}\n >\n <Flex\n container={{ alignItems: 'center', gap: 1 }}\n as={Text}\n variant='h2'\n id={`${id}-heading`}\n >\n <span>{heading}</span>\n {typeof count === 'number' && <Count>{count}</Count>}\n </Flex>\n\n <Flex container>\n {maximizable && !alert && state !== 'maximized' && (\n <Button\n icon\n variant='simple'\n label={t('maximize')}\n aria-label={t('modal_maximize')}\n onKeyDown={onHeaderActionKeyDown}\n onClick={() => {\n if (onRequestMaximize?.() !== false) {\n maximize();\n }\n }}\n >\n <Icon name='undock' />\n </Button>\n )}\n {dockable && !alert && state !== 'docked' && (\n <Button\n icon\n variant='simple'\n label={t('dock')}\n aria-label={t('modal_dock')}\n onKeyDown={onHeaderActionKeyDown}\n onClick={() => {\n if (onRequestDock?.() !== false) {\n dock();\n }\n }}\n >\n <Icon name='dock' />\n </Button>\n )}\n {minimizable && !alert && (\n <Button\n icon\n variant='simple'\n label={t('minimize')}\n aria-label={t('modal_minimize')}\n onKeyDown={onHeaderActionKeyDown}\n onClick={() => {\n if (onRequestMinimize?.() !== false) {\n minimize();\n }\n }}\n >\n <Icon name='minus' />\n </Button>\n )}\n {dismissible && !alert && (\n <Button\n icon\n variant='simple'\n label={t('close')}\n aria-label={t('modal_close')}\n onKeyDown={onHeaderActionKeyDown}\n onClick={tryDismiss}\n ref={closeButtonRef}\n >\n <Icon name='times' />\n </Button>\n )}\n </Flex>\n </Flex>\n\n <Flex\n item={{ grow: 1 }}\n as={StyledModalContent}\n ref={modalContentRef}\n style={\n modalContentRef.current\n ? { '--scroll-top': `${modalContentRef.current.scrollTop}px` }\n : undefined\n }\n >\n {children && (\n <StyledModalChildrenWrap id={`${id}-content`} inert={progress ? '' : undefined}>\n {children}\n </StyledModalChildrenWrap>\n )}\n\n <Progress\n visible={!!progress}\n focusOnVisible\n placement='local'\n message={typeof progress === 'object' ? progress.message : t('loading')}\n />\n </Flex>\n\n {actions && (\n <Flex container={{ justify: 'between' }} item={{ shrink: 0 }} as={StyledModalActions}>\n {actions}\n </Flex>\n )}\n </Flex>\n );\n\n const renderModal =\n state === 'docked' ? (\n modal\n ) : (\n <Backdrop\n ref={backdropRef}\n container={{\n alignItems: center || maximized ? 'center' : 'start'\n }}\n transitionSpeed='slow'\n open={state === 'open' || state === 'maximized'}\n onBeforeTransitionIn={onBeforeOpen}\n onAfterTransitionIn={onAfterOpen}\n onBeforeTransitionOut={onBeforeClose}\n onAfterTransitionOut={() => {\n unmount();\n onAfterClose?.();\n }}\n >\n {modal}\n </Backdrop>\n );\n\n return state === 'minimized' ? <MinimizedModal {...props} {...restProps} /> : renderModal;\n});\n\nexport default Modal;\n"]}
|
|
1
|
+
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAS7E,OAAO,QAAQ,EAAE,EAAsB,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,OAAO,EACL,kBAAkB,EAClB,OAAO,EACP,aAAa,EACb,MAAM,EACN,YAAY,EAC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AAC;AAC5F,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC","sourcesContent":["import { forwardRef, useEffect, useRef, useCallback, useState } from 'react';\nimport type {\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n MouseEvent,\n KeyboardEvent as ReactKeyboardEvent\n} from 'react';\n\nimport Progress, { type ProgressProps } from '../Progress';\nimport { getFocusables } from '../../utils';\nimport Backdrop from '../Backdrop';\nimport Flex from '../Flex';\nimport Button from '../Button';\nimport type { ForwardProps } from '../../types';\nimport {\n useConsolidatedRef,\n useI18n,\n useOuterEvent,\n useUID,\n useFocusTrap,\n usePrevious,\n useModalContext,\n useEvent\n} from '../../hooks';\nimport Icon, { registerIcon } from '../Icon';\nimport * as timesIcon from '../Icon/icons/times.icon';\nimport * as minusIcon from '../Icon/icons/minus.icon';\nimport * as dockIcon from '../Icon/icons/dock.icon';\nimport * as undockIcon from '../Icon/icons/undock.icon';\nimport Text from '../Text';\nimport { Count } from '../Badges';\n\nimport MinimizedModal from './MinimizedModal';\nimport type { ModalProps } from './Modal.types';\nimport {\n StyledModal,\n StyledModalHeader,\n StyledModalContent,\n StyledModalActions,\n StyledModalChildrenWrap\n} from './Modal.styles';\n\nregisterIcon(timesIcon, minusIcon, dockIcon, undockIcon);\n\nconst Modal: FunctionComponent<ModalProps & ForwardProps> = forwardRef(function Modal(\n props: PropsWithoutRef<ModalProps>,\n ref: Ref<HTMLElement>\n) {\n const {\n as,\n progress = false,\n heading,\n count,\n children,\n actions,\n stretch = false,\n center = false,\n defaultFocus,\n onBeforeOpen,\n onAfterOpen,\n onBeforeClose,\n onAfterClose,\n onRequestDismiss,\n onRequestMinimize,\n onRequestMaximize,\n onRequestDock,\n onRequestActivate,\n ...restProps\n } = props;\n\n const {\n alert,\n dismissible,\n minimizable,\n maximizable,\n dockable,\n state,\n dismiss,\n minimize,\n maximize,\n dock,\n unmount,\n top\n } = useModalContext();\n\n const modalRef = useConsolidatedRef(ref);\n const modalContentRef = useRef<HTMLDivElement>(null);\n const backdropRef = useRef<HTMLDivElement>(null);\n const closeButtonRef = useRef<HTMLButtonElement>(null);\n const previousState = usePrevious(state);\n const id = useUID();\n const t = useI18n();\n const [progressMessage, setProgressMessage] = useState<ProgressProps['message']>(undefined);\n\n const tryDismiss = () => {\n if (onRequestDismiss?.() !== false) {\n dismiss();\n }\n };\n\n const setFocus = () => {\n if (progress) return;\n\n const focusables = getFocusables(modalRef);\n\n if (defaultFocus?.current) {\n defaultFocus.current.focus();\n } else {\n const focusable =\n focusables.find(el => {\n return modalContentRef.current?.contains(el);\n }) ??\n closeButtonRef.current ??\n focusables[0];\n\n focusable?.focus();\n }\n };\n\n useFocusTrap(modalRef, false);\n useEvent('shortcut', e => e.stopPropagation(), { eventOptions: { capture: true } });\n\n useOuterEvent('mousedown', [modalRef], e => {\n if (['minimized', 'docked', 'closed'].includes(state)) return;\n\n if (dismissible) {\n if (e.target === backdropRef.current) {\n tryDismiss();\n }\n } else {\n modalRef.current?.focus();\n }\n });\n\n useEffect(() => {\n if (state === 'minimized') return;\n if (state === 'open' || state === 'maximized' || state === 'docked') setFocus();\n\n // This won't actually run until potential changes to docked modal handling.\n if (state === 'closed' && previousState === 'docked') {\n onBeforeClose?.();\n unmount();\n onAfterClose?.();\n }\n }, [state]);\n\n useEffect(() => {\n // If a modal is already in a closed state on initial mount, unmount it.\n // This only happens when a docked modal closes since the ModalManager\n // remounts it outside of the DockedModals container if state !== 'docked'.\n if (state === 'closed') {\n onBeforeClose?.();\n unmount();\n onAfterClose?.();\n }\n }, []);\n\n // Dismiss on Escape needs to be handled using React event handling to be cancelable using SyntheticEvent.stopPropagation.\n const onModalKeyDown = useCallback(\n (e: ReactKeyboardEvent) => {\n if (dismissible && (state === 'open' || state === 'maximized') && e.key === 'Escape' && top) {\n tryDismiss();\n }\n },\n [dismissible, state, top, tryDismiss]\n );\n\n const onHeaderActionKeyDown = useCallback((e: ReactKeyboardEvent<HTMLButtonElement>) => {\n if (e.repeat && (e.key === 'Enter' || e.key === ' ')) e.preventDefault();\n }, []);\n\n useEffect(() => {\n if (!progress) {\n setFocus();\n }\n\n if (typeof progress === 'object' && progress.message !== progressMessage) {\n setProgressMessage(progress.message);\n } else if (progress === true) {\n setProgressMessage(t('loading'));\n }\n }, [progress]);\n\n const maximized = stretch || state === 'maximized';\n\n const modal = (\n <Flex\n {...restProps}\n container={{ direction: 'column' }}\n ref={modalRef}\n as={StyledModal}\n forwardedAs={as}\n onClick={(e: MouseEvent) => e.stopPropagation()}\n onKeyDown={onModalKeyDown}\n alert={alert}\n role={alert ? 'alertdialog' : 'dialog'}\n stretch={maximized}\n center={center}\n aria-labelledby={`${id}-heading`}\n aria-describedby={alert ? `${id}-content` : undefined}\n aria-modal={state === 'docked' ? 'false' : 'true'}\n state={state}\n aria-busy={progress ? 'true' : 'false'}\n >\n <Flex\n container={{ justify: 'between', alignItems: 'center', gap: 1 }}\n item={{ shrink: 0 }}\n as={StyledModalHeader}\n hasAction={minimizable || dismissible}\n >\n <Flex\n container={{ alignItems: 'center', gap: 1 }}\n as={Text}\n variant='h2'\n id={`${id}-heading`}\n >\n <span>{heading}</span>\n {typeof count === 'number' && <Count>{count}</Count>}\n </Flex>\n\n <Flex container>\n {maximizable && !alert && state !== 'maximized' && (\n <Button\n icon\n variant='simple'\n label={t('maximize')}\n aria-label={t('modal_maximize')}\n onKeyDown={onHeaderActionKeyDown}\n onClick={() => {\n if (onRequestMaximize?.() !== false) {\n maximize();\n }\n }}\n >\n <Icon name='undock' />\n </Button>\n )}\n {dockable && !alert && state !== 'docked' && (\n <Button\n icon\n variant='simple'\n label={t('dock')}\n aria-label={t('modal_dock')}\n onKeyDown={onHeaderActionKeyDown}\n onClick={() => {\n if (onRequestDock?.() !== false) {\n dock();\n }\n }}\n >\n <Icon name='dock' />\n </Button>\n )}\n {minimizable && !alert && (\n <Button\n icon\n variant='simple'\n label={t('minimize')}\n aria-label={t('modal_minimize')}\n onKeyDown={onHeaderActionKeyDown}\n onClick={() => {\n if (onRequestMinimize?.() !== false) {\n minimize();\n }\n }}\n >\n <Icon name='minus' />\n </Button>\n )}\n {dismissible && !alert && (\n <Button\n icon\n variant='simple'\n label={t('close')}\n aria-label={t('modal_close')}\n onKeyDown={onHeaderActionKeyDown}\n onClick={tryDismiss}\n ref={closeButtonRef}\n >\n <Icon name='times' />\n </Button>\n )}\n </Flex>\n </Flex>\n\n <Flex\n item={{ grow: 1 }}\n as={StyledModalContent}\n ref={modalContentRef}\n style={\n modalContentRef.current\n ? { '--scroll-top': `${modalContentRef.current.scrollTop}px` }\n : undefined\n }\n >\n {children && (\n <StyledModalChildrenWrap id={`${id}-content`} inert={progress ? '' : undefined}>\n {children}\n </StyledModalChildrenWrap>\n )}\n\n <Progress\n visible={!!progress}\n focusOnVisible\n delay\n placement='local'\n message={progressMessage}\n onTransitionEndOut={() => setProgressMessage(undefined)}\n />\n </Flex>\n\n {actions && (\n <Flex container={{ justify: 'between' }} item={{ shrink: 0 }} as={StyledModalActions}>\n {actions}\n </Flex>\n )}\n </Flex>\n );\n\n const renderModal =\n state === 'docked' ? (\n modal\n ) : (\n <Backdrop\n ref={backdropRef}\n container={{\n alignItems: center || maximized ? 'center' : 'start'\n }}\n transitionSpeed='slow'\n open={state === 'open' || state === 'maximized'}\n onBeforeTransitionIn={onBeforeOpen}\n onAfterTransitionIn={onAfterOpen}\n onBeforeTransitionOut={onBeforeClose}\n onAfterTransitionOut={() => {\n unmount();\n onAfterClose?.();\n }}\n >\n {modal}\n </Backdrop>\n );\n\n return state === 'minimized' ? <MinimizedModal {...props} {...restProps} /> : renderModal;\n});\n\nexport default Modal;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Modal.styles.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAInE,eAAO,MAAM,uBAAuB,yGAAe,CAAC;AAEpD,eAAO,MAAM,iBAAiB;;SAyB7B,CAAC;AAIF,eAAO,MAAM,kBAAkB,yGAc7B,CAAC;AAIH,eAAO,MAAM,kBAAkB,4GAI7B,CAAC;AAIH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"Modal.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Modal.styles.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAInE,eAAO,MAAM,uBAAuB,yGAAe,CAAC;AAEpD,eAAO,MAAM,iBAAiB;;SAyB7B,CAAC;AAIF,eAAO,MAAM,kBAAkB,yGAc7B,CAAC;AAIH,eAAO,MAAM,kBAAkB,4GAI7B,CAAC;AAIH,eAAO,MAAM,WAAW,8iBAyGtB,CAAC"}
|
|
@@ -67,17 +67,38 @@ export const StyledModal = styled(StyledCard)(({ theme: { base }, alert, autoWid
|
|
|
67
67
|
|
|
68
68
|
${!alert && stretch
|
|
69
69
|
? css `
|
|
70
|
-
width: calc(100% - 1rem);
|
|
71
70
|
height: calc(100% - 1rem);
|
|
72
71
|
|
|
72
|
+
${autoWidth
|
|
73
|
+
? css `
|
|
74
|
+
max-width: min(calc(100% - 1rem), ${defaultMaxWidth});
|
|
75
|
+
`
|
|
76
|
+
: css `
|
|
77
|
+
width: calc(100% - 1rem);
|
|
78
|
+
`}
|
|
79
|
+
|
|
73
80
|
@media screen and (min-width: ${base.breakpoints.sm}) {
|
|
74
|
-
width: calc(100% - 2rem);
|
|
75
81
|
height: calc(100% - 2rem);
|
|
82
|
+
|
|
83
|
+
${autoWidth
|
|
84
|
+
? css `
|
|
85
|
+
max-width: min(calc(100% - 2rem), ${defaultMaxWidth});
|
|
86
|
+
`
|
|
87
|
+
: css `
|
|
88
|
+
width: calc(100% - 2rem);
|
|
89
|
+
`}
|
|
76
90
|
}
|
|
77
91
|
|
|
78
92
|
@media screen and (min-width: ${base.breakpoints.md}) {
|
|
79
|
-
width: calc(100% - 4rem);
|
|
80
93
|
height: calc(100% - 4rem);
|
|
94
|
+
|
|
95
|
+
${autoWidth
|
|
96
|
+
? css `
|
|
97
|
+
max-width: min(calc(100% - 4rem), ${defaultMaxWidth});
|
|
98
|
+
`
|
|
99
|
+
: css `
|
|
100
|
+
width: calc(100% - 4rem);
|
|
101
|
+
`}
|
|
81
102
|
}
|
|
82
103
|
`
|
|
83
104
|
: css `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.styles.js","sourceRoot":"","sources":["../../../src/components/Modal/Modal.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAM7C,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAEpD,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAC5C,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACjC,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAEvC,OAAO,GAAG,CAAA;sBACQ,CAAC,GAAG,SAAS,MAAM,IAAI,CAAC,OAAO,UAAU,CAAC,GAAG,SAAS,MAAM,IAAI,CAAC,OAAO;eAC/E,GAAG,GAAG,SAAS,MAAM,IAAI,CAAC,OAAO,cAAc,IAAI,CAAC,OAAO;aAC7D,UAAU;6BACM,IAAI,CAAC,OAAO;;;;;;;;;;;;QA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AAC,EAAE;;;cAG/C,SAAS;YACT,CAAC,CAAC,GAAG,CAAA;sDACmC,eAAe;iBACpD;YACH,CAAC,CAAC,GAAG,CAAA;;iBAEF;;;0CAGyB,IAAI,CAAC,WAAW,CAAC,EAAE;;;cAG/C,SAAS;YACT,CAAC,CAAC,GAAG,CAAA;sDACmC,eAAe;iBACpD;YACH,CAAC,CAAC,GAAG,CAAA;;iBAEF;;SAER;QACH,CAAC,CAAC,GAAG,CAAA;8CACmC,eAAe;8CACf,eAAe;;YAEjD,CAAC,MAAM;YACT,GAAG,CAAA;;WAEF;;0CAE+B,IAAI,CAAC,WAAW,CAAC,EAAE;gDACb,eAAe;gDACf,eAAe;;cAEjD,CAAC,MAAM;YACT,GAAG,CAAA;;aAEF;;;0CAG6B,IAAI,CAAC,WAAW,CAAC,EAAE;gDACb,eAAe;gDACf,eAAe;;cAEjD,CAAC,MAAM;YACT,GAAG,CAAA;;aAEF;;SAEJ;;MAEH,KAAK,KAAK,QAAQ;QACpB,GAAG,CAAA;;;;;;;;;;;KAWF;;;QAGG,kBAAkB;;;;;;GAMvB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,WAAW,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { StyledButton } from '../Button';\nimport type { PropsWithDefaults } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport { StyledIcon } from '../Icon';\nimport { StyledCard } from '../Card';\nimport { StyledBackdrop } from '../Backdrop';\n\nimport type { ModalContextValue, ModalProps } from './Modal.types';\n\ntype ModalPropsWithDefaults = PropsWithDefaults<ModalProps, 'stretch' | 'center' | 'autoWidth'>;\n\nexport const StyledModalChildrenWrap = styled.div``;\n\nexport const StyledModalHeader = styled.header<{ hasAction?: boolean }>(\n ({ theme: { base }, hasAction }) => {\n const padAdjust = hasAction ? 0.75 : 0;\n\n return css`\n padding: calc(${3 - padAdjust} * ${base.spacing}) calc(${3 - padAdjust} * ${base.spacing})\n calc(${2.5 - padAdjust} * ${base.spacing}) calc(3 * ${base.spacing});\n h2 > ${StyledIcon} {\n margin-inline-end: ${base.spacing};\n }\n\n > h2 {\n overflow-x: hidden;\n > :first-child {\n overflow-x: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n }\n\n ${StyledButton} {\n color: ${base.palette['foreground-color']};\n }\n `;\n }\n);\n\nStyledModalHeader.defaultProps = defaultThemeProp;\n\nexport const StyledModalContent = styled.div(({ theme: { base } }) => {\n return css`\n position: relative;\n padding: calc(0.5 * ${base.spacing}) calc(3 * ${base.spacing});\n overflow-y: auto;\n\n &:last-child {\n padding-bottom: calc(3 * ${base.spacing});\n }\n\n & > ${StyledBackdrop} {\n top: var(--scroll-top, 0);\n }\n `;\n});\n\nStyledModalContent.defaultProps = defaultThemeProp;\n\nexport const StyledModalActions = styled.footer(({ theme: { base } }) => {\n return css`\n padding: calc(2.5 * ${base.spacing}) calc(3 * ${base.spacing}) calc(3 * ${base.spacing});\n `;\n});\n\nStyledModalActions.defaultProps = defaultThemeProp;\n\nexport const StyledModal = styled(StyledCard)<\n ModalPropsWithDefaults & Pick<ModalContextValue, 'alert' | 'state'>\n>(({ theme: { base }, alert, autoWidth, center, stretch, state }) => {\n let defaultMinWidth = '80ch';\n let defaultMaxWidth = '80ch';\n\n if (alert) {\n defaultMinWidth = '60ch';\n defaultMaxWidth = '60ch';\n } else if (autoWidth) {\n defaultMaxWidth = '100%';\n }\n\n return css`\n position: relative;\n box-shadow: ${base.shadow.high};\n\n ${!alert && stretch\n ? css`\n height: calc(100% - 1rem);\n\n ${autoWidth\n ? css`\n max-width: min(calc(100% - 1rem), ${defaultMaxWidth});\n `\n : css`\n width: calc(100% - 1rem);\n `}\n\n @media screen and (min-width: ${base.breakpoints.sm}) {\n height: calc(100% - 2rem);\n\n ${autoWidth\n ? css`\n max-width: min(calc(100% - 2rem), ${defaultMaxWidth});\n `\n : css`\n width: calc(100% - 2rem);\n `}\n }\n\n @media screen and (min-width: ${base.breakpoints.md}) {\n height: calc(100% - 4rem);\n\n ${autoWidth\n ? css`\n max-width: min(calc(100% - 4rem), ${defaultMaxWidth});\n `\n : css`\n width: calc(100% - 4rem);\n `}\n }\n `\n : css`\n min-width: min(calc(100% - 1rem), ${defaultMinWidth});\n max-width: min(calc(100% - 1rem), ${defaultMaxWidth});\n max-height: calc(100% - 1rem);\n ${!center &&\n css`\n margin-block-start: 0.5rem;\n `}\n\n @media screen and (min-width: ${base.breakpoints.sm}) {\n min-width: min(calc(100% - 2rem), ${defaultMinWidth});\n max-width: min(calc(100% - 2rem), ${defaultMaxWidth});\n max-height: calc(100% - 2rem);\n ${!center &&\n css`\n margin-block-start: 1rem;\n `}\n }\n\n @media screen and (min-width: ${base.breakpoints.md}) {\n min-width: min(calc(100% - 4rem), ${defaultMinWidth});\n max-width: min(calc(100% - 4rem), ${defaultMaxWidth});\n max-height: calc(100% - 4rem);\n ${!center &&\n css`\n margin-block-start: 2rem;\n `}\n }\n `}\n\n ${state === 'docked' &&\n css`\n /*\n * This seems like the most optimal of the suboptimal solutions.\n * https://styled-components.com/docs/faqs#how-can-i-override-styles-with-higher-specificity\n */\n &&& {\n /* Using non logical properties due to Safari 14.x support and since the inline bottom values are the same. */\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n pointer-events: auto;\n }\n `}\n\n &[aria-busy='true'] {\n ${StyledModalContent} {\n /* TODO: Replace with useScrollToggle hook. */\n overflow: hidden;\n min-height: 8rem;\n }\n }\n `;\n});\n\nStyledModal.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalManager.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/ModalManager.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAA2B,OAAO,EAAE,MAAM,OAAO,CAAC;AAMjF,OAAO,YAAY,CAAC;AAGpB,OAAO,KAAK,EAIV,iBAAiB,EAEjB,wBAAwB,EACzB,MAAM,eAAe,CAAC;AAGvB,OAAO,QAAQ,YAAY,CAAC;IAC1B,UAAiB,aAAa;QAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,CAAC;KACzD;CACF;AAgKD,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ModalManager.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/ModalManager.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAA2B,OAAO,EAAE,MAAM,OAAO,CAAC;AAMjF,OAAO,YAAY,CAAC;AAGpB,OAAO,KAAK,EAIV,iBAAiB,EAEjB,wBAAwB,EACzB,MAAM,eAAe,CAAC;AAGvB,OAAO,QAAQ,YAAY,CAAC;IAC1B,UAAiB,aAAa;QAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,CAAC;KACzD;CACF;AAgKD,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CA0HtD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -98,8 +98,12 @@ const ModalManager = ({ children }) => {
|
|
|
98
98
|
dispatch({ action: 'dismiss', modal: { id } });
|
|
99
99
|
options?.onDismiss?.(id);
|
|
100
100
|
const initiator = initiatorRef?.deref();
|
|
101
|
+
const currentActiveElement = getActiveElement();
|
|
101
102
|
if (initiator?.isConnected &&
|
|
102
|
-
(initiator instanceof HTMLElement || initiator instanceof SVGElement)
|
|
103
|
+
(initiator instanceof HTMLElement || initiator instanceof SVGElement) &&
|
|
104
|
+
currentActiveElement !== null &&
|
|
105
|
+
(currentActiveElement.closest('[aria-modal="true"]') !== null ||
|
|
106
|
+
currentActiveElement === document.body)) {
|
|
103
107
|
initiator.focus();
|
|
104
108
|
}
|
|
105
109
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalManager.js","sourceRoot":"","sources":["../../../src/components/Modal/ModalManager.tsx"],"names":[],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AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { useReducer, useMemo, useEffect, useContext, memo } from 'react';\nimport type { FunctionComponent, ComponentType, Dispatch, Context } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { createUID, getActiveElement, windowIsAvailable } from '../../utils';\nimport { useConfiguration, useScrollToggle } from '../../hooks';\nimport type { ExcludeStrict, OmitStrict } from '../../types';\nimport '../../init';\n\nimport DockedModals from './DockedModals';\nimport type {\n ModalMethods,\n ModalOptions,\n ModalObject,\n ModalManagerProps,\n ModalState,\n ModalManagerContextValue\n} from './Modal.types';\nimport { ModalContext, ModalManagerContext } from './Contexts';\n\ndeclare module '../../init' {\n export interface CosmosGlobals {\n modalManagerContext?: Context<ModalManagerContextValue>;\n }\n}\n\ntype ModalAction =\n | 'create'\n | 'update'\n | 'minimize'\n | 'maximize'\n | 'dock'\n | 'activate'\n | 'dismiss'\n | 'unmount';\n\ntype ModalReducerPayload<P extends object> =\n | { action: 'create'; modal: ModalObject<P> }\n | {\n action: 'update';\n modal: Partial<OmitStrict<ModalObject<P>, 'props'>> &\n Pick<ModalObject, 'id'> & { props: Partial<ModalObject<P>['props']> };\n }\n | {\n action: ExcludeStrict<ModalAction, 'create' | 'update'>;\n modal: Pick<ModalObject, 'id'>;\n };\n\nconst reducer = <P extends object>(\n modals: ModalObject[],\n payload: ModalReducerPayload<P>\n): ModalObject<any>[] => {\n switch (payload.action) {\n case 'create':\n return [...modals, payload.modal];\n\n case 'unmount':\n return modals.filter(modal => modal.id !== payload.modal.id);\n\n case 'dismiss':\n return modals.map(modal => {\n modal.state = modal.id === payload.modal.id ? 'closed' : modal.state;\n return modal;\n });\n\n case 'update':\n return modals.map(modal => {\n modal.props =\n modal.id === payload.modal.id ? { ...modal.props, ...payload.modal.props } : modal.props;\n return modal;\n });\n\n case 'activate': {\n const newModals = modals.map(modal => {\n modal.state = modal.id === payload.modal.id ? 'open' : modal.state;\n return modal;\n });\n\n // Move the newly activated modal to the end of the list\n // to ensure it is shown on top of other active modals.\n const activatedModal = newModals.splice(\n newModals.findIndex(modal => modal.id === payload.modal.id),\n 1\n );\n\n return [...newModals, ...activatedModal];\n }\n\n case 'minimize':\n return modals.map(modal => {\n modal.state =\n modal.id === payload.modal.id && modal.options.minimizable ? 'minimized' : modal.state;\n return modal;\n });\n\n case 'maximize':\n return modals.map(modal => {\n modal.state =\n modal.id === payload.modal.id && modal.options.maximizable ? 'maximized' : modal.state;\n return modal;\n });\n\n case 'dock':\n return modals.map(modal => {\n modal.state =\n modal.id === payload.modal.id && modal.options.dockable ? 'docked' : 'minimized';\n return modal;\n });\n\n default:\n return modals;\n }\n};\n\nconst WrappedModal = memo(\n ({\n Component,\n id,\n options: { alert, dismissible, dockable, minimizable, maximizable },\n state,\n methods,\n props,\n top\n }: ModalObject & { top: boolean }) => (\n <ModalContext.Provider\n // eslint-disable-next-line react/jsx-no-constructed-context-values\n value={{\n id,\n alert,\n dismissible,\n minimizable,\n maximizable,\n dockable,\n state,\n top,\n initialized: true,\n ...methods\n }}\n >\n <Component {...props} />\n </ModalContext.Provider>\n )\n);\n\nconst RenderModals = ({ modals }: { modals: ModalObject[] }) => {\n const { open, minimized, alerts } = modals.reduce<{\n open: ModalObject[];\n minimized: ModalObject[];\n alerts: ModalObject[];\n }>(\n (obj, modal) => {\n if (modal.options.alert) obj.alerts.push(modal);\n else if (modal.state === 'minimized' || modal.state === 'docked') {\n obj.minimized.push(modal);\n } else obj.open.push(modal);\n\n return obj;\n },\n { open: [], minimized: [], alerts: [] }\n );\n\n return (\n <>\n {open.map((modal, i) => (\n <WrappedModal\n {...modal}\n top={alerts.length === 0 && i === open.length - 1}\n key={modal.id}\n />\n ))}\n {minimized.length > 0 && (\n <DockedModals>\n {minimized.map(modal => (\n <WrappedModal {...modal} top={false} key={modal.id} />\n ))}\n </DockedModals>\n )}\n {alerts.map((modal, i) => (\n <WrappedModal {...modal} top={i === open.length - 1} key={modal.id} />\n ))}\n </>\n );\n};\n\nconst ModalManager: FunctionComponent<ModalManagerProps> = ({ children }) => {\n const [modals, dispatch] = useReducer(reducer, []);\n const { disableScroll, enableScroll } = useScrollToggle();\n\n const providerValue = useMemo(\n () => ({\n create: <P extends object>(\n Component: ComponentType<P>,\n props?: P,\n options?: ModalOptions\n ) => {\n const id = options?.id || createUID();\n const activeElement = getActiveElement();\n const initiatorRef = activeElement ? new WeakRef(activeElement) : null;\n\n const methods: ModalMethods<P> = {\n dismiss: () => {\n dispatch({ action: 'dismiss', modal: { id } });\n options?.onDismiss?.(id);\n const initiator = initiatorRef?.deref();\n if (\n initiator?.isConnected &&\n (initiator instanceof HTMLElement || initiator instanceof SVGElement)\n ) {\n initiator.focus();\n }\n },\n update: updateProps => {\n (dispatch as Dispatch<ModalReducerPayload<P>>)({\n action: 'update',\n modal: { id, props: updateProps }\n });\n },\n minimize: () => {\n dispatch({ action: 'minimize', modal: { id } });\n options?.onMinimize?.(id);\n },\n maximize: () => {\n dispatch({ action: 'maximize', modal: { id } });\n options?.onMaximize?.(id);\n },\n dock: () => {\n dispatch({ action: 'dock', modal: { id } });\n options?.onDock?.(id);\n },\n activate: () => {\n dispatch({ action: 'activate', modal: { id } });\n options?.onActivate?.(id);\n },\n unmount: () => {\n dispatch({ action: 'unmount', modal: { id } });\n }\n };\n\n let defaultState: ModalState;\n if (options?.defaultMinimized) {\n defaultState = 'minimized';\n } else if (options?.dockable) {\n defaultState = 'docked';\n } else {\n defaultState = 'open';\n }\n\n (dispatch as Dispatch<ModalReducerPayload<P>>)({\n action: 'create',\n modal: {\n id,\n methods,\n Component,\n props,\n state: defaultState,\n options: {\n alert: false,\n minimizable: false,\n maximizable: false,\n dockable: false,\n defaultMinimized: false,\n unmountWhenMinimized: true,\n ...options,\n dismissible: !!(options?.alert ? false : options?.dismissible ?? true)\n }\n }\n });\n\n return methods;\n },\n ModalContext,\n initialized: true\n }),\n []\n );\n\n useEffect(() => {\n if (modals.some(modal => modal.state === 'open' && !modal.options.dockable)) {\n disableScroll();\n } else {\n enableScroll();\n }\n }, [modals]);\n\n const { portalTarget } = useConfiguration();\n\n const context = windowIsAvailable\n ? window.cosmos.modalManagerContext ?? ModalManagerContext\n : ModalManagerContext;\n const priorCtx = useContext(context);\n\n // Don't create additional Modal portals.\n if (priorCtx.initialized) return <context.Provider value={priorCtx}>{children}</context.Provider>;\n\n return (\n <context.Provider value={providerValue}>\n {children}\n {modals.length > 0 &&\n portalTarget &&\n createPortal(<RenderModals modals={modals} />, portalTarget)}\n </context.Provider>\n );\n};\n\nexport default ModalManager;\n"]}
|
|
1
|
+
{"version":3,"file":"ModalManager.js","sourceRoot":"","sources":["../../../src/components/Modal/ModalManager.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEhE,OAAO,YAAY,CAAC;AAEpB,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAS1C,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AA8B/D,MAAM,OAAO,GAAG,CACd,MAAqB,EACrB,OAA+B,EACX,EAAE;IACtB,QAAQ,OAAO,CAAC,MAAM,EAAE;QACtB,KAAK,QAAQ;YACX,OAAO,CAAC,GAAG,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAEpC,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAE/D,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAA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AY,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAE5C,MAAM,OAAO,GAAG,iBAAiB;QAC/B,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,IAAI,mBAAmB;QAC1D,CAAC,CAAC,mBAAmB,CAAC;IACxB,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAErC,yCAAyC;IACzC,IAAI,QAAQ,CAAC,WAAW;QAAE,OAAO,KAAC,OAAO,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,YAAG,QAAQ,GAAoB,CAAC;IAElG,OAAO,CACL,MAAC,OAAO,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa,aACnC,QAAQ,EACR,MAAM,CAAC,MAAM,GAAG,CAAC;gBAChB,YAAY;gBACZ,YAAY,CAAC,KAAC,YAAY,IAAC,MAAM,EAAE,MAAM,GAAI,EAAE,YAAY,CAAC,IAC7C,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { useReducer, useMemo, useEffect, useContext, memo } from 'react';\nimport type { FunctionComponent, ComponentType, Dispatch, Context } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { createUID, getActiveElement, windowIsAvailable } from '../../utils';\nimport { useConfiguration, useScrollToggle } from '../../hooks';\nimport type { ExcludeStrict, OmitStrict } from '../../types';\nimport '../../init';\n\nimport DockedModals from './DockedModals';\nimport type {\n ModalMethods,\n ModalOptions,\n ModalObject,\n ModalManagerProps,\n ModalState,\n ModalManagerContextValue\n} from './Modal.types';\nimport { ModalContext, ModalManagerContext } from './Contexts';\n\ndeclare module '../../init' {\n export interface CosmosGlobals {\n modalManagerContext?: Context<ModalManagerContextValue>;\n }\n}\n\ntype ModalAction =\n | 'create'\n | 'update'\n | 'minimize'\n | 'maximize'\n | 'dock'\n | 'activate'\n | 'dismiss'\n | 'unmount';\n\ntype ModalReducerPayload<P extends object> =\n | { action: 'create'; modal: ModalObject<P> }\n | {\n action: 'update';\n modal: Partial<OmitStrict<ModalObject<P>, 'props'>> &\n Pick<ModalObject, 'id'> & { props: Partial<ModalObject<P>['props']> };\n }\n | {\n action: ExcludeStrict<ModalAction, 'create' | 'update'>;\n modal: Pick<ModalObject, 'id'>;\n };\n\nconst reducer = <P extends object>(\n modals: ModalObject[],\n payload: ModalReducerPayload<P>\n): ModalObject<any>[] => {\n switch (payload.action) {\n case 'create':\n return [...modals, payload.modal];\n\n case 'unmount':\n return modals.filter(modal => modal.id !== payload.modal.id);\n\n case 'dismiss':\n return modals.map(modal => {\n modal.state = modal.id === payload.modal.id ? 'closed' : modal.state;\n return modal;\n });\n\n case 'update':\n return modals.map(modal => {\n modal.props =\n modal.id === payload.modal.id ? { ...modal.props, ...payload.modal.props } : modal.props;\n return modal;\n });\n\n case 'activate': {\n const newModals = modals.map(modal => {\n modal.state = modal.id === payload.modal.id ? 'open' : modal.state;\n return modal;\n });\n\n // Move the newly activated modal to the end of the list\n // to ensure it is shown on top of other active modals.\n const activatedModal = newModals.splice(\n newModals.findIndex(modal => modal.id === payload.modal.id),\n 1\n );\n\n return [...newModals, ...activatedModal];\n }\n\n case 'minimize':\n return modals.map(modal => {\n modal.state =\n modal.id === payload.modal.id && modal.options.minimizable ? 'minimized' : modal.state;\n return modal;\n });\n\n case 'maximize':\n return modals.map(modal => {\n modal.state =\n modal.id === payload.modal.id && modal.options.maximizable ? 'maximized' : modal.state;\n return modal;\n });\n\n case 'dock':\n return modals.map(modal => {\n modal.state =\n modal.id === payload.modal.id && modal.options.dockable ? 'docked' : 'minimized';\n return modal;\n });\n\n default:\n return modals;\n }\n};\n\nconst WrappedModal = memo(\n ({\n Component,\n id,\n options: { alert, dismissible, dockable, minimizable, maximizable },\n state,\n methods,\n props,\n top\n }: ModalObject & { top: boolean }) => (\n <ModalContext.Provider\n // eslint-disable-next-line react/jsx-no-constructed-context-values\n value={{\n id,\n alert,\n dismissible,\n minimizable,\n maximizable,\n dockable,\n state,\n top,\n initialized: true,\n ...methods\n }}\n >\n <Component {...props} />\n </ModalContext.Provider>\n )\n);\n\nconst RenderModals = ({ modals }: { modals: ModalObject[] }) => {\n const { open, minimized, alerts } = modals.reduce<{\n open: ModalObject[];\n minimized: ModalObject[];\n alerts: ModalObject[];\n }>(\n (obj, modal) => {\n if (modal.options.alert) obj.alerts.push(modal);\n else if (modal.state === 'minimized' || modal.state === 'docked') {\n obj.minimized.push(modal);\n } else obj.open.push(modal);\n\n return obj;\n },\n { open: [], minimized: [], alerts: [] }\n );\n\n return (\n <>\n {open.map((modal, i) => (\n <WrappedModal\n {...modal}\n top={alerts.length === 0 && i === open.length - 1}\n key={modal.id}\n />\n ))}\n {minimized.length > 0 && (\n <DockedModals>\n {minimized.map(modal => (\n <WrappedModal {...modal} top={false} key={modal.id} />\n ))}\n </DockedModals>\n )}\n {alerts.map((modal, i) => (\n <WrappedModal {...modal} top={i === open.length - 1} key={modal.id} />\n ))}\n </>\n );\n};\n\nconst ModalManager: FunctionComponent<ModalManagerProps> = ({ children }) => {\n const [modals, dispatch] = useReducer(reducer, []);\n const { disableScroll, enableScroll } = useScrollToggle();\n\n const providerValue = useMemo(\n () => ({\n create: <P extends object>(\n Component: ComponentType<P>,\n props?: P,\n options?: ModalOptions\n ) => {\n const id = options?.id || createUID();\n const activeElement = getActiveElement();\n const initiatorRef = activeElement ? new WeakRef(activeElement) : null;\n\n const methods: ModalMethods<P> = {\n dismiss: () => {\n dispatch({ action: 'dismiss', modal: { id } });\n options?.onDismiss?.(id);\n const initiator = initiatorRef?.deref();\n const currentActiveElement = getActiveElement();\n if (\n initiator?.isConnected &&\n (initiator instanceof HTMLElement || initiator instanceof SVGElement) &&\n currentActiveElement !== null &&\n (currentActiveElement.closest('[aria-modal=\"true\"]') !== null ||\n currentActiveElement === document.body)\n ) {\n initiator.focus();\n }\n },\n update: updateProps => {\n (dispatch as Dispatch<ModalReducerPayload<P>>)({\n action: 'update',\n modal: { id, props: updateProps }\n });\n },\n minimize: () => {\n dispatch({ action: 'minimize', modal: { id } });\n options?.onMinimize?.(id);\n },\n maximize: () => {\n dispatch({ action: 'maximize', modal: { id } });\n options?.onMaximize?.(id);\n },\n dock: () => {\n dispatch({ action: 'dock', modal: { id } });\n options?.onDock?.(id);\n },\n activate: () => {\n dispatch({ action: 'activate', modal: { id } });\n options?.onActivate?.(id);\n },\n unmount: () => {\n dispatch({ action: 'unmount', modal: { id } });\n }\n };\n\n let defaultState: ModalState;\n if (options?.defaultMinimized) {\n defaultState = 'minimized';\n } else if (options?.dockable) {\n defaultState = 'docked';\n } else {\n defaultState = 'open';\n }\n\n (dispatch as Dispatch<ModalReducerPayload<P>>)({\n action: 'create',\n modal: {\n id,\n methods,\n Component,\n props,\n state: defaultState,\n options: {\n alert: false,\n minimizable: false,\n maximizable: false,\n dockable: false,\n defaultMinimized: false,\n unmountWhenMinimized: true,\n ...options,\n dismissible: !!(options?.alert ? false : options?.dismissible ?? true)\n }\n }\n });\n\n return methods;\n },\n ModalContext,\n initialized: true\n }),\n []\n );\n\n useEffect(() => {\n if (modals.some(modal => modal.state === 'open' && !modal.options.dockable)) {\n disableScroll();\n } else {\n enableScroll();\n }\n }, [modals]);\n\n const { portalTarget } = useConfiguration();\n\n const context = windowIsAvailable\n ? window.cosmos.modalManagerContext ?? ModalManagerContext\n : ModalManagerContext;\n const priorCtx = useContext(context);\n\n // Don't create additional Modal portals.\n if (priorCtx.initialized) return <context.Provider value={priorCtx}>{children}</context.Provider>;\n\n return (\n <context.Provider value={providerValue}>\n {children}\n {modals.length > 0 &&\n portalTarget &&\n createPortal(<RenderModals modals={modals} />, portalTarget)}\n </context.Provider>\n );\n};\n\nexport default ModalManager;\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const getNumberInputTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly ["control", "plus", "minus", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
2
|
-
export declare const getNumberRangeTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly ["min", "max", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
1
|
+
export declare const getNumberInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["control", "plus", "minus", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
2
|
+
export declare const getNumberRangeTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["min", "max", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
3
3
|
//# sourceMappingURL=Number.test-ids.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Number.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Number/Number.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"Number.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Number/Number.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,gMAKvB,CAAC;AAEZ,eAAO,MAAM,qBAAqB,kLAIvB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import type { FunctionComponent } from 'react';
|
|
|
2
2
|
import type { ForwardProps } from '../../types';
|
|
3
3
|
import type { NumberInputProps } from './NumberInput.types';
|
|
4
4
|
declare const _default: FunctionComponent<NumberInputProps & ForwardProps> & {
|
|
5
|
-
getTestIds: (testIdProp?: string | undefined) => import("../../types").TestIdsRecord<readonly ["control", "plus", "minus", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
5
|
+
getTestIds: (testIdProp?: string | null | undefined) => import("../../types").TestIdsRecord<readonly ["control", "plus", "minus", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
8
|
//# sourceMappingURL=NumberInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../src/components/Number/NumberInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,iBAAiB,EAIlB,MAAM,OAAO,CAAC;AAQf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../src/components/Number/NumberInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,iBAAiB,EAIlB,MAAM,OAAO,CAAC;AAQf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAgBhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;;;;AAgR5D,wBAA+D"}
|