@pega/cosmos-react-core 7.0.0-build.3.4 → 7.0.0-build.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/AIButton/AIButton.d.ts +30 -2
- package/lib/components/AIButton/AIButton.d.ts.map +1 -1
- package/lib/components/AIButton/AIButton.js +7 -6
- package/lib/components/AIButton/AIButton.js.map +1 -1
- package/lib/components/Actions/Actions.d.ts +1 -1
- package/lib/components/Actions/Actions.d.ts.map +1 -1
- package/lib/components/Actions/Actions.js +6 -3
- package/lib/components/Actions/Actions.js.map +1 -1
- package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.js +9 -7
- package/lib/components/AppShell/AppHeader.js.map +1 -1
- package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.styles.js +27 -20
- package/lib/components/AppShell/AppHeader.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js +16 -4
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts +5 -1
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +52 -13
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.types.d.ts +4 -0
- package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.types.js.map +1 -1
- package/lib/components/AppShell/AppShellContext.d.ts +3 -1
- package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellContext.js +3 -1
- package/lib/components/AppShell/AppShellContext.js.map +1 -1
- package/lib/components/AppShell/AppShellList.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellList.styles.js +1 -0
- package/lib/components/AppShell/AppShellList.styles.js.map +1 -1
- package/lib/components/AppShell/NavigationList.d.ts.map +1 -1
- package/lib/components/AppShell/NavigationList.js +3 -3
- package/lib/components/AppShell/NavigationList.js.map +1 -1
- package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -1
- package/lib/components/AppShell/NavigationListItemWrapper.js +1 -0
- package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -1
- package/lib/components/AppShell/Operator.d.ts +1 -1
- package/lib/components/AppShell/style-utils.d.ts +3 -0
- package/lib/components/AppShell/style-utils.d.ts.map +1 -1
- package/lib/components/AppShell/style-utils.js +42 -3
- package/lib/components/AppShell/style-utils.js.map +1 -1
- package/lib/components/Avatar/Avatar.d.ts +2 -2
- package/lib/components/Avatar/Avatar.d.ts.map +1 -1
- package/lib/components/Avatar/Avatar.js +21 -20
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/Avatar/Avatar.test-ids.d.ts +1 -1
- package/lib/components/Avatar/Avatar.test-ids.d.ts.map +1 -1
- package/lib/components/Backdrop/Backdrop.d.ts +1 -1
- package/lib/components/Backdrop/Backdrop.test-ids.d.ts +1 -1
- package/lib/components/Backdrop/Backdrop.test-ids.d.ts.map +1 -1
- package/lib/components/Badges/Alert.d.ts +1 -1
- package/lib/components/Badges/Badges.test-ids.d.ts +6 -6
- package/lib/components/Badges/Badges.test-ids.d.ts.map +1 -1
- package/lib/components/Badges/Count.d.ts +1 -1
- package/lib/components/Badges/Keyboard.d.ts +1 -1
- package/lib/components/Badges/Keyboard.d.ts.map +1 -1
- package/lib/components/Badges/Keyboard.js +9 -8
- package/lib/components/Badges/Keyboard.js.map +1 -1
- package/lib/components/Badges/Selection.d.ts +1 -1
- package/lib/components/Badges/Selection.d.ts.map +1 -1
- package/lib/components/Badges/Selection.js +3 -1
- package/lib/components/Badges/Selection.js.map +1 -1
- package/lib/components/Badges/Status.d.ts +1 -1
- package/lib/components/Badges/Status.d.ts.map +1 -1
- package/lib/components/Badges/Status.js +0 -1
- package/lib/components/Badges/Status.js.map +1 -1
- package/lib/components/Badges/Tag.d.ts +1 -1
- package/lib/components/Banner/Banner.d.ts +1 -1
- package/lib/components/Banner/Banner.d.ts.map +1 -1
- package/lib/components/Banner/Banner.js +5 -2
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Banner/Banner.test-ids.d.ts +1 -1
- package/lib/components/Banner/Banner.test-ids.d.ts.map +1 -1
- package/lib/components/Button/Button.d.ts +1 -1
- package/lib/components/Button/Button.d.ts.map +1 -1
- package/lib/components/Button/Button.js +142 -53
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Card/Card.d.ts.map +1 -1
- package/lib/components/Card/Card.js +8 -0
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Checkbox/Checkbox.d.ts +3 -33
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/Checkbox.js +1 -5
- package/lib/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.d.ts +6 -23
- package/lib/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.js +3 -4
- package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts +1 -1
- package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts +2 -4
- package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.js +8 -5
- package/lib/components/ComboBox/ComboBox.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.styles.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.styles.js +7 -1
- package/lib/components/ComboBox/ComboBox.styles.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.types.d.ts +8 -26
- package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
- package/lib/components/ComboBox/ComboxBox.test-ids.d.ts +1 -1
- package/lib/components/ComboBox/ComboxBox.test-ids.d.ts.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +10 -2
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.d.ts +2 -3
- package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.js +2 -3
- package/lib/components/CompositeInput/CompositeInput.js.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts +1 -1
- package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.types.d.ts +4 -13
- package/lib/components/CompositeInput/CompositeInput.types.d.ts.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.types.js.map +1 -1
- package/lib/components/Configuration/Configuration.d.ts +1 -0
- package/lib/components/Configuration/Configuration.d.ts.map +1 -1
- package/lib/components/Configuration/Configuration.js +58 -30
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/Configuration/ThemeOverride.d.ts +11 -0
- package/lib/components/Configuration/ThemeOverride.d.ts.map +1 -0
- package/lib/components/Configuration/ThemeOverride.js +23 -0
- package/lib/components/Configuration/ThemeOverride.js.map +1 -0
- package/lib/components/Configuration/connected-watcher.d.ts +17 -0
- package/lib/components/Configuration/connected-watcher.d.ts.map +1 -0
- package/lib/components/Configuration/connected-watcher.js +13 -0
- package/lib/components/Configuration/connected-watcher.js.map +1 -0
- package/lib/components/Configuration/index.d.ts +1 -0
- package/lib/components/Configuration/index.d.ts.map +1 -1
- package/lib/components/Configuration/index.js +1 -0
- package/lib/components/Configuration/index.js.map +1 -1
- package/lib/components/Configuration/withConfiguration.d.ts.map +1 -1
- package/lib/components/Configuration/withConfiguration.js.map +1 -1
- package/lib/components/CreditCard/CreditCard.types.d.ts +5 -25
- package/lib/components/CreditCard/CreditCard.types.d.ts.map +1 -1
- package/lib/components/CreditCard/CreditCard.types.js.map +1 -1
- package/lib/components/CreditCard/CreditCardDisplay.d.ts +2 -4
- package/lib/components/CreditCard/CreditCardDisplay.d.ts.map +1 -1
- package/lib/components/CreditCard/CreditCardDisplay.js +1 -2
- package/lib/components/CreditCard/CreditCardDisplay.js.map +1 -1
- package/lib/components/CreditCard/CreditCardInput.d.ts +15 -5
- package/lib/components/CreditCard/CreditCardInput.d.ts.map +1 -1
- package/lib/components/CreditCard/CreditCardInput.js +1 -2
- package/lib/components/CreditCard/CreditCardInput.js.map +1 -1
- package/lib/components/Currency/Currency.test-ids.d.ts +1 -1
- package/lib/components/Currency/Currency.test-ids.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.d.ts +1 -1
- package/lib/components/Currency/CurrencyInput.js +1 -1
- package/lib/components/Currency/CurrencyInput.js.map +1 -1
- package/lib/components/DangerButton/DangerButton.js +2 -2
- package/lib/components/DangerButton/DangerButton.js.map +1 -1
- package/lib/components/DateTime/DateTime.test-ids.d.ts +11 -11
- package/lib/components/DateTime/DateTime.test-ids.d.ts.map +1 -1
- package/lib/components/DateTime/DateTime.test-ids.js +5 -1
- package/lib/components/DateTime/DateTime.test-ids.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +30 -30
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.d.ts +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.js +2 -2
- package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.d.ts +1 -0
- package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.js +24 -16
- package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +28 -22
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.d.ts +1 -1
- package/lib/components/DateTime/Input/MonthInput.d.ts +1 -1
- package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.js +23 -12
- package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
- package/lib/components/DateTime/Input/PartInput.d.ts +1 -1
- package/lib/components/DateTime/Input/PartInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/PartInput.js +13 -7
- package/lib/components/DateTime/Input/PartInput.js.map +1 -1
- package/lib/components/DateTime/Input/QuarterInput.d.ts +1 -1
- package/lib/components/DateTime/Input/TimeInput.d.ts +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.js +3 -3
- package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.d.ts +1 -1
- package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.js +17 -6
- package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
- package/lib/components/DateTime/Input/utils.d.ts +3 -2
- package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Input/utils.js +9 -2
- package/lib/components/DateTime/Input/utils.js.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.js +5 -4
- package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.styles.js +2 -1
- package/lib/components/DateTime/Picker/Calendar.styles.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.d.ts +1 -1
- package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.js +31 -19
- package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.styles.d.ts +1 -0
- package/lib/components/DateTime/Picker/DatePicker.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.styles.js +13 -5
- package/lib/components/DateTime/Picker/DatePicker.styles.js.map +1 -1
- package/lib/components/DateTime/Picker/DateRangePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DateRangePicker.js +18 -11
- package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.js +2 -1
- package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/utils.d.ts +9 -0
- package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/utils.js +16 -0
- package/lib/components/DateTime/Picker/utils.js.map +1 -1
- package/lib/components/DateTime/index.d.ts +1 -1
- package/lib/components/DateTime/index.d.ts.map +1 -1
- package/lib/components/DateTime/index.js +1 -1
- package/lib/components/DateTime/index.js.map +1 -1
- package/lib/components/DateTime/utils.d.ts +5 -0
- package/lib/components/DateTime/utils.d.ts.map +1 -1
- package/lib/components/DateTime/utils.js +21 -11
- package/lib/components/DateTime/utils.js.map +1 -1
- package/lib/components/Email/EmailDisplay.d.ts.map +1 -1
- package/lib/components/Email/EmailDisplay.js +2 -2
- package/lib/components/Email/EmailDisplay.js.map +1 -1
- package/lib/components/EmptyState/EmptyState.d.ts.map +1 -1
- package/lib/components/EmptyState/EmptyState.js +5 -2
- package/lib/components/EmptyState/EmptyState.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.d.ts +6 -0
- package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.js +36 -14
- package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts +1 -0
- package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.js +18 -18
- package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.d.ts +14 -10
- package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.js +13 -5
- package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.test-ids.d.ts +2 -2
- package/lib/components/FieldValueList/FieldValueList.test-ids.d.ts.map +1 -1
- package/lib/components/FieldValueList/index.d.ts +1 -1
- package/lib/components/FieldValueList/index.d.ts.map +1 -1
- package/lib/components/FieldValueList/index.js.map +1 -1
- package/lib/components/File/CompactList.d.ts +15 -0
- package/lib/components/File/CompactList.d.ts.map +1 -0
- package/lib/components/File/CompactList.js +21 -0
- package/lib/components/File/CompactList.js.map +1 -0
- package/lib/components/File/File.test-ids.d.ts +1 -1
- package/lib/components/File/File.test-ids.d.ts.map +1 -1
- package/lib/components/File/FileDisplay.d.ts +5 -0
- package/lib/components/File/FileDisplay.d.ts.map +1 -1
- package/lib/components/File/FileDisplay.js +2 -2
- package/lib/components/File/FileDisplay.js.map +1 -1
- package/lib/components/File/FileDisplayList.d.ts +10 -0
- package/lib/components/File/FileDisplayList.d.ts.map +1 -0
- package/lib/components/File/FileDisplayList.js +14 -0
- package/lib/components/File/FileDisplayList.js.map +1 -0
- package/lib/components/File/FileInput.d.ts +38 -9
- package/lib/components/File/FileInput.d.ts.map +1 -1
- package/lib/components/File/FileInput.js +183 -72
- package/lib/components/File/FileInput.js.map +1 -1
- package/lib/components/File/FileInput.styles.d.ts +26 -0
- package/lib/components/File/FileInput.styles.d.ts.map +1 -0
- package/lib/components/File/FileInput.styles.js +166 -0
- package/lib/components/File/FileInput.styles.js.map +1 -0
- package/lib/components/File/FileItem.d.ts +18 -4
- package/lib/components/File/FileItem.d.ts.map +1 -1
- package/lib/components/File/FileItem.js +84 -30
- package/lib/components/File/FileItem.js.map +1 -1
- package/lib/components/File/FileList.d.ts +20 -0
- package/lib/components/File/FileList.d.ts.map +1 -0
- package/lib/components/File/FileList.js +66 -0
- package/lib/components/File/FileList.js.map +1 -0
- package/lib/components/File/FileUploadItem.d.ts +4 -0
- package/lib/components/File/FileUploadItem.d.ts.map +1 -1
- package/lib/components/File/FileUploadItem.js +42 -38
- package/lib/components/File/FileUploadItem.js.map +1 -1
- package/lib/components/File/index.d.ts +4 -0
- package/lib/components/File/index.d.ts.map +1 -1
- package/lib/components/File/index.js +2 -0
- package/lib/components/File/index.js.map +1 -1
- package/lib/components/Flex/Flex.js.map +1 -1
- package/lib/components/Form/Form.d.ts +1 -1
- package/lib/components/Form/Form.test-ids.d.ts +1 -1
- package/lib/components/Form/Form.test-ids.d.ts.map +1 -1
- package/lib/components/FormField/FormField.d.ts +2 -2
- package/lib/components/FormField/FormField.d.ts.map +1 -1
- package/lib/components/FormField/FormField.js +45 -60
- package/lib/components/FormField/FormField.js.map +1 -1
- package/lib/components/FormField/FormField.test-ids.d.ts +1 -1
- package/lib/components/FormField/FormField.test-ids.d.ts.map +1 -1
- package/lib/components/Fullscreen/Fullscreen.d.ts +18 -0
- package/lib/components/Fullscreen/Fullscreen.d.ts.map +1 -0
- package/lib/components/Fullscreen/Fullscreen.js +56 -0
- package/lib/components/Fullscreen/Fullscreen.js.map +1 -0
- package/lib/components/Fullscreen/Fullscreen.test-ids.d.ts +2 -0
- package/lib/components/Fullscreen/Fullscreen.test-ids.d.ts.map +1 -0
- package/lib/components/Fullscreen/Fullscreen.test-ids.js +3 -0
- package/lib/components/Fullscreen/Fullscreen.test-ids.js.map +1 -0
- package/lib/components/Fullscreen/FullscreenButton.d.ts +6 -0
- package/lib/components/Fullscreen/FullscreenButton.d.ts.map +1 -0
- package/lib/components/Fullscreen/FullscreenButton.js +33 -0
- package/lib/components/Fullscreen/FullscreenButton.js.map +1 -0
- package/lib/components/Fullscreen/index.d.ts +4 -0
- package/lib/components/Fullscreen/index.d.ts.map +1 -0
- package/lib/components/Fullscreen/index.js +4 -0
- package/lib/components/Fullscreen/index.js.map +1 -0
- package/lib/components/HTML/HTML.d.ts +1 -1
- package/lib/components/HTML/HTML.test-ids.d.ts +1 -1
- package/lib/components/HTML/HTML.test-ids.d.ts.map +1 -1
- package/lib/components/Icon/Icon.d.ts.map +1 -1
- package/lib/components/Icon/Icon.js +1 -1
- package/lib/components/Icon/Icon.js.map +1 -1
- package/lib/components/Icon/iconNames.d.ts +1 -1
- package/lib/components/Icon/iconNames.d.ts.map +1 -1
- package/lib/components/Icon/iconNames.js +2 -0
- package/lib/components/Icon/iconNames.js.map +1 -1
- package/lib/components/Icon/icons/calendar-now.icon.d.ts +5 -0
- package/lib/components/Icon/icons/calendar-now.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/calendar-now.icon.js +7 -0
- package/lib/components/Icon/icons/calendar-now.icon.js.map +1 -0
- package/lib/components/Icon/icons/preview.icon.d.ts +5 -0
- package/lib/components/Icon/icons/preview.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/preview.icon.js +7 -0
- package/lib/components/Icon/icons/preview.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/arrow-down.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-down.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-left.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-left.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-down.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-down.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-left.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-left.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-right.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-right.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-up.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-micro-up.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-right.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-right.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/arrow-up.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/arrow-up.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/calendar-now.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/calendar-now.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/calendar-now.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/calendar-now.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/caret-down.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/caret-down.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/caret-left.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/caret-left.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/caret-right.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/caret-right.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/caret-up.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/caret-up.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/case-solid.icon.d.ts +1 -1
- package/lib/components/Icon/streamline-icons/case-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/case-solid.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/case-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/clipboard-pencil-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/clipboard-pencil-solid.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/clipboard-pencil-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/clock-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/clock-solid.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/clock-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/disc-stack-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/disc-stack-solid.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/disc-stack-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/dock.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/dock.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/dock.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/dock.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/drag.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/drag.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/expression.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/expression.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/expression.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/expression.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/indent.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/indent.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/indent.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/indent.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/information-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/information-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/information-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/information-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/list-number.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/list-number.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/list-number.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/list-number.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-down.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-down.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-down.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-down.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-left.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-left.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-left.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-left.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-right.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-right.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-right.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-right.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-up.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-up.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-up.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/micro-arrow-up.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/minus.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/minus.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/minus.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/open.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/open.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/plus.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/plus.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/plus.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/rule-library-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/rule-library-solid.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/rule-library-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/search-analytics-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/search-analytics-solid.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/search-analytics-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/times.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/times.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/times.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/undock.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/undock.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/undock.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/undock.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/unindent.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/unindent.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/unindent.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/unindent.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/warn-solid.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/warn-solid.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/warn-solid.icon.js.map +1 -1
- package/lib/components/Icon/streamlineIconNames.d.ts +1 -1
- package/lib/components/Icon/streamlineIconNames.d.ts.map +1 -1
- package/lib/components/Icon/streamlineIconNames.js +12 -0
- package/lib/components/Icon/streamlineIconNames.js.map +1 -1
- package/lib/components/IconPicker/IconPicker.d.ts +7 -1
- package/lib/components/IconPicker/IconPicker.d.ts.map +1 -1
- package/lib/components/IconPicker/IconPicker.js +20 -14
- package/lib/components/IconPicker/IconPicker.js.map +1 -1
- package/lib/components/Input/Input.d.ts +5 -8
- package/lib/components/Input/Input.d.ts.map +1 -1
- package/lib/components/Input/Input.js +2 -3
- package/lib/components/Input/Input.js.map +1 -1
- package/lib/components/Input/Input.test-ids.d.ts +1 -1
- package/lib/components/Input/Input.test-ids.d.ts.map +1 -1
- package/lib/components/Label/Label.js +2 -2
- package/lib/components/Label/Label.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.js +21 -12
- package/lib/components/Lightbox/Lightbox.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.styles.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.test-ids.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.test-ids.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.types.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.types.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.types.js.map +1 -1
- package/lib/components/Link/Link.d.ts +5 -2
- package/lib/components/Link/Link.d.ts.map +1 -1
- package/lib/components/Link/Link.js +28 -16
- package/lib/components/Link/Link.js.map +1 -1
- package/lib/components/Link/Link.test-ids.d.ts +1 -1
- package/lib/components/Link/Link.test-ids.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.d.ts +1 -1
- package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.js +9 -8
- package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.js +6 -9
- package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts +1 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.js +4 -1
- package/lib/components/ListToolbar/ListToolbar.test-ids.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.d.ts +7 -3
- package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
- package/lib/components/ListToolbar/PresetMenuPopover.d.ts.map +1 -1
- package/lib/components/ListToolbar/PresetMenuPopover.js +2 -2
- package/lib/components/ListToolbar/PresetMenuPopover.js.map +1 -1
- package/lib/components/ListToolbar/helpers.d.ts.map +1 -1
- package/lib/components/ListToolbar/helpers.js.map +1 -1
- package/lib/components/Location/CurrentLocationButton.d.ts +1 -6
- package/lib/components/Location/CurrentLocationButton.d.ts.map +1 -1
- package/lib/components/Location/CurrentLocationButton.js +10 -20
- package/lib/components/Location/CurrentLocationButton.js.map +1 -1
- package/lib/components/Location/Location.test-ids.d.ts +1 -1
- package/lib/components/Location/Location.test-ids.d.ts.map +1 -1
- package/lib/components/Location/Location.types.d.ts +49 -17
- package/lib/components/Location/Location.types.d.ts.map +1 -1
- package/lib/components/Location/Location.types.js +9 -1
- package/lib/components/Location/Location.types.js.map +1 -1
- package/lib/components/Location/LocationDisplay.d.ts +5 -4
- package/lib/components/Location/LocationDisplay.d.ts.map +1 -1
- package/lib/components/Location/LocationDisplay.js +17 -4
- package/lib/components/Location/LocationDisplay.js.map +1 -1
- package/lib/components/Location/LocationInput.d.ts +23 -18
- package/lib/components/Location/LocationInput.d.ts.map +1 -1
- package/lib/components/Location/LocationInput.js +37 -15
- package/lib/components/Location/LocationInput.js.map +1 -1
- package/lib/components/Location/LocationView.d.ts +26 -12
- package/lib/components/Location/LocationView.d.ts.map +1 -1
- package/lib/components/Location/LocationView.js +103 -50
- package/lib/components/Location/LocationView.js.map +1 -1
- package/lib/components/Location/index.d.ts +2 -2
- package/lib/components/Location/index.d.ts.map +1 -1
- package/lib/components/Location/index.js +1 -1
- package/lib/components/Location/index.js.map +1 -1
- package/lib/components/Location/utils.d.ts +20 -2
- package/lib/components/Location/utils.d.ts.map +1 -1
- package/lib/components/Location/utils.js +184 -41
- package/lib/components/Location/utils.js.map +1 -1
- package/lib/components/Menu/Menu.context.d.ts.map +1 -1
- package/lib/components/Menu/Menu.context.js +1 -0
- package/lib/components/Menu/Menu.context.js.map +1 -1
- package/lib/components/Menu/Menu.d.ts +1 -1
- package/lib/components/Menu/Menu.d.ts.map +1 -1
- package/lib/components/Menu/Menu.js +6 -2
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/Menu.styles.d.ts +0 -1
- package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
- package/lib/components/Menu/Menu.styles.js +5 -12
- package/lib/components/Menu/Menu.styles.js.map +1 -1
- package/lib/components/Menu/Menu.test-ids.d.ts +2 -2
- package/lib/components/Menu/Menu.test-ids.d.ts.map +1 -1
- package/lib/components/Menu/Menu.types.d.ts +14 -2
- package/lib/components/Menu/Menu.types.d.ts.map +1 -1
- package/lib/components/Menu/Menu.types.js.map +1 -1
- package/lib/components/Menu/Menu.utils.d.ts +4 -0
- package/lib/components/Menu/Menu.utils.d.ts.map +1 -0
- package/lib/components/Menu/Menu.utils.js +6 -0
- package/lib/components/Menu/Menu.utils.js.map +1 -0
- package/lib/components/Menu/MenuGroup.js +2 -2
- package/lib/components/Menu/MenuGroup.js.map +1 -1
- package/lib/components/Menu/MenuItem.d.ts +1 -1
- package/lib/components/Menu/MenuItem.d.ts.map +1 -1
- package/lib/components/Menu/MenuItem.js +3 -3
- package/lib/components/Menu/MenuItem.js.map +1 -1
- package/lib/components/Menu/MenuList.d.ts.map +1 -1
- package/lib/components/Menu/MenuList.js +3 -3
- package/lib/components/Menu/MenuList.js.map +1 -1
- package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
- package/lib/components/Menu/NavItemsList.js +1 -3
- package/lib/components/Menu/NavItemsList.js.map +1 -1
- package/lib/components/Menu/index.d.ts +1 -0
- package/lib/components/Menu/index.d.ts.map +1 -1
- package/lib/components/Menu/index.js +1 -0
- package/lib/components/Menu/index.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.d.ts +8 -1
- package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +15 -5
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.test-ids.d.ts +1 -1
- package/lib/components/MenuButton/MenuButton.test-ids.d.ts.map +1 -1
- package/lib/components/MetaList/MetaList.d.ts +1 -1
- package/lib/components/MetaList/MetaList.test-ids.d.ts +1 -1
- package/lib/components/MetaList/MetaList.test-ids.d.ts.map +1 -1
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/Modal.js +10 -3
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/Modal.styles.d.ts.map +1 -1
- package/lib/components/Modal/Modal.styles.js +24 -3
- package/lib/components/Modal/Modal.styles.js.map +1 -1
- package/lib/components/Modal/ModalManager.d.ts.map +1 -1
- package/lib/components/Modal/ModalManager.js +5 -1
- package/lib/components/Modal/ModalManager.js.map +1 -1
- package/lib/components/Number/Number.test-ids.d.ts +2 -2
- package/lib/components/Number/Number.test-ids.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.d.ts +1 -1
- package/lib/components/Number/NumberInput.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.js +11 -3
- package/lib/components/Number/NumberInput.js.map +1 -1
- package/lib/components/Number/NumberRangeInput.d.ts +1 -1
- package/lib/components/Number/NumberRangeInput.d.ts.map +1 -1
- package/lib/components/Number/NumberRangeInput.js +5 -69
- package/lib/components/Number/NumberRangeInput.js.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.styles.d.ts +3 -1
- package/lib/components/PageTemplates/CategorySubPage.styles.d.ts.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.styles.js +3 -2
- package/lib/components/PageTemplates/CategorySubPage.styles.js.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.js +41 -6
- package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts +1 -0
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js +84 -31
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/Phone/Phone.test-ids.d.ts +1 -1
- package/lib/components/Phone/Phone.test-ids.d.ts.map +1 -1
- package/lib/components/Phone/PhoneDisplay.d.ts.map +1 -1
- package/lib/components/Phone/PhoneDisplay.js +2 -2
- package/lib/components/Phone/PhoneDisplay.js.map +1 -1
- package/lib/components/Phone/PhoneInput.d.ts +1 -1
- package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
- package/lib/components/Phone/PhoneInput.js +8 -3
- package/lib/components/Phone/PhoneInput.js.map +1 -1
- package/lib/components/Popover/Popover.d.ts +2 -0
- package/lib/components/Popover/Popover.d.ts.map +1 -1
- package/lib/components/Popover/Popover.js +20 -3
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
- package/lib/components/Popover/Popover.styles.js +2 -2
- package/lib/components/Popover/Popover.styles.js.map +1 -1
- package/lib/components/Popover/modifiers.d.ts.map +1 -1
- package/lib/components/Popover/modifiers.js +11 -5
- package/lib/components/Popover/modifiers.js.map +1 -1
- package/lib/components/Progress/Progress.d.ts.map +1 -1
- package/lib/components/Progress/Progress.js +2 -2
- package/lib/components/Progress/Progress.js.map +1 -1
- package/lib/components/Progress/Progress.styles.d.ts +1 -1
- package/lib/components/Progress/Progress.styles.d.ts.map +1 -1
- package/lib/components/Progress/Progress.styles.js +9 -9
- package/lib/components/Progress/Progress.styles.js.map +1 -1
- package/lib/components/Progress/Progress.types.d.ts +4 -0
- package/lib/components/Progress/Progress.types.d.ts.map +1 -1
- package/lib/components/Progress/Progress.types.js.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.d.ts +6 -30
- package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.js +3 -4
- package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts +19 -6
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.js +5 -1
- package/lib/components/SearchInput/SearchInput.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.styles.d.ts +3 -3
- package/lib/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.styles.js +15 -15
- package/lib/components/SearchInput/SearchInput.styles.js.map +1 -1
- package/lib/components/Select/Select.d.ts +1 -1
- package/lib/components/Select/Select.test-ids.d.ts +1 -1
- package/lib/components/Select/Select.test-ids.d.ts.map +1 -1
- package/lib/components/Slider/Slider.d.ts +1 -1
- package/lib/components/Slider/Slider.test-ids.d.ts +1 -1
- package/lib/components/Slider/Slider.test-ids.d.ts.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.d.ts +6 -1
- package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.js +13 -5
- package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.test-ids.d.ts +1 -1
- package/lib/components/SummaryItem/SummaryItem.test-ids.d.ts.map +1 -1
- package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
- package/lib/components/SummaryList/SummaryList.js +9 -9
- package/lib/components/SummaryList/SummaryList.js.map +1 -1
- package/lib/components/Switch/Switch.js +2 -2
- package/lib/components/Switch/Switch.js.map +1 -1
- package/lib/components/Tabs/Tab.d.ts +7 -3
- package/lib/components/Tabs/Tab.d.ts.map +1 -1
- package/lib/components/Tabs/Tab.js +83 -23
- package/lib/components/Tabs/Tab.js.map +1 -1
- package/lib/components/Tabs/TabPanel.d.ts +13 -2
- package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
- package/lib/components/Tabs/TabPanel.js +60 -5
- package/lib/components/Tabs/TabPanel.js.map +1 -1
- package/lib/components/Tabs/Tabs.d.ts +0 -1
- package/lib/components/Tabs/Tabs.d.ts.map +1 -1
- package/lib/components/Tabs/Tabs.js +97 -35
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/Tabs/Tabs.styles.d.ts +17 -0
- package/lib/components/Tabs/Tabs.styles.d.ts.map +1 -0
- package/lib/components/Tabs/Tabs.styles.js +110 -0
- package/lib/components/Tabs/Tabs.styles.js.map +1 -0
- package/lib/components/Tabs/TabsContext.d.ts +6 -0
- package/lib/components/Tabs/TabsContext.d.ts.map +1 -0
- package/lib/components/Tabs/TabsContext.js +6 -0
- package/lib/components/Tabs/TabsContext.js.map +1 -0
- package/lib/components/Tabs/index.d.ts +1 -0
- package/lib/components/Tabs/index.d.ts.map +1 -1
- package/lib/components/Tabs/index.js +1 -0
- package/lib/components/Tabs/index.js.map +1 -1
- package/lib/components/Text/Text.js +1 -1
- package/lib/components/Text/Text.js.map +1 -1
- package/lib/components/TextArea/TextArea.d.ts +1 -1
- package/lib/components/TextArea/TextArea.test-ids.d.ts +1 -1
- package/lib/components/TextArea/TextArea.test-ids.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.d.ts +1 -1
- package/lib/components/Toaster/Toaster.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.js +88 -19
- package/lib/components/Toaster/Toaster.js.map +1 -1
- package/lib/components/Toaster/Toaster.test-ids.d.ts +1 -1
- package/lib/components/Toaster/Toaster.test-ids.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.types.d.ts +17 -4
- package/lib/components/Toaster/Toaster.types.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.types.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.d.ts +3 -3
- package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +19 -4
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.test-ids.d.ts +1 -1
- package/lib/components/Tooltip/Tooltip.test-ids.d.ts.map +1 -1
- package/lib/components/Tree/StandardTree.styles.d.ts +1 -1
- package/lib/components/Tree/Tree.d.ts +1 -1
- package/lib/components/Tree/Tree.test-ids.d.ts +2 -2
- package/lib/components/Tree/Tree.test-ids.d.ts.map +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useArrows.d.ts.map +1 -1
- package/lib/hooks/useArrows.js +3 -1
- package/lib/hooks/useArrows.js.map +1 -1
- package/lib/hooks/useEvent.d.ts +5 -0
- package/lib/hooks/useEvent.d.ts.map +1 -1
- package/lib/hooks/useEvent.js.map +1 -1
- package/lib/hooks/useFocusWithin.d.ts.map +1 -1
- package/lib/hooks/useFocusWithin.js +14 -8
- package/lib/hooks/useFocusWithin.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +146 -3
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useScrollStick.d.ts +3 -3
- package/lib/hooks/useScrollStick.d.ts.map +1 -1
- package/lib/hooks/useScrollStick.js +6 -5
- package/lib/hooks/useScrollStick.js.map +1 -1
- package/lib/hooks/useScrollToggle.d.ts.map +1 -1
- package/lib/hooks/useScrollToggle.js +1 -0
- package/lib/hooks/useScrollToggle.js.map +1 -1
- package/lib/hooks/useSimpleStoreInstance.d.ts +9 -0
- package/lib/hooks/useSimpleStoreInstance.d.ts.map +1 -0
- package/lib/hooks/useSimpleStoreInstance.js +13 -0
- package/lib/hooks/useSimpleStoreInstance.js.map +1 -0
- package/lib/hooks/useTestIds.d.ts +1 -1
- package/lib/hooks/useTestIds.d.ts.map +1 -1
- package/lib/hooks/useTestIds.js +1 -1
- package/lib/hooks/useTestIds.js.map +1 -1
- package/lib/i18n/default.d.ts +146 -3
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +169 -11
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +146 -3
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/styles/GlobalStyle.d.ts +1 -1
- package/lib/styles/GlobalStyle.d.ts.map +1 -1
- package/lib/styles/GlobalStyle.js +6 -1
- package/lib/styles/GlobalStyle.js.map +1 -1
- package/lib/styles/mixins.d.ts +3 -0
- package/lib/styles/mixins.d.ts.map +1 -0
- package/lib/styles/mixins.js +14 -0
- package/lib/styles/mixins.js.map +1 -0
- package/lib/styles/utils.d.ts +11 -5
- package/lib/styles/utils.d.ts.map +1 -1
- package/lib/styles/utils.js +28 -12
- package/lib/styles/utils.js.map +1 -1
- package/lib/theme/ThemeMachine.d.ts.map +1 -1
- package/lib/theme/ThemeMachine.js.map +1 -1
- package/lib/theme/theme.d.ts +18 -0
- package/lib/theme/theme.d.ts.map +1 -1
- package/lib/theme/themeDefinition.json +9 -2
- package/lib/theme/themeOverrides.schema.json +13 -0
- package/lib/types/types.d.ts +4 -2
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/types.js.map +1 -1
- package/lib/utils/formatListToLocaleString.d.ts.map +1 -1
- package/lib/utils/formatListToLocaleString.js +5 -2
- package/lib/utils/formatListToLocaleString.js.map +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/isPositionWithinRect.d.ts +12 -0
- package/lib/utils/isPositionWithinRect.d.ts.map +1 -0
- package/lib/utils/isPositionWithinRect.js +11 -0
- package/lib/utils/isPositionWithinRect.js.map +1 -0
- package/lib/utils/withTestIds.d.ts +1 -1
- package/package.json +9 -6
- package/lib/components/Location/types.d.ts +0 -45
- package/lib/components/Location/types.d.ts.map +0 -1
- package/lib/components/Location/types.js +0 -10
- package/lib/components/Location/types.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreditCard.types.js","sourceRoot":"","sources":["../../../src/components/CreditCard/CreditCard.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"CreditCard.types.js","sourceRoot":"","sources":["../../../src/components/CreditCard/CreditCard.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { NoChildrenProp, OmitStrict, WithAttributes } from '../../types';\nimport type { FormControlProps } from '../FormControl';\n\nexport type ObfuscationMode = 'none' | 'partial' | 'full';\n\nexport interface FormattingOptions {\n obfuscation?: ObfuscationMode;\n}\n\nexport type CreditCardDisplayProps = WithAttributes<\n 'span',\n NoChildrenProp & {\n /** Number value. */\n value?: string;\n /** Options to define formatting. */\n formattingOptions?: {\n /**\n * Defines if the obfuscation (replacing digits with bullets) should be applied.\n * This is only visual obfuscation, the real one should be applied on the server side.\n * Characters that are going to be obfuscated may be random characters or even missing.\n * @default 'none'\n */\n obfuscation?: ObfuscationMode;\n };\n }\n>;\n\nexport type CreditCardInputProps = OmitStrict<\n WithAttributes<\n 'input',\n NoChildrenProp & {\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /**\n * Visually hides the label region.\n * @default false\n */\n labelHidden?: FormControlProps['labelHidden'];\n /** It is recommended to pass a simple string to offer guidance. Text will be styled based on status prop. */\n info?: FormControlProps['info'];\n /**\n * CurrencyInput input value.\n * Requires an onChange handler to update value.\n * @default ''\n */\n value?: string;\n /** Callback fired when input value changes. */\n onChange: (value?: string) => void;\n /** Callback fired when the component loses focus. */\n onFocus?: (value?: string) => void;\n /** Callback fired when the component loses focus. */\n onBlur?: (value?: string) => void;\n /** Pass a heading and content to show additional information on the field. */\n additionalInfo?: FormControlProps['additionalInfo'];\n }\n >,\n 'type' | 'defaultValue'\n>;\n"]}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type { FunctionComponent } from 'react';
|
|
2
|
-
import type { ForwardProps } from '../../types';
|
|
3
1
|
import type { CreditCardDisplayProps } from './CreditCard.types';
|
|
4
|
-
declare const
|
|
5
|
-
export default
|
|
2
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<CreditCardDisplayProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
3
|
+
export default _default;
|
|
6
4
|
//# sourceMappingURL=CreditCardDisplay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreditCardDisplay.d.ts","sourceRoot":"","sources":["../../../src/components/CreditCard/CreditCardDisplay.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CreditCardDisplay.d.ts","sourceRoot":"","sources":["../../../src/components/CreditCard/CreditCardDisplay.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;;AAGjE,wBAuBG"}
|
|
@@ -3,12 +3,11 @@ import { forwardRef } from 'react';
|
|
|
3
3
|
import VisuallyHiddenText from '../VisuallyHiddenText';
|
|
4
4
|
import NoValue from '../NoValue/NoValue';
|
|
5
5
|
import { formatCreditCard } from './utils';
|
|
6
|
-
|
|
6
|
+
export default forwardRef(function CreditCardDisplay({ value, formattingOptions = {}, ...restProps }, ref) {
|
|
7
7
|
const formatted = value ? formatCreditCard(value, formattingOptions) : undefined;
|
|
8
8
|
return (_jsx("span", { ref: ref, ...restProps, children: formatted ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": 'true', children: formatted }), _jsx(VisuallyHiddenText, { children: formatted
|
|
9
9
|
.replace(/\s+/g, '.')
|
|
10
10
|
.replace(/([0-9•]\.?)/g, digit => `${digit} `)
|
|
11
11
|
.trim() })] })) : (_jsx(NoValue, {})) }));
|
|
12
12
|
});
|
|
13
|
-
export default CreditCardDisplay;
|
|
14
13
|
//# sourceMappingURL=CreditCardDisplay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreditCardDisplay.js","sourceRoot":"","sources":["../../../src/components/CreditCard/CreditCardDisplay.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAInC,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,OAAO,MAAM,oBAAoB,CAAC;AAGzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,
|
|
1
|
+
{"version":3,"file":"CreditCardDisplay.js","sourceRoot":"","sources":["../../../src/components/CreditCard/CreditCardDisplay.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAInC,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,OAAO,MAAM,oBAAoB,CAAC;AAGzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAe,UAAU,CAGvB,SAAS,iBAAiB,CAAC,EAAE,KAAK,EAAE,iBAAiB,GAAG,EAAE,EAAE,GAAG,SAAS,EAAE,EAAE,GAAG;IAC/E,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEjF,OAAO,CACL,eAAM,GAAG,EAAE,GAAG,KAAM,SAAS,YAC1B,SAAS,CAAC,CAAC,CAAC,CACX,8BACE,8BAAkB,MAAM,YAAE,SAAS,GAAQ,EAC3C,KAAC,kBAAkB,cAChB,SAAS;yBACP,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;yBACpB,OAAO,CAAC,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC;yBAC7C,IAAI,EAAE,GACU,IACpB,CACJ,CAAC,CAAC,CAAC,CACF,KAAC,OAAO,KAAG,CACZ,GACI,CACR,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { PropsWithoutRef } from 'react';\n\nimport type { RefElement } from '../../types';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\nimport NoValue from '../NoValue/NoValue';\n\nimport type { CreditCardDisplayProps } from './CreditCard.types';\nimport { formatCreditCard } from './utils';\n\nexport default forwardRef<\n RefElement<CreditCardDisplayProps>,\n PropsWithoutRef<CreditCardDisplayProps>\n>(function CreditCardDisplay({ value, formattingOptions = {}, ...restProps }, ref) {\n const formatted = value ? formatCreditCard(value, formattingOptions) : undefined;\n\n return (\n <span ref={ref} {...restProps}>\n {formatted ? (\n <>\n <span aria-hidden='true'>{formatted}</span>\n <VisuallyHiddenText>\n {formatted\n .replace(/\\s+/g, '.')\n .replace(/([0-9•]\\.?)/g, digit => `${digit} `)\n .trim()}\n </VisuallyHiddenText>\n </>\n ) : (\n <NoValue />\n )}\n </span>\n );\n});\n"]}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<Pick<import("../../types").WithAttributes<"input", import("../../types").NoChildrenProp & {
|
|
2
|
+
status?: "error" | "warning" | "success" | "pending" | undefined;
|
|
3
|
+
label?: import("react").ReactNode;
|
|
4
|
+
labelHidden?: boolean | undefined;
|
|
5
|
+
info?: import("react").ReactNode;
|
|
6
|
+
value?: string | undefined;
|
|
7
|
+
onChange: (value?: string | undefined) => void;
|
|
8
|
+
onFocus?: ((value?: string | undefined) => void) | undefined;
|
|
9
|
+
onBlur?: ((value?: string | undefined) => void) | undefined;
|
|
10
|
+
additionalInfo?: {
|
|
11
|
+
heading?: string | undefined;
|
|
12
|
+
content: string | JSX.Element;
|
|
13
|
+
} | undefined;
|
|
14
|
+
}>, "hidden" | "color" | "content" | "size" | "style" | "height" | "translate" | "width" | "multiple" | "disabled" | "prefix" | "src" | "form" | "label" | "slot" | "title" | "pattern" | "children" | "ref" | "key" | "accept" | "alt" | "autoComplete" | "capture" | "checked" | "crossOrigin" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "list" | "max" | "maxLength" | "min" | "minLength" | "name" | "status" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "enterKeyHint" | "readOnly" | "required" | "step" | "value" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "info" | "labelHidden" | "additionalInfo">, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
15
|
+
export default _default;
|
|
6
16
|
//# sourceMappingURL=CreditCardInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreditCardInput.d.ts","sourceRoot":"","sources":["../../../src/components/CreditCard/CreditCardInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CreditCardInput.d.ts","sourceRoot":"","sources":["../../../src/components/CreditCard/CreditCardInput.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAiBA,wBAwDE"}
|
|
@@ -4,7 +4,7 @@ import creditCardType from 'credit-card-type';
|
|
|
4
4
|
import Input from '../Input';
|
|
5
5
|
import { useConsolidatedRef, useInputFormatter } from '../../hooks';
|
|
6
6
|
import { formatCreditCard, isPossibleCardNumber } from './utils';
|
|
7
|
-
|
|
7
|
+
export default forwardRef(function CreditCardInput({ value = '', onChange, onBlur, onFocus, ...restProps }, ref) {
|
|
8
8
|
const onInputKeyDown = (e) => {
|
|
9
9
|
if (value && !isPossibleCardNumber(value) && Number.isFinite(Number.parseInt(e.key, 10))) {
|
|
10
10
|
e.target.value = '';
|
|
@@ -35,5 +35,4 @@ const CreditCardInput = forwardRef(function CreditCardInput({ value = '', onChan
|
|
|
35
35
|
const formatted = useInputFormatter(inputRef, value, (input) => formatCreditCard(input.replace(/\D+/g, ''), { obfuscation }));
|
|
36
36
|
return (_jsx(Input, { ...restProps, inputMode: 'numeric', ref: inputRef, value: formatted, onChange: onInputChange, onBlur: onInputBlur, onFocus: onInputFocus, onPaste: onPaste, onKeyDown: onInputKeyDown, maxLength: maxLength, autoComplete: 'cc-number' }));
|
|
37
37
|
});
|
|
38
|
-
export default CreditCardInput;
|
|
39
38
|
//# sourceMappingURL=CreditCardInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreditCardInput.js","sourceRoot":"","sources":["../../../src/components/CreditCard/CreditCardInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAQnC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAG9C,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGpE,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEjE,
|
|
1
|
+
{"version":3,"file":"CreditCardInput.js","sourceRoot":"","sources":["../../../src/components/CreditCard/CreditCardInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAQnC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAG9C,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGpE,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEjE,eAAe,UAAU,CACvB,SAAS,eAAe,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,EAAE,GAAG;IACnF,MAAM,cAAc,GAAG,CAAC,CAAgB,EAAE,EAAE;QAC1C,IAAI,KAAK,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAA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,CAAC,QAAQ,EAAE,CAAC,CAAC;YAClC,CAAC,CAAC,cAAc,EAAE,CAAC;SACpB;IACH,CAAC,CAAC;IAEF,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAE/F,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;IAE1D,MAAM,QAAQ,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACzC,MAAM,SAAS,GAAG,iBAAiB,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,KAAa,EAAE,EAAE,CACrE,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,CAAC,CAC7D,CAAC;IAEF,OAAO,CACL,KAAC,KAAK,OACA,SAAS,EACb,SAAS,EAAC,SAAS,EACnB,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,cAAc,EACzB,SAAS,EAAE,SAAS,EACpB,YAAY,EAAC,WAAW,GACxB,CACH,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type {\n PropsWithoutRef,\n ChangeEvent,\n ClipboardEvent,\n KeyboardEvent,\n FocusEvent\n} from 'react';\nimport creditCardType from 'credit-card-type';\n\nimport type { RefElement } from '../../types';\nimport Input from '../Input';\nimport { useConsolidatedRef, useInputFormatter } from '../../hooks';\n\nimport type { CreditCardInputProps } from './CreditCard.types';\nimport { formatCreditCard, isPossibleCardNumber } from './utils';\n\nexport default forwardRef<RefElement<CreditCardInputProps>, PropsWithoutRef<CreditCardInputProps>>(\n function CreditCardInput({ value = '', onChange, onBlur, onFocus, ...restProps }, ref) {\n const onInputKeyDown = (e: KeyboardEvent) => {\n if (value && !isPossibleCardNumber(value) && Number.isFinite(Number.parseInt(e.key, 10))) {\n (e.target as HTMLInputElement).value = '';\n }\n };\n\n const onInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n onChange(e.target.value ? e.target.value.replace(/\\D+/g, '') : undefined);\n };\n\n const onInputBlur = (e: FocusEvent) => {\n const inputValue = (e.target as HTMLInputElement).value;\n onBlur?.(inputValue ? inputValue.replace(/\\D+/g, '') : undefined);\n };\n\n const onInputFocus = (e: FocusEvent) => {\n const inputValue = (e.target as HTMLInputElement).value;\n onFocus?.(inputValue ? inputValue.replace(/\\D+/g, '') : undefined);\n };\n\n const onPaste = (e: ClipboardEvent) => {\n const text = e.clipboardData.getData('text').replace(/\\D+/g, '');\n const [{ lengths: [inferredLength] = [] } = {}] = creditCardType(text);\n if (text.length > inferredLength) {\n onChange(Number(text).toString());\n e.preventDefault();\n }\n };\n\n const maxLength = value ? Math.max(...(creditCardType(value)[0]?.lengths || [16])) : undefined;\n\n const obfuscation = /\\D/.test(value) ? 'partial' : 'none';\n\n const inputRef = useConsolidatedRef(ref);\n const formatted = useInputFormatter(inputRef, value, (input: string) =>\n formatCreditCard(input.replace(/\\D+/g, ''), { obfuscation })\n );\n\n return (\n <Input\n {...restProps}\n inputMode='numeric'\n ref={inputRef}\n value={formatted}\n onChange={onInputChange}\n onBlur={onInputBlur}\n onFocus={onInputFocus}\n onPaste={onPaste}\n onKeyDown={onInputKeyDown}\n maxLength={maxLength}\n autoComplete='cc-number'\n />\n );\n }\n);\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const getCurrencyInputTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
1
|
+
export declare const getCurrencyInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
2
2
|
//# sourceMappingURL=Currency.test-ids.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Currency.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Currency/Currency.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"Currency.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Currency/Currency.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,+KAGzB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import type { FunctionComponent } from 'react';
|
|
|
2
2
|
import type { ForwardProps } from '../../types';
|
|
3
3
|
import type CurrencyInputProps from './CurrencyInput.types';
|
|
4
4
|
declare const _default: FunctionComponent<CurrencyInputProps & ForwardProps> & {
|
|
5
|
-
getTestIds: (testIdProp?: string | undefined) => import("../../types").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
5
|
+
getTestIds: (testIdProp?: string | null | undefined) => import("../../types").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
8
8
|
//# sourceMappingURL=CurrencyInput.d.ts.map
|
|
@@ -94,7 +94,7 @@ const CurrencyInput = forwardRef(function CurrencyInput(props, ref) {
|
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
const formattedValue = useInputFormatter(inputRef, value, formatValue, `\\p{N}${decimalSign}-`);
|
|
97
|
-
const Comp = (_jsxs(_Fragment, { children: [_jsx(Input, { "data-testid": testIds.control, onChange: onInputChange, id: id, readOnly: readOnly, required: required, disabled: disabled, status: status, ...restProps,
|
|
97
|
+
const Comp = (_jsxs(_Fragment, { children: [_jsx(Input, { "data-testid": testIds.control, onChange: onInputChange, id: id, readOnly: readOnly, required: required, disabled: disabled, status: status, ...restProps, onResolveSuggestion: onResolveSuggestion, inputMode: 'numeric', ref: inputRef, value: formattedValue, onKeyDown: onKeyDown, onFocus: onInputFocusEvent, onBlur: onInputFocusEvent, "aria-describedby": validCurrencyISOCode ? descriptionId : undefined, maxLength: 16 }), validCurrencyISOCode && (_jsx(VisuallyHiddenText, { id: descriptionId, "aria-hidden": true, children: t('measured_in', [validCurrencyISOCode]) }))] }));
|
|
98
98
|
return label ? (_jsx(FormField, { testId: testIds, label: label, labelHidden: labelHidden, id: id, info: info, status: status, required: required, disabled: disabled, additionalInfo: additionalInfo, onResolveSuggestion: onResolveSuggestion, children: Comp })) : (Comp);
|
|
99
99
|
});
|
|
100
100
|
export default withTestIds(CurrencyInput, getCurrencyInputTestIds);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrencyInput.js","sourceRoot":"","sources":["../../../src/components/Currency/CurrencyInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AASzD,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,OAAO,EACP,iBAAiB,EACjB,WAAW,EACX,UAAU,EACV,MAAM,EACP,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EAAE,gCAAgC,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/F,OAAO,EAAE,uBAAuB,EA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,EACb,aAAa,EAAE,MAAM,KAAK,SAAS,IAAI,CAAC,CAAC,mBAAmB,EAC5D,SAAS,EAAC,SAAS,EACnB,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,cAAc,EACrB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,iBAAiB,sBACP,oBAAoB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,EAClE,SAAS,EAAE,EAAE,GACb,EACD,oBAAoB,IAAI,CACvB,KAAC,kBAAkB,IAAC,EAAE,EAAE,aAAa,iCAClC,CAAC,CAAC,aAAa,EAAE,CAAC,oBAAoB,CAAC,CAAC,GACtB,CACtB,IACA,CACJ,CAAC;IAEF,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,KAAC,SAAS,IACR,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,mBAAmB,EAAE,mBAAmB,YAEvC,IAAI,GACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,aAAa,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { forwardRef, useCallback, useMemo } from 'react';\nimport type {\n FunctionComponent,\n PropsWithoutRef,\n KeyboardEvent,\n ChangeEvent,\n FocusEvent\n} from 'react';\n\nimport VisuallyHiddenText from '../VisuallyHiddenText';\nimport FormField from '../FormField';\nimport type { ForwardProps } from '../../types';\nimport {\n useConfiguration,\n useConsolidatedRef,\n useI18n,\n useInputFormatter,\n usePrevious,\n useTestIds,\n useUID\n} from '../../hooks';\nimport {\n getCleanedValue,\n getDecimalSign,\n getDecrementedValue,\n getIncrementedValue\n} from '../Number/utils';\nimport Input from '../Input';\nimport { withTestIds } from '../../utils';\n\nimport type CurrencyInputProps from './CurrencyInput.types';\nimport { getCurrencyMinimumFractionDigits, getFormattedValue, isValidCurrency } from './utils';\nimport { getCurrencyInputTestIds } from './Currency.test-ids';\n\nconst CurrencyInput: FunctionComponent<CurrencyInputProps & ForwardProps> = forwardRef(\n function CurrencyInput(\n props: PropsWithoutRef<CurrencyInputProps>,\n ref: CurrencyInputProps['ref']\n ) {\n const uid = useUID();\n const {\n testId,\n id = uid,\n status,\n label,\n labelHidden,\n info,\n required,\n disabled,\n readOnly,\n additionalInfo,\n value: valueProp = '',\n onChange,\n onBlur,\n onFocus,\n onResolveSuggestion,\n currencyISOCode,\n showDecimal = true,\n showGroupSeparators = true,\n min = Number.MIN_SAFE_INTEGER,\n max = Number.MAX_SAFE_INTEGER,\n step = 1,\n alwaysShowISOCode = false,\n maximumFractionDigits = 0,\n ...restProps\n } = props;\n\n const descriptionId = useUID();\n const testIds = useTestIds(testId, getCurrencyInputTestIds);\n\n const { locale } = useConfiguration();\n\n const t = useI18n();\n const inputRef = useConsolidatedRef(ref);\n\n const validCurrencyISOCode = useMemo(\n () => (currencyISOCode && isValidCurrency(currencyISOCode) ? currencyISOCode : undefined),\n [currencyISOCode]\n );\n\n const minimumFractionDigits = useMemo(\n () => getCurrencyMinimumFractionDigits(locale, validCurrencyISOCode),\n [locale, validCurrencyISOCode]\n );\n\n const numberOfDecimals = showDecimal\n ? Math.max(maximumFractionDigits, minimumFractionDigits)\n : 0;\n\n const decimalSign = useMemo(() => getDecimalSign(locale), [locale]);\n\n // on initial render only pad the value with 0 if necessary\n const rendered = usePrevious(true);\n let value = valueProp;\n if (!rendered && validCurrencyISOCode && !Number.isNaN(parseFloat(value))) {\n const [integer, fraction = ''] = value.split('.');\n value = `${integer}.${fraction.padEnd(numberOfDecimals, '0')}`;\n }\n\n const formatValue = useCallback(\n number => {\n return getFormattedValue(number, locale, validCurrencyISOCode, {\n showGroupSeparators,\n showAs: alwaysShowISOCode ? 'code' : 'symbol',\n numberOfDecimals\n });\n },\n [alwaysShowISOCode, numberOfDecimals, showGroupSeparators, locale, validCurrencyISOCode]\n );\n\n const onInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n const cleanedInputValue = getCleanedValue(inputValue, decimalSign, numberOfDecimals);\n if (cleanedInputValue === value) return;\n onChange(cleanedInputValue);\n };\n\n const onKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (readOnly) return;\n const input = e.currentTarget;\n switch (e.key) {\n case 'ArrowUp':\n e.preventDefault();\n onChange(getIncrementedValue(value, min, max, step));\n break;\n case 'ArrowDown':\n e.preventDefault();\n onChange(getDecrementedValue(value, min, max, step));\n break;\n case decimalSign:\n if (!showDecimal) e.preventDefault();\n if (input.value.includes(decimalSign)) {\n if (input.selectionStart && input.value.charAt(input.selectionStart) === decimalSign) {\n input.setSelectionRange(input.selectionStart + 1, input.selectionStart + 1);\n }\n e.preventDefault();\n } else if (\n input.selectionStart !== null &&\n !input.value.charAt(input.selectionStart - 1).match(/\\d/)\n ) {\n onChange(\n getCleanedValue(`${input.value}0${decimalSign}`, decimalSign, numberOfDecimals)\n );\n e.preventDefault();\n }\n break;\n case '-':\n if (value.startsWith('-')) e.preventDefault();\n break;\n default:\n }\n };\n\n const onInputFocusEvent = (e: FocusEvent<HTMLInputElement>) => {\n let parsableValue = value;\n if (validCurrencyISOCode && !Number.isNaN(parseFloat(value))) {\n const [integer, fraction = ''] = value.split('.');\n parsableValue = `${integer}.${fraction.padEnd(numberOfDecimals, '0')}`;\n }\n\n if (e.type === 'focus') onFocus?.(parsableValue);\n else {\n if (parsableValue !== value) {\n onChange(parsableValue);\n }\n\n onBlur?.(parsableValue);\n }\n };\n\n const formattedValue = useInputFormatter(inputRef, value, formatValue, `\\\\p{N}${decimalSign}-`);\n\n const Comp = (\n <>\n <Input\n data-testid={testIds.control}\n onChange={onInputChange}\n id={id}\n readOnly={readOnly}\n required={required}\n disabled={disabled}\n status={status}\n {...restProps}\n hasSuggestion={status === 'pending' && !!onResolveSuggestion}\n inputMode='numeric'\n ref={inputRef}\n value={formattedValue}\n onKeyDown={onKeyDown}\n onFocus={onInputFocusEvent}\n onBlur={onInputFocusEvent}\n aria-describedby={validCurrencyISOCode ? descriptionId : undefined}\n maxLength={16}\n />\n {validCurrencyISOCode && (\n <VisuallyHiddenText id={descriptionId} aria-hidden>\n {t('measured_in', [validCurrencyISOCode])}\n </VisuallyHiddenText>\n )}\n </>\n );\n\n return label ? (\n <FormField\n testId={testIds}\n label={label}\n labelHidden={labelHidden}\n id={id}\n info={info}\n status={status}\n required={required}\n disabled={disabled}\n additionalInfo={additionalInfo}\n onResolveSuggestion={onResolveSuggestion}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default withTestIds(CurrencyInput, getCurrencyInputTestIds);\n"]}
|
|
1
|
+
{"version":3,"file":"CurrencyInput.js","sourceRoot":"","sources":["../../../src/components/Currency/CurrencyInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AASzD,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,OAAO,EACP,iBAAiB,EACjB,WAAW,EACX,UAAU,EACV,MAAM,EACP,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EAAE,gCAAgC,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/F,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAA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BAAmB,EACxC,SAAS,EAAC,SAAS,EACnB,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,cAAc,EACrB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,iBAAiB,sBACP,oBAAoB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,EAClE,SAAS,EAAE,EAAE,GACb,EACD,oBAAoB,IAAI,CACvB,KAAC,kBAAkB,IAAC,EAAE,EAAE,aAAa,iCAClC,CAAC,CAAC,aAAa,EAAE,CAAC,oBAAoB,CAAC,CAAC,GACtB,CACtB,IACA,CACJ,CAAC;IAEF,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,KAAC,SAAS,IACR,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,mBAAmB,EAAE,mBAAmB,YAEvC,IAAI,GACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,aAAa,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { forwardRef, useCallback, useMemo } from 'react';\nimport type {\n FunctionComponent,\n PropsWithoutRef,\n KeyboardEvent,\n ChangeEvent,\n FocusEvent\n} from 'react';\n\nimport VisuallyHiddenText from '../VisuallyHiddenText';\nimport FormField from '../FormField';\nimport type { ForwardProps } from '../../types';\nimport {\n useConfiguration,\n useConsolidatedRef,\n useI18n,\n useInputFormatter,\n usePrevious,\n useTestIds,\n useUID\n} from '../../hooks';\nimport {\n getCleanedValue,\n getDecimalSign,\n getDecrementedValue,\n getIncrementedValue\n} from '../Number/utils';\nimport Input from '../Input';\nimport { withTestIds } from '../../utils';\n\nimport type CurrencyInputProps from './CurrencyInput.types';\nimport { getCurrencyMinimumFractionDigits, getFormattedValue, isValidCurrency } from './utils';\nimport { getCurrencyInputTestIds } from './Currency.test-ids';\n\nconst CurrencyInput: FunctionComponent<CurrencyInputProps & ForwardProps> = forwardRef(\n function CurrencyInput(\n props: PropsWithoutRef<CurrencyInputProps>,\n ref: CurrencyInputProps['ref']\n ) {\n const uid = useUID();\n const {\n testId,\n id = uid,\n status,\n label,\n labelHidden,\n info,\n required,\n disabled,\n readOnly,\n additionalInfo,\n value: valueProp = '',\n onChange,\n onBlur,\n onFocus,\n onResolveSuggestion,\n currencyISOCode,\n showDecimal = true,\n showGroupSeparators = true,\n min = Number.MIN_SAFE_INTEGER,\n max = Number.MAX_SAFE_INTEGER,\n step = 1,\n alwaysShowISOCode = false,\n maximumFractionDigits = 0,\n ...restProps\n } = props;\n\n const descriptionId = useUID();\n const testIds = useTestIds(testId, getCurrencyInputTestIds);\n\n const { locale } = useConfiguration();\n\n const t = useI18n();\n const inputRef = useConsolidatedRef(ref);\n\n const validCurrencyISOCode = useMemo(\n () => (currencyISOCode && isValidCurrency(currencyISOCode) ? currencyISOCode : undefined),\n [currencyISOCode]\n );\n\n const minimumFractionDigits = useMemo(\n () => getCurrencyMinimumFractionDigits(locale, validCurrencyISOCode),\n [locale, validCurrencyISOCode]\n );\n\n const numberOfDecimals = showDecimal\n ? Math.max(maximumFractionDigits, minimumFractionDigits)\n : 0;\n\n const decimalSign = useMemo(() => getDecimalSign(locale), [locale]);\n\n // on initial render only pad the value with 0 if necessary\n const rendered = usePrevious(true);\n let value = valueProp;\n if (!rendered && validCurrencyISOCode && !Number.isNaN(parseFloat(value))) {\n const [integer, fraction = ''] = value.split('.');\n value = `${integer}.${fraction.padEnd(numberOfDecimals, '0')}`;\n }\n\n const formatValue = useCallback(\n number => {\n return getFormattedValue(number, locale, validCurrencyISOCode, {\n showGroupSeparators,\n showAs: alwaysShowISOCode ? 'code' : 'symbol',\n numberOfDecimals\n });\n },\n [alwaysShowISOCode, numberOfDecimals, showGroupSeparators, locale, validCurrencyISOCode]\n );\n\n const onInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n const cleanedInputValue = getCleanedValue(inputValue, decimalSign, numberOfDecimals);\n if (cleanedInputValue === value) return;\n onChange(cleanedInputValue);\n };\n\n const onKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (readOnly) return;\n const input = e.currentTarget;\n switch (e.key) {\n case 'ArrowUp':\n e.preventDefault();\n onChange(getIncrementedValue(value, min, max, step));\n break;\n case 'ArrowDown':\n e.preventDefault();\n onChange(getDecrementedValue(value, min, max, step));\n break;\n case decimalSign:\n if (!showDecimal) e.preventDefault();\n if (input.value.includes(decimalSign)) {\n if (input.selectionStart && input.value.charAt(input.selectionStart) === decimalSign) {\n input.setSelectionRange(input.selectionStart + 1, input.selectionStart + 1);\n }\n e.preventDefault();\n } else if (\n input.selectionStart !== null &&\n !input.value.charAt(input.selectionStart - 1).match(/\\d/)\n ) {\n onChange(\n getCleanedValue(`${input.value}0${decimalSign}`, decimalSign, numberOfDecimals)\n );\n e.preventDefault();\n }\n break;\n case '-':\n if (value.startsWith('-')) e.preventDefault();\n break;\n default:\n }\n };\n\n const onInputFocusEvent = (e: FocusEvent<HTMLInputElement>) => {\n let parsableValue = value;\n if (validCurrencyISOCode && !Number.isNaN(parseFloat(value))) {\n const [integer, fraction = ''] = value.split('.');\n parsableValue = `${integer}.${fraction.padEnd(numberOfDecimals, '0')}`;\n }\n\n if (e.type === 'focus') onFocus?.(parsableValue);\n else {\n if (parsableValue !== value) {\n onChange(parsableValue);\n }\n\n onBlur?.(parsableValue);\n }\n };\n\n const formattedValue = useInputFormatter(inputRef, value, formatValue, `\\\\p{N}${decimalSign}-`);\n\n const Comp = (\n <>\n <Input\n data-testid={testIds.control}\n onChange={onInputChange}\n id={id}\n readOnly={readOnly}\n required={required}\n disabled={disabled}\n status={status}\n {...restProps}\n onResolveSuggestion={onResolveSuggestion}\n inputMode='numeric'\n ref={inputRef}\n value={formattedValue}\n onKeyDown={onKeyDown}\n onFocus={onInputFocusEvent}\n onBlur={onInputFocusEvent}\n aria-describedby={validCurrencyISOCode ? descriptionId : undefined}\n maxLength={16}\n />\n {validCurrencyISOCode && (\n <VisuallyHiddenText id={descriptionId} aria-hidden>\n {t('measured_in', [validCurrencyISOCode])}\n </VisuallyHiddenText>\n )}\n </>\n );\n\n return label ? (\n <FormField\n testId={testIds}\n label={label}\n labelHidden={labelHidden}\n id={id}\n info={info}\n status={status}\n required={required}\n disabled={disabled}\n additionalInfo={additionalInfo}\n onResolveSuggestion={onResolveSuggestion}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default withTestIds(CurrencyInput, getCurrencyInputTestIds);\n"]}
|
|
@@ -3,13 +3,13 @@ import { forwardRef } from 'react';
|
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { defaultThemeProp } from '../../theme';
|
|
5
5
|
import Button from '../Button';
|
|
6
|
-
import
|
|
6
|
+
import { ThemeOverride } from '../Configuration';
|
|
7
7
|
import { useTheme } from '../../hooks';
|
|
8
8
|
export const StyledDangerButton = styled(Button) ``;
|
|
9
9
|
StyledDangerButton.defaultProps = defaultThemeProp;
|
|
10
10
|
export default forwardRef(function DangerButton({ label, primary = false, ...restProps }, ref) {
|
|
11
11
|
const theme = useTheme();
|
|
12
|
-
return (_jsx(
|
|
12
|
+
return (_jsx(ThemeOverride, { theme: {
|
|
13
13
|
base: {
|
|
14
14
|
palette: {
|
|
15
15
|
interactive: theme.base.palette.urgent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DangerButton.js","sourceRoot":"","sources":["../../../src/components/DangerButton/DangerButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,aAAa,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"DangerButton.js","sourceRoot":"","sources":["../../../src/components/DangerButton/DangerButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAevC,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA,EAAE,CAAC;AAEnD,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnD,eAAe,UAAU,CACvB,SAAS,YAAY,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,SAAS,EAAE,EAAE,GAAG;IACjE,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB,OAAO,CACL,KAAC,aAAa,IACZ,KAAK,EAAE;YACL,IAAI,EAAE;gBACJ,OAAO,EAAE;oBACP,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM;iBACvC;aACF;SACF,YAED,KAAC,kBAAkB,OAAK,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,YAClF,KAAK,GACa,GACP,CACjB,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { PropsWithoutRef } from 'react';\nimport styled from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport type { NoChildrenProp, RefElement, WithAttributes } from '../../types';\nimport Button from '../Button';\nimport { ThemeOverride } from '../Configuration';\nimport { useTheme } from '../../hooks';\n\nexport type DangerButtonProps = WithAttributes<\n 'button',\n NoChildrenProp & {\n /** Text content for the button. */\n label: NonNullable<HTMLButtonElement['textContent']>;\n /**\n * Elevates emphasis for button style.\n * @default false\n */\n primary?: boolean;\n }\n>;\n\nexport const StyledDangerButton = styled(Button)``;\n\nStyledDangerButton.defaultProps = defaultThemeProp;\n\nexport default forwardRef<RefElement<DangerButtonProps>, PropsWithoutRef<DangerButtonProps>>(\n function DangerButton({ label, primary = false, ...restProps }, ref) {\n const theme = useTheme();\n\n return (\n <ThemeOverride\n theme={{\n base: {\n palette: {\n interactive: theme.base.palette.urgent\n }\n }\n }}\n >\n <StyledDangerButton {...restProps} variant={primary ? 'primary' : undefined} ref={ref}>\n {label}\n </StyledDangerButton>\n </ThemeOverride>\n );\n }\n);\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export declare const getDurationInputTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly ["control-hour", "control-minute", "control-second", "control-number", "control-unit", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
2
|
-
export declare const getDateInputTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly ["control-day", "control-month", "control-year", "open-close-picker", "clear-current-date", "set-current-date", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
3
|
-
export declare const getDateRangeInputTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly ["from-date", "to-date", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
4
|
-
export declare const getDateTimeInputTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly ["control-day", "control-month", "control-year", "control-hour", "control-minute", "control-second", "control-period", "open-close-picker", "clear-current-date-and-time", "set-current-date-and-time", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
5
|
-
export declare const getDayOfWeekInputTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
6
|
-
export declare const getMonthInputTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly ["control-month", "control-year", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
7
|
-
export declare const getQuarterInputTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly ["control-quarter", "control-year", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
8
|
-
export declare const getTimeInputTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly ["control-hour", "control-minute", "control-second", "control-period", "open-close-picker", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
9
|
-
export declare const getTimeRangeInputTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly ["from-time", "to-time", "from-date-time", "to-date-time", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
10
|
-
export declare const getWeekInputTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly ["control-week", "control-year", "open-close-picker", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
11
|
-
export declare const getDatePickerTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly ["previous-month", "month", "next-month", "calendar", "time"]>;
|
|
1
|
+
export declare const getDurationInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["control-hour", "control-minute", "control-second", "control-number", "control-unit", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
2
|
+
export declare const getDateInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["control-day", "control-month", "control-year", "open-close-picker", "clear-current-date", "set-current-date", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
3
|
+
export declare const getDateRangeInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["from-date", "to-date", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
4
|
+
export declare const getDateTimeInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["control-day", "control-month", "control-year", "control-hour", "control-minute", "control-second", "control-period", "open-close-picker", "discard-changes", "apply-changes", "clear-current-date-and-time", "set-current-date-and-time", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
5
|
+
export declare const getDayOfWeekInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["control", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
6
|
+
export declare const getMonthInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["control-month", "control-year", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
7
|
+
export declare const getQuarterInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["control-quarter", "control-year", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
8
|
+
export declare const getTimeInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["control-hour", "control-minute", "control-second", "control-period", "open-close-picker", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
9
|
+
export declare const getTimeRangeInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["from-time", "to-time", "from-date-time", "to-date-time", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
10
|
+
export declare const getWeekInputTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["control-week", "control-year", "open-close-picker", "clear-current-week", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
11
|
+
export declare const getDatePickerTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["previous-month", "month", "next-month", "calendar", "time", "set-current-date"]>;
|
|
12
12
|
//# sourceMappingURL=DateTime.test-ids.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTime.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/DateTime.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"DateTime.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/DateTime/DateTime.test-ids.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,0PAOzB,CAAC;AAEZ,eAAO,MAAM,mBAAmB,mRAQrB,CAAC;AAEZ,eAAO,MAAM,wBAAwB,4LAI1B,CAAC;AAEZ,eAAO,MAAM,uBAAuB,+YAczB,CAAC;AAEZ,eAAO,MAAM,wBAAwB,+KAG1B,CAAC;AAEZ,eAAO,MAAM,oBAAoB,qMAItB,CAAC;AAEZ,eAAO,MAAM,sBAAsB,uMAIxB,CAAC;AAEZ,eAAO,MAAM,mBAAmB,+PAOrB,CAAC;AAEZ,eAAO,MAAM,wBAAwB,8NAM1B,CAAC;AAEZ,eAAO,MAAM,mBAAmB,+OAMrB,CAAC;AAEZ,eAAO,MAAM,oBAAoB,uKAOtB,CAAC"}
|
|
@@ -31,6 +31,8 @@ export const getDateTimeInputTestIds = createTestIds('date-time-input', [
|
|
|
31
31
|
'control-second',
|
|
32
32
|
'control-period',
|
|
33
33
|
'open-close-picker',
|
|
34
|
+
'discard-changes',
|
|
35
|
+
'apply-changes',
|
|
34
36
|
'clear-current-date-and-time',
|
|
35
37
|
'set-current-date-and-time',
|
|
36
38
|
...elements
|
|
@@ -68,6 +70,7 @@ export const getWeekInputTestIds = createTestIds('week-input', [
|
|
|
68
70
|
'control-week',
|
|
69
71
|
'control-year',
|
|
70
72
|
'open-close-picker',
|
|
73
|
+
'clear-current-week',
|
|
71
74
|
...elements
|
|
72
75
|
]);
|
|
73
76
|
export const getDatePickerTestIds = createTestIds('date-picker', [
|
|
@@ -75,6 +78,7 @@ export const getDatePickerTestIds = createTestIds('date-picker', [
|
|
|
75
78
|
'month',
|
|
76
79
|
'next-month',
|
|
77
80
|
'calendar',
|
|
78
|
-
'time'
|
|
81
|
+
'time',
|
|
82
|
+
'set-current-date'
|
|
79
83
|
]);
|
|
80
84
|
//# sourceMappingURL=DateTime.test-ids.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTime.test-ids.js","sourceRoot":"","sources":["../../../src/components/DateTime/DateTime.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAC,gBAAgB,EAAE;IACrE,cAAc;IACd,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,cAAc;IACd,GAAG,QAAQ;CACH,CAAC,CAAC;AAEZ,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC,YAAY,EAAE;IAC7D,aAAa;IACb,eAAe;IACf,cAAc;IACd,mBAAmB;IACnB,oBAAoB;IACpB,kBAAkB;IAClB,GAAG,QAAQ;CACH,CAAC,CAAC;AAEZ,MAAM,CAAC,MAAM,wBAAwB,GAAG,aAAa,CAAC,kBAAkB,EAAE;IACxE,WAAW;IACX,SAAS;IACT,GAAG,QAAQ;CACH,CAAC,CAAC;AAEZ,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAC,iBAAiB,EAAE;IACtE,aAAa;IACb,eAAe;IACf,cAAc;IACd,cAAc;IACd,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,mBAAmB;IACnB,6BAA6B;IAC7B,2BAA2B;IAC3B,GAAG,QAAQ;CACH,CAAC,CAAC;AAEZ,MAAM,CAAC,MAAM,wBAAwB,GAAG,aAAa,CAAC,mBAAmB,EAAE;IACzE,SAAS;IACT,GAAG,QAAQ;CACH,CAAC,CAAC;AAEZ,MAAM,CAAC,MA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AC,YAAY,EAAE;IAC7D,cAAc;IACd,cAAc;IACd,mBAAmB;IACnB,oBAAoB;IACpB,GAAG,QAAQ;CACH,CAAC,CAAC;AAEZ,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC,aAAa,EAAE;IAC/D,gBAAgB;IAChB,OAAO;IACP,YAAY;IACZ,UAAU;IACV,MAAM;IACN,kBAAkB;CACV,CAAC,CAAC","sourcesContent":["import { createTestIds } from '../../utils';\nimport { elements } from '../FormField/FormField.test-ids';\n\nexport const getDurationInputTestIds = createTestIds('duration-input', [\n 'control-hour',\n 'control-minute',\n 'control-second',\n 'control-number',\n 'control-unit',\n ...elements\n] as const);\n\nexport const getDateInputTestIds = createTestIds('date-input', [\n 'control-day',\n 'control-month',\n 'control-year',\n 'open-close-picker',\n 'clear-current-date',\n 'set-current-date',\n ...elements\n] as const);\n\nexport const getDateRangeInputTestIds = createTestIds('date-range-input', [\n 'from-date',\n 'to-date',\n ...elements\n] as const);\n\nexport const getDateTimeInputTestIds = createTestIds('date-time-input', [\n 'control-day',\n 'control-month',\n 'control-year',\n 'control-hour',\n 'control-minute',\n 'control-second',\n 'control-period',\n 'open-close-picker',\n 'discard-changes',\n 'apply-changes',\n 'clear-current-date-and-time',\n 'set-current-date-and-time',\n ...elements\n] as const);\n\nexport const getDayOfWeekInputTestIds = createTestIds('day-of-week-input', [\n 'control',\n ...elements\n] as const);\n\nexport const getMonthInputTestIds = createTestIds('month-input', [\n 'control-month',\n 'control-year',\n ...elements\n] as const);\n\nexport const getQuarterInputTestIds = createTestIds('quarter-input', [\n 'control-quarter',\n 'control-year',\n ...elements\n] as const);\n\nexport const getTimeInputTestIds = createTestIds('time-input', [\n 'control-hour',\n 'control-minute',\n 'control-second',\n 'control-period',\n 'open-close-picker',\n ...elements\n] as const);\n\nexport const getTimeRangeInputTestIds = createTestIds('time-range-input', [\n 'from-time',\n 'to-time',\n 'from-date-time',\n 'to-date-time',\n ...elements\n] as const);\n\nexport const getWeekInputTestIds = createTestIds('week-input', [\n 'control-week',\n 'control-year',\n 'open-close-picker',\n 'clear-current-week',\n ...elements\n] as const);\n\nexport const getDatePickerTestIds = createTestIds('date-picker', [\n 'previous-month',\n 'month',\n 'next-month',\n 'calendar',\n 'time',\n 'set-current-date'\n] as const);\n"]}
|
|
@@ -24,7 +24,7 @@ export interface DateInputProps extends DateTimeProps {
|
|
|
24
24
|
}
|
|
25
25
|
export declare const StyledDateInput: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, DateInputProps, never>;
|
|
26
26
|
declare const _default: FunctionComponent<DateInputProps & ForwardProps> & {
|
|
27
|
-
getTestIds: (testIdProp?: string | undefined) => import("../../../types").TestIdsRecord<readonly ["control-day", "control-month", "control-year", "open-close-picker", "clear-current-date", "set-current-date", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
27
|
+
getTestIds: (testIdProp?: string | null | undefined) => import("../../../types").TestIdsRecord<readonly ["control-day", "control-month", "control-year", "open-close-picker", "clear-current-date", "set-current-date", "label", "info", "additional-info", "suggestion-accept", "suggestion-reject"]>;
|
|
28
28
|
};
|
|
29
29
|
export default _default;
|
|
30
30
|
//# sourceMappingURL=DateInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/DateInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,iBAAiB,EAEjB,GAAG,EAEH,QAAQ,EACR,cAAc,EACd,aAAa,EACd,MAAM,OAAO,CAAC;AAWf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../../src/components/DateTime/Input/DateInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,iBAAiB,EAEjB,GAAG,EAEH,QAAQ,EACR,cAAc,EACd,aAAa,EACd,MAAM,OAAO,CAAC;AAWf,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAMnD,OAAO,KAAK,eAAe,MAAM,4BAA4B,CAAC;AAE9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,aAAa,MAAM,mBAAmB,CAAC;AAyBnD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kCAAkC;IAClC,MAAM,CAAC,EAAE;QACP,QAAQ,EAAE,aAAa,CAAC;QACxB,aAAa,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,YAAY,CAAC;KACzD,CAAC;IACF,8EAA8E;IAC9E,cAAc,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACpD,oDAAoD;IACpD,MAAM,CAAC,EAAE,GAAG,CAAC,oBAAoB,CAAC,CAAC;CACpC;AAED,eAAO,MAAM,eAAe,qHAE3B,CAAC;;;;AAmWF,wBAA2D"}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
2
|
-
import { forwardRef, useRef, useImperativeHandle, useEffect } from 'react';
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useRef, useImperativeHandle, useEffect, useState } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { defaultThemeProp } from '../../../theme';
|
|
5
5
|
import { useConfiguration, useFocusWithin, useI18n, useOuterEvent, useTestIds } from '../../../hooks';
|
|
6
6
|
import FormField from '../../FormField';
|
|
7
7
|
import Flex from '../../Flex';
|
|
8
|
-
import Button from '../../Button';
|
|
9
8
|
import Icon, { registerIcon } from '../../Icon';
|
|
10
9
|
import * as calendarIcon from '../../Icon/icons/calendar.icon';
|
|
11
10
|
import DatePicker from '../Picker/DatePicker';
|
|
12
11
|
import { StyledFormControl } from '../../FormControl';
|
|
13
|
-
import {
|
|
12
|
+
import { withTestIds } from '../../../utils';
|
|
14
13
|
import { getDateInputTestIds } from '../DateTime.test-ids';
|
|
15
14
|
import { getDateFormat, parsePastedTextToDate, parseToDate, validateDate, generatePickerButtonAriaLabel } from './utils';
|
|
16
|
-
import StyledDateTime, {
|
|
15
|
+
import StyledDateTime, { StyledDatePickerDialog, StyledDialogContent, StyledInputButton, StyledInputContainer } from './DateTime.styles';
|
|
17
16
|
import useAutoFocusNextInput from './useAutoFocusNextInput';
|
|
18
17
|
import PartInput from './PartInput';
|
|
19
18
|
import usePickerButton from './usePickerButton';
|
|
@@ -61,6 +60,10 @@ const DateInput = forwardRef(function DateInput(props, ref) {
|
|
|
61
60
|
useRef(null),
|
|
62
61
|
useRef(null)
|
|
63
62
|
];
|
|
63
|
+
const [hasValue, setHasValue] = useState(!!date);
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
setHasValue(!!date);
|
|
66
|
+
}, [date]);
|
|
64
67
|
const pickParts = () => {
|
|
65
68
|
return {
|
|
66
69
|
day: dayInputRef.current?.value || undefined,
|
|
@@ -81,7 +84,7 @@ const DateInput = forwardRef(function DateInput(props, ref) {
|
|
|
81
84
|
: undefined;
|
|
82
85
|
}
|
|
83
86
|
};
|
|
84
|
-
const [open, setOpen, , setPopoverRef,
|
|
87
|
+
const [open, setOpen, , setPopoverRef, datePickerButtonEl, setDatePickerButtonEl] = usePickerButton();
|
|
85
88
|
const inputContainerRef = useRef(null);
|
|
86
89
|
const onFocusChange = (focused) => {
|
|
87
90
|
const callbackParam = convertToCallbackParameter(date ? new Date(date) : new Date(), pickParts());
|
|
@@ -95,7 +98,13 @@ const DateInput = forwardRef(function DateInput(props, ref) {
|
|
|
95
98
|
};
|
|
96
99
|
const onInputChange = () => {
|
|
97
100
|
onChange?.(convertToCallbackParameter(date ? new Date(date) : new Date(), pickParts()));
|
|
98
|
-
|
|
101
|
+
datePickerButtonEl?.setAttribute('aria-label', generatePickerButtonAriaLabel(currentlySelectedDate(), 'date', locale, t, open));
|
|
102
|
+
if (dayInputRef.current?.value || monthInputRef.current?.value || yearInputRef.current?.value) {
|
|
103
|
+
setHasValue(true);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
setHasValue(false);
|
|
107
|
+
}
|
|
99
108
|
};
|
|
100
109
|
const setInputValue = (newValue) => {
|
|
101
110
|
if (dayInputRef.current && monthInputRef.current && yearInputRef.current) {
|
|
@@ -103,6 +112,7 @@ const DateInput = forwardRef(function DateInput(props, ref) {
|
|
|
103
112
|
monthInputRef.current.value =
|
|
104
113
|
(newValue && (newValue.getUTCMonth() + 1).toString().padStart(2, '0')) ?? '';
|
|
105
114
|
yearInputRef.current.value = newValue?.getUTCFullYear().toString() ?? '';
|
|
115
|
+
setHasValue(!!newValue);
|
|
106
116
|
}
|
|
107
117
|
};
|
|
108
118
|
const onPaste = (e) => {
|
|
@@ -125,29 +135,15 @@ const DateInput = forwardRef(function DateInput(props, ref) {
|
|
|
125
135
|
const YearInput = (_jsx(PartInput, { "data-testid": testIds.controlYear, placeholder: t('year_placeholder'), "aria-label": displayNames.of('year'), value: date?.getUTCFullYear(), onChange: onInputChange, size: 4, maxLength: 4, padWithZeros: false, readOnly: readOnly, min: 1, ref: yearInputRef }, 'year'));
|
|
126
136
|
useFocusWithin([containerRef], onFocusChange);
|
|
127
137
|
useImperativeHandle(handle, () => ({ setOpen }));
|
|
128
|
-
const PickerButton = (_jsxs(_Fragment, { children: [_jsx(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
setInputValue(undefined);
|
|
136
|
-
setOpen(false);
|
|
137
|
-
setTimeout(() => buttonEl?.focus());
|
|
138
|
-
onInputChange();
|
|
139
|
-
}, children: t('clear') }), _jsx(Button, { "data-testid": testIds.setCurrentDate, "aria-label": t('set_current_date_a11y'), onClick: () => {
|
|
140
|
-
const now = new Date();
|
|
141
|
-
now.setUTCMinutes(now.getMinutes());
|
|
142
|
-
now.setUTCHours(now.getHours());
|
|
143
|
-
now.setUTCSeconds(now.getSeconds());
|
|
144
|
-
setInputValue(now);
|
|
145
|
-
setOpen(false);
|
|
146
|
-
setTimeout(() => buttonEl?.focus());
|
|
147
|
-
onInputChange();
|
|
148
|
-
}, children: cap(new Intl.RelativeTimeFormat(locale, { numeric: 'auto' }).format(0, 'day')) })] })] }) }))] }));
|
|
138
|
+
const PickerButton = (_jsxs(_Fragment, { children: [_jsx(StyledInputButton, { "data-testid": testIds.openClosePicker, variant: 'simple', icon: true, ref: setDatePickerButtonEl, onClick: () => setOpen(cur => !cur), "aria-label": generatePickerButtonAriaLabel(currentlySelectedDate(), 'date', locale, t, open), readOnly: readOnly, disabled: disabled, children: _jsx(Icon, { name: 'calendar' }) }), open && datePickerButtonEl && (_jsx(StyledDatePickerDialog, { ref: setPopoverRef, target: datePickerButtonEl, placement: 'bottom-end', "aria-label": t('choose_date'), children: _jsx(Flex, { container: { direction: 'column' }, as: StyledDialogContent, children: _jsx(PickerComp, { testId: testIds.root, selected: currentlySelectedDate(), min: min, max: max, showWeekNumber: showWeekNumber, ...rendererProps, onChange: selected => {
|
|
139
|
+
setInputValue(selected);
|
|
140
|
+
setOpen(false);
|
|
141
|
+
setTimeout(() => datePickerButtonEl?.focus());
|
|
142
|
+
onInputChange();
|
|
143
|
+
rendererProps?.onChange?.(selected);
|
|
144
|
+
} }) }) }))] }));
|
|
149
145
|
const orderedRefs = [];
|
|
150
|
-
const Comp = (_jsxs(Flex, { "data-testid": testIds.root, as: StyledDateInput, forwardedAs: StyledFormControl, hasSuggestion: status === 'pending' && !!onResolveSuggestion, container: { alignItems: 'center', wrap: 'nowrap' }, status: status, readOnly: readOnly, disabled: disabled, ref: containerRef, onClick: (e) => {
|
|
146
|
+
const Comp = (_jsxs(Flex, { "data-testid": testIds.root, as: StyledDateInput, forwardedAs: StyledFormControl, hasSuggestion: status === 'pending' && !!onResolveSuggestion, container: { alignItems: 'center', wrap: 'nowrap', justify: 'between' }, status: status, readOnly: readOnly, disabled: disabled, ref: containerRef, onClick: (e) => {
|
|
151
147
|
if (e.target === containerRef.current)
|
|
152
148
|
orderedRefs[0].current?.focus();
|
|
153
149
|
}, ...restProps, children: [_jsx(Flex, { ref: inputContainerRef, as: StyledInputContainer, container: { alignItems: 'center', wrap: 'wrap' }, onPaste: onPaste, children: getDateFormat(locale).map(part => {
|
|
@@ -164,7 +160,11 @@ const DateInput = forwardRef(function DateInput(props, ref) {
|
|
|
164
160
|
default:
|
|
165
161
|
return part;
|
|
166
162
|
}
|
|
167
|
-
}) }), !readOnly &&
|
|
163
|
+
}) }), _jsxs(Flex, { container: true, children: [!readOnly && hasValue && (_jsx(StyledInputButton, { "data-testid": testIds.clearCurrentDate, "aria-label": t('clear_current_date'), icon: true, onClick: () => {
|
|
164
|
+
setInputValue(undefined);
|
|
165
|
+
setTimeout(() => datePickerButtonEl?.focus());
|
|
166
|
+
onInputChange();
|
|
167
|
+
}, variant: 'simple', compact: true, label: t('clear'), children: _jsx(Icon, { name: 'times' }) })), !readOnly && PickerButton] })] }));
|
|
168
168
|
useEffect(() => {
|
|
169
169
|
if (autoFocus)
|
|
170
170
|
orderedRefs[0].current?.focus();
|