@carbon/react 1.87.0-rc.0 → 1.87.1-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +739 -739
- package/es/_virtual/_rollupPluginBabelHelpers.js +4 -4
- package/es/components/Button/Button.js +1 -1
- package/es/components/Button/index.js +5 -1
- package/es/components/ButtonSet/index.js +4 -1
- package/es/components/Checkbox/index.js +4 -1
- package/es/components/ComboBox/ComboBox.js +1 -1
- package/es/components/ComboBox/index.js +4 -1
- package/es/components/ComposedModal/ComposedModal.js +18 -8
- package/es/components/ContainedList/ContainedListItem/index.js +4 -1
- package/es/components/ContainedList/index.js +2 -2
- package/es/components/Copy/Copy.js +1 -1
- package/es/components/Copy/index.js +4 -1
- package/es/components/CopyButton/index.js +4 -1
- package/es/components/DataTable/Table.js +1 -1
- package/es/components/DataTable/state/getDerivedStateFromProps.d.ts +19 -0
- package/es/components/DataTable/state/getDerivedStateFromProps.js +1 -2
- package/es/components/DataTable/state/sorting.d.ts +15 -0
- package/es/components/DataTable/state/sorting.js +1 -2
- package/es/components/DataTable/tools/denormalize.d.ts +22 -0
- package/es/components/DataTable/tools/denormalize.js +1 -2
- package/es/components/DataTable/tools/normalize.d.ts +9 -0
- package/es/components/DataTable/tools/normalize.js +1 -2
- package/es/components/DatePicker/DatePicker.js +18 -11
- package/es/components/DatePicker/index.js +4 -1
- package/es/components/DatePicker/plugins/fixEventsPlugin.d.ts +2 -0
- package/es/components/DatePicker/plugins/rangePlugin.d.ts +2 -0
- package/es/components/DatePickerInput/DatePickerInput.js +6 -0
- package/es/components/DatePickerInput/index.js +4 -1
- package/es/components/Dialog/index.js +2 -2
- package/es/components/Dropdown/Dropdown.js +2 -2
- package/es/components/Dropdown/index.js +4 -1
- package/es/components/FeatureFlags/index.js +2 -2
- package/es/components/FluidSelect/index.js +4 -1
- package/es/components/FluidTextInput/index.js +4 -1
- package/es/components/IconIndicator/index.js +1 -1
- package/es/components/InlineCheckbox/index.js +4 -1
- package/es/components/InlineLoading/index.js +4 -1
- package/es/components/LayoutDirection/LayoutDirection.js +1 -2
- package/es/components/Link/index.js +4 -1
- package/es/components/ListBox/ListBox.js +1 -1
- package/es/components/Loading/index.js +4 -1
- package/es/components/Menu/Menu.d.ts +3 -1
- package/es/components/Menu/Menu.js +3 -1
- package/es/components/Menu/MenuItem.js +1 -1
- package/es/components/Modal/Modal.js +16 -5
- package/es/components/Modal/index.js +4 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +3 -3
- package/es/components/MultiSelect/MultiSelect.js +2 -2
- package/es/components/MultiSelect/filter.js +0 -4
- package/es/components/MultiSelect/tools/itemToString.d.ts +1 -0
- package/es/components/MultiSelect/tools/sorting.d.ts +9 -0
- package/es/components/Notification/Notification.js +2 -2
- package/es/components/NumberInput/NumberInput.js +1 -1
- package/es/components/OverflowMenu/next/index.js +1 -1
- package/es/components/OverflowMenuItem/index.js +4 -1
- package/es/components/OverflowMenuV2/index.d.ts +1 -0
- package/es/components/PageHeader/PageHeader.js +1 -1
- package/es/components/Pagination/experimental/PageSelector.d.ts +19 -0
- package/es/components/Pagination/experimental/Pagination.d.ts +43 -0
- package/es/components/Pagination/experimental/index.d.ts +3 -0
- package/es/components/Popover/index.js +21 -4
- package/es/components/RadioButton/index.js +4 -1
- package/es/components/RadioTile/index.js +4 -1
- package/es/components/Search/Search.js +1 -1
- package/es/components/Search/index.js +4 -1
- package/es/components/Select/index.js +4 -1
- package/es/components/SelectItem/index.js +4 -1
- package/es/components/ShapeIndicator/index.js +1 -1
- package/es/components/SkeletonText/index.js +4 -1
- package/es/components/Slider/Slider.js +1 -1
- package/es/components/Switch/IconSwitch.d.ts +3 -0
- package/es/components/Switch/IconSwitch.js +1 -2
- package/es/components/TabContent/TabContent.js +2 -22
- package/es/components/Tabs/Tabs.js +5 -5
- package/es/components/Tag/DismissibleTag.js +1 -1
- package/es/components/TextArea/TextArea.js +1 -1
- package/es/components/TextArea/index.js +4 -1
- package/es/components/TextInput/index.js +4 -1
- package/es/components/TextInput/util.d.ts +9 -0
- package/es/components/Toggletip/index.js +2 -2
- package/es/components/UIShell/HeaderMenu.js +2 -2
- package/es/components/UIShell/SideNav.js +1 -1
- package/es/components/UIShell/_utils.d.ts +7 -0
- package/es/feature-flags.d.ts +1 -0
- package/es/internal/FloatingMenu.js +1 -1
- package/es/internal/deprecateFieldOnObject.js +1 -1
- package/es/internal/useId.d.ts +21 -0
- package/es/internal/useId.js +27 -1
- package/es/internal/useOverflowItems.js +0 -6
- package/es/node_modules/es-toolkit/dist/compat/function/{debounce.mjs.js → debounce.js} +1 -1
- package/es/node_modules/es-toolkit/dist/compat/function/{throttle.mjs.js → throttle.js} +1 -1
- package/es/prop-types/deprecateComponent.d.ts +1 -0
- package/es/prop-types/deprecateComponent.js +1 -4
- package/es/prop-types/deprecateValuesWithin.d.ts +1 -0
- package/es/prop-types/requiredIfGivenPropIsTruthy.d.ts +14 -0
- package/es/tools/mergeRefs.d.ts +12 -0
- package/es/tools/mergeRefs.js +1 -2
- package/icons/index.js +1 -3
- package/lib/_virtual/_rollupPluginBabelHelpers.js +5 -7
- package/lib/components/AILabel/index.js +35 -43
- package/lib/components/AISkeleton/AISkeletonIcon.js +5 -11
- package/lib/components/AISkeleton/AISkeletonPlaceholder.js +4 -10
- package/lib/components/AISkeleton/AISkeletonText.js +8 -14
- package/lib/components/Accordion/Accordion.Skeleton.js +21 -27
- package/lib/components/Accordion/Accordion.js +11 -17
- package/lib/components/Accordion/AccordionItem.js +19 -25
- package/lib/components/Accordion/AccordionProvider.js +1 -7
- package/lib/components/AspectRatio/AspectRatio.js +7 -13
- package/lib/components/BadgeIndicator/index.js +7 -13
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +7 -13
- package/lib/components/Breadcrumb/Breadcrumb.js +9 -15
- package/lib/components/Breadcrumb/BreadcrumbItem.js +16 -22
- package/lib/components/Button/Button.Skeleton.js +8 -14
- package/lib/components/Button/Button.js +31 -36
- package/lib/components/Button/ButtonBase.js +6 -11
- package/lib/components/Button/index.js +3 -3
- package/lib/components/ButtonSet/ButtonSet.js +6 -12
- package/lib/components/ButtonSet/index.js +2 -2
- package/lib/components/ChatButton/ChatButton.Skeleton.js +5 -11
- package/lib/components/ChatButton/ChatButton.js +12 -18
- package/lib/components/Checkbox/Checkbox.Skeleton.js +6 -12
- package/lib/components/Checkbox/Checkbox.js +33 -39
- package/lib/components/Checkbox/index.js +3 -3
- package/lib/components/CheckboxGroup/CheckboxGroup.js +24 -30
- package/lib/components/ClassPrefix/index.js +3 -10
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +10 -16
- package/lib/components/CodeSnippet/CodeSnippet.js +39 -46
- package/lib/components/ComboBox/ComboBox.js +57 -64
- package/lib/components/ComboBox/index.js +2 -2
- package/lib/components/ComboButton/index.js +20 -28
- package/lib/components/ComposedModal/ComposedModal.js +61 -57
- package/lib/components/ComposedModal/ModalFooter.js +37 -45
- package/lib/components/ComposedModal/ModalHeader.js +23 -31
- package/lib/components/ContainedList/ContainedList.js +18 -24
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +14 -20
- package/lib/components/ContainedList/ContainedListItem/index.js +2 -2
- package/lib/components/ContainedList/index.js +5 -5
- package/lib/components/ContentSwitcher/ContentSwitcher.js +11 -19
- package/lib/components/ContextMenu/useContextMenu.js +1 -1
- package/lib/components/Copy/Copy.js +12 -18
- package/lib/components/Copy/index.js +2 -2
- package/lib/components/CopyButton/CopyButton.js +12 -18
- package/lib/components/CopyButton/index.js +2 -2
- package/lib/components/DangerButton/DangerButton.js +2 -6
- package/lib/components/DataTable/DataTable.js +48 -55
- package/lib/components/DataTable/Table.js +18 -24
- package/lib/components/DataTable/TableActionList.js +2 -2
- package/lib/components/DataTable/TableBatchAction.js +4 -9
- package/lib/components/DataTable/TableBatchActions.js +19 -25
- package/lib/components/DataTable/TableBody.js +5 -10
- package/lib/components/DataTable/TableCell.js +8 -14
- package/lib/components/DataTable/TableContainer.js +14 -20
- package/lib/components/DataTable/TableContext.js +0 -2
- package/lib/components/DataTable/TableDecoratorRow.js +5 -11
- package/lib/components/DataTable/TableExpandHeader.js +16 -22
- package/lib/components/DataTable/TableExpandRow.js +20 -26
- package/lib/components/DataTable/TableExpandedRow.js +8 -14
- package/lib/components/DataTable/TableHead.js +2 -2
- package/lib/components/DataTable/TableHeader.js +26 -32
- package/lib/components/DataTable/TableRow.js +8 -14
- package/lib/components/DataTable/TableSelectAll.js +13 -19
- package/lib/components/DataTable/TableSelectRow.js +15 -21
- package/lib/components/DataTable/TableSlugRow.js +7 -13
- package/lib/components/DataTable/TableToolbar.js +7 -13
- package/lib/components/DataTable/TableToolbarAction.js +5 -10
- package/lib/components/DataTable/TableToolbarContent.js +2 -2
- package/lib/components/DataTable/TableToolbarMenu.js +9 -15
- package/lib/components/DataTable/TableToolbarSearch.js +22 -28
- package/lib/components/DataTable/state/getDerivedStateFromProps.d.ts +19 -0
- package/lib/components/DataTable/state/getDerivedStateFromProps.js +2 -3
- package/lib/components/DataTable/state/sortStates.js +0 -2
- package/lib/components/DataTable/state/sorting.d.ts +15 -0
- package/lib/components/DataTable/state/sorting.js +0 -2
- package/lib/components/DataTable/tools/cells.js +0 -2
- package/lib/components/DataTable/tools/denormalize.d.ts +22 -0
- package/lib/components/DataTable/tools/denormalize.js +1 -2
- package/lib/components/DataTable/tools/filter.js +0 -2
- package/lib/components/DataTable/tools/normalize.d.ts +9 -0
- package/lib/components/DataTable/tools/normalize.js +1 -2
- package/lib/components/DataTable/tools/sorting.js +0 -2
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +25 -31
- package/lib/components/DatePicker/DatePicker.Skeleton.js +14 -20
- package/lib/components/DatePicker/DatePicker.js +65 -66
- package/lib/components/DatePicker/index.js +3 -3
- package/lib/components/DatePicker/plugins/appendToPlugin.js +0 -2
- package/lib/components/DatePicker/plugins/fixEventsPlugin.d.ts +2 -0
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +1 -1
- package/lib/components/DatePicker/plugins/rangePlugin.d.ts +2 -0
- package/lib/components/DatePicker/plugins/rangePlugin.js +2 -6
- package/lib/components/DatePickerInput/DatePickerInput.js +49 -49
- package/lib/components/DatePickerInput/index.js +2 -2
- package/lib/components/Dialog/index.js +72 -80
- package/lib/components/Dropdown/Dropdown.Skeleton.js +8 -14
- package/lib/components/Dropdown/Dropdown.js +49 -55
- package/lib/components/Dropdown/index.js +3 -3
- package/lib/components/ErrorBoundary/ErrorBoundary.js +4 -9
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +0 -2
- package/lib/components/ExpandableSearch/ExpandableSearch.js +6 -11
- package/lib/components/FeatureFlags/index.js +10 -17
- package/lib/components/FileUploader/FileUploader.Skeleton.js +7 -13
- package/lib/components/FileUploader/FileUploader.js +30 -36
- package/lib/components/FileUploader/FileUploaderButton.js +19 -25
- package/lib/components/FileUploader/FileUploaderDropContainer.js +18 -24
- package/lib/components/FileUploader/FileUploaderItem.js +23 -29
- package/lib/components/FileUploader/Filename.js +13 -18
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +7 -13
- package/lib/components/FluidComboBox/FluidComboBox.js +24 -30
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +14 -20
- package/lib/components/FluidDatePicker/FluidDatePicker.js +12 -18
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +4 -8
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +7 -13
- package/lib/components/FluidDropdown/FluidDropdown.js +24 -30
- package/lib/components/FluidForm/FluidForm.js +6 -12
- package/lib/components/FluidForm/FormContext.js +0 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +7 -13
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +36 -42
- package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +7 -13
- package/lib/components/FluidNumberInput/FluidNumberInput.js +30 -36
- package/lib/components/FluidSearch/FluidSearch.Skeleton.js +7 -13
- package/lib/components/FluidSearch/FluidSearch.js +19 -25
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +7 -13
- package/lib/components/FluidSelect/FluidSelect.js +17 -23
- package/lib/components/FluidSelect/index.js +3 -3
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +7 -13
- package/lib/components/FluidTextArea/FluidTextArea.js +25 -31
- package/lib/components/FluidTextInput/FluidPasswordInput.js +18 -22
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +7 -13
- package/lib/components/FluidTextInput/FluidTextInput.js +23 -29
- package/lib/components/FluidTextInput/index.js +3 -3
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +6 -12
- package/lib/components/FluidTimePicker/FluidTimePicker.js +23 -29
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +10 -15
- package/lib/components/Form/Form.js +5 -11
- package/lib/components/FormGroup/FormGroup.js +13 -19
- package/lib/components/FormItem/FormItem.js +5 -11
- package/lib/components/FormLabel/FormLabel.js +6 -12
- package/lib/components/Grid/CSSGrid.js +20 -28
- package/lib/components/Grid/Column.js +31 -37
- package/lib/components/Grid/ColumnHang.js +5 -13
- package/lib/components/Grid/FlexGrid.js +10 -18
- package/lib/components/Grid/Grid.js +9 -16
- package/lib/components/Grid/GridContext.js +7 -14
- package/lib/components/Grid/Row.js +8 -14
- package/lib/components/Heading/index.js +14 -21
- package/lib/components/Icon/Icon.Skeleton.js +4 -10
- package/lib/components/IconButton/index.js +25 -33
- package/lib/components/IconIndicator/index.js +9 -15
- package/lib/components/IdPrefix/index.js +3 -10
- package/lib/components/InlineCheckbox/InlineCheckbox.js +17 -22
- package/lib/components/InlineCheckbox/index.js +2 -2
- package/lib/components/InlineLoading/InlineLoading.js +17 -23
- package/lib/components/InlineLoading/index.js +2 -2
- package/lib/components/Layer/LayerContext.js +1 -7
- package/lib/components/Layer/LayerLevel.js +0 -2
- package/lib/components/Layer/index.js +11 -19
- package/lib/components/Layout/index.js +22 -30
- package/lib/components/LayoutDirection/LayoutDirection.js +6 -13
- package/lib/components/LayoutDirection/LayoutDirectionContext.js +1 -7
- package/lib/components/LayoutDirection/useLayoutDirection.js +0 -2
- package/lib/components/Link/Link.js +15 -21
- package/lib/components/Link/index.js +2 -2
- package/lib/components/ListBox/ListBox.js +17 -23
- package/lib/components/ListBox/ListBoxField.js +7 -12
- package/lib/components/ListBox/ListBoxMenu.js +7 -12
- package/lib/components/ListBox/ListBoxMenuIcon.js +7 -13
- package/lib/components/ListBox/ListBoxMenuItem.js +9 -15
- package/lib/components/ListBox/ListBoxPropTypes.js +2 -8
- package/lib/components/ListBox/ListBoxSelection.js +14 -20
- package/lib/components/ListBox/index.js +7 -7
- package/lib/components/ListBox/next/ListBoxSelection.js +18 -24
- package/lib/components/ListBox/next/ListBoxTrigger.js +7 -13
- package/lib/components/ListItem/ListItem.js +5 -11
- package/lib/components/Loading/Loading.js +14 -20
- package/lib/components/Loading/index.js +2 -2
- package/lib/components/Menu/Menu.d.ts +3 -1
- package/lib/components/Menu/Menu.js +18 -24
- package/lib/components/Menu/MenuContext.js +0 -2
- package/lib/components/Menu/MenuItem.js +44 -52
- package/lib/components/MenuButton/index.js +16 -24
- package/lib/components/Modal/Modal.js +91 -86
- package/lib/components/Modal/index.js +2 -2
- package/lib/components/ModalWrapper/ModalWrapper.js +30 -35
- package/lib/components/MultiSelect/FilterableMultiSelect.js +57 -67
- package/lib/components/MultiSelect/MultiSelect.js +61 -70
- package/lib/components/MultiSelect/MultiSelectPropTypes.js +2 -8
- package/lib/components/MultiSelect/filter.js +0 -6
- package/lib/components/MultiSelect/tools/itemToString.d.ts +1 -0
- package/lib/components/MultiSelect/tools/itemToString.js +1 -7
- package/lib/components/MultiSelect/tools/sorting.d.ts +9 -0
- package/lib/components/MultiSelect/tools/sorting.js +0 -2
- package/lib/components/Notification/Notification.js +118 -126
- package/lib/components/NumberInput/NumberFormatPropTypes.js +21 -27
- package/lib/components/NumberInput/NumberInput.Skeleton.js +8 -14
- package/lib/components/NumberInput/NumberInput.js +66 -74
- package/lib/components/OrderedList/OrderedList.js +8 -14
- package/lib/components/OverflowMenu/OverflowMenu.js +42 -49
- package/lib/components/OverflowMenu/index.js +3 -7
- package/lib/components/OverflowMenu/next/index.js +18 -26
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +27 -33
- package/lib/components/OverflowMenuItem/index.js +2 -2
- package/lib/components/OverflowMenuV2/index.d.ts +1 -0
- package/lib/components/OverflowMenuV2/index.js +2 -8
- package/lib/components/PageHeader/PageHeader.js +70 -78
- package/lib/components/PageHeader/index.js +0 -2
- package/lib/components/Pagination/Pagination.Skeleton.js +10 -16
- package/lib/components/Pagination/Pagination.js +44 -51
- package/lib/components/Pagination/experimental/PageSelector.d.ts +19 -0
- package/lib/components/Pagination/experimental/PageSelector.js +9 -15
- package/lib/components/Pagination/experimental/Pagination.d.ts +43 -0
- package/lib/components/Pagination/experimental/Pagination.js +34 -40
- package/lib/components/Pagination/experimental/index.d.ts +3 -0
- package/lib/components/PaginationNav/PaginationNav.js +54 -60
- package/lib/components/Popover/index.js +56 -47
- package/lib/components/PrimaryButton/PrimaryButton.js +2 -6
- package/lib/components/ProgressBar/ProgressBar.js +25 -31
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +10 -16
- package/lib/components/ProgressIndicator/ProgressIndicator.js +41 -49
- package/lib/components/RadioButton/RadioButton.Skeleton.js +6 -12
- package/lib/components/RadioButton/RadioButton.js +26 -32
- package/lib/components/RadioButton/index.js +2 -2
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +37 -43
- package/lib/components/RadioTile/RadioTile.js +25 -31
- package/lib/components/RadioTile/index.js +2 -2
- package/lib/components/Search/Search.Skeleton.js +7 -13
- package/lib/components/Search/Search.js +33 -39
- package/lib/components/Search/index.js +3 -3
- package/lib/components/SecondaryButton/SecondaryButton.js +2 -6
- package/lib/components/Select/Select.Skeleton.js +8 -14
- package/lib/components/Select/Select.js +42 -48
- package/lib/components/Select/index.js +3 -3
- package/lib/components/SelectItem/SelectItem.js +8 -14
- package/lib/components/SelectItem/index.js +2 -2
- package/lib/components/SelectItemGroup/SelectItemGroup.js +7 -13
- package/lib/components/ShapeIndicator/index.js +12 -18
- package/lib/components/SkeletonIcon/SkeletonIcon.js +4 -10
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +4 -10
- package/lib/components/SkeletonText/SkeletonText.js +11 -17
- package/lib/components/SkeletonText/index.js +2 -2
- package/lib/components/Slider/Slider.Skeleton.js +29 -35
- package/lib/components/Slider/Slider.js +84 -90
- package/lib/components/Slider/SliderHandles.js +18 -24
- package/lib/components/Slider/index.js +3 -3
- package/lib/components/Stack/HStack.js +1 -7
- package/lib/components/Stack/Stack.js +7 -15
- package/lib/components/Stack/VStack.js +1 -7
- package/lib/components/StructuredList/StructuredList.Skeleton.js +15 -21
- package/lib/components/StructuredList/StructuredList.js +60 -68
- package/lib/components/Switch/IconSwitch.d.ts +3 -0
- package/lib/components/Switch/IconSwitch.js +18 -25
- package/lib/components/Switch/Switch.js +14 -20
- package/lib/components/TabContent/TabContent.js +7 -33
- package/lib/components/Tabs/Tabs.Skeleton.js +10 -16
- package/lib/components/Tabs/Tabs.js +121 -129
- package/lib/components/Tabs/usePressable.js +0 -2
- package/lib/components/Tag/DismissibleTag.js +24 -30
- package/lib/components/Tag/OperationalTag.js +16 -22
- package/lib/components/Tag/SelectableTag.js +19 -25
- package/lib/components/Tag/Tag.Skeleton.js +5 -11
- package/lib/components/Tag/Tag.js +28 -34
- package/lib/components/Tag/isEllipsisActive.js +0 -2
- package/lib/components/Text/Text.js +6 -13
- package/lib/components/Text/TextDirection.js +4 -11
- package/lib/components/Text/TextDirectionContext.js +0 -2
- package/lib/components/Text/createTextComponent.js +1 -7
- package/lib/components/Text/index.js +0 -2
- package/lib/components/TextArea/TextArea.Skeleton.js +7 -13
- package/lib/components/TextArea/TextArea.js +49 -55
- package/lib/components/TextArea/index.js +3 -3
- package/lib/components/TextInput/ControlledPasswordInput.js +36 -42
- package/lib/components/TextInput/PasswordInput.js +48 -54
- package/lib/components/TextInput/TextInput.Skeleton.js +7 -13
- package/lib/components/TextInput/TextInput.js +47 -53
- package/lib/components/TextInput/index.js +3 -3
- package/lib/components/TextInput/util.d.ts +9 -0
- package/lib/components/TextInput/util.js +0 -2
- package/lib/components/Theme/index.js +16 -24
- package/lib/components/Tile/Tile.js +92 -100
- package/lib/components/TileGroup/TileGroup.js +15 -22
- package/lib/components/TimePicker/TimePicker.js +39 -45
- package/lib/components/TimePickerSelect/TimePickerSelect.js +10 -16
- package/lib/components/Toggle/Toggle.Skeleton.js +7 -13
- package/lib/components/Toggle/Toggle.js +28 -34
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +12 -20
- package/lib/components/Toggletip/index.js +32 -40
- package/lib/components/Tooltip/DefinitionTooltip.js +14 -22
- package/lib/components/Tooltip/Tooltip.js +19 -27
- package/lib/components/TreeView/TreeContext.js +0 -2
- package/lib/components/TreeView/TreeNode.js +41 -47
- package/lib/components/TreeView/TreeView.js +17 -23
- package/lib/components/UIShell/Content.js +6 -12
- package/lib/components/UIShell/Header.js +4 -10
- package/lib/components/UIShell/HeaderContainer.js +4 -9
- package/lib/components/UIShell/HeaderGlobalAction.js +11 -17
- package/lib/components/UIShell/HeaderGlobalBar.js +2 -2
- package/lib/components/UIShell/HeaderMenu.js +17 -23
- package/lib/components/UIShell/HeaderMenuButton.js +9 -15
- package/lib/components/UIShell/HeaderMenuItem.js +11 -17
- package/lib/components/UIShell/HeaderName.js +8 -14
- package/lib/components/UIShell/HeaderNavigation.js +6 -12
- package/lib/components/UIShell/HeaderPanel.js +11 -17
- package/lib/components/UIShell/HeaderSideNavItems.js +6 -12
- package/lib/components/UIShell/Link.js +6 -11
- package/lib/components/UIShell/SideNav.js +23 -29
- package/lib/components/UIShell/SideNavDetails.js +7 -13
- package/lib/components/UIShell/SideNavDivider.js +5 -11
- package/lib/components/UIShell/SideNavFooter.js +12 -18
- package/lib/components/UIShell/SideNavHeader.js +8 -14
- package/lib/components/UIShell/SideNavIcon.js +6 -12
- package/lib/components/UIShell/SideNavItem.js +6 -12
- package/lib/components/UIShell/SideNavItems.js +9 -15
- package/lib/components/UIShell/SideNavLink.js +13 -19
- package/lib/components/UIShell/SideNavLinkText.js +5 -11
- package/lib/components/UIShell/SideNavMenu.js +20 -26
- package/lib/components/UIShell/SideNavMenuItem.js +13 -19
- package/lib/components/UIShell/SideNavSwitcher.js +13 -19
- package/lib/components/UIShell/SkipToContent.js +7 -13
- package/lib/components/UIShell/Switcher.js +9 -15
- package/lib/components/UIShell/SwitcherDivider.js +4 -10
- package/lib/components/UIShell/SwitcherItem.js +15 -21
- package/lib/components/UIShell/_utils.d.ts +7 -0
- package/lib/components/UIShell/_utils.js +0 -2
- package/lib/components/UnorderedList/UnorderedList.js +7 -13
- package/lib/feature-flags.d.ts +1 -0
- package/lib/feature-flags.js +3 -4
- package/lib/index.js +180 -182
- package/lib/internal/FloatingMenu.js +10 -18
- package/lib/internal/OptimizedResize.js +2 -8
- package/lib/internal/Selection.js +1 -7
- package/lib/internal/clamp.js +0 -2
- package/lib/internal/createClassWrapper.js +1 -7
- package/lib/internal/deprecateFieldOnObject.js +1 -3
- package/lib/internal/environment.js +0 -2
- package/lib/internal/getAnnouncement.js +0 -2
- package/lib/internal/keyboard/keys.js +0 -2
- package/lib/internal/keyboard/match.js +0 -2
- package/lib/internal/keyboard/navigation.js +0 -2
- package/lib/internal/noopFn.js +0 -2
- package/lib/internal/useAttachedMenu.js +0 -2
- package/lib/internal/useControllableState.js +0 -2
- package/lib/internal/useDelayedState.js +0 -2
- package/lib/internal/useEvent.js +0 -2
- package/lib/internal/useId.d.ts +21 -0
- package/lib/internal/useId.js +27 -7
- package/lib/internal/useIdPrefix.js +2 -8
- package/lib/internal/useIsomorphicEffect.js +1 -1
- package/lib/internal/useMatchMedia.js +0 -2
- package/lib/internal/useMergedRefs.js +0 -2
- package/lib/internal/useNoInteractiveChildren.js +0 -2
- package/lib/internal/useNormalizedInputProps.js +2 -8
- package/lib/internal/useOutsideClick.js +0 -2
- package/lib/internal/useOverflowItems.js +1 -7
- package/lib/internal/usePrefix.js +2 -8
- package/lib/internal/usePreviousValue.js +0 -2
- package/lib/internal/useResizeObserver.js +0 -2
- package/lib/internal/useSavedCallback.js +0 -2
- package/lib/internal/utils.js +0 -2
- package/lib/internal/warning.js +0 -2
- package/lib/internal/wrapFocus.js +0 -2
- package/lib/node_modules/es-toolkit/dist/compat/function/{debounce.mjs.js → debounce.js} +1 -3
- package/lib/node_modules/es-toolkit/dist/compat/function/{throttle.mjs.js → throttle.js} +1 -3
- package/lib/node_modules/es-toolkit/dist/function/{debounce.mjs.js → debounce.js} +0 -2
- package/lib/prop-types/AriaPropTypes.js +2 -8
- package/lib/prop-types/deprecate.js +0 -2
- package/lib/prop-types/deprecateComponent.d.ts +1 -0
- package/lib/prop-types/deprecateComponent.js +2 -5
- package/lib/prop-types/deprecateValuesWithin.d.ts +1 -0
- package/lib/prop-types/deprecateValuesWithin.js +1 -1
- package/lib/prop-types/isRequiredOneOf.js +0 -2
- package/lib/prop-types/requiredIfGivenPropIsTruthy.d.ts +14 -0
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +1 -1
- package/lib/tools/events.js +0 -2
- package/lib/tools/mapPopoverAlign.js +0 -2
- package/lib/tools/mergeRefs.d.ts +12 -0
- package/lib/tools/mergeRefs.js +1 -2
- package/lib/tools/setupGetInstanceId.js +0 -2
- package/lib/tools/toggleClass.js +0 -2
- package/lib/tools/wrapComponent.js +4 -10
- package/package.json +11 -11
- /package/es/node_modules/es-toolkit/dist/function/{debounce.mjs.js → debounce.js} +0 -0
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
-
|
|
12
10
|
var PropTypes = require('prop-types');
|
|
13
11
|
var React = require('react');
|
|
14
12
|
var isEqual = require('react-fast-compare');
|
|
@@ -42,11 +40,6 @@ var TableToolbarContent = require('./TableToolbarContent.js');
|
|
|
42
40
|
var TableToolbarSearch = require('./TableToolbarSearch.js');
|
|
43
41
|
var TableToolbarMenu = require('./TableToolbarMenu.js');
|
|
44
42
|
|
|
45
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
46
|
-
|
|
47
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
48
|
-
var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
|
|
49
|
-
|
|
50
43
|
const getInstanceId = setupGetInstanceId.setupGetInstanceId();
|
|
51
44
|
const translationKeys = {
|
|
52
45
|
expandRow: 'carbon.table.row.expand',
|
|
@@ -106,13 +99,13 @@ const DataTable = props => {
|
|
|
106
99
|
} = props;
|
|
107
100
|
const instanceId = React.useMemo(() => getInstanceId(), []);
|
|
108
101
|
const [state, setState] = React.useState(() => ({
|
|
109
|
-
...getDerivedStateFromProps
|
|
102
|
+
...getDerivedStateFromProps.default(props, {}),
|
|
110
103
|
isExpandedAll: false // Start with collapsed state, treat `undefined` as neutral state
|
|
111
104
|
}));
|
|
112
105
|
React.useEffect(() => {
|
|
113
106
|
const nextRowIds = rows.map(row => row.id);
|
|
114
107
|
const nextHeaders = headers.map(header => header.key);
|
|
115
|
-
const hasRowIdsChanged = !
|
|
108
|
+
const hasRowIdsChanged = !isEqual(nextRowIds, state.rowIds);
|
|
116
109
|
const currentHeaders = Object.keys(state.cellsById).reduce((acc, cellId) => {
|
|
117
110
|
const headerKey = cellId.split(':')[1];
|
|
118
111
|
if (headerKey && !acc.includes(headerKey)) {
|
|
@@ -120,7 +113,7 @@ const DataTable = props => {
|
|
|
120
113
|
}
|
|
121
114
|
return acc;
|
|
122
115
|
}, []);
|
|
123
|
-
const hasHeadersChanged = !
|
|
116
|
+
const hasHeadersChanged = !isEqual(nextHeaders, currentHeaders);
|
|
124
117
|
const currentRows = state.rowIds.map(id => {
|
|
125
118
|
const row = state.rowsById[id];
|
|
126
119
|
return {
|
|
@@ -131,9 +124,9 @@ const DataTable = props => {
|
|
|
131
124
|
isSelected: row.isSelected
|
|
132
125
|
};
|
|
133
126
|
});
|
|
134
|
-
const hasRowsChanged = !
|
|
127
|
+
const hasRowsChanged = !isEqual(rows, currentRows);
|
|
135
128
|
if (hasRowIdsChanged || hasHeadersChanged || hasRowsChanged) {
|
|
136
|
-
setState(prev => getDerivedStateFromProps
|
|
129
|
+
setState(prev => getDerivedStateFromProps.default(props, prev));
|
|
137
130
|
}
|
|
138
131
|
}, [headers, rows]);
|
|
139
132
|
|
|
@@ -592,9 +585,9 @@ const DataTable = props => {
|
|
|
592
585
|
}) : state.rowIds;
|
|
593
586
|
const renderProps = {
|
|
594
587
|
// Data derived from state
|
|
595
|
-
rows: denormalize
|
|
588
|
+
rows: denormalize.default(filteredRowIds, state.rowsById, state.cellsById),
|
|
596
589
|
headers: headers,
|
|
597
|
-
selectedRows: denormalize
|
|
590
|
+
selectedRows: denormalize.default(getSelectedRows(), state.rowsById, state.cellsById),
|
|
598
591
|
// Prop accessors/getters
|
|
599
592
|
getHeaderProps,
|
|
600
593
|
getExpandHeaderProps,
|
|
@@ -626,102 +619,102 @@ const DataTable = props => {
|
|
|
626
619
|
};
|
|
627
620
|
DataTable.translationKeys = Object.values(translationKeys);
|
|
628
621
|
DataTable.Table = Table.Table;
|
|
629
|
-
DataTable.TableActionList = TableActionList
|
|
630
|
-
DataTable.TableBatchAction = TableBatchAction
|
|
631
|
-
DataTable.TableBatchActions = TableBatchActions
|
|
632
|
-
DataTable.TableBody = TableBody
|
|
633
|
-
DataTable.TableCell = TableCell
|
|
634
|
-
DataTable.TableContainer = TableContainer
|
|
635
|
-
DataTable.TableDecoratorRow = TableDecoratorRow
|
|
636
|
-
DataTable.TableExpandHeader = TableExpandHeader
|
|
637
|
-
DataTable.TableExpandRow = TableExpandRow
|
|
638
|
-
DataTable.TableExpandedRow = TableExpandedRow
|
|
639
|
-
DataTable.TableHead = TableHead
|
|
640
|
-
DataTable.TableHeader = TableHeader
|
|
641
|
-
DataTable.TableRow = TableRow
|
|
642
|
-
DataTable.TableSelectAll = TableSelectAll
|
|
643
|
-
DataTable.TableSelectRow = TableSelectRow
|
|
644
|
-
DataTable.TableSlugRow = TableSlugRow
|
|
645
|
-
DataTable.TableToolbar = TableToolbar
|
|
646
|
-
DataTable.TableToolbarAction = TableToolbarAction
|
|
647
|
-
DataTable.TableToolbarContent = TableToolbarContent
|
|
648
|
-
DataTable.TableToolbarSearch = TableToolbarSearch
|
|
649
|
-
DataTable.TableToolbarMenu = TableToolbarMenu
|
|
622
|
+
DataTable.TableActionList = TableActionList.default;
|
|
623
|
+
DataTable.TableBatchAction = TableBatchAction.default;
|
|
624
|
+
DataTable.TableBatchActions = TableBatchActions.default;
|
|
625
|
+
DataTable.TableBody = TableBody.default;
|
|
626
|
+
DataTable.TableCell = TableCell.default;
|
|
627
|
+
DataTable.TableContainer = TableContainer.default;
|
|
628
|
+
DataTable.TableDecoratorRow = TableDecoratorRow.default;
|
|
629
|
+
DataTable.TableExpandHeader = TableExpandHeader.default;
|
|
630
|
+
DataTable.TableExpandRow = TableExpandRow.default;
|
|
631
|
+
DataTable.TableExpandedRow = TableExpandedRow.default;
|
|
632
|
+
DataTable.TableHead = TableHead.default;
|
|
633
|
+
DataTable.TableHeader = TableHeader.default;
|
|
634
|
+
DataTable.TableRow = TableRow.default;
|
|
635
|
+
DataTable.TableSelectAll = TableSelectAll.default;
|
|
636
|
+
DataTable.TableSelectRow = TableSelectRow.default;
|
|
637
|
+
DataTable.TableSlugRow = TableSlugRow.default;
|
|
638
|
+
DataTable.TableToolbar = TableToolbar.default;
|
|
639
|
+
DataTable.TableToolbarAction = TableToolbarAction.default;
|
|
640
|
+
DataTable.TableToolbarContent = TableToolbarContent.default;
|
|
641
|
+
DataTable.TableToolbarSearch = TableToolbarSearch.default;
|
|
642
|
+
DataTable.TableToolbarMenu = TableToolbarMenu.default;
|
|
650
643
|
DataTable.propTypes = {
|
|
651
644
|
/**
|
|
652
645
|
* Experimental property. Allows table to align cell contents to the top if there is text wrapping in the content. Might have performance issues, intended for smaller tables
|
|
653
646
|
*/
|
|
654
|
-
experimentalAutoAlign:
|
|
647
|
+
experimentalAutoAlign: PropTypes.bool,
|
|
655
648
|
/**
|
|
656
649
|
* Optional hook to manually control filtering of the rows from the
|
|
657
650
|
* TableToolbarSearch component
|
|
658
651
|
*/
|
|
659
|
-
filterRows:
|
|
652
|
+
filterRows: PropTypes.func,
|
|
660
653
|
/**
|
|
661
654
|
* The `headers` prop represents the order in which the headers should
|
|
662
655
|
* appear in the table. We expect an array of objects to be passed in, where
|
|
663
656
|
* `key` is the name of the key in a row object, and `header` is the name of
|
|
664
657
|
* the header.
|
|
665
658
|
*/
|
|
666
|
-
headers:
|
|
667
|
-
key:
|
|
668
|
-
header:
|
|
659
|
+
headers: PropTypes.arrayOf(PropTypes.shape({
|
|
660
|
+
key: PropTypes.string.isRequired,
|
|
661
|
+
header: PropTypes.node.isRequired
|
|
669
662
|
})).isRequired,
|
|
670
663
|
/**
|
|
671
664
|
* Specify whether the table should be able to be sorted by its headers
|
|
672
665
|
*/
|
|
673
|
-
isSortable:
|
|
666
|
+
isSortable: PropTypes.bool,
|
|
674
667
|
/**
|
|
675
668
|
* Provide a string for the current locale
|
|
676
669
|
*/
|
|
677
|
-
locale:
|
|
670
|
+
locale: PropTypes.string,
|
|
678
671
|
/**
|
|
679
672
|
* Specify whether the overflow menu (if it exists) should be shown always, or only on hover
|
|
680
673
|
*/
|
|
681
|
-
overflowMenuOnHover:
|
|
674
|
+
overflowMenuOnHover: PropTypes.bool,
|
|
682
675
|
/**
|
|
683
676
|
* Specify whether the control should be a radio button or inline checkbox
|
|
684
677
|
*/
|
|
685
|
-
radio:
|
|
678
|
+
radio: PropTypes.bool,
|
|
686
679
|
/**
|
|
687
680
|
* The `rows` prop is where you provide us with a list of all the rows that
|
|
688
681
|
* you want to render in the table. The only hard requirement is that this
|
|
689
682
|
* is an array of objects, and that each object has a unique `id` field
|
|
690
683
|
* available on it.
|
|
691
684
|
*/
|
|
692
|
-
rows:
|
|
693
|
-
id:
|
|
694
|
-
disabled:
|
|
695
|
-
isSelected:
|
|
696
|
-
isExpanded:
|
|
685
|
+
rows: PropTypes.arrayOf(PropTypes.shape({
|
|
686
|
+
id: PropTypes.string.isRequired,
|
|
687
|
+
disabled: PropTypes.bool,
|
|
688
|
+
isSelected: PropTypes.bool,
|
|
689
|
+
isExpanded: PropTypes.bool
|
|
697
690
|
})).isRequired,
|
|
698
691
|
/**
|
|
699
692
|
* Change the row height of table. Currently supports `xs`, `sm`, `md`, `lg`, and `xl`.
|
|
700
693
|
*/
|
|
701
|
-
size:
|
|
694
|
+
size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl']),
|
|
702
695
|
/**
|
|
703
696
|
* Optional hook to manually control sorting of the rows.
|
|
704
697
|
*/
|
|
705
|
-
sortRow:
|
|
698
|
+
sortRow: PropTypes.func,
|
|
706
699
|
/**
|
|
707
700
|
* Specify whether the header should be sticky.
|
|
708
701
|
* Still experimental: may not work with every combination of table props
|
|
709
702
|
*/
|
|
710
|
-
stickyHeader:
|
|
703
|
+
stickyHeader: PropTypes.bool,
|
|
711
704
|
/**
|
|
712
705
|
* Optional method that takes in a message id and returns an
|
|
713
706
|
* internationalized string. See `DataTable.translationKeys` for all
|
|
714
707
|
* available message ids.
|
|
715
708
|
*/
|
|
716
|
-
translateWithId:
|
|
709
|
+
translateWithId: PropTypes.func,
|
|
717
710
|
/**
|
|
718
711
|
* `false` If true, will use a width of 'auto' instead of 100%
|
|
719
712
|
*/
|
|
720
|
-
useStaticWidth:
|
|
713
|
+
useStaticWidth: PropTypes.bool,
|
|
721
714
|
/**
|
|
722
715
|
* `true` to add useZebraStyles striping.
|
|
723
716
|
*/
|
|
724
|
-
useZebraStyles:
|
|
717
|
+
useZebraStyles: PropTypes.bool
|
|
725
718
|
};
|
|
726
719
|
|
|
727
720
|
exports.DataTable = DataTable;
|
|
@@ -17,13 +17,7 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
17
17
|
var TableContext = require('./TableContext.js');
|
|
18
18
|
var useEvent = require('../../internal/useEvent.js');
|
|
19
19
|
var useIsomorphicEffect = require('../../internal/useIsomorphicEffect.js');
|
|
20
|
-
var debounce = require('../../node_modules/es-toolkit/dist/compat/function/debounce.
|
|
21
|
-
|
|
22
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
|
-
|
|
24
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
25
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
26
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
20
|
+
var debounce = require('../../node_modules/es-toolkit/dist/compat/function/debounce.js');
|
|
27
21
|
|
|
28
22
|
const isElementWrappingContent = (element, context) => {
|
|
29
23
|
if (element.children.length > 0) {
|
|
@@ -73,7 +67,7 @@ const Table = ({
|
|
|
73
67
|
const prefix = usePrefix.usePrefix();
|
|
74
68
|
const [isScrollable, setIsScrollable] = React.useState(false);
|
|
75
69
|
const tableRef = React.useRef(null);
|
|
76
|
-
const componentClass =
|
|
70
|
+
const componentClass = cx(`${prefix}--data-table`, className, {
|
|
77
71
|
[`${prefix}--data-table--${size}`]: size,
|
|
78
72
|
[`${prefix}--data-table--sort`]: isSortable,
|
|
79
73
|
[`${prefix}--data-table--zebra`]: useZebraStyles,
|
|
@@ -120,7 +114,7 @@ const Table = ({
|
|
|
120
114
|
}, []);
|
|
121
115
|
const debouncedSetTabIndex = debounce.debounce(setTabIndex, 100);
|
|
122
116
|
useEvent.useWindowEvent('resize', debouncedSetTabIndex);
|
|
123
|
-
useIsomorphicEffect
|
|
117
|
+
useIsomorphicEffect.default(() => {
|
|
124
118
|
setTabIndex();
|
|
125
119
|
}, [setTabIndex]);
|
|
126
120
|
|
|
@@ -130,22 +124,22 @@ const Table = ({
|
|
|
130
124
|
setTableAlignment();
|
|
131
125
|
});
|
|
132
126
|
}
|
|
133
|
-
useIsomorphicEffect
|
|
127
|
+
useIsomorphicEffect.default(() => {
|
|
134
128
|
setTableAlignment();
|
|
135
129
|
}, [setTableAlignment, size]);
|
|
136
|
-
const table = /*#__PURE__*/
|
|
130
|
+
const table = /*#__PURE__*/React.createElement("div", {
|
|
137
131
|
className: `${prefix}--data-table-content`
|
|
138
132
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
139
133
|
,
|
|
140
134
|
tabIndex: tabIndex ?? (isScrollable ? 0 : undefined)
|
|
141
|
-
}, /*#__PURE__*/
|
|
135
|
+
}, /*#__PURE__*/React.createElement("table", _rollupPluginBabelHelpers.extends({
|
|
142
136
|
"aria-labelledby": titleId,
|
|
143
137
|
"aria-describedby": descriptionId
|
|
144
138
|
}, other, {
|
|
145
139
|
className: componentClass,
|
|
146
140
|
ref: tableRef
|
|
147
141
|
}), children));
|
|
148
|
-
return stickyHeader ? /*#__PURE__*/
|
|
142
|
+
return stickyHeader ? /*#__PURE__*/React.createElement("section", {
|
|
149
143
|
className: `${prefix}--data-table_inner-container`
|
|
150
144
|
}, table) : table;
|
|
151
145
|
};
|
|
@@ -153,41 +147,41 @@ Table.propTypes = {
|
|
|
153
147
|
/**
|
|
154
148
|
* Pass in the children that will be rendered within the Table
|
|
155
149
|
*/
|
|
156
|
-
children:
|
|
157
|
-
className:
|
|
150
|
+
children: PropTypes.node,
|
|
151
|
+
className: PropTypes.string,
|
|
158
152
|
/**
|
|
159
153
|
* Experimental property. Allows table to align cell contents to the top if there is text wrapping in the content. Might have performance issues, intended for smaller tables
|
|
160
154
|
*/
|
|
161
|
-
experimentalAutoAlign:
|
|
155
|
+
experimentalAutoAlign: PropTypes.bool,
|
|
162
156
|
/**
|
|
163
157
|
* `false` If true, will apply sorting styles
|
|
164
158
|
*/
|
|
165
|
-
isSortable:
|
|
159
|
+
isSortable: PropTypes.bool,
|
|
166
160
|
/**
|
|
167
161
|
* Specify whether the overflow menu (if it exists) should be shown always, or only on hover
|
|
168
162
|
*/
|
|
169
|
-
overflowMenuOnHover:
|
|
163
|
+
overflowMenuOnHover: PropTypes.bool,
|
|
170
164
|
/**
|
|
171
165
|
* Change the row height of table. Currently supports `xs`, `sm`, `md`, `lg`, and `xl`.
|
|
172
166
|
*/
|
|
173
|
-
size:
|
|
167
|
+
size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl']),
|
|
174
168
|
/**
|
|
175
169
|
* `false` If true, will keep the header sticky (only data rows will scroll)
|
|
176
170
|
*/
|
|
177
|
-
stickyHeader:
|
|
171
|
+
stickyHeader: PropTypes.bool,
|
|
178
172
|
/**
|
|
179
173
|
* `false` If true, will use a width of 'auto' instead of 100%
|
|
180
174
|
*/
|
|
181
|
-
useStaticWidth:
|
|
175
|
+
useStaticWidth: PropTypes.bool,
|
|
182
176
|
/**
|
|
183
177
|
* `true` to add useZebraStyles striping.
|
|
184
178
|
*/
|
|
185
|
-
useZebraStyles:
|
|
179
|
+
useZebraStyles: PropTypes.bool,
|
|
186
180
|
/**
|
|
187
181
|
* Specify the table tabIndex
|
|
188
182
|
*/
|
|
189
|
-
tabIndex:
|
|
183
|
+
tabIndex: PropTypes.number
|
|
190
184
|
};
|
|
191
185
|
|
|
192
186
|
exports.Table = Table;
|
|
193
|
-
exports
|
|
187
|
+
exports.default = Table;
|
|
@@ -11,10 +11,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
11
11
|
|
|
12
12
|
var wrapComponent = require('../../tools/wrapComponent.js');
|
|
13
13
|
|
|
14
|
-
const TableActionList = wrapComponent
|
|
14
|
+
const TableActionList = wrapComponent.default({
|
|
15
15
|
name: 'TableActionList',
|
|
16
16
|
type: 'div',
|
|
17
17
|
className: prefix => `${prefix}--action-list`
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
exports
|
|
20
|
+
exports.default = TableActionList;
|
|
@@ -16,16 +16,11 @@ var iconsReact = require('@carbon/icons-react');
|
|
|
16
16
|
var Button = require('../Button/Button.js');
|
|
17
17
|
require('../Button/Button.Skeleton.js');
|
|
18
18
|
|
|
19
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
|
-
|
|
21
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
22
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
|
-
|
|
24
19
|
const TableBatchAction = ({
|
|
25
20
|
renderIcon = iconsReact.AddFilled,
|
|
26
21
|
iconDescription = 'Add',
|
|
27
22
|
...props
|
|
28
|
-
}) => /*#__PURE__*/
|
|
23
|
+
}) => /*#__PURE__*/React.createElement(Button.default, _rollupPluginBabelHelpers.extends({
|
|
29
24
|
renderIcon: renderIcon,
|
|
30
25
|
iconDescription: iconDescription
|
|
31
26
|
}, props));
|
|
@@ -33,7 +28,7 @@ TableBatchAction.propTypes = {
|
|
|
33
28
|
/**
|
|
34
29
|
* Specify if the button is an icon-only button
|
|
35
30
|
*/
|
|
36
|
-
hasIconOnly:
|
|
31
|
+
hasIconOnly: PropTypes.bool,
|
|
37
32
|
/**
|
|
38
33
|
* If specifying the `renderIcon` prop, provide a description for that icon that can
|
|
39
34
|
* be read by screen readers
|
|
@@ -47,7 +42,7 @@ TableBatchAction.propTypes = {
|
|
|
47
42
|
/**
|
|
48
43
|
* A component used to render an icon.
|
|
49
44
|
*/
|
|
50
|
-
renderIcon:
|
|
45
|
+
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
51
46
|
};
|
|
52
47
|
|
|
53
|
-
exports
|
|
48
|
+
exports.default = TableBatchAction;
|
|
@@ -20,12 +20,6 @@ require('../Text/index.js');
|
|
|
20
20
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
21
21
|
var Text = require('../Text/Text.js');
|
|
22
22
|
|
|
23
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
24
|
-
|
|
25
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
26
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
27
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
28
|
-
|
|
29
23
|
const TableBatchActionsTranslationKeys = ['carbon.table.batch.cancel', 'carbon.table.batch.items.selected', 'carbon.table.batch.item.selected', 'carbon.table.batch.selectAll'];
|
|
30
24
|
const translationKeys = {
|
|
31
25
|
'carbon.table.batch.cancel': 'Cancel',
|
|
@@ -59,37 +53,37 @@ const TableBatchActions = ({
|
|
|
59
53
|
translateWithId: t = translateWithId,
|
|
60
54
|
...rest
|
|
61
55
|
}) => {
|
|
62
|
-
const [isScrolling, setIsScrolling] =
|
|
56
|
+
const [isScrolling, setIsScrolling] = React.useState(false);
|
|
63
57
|
const prefix = usePrefix.usePrefix();
|
|
64
|
-
const batchActionsClasses =
|
|
58
|
+
const batchActionsClasses = cx({
|
|
65
59
|
[`${prefix}--batch-actions`]: true,
|
|
66
60
|
[`${prefix}--batch-actions--active`]: shouldShowBatchActions
|
|
67
61
|
}, className);
|
|
68
|
-
const batchSummaryClasses =
|
|
62
|
+
const batchSummaryClasses = cx(`${prefix}--batch-summary`, {
|
|
69
63
|
[`${prefix}--batch-summary__scroll`]: isScrolling
|
|
70
64
|
});
|
|
71
|
-
return /*#__PURE__*/
|
|
65
|
+
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
|
72
66
|
onScroll: () => {
|
|
73
67
|
setIsScrolling(!isScrolling);
|
|
74
68
|
},
|
|
75
69
|
"aria-hidden": !shouldShowBatchActions,
|
|
76
70
|
className: batchActionsClasses
|
|
77
|
-
}, rest), /*#__PURE__*/
|
|
71
|
+
}, rest), /*#__PURE__*/React.createElement("div", {
|
|
78
72
|
className: batchSummaryClasses
|
|
79
|
-
}, /*#__PURE__*/
|
|
73
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
80
74
|
className: `${prefix}--batch-summary__para`
|
|
81
|
-
}, /*#__PURE__*/
|
|
75
|
+
}, /*#__PURE__*/React.createElement(Text.Text, null, totalSelected > 1 || totalSelected === 0 ? t('carbon.table.batch.items.selected', {
|
|
82
76
|
totalSelected
|
|
83
77
|
}) : t('carbon.table.batch.item.selected', {
|
|
84
78
|
totalSelected
|
|
85
|
-
}))), onSelectAll && /*#__PURE__*/
|
|
79
|
+
}))), onSelectAll && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
86
80
|
className: `${prefix}--batch-summary__divider`
|
|
87
|
-
}, "|"), /*#__PURE__*/
|
|
81
|
+
}, "|"), /*#__PURE__*/React.createElement(Button.default, {
|
|
88
82
|
onClick: onSelectAll,
|
|
89
83
|
tabIndex: shouldShowBatchActions ? 0 : -1
|
|
90
84
|
}, t('carbon.table.batch.selectAll', {
|
|
91
85
|
totalCount
|
|
92
|
-
})))), /*#__PURE__*/
|
|
86
|
+
})))), /*#__PURE__*/React.createElement(TableActionList.default, null, children, /*#__PURE__*/React.createElement(Button.default, {
|
|
93
87
|
className: `${prefix}--batch-summary__cancel`,
|
|
94
88
|
tabIndex: shouldShowBatchActions ? 0 : -1,
|
|
95
89
|
onClick: onCancel
|
|
@@ -97,40 +91,40 @@ const TableBatchActions = ({
|
|
|
97
91
|
};
|
|
98
92
|
TableBatchActions.translationKeys = TableBatchActionsTranslationKeys;
|
|
99
93
|
TableBatchActions.propTypes = {
|
|
100
|
-
children:
|
|
101
|
-
className:
|
|
94
|
+
children: PropTypes.node,
|
|
95
|
+
className: PropTypes.string,
|
|
102
96
|
/**
|
|
103
97
|
* Hook required to listen for when the user initiates a cancel request
|
|
104
98
|
* through this component
|
|
105
99
|
*/
|
|
106
|
-
onCancel:
|
|
100
|
+
onCancel: PropTypes.func.isRequired,
|
|
107
101
|
/**
|
|
108
102
|
* Hook to listen for when the user initiates a select all
|
|
109
103
|
* request through this component. This _only_ controls the rendering
|
|
110
104
|
* of the `Select All` button and does not include built in functionality
|
|
111
105
|
*/
|
|
112
|
-
onSelectAll:
|
|
106
|
+
onSelectAll: PropTypes.func,
|
|
113
107
|
/**
|
|
114
108
|
* Boolean specifier for whether or not the batch action bar should be
|
|
115
109
|
* displayed
|
|
116
110
|
*/
|
|
117
|
-
shouldShowBatchActions:
|
|
111
|
+
shouldShowBatchActions: PropTypes.bool,
|
|
118
112
|
/**
|
|
119
113
|
* Numeric representation of the total number of items in a table.
|
|
120
114
|
* This number is used in the select all button text
|
|
121
115
|
*/
|
|
122
|
-
totalCount:
|
|
116
|
+
totalCount: PropTypes.number,
|
|
123
117
|
/**
|
|
124
118
|
* Numeric representation of the total number of items selected in a table.
|
|
125
119
|
* This number is used to derive the selection message
|
|
126
120
|
*/
|
|
127
|
-
totalSelected:
|
|
121
|
+
totalSelected: PropTypes.number.isRequired,
|
|
128
122
|
/**
|
|
129
123
|
* Supply a method to translate internal strings with your i18n tool of
|
|
130
124
|
* choice. Translation keys are available on the `translationKeys` field for
|
|
131
125
|
* this component.
|
|
132
126
|
*/
|
|
133
|
-
translateWithId:
|
|
127
|
+
translateWithId: PropTypes.func
|
|
134
128
|
};
|
|
135
129
|
|
|
136
|
-
exports
|
|
130
|
+
exports.default = TableBatchActions;
|
|
@@ -13,16 +13,11 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
|
|
|
13
13
|
var PropTypes = require('prop-types');
|
|
14
14
|
var React = require('react');
|
|
15
15
|
|
|
16
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
|
-
|
|
18
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
19
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
20
|
-
|
|
21
16
|
const TableBody = ({
|
|
22
17
|
children,
|
|
23
18
|
className,
|
|
24
19
|
...rest
|
|
25
|
-
}) => /*#__PURE__*/
|
|
20
|
+
}) => /*#__PURE__*/React.createElement("tbody", _rollupPluginBabelHelpers.extends({
|
|
26
21
|
"aria-live": rest['aria-live'] ?? 'polite',
|
|
27
22
|
className: className
|
|
28
23
|
}, rest), children);
|
|
@@ -30,9 +25,9 @@ TableBody.propTypes = {
|
|
|
30
25
|
/**
|
|
31
26
|
* `polite` Adjust the notification behavior of screen readers
|
|
32
27
|
*/
|
|
33
|
-
'aria-live':
|
|
34
|
-
children:
|
|
35
|
-
className:
|
|
28
|
+
'aria-live': PropTypes.oneOf(['polite', 'assertive', 'off']),
|
|
29
|
+
children: PropTypes.node,
|
|
30
|
+
className: PropTypes.string
|
|
36
31
|
};
|
|
37
32
|
|
|
38
|
-
exports
|
|
33
|
+
exports.default = TableBody;
|
|
@@ -15,12 +15,6 @@ var cx = require('classnames');
|
|
|
15
15
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
16
16
|
var PropTypes = require('prop-types');
|
|
17
17
|
|
|
18
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
-
|
|
20
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
21
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
22
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
23
|
-
|
|
24
18
|
const frFn = React.forwardRef;
|
|
25
19
|
const TableCell = frFn((props, ref) => {
|
|
26
20
|
const {
|
|
@@ -31,10 +25,10 @@ const TableCell = frFn((props, ref) => {
|
|
|
31
25
|
...rest
|
|
32
26
|
} = props;
|
|
33
27
|
const prefix = usePrefix.usePrefix();
|
|
34
|
-
const tableCellClassNames =
|
|
28
|
+
const tableCellClassNames = cx(className, {
|
|
35
29
|
[`${prefix}--table-cell--column-slug`]: hasAILabelHeader
|
|
36
30
|
});
|
|
37
|
-
return /*#__PURE__*/
|
|
31
|
+
return /*#__PURE__*/React.createElement("td", _rollupPluginBabelHelpers.extends({
|
|
38
32
|
className: tableCellClassNames ? tableCellClassNames : undefined,
|
|
39
33
|
ref: ref,
|
|
40
34
|
colSpan: colSpan
|
|
@@ -45,23 +39,23 @@ TableCell.propTypes = {
|
|
|
45
39
|
/**
|
|
46
40
|
* Pass in children that will be embedded in the table header label
|
|
47
41
|
*/
|
|
48
|
-
children:
|
|
42
|
+
children: PropTypes.node,
|
|
49
43
|
/**
|
|
50
44
|
* Specify an optional className to be applied to the container node
|
|
51
45
|
*/
|
|
52
|
-
className:
|
|
46
|
+
className: PropTypes.string,
|
|
53
47
|
/**
|
|
54
48
|
* The width of the expanded row's internal cell
|
|
55
49
|
*/
|
|
56
|
-
colSpan:
|
|
50
|
+
colSpan: PropTypes.number,
|
|
57
51
|
/**
|
|
58
52
|
* Specify if the table cell is in an AI column
|
|
59
53
|
*/
|
|
60
|
-
hasAILabelHeader:
|
|
54
|
+
hasAILabelHeader: PropTypes.bool,
|
|
61
55
|
/**
|
|
62
56
|
* The id of the matching th node in the table head. Addresses a11y concerns outlined here: https://www.ibm.com/able/guidelines/ci162/info_and_relationships.html and https://www.w3.org/TR/WCAG20-TECHS/H43
|
|
63
57
|
*/
|
|
64
|
-
headers:
|
|
58
|
+
headers: PropTypes.string
|
|
65
59
|
};
|
|
66
60
|
|
|
67
|
-
exports
|
|
61
|
+
exports.default = TableCell;
|
|
@@ -18,12 +18,6 @@ var useId = require('../../internal/useId.js');
|
|
|
18
18
|
var TableContext = require('./TableContext.js');
|
|
19
19
|
var index = require('../Heading/index.js');
|
|
20
20
|
|
|
21
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
22
|
-
|
|
23
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
24
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
25
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
26
|
-
|
|
27
21
|
const TableContainer = ({
|
|
28
22
|
aiEnabled,
|
|
29
23
|
className,
|
|
@@ -38,7 +32,7 @@ const TableContainer = ({
|
|
|
38
32
|
const titleId = `${baseId}-title`;
|
|
39
33
|
const descriptionId = `${baseId}-description`;
|
|
40
34
|
const prefix = usePrefix.usePrefix();
|
|
41
|
-
const tableContainerClasses =
|
|
35
|
+
const tableContainerClasses = cx(className, `${prefix}--data-table-container`, {
|
|
42
36
|
[`${prefix}--data-table--max-width`]: stickyHeader,
|
|
43
37
|
[`${prefix}--data-table-container--static`]: useStaticWidth,
|
|
44
38
|
[`${prefix}--data-table-container--ai-enabled`]: aiEnabled
|
|
@@ -49,16 +43,16 @@ const TableContainer = ({
|
|
|
49
43
|
descriptionId: description ? descriptionId : undefined
|
|
50
44
|
};
|
|
51
45
|
}, [title, description, titleId, descriptionId]);
|
|
52
|
-
return /*#__PURE__*/
|
|
46
|
+
return /*#__PURE__*/React.createElement(TableContext.TableContext.Provider, {
|
|
53
47
|
value: value
|
|
54
|
-
}, /*#__PURE__*/
|
|
48
|
+
}, /*#__PURE__*/React.createElement(index.Section, _rollupPluginBabelHelpers.extends({}, rest, {
|
|
55
49
|
className: tableContainerClasses
|
|
56
|
-
}), (title || description) && /*#__PURE__*/
|
|
50
|
+
}), (title || description) && /*#__PURE__*/React.createElement("div", {
|
|
57
51
|
className: `${prefix}--data-table-header`
|
|
58
|
-
}, title && /*#__PURE__*/
|
|
52
|
+
}, title && /*#__PURE__*/React.createElement(index.Heading, {
|
|
59
53
|
className: `${prefix}--data-table-header__title`,
|
|
60
54
|
id: titleId
|
|
61
|
-
}, title), description && /*#__PURE__*/
|
|
55
|
+
}, title), description && /*#__PURE__*/React.createElement("p", {
|
|
62
56
|
className: `${prefix}--data-table-header__description`,
|
|
63
57
|
id: descriptionId
|
|
64
58
|
}, description)), children));
|
|
@@ -67,25 +61,25 @@ TableContainer.propTypes = {
|
|
|
67
61
|
/**
|
|
68
62
|
* Specify if the entire table has AI generated contents
|
|
69
63
|
*/
|
|
70
|
-
aiEnabled:
|
|
71
|
-
children:
|
|
72
|
-
className:
|
|
64
|
+
aiEnabled: PropTypes.bool,
|
|
65
|
+
children: PropTypes.node,
|
|
66
|
+
className: PropTypes.string,
|
|
73
67
|
/**
|
|
74
68
|
* Optional description text for the Table
|
|
75
69
|
*/
|
|
76
|
-
description:
|
|
70
|
+
description: PropTypes.node,
|
|
77
71
|
/**
|
|
78
72
|
* Specify whether the table should have a sticky header
|
|
79
73
|
*/
|
|
80
|
-
stickyHeader:
|
|
74
|
+
stickyHeader: PropTypes.bool,
|
|
81
75
|
/**
|
|
82
76
|
* Provide a title for the Table
|
|
83
77
|
*/
|
|
84
|
-
title:
|
|
78
|
+
title: PropTypes.node,
|
|
85
79
|
/**
|
|
86
80
|
* If true, will use a width of 'fit-content' to match the inner table width
|
|
87
81
|
*/
|
|
88
|
-
useStaticWidth:
|
|
82
|
+
useStaticWidth: PropTypes.bool
|
|
89
83
|
};
|
|
90
84
|
|
|
91
|
-
exports
|
|
85
|
+
exports.default = TableContainer;
|