@pega/cosmos-react-core 2.0.0-dev.9.4 → 2.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/lib/components/Actions/Actions.js +1 -1
- 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 +1 -6
- package/lib/components/AppShell/AppHeader.js.map +1 -1
- package/lib/components/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.js +88 -63
- package/lib/components/AppShell/AppShell.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts +19 -16
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +227 -173
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/AppShell.types.d.ts +7 -7
- 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 -0
- package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellContext.js +9 -1
- package/lib/components/AppShell/AppShellContext.js.map +1 -1
- package/lib/components/AppShell/AppShellList.d.ts +4 -3
- package/lib/components/AppShell/AppShellList.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellList.js +24 -19
- package/lib/components/AppShell/AppShellList.js.map +1 -1
- package/lib/components/AppShell/Drawer.d.ts.map +1 -1
- package/lib/components/AppShell/Drawer.js +7 -8
- package/lib/components/AppShell/Drawer.js.map +1 -1
- package/lib/components/AppShell/Operator.js +3 -5
- package/lib/components/AppShell/Operator.js.map +1 -1
- package/lib/components/AppShell/SkipNavigation.d.ts.map +1 -1
- package/lib/components/AppShell/SkipNavigation.js +30 -39
- package/lib/components/AppShell/SkipNavigation.js.map +1 -1
- package/lib/components/AppShell/index.d.ts +1 -0
- package/lib/components/AppShell/index.d.ts.map +1 -1
- package/lib/components/AppShell/index.js +1 -0
- package/lib/components/AppShell/index.js.map +1 -1
- package/lib/components/Avatar/Avatar.d.ts.map +1 -1
- package/lib/components/Avatar/Avatar.js +5 -4
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/Backdrop/Backdrop.d.ts +1 -1
- package/lib/components/Backdrop/Backdrop.d.ts.map +1 -1
- package/lib/components/Backdrop/Backdrop.js +7 -6
- package/lib/components/Backdrop/Backdrop.js.map +1 -1
- package/lib/components/Backdrop/index.d.ts +1 -2
- package/lib/components/Backdrop/index.d.ts.map +1 -1
- package/lib/components/Backdrop/index.js +1 -2
- package/lib/components/Backdrop/index.js.map +1 -1
- package/lib/components/Badges/Alert.d.ts +2 -2
- package/lib/components/Badges/Alert.d.ts.map +1 -1
- package/lib/components/Badges/Alert.js +1 -1
- package/lib/components/Badges/Alert.js.map +1 -1
- package/lib/components/Badges/Count.js +1 -1
- package/lib/components/Badges/Count.js.map +1 -1
- package/lib/components/Badges/Selection.d.ts.map +1 -1
- package/lib/components/Badges/Selection.js +10 -9
- package/lib/components/Badges/Selection.js.map +1 -1
- package/lib/components/Badges/Status.d.ts +2 -2
- package/lib/components/Badges/Status.d.ts.map +1 -1
- package/lib/components/Badges/Status.js +1 -1
- package/lib/components/Badges/Status.js.map +1 -1
- package/lib/components/Badges/Tag.js +1 -1
- package/lib/components/Badges/Tag.js.map +1 -1
- package/lib/components/Banner/Banner.d.ts +2 -2
- package/lib/components/Banner/Banner.d.ts.map +1 -1
- package/lib/components/Banner/Banner.js +6 -8
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Boolean/BooleanDisplay.d.ts +2 -2
- package/lib/components/Boolean/BooleanDisplay.d.ts.map +1 -1
- package/lib/components/Boolean/BooleanDisplay.js +1 -2
- package/lib/components/Boolean/BooleanDisplay.js.map +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.js +13 -11
- package/lib/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/lib/components/Button/BareButton.d.ts.map +1 -1
- package/lib/components/Button/BareButton.js +21 -2
- package/lib/components/Button/BareButton.js.map +1 -1
- package/lib/components/Button/BareRoleButton.d.ts +12 -0
- package/lib/components/Button/BareRoleButton.d.ts.map +1 -0
- package/lib/components/Button/BareRoleButton.js +20 -0
- package/lib/components/Button/BareRoleButton.js.map +1 -0
- package/lib/components/Button/Button.d.ts +5 -0
- package/lib/components/Button/Button.d.ts.map +1 -1
- package/lib/components/Button/Button.js +34 -10
- 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 +3 -2
- package/lib/components/Card/Card.js.map +1 -1
- package/lib/components/Card/CardContent.d.ts.map +1 -1
- package/lib/components/Card/CardContent.js +5 -4
- package/lib/components/Card/CardContent.js.map +1 -1
- package/lib/components/Card/CardFooter.d.ts.map +1 -1
- package/lib/components/Card/CardFooter.js +5 -4
- package/lib/components/Card/CardFooter.js.map +1 -1
- package/lib/components/Card/CardHeader.d.ts +3 -1
- package/lib/components/Card/CardHeader.d.ts.map +1 -1
- package/lib/components/Card/CardHeader.js +9 -7
- package/lib/components/Card/CardHeader.js.map +1 -1
- package/lib/components/Card/CardMedia.js +1 -1
- package/lib/components/Card/CardMedia.js.map +1 -1
- package/lib/components/Card/CollapsibleCard.d.ts.map +1 -1
- package/lib/components/Card/CollapsibleCard.js +5 -7
- package/lib/components/Card/CollapsibleCard.js.map +1 -1
- package/lib/components/Card/SelectableCard.js +1 -1
- package/lib/components/Card/SelectableCard.js.map +1 -1
- package/lib/components/Checkbox/Checkbox.d.ts +2 -2
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/Checkbox.js +1 -1
- package/lib/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.d.ts +2 -2
- package/lib/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.js +8 -11
- package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.js +43 -63
- package/lib/components/ComboBox/ComboBox.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.types.d.ts +2 -1
- 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/ComboBoxInput.js +4 -4
- package/lib/components/ComboBox/ComboBoxInput.js.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +23 -29
- package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts.map +1 -1
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js +16 -12
- package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
- package/lib/components/Configuration/Configuration.js +11 -13
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/Currency/CurrencyDisplay.d.ts +6 -2
- package/lib/components/Currency/CurrencyDisplay.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyDisplay.js +11 -7
- package/lib/components/Currency/CurrencyDisplay.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.js +16 -16
- package/lib/components/Currency/CurrencyInput.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.d.ts +6 -2
- package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
- package/lib/components/Currency/utils.d.ts +12 -1
- package/lib/components/Currency/utils.d.ts.map +1 -1
- package/lib/components/Currency/utils.js +30 -2
- package/lib/components/Currency/utils.js.map +1 -1
- package/lib/components/DateTime/DateTime.types.d.ts +2 -1
- package/lib/components/DateTime/DateTime.types.d.ts.map +1 -1
- package/lib/components/DateTime/DateTime.types.js.map +1 -1
- package/lib/components/DateTime/DateTimeDisplay.d.ts +1 -1
- package/lib/components/DateTime/DateTimeDisplay.d.ts.map +1 -1
- package/lib/components/DateTime/DateTimeDisplay.js +10 -2
- package/lib/components/DateTime/DateTimeDisplay.js.map +1 -1
- package/lib/components/DateTime/DurationDisplay.d.ts.map +1 -1
- package/lib/components/DateTime/DurationDisplay.js +11 -6
- package/lib/components/DateTime/DurationDisplay.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +26 -28
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.js +10 -16
- package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.js +14 -3
- package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +37 -44
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +2 -0
- package/lib/components/DateTime/Input/DayOfWeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DayOfWeekInput.js +7 -5
- package/lib/components/DateTime/Input/DayOfWeekInput.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/DurationInput.js +3 -3
- package/lib/components/DateTime/Input/Duration/DurationInput.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/NumberUnit.js +4 -5
- package/lib/components/DateTime/Input/Duration/NumberUnit.js.map +1 -1
- package/lib/components/DateTime/Input/Duration/Time.d.ts.map +1 -1
- package/lib/components/DateTime/Input/Duration/Time.js +12 -15
- package/lib/components/DateTime/Input/Duration/Time.js.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.js +12 -16
- package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
- package/lib/components/DateTime/Input/PartInput.js +3 -4
- package/lib/components/DateTime/Input/PartInput.js.map +1 -1
- package/lib/components/DateTime/Input/QuarterInput.d.ts +9 -0
- package/lib/components/DateTime/Input/QuarterInput.d.ts.map +1 -0
- package/lib/components/DateTime/Input/QuarterInput.js +102 -0
- package/lib/components/DateTime/Input/QuarterInput.js.map +1 -0
- package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.js +29 -39
- package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.js +23 -24
- package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
- package/lib/components/DateTime/Input/useAutoFocusNextInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/useAutoFocusNextInput.js +8 -9
- package/lib/components/DateTime/Input/useAutoFocusNextInput.js.map +1 -1
- package/lib/components/DateTime/Input/usePickerButton.js +4 -4
- package/lib/components/DateTime/Input/usePickerButton.js.map +1 -1
- package/lib/components/DateTime/Input/utils.d.ts +7 -0
- package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Input/utils.js +52 -10
- 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 +32 -34
- package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.styles.d.ts +2 -2
- package/lib/components/DateTime/Picker/Calendar.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.styles.js +16 -7
- package/lib/components/DateTime/Picker/Calendar.styles.js.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DatePicker.js +13 -17
- package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/DateRangePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/DateRangePicker.js +13 -17
- package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.js +9 -10
- package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
- package/lib/components/DateTime/Picker/Weeks.js +9 -11
- package/lib/components/DateTime/Picker/Weeks.js.map +1 -1
- package/lib/components/DateTime/Picker/utils.d.ts +1 -0
- package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/utils.js +3 -0
- package/lib/components/DateTime/Picker/utils.js.map +1 -1
- package/lib/components/DateTime/index.d.ts +3 -0
- package/lib/components/DateTime/index.d.ts.map +1 -1
- package/lib/components/DateTime/index.js +2 -0
- package/lib/components/DateTime/index.js.map +1 -1
- package/lib/components/Drawer/Drawer.d.ts.map +1 -1
- package/lib/components/Drawer/Drawer.js +10 -7
- package/lib/components/Drawer/Drawer.js.map +1 -1
- package/lib/components/Email/EmailDisplay.d.ts +2 -2
- 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/EmojiPicker/EmojiDisplay.d.ts.map +1 -1
- package/lib/components/EmojiPicker/EmojiDisplay.js +1 -1
- package/lib/components/EmojiPicker/EmojiDisplay.js.map +1 -1
- package/lib/components/EmojiPicker/EmojiPicker.js +3 -4
- package/lib/components/EmojiPicker/EmojiPicker.js.map +1 -1
- package/lib/components/EmptyState/EmptyState.d.ts +14 -0
- package/lib/components/EmptyState/EmptyState.d.ts.map +1 -0
- package/lib/components/{NoItems/NoItems.js → EmptyState/EmptyState.js} +11 -8
- package/lib/components/EmptyState/EmptyState.js.map +1 -0
- package/lib/components/EmptyState/index.d.ts +4 -0
- package/lib/components/EmptyState/index.d.ts.map +1 -0
- package/lib/components/EmptyState/index.js +3 -0
- package/lib/components/EmptyState/index.js.map +1 -0
- package/lib/components/ErrorState/ErrorState.d.ts +16 -0
- package/lib/components/ErrorState/ErrorState.d.ts.map +1 -0
- package/lib/components/ErrorState/ErrorState.js +31 -0
- package/lib/components/ErrorState/ErrorState.js.map +1 -0
- package/lib/components/ErrorState/index.d.ts +4 -0
- package/lib/components/ErrorState/index.d.ts.map +1 -0
- package/lib/components/ErrorState/index.js +3 -0
- package/lib/components/ErrorState/index.js.map +1 -0
- package/lib/components/ExpandCollapse/ExpandCollapse.js +6 -6
- package/lib/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.js +6 -7
- package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.js +8 -7
- package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
- package/lib/components/FieldGroup/index.d.ts +1 -0
- package/lib/components/FieldGroup/index.d.ts.map +1 -1
- package/lib/components/FieldGroup/index.js +1 -0
- package/lib/components/FieldGroup/index.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.d.ts +2 -2
- package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.js +5 -7
- package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/File/FileDisplay.d.ts +6 -3
- package/lib/components/File/FileDisplay.d.ts.map +1 -1
- package/lib/components/File/FileDisplay.js +7 -7
- package/lib/components/File/FileDisplay.js.map +1 -1
- package/lib/components/File/FileInput.d.ts +3 -3
- package/lib/components/File/FileInput.d.ts.map +1 -1
- package/lib/components/File/FileInput.js +18 -19
- package/lib/components/File/FileInput.js.map +1 -1
- package/lib/components/File/FileItem.d.ts +0 -2
- package/lib/components/File/FileItem.d.ts.map +1 -1
- package/lib/components/File/FileItem.js +3 -4
- package/lib/components/File/FileItem.js.map +1 -1
- package/lib/components/File/FileUploadItem.d.ts +4 -2
- package/lib/components/File/FileUploadItem.d.ts.map +1 -1
- package/lib/components/File/FileUploadItem.js +58 -20
- package/lib/components/File/FileUploadItem.js.map +1 -1
- package/lib/components/File/FileVisual.d.ts +7 -16
- package/lib/components/File/FileVisual.d.ts.map +1 -1
- package/lib/components/File/FileVisual.js +44 -47
- package/lib/components/File/FileVisual.js.map +1 -1
- package/lib/components/File/index.d.ts +1 -0
- package/lib/components/File/index.d.ts.map +1 -1
- package/lib/components/File/index.js +1 -0
- package/lib/components/File/index.js.map +1 -1
- package/lib/components/File/utils.js +2 -3
- package/lib/components/File/utils.js.map +1 -1
- package/lib/components/Flex/Flex.d.ts +17 -7
- package/lib/components/Flex/Flex.d.ts.map +1 -1
- package/lib/components/Flex/Flex.js +25 -9
- package/lib/components/Flex/Flex.js.map +1 -1
- package/lib/components/Form/Form.d.ts +7 -1
- package/lib/components/Form/Form.d.ts.map +1 -1
- package/lib/components/Form/Form.js +5 -4
- package/lib/components/Form/Form.js.map +1 -1
- package/lib/components/FormControl/FormControl.d.ts +1 -1
- package/lib/components/FormControl/FormControl.d.ts.map +1 -1
- package/lib/components/FormControl/FormControl.js +1 -1
- package/lib/components/FormControl/FormControl.js.map +1 -1
- package/lib/components/FormField/FormField.d.ts +5 -7
- package/lib/components/FormField/FormField.d.ts.map +1 -1
- package/lib/components/FormField/FormField.js +9 -19
- package/lib/components/FormField/FormField.js.map +1 -1
- package/lib/components/Grid/Grid.d.ts +1 -1
- package/lib/components/Grid/Grid.d.ts.map +1 -1
- package/lib/components/Grid/Grid.js +17 -21
- package/lib/components/Grid/Grid.js.map +1 -1
- package/lib/components/Icon/Icon.js +3 -5
- 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/compass-solid.icon.js +1 -2
- package/lib/components/Icon/icons/compass-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/dataviz-table-with-bars.icon.js +1 -4
- package/lib/components/Icon/icons/dataviz-table-with-bars.icon.js.map +1 -1
- package/lib/components/Icon/icons/dataviz-table-with-cross.icon.js +1 -2
- package/lib/components/Icon/icons/dataviz-table-with-cross.icon.js.map +1 -1
- package/lib/components/Icon/icons/dataviz-waterfall.icon.js +1 -5
- package/lib/components/Icon/icons/dataviz-waterfall.icon.js.map +1 -1
- package/lib/components/Icon/icons/dock.icon.d.ts +4 -0
- package/lib/components/Icon/icons/dock.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/dock.icon.js +6 -0
- package/lib/components/Icon/icons/dock.icon.js.map +1 -0
- package/lib/components/Icon/icons/filetype-text.icon.js +1 -4
- package/lib/components/Icon/icons/filetype-text.icon.js.map +1 -1
- package/lib/components/Icon/icons/folder-dollar.icon.js +1 -2
- package/lib/components/Icon/icons/folder-dollar.icon.js.map +1 -1
- package/lib/components/Icon/icons/freeze-column.icon.js +1 -2
- package/lib/components/Icon/icons/freeze-column.icon.js.map +1 -1
- package/lib/components/Icon/icons/galaxy.icon.js +1 -3
- package/lib/components/Icon/icons/galaxy.icon.js.map +1 -1
- package/lib/components/Icon/icons/grad-solid.icon.js +1 -2
- package/lib/components/Icon/icons/grad-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/grad.icon.js +1 -5
- package/lib/components/Icon/icons/grad.icon.js.map +1 -1
- package/lib/components/Icon/icons/list-number.icon.js +1 -6
- package/lib/components/Icon/icons/list-number.icon.js.map +1 -1
- package/lib/components/Icon/icons/list.icon.js +1 -6
- package/lib/components/Icon/icons/list.icon.js.map +1 -1
- package/lib/components/Icon/icons/pin.icon.js +1 -2
- package/lib/components/Icon/icons/pin.icon.js.map +1 -1
- package/lib/components/Icon/icons/search-solid.icon.js +1 -2
- package/lib/components/Icon/icons/search-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/tracer.icon.js +1 -2
- package/lib/components/Icon/icons/tracer.icon.js.map +1 -1
- package/lib/components/Icon/icons/tribox-solid.icon.js +1 -3
- package/lib/components/Icon/icons/tribox-solid.icon.js.map +1 -1
- package/lib/components/Icon/icons/tribox.icon.js +1 -3
- package/lib/components/Icon/icons/tribox.icon.js.map +1 -1
- package/lib/components/Icon/icons/undock.icon.d.ts +4 -0
- package/lib/components/Icon/icons/undock.icon.d.ts.map +1 -0
- package/lib/components/Icon/icons/undock.icon.js +6 -0
- package/lib/components/Icon/icons/undock.icon.js.map +1 -0
- package/lib/components/Icon/index.d.ts +1 -0
- package/lib/components/Icon/index.d.ts.map +1 -1
- package/lib/components/Icon/index.js +1 -0
- package/lib/components/Icon/index.js.map +1 -1
- package/lib/components/Image/Image.js +1 -1
- package/lib/components/Image/Image.js.map +1 -1
- package/lib/components/Image/index.d.ts +1 -1
- package/lib/components/Image/index.d.ts.map +1 -1
- package/lib/components/Image/index.js +1 -0
- package/lib/components/Image/index.js.map +1 -1
- package/lib/components/Input/Input.d.ts +2 -2
- package/lib/components/Input/Input.d.ts.map +1 -1
- package/lib/components/Input/Input.js +13 -13
- package/lib/components/Input/Input.js.map +1 -1
- package/lib/components/Input/Input.styles.js +2 -2
- package/lib/components/Input/Input.styles.js.map +1 -1
- package/lib/components/Input/index.d.ts +1 -1
- package/lib/components/Input/index.d.ts.map +1 -1
- package/lib/components/Input/index.js.map +1 -1
- package/lib/components/Label/Label.d.ts +2 -2
- package/lib/components/Label/Label.d.ts.map +1 -1
- package/lib/components/Label/Label.js +1 -1
- package/lib/components/Label/Label.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.d.ts +6 -0
- package/lib/components/Lightbox/Lightbox.d.ts.map +1 -0
- package/lib/components/Lightbox/Lightbox.js +129 -0
- package/lib/components/Lightbox/Lightbox.js.map +1 -0
- package/lib/components/Lightbox/Lightbox.styles.d.ts +11 -0
- package/lib/components/Lightbox/Lightbox.styles.d.ts.map +1 -0
- package/lib/components/Lightbox/Lightbox.styles.js +166 -0
- package/lib/components/Lightbox/Lightbox.styles.js.map +1 -0
- package/lib/components/Lightbox/Lightbox.types.d.ts +42 -0
- package/lib/components/Lightbox/Lightbox.types.d.ts.map +1 -0
- package/lib/components/Lightbox/Lightbox.types.js +2 -0
- package/lib/components/Lightbox/Lightbox.types.js.map +1 -0
- package/lib/components/Lightbox/index.d.ts +3 -0
- package/lib/components/Lightbox/index.d.ts.map +1 -0
- package/lib/components/Lightbox/index.js +2 -0
- package/lib/components/Lightbox/index.js.map +1 -0
- package/lib/components/Link/Link.d.ts.map +1 -1
- package/lib/components/Link/Link.js +19 -19
- package/lib/components/Link/Link.js.map +1 -1
- package/lib/components/List/CommaSeparatedList.d.ts +15 -0
- package/lib/components/List/CommaSeparatedList.d.ts.map +1 -0
- package/lib/components/List/CommaSeparatedList.js +61 -0
- package/lib/components/List/CommaSeparatedList.js.map +1 -0
- package/lib/components/List/List.d.ts +30 -0
- package/lib/components/List/List.d.ts.map +1 -0
- package/lib/components/List/List.js +56 -0
- package/lib/components/List/List.js.map +1 -0
- package/lib/components/List/OrderedList.d.ts +6 -0
- package/lib/components/List/OrderedList.d.ts.map +1 -0
- package/lib/components/List/OrderedList.js +6 -0
- package/lib/components/List/OrderedList.js.map +1 -0
- package/lib/components/List/UnorderedList.d.ts +6 -0
- package/lib/components/List/UnorderedList.d.ts.map +1 -0
- package/lib/components/List/UnorderedList.js +6 -0
- package/lib/components/List/UnorderedList.js.map +1 -0
- package/lib/components/List/index.d.ts +5 -0
- package/lib/components/List/index.d.ts.map +1 -0
- package/lib/components/List/index.js +4 -0
- package/lib/components/List/index.js.map +1 -0
- package/lib/components/Location/CurrentLocationButton.d.ts.map +1 -1
- package/lib/components/Location/CurrentLocationButton.js +7 -7
- package/lib/components/Location/CurrentLocationButton.js.map +1 -1
- package/lib/components/Location/Location.types.d.ts +2 -1
- package/lib/components/Location/Location.types.d.ts.map +1 -1
- package/lib/components/Location/Location.types.js.map +1 -1
- package/lib/components/Location/LocationDisplay.js +8 -9
- package/lib/components/Location/LocationDisplay.js.map +1 -1
- package/lib/components/Location/LocationInput.js +27 -28
- package/lib/components/Location/LocationInput.js.map +1 -1
- package/lib/components/Location/LocationView.js +8 -13
- package/lib/components/Location/LocationView.js.map +1 -1
- package/lib/components/Location/index.d.ts +4 -4
- package/lib/components/Location/index.d.ts.map +1 -1
- package/lib/components/Location/index.js.map +1 -1
- package/lib/components/Location/utils.js +11 -15
- package/lib/components/Location/utils.js.map +1 -1
- package/lib/components/Menu/FlyoutMenuList.d.ts.map +1 -1
- package/lib/components/Menu/FlyoutMenuList.js +12 -15
- package/lib/components/Menu/FlyoutMenuList.js.map +1 -1
- package/lib/components/Menu/Menu.context.d.ts.map +1 -1
- package/lib/components/Menu/Menu.context.js +2 -0
- package/lib/components/Menu/Menu.context.js.map +1 -1
- package/lib/components/Menu/Menu.d.ts.map +1 -1
- package/lib/components/Menu/Menu.js +92 -48
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/Menu.styles.d.ts +11 -1
- package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
- package/lib/components/Menu/Menu.styles.js +208 -7
- package/lib/components/Menu/Menu.styles.js.map +1 -1
- package/lib/components/Menu/Menu.types.d.ts +30 -12
- package/lib/components/Menu/Menu.types.d.ts.map +1 -1
- package/lib/components/Menu/Menu.types.js.map +1 -1
- package/lib/components/Menu/MenuGroup.d.ts +6 -0
- package/lib/components/Menu/MenuGroup.d.ts.map +1 -0
- package/lib/components/Menu/MenuGroup.js +17 -0
- package/lib/components/Menu/MenuGroup.js.map +1 -0
- package/lib/components/Menu/MenuItem.d.ts +0 -3
- package/lib/components/Menu/MenuItem.d.ts.map +1 -1
- package/lib/components/Menu/MenuItem.js +57 -164
- package/lib/components/Menu/MenuItem.js.map +1 -1
- package/lib/components/Menu/MenuList.d.ts +1 -1
- package/lib/components/Menu/MenuList.d.ts.map +1 -1
- package/lib/components/Menu/MenuList.js +28 -30
- package/lib/components/Menu/MenuList.js.map +1 -1
- package/lib/components/Menu/MenuListHeader.d.ts +0 -1
- package/lib/components/Menu/MenuListHeader.d.ts.map +1 -1
- package/lib/components/Menu/MenuListHeader.js +7 -55
- package/lib/components/Menu/MenuListHeader.js.map +1 -1
- package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
- package/lib/components/Menu/NavItemsList.js +2 -3
- package/lib/components/Menu/NavItemsList.js.map +1 -1
- package/lib/components/Menu/helpers.d.ts +13 -12
- package/lib/components/Menu/helpers.d.ts.map +1 -1
- package/lib/components/Menu/helpers.js +40 -36
- package/lib/components/Menu/helpers.js.map +1 -1
- package/lib/components/Menu/index.d.ts +2 -3
- package/lib/components/Menu/index.d.ts.map +1 -1
- package/lib/components/Menu/index.js +1 -2
- package/lib/components/Menu/index.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.d.ts +3 -1
- package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +13 -14
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MetaList/MetaList.d.ts +13 -4
- package/lib/components/MetaList/MetaList.d.ts.map +1 -1
- package/lib/components/MetaList/MetaList.js +34 -20
- package/lib/components/MetaList/MetaList.js.map +1 -1
- package/lib/components/Modal/Contexts.d.ts.map +1 -1
- package/lib/components/Modal/Contexts.js +6 -2
- package/lib/components/Modal/Contexts.js.map +1 -1
- package/lib/components/Modal/DockedModals.d.ts.map +1 -1
- package/lib/components/Modal/DockedModals.js +5 -4
- package/lib/components/Modal/DockedModals.js.map +1 -1
- package/lib/components/Modal/MinimizedModal.d.ts.map +1 -1
- package/lib/components/Modal/MinimizedModal.js +53 -38
- package/lib/components/Modal/MinimizedModal.js.map +1 -1
- package/lib/components/Modal/Modal.d.ts +1 -6
- package/lib/components/Modal/Modal.d.ts.map +1 -1
- package/lib/components/Modal/Modal.js +89 -136
- package/lib/components/Modal/Modal.js.map +1 -1
- package/lib/components/Modal/Modal.styles.d.ts +9 -0
- package/lib/components/Modal/Modal.styles.d.ts.map +1 -0
- package/lib/components/Modal/Modal.styles.js +134 -0
- package/lib/components/Modal/Modal.styles.js.map +1 -0
- package/lib/components/Modal/Modal.types.d.ts +60 -7
- package/lib/components/Modal/Modal.types.d.ts.map +1 -1
- package/lib/components/Modal/Modal.types.js +2 -1
- package/lib/components/Modal/Modal.types.js.map +1 -1
- package/lib/components/Modal/ModalManager.d.ts.map +1 -1
- package/lib/components/Modal/ModalManager.js +78 -68
- package/lib/components/Modal/ModalManager.js.map +1 -1
- package/lib/components/MultiStep/MultiStep.d.ts.map +1 -1
- package/lib/components/MultiStep/MultiStep.js +10 -12
- package/lib/components/MultiStep/MultiStep.js.map +1 -1
- package/lib/components/MultiStep/MultiStep.styles.d.ts.map +1 -1
- package/lib/components/MultiStep/MultiStep.styles.js +5 -2
- package/lib/components/MultiStep/MultiStep.styles.js.map +1 -1
- package/lib/components/MultiStep/MultiStep.types.d.ts +4 -2
- package/lib/components/MultiStep/MultiStep.types.d.ts.map +1 -1
- package/lib/components/MultiStep/MultiStep.types.js.map +1 -1
- package/lib/components/MultiStep/index.d.ts +1 -1
- package/lib/components/MultiStep/index.d.ts.map +1 -1
- package/lib/components/MultiStep/index.js.map +1 -1
- package/lib/components/Number/NumberDisplay.d.ts +2 -2
- package/lib/components/Number/NumberDisplay.d.ts.map +1 -1
- package/lib/components/Number/NumberDisplay.js +1 -1
- package/lib/components/Number/NumberDisplay.js.map +1 -1
- package/lib/components/Number/NumberInput.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.js +18 -25
- package/lib/components/Number/NumberInput.js.map +1 -1
- package/lib/components/Number/NumberInput.styles.d.ts +2 -2
- package/lib/components/Number/NumberInput.styles.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.types.d.ts +2 -2
- package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.types.js.map +1 -1
- package/lib/components/Number/utils.js +2 -3
- package/lib/components/Number/utils.js.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.d.ts +1 -1
- package/lib/components/PageTemplates/CategorySubPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.js +8 -18
- package/lib/components/PageTemplates/CategorySubPage.js.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.styles.d.ts +1 -1
- package/lib/components/PageTemplates/CategorySubPage.styles.d.ts.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.d.ts +7 -1
- package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.js +48 -28
- package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts +15 -6
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js +89 -79
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/PageTemplates/index.d.ts +5 -3
- package/lib/components/PageTemplates/index.d.ts.map +1 -1
- package/lib/components/PageTemplates/index.js +2 -1
- package/lib/components/PageTemplates/index.js.map +1 -1
- package/lib/components/Pagination/Pagination.d.ts +2 -2
- package/lib/components/Pagination/Pagination.d.ts.map +1 -1
- package/lib/components/Pagination/Pagination.js +7 -6
- package/lib/components/Pagination/Pagination.js.map +1 -1
- package/lib/components/Paragraph/ParagraphDisplay.d.ts +11 -0
- package/lib/components/Paragraph/ParagraphDisplay.d.ts.map +1 -0
- package/lib/components/Paragraph/ParagraphDisplay.js +11 -0
- package/lib/components/Paragraph/ParagraphDisplay.js.map +1 -0
- package/lib/components/Paragraph/index.d.ts +3 -0
- package/lib/components/Paragraph/index.d.ts.map +1 -0
- package/lib/components/Paragraph/index.js +2 -0
- package/lib/components/Paragraph/index.js.map +1 -0
- package/lib/components/Phone/PhoneDisplay.d.ts +2 -2
- package/lib/components/Phone/PhoneDisplay.d.ts.map +1 -1
- package/lib/components/Phone/PhoneDisplay.js +2 -3
- package/lib/components/Phone/PhoneDisplay.js.map +1 -1
- package/lib/components/Phone/PhoneInput.d.ts +2 -2
- package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
- package/lib/components/Phone/PhoneInput.js +18 -17
- package/lib/components/Phone/PhoneInput.js.map +1 -1
- package/lib/components/Phone/utils.js +2 -3
- package/lib/components/Phone/utils.js.map +1 -1
- package/lib/components/Popover/Popover.d.ts +0 -4
- package/lib/components/Popover/Popover.d.ts.map +1 -1
- package/lib/components/Popover/Popover.js +17 -122
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/Popover.styles.d.ts +5 -0
- package/lib/components/Popover/Popover.styles.d.ts.map +1 -0
- package/lib/components/Popover/Popover.styles.js +131 -0
- package/lib/components/Popover/Popover.styles.js.map +1 -0
- package/lib/components/Popover/PopoverManager.js +2 -2
- package/lib/components/Popover/PopoverManager.js.map +1 -1
- package/lib/components/Popover/index.d.ts +1 -1
- package/lib/components/Popover/index.d.ts.map +1 -1
- package/lib/components/Popover/index.js +1 -1
- package/lib/components/Popover/index.js.map +1 -1
- package/lib/components/Popover/modifiers.d.ts +3 -0
- package/lib/components/Popover/modifiers.d.ts.map +1 -0
- package/lib/components/Popover/modifiers.js +11 -0
- package/lib/components/Popover/modifiers.js.map +1 -0
- package/lib/components/Progress/Bar.js +2 -2
- package/lib/components/Progress/Bar.js.map +1 -1
- package/lib/components/Progress/Ellipsis.d.ts +1 -1
- package/lib/components/Progress/Ellipsis.d.ts.map +1 -1
- package/lib/components/Progress/Ellipsis.js +48 -50
- package/lib/components/Progress/Ellipsis.js.map +1 -1
- package/lib/components/Progress/Progress.js +3 -4
- package/lib/components/Progress/Progress.js.map +1 -1
- package/lib/components/Progress/Progress.types.d.ts +2 -2
- package/lib/components/Progress/Progress.types.d.ts.map +1 -1
- package/lib/components/Progress/Progress.types.js.map +1 -1
- package/lib/components/Progress/Ring.d.ts +1 -1
- package/lib/components/Progress/Ring.d.ts.map +1 -1
- package/lib/components/Progress/Ring.js +40 -40
- package/lib/components/Progress/Ring.js.map +1 -1
- package/lib/components/RadioButton/RadioButton.d.ts +2 -2
- package/lib/components/RadioButton/RadioButton.d.ts.map +1 -1
- package/lib/components/RadioButton/RadioButton.js +1 -1
- package/lib/components/RadioButton/RadioButton.js.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.d.ts +2 -2
- package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.js +7 -8
- package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts +4 -0
- package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.js +19 -18
- package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
- package/lib/components/Rating/Rating.d.ts +2 -2
- package/lib/components/Rating/Rating.d.ts.map +1 -1
- package/lib/components/Rating/Rating.js +6 -7
- package/lib/components/Rating/Rating.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts +5 -5
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.js +14 -14
- package/lib/components/SearchInput/SearchInput.js.map +1 -1
- package/lib/components/Select/Option.js +1 -1
- package/lib/components/Select/Option.js.map +1 -1
- package/lib/components/Select/Select.d.ts.map +1 -1
- package/lib/components/Select/Select.js +15 -16
- package/lib/components/Select/Select.js.map +1 -1
- package/lib/components/Select/index.d.ts +2 -3
- package/lib/components/Select/index.d.ts.map +1 -1
- package/lib/components/Select/index.js.map +1 -1
- package/lib/components/Sentiment/Sentiment.d.ts +2 -2
- package/lib/components/Sentiment/Sentiment.d.ts.map +1 -1
- package/lib/components/Sentiment/Sentiment.js +1 -2
- package/lib/components/Sentiment/Sentiment.js.map +1 -1
- package/lib/components/Skeleton/LineSkeleton.js +1 -1
- package/lib/components/Skeleton/LineSkeleton.js.map +1 -1
- package/lib/components/Skeleton/ParagraphSkeleton.js +1 -1
- package/lib/components/Skeleton/ParagraphSkeleton.js.map +1 -1
- package/lib/components/Skeleton/RectangleSkeleton.js +1 -1
- package/lib/components/Skeleton/RectangleSkeleton.js.map +1 -1
- package/lib/components/Slider/Slider.d.ts.map +1 -1
- package/lib/components/Slider/Slider.js +12 -19
- package/lib/components/Slider/Slider.js.map +1 -1
- package/lib/components/Slider/Slider.styles.d.ts +4 -1
- package/lib/components/Slider/Slider.styles.d.ts.map +1 -1
- package/lib/components/Slider/Slider.styles.js +17 -5
- package/lib/components/Slider/Slider.styles.js.map +1 -1
- package/lib/components/Slider/Slider.types.d.ts +2 -2
- package/lib/components/Slider/Slider.types.d.ts.map +1 -1
- package/lib/components/Slider/Slider.types.js.map +1 -1
- package/lib/components/Slider/SliderTicks.d.ts +1 -0
- package/lib/components/Slider/SliderTicks.d.ts.map +1 -1
- package/lib/components/Slider/SliderTicks.js +19 -12
- package/lib/components/Slider/SliderTicks.js.map +1 -1
- package/lib/components/Slider/utils.d.ts +10 -11
- package/lib/components/Slider/utils.d.ts.map +1 -1
- package/lib/components/Slider/utils.js +24 -18
- package/lib/components/Slider/utils.js.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.d.ts +5 -5
- package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
- package/lib/components/SummaryItem/SummaryItem.js +3 -5
- package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
- package/lib/components/SummaryList/SummaryList.d.ts +8 -2
- package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
- package/lib/components/SummaryList/SummaryList.js +10 -11
- package/lib/components/SummaryList/SummaryList.js.map +1 -1
- package/lib/components/SummaryList/ViewAll.d.ts +1 -1
- package/lib/components/SummaryList/ViewAll.d.ts.map +1 -1
- package/lib/components/SummaryList/ViewAll.js +14 -10
- package/lib/components/SummaryList/ViewAll.js.map +1 -1
- package/lib/components/Switch/Switch.d.ts +2 -2
- package/lib/components/Switch/Switch.d.ts.map +1 -1
- package/lib/components/Switch/Switch.js +41 -30
- package/lib/components/Switch/Switch.js.map +1 -1
- package/lib/components/Table/Table.d.ts +2 -2
- package/lib/components/Table/Table.d.ts.map +1 -1
- package/lib/components/Table/Table.js +14 -13
- package/lib/components/Table/Table.js.map +1 -1
- package/lib/components/Table/index.d.ts +1 -2
- package/lib/components/Table/index.d.ts.map +1 -1
- package/lib/components/Table/index.js.map +1 -1
- package/lib/components/Tabs/Tab.d.ts +1 -1
- package/lib/components/Tabs/Tab.d.ts.map +1 -1
- package/lib/components/Tabs/Tab.js +9 -7
- package/lib/components/Tabs/Tab.js.map +1 -1
- package/lib/components/Tabs/TabPanel.d.ts +10 -2
- package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
- package/lib/components/Tabs/TabPanel.js +24 -8
- package/lib/components/Tabs/TabPanel.js.map +1 -1
- package/lib/components/Tabs/Tabs.d.ts +1 -0
- package/lib/components/Tabs/Tabs.d.ts.map +1 -1
- package/lib/components/Tabs/Tabs.js +22 -18
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/components/Tabs/Tabs.types.d.ts +2 -2
- package/lib/components/Tabs/Tabs.types.d.ts.map +1 -1
- package/lib/components/Tabs/Tabs.types.js.map +1 -1
- package/lib/components/Text/Text.d.ts +1 -1
- package/lib/components/Text/Text.d.ts.map +1 -1
- package/lib/components/Text/Text.js +2 -2
- package/lib/components/Text/Text.js.map +1 -1
- package/lib/components/TextArea/TextArea.d.ts +2 -2
- package/lib/components/TextArea/TextArea.d.ts.map +1 -1
- package/lib/components/TextArea/TextArea.js +31 -30
- package/lib/components/TextArea/TextArea.js.map +1 -1
- package/lib/components/TextArea/index.d.ts +1 -1
- package/lib/components/TextArea/index.d.ts.map +1 -1
- package/lib/components/TextArea/index.js.map +1 -1
- package/lib/components/Toaster/Toaster.d.ts +8 -36
- package/lib/components/Toaster/Toaster.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.js +97 -102
- package/lib/components/Toaster/Toaster.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.d.ts +6 -1
- package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +6 -13
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/components/Tree/StandardTree.d.ts +6 -0
- package/lib/components/Tree/StandardTree.d.ts.map +1 -0
- package/lib/components/Tree/StandardTree.js +175 -0
- package/lib/components/Tree/StandardTree.js.map +1 -0
- package/lib/components/Tree/StandardTree.styles.d.ts +13 -0
- package/lib/components/Tree/StandardTree.styles.d.ts.map +1 -0
- package/lib/components/Tree/StandardTree.styles.js +155 -0
- package/lib/components/Tree/StandardTree.styles.js.map +1 -0
- package/lib/components/Tree/StandardTree.types.d.ts +25 -0
- package/lib/components/Tree/StandardTree.types.d.ts.map +1 -0
- package/lib/components/Tree/StandardTree.types.js +2 -0
- package/lib/components/Tree/StandardTree.types.js.map +1 -0
- package/lib/components/Tree/Tree.d.ts +35 -49
- package/lib/components/Tree/Tree.d.ts.map +1 -1
- package/lib/components/Tree/Tree.js +18 -56
- package/lib/components/Tree/Tree.js.map +1 -1
- package/lib/components/Tree/helpers.d.ts +19 -0
- package/lib/components/Tree/helpers.d.ts.map +1 -0
- package/lib/components/Tree/helpers.js +180 -0
- package/lib/components/Tree/helpers.js.map +1 -0
- package/lib/components/Tree/index.d.ts +4 -2
- package/lib/components/Tree/index.d.ts.map +1 -1
- package/lib/components/Tree/index.js +3 -1
- package/lib/components/Tree/index.js.map +1 -1
- package/lib/components/URL/URLDisplay.d.ts +2 -2
- package/lib/components/URL/URLDisplay.d.ts.map +1 -1
- package/lib/components/URL/URLDisplay.js +2 -2
- package/lib/components/URL/URLDisplay.js.map +1 -1
- package/lib/components/VisuallyHiddenText/VisuallyHiddenText.d.ts +10 -0
- package/lib/components/VisuallyHiddenText/VisuallyHiddenText.d.ts.map +1 -0
- package/lib/components/VisuallyHiddenText/VisuallyHiddenText.js +10 -0
- package/lib/components/VisuallyHiddenText/VisuallyHiddenText.js.map +1 -0
- package/lib/components/VisuallyHiddenText/index.d.ts +2 -0
- package/lib/components/VisuallyHiddenText/index.d.ts.map +1 -0
- package/lib/components/VisuallyHiddenText/index.js +2 -0
- package/lib/components/VisuallyHiddenText/index.js.map +1 -0
- package/lib/hooks/index.d.ts +7 -4
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/index.js +7 -3
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useActiveDescendant.d.ts +17 -3
- package/lib/hooks/useActiveDescendant.d.ts.map +1 -1
- package/lib/hooks/useActiveDescendant.js +86 -64
- package/lib/hooks/useActiveDescendant.js.map +1 -1
- package/lib/hooks/useAutoResize.d.ts.map +1 -1
- package/lib/hooks/useAutoResize.js +6 -7
- package/lib/hooks/useAutoResize.js.map +1 -1
- package/lib/hooks/useBreakpoint.js +2 -4
- package/lib/hooks/useBreakpoint.js.map +1 -1
- package/lib/hooks/useDraggable.d.ts +8 -0
- package/lib/hooks/useDraggable.d.ts.map +1 -0
- package/lib/hooks/useDraggable.js +64 -0
- package/lib/hooks/useDraggable.js.map +1 -0
- package/lib/hooks/useFocusWithin.d.ts +1 -1
- package/lib/hooks/useFocusWithin.d.ts.map +1 -1
- package/lib/hooks/useFocusWithin.js +29 -24
- package/lib/hooks/useFocusWithin.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +511 -170
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useI18n.js +2 -2
- package/lib/hooks/useI18n.js.map +1 -1
- package/lib/hooks/useLongPress.d.ts +16 -0
- package/lib/hooks/useLongPress.d.ts.map +1 -0
- package/lib/hooks/useLongPress.js +59 -0
- package/lib/hooks/useLongPress.js.map +1 -0
- package/lib/hooks/useOuterEvent.js +1 -1
- package/lib/hooks/useOuterEvent.js.map +1 -1
- package/lib/hooks/useOverride.js +1 -1
- package/lib/hooks/useOverride.js.map +1 -1
- package/lib/hooks/useScrollStick.js +14 -3
- package/lib/hooks/useScrollStick.js.map +1 -1
- package/lib/hooks/useScrollToggle.d.ts +6 -0
- package/lib/hooks/useScrollToggle.d.ts.map +1 -0
- package/lib/hooks/useScrollToggle.js +40 -0
- package/lib/hooks/useScrollToggle.js.map +1 -0
- package/lib/hooks/useTransitionState.d.ts +39 -0
- package/lib/hooks/useTransitionState.d.ts.map +1 -0
- package/lib/hooks/useTransitionState.js +56 -0
- package/lib/hooks/useTransitionState.js.map +1 -0
- package/lib/i18n/default.d.ts +589 -0
- package/lib/i18n/default.d.ts.map +1 -0
- package/lib/i18n/default.js +636 -0
- package/lib/i18n/default.js.map +1 -0
- package/lib/i18n/i18n.d.ts +1000 -318
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/i18n/i18n.js +1 -1
- package/lib/i18n/i18n.js.map +1 -1
- package/lib/i18n/index.d.ts +1 -0
- package/lib/i18n/index.d.ts.map +1 -1
- package/lib/i18n/index.js.map +1 -1
- package/lib/i18n/translate.d.ts +29 -4
- package/lib/i18n/translate.d.ts.map +1 -1
- package/lib/i18n/translate.js +21 -8
- package/lib/i18n/translate.js.map +1 -1
- package/lib/index.d.ts +11 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +11 -2
- package/lib/index.js.map +1 -1
- package/lib/styles/GlobalStyle.d.ts.map +1 -1
- package/lib/styles/GlobalStyle.js +2 -26
- package/lib/styles/GlobalStyle.js.map +1 -1
- package/lib/theme/ThemeMachine.js +7 -1
- package/lib/theme/ThemeMachine.js.map +1 -1
- package/lib/theme/index.d.ts +1 -0
- package/lib/theme/index.d.ts.map +1 -1
- package/lib/theme/index.js +1 -0
- package/lib/theme/index.js.map +1 -1
- package/lib/theme/theme.d.ts +83 -53
- package/lib/theme/theme.d.ts.map +1 -1
- package/lib/theme/themeDefinition.json +50 -30
- package/lib/theme/themeOverrides.schema.json +24 -3
- package/lib/theme/themes/buildTheme.json +3 -39
- package/lib/theme/themes/darkTheme.json +6 -0
- package/lib/theme/themes/legacyBuildTheme.json +50 -0
- package/lib/types/types.d.ts +6 -1
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/types.js.map +1 -1
- package/lib/utils/utils.d.ts +41 -4
- package/lib/utils/utils.d.ts.map +1 -1
- package/lib/utils/utils.js +55 -9
- package/lib/utils/utils.js.map +1 -1
- package/package.json +11 -12
- package/lib/components/DateTime/Input/useButtonAriaLabel.d.ts +0 -3
- package/lib/components/DateTime/Input/useButtonAriaLabel.d.ts.map +0 -1
- package/lib/components/DateTime/Input/useButtonAriaLabel.js +0 -33
- package/lib/components/DateTime/Input/useButtonAriaLabel.js.map +0 -1
- package/lib/components/NoItems/NoItems.d.ts +0 -14
- package/lib/components/NoItems/NoItems.d.ts.map +0 -1
- package/lib/components/NoItems/NoItems.js.map +0 -1
- package/lib/components/NoItems/index.d.ts +0 -4
- package/lib/components/NoItems/index.d.ts.map +0 -1
- package/lib/components/NoItems/index.js +0 -3
- package/lib/components/NoItems/index.js.map +0 -1
- package/lib/i18n/default.json +0 -246
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { FormControlProps } from '../FormControl';
|
|
3
3
|
import { RadioCheckProps } from '../RadioCheck';
|
|
4
|
-
import { ForwardProps } from '../../types';
|
|
5
|
-
export interface CheckboxProps {
|
|
4
|
+
import { ForwardProps, NoChildrenProp } from '../../types';
|
|
5
|
+
export interface CheckboxProps extends NoChildrenProp {
|
|
6
6
|
/**
|
|
7
7
|
* Sets DOM id for the control and associates label element via 'for' attribute.
|
|
8
8
|
* If an id is not pass, a random id will be generated for any render.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAmB,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAmB,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE3D,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD;;;OAGG;IACH,EAAE,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC5B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAClC,wEAAwE;IACxE,QAAQ,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACxC,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACxC,+FAA+F;IAC/F,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAChC,yEAAyE;IACzE,OAAO,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACrC,oEAAoE;IACpE,cAAc,CAAC,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;IACnD;;;OAGG;IACH,aAAa,CAAC,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC;IACjD,oDAAoD;IACpD,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;CACrC;AAGD,QAAA,MAAM,EAAE,EAAE,EAAE,CAAC,aAAa,GAAG,YAAY,CAIxC,CAAC;AAKF,eAAe,EAAE,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import RadioCheck from '../RadioCheck';
|
|
4
4
|
// Odd issue with SB doc prop table not being generated when called Checkbox...so using CB
|
|
5
|
-
const CB = forwardRef((props, ref) => (_jsx(RadioCheck,
|
|
5
|
+
const CB = forwardRef((props, ref) => (_jsx(RadioCheck, { ...props, type: 'checkbox', ref: ref }, void 0)));
|
|
6
6
|
// Adding here for doc purposes only
|
|
7
7
|
CB.defaultProps = RadioCheck.defaultProps;
|
|
8
8
|
export default CB;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,EAAO,MAAM,OAAO,CAAC;AAG5C,OAAO,UAA+B,MAAM,eAAe,CAAC;AA8B5D,0FAA0F;AAC1F,MAAM,EAAE,GAAqC,UAAU,CACrD,CAAC,KAAoB,EAAE,GAA0B,EAAE,EAAE,CAAC,CACpD,KAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,EAAO,MAAM,OAAO,CAAC;AAG5C,OAAO,UAA+B,MAAM,eAAe,CAAC;AA8B5D,0FAA0F;AAC1F,MAAM,EAAE,GAAqC,UAAU,CACrD,CAAC,KAAoB,EAAE,GAA0B,EAAE,EAAE,CAAC,CACpD,KAAC,UAAU,OAAK,KAAK,EAAE,IAAI,EAAC,UAAU,EAAC,GAAG,EAAE,GAAG,WAAI,CACpD,CACF,CAAC;AAEF,oCAAoC;AACpC,EAAE,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;AAE1C,eAAe,EAAE,CAAC","sourcesContent":["import { FC, forwardRef, Ref } from 'react';\n\nimport { FormControlProps } from '../FormControl';\nimport RadioCheck, { RadioCheckProps } from '../RadioCheck';\nimport { ForwardProps, NoChildrenProp } from '../../types';\n\nexport interface CheckboxProps extends NoChildrenProp {\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /** Sets checked prop via onChange when using as controlled component. */\n checked?: RadioCheckProps['checked'];\n /** Initialize checked prop when using as uncontrolled component. */\n defaultChecked?: RadioCheckProps['defaultChecked'];\n /**\n * Sets Checkbox to an an [indeterminate state](https://css-tricks.com/almanac/selectors/i/indeterminate/#indeterminate-checkboxes).\n * @default false\n */\n indeterminate?: RadioCheckProps['indeterminate'];\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n}\n\n// Odd issue with SB doc prop table not being generated when called Checkbox...so using CB\nconst CB: FC<CheckboxProps & ForwardProps> = forwardRef(\n (props: CheckboxProps, ref: Ref<HTMLInputElement>) => (\n <RadioCheck {...props} type='checkbox' ref={ref} />\n )\n);\n\n// Adding here for doc purposes only\nCB.defaultProps = RadioCheck.defaultProps;\n\nexport default CB;\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FC, Ref, MouseEventHandler } from 'react';
|
|
2
2
|
import { ColorChangeHandler } from 'react-color';
|
|
3
|
-
import { BaseProps, ForwardProps } from '../../types';
|
|
3
|
+
import { BaseProps, ForwardProps, NoChildrenProp } from '../../types';
|
|
4
4
|
import { FormFieldProps } from '../FormField';
|
|
5
5
|
import { FormControlProps } from '../FormControl';
|
|
6
|
-
export interface ColorPickerProps extends BaseProps {
|
|
6
|
+
export interface ColorPickerProps extends BaseProps, NoChildrenProp {
|
|
7
7
|
/** label for the color picker control */
|
|
8
8
|
label: FormControlProps['label'];
|
|
9
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,EAAE,EAEF,GAAG,EAGH,iBAAiB,EAElB,MAAM,OAAO,CAAC;AAGf,OAAO,EAAgB,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAqB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,EAAE,EAEF,GAAG,EAGH,iBAAiB,EAElB,MAAM,OAAO,CAAC;AAGf,OAAO,EAAgB,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAqB,MAAM,aAAa,CAAC;AACzF,OAAkB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAqB,MAAM,gBAAgB,CAAC;AAKrE,MAAM,WAAW,gBAAiB,SAAQ,SAAS,EAAE,cAAc;IACjE,yCAAyC;IACzC,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACjC;;;OAGG;IACH,EAAE,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAClC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACxC,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACxC,uCAAuC;IACvC,WAAW,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAC9C,6GAA6G;IAC7G,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAChC,oDAAoD;IACpD,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACpC,qFAAqF;IACrF,QAAQ,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACxC,+FAA+F;IAC/F,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAChC,6CAA6C;IAC7C,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;IAClC,kEAAkE;IAClE,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,wCAAwC;IACxC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,+FAA+F;IAC/F,OAAO,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IAC9C,uCAAuC;IACvC,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC7B;AA0ED,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,GAAG,YAAY,CAuHpD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -83,7 +83,7 @@ const ColorPicker = forwardRef((props, ref) => {
|
|
|
83
83
|
const [showPopOver, setShowPopOver] = useState(false);
|
|
84
84
|
const hidePopover = () => {
|
|
85
85
|
if (showPopOver) {
|
|
86
|
-
onBeforeClose
|
|
86
|
+
onBeforeClose?.();
|
|
87
87
|
}
|
|
88
88
|
setShowPopOver(false);
|
|
89
89
|
};
|
|
@@ -96,27 +96,24 @@ const ColorPicker = forwardRef((props, ref) => {
|
|
|
96
96
|
useOuterEvent('mousedown', [popoverEl], hidePopover);
|
|
97
97
|
useEffect(() => {
|
|
98
98
|
document.addEventListener('keydown', closePopover);
|
|
99
|
-
popoverEl
|
|
99
|
+
popoverEl?.addEventListener('keydown', closePopover);
|
|
100
100
|
return () => {
|
|
101
101
|
document.removeEventListener('keydown', closePopover);
|
|
102
|
-
popoverEl
|
|
102
|
+
popoverEl?.removeEventListener('keydown', closePopover);
|
|
103
103
|
};
|
|
104
104
|
}, [popoverEl]);
|
|
105
105
|
useEffect(() => {
|
|
106
106
|
if (showPopOver) {
|
|
107
|
-
popoverEl
|
|
107
|
+
popoverEl?.focus();
|
|
108
108
|
}
|
|
109
109
|
}, [showPopOver]);
|
|
110
|
-
return (_jsx(FormField,
|
|
110
|
+
return (_jsx(FormField, { inline: inline, container: inline ? { justify: 'between' } : undefined, as: StyledColorPicker, id: id, label: label, labelHidden: labelHidden, swatchOnly: swatchOnly, info: info, disabled: disabled, status: status, required: required, children: _jsxs(Flex, { container: { alignItems: 'center' }, item: swatchOnly ? { alignSelf: 'start' } : undefined, as: StyledFormControl, disabled: disabled, status: status, required: required, readOnly: readOnly, onClick: readOnly ? undefined : () => setShowPopOver(true), children: [_jsx("input", { ...restProps, id: id, type: readOnly ? undefined : 'color', ref: inputRef, defaultValue: value, disabled: disabled, required: required, readOnly: readOnly, onClick: e => {
|
|
111
111
|
e.preventDefault();
|
|
112
112
|
if (readOnly)
|
|
113
113
|
e.preventDefault();
|
|
114
|
-
} }), void 0),
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
_jsx(Popover, Object.assign({ placement: 'bottom-start', style: { zIndex: '3000' }, show: showPopOver, ref: setPopoverEl, groupId: 'popover', target: maskedSwatchRef.current }, { children: _jsx(ChromePicker, { disableAlpha: !alpha, color: value, onChange: (color, e) => {
|
|
118
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(color, e);
|
|
119
|
-
} }, void 0) }), void 0)] }), void 0) }), void 0));
|
|
114
|
+
} }, void 0), _jsx("div", { style: { backgroundColor: value }, ref: maskedSwatchRef }, void 0), !swatchOnly && value, _jsx(Popover, { placement: 'bottom-start', style: { zIndex: '3000' }, show: showPopOver, ref: setPopoverEl, groupId: 'popover', target: maskedSwatchRef.current, children: _jsx(ChromePicker, { disableAlpha: !alpha, color: value, onChange: (color, e) => {
|
|
115
|
+
onChange?.(color, e);
|
|
116
|
+
} }, void 0) }, void 0)] }, void 0) }, void 0));
|
|
120
117
|
});
|
|
121
118
|
export default ColorPicker;
|
|
122
119
|
//# sourceMappingURL=ColorPicker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPicker.js","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,EAEV,QAAQ,EAGR,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAsB,MAAM,aAAa,CAAC;AAG/D,OAAO,SAA6B,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAoB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACpF,OAAO,OAAO,MAAM,YAAY,CAAC;AAqDjC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAClC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE;IACxB,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM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E,EAAE,GAAG,EAAE,eAAe,WAAI;gBAC/D,CAAC,UAAU,IAAI,KAAK;gBACrB,KAAC,OAAO,kBACN,SAAS,EAAC,cAAc,EACxB,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EACzB,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,YAAY,EACjB,OAAO,EAAC,SAAS,EACjB,MAAM,EAAE,eAAe,CAAC,OAAO,gBAE/B,KAAC,YAAY,IACX,YAAY,EAAE,CAAC,KAAK,EACpB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;4BACrB,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,KAAK,EAAE,CAAC,CAAC,CAAC;wBACvB,CAAC,WACD,YACM,aACL,YACG,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {\n FC,\n forwardRef,\n Ref,\n useState,\n PropsWithoutRef,\n MouseEventHandler,\n useEffect\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { hideVisually } from 'polished';\nimport { ChromePicker, ColorChangeHandler } from 'react-color';\n\nimport { BaseProps, ForwardProps, PropsWithDefaults } from '../../types';\nimport FormField, { FormFieldProps } from '../FormField';\nimport { defaultThemeProp } from '../../theme';\nimport { FormControlProps, StyledFormControl } from '../FormControl';\nimport Flex from '../Flex';\nimport { useConsolidatedRef, useUID, useElement, useOuterEvent } from '../../hooks';\nimport Popover from '../Popover';\n\nexport interface ColorPickerProps extends BaseProps {\n /** label for the color picker control */\n label: FormControlProps['label'];\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not passed, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /**\n * Color picker value in hex\n * @default \"#000000\"\n */\n value?: FormControlProps['value'];\n /**\n * Show color swatch without hex value display.\n * @default false\n */\n swatchOnly?: boolean;\n /**\n * Enables alpha slider.\n * @default false\n */\n alpha?: boolean;\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Disable the control. */\n disabled?: FormControlProps['disabled'];\n /** Visually hides the label region. */\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 /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Makes the input non editable and non clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /** Layout field elements inline in a row. */\n inline?: FormFieldProps['inline'];\n /** onChange event handler that gets called on change of value. */\n onChange?: ColorChangeHandler;\n /** onBeforeClose of the color picker */\n onBeforeClose?: () => void;\n /** Called when the underlying input element is clicked. This should be rarely if ever used. */\n onClick?: MouseEventHandler<HTMLInputElement>;\n /** Ref placed on the input element. */\n ref?: Ref<HTMLInputElement>;\n}\n\ntype ColorPickerPropsWithDefaults = PropsWithDefaults<ColorPickerProps, 'value' | 'swatchOnly'>;\n\nconst StyledColorPicker = styled.div<Pick<ColorPickerPropsWithDefaults, 'swatchOnly'>>(\n ({ theme, swatchOnly }) => {\n const size = theme.components.input.height;\n const borderWidth = theme.components['form-control']['border-width'];\n\n return css`\n ${StyledFormControl} {\n overflow: hidden;\n text-transform: uppercase;\n ${!swatchOnly &&\n css`\n min-width: 8rem;\n `}\n\n ${!swatchOnly &&\n css`\n padding-inline-end: ${theme.base.spacing};\n `}\n\n &:focus-within {\n box-shadow: ${theme.base.shadow.focus};\n border: none;\n }\n\n & > input {\n ${hideVisually}\n\n & + div {\n height: calc(${size} - (2 * ${borderWidth}));\n\n ${swatchOnly\n ? css`\n width: calc(${size} - (2 * ${borderWidth}));\n `\n : css`\n min-width: calc(${size} - ${borderWidth});\n margin-inline-end: ${theme.base.spacing};\n border-inline-end: ${borderWidth} solid\n ${theme.components['form-control']['border-color']};\n `}\n }\n\n &:focus + div {\n width: ${size};\n height: ${size};\n }\n }\n\n & input {\n height: 2rem !important;\n min-height: 2rem;\n color: #000000 !important;\n background-color: #ffffff !important;\n font-size: 0.8125rem !important;\n font-family: ${theme.base['font-family']};\n\n & + label {\n font-weight: 600;\n color: rgba(0, 0, 0, 0.6) !important;\n font-size: 0.8125rem !important;\n font-family: ${theme.base['font-family']};\n }\n }\n }\n `;\n }\n);\n\nStyledColorPicker.defaultProps = defaultThemeProp;\n\nconst ColorPicker: FC<ColorPickerProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<ColorPickerProps>, ref: ColorPickerProps['ref']) => {\n const uid = useUID();\n const {\n id = uid,\n value = '#000000',\n label,\n info,\n disabled,\n status,\n required,\n readOnly,\n labelHidden,\n swatchOnly = false,\n alpha = false,\n inline,\n onClick,\n onChange,\n onBeforeClose,\n ...restProps\n } = props;\n\n const inputRef = useConsolidatedRef(ref);\n const maskedSwatchRef = useConsolidatedRef<HTMLDivElement>();\n const [popoverEl, setPopoverEl] = useElement<HTMLElement>(null);\n const [showPopOver, setShowPopOver] = useState(false);\n\n const hidePopover = () => {\n if (showPopOver) {\n onBeforeClose?.();\n }\n\n setShowPopOver(false);\n };\n\n const closePopover = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.preventDefault();\n hidePopover();\n }\n };\n\n useOuterEvent('mousedown', [popoverEl], hidePopover);\n\n useEffect(() => {\n document.addEventListener('keydown', closePopover);\n popoverEl?.addEventListener('keydown', closePopover);\n return () => {\n document.removeEventListener('keydown', closePopover);\n popoverEl?.removeEventListener('keydown', closePopover);\n };\n }, [popoverEl]);\n\n useEffect(() => {\n if (showPopOver) {\n popoverEl?.focus();\n }\n }, [showPopOver]);\n\n return (\n <FormField\n inline={inline}\n container={inline ? { justify: 'between' } : undefined}\n as={StyledColorPicker}\n id={id}\n label={label}\n labelHidden={labelHidden}\n swatchOnly={swatchOnly}\n info={info}\n disabled={disabled}\n status={status}\n required={required}\n >\n <Flex\n container={{ alignItems: 'center' }}\n item={swatchOnly ? { alignSelf: 'start' } : undefined}\n as={StyledFormControl}\n disabled={disabled}\n status={status}\n required={required}\n readOnly={readOnly}\n onClick={readOnly ? undefined : () => setShowPopOver(true)}\n >\n <input\n {...restProps}\n id={id}\n type={readOnly ? undefined : 'color'}\n ref={inputRef}\n defaultValue={value}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n onClick={e => {\n e.preventDefault();\n if (readOnly) e.preventDefault();\n }}\n />\n <div style={{ backgroundColor: value }} ref={maskedSwatchRef} />\n {!swatchOnly && value}\n <Popover\n placement='bottom-start'\n style={{ zIndex: '3000' }}\n show={showPopOver}\n ref={setPopoverEl}\n groupId='popover'\n target={maskedSwatchRef.current}\n >\n <ChromePicker\n disableAlpha={!alpha}\n color={value}\n onChange={(color, e) => {\n onChange?.(color, e);\n }}\n />\n </Popover>\n </Flex>\n </FormField>\n );\n }\n);\n\nexport default ColorPicker;\n"]}
|
|
1
|
+
{"version":3,"file":"ColorPicker.js","sourceRoot":"","sources":["../../../src/components/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,EAEV,QAAQ,EAGR,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAsB,MAAM,aAAa,CAAC;AAG/D,OAAO,SAA6B,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAoB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACpF,OAAO,OAAO,MAAM,YAAY,CAAC;AAqDjC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CACl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AAE,KAAK,EAAE,EAAE,GAAG,EAAE,eAAe,WAAI,EAC/D,CAAC,UAAU,IAAI,KAAK,EACrB,KAAC,OAAO,IACN,SAAS,EAAC,cAAc,EACxB,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EACzB,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,YAAY,EACjB,OAAO,EAAC,SAAS,EACjB,MAAM,EAAE,eAAe,CAAC,OAAO,YAE/B,KAAC,YAAY,IACX,YAAY,EAAE,CAAC,KAAK,EACpB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;4BACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;wBACvB,CAAC,WACD,WACM,YACL,WACG,CACb,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {\n FC,\n forwardRef,\n Ref,\n useState,\n PropsWithoutRef,\n MouseEventHandler,\n useEffect\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { hideVisually } from 'polished';\nimport { ChromePicker, ColorChangeHandler } from 'react-color';\n\nimport { BaseProps, ForwardProps, NoChildrenProp, PropsWithDefaults } from '../../types';\nimport FormField, { FormFieldProps } from '../FormField';\nimport { defaultThemeProp } from '../../theme';\nimport { FormControlProps, StyledFormControl } from '../FormControl';\nimport Flex from '../Flex';\nimport { useConsolidatedRef, useUID, useElement, useOuterEvent } from '../../hooks';\nimport Popover from '../Popover';\n\nexport interface ColorPickerProps extends BaseProps, NoChildrenProp {\n /** label for the color picker control */\n label: FormControlProps['label'];\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not passed, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /**\n * Color picker value in hex\n * @default \"#000000\"\n */\n value?: FormControlProps['value'];\n /**\n * Show color swatch without hex value display.\n * @default false\n */\n swatchOnly?: boolean;\n /**\n * Enables alpha slider.\n * @default false\n */\n alpha?: boolean;\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Disable the control. */\n disabled?: FormControlProps['disabled'];\n /** Visually hides the label region. */\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 /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Makes the input non editable and non clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /** Layout field elements inline in a row. */\n inline?: FormFieldProps['inline'];\n /** onChange event handler that gets called on change of value. */\n onChange?: ColorChangeHandler;\n /** onBeforeClose of the color picker */\n onBeforeClose?: () => void;\n /** Called when the underlying input element is clicked. This should be rarely if ever used. */\n onClick?: MouseEventHandler<HTMLInputElement>;\n /** Ref placed on the input element. */\n ref?: Ref<HTMLInputElement>;\n}\n\ntype ColorPickerPropsWithDefaults = PropsWithDefaults<ColorPickerProps, 'value' | 'swatchOnly'>;\n\nconst StyledColorPicker = styled.div<Pick<ColorPickerPropsWithDefaults, 'swatchOnly'>>(\n ({ theme, swatchOnly }) => {\n const size = theme.components.input.height;\n const borderWidth = theme.components['form-control']['border-width'];\n\n return css`\n ${StyledFormControl} {\n overflow: hidden;\n text-transform: uppercase;\n ${!swatchOnly &&\n css`\n min-width: 8rem;\n `}\n\n ${!swatchOnly &&\n css`\n padding-inline-end: ${theme.base.spacing};\n `}\n\n &:focus-within {\n box-shadow: ${theme.base.shadow.focus};\n border: none;\n }\n\n & > input {\n ${hideVisually}\n\n & + div {\n height: calc(${size} - (2 * ${borderWidth}));\n\n ${swatchOnly\n ? css`\n width: calc(${size} - (2 * ${borderWidth}));\n `\n : css`\n min-width: calc(${size} - ${borderWidth});\n margin-inline-end: ${theme.base.spacing};\n border-inline-end: ${borderWidth} solid\n ${theme.components['form-control']['border-color']};\n `}\n }\n\n &:focus + div {\n width: ${size};\n height: ${size};\n }\n }\n\n & input {\n height: 2rem !important;\n min-height: 2rem;\n color: #000000 !important;\n background-color: #ffffff !important;\n font-size: 0.8125rem !important;\n font-family: ${theme.base['font-family']};\n\n & + label {\n font-weight: 600;\n color: rgba(0, 0, 0, 0.6) !important;\n font-size: 0.8125rem !important;\n font-family: ${theme.base['font-family']};\n }\n }\n }\n `;\n }\n);\n\nStyledColorPicker.defaultProps = defaultThemeProp;\n\nconst ColorPicker: FC<ColorPickerProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<ColorPickerProps>, ref: ColorPickerProps['ref']) => {\n const uid = useUID();\n const {\n id = uid,\n value = '#000000',\n label,\n info,\n disabled,\n status,\n required,\n readOnly,\n labelHidden,\n swatchOnly = false,\n alpha = false,\n inline,\n onClick,\n onChange,\n onBeforeClose,\n ...restProps\n } = props;\n\n const inputRef = useConsolidatedRef(ref);\n const maskedSwatchRef = useConsolidatedRef<HTMLDivElement>();\n const [popoverEl, setPopoverEl] = useElement<HTMLElement>(null);\n const [showPopOver, setShowPopOver] = useState(false);\n\n const hidePopover = () => {\n if (showPopOver) {\n onBeforeClose?.();\n }\n\n setShowPopOver(false);\n };\n\n const closePopover = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.preventDefault();\n hidePopover();\n }\n };\n\n useOuterEvent('mousedown', [popoverEl], hidePopover);\n\n useEffect(() => {\n document.addEventListener('keydown', closePopover);\n popoverEl?.addEventListener('keydown', closePopover);\n return () => {\n document.removeEventListener('keydown', closePopover);\n popoverEl?.removeEventListener('keydown', closePopover);\n };\n }, [popoverEl]);\n\n useEffect(() => {\n if (showPopOver) {\n popoverEl?.focus();\n }\n }, [showPopOver]);\n\n return (\n <FormField\n inline={inline}\n container={inline ? { justify: 'between' } : undefined}\n as={StyledColorPicker}\n id={id}\n label={label}\n labelHidden={labelHidden}\n swatchOnly={swatchOnly}\n info={info}\n disabled={disabled}\n status={status}\n required={required}\n >\n <Flex\n container={{ alignItems: 'center' }}\n item={swatchOnly ? { alignSelf: 'start' } : undefined}\n as={StyledFormControl}\n disabled={disabled}\n status={status}\n required={required}\n readOnly={readOnly}\n onClick={readOnly ? undefined : () => setShowPopOver(true)}\n >\n <input\n {...restProps}\n id={id}\n type={readOnly ? undefined : 'color'}\n ref={inputRef}\n defaultValue={value}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n onClick={e => {\n e.preventDefault();\n if (readOnly) e.preventDefault();\n }}\n />\n <div style={{ backgroundColor: value }} ref={maskedSwatchRef} />\n {!swatchOnly && value}\n <Popover\n placement='bottom-start'\n style={{ zIndex: '3000' }}\n show={showPopOver}\n ref={setPopoverEl}\n groupId='popover'\n target={maskedSwatchRef.current}\n >\n <ChromePicker\n disableAlpha={!alpha}\n color={value}\n onChange={(color, e) => {\n onChange?.(color, e);\n }}\n />\n </Popover>\n </Flex>\n </FormField>\n );\n }\n);\n\nexport default ColorPicker;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
2
|
import { ForwardProps } from '../../types';
|
|
3
3
|
import ComboBoxProps from './ComboBox.types';
|
|
4
|
-
export declare const StyledComboBox: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme,
|
|
4
|
+
export declare const StyledComboBox: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("../../types").OmitStrict<import("../FormControl").FormControlProps, never> & Required<Pick<import("../FormControl").FormControlProps, never>>, never>;
|
|
5
5
|
declare const ComboBox: FunctionComponent<ComboBoxProps & ForwardProps>;
|
|
6
6
|
export default ComboBox;
|
|
7
7
|
//# sourceMappingURL=ComboBox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboBox.d.ts","sourceRoot":"","sources":["../../../src/components/ComboBox/ComboBox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EASlB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ComboBox.d.ts","sourceRoot":"","sources":["../../../src/components/ComboBox/ComboBox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EASlB,MAAM,OAAO,CAAC;AAMf,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAa3C,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAI7C,eAAO,MAAM,cAAc,4PAO1B,CAAC;AAIF,QAAA,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,GAAG,YAAY,CA0M7D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
4
|
+
import Icon, { registerIcon } from '../Icon';
|
|
5
|
+
import * as caretDownIcon from '../Icon/icons/caret-down.icon';
|
|
6
|
+
import * as caretUpIcon from '../Icon/icons/caret-up.icon';
|
|
7
|
+
import VisuallyHiddenText from '../VisuallyHiddenText';
|
|
6
8
|
import { useConsolidatedRef, useFocusWithin, useI18n, useUID, useElement } from '../../hooks';
|
|
7
9
|
import Popover, { StyledPopover } from '../Popover';
|
|
8
10
|
import FormField from '../FormField';
|
|
@@ -10,33 +12,10 @@ import { StyledFormControl } from '../FormControl';
|
|
|
10
12
|
import Menu from '../Menu';
|
|
11
13
|
import Button from '../Button';
|
|
12
14
|
import { navigatorIsAvailable } from '../../utils';
|
|
15
|
+
import menuHelpers from '../Menu/helpers';
|
|
16
|
+
import { sameWidth } from '../Popover/modifiers';
|
|
13
17
|
import ComboBoxInput from './ComboBoxInput';
|
|
14
|
-
|
|
15
|
-
{
|
|
16
|
-
name: 'flip',
|
|
17
|
-
enabled: true,
|
|
18
|
-
options: {
|
|
19
|
-
fallbackPlacements: ['top-start']
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
name: 'preventOverflow',
|
|
24
|
-
enabled: true
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
name: 'hide',
|
|
28
|
-
enabled: false
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: 'sameWidth',
|
|
32
|
-
enabled: true,
|
|
33
|
-
phase: 'beforeWrite',
|
|
34
|
-
fn({ state }) {
|
|
35
|
-
state.styles.popper.width = `${state.rects.reference.width}px`;
|
|
36
|
-
},
|
|
37
|
-
requires: ['computeStyles']
|
|
38
|
-
}
|
|
39
|
-
];
|
|
18
|
+
registerIcon(caretDownIcon, caretUpIcon);
|
|
40
19
|
export const StyledComboBox = styled(StyledFormControl) `
|
|
41
20
|
border: 0;
|
|
42
21
|
|
|
@@ -45,9 +24,6 @@ export const StyledComboBox = styled(StyledFormControl) `
|
|
|
45
24
|
border-top-right-radius: 0;
|
|
46
25
|
}
|
|
47
26
|
`;
|
|
48
|
-
const StyledAriaDescription = styled.p `
|
|
49
|
-
${hideVisually}
|
|
50
|
-
`;
|
|
51
27
|
const isMobile = navigatorIsAvailable && navigator.userAgent.includes('Mobile');
|
|
52
28
|
const ComboBox = forwardRef((props, ref) => {
|
|
53
29
|
const uid = useUID();
|
|
@@ -60,17 +36,16 @@ const ComboBox = forwardRef((props, ref) => {
|
|
|
60
36
|
// Force a re-render to make sure useFocusWithin has valid elements to set listeners on.
|
|
61
37
|
const [, setContainerEl] = useElement();
|
|
62
38
|
const containerRef = useConsolidatedRef(ref, setContainerEl);
|
|
63
|
-
useFocusWithin([containerRef], focused => {
|
|
39
|
+
const focus = useFocusWithin([containerRef], focused => {
|
|
64
40
|
if (!focused) {
|
|
65
41
|
setOpen(false);
|
|
66
|
-
onBlur
|
|
42
|
+
onBlur?.(selected?.items);
|
|
67
43
|
}
|
|
68
44
|
else {
|
|
69
|
-
onFocus
|
|
45
|
+
onFocus?.(selected?.items);
|
|
70
46
|
if (isMobile) {
|
|
71
47
|
setTimeout(() => {
|
|
72
|
-
|
|
73
|
-
(_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
48
|
+
containerRef.current?.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
74
49
|
}, 150); // delay it to let keyboard expand first
|
|
75
50
|
}
|
|
76
51
|
}
|
|
@@ -94,51 +69,56 @@ const ComboBox = forwardRef((props, ref) => {
|
|
|
94
69
|
}
|
|
95
70
|
}, [open, readOnly, menu, value]);
|
|
96
71
|
const onDropdownButtonClick = useCallback(() => {
|
|
97
|
-
onDropdownButtonClickProp
|
|
72
|
+
onDropdownButtonClickProp?.(!open);
|
|
98
73
|
setOpen(!open);
|
|
99
74
|
}, [open, onDropdownButtonClickProp]);
|
|
100
75
|
const dropdownButton = useMemo(() => {
|
|
101
|
-
|
|
102
|
-
|
|
76
|
+
return (menu?.items?.length || onDropdownButtonClickProp || !onChange) && !readOnly ? (_jsx(Button, { "aria-hidden": 'true', "aria-label": t(open ? 'combobox_close_list_button_a11y' : 'combobox_open_list_button_a11y'), icon: true, variant: 'simple', onClick: onDropdownButtonClick, onMouseDown: (e) => {
|
|
77
|
+
e.preventDefault();
|
|
78
|
+
inputRef.current?.focus();
|
|
79
|
+
}, disabled: disabled, tabIndex: '-1', children: _jsx(Icon, { name: open ? 'caret-up' : 'caret-down' }, void 0) }, void 0)) : null;
|
|
103
80
|
}, [onDropdownButtonClick, onChange, readOnly, open, disabled]);
|
|
104
81
|
const onInputClick = useCallback((e) => {
|
|
105
82
|
if (readOnly)
|
|
106
83
|
return;
|
|
107
84
|
setOpen(true);
|
|
108
|
-
onClick
|
|
85
|
+
onClick?.(e);
|
|
109
86
|
}, [readOnly, onClick]);
|
|
110
87
|
useEffect(() => {
|
|
111
|
-
if (menu && value && value.length > 0) {
|
|
88
|
+
if (focus && menu && value && value.length > 0) {
|
|
112
89
|
setOpen(true);
|
|
113
90
|
}
|
|
114
|
-
}, [menu, value]);
|
|
91
|
+
}, [menu, value, focus]);
|
|
115
92
|
// Workaround for the following error from jsx-ast-utils, fixed in version 3.5.0.
|
|
116
93
|
// The prop value with an expression type of JSXFragment could not be resolved. Please file issue to get this fixed immediately.
|
|
117
|
-
const inputActions = (_jsxs(_Fragment, { children: [dropdownButton,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
94
|
+
const inputActions = (_jsxs(_Fragment, { children: [dropdownButton, actions] }, void 0));
|
|
95
|
+
const Comp = (_jsxs(StyledComboBox, { ref: containerRef, as: StyledFormControl, id: `${id}-combobox`, children: [_jsx(ComboBoxInput, { ref: inputRef, role: 'combobox', "aria-haspopup": 'listbox', "aria-expanded": !readOnly && !disabled && open, "aria-autocomplete": 'list', "aria-describedby": `${id}-inputDescription`, selected: selected?.items, spellCheck: false, ...{
|
|
96
|
+
id,
|
|
97
|
+
readOnly,
|
|
98
|
+
disabled,
|
|
99
|
+
onChange,
|
|
100
|
+
value,
|
|
101
|
+
mode,
|
|
102
|
+
status
|
|
103
|
+
}, actions: inputActions, onRemove: selected?.onRemove, onClick: onInputClick, onKeyDown: onInputKeyDown, ...restProps }, void 0), _jsx(VisuallyHiddenText, { id: `${id}-inputDescription`, children: `${t('combobox_open_close')} ` && onChange ? t('combobox_search_instructions') : '' }, void 0), _jsx(Popover, { show: open && menu !== undefined, target: containerRef.current, placement: 'bottom-start', modifiers: [
|
|
104
|
+
{
|
|
105
|
+
name: 'flip',
|
|
106
|
+
options: {
|
|
107
|
+
fallbackPlacements: ['top-start']
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
sameWidth
|
|
111
|
+
], strategy: isMobile ? 'absolute' : 'fixed', onMouseDown: (e) => e.preventDefault(), children: menu && (_jsx(Menu, { ref: menuRef, id: menuComponentId, role: 'listbox', mode: mode, ...menu, items: menu.items, focusControlEl: inputRef.current || undefined, onItemClick: (itemId, e) => {
|
|
132
112
|
if (mode === 'single-select') {
|
|
133
113
|
setOpen(false);
|
|
134
114
|
}
|
|
135
|
-
|
|
136
|
-
const clickedItem = menu.items
|
|
137
|
-
if (
|
|
138
|
-
|
|
115
|
+
menu.onItemClick?.(itemId, e);
|
|
116
|
+
const clickedItem = menuHelpers.getItem(menu.items, itemId);
|
|
117
|
+
if (clickedItem?.primary && !clickedItem?.selected) {
|
|
118
|
+
selected?.onNew?.(clickedItem?.primary);
|
|
139
119
|
}
|
|
140
|
-
}, arrowNavigationUnsupported: true }
|
|
141
|
-
return label ? (_jsx(FormField,
|
|
120
|
+
}, arrowNavigationUnsupported: true }, void 0)) }, void 0)] }, void 0));
|
|
121
|
+
return label ? (_jsx(FormField, { ...{ label, labelHidden, id, info, status, required, disabled }, children: Comp }, void 0)) : (Comp);
|
|
142
122
|
});
|
|
143
123
|
export default ComboBox;
|
|
144
124
|
//# sourceMappingURL=ComboBox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboBox.js","sourceRoot":"","sources":["../../../src/components/ComboBox/ComboBox.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAKV,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9F,OAAO,OAAO,EAAE,EAAgB,aAAa,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,I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I,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,KAAI,CAAC,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,QAAQ,CAAA,EAAE;4BAClD,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,+CAAf,QAAQ,EAAU,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,CAAC,CAAC;yBACzC;oBACH,CAAC,EACD,0BAA0B,kBAC1B,CACH,YACO,aACK,CAClB,CAAC;IAEF,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,KAAC,SAAS,oBAAK,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,cACxE,IAAI,YACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n KeyboardEvent as ReactKeyboardEvent,\n PropsWithoutRef,\n Ref,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport styled from 'styled-components';\nimport { hideVisually } from 'polished';\n\nimport Icon from '../Icon';\nimport { ForwardProps } from '../../types';\nimport { useConsolidatedRef, useFocusWithin, useI18n, useUID, useElement } from '../../hooks';\nimport Popover, { PopoverProps, StyledPopover } from '../Popover';\nimport FormField from '../FormField';\nimport { StyledFormControl } from '../FormControl';\nimport Menu from '../Menu';\nimport Button from '../Button';\nimport { navigatorIsAvailable } from '../../utils';\n\nimport ComboBoxInput from './ComboBoxInput';\nimport ComboBoxProps from './ComboBox.types';\n\nconst popoverModifiers: PopoverProps['modifiers'] = [\n {\n name: 'flip',\n enabled: true,\n options: {\n fallbackPlacements: ['top-start']\n }\n },\n {\n name: 'preventOverflow',\n enabled: true\n },\n {\n name: 'hide',\n enabled: false\n },\n {\n name: 'sameWidth',\n enabled: true,\n phase: 'beforeWrite',\n fn({ state }) {\n state.styles.popper.width = `${state.rects.reference.width}px`;\n },\n requires: ['computeStyles']\n }\n];\n\nexport const StyledComboBox = styled(StyledFormControl)`\n border: 0;\n\n & ${StyledPopover} {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n`;\n\nconst StyledAriaDescription = styled.p`\n ${hideVisually}\n`;\n\nconst isMobile = navigatorIsAvailable && navigator.userAgent.includes('Mobile');\n\nconst ComboBox: FunctionComponent<ComboBoxProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<ComboBoxProps>, ref: Ref<HTMLDivElement>) => {\n const uid = useUID();\n const {\n value,\n required,\n id = uid,\n label,\n labelHidden,\n info,\n status,\n readOnly,\n disabled,\n mode = 'single-select',\n selected,\n onChange,\n actions,\n onFocus,\n onBlur,\n onDropdownButtonClick: onDropdownButtonClickProp,\n onClick,\n menu,\n ...restProps\n } = props;\n\n const t = useI18n();\n const inputRef = useRef<HTMLInputElement>(null);\n const [open, setOpen] = useState<boolean>(false);\n const menuRef = useRef<HTMLDivElement>(null);\n const menuComponentId = `${id}-listbox`;\n\n // Force a re-render to make sure useFocusWithin has valid elements to set listeners on.\n const [, setContainerEl] = useElement();\n const containerRef = useConsolidatedRef<HTMLDivElement>(ref, setContainerEl);\n\n useFocusWithin([containerRef], focused => {\n if (!focused) {\n setOpen(false);\n onBlur?.(selected?.items);\n } else {\n onFocus?.(selected?.items);\n if (isMobile) {\n setTimeout(() => {\n containerRef.current?.scrollIntoView({ behavior: 'smooth', block: 'start' });\n }, 150); // delay it to let keyboard expand first\n }\n }\n });\n\n const onInputKeyDown = useCallback(\n (e: ReactKeyboardEvent<HTMLInputElement>) => {\n if (!menu || readOnly) return;\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault();\n if (!open) setOpen(true);\n break;\n case 'Escape':\n e.preventDefault();\n if (open) e.stopPropagation();\n setOpen(false);\n break;\n default:\n }\n },\n [open, readOnly, menu, value]\n );\n\n const onDropdownButtonClick = useCallback(() => {\n onDropdownButtonClickProp?.(!open);\n setOpen(!open);\n }, [open, onDropdownButtonClickProp]);\n\n const dropdownButton = useMemo(() => {\n return (menu?.items?.length || onDropdownButtonClickProp || !onChange) && !readOnly ? (\n <Button\n aria-label={t(\n open ? 'combobox_close_list_button_a11y' : 'combobox_open_list_button_a11y'\n )}\n icon\n variant='simple'\n onClick={onDropdownButtonClick}\n disabled={disabled}\n tabIndex='-1'\n >\n <Icon name={open ? 'caret-up' : 'caret-down'} />\n </Button>\n ) : null;\n }, [onDropdownButtonClick, onChange, readOnly, open, disabled]);\n\n const onInputClick = useCallback(\n (e: MouseEvent) => {\n if (readOnly) return;\n setOpen(true);\n onClick?.(e);\n },\n [readOnly, onClick]\n );\n\n useEffect(() => {\n if (menu && value && value.length > 0) {\n setOpen(true);\n }\n }, [menu, value]);\n\n // Workaround for the following error from jsx-ast-utils, fixed in version 3.5.0.\n // The prop value with an expression type of JSXFragment could not be resolved. Please file issue to get this fixed immediately.\n const inputActions = (\n <>\n {dropdownButton}\n {actions}\n </>\n );\n\n const Comp = (\n <StyledComboBox ref={containerRef} as={StyledFormControl} id={`${id}-combobox`}>\n <ComboBoxInput\n ref={inputRef}\n role='combobox'\n aria-haspopup='listbox'\n aria-owns={menuComponentId}\n aria-expanded={!readOnly && !disabled && open}\n aria-autocomplete='list'\n aria-controls={menuComponentId}\n aria-describedby={`${id}-inputDescription`}\n selected={selected?.items}\n spellCheck={false}\n {...{\n id,\n readOnly,\n disabled,\n onChange,\n value,\n mode,\n status\n }}\n actions={inputActions}\n onRemove={selected?.onRemove}\n onClick={onInputClick}\n onKeyDown={onInputKeyDown}\n {...restProps}\n />\n\n <StyledAriaDescription id={`${id}-inputDescription`}>\n {t('combobox_open_close')}\n {!!onChange && ` ${t('combobox_search_instructions')}`}\n </StyledAriaDescription>\n\n <Popover\n show={open && menu !== undefined}\n target={containerRef.current}\n placement='bottom-start'\n modifiers={popoverModifiers}\n strategy={isMobile ? 'absolute' : 'fixed'}\n onMouseDown={(e: MouseEvent) => e.preventDefault()}\n >\n {menu && (\n <Menu\n ref={menuRef}\n id={menuComponentId}\n role='listbox'\n mode={mode}\n {...menu}\n items={menu.items}\n focusControlEl={inputRef.current || undefined}\n onItemClick={(itemId, e) => {\n if (mode === 'single-select') {\n setOpen(false);\n }\n menu.onItemClick?.(itemId, e);\n\n const clickedItem = menu.items.find(item => item.id === itemId);\n\n if (clickedItem?.primary && !clickedItem?.selected) {\n selected?.onNew?.(clickedItem?.primary);\n }\n }}\n arrowNavigationUnsupported\n />\n )}\n </Popover>\n </StyledComboBox>\n );\n\n return label ? (\n <FormField {...{ label, labelHidden, id, info, status, required, disabled }}>\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default ComboBox;\n"]}
|
|
1
|
+
{"version":3,"file":"ComboBox.js","sourceRoot":"","sources":["../../../src/components/ComboBox/ComboBox.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAKV,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAE3D,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9F,OAAO,OAAO,EAAE,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,IAAmB,MAAM,SAAS,CAAC;AAC1C,OAAO,MAAM,MAAM,WAAW,CAAC;AAC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useEffect,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport styled from 'styled-components';\n\nimport Icon, { registerIcon } from '../Icon';\nimport * as caretDownIcon from '../Icon/icons/caret-down.icon';\nimport * as caretUpIcon from '../Icon/icons/caret-up.icon';\nimport { ForwardProps } from '../../types';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\nimport { useConsolidatedRef, useFocusWithin, useI18n, useUID, useElement } from '../../hooks';\nimport Popover, { StyledPopover } from '../Popover';\nimport FormField from '../FormField';\nimport { StyledFormControl } from '../FormControl';\nimport Menu, { MenuProps } from '../Menu';\nimport Button from '../Button';\nimport { navigatorIsAvailable } from '../../utils';\nimport menuHelpers from '../Menu/helpers';\nimport { sameWidth } from '../Popover/modifiers';\n\nimport ComboBoxInput from './ComboBoxInput';\nimport ComboBoxProps from './ComboBox.types';\n\nregisterIcon(caretDownIcon, caretUpIcon);\n\nexport const StyledComboBox = styled(StyledFormControl)`\n border: 0;\n\n & ${StyledPopover} {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n`;\n\nconst isMobile = navigatorIsAvailable && navigator.userAgent.includes('Mobile');\n\nconst ComboBox: FunctionComponent<ComboBoxProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<ComboBoxProps>, ref: Ref<HTMLDivElement>) => {\n const uid = useUID();\n const {\n value,\n required,\n id = uid,\n label,\n labelHidden,\n info,\n status,\n readOnly,\n disabled,\n mode = 'single-select',\n selected,\n onChange,\n actions,\n onFocus,\n onBlur,\n onDropdownButtonClick: onDropdownButtonClickProp,\n onClick,\n menu,\n ...restProps\n } = props;\n\n const t = useI18n();\n const inputRef = useRef<HTMLInputElement>(null);\n const [open, setOpen] = useState(false);\n const menuRef: MenuProps['ref'] = useRef(null);\n const menuComponentId = `${id}-listbox`;\n\n // Force a re-render to make sure useFocusWithin has valid elements to set listeners on.\n const [, setContainerEl] = useElement();\n const containerRef = useConsolidatedRef<HTMLDivElement>(ref, setContainerEl);\n\n const focus = useFocusWithin([containerRef], focused => {\n if (!focused) {\n setOpen(false);\n onBlur?.(selected?.items);\n } else {\n onFocus?.(selected?.items);\n if (isMobile) {\n setTimeout(() => {\n containerRef.current?.scrollIntoView({ behavior: 'smooth', block: 'start' });\n }, 150); // delay it to let keyboard expand first\n }\n }\n });\n\n const onInputKeyDown = useCallback(\n (e: ReactKeyboardEvent<HTMLInputElement>) => {\n if (!menu || readOnly) return;\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault();\n if (!open) setOpen(true);\n break;\n case 'Escape':\n e.preventDefault();\n if (open) e.stopPropagation();\n setOpen(false);\n break;\n default:\n }\n },\n [open, readOnly, menu, value]\n );\n\n const onDropdownButtonClick = useCallback(() => {\n onDropdownButtonClickProp?.(!open);\n setOpen(!open);\n }, [open, onDropdownButtonClickProp]);\n\n const dropdownButton = useMemo(() => {\n return (menu?.items?.length || onDropdownButtonClickProp || !onChange) && !readOnly ? (\n <Button\n aria-hidden='true'\n aria-label={t(\n open ? 'combobox_close_list_button_a11y' : 'combobox_open_list_button_a11y'\n )}\n icon\n variant='simple'\n onClick={onDropdownButtonClick}\n onMouseDown={(e: MouseEvent) => {\n e.preventDefault();\n inputRef.current?.focus();\n }}\n disabled={disabled}\n tabIndex='-1'\n >\n <Icon name={open ? 'caret-up' : 'caret-down'} />\n </Button>\n ) : null;\n }, [onDropdownButtonClick, onChange, readOnly, open, disabled]);\n\n const onInputClick = useCallback(\n (e: MouseEvent) => {\n if (readOnly) return;\n setOpen(true);\n onClick?.(e);\n },\n [readOnly, onClick]\n );\n\n useEffect(() => {\n if (focus && menu && value && value.length > 0) {\n setOpen(true);\n }\n }, [menu, value, focus]);\n\n // Workaround for the following error from jsx-ast-utils, fixed in version 3.5.0.\n // The prop value with an expression type of JSXFragment could not be resolved. Please file issue to get this fixed immediately.\n const inputActions = (\n <>\n {dropdownButton}\n {actions}\n </>\n );\n\n const Comp = (\n <StyledComboBox ref={containerRef} as={StyledFormControl} id={`${id}-combobox`}>\n <ComboBoxInput\n ref={inputRef}\n role='combobox'\n aria-haspopup='listbox'\n aria-expanded={!readOnly && !disabled && open}\n aria-autocomplete='list'\n aria-describedby={`${id}-inputDescription`}\n selected={selected?.items}\n spellCheck={false}\n {...{\n id,\n readOnly,\n disabled,\n onChange,\n value,\n mode,\n status\n }}\n actions={inputActions}\n onRemove={selected?.onRemove}\n onClick={onInputClick}\n onKeyDown={onInputKeyDown}\n {...restProps}\n />\n\n <VisuallyHiddenText id={`${id}-inputDescription`}>\n {`${t('combobox_open_close')} ` && onChange ? t('combobox_search_instructions') : ''}\n </VisuallyHiddenText>\n\n <Popover\n show={open && menu !== undefined}\n target={containerRef.current}\n placement='bottom-start'\n modifiers={[\n {\n name: 'flip',\n options: {\n fallbackPlacements: ['top-start']\n }\n },\n sameWidth\n ]}\n strategy={isMobile ? 'absolute' : 'fixed'}\n onMouseDown={(e: MouseEvent) => e.preventDefault()}\n >\n {menu && (\n <Menu\n ref={menuRef}\n id={menuComponentId}\n role='listbox'\n mode={mode}\n {...menu}\n items={menu.items}\n focusControlEl={inputRef.current || undefined}\n onItemClick={(itemId, e) => {\n if (mode === 'single-select') {\n setOpen(false);\n }\n menu.onItemClick?.(itemId, e);\n\n const clickedItem = menuHelpers.getItem(menu.items, itemId);\n\n if (clickedItem?.primary && !clickedItem?.selected) {\n selected?.onNew?.(clickedItem?.primary);\n }\n }}\n arrowNavigationUnsupported\n />\n )}\n </Popover>\n </StyledComboBox>\n );\n\n return label ? (\n <FormField {...{ label, labelHidden, id, info, status, required, disabled }}>\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default ComboBox;\n"]}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ChangeEvent, ReactNode } from 'react';
|
|
2
|
+
import type { NoChildrenProp } from '../../types';
|
|
2
3
|
import { FormControlProps } from '../FormControl';
|
|
3
4
|
import { MenuItemProps, MenuProps } from '../Menu/Menu.types';
|
|
4
5
|
export interface Selected {
|
|
5
6
|
id: string;
|
|
6
7
|
text: string;
|
|
7
8
|
}
|
|
8
|
-
export default interface ComboBoxProps {
|
|
9
|
+
export default interface ComboBoxProps extends NoChildrenProp {
|
|
9
10
|
/**
|
|
10
11
|
* Sets DOM id for the control and associates label element via 'for' attribute.
|
|
11
12
|
* If an id is not pass, a random id will be generated for any render.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboBox.types.d.ts","sourceRoot":"","sources":["../../../src/components/ComboBox/ComboBox.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE9D,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,CAAC,OAAO,WAAW,
|
|
1
|
+
{"version":3,"file":"ComboBox.types.d.ts","sourceRoot":"","sources":["../../../src/components/ComboBox/ComboBox.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE9D,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,CAAC,OAAO,WAAW,aAAc,SAAQ,cAAc;IAC3D;;;OAGG;IACH,EAAE,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC5B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAClC,uCAAuC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E,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,QAAQ,EAAE,KAAK,IAAI,CAAC;IACpD,iDAAiD;IACjD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;OAOG;IACH,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,oDAAoD;IACpD,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IAClC,wDAAwD;IACxD,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,yCAAyC;IACzC,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboBox.types.js","sourceRoot":"","sources":["../../../src/components/ComboBox/ComboBox.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ChangeEvent, ReactNode } from 'react';\n\nimport { FormControlProps } from '../FormControl';\nimport { MenuItemProps, MenuProps } from '../Menu/Menu.types';\n\nexport interface Selected {\n id: string;\n text: string;\n}\n\nexport default interface ComboBoxProps {\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Visually hides the label region. */\n labelHidden?: FormControlProps['labelHidden'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Makes the component non editable and non clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\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 /** Placeholder text */\n placeholder?: FormControlProps['placeholder'];\n /**\n * Whether it is single selection or multi selection combobox.\n * @default 'single-select'\n */\n mode?: 'single-select' | 'multi-select';\n /** Currently selected option, single for single-select, an array for multi-select. */\n selected?: {\n items?: Selected | Selected[];\n onRemove?: (id: MenuItemProps['id'], index: number) => void;\n onNew?: (text: string) => void;\n };\n /** Value of the combobox filtering input. */\n value?: FormControlProps['value'];\n /** Callback fired when the filtering input value changes. */\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n /** Callback fired when the ComboBox input gains focus. */\n onFocus?: (selected?: Selected | Selected[]) => void;\n /**\n * Callback fired when the ComboBox looses focus within its containing element.\n * This is not specific to the input element.\n * Note, behavior will be enhanced in an upcoming release and the input will be the only focusable element.\n */\n onBlur?: (selected?: Selected | Selected[]) => void;\n /** Automatically focuses the input on render. */\n autoFocus?: boolean;\n /**\n * Fired when the user clicks on the dropdown icon to initiate opening the menu.\n * If you want to offer default menu items without an input value, pass this function.\n * This function can be an appropriate time to fetch menu item data.\n * Remember to set the loading prop to true when when fetching data for an empty list.\n *\n * @param open value defining whether the click opens or closes the menu\n */\n onDropdownButtonClick?: (open: boolean) => void;\n /** Fired when user clicks on the Combobox input. */\n onClick?: (e: MouseEvent) => void;\n /** Action Buttons that will render within the input. */\n actions?: ReactNode;\n /** Menu related props. @see MenuProps */\n menu?: MenuProps;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ComboBox.types.js","sourceRoot":"","sources":["../../../src/components/ComboBox/ComboBox.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ChangeEvent, ReactNode } from 'react';\n\nimport type { NoChildrenProp } from '../../types';\nimport { FormControlProps } from '../FormControl';\nimport { MenuItemProps, MenuProps } from '../Menu/Menu.types';\n\nexport interface Selected {\n id: string;\n text: string;\n}\n\nexport default interface ComboBoxProps extends NoChildrenProp {\n /**\n * Sets DOM id for the control and associates label element via 'for' attribute.\n * If an id is not pass, a random id will be generated for any render.\n */\n id?: FormControlProps['id'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /** Visually hides the label region. */\n labelHidden?: FormControlProps['labelHidden'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Disable the control. The browser defaults to false. */\n disabled?: FormControlProps['disabled'];\n /** Makes the component non editable and non clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /** Sets html name attribute for the underlying control. Useful for mapping to a data field. */\n name?: FormControlProps['name'];\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\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 /** Placeholder text */\n placeholder?: FormControlProps['placeholder'];\n /**\n * Whether it is single selection or multi selection combobox.\n * @default 'single-select'\n */\n mode?: 'single-select' | 'multi-select';\n /** Currently selected option, single for single-select, an array for multi-select. */\n selected?: {\n items?: Selected | Selected[];\n onRemove?: (id: MenuItemProps['id'], index: number) => void;\n onNew?: (text: string) => void;\n };\n /** Value of the combobox filtering input. */\n value?: FormControlProps['value'];\n /** Callback fired when the filtering input value changes. */\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n /** Callback fired when the ComboBox input gains focus. */\n onFocus?: (selected?: Selected | Selected[]) => void;\n /**\n * Callback fired when the ComboBox looses focus within its containing element.\n * This is not specific to the input element.\n * Note, behavior will be enhanced in an upcoming release and the input will be the only focusable element.\n */\n onBlur?: (selected?: Selected | Selected[]) => void;\n /** Automatically focuses the input on render. */\n autoFocus?: boolean;\n /**\n * Fired when the user clicks on the dropdown icon to initiate opening the menu.\n * If you want to offer default menu items without an input value, pass this function.\n * This function can be an appropriate time to fetch menu item data.\n * Remember to set the loading prop to true when when fetching data for an empty list.\n *\n * @param open value defining whether the click opens or closes the menu\n */\n onDropdownButtonClick?: (open: boolean) => void;\n /** Fired when user clicks on the Combobox input. */\n onClick?: (e: MouseEvent) => void;\n /** Action Buttons that will render within the input. */\n actions?: ReactNode;\n /** Menu related props. @see MenuProps */\n menu?: MenuProps;\n}\n"]}
|
|
@@ -4,10 +4,10 @@ import SingleSelectInput from './SingleSelectInput/SingleSelectInput';
|
|
|
4
4
|
import MultiSelectInput from './MultiSelectInput/MultiSelectInput';
|
|
5
5
|
const ComboBoxInput = forwardRef((props, ref) => {
|
|
6
6
|
const { value, mode, selected, onRemove, ...restProps } = props;
|
|
7
|
-
return mode === 'multi-select' ? (_jsx(MultiSelectInput,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
return mode === 'multi-select' ? (_jsx(MultiSelectInput, { selected: selected, value: value, ...{
|
|
8
|
+
ref,
|
|
9
|
+
onRemove
|
|
10
|
+
}, ...restProps }, void 0)) : (_jsx(SingleSelectInput, { ref: ref, selected: selected, value: value, ...restProps }, void 0));
|
|
11
11
|
});
|
|
12
12
|
export default ComboBoxInput;
|
|
13
13
|
//# sourceMappingURL=ComboBoxInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboBoxInput.js","sourceRoot":"","sources":["../../../src/components/ComboBox/ComboBoxInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2C,MAAM,OAAO,CAAC;AAK5E,OAAO,iBAAiB,MAAM,uCAAuC,CAAC;AACtE,OAAO,gBAAgB,MAAM,qCAAqC,CAAC;AAUnE,MAAM,aAAa,GAAyD,UAAU,CACpF,CAAC,KAA0C,EAAE,GAA0B,EAAE,EAAE;IACzE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAEhE,OAAO,IAAI,KAAK,cAAc,CAAC,CAAC,CAAC,CAC/B,KAAC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"ComboBoxInput.js","sourceRoot":"","sources":["../../../src/components/ComboBox/ComboBoxInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAA2C,MAAM,OAAO,CAAC;AAK5E,OAAO,iBAAiB,MAAM,uCAAuC,CAAC;AACtE,OAAO,gBAAgB,MAAM,qCAAqC,CAAC;AAUnE,MAAM,aAAa,GAAyD,UAAU,CACpF,CAAC,KAA0C,EAAE,GAA0B,EAAE,EAAE;IACzE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAEhE,OAAO,IAAI,KAAK,cAAc,CAAC,CAAC,CAAC,CAC/B,KAAC,gBAAgB,IACf,QAAQ,EAAE,QAAsB,EAChC,KAAK,EAAE,KAAK,KACR;YACF,GAAG;YACH,QAAQ;SACT,KACG,SAAS,WACb,CACH,CAAC,CAAC,CAAC,CACF,KAAC,iBAAiB,IAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAoB,EAAE,KAAK,EAAE,KAAK,KAAM,SAAS,WAAI,CAC7F,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, Ref, PropsWithoutRef } from 'react';\n\nimport { BaseProps, ForwardProps } from '../../types';\nimport { MenuItemProps } from '../Menu/Menu.types';\n\nimport SingleSelectInput from './SingleSelectInput/SingleSelectInput';\nimport MultiSelectInput from './MultiSelectInput/MultiSelectInput';\nimport ComboBoxProps, { Selected } from './ComboBox.types';\n\ninterface ComboBoxInputProps extends BaseProps {\n mode?: 'multi-select' | 'single-select';\n selected?: Selected | Selected[];\n value?: ComboBoxProps['value'];\n onRemove?: (id: MenuItemProps['id'], index: number) => void;\n}\n\nconst ComboBoxInput: FunctionComponent<ComboBoxInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<ComboBoxInputProps>, ref: Ref<HTMLInputElement>) => {\n const { value, mode, selected, onRemove, ...restProps } = props;\n\n return mode === 'multi-select' ? (\n <MultiSelectInput\n selected={selected as Selected[]}\n value={value}\n {...{\n ref,\n onRemove\n }}\n {...restProps}\n />\n ) : (\n <SingleSelectInput ref={ref} selected={selected as Selected} value={value} {...restProps} />\n );\n }\n);\n\nexport default ComboBoxInput;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelectInput.d.ts","sourceRoot":"","sources":["../../../../src/components/ComboBox/MultiSelectInput/MultiSelectInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAS9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"MultiSelectInput.d.ts","sourceRoot":"","sources":["../../../../src/components/ComboBox/MultiSelectInput/MultiSelectInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAS9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,eAAO,MAAM,iBAAiB,4HA4D5B,CAAC;AAIH,QAAA,MAAM,gBAAgB,EAAE,iBAAiB,CAAC,qBAAqB,GAAG,YAAY,CAqG7E,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|