@carbon/react 1.86.0 → 1.87.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 +871 -871
- package/es/_virtual/_rollupPluginBabelHelpers.js +4 -4
- package/es/components/Button/Button.Skeleton.js +2 -1
- package/es/components/Button/Button.d.ts +1 -1
- package/es/components/Button/Button.js +3 -3
- package/es/components/Button/ButtonBase.js +2 -0
- 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/CodeSnippet/CodeSnippet.js +1 -0
- package/es/components/ComboBox/ComboBox.d.ts +7 -0
- package/es/components/ComboBox/ComboBox.js +11 -2
- package/es/components/ComboBox/index.js +4 -1
- package/es/components/ComposedModal/ComposedModal.js +18 -8
- package/es/components/ContainedList/ContainedList.d.ts +1 -1
- package/es/components/ContainedList/ContainedList.js +3 -3
- 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.Skeleton.js +4 -4
- 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/FluidNumberInput/FluidNumberInput.d.ts +3 -2
- package/es/components/FluidNumberInput/FluidNumberInput.js +3 -2
- package/es/components/FluidSelect/index.js +4 -1
- package/es/components/FluidTextInput/index.js +4 -1
- package/es/components/IconButton/index.d.ts +1 -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.d.ts +7 -0
- package/es/components/MultiSelect/FilterableMultiSelect.js +20 -10
- 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.d.ts +3 -2
- package/es/components/NumberInput/NumberInput.js +5 -4
- 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 +26 -8
- 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.d.ts +1 -1
- package/es/components/Toggletip/index.js +3 -3
- 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/useEvent.d.ts +2 -2
- package/es/internal/useEvent.js +4 -3
- 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 +9 -14
- package/lib/components/Button/Button.d.ts +1 -1
- package/lib/components/Button/Button.js +32 -37
- package/lib/components/Button/ButtonBase.js +8 -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 +40 -46
- package/lib/components/ComboBox/ComboBox.d.ts +7 -0
- package/lib/components/ComboBox/ComboBox.js +65 -63
- 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.d.ts +1 -1
- package/lib/components/ContainedList/ContainedList.js +19 -25
- 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 +10 -16
- 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.d.ts +3 -2
- package/lib/components/FluidNumberInput/FluidNumberInput.js +33 -38
- 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.d.ts +1 -1
- 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.d.ts +7 -0
- package/lib/components/MultiSelect/FilterableMultiSelect.js +71 -71
- 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.d.ts +3 -2
- package/lib/components/NumberInput/NumberInput.js +70 -77
- 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 +60 -50
- 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.d.ts +1 -1
- package/lib/components/Toggletip/index.js +33 -41
- 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.d.ts +2 -2
- package/lib/internal/useEvent.js +4 -5
- 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 +12 -12
- package/telemetry.yml +1 -0
- /package/es/node_modules/es-toolkit/dist/function/{debounce.mjs.js → debounce.js} +0 -0
|
@@ -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,
|
|
@@ -161,6 +154,7 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
161
154
|
warnText,
|
|
162
155
|
allowCustomValue = false,
|
|
163
156
|
slug,
|
|
157
|
+
inputProps,
|
|
164
158
|
...rest
|
|
165
159
|
} = props;
|
|
166
160
|
const enableFloatingStyles = index.useFeatureFlag('enable-v12-dynamic-floating-styles') || autoAlign;
|
|
@@ -420,28 +414,28 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
420
414
|
}
|
|
421
415
|
};
|
|
422
416
|
const showWarning = !invalid && warn;
|
|
423
|
-
const className =
|
|
417
|
+
const className = cx(`${prefix}--combo-box`, {
|
|
424
418
|
[`${prefix}--combo-box--invalid--focused`]: invalid && isFocused,
|
|
425
419
|
[`${prefix}--list-box--up`]: direction === 'top',
|
|
426
420
|
[`${prefix}--combo-box--warning`]: showWarning,
|
|
427
421
|
[`${prefix}--combo-box--readonly`]: readOnly,
|
|
428
422
|
[`${prefix}--autoalign`]: enableFloatingStyles
|
|
429
423
|
});
|
|
430
|
-
const titleClasses =
|
|
424
|
+
const titleClasses = cx(`${prefix}--label`, {
|
|
431
425
|
[`${prefix}--label--disabled`]: disabled
|
|
432
426
|
});
|
|
433
427
|
const helperTextId = `combobox-helper-text-${comboBoxInstanceId}`;
|
|
434
428
|
const warnTextId = `combobox-warn-text-${comboBoxInstanceId}`;
|
|
435
429
|
const invalidTextId = `combobox-invalid-text-${comboBoxInstanceId}`;
|
|
436
|
-
const helperClasses =
|
|
430
|
+
const helperClasses = cx(`${prefix}--form__helper-text`, {
|
|
437
431
|
[`${prefix}--form__helper-text--disabled`]: disabled
|
|
438
432
|
});
|
|
439
|
-
const wrapperClasses =
|
|
433
|
+
const wrapperClasses = cx(`${prefix}--list-box__wrapper`, [containerClassName, {
|
|
440
434
|
[`${prefix}--list-box__wrapper--fluid--invalid`]: isFluid && invalid,
|
|
441
435
|
[`${prefix}--list-box__wrapper--slug`]: slug,
|
|
442
436
|
[`${prefix}--list-box__wrapper--decorator`]: decorator
|
|
443
437
|
}]);
|
|
444
|
-
const inputClasses =
|
|
438
|
+
const inputClasses = cx(`${prefix}--text-input`, {
|
|
445
439
|
[`${prefix}--text-input--empty`]: !inputValue,
|
|
446
440
|
[`${prefix}--combo-box--input--focus`]: isFocused
|
|
447
441
|
});
|
|
@@ -519,7 +513,7 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
519
513
|
if (isManualClearingRef.current) {
|
|
520
514
|
return;
|
|
521
515
|
}
|
|
522
|
-
if ((type === ItemClick || type === FunctionSelectItem || type === InputKeyDownEnter) && typeof newSelectedItem !== 'undefined' && !
|
|
516
|
+
if ((type === ItemClick || type === FunctionSelectItem || type === InputKeyDownEnter) && typeof newSelectedItem !== 'undefined' && !isEqual(selectedItemProp, newSelectedItem)) {
|
|
523
517
|
onChange({
|
|
524
518
|
selectedItem: newSelectedItem
|
|
525
519
|
});
|
|
@@ -600,12 +594,12 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
600
594
|
}
|
|
601
595
|
}
|
|
602
596
|
}, [inputValue, typeaheadText]);
|
|
603
|
-
return /*#__PURE__*/
|
|
597
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
604
598
|
className: wrapperClasses
|
|
605
|
-
}, titleText && /*#__PURE__*/
|
|
599
|
+
}, titleText && /*#__PURE__*/React.createElement(Text.Text, _rollupPluginBabelHelpers.extends({
|
|
606
600
|
as: "label",
|
|
607
601
|
className: titleClasses
|
|
608
|
-
}, getLabelProps()), titleText), /*#__PURE__*/
|
|
602
|
+
}, getLabelProps()), titleText), /*#__PURE__*/React.createElement(index$2.default, {
|
|
609
603
|
onFocus: handleFocus,
|
|
610
604
|
onBlur: handleFocus,
|
|
611
605
|
className: className,
|
|
@@ -620,9 +614,9 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
620
614
|
ref: enableFloatingStyles ? refs.setReference : null,
|
|
621
615
|
warnText: warnText,
|
|
622
616
|
warnTextId: warnTextId
|
|
623
|
-
}, /*#__PURE__*/
|
|
617
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
624
618
|
className: `${prefix}--list-box__field`
|
|
625
|
-
}, /*#__PURE__*/
|
|
619
|
+
}, /*#__PURE__*/React.createElement("input", _rollupPluginBabelHelpers.extends({
|
|
626
620
|
disabled: disabled,
|
|
627
621
|
className: inputClasses,
|
|
628
622
|
type: "text",
|
|
@@ -634,12 +628,13 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
634
628
|
'aria-controls': isOpen ? undefined : menuProps.id,
|
|
635
629
|
placeholder,
|
|
636
630
|
value: inputValue,
|
|
631
|
+
...inputProps,
|
|
637
632
|
onChange: e => {
|
|
638
633
|
const newValue = e.target.value;
|
|
639
634
|
setInputValue(newValue);
|
|
640
635
|
downshiftSetInputValue(newValue);
|
|
641
636
|
},
|
|
642
|
-
ref: mergeRefs
|
|
637
|
+
ref: mergeRefs.default(textInput, ref, inputRef),
|
|
643
638
|
onKeyDown: event => {
|
|
644
639
|
if (match.match(event, keys.Space)) {
|
|
645
640
|
event.stopPropagation();
|
|
@@ -706,11 +701,11 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
706
701
|
}), rest, readOnlyEventHandlers, {
|
|
707
702
|
readOnly: readOnly,
|
|
708
703
|
"aria-describedby": ariaDescribedBy
|
|
709
|
-
})), invalid && /*#__PURE__*/
|
|
704
|
+
})), invalid && /*#__PURE__*/React.createElement(iconsReact.WarningFilled, {
|
|
710
705
|
className: `${prefix}--list-box__invalid-icon`
|
|
711
|
-
}), showWarning && /*#__PURE__*/
|
|
706
|
+
}), showWarning && /*#__PURE__*/React.createElement(iconsReact.WarningAltFilled, {
|
|
712
707
|
className: `${prefix}--list-box__invalid-icon ${prefix}--list-box__invalid-icon--warning`
|
|
713
|
-
}), inputValue && /*#__PURE__*/
|
|
708
|
+
}), inputValue && /*#__PURE__*/React.createElement(ListBoxSelection.default, {
|
|
714
709
|
clearSelection: () => {
|
|
715
710
|
setIsClearing(true); // This updates the state which syncs to the ref
|
|
716
711
|
setInputValue('');
|
|
@@ -724,12 +719,12 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
724
719
|
disabled: disabled || readOnly,
|
|
725
720
|
onClearSelection: handleSelectionClear,
|
|
726
721
|
selectionCount: 0
|
|
727
|
-
}), /*#__PURE__*/
|
|
722
|
+
}), /*#__PURE__*/React.createElement(ListBoxTrigger.default, _rollupPluginBabelHelpers.extends({}, buttonProps, {
|
|
728
723
|
isOpen: isOpen,
|
|
729
724
|
translateWithId: translateWithId
|
|
730
|
-
}))), slug ? normalizedDecorator : decorator ? /*#__PURE__*/
|
|
725
|
+
}))), slug ? normalizedDecorator : decorator ? /*#__PURE__*/React.createElement("div", {
|
|
731
726
|
className: `${prefix}--list-box__inner-wrapper--decorator`
|
|
732
|
-
}, normalizedDecorator) : '', /*#__PURE__*/
|
|
727
|
+
}, normalizedDecorator) : '', /*#__PURE__*/React.createElement(index$2.default.Menu, menuProps, isOpen ? filterItems(items, itemToString, inputValue).map((item, index) => {
|
|
733
728
|
const isObject = item !== null && typeof item === 'object';
|
|
734
729
|
const title = isObject && 'text' in item && itemToElement ? item.text?.toString() : itemToString(item);
|
|
735
730
|
const itemProps = getItemProps({
|
|
@@ -747,18 +742,18 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
747
742
|
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
748
743
|
...modifiedItemProps
|
|
749
744
|
} = itemProps;
|
|
750
|
-
return /*#__PURE__*/
|
|
745
|
+
return /*#__PURE__*/React.createElement(index$2.default.MenuItem, _rollupPluginBabelHelpers.extends({
|
|
751
746
|
key: itemProps.id,
|
|
752
747
|
isActive: selectedItem === item,
|
|
753
748
|
isHighlighted: highlightedIndex === index,
|
|
754
749
|
title: title,
|
|
755
750
|
disabled: disabled
|
|
756
|
-
}, modifiedItemProps), ItemToElement ? /*#__PURE__*/
|
|
751
|
+
}, modifiedItemProps), ItemToElement ? /*#__PURE__*/React.createElement(ItemToElement, _rollupPluginBabelHelpers.extends({
|
|
757
752
|
key: itemProps.id
|
|
758
|
-
}, item)) : itemToString(item), selectedItem === item && /*#__PURE__*/
|
|
753
|
+
}, item)) : itemToString(item), selectedItem === item && /*#__PURE__*/React.createElement(iconsReact.Checkmark, {
|
|
759
754
|
className: `${prefix}--list-box__menu-item__selected-icon`
|
|
760
755
|
}));
|
|
761
|
-
}) : null)), helperText && !invalid && !warn && !isFluid && /*#__PURE__*/
|
|
756
|
+
}) : null)), helperText && !invalid && !warn && !isFluid && /*#__PURE__*/React.createElement(Text.Text, {
|
|
762
757
|
as: "div",
|
|
763
758
|
id: helperTextId,
|
|
764
759
|
className: helperClasses
|
|
@@ -770,40 +765,40 @@ ComboBox.propTypes = {
|
|
|
770
765
|
* Specify whether or not the ComboBox should allow a value that is
|
|
771
766
|
* not in the list to be entered in the input
|
|
772
767
|
*/
|
|
773
|
-
allowCustomValue:
|
|
768
|
+
allowCustomValue: PropTypes.bool,
|
|
774
769
|
/**
|
|
775
770
|
* 'aria-label' of the ListBox component.
|
|
776
771
|
* Specify a label to be read by screen readers on the container node
|
|
777
772
|
*/
|
|
778
|
-
['aria-label']:
|
|
773
|
+
['aria-label']: PropTypes.string,
|
|
779
774
|
/**
|
|
780
775
|
* Deprecated, please use `aria-label` instead.
|
|
781
776
|
* Specify a label to be read by screen readers on the container note.
|
|
782
777
|
* 'aria-label' of the ListBox component.
|
|
783
778
|
*/
|
|
784
|
-
ariaLabel: deprecate.deprecate(
|
|
779
|
+
ariaLabel: deprecate.deprecate(PropTypes.string, 'This prop syntax has been deprecated. Please use the new `aria-label`.'),
|
|
785
780
|
/**
|
|
786
781
|
* **Experimental**: Will attempt to automatically align the floating
|
|
787
782
|
* element to avoid collisions with the viewport and being clipped by
|
|
788
783
|
* ancestor elements.
|
|
789
784
|
*/
|
|
790
|
-
autoAlign:
|
|
785
|
+
autoAlign: PropTypes.bool,
|
|
791
786
|
/**
|
|
792
787
|
* An optional className to add to the container node
|
|
793
788
|
*/
|
|
794
|
-
className:
|
|
789
|
+
className: PropTypes.string,
|
|
795
790
|
/**
|
|
796
791
|
* **Experimental**: Provide a decorator component to be rendered inside the `ComboBox` component
|
|
797
792
|
*/
|
|
798
|
-
decorator:
|
|
793
|
+
decorator: PropTypes.node,
|
|
799
794
|
/**
|
|
800
795
|
* Specify the direction of the combobox dropdown. Can be either top or bottom.
|
|
801
796
|
*/
|
|
802
|
-
direction:
|
|
797
|
+
direction: PropTypes.oneOf(['top', 'bottom']),
|
|
803
798
|
/**
|
|
804
799
|
* Specify if the control should be disabled, or not
|
|
805
800
|
*/
|
|
806
|
-
disabled:
|
|
801
|
+
disabled: PropTypes.bool,
|
|
807
802
|
/**
|
|
808
803
|
* Additional props passed to Downshift.
|
|
809
804
|
*
|
|
@@ -812,7 +807,7 @@ ComboBox.propTypes = {
|
|
|
812
807
|
* change, and in some cases they can not be shimmed by Carbon to shield you
|
|
813
808
|
* from potentially breaking changes.
|
|
814
809
|
*/
|
|
815
|
-
downshiftProps:
|
|
810
|
+
downshiftProps: PropTypes.object,
|
|
816
811
|
/**
|
|
817
812
|
* Provide a ref that will be mutated to contain an object of downshift
|
|
818
813
|
* action functions. These can be called to change the internal state of the
|
|
@@ -824,118 +819,125 @@ ComboBox.propTypes = {
|
|
|
824
819
|
* cases they can not be shimmed by Carbon to shield you from potentially breaking
|
|
825
820
|
* changes.
|
|
826
821
|
*/
|
|
827
|
-
downshiftActions:
|
|
828
|
-
current:
|
|
822
|
+
downshiftActions: PropTypes.exact({
|
|
823
|
+
current: PropTypes.any
|
|
829
824
|
}),
|
|
830
825
|
/**
|
|
831
826
|
* Provide helper text that is used alongside the control label for
|
|
832
827
|
* additional help
|
|
833
828
|
*/
|
|
834
|
-
helperText:
|
|
829
|
+
helperText: PropTypes.node,
|
|
835
830
|
/**
|
|
836
831
|
* Specify a custom `id` for the input
|
|
837
832
|
*/
|
|
838
|
-
id:
|
|
833
|
+
id: PropTypes.string.isRequired,
|
|
839
834
|
/**
|
|
840
835
|
* Allow users to pass in an arbitrary item or a string (in case their items are an array of strings)
|
|
841
836
|
* from their collection that are pre-selected
|
|
842
837
|
*/
|
|
843
|
-
initialSelectedItem:
|
|
838
|
+
initialSelectedItem: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.number]),
|
|
844
839
|
/**
|
|
845
840
|
* Specify if the currently selected value is invalid.
|
|
846
841
|
*/
|
|
847
|
-
invalid:
|
|
842
|
+
invalid: PropTypes.bool,
|
|
848
843
|
/**
|
|
849
844
|
* Message which is displayed if the value is invalid.
|
|
850
845
|
*/
|
|
851
|
-
invalidText:
|
|
846
|
+
invalidText: PropTypes.node,
|
|
852
847
|
/**
|
|
853
848
|
* Optional function to render items as custom components instead of strings.
|
|
854
849
|
* Defaults to null and is overridden by a getter
|
|
855
850
|
*/
|
|
856
|
-
itemToElement:
|
|
851
|
+
itemToElement: PropTypes.func,
|
|
857
852
|
/**
|
|
858
853
|
* Helper function passed to downshift that allows the library to render a
|
|
859
854
|
* given item to a string label. By default, it extracts the `label` field
|
|
860
855
|
* from a given item to serve as the item label in the list
|
|
861
856
|
*/
|
|
862
|
-
itemToString:
|
|
857
|
+
itemToString: PropTypes.func,
|
|
863
858
|
/**
|
|
864
859
|
* We try to stay as generic as possible here to allow individuals to pass
|
|
865
860
|
* in a collection of whatever kind of data structure they prefer
|
|
866
861
|
*/
|
|
867
|
-
items:
|
|
862
|
+
items: PropTypes.array.isRequired,
|
|
868
863
|
/**
|
|
869
864
|
* should use "light theme" (white background)?
|
|
870
865
|
*/
|
|
871
|
-
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.'),
|
|
872
867
|
/**
|
|
873
868
|
* `onChange` is a utility for this controlled component to communicate to a
|
|
874
869
|
* consuming component when a specific dropdown item is selected.
|
|
875
870
|
* `({ selectedItem }) => void`
|
|
876
871
|
* @param {{ selectedItem }}
|
|
877
872
|
*/
|
|
878
|
-
onChange:
|
|
873
|
+
onChange: PropTypes.func.isRequired,
|
|
879
874
|
/**
|
|
880
875
|
* Callback function to notify consumer when the text input changes.
|
|
881
876
|
* This provides support to change available items based on the text.
|
|
882
877
|
* `(inputText) => void`
|
|
883
878
|
* @param {string} inputText
|
|
884
879
|
*/
|
|
885
|
-
onInputChange:
|
|
880
|
+
onInputChange: PropTypes.func,
|
|
886
881
|
/**
|
|
887
882
|
* Callback function that fires when the combobox menu toggle is clicked
|
|
888
883
|
* `(evt) => void`
|
|
889
884
|
* @param {MouseEvent} event
|
|
890
885
|
*/
|
|
891
|
-
onToggleClick:
|
|
886
|
+
onToggleClick: PropTypes.func,
|
|
892
887
|
/**
|
|
893
888
|
* Used to provide a placeholder text node before a user enters any input.
|
|
894
889
|
* This is only present if the control has no items selected
|
|
895
890
|
*/
|
|
896
|
-
placeholder:
|
|
891
|
+
placeholder: PropTypes.string,
|
|
897
892
|
/**
|
|
898
893
|
* Is the ComboBox readonly?
|
|
899
894
|
*/
|
|
900
|
-
readOnly:
|
|
895
|
+
readOnly: PropTypes.bool,
|
|
901
896
|
/**
|
|
902
897
|
* For full control of the selection
|
|
903
898
|
*/
|
|
904
|
-
selectedItem:
|
|
899
|
+
selectedItem: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.number]),
|
|
905
900
|
/**
|
|
906
901
|
* Specify your own filtering logic by passing in a `shouldFilterItem`
|
|
907
902
|
* function that takes in the current input and an item and passes back
|
|
908
903
|
* whether or not the item should be filtered.
|
|
909
904
|
* this prop will be ignored if `typeahead` prop is enabled
|
|
910
905
|
*/
|
|
911
|
-
shouldFilterItem:
|
|
906
|
+
shouldFilterItem: PropTypes.func,
|
|
912
907
|
/**
|
|
913
908
|
* Specify the size of the ListBox. Currently supports either `sm`, `md` or `lg` as an option.
|
|
914
909
|
*/
|
|
915
910
|
size: ListBoxPropTypes.ListBoxSizePropType,
|
|
916
|
-
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.'),
|
|
917
912
|
/**
|
|
918
913
|
* Provide text to be used in a `<label>` element that is tied to the
|
|
919
914
|
* combobox via ARIA attributes.
|
|
920
915
|
*/
|
|
921
|
-
titleText:
|
|
916
|
+
titleText: PropTypes.node,
|
|
922
917
|
/**
|
|
923
918
|
* Specify a custom translation function that takes in a message identifier
|
|
924
919
|
* and returns the localized string for the message
|
|
925
920
|
*/
|
|
926
|
-
translateWithId:
|
|
921
|
+
translateWithId: PropTypes.func,
|
|
927
922
|
/**
|
|
928
923
|
* **Experimental**: will enable autocomplete and typeahead for the input field
|
|
929
924
|
*/
|
|
930
|
-
typeahead:
|
|
925
|
+
typeahead: PropTypes.bool,
|
|
931
926
|
/**
|
|
932
927
|
* Specify whether the control is currently in warning state
|
|
933
928
|
*/
|
|
934
|
-
warn:
|
|
929
|
+
warn: PropTypes.bool,
|
|
935
930
|
/**
|
|
936
931
|
* Provide the text that is displayed when the control is in warning state
|
|
937
932
|
*/
|
|
938
|
-
warnText:
|
|
933
|
+
warnText: PropTypes.node,
|
|
934
|
+
/**
|
|
935
|
+
* Specify native input attributes to place on the `<input>`, like maxLength.
|
|
936
|
+
* These are passed to downshift's getInputProps() and will override the
|
|
937
|
+
* internal input props.
|
|
938
|
+
* https://github.com/downshift-js/downshift?tab=readme-ov-file#getinputprops
|
|
939
|
+
*/
|
|
940
|
+
inputProps: PropTypes.object
|
|
939
941
|
};
|
|
940
942
|
|
|
941
|
-
exports
|
|
943
|
+
exports.default = ComboBox;
|
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
-
|
|
12
10
|
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
13
11
|
var React = require('react');
|
|
14
12
|
var PropTypes = require('prop-types');
|
|
@@ -28,12 +26,6 @@ var mergeRefs = require('../../tools/mergeRefs.js');
|
|
|
28
26
|
var deprecateValuesWithin = require('../../prop-types/deprecateValuesWithin.js');
|
|
29
27
|
var mapPopoverAlign = require('../../tools/mapPopoverAlign.js');
|
|
30
28
|
|
|
31
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
32
|
-
|
|
33
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
34
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
35
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
36
|
-
|
|
37
29
|
var _ChevronDown;
|
|
38
30
|
const defaultTranslations = {
|
|
39
31
|
'carbon.combo-button.additional-actions': 'Additional actions'
|
|
@@ -46,7 +38,7 @@ const defaultTranslations = {
|
|
|
46
38
|
function defaultTranslateWithId(messageId) {
|
|
47
39
|
return defaultTranslations[messageId];
|
|
48
40
|
}
|
|
49
|
-
const ComboButton = /*#__PURE__*/
|
|
41
|
+
const ComboButton = /*#__PURE__*/React.forwardRef(function ComboButton({
|
|
50
42
|
children,
|
|
51
43
|
className,
|
|
52
44
|
disabled,
|
|
@@ -98,7 +90,7 @@ const ComboButton = /*#__PURE__*/React__default["default"].forwardRef(function C
|
|
|
98
90
|
middleware: middlewares,
|
|
99
91
|
whileElementsMounted: react.autoUpdate
|
|
100
92
|
});
|
|
101
|
-
const ref = mergeRefs
|
|
93
|
+
const ref = mergeRefs.default(forwardRef, containerRef, refs.setReference);
|
|
102
94
|
const {
|
|
103
95
|
open,
|
|
104
96
|
handleClick: hookOnClick,
|
|
@@ -126,24 +118,24 @@ const ComboButton = /*#__PURE__*/React__default["default"].forwardRef(function C
|
|
|
126
118
|
onClick(e);
|
|
127
119
|
}
|
|
128
120
|
}
|
|
129
|
-
const containerClasses =
|
|
121
|
+
const containerClasses = cx(`${prefix}--combo-button__container`, `${prefix}--combo-button__container--${size}`, {
|
|
130
122
|
[`${prefix}--combo-button__container--open`]: open
|
|
131
123
|
}, className);
|
|
132
|
-
const menuClasses =
|
|
133
|
-
const primaryActionClasses =
|
|
134
|
-
const triggerClasses =
|
|
135
|
-
return /*#__PURE__*/
|
|
124
|
+
const menuClasses = cx(`${prefix}--combo-button__${menuAlignment}`);
|
|
125
|
+
const primaryActionClasses = cx(`${prefix}--combo-button__primary-action`);
|
|
126
|
+
const triggerClasses = cx(`${prefix}--combo-button__trigger`);
|
|
127
|
+
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({}, rest, {
|
|
136
128
|
className: containerClasses,
|
|
137
129
|
ref: ref,
|
|
138
130
|
"aria-owns": open ? id : undefined
|
|
139
|
-
}), /*#__PURE__*/
|
|
131
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
140
132
|
className: primaryActionClasses
|
|
141
|
-
}, /*#__PURE__*/
|
|
133
|
+
}, /*#__PURE__*/React.createElement(Button.default, {
|
|
142
134
|
title: label,
|
|
143
135
|
size: size,
|
|
144
136
|
disabled: disabled,
|
|
145
137
|
onClick: handlePrimaryActionClick
|
|
146
|
-
}, label)), /*#__PURE__*/
|
|
138
|
+
}, label)), /*#__PURE__*/React.createElement(index$1.IconButton, {
|
|
147
139
|
ref: refs.setReference,
|
|
148
140
|
className: triggerClasses,
|
|
149
141
|
label: t('carbon.combo-button.additional-actions'),
|
|
@@ -155,7 +147,7 @@ const ComboButton = /*#__PURE__*/React__default["default"].forwardRef(function C
|
|
|
155
147
|
onClick: handleTriggerClick,
|
|
156
148
|
onMouseDown: handleTriggerMousedown,
|
|
157
149
|
"aria-controls": open ? id : undefined
|
|
158
|
-
}, _ChevronDown || (_ChevronDown = /*#__PURE__*/
|
|
150
|
+
}, _ChevronDown || (_ChevronDown = /*#__PURE__*/React.createElement(iconsReact.ChevronDown, null))), /*#__PURE__*/React.createElement(Menu.Menu, {
|
|
159
151
|
containerRef: containerRef,
|
|
160
152
|
menuAlignment: menuAlignment,
|
|
161
153
|
className: menuClasses,
|
|
@@ -171,35 +163,35 @@ ComboButton.propTypes = {
|
|
|
171
163
|
/**
|
|
172
164
|
* A collection of MenuItems to be rendered as additional actions for this ComboButton.
|
|
173
165
|
*/
|
|
174
|
-
children:
|
|
166
|
+
children: PropTypes.node.isRequired,
|
|
175
167
|
/**
|
|
176
168
|
* Additional CSS class names.
|
|
177
169
|
*/
|
|
178
|
-
className:
|
|
170
|
+
className: PropTypes.string,
|
|
179
171
|
/**
|
|
180
172
|
* Specify whether the ComboButton should be disabled, or not.
|
|
181
173
|
*/
|
|
182
|
-
disabled:
|
|
174
|
+
disabled: PropTypes.bool,
|
|
183
175
|
/**
|
|
184
176
|
* Provide the label to be rendered on the primary action button.
|
|
185
177
|
*/
|
|
186
|
-
label:
|
|
178
|
+
label: PropTypes.string.isRequired,
|
|
187
179
|
/**
|
|
188
180
|
* Experimental property. Specify how the menu should align with the button element
|
|
189
181
|
*/
|
|
190
|
-
menuAlignment:
|
|
182
|
+
menuAlignment: PropTypes.oneOf(['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end']),
|
|
191
183
|
/**
|
|
192
184
|
* Provide an optional function to be called when the primary action element is clicked.
|
|
193
185
|
*/
|
|
194
|
-
onClick:
|
|
186
|
+
onClick: PropTypes.func,
|
|
195
187
|
/**
|
|
196
188
|
* Specify the size of the buttons and menu.
|
|
197
189
|
*/
|
|
198
|
-
size:
|
|
190
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
199
191
|
/**
|
|
200
192
|
* Specify how the trigger tooltip should be aligned.
|
|
201
193
|
*/
|
|
202
|
-
tooltipAlignment: deprecateValuesWithin
|
|
194
|
+
tooltipAlignment: deprecateValuesWithin.default(PropTypes.oneOf(['top', 'top-left',
|
|
203
195
|
// deprecated use top-start instead
|
|
204
196
|
'top-right',
|
|
205
197
|
// deprecated use top-end instead
|
|
@@ -225,7 +217,7 @@ ComboButton.propTypes = {
|
|
|
225
217
|
* Optional method that takes in a message id and returns an
|
|
226
218
|
* internationalized string.
|
|
227
219
|
*/
|
|
228
|
-
translateWithId:
|
|
220
|
+
translateWithId: PropTypes.func
|
|
229
221
|
};
|
|
230
222
|
|
|
231
223
|
exports.ComboButton = ComboButton;
|