@pega/cosmos-react-core 7.0.0-build.9.1 → 7.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/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 +26 -19
- 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 +17 -5
- 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 +50 -11
- 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/AppShellSearch.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellSearch.styles.js +2 -0
- package/lib/components/AppShell/AppShellSearch.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 +40 -1
- 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 +19 -19
- 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/Selection.d.ts +1 -1
- package/lib/components/Badges/Selection.d.ts.map +1 -1
- package/lib/components/Badges/Selection.js +23 -20
- 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 +3 -1
- 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 +87 -58
- 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 +21 -32
- 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/Currency/CurrencyInput.types.d.ts +1 -1
- package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
- package/lib/components/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 -27
- 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 +26 -25
- 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 +21 -10
- 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/TimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.js +2 -7
- package/lib/components/DateTime/Input/TimeInput.js.map +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 +2 -2
- package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Input/utils.js +5 -2
- package/lib/components/DateTime/Input/utils.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 +28 -17
- 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 +1 -0
- package/lib/components/DateTime/utils.d.ts.map +1 -1
- package/lib/components/DateTime/utils.js +13 -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 +37 -15
- package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.js +39 -20
- 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 +4 -2
- package/lib/components/File/FileDisplayList.d.ts.map +1 -1
- package/lib/components/File/FileDisplayList.js +9 -3
- package/lib/components/File/FileDisplayList.js.map +1 -1
- package/lib/components/File/FileInput.d.ts +32 -8
- package/lib/components/File/FileInput.d.ts.map +1 -1
- package/lib/components/File/FileInput.js +169 -74
- 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 +16 -0
- package/lib/components/File/FileItem.d.ts.map +1 -1
- package/lib/components/File/FileItem.js +82 -27
- package/lib/components/File/FileItem.js.map +1 -1
- package/lib/components/File/FileList.d.ts +9 -3
- package/lib/components/File/FileList.d.ts.map +1 -1
- package/lib/components/File/FileList.js +53 -9
- package/lib/components/File/FileList.js.map +1 -1
- 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/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 +62 -64
- 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 +2 -2
- 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.d.ts.map +1 -1
- 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.d.ts.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-right.icon.d.ts.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.d.ts.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.d.ts.map +1 -1
- 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.d.ts.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.d.ts.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.d.ts.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.js +1 -1
- package/lib/components/Icon/streamline-icons/case-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/clipboard-pencil-solid.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/clipboard-pencil-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/clock-solid.icon.js +1 -1
- 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 +1 -1
- 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/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.js +1 -1
- package/lib/components/Icon/streamline-icons/information-solid.icon.js.map +1 -1
- 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/open.icon.d.ts.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/rule-library-solid.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/rule-library-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/search-analytics-solid.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/search-analytics-solid.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.js +1 -1
- 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 +7 -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/Lightbox/Lightbox.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.js +13 -6
- 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 +45 -17
- 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 +8 -7
- 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 +5 -5
- 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 +2 -2
- package/lib/components/Location/utils.d.ts.map +1 -1
- package/lib/components/Location/utils.js +67 -38
- 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 +2 -9
- 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 +24 -14
- 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 +31 -7
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/Modal.styles.d.ts +3 -1
- package/lib/components/Modal/Modal.styles.d.ts.map +1 -1
- package/lib/components/Modal/Modal.styles.js +34 -17
- 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/MultiStepForm/MultiStepForm.d.ts.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.js +28 -1
- package/lib/components/MultiStepForm/MultiStepForm.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/NumberDisplay.d.ts +5 -8
- package/lib/components/Number/NumberDisplay.d.ts.map +1 -1
- package/lib/components/Number/NumberDisplay.js +1 -2
- package/lib/components/Number/NumberDisplay.js.map +1 -1
- package/lib/components/Number/NumberInput.d.ts +2 -4
- package/lib/components/Number/NumberInput.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.js +15 -7
- package/lib/components/Number/NumberInput.js.map +1 -1
- package/lib/components/Number/NumberInput.types.d.ts +12 -30
- package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.types.js.map +1 -1
- package/lib/components/Number/NumberRangeInput.d.ts +2 -4
- package/lib/components/Number/NumberRangeInput.d.ts.map +1 -1
- package/lib/components/Number/NumberRangeInput.js +7 -72
- 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 +2 -0
- package/lib/components/PageTemplates/CategorySubPage.styles.js.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.js +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 +85 -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 +20 -5
- 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 +7 -7
- 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 +1 -2
- package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.js +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
- package/lib/components/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.js +1 -1
- package/lib/components/Slider/Slider.js.map +1 -1
- package/lib/components/Slider/Slider.styles.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/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 +117 -21
- 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 +8 -3
- package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +20 -5
- 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 +2 -0
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/index.js +2 -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 +155 -4
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useRefMap.d.ts +8 -0
- package/lib/hooks/useRefMap.d.ts.map +1 -0
- package/lib/hooks/useRefMap.js +27 -0
- package/lib/hooks/useRefMap.js.map +1 -0
- 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 +155 -4
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +178 -11
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +155 -4
- 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/theme/ThemeMachine.d.ts.map +1 -1
- package/lib/theme/ThemeMachine.js.map +1 -1
- package/lib/theme/theme.d.ts +18 -24
- package/lib/theme/theme.d.ts.map +1 -1
- package/lib/theme/themeDefinition.json +9 -14
- package/lib/theme/themeOverrides.schema.json +13 -18
- package/lib/types/types.d.ts +6 -4
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/types.js.map +1 -1
- package/lib/utils/createStringMatcher.d.ts +1 -1
- package/lib/utils/createStringMatcher.d.ts.map +1 -1
- package/lib/utils/createStringMatcher.js +4 -1
- package/lib/utils/createStringMatcher.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 +10 -7
- 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
|
@@ -10,12 +10,22 @@ export interface FileItemProps extends BaseProps {
|
|
|
10
10
|
thumbnail?: FileVisualProps['thumbnail'];
|
|
11
11
|
/** File extension. Use 'url' for link */
|
|
12
12
|
format?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Used for a smaller sized FileItem.
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
compact?: boolean;
|
|
13
18
|
/** When passed, will render a single icon button for yet to be or in progress uploads. Use this action to trigger xhr request termination. */
|
|
14
19
|
onCancel?: (id: FileItemProps['id']) => void;
|
|
15
20
|
/** When passed, will render a single icon button or within a MenuButton if other actions are defined. */
|
|
16
21
|
onEdit?: (id: FileItemProps['id']) => void;
|
|
17
22
|
/** When passed, will be called on click of the name. Passes file id as the parameter. */
|
|
18
23
|
onPreview?: (id: FileItemProps['id']) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Moves preview option to actions menu.
|
|
26
|
+
* To be used only in compact mode of single file input when rendered in a table
|
|
27
|
+
*/
|
|
28
|
+
previewFromActions?: boolean;
|
|
19
29
|
/** When passed, will render a single icon button or within a MenuButton if other actions are defined. Passes file id as the parameter. */
|
|
20
30
|
onDownload?: (id: FileItemProps['id']) => void;
|
|
21
31
|
/** When passed, will render a single icon button or within a MenuButton if other actions are defined. */
|
|
@@ -24,9 +34,15 @@ export interface FileItemProps extends BaseProps {
|
|
|
24
34
|
progress?: number;
|
|
25
35
|
/** Set if there is an error uploading the file. Applies error styling to the meta string passed. */
|
|
26
36
|
error?: string;
|
|
37
|
+
/** Setting the disable state */
|
|
38
|
+
disabled?: boolean;
|
|
27
39
|
/** Ref for the wrapping element. */
|
|
28
40
|
ref?: Ref<HTMLDivElement>;
|
|
29
41
|
}
|
|
42
|
+
export declare const StyledFileItem: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
43
|
+
compactMode: FileItemProps['compact'];
|
|
44
|
+
isDisabled?: FileItemProps['disabled'];
|
|
45
|
+
}, never>;
|
|
30
46
|
declare const FileItem: FC<FileItemProps & ForwardProps>;
|
|
31
47
|
export default FileItem;
|
|
32
48
|
//# sourceMappingURL=FileItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileItem.d.ts","sourceRoot":"","sources":["../../../src/components/File/FileItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,E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AoG;IACpG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AA+CD,eAAO,MAAM,cAAc;iBACZ,aAAa,CAAC,SAAS,CAAC;iBACxB,aAAa,CAAC,UAAU,CAAC;SA4EvC,CAAC;AAIF,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,GAAG,YAAY,CAsL7C,CAAC;AAEH,eAAe,QAAQ,CAAC"}
|
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useState } from 'react';
|
|
2
|
+
import { forwardRef, useEffect, useState } from 'react';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
|
+
import Icon, { registerIcon } from '../Icon';
|
|
5
|
+
import * as openIcon from '../Icon/icons/open.icon';
|
|
6
|
+
import * as timesIcon from '../Icon/icons/times.icon';
|
|
7
|
+
import * as previewIcon from '../Icon/icons/preview.icon';
|
|
8
|
+
import * as editIcon from '../Icon/icons/pencil.icon';
|
|
9
|
+
import * as downloadIcon from '../Icon/icons/download.icon';
|
|
10
|
+
import * as deleteIcon from '../Icon/icons/trash.icon';
|
|
4
11
|
import Text, { StyledText } from '../Text';
|
|
5
|
-
import Icon from '../Icon';
|
|
6
12
|
import Tooltip from '../Tooltip';
|
|
7
13
|
import { defaultThemeProp } from '../../theme';
|
|
8
|
-
import Button from '../Button';
|
|
9
|
-
import { useI18n, useElement, useConfiguration } from '../../hooks';
|
|
14
|
+
import Button, { StyledButton } from '../Button';
|
|
15
|
+
import { useI18n, useElement, useConfiguration, useConsolidatedRef } from '../../hooks';
|
|
10
16
|
import Actions from '../Actions';
|
|
11
17
|
import Progress from '../Progress';
|
|
12
18
|
import { StyledProgressRing } from '../Progress/Progress.styles';
|
|
13
19
|
import { formatNumber } from '../Number';
|
|
14
20
|
import Flex from '../Flex';
|
|
15
21
|
import { StyledIconShape } from '../Icon/Icon';
|
|
22
|
+
import { getActiveElement, getFocusables } from '../../utils';
|
|
23
|
+
import { elipsisOverflow } from '../../styles/mixins';
|
|
16
24
|
import { getKindFromMimeType, getMimeTypeFromFile } from './utils';
|
|
17
25
|
import FileVisual, { StyledFileVisual } from './FileVisual';
|
|
26
|
+
registerIcon(openIcon, timesIcon, previewIcon, editIcon, downloadIcon, deleteIcon);
|
|
18
27
|
const StyledErrorIcon = styled(Icon)(({ theme }) => {
|
|
19
28
|
return css `
|
|
20
29
|
color: ${theme.base.palette.urgent};
|
|
@@ -24,9 +33,7 @@ const StyledErrorIcon = styled(Icon)(({ theme }) => {
|
|
|
24
33
|
StyledErrorIcon.defaultProps = defaultThemeProp;
|
|
25
34
|
const titleEllipsisStyle = css `
|
|
26
35
|
flex-shrink: 1;
|
|
27
|
-
|
|
28
|
-
overflow: hidden;
|
|
29
|
-
text-overflow: ellipsis;
|
|
36
|
+
${elipsisOverflow}
|
|
30
37
|
`;
|
|
31
38
|
const StyledPreviewTitle = styled(Button) `
|
|
32
39
|
${titleEllipsisStyle}
|
|
@@ -53,13 +60,33 @@ const StyledActionsWrapper = styled.div(({ meta }) => {
|
|
|
53
60
|
`;
|
|
54
61
|
});
|
|
55
62
|
StyledActionsWrapper.defaultProps = defaultThemeProp;
|
|
56
|
-
const StyledFileItem = styled.div(({ theme: { base: { palette, 'border-radius': borderRadius, spacing, 'hit-area': { compact } }, components } }) => {
|
|
63
|
+
export const StyledFileItem = styled.div(({ theme: { base: { palette, 'border-radius': borderRadius, spacing, 'hit-area': { compact }, 'disabled-opacity': disabledOpacity }, components: { input, 'form-control': { ':disabled': { 'background-color': disabledBackgroundColor, 'border-color': disabledBorderColor } } } }, compactMode, isDisabled }) => {
|
|
57
64
|
return css `
|
|
58
65
|
border-radius: calc(0.5 * ${borderRadius});
|
|
59
66
|
border: 0.0625rem solid ${palette['border-line']};
|
|
60
67
|
background-color: ${palette['primary-background']};
|
|
61
|
-
height: ${
|
|
62
|
-
min-width: calc(${
|
|
68
|
+
height: ${input.height};
|
|
69
|
+
min-width: calc(${input.height} + 12ch + 1.5 * ${spacing} + ${compact});
|
|
70
|
+
|
|
71
|
+
${compactMode &&
|
|
72
|
+
css `
|
|
73
|
+
height: ${compact};
|
|
74
|
+
min-width: calc(${compact} + 12ch + 2 * ${spacing});
|
|
75
|
+
width: fit-content;
|
|
76
|
+
max-width: 25ch;
|
|
77
|
+
|
|
78
|
+
${StyledPreviewTitle}, ${StyledTextTitle} {
|
|
79
|
+
min-width: 12ch;
|
|
80
|
+
max-width: calc(25ch - (${compact} + 2 * ${spacing}));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
${StyledActionsWrapper} > ${StyledButton} {
|
|
84
|
+
min-height: 100%;
|
|
85
|
+
min-width: 100%;
|
|
86
|
+
margin-block: ${spacing};
|
|
87
|
+
}
|
|
88
|
+
`}
|
|
89
|
+
|
|
63
90
|
> ${StyledProgressRing} {
|
|
64
91
|
margin-inline-start: calc(0.5 * ${spacing});
|
|
65
92
|
}
|
|
@@ -69,20 +96,35 @@ const StyledFileItem = styled.div(({ theme: { base: { palette, 'border-radius':
|
|
|
69
96
|
border-end-start-radius: inherit;
|
|
70
97
|
border-start-end-radius: 0;
|
|
71
98
|
border-end-end-radius: 0;
|
|
72
|
-
width: ${
|
|
99
|
+
width: ${input.height};
|
|
73
100
|
flex-shrink: 0;
|
|
101
|
+
|
|
102
|
+
${compactMode &&
|
|
103
|
+
css `
|
|
104
|
+
height: ${compact};
|
|
105
|
+
width: ${compact};
|
|
106
|
+
`}
|
|
74
107
|
}
|
|
108
|
+
${isDisabled &&
|
|
109
|
+
css `
|
|
110
|
+
background-color: ${disabledBackgroundColor};
|
|
111
|
+
border-color: ${disabledBorderColor};
|
|
112
|
+
opacity: ${disabledOpacity};
|
|
113
|
+
`}
|
|
75
114
|
`;
|
|
76
115
|
});
|
|
77
116
|
StyledFileItem.defaultProps = defaultThemeProp;
|
|
78
117
|
const FileItem = forwardRef(function FileItem(props, ref) {
|
|
79
|
-
const { id, name, thumbnail, format, error, onCancel, onEdit, onPreview, onDownload, onDelete, progress, ...restProps } = props;
|
|
118
|
+
const { id, name, thumbnail, format, error, onCancel, onEdit, onPreview, onDownload, onDelete, progress, compact = false, previewFromActions = false, disabled = false, ...restProps } = props;
|
|
80
119
|
const [thumbnailError, setThumbnailError] = useState(false);
|
|
81
120
|
const [textTarget, setTextTarget] = useElement();
|
|
82
121
|
const [metaTarget, setMetaTarget] = useElement();
|
|
83
122
|
const { locale } = useConfiguration();
|
|
84
123
|
const t = useI18n();
|
|
85
124
|
const uploading = typeof progress === 'number' && progress < 100;
|
|
125
|
+
const itemRef = useConsolidatedRef(ref);
|
|
126
|
+
const activeElement = getActiveElement();
|
|
127
|
+
const activeElementInItem = itemRef.current?.contains(activeElement);
|
|
86
128
|
let metaMessage;
|
|
87
129
|
if (uploading) {
|
|
88
130
|
metaMessage = formatNumber(progress, {
|
|
@@ -98,42 +140,55 @@ const FileItem = forwardRef(function FileItem(props, ref) {
|
|
|
98
140
|
metaMessage = error;
|
|
99
141
|
}
|
|
100
142
|
const definedActions = [
|
|
143
|
+
previewFromActions ? { onClick: onPreview, text: t('preview'), icon: 'preview' } : undefined,
|
|
101
144
|
{ onClick: onEdit, text: t('edit'), icon: 'pencil' },
|
|
102
145
|
{ onClick: onDownload, text: t('download'), icon: 'download' },
|
|
103
146
|
{ onClick: onDelete, text: t('delete'), icon: 'trash' }
|
|
104
|
-
]
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
147
|
+
].flatMap(action => {
|
|
148
|
+
if (!action || !action.onClick)
|
|
149
|
+
return [];
|
|
150
|
+
const { text, icon, onClick } = action;
|
|
151
|
+
return [
|
|
152
|
+
{
|
|
153
|
+
id: text,
|
|
154
|
+
text,
|
|
155
|
+
icon,
|
|
156
|
+
onClick: () => {
|
|
157
|
+
if (onClick)
|
|
158
|
+
onClick(id);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
];
|
|
162
|
+
});
|
|
117
163
|
let visual;
|
|
164
|
+
let contextualLabel;
|
|
118
165
|
if (uploading) {
|
|
119
166
|
visual = _jsx(Progress, { variant: 'ring', placement: 'inline', value: progress });
|
|
167
|
+
contextualLabel = t('uploading_file', [name]);
|
|
120
168
|
}
|
|
121
169
|
else if (error) {
|
|
122
170
|
visual = _jsx(StyledErrorIcon, { name: 'warn-solid' });
|
|
171
|
+
contextualLabel = t('upload_failed', [name, error]);
|
|
123
172
|
}
|
|
124
173
|
else {
|
|
125
174
|
visual = (_jsx(FileVisual, { type: format === 'url' ? 'link' : getKindFromMimeType(getMimeTypeFromFile(format ?? '') ?? ''), thumbnail: thumbnailError ? undefined : thumbnail, onThumbnailError: () => {
|
|
126
175
|
setThumbnailError(true);
|
|
127
176
|
} }));
|
|
177
|
+
contextualLabel = name;
|
|
128
178
|
}
|
|
179
|
+
useEffect(() => {
|
|
180
|
+
if (!activeElement?.isConnected && activeElementInItem && itemRef.current) {
|
|
181
|
+
getFocusables(itemRef.current)[0]?.focus();
|
|
182
|
+
}
|
|
183
|
+
}, [progress, error, onCancel, onDelete, onPreview, onEdit, onDownload]);
|
|
129
184
|
return (_jsxs(Flex, { as: StyledFileItem, container: {
|
|
130
185
|
pad: [undefined, 0.5, undefined, undefined],
|
|
131
186
|
alignItems: 'center',
|
|
132
187
|
justify: 'start',
|
|
133
188
|
gap: 1
|
|
134
|
-
}, ref:
|
|
189
|
+
}, isDisabled: disabled, compactMode: compact, ref: itemRef, children: [visual, !previewFromActions && onPreview && !(error || uploading) ? (_jsxs(Button, { ...restProps, as: StyledPreviewTitle, variant: 'link', ref: setTextTarget, onClick: () => {
|
|
135
190
|
onPreview(id);
|
|
136
|
-
}, "aria-label": t('preview_file', [name]), children: [name, format === 'url' && _jsx(Icon, { name: 'open' })] })) : (_jsx(Text, { ...restProps, as: StyledTextTitle, ref: setTextTarget, children: name })), metaMessage && (_jsxs(_Fragment, { children: [_jsx(Text, { as: StyledMeta, variant: 'secondary', error: error && !uploading, ref: setMetaTarget, children: metaMessage }), metaTarget && (_jsx(Tooltip, { target: metaTarget, describeTarget: false, smart: true, children: metaMessage }))] })), (error || uploading) && onCancel && (_jsx(StyledActionsWrapper, { meta: !!metaMessage, children: _jsx(Button, { label: t('cancel'), "aria-label": `${t('cancel')} - ${
|
|
191
|
+
}, "aria-label": t('preview_file', [name]), disabled: disabled, children: [name, format === 'url' && _jsx(Icon, { name: 'open' })] })) : (_jsx(Text, { ...restProps, as: StyledTextTitle, ref: setTextTarget, children: name })), metaMessage && (_jsxs(_Fragment, { children: [_jsx(Text, { as: StyledMeta, variant: 'secondary', error: error && !uploading, ref: setMetaTarget, children: metaMessage }), metaTarget && (_jsx(Tooltip, { target: metaTarget, describeTarget: false, smart: true, children: metaMessage }))] })), (error || uploading) && onCancel && (_jsx(StyledActionsWrapper, { meta: !!metaMessage, children: _jsx(Button, { label: t('cancel'), "aria-label": `${t('cancel')} - ${contextualLabel}`, variant: 'simple', compact: true, icon: true, onClick: () => onCancel(id), children: _jsx(Icon, { name: 'times' }) }) })), !(error || uploading) && !!definedActions.length && (_jsx(StyledActionsWrapper, { meta: !!metaMessage, children: _jsx(Actions, { items: definedActions, compact: true, iconOnly: true, contextualLabel: name, disabled: disabled }) })), textTarget && (_jsx(Tooltip, { target: textTarget, smart: true, describeTarget: false, children: name }))] }));
|
|
137
192
|
});
|
|
138
193
|
export default FileItem;
|
|
139
194
|
//# sourceMappingURL=FileItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileItem.js","sourceRoot":"","sources":["../../../src/components/File/FileItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UA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AE,CAAC,YAE3B,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,GAAG,GACd,GACY,CACxB,EAEA,CAAC,CAAC,KAAK,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,MAAM,IAAI,CACnD,KAAC,oBAAoB,IAAC,IAAI,EAAE,CAAC,CAAC,WAAW,YACvC,KAAC,OAAO,IAAC,KAAK,EAAE,cAAc,EAAE,OAAO,QAAC,QAAQ,QAAC,eAAe,EAAE,IAAI,GAAI,GACrD,CACxB,EAEA,UAAU,IAAI,CACb,KAAC,OAAO,IAAC,MAAM,EAAE,UAAU,EAAE,KAAK,QAAC,cAAc,EAAE,KAAK,YACrD,IAAI,GACG,CACX,IACI,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { forwardRef, useState } from 'react';\nimport type { PropsWithoutRef, FC, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Text, { StyledText } from '../Text';\nimport Icon from '../Icon';\nimport Tooltip from '../Tooltip';\nimport type { ForwardProps, BaseProps, Action } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Button from '../Button';\nimport { useI18n, useElement, useConfiguration } from '../../hooks';\nimport Actions from '../Actions';\nimport Progress from '../Progress';\nimport { StyledProgressRing } from '../Progress/Progress.styles';\nimport { formatNumber } from '../Number';\nimport Flex from '../Flex';\nimport { StyledIconShape } from '../Icon/Icon';\n\nimport { getKindFromMimeType, getMimeTypeFromFile } from './utils';\nimport FileVisual, { StyledFileVisual } from './FileVisual';\nimport type { FileVisualProps } from './FileVisual';\n\nexport interface FileItemProps extends BaseProps {\n /** Unique id for item. */\n id: string;\n /** Name of the file. */\n name: string;\n /** A string to be used as an image src for a attachment thumbnail. Falls back to a provided icon or the default attachment icon. */\n thumbnail?: FileVisualProps['thumbnail'];\n /** File extension. Use 'url' for link */\n format?: string;\n /** When passed, will render a single icon button for yet to be or in progress uploads. Use this action to trigger xhr request termination. */\n onCancel?: (id: FileItemProps['id']) => void;\n /** When passed, will render a single icon button or within a MenuButton if other actions are defined. */\n onEdit?: (id: FileItemProps['id']) => void;\n /** When passed, will be called on click of the name. Passes file id as the parameter. */\n onPreview?: (id: FileItemProps['id']) => void;\n /** When passed, will render a single icon button or within a MenuButton if other actions are defined. Passes file id as the parameter. */\n onDownload?: (id: FileItemProps['id']) => void;\n /** When passed, will render a single icon button or within a MenuButton if other actions are defined. */\n onDelete?: (id: FileItemProps['id']) => void;\n /** If the attachment is in an upload state, pass progress as a number between 0-100 representing the percentage of progress. */\n progress?: number;\n /** Set if there is an error uploading the file. Applies error styling to the meta string passed. */\n error?: string;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nconst StyledErrorIcon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.palette.urgent};\n margin-inline-start: calc(0.5 * ${theme.base.spacing});\n `;\n});\n\nStyledErrorIcon.defaultProps = defaultThemeProp;\n\nconst titleEllipsisStyle = css`\n flex-shrink: 1;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\nconst StyledPreviewTitle = styled(Button)`\n ${titleEllipsisStyle}\n`;\n\nconst StyledTextTitle = styled(Text)`\n ${titleEllipsisStyle}\n`;\n\nconst StyledMeta = styled(StyledText)<{ error: boolean }>(({ theme, error }) => {\n return css`\n /* min width to show percentage in full */\n min-width: 4ch;\n margin-inline-start: auto;\n ${titleEllipsisStyle}\n ${error &&\n css`\n color: ${theme.base.palette.urgent};\n `}\n `;\n});\n\nStyledMeta.defaultProps = defaultThemeProp;\n\nconst StyledActionsWrapper = styled.div<{ meta: boolean }>(({ meta }) => {\n return css`\n margin-inline-start: ${meta ? 'unset' : 'auto'};\n `;\n});\n\nStyledActionsWrapper.defaultProps = defaultThemeProp;\n\nconst StyledFileItem = styled.div(\n ({\n theme: {\n base: {\n palette,\n 'border-radius': borderRadius,\n spacing,\n 'hit-area': { compact }\n },\n components\n }\n }) => {\n return css`\n border-radius: calc(0.5 * ${borderRadius});\n border: 0.0625rem solid ${palette['border-line']};\n background-color: ${palette['primary-background']};\n height: ${components.input.height};\n min-width: calc(${components.input.height} + 12ch + 1.5 * ${spacing} + ${compact});\n > ${StyledProgressRing} {\n margin-inline-start: calc(0.5 * ${spacing});\n }\n\n > ${StyledFileVisual}, > ${StyledIconShape} {\n border-start-start-radius: inherit;\n border-end-start-radius: inherit;\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n width: ${components.input.height};\n flex-shrink: 0;\n }\n `;\n }\n);\n\nStyledFileItem.defaultProps = defaultThemeProp;\n\nconst FileItem: FC<FileItemProps & ForwardProps> = forwardRef(function FileItem(\n props: PropsWithoutRef<FileItemProps>,\n ref: FileItemProps['ref']\n) {\n const {\n id,\n name,\n thumbnail,\n format,\n error,\n onCancel,\n onEdit,\n onPreview,\n onDownload,\n onDelete,\n progress,\n ...restProps\n } = props;\n\n const [thumbnailError, setThumbnailError] = useState(false);\n const [textTarget, setTextTarget] = useElement();\n const [metaTarget, setMetaTarget] = useElement();\n const { locale } = useConfiguration();\n const t = useI18n();\n const uploading = typeof progress === 'number' && progress < 100;\n\n let metaMessage;\n\n if (uploading) {\n metaMessage = formatNumber(progress, {\n locale,\n options: {\n style: 'unit',\n unit: 'percent',\n maximumFractionDigits: 0\n }\n });\n } else if (error) {\n metaMessage = error;\n }\n\n const definedActions: Action[] = [\n { onClick: onEdit, text: t('edit'), icon: 'pencil' },\n { onClick: onDownload, text: t('download'), icon: 'download' },\n { onClick: onDelete, text: t('delete'), icon: 'trash' }\n ]\n .filter(action => {\n return !!action.onClick;\n })\n .map(({ text: actiontext, icon, onClick }) => ({\n id: actiontext,\n text: actiontext,\n icon,\n onClick: () => {\n if (onClick) onClick(id);\n }\n }));\n\n let visual;\n\n if (uploading) {\n visual = <Progress variant='ring' placement='inline' value={progress} />;\n } else if (error) {\n visual = <StyledErrorIcon name='warn-solid' />;\n } else {\n visual = (\n <FileVisual\n type={\n format === 'url' ? 'link' : getKindFromMimeType(getMimeTypeFromFile(format ?? '') ?? '')\n }\n thumbnail={thumbnailError ? undefined : thumbnail}\n onThumbnailError={() => {\n setThumbnailError(true);\n }}\n />\n );\n }\n\n return (\n <Flex\n as={StyledFileItem}\n container={{\n pad: [undefined, 0.5, undefined, undefined],\n alignItems: 'center',\n justify: 'start',\n gap: 1\n }}\n ref={ref}\n >\n {visual}\n\n {onPreview && !(error || uploading) ? (\n <Button\n {...restProps}\n as={StyledPreviewTitle}\n variant='link'\n ref={setTextTarget}\n onClick={() => {\n onPreview(id);\n }}\n aria-label={t('preview_file', [name])}\n >\n {name}\n {format === 'url' && <Icon name='open' />}\n </Button>\n ) : (\n <Text {...restProps} as={StyledTextTitle} ref={setTextTarget}>\n {name}\n </Text>\n )}\n {metaMessage && (\n <>\n <Text as={StyledMeta} variant='secondary' error={error && !uploading} ref={setMetaTarget}>\n {metaMessage}\n </Text>\n\n {metaTarget && (\n <Tooltip target={metaTarget} describeTarget={false} smart>\n {metaMessage}\n </Tooltip>\n )}\n </>\n )}\n\n {(error || uploading) && onCancel && (\n <StyledActionsWrapper meta={!!metaMessage}>\n <Button\n label={t('cancel')}\n aria-label={`${t('cancel')} - ${name}`}\n variant='simple'\n compact\n icon\n onClick={() => onCancel(id)}\n >\n <Icon name='times' />\n </Button>\n </StyledActionsWrapper>\n )}\n\n {!(error || uploading) && !!definedActions.length && (\n <StyledActionsWrapper meta={!!metaMessage}>\n <Actions items={definedActions} compact iconOnly contextualLabel={name} />\n </StyledActionsWrapper>\n )}\n\n {textTarget && (\n <Tooltip target={textTarget} smart describeTarget={false}>\n {name}\n </Tooltip>\n )}\n </Flex>\n );\n});\n\nexport default FileItem;\n"]}
|
|
1
|
+
{"version":3,"file":"FileItem.js","sourceRoot":"","sources":["../../../src/components/File/FileItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,MAAM,EA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AK,YACrD,IAAI,GACG,CACX,IACI,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { forwardRef, useEffect, useState } from 'react';\nimport type { PropsWithoutRef, FC, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Icon, { registerIcon } from '../Icon';\nimport * as openIcon from '../Icon/icons/open.icon';\nimport * as timesIcon from '../Icon/icons/times.icon';\nimport * as previewIcon from '../Icon/icons/preview.icon';\nimport * as editIcon from '../Icon/icons/pencil.icon';\nimport * as downloadIcon from '../Icon/icons/download.icon';\nimport * as deleteIcon from '../Icon/icons/trash.icon';\nimport Text, { StyledText } from '../Text';\nimport Tooltip from '../Tooltip';\nimport type { ForwardProps, BaseProps, Action } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Button, { StyledButton } from '../Button';\nimport { useI18n, useElement, useConfiguration, useConsolidatedRef } from '../../hooks';\nimport Actions from '../Actions';\nimport Progress from '../Progress';\nimport { StyledProgressRing } from '../Progress/Progress.styles';\nimport { formatNumber } from '../Number';\nimport Flex from '../Flex';\nimport { StyledIconShape } from '../Icon/Icon';\nimport { getActiveElement, getFocusables } from '../../utils';\nimport { elipsisOverflow } from '../../styles/mixins';\n\nimport { getKindFromMimeType, getMimeTypeFromFile } from './utils';\nimport FileVisual, { StyledFileVisual } from './FileVisual';\nimport type { FileVisualProps } from './FileVisual';\n\nregisterIcon(openIcon, timesIcon, previewIcon, editIcon, downloadIcon, deleteIcon);\n\nexport interface FileItemProps extends BaseProps {\n /** Unique id for item. */\n id: string;\n /** Name of the file. */\n name: string;\n /** A string to be used as an image src for a attachment thumbnail. Falls back to a provided icon or the default attachment icon. */\n thumbnail?: FileVisualProps['thumbnail'];\n /** File extension. Use 'url' for link */\n format?: string;\n /**\n * Used for a smaller sized FileItem.\n * @default false\n */\n compact?: boolean;\n /** When passed, will render a single icon button for yet to be or in progress uploads. Use this action to trigger xhr request termination. */\n onCancel?: (id: FileItemProps['id']) => void;\n /** When passed, will render a single icon button or within a MenuButton if other actions are defined. */\n onEdit?: (id: FileItemProps['id']) => void;\n /** When passed, will be called on click of the name. Passes file id as the parameter. */\n onPreview?: (id: FileItemProps['id']) => void;\n /**\n * Moves preview option to actions menu.\n * To be used only in compact mode of single file input when rendered in a table\n */\n previewFromActions?: boolean;\n /** When passed, will render a single icon button or within a MenuButton if other actions are defined. Passes file id as the parameter. */\n onDownload?: (id: FileItemProps['id']) => void;\n /** When passed, will render a single icon button or within a MenuButton if other actions are defined. */\n onDelete?: (id: FileItemProps['id']) => void;\n /** If the attachment is in an upload state, pass progress as a number between 0-100 representing the percentage of progress. */\n progress?: number;\n /** Set if there is an error uploading the file. Applies error styling to the meta string passed. */\n error?: string;\n /** Setting the disable state */\n disabled?: boolean;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nconst StyledErrorIcon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.palette.urgent};\n margin-inline-start: calc(0.5 * ${theme.base.spacing});\n `;\n});\n\nStyledErrorIcon.defaultProps = defaultThemeProp;\n\nconst titleEllipsisStyle = css`\n flex-shrink: 1;\n ${elipsisOverflow}\n`;\n\nconst StyledPreviewTitle = styled(Button)`\n ${titleEllipsisStyle}\n`;\n\nconst StyledTextTitle = styled(Text)`\n ${titleEllipsisStyle}\n`;\n\nconst StyledMeta = styled(StyledText)<{ error: boolean }>(({ theme, error }) => {\n return css`\n /* min width to show percentage in full */\n min-width: 4ch;\n margin-inline-start: auto;\n ${titleEllipsisStyle}\n ${error &&\n css`\n color: ${theme.base.palette.urgent};\n `}\n `;\n});\n\nStyledMeta.defaultProps = defaultThemeProp;\n\nconst StyledActionsWrapper = styled.div<{ meta: boolean }>(({ meta }) => {\n return css`\n margin-inline-start: ${meta ? 'unset' : 'auto'};\n `;\n});\n\nStyledActionsWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledFileItem = styled.div<{\n compactMode: FileItemProps['compact'];\n isDisabled?: FileItemProps['disabled'];\n}>(\n ({\n theme: {\n base: {\n palette,\n 'border-radius': borderRadius,\n spacing,\n 'hit-area': { compact },\n 'disabled-opacity': disabledOpacity\n },\n components: {\n input,\n 'form-control': {\n ':disabled': {\n 'background-color': disabledBackgroundColor,\n 'border-color': disabledBorderColor\n }\n }\n }\n },\n compactMode,\n isDisabled\n }) => {\n return css`\n border-radius: calc(0.5 * ${borderRadius});\n border: 0.0625rem solid ${palette['border-line']};\n background-color: ${palette['primary-background']};\n height: ${input.height};\n min-width: calc(${input.height} + 12ch + 1.5 * ${spacing} + ${compact});\n\n ${compactMode &&\n css`\n height: ${compact};\n min-width: calc(${compact} + 12ch + 2 * ${spacing});\n width: fit-content;\n max-width: 25ch;\n\n ${StyledPreviewTitle}, ${StyledTextTitle} {\n min-width: 12ch;\n max-width: calc(25ch - (${compact} + 2 * ${spacing}));\n }\n\n ${StyledActionsWrapper} > ${StyledButton} {\n min-height: 100%;\n min-width: 100%;\n margin-block: ${spacing};\n }\n `}\n\n > ${StyledProgressRing} {\n margin-inline-start: calc(0.5 * ${spacing});\n }\n\n > ${StyledFileVisual}, > ${StyledIconShape} {\n border-start-start-radius: inherit;\n border-end-start-radius: inherit;\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n width: ${input.height};\n flex-shrink: 0;\n\n ${compactMode &&\n css`\n height: ${compact};\n width: ${compact};\n `}\n }\n ${isDisabled &&\n css`\n background-color: ${disabledBackgroundColor};\n border-color: ${disabledBorderColor};\n opacity: ${disabledOpacity};\n `}\n `;\n }\n);\n\nStyledFileItem.defaultProps = defaultThemeProp;\n\nconst FileItem: FC<FileItemProps & ForwardProps> = forwardRef(function FileItem(\n props: PropsWithoutRef<FileItemProps>,\n ref: FileItemProps['ref']\n) {\n const {\n id,\n name,\n thumbnail,\n format,\n error,\n onCancel,\n onEdit,\n onPreview,\n onDownload,\n onDelete,\n progress,\n compact = false,\n previewFromActions = false,\n disabled = false,\n ...restProps\n } = props;\n\n const [thumbnailError, setThumbnailError] = useState(false);\n const [textTarget, setTextTarget] = useElement();\n const [metaTarget, setMetaTarget] = useElement();\n const { locale } = useConfiguration();\n const t = useI18n();\n const uploading = typeof progress === 'number' && progress < 100;\n const itemRef = useConsolidatedRef(ref);\n\n const activeElement = getActiveElement();\n const activeElementInItem = itemRef.current?.contains(activeElement);\n\n let metaMessage;\n\n if (uploading) {\n metaMessage = formatNumber(progress, {\n locale,\n options: {\n style: 'unit',\n unit: 'percent',\n maximumFractionDigits: 0\n }\n });\n } else if (error) {\n metaMessage = error;\n }\n\n const definedActions: Action[] = [\n previewFromActions ? { onClick: onPreview, text: t('preview'), icon: 'preview' } : undefined,\n { onClick: onEdit, text: t('edit'), icon: 'pencil' },\n { onClick: onDownload, text: t('download'), icon: 'download' },\n { onClick: onDelete, text: t('delete'), icon: 'trash' }\n ].flatMap(action => {\n if (!action || !action.onClick) return [];\n\n const { text, icon, onClick } = action;\n return [\n {\n id: text,\n text,\n icon,\n onClick: () => {\n if (onClick) onClick(id);\n }\n }\n ];\n });\n\n let visual;\n let contextualLabel;\n\n if (uploading) {\n visual = <Progress variant='ring' placement='inline' value={progress} />;\n contextualLabel = t('uploading_file', [name]);\n } else if (error) {\n visual = <StyledErrorIcon name='warn-solid' />;\n contextualLabel = t('upload_failed', [name, error]);\n } else {\n visual = (\n <FileVisual\n type={\n format === 'url' ? 'link' : getKindFromMimeType(getMimeTypeFromFile(format ?? '') ?? '')\n }\n thumbnail={thumbnailError ? undefined : thumbnail}\n onThumbnailError={() => {\n setThumbnailError(true);\n }}\n />\n );\n contextualLabel = name;\n }\n\n useEffect(() => {\n if (!activeElement?.isConnected && activeElementInItem && itemRef.current) {\n getFocusables(itemRef.current)[0]?.focus();\n }\n }, [progress, error, onCancel, onDelete, onPreview, onEdit, onDownload]);\n\n return (\n <Flex\n as={StyledFileItem}\n container={{\n pad: [undefined, 0.5, undefined, undefined],\n alignItems: 'center',\n justify: 'start',\n gap: 1\n }}\n isDisabled={disabled}\n compactMode={compact}\n ref={itemRef}\n >\n {visual}\n\n {!previewFromActions && onPreview && !(error || uploading) ? (\n <Button\n {...restProps}\n as={StyledPreviewTitle}\n variant='link'\n ref={setTextTarget}\n onClick={() => {\n onPreview(id);\n }}\n aria-label={t('preview_file', [name])}\n disabled={disabled}\n >\n {name}\n {format === 'url' && <Icon name='open' />}\n </Button>\n ) : (\n <Text {...restProps} as={StyledTextTitle} ref={setTextTarget}>\n {name}\n </Text>\n )}\n {metaMessage && (\n <>\n <Text as={StyledMeta} variant='secondary' error={error && !uploading} ref={setMetaTarget}>\n {metaMessage}\n </Text>\n\n {metaTarget && (\n <Tooltip target={metaTarget} describeTarget={false} smart>\n {metaMessage}\n </Tooltip>\n )}\n </>\n )}\n\n {(error || uploading) && onCancel && (\n <StyledActionsWrapper meta={!!metaMessage}>\n <Button\n label={t('cancel')}\n aria-label={`${t('cancel')} - ${contextualLabel}`}\n variant='simple'\n compact\n icon\n onClick={() => onCancel(id)}\n >\n <Icon name='times' />\n </Button>\n </StyledActionsWrapper>\n )}\n\n {!(error || uploading) && !!definedActions.length && (\n <StyledActionsWrapper meta={!!metaMessage}>\n <Actions\n items={definedActions}\n compact\n iconOnly\n contextualLabel={name}\n disabled={disabled}\n />\n </StyledActionsWrapper>\n )}\n\n {textTarget && (\n <Tooltip target={textTarget} smart describeTarget={false}>\n {name}\n </Tooltip>\n )}\n </Flex>\n );\n});\n\nexport default FileItem;\n"]}
|
|
@@ -2,13 +2,19 @@ import type { PropsWithoutRef } from 'react';
|
|
|
2
2
|
import type { WithAttributes } from '../../types';
|
|
3
3
|
import type { FileDisplayProps } from './FileDisplay';
|
|
4
4
|
import type { FileItemProps } from './FileItem';
|
|
5
|
-
|
|
5
|
+
interface CommonFileProps {
|
|
6
|
+
onDownloadAll?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export type FileListProps = WithAttributes<'div', (CommonFileProps & {
|
|
6
9
|
type: 'display';
|
|
7
10
|
items: FileDisplayProps[];
|
|
8
|
-
|
|
11
|
+
disabled?: never;
|
|
12
|
+
}) | (CommonFileProps & {
|
|
9
13
|
type: 'item';
|
|
10
14
|
items: FileItemProps[];
|
|
11
|
-
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
})>;
|
|
17
|
+
export declare const StyledFileList: import("styled-components").StyledComponent<import("react").FunctionComponent<import("../Grid/Grid.types").default & import("../../types").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
12
18
|
declare const FileList: import("react").ForwardRefExoticComponent<PropsWithoutRef<FileListProps> & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
19
|
export default FileList;
|
|
14
20
|
//# sourceMappingURL=FileList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileList.d.ts","sourceRoot":"","sources":["../../../src/components/File/FileList.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAG7C,OAAO,KAAK,EAAc,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"FileList.d.ts","sourceRoot":"","sources":["../../../src/components/File/FileList.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAG7C,OAAO,KAAK,EAAc,cAAc,EAAE,MAAM,aAAa,CAAC;AAW9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAIhD,UAAU,eAAe;IACvB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,MAAM,MAAM,aAAa,GAAG,cAAc,CACxC,KAAK,EACH,CAAC,eAAe,GAAG;IACjB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB,CAAC,GACF,CAAC,eAAe,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC,CACL,CAAC;AAEF,eAAO,MAAM,cAAc,gNAI1B,CAAC;AAuBF,QAAA,MAAM,QAAQ,2HAwDb,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,22 +1,66 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { useBreakpoint, useConsolidatedRef } from '../../hooks';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useEffect } from 'react';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
import { useBreakpoint, useConsolidatedRef, useI18n, usePrevious } from '../../hooks';
|
|
5
5
|
import Grid from '../Grid';
|
|
6
6
|
import { StyledLink } from '../Link';
|
|
7
|
+
import { getActiveElement, getFocusables } from '../../utils';
|
|
8
|
+
import Flex from '../Flex';
|
|
9
|
+
import Button from '../Button';
|
|
10
|
+
import { defaultThemeProp } from '../../theme';
|
|
11
|
+
import { calculateFontSize } from '../../styles';
|
|
12
|
+
import { elipsisOverflow } from '../../styles/mixins';
|
|
7
13
|
import FileDisplay from './FileDisplay';
|
|
8
14
|
import FileItem from './FileItem';
|
|
9
|
-
const StyledFileList = styled(Grid) `
|
|
15
|
+
export const StyledFileList = styled(Grid) `
|
|
10
16
|
${StyledLink} + ${StyledLink} {
|
|
11
17
|
margin-inline-start: unset;
|
|
12
18
|
}
|
|
13
19
|
`;
|
|
14
|
-
const
|
|
20
|
+
const StyledDownloadAllButton = styled.button(({ theme: { components: { text }, base: { 'font-size': fontSize, 'font-scale': fontScale, spacing } } }) => {
|
|
21
|
+
const fontSizes = calculateFontSize(fontSize, fontScale);
|
|
22
|
+
return css `
|
|
23
|
+
font-size: ${fontSizes[text.secondary['font-size']]};
|
|
24
|
+
${elipsisOverflow}
|
|
25
|
+
flex-shrink: 1;
|
|
26
|
+
width: fit-content;
|
|
27
|
+
margin-inline-start: calc(0.5 * ${spacing});
|
|
28
|
+
margin-block-end: calc(0.5 * ${spacing});
|
|
29
|
+
`;
|
|
30
|
+
});
|
|
31
|
+
StyledDownloadAllButton.defaultProps = defaultThemeProp;
|
|
32
|
+
const FileList = forwardRef(function FileList({ type, items, onDownloadAll, disabled = false, ...restProps }, ref) {
|
|
15
33
|
const listRef = useConsolidatedRef(ref);
|
|
16
34
|
const isSmallOrAbove = useBreakpoint('sm', { breakpointRef: listRef });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
35
|
+
const t = useI18n();
|
|
36
|
+
const prevItems = usePrevious(items);
|
|
37
|
+
const activeElementContained = listRef.current?.contains(getActiveElement());
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
// Early exit when focus doesn't need to be grabbed
|
|
40
|
+
if (items.length === 0 ||
|
|
41
|
+
!activeElementContained ||
|
|
42
|
+
listRef.current?.contains(getActiveElement())) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
prevItems?.forEach((item, oldIndex) => {
|
|
46
|
+
const newIndex = items.findIndex(newItem => {
|
|
47
|
+
return item.id === newItem.id;
|
|
48
|
+
});
|
|
49
|
+
if (newIndex === -1 && listRef.current) {
|
|
50
|
+
if (oldIndex === prevItems.length - 1) {
|
|
51
|
+
// Move the focus to previous element when last element is removed
|
|
52
|
+
getFocusables(listRef.current.children[items.length - 1])[0]?.focus();
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
// Otherwise, Move the focus to next element
|
|
56
|
+
getFocusables(listRef.current.children[oldIndex])[0]?.focus();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}, [items]);
|
|
61
|
+
return (_jsxs(Flex, { container: { direction: 'column', gap: 1 }, children: [_jsx(Grid, { ...restProps, ref: listRef, container: { gap: 0.5, cols: isSmallOrAbove ? 'repeat(2, 1fr)' : '1fr' }, as: StyledFileList, children: type === 'display'
|
|
62
|
+
? items.map(item => _jsx(FileDisplay, { ...item }, item.id))
|
|
63
|
+
: items.map(item => _jsx(FileItem, { ...item, disabled: disabled }, item.id)) }), onDownloadAll && items.length > 1 && (_jsx(Button, { as: StyledDownloadAllButton, onClick: onDownloadAll, variant: 'link', children: t('download_all') }))] }));
|
|
20
64
|
});
|
|
21
65
|
export default FileList;
|
|
22
66
|
//# sourceMappingURL=FileList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileList.js","sourceRoot":"","sources":["../../../src/components/File/FileList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FileList.js","sourceRoot":"","sources":["../../../src/components/File/FileList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtF,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAiB,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAItD,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAoBlC,M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AAC;oBAC5D,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,KAAC,QAAQ,OAAmB,IAAI,EAAE,QAAQ,EAAE,QAAQ,IAArC,IAAI,CAAC,EAAE,CAAkC,CAAC,GAC1E,EACN,aAAa,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CACpC,KAAC,MAAM,IAAC,EAAE,EAAE,uBAAuB,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAC,MAAM,YACxE,CAAC,CAAC,cAAc,CAAC,GACX,CACV,IACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { forwardRef, useEffect } from 'react';\nimport type { PropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport type { RefElement, WithAttributes } from '../../types';\nimport { useBreakpoint, useConsolidatedRef, useI18n, usePrevious } from '../../hooks';\nimport Grid from '../Grid';\nimport { StyledLink } from '../Link';\nimport { getActiveElement, getFocusables } from '../../utils';\nimport Flex from '../Flex';\nimport Button from '../Button';\nimport { defaultThemeProp } from '../../theme';\nimport { calculateFontSize, type FontSize } from '../../styles';\nimport { elipsisOverflow } from '../../styles/mixins';\n\nimport type { FileDisplayProps } from './FileDisplay';\nimport type { FileItemProps } from './FileItem';\nimport FileDisplay from './FileDisplay';\nimport FileItem from './FileItem';\n\ninterface CommonFileProps {\n onDownloadAll?: () => void;\n}\n\nexport type FileListProps = WithAttributes<\n 'div',\n | (CommonFileProps & {\n type: 'display';\n items: FileDisplayProps[];\n disabled?: never;\n })\n | (CommonFileProps & {\n type: 'item';\n items: FileItemProps[];\n disabled?: boolean;\n })\n>;\n\nexport const StyledFileList = styled(Grid)`\n ${StyledLink} + ${StyledLink} {\n margin-inline-start: unset;\n }\n`;\n\nconst StyledDownloadAllButton = styled.button(\n ({\n theme: {\n components: { text },\n base: { 'font-size': fontSize, 'font-scale': fontScale, spacing }\n }\n }) => {\n const fontSizes = calculateFontSize(fontSize, fontScale);\n return css`\n font-size: ${fontSizes[text.secondary['font-size'] as FontSize]};\n ${elipsisOverflow}\n flex-shrink: 1;\n width: fit-content;\n margin-inline-start: calc(0.5 * ${spacing});\n margin-block-end: calc(0.5 * ${spacing});\n `;\n }\n);\n\nStyledDownloadAllButton.defaultProps = defaultThemeProp;\n\nconst FileList = forwardRef<RefElement<FileListProps>, PropsWithoutRef<FileListProps>>(\n function FileList({ type, items, onDownloadAll, disabled = false, ...restProps }, ref) {\n const listRef = useConsolidatedRef(ref);\n const isSmallOrAbove = useBreakpoint('sm', { breakpointRef: listRef });\n const t = useI18n();\n\n const prevItems = usePrevious(items);\n const activeElementContained = listRef.current?.contains(getActiveElement());\n\n useEffect(() => {\n // Early exit when focus doesn't need to be grabbed\n if (\n items.length === 0 ||\n !activeElementContained ||\n listRef.current?.contains(getActiveElement())\n ) {\n return;\n }\n\n prevItems?.forEach((item, oldIndex) => {\n const newIndex = items.findIndex(newItem => {\n return item.id === newItem.id;\n });\n\n if (newIndex === -1 && listRef.current) {\n if (oldIndex === prevItems.length - 1) {\n // Move the focus to previous element when last element is removed\n getFocusables(listRef.current.children[items.length - 1])[0]?.focus();\n } else {\n // Otherwise, Move the focus to next element\n getFocusables(listRef.current.children[oldIndex])[0]?.focus();\n }\n }\n });\n }, [items]);\n\n return (\n <Flex container={{ direction: 'column', gap: 1 }}>\n <Grid\n {...restProps}\n ref={listRef}\n container={{ gap: 0.5, cols: isSmallOrAbove ? 'repeat(2, 1fr)' : '1fr' }}\n as={StyledFileList}\n >\n {type === 'display'\n ? items.map(item => <FileDisplay key={item.id} {...item} />)\n : items.map(item => <FileItem key={item.id} {...item} disabled={disabled} />)}\n </Grid>\n {onDownloadAll && items.length > 1 && (\n <Button as={StyledDownloadAllButton} onClick={onDownloadAll} variant='link'>\n {t('download_all')}\n </Button>\n )}\n </Flex>\n );\n }\n);\n\nexport default FileList;\n"]}
|
|
@@ -37,6 +37,10 @@ export interface FileUploadItemProps extends BaseProps, NoChildrenProp {
|
|
|
37
37
|
/** A ref to the file item's HTMLLIElement. */
|
|
38
38
|
ref?: Ref<HTMLLIElement>;
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated
|
|
42
|
+
* Deprecating in favour of new file components
|
|
43
|
+
*/
|
|
40
44
|
declare const FileUploadItem: FC<FileUploadItemProps & ForwardProps>;
|
|
41
45
|
export default FileUploadItem;
|
|
42
46
|
//# sourceMappingURL=FileUploadItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUploadItem.d.ts","sourceRoot":"","sources":["../../../src/components/File/FileUploadItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,EAAE,EAAE,GAAG,EAAE,YAAY,EAAa,MAAM,OAAO,CAAC;AAe/E,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAO3E,MAAM,WAAW,mBAAoB,SAAQ,SAAS,EAAE,cAAc;IACpE,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,gBAAgB;IAChB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,wDAAwD;IACxD,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,uKAAuK;IACvK,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,8IAA8I;IAC9I,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACvD,yGAAyG;IACzG,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACrD,yGAAyG;IACzG,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACxD,yGAAyG;IACzG,UAA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I,EAAE,mBAAmB,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACrD,yGAAyG;IACzG,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACxD,yGAAyG;IACzG,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACzD,yGAAyG;IACzG,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACvD;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,oIAAoI;IACpI,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gIAAgI;IAChI,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8CAA8C;IAC9C,GAAG,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;CAC1B;AAkED;;;GAGG;AACH,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,GAAG,YAAY,CAgIzD,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -14,56 +14,60 @@ import FileVisual from './FileVisual';
|
|
|
14
14
|
import { getKindFromMimeType, getMimeTypeFromFile } from './utils';
|
|
15
15
|
const StyledFileUploadItem = styled(SummaryItem)(({ hasThumbnail, disabled, theme }) => {
|
|
16
16
|
return css `
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
border: 0.0625rem solid ${theme.base.palette['border-line']};
|
|
18
|
+
border-radius: calc(0.5 * ${theme.base['border-radius']});
|
|
19
|
+
background-color: ${theme.base.palette['primary-background']};
|
|
20
|
+
padding: calc(0.5 * ${theme.base.spacing});
|
|
21
|
+
min-height: 3rem;
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
${disabled &&
|
|
24
24
|
css `
|
|
25
|
-
|
|
25
|
+
opacity: ${theme.base['disabled-opacity']};
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
`}
|
|
31
|
-
|
|
32
|
-
${StyledProgressRing} {
|
|
33
|
-
height: ${theme.components.input.height};
|
|
34
|
-
width: ${theme.components.input.height};
|
|
27
|
+
${StyledButton}:disabled {
|
|
28
|
+
opacity: unset;
|
|
35
29
|
}
|
|
30
|
+
`}
|
|
31
|
+
|
|
32
|
+
${StyledProgressRing} {
|
|
33
|
+
height: ${theme.components.input.height};
|
|
34
|
+
width: ${theme.components.input.height};
|
|
35
|
+
}
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
${hasThumbnail &&
|
|
38
38
|
css `
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
height: calc(6rem + ${theme.base.spacing});
|
|
40
|
+
grid-row: span 2;
|
|
41
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
${StyledVisual} {
|
|
44
|
+
align-self: auto;
|
|
45
|
+
width: calc(6rem - 0.125rem);
|
|
46
|
+
height: calc(6rem - 0.125rem);
|
|
47
|
+
}
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
${StyledPrimary} {
|
|
50
|
+
align-self: start;
|
|
51
|
+
margin-block-start: calc(0.5 * ${theme.base.spacing});
|
|
52
|
+
}
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
${StyledSecondary} {
|
|
55
|
+
grid-area: primary;
|
|
56
|
+
align-self: center;
|
|
57
|
+
margin-block-start: calc(3 * ${theme.base.spacing});
|
|
58
|
+
}
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
${StyledSummaryItemActions} {
|
|
61
|
+
align-self: start;
|
|
62
|
+
}
|
|
63
|
+
`}
|
|
64
|
+
`;
|
|
65
65
|
});
|
|
66
66
|
StyledFileUploadItem.defaultProps = defaultThemeProp;
|
|
67
|
+
/**
|
|
68
|
+
* @deprecated
|
|
69
|
+
* Deprecating in favour of new file components
|
|
70
|
+
*/
|
|
67
71
|
const FileUploadItem = forwardRef(function FileUploadItem({ name, meta, error = false, progress, thumbnail, onCancel, onEdit, onPreview, onDownload, onDelete, size, disabled, ...restProps }, ref) {
|
|
68
72
|
const t = useI18n();
|
|
69
73
|
const [thumbnailError, setThumbnailError] = useState(false);
|