@carbon/react 1.87.0-rc.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 +853 -853
- 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
|
@@ -16,18 +16,12 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
16
16
|
var index = require('../AILabel/index.js');
|
|
17
17
|
var utils = require('../../internal/utils.js');
|
|
18
18
|
|
|
19
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
|
-
|
|
21
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
22
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
23
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
24
|
-
|
|
25
19
|
const TableDecoratorRow = ({
|
|
26
20
|
className,
|
|
27
21
|
decorator
|
|
28
22
|
}) => {
|
|
29
23
|
const prefix = usePrefix.usePrefix();
|
|
30
|
-
const TableDecoratorRowClasses =
|
|
24
|
+
const TableDecoratorRowClasses = cx({
|
|
31
25
|
...(className && {
|
|
32
26
|
[className]: true
|
|
33
27
|
}),
|
|
@@ -38,7 +32,7 @@ const TableDecoratorRow = ({
|
|
|
38
32
|
const normalizedDecorator = decoratorIsAILabel ? /*#__PURE__*/React.cloneElement(decorator, {
|
|
39
33
|
size: 'mini'
|
|
40
34
|
}) : null;
|
|
41
|
-
return /*#__PURE__*/
|
|
35
|
+
return /*#__PURE__*/React.createElement("td", {
|
|
42
36
|
className: TableDecoratorRowClasses
|
|
43
37
|
}, normalizedDecorator);
|
|
44
38
|
};
|
|
@@ -47,11 +41,11 @@ TableDecoratorRow.propTypes = {
|
|
|
47
41
|
/**
|
|
48
42
|
* The CSS class names of the cell that wraps the underlying input control
|
|
49
43
|
*/
|
|
50
|
-
className:
|
|
44
|
+
className: PropTypes.string,
|
|
51
45
|
/**
|
|
52
46
|
* **Experimental**: Provide a `decorator` component to be rendered inside the `TableDecoratorRow` component
|
|
53
47
|
*/
|
|
54
|
-
decorator:
|
|
48
|
+
decorator: PropTypes.node
|
|
55
49
|
};
|
|
56
50
|
|
|
57
|
-
exports
|
|
51
|
+
exports.default = TableDecoratorRow;
|
|
@@ -18,12 +18,6 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
18
18
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
19
19
|
var requiredIfGivenPropIsTruthy = require('../../prop-types/requiredIfGivenPropIsTruthy.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 TableExpandHeader = ({
|
|
28
22
|
['aria-controls']: ariaControls,
|
|
29
23
|
['aria-label']: ariaLabel,
|
|
@@ -39,14 +33,14 @@ const TableExpandHeader = ({
|
|
|
39
33
|
...rest
|
|
40
34
|
}) => {
|
|
41
35
|
const prefix = usePrefix.usePrefix();
|
|
42
|
-
const className =
|
|
36
|
+
const className = cx(`${prefix}--table-expand`, headerClassName);
|
|
43
37
|
const previousValue = isExpanded ? 'collapsed' : undefined;
|
|
44
|
-
return /*#__PURE__*/
|
|
38
|
+
return /*#__PURE__*/React.createElement("th", _rollupPluginBabelHelpers.extends({
|
|
45
39
|
scope: "col",
|
|
46
40
|
className: className,
|
|
47
41
|
"data-previous-value": previousValue,
|
|
48
42
|
id: id
|
|
49
|
-
}, rest), enableExpando || enableToggle ? /*#__PURE__*/
|
|
43
|
+
}, rest), enableExpando || enableToggle ? /*#__PURE__*/React.createElement("button", {
|
|
50
44
|
type: "button",
|
|
51
45
|
className: `${prefix}--table-expand__button`,
|
|
52
46
|
onClick: onExpand,
|
|
@@ -54,7 +48,7 @@ const TableExpandHeader = ({
|
|
|
54
48
|
"aria-label": deprecatedAriaLabel || ariaLabel,
|
|
55
49
|
"aria-expanded": isExpanded,
|
|
56
50
|
"aria-controls": ariaControls
|
|
57
|
-
}, /*#__PURE__*/
|
|
51
|
+
}, /*#__PURE__*/React.createElement(iconsReact.ChevronRight, {
|
|
58
52
|
className: `${prefix}--table-expand__svg`,
|
|
59
53
|
"aria-label": expandIconDescription
|
|
60
54
|
})) : null, children);
|
|
@@ -63,45 +57,45 @@ TableExpandHeader.propTypes = {
|
|
|
63
57
|
/**
|
|
64
58
|
* Space separated list of one or more ID values referencing the TableExpandedRow(s) being controlled by the TableExpandHeader
|
|
65
59
|
*/
|
|
66
|
-
['aria-controls']:
|
|
60
|
+
['aria-controls']: PropTypes.string,
|
|
67
61
|
/**
|
|
68
62
|
* Specify the string read by a voice reader when the expand trigger is
|
|
69
63
|
* focused
|
|
70
64
|
*/
|
|
71
|
-
['aria-label']:
|
|
65
|
+
['aria-label']: PropTypes.string,
|
|
72
66
|
/**
|
|
73
67
|
* Deprecated, please use `aria-label` instead.
|
|
74
68
|
* Specify the string read by a voice reader when the expand trigger is
|
|
75
69
|
* focused
|
|
76
70
|
*/
|
|
77
|
-
ariaLabel:
|
|
78
|
-
children:
|
|
79
|
-
className:
|
|
71
|
+
ariaLabel: PropTypes.string,
|
|
72
|
+
children: PropTypes.node,
|
|
73
|
+
className: PropTypes.string,
|
|
80
74
|
/**
|
|
81
75
|
* The enableExpando prop is being replaced by TableExpandHeader
|
|
82
76
|
*/
|
|
83
|
-
enableExpando: deprecate.deprecate(
|
|
77
|
+
enableExpando: deprecate.deprecate(PropTypes.bool, 'The `enableExpando` prop has been deprecated in favor of `enableToggle`. This prop will be removed in the next major release.'),
|
|
84
78
|
/**
|
|
85
79
|
* Specify whether an expand all button should be displayed
|
|
86
80
|
*/
|
|
87
|
-
enableToggle:
|
|
81
|
+
enableToggle: PropTypes.bool,
|
|
88
82
|
/**
|
|
89
83
|
* The description of the chevron right icon, to be put in its SVG `<title>` element.
|
|
90
84
|
*/
|
|
91
|
-
expandIconDescription:
|
|
85
|
+
expandIconDescription: PropTypes.string,
|
|
92
86
|
/**
|
|
93
87
|
* Supply an id to the th element.
|
|
94
88
|
*/
|
|
95
|
-
id:
|
|
89
|
+
id: PropTypes.string,
|
|
96
90
|
/**
|
|
97
91
|
* Specify whether this row is expanded or not. This helps coordinate data
|
|
98
92
|
* attributes so that `TableExpandRow` and `TableExpandedRow` work together
|
|
99
93
|
*/
|
|
100
|
-
isExpanded: requiredIfGivenPropIsTruthy
|
|
94
|
+
isExpanded: requiredIfGivenPropIsTruthy.default('enableToggle', PropTypes.bool),
|
|
101
95
|
/**
|
|
102
96
|
* Hook for when a listener initiates a request to expand the given row
|
|
103
97
|
*/
|
|
104
|
-
onExpand:
|
|
98
|
+
onExpand: PropTypes.oneOfType([requiredIfGivenPropIsTruthy.default('enableExpando', PropTypes.func), requiredIfGivenPropIsTruthy.default('enableToggle', PropTypes.func)])
|
|
105
99
|
};
|
|
106
100
|
|
|
107
|
-
exports
|
|
101
|
+
exports.default = TableExpandHeader;
|
|
@@ -21,13 +21,7 @@ var TableDecoratorRow = require('./TableDecoratorRow.js');
|
|
|
21
21
|
var index = require('../AILabel/index.js');
|
|
22
22
|
var utils = require('../../internal/utils.js');
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
27
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
28
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
29
|
-
|
|
30
|
-
const TableExpandRow = /*#__PURE__*/React__default["default"].forwardRef(({
|
|
24
|
+
const TableExpandRow = /*#__PURE__*/React.forwardRef(({
|
|
31
25
|
['aria-controls']: ariaControls,
|
|
32
26
|
['aria-label']: ariaLabel,
|
|
33
27
|
ariaLabel: deprecatedAriaLabel,
|
|
@@ -45,12 +39,12 @@ const TableExpandRow = /*#__PURE__*/React__default["default"].forwardRef(({
|
|
|
45
39
|
// We need to put the AILabel and Decorator before the expansion arrow and all other table cells after the arrow.
|
|
46
40
|
let rowHasAILabel;
|
|
47
41
|
const decorator = React.Children.toArray(children).map(child => {
|
|
48
|
-
if (utils.isComponentElement(child, TableSlugRow
|
|
42
|
+
if (utils.isComponentElement(child, TableSlugRow.default)) {
|
|
49
43
|
if (child.props.slug) {
|
|
50
44
|
rowHasAILabel = true;
|
|
51
45
|
}
|
|
52
46
|
return child;
|
|
53
|
-
} else if (utils.isComponentElement(child, TableDecoratorRow
|
|
47
|
+
} else if (utils.isComponentElement(child, TableDecoratorRow.default)) {
|
|
54
48
|
if (utils.isComponentElement(child.props.decorator, index.AILabel)) {
|
|
55
49
|
rowHasAILabel = true;
|
|
56
50
|
}
|
|
@@ -58,26 +52,26 @@ const TableExpandRow = /*#__PURE__*/React__default["default"].forwardRef(({
|
|
|
58
52
|
}
|
|
59
53
|
});
|
|
60
54
|
const normalizedChildren = React.Children.toArray(children).map(child => {
|
|
61
|
-
if (/*#__PURE__*/React.isValidElement(child) && child.type !== TableSlugRow
|
|
55
|
+
if (/*#__PURE__*/React.isValidElement(child) && child.type !== TableSlugRow.default && child.type !== TableDecoratorRow.default) {
|
|
62
56
|
return child;
|
|
63
57
|
}
|
|
64
58
|
});
|
|
65
|
-
const className =
|
|
59
|
+
const className = cx({
|
|
66
60
|
[`${prefix}--parent-row`]: true,
|
|
67
61
|
[`${prefix}--expandable-row`]: isExpanded,
|
|
68
62
|
[`${prefix}--data-table--selected`]: isSelected,
|
|
69
63
|
[`${prefix}--data-table--slug-row ${prefix}--data-table--ai-label-row`]: rowHasAILabel
|
|
70
64
|
}, rowClassName);
|
|
71
65
|
const previousValue = isExpanded ? 'collapsed' : undefined;
|
|
72
|
-
return /*#__PURE__*/
|
|
66
|
+
return /*#__PURE__*/React.createElement("tr", _rollupPluginBabelHelpers.extends({}, rest, {
|
|
73
67
|
ref: ref,
|
|
74
68
|
className: className,
|
|
75
69
|
"data-parent-row": true
|
|
76
|
-
}), decorator, /*#__PURE__*/
|
|
70
|
+
}), decorator, /*#__PURE__*/React.createElement(TableCell.default, {
|
|
77
71
|
className: `${prefix}--table-expand`,
|
|
78
72
|
"data-previous-value": previousValue,
|
|
79
73
|
headers: expandHeader
|
|
80
|
-
}, /*#__PURE__*/
|
|
74
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
81
75
|
type: "button",
|
|
82
76
|
className: `${prefix}--table-expand__button`,
|
|
83
77
|
onClick: onExpand,
|
|
@@ -85,7 +79,7 @@ const TableExpandRow = /*#__PURE__*/React__default["default"].forwardRef(({
|
|
|
85
79
|
"aria-label": deprecatedAriaLabel || ariaLabel,
|
|
86
80
|
"aria-expanded": isExpanded,
|
|
87
81
|
"aria-controls": ariaControls
|
|
88
|
-
}, /*#__PURE__*/
|
|
82
|
+
}, /*#__PURE__*/React.createElement(iconsReact.ChevronRight, {
|
|
89
83
|
className: `${prefix}--table-expand__svg`,
|
|
90
84
|
"aria-label": expandIconDescription
|
|
91
85
|
}))), normalizedChildren);
|
|
@@ -95,43 +89,43 @@ TableExpandRow.propTypes = {
|
|
|
95
89
|
* Space separated list of one or more ID values referencing the TableExpandedRow(s) being controlled by the TableExpandRow
|
|
96
90
|
* TODO: make this required in v12
|
|
97
91
|
*/
|
|
98
|
-
['aria-controls']:
|
|
92
|
+
['aria-controls']: PropTypes.string,
|
|
99
93
|
/**
|
|
100
94
|
* Specify the string read by a voice reader when the expand trigger is
|
|
101
95
|
* focused
|
|
102
96
|
*/
|
|
103
97
|
/**@ts-ignore*/
|
|
104
|
-
['aria-label']:
|
|
98
|
+
['aria-label']: PropTypes.string,
|
|
105
99
|
/**
|
|
106
100
|
* Deprecated, please use `aria-label` instead.
|
|
107
101
|
* Specify the string read by a voice reader when the expand trigger is
|
|
108
102
|
* focused
|
|
109
103
|
*/
|
|
110
|
-
ariaLabel:
|
|
111
|
-
children:
|
|
112
|
-
className:
|
|
104
|
+
ariaLabel: PropTypes.string,
|
|
105
|
+
children: PropTypes.node,
|
|
106
|
+
className: PropTypes.string,
|
|
113
107
|
/**
|
|
114
108
|
* 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
|
|
115
109
|
*/
|
|
116
|
-
expandHeader:
|
|
110
|
+
expandHeader: PropTypes.string,
|
|
117
111
|
/**
|
|
118
112
|
* The description of the chevron right icon, to be put in its SVG `<title>` element.
|
|
119
113
|
*/
|
|
120
|
-
expandIconDescription:
|
|
114
|
+
expandIconDescription: PropTypes.string,
|
|
121
115
|
/**
|
|
122
116
|
* Specify whether this row is expanded or not. This helps coordinate data
|
|
123
117
|
* attributes so that `TableExpandRow` and `TableExpandedRow` work together
|
|
124
118
|
*/
|
|
125
|
-
isExpanded:
|
|
119
|
+
isExpanded: PropTypes.bool,
|
|
126
120
|
/**
|
|
127
121
|
* Specify if the row is selected
|
|
128
122
|
*/
|
|
129
|
-
isSelected:
|
|
123
|
+
isSelected: PropTypes.bool,
|
|
130
124
|
/**
|
|
131
125
|
* Hook for when a listener initiates a request to expand the given row
|
|
132
126
|
*/
|
|
133
|
-
onExpand:
|
|
127
|
+
onExpand: PropTypes.func.isRequired
|
|
134
128
|
};
|
|
135
129
|
TableExpandRow.displayName = 'TableExpandRow';
|
|
136
130
|
|
|
137
|
-
exports
|
|
131
|
+
exports.default = TableExpandRow;
|
|
@@ -16,12 +16,6 @@ var React = require('react');
|
|
|
16
16
|
var TableCell = require('./TableCell.js');
|
|
17
17
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
18
18
|
|
|
19
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
|
-
|
|
21
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
22
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
23
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
24
|
-
|
|
25
19
|
const TableExpandedRow = ({
|
|
26
20
|
className: customClassName,
|
|
27
21
|
children,
|
|
@@ -30,7 +24,7 @@ const TableExpandedRow = ({
|
|
|
30
24
|
}) => {
|
|
31
25
|
const rowRef = React.useRef(null);
|
|
32
26
|
const prefix = usePrefix.usePrefix();
|
|
33
|
-
const className =
|
|
27
|
+
const className = cx(`${prefix}--expandable-row`, customClassName);
|
|
34
28
|
const toggleParentHoverClass = eventType => {
|
|
35
29
|
if (rowRef && rowRef.current && rowRef.current.previousElementSibling) {
|
|
36
30
|
const parentNode = rowRef.current.previousElementSibling;
|
|
@@ -41,16 +35,16 @@ const TableExpandedRow = ({
|
|
|
41
35
|
}
|
|
42
36
|
}
|
|
43
37
|
};
|
|
44
|
-
return /*#__PURE__*/
|
|
38
|
+
return /*#__PURE__*/React.createElement("tr", _rollupPluginBabelHelpers.extends({
|
|
45
39
|
ref: rowRef,
|
|
46
40
|
onMouseEnter: () => toggleParentHoverClass('enter'),
|
|
47
41
|
onMouseLeave: () => toggleParentHoverClass('leave')
|
|
48
42
|
}, rest, {
|
|
49
43
|
className: className,
|
|
50
44
|
"data-child-row": true
|
|
51
|
-
}), /*#__PURE__*/
|
|
45
|
+
}), /*#__PURE__*/React.createElement(TableCell.default, {
|
|
52
46
|
colSpan: colSpan
|
|
53
|
-
}, /*#__PURE__*/
|
|
47
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
54
48
|
className: `${prefix}--child-row-inner-container`
|
|
55
49
|
}, children)));
|
|
56
50
|
};
|
|
@@ -58,15 +52,15 @@ TableExpandedRow.propTypes = {
|
|
|
58
52
|
/**
|
|
59
53
|
* Pass in the contents for your TableExpandedRow
|
|
60
54
|
*/
|
|
61
|
-
children:
|
|
55
|
+
children: PropTypes.node,
|
|
62
56
|
/**
|
|
63
57
|
* Specify an optional className to be applied to the container node
|
|
64
58
|
*/
|
|
65
|
-
className:
|
|
59
|
+
className: PropTypes.string,
|
|
66
60
|
/**
|
|
67
61
|
* The width of the expanded row's internal cell
|
|
68
62
|
*/
|
|
69
|
-
colSpan:
|
|
63
|
+
colSpan: PropTypes.number.isRequired
|
|
70
64
|
};
|
|
71
65
|
|
|
72
|
-
exports
|
|
66
|
+
exports.default = TableExpandedRow;
|
|
@@ -11,9 +11,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
11
11
|
|
|
12
12
|
var wrapComponent = require('../../tools/wrapComponent.js');
|
|
13
13
|
|
|
14
|
-
const TableHead = wrapComponent
|
|
14
|
+
const TableHead = wrapComponent.default({
|
|
15
15
|
name: 'TableHead',
|
|
16
16
|
type: 'thead'
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
exports
|
|
19
|
+
exports.default = TableHead;
|
|
@@ -21,12 +21,6 @@ var index = require('../AILabel/index.js');
|
|
|
21
21
|
var utils = require('../../internal/utils.js');
|
|
22
22
|
var sortStates = require('./state/sortStates.js');
|
|
23
23
|
|
|
24
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
25
|
-
|
|
26
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
27
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
28
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
29
|
-
|
|
30
24
|
const defaultScope = 'col';
|
|
31
25
|
const translationKeys = {
|
|
32
26
|
buttonDescription: 'carbon.table.header.icon.description'
|
|
@@ -53,7 +47,7 @@ const sortDirections = {
|
|
|
53
47
|
[sortStates.sortStates.ASC]: 'ascending',
|
|
54
48
|
[sortStates.sortStates.DESC]: 'descending'
|
|
55
49
|
};
|
|
56
|
-
const TableHeader = /*#__PURE__*/
|
|
50
|
+
const TableHeader = /*#__PURE__*/React.forwardRef(function TableHeader({
|
|
57
51
|
className: headerClassName,
|
|
58
52
|
children,
|
|
59
53
|
colSpan,
|
|
@@ -80,25 +74,25 @@ const TableHeader = /*#__PURE__*/React__default["default"].forwardRef(function T
|
|
|
80
74
|
size: 'mini',
|
|
81
75
|
ref: AILableRef
|
|
82
76
|
}) : null;
|
|
83
|
-
const headerLabelClassNames =
|
|
77
|
+
const headerLabelClassNames = cx({
|
|
84
78
|
[`${prefix}--table-header-label`]: true,
|
|
85
79
|
[`${prefix}--table-header-label--slug ${prefix}--table-header-label--ai-label`]: colHasAILabel,
|
|
86
80
|
[`${prefix}--table-header-label--decorator`]: decorator
|
|
87
81
|
});
|
|
88
82
|
if (!isSortable) {
|
|
89
|
-
return /*#__PURE__*/
|
|
83
|
+
return /*#__PURE__*/React.createElement("th", _rollupPluginBabelHelpers.extends({}, rest, {
|
|
90
84
|
id: id,
|
|
91
85
|
className: headerClassName,
|
|
92
86
|
scope: scope,
|
|
93
87
|
colSpan: colSpan,
|
|
94
88
|
ref: ref
|
|
95
|
-
}), children ? /*#__PURE__*/
|
|
89
|
+
}), children ? /*#__PURE__*/React.createElement("div", {
|
|
96
90
|
className: headerLabelClassNames
|
|
97
|
-
}, children, /*#__PURE__*/
|
|
91
|
+
}, children, /*#__PURE__*/React.createElement("div", {
|
|
98
92
|
className: `${prefix}--table-header-label--decorator-inner`
|
|
99
93
|
}, normalizedDecorator)) : null);
|
|
100
94
|
}
|
|
101
|
-
const className =
|
|
95
|
+
const className = cx(headerClassName, {
|
|
102
96
|
[`${prefix}--table-sort`]: true,
|
|
103
97
|
[`${prefix}--table-sort--active`]: isSortHeader && sortDirection !== sortStates.sortStates.NONE,
|
|
104
98
|
[`${prefix}--table-sort--descending`]: isSortHeader && sortDirection === sortStates.sortStates.DESC
|
|
@@ -110,7 +104,7 @@ const TableHeader = /*#__PURE__*/React__default["default"].forwardRef(function T
|
|
|
110
104
|
isSortHeader,
|
|
111
105
|
sortStates: sortStates.sortStates
|
|
112
106
|
});
|
|
113
|
-
const headerClasses =
|
|
107
|
+
const headerClasses = cx(headerClassName, `${prefix}--table-sort__header`, {
|
|
114
108
|
[`${prefix}--table-sort__header--ai-label`]: colHasAILabel,
|
|
115
109
|
[`${prefix}--table-sort__header--decorator`]: decorator
|
|
116
110
|
});
|
|
@@ -121,32 +115,32 @@ const TableHeader = /*#__PURE__*/React__default["default"].forwardRef(function T
|
|
|
121
115
|
return onClick(evt);
|
|
122
116
|
}
|
|
123
117
|
};
|
|
124
|
-
return /*#__PURE__*/
|
|
118
|
+
return /*#__PURE__*/React.createElement("th", {
|
|
125
119
|
id: id,
|
|
126
120
|
"aria-sort": ariaSort,
|
|
127
121
|
className: headerClasses,
|
|
128
122
|
colSpan: colSpan,
|
|
129
123
|
ref: ref,
|
|
130
124
|
scope: scope
|
|
131
|
-
}, /*#__PURE__*/
|
|
125
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
132
126
|
className: `${prefix}--table-sort__description`,
|
|
133
127
|
id: uniqueId
|
|
134
|
-
}, sortDescription), /*#__PURE__*/
|
|
128
|
+
}, sortDescription), /*#__PURE__*/React.createElement("button", _rollupPluginBabelHelpers.extends({
|
|
135
129
|
type: "button",
|
|
136
130
|
"aria-describedby": uniqueId,
|
|
137
131
|
className: className,
|
|
138
132
|
onClick: handleClick
|
|
139
|
-
}, rest), /*#__PURE__*/
|
|
133
|
+
}, rest), /*#__PURE__*/React.createElement("span", {
|
|
140
134
|
className: `${prefix}--table-sort__flex`
|
|
141
|
-
}, /*#__PURE__*/
|
|
135
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
142
136
|
className: `${prefix}--table-header-label`
|
|
143
|
-
}, children), /*#__PURE__*/
|
|
137
|
+
}, children), /*#__PURE__*/React.createElement(iconsReact.ArrowUp, {
|
|
144
138
|
size: 20,
|
|
145
139
|
className: `${prefix}--table-sort__icon`
|
|
146
|
-
}), /*#__PURE__*/
|
|
140
|
+
}), /*#__PURE__*/React.createElement(iconsReact.ArrowsVertical, {
|
|
147
141
|
size: 20,
|
|
148
142
|
className: `${prefix}--table-sort__icon-unsorted`
|
|
149
|
-
}), /*#__PURE__*/
|
|
143
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
150
144
|
className: `${prefix}--table-header-label--decorator-inner`
|
|
151
145
|
}, normalizedDecorator))));
|
|
152
146
|
});
|
|
@@ -154,52 +148,52 @@ TableHeader.propTypes = {
|
|
|
154
148
|
/**
|
|
155
149
|
* Pass in children that will be embedded in the table header label
|
|
156
150
|
*/
|
|
157
|
-
children:
|
|
151
|
+
children: PropTypes.node,
|
|
158
152
|
/**
|
|
159
153
|
* Specify an optional className to be applied to the container node
|
|
160
154
|
*/
|
|
161
|
-
className:
|
|
155
|
+
className: PropTypes.string,
|
|
162
156
|
/**
|
|
163
157
|
* Specify `colSpan` as a non-negative integer value to indicate how
|
|
164
158
|
* many columns the TableHeader cell extends in a table
|
|
165
159
|
*/
|
|
166
|
-
colSpan:
|
|
160
|
+
colSpan: PropTypes.number,
|
|
167
161
|
/**
|
|
168
162
|
* Supply an id to the th element.
|
|
169
163
|
*/
|
|
170
|
-
id:
|
|
164
|
+
id: PropTypes.string,
|
|
171
165
|
/**
|
|
172
166
|
* Specify whether this header is the header by which a table is being sorted
|
|
173
167
|
* by
|
|
174
168
|
*/
|
|
175
|
-
isSortHeader:
|
|
169
|
+
isSortHeader: PropTypes.bool,
|
|
176
170
|
/**
|
|
177
171
|
* Specify whether this header is one through which a user can sort the table
|
|
178
172
|
*/
|
|
179
|
-
isSortable:
|
|
173
|
+
isSortable: PropTypes.bool,
|
|
180
174
|
/**
|
|
181
175
|
* Hook that is invoked when the header is clicked
|
|
182
176
|
*/
|
|
183
|
-
onClick:
|
|
177
|
+
onClick: PropTypes.func,
|
|
184
178
|
/**
|
|
185
179
|
* Specify the scope of this table header. You can find more info about this
|
|
186
180
|
* attribute at the following URL:
|
|
187
181
|
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attr-scope
|
|
188
182
|
*/
|
|
189
|
-
scope:
|
|
183
|
+
scope: PropTypes.string,
|
|
190
184
|
/**
|
|
191
185
|
* Specify which direction we are currently sorting by, should be one of DESC,
|
|
192
186
|
* NONE, or ASC.
|
|
193
187
|
*/
|
|
194
|
-
sortDirection:
|
|
188
|
+
sortDirection: PropTypes.oneOf(Object.values(sortStates.sortStates)),
|
|
195
189
|
/**
|
|
196
190
|
* Supply a method to translate internal strings with your i18n tool of
|
|
197
191
|
* choice. Translation keys are available on the `translationKeys` field for
|
|
198
192
|
* this component.
|
|
199
193
|
*/
|
|
200
|
-
translateWithId:
|
|
194
|
+
translateWithId: PropTypes.func
|
|
201
195
|
};
|
|
202
196
|
TableHeader.translationKeys = Object.values(translationKeys);
|
|
203
197
|
TableHeader.displayName = 'TableHeader';
|
|
204
198
|
|
|
205
|
-
exports
|
|
199
|
+
exports.default = TableHeader;
|
|
@@ -19,31 +19,25 @@ var TableDecoratorRow = require('./TableDecoratorRow.js');
|
|
|
19
19
|
var index = require('../AILabel/index.js');
|
|
20
20
|
var utils = require('../../internal/utils.js');
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
25
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
26
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
27
|
-
|
|
28
|
-
const TableRow = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => {
|
|
22
|
+
const TableRow = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
29
23
|
const prefix = usePrefix.usePrefix();
|
|
30
24
|
let rowHasAILabel;
|
|
31
25
|
if (props?.children) {
|
|
32
26
|
// TODO: Why is this loop a `map`? It's not returning anything. Ideally,
|
|
33
27
|
// it seems that it should be a `some`. Maybe I'm missing something?
|
|
34
28
|
React.Children.toArray(props.children).map(child => {
|
|
35
|
-
if (utils.isComponentElement(child, TableSlugRow
|
|
29
|
+
if (utils.isComponentElement(child, TableSlugRow.default)) {
|
|
36
30
|
if (child.props.slug) {
|
|
37
31
|
rowHasAILabel = true;
|
|
38
32
|
}
|
|
39
|
-
} else if (utils.isComponentElement(child, TableDecoratorRow
|
|
33
|
+
} else if (utils.isComponentElement(child, TableDecoratorRow.default) && utils.isComponentElement(child.props.decorator, index.AILabel)) {
|
|
40
34
|
rowHasAILabel = true;
|
|
41
35
|
}
|
|
42
36
|
});
|
|
43
37
|
}
|
|
44
38
|
// Remove unnecessary props if provided to this component, these are
|
|
45
39
|
// only useful in `TableExpandRow`
|
|
46
|
-
const className =
|
|
40
|
+
const className = cx(props.className, {
|
|
47
41
|
[`${prefix}--data-table--selected`]: props.isSelected,
|
|
48
42
|
[`${prefix}--data-table--slug-row ${prefix}--data-table--ai-label-row`]: rowHasAILabel
|
|
49
43
|
});
|
|
@@ -59,7 +53,7 @@ const TableRow = /*#__PURE__*/React__default["default"].forwardRef((props, ref)
|
|
|
59
53
|
if (className) {
|
|
60
54
|
cleanProps.className = className;
|
|
61
55
|
}
|
|
62
|
-
return /*#__PURE__*/
|
|
56
|
+
return /*#__PURE__*/React.createElement("tr", _rollupPluginBabelHelpers.extends({
|
|
63
57
|
ref: ref
|
|
64
58
|
}, cleanProps));
|
|
65
59
|
});
|
|
@@ -67,11 +61,11 @@ TableRow.propTypes = {
|
|
|
67
61
|
/**
|
|
68
62
|
* Specify an optional className to be applied to the container node
|
|
69
63
|
*/
|
|
70
|
-
className:
|
|
64
|
+
className: PropTypes.string,
|
|
71
65
|
/**
|
|
72
66
|
* Specify if the row is selected
|
|
73
67
|
*/
|
|
74
|
-
isSelected:
|
|
68
|
+
isSelected: PropTypes.bool
|
|
75
69
|
};
|
|
76
70
|
|
|
77
|
-
exports
|
|
71
|
+
exports.default = TableRow;
|
|
@@ -16,12 +16,6 @@ var cx = require('classnames');
|
|
|
16
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
17
|
var deprecate = require('../../prop-types/deprecate.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
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
24
|
-
|
|
25
19
|
const TableSelectAll = ({
|
|
26
20
|
ariaLabel: deprecatedAriaLabel = 'Select all rows in the table',
|
|
27
21
|
['aria-label']: ariaLabel,
|
|
@@ -34,11 +28,11 @@ const TableSelectAll = ({
|
|
|
34
28
|
className
|
|
35
29
|
}) => {
|
|
36
30
|
const prefix = usePrefix.usePrefix();
|
|
37
|
-
return /*#__PURE__*/
|
|
31
|
+
return /*#__PURE__*/React.createElement("th", {
|
|
38
32
|
"aria-live": "off",
|
|
39
33
|
scope: "col",
|
|
40
|
-
className:
|
|
41
|
-
}, /*#__PURE__*/
|
|
34
|
+
className: cx(`${prefix}--table-column-checkbox`, className)
|
|
35
|
+
}, /*#__PURE__*/React.createElement(InlineCheckbox.default, {
|
|
42
36
|
"aria-label": ariaLabel || deprecatedAriaLabel,
|
|
43
37
|
checked: checked,
|
|
44
38
|
id: id,
|
|
@@ -52,40 +46,40 @@ TableSelectAll.propTypes = {
|
|
|
52
46
|
/**
|
|
53
47
|
* Specify the aria label for the underlying input control
|
|
54
48
|
*/
|
|
55
|
-
['aria-label']:
|
|
49
|
+
['aria-label']: PropTypes.string,
|
|
56
50
|
/**
|
|
57
51
|
* Deprecated, please use `aria-label` instead.
|
|
58
52
|
* Specify the aria label for the underlying input control
|
|
59
53
|
*/
|
|
60
|
-
ariaLabel: deprecate.deprecate(
|
|
54
|
+
ariaLabel: deprecate.deprecate(PropTypes.string, 'This prop syntax has been deprecated. Please use the new `aria-label`.'),
|
|
61
55
|
/**
|
|
62
56
|
* Specify whether all items are selected, or not
|
|
63
57
|
*/
|
|
64
|
-
checked:
|
|
58
|
+
checked: PropTypes.bool,
|
|
65
59
|
/**
|
|
66
60
|
* The CSS class names of the cell that wraps the underlying input control
|
|
67
61
|
*/
|
|
68
|
-
className:
|
|
62
|
+
className: PropTypes.string,
|
|
69
63
|
/**
|
|
70
64
|
* Specify whether the checkbox input should be disabled
|
|
71
65
|
*/
|
|
72
|
-
disabled:
|
|
66
|
+
disabled: PropTypes.bool,
|
|
73
67
|
/**
|
|
74
68
|
* Provide an `id` for the underlying input control
|
|
75
69
|
*/
|
|
76
|
-
id:
|
|
70
|
+
id: PropTypes.string.isRequired,
|
|
77
71
|
/**
|
|
78
72
|
* Specify whether the selection only has a subset of all items
|
|
79
73
|
*/
|
|
80
|
-
indeterminate:
|
|
74
|
+
indeterminate: PropTypes.bool,
|
|
81
75
|
/**
|
|
82
76
|
* Provide a `name` for the underlying input control
|
|
83
77
|
*/
|
|
84
|
-
name:
|
|
78
|
+
name: PropTypes.string.isRequired,
|
|
85
79
|
/**
|
|
86
80
|
* Provide a handler to listen to when a user initiates a selection request
|
|
87
81
|
*/
|
|
88
|
-
onSelect:
|
|
82
|
+
onSelect: PropTypes.func.isRequired
|
|
89
83
|
};
|
|
90
84
|
|
|
91
|
-
exports
|
|
85
|
+
exports.default = TableSelectAll;
|