@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
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
function _defineProperty(e, r, t) {
|
|
9
9
|
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
10
10
|
value: t,
|
|
11
|
-
enumerable:
|
|
12
|
-
configurable:
|
|
13
|
-
writable:
|
|
11
|
+
enumerable: true,
|
|
12
|
+
configurable: true,
|
|
13
|
+
writable: true
|
|
14
14
|
}) : e[r] = t, e;
|
|
15
15
|
}
|
|
16
16
|
function _extends() {
|
|
@@ -26,7 +26,7 @@ function _toPrimitive(t, r) {
|
|
|
26
26
|
if ("object" != typeof t || !t) return t;
|
|
27
27
|
var e = t[Symbol.toPrimitive];
|
|
28
28
|
if (void 0 !== e) {
|
|
29
|
-
var i = e.call(t, r
|
|
29
|
+
var i = e.call(t, r);
|
|
30
30
|
if ("object" != typeof i) return i;
|
|
31
31
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
32
32
|
}
|
|
@@ -22,6 +22,7 @@ const ButtonSkeleton = ({
|
|
|
22
22
|
const buttonClasses = cx(className, {
|
|
23
23
|
[`${prefix}--skeleton`]: true,
|
|
24
24
|
[`${prefix}--btn`]: true,
|
|
25
|
+
[`${prefix}--btn--xs`]: size === 'xs',
|
|
25
26
|
[`${prefix}--btn--sm`]: small || size === 'sm',
|
|
26
27
|
[`${prefix}--btn--md`]: size === 'md',
|
|
27
28
|
[`${prefix}--btn--lg`]: size === 'lg',
|
|
@@ -54,7 +55,7 @@ ButtonSkeleton.propTypes = {
|
|
|
54
55
|
* For `default` buttons, this prop can remain unspecified or use `default`.
|
|
55
56
|
* In the next major release of Carbon, `default`, `field`, and `small` will be removed
|
|
56
57
|
*/
|
|
57
|
-
size: PropTypes.oneOf(['sm', 'md', 'lg', 'xl', '2xl']),
|
|
58
|
+
size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', '2xl']),
|
|
58
59
|
/**
|
|
59
60
|
* @deprecated This property will be removed in the next major Carbon version,
|
|
60
61
|
* use size={sm} instead.
|
|
@@ -9,7 +9,7 @@ import { IconButtonKind } from '../IconButton';
|
|
|
9
9
|
import { PolymorphicComponentPropWithRef } from '../../internal/PolymorphicProps';
|
|
10
10
|
export declare const ButtonKinds: readonly ["primary", "secondary", "danger", "ghost", "danger--primary", "danger--ghost", "danger--tertiary", "tertiary"];
|
|
11
11
|
export type ButtonKind = (typeof ButtonKinds)[number];
|
|
12
|
-
export declare const ButtonSizes: readonly ["sm", "md", "lg", "xl", "2xl"];
|
|
12
|
+
export declare const ButtonSizes: readonly ["xs", "sm", "md", "lg", "xl", "2xl"];
|
|
13
13
|
export type ButtonSize = (typeof ButtonSizes)[number];
|
|
14
14
|
export declare const ButtonTooltipAlignments: readonly ["start", "center", "end"];
|
|
15
15
|
export type ButtonTooltipAlignment = (typeof ButtonTooltipAlignments)[number];
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import React from 'react';
|
|
11
|
-
import {
|
|
11
|
+
import { IconButtonKinds, IconButton } from '../IconButton/index.js';
|
|
12
12
|
import ButtonBase from './ButtonBase.js';
|
|
13
13
|
|
|
14
14
|
const ButtonKinds = ['primary', 'secondary', 'danger', 'ghost', 'danger--primary', 'danger--ghost', 'danger--tertiary', 'tertiary'];
|
|
15
|
-
const ButtonSizes = ['sm', 'md', 'lg', 'xl', '2xl'];
|
|
15
|
+
const ButtonSizes = ['xs', 'sm', 'md', 'lg', 'xl', '2xl'];
|
|
16
16
|
const ButtonTooltipAlignments = ['start', 'center', 'end'];
|
|
17
17
|
const ButtonTooltipPositions = ['top', 'right', 'bottom', 'left'];
|
|
18
18
|
function isIconOnlyButton(hasIconOnly, _kind) {
|
|
@@ -210,7 +210,7 @@ Button.propTypes = {
|
|
|
210
210
|
/**
|
|
211
211
|
* Specify the size of the button, from the following list of sizes:
|
|
212
212
|
*/
|
|
213
|
-
size: PropTypes.oneOf(['sm', 'md', 'lg', 'xl', '2xl']),
|
|
213
|
+
size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', '2xl']),
|
|
214
214
|
/**
|
|
215
215
|
* Optional prop to specify the tabIndex of the Button
|
|
216
216
|
*/
|
|
@@ -36,6 +36,8 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase({
|
|
|
36
36
|
const prefix = usePrefix();
|
|
37
37
|
const buttonClasses = cx(className, {
|
|
38
38
|
[`${prefix}--btn`]: true,
|
|
39
|
+
[`${prefix}--btn--xs`]: size === 'xs' && !isExpressive,
|
|
40
|
+
// TODO: V12 - Remove this class
|
|
39
41
|
[`${prefix}--btn--sm`]: size === 'sm' && !isExpressive,
|
|
40
42
|
// TODO: V12 - Remove this class
|
|
41
43
|
[`${prefix}--btn--md`]: size === 'md' && !isExpressive,
|
|
@@ -6,5 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import Button from './Button.js';
|
|
9
|
-
export {
|
|
9
|
+
export { ButtonKinds, ButtonSizes, ButtonTooltipAlignments, ButtonTooltipPositions } from './Button.js';
|
|
10
10
|
export { default as ButtonSkeleton } from './Button.Skeleton.js';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
export { Button, Button as default };
|
|
@@ -157,6 +157,7 @@ function CodeSnippet({
|
|
|
157
157
|
"aria-label": deprecatedAriaLabel || ariaLabel,
|
|
158
158
|
"aria-describedby": uid,
|
|
159
159
|
className: codeSnippetClasses,
|
|
160
|
+
disabled: disabled,
|
|
160
161
|
feedback: feedback,
|
|
161
162
|
feedbackTimeout: feedbackTimeout
|
|
162
163
|
}), /*#__PURE__*/React.createElement("code", {
|
|
@@ -195,6 +195,13 @@ export interface ComboBoxProps<ItemType> extends Omit<InputHTMLAttributes<HTMLIn
|
|
|
195
195
|
* Provide the text that is displayed when the control is in warning state
|
|
196
196
|
*/
|
|
197
197
|
warnText?: ReactNode;
|
|
198
|
+
/**
|
|
199
|
+
* Specify native input attributes to place on the `<input>`, like maxLength.
|
|
200
|
+
* These are passed to downshift's getInputProps() and will override the
|
|
201
|
+
* internal input props.
|
|
202
|
+
* https://github.com/downshift-js/downshift?tab=readme-ov-file#getinputprops
|
|
203
|
+
*/
|
|
204
|
+
inputProps?: InputHTMLAttributes<HTMLInputElement>;
|
|
198
205
|
}
|
|
199
206
|
type ComboboxComponentProps<ItemType> = PropsWithRef<PropsWithChildren<ComboBoxProps<ItemType>> & RefAttributes<HTMLInputElement>>;
|
|
200
207
|
export interface ComboBoxComponent {
|
|
@@ -24,7 +24,7 @@ import { deprecate } from '../../prop-types/deprecate.js';
|
|
|
24
24
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
25
25
|
import '../FluidForm/FluidForm.js';
|
|
26
26
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
27
|
-
import { useFloating, flip, hide
|
|
27
|
+
import { useFloating, autoUpdate, flip, hide } from '@floating-ui/react';
|
|
28
28
|
import { useFeatureFlag } from '../FeatureFlags/index.js';
|
|
29
29
|
import { AILabel } from '../AILabel/index.js';
|
|
30
30
|
import { isComponentElement } from '../../internal/utils.js';
|
|
@@ -150,6 +150,7 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
150
150
|
warnText,
|
|
151
151
|
allowCustomValue = false,
|
|
152
152
|
slug,
|
|
153
|
+
inputProps,
|
|
153
154
|
...rest
|
|
154
155
|
} = props;
|
|
155
156
|
const enableFloatingStyles = useFeatureFlag('enable-v12-dynamic-floating-styles') || autoAlign;
|
|
@@ -623,6 +624,7 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
623
624
|
'aria-controls': isOpen ? undefined : menuProps.id,
|
|
624
625
|
placeholder,
|
|
625
626
|
value: inputValue,
|
|
627
|
+
...inputProps,
|
|
626
628
|
onChange: e => {
|
|
627
629
|
const newValue = e.target.value;
|
|
628
630
|
setInputValue(newValue);
|
|
@@ -924,7 +926,14 @@ ComboBox.propTypes = {
|
|
|
924
926
|
/**
|
|
925
927
|
* Provide the text that is displayed when the control is in warning state
|
|
926
928
|
*/
|
|
927
|
-
warnText: PropTypes.node
|
|
929
|
+
warnText: PropTypes.node,
|
|
930
|
+
/**
|
|
931
|
+
* Specify native input attributes to place on the `<input>`, like maxLength.
|
|
932
|
+
* These are passed to downshift's getInputProps() and will override the
|
|
933
|
+
* internal input props.
|
|
934
|
+
* https://github.com/downshift-js/downshift?tab=readme-ov-file#getinputprops
|
|
935
|
+
*/
|
|
936
|
+
inputProps: PropTypes.object
|
|
928
937
|
};
|
|
929
938
|
|
|
930
939
|
export { ComboBox as default };
|
|
@@ -17,7 +17,7 @@ import mergeRefs from '../../tools/mergeRefs.js';
|
|
|
17
17
|
import cx from 'classnames';
|
|
18
18
|
import { toggleClass } from '../../tools/toggleClass.js';
|
|
19
19
|
import requiredIfGivenPropIsTruthy from '../../prop-types/requiredIfGivenPropIsTruthy.js';
|
|
20
|
-
import { wrapFocusWithoutSentinels,
|
|
20
|
+
import { wrapFocusWithoutSentinels, wrapFocus, elementOrParentIsFloatingMenu } from '../../internal/wrapFocus.js';
|
|
21
21
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
22
22
|
import { Escape, Tab } from '../../internal/keyboard/keys.js';
|
|
23
23
|
import { match } from '../../internal/keyboard/match.js';
|
|
@@ -28,7 +28,7 @@ import { unstable__Dialog } from '../Dialog/index.js';
|
|
|
28
28
|
import { warning } from '../../internal/warning.js';
|
|
29
29
|
import { AILabel } from '../AILabel/index.js';
|
|
30
30
|
import { isComponentElement } from '../../internal/utils.js';
|
|
31
|
-
import { debounce } from '../../node_modules/es-toolkit/dist/compat/function/debounce.
|
|
31
|
+
import { debounce } from '../../node_modules/es-toolkit/dist/compat/function/debounce.js';
|
|
32
32
|
|
|
33
33
|
const ModalBody = /*#__PURE__*/React.forwardRef(function ModalBody({
|
|
34
34
|
className: customClassName,
|
|
@@ -146,10 +146,6 @@ const ComposedModal = /*#__PURE__*/React.forwardRef(function ComposedModal({
|
|
|
146
146
|
|
|
147
147
|
function handleKeyDown(event) {
|
|
148
148
|
if (!enableDialogElement) {
|
|
149
|
-
event.stopPropagation();
|
|
150
|
-
if (match(event, Escape)) {
|
|
151
|
-
closeModal(event);
|
|
152
|
-
}
|
|
153
149
|
if (focusTrapWithoutSentinels && open && match(event, Tab) && innerModal.current) {
|
|
154
150
|
wrapFocusWithoutSentinels({
|
|
155
151
|
containerNode: innerModal.current,
|
|
@@ -235,7 +231,7 @@ const ComposedModal = /*#__PURE__*/React.forwardRef(function ComposedModal({
|
|
|
235
231
|
let generatedAriaLabel;
|
|
236
232
|
const childrenWithProps = React.Children.toArray(children).map(child => {
|
|
237
233
|
switch (true) {
|
|
238
|
-
case isElement(child) && child.type === React.createElement(ModalHeader).type:
|
|
234
|
+
case isElement(child) && child.type === /*#__PURE__*/React.createElement(ModalHeader).type:
|
|
239
235
|
{
|
|
240
236
|
const el = child;
|
|
241
237
|
generatedAriaLabel = el.props.label;
|
|
@@ -243,7 +239,7 @@ const ComposedModal = /*#__PURE__*/React.forwardRef(function ComposedModal({
|
|
|
243
239
|
closeModal
|
|
244
240
|
});
|
|
245
241
|
}
|
|
246
|
-
case isElement(child) && child.type === React.createElement(ModalFooter).type:
|
|
242
|
+
case isElement(child) && child.type === /*#__PURE__*/React.createElement(ModalFooter).type:
|
|
247
243
|
{
|
|
248
244
|
const el = child;
|
|
249
245
|
return /*#__PURE__*/React.cloneElement(el, {
|
|
@@ -256,6 +252,20 @@ const ComposedModal = /*#__PURE__*/React.forwardRef(function ComposedModal({
|
|
|
256
252
|
return child;
|
|
257
253
|
}
|
|
258
254
|
});
|
|
255
|
+
useEffect(() => {
|
|
256
|
+
if (!open) return;
|
|
257
|
+
const handleEscapeKey = event => {
|
|
258
|
+
if (match(event, Escape)) {
|
|
259
|
+
event.preventDefault();
|
|
260
|
+
event.stopPropagation();
|
|
261
|
+
closeModal(event);
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
document.addEventListener('keydown', handleEscapeKey, true);
|
|
265
|
+
return () => {
|
|
266
|
+
document.removeEventListener('keydown', handleEscapeKey, true);
|
|
267
|
+
};
|
|
268
|
+
}, [open]);
|
|
259
269
|
useEffect(() => {
|
|
260
270
|
if (!enableDialogElement && !open && launcherButtonRef) {
|
|
261
271
|
setTimeout(() => {
|
|
@@ -76,7 +76,7 @@ const ContainedList = ({
|
|
|
76
76
|
const renderedChildren = renderChildren(children);
|
|
77
77
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
78
78
|
className: classes
|
|
79
|
-
}, rest), /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
}, rest), label && /*#__PURE__*/React.createElement("div", {
|
|
80
80
|
className: `${prefix}--contained-list__header`
|
|
81
81
|
}, /*#__PURE__*/React.createElement("div", {
|
|
82
82
|
id: labelId,
|
|
@@ -99,7 +99,7 @@ const ContainedList = ({
|
|
|
99
99
|
// eslint-disable-next-line jsx-a11y/no-redundant-roles
|
|
100
100
|
React.createElement("ul", {
|
|
101
101
|
role: "list",
|
|
102
|
-
"aria-labelledby": labelId
|
|
102
|
+
"aria-labelledby": label ? labelId : undefined
|
|
103
103
|
}, isActionSearch ? filteredChildren : renderedChildren));
|
|
104
104
|
};
|
|
105
105
|
ContainedList.propTypes = {
|
|
@@ -126,7 +126,7 @@ ContainedList.propTypes = {
|
|
|
126
126
|
/**
|
|
127
127
|
* A label describing the contained list.
|
|
128
128
|
*/
|
|
129
|
-
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node])
|
|
129
|
+
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
130
130
|
/**
|
|
131
131
|
* Specify the size of the contained list.
|
|
132
132
|
*/
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
import { deprecateFieldOnObject } from '../../internal/deprecateFieldOnObject.js';
|
|
9
9
|
import ContainedList from './ContainedList.js';
|
|
10
|
-
export { default as ContainedList, default } from './ContainedList.js';
|
|
11
10
|
import ContainedListItem from './ContainedListItem/ContainedListItem.js';
|
|
12
|
-
export { default as ContainedListItem } from './ContainedListItem/ContainedListItem.js';
|
|
13
11
|
|
|
14
12
|
ContainedList.ContainedListItem = ContainedListItem;
|
|
15
13
|
if (process.env.NODE_ENV !== 'production') {
|
|
16
14
|
deprecateFieldOnObject(ContainedList, 'ContainedListItem', ContainedListItem);
|
|
17
15
|
}
|
|
16
|
+
|
|
17
|
+
export { ContainedList, ContainedListItem, ContainedList as default };
|
|
@@ -15,7 +15,7 @@ import { IconButton } from '../IconButton/index.js';
|
|
|
15
15
|
import { noopFn } from '../../internal/noopFn.js';
|
|
16
16
|
import deprecateValuesWithin from '../../prop-types/deprecateValuesWithin.js';
|
|
17
17
|
import { mapPopoverAlign } from '../../tools/mapPopoverAlign.js';
|
|
18
|
-
import { debounce } from '../../node_modules/es-toolkit/dist/compat/function/debounce.
|
|
18
|
+
import { debounce } from '../../node_modules/es-toolkit/dist/compat/function/debounce.js';
|
|
19
19
|
|
|
20
20
|
function Copy({
|
|
21
21
|
align = 'bottom',
|
|
@@ -13,7 +13,7 @@ import { usePrefix } from '../../internal/usePrefix.js';
|
|
|
13
13
|
import { TableContext } from './TableContext.js';
|
|
14
14
|
import { useWindowEvent } from '../../internal/useEvent.js';
|
|
15
15
|
import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
|
|
16
|
-
import { debounce } from '../../node_modules/es-toolkit/dist/compat/function/debounce.
|
|
16
|
+
import { debounce } from '../../node_modules/es-toolkit/dist/compat/function/debounce.js';
|
|
17
17
|
|
|
18
18
|
const isElementWrappingContent = (element, context) => {
|
|
19
19
|
if (element.children.length > 0) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default getDerivedStateFromProps;
|
|
2
|
+
/**
|
|
3
|
+
* Helper to derive the next state from the given props and the
|
|
4
|
+
* prevState. Potential future-facing API hook for React v17.
|
|
5
|
+
*
|
|
6
|
+
* Currently, it's being used as a way to normalize the incoming data that we
|
|
7
|
+
* are receiving for rows
|
|
8
|
+
*/
|
|
9
|
+
declare function getDerivedStateFromProps(props: any, prevState: any): {
|
|
10
|
+
rowIds: any;
|
|
11
|
+
rowsById: any;
|
|
12
|
+
cellsById: any;
|
|
13
|
+
sortDirection: any;
|
|
14
|
+
sortHeaderKey: any;
|
|
15
|
+
initialRowOrder: any;
|
|
16
|
+
filterInputValue: any;
|
|
17
|
+
shouldShowBatchActions: any;
|
|
18
|
+
isExpandedAll: boolean;
|
|
19
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { sortStates };
|
|
2
|
+
export const initialSortState: import("./sortStates").DataTableSortState;
|
|
3
|
+
export function getNextSortDirection(prevHeader: string, header: string, prevState: string): string;
|
|
4
|
+
export function getNextSortState(props: any, state: any, { key }: {
|
|
5
|
+
key: any;
|
|
6
|
+
}): any;
|
|
7
|
+
export function getSortedState(props: {
|
|
8
|
+
locale: string;
|
|
9
|
+
sortRows: Function;
|
|
10
|
+
}, state: {
|
|
11
|
+
rowIds: Array<string>;
|
|
12
|
+
cellsById: object;
|
|
13
|
+
initialRowOrder: Array<string>;
|
|
14
|
+
}, key: string, sortDirection: string): object;
|
|
15
|
+
import { sortStates } from './sortStates';
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { sortStates } from './sortStates.js';
|
|
9
|
-
export { sortStates } from './sortStates.js';
|
|
10
9
|
import { sortRows } from '../tools/sorting.js';
|
|
11
10
|
|
|
12
11
|
// Our initialSortState should be `NONE`, unless a consumer has specified a
|
|
@@ -94,4 +93,4 @@ const getSortedState = (props, state, key, sortDirection) => {
|
|
|
94
93
|
};
|
|
95
94
|
};
|
|
96
95
|
|
|
97
|
-
export { getNextSortDirection, getNextSortState, getSortedState, initialSortState };
|
|
96
|
+
export { getNextSortDirection, getNextSortState, getSortedState, initialSortState, sortStates };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export default denormalize;
|
|
2
|
+
/**
|
|
3
|
+
* Copyright IBM Corp. 2016, 2023
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Counterpart to `normalize` for a collection of rows. This method unravels the
|
|
10
|
+
* normalization step that we use to build the given parameters in order to
|
|
11
|
+
* return a natural interface to working with rows for a consumer.
|
|
12
|
+
*
|
|
13
|
+
* The default heuristic here is to map through all the row ids and return the
|
|
14
|
+
* value of the row for the given id, in addition to adding a `cells` key that
|
|
15
|
+
* contains the results of mapping over the rows cells and getting individual
|
|
16
|
+
* cell info.
|
|
17
|
+
*
|
|
18
|
+
* @param {Array<string>} rowIds array of row ids in the table
|
|
19
|
+
* @param {object} rowsById object containing lookups for rows by id
|
|
20
|
+
* @param {object} cellsById object containing lookups for cells by id
|
|
21
|
+
*/
|
|
22
|
+
declare function denormalize(rowIds: Array<string>, rowsById: object, cellsById: object): any[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default normalize;
|
|
2
|
+
/**
|
|
3
|
+
* Normalize a collection of rows with the given headers.
|
|
4
|
+
*
|
|
5
|
+
* @param {Array<object>} rows
|
|
6
|
+
* @param {Array<object>} headers
|
|
7
|
+
* @returns {object}
|
|
8
|
+
*/
|
|
9
|
+
declare function normalize(rows: Array<object>, headers: Array<object>, prevState?: {}): object;
|
|
@@ -24,15 +24,20 @@ import '../FluidForm/FluidForm.js';
|
|
|
24
24
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
25
25
|
import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
|
|
26
26
|
|
|
27
|
-
// Weekdays shorthand for
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
// Weekdays shorthand for English locale
|
|
28
|
+
// Ensure localization exists before trying to access it
|
|
29
|
+
function initializeWeekdayShorthand() {
|
|
30
|
+
if (l10n?.en?.weekdays?.shorthand) {
|
|
31
|
+
l10n.en.weekdays.shorthand.forEach((_day, index) => {
|
|
32
|
+
const currentDay = l10n.en.weekdays.shorthand;
|
|
33
|
+
if (currentDay[index] === 'Thu' || currentDay[index] === 'Th') {
|
|
34
|
+
currentDay[index] = 'Th';
|
|
35
|
+
} else {
|
|
36
|
+
currentDay[index] = currentDay[index].charAt(0);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
34
39
|
}
|
|
35
|
-
}
|
|
40
|
+
}
|
|
36
41
|
const forEach = Array.prototype.forEach;
|
|
37
42
|
|
|
38
43
|
/**
|
|
@@ -222,14 +227,14 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
222
227
|
[String(className)]: className
|
|
223
228
|
});
|
|
224
229
|
const childrenWithProps = React.Children.toArray(children).map((child, index) => {
|
|
225
|
-
if (index === 0 && child.type === React.createElement(DatePickerInput, child.props).type) {
|
|
230
|
+
if (index === 0 && child.type === /*#__PURE__*/React.createElement(DatePickerInput, child.props).type) {
|
|
226
231
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
227
232
|
datePickerType,
|
|
228
233
|
ref: startInputField,
|
|
229
234
|
readOnly
|
|
230
235
|
});
|
|
231
236
|
}
|
|
232
|
-
if (index === 1 && child.type === React.createElement(DatePickerInput, child.props).type) {
|
|
237
|
+
if (index === 1 && child.type === /*#__PURE__*/React.createElement(DatePickerInput, child.props).type) {
|
|
233
238
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
234
239
|
datePickerType,
|
|
235
240
|
ref: endInputField,
|
|
@@ -249,6 +254,9 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
249
254
|
});
|
|
250
255
|
}
|
|
251
256
|
});
|
|
257
|
+
useEffect(() => {
|
|
258
|
+
initializeWeekdayShorthand();
|
|
259
|
+
}, []);
|
|
252
260
|
useEffect(() => {
|
|
253
261
|
if (datePickerType !== 'single' && datePickerType !== 'range') {
|
|
254
262
|
return;
|
|
@@ -345,7 +353,6 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
345
353
|
}) : () => {}, carbonFlatpickrMonthSelectPlugin({
|
|
346
354
|
selectorFlatpickrMonthYearContainer: '.flatpickr-current-month',
|
|
347
355
|
selectorFlatpickrYearContainer: '.numInputWrapper',
|
|
348
|
-
selectorFlatpickrCurrentMonth: '.cur-month',
|
|
349
356
|
classFlatpickrCurrentMonth: 'cur-month'
|
|
350
357
|
}), carbonFlatpickrFixEventsPlugin({
|
|
351
358
|
inputFrom: startInputField.current,
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { WarningFilled, WarningAltFilled, Calendar } from '@carbon/icons-react';
|
|
9
|
+
import { warning } from '../../internal/warning.js';
|
|
9
10
|
import cx from 'classnames';
|
|
10
11
|
import PropTypes from 'prop-types';
|
|
11
12
|
import React, { useContext, cloneElement } from 'react';
|
|
@@ -19,6 +20,7 @@ import { AILabel } from '../AILabel/index.js';
|
|
|
19
20
|
import { isComponentElement } from '../../internal/utils.js';
|
|
20
21
|
import { Text } from '../Text/Text.js';
|
|
21
22
|
|
|
23
|
+
let didWarnAboutDatePickerInputValue = false;
|
|
22
24
|
const DatePickerInput = /*#__PURE__*/React.forwardRef(function DatePickerInput(props, ref) {
|
|
23
25
|
const {
|
|
24
26
|
datePickerType,
|
|
@@ -62,6 +64,10 @@ const DatePickerInput = /*#__PURE__*/React.forwardRef(function DatePickerInput(p
|
|
|
62
64
|
placeholder,
|
|
63
65
|
type
|
|
64
66
|
};
|
|
67
|
+
if (process.env.NODE_ENV !== 'production' && 'value' in rest && !didWarnAboutDatePickerInputValue) {
|
|
68
|
+
process.env.NODE_ENV !== "production" ? warning(false, `The 'value' prop is not supported on the DatePickerInput component. ` + `For DatePicker components with 'datePickerType="range"', please ` + `pass the 'value' prop (as an array of dates) to the parent ` + `DatePicker component instead.`) : void 0;
|
|
69
|
+
didWarnAboutDatePickerInputValue = true;
|
|
70
|
+
}
|
|
65
71
|
const wrapperClasses = cx(`${prefix}--date-picker-input__wrapper`, {
|
|
66
72
|
[`${prefix}--date-picker-input__wrapper--invalid`]: invalid,
|
|
67
73
|
[`${prefix}--date-picker-input__wrapper--warn`]: warn,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
|
-
import React, { useRef, useEffect, useContext, useState
|
|
10
|
+
import React, { useRef, useEffect, createContext, useContext, useState } from 'react';
|
|
11
11
|
import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
import cx from 'classnames';
|
|
@@ -21,7 +21,7 @@ import Button from '../Button/Button.js';
|
|
|
21
21
|
import '../Button/Button.Skeleton.js';
|
|
22
22
|
import { useId } from '../../internal/useId.js';
|
|
23
23
|
import InlineLoading from '../InlineLoading/InlineLoading.js';
|
|
24
|
-
import { debounce } from '../../node_modules/es-toolkit/dist/compat/function/debounce.
|
|
24
|
+
import { debounce } from '../../node_modules/es-toolkit/dist/compat/function/debounce.js';
|
|
25
25
|
import { Text } from '../Text/Text.js';
|
|
26
26
|
|
|
27
27
|
const DialogContext = /*#__PURE__*/createContext({});
|
|
@@ -20,15 +20,15 @@ const DropdownSkeleton = ({
|
|
|
20
20
|
...rest
|
|
21
21
|
}) => {
|
|
22
22
|
const prefix = usePrefix();
|
|
23
|
-
const wrapperClasses = cx(className, `${prefix}--skeleton`, `${prefix}--form-item
|
|
24
|
-
[`${prefix}--list-box--${size}`]: size
|
|
25
|
-
});
|
|
23
|
+
const wrapperClasses = cx(className, `${prefix}--skeleton`, `${prefix}--form-item`);
|
|
26
24
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
27
25
|
className: wrapperClasses
|
|
28
26
|
}, rest), !hideLabel && /*#__PURE__*/React.createElement("span", {
|
|
29
27
|
className: `${prefix}--label ${prefix}--skeleton`
|
|
30
28
|
}), /*#__PURE__*/React.createElement("div", {
|
|
31
|
-
className: `${prefix}--skeleton ${prefix}--dropdown
|
|
29
|
+
className: cx(`${prefix}--skeleton ${prefix}--dropdown`, {
|
|
30
|
+
[`${prefix}--list-box--${size}`]: size
|
|
31
|
+
})
|
|
32
32
|
}));
|
|
33
33
|
};
|
|
34
34
|
DropdownSkeleton.propTypes = {
|