@pega/cosmos-react-core 7.0.0-build.3.4 → 7.0.0-build.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/AIButton/AIButton.d.ts +30 -2
- package/lib/components/AIButton/AIButton.d.ts.map +1 -1
- package/lib/components/AIButton/AIButton.js +7 -6
- package/lib/components/AIButton/AIButton.js.map +1 -1
- package/lib/components/Actions/Actions.d.ts +1 -1
- package/lib/components/Actions/Actions.d.ts.map +1 -1
- package/lib/components/Actions/Actions.js +6 -3
- package/lib/components/Actions/Actions.js.map +1 -1
- package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.js +9 -7
- package/lib/components/AppShell/AppHeader.js.map +1 -1
- package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.styles.js +27 -20
- package/lib/components/AppShell/AppHeader.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js +16 -4
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts +5 -1
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +52 -13
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.types.d.ts +4 -0
- package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.types.js.map +1 -1
- package/lib/components/AppShell/AppShellContext.d.ts +3 -1
- package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellContext.js +3 -1
- package/lib/components/AppShell/AppShellContext.js.map +1 -1
- package/lib/components/AppShell/AppShellList.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellList.styles.js +1 -0
- package/lib/components/AppShell/AppShellList.styles.js.map +1 -1
- package/lib/components/AppShell/NavigationList.d.ts.map +1 -1
- package/lib/components/AppShell/NavigationList.js +3 -3
- package/lib/components/AppShell/NavigationList.js.map +1 -1
- package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -1
- package/lib/components/AppShell/NavigationListItemWrapper.js +1 -0
- package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -1
- package/lib/components/AppShell/Operator.d.ts +1 -1
- package/lib/components/AppShell/style-utils.d.ts +3 -0
- package/lib/components/AppShell/style-utils.d.ts.map +1 -1
- package/lib/components/AppShell/style-utils.js +42 -3
- package/lib/components/AppShell/style-utils.js.map +1 -1
- package/lib/components/Avatar/Avatar.d.ts +2 -2
- package/lib/components/Avatar/Avatar.d.ts.map +1 -1
- package/lib/components/Avatar/Avatar.js +21 -20
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/Avatar/Avatar.test-ids.d.ts +1 -1
- package/lib/components/Avatar/Avatar.test-ids.d.ts.map +1 -1
- package/lib/components/Backdrop/Backdrop.d.ts +1 -1
- package/lib/components/Backdrop/Backdrop.test-ids.d.ts +1 -1
- package/lib/components/Backdrop/Backdrop.test-ids.d.ts.map +1 -1
- package/lib/components/Badges/Alert.d.ts +1 -1
- package/lib/components/Badges/Badges.test-ids.d.ts +6 -6
- package/lib/components/Badges/Badges.test-ids.d.ts.map +1 -1
- package/lib/components/Badges/Count.d.ts +1 -1
- package/lib/components/Badges/Keyboard.d.ts +1 -1
- package/lib/components/Badges/Keyboard.d.ts.map +1 -1
- package/lib/components/Badges/Keyboard.js +9 -8
- package/lib/components/Badges/Keyboard.js.map +1 -1
- package/lib/components/Badges/Selection.d.ts +1 -1
- package/lib/components/Badges/Selection.d.ts.map +1 -1
- package/lib/components/Badges/Selection.js +3 -1
- package/lib/components/Badges/Selection.js.map +1 -1
- package/lib/components/Badges/Status.d.ts +1 -1
- package/lib/components/Badges/Status.d.ts.map +1 -1
- package/lib/components/Badges/Status.js +0 -1
- package/lib/components/Badges/Status.js.map +1 -1
- package/lib/components/Badges/Tag.d.ts +1 -1
- package/lib/components/Banner/Banner.d.ts +1 -1
- package/lib/components/Banner/Banner.d.ts.map +1 -1
- package/lib/components/Banner/Banner.js +5 -2
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Banner/Banner.test-ids.d.ts +1 -1
- package/lib/components/Banner/Banner.test-ids.d.ts.map +1 -1
- package/lib/components/Button/Button.d.ts +1 -1
- package/lib/components/Button/Button.d.ts.map +1 -1
- package/lib/components/Button/Button.js +142 -53
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Card/Card.d.ts.map +1 -1
- package/lib/components/Card/Card.js +8 -0
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Checkbox/Checkbox.d.ts +3 -33
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/Checkbox.js +1 -5
- package/lib/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.d.ts +6 -23
- package/lib/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.js +3 -4
- package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts +1 -1
- package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts +2 -4
- package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.js +8 -5
- package/lib/components/ComboBox/ComboBox.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.styles.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.styles.js +7 -1
- package/lib/components/ComboBox/ComboBox.styles.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.types.d.ts +8 -26
- package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
- package/lib/components/ComboBox/ComboxBox.test-ids.d.ts +1 -1
- package/lib/components/ComboBox/ComboxBox.test-ids.d.ts.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +10 -2
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.d.ts +2 -3
- package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.js +2 -3
- package/lib/components/CompositeInput/CompositeInput.js.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts +1 -1
- package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.types.d.ts +4 -13
- package/lib/components/CompositeInput/CompositeInput.types.d.ts.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.types.js.map +1 -1
- package/lib/components/Configuration/Configuration.d.ts +1 -0
- package/lib/components/Configuration/Configuration.d.ts.map +1 -1
- package/lib/components/Configuration/Configuration.js +58 -30
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/Configuration/ThemeOverride.d.ts +11 -0
- package/lib/components/Configuration/ThemeOverride.d.ts.map +1 -0
- package/lib/components/Configuration/ThemeOverride.js +23 -0
- package/lib/components/Configuration/ThemeOverride.js.map +1 -0
- package/lib/components/Configuration/connected-watcher.d.ts +17 -0
- package/lib/components/Configuration/connected-watcher.d.ts.map +1 -0
- package/lib/components/Configuration/connected-watcher.js +13 -0
- package/lib/components/Configuration/connected-watcher.js.map +1 -0
- package/lib/components/Configuration/index.d.ts +1 -0
- package/lib/components/Configuration/index.d.ts.map +1 -1
- package/lib/components/Configuration/index.js +1 -0
- package/lib/components/Configuration/index.js.map +1 -1
- package/lib/components/Configuration/withConfiguration.d.ts.map +1 -1
- package/lib/components/Configuration/withConfiguration.js.map +1 -1
- package/lib/components/CreditCard/CreditCard.types.d.ts +5 -25
- package/lib/components/CreditCard/CreditCard.types.d.ts.map +1 -1
- package/lib/components/CreditCard/CreditCard.types.js.map +1 -1
- package/lib/components/CreditCard/CreditCardDisplay.d.ts +2 -4
- package/lib/components/CreditCard/CreditCardDisplay.d.ts.map +1 -1
- package/lib/components/CreditCard/CreditCardDisplay.js +1 -2
- package/lib/components/CreditCard/CreditCardDisplay.js.map +1 -1
- package/lib/components/CreditCard/CreditCardInput.d.ts +15 -5
- package/lib/components/CreditCard/CreditCardInput.d.ts.map +1 -1
- package/lib/components/CreditCard/CreditCardInput.js +1 -2
- package/lib/components/CreditCard/CreditCardInput.js.map +1 -1
- package/lib/components/Currency/Currency.test-ids.d.ts +1 -1
- package/lib/components/Currency/Currency.test-ids.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.d.ts +1 -1
- package/lib/components/Currency/CurrencyInput.js +1 -1
- package/lib/components/Currency/CurrencyInput.js.map +1 -1
- package/lib/components/DangerButton/DangerButton.js +2 -2
- package/lib/components/DangerButton/DangerButton.js.map +1 -1
- package/lib/components/DateTime/DateTime.test-ids.d.ts +11 -11
- package/lib/components/DateTime/DateTime.test-ids.d.ts.map +1 -1
- package/lib/components/DateTime/DateTime.test-ids.js +5 -1
- package/lib/components/DateTime/DateTime.test-ids.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +30 -30
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.d.ts +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.js +2 -2
- package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.d.ts +1 -0
- package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.js +24 -16
- package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +28 -22
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.d.ts +1 -1
- package/lib/components/DateTime/Input/MonthInput.d.ts +1 -1
- package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.js +23 -12
- package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
- package/lib/components/DateTime/Input/PartInput.d.ts +1 -1
- package/lib/components/DateTime/Input/PartInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/PartInput.js +13 -7
- package/lib/components/DateTime/Input/PartInput.js.map +1 -1
- package/lib/components/DateTime/Input/QuarterInput.d.ts +1 -1
- package/lib/components/DateTime/Input/TimeInput.d.ts +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.js +3 -3
- package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.d.ts +1 -1
- package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.js +17 -6
- package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
- package/lib/components/DateTime/Input/utils.d.ts +3 -2
- package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Input/utils.js +9 -2
- package/lib/components/DateTime/Input/utils.js.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.js +5 -4
- package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.styles.js +2 -1
- package/lib/components/DateTime/Picker/Calendar.styles.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.d.ts +1 -1
- package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.js +31 -19
- package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.styles.d.ts +1 -0
- package/lib/components/DateTime/Picker/DatePicker.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.styles.js +13 -5
- package/lib/components/DateTime/Picker/DatePicker.styles.js.map +1 -1
- package/lib/components/DateTime/Picker/DateRangePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DateRangePicker.js +18 -11
- package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.js +2 -1
- package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/utils.d.ts +9 -0
- package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/utils.js +16 -0
- package/lib/components/DateTime/Picker/utils.js.map +1 -1
- package/lib/components/DateTime/index.d.ts +1 -1
- package/lib/components/DateTime/index.d.ts.map +1 -1
- package/lib/components/DateTime/index.js +1 -1
- package/lib/components/DateTime/index.js.map +1 -1
- package/lib/components/DateTime/utils.d.ts +5 -0
- package/lib/components/DateTime/utils.d.ts.map +1 -1
- package/lib/components/DateTime/utils.js +21 -11
- package/lib/components/DateTime/utils.js.map +1 -1
- package/lib/components/Email/EmailDisplay.d.ts.map +1 -1
- package/lib/components/Email/EmailDisplay.js +2 -2
- package/lib/components/Email/EmailDisplay.js.map +1 -1
- package/lib/components/EmptyState/EmptyState.d.ts.map +1 -1
- package/lib/components/EmptyState/EmptyState.js +5 -2
- package/lib/components/EmptyState/EmptyState.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.d.ts +6 -0
- package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.js +36 -14
- package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts +1 -0
- package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.js +18 -18
- package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.d.ts +14 -10
- package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.js +13 -5
- package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.test-ids.d.ts +2 -2
- package/lib/components/FieldValueList/FieldValueList.test-ids.d.ts.map +1 -1
- package/lib/components/FieldValueList/index.d.ts +1 -1
- package/lib/components/FieldValueList/index.d.ts.map +1 -1
- package/lib/components/FieldValueList/index.js.map +1 -1
- package/lib/components/File/CompactList.d.ts +15 -0
- package/lib/components/File/CompactList.d.ts.map +1 -0
- package/lib/components/File/CompactList.js +21 -0
- package/lib/components/File/CompactList.js.map +1 -0
- package/lib/components/File/File.test-ids.d.ts +1 -1
- package/lib/components/File/File.test-ids.d.ts.map +1 -1
- package/lib/components/File/FileDisplay.d.ts +5 -0
- package/lib/components/File/FileDisplay.d.ts.map +1 -1
- package/lib/components/File/FileDisplay.js +2 -2
- package/lib/components/File/FileDisplay.js.map +1 -1
- package/lib/components/File/FileDisplayList.d.ts +10 -0
- package/lib/components/File/FileDisplayList.d.ts.map +1 -0
- package/lib/components/File/FileDisplayList.js +14 -0
- package/lib/components/File/FileDisplayList.js.map +1 -0
- package/lib/components/File/FileInput.d.ts +38 -9
- package/lib/components/File/FileInput.d.ts.map +1 -1
- package/lib/components/File/FileInput.js +183 -72
- package/lib/components/File/FileInput.js.map +1 -1
- package/lib/components/File/FileInput.styles.d.ts +26 -0
- package/lib/components/File/FileInput.styles.d.ts.map +1 -0
- package/lib/components/File/FileInput.styles.js +166 -0
- package/lib/components/File/FileInput.styles.js.map +1 -0
- package/lib/components/File/FileItem.d.ts +18 -4
- package/lib/components/File/FileItem.d.ts.map +1 -1
- package/lib/components/File/FileItem.js +84 -30
- package/lib/components/File/FileItem.js.map +1 -1
- package/lib/components/File/FileList.d.ts +20 -0
- package/lib/components/File/FileList.d.ts.map +1 -0
- package/lib/components/File/FileList.js +66 -0
- package/lib/components/File/FileList.js.map +1 -0
- package/lib/components/File/FileUploadItem.d.ts +4 -0
- package/lib/components/File/FileUploadItem.d.ts.map +1 -1
- package/lib/components/File/FileUploadItem.js +42 -38
- package/lib/components/File/FileUploadItem.js.map +1 -1
- package/lib/components/File/index.d.ts +4 -0
- package/lib/components/File/index.d.ts.map +1 -1
- package/lib/components/File/index.js +2 -0
- package/lib/components/File/index.js.map +1 -1
- package/lib/components/Flex/Flex.js.map +1 -1
- package/lib/components/Form/Form.d.ts +1 -1
- package/lib/components/Form/Form.test-ids.d.ts +1 -1
- package/lib/components/Form/Form.test-ids.d.ts.map +1 -1
- package/lib/components/FormField/FormField.d.ts +2 -2
- package/lib/components/FormField/FormField.d.ts.map +1 -1
- package/lib/components/FormField/FormField.js +45 -60
- package/lib/components/FormField/FormField.js.map +1 -1
- package/lib/components/FormField/FormField.test-ids.d.ts +1 -1
- package/lib/components/FormField/FormField.test-ids.d.ts.map +1 -1
- package/lib/components/Fullscreen/Fullscreen.d.ts +18 -0
- package/lib/components/Fullscreen/Fullscreen.d.ts.map +1 -0
- package/lib/components/Fullscreen/Fullscreen.js +56 -0
- package/lib/components/Fullscreen/Fullscreen.js.map +1 -0
- package/lib/components/Fullscreen/Fullscreen.test-ids.d.ts +2 -0
- package/lib/components/Fullscreen/Fullscreen.test-ids.d.ts.map +1 -0
- package/lib/components/Fullscreen/Fullscreen.test-ids.js +3 -0
- package/lib/components/Fullscreen/Fullscreen.test-ids.js.map +1 -0
- package/lib/components/Fullscreen/FullscreenButton.d.ts +6 -0
- package/lib/components/Fullscreen/FullscreenButton.d.ts.map +1 -0
- package/lib/components/Fullscreen/FullscreenButton.js +33 -0
- package/lib/components/Fullscreen/FullscreenButton.js.map +1 -0
- package/lib/components/Fullscreen/index.d.ts +4 -0
- package/lib/components/Fullscreen/index.d.ts.map +1 -0
- package/lib/components/Fullscreen/index.js +4 -0
- package/lib/components/Fullscreen/index.js.map +1 -0
- package/lib/components/HTML/HTML.d.ts +1 -1
- package/lib/components/HTML/HTML.test-ids.d.ts +1 -1
- package/lib/components/HTML/HTML.test-ids.d.ts.map +1 -1
- package/lib/components/Icon/Icon.d.ts.map +1 -1
- package/lib/components/Icon/Icon.js +1 -1
- package/lib/components/Icon/Icon.js.map +1 -1
- package/lib/components/Icon/iconNames.d.ts +1 -1
- package/lib/components/Icon/iconNames.d.ts.map +1 -1
- package/lib/components/Icon/iconNames.js +2 -0
- package/lib/components/Icon/iconNames.js.map +1 -1
- package/lib/components/Icon/icons/calendar-now.icon.d.ts +5 -0
- package/lib/components/Icon/icons/calendar-now.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/calendar-now.icon.js +7 -0
- package/lib/components/Icon/icons/calendar-now.icon.js.map +1 -0
- package/lib/components/Icon/icons/preview.icon.d.ts +5 -0
- package/lib/components/Icon/icons/preview.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/preview.icon.js +7 -0
- package/lib/components/Icon/icons/preview.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/arrow-down.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-down.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-left.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-left.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-down.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-down.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-left.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-left.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-right.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-right.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-up.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-up.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-right.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-right.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-up.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-up.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/calendar-now.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/calendar-now.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/calendar-now.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/calendar-now.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/caret-down.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/caret-down.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/caret-left.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/caret-left.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/caret-right.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/caret-right.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/caret-up.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/caret-up.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/case-solid.icon.d.ts +1 -1
- package/lib/components/Icon/streamline-icons/case-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/case-solid.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/case-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/clipboard-pencil-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/clipboard-pencil-solid.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/clipboard-pencil-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/clock-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/clock-solid.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/clock-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/disc-stack-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/disc-stack-solid.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/disc-stack-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/dock.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/dock.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/dock.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/dock.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/drag.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/drag.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/expression.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/expression.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/expression.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/expression.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/indent.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/indent.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/indent.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/indent.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/information-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/information-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/information-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/information-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/list-number.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/list-number.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/list-number.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/list-number.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-down.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-down.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-down.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-down.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-left.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-left.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-left.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-left.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-right.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-right.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-right.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-right.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-up.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-up.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-up.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-up.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/minus.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/minus.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/minus.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/open.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/open.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/plus.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/plus.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/plus.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/rule-library-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/rule-library-solid.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/rule-library-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/search-analytics-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/search-analytics-solid.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/search-analytics-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/times.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/times.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/times.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/undock.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/undock.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/undock.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/undock.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/unindent.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/unindent.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/unindent.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/unindent.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/warn-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/warn-solid.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/warn-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamlineIconNames.d.ts +1 -1
- package/lib/components/Icon/streamlineIconNames.d.ts.map +1 -1
- package/lib/components/Icon/streamlineIconNames.js +12 -0
- package/lib/components/Icon/streamlineIconNames.js.map +1 -1
- package/lib/components/IconPicker/IconPicker.d.ts +7 -1
- package/lib/components/IconPicker/IconPicker.d.ts.map +1 -1
- package/lib/components/IconPicker/IconPicker.js +20 -14
- package/lib/components/IconPicker/IconPicker.js.map +1 -1
- package/lib/components/Input/Input.d.ts +5 -8
- package/lib/components/Input/Input.d.ts.map +1 -1
- package/lib/components/Input/Input.js +2 -3
- package/lib/components/Input/Input.js.map +1 -1
- package/lib/components/Input/Input.test-ids.d.ts +1 -1
- package/lib/components/Input/Input.test-ids.d.ts.map +1 -1
- package/lib/components/Label/Label.js +2 -2
- package/lib/components/Label/Label.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.js +21 -12
- package/lib/components/Lightbox/Lightbox.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.styles.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.test-ids.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.test-ids.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.types.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.types.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.types.js.map +1 -1
- package/lib/components/Link/Link.d.ts +5 -2
- package/lib/components/Link/Link.d.ts.map +1 -1
- package/lib/components/Link/Link.js +28 -16
- package/lib/components/Link/Link.js.map +1 -1
- package/lib/components/Link/Link.test-ids.d.ts +1 -1
- package/lib/components/Link/Link.test-ids.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.d.ts +1 -1
- package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.js +9 -8
- package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.js +6 -9
- package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts +1 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.js +4 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.d.ts +7 -3
- package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
- package/lib/components/ListToolbar/PresetMenuPopover.d.ts.map +1 -1
- package/lib/components/ListToolbar/PresetMenuPopover.js +2 -2
- package/lib/components/ListToolbar/PresetMenuPopover.js.map +1 -1
- package/lib/components/ListToolbar/helpers.d.ts.map +1 -1
- package/lib/components/ListToolbar/helpers.js.map +1 -1
- package/lib/components/Location/CurrentLocationButton.d.ts +1 -6
- package/lib/components/Location/CurrentLocationButton.d.ts.map +1 -1
- package/lib/components/Location/CurrentLocationButton.js +10 -20
- package/lib/components/Location/CurrentLocationButton.js.map +1 -1
- package/lib/components/Location/Location.test-ids.d.ts +1 -1
- package/lib/components/Location/Location.test-ids.d.ts.map +1 -1
- package/lib/components/Location/Location.types.d.ts +49 -17
- package/lib/components/Location/Location.types.d.ts.map +1 -1
- package/lib/components/Location/Location.types.js +9 -1
- package/lib/components/Location/Location.types.js.map +1 -1
- package/lib/components/Location/LocationDisplay.d.ts +5 -4
- package/lib/components/Location/LocationDisplay.d.ts.map +1 -1
- package/lib/components/Location/LocationDisplay.js +17 -4
- package/lib/components/Location/LocationDisplay.js.map +1 -1
- package/lib/components/Location/LocationInput.d.ts +23 -18
- package/lib/components/Location/LocationInput.d.ts.map +1 -1
- package/lib/components/Location/LocationInput.js +37 -15
- package/lib/components/Location/LocationInput.js.map +1 -1
- package/lib/components/Location/LocationView.d.ts +26 -12
- package/lib/components/Location/LocationView.d.ts.map +1 -1
- package/lib/components/Location/LocationView.js +103 -50
- package/lib/components/Location/LocationView.js.map +1 -1
- package/lib/components/Location/index.d.ts +2 -2
- package/lib/components/Location/index.d.ts.map +1 -1
- package/lib/components/Location/index.js +1 -1
- package/lib/components/Location/index.js.map +1 -1
- package/lib/components/Location/utils.d.ts +20 -2
- package/lib/components/Location/utils.d.ts.map +1 -1
- package/lib/components/Location/utils.js +184 -41
- package/lib/components/Location/utils.js.map +1 -1
- package/lib/components/Menu/Menu.context.d.ts.map +1 -1
- package/lib/components/Menu/Menu.context.js +1 -0
- package/lib/components/Menu/Menu.context.js.map +1 -1
- package/lib/components/Menu/Menu.d.ts +1 -1
- package/lib/components/Menu/Menu.d.ts.map +1 -1
- package/lib/components/Menu/Menu.js +6 -2
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/Menu.styles.d.ts +0 -1
- package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
- package/lib/components/Menu/Menu.styles.js +5 -12
- package/lib/components/Menu/Menu.styles.js.map +1 -1
- package/lib/components/Menu/Menu.test-ids.d.ts +2 -2
- package/lib/components/Menu/Menu.test-ids.d.ts.map +1 -1
- package/lib/components/Menu/Menu.types.d.ts +14 -2
- package/lib/components/Menu/Menu.types.d.ts.map +1 -1
- package/lib/components/Menu/Menu.types.js.map +1 -1
- package/lib/components/Menu/Menu.utils.d.ts +4 -0
- package/lib/components/Menu/Menu.utils.d.ts.map +1 -0
- package/lib/components/Menu/Menu.utils.js +6 -0
- package/lib/components/Menu/Menu.utils.js.map +1 -0
- package/lib/components/Menu/MenuGroup.js +2 -2
- package/lib/components/Menu/MenuGroup.js.map +1 -1
- package/lib/components/Menu/MenuItem.d.ts +1 -1
- package/lib/components/Menu/MenuItem.d.ts.map +1 -1
- package/lib/components/Menu/MenuItem.js +3 -3
- package/lib/components/Menu/MenuItem.js.map +1 -1
- package/lib/components/Menu/MenuList.d.ts.map +1 -1
- package/lib/components/Menu/MenuList.js +3 -3
- package/lib/components/Menu/MenuList.js.map +1 -1
- package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
- package/lib/components/Menu/NavItemsList.js +1 -3
- package/lib/components/Menu/NavItemsList.js.map +1 -1
- package/lib/components/Menu/index.d.ts +1 -0
- package/lib/components/Menu/index.d.ts.map +1 -1
- package/lib/components/Menu/index.js +1 -0
- package/lib/components/Menu/index.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.d.ts +8 -1
- package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +15 -5
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.test-ids.d.ts +1 -1
- package/lib/components/MenuButton/MenuButton.test-ids.d.ts.map +1 -1
- package/lib/components/MetaList/MetaList.d.ts +1 -1
- package/lib/components/MetaList/MetaList.test-ids.d.ts +1 -1
- package/lib/components/MetaList/MetaList.test-ids.d.ts.map +1 -1
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/Modal.js +10 -3
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/Modal.styles.d.ts.map +1 -1
- package/lib/components/Modal/Modal.styles.js +24 -3
- package/lib/components/Modal/Modal.styles.js.map +1 -1
- package/lib/components/Modal/ModalManager.d.ts.map +1 -1
- package/lib/components/Modal/ModalManager.js +5 -1
- package/lib/components/Modal/ModalManager.js.map +1 -1
- package/lib/components/Number/Number.test-ids.d.ts +2 -2
- package/lib/components/Number/Number.test-ids.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.d.ts +1 -1
- package/lib/components/Number/NumberInput.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.js +11 -3
- package/lib/components/Number/NumberInput.js.map +1 -1
- package/lib/components/Number/NumberRangeInput.d.ts +1 -1
- package/lib/components/Number/NumberRangeInput.d.ts.map +1 -1
- package/lib/components/Number/NumberRangeInput.js +5 -69
- package/lib/components/Number/NumberRangeInput.js.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.styles.d.ts +3 -1
- package/lib/components/PageTemplates/CategorySubPage.styles.d.ts.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.styles.js +3 -2
- package/lib/components/PageTemplates/CategorySubPage.styles.js.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.js +41 -6
- package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts +1 -0
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js +84 -31
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/Phone/Phone.test-ids.d.ts +1 -1
- package/lib/components/Phone/Phone.test-ids.d.ts.map +1 -1
- package/lib/components/Phone/PhoneDisplay.d.ts.map +1 -1
- package/lib/components/Phone/PhoneDisplay.js +2 -2
- package/lib/components/Phone/PhoneDisplay.js.map +1 -1
- package/lib/components/Phone/PhoneInput.d.ts +1 -1
- package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
- package/lib/components/Phone/PhoneInput.js +8 -3
- package/lib/components/Phone/PhoneInput.js.map +1 -1
- package/lib/components/Popover/Popover.d.ts +2 -0
- package/lib/components/Popover/Popover.d.ts.map +1 -1
- package/lib/components/Popover/Popover.js +20 -3
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
- package/lib/components/Popover/Popover.styles.js +2 -2
- package/lib/components/Popover/Popover.styles.js.map +1 -1
- package/lib/components/Popover/modifiers.d.ts.map +1 -1
- package/lib/components/Popover/modifiers.js +11 -5
- package/lib/components/Popover/modifiers.js.map +1 -1
- package/lib/components/Progress/Progress.d.ts.map +1 -1
- package/lib/components/Progress/Progress.js +2 -2
- package/lib/components/Progress/Progress.js.map +1 -1
- package/lib/components/Progress/Progress.styles.d.ts +1 -1
- package/lib/components/Progress/Progress.styles.d.ts.map +1 -1
- package/lib/components/Progress/Progress.styles.js +9 -9
- package/lib/components/Progress/Progress.styles.js.map +1 -1
- package/lib/components/Progress/Progress.types.d.ts +4 -0
- package/lib/components/Progress/Progress.types.d.ts.map +1 -1
- package/lib/components/Progress/Progress.types.js.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.d.ts +6 -30
- package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.js +3 -4
- package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts +19 -6
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.js +5 -1
- package/lib/components/SearchInput/SearchInput.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.styles.d.ts +3 -3
- package/lib/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.styles.js +15 -15
- package/lib/components/SearchInput/SearchInput.styles.js.map +1 -1
- package/lib/components/Select/Select.d.ts +1 -1
- package/lib/components/Select/Select.test-ids.d.ts +1 -1
- package/lib/components/Select/Select.test-ids.d.ts.map +1 -1
- package/lib/components/Slider/Slider.d.ts +1 -1
- package/lib/components/Slider/Slider.test-ids.d.ts +1 -1
- package/lib/components/Slider/Slider.test-ids.d.ts.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.d.ts +6 -1
- package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.js +13 -5
- package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.test-ids.d.ts +1 -1
- package/lib/components/SummaryItem/SummaryItem.test-ids.d.ts.map +1 -1
- package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
- package/lib/components/SummaryList/SummaryList.js +9 -9
- package/lib/components/SummaryList/SummaryList.js.map +1 -1
- package/lib/components/Switch/Switch.js +2 -2
- package/lib/components/Switch/Switch.js.map +1 -1
- package/lib/components/Tabs/Tab.d.ts +7 -3
- package/lib/components/Tabs/Tab.d.ts.map +1 -1
- package/lib/components/Tabs/Tab.js +83 -23
- package/lib/components/Tabs/Tab.js.map +1 -1
- package/lib/components/Tabs/TabPanel.d.ts +13 -2
- package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
- package/lib/components/Tabs/TabPanel.js +60 -5
- package/lib/components/Tabs/TabPanel.js.map +1 -1
- package/lib/components/Tabs/Tabs.d.ts +0 -1
- package/lib/components/Tabs/Tabs.d.ts.map +1 -1
- package/lib/components/Tabs/Tabs.js +97 -35
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/Tabs/Tabs.styles.d.ts +17 -0
- package/lib/components/Tabs/Tabs.styles.d.ts.map +1 -0
- package/lib/components/Tabs/Tabs.styles.js +110 -0
- package/lib/components/Tabs/Tabs.styles.js.map +1 -0
- package/lib/components/Tabs/TabsContext.d.ts +6 -0
- package/lib/components/Tabs/TabsContext.d.ts.map +1 -0
- package/lib/components/Tabs/TabsContext.js +6 -0
- package/lib/components/Tabs/TabsContext.js.map +1 -0
- package/lib/components/Tabs/index.d.ts +1 -0
- package/lib/components/Tabs/index.d.ts.map +1 -1
- package/lib/components/Tabs/index.js +1 -0
- package/lib/components/Tabs/index.js.map +1 -1
- package/lib/components/Text/Text.js +1 -1
- package/lib/components/Text/Text.js.map +1 -1
- package/lib/components/TextArea/TextArea.d.ts +1 -1
- package/lib/components/TextArea/TextArea.test-ids.d.ts +1 -1
- package/lib/components/TextArea/TextArea.test-ids.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.d.ts +1 -1
- package/lib/components/Toaster/Toaster.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.js +88 -19
- package/lib/components/Toaster/Toaster.js.map +1 -1
- package/lib/components/Toaster/Toaster.test-ids.d.ts +1 -1
- package/lib/components/Toaster/Toaster.test-ids.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.types.d.ts +17 -4
- package/lib/components/Toaster/Toaster.types.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.types.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.d.ts +3 -3
- package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +19 -4
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.test-ids.d.ts +1 -1
- package/lib/components/Tooltip/Tooltip.test-ids.d.ts.map +1 -1
- package/lib/components/Tree/StandardTree.styles.d.ts +1 -1
- package/lib/components/Tree/Tree.d.ts +1 -1
- package/lib/components/Tree/Tree.test-ids.d.ts +2 -2
- package/lib/components/Tree/Tree.test-ids.d.ts.map +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useArrows.d.ts.map +1 -1
- package/lib/hooks/useArrows.js +3 -1
- package/lib/hooks/useArrows.js.map +1 -1
- package/lib/hooks/useEvent.d.ts +5 -0
- package/lib/hooks/useEvent.d.ts.map +1 -1
- package/lib/hooks/useEvent.js.map +1 -1
- package/lib/hooks/useFocusWithin.d.ts.map +1 -1
- package/lib/hooks/useFocusWithin.js +14 -8
- package/lib/hooks/useFocusWithin.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +146 -3
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useScrollStick.d.ts +3 -3
- package/lib/hooks/useScrollStick.d.ts.map +1 -1
- package/lib/hooks/useScrollStick.js +6 -5
- package/lib/hooks/useScrollStick.js.map +1 -1
- package/lib/hooks/useScrollToggle.d.ts.map +1 -1
- package/lib/hooks/useScrollToggle.js +1 -0
- package/lib/hooks/useScrollToggle.js.map +1 -1
- package/lib/hooks/useSimpleStoreInstance.d.ts +9 -0
- package/lib/hooks/useSimpleStoreInstance.d.ts.map +1 -0
- package/lib/hooks/useSimpleStoreInstance.js +13 -0
- package/lib/hooks/useSimpleStoreInstance.js.map +1 -0
- package/lib/hooks/useTestIds.d.ts +1 -1
- package/lib/hooks/useTestIds.d.ts.map +1 -1
- package/lib/hooks/useTestIds.js +1 -1
- package/lib/hooks/useTestIds.js.map +1 -1
- package/lib/i18n/default.d.ts +146 -3
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +169 -11
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +146 -3
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/styles/GlobalStyle.d.ts +1 -1
- package/lib/styles/GlobalStyle.d.ts.map +1 -1
- package/lib/styles/GlobalStyle.js +6 -1
- package/lib/styles/GlobalStyle.js.map +1 -1
- package/lib/styles/mixins.d.ts +3 -0
- package/lib/styles/mixins.d.ts.map +1 -0
- package/lib/styles/mixins.js +14 -0
- package/lib/styles/mixins.js.map +1 -0
- package/lib/styles/utils.d.ts +11 -5
- package/lib/styles/utils.d.ts.map +1 -1
- package/lib/styles/utils.js +28 -12
- package/lib/styles/utils.js.map +1 -1
- package/lib/theme/ThemeMachine.d.ts.map +1 -1
- package/lib/theme/ThemeMachine.js.map +1 -1
- package/lib/theme/theme.d.ts +18 -0
- package/lib/theme/theme.d.ts.map +1 -1
- package/lib/theme/themeDefinition.json +9 -2
- package/lib/theme/themeOverrides.schema.json +13 -0
- package/lib/types/types.d.ts +4 -2
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/types.js.map +1 -1
- package/lib/utils/formatListToLocaleString.d.ts.map +1 -1
- package/lib/utils/formatListToLocaleString.js +5 -2
- package/lib/utils/formatListToLocaleString.js.map +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/isPositionWithinRect.d.ts +12 -0
- package/lib/utils/isPositionWithinRect.d.ts.map +1 -0
- package/lib/utils/isPositionWithinRect.js +11 -0
- package/lib/utils/isPositionWithinRect.js.map +1 -0
- package/lib/utils/withTestIds.d.ts +1 -1
- package/package.json +9 -6
- package/lib/components/Location/types.d.ts +0 -45
- package/lib/components/Location/types.d.ts.map +0 -1
- package/lib/components/Location/types.js +0 -10
- package/lib/components/Location/types.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useRef, useEffect, forwardRef } from 'react';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
|
-
import { meetsContrastGuidelines, mix
|
|
4
|
+
import { meetsContrastGuidelines, mix } from 'polished';
|
|
5
5
|
import { defaultThemeProp } from '../../theme';
|
|
6
|
-
import { tryCatch } from '../../utils';
|
|
7
|
-
import { getHoverColors, omitProps, readableHue } from '../../styles';
|
|
6
|
+
import { isPositionWithinRect, tryCatch } from '../../utils';
|
|
7
|
+
import { getActiveColors, getHoverColors, omitProps, readableColor, readableHue } from '../../styles';
|
|
8
8
|
import { useElement, useConsolidatedRef } from '../../hooks';
|
|
9
9
|
import Tooltip from '../Tooltip';
|
|
10
10
|
import Progress, { StyledProgressRing } from '../Progress';
|
|
@@ -16,7 +16,7 @@ const baseStyles = (theme) => {
|
|
|
16
16
|
return css `
|
|
17
17
|
outline: none;
|
|
18
18
|
text-decoration: none;
|
|
19
|
-
transition-property: background-color, color, box-shadow;
|
|
19
|
+
transition-property: background-color, color, border-color, box-shadow, translate;
|
|
20
20
|
transition-duration: calc(0.5 * ${speed});
|
|
21
21
|
transition-timing-function: ${ease};
|
|
22
22
|
cursor: pointer;
|
|
@@ -43,9 +43,26 @@ const baseStyles = (theme) => {
|
|
|
43
43
|
}
|
|
44
44
|
`;
|
|
45
45
|
};
|
|
46
|
+
const getFilledButtonStyles = (color) => ({
|
|
47
|
+
contrastColor: tryCatch(() => readableColor(color)),
|
|
48
|
+
hoverColors: getHoverColors(color),
|
|
49
|
+
activeColors: getActiveColors(color)
|
|
50
|
+
});
|
|
51
|
+
const getOutlinedButtonStyles = (color, backgroundColor) => {
|
|
52
|
+
const backgroundUsable = meetsContrastGuidelines(color, backgroundColor).AA;
|
|
53
|
+
const usableColor = backgroundUsable ? color : readableHue(color, backgroundColor);
|
|
54
|
+
const hoverBackgroundColor = tryCatch(() => mix(0.9, backgroundColor, color));
|
|
55
|
+
const activeBackgroundColor = tryCatch(() => mix(0.8, backgroundColor, usableColor));
|
|
56
|
+
return {
|
|
57
|
+
textColor: backgroundUsable ? color : readableColor(color),
|
|
58
|
+
hoverBg: hoverBackgroundColor,
|
|
59
|
+
hoverFg: readableHue(color, hoverBackgroundColor ?? 'transparent'),
|
|
60
|
+
activeBg: tryCatch(() => mix(0.8, backgroundColor, usableColor)),
|
|
61
|
+
activeFg: readableHue(usableColor, activeBackgroundColor ?? 'transparent')
|
|
62
|
+
};
|
|
63
|
+
};
|
|
46
64
|
export const StyledButton = styled.button.withConfig(omitProps('loading'))(({ variant, icon, loading, compact, theme }) => {
|
|
47
|
-
const { base: { spacing, 'border-radius': baseBorderRadius, palette: { 'primary-background': backgroundColor }, 'hit-area': { 'mouse-min': hitAreaMouse, 'finger-min': hitAreaFinger, 'compact-min': hitAreaCompact }, animation: { speed } }, components: { button: { color, 'secondary-color': secondaryColor, padding, 'border-radius': borderRadius, 'border-width': borderWidth, touch: { padding: touchPadding } } } } = theme;
|
|
48
|
-
const contrastColor = tryCatch(() => readableColor(color));
|
|
65
|
+
const { base: { spacing, 'border-radius': baseBorderRadius, palette: { 'primary-background': backgroundColor }, 'hit-area': { 'mouse-min': hitAreaMouse, 'finger-min': hitAreaFinger, 'compact-min': hitAreaCompact }, animation: { speed, timing: { ease } } }, components: { button: { color, 'secondary-color': secondaryColor, 'secondary-fill-style': fillStyle, padding, 'border-radius': borderRadius, 'border-width': borderWidth, touch: { padding: touchPadding } } } } = theme;
|
|
49
66
|
// Base
|
|
50
67
|
const base = baseStyles(theme);
|
|
51
68
|
// Non-text base
|
|
@@ -95,48 +112,70 @@ export const StyledButton = styled.button.withConfig(omitProps('loading'))(({ va
|
|
|
95
112
|
padding: ${touchPadding};
|
|
96
113
|
`}
|
|
97
114
|
}
|
|
115
|
+
|
|
116
|
+
&:active {
|
|
117
|
+
translate: 0 0.0625rem;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&::after {
|
|
121
|
+
content: '';
|
|
122
|
+
position: absolute;
|
|
123
|
+
inset: calc(-1 * ${borderWidth});
|
|
124
|
+
border-radius: calc(${baseBorderRadius} * ${borderRadius});
|
|
125
|
+
transition: translate calc(0.5 * ${speed}) ${ease};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&:active::after {
|
|
129
|
+
translate: 0 -0.0625rem;
|
|
130
|
+
}
|
|
98
131
|
`;
|
|
99
|
-
// Primary
|
|
100
|
-
const hoverColors =
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
const primary = css `
|
|
104
|
-
--button-background-color: ${color};
|
|
132
|
+
// Primary and Secondary-filled
|
|
133
|
+
const { contrastColor, hoverColors, activeColors } = getFilledButtonStyles(variant === 'primary' ? color : secondaryColor);
|
|
134
|
+
const solidButtonStyles = css `
|
|
135
|
+
--button-background-color: ${variant === 'primary' ? color : secondaryColor};
|
|
105
136
|
color: ${contrastColor};
|
|
106
|
-
background-color: ${color};
|
|
137
|
+
background-color: ${variant === 'primary' ? color : secondaryColor};
|
|
107
138
|
|
|
108
139
|
@media (hover: hover) {
|
|
109
140
|
&:hover {
|
|
110
|
-
background-color: ${
|
|
111
|
-
color: ${hoverContrastColor};
|
|
141
|
+
background-color: ${hoverColors.background};
|
|
112
142
|
text-decoration: none;
|
|
113
143
|
}
|
|
114
144
|
}
|
|
145
|
+
|
|
146
|
+
&:active {
|
|
147
|
+
background-color: ${activeColors.background};
|
|
148
|
+
color: ${activeColors.foreground};
|
|
149
|
+
text-decoration: none;
|
|
150
|
+
}
|
|
115
151
|
`;
|
|
116
|
-
// Secondary
|
|
117
|
-
const
|
|
118
|
-
const usableColor = backgroundUsable ? color : readableHue(color, secondaryColor);
|
|
119
|
-
const secondaryHoverBackgroundColor = tryCatch(() => mix(0.85, secondaryColor, usableColor));
|
|
120
|
-
const secondaryHoverForegroundColor = readableHue(usableColor, secondaryHoverBackgroundColor ?? 'transparent');
|
|
152
|
+
// Secondary-outline
|
|
153
|
+
const secondaryOutlineButtonStyles = getOutlinedButtonStyles(secondaryColor, backgroundColor);
|
|
121
154
|
const secondary = css `
|
|
122
|
-
--button-background-color: ${
|
|
123
|
-
color: ${
|
|
124
|
-
background-color: ${
|
|
125
|
-
border-color: ${
|
|
155
|
+
--button-background-color: ${backgroundColor};
|
|
156
|
+
color: ${secondaryOutlineButtonStyles.textColor};
|
|
157
|
+
background-color: ${backgroundColor};
|
|
158
|
+
border-color: ${secondaryColor};
|
|
126
159
|
|
|
127
160
|
@media (hover: hover) {
|
|
128
161
|
&:hover {
|
|
129
|
-
color: ${
|
|
130
|
-
background-color: ${secondaryHoverBackgroundColor};
|
|
162
|
+
background-color: ${secondaryOutlineButtonStyles.hoverBg};
|
|
131
163
|
text-decoration: none;
|
|
132
|
-
border-color: ${secondaryHoverForegroundColor};
|
|
133
164
|
}
|
|
134
165
|
}
|
|
166
|
+
|
|
167
|
+
&:active {
|
|
168
|
+
color: ${secondaryOutlineButtonStyles.activeFg};
|
|
169
|
+
background-color: ${secondaryOutlineButtonStyles.activeBg};
|
|
170
|
+
border-color: ${secondaryOutlineButtonStyles.activeFg};
|
|
171
|
+
text-decoration: none;
|
|
172
|
+
}
|
|
135
173
|
`;
|
|
136
174
|
// Simple
|
|
175
|
+
const simpleButtonStyles = getOutlinedButtonStyles(fillStyle === 'outline' ? secondaryColor : color, backgroundColor);
|
|
137
176
|
const simple = css `
|
|
138
177
|
--button-background-color: ${icon ? 'transparent' : backgroundColor};
|
|
139
|
-
color: ${icon ? 'currentColor' :
|
|
178
|
+
color: ${icon ? 'currentColor' : simpleButtonStyles.textColor};
|
|
140
179
|
background-color: ${icon ? 'transparent' : backgroundColor};
|
|
141
180
|
|
|
142
181
|
@media (hover: hover) {
|
|
@@ -152,15 +191,40 @@ export const StyledButton = styled.button.withConfig(omitProps('loading'))(({ va
|
|
|
152
191
|
right: calc(${borderWidth} * -1);
|
|
153
192
|
border-radius: inherit;
|
|
154
193
|
background-color: currentColor;
|
|
155
|
-
opacity: 0.
|
|
194
|
+
opacity: 0.1;
|
|
156
195
|
}
|
|
157
196
|
`}
|
|
158
197
|
|
|
159
198
|
${!icon &&
|
|
160
199
|
css `
|
|
161
|
-
background-color: ${
|
|
162
|
-
color: ${
|
|
163
|
-
border-color: ${
|
|
200
|
+
background-color: ${simpleButtonStyles.hoverBg};
|
|
201
|
+
color: ${simpleButtonStyles.hoverFg};
|
|
202
|
+
border-color: ${simpleButtonStyles.hoverFg};
|
|
203
|
+
text-decoration: none;
|
|
204
|
+
`}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
&:active {
|
|
208
|
+
${icon &&
|
|
209
|
+
css `
|
|
210
|
+
::before {
|
|
211
|
+
content: '';
|
|
212
|
+
position: absolute;
|
|
213
|
+
top: calc(${borderWidth} * -1);
|
|
214
|
+
bottom: calc(${borderWidth} * -1);
|
|
215
|
+
left: calc(${borderWidth} * -1);
|
|
216
|
+
right: calc(${borderWidth} * -1);
|
|
217
|
+
border-radius: inherit;
|
|
218
|
+
background-color: currentColor;
|
|
219
|
+
opacity: 0.2;
|
|
220
|
+
}
|
|
221
|
+
`}
|
|
222
|
+
|
|
223
|
+
${!icon &&
|
|
224
|
+
css `
|
|
225
|
+
background-color: ${simpleButtonStyles.activeBg};
|
|
226
|
+
color: ${simpleButtonStyles.activeFg};
|
|
227
|
+
border-color: ${simpleButtonStyles.activeFg};
|
|
164
228
|
text-decoration: none;
|
|
165
229
|
`}
|
|
166
230
|
}
|
|
@@ -169,8 +233,9 @@ export const StyledButton = styled.button.withConfig(omitProps('loading'))(({ va
|
|
|
169
233
|
return css `
|
|
170
234
|
${base}
|
|
171
235
|
${nonTextual}
|
|
172
|
-
${variant === 'primary' &&
|
|
173
|
-
|
|
236
|
+
${(variant === 'primary' || (variant === 'secondary' && fillStyle === 'fill')) &&
|
|
237
|
+
solidButtonStyles}
|
|
238
|
+
${variant === 'secondary' && fillStyle === 'outline' && secondary}
|
|
174
239
|
${variant === 'simple' && simple}
|
|
175
240
|
|
|
176
241
|
${loading &&
|
|
@@ -201,54 +266,78 @@ export const StyledButtonLink = styled.a.withConfig(omitProps('loading'))(({ the
|
|
|
201
266
|
const { base: { palette: { 'foreground-color': textColor } }, components: { link: { color: linkColor } } } = theme;
|
|
202
267
|
const base = baseStyles(theme);
|
|
203
268
|
const textual = css `
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
269
|
+
background-color: transparent;
|
|
270
|
+
display: inline;
|
|
271
|
+
text-align: start;
|
|
272
|
+
border: none;
|
|
208
273
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
274
|
+
@media (hover: hover) {
|
|
275
|
+
&:hover {
|
|
276
|
+
text-decoration: underline;
|
|
213
277
|
}
|
|
278
|
+
}
|
|
214
279
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
280
|
+
> ${StyledIcon} {
|
|
281
|
+
vertical-align: bottom;
|
|
282
|
+
}
|
|
283
|
+
`;
|
|
284
|
+
const { background: activeColor } = getActiveColors(linkColor);
|
|
219
285
|
const link = css `
|
|
220
|
-
|
|
221
|
-
|
|
286
|
+
color: ${linkColor};
|
|
287
|
+
|
|
288
|
+
&:active {
|
|
289
|
+
color: ${activeColor};
|
|
290
|
+
}
|
|
291
|
+
`;
|
|
222
292
|
const text = css `
|
|
223
|
-
|
|
224
|
-
|
|
293
|
+
color: ${textColor};
|
|
294
|
+
`;
|
|
225
295
|
return css `
|
|
226
|
-
|
|
227
|
-
|
|
296
|
+
${base}
|
|
297
|
+
${textual}
|
|
228
298
|
${variant === 'link' && link}
|
|
229
299
|
${variant === 'text' && text}
|
|
230
|
-
|
|
300
|
+
`;
|
|
231
301
|
});
|
|
232
302
|
StyledButtonLink.defaultProps = defaultThemeProp;
|
|
233
303
|
const Button = forwardRef(function Button({ variant = 'secondary', type = 'button', disabled = false, icon = false, compact = false, href, as, forwardedAs, label, 'aria-label': ariaLabel, loading = false, children, ...restProps }, ref) {
|
|
234
304
|
const [buttonEl, setButtonEl] = useElement();
|
|
235
305
|
const mouseDownEvent = useRef();
|
|
306
|
+
const mouseDownPosition = useRef();
|
|
307
|
+
const mouseDownTimestamp = useRef();
|
|
236
308
|
const buttonRef = useConsolidatedRef(ref, setButtonEl);
|
|
237
309
|
const isTextual = ['link', 'text'].includes(variant);
|
|
238
310
|
const showProgress = loading && !isTextual;
|
|
239
311
|
const StyledComp = isTextual ? StyledButtonLink : StyledButton;
|
|
312
|
+
const handleClickWithElementShift = (e) => {
|
|
313
|
+
if (buttonRef.current &&
|
|
314
|
+
mouseDownPosition.current &&
|
|
315
|
+
mouseDownTimestamp.current &&
|
|
316
|
+
isPositionWithinRect({ x: e.clientX, y: e.clientY }, mouseDownPosition.current) &&
|
|
317
|
+
Date.now() - mouseDownTimestamp.current < 500) {
|
|
318
|
+
buttonRef.current.click();
|
|
319
|
+
}
|
|
320
|
+
};
|
|
240
321
|
useEffect(() => {
|
|
322
|
+
document.addEventListener('mouseup', handleClickWithElementShift);
|
|
241
323
|
return () => {
|
|
324
|
+
document.removeEventListener('mouseup', handleClickWithElementShift);
|
|
242
325
|
mouseDownEvent.current = undefined;
|
|
326
|
+
mouseDownPosition.current = undefined;
|
|
327
|
+
mouseDownTimestamp.current = undefined;
|
|
243
328
|
};
|
|
244
329
|
}, []);
|
|
245
330
|
return (_jsxs(_Fragment, { children: [_jsxs(StyledComp, { ...restProps, ref: buttonRef, as: as || (href ? 'a' : 'button'), forwardedAs: forwardedAs || (href ? 'a' : 'button'), variant: variant, icon: icon, compact: compact, type: href ? undefined : type, href: href, disabled: disabled && !href, loading: showProgress, "aria-label": ariaLabel || label, onMouseDown: (e) => {
|
|
246
331
|
restProps.onMouseDown?.(e);
|
|
247
332
|
e.persist();
|
|
248
333
|
mouseDownEvent.current = e;
|
|
334
|
+
mouseDownPosition.current = e.currentTarget.getBoundingClientRect();
|
|
335
|
+
mouseDownTimestamp.current = Date.now();
|
|
249
336
|
}, onMouseUp: (e) => {
|
|
250
337
|
const shouldFocus = mouseDownEvent.current && !mouseDownEvent.current.defaultPrevented;
|
|
251
338
|
mouseDownEvent.current = undefined;
|
|
339
|
+
mouseDownPosition.current = undefined;
|
|
340
|
+
mouseDownTimestamp.current = undefined;
|
|
252
341
|
if (shouldFocus && buttonRef.current !== document.activeElement) {
|
|
253
342
|
buttonRef.current?.focus();
|
|
254
343
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAStD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,uBAAuB,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,QAAQ,EAAE,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAkD3C,MAAM,UAAU,GAAG,CAAC,KAAmB,EAAE,EAAE;IACzC,MAAM,EACJ,IAAI,EAAE,EACJ,OAAO,EACP,SAAS,EAAE,EACT,KAAK,EACL,MAAM,EAAE,EAAE,IAAI,EAAE,EACjB,EACD,kBAAkB,EAAE,eAAe,EACpC,EACD,UAAU,EAAE,EACV,MAAM,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE,EACxC,EACF,GAAG,KAAK,CAAC;IAEV,OAAO,GAAG,CAAA;;;;sCAI0B,KAAK;kCACT,IAAI;;;;6BAIT,OAAO;;;;UAI1B,aAAa;6BACM,OAAO;;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YAC/E,KAAK,GACE,CACX,IACA,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC","sourcesContent":["import { useRef, useEffect, forwardRef } from 'react';\nimport type {\n FunctionComponent,\n ReactNode,\n PropsWithoutRef,\n Ref,\n MouseEvent,\n MouseEventHandler\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\nimport { meetsContrastGuidelines, mix, readableColor } from 'polished';\n\nimport type { BaseProps, ForwardProps, PropsWithDefaults, AsProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport { tryCatch } from '../../utils';\nimport { getHoverColors, omitProps, readableHue } from '../../styles';\nimport { useElement, useConsolidatedRef } from '../../hooks';\nimport Tooltip from '../Tooltip';\nimport Progress, { StyledProgressRing } from '../Progress';\nimport { StyledBackdrop } from '../Backdrop';\nimport { StyledIcon } from '../Icon';\nimport { StyledPopover } from '../Popover';\n\nexport interface ButtonProps extends BaseProps, AsProp {\n /** Text or content for the Button. */\n children: ReactNode;\n /**\n * Determines if the Button will be disabled.\n * @default false\n */\n disabled?: boolean;\n /** A location to navigate to. Passing an href will render an anchor styled as a Button. */\n href?: string;\n /**\n * Controls the styling of the Button.\n * @default 'secondary'\n */\n variant?: 'primary' | 'secondary' | 'simple' | 'link' | 'text';\n /**\n * Controls the behavior of a Button within a Form.\n * @default 'button'\n */\n type?: 'button' | 'reset' | 'submit';\n /**\n * Set the Icon prop to `true` if you're using just an Icon in your Button. Make sure to pass an Icon as children if `true`.\n * @default false\n */\n icon?: boolean;\n /**\n * Used for a smaller sized button.\n * @default false\n */\n compact?: boolean;\n /** The label text will be used inside a Tooltip. */\n label?: string;\n /** The aria label text will be inserted as the aria-label on the Button. */\n 'aria-label'?: string;\n /**\n * Optionally renders an indeterminate progress indicator in a button.\n * @default false\n */\n loading?: boolean;\n /** Ref forwarded to the wrapping element. */\n ref?: Ref<HTMLButtonElement>;\n}\n\ntype ButtonPropsWithDefaults = PropsWithDefaults<\n ButtonProps,\n 'variant' | 'type' | 'disabled' | 'icon' | 'loading'\n>;\n\nconst baseStyles = (theme: DefaultTheme) => {\n const {\n base: {\n spacing,\n animation: {\n speed,\n timing: { ease }\n },\n 'disabled-opacity': disabledOpacity\n },\n components: {\n button: { 'focus-shadow': focusShadow }\n }\n } = theme;\n\n return css`\n outline: none;\n text-decoration: none;\n transition-property: background-color, color, box-shadow;\n transition-duration: calc(0.5 * ${speed});\n transition-timing-function: ${ease};\n cursor: pointer;\n\n & + & {\n margin-inline-start: ${spacing};\n }\n\n /* Not able to combine with selector above. Stylis bug? */\n & + ${StyledPopover} + & {\n margin-inline-start: ${spacing};\n }\n\n &:disabled,\n &[disabled] {\n opacity: ${disabledOpacity};\n cursor: not-allowed;\n pointer-events: none;\n }\n\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: ${focusShadow};\n }\n `;\n};\n\nexport const StyledButton = styled.button.withConfig<ButtonPropsWithDefaults>(omitProps('loading'))(\n ({ variant, icon, loading, compact, theme }) => {\n const {\n base: {\n spacing,\n 'border-radius': baseBorderRadius,\n palette: { 'primary-background': backgroundColor },\n 'hit-area': {\n 'mouse-min': hitAreaMouse,\n 'finger-min': hitAreaFinger,\n 'compact-min': hitAreaCompact\n },\n animation: { speed }\n },\n components: {\n button: {\n color,\n 'secondary-color': secondaryColor,\n padding,\n 'border-radius': borderRadius,\n 'border-width': borderWidth,\n touch: { padding: touchPadding }\n }\n }\n } = theme;\n const contrastColor = tryCatch(() => readableColor(color));\n\n // Base\n const base = baseStyles(theme);\n\n // Non-text base\n const nonTextual = css`\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-height: ${hitAreaMouse};\n min-width: ${hitAreaMouse};\n border: ${borderWidth} solid transparent;\n border-radius: calc(${baseBorderRadius} * ${borderRadius});\n -webkit-user-select: none;\n user-select: none;\n\n ${!icon &&\n css`\n padding: ${padding};\n `}\n\n ${icon &&\n css`\n border-radius: calc(${baseBorderRadius} * ${borderRadius});\n\n > svg {\n display: block;\n }\n `}\n\n ${compact &&\n css`\n min-height: ${hitAreaCompact};\n min-width: ${hitAreaCompact};\n `}\n\n @media (pointer: coarse) {\n border-radius: calc(${baseBorderRadius} * ${borderRadius});\n\n ${!compact &&\n css`\n min-height: ${hitAreaFinger};\n min-width: ${hitAreaFinger};\n `}\n\n ${!icon &&\n css`\n padding: ${touchPadding};\n `}\n }\n `;\n\n // Primary\n const hoverColors = getHoverColors(color);\n const hoverPrimaryColor = hoverColors.background;\n const hoverContrastColor = hoverColors.foreground;\n const primary = css`\n --button-background-color: ${color};\n color: ${contrastColor};\n background-color: ${color};\n\n @media (hover: hover) {\n &:hover {\n background-color: ${hoverPrimaryColor};\n color: ${hoverContrastColor};\n text-decoration: none;\n }\n }\n `;\n\n // Secondary\n const backgroundUsable = meetsContrastGuidelines(color, secondaryColor).AA;\n const usableColor = backgroundUsable ? color : readableHue(color, secondaryColor);\n const secondaryHoverBackgroundColor = tryCatch(() => mix(0.85, secondaryColor, usableColor));\n const secondaryHoverForegroundColor = readableHue(\n usableColor,\n secondaryHoverBackgroundColor ?? 'transparent'\n );\n const secondary = css`\n --button-background-color: ${secondaryColor};\n color: ${usableColor};\n background-color: ${secondaryColor};\n border-color: ${usableColor};\n\n @media (hover: hover) {\n &:hover {\n color: ${secondaryHoverForegroundColor};\n background-color: ${secondaryHoverBackgroundColor};\n text-decoration: none;\n border-color: ${secondaryHoverForegroundColor};\n }\n }\n `;\n\n // Simple\n const simple = css`\n --button-background-color: ${icon ? 'transparent' : backgroundColor};\n color: ${icon ? 'currentColor' : usableColor};\n background-color: ${icon ? 'transparent' : backgroundColor};\n\n @media (hover: hover) {\n &:hover {\n ${icon &&\n css`\n ::before {\n content: '';\n position: absolute;\n top: calc(${borderWidth} * -1);\n bottom: calc(${borderWidth} * -1);\n left: calc(${borderWidth} * -1);\n right: calc(${borderWidth} * -1);\n border-radius: inherit;\n background-color: currentColor;\n opacity: 0.15;\n }\n `}\n\n ${!icon &&\n css`\n background-color: ${secondaryHoverBackgroundColor};\n color: ${secondaryHoverForegroundColor};\n border-color: ${secondaryHoverForegroundColor};\n text-decoration: none;\n `}\n }\n }\n `;\n\n return css`\n ${base}\n ${nonTextual}\n ${variant === 'primary' && primary}\n ${variant === 'secondary' && secondary}\n ${variant === 'simple' && simple}\n\n ${loading &&\n css`\n ${StyledBackdrop} {\n background-color: var(--button-background-color);\n border-radius: inherit;\n }\n\n ${StyledProgressRing} {\n width: 1em;\n height: 1em;\n\n ${!icon &&\n css`\n margin-inline-end: calc(${spacing} / 2);\n `}\n\n circle:nth-child(2) {\n animation-duration: calc(${speed} * 2);\n }\n }\n `}\n `;\n }\n);\n\nStyledButton.defaultProps = defaultThemeProp;\n\nexport const StyledButtonLink = styled.a.withConfig<ButtonPropsWithDefaults>(omitProps('loading'))(\n ({ theme, variant }) => {\n const {\n base: {\n palette: { 'foreground-color': textColor }\n },\n components: {\n link: { color: linkColor }\n }\n } = theme;\n\n const base = baseStyles(theme);\n\n const textual = css`\n background-color: transparent;\n display: inline;\n text-align: start;\n border: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n > ${StyledIcon} {\n vertical-align: bottom;\n }\n `;\n\n const link = css`\n color: ${linkColor};\n `;\n\n const text = css`\n color: ${textColor};\n `;\n\n return css`\n ${base}\n ${textual}\n ${variant === 'link' && link}\n ${variant === 'text' && text}\n `;\n }\n);\n\nStyledButtonLink.defaultProps = defaultThemeProp;\n\nconst Button: FunctionComponent<ButtonProps & ForwardProps> = forwardRef(function Button(\n {\n variant = 'secondary',\n type = 'button',\n disabled = false,\n icon = false,\n compact = false,\n href,\n as,\n forwardedAs,\n label,\n 'aria-label': ariaLabel,\n loading = false,\n children,\n ...restProps\n }: PropsWithoutRef<ButtonProps> & ForwardProps,\n ref: Ref<HTMLButtonElement>\n) {\n const [buttonEl, setButtonEl] = useElement();\n const mouseDownEvent = useRef<MouseEvent>();\n const buttonRef = useConsolidatedRef<HTMLButtonElement>(ref, setButtonEl);\n const isTextual = ['link', 'text'].includes(variant);\n const showProgress = loading && !isTextual;\n const StyledComp: React.ElementType = isTextual ? StyledButtonLink : StyledButton;\n\n useEffect(() => {\n return () => {\n mouseDownEvent.current = undefined;\n };\n }, []);\n\n return (\n <>\n <StyledComp\n {...restProps}\n ref={buttonRef}\n as={as || (href ? 'a' : 'button')}\n forwardedAs={forwardedAs || (href ? 'a' : 'button')}\n variant={variant}\n icon={icon}\n compact={compact}\n type={href ? undefined : type}\n href={href}\n disabled={disabled && !href}\n loading={showProgress}\n aria-label={ariaLabel || label}\n onMouseDown={(e: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n (restProps.onMouseDown as MouseEventHandler | undefined)?.(e);\n e.persist();\n mouseDownEvent.current = e;\n }}\n onMouseUp={(e: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n const shouldFocus = mouseDownEvent.current && !mouseDownEvent.current.defaultPrevented;\n mouseDownEvent.current = undefined;\n\n if (shouldFocus && buttonRef.current !== document.activeElement) {\n buttonRef.current?.focus();\n }\n\n return (restProps.onMouseUp as MouseEventHandler | undefined)?.(e);\n }}\n >\n {showProgress && <Progress variant='ring' placement='inline' />}\n {!icon || !showProgress ? children : null}\n </StyledComp>\n\n {buttonEl && label && (\n <Tooltip target={buttonEl} showDelay='none' hideDelay='none' describeTarget={false}>\n {label}\n </Tooltip>\n )}\n </>\n );\n});\n\nexport default Button;\n"]}
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAStD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,uBAAuB,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAGxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;A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unctionComponent,\n ReactNode,\n PropsWithoutRef,\n Ref,\n MouseEventHandler,\n MouseEvent as ReactMouseEvent\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\nimport { meetsContrastGuidelines, mix } from 'polished';\n\nimport type { BaseProps, ForwardProps, PropsWithDefaults, AsProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport { isPositionWithinRect, tryCatch } from '../../utils';\nimport {\n getActiveColors,\n getHoverColors,\n omitProps,\n readableColor,\n readableHue\n} from '../../styles';\nimport { useElement, useConsolidatedRef } from '../../hooks';\nimport Tooltip from '../Tooltip';\nimport Progress, { StyledProgressRing } from '../Progress';\nimport { StyledBackdrop } from '../Backdrop';\nimport { StyledIcon } from '../Icon';\nimport { StyledPopover } from '../Popover';\n\nexport interface ButtonProps extends BaseProps, AsProp {\n /** Text or content for the Button. */\n children: ReactNode;\n /**\n * Determines if the Button will be disabled.\n * @default false\n */\n disabled?: boolean;\n /** A location to navigate to. Passing an href will render an anchor styled as a Button. */\n href?: string;\n /**\n * Controls the styling of the Button.\n * @default 'secondary'\n */\n variant?: 'primary' | 'secondary' | 'simple' | 'link' | 'text';\n /**\n * Controls the behavior of a Button within a Form.\n * @default 'button'\n */\n type?: 'button' | 'reset' | 'submit';\n /**\n * Set the Icon prop to `true` if you're using just an Icon in your Button. Make sure to pass an Icon as children if `true`.\n * @default false\n */\n icon?: boolean;\n /**\n * Used for a smaller sized button.\n * @default false\n */\n compact?: boolean;\n /** The label text will be used inside a Tooltip. */\n label?: string;\n /** The aria label text will be inserted as the aria-label on the Button. */\n 'aria-label'?: string;\n /**\n * Optionally renders an indeterminate progress indicator in a button.\n * @default false\n */\n loading?: boolean;\n /** Ref forwarded to the wrapping element. */\n ref?: Ref<HTMLButtonElement>;\n}\n\ntype ButtonPropsWithDefaults = PropsWithDefaults<\n ButtonProps,\n 'variant' | 'type' | 'disabled' | 'icon' | 'loading'\n>;\n\nconst baseStyles = (theme: DefaultTheme) => {\n const {\n base: {\n spacing,\n animation: {\n speed,\n timing: { ease }\n },\n 'disabled-opacity': disabledOpacity\n },\n components: {\n button: { 'focus-shadow': focusShadow }\n }\n } = theme;\n\n return css`\n outline: none;\n text-decoration: none;\n transition-property: background-color, color, border-color, box-shadow, translate;\n transition-duration: calc(0.5 * ${speed});\n transition-timing-function: ${ease};\n cursor: pointer;\n\n & + & {\n margin-inline-start: ${spacing};\n }\n\n /* Not able to combine with selector above. Stylis bug? */\n & + ${StyledPopover} + & {\n margin-inline-start: ${spacing};\n }\n\n &:disabled,\n &[disabled] {\n opacity: ${disabledOpacity};\n cursor: not-allowed;\n pointer-events: none;\n }\n\n &:enabled:focus,\n &:not([disabled]):focus {\n box-shadow: ${focusShadow};\n }\n `;\n};\n\nconst getFilledButtonStyles = (color: string) => ({\n contrastColor: tryCatch(() => readableColor(color)),\n hoverColors: getHoverColors(color),\n activeColors: getActiveColors(color)\n});\n\nconst getOutlinedButtonStyles = (color: string, backgroundColor: string) => {\n const backgroundUsable = meetsContrastGuidelines(color, backgroundColor).AA;\n const usableColor = backgroundUsable ? color : readableHue(color, backgroundColor);\n const hoverBackgroundColor = tryCatch(() => mix(0.9, backgroundColor, color));\n const activeBackgroundColor = tryCatch(() => mix(0.8, backgroundColor, usableColor));\n\n return {\n textColor: backgroundUsable ? color : readableColor(color),\n hoverBg: hoverBackgroundColor,\n hoverFg: readableHue(color, hoverBackgroundColor ?? 'transparent'),\n activeBg: tryCatch(() => mix(0.8, backgroundColor, usableColor)),\n activeFg: readableHue(usableColor, activeBackgroundColor ?? 'transparent')\n };\n};\n\nexport const StyledButton = styled.button.withConfig<ButtonPropsWithDefaults>(omitProps('loading'))(\n ({ variant, icon, loading, compact, theme }) => {\n const {\n base: {\n spacing,\n 'border-radius': baseBorderRadius,\n palette: { 'primary-background': backgroundColor },\n 'hit-area': {\n 'mouse-min': hitAreaMouse,\n 'finger-min': hitAreaFinger,\n 'compact-min': hitAreaCompact\n },\n animation: {\n speed,\n timing: { ease }\n }\n },\n components: {\n button: {\n color,\n 'secondary-color': secondaryColor,\n 'secondary-fill-style': fillStyle,\n padding,\n 'border-radius': borderRadius,\n 'border-width': borderWidth,\n touch: { padding: touchPadding }\n }\n }\n } = theme;\n\n // Base\n const base = baseStyles(theme);\n\n // Non-text base\n const nonTextual = css`\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-height: ${hitAreaMouse};\n min-width: ${hitAreaMouse};\n border: ${borderWidth} solid transparent;\n border-radius: calc(${baseBorderRadius} * ${borderRadius});\n -webkit-user-select: none;\n user-select: none;\n\n ${!icon &&\n css`\n padding: ${padding};\n `}\n\n ${icon &&\n css`\n border-radius: calc(${baseBorderRadius} * ${borderRadius});\n\n > svg {\n display: block;\n }\n `}\n\n ${compact &&\n css`\n min-height: ${hitAreaCompact};\n min-width: ${hitAreaCompact};\n `}\n\n @media (pointer: coarse) {\n border-radius: calc(${baseBorderRadius} * ${borderRadius});\n\n ${!compact &&\n css`\n min-height: ${hitAreaFinger};\n min-width: ${hitAreaFinger};\n `}\n\n ${!icon &&\n css`\n padding: ${touchPadding};\n `}\n }\n\n &:active {\n translate: 0 0.0625rem;\n }\n\n &::after {\n content: '';\n position: absolute;\n inset: calc(-1 * ${borderWidth});\n border-radius: calc(${baseBorderRadius} * ${borderRadius});\n transition: translate calc(0.5 * ${speed}) ${ease};\n }\n\n &:active::after {\n translate: 0 -0.0625rem;\n }\n `;\n\n // Primary and Secondary-filled\n const { contrastColor, hoverColors, activeColors } = getFilledButtonStyles(\n variant === 'primary' ? color : secondaryColor\n );\n const solidButtonStyles = css`\n --button-background-color: ${variant === 'primary' ? color : secondaryColor};\n color: ${contrastColor};\n background-color: ${variant === 'primary' ? color : secondaryColor};\n\n @media (hover: hover) {\n &:hover {\n background-color: ${hoverColors.background};\n text-decoration: none;\n }\n }\n\n &:active {\n background-color: ${activeColors.background};\n color: ${activeColors.foreground};\n text-decoration: none;\n }\n `;\n\n // Secondary-outline\n const secondaryOutlineButtonStyles = getOutlinedButtonStyles(secondaryColor, backgroundColor);\n const secondary = css`\n --button-background-color: ${backgroundColor};\n color: ${secondaryOutlineButtonStyles.textColor};\n background-color: ${backgroundColor};\n border-color: ${secondaryColor};\n\n @media (hover: hover) {\n &:hover {\n background-color: ${secondaryOutlineButtonStyles.hoverBg};\n text-decoration: none;\n }\n }\n\n &:active {\n color: ${secondaryOutlineButtonStyles.activeFg};\n background-color: ${secondaryOutlineButtonStyles.activeBg};\n border-color: ${secondaryOutlineButtonStyles.activeFg};\n text-decoration: none;\n }\n `;\n\n // Simple\n const simpleButtonStyles = getOutlinedButtonStyles(\n fillStyle === 'outline' ? secondaryColor : color,\n backgroundColor\n );\n const simple = css`\n --button-background-color: ${icon ? 'transparent' : backgroundColor};\n color: ${icon ? 'currentColor' : simpleButtonStyles.textColor};\n background-color: ${icon ? 'transparent' : backgroundColor};\n\n @media (hover: hover) {\n &:hover {\n ${icon &&\n css`\n ::before {\n content: '';\n position: absolute;\n top: calc(${borderWidth} * -1);\n bottom: calc(${borderWidth} * -1);\n left: calc(${borderWidth} * -1);\n right: calc(${borderWidth} * -1);\n border-radius: inherit;\n background-color: currentColor;\n opacity: 0.1;\n }\n `}\n\n ${!icon &&\n css`\n background-color: ${simpleButtonStyles.hoverBg};\n color: ${simpleButtonStyles.hoverFg};\n border-color: ${simpleButtonStyles.hoverFg};\n text-decoration: none;\n `}\n }\n\n &:active {\n ${icon &&\n css`\n ::before {\n content: '';\n position: absolute;\n top: calc(${borderWidth} * -1);\n bottom: calc(${borderWidth} * -1);\n left: calc(${borderWidth} * -1);\n right: calc(${borderWidth} * -1);\n border-radius: inherit;\n background-color: currentColor;\n opacity: 0.2;\n }\n `}\n\n ${!icon &&\n css`\n background-color: ${simpleButtonStyles.activeBg};\n color: ${simpleButtonStyles.activeFg};\n border-color: ${simpleButtonStyles.activeFg};\n text-decoration: none;\n `}\n }\n }\n `;\n\n return css`\n ${base}\n ${nonTextual}\n ${(variant === 'primary' || (variant === 'secondary' && fillStyle === 'fill')) &&\n solidButtonStyles}\n ${variant === 'secondary' && fillStyle === 'outline' && secondary}\n ${variant === 'simple' && simple}\n\n ${loading &&\n css`\n ${StyledBackdrop} {\n background-color: var(--button-background-color);\n border-radius: inherit;\n }\n\n ${StyledProgressRing} {\n width: 1em;\n height: 1em;\n\n ${!icon &&\n css`\n margin-inline-end: calc(${spacing} / 2);\n `}\n\n circle:nth-child(2) {\n animation-duration: calc(${speed} * 2);\n }\n }\n `}\n `;\n }\n);\n\nStyledButton.defaultProps = defaultThemeProp;\n\nexport const StyledButtonLink = styled.a.withConfig<\n Pick<ButtonPropsWithDefaults, 'variant'> &\n // Needed for omitProps\n Pick<ButtonProps, 'loading'>\n>(omitProps('loading'))(({ theme, variant }) => {\n const {\n base: {\n palette: { 'foreground-color': textColor }\n },\n components: {\n link: { color: linkColor }\n }\n } = theme;\n\n const base = baseStyles(theme);\n\n const textual = css`\n background-color: transparent;\n display: inline;\n text-align: start;\n border: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n > ${StyledIcon} {\n vertical-align: bottom;\n }\n `;\n\n const { background: activeColor } = getActiveColors(linkColor);\n const link = css`\n color: ${linkColor};\n\n &:active {\n color: ${activeColor};\n }\n `;\n\n const text = css`\n color: ${textColor};\n `;\n\n return css`\n ${base}\n ${textual}\n ${variant === 'link' && link}\n ${variant === 'text' && text}\n `;\n});\n\nStyledButtonLink.defaultProps = defaultThemeProp;\n\nconst Button: FunctionComponent<ButtonProps & ForwardProps> = forwardRef(function Button(\n {\n variant = 'secondary',\n type = 'button',\n disabled = false,\n icon = false,\n compact = false,\n href,\n as,\n forwardedAs,\n label,\n 'aria-label': ariaLabel,\n loading = false,\n children,\n ...restProps\n }: PropsWithoutRef<ButtonProps> & ForwardProps,\n ref: Ref<HTMLButtonElement>\n) {\n const [buttonEl, setButtonEl] = useElement();\n const mouseDownEvent = useRef<ReactMouseEvent>();\n const mouseDownPosition = useRef<DOMRect>();\n const mouseDownTimestamp = useRef<number>();\n const buttonRef = useConsolidatedRef<HTMLButtonElement>(ref, setButtonEl);\n const isTextual = ['link', 'text'].includes(variant);\n const showProgress = loading && !isTextual;\n const StyledComp: React.ElementType = isTextual ? StyledButtonLink : StyledButton;\n\n const handleClickWithElementShift = (e: MouseEvent) => {\n if (\n buttonRef.current &&\n mouseDownPosition.current &&\n mouseDownTimestamp.current &&\n isPositionWithinRect({ x: e.clientX, y: e.clientY }, mouseDownPosition.current) &&\n Date.now() - mouseDownTimestamp.current < 500\n ) {\n buttonRef.current.click();\n }\n };\n\n useEffect(() => {\n document.addEventListener('mouseup', handleClickWithElementShift);\n\n return () => {\n document.removeEventListener('mouseup', handleClickWithElementShift);\n mouseDownEvent.current = undefined;\n mouseDownPosition.current = undefined;\n mouseDownTimestamp.current = undefined;\n };\n }, []);\n\n return (\n <>\n <StyledComp\n {...restProps}\n ref={buttonRef}\n as={as || (href ? 'a' : 'button')}\n forwardedAs={forwardedAs || (href ? 'a' : 'button')}\n variant={variant}\n icon={icon}\n compact={compact}\n type={href ? undefined : type}\n href={href}\n disabled={disabled && !href}\n loading={showProgress}\n aria-label={ariaLabel || label}\n onMouseDown={(e: ReactMouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n (restProps.onMouseDown as MouseEventHandler | undefined)?.(e);\n e.persist();\n mouseDownEvent.current = e;\n mouseDownPosition.current = e.currentTarget.getBoundingClientRect();\n mouseDownTimestamp.current = Date.now();\n }}\n onMouseUp={(e: ReactMouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {\n const shouldFocus = mouseDownEvent.current && !mouseDownEvent.current.defaultPrevented;\n mouseDownEvent.current = undefined;\n mouseDownPosition.current = undefined;\n mouseDownTimestamp.current = undefined;\n\n if (shouldFocus && buttonRef.current !== document.activeElement) {\n buttonRef.current?.focus();\n }\n\n return (restProps.onMouseUp as MouseEventHandler | undefined)?.(e);\n }}\n >\n {showProgress && <Progress variant='ring' placement='inline' />}\n {!icon || !showProgress ? children : null}\n </StyledComp>\n\n {buttonEl && label && (\n <Tooltip target={buttonEl} showDelay='none' hideDelay='none' describeTarget={false}>\n {label}\n </Tooltip>\n )}\n </>\n );\n});\n\nexport default Button;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAmB,SAAS,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAKnG,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAmB,SAAS,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAKnG,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAMnE,MAAM,WAAW,SAAU,SAAQ,SAAS,EAAE,MAAM;IAClD,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kCAAkC;IAClC,OAAO,CAAC,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;IACzC,6CAA6C;IAC7C,GAAG,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CACxB;AAED,eAAO,MAAM,UAAU,6HA6CrB,CAAC;AAIH,QAAA,MAAM,IAAI,EAAE,iBAAiB,CAAC,SAAS,GAAG,YAAY,CA6BpD,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
|
@@ -4,8 +4,10 @@ import styled, { css } from 'styled-components';
|
|
|
4
4
|
import { defaultThemeProp } from '../../theme';
|
|
5
5
|
import Flex from '../Flex';
|
|
6
6
|
import { StyledPopover } from '../Popover';
|
|
7
|
+
import { useFullscreenContext } from '../Fullscreen';
|
|
7
8
|
import { StyledCardMedia } from './CardMedia';
|
|
8
9
|
export const StyledCard = styled.article(props => {
|
|
10
|
+
const fullscreen = useFullscreenContext();
|
|
9
11
|
const { 'border-radius': borderRadius, 'border-color': borderColor, background } = props.theme.components.card;
|
|
10
12
|
const interactive = props.interactive
|
|
11
13
|
? css `
|
|
@@ -35,6 +37,12 @@ export const StyledCard = styled.article(props => {
|
|
|
35
37
|
border-radius: ${borderRadius} ${borderRadius} 0 0;
|
|
36
38
|
}
|
|
37
39
|
}
|
|
40
|
+
|
|
41
|
+
${fullscreen?.[0] &&
|
|
42
|
+
css `
|
|
43
|
+
block-size: 100%;
|
|
44
|
+
border-radius: 0;
|
|
45
|
+
`}
|
|
38
46
|
}
|
|
39
47
|
`;
|
|
40
48
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAA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E,QAAQ,EAAE,EAClC,EAAE,EAAE,UAAU,EACd,WAAW,EAAE,EAAE,EACf,GAAG,EAAE,GAAG,KACJ,gBAAgB,KAChB,SAAS,YAEZ,QAAQ,GACJ,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { FunctionComponent, Ref, PropsWithoutRef, ReactNode, MouseEventHandler } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport Flex from '../Flex';\nimport type { ForwardProps, BaseProps, AsProp } from '../../types';\nimport { StyledPopover } from '../Popover';\nimport { useFullscreenContext } from '../Fullscreen';\n\nimport { StyledCardMedia } from './CardMedia';\n\nexport interface CardProps extends BaseProps, AsProp {\n /** Components and content for the Card. */\n children?: ReactNode;\n /**\n * Enables the focus, hover, and active styles.\n * @default false\n * @deprecated\n */\n interactive?: boolean;\n /** Callback for onClick event. */\n onClick?: MouseEventHandler<HTMLElement>;\n /** Ref forwarded to the wrapping element. */\n ref?: Ref<HTMLElement>;\n}\n\nexport const StyledCard = styled.article<Partial<CardProps>>(props => {\n const fullscreen = useFullscreenContext();\n\n const {\n 'border-radius': borderRadius,\n 'border-color': borderColor,\n background\n } = props.theme.components.card;\n const interactive = props.interactive\n ? css`\n &:hover {\n border: 0;\n box-shadow: 0 0 0 0.0625rem ${borderColor};\n }\n &:focus {\n border: 0;\n box-shadow: 0 0 0 0.125rem ${borderColor};\n }\n `\n : undefined;\n\n return css`\n ${StyledPopover} &, &:not(& &) {\n background-color: ${background};\n border-radius: ${borderRadius};\n\n &:focus {\n outline: none;\n }\n\n ${interactive}\n\n ${StyledCardMedia} {\n &:first-child img {\n border-radius: ${borderRadius} ${borderRadius} 0 0;\n }\n }\n\n ${fullscreen?.[0] &&\n css`\n block-size: 100%;\n border-radius: 0;\n `}\n }\n `;\n});\n\nStyledCard.defaultProps = defaultThemeProp;\n\nconst Card: FunctionComponent<CardProps & ForwardProps> = forwardRef(function Card(\n { children, as, onClick, interactive = false, ...restProps }: PropsWithoutRef<CardProps>,\n ref: CardProps['ref']\n) {\n const interactiveProps = {\n ...(onClick && {\n onClick,\n tabIndex: 0,\n role: 'button'\n }),\n ...(interactive && {\n tabIndex: 0\n }),\n interactive\n };\n\n return (\n <Flex\n role='none'\n container={{ direction: 'column' }}\n as={StyledCard}\n forwardedAs={as}\n ref={ref}\n {...interactiveProps}\n {...restProps}\n >\n {children}\n </Flex>\n );\n});\n\nexport default Card;\n"]}
|
|
@@ -1,35 +1,5 @@
|
|
|
1
|
-
import type { ChangeEvent, FC } from 'react';
|
|
2
|
-
import type { FormControlProps } from '../FormControl';
|
|
3
1
|
import type { RadioCheckProps } from '../RadioCheck';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* Sets DOM id for the control and associates label element via 'for' attribute.
|
|
8
|
-
* If an id is not pass, a random id will be generated for any render.
|
|
9
|
-
*/
|
|
10
|
-
id?: FormControlProps['id'];
|
|
11
|
-
/** Pass a string or a fragment with an Icon and string. */
|
|
12
|
-
label?: FormControlProps['label'];
|
|
13
|
-
/** Indicate if the field is required. The browser defaults to false. */
|
|
14
|
-
required?: FormControlProps['required'];
|
|
15
|
-
/** Disable the control. The browser defaults to false. */
|
|
16
|
-
disabled?: FormControlProps['disabled'];
|
|
17
|
-
/** Sets html name attribute for the underlying control. Useful for mapping to a data field. */
|
|
18
|
-
name?: FormControlProps['name'];
|
|
19
|
-
/** Sets checked prop via onChange when using as controlled component. */
|
|
20
|
-
checked?: RadioCheckProps['checked'];
|
|
21
|
-
/** Initialize checked prop when using as uncontrolled component. */
|
|
22
|
-
defaultChecked?: RadioCheckProps['defaultChecked'];
|
|
23
|
-
/**
|
|
24
|
-
* Sets Checkbox to an an [indeterminate state](https://css-tricks.com/almanac/selectors/i/indeterminate/#indeterminate-checkboxes).
|
|
25
|
-
* @default false
|
|
26
|
-
*/
|
|
27
|
-
indeterminate?: RadioCheckProps['indeterminate'];
|
|
28
|
-
/** Set visual state based on a validation state. */
|
|
29
|
-
status?: FormControlProps['status'];
|
|
30
|
-
/** Callback invoked when this particular checkbox changes selection. */
|
|
31
|
-
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
32
|
-
}
|
|
33
|
-
declare const CB: FC<CheckboxProps & ForwardProps>;
|
|
34
|
-
export default CB;
|
|
2
|
+
export type CheckboxProps = Omit<RadioCheckProps, 'type'>;
|
|
3
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<CheckboxProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
4
|
+
export default _default;
|
|
35
5
|
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAKrD,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;;AAE1D,wBAIE"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import RadioCheck from '../RadioCheck';
|
|
4
|
-
|
|
5
|
-
const CB = forwardRef(function CB(props, ref) {
|
|
4
|
+
export default forwardRef(function Checkbox(props, ref) {
|
|
6
5
|
return _jsx(RadioCheck, { ...props, type: 'checkbox', ref: ref });
|
|
7
6
|
});
|
|
8
|
-
// Adding here for doc purposes only
|
|
9
|
-
CB.defaultProps = RadioCheck.defaultProps;
|
|
10
|
-
export default CB;
|
|
11
7
|
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,UAAU,MAAM,eAAe,CAAC;AAQvC,eAAe,UAAU,CACvB,SAAS,QAAQ,CAAC,KAAK,EAAE,GAAG;IAC1B,OAAO,KAAC,UAAU,OAAK,KAAK,EAAE,IAAI,EAAC,UAAU,EAAC,GAAG,EAAE,GAAG,GAAI,CAAC;AAC7D,CAAC,CACF,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { PropsWithoutRef } from 'react';\n\nimport RadioCheck from '../RadioCheck';\nimport type { RadioCheckProps } from '../RadioCheck';\nimport type { RefElement } from '../../types';\n\n// Use Omit here to avoid listing all props for HTMLInputElement.\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport type CheckboxProps = Omit<RadioCheckProps, 'type'>;\n\nexport default forwardRef<RefElement<CheckboxProps>, PropsWithoutRef<CheckboxProps>>(\n function Checkbox(props, ref) {\n return <RadioCheck {...props} type='checkbox' ref={ref} />;\n }\n);\n"]}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { ChangeEvent } from 'react';
|
|
2
|
+
import type { NoChildrenProp, TestIdProp, WithAttributes } from '../../types';
|
|
3
3
|
import type { FormFieldProps } from '../FormField';
|
|
4
4
|
import type { FormControlProps } from '../FormControl';
|
|
5
|
-
export
|
|
5
|
+
export type ColorPickerProps = WithAttributes<'input', TestIdProp & NoChildrenProp & {
|
|
6
6
|
/** label for the color picker control */
|
|
7
7
|
label: FormControlProps['label'];
|
|
8
|
-
/**
|
|
9
|
-
* Sets DOM id for the control and associates label element via 'for' attribute.
|
|
10
|
-
* If an id is not passed, a random id will be generated for any render.
|
|
11
|
-
*/
|
|
12
|
-
id?: FormControlProps['id'];
|
|
13
8
|
/**
|
|
14
9
|
* Color picker value in hex
|
|
15
10
|
* @default '#000000'
|
|
@@ -20,20 +15,12 @@ export interface ColorPickerProps extends BaseProps, NoChildrenProp, TestIdProp
|
|
|
20
15
|
* @default false
|
|
21
16
|
*/
|
|
22
17
|
swatchOnly?: boolean;
|
|
23
|
-
/** Indicate if the field is required. The browser defaults to false. */
|
|
24
|
-
required?: FormControlProps['required'];
|
|
25
|
-
/** Disable the control. */
|
|
26
|
-
disabled?: FormControlProps['disabled'];
|
|
27
18
|
/** Visually hides the label region. */
|
|
28
19
|
labelHidden?: FormControlProps['labelHidden'];
|
|
29
20
|
/** It is recommended to pass a simple string to offer guidance. Text will be styled based on status prop. */
|
|
30
21
|
info?: FormControlProps['info'];
|
|
31
22
|
/** Set visual state based on a validation state. */
|
|
32
23
|
status?: FormControlProps['status'];
|
|
33
|
-
/** Makes the input non editable and non clickable. The browser defaults to false. */
|
|
34
|
-
readOnly?: FormControlProps['readOnly'];
|
|
35
|
-
/** Sets html name attribute for the underlying control. Useful for mapping to a data field. */
|
|
36
|
-
name?: FormControlProps['name'];
|
|
37
24
|
/** Layout field elements inline in a row. */
|
|
38
25
|
inline?: FormFieldProps['inline'];
|
|
39
26
|
/** Button when clicked will show additional information on the color picker */
|
|
@@ -42,11 +29,7 @@ export interface ColorPickerProps extends BaseProps, NoChildrenProp, TestIdProp
|
|
|
42
29
|
onChange?: ColorChangeHandler;
|
|
43
30
|
/** onBeforeClose of the color picker */
|
|
44
31
|
onBeforeClose?: () => void;
|
|
45
|
-
|
|
46
|
-
onClick?: MouseEventHandler<HTMLInputElement>;
|
|
47
|
-
/** Ref placed on the input element. */
|
|
48
|
-
ref?: Ref<HTMLInputElement>;
|
|
49
|
-
}
|
|
32
|
+
}>;
|
|
50
33
|
type RGBColor = {
|
|
51
34
|
r: number;
|
|
52
35
|
g: number;
|
|
@@ -63,8 +46,8 @@ type ColorResult = {
|
|
|
63
46
|
hsl: HSLColor;
|
|
64
47
|
};
|
|
65
48
|
type ColorChangeHandler = (color: ColorResult, event: ChangeEvent<HTMLInputElement>) => void;
|
|
66
|
-
declare const _default:
|
|
67
|
-
getTestIds: (testIdProp?: string | undefined) => import("../../types").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
49
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<ColorPickerProps, "ref"> & import("react").RefAttributes<HTMLInputElement>> & {
|
|
50
|
+
getTestIds: (testIdProp?: string | null | undefined) => import("../../types").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
68
51
|
};
|
|
69
52
|
export default _default;
|
|
70
53
|
//# sourceMappingURL=ColorPicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,WAAW,EAAE,MAAM,OAAO,CAAC;AAI1D,OAAO,KAAK,EACV,cAAc,EAGd,UAAU,EACV,cAAc,EACf,MAAM,aAAa,CAAC;AAGrB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAMvD,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAC3C,OAAO,EACP,UAAU,GACR,cAAc,GAAG;IACf,yCAAyC;IACzC,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACjC;;;OAGG;IACH,KAAK,CAAC,EAAE,gBAAgB,CA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