@carbon/react 1.87.0-rc.0 → 1.87.1-rc.0
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/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +739 -739
- package/es/_virtual/_rollupPluginBabelHelpers.js +4 -4
- package/es/components/Button/Button.js +1 -1
- package/es/components/Button/index.js +5 -1
- package/es/components/ButtonSet/index.js +4 -1
- package/es/components/Checkbox/index.js +4 -1
- package/es/components/ComboBox/ComboBox.js +1 -1
- package/es/components/ComboBox/index.js +4 -1
- package/es/components/ComposedModal/ComposedModal.js +18 -8
- package/es/components/ContainedList/ContainedListItem/index.js +4 -1
- package/es/components/ContainedList/index.js +2 -2
- package/es/components/Copy/Copy.js +1 -1
- package/es/components/Copy/index.js +4 -1
- package/es/components/CopyButton/index.js +4 -1
- package/es/components/DataTable/Table.js +1 -1
- package/es/components/DataTable/state/getDerivedStateFromProps.d.ts +19 -0
- package/es/components/DataTable/state/getDerivedStateFromProps.js +1 -2
- package/es/components/DataTable/state/sorting.d.ts +15 -0
- package/es/components/DataTable/state/sorting.js +1 -2
- package/es/components/DataTable/tools/denormalize.d.ts +22 -0
- package/es/components/DataTable/tools/denormalize.js +1 -2
- package/es/components/DataTable/tools/normalize.d.ts +9 -0
- package/es/components/DataTable/tools/normalize.js +1 -2
- package/es/components/DatePicker/DatePicker.js +18 -11
- package/es/components/DatePicker/index.js +4 -1
- package/es/components/DatePicker/plugins/fixEventsPlugin.d.ts +2 -0
- package/es/components/DatePicker/plugins/rangePlugin.d.ts +2 -0
- package/es/components/DatePickerInput/DatePickerInput.js +6 -0
- package/es/components/DatePickerInput/index.js +4 -1
- package/es/components/Dialog/index.js +2 -2
- package/es/components/Dropdown/Dropdown.js +2 -2
- package/es/components/Dropdown/index.js +4 -1
- package/es/components/FeatureFlags/index.js +2 -2
- package/es/components/FluidSelect/index.js +4 -1
- package/es/components/FluidTextInput/index.js +4 -1
- package/es/components/IconIndicator/index.js +1 -1
- package/es/components/InlineCheckbox/index.js +4 -1
- package/es/components/InlineLoading/index.js +4 -1
- package/es/components/LayoutDirection/LayoutDirection.js +1 -2
- package/es/components/Link/index.js +4 -1
- package/es/components/ListBox/ListBox.js +1 -1
- package/es/components/Loading/index.js +4 -1
- package/es/components/Menu/Menu.d.ts +3 -1
- package/es/components/Menu/Menu.js +3 -1
- package/es/components/Menu/MenuItem.js +1 -1
- package/es/components/Modal/Modal.js +16 -5
- package/es/components/Modal/index.js +4 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +3 -3
- package/es/components/MultiSelect/MultiSelect.js +2 -2
- package/es/components/MultiSelect/filter.js +0 -4
- package/es/components/MultiSelect/tools/itemToString.d.ts +1 -0
- package/es/components/MultiSelect/tools/sorting.d.ts +9 -0
- package/es/components/Notification/Notification.js +2 -2
- package/es/components/NumberInput/NumberInput.js +1 -1
- package/es/components/OverflowMenu/next/index.js +1 -1
- package/es/components/OverflowMenuItem/index.js +4 -1
- package/es/components/OverflowMenuV2/index.d.ts +1 -0
- package/es/components/PageHeader/PageHeader.js +1 -1
- package/es/components/Pagination/experimental/PageSelector.d.ts +19 -0
- package/es/components/Pagination/experimental/Pagination.d.ts +43 -0
- package/es/components/Pagination/experimental/index.d.ts +3 -0
- package/es/components/Popover/index.js +21 -4
- package/es/components/RadioButton/index.js +4 -1
- package/es/components/RadioTile/index.js +4 -1
- package/es/components/Search/Search.js +1 -1
- package/es/components/Search/index.js +4 -1
- package/es/components/Select/index.js +4 -1
- package/es/components/SelectItem/index.js +4 -1
- package/es/components/ShapeIndicator/index.js +1 -1
- package/es/components/SkeletonText/index.js +4 -1
- package/es/components/Slider/Slider.js +1 -1
- package/es/components/Switch/IconSwitch.d.ts +3 -0
- package/es/components/Switch/IconSwitch.js +1 -2
- package/es/components/TabContent/TabContent.js +2 -22
- package/es/components/Tabs/Tabs.js +5 -5
- package/es/components/Tag/DismissibleTag.js +1 -1
- package/es/components/TextArea/TextArea.js +1 -1
- package/es/components/TextArea/index.js +4 -1
- package/es/components/TextInput/index.js +4 -1
- package/es/components/TextInput/util.d.ts +9 -0
- package/es/components/Toggletip/index.js +2 -2
- package/es/components/UIShell/HeaderMenu.js +2 -2
- package/es/components/UIShell/SideNav.js +1 -1
- package/es/components/UIShell/_utils.d.ts +7 -0
- package/es/feature-flags.d.ts +1 -0
- package/es/internal/FloatingMenu.js +1 -1
- package/es/internal/deprecateFieldOnObject.js +1 -1
- package/es/internal/useId.d.ts +21 -0
- package/es/internal/useId.js +27 -1
- package/es/internal/useOverflowItems.js +0 -6
- package/es/node_modules/es-toolkit/dist/compat/function/{debounce.mjs.js → debounce.js} +1 -1
- package/es/node_modules/es-toolkit/dist/compat/function/{throttle.mjs.js → throttle.js} +1 -1
- package/es/prop-types/deprecateComponent.d.ts +1 -0
- package/es/prop-types/deprecateComponent.js +1 -4
- package/es/prop-types/deprecateValuesWithin.d.ts +1 -0
- package/es/prop-types/requiredIfGivenPropIsTruthy.d.ts +14 -0
- package/es/tools/mergeRefs.d.ts +12 -0
- package/es/tools/mergeRefs.js +1 -2
- package/icons/index.js +1 -3
- package/lib/_virtual/_rollupPluginBabelHelpers.js +5 -7
- package/lib/components/AILabel/index.js +35 -43
- package/lib/components/AISkeleton/AISkeletonIcon.js +5 -11
- package/lib/components/AISkeleton/AISkeletonPlaceholder.js +4 -10
- package/lib/components/AISkeleton/AISkeletonText.js +8 -14
- package/lib/components/Accordion/Accordion.Skeleton.js +21 -27
- package/lib/components/Accordion/Accordion.js +11 -17
- package/lib/components/Accordion/AccordionItem.js +19 -25
- package/lib/components/Accordion/AccordionProvider.js +1 -7
- package/lib/components/AspectRatio/AspectRatio.js +7 -13
- package/lib/components/BadgeIndicator/index.js +7 -13
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +7 -13
- package/lib/components/Breadcrumb/Breadcrumb.js +9 -15
- package/lib/components/Breadcrumb/BreadcrumbItem.js +16 -22
- package/lib/components/Button/Button.Skeleton.js +8 -14
- package/lib/components/Button/Button.js +31 -36
- package/lib/components/Button/ButtonBase.js +6 -11
- package/lib/components/Button/index.js +3 -3
- package/lib/components/ButtonSet/ButtonSet.js +6 -12
- package/lib/components/ButtonSet/index.js +2 -2
- package/lib/components/ChatButton/ChatButton.Skeleton.js +5 -11
- package/lib/components/ChatButton/ChatButton.js +12 -18
- package/lib/components/Checkbox/Checkbox.Skeleton.js +6 -12
- package/lib/components/Checkbox/Checkbox.js +33 -39
- package/lib/components/Checkbox/index.js +3 -3
- package/lib/components/CheckboxGroup/CheckboxGroup.js +24 -30
- package/lib/components/ClassPrefix/index.js +3 -10
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +10 -16
- package/lib/components/CodeSnippet/CodeSnippet.js +39 -46
- package/lib/components/ComboBox/ComboBox.js +57 -64
- package/lib/components/ComboBox/index.js +2 -2
- package/lib/components/ComboButton/index.js +20 -28
- package/lib/components/ComposedModal/ComposedModal.js +61 -57
- package/lib/components/ComposedModal/ModalFooter.js +37 -45
- package/lib/components/ComposedModal/ModalHeader.js +23 -31
- package/lib/components/ContainedList/ContainedList.js +18 -24
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +14 -20
- package/lib/components/ContainedList/ContainedListItem/index.js +2 -2
- package/lib/components/ContainedList/index.js +5 -5
- package/lib/components/ContentSwitcher/ContentSwitcher.js +11 -19
- package/lib/components/ContextMenu/useContextMenu.js +1 -1
- package/lib/components/Copy/Copy.js +12 -18
- package/lib/components/Copy/index.js +2 -2
- package/lib/components/CopyButton/CopyButton.js +12 -18
- package/lib/components/CopyButton/index.js +2 -2
- package/lib/components/DangerButton/DangerButton.js +2 -6
- package/lib/components/DataTable/DataTable.js +48 -55
- package/lib/components/DataTable/Table.js +18 -24
- package/lib/components/DataTable/TableActionList.js +2 -2
- package/lib/components/DataTable/TableBatchAction.js +4 -9
- package/lib/components/DataTable/TableBatchActions.js +19 -25
- package/lib/components/DataTable/TableBody.js +5 -10
- package/lib/components/DataTable/TableCell.js +8 -14
- package/lib/components/DataTable/TableContainer.js +14 -20
- package/lib/components/DataTable/TableContext.js +0 -2
- package/lib/components/DataTable/TableDecoratorRow.js +5 -11
- package/lib/components/DataTable/TableExpandHeader.js +16 -22
- package/lib/components/DataTable/TableExpandRow.js +20 -26
- package/lib/components/DataTable/TableExpandedRow.js +8 -14
- package/lib/components/DataTable/TableHead.js +2 -2
- package/lib/components/DataTable/TableHeader.js +26 -32
- package/lib/components/DataTable/TableRow.js +8 -14
- package/lib/components/DataTable/TableSelectAll.js +13 -19
- package/lib/components/DataTable/TableSelectRow.js +15 -21
- package/lib/components/DataTable/TableSlugRow.js +7 -13
- package/lib/components/DataTable/TableToolbar.js +7 -13
- package/lib/components/DataTable/TableToolbarAction.js +5 -10
- package/lib/components/DataTable/TableToolbarContent.js +2 -2
- package/lib/components/DataTable/TableToolbarMenu.js +9 -15
- package/lib/components/DataTable/TableToolbarSearch.js +22 -28
- package/lib/components/DataTable/state/getDerivedStateFromProps.d.ts +19 -0
- package/lib/components/DataTable/state/getDerivedStateFromProps.js +2 -3
- package/lib/components/DataTable/state/sortStates.js +0 -2
- package/lib/components/DataTable/state/sorting.d.ts +15 -0
- package/lib/components/DataTable/state/sorting.js +0 -2
- package/lib/components/DataTable/tools/cells.js +0 -2
- package/lib/components/DataTable/tools/denormalize.d.ts +22 -0
- package/lib/components/DataTable/tools/denormalize.js +1 -2
- package/lib/components/DataTable/tools/filter.js +0 -2
- package/lib/components/DataTable/tools/normalize.d.ts +9 -0
- package/lib/components/DataTable/tools/normalize.js +1 -2
- package/lib/components/DataTable/tools/sorting.js +0 -2
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +25 -31
- package/lib/components/DatePicker/DatePicker.Skeleton.js +14 -20
- package/lib/components/DatePicker/DatePicker.js +65 -66
- package/lib/components/DatePicker/index.js +3 -3
- package/lib/components/DatePicker/plugins/appendToPlugin.js +0 -2
- package/lib/components/DatePicker/plugins/fixEventsPlugin.d.ts +2 -0
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +1 -1
- package/lib/components/DatePicker/plugins/rangePlugin.d.ts +2 -0
- package/lib/components/DatePicker/plugins/rangePlugin.js +2 -6
- package/lib/components/DatePickerInput/DatePickerInput.js +49 -49
- package/lib/components/DatePickerInput/index.js +2 -2
- package/lib/components/Dialog/index.js +72 -80
- package/lib/components/Dropdown/Dropdown.Skeleton.js +8 -14
- package/lib/components/Dropdown/Dropdown.js +49 -55
- package/lib/components/Dropdown/index.js +3 -3
- package/lib/components/ErrorBoundary/ErrorBoundary.js +4 -9
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +0 -2
- package/lib/components/ExpandableSearch/ExpandableSearch.js +6 -11
- package/lib/components/FeatureFlags/index.js +10 -17
- package/lib/components/FileUploader/FileUploader.Skeleton.js +7 -13
- package/lib/components/FileUploader/FileUploader.js +30 -36
- package/lib/components/FileUploader/FileUploaderButton.js +19 -25
- package/lib/components/FileUploader/FileUploaderDropContainer.js +18 -24
- package/lib/components/FileUploader/FileUploaderItem.js +23 -29
- package/lib/components/FileUploader/Filename.js +13 -18
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +7 -13
- package/lib/components/FluidComboBox/FluidComboBox.js +24 -30
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +14 -20
- package/lib/components/FluidDatePicker/FluidDatePicker.js +12 -18
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +4 -8
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +7 -13
- package/lib/components/FluidDropdown/FluidDropdown.js +24 -30
- package/lib/components/FluidForm/FluidForm.js +6 -12
- package/lib/components/FluidForm/FormContext.js +0 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +7 -13
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +36 -42
- package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +7 -13
- package/lib/components/FluidNumberInput/FluidNumberInput.js +30 -36
- package/lib/components/FluidSearch/FluidSearch.Skeleton.js +7 -13
- package/lib/components/FluidSearch/FluidSearch.js +19 -25
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +7 -13
- package/lib/components/FluidSelect/FluidSelect.js +17 -23
- package/lib/components/FluidSelect/index.js +3 -3
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +7 -13
- package/lib/components/FluidTextArea/FluidTextArea.js +25 -31
- package/lib/components/FluidTextInput/FluidPasswordInput.js +18 -22
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +7 -13
- package/lib/components/FluidTextInput/FluidTextInput.js +23 -29
- package/lib/components/FluidTextInput/index.js +3 -3
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +6 -12
- package/lib/components/FluidTimePicker/FluidTimePicker.js +23 -29
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +10 -15
- package/lib/components/Form/Form.js +5 -11
- package/lib/components/FormGroup/FormGroup.js +13 -19
- package/lib/components/FormItem/FormItem.js +5 -11
- package/lib/components/FormLabel/FormLabel.js +6 -12
- package/lib/components/Grid/CSSGrid.js +20 -28
- package/lib/components/Grid/Column.js +31 -37
- package/lib/components/Grid/ColumnHang.js +5 -13
- package/lib/components/Grid/FlexGrid.js +10 -18
- package/lib/components/Grid/Grid.js +9 -16
- package/lib/components/Grid/GridContext.js +7 -14
- package/lib/components/Grid/Row.js +8 -14
- package/lib/components/Heading/index.js +14 -21
- package/lib/components/Icon/Icon.Skeleton.js +4 -10
- package/lib/components/IconButton/index.js +25 -33
- package/lib/components/IconIndicator/index.js +9 -15
- package/lib/components/IdPrefix/index.js +3 -10
- package/lib/components/InlineCheckbox/InlineCheckbox.js +17 -22
- package/lib/components/InlineCheckbox/index.js +2 -2
- package/lib/components/InlineLoading/InlineLoading.js +17 -23
- package/lib/components/InlineLoading/index.js +2 -2
- package/lib/components/Layer/LayerContext.js +1 -7
- package/lib/components/Layer/LayerLevel.js +0 -2
- package/lib/components/Layer/index.js +11 -19
- package/lib/components/Layout/index.js +22 -30
- package/lib/components/LayoutDirection/LayoutDirection.js +6 -13
- package/lib/components/LayoutDirection/LayoutDirectionContext.js +1 -7
- package/lib/components/LayoutDirection/useLayoutDirection.js +0 -2
- package/lib/components/Link/Link.js +15 -21
- package/lib/components/Link/index.js +2 -2
- package/lib/components/ListBox/ListBox.js +17 -23
- package/lib/components/ListBox/ListBoxField.js +7 -12
- package/lib/components/ListBox/ListBoxMenu.js +7 -12
- package/lib/components/ListBox/ListBoxMenuIcon.js +7 -13
- package/lib/components/ListBox/ListBoxMenuItem.js +9 -15
- package/lib/components/ListBox/ListBoxPropTypes.js +2 -8
- package/lib/components/ListBox/ListBoxSelection.js +14 -20
- package/lib/components/ListBox/index.js +7 -7
- package/lib/components/ListBox/next/ListBoxSelection.js +18 -24
- package/lib/components/ListBox/next/ListBoxTrigger.js +7 -13
- package/lib/components/ListItem/ListItem.js +5 -11
- package/lib/components/Loading/Loading.js +14 -20
- package/lib/components/Loading/index.js +2 -2
- package/lib/components/Menu/Menu.d.ts +3 -1
- package/lib/components/Menu/Menu.js +18 -24
- package/lib/components/Menu/MenuContext.js +0 -2
- package/lib/components/Menu/MenuItem.js +44 -52
- package/lib/components/MenuButton/index.js +16 -24
- package/lib/components/Modal/Modal.js +91 -86
- package/lib/components/Modal/index.js +2 -2
- package/lib/components/ModalWrapper/ModalWrapper.js +30 -35
- package/lib/components/MultiSelect/FilterableMultiSelect.js +57 -67
- package/lib/components/MultiSelect/MultiSelect.js +61 -70
- package/lib/components/MultiSelect/MultiSelectPropTypes.js +2 -8
- package/lib/components/MultiSelect/filter.js +0 -6
- package/lib/components/MultiSelect/tools/itemToString.d.ts +1 -0
- package/lib/components/MultiSelect/tools/itemToString.js +1 -7
- package/lib/components/MultiSelect/tools/sorting.d.ts +9 -0
- package/lib/components/MultiSelect/tools/sorting.js +0 -2
- package/lib/components/Notification/Notification.js +118 -126
- package/lib/components/NumberInput/NumberFormatPropTypes.js +21 -27
- package/lib/components/NumberInput/NumberInput.Skeleton.js +8 -14
- package/lib/components/NumberInput/NumberInput.js +66 -74
- package/lib/components/OrderedList/OrderedList.js +8 -14
- package/lib/components/OverflowMenu/OverflowMenu.js +42 -49
- package/lib/components/OverflowMenu/index.js +3 -7
- package/lib/components/OverflowMenu/next/index.js +18 -26
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +27 -33
- package/lib/components/OverflowMenuItem/index.js +2 -2
- package/lib/components/OverflowMenuV2/index.d.ts +1 -0
- package/lib/components/OverflowMenuV2/index.js +2 -8
- package/lib/components/PageHeader/PageHeader.js +70 -78
- package/lib/components/PageHeader/index.js +0 -2
- package/lib/components/Pagination/Pagination.Skeleton.js +10 -16
- package/lib/components/Pagination/Pagination.js +44 -51
- package/lib/components/Pagination/experimental/PageSelector.d.ts +19 -0
- package/lib/components/Pagination/experimental/PageSelector.js +9 -15
- package/lib/components/Pagination/experimental/Pagination.d.ts +43 -0
- package/lib/components/Pagination/experimental/Pagination.js +34 -40
- package/lib/components/Pagination/experimental/index.d.ts +3 -0
- package/lib/components/PaginationNav/PaginationNav.js +54 -60
- package/lib/components/Popover/index.js +56 -47
- package/lib/components/PrimaryButton/PrimaryButton.js +2 -6
- package/lib/components/ProgressBar/ProgressBar.js +25 -31
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +10 -16
- package/lib/components/ProgressIndicator/ProgressIndicator.js +41 -49
- package/lib/components/RadioButton/RadioButton.Skeleton.js +6 -12
- package/lib/components/RadioButton/RadioButton.js +26 -32
- package/lib/components/RadioButton/index.js +2 -2
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +37 -43
- package/lib/components/RadioTile/RadioTile.js +25 -31
- package/lib/components/RadioTile/index.js +2 -2
- package/lib/components/Search/Search.Skeleton.js +7 -13
- package/lib/components/Search/Search.js +33 -39
- package/lib/components/Search/index.js +3 -3
- package/lib/components/SecondaryButton/SecondaryButton.js +2 -6
- package/lib/components/Select/Select.Skeleton.js +8 -14
- package/lib/components/Select/Select.js +42 -48
- package/lib/components/Select/index.js +3 -3
- package/lib/components/SelectItem/SelectItem.js +8 -14
- package/lib/components/SelectItem/index.js +2 -2
- package/lib/components/SelectItemGroup/SelectItemGroup.js +7 -13
- package/lib/components/ShapeIndicator/index.js +12 -18
- package/lib/components/SkeletonIcon/SkeletonIcon.js +4 -10
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +4 -10
- package/lib/components/SkeletonText/SkeletonText.js +11 -17
- package/lib/components/SkeletonText/index.js +2 -2
- package/lib/components/Slider/Slider.Skeleton.js +29 -35
- package/lib/components/Slider/Slider.js +84 -90
- package/lib/components/Slider/SliderHandles.js +18 -24
- package/lib/components/Slider/index.js +3 -3
- package/lib/components/Stack/HStack.js +1 -7
- package/lib/components/Stack/Stack.js +7 -15
- package/lib/components/Stack/VStack.js +1 -7
- package/lib/components/StructuredList/StructuredList.Skeleton.js +15 -21
- package/lib/components/StructuredList/StructuredList.js +60 -68
- package/lib/components/Switch/IconSwitch.d.ts +3 -0
- package/lib/components/Switch/IconSwitch.js +18 -25
- package/lib/components/Switch/Switch.js +14 -20
- package/lib/components/TabContent/TabContent.js +7 -33
- package/lib/components/Tabs/Tabs.Skeleton.js +10 -16
- package/lib/components/Tabs/Tabs.js +121 -129
- package/lib/components/Tabs/usePressable.js +0 -2
- package/lib/components/Tag/DismissibleTag.js +24 -30
- package/lib/components/Tag/OperationalTag.js +16 -22
- package/lib/components/Tag/SelectableTag.js +19 -25
- package/lib/components/Tag/Tag.Skeleton.js +5 -11
- package/lib/components/Tag/Tag.js +28 -34
- package/lib/components/Tag/isEllipsisActive.js +0 -2
- package/lib/components/Text/Text.js +6 -13
- package/lib/components/Text/TextDirection.js +4 -11
- package/lib/components/Text/TextDirectionContext.js +0 -2
- package/lib/components/Text/createTextComponent.js +1 -7
- package/lib/components/Text/index.js +0 -2
- package/lib/components/TextArea/TextArea.Skeleton.js +7 -13
- package/lib/components/TextArea/TextArea.js +49 -55
- package/lib/components/TextArea/index.js +3 -3
- package/lib/components/TextInput/ControlledPasswordInput.js +36 -42
- package/lib/components/TextInput/PasswordInput.js +48 -54
- package/lib/components/TextInput/TextInput.Skeleton.js +7 -13
- package/lib/components/TextInput/TextInput.js +47 -53
- package/lib/components/TextInput/index.js +3 -3
- package/lib/components/TextInput/util.d.ts +9 -0
- package/lib/components/TextInput/util.js +0 -2
- package/lib/components/Theme/index.js +16 -24
- package/lib/components/Tile/Tile.js +92 -100
- package/lib/components/TileGroup/TileGroup.js +15 -22
- package/lib/components/TimePicker/TimePicker.js +39 -45
- package/lib/components/TimePickerSelect/TimePickerSelect.js +10 -16
- package/lib/components/Toggle/Toggle.Skeleton.js +7 -13
- package/lib/components/Toggle/Toggle.js +28 -34
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +12 -20
- package/lib/components/Toggletip/index.js +32 -40
- package/lib/components/Tooltip/DefinitionTooltip.js +14 -22
- package/lib/components/Tooltip/Tooltip.js +19 -27
- package/lib/components/TreeView/TreeContext.js +0 -2
- package/lib/components/TreeView/TreeNode.js +41 -47
- package/lib/components/TreeView/TreeView.js +17 -23
- package/lib/components/UIShell/Content.js +6 -12
- package/lib/components/UIShell/Header.js +4 -10
- package/lib/components/UIShell/HeaderContainer.js +4 -9
- package/lib/components/UIShell/HeaderGlobalAction.js +11 -17
- package/lib/components/UIShell/HeaderGlobalBar.js +2 -2
- package/lib/components/UIShell/HeaderMenu.js +17 -23
- package/lib/components/UIShell/HeaderMenuButton.js +9 -15
- package/lib/components/UIShell/HeaderMenuItem.js +11 -17
- package/lib/components/UIShell/HeaderName.js +8 -14
- package/lib/components/UIShell/HeaderNavigation.js +6 -12
- package/lib/components/UIShell/HeaderPanel.js +11 -17
- package/lib/components/UIShell/HeaderSideNavItems.js +6 -12
- package/lib/components/UIShell/Link.js +6 -11
- package/lib/components/UIShell/SideNav.js +23 -29
- package/lib/components/UIShell/SideNavDetails.js +7 -13
- package/lib/components/UIShell/SideNavDivider.js +5 -11
- package/lib/components/UIShell/SideNavFooter.js +12 -18
- package/lib/components/UIShell/SideNavHeader.js +8 -14
- package/lib/components/UIShell/SideNavIcon.js +6 -12
- package/lib/components/UIShell/SideNavItem.js +6 -12
- package/lib/components/UIShell/SideNavItems.js +9 -15
- package/lib/components/UIShell/SideNavLink.js +13 -19
- package/lib/components/UIShell/SideNavLinkText.js +5 -11
- package/lib/components/UIShell/SideNavMenu.js +20 -26
- package/lib/components/UIShell/SideNavMenuItem.js +13 -19
- package/lib/components/UIShell/SideNavSwitcher.js +13 -19
- package/lib/components/UIShell/SkipToContent.js +7 -13
- package/lib/components/UIShell/Switcher.js +9 -15
- package/lib/components/UIShell/SwitcherDivider.js +4 -10
- package/lib/components/UIShell/SwitcherItem.js +15 -21
- package/lib/components/UIShell/_utils.d.ts +7 -0
- package/lib/components/UIShell/_utils.js +0 -2
- package/lib/components/UnorderedList/UnorderedList.js +7 -13
- package/lib/feature-flags.d.ts +1 -0
- package/lib/feature-flags.js +3 -4
- package/lib/index.js +180 -182
- package/lib/internal/FloatingMenu.js +10 -18
- package/lib/internal/OptimizedResize.js +2 -8
- package/lib/internal/Selection.js +1 -7
- package/lib/internal/clamp.js +0 -2
- package/lib/internal/createClassWrapper.js +1 -7
- package/lib/internal/deprecateFieldOnObject.js +1 -3
- package/lib/internal/environment.js +0 -2
- package/lib/internal/getAnnouncement.js +0 -2
- package/lib/internal/keyboard/keys.js +0 -2
- package/lib/internal/keyboard/match.js +0 -2
- package/lib/internal/keyboard/navigation.js +0 -2
- package/lib/internal/noopFn.js +0 -2
- package/lib/internal/useAttachedMenu.js +0 -2
- package/lib/internal/useControllableState.js +0 -2
- package/lib/internal/useDelayedState.js +0 -2
- package/lib/internal/useEvent.js +0 -2
- package/lib/internal/useId.d.ts +21 -0
- package/lib/internal/useId.js +27 -7
- package/lib/internal/useIdPrefix.js +2 -8
- package/lib/internal/useIsomorphicEffect.js +1 -1
- package/lib/internal/useMatchMedia.js +0 -2
- package/lib/internal/useMergedRefs.js +0 -2
- package/lib/internal/useNoInteractiveChildren.js +0 -2
- package/lib/internal/useNormalizedInputProps.js +2 -8
- package/lib/internal/useOutsideClick.js +0 -2
- package/lib/internal/useOverflowItems.js +1 -7
- package/lib/internal/usePrefix.js +2 -8
- package/lib/internal/usePreviousValue.js +0 -2
- package/lib/internal/useResizeObserver.js +0 -2
- package/lib/internal/useSavedCallback.js +0 -2
- package/lib/internal/utils.js +0 -2
- package/lib/internal/warning.js +0 -2
- package/lib/internal/wrapFocus.js +0 -2
- package/lib/node_modules/es-toolkit/dist/compat/function/{debounce.mjs.js → debounce.js} +1 -3
- package/lib/node_modules/es-toolkit/dist/compat/function/{throttle.mjs.js → throttle.js} +1 -3
- package/lib/node_modules/es-toolkit/dist/function/{debounce.mjs.js → debounce.js} +0 -2
- package/lib/prop-types/AriaPropTypes.js +2 -8
- package/lib/prop-types/deprecate.js +0 -2
- package/lib/prop-types/deprecateComponent.d.ts +1 -0
- package/lib/prop-types/deprecateComponent.js +2 -5
- package/lib/prop-types/deprecateValuesWithin.d.ts +1 -0
- package/lib/prop-types/deprecateValuesWithin.js +1 -1
- package/lib/prop-types/isRequiredOneOf.js +0 -2
- package/lib/prop-types/requiredIfGivenPropIsTruthy.d.ts +14 -0
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +1 -1
- package/lib/tools/events.js +0 -2
- package/lib/tools/mapPopoverAlign.js +0 -2
- package/lib/tools/mergeRefs.d.ts +12 -0
- package/lib/tools/mergeRefs.js +1 -2
- package/lib/tools/setupGetInstanceId.js +0 -2
- package/lib/tools/toggleClass.js +0 -2
- package/lib/tools/wrapComponent.js +4 -10
- package/package.json +11 -11
- /package/es/node_modules/es-toolkit/dist/function/{debounce.mjs.js → debounce.js} +0 -0
|
@@ -26,13 +26,6 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
26
26
|
var deprecateValuesWithin = require('../../prop-types/deprecateValuesWithin.js');
|
|
27
27
|
var mapPopoverAlign = require('../../tools/mapPopoverAlign.js');
|
|
28
28
|
|
|
29
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
30
|
-
|
|
31
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
32
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
33
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
34
|
-
var copy__default = /*#__PURE__*/_interopDefaultLegacy(copy);
|
|
35
|
-
|
|
36
29
|
const rowHeightInPixels = 16;
|
|
37
30
|
const defaultMaxCollapsedNumberOfRows = 15;
|
|
38
31
|
const defaultMaxExpandedNumberOfRows = 0;
|
|
@@ -136,13 +129,13 @@ function CodeSnippet({
|
|
|
136
129
|
}, [handleScroll]);
|
|
137
130
|
const handleCopyClick = evt => {
|
|
138
131
|
if (copyText || innerCodeRef?.current) {
|
|
139
|
-
|
|
132
|
+
copy(copyText ?? innerCodeRef?.current?.innerText ?? '');
|
|
140
133
|
}
|
|
141
134
|
if (onClick) {
|
|
142
135
|
onClick(evt);
|
|
143
136
|
}
|
|
144
137
|
};
|
|
145
|
-
const codeSnippetClasses =
|
|
138
|
+
const codeSnippetClasses = cx(className, `${prefix}--snippet`, {
|
|
146
139
|
[`${prefix}--snippet--${type}`]: type,
|
|
147
140
|
[`${prefix}--snippet--disabled`]: type !== 'inline' && disabled,
|
|
148
141
|
[`${prefix}--snippet--expand`]: expandedCode,
|
|
@@ -154,14 +147,14 @@ function CodeSnippet({
|
|
|
154
147
|
const expandCodeBtnText = expandedCode ? showLessText : showMoreText;
|
|
155
148
|
if (type === 'inline') {
|
|
156
149
|
if (hideCopyButton) {
|
|
157
|
-
return /*#__PURE__*/
|
|
150
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
158
151
|
className: codeSnippetClasses
|
|
159
|
-
}, /*#__PURE__*/
|
|
152
|
+
}, /*#__PURE__*/React.createElement("code", {
|
|
160
153
|
id: uid,
|
|
161
154
|
ref: innerCodeRef
|
|
162
155
|
}, children));
|
|
163
156
|
}
|
|
164
|
-
return /*#__PURE__*/
|
|
157
|
+
return /*#__PURE__*/React.createElement(Copy.default, _rollupPluginBabelHelpers.extends({}, rest, {
|
|
165
158
|
align: align,
|
|
166
159
|
autoAlign: autoAlign,
|
|
167
160
|
onClick: handleCopyClick,
|
|
@@ -171,7 +164,7 @@ function CodeSnippet({
|
|
|
171
164
|
disabled: disabled,
|
|
172
165
|
feedback: feedback,
|
|
173
166
|
feedbackTimeout: feedbackTimeout
|
|
174
|
-
}), /*#__PURE__*/
|
|
167
|
+
}), /*#__PURE__*/React.createElement("code", {
|
|
175
168
|
id: uid,
|
|
176
169
|
ref: innerCodeRef
|
|
177
170
|
}, children));
|
|
@@ -198,9 +191,9 @@ function CodeSnippet({
|
|
|
198
191
|
containerStyle.style = styles;
|
|
199
192
|
}
|
|
200
193
|
}
|
|
201
|
-
return /*#__PURE__*/
|
|
194
|
+
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({}, rest, {
|
|
202
195
|
className: codeSnippetClasses
|
|
203
|
-
}), /*#__PURE__*/
|
|
196
|
+
}), /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
|
204
197
|
ref: codeContainerRef,
|
|
205
198
|
role: type === 'single' || type === 'multi' ? 'textbox' : undefined,
|
|
206
199
|
tabIndex: (type === 'single' || type === 'multi') && !disabled ? 0 : undefined,
|
|
@@ -209,16 +202,16 @@ function CodeSnippet({
|
|
|
209
202
|
"aria-readonly": type === 'single' || type === 'multi' ? true : undefined,
|
|
210
203
|
"aria-multiline": type === 'multi' ? true : undefined,
|
|
211
204
|
onScroll: type === 'single' && handleScroll || undefined
|
|
212
|
-
}, containerStyle), /*#__PURE__*/
|
|
205
|
+
}, containerStyle), /*#__PURE__*/React.createElement("pre", {
|
|
213
206
|
ref: codeContentRef,
|
|
214
207
|
onScroll: type === 'multi' && handleScroll || undefined
|
|
215
|
-
}, /*#__PURE__*/
|
|
208
|
+
}, /*#__PURE__*/React.createElement("code", {
|
|
216
209
|
ref: innerCodeRef
|
|
217
|
-
}, children))), hasLeftOverflow && /*#__PURE__*/
|
|
210
|
+
}, children))), hasLeftOverflow && /*#__PURE__*/React.createElement("div", {
|
|
218
211
|
className: `${prefix}--snippet__overflow-indicator--left`
|
|
219
|
-
}), hasRightOverflow && type !== 'multi' && /*#__PURE__*/
|
|
212
|
+
}), hasRightOverflow && type !== 'multi' && /*#__PURE__*/React.createElement("div", {
|
|
220
213
|
className: `${prefix}--snippet__overflow-indicator--right`
|
|
221
|
-
}), !hideCopyButton && /*#__PURE__*/
|
|
214
|
+
}), !hideCopyButton && /*#__PURE__*/React.createElement(CopyButton.default, {
|
|
222
215
|
align: align,
|
|
223
216
|
autoAlign: autoAlign,
|
|
224
217
|
size: type === 'multi' ? 'sm' : 'md',
|
|
@@ -227,15 +220,15 @@ function CodeSnippet({
|
|
|
227
220
|
feedback: feedback,
|
|
228
221
|
feedbackTimeout: feedbackTimeout,
|
|
229
222
|
iconDescription: copyButtonDescription
|
|
230
|
-
}), shouldShowMoreLessBtn && /*#__PURE__*/
|
|
223
|
+
}), shouldShowMoreLessBtn && /*#__PURE__*/React.createElement(Button.default, {
|
|
231
224
|
kind: "ghost",
|
|
232
225
|
size: "sm",
|
|
233
226
|
className: `${prefix}--snippet-btn--expand`,
|
|
234
227
|
disabled: disabled,
|
|
235
228
|
onClick: () => setExpandedCode(!expandedCode)
|
|
236
|
-
}, /*#__PURE__*/
|
|
229
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
237
230
|
className: `${prefix}--snippet-btn--text`
|
|
238
|
-
}, expandCodeBtnText), /*#__PURE__*/
|
|
231
|
+
}, expandCodeBtnText), /*#__PURE__*/React.createElement(iconsReact.ChevronDown, {
|
|
239
232
|
className: `${prefix}--icon-chevron--down ${prefix}--snippet__icon`,
|
|
240
233
|
name: "chevron--down",
|
|
241
234
|
role: "img"
|
|
@@ -245,7 +238,7 @@ CodeSnippet.propTypes = {
|
|
|
245
238
|
/**
|
|
246
239
|
* Specify how the trigger should align with the tooltip
|
|
247
240
|
*/
|
|
248
|
-
align: deprecateValuesWithin
|
|
241
|
+
align: deprecateValuesWithin.default(PropTypes.oneOf(['top', 'top-left',
|
|
249
242
|
// deprecated use top-start instead
|
|
250
243
|
'top-right',
|
|
251
244
|
// deprecated use top-end instead
|
|
@@ -271,95 +264,95 @@ CodeSnippet.propTypes = {
|
|
|
271
264
|
* Specify a label to be read by screen readers on the containing textbox
|
|
272
265
|
* node
|
|
273
266
|
*/
|
|
274
|
-
['aria-label']:
|
|
267
|
+
['aria-label']: PropTypes.string,
|
|
275
268
|
/**
|
|
276
269
|
* Deprecated, please use `aria-label` instead.
|
|
277
270
|
* Specify a label to be read by screen readers on the containing textbox
|
|
278
271
|
* node
|
|
279
272
|
*/
|
|
280
|
-
ariaLabel: deprecate.deprecate(
|
|
273
|
+
ariaLabel: deprecate.deprecate(PropTypes.string, 'This prop syntax has been deprecated. Please use the new `aria-label`.'),
|
|
281
274
|
/**
|
|
282
275
|
* **Experimental**: Will attempt to automatically align the tooltip
|
|
283
276
|
*/
|
|
284
|
-
autoAlign:
|
|
277
|
+
autoAlign: PropTypes.bool,
|
|
285
278
|
/**
|
|
286
279
|
* Provide the content of your CodeSnippet as a node or string
|
|
287
280
|
*/
|
|
288
|
-
children:
|
|
281
|
+
children: PropTypes.node,
|
|
289
282
|
/**
|
|
290
283
|
* Specify an optional className to be applied to the container node
|
|
291
284
|
*/
|
|
292
|
-
className:
|
|
285
|
+
className: PropTypes.string,
|
|
293
286
|
/**
|
|
294
287
|
* Specify the description for the Copy Button
|
|
295
288
|
*/
|
|
296
|
-
copyButtonDescription:
|
|
289
|
+
copyButtonDescription: PropTypes.string,
|
|
297
290
|
/**
|
|
298
291
|
* Optional text to copy. If not specified, the `children` node's `innerText`
|
|
299
292
|
* will be used as the copy value.
|
|
300
293
|
*/
|
|
301
|
-
copyText:
|
|
294
|
+
copyText: PropTypes.string,
|
|
302
295
|
/**
|
|
303
296
|
* Specify whether or not the CodeSnippet should be disabled
|
|
304
297
|
*/
|
|
305
|
-
disabled:
|
|
298
|
+
disabled: PropTypes.bool,
|
|
306
299
|
/**
|
|
307
300
|
* Specify the string displayed when the snippet is copied
|
|
308
301
|
*/
|
|
309
|
-
feedback:
|
|
302
|
+
feedback: PropTypes.string,
|
|
310
303
|
/**
|
|
311
304
|
* Specify the time it takes for the feedback message to timeout
|
|
312
305
|
*/
|
|
313
|
-
feedbackTimeout:
|
|
306
|
+
feedbackTimeout: PropTypes.number,
|
|
314
307
|
/**
|
|
315
308
|
* Specify whether or not a copy button should be used/rendered.
|
|
316
309
|
*/
|
|
317
|
-
hideCopyButton:
|
|
310
|
+
hideCopyButton: PropTypes.bool,
|
|
318
311
|
/**
|
|
319
312
|
* Specify whether you are using the light variant of the Code Snippet,
|
|
320
313
|
* typically used for inline snippet to display an alternate color
|
|
321
314
|
*/
|
|
322
315
|
|
|
323
|
-
light: deprecate.deprecate(
|
|
316
|
+
light: deprecate.deprecate(PropTypes.bool, 'The `light` prop for `CodeSnippet` has ' + 'been deprecated in favor of the new `Layer` component. It will be removed in the next major release.'),
|
|
324
317
|
/**
|
|
325
318
|
* Specify the maximum number of rows to be shown when in collapsed view
|
|
326
319
|
*/
|
|
327
|
-
maxCollapsedNumberOfRows:
|
|
320
|
+
maxCollapsedNumberOfRows: PropTypes.number,
|
|
328
321
|
/**
|
|
329
322
|
* Specify the maximum number of rows to be shown when in expanded view
|
|
330
323
|
*/
|
|
331
|
-
maxExpandedNumberOfRows:
|
|
324
|
+
maxExpandedNumberOfRows: PropTypes.number,
|
|
332
325
|
/**
|
|
333
326
|
* Specify the minimum number of rows to be shown when in collapsed view
|
|
334
327
|
*/
|
|
335
|
-
minCollapsedNumberOfRows:
|
|
328
|
+
minCollapsedNumberOfRows: PropTypes.number,
|
|
336
329
|
/**
|
|
337
330
|
* Specify the minimum number of rows to be shown when in expanded view
|
|
338
331
|
*/
|
|
339
|
-
minExpandedNumberOfRows:
|
|
332
|
+
minExpandedNumberOfRows: PropTypes.number,
|
|
340
333
|
/**
|
|
341
334
|
* An optional handler to listen to the `onClick` even fired by the Copy
|
|
342
335
|
* Button
|
|
343
336
|
*/
|
|
344
|
-
onClick:
|
|
337
|
+
onClick: PropTypes.func,
|
|
345
338
|
/**
|
|
346
339
|
* Specify a string that is displayed when the Code Snippet has been
|
|
347
340
|
* interacted with to show more lines
|
|
348
341
|
*/
|
|
349
|
-
showLessText:
|
|
342
|
+
showLessText: PropTypes.string,
|
|
350
343
|
/**
|
|
351
344
|
* Specify a string that is displayed when the Code Snippet text is more
|
|
352
345
|
* than 15 lines
|
|
353
346
|
*/
|
|
354
|
-
showMoreText:
|
|
347
|
+
showMoreText: PropTypes.string,
|
|
355
348
|
/**
|
|
356
349
|
* Provide the type of Code Snippet
|
|
357
350
|
*/
|
|
358
|
-
type:
|
|
351
|
+
type: PropTypes.oneOf(['single', 'inline', 'multi']),
|
|
359
352
|
/**
|
|
360
353
|
* Specify whether or not to wrap the text.
|
|
361
354
|
*/
|
|
362
|
-
wrapText:
|
|
355
|
+
wrapText: PropTypes.bool
|
|
363
356
|
};
|
|
364
357
|
|
|
365
|
-
exports
|
|
358
|
+
exports.default = CodeSnippet;
|
|
@@ -35,13 +35,6 @@ var utils = require('../../internal/utils.js');
|
|
|
35
35
|
var ListBoxPropTypes = require('../ListBox/ListBoxPropTypes.js');
|
|
36
36
|
var Text = require('../Text/Text.js');
|
|
37
37
|
|
|
38
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
39
|
-
|
|
40
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
41
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
42
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
43
|
-
var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
|
|
44
|
-
|
|
45
38
|
const {
|
|
46
39
|
InputBlur,
|
|
47
40
|
InputKeyDownEnter,
|
|
@@ -421,28 +414,28 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
421
414
|
}
|
|
422
415
|
};
|
|
423
416
|
const showWarning = !invalid && warn;
|
|
424
|
-
const className =
|
|
417
|
+
const className = cx(`${prefix}--combo-box`, {
|
|
425
418
|
[`${prefix}--combo-box--invalid--focused`]: invalid && isFocused,
|
|
426
419
|
[`${prefix}--list-box--up`]: direction === 'top',
|
|
427
420
|
[`${prefix}--combo-box--warning`]: showWarning,
|
|
428
421
|
[`${prefix}--combo-box--readonly`]: readOnly,
|
|
429
422
|
[`${prefix}--autoalign`]: enableFloatingStyles
|
|
430
423
|
});
|
|
431
|
-
const titleClasses =
|
|
424
|
+
const titleClasses = cx(`${prefix}--label`, {
|
|
432
425
|
[`${prefix}--label--disabled`]: disabled
|
|
433
426
|
});
|
|
434
427
|
const helperTextId = `combobox-helper-text-${comboBoxInstanceId}`;
|
|
435
428
|
const warnTextId = `combobox-warn-text-${comboBoxInstanceId}`;
|
|
436
429
|
const invalidTextId = `combobox-invalid-text-${comboBoxInstanceId}`;
|
|
437
|
-
const helperClasses =
|
|
430
|
+
const helperClasses = cx(`${prefix}--form__helper-text`, {
|
|
438
431
|
[`${prefix}--form__helper-text--disabled`]: disabled
|
|
439
432
|
});
|
|
440
|
-
const wrapperClasses =
|
|
433
|
+
const wrapperClasses = cx(`${prefix}--list-box__wrapper`, [containerClassName, {
|
|
441
434
|
[`${prefix}--list-box__wrapper--fluid--invalid`]: isFluid && invalid,
|
|
442
435
|
[`${prefix}--list-box__wrapper--slug`]: slug,
|
|
443
436
|
[`${prefix}--list-box__wrapper--decorator`]: decorator
|
|
444
437
|
}]);
|
|
445
|
-
const inputClasses =
|
|
438
|
+
const inputClasses = cx(`${prefix}--text-input`, {
|
|
446
439
|
[`${prefix}--text-input--empty`]: !inputValue,
|
|
447
440
|
[`${prefix}--combo-box--input--focus`]: isFocused
|
|
448
441
|
});
|
|
@@ -520,7 +513,7 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
520
513
|
if (isManualClearingRef.current) {
|
|
521
514
|
return;
|
|
522
515
|
}
|
|
523
|
-
if ((type === ItemClick || type === FunctionSelectItem || type === InputKeyDownEnter) && typeof newSelectedItem !== 'undefined' && !
|
|
516
|
+
if ((type === ItemClick || type === FunctionSelectItem || type === InputKeyDownEnter) && typeof newSelectedItem !== 'undefined' && !isEqual(selectedItemProp, newSelectedItem)) {
|
|
524
517
|
onChange({
|
|
525
518
|
selectedItem: newSelectedItem
|
|
526
519
|
});
|
|
@@ -601,12 +594,12 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
601
594
|
}
|
|
602
595
|
}
|
|
603
596
|
}, [inputValue, typeaheadText]);
|
|
604
|
-
return /*#__PURE__*/
|
|
597
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
605
598
|
className: wrapperClasses
|
|
606
|
-
}, titleText && /*#__PURE__*/
|
|
599
|
+
}, titleText && /*#__PURE__*/React.createElement(Text.Text, _rollupPluginBabelHelpers.extends({
|
|
607
600
|
as: "label",
|
|
608
601
|
className: titleClasses
|
|
609
|
-
}, getLabelProps()), titleText), /*#__PURE__*/
|
|
602
|
+
}, getLabelProps()), titleText), /*#__PURE__*/React.createElement(index$2.default, {
|
|
610
603
|
onFocus: handleFocus,
|
|
611
604
|
onBlur: handleFocus,
|
|
612
605
|
className: className,
|
|
@@ -621,9 +614,9 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
621
614
|
ref: enableFloatingStyles ? refs.setReference : null,
|
|
622
615
|
warnText: warnText,
|
|
623
616
|
warnTextId: warnTextId
|
|
624
|
-
}, /*#__PURE__*/
|
|
617
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
625
618
|
className: `${prefix}--list-box__field`
|
|
626
|
-
}, /*#__PURE__*/
|
|
619
|
+
}, /*#__PURE__*/React.createElement("input", _rollupPluginBabelHelpers.extends({
|
|
627
620
|
disabled: disabled,
|
|
628
621
|
className: inputClasses,
|
|
629
622
|
type: "text",
|
|
@@ -641,7 +634,7 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
641
634
|
setInputValue(newValue);
|
|
642
635
|
downshiftSetInputValue(newValue);
|
|
643
636
|
},
|
|
644
|
-
ref: mergeRefs
|
|
637
|
+
ref: mergeRefs.default(textInput, ref, inputRef),
|
|
645
638
|
onKeyDown: event => {
|
|
646
639
|
if (match.match(event, keys.Space)) {
|
|
647
640
|
event.stopPropagation();
|
|
@@ -708,11 +701,11 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
708
701
|
}), rest, readOnlyEventHandlers, {
|
|
709
702
|
readOnly: readOnly,
|
|
710
703
|
"aria-describedby": ariaDescribedBy
|
|
711
|
-
})), invalid && /*#__PURE__*/
|
|
704
|
+
})), invalid && /*#__PURE__*/React.createElement(iconsReact.WarningFilled, {
|
|
712
705
|
className: `${prefix}--list-box__invalid-icon`
|
|
713
|
-
}), showWarning && /*#__PURE__*/
|
|
706
|
+
}), showWarning && /*#__PURE__*/React.createElement(iconsReact.WarningAltFilled, {
|
|
714
707
|
className: `${prefix}--list-box__invalid-icon ${prefix}--list-box__invalid-icon--warning`
|
|
715
|
-
}), inputValue && /*#__PURE__*/
|
|
708
|
+
}), inputValue && /*#__PURE__*/React.createElement(ListBoxSelection.default, {
|
|
716
709
|
clearSelection: () => {
|
|
717
710
|
setIsClearing(true); // This updates the state which syncs to the ref
|
|
718
711
|
setInputValue('');
|
|
@@ -726,12 +719,12 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
726
719
|
disabled: disabled || readOnly,
|
|
727
720
|
onClearSelection: handleSelectionClear,
|
|
728
721
|
selectionCount: 0
|
|
729
|
-
}), /*#__PURE__*/
|
|
722
|
+
}), /*#__PURE__*/React.createElement(ListBoxTrigger.default, _rollupPluginBabelHelpers.extends({}, buttonProps, {
|
|
730
723
|
isOpen: isOpen,
|
|
731
724
|
translateWithId: translateWithId
|
|
732
|
-
}))), slug ? normalizedDecorator : decorator ? /*#__PURE__*/
|
|
725
|
+
}))), slug ? normalizedDecorator : decorator ? /*#__PURE__*/React.createElement("div", {
|
|
733
726
|
className: `${prefix}--list-box__inner-wrapper--decorator`
|
|
734
|
-
}, normalizedDecorator) : '', /*#__PURE__*/
|
|
727
|
+
}, normalizedDecorator) : '', /*#__PURE__*/React.createElement(index$2.default.Menu, menuProps, isOpen ? filterItems(items, itemToString, inputValue).map((item, index) => {
|
|
735
728
|
const isObject = item !== null && typeof item === 'object';
|
|
736
729
|
const title = isObject && 'text' in item && itemToElement ? item.text?.toString() : itemToString(item);
|
|
737
730
|
const itemProps = getItemProps({
|
|
@@ -749,18 +742,18 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
749
742
|
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
750
743
|
...modifiedItemProps
|
|
751
744
|
} = itemProps;
|
|
752
|
-
return /*#__PURE__*/
|
|
745
|
+
return /*#__PURE__*/React.createElement(index$2.default.MenuItem, _rollupPluginBabelHelpers.extends({
|
|
753
746
|
key: itemProps.id,
|
|
754
747
|
isActive: selectedItem === item,
|
|
755
748
|
isHighlighted: highlightedIndex === index,
|
|
756
749
|
title: title,
|
|
757
750
|
disabled: disabled
|
|
758
|
-
}, modifiedItemProps), ItemToElement ? /*#__PURE__*/
|
|
751
|
+
}, modifiedItemProps), ItemToElement ? /*#__PURE__*/React.createElement(ItemToElement, _rollupPluginBabelHelpers.extends({
|
|
759
752
|
key: itemProps.id
|
|
760
|
-
}, item)) : itemToString(item), selectedItem === item && /*#__PURE__*/
|
|
753
|
+
}, item)) : itemToString(item), selectedItem === item && /*#__PURE__*/React.createElement(iconsReact.Checkmark, {
|
|
761
754
|
className: `${prefix}--list-box__menu-item__selected-icon`
|
|
762
755
|
}));
|
|
763
|
-
}) : null)), helperText && !invalid && !warn && !isFluid && /*#__PURE__*/
|
|
756
|
+
}) : null)), helperText && !invalid && !warn && !isFluid && /*#__PURE__*/React.createElement(Text.Text, {
|
|
764
757
|
as: "div",
|
|
765
758
|
id: helperTextId,
|
|
766
759
|
className: helperClasses
|
|
@@ -772,40 +765,40 @@ ComboBox.propTypes = {
|
|
|
772
765
|
* Specify whether or not the ComboBox should allow a value that is
|
|
773
766
|
* not in the list to be entered in the input
|
|
774
767
|
*/
|
|
775
|
-
allowCustomValue:
|
|
768
|
+
allowCustomValue: PropTypes.bool,
|
|
776
769
|
/**
|
|
777
770
|
* 'aria-label' of the ListBox component.
|
|
778
771
|
* Specify a label to be read by screen readers on the container node
|
|
779
772
|
*/
|
|
780
|
-
['aria-label']:
|
|
773
|
+
['aria-label']: PropTypes.string,
|
|
781
774
|
/**
|
|
782
775
|
* Deprecated, please use `aria-label` instead.
|
|
783
776
|
* Specify a label to be read by screen readers on the container note.
|
|
784
777
|
* 'aria-label' of the ListBox component.
|
|
785
778
|
*/
|
|
786
|
-
ariaLabel: deprecate.deprecate(
|
|
779
|
+
ariaLabel: deprecate.deprecate(PropTypes.string, 'This prop syntax has been deprecated. Please use the new `aria-label`.'),
|
|
787
780
|
/**
|
|
788
781
|
* **Experimental**: Will attempt to automatically align the floating
|
|
789
782
|
* element to avoid collisions with the viewport and being clipped by
|
|
790
783
|
* ancestor elements.
|
|
791
784
|
*/
|
|
792
|
-
autoAlign:
|
|
785
|
+
autoAlign: PropTypes.bool,
|
|
793
786
|
/**
|
|
794
787
|
* An optional className to add to the container node
|
|
795
788
|
*/
|
|
796
|
-
className:
|
|
789
|
+
className: PropTypes.string,
|
|
797
790
|
/**
|
|
798
791
|
* **Experimental**: Provide a decorator component to be rendered inside the `ComboBox` component
|
|
799
792
|
*/
|
|
800
|
-
decorator:
|
|
793
|
+
decorator: PropTypes.node,
|
|
801
794
|
/**
|
|
802
795
|
* Specify the direction of the combobox dropdown. Can be either top or bottom.
|
|
803
796
|
*/
|
|
804
|
-
direction:
|
|
797
|
+
direction: PropTypes.oneOf(['top', 'bottom']),
|
|
805
798
|
/**
|
|
806
799
|
* Specify if the control should be disabled, or not
|
|
807
800
|
*/
|
|
808
|
-
disabled:
|
|
801
|
+
disabled: PropTypes.bool,
|
|
809
802
|
/**
|
|
810
803
|
* Additional props passed to Downshift.
|
|
811
804
|
*
|
|
@@ -814,7 +807,7 @@ ComboBox.propTypes = {
|
|
|
814
807
|
* change, and in some cases they can not be shimmed by Carbon to shield you
|
|
815
808
|
* from potentially breaking changes.
|
|
816
809
|
*/
|
|
817
|
-
downshiftProps:
|
|
810
|
+
downshiftProps: PropTypes.object,
|
|
818
811
|
/**
|
|
819
812
|
* Provide a ref that will be mutated to contain an object of downshift
|
|
820
813
|
* action functions. These can be called to change the internal state of the
|
|
@@ -826,125 +819,125 @@ ComboBox.propTypes = {
|
|
|
826
819
|
* cases they can not be shimmed by Carbon to shield you from potentially breaking
|
|
827
820
|
* changes.
|
|
828
821
|
*/
|
|
829
|
-
downshiftActions:
|
|
830
|
-
current:
|
|
822
|
+
downshiftActions: PropTypes.exact({
|
|
823
|
+
current: PropTypes.any
|
|
831
824
|
}),
|
|
832
825
|
/**
|
|
833
826
|
* Provide helper text that is used alongside the control label for
|
|
834
827
|
* additional help
|
|
835
828
|
*/
|
|
836
|
-
helperText:
|
|
829
|
+
helperText: PropTypes.node,
|
|
837
830
|
/**
|
|
838
831
|
* Specify a custom `id` for the input
|
|
839
832
|
*/
|
|
840
|
-
id:
|
|
833
|
+
id: PropTypes.string.isRequired,
|
|
841
834
|
/**
|
|
842
835
|
* Allow users to pass in an arbitrary item or a string (in case their items are an array of strings)
|
|
843
836
|
* from their collection that are pre-selected
|
|
844
837
|
*/
|
|
845
|
-
initialSelectedItem:
|
|
838
|
+
initialSelectedItem: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.number]),
|
|
846
839
|
/**
|
|
847
840
|
* Specify if the currently selected value is invalid.
|
|
848
841
|
*/
|
|
849
|
-
invalid:
|
|
842
|
+
invalid: PropTypes.bool,
|
|
850
843
|
/**
|
|
851
844
|
* Message which is displayed if the value is invalid.
|
|
852
845
|
*/
|
|
853
|
-
invalidText:
|
|
846
|
+
invalidText: PropTypes.node,
|
|
854
847
|
/**
|
|
855
848
|
* Optional function to render items as custom components instead of strings.
|
|
856
849
|
* Defaults to null and is overridden by a getter
|
|
857
850
|
*/
|
|
858
|
-
itemToElement:
|
|
851
|
+
itemToElement: PropTypes.func,
|
|
859
852
|
/**
|
|
860
853
|
* Helper function passed to downshift that allows the library to render a
|
|
861
854
|
* given item to a string label. By default, it extracts the `label` field
|
|
862
855
|
* from a given item to serve as the item label in the list
|
|
863
856
|
*/
|
|
864
|
-
itemToString:
|
|
857
|
+
itemToString: PropTypes.func,
|
|
865
858
|
/**
|
|
866
859
|
* We try to stay as generic as possible here to allow individuals to pass
|
|
867
860
|
* in a collection of whatever kind of data structure they prefer
|
|
868
861
|
*/
|
|
869
|
-
items:
|
|
862
|
+
items: PropTypes.array.isRequired,
|
|
870
863
|
/**
|
|
871
864
|
* should use "light theme" (white background)?
|
|
872
865
|
*/
|
|
873
|
-
light: deprecate.deprecate(
|
|
866
|
+
light: deprecate.deprecate(PropTypes.bool, 'The `light` prop for `Combobox` has ' + 'been deprecated in favor of the new `Layer` component. It will be removed in the next major release.'),
|
|
874
867
|
/**
|
|
875
868
|
* `onChange` is a utility for this controlled component to communicate to a
|
|
876
869
|
* consuming component when a specific dropdown item is selected.
|
|
877
870
|
* `({ selectedItem }) => void`
|
|
878
871
|
* @param {{ selectedItem }}
|
|
879
872
|
*/
|
|
880
|
-
onChange:
|
|
873
|
+
onChange: PropTypes.func.isRequired,
|
|
881
874
|
/**
|
|
882
875
|
* Callback function to notify consumer when the text input changes.
|
|
883
876
|
* This provides support to change available items based on the text.
|
|
884
877
|
* `(inputText) => void`
|
|
885
878
|
* @param {string} inputText
|
|
886
879
|
*/
|
|
887
|
-
onInputChange:
|
|
880
|
+
onInputChange: PropTypes.func,
|
|
888
881
|
/**
|
|
889
882
|
* Callback function that fires when the combobox menu toggle is clicked
|
|
890
883
|
* `(evt) => void`
|
|
891
884
|
* @param {MouseEvent} event
|
|
892
885
|
*/
|
|
893
|
-
onToggleClick:
|
|
886
|
+
onToggleClick: PropTypes.func,
|
|
894
887
|
/**
|
|
895
888
|
* Used to provide a placeholder text node before a user enters any input.
|
|
896
889
|
* This is only present if the control has no items selected
|
|
897
890
|
*/
|
|
898
|
-
placeholder:
|
|
891
|
+
placeholder: PropTypes.string,
|
|
899
892
|
/**
|
|
900
893
|
* Is the ComboBox readonly?
|
|
901
894
|
*/
|
|
902
|
-
readOnly:
|
|
895
|
+
readOnly: PropTypes.bool,
|
|
903
896
|
/**
|
|
904
897
|
* For full control of the selection
|
|
905
898
|
*/
|
|
906
|
-
selectedItem:
|
|
899
|
+
selectedItem: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.number]),
|
|
907
900
|
/**
|
|
908
901
|
* Specify your own filtering logic by passing in a `shouldFilterItem`
|
|
909
902
|
* function that takes in the current input and an item and passes back
|
|
910
903
|
* whether or not the item should be filtered.
|
|
911
904
|
* this prop will be ignored if `typeahead` prop is enabled
|
|
912
905
|
*/
|
|
913
|
-
shouldFilterItem:
|
|
906
|
+
shouldFilterItem: PropTypes.func,
|
|
914
907
|
/**
|
|
915
908
|
* Specify the size of the ListBox. Currently supports either `sm`, `md` or `lg` as an option.
|
|
916
909
|
*/
|
|
917
910
|
size: ListBoxPropTypes.ListBoxSizePropType,
|
|
918
|
-
slug: deprecate.deprecate(
|
|
911
|
+
slug: deprecate.deprecate(PropTypes.node, 'The `slug` prop has been deprecated and will be removed in the next major version. Use the decorator prop instead.'),
|
|
919
912
|
/**
|
|
920
913
|
* Provide text to be used in a `<label>` element that is tied to the
|
|
921
914
|
* combobox via ARIA attributes.
|
|
922
915
|
*/
|
|
923
|
-
titleText:
|
|
916
|
+
titleText: PropTypes.node,
|
|
924
917
|
/**
|
|
925
918
|
* Specify a custom translation function that takes in a message identifier
|
|
926
919
|
* and returns the localized string for the message
|
|
927
920
|
*/
|
|
928
|
-
translateWithId:
|
|
921
|
+
translateWithId: PropTypes.func,
|
|
929
922
|
/**
|
|
930
923
|
* **Experimental**: will enable autocomplete and typeahead for the input field
|
|
931
924
|
*/
|
|
932
|
-
typeahead:
|
|
925
|
+
typeahead: PropTypes.bool,
|
|
933
926
|
/**
|
|
934
927
|
* Specify whether the control is currently in warning state
|
|
935
928
|
*/
|
|
936
|
-
warn:
|
|
929
|
+
warn: PropTypes.bool,
|
|
937
930
|
/**
|
|
938
931
|
* Provide the text that is displayed when the control is in warning state
|
|
939
932
|
*/
|
|
940
|
-
warnText:
|
|
933
|
+
warnText: PropTypes.node,
|
|
941
934
|
/**
|
|
942
935
|
* Specify native input attributes to place on the `<input>`, like maxLength.
|
|
943
936
|
* These are passed to downshift's getInputProps() and will override the
|
|
944
937
|
* internal input props.
|
|
945
938
|
* https://github.com/downshift-js/downshift?tab=readme-ov-file#getinputprops
|
|
946
939
|
*/
|
|
947
|
-
inputProps:
|
|
940
|
+
inputProps: PropTypes.object
|
|
948
941
|
};
|
|
949
942
|
|
|
950
|
-
exports
|
|
943
|
+
exports.default = ComboBox;
|