@carbon/react 1.112.0 → 1.113.0-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 +941 -941
- package/es/components/AILabel/index.js +6 -6
- package/es/components/AISkeleton/AISkeletonIcon.js +2 -2
- package/es/components/AISkeleton/AISkeletonPlaceholder.js +2 -2
- package/es/components/AISkeleton/AISkeletonText.js +2 -2
- package/es/components/Accordion/Accordion.Skeleton.js +3 -3
- package/es/components/Accordion/Accordion.js +2 -2
- package/es/components/Accordion/AccordionItem.js +2 -2
- package/es/components/AspectRatio/AspectRatio.js +2 -2
- package/es/components/BadgeIndicator/index.js +4 -4
- package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +3 -3
- package/es/components/Breadcrumb/Breadcrumb.js +2 -2
- package/es/components/Breadcrumb/BreadcrumbItem.js +3 -3
- package/es/components/Button/Button.Skeleton.js +3 -3
- package/es/components/Button/Button.js +2 -2
- package/es/components/Button/ButtonBase.js +2 -2
- package/es/components/Button/index.js +3 -3
- package/es/components/ButtonSet/ButtonSet.js +3 -3
- package/es/components/ButtonSet/index.js +1 -1
- package/es/components/ChatButton/ChatButton.Skeleton.js +2 -2
- package/es/components/ChatButton/ChatButton.js +3 -3
- package/es/components/Checkbox/Checkbox.Skeleton.js +3 -3
- package/es/components/Checkbox/Checkbox.js +4 -4
- package/es/components/Checkbox/index.js +2 -2
- package/es/components/CheckboxGroup/CheckboxGroup.js +2 -2
- package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +3 -3
- package/es/components/CodeSnippet/CodeSnippet.js +2 -2
- package/es/components/ComboBox/ComboBox.js +12 -9
- package/es/components/ComboBox/index.js +1 -1
- package/es/components/ComboButton/index.js +5 -5
- package/es/components/ComposedModal/ComposedModal.js +7 -6
- package/es/components/ComposedModal/ComposedModalPresence.js +5 -2
- package/es/components/ComposedModal/ModalFooter.js +4 -4
- package/es/components/ComposedModal/ModalHeader.js +6 -6
- package/es/components/ContainedList/ContainedList.js +2 -2
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +2 -2
- package/es/components/ContainedList/ContainedListItem/index.js +1 -1
- package/es/components/ContentSwitcher/ContentSwitcher.js +2 -2
- package/es/components/Copy/Copy.js +4 -4
- package/es/components/Copy/index.js +1 -1
- package/es/components/CopyButton/CopyButton.js +3 -3
- package/es/components/CopyButton/index.js +1 -1
- package/es/components/DataTable/DataTable.js +4 -3
- package/es/components/DataTable/Table.js +3 -3
- package/es/components/DataTable/TableBatchActions.js +3 -3
- package/es/components/DataTable/TableCell.js +2 -2
- package/es/components/DataTable/TableContainer.js +3 -3
- package/es/components/DataTable/TableDecoratorRow.js +2 -2
- package/es/components/DataTable/TableExpandHeader.js +2 -2
- package/es/components/DataTable/TableExpandRow.js +2 -2
- package/es/components/DataTable/TableExpandedRow.js +2 -2
- package/es/components/DataTable/TableHeader.js +4 -4
- package/es/components/DataTable/TableRow.js +2 -2
- package/es/components/DataTable/TableSelectAll.js +2 -2
- package/es/components/DataTable/TableSelectRow.js +2 -2
- package/es/components/DataTable/TableSlugRow.js +2 -2
- package/es/components/DataTable/TableToolbar.js +3 -3
- package/es/components/DataTable/TableToolbarMenu.js +4 -4
- package/es/components/DataTable/TableToolbarSearch.js +3 -3
- package/es/components/DataTable/state/sorting.js +3 -2
- package/es/components/DataTable/tools/sorting.js +1 -1
- package/es/components/DataTableSkeleton/DataTableSkeleton.js +2 -2
- package/es/components/DatePicker/DatePicker.Skeleton.js +4 -4
- package/es/components/DatePicker/DatePicker.js +3 -3
- package/es/components/DatePicker/index.js +2 -2
- package/es/components/DatePickerInput/DatePickerInput.js +7 -7
- package/es/components/DatePickerInput/index.js +1 -1
- package/es/components/Dialog/Dialog.js +9 -9
- package/es/components/Dialog/index.js +1 -1
- package/es/components/Dropdown/Dropdown.Skeleton.js +4 -4
- package/es/components/Dropdown/Dropdown.js +5 -5
- package/es/components/Dropdown/index.js +2 -2
- package/es/components/ExpandableSearch/ExpandableSearch.js +2 -2
- package/es/components/ExpandableSearch/index.js +1 -1
- package/es/components/FileUploader/FileUploader.Skeleton.js +4 -4
- package/es/components/FileUploader/FileUploader.js +11 -8
- package/es/components/FileUploader/FileUploaderButton.js +3 -3
- package/es/components/FileUploader/FileUploaderDropContainer.js +8 -6
- package/es/components/FileUploader/FileUploaderItem.js +3 -3
- package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +2 -2
- package/es/components/FluidComboBox/FluidComboBox.js +3 -3
- package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +3 -3
- package/es/components/FluidDatePicker/FluidDatePicker.js +3 -3
- package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +2 -2
- package/es/components/FluidDropdown/FluidDropdown.js +3 -3
- package/es/components/FluidForm/FluidForm.js +3 -3
- package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +2 -2
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +4 -4
- package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.js +2 -2
- package/es/components/FluidNumberInput/FluidNumberInput.js +3 -3
- package/es/components/FluidSearch/FluidSearch.Skeleton.js +2 -2
- package/es/components/FluidSearch/FluidSearch.js +3 -3
- package/es/components/FluidSelect/FluidSelect.Skeleton.js +2 -2
- package/es/components/FluidSelect/FluidSelect.js +3 -3
- package/es/components/FluidSelect/index.js +2 -2
- package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +2 -2
- package/es/components/FluidTextArea/FluidTextArea.js +3 -3
- package/es/components/FluidTextInput/FluidPasswordInput.js +3 -3
- package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +2 -2
- package/es/components/FluidTextInput/FluidTextInput.js +4 -4
- package/es/components/FluidTextInput/index.js +3 -3
- package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +2 -2
- package/es/components/FluidTimePicker/FluidTimePicker.js +3 -3
- package/es/components/FluidTimePickerSelect/index.js +1 -1
- package/es/components/Form/Form.js +2 -2
- package/es/components/FormGroup/FormGroup.js +2 -2
- package/es/components/FormItem/FormItem.js +2 -2
- package/es/components/FormLabel/FormLabel.js +2 -2
- package/es/components/Grid/CSSGrid.js +4 -4
- package/es/components/Grid/Column.js +3 -3
- package/es/components/Grid/ColumnHang.js +3 -3
- package/es/components/Grid/FlexGrid.js +3 -3
- package/es/components/Grid/Grid.js +3 -3
- package/es/components/Grid/Row.js +2 -2
- package/es/components/Icon/Icon.Skeleton.js +3 -3
- package/es/components/IconButton/index.js +4 -3
- package/es/components/IconIndicator/index.js +4 -4
- package/es/components/InlineCheckbox/index.js +1 -1
- package/es/components/InlineLoading/InlineLoading.js +2 -2
- package/es/components/InlineLoading/index.js +1 -1
- package/es/components/Layer/LayerLevel.js +1 -1
- package/es/components/Layer/index.js +2 -2
- package/es/components/Layout/index.js +3 -3
- package/es/components/LayoutDirection/LayoutDirection.js +1 -1
- package/es/components/Link/Link.js +2 -2
- package/es/components/Link/index.js +1 -1
- package/es/components/ListBox/ListBox.js +2 -2
- package/es/components/ListBox/ListBoxMenuIcon.js +2 -2
- package/es/components/ListBox/ListBoxMenuItem.js +4 -3
- package/es/components/ListBox/ListBoxSelection.js +3 -3
- package/es/components/ListBox/index.js +2 -2
- package/es/components/ListBox/next/ListBoxSelection.js +3 -3
- package/es/components/ListBox/next/ListBoxTrigger.js +2 -2
- package/es/components/ListItem/ListItem.js +2 -2
- package/es/components/Loading/Loading.js +3 -3
- package/es/components/Loading/index.js +1 -1
- package/es/components/Menu/Menu.js +3 -3
- package/es/components/Menu/MenuItem.js +9 -9
- package/es/components/MenuButton/index.js +4 -4
- package/es/components/Modal/Modal.js +9 -9
- package/es/components/Modal/ModalPresence.js +5 -2
- package/es/components/Modal/index.js +2 -2
- package/es/components/ModalWrapper/ModalWrapper.js +2 -2
- package/es/components/MultiSelect/FilterableMultiSelect.js +10 -8
- package/es/components/MultiSelect/MultiSelect.js +7 -7
- package/es/components/Notification/Notification.js +10 -10
- package/es/components/NumberInput/NumberInput.Skeleton.js +2 -2
- package/es/components/NumberInput/NumberInput.js +21 -11
- package/es/components/OrderedList/OrderedList.js +2 -2
- package/es/components/OverflowMenu/OverflowMenu.js +7 -7
- package/es/components/OverflowMenu/index.js +2 -2
- package/es/components/OverflowMenu/next/index.js +4 -4
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +4 -4
- package/es/components/OverflowMenuItem/index.js +1 -1
- package/es/components/OverflowMenuV2/index.js +1 -1
- package/es/components/PageHeader/PageHeader.js +15 -15
- package/es/components/PageHeader/index.js +1 -1
- package/es/components/Pagination/Pagination.Skeleton.js +3 -3
- package/es/components/Pagination/Pagination.d.ts +18 -1
- package/es/components/Pagination/Pagination.js +33 -8
- package/es/components/Pagination/experimental/PageSelector.d.ts +4 -0
- package/es/components/Pagination/experimental/PageSelector.js +16 -3
- package/es/components/Pagination/experimental/Pagination-story.d.ts +100 -65
- package/es/components/Pagination/experimental/Pagination.d.ts +4 -0
- package/es/components/Pagination/experimental/Pagination.js +12 -5
- package/es/components/PaginationNav/PaginationNav.js +8 -6
- package/es/components/Popover/index.js +14 -6
- package/es/components/ProgressBar/ProgressBar.js +3 -3
- package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +3 -3
- package/es/components/ProgressIndicator/ProgressIndicator.js +4 -4
- package/es/components/RadioButton/RadioButton.Skeleton.js +3 -3
- package/es/components/RadioButton/RadioButton.js +3 -3
- package/es/components/RadioButton/index.js +1 -1
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +4 -4
- package/es/components/RadioTile/RadioTile.js +3 -3
- package/es/components/RadioTile/index.js +1 -1
- package/es/components/Search/Search.Skeleton.js +3 -3
- package/es/components/Search/Search.js +4 -4
- package/es/components/Search/index.js +2 -2
- package/es/components/Select/Select.Skeleton.js +3 -3
- package/es/components/Select/Select.js +6 -6
- package/es/components/Select/index.js +2 -2
- package/es/components/SelectItem/SelectItem.js +2 -2
- package/es/components/SelectItem/index.js +1 -1
- package/es/components/SelectItemGroup/SelectItemGroup.js +2 -2
- package/es/components/ShapeIndicator/index.js +4 -4
- package/es/components/SkeletonIcon/SkeletonIcon.js +2 -2
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +2 -2
- package/es/components/SkeletonText/SkeletonText.js +2 -2
- package/es/components/SkeletonText/index.js +1 -1
- package/es/components/Slider/Slider.Skeleton.js +7 -7
- package/es/components/Slider/Slider.js +22 -20
- package/es/components/Stack/Stack.js +2 -2
- package/es/components/StructuredList/StructuredList.Skeleton.js +3 -3
- package/es/components/StructuredList/StructuredList.js +7 -7
- package/es/components/Switch/IconSwitch.js +6 -5
- package/es/components/Switch/Switch.js +3 -3
- package/es/components/TabContent/TabContent.js +2 -2
- package/es/components/Tabs/Tabs.Skeleton.js +3 -3
- package/es/components/Tabs/Tabs.js +45 -33
- package/es/components/Tag/DismissibleTag.js +4 -3
- package/es/components/Tag/OperationalTag.js +4 -3
- package/es/components/Tag/SelectableTag.js +3 -3
- package/es/components/Tag/Tag.Skeleton.js +3 -3
- package/es/components/Tag/Tag.js +4 -3
- package/es/components/TextArea/TextArea.Skeleton.js +3 -3
- package/es/components/TextArea/TextArea.js +8 -8
- package/es/components/TextArea/index.js +2 -2
- package/es/components/TextInput/ControlledPasswordInput.js +6 -6
- package/es/components/TextInput/PasswordInput.js +10 -10
- package/es/components/TextInput/TextInput.Skeleton.js +3 -3
- package/es/components/TextInput/TextInput.js +9 -9
- package/es/components/TextInput/index.js +2 -2
- package/es/components/Theme/index.js +2 -2
- package/es/components/Tile/Tile.js +14 -11
- package/es/components/TileGroup/TileGroup.js +1 -1
- package/es/components/TimePicker/TimePicker.js +5 -5
- package/es/components/TimePickerSelect/TimePickerSelect.js +2 -2
- package/es/components/Toggle/Toggle.Skeleton.js +3 -3
- package/es/components/Toggle/Toggle.js +6 -6
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +2 -2
- package/es/components/Toggletip/index.js +6 -6
- package/es/components/Tooltip/DefinitionTooltip.js +2 -2
- package/es/components/Tooltip/Tooltip.d.ts +2 -1
- package/es/components/Tooltip/Tooltip.js +5 -4
- package/es/components/TreeView/TreeNode.js +11 -8
- package/es/components/TreeView/TreeView.js +2 -2
- package/es/components/UIShell/Content.js +2 -2
- package/es/components/UIShell/Header.js +2 -2
- package/es/components/UIShell/HeaderGlobalAction.js +2 -2
- package/es/components/UIShell/HeaderMenu.js +4 -4
- package/es/components/UIShell/HeaderMenuButton.js +2 -2
- package/es/components/UIShell/HeaderMenuItem.js +2 -2
- package/es/components/UIShell/HeaderName.js +2 -2
- package/es/components/UIShell/HeaderNavigation.js +2 -2
- package/es/components/UIShell/HeaderPanel.js +3 -3
- package/es/components/UIShell/HeaderSideNavItems.js +2 -2
- package/es/components/UIShell/SideNav.js +3 -3
- package/es/components/UIShell/SideNavDetails.js +2 -2
- package/es/components/UIShell/SideNavDivider.js +2 -2
- package/es/components/UIShell/SideNavFooter.js +2 -2
- package/es/components/UIShell/SideNavHeader.js +2 -2
- package/es/components/UIShell/SideNavIcon.js +2 -2
- package/es/components/UIShell/SideNavItem.js +2 -2
- package/es/components/UIShell/SideNavItems.js +2 -2
- package/es/components/UIShell/SideNavLink.js +2 -2
- package/es/components/UIShell/SideNavLinkText.js +2 -2
- package/es/components/UIShell/SideNavMenu.js +3 -3
- package/es/components/UIShell/SideNavMenuItem.js +3 -3
- package/es/components/UIShell/SideNavSwitcher.js +2 -2
- package/es/components/UIShell/SkipToContent.js +2 -2
- package/es/components/UIShell/Switcher.js +2 -2
- package/es/components/UIShell/SwitcherDivider.js +3 -3
- package/es/components/UIShell/SwitcherItem.js +4 -4
- package/es/components/UnorderedList/UnorderedList.js +2 -2
- package/es/index.js +30 -30
- package/es/internal/FloatingMenu.js +12 -9
- package/es/internal/motion/MotionSurface.d.ts +35 -0
- package/es/internal/motion/useMotionEnabled.d.ts +13 -0
- package/es/internal/motion/useMotionSurface.d.ts +33 -0
- package/es/internal/useId.js +1 -1
- package/es/internal/useOverflowItems.js +2 -1
- package/es/internal/usePresence.d.ts +8 -1
- package/es/internal/usePresence.js +4 -2
- package/es/internal/usePresenceContext.d.ts +12 -0
- package/es/internal/usePresenceContext.js +23 -5
- package/es/tools/wrapComponent.js +2 -2
- package/lib/components/AILabel/index.js +4 -4
- package/lib/components/AISkeleton/AISkeletonIcon.js +2 -2
- package/lib/components/AISkeleton/AISkeletonPlaceholder.js +2 -2
- package/lib/components/AISkeleton/AISkeletonText.js +2 -2
- package/lib/components/Accordion/Accordion.Skeleton.js +3 -2
- package/lib/components/Accordion/Accordion.js +2 -2
- package/lib/components/Accordion/AccordionItem.js +2 -2
- package/lib/components/AspectRatio/AspectRatio.js +2 -2
- package/lib/components/BadgeIndicator/index.js +3 -2
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +3 -2
- package/lib/components/Breadcrumb/Breadcrumb.js +2 -2
- package/lib/components/Breadcrumb/BreadcrumbItem.js +2 -2
- package/lib/components/Button/Button.Skeleton.js +3 -2
- package/lib/components/Button/Button.js +2 -2
- package/lib/components/Button/ButtonBase.js +2 -2
- package/lib/components/Button/index.js +7 -1
- package/lib/components/ButtonSet/ButtonSet.js +2 -2
- package/lib/components/ButtonSet/index.js +3 -1
- package/lib/components/ChatButton/ChatButton.Skeleton.js +2 -2
- package/lib/components/ChatButton/ChatButton.js +2 -2
- package/lib/components/Checkbox/Checkbox.Skeleton.js +3 -2
- package/lib/components/Checkbox/Checkbox.js +3 -3
- package/lib/components/Checkbox/index.js +3 -1
- package/lib/components/CheckboxGroup/CheckboxGroup.js +2 -2
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +3 -2
- package/lib/components/CodeSnippet/CodeSnippet.js +2 -2
- package/lib/components/ComboBox/ComboBox.js +8 -5
- package/lib/components/ComboBox/index.js +3 -1
- package/lib/components/ComboButton/index.js +2 -2
- package/lib/components/ComposedModal/ComposedModal.js +5 -4
- package/lib/components/ComposedModal/ComposedModalPresence.js +4 -1
- package/lib/components/ComposedModal/ModalFooter.js +3 -3
- package/lib/components/ComposedModal/ModalHeader.js +2 -2
- package/lib/components/ContainedList/ContainedList.js +2 -2
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +2 -2
- package/lib/components/ContainedList/ContainedListItem/index.js +3 -1
- package/lib/components/ContentSwitcher/ContentSwitcher.js +2 -2
- package/lib/components/Copy/Copy.js +3 -3
- package/lib/components/Copy/index.js +3 -1
- package/lib/components/CopyButton/CopyButton.js +3 -3
- package/lib/components/CopyButton/index.js +3 -1
- package/lib/components/DataTable/DataTable.js +4 -3
- package/lib/components/DataTable/Table.js +3 -2
- package/lib/components/DataTable/TableBatchActions.js +2 -2
- package/lib/components/DataTable/TableCell.js +2 -2
- package/lib/components/DataTable/TableContainer.js +2 -2
- package/lib/components/DataTable/TableDecoratorRow.js +2 -2
- package/lib/components/DataTable/TableExpandHeader.js +2 -2
- package/lib/components/DataTable/TableExpandRow.js +2 -2
- package/lib/components/DataTable/TableExpandedRow.js +2 -2
- package/lib/components/DataTable/TableHeader.js +2 -2
- package/lib/components/DataTable/TableRow.js +2 -2
- package/lib/components/DataTable/TableSelectAll.js +2 -2
- package/lib/components/DataTable/TableSelectRow.js +2 -2
- package/lib/components/DataTable/TableSlugRow.js +2 -2
- package/lib/components/DataTable/TableToolbar.js +3 -2
- package/lib/components/DataTable/TableToolbarMenu.js +3 -3
- package/lib/components/DataTable/TableToolbarSearch.js +3 -3
- package/lib/components/DataTable/state/sorting.js +3 -1
- package/lib/components/DataTable/tools/sorting.js +2 -0
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +2 -2
- package/lib/components/DatePicker/DatePicker.Skeleton.js +3 -2
- package/lib/components/DatePicker/DatePicker.js +2 -2
- package/lib/components/DatePicker/index.js +3 -1
- package/lib/components/DatePickerInput/DatePickerInput.js +3 -3
- package/lib/components/DatePickerInput/index.js +3 -1
- package/lib/components/Dialog/Dialog.js +3 -3
- package/lib/components/Dialog/index.js +8 -0
- package/lib/components/Dropdown/Dropdown.Skeleton.js +3 -2
- package/lib/components/Dropdown/Dropdown.js +2 -2
- package/lib/components/Dropdown/index.js +3 -1
- package/lib/components/ExpandableSearch/ExpandableSearch.js +2 -2
- package/lib/components/ExpandableSearch/index.js +3 -1
- package/lib/components/FileUploader/FileUploader.Skeleton.js +4 -3
- package/lib/components/FileUploader/FileUploader.js +9 -6
- package/lib/components/FileUploader/FileUploaderButton.js +3 -3
- package/lib/components/FileUploader/FileUploaderDropContainer.js +8 -6
- package/lib/components/FileUploader/FileUploaderItem.js +3 -3
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +2 -2
- package/lib/components/FluidComboBox/FluidComboBox.js +2 -2
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +2 -2
- package/lib/components/FluidDatePicker/FluidDatePicker.js +2 -2
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +2 -2
- package/lib/components/FluidDropdown/FluidDropdown.js +2 -2
- package/lib/components/FluidForm/FluidForm.js +2 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +2 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +2 -2
- package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +2 -2
- package/lib/components/FluidNumberInput/FluidNumberInput.js +2 -2
- package/lib/components/FluidSearch/FluidSearch.Skeleton.js +2 -2
- package/lib/components/FluidSearch/FluidSearch.js +2 -2
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +2 -2
- package/lib/components/FluidSelect/FluidSelect.js +2 -2
- package/lib/components/FluidSelect/index.js +3 -1
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +2 -2
- package/lib/components/FluidTextArea/FluidTextArea.js +2 -2
- package/lib/components/FluidTextInput/FluidPasswordInput.js +2 -2
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +2 -2
- package/lib/components/FluidTextInput/FluidTextInput.js +2 -2
- package/lib/components/FluidTextInput/index.js +5 -2
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +2 -2
- package/lib/components/FluidTimePicker/FluidTimePicker.js +2 -2
- package/lib/components/FluidTimePickerSelect/index.js +3 -1
- package/lib/components/Form/Form.js +2 -2
- package/lib/components/FormGroup/FormGroup.js +2 -2
- package/lib/components/FormItem/FormItem.js +2 -2
- package/lib/components/FormLabel/FormLabel.js +2 -2
- package/lib/components/Grid/CSSGrid.js +3 -3
- package/lib/components/Grid/Column.js +2 -2
- package/lib/components/Grid/ColumnHang.js +3 -3
- package/lib/components/Grid/FlexGrid.js +3 -3
- package/lib/components/Grid/Grid.js +3 -3
- package/lib/components/Grid/Row.js +2 -2
- package/lib/components/Icon/Icon.Skeleton.js +3 -2
- package/lib/components/IconButton/index.js +4 -3
- package/lib/components/IconIndicator/index.js +4 -2
- package/lib/components/InlineCheckbox/index.js +3 -1
- package/lib/components/InlineLoading/InlineLoading.js +2 -2
- package/lib/components/InlineLoading/index.js +3 -1
- package/lib/components/Layer/LayerLevel.js +1 -0
- package/lib/components/Layer/index.js +2 -2
- package/lib/components/Layout/index.js +2 -2
- package/lib/components/LayoutDirection/LayoutDirection.js +1 -0
- package/lib/components/Link/Link.js +2 -2
- package/lib/components/Link/index.js +3 -1
- package/lib/components/ListBox/ListBox.js +2 -2
- package/lib/components/ListBox/ListBoxMenuIcon.js +2 -2
- package/lib/components/ListBox/ListBoxMenuItem.js +4 -3
- package/lib/components/ListBox/ListBoxSelection.js +2 -2
- package/lib/components/ListBox/index.js +3 -1
- package/lib/components/ListBox/next/ListBoxSelection.js +2 -2
- package/lib/components/ListBox/next/ListBoxTrigger.js +2 -2
- package/lib/components/ListItem/ListItem.js +2 -2
- package/lib/components/Loading/Loading.js +2 -2
- package/lib/components/Loading/index.js +3 -1
- package/lib/components/Menu/Menu.js +2 -2
- package/lib/components/Menu/MenuItem.js +2 -2
- package/lib/components/MenuButton/index.js +2 -2
- package/lib/components/Modal/Modal.js +5 -4
- package/lib/components/Modal/ModalPresence.js +4 -1
- package/lib/components/Modal/index.js +6 -2
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.js +6 -4
- package/lib/components/MultiSelect/MultiSelect.js +3 -3
- package/lib/components/Notification/Notification.js +4 -4
- package/lib/components/NumberInput/NumberInput.Skeleton.js +2 -2
- package/lib/components/NumberInput/NumberInput.js +16 -5
- package/lib/components/OrderedList/OrderedList.js +2 -2
- package/lib/components/OverflowMenu/OverflowMenu.js +5 -3
- package/lib/components/OverflowMenu/index.js +3 -2
- package/lib/components/OverflowMenu/next/index.js +2 -2
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +3 -3
- package/lib/components/OverflowMenuItem/index.js +3 -1
- package/lib/components/OverflowMenuV2/index.js +1 -1
- package/lib/components/PageHeader/PageHeader.js +5 -5
- package/lib/components/PageHeader/index.js +14 -0
- package/lib/components/Pagination/Pagination.Skeleton.js +3 -2
- package/lib/components/Pagination/Pagination.d.ts +18 -1
- package/lib/components/Pagination/Pagination.js +31 -6
- package/lib/components/Pagination/experimental/PageSelector.d.ts +4 -0
- package/lib/components/Pagination/experimental/PageSelector.js +9 -2
- package/lib/components/Pagination/experimental/Pagination-story.d.ts +100 -65
- package/lib/components/Pagination/experimental/Pagination.d.ts +4 -0
- package/lib/components/Pagination/experimental/Pagination.js +9 -2
- package/lib/components/PaginationNav/PaginationNav.js +6 -4
- package/lib/components/Popover/index.js +10 -2
- package/lib/components/ProgressBar/ProgressBar.js +2 -2
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +3 -2
- package/lib/components/ProgressIndicator/ProgressIndicator.js +2 -2
- package/lib/components/RadioButton/RadioButton.Skeleton.js +3 -2
- package/lib/components/RadioButton/RadioButton.js +2 -2
- package/lib/components/RadioButton/index.js +3 -1
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +2 -2
- package/lib/components/RadioTile/RadioTile.js +3 -3
- package/lib/components/RadioTile/index.js +3 -1
- package/lib/components/Search/Search.Skeleton.js +3 -2
- package/lib/components/Search/Search.js +3 -3
- package/lib/components/Search/index.js +3 -1
- package/lib/components/Select/Select.Skeleton.js +3 -2
- package/lib/components/Select/Select.js +2 -2
- package/lib/components/Select/index.js +3 -1
- package/lib/components/SelectItem/SelectItem.js +2 -2
- package/lib/components/SelectItem/index.js +3 -1
- package/lib/components/SelectItemGroup/SelectItemGroup.js +2 -2
- package/lib/components/ShapeIndicator/index.js +4 -2
- package/lib/components/SkeletonIcon/SkeletonIcon.js +2 -2
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +2 -2
- package/lib/components/SkeletonText/SkeletonText.js +2 -2
- package/lib/components/SkeletonText/index.js +3 -1
- package/lib/components/Slider/Slider.Skeleton.js +2 -2
- package/lib/components/Slider/Slider.js +8 -6
- package/lib/components/Stack/Stack.js +2 -2
- package/lib/components/StructuredList/StructuredList.Skeleton.js +2 -2
- package/lib/components/StructuredList/StructuredList.js +2 -2
- package/lib/components/Switch/IconSwitch.js +5 -4
- package/lib/components/Switch/Switch.js +3 -3
- package/lib/components/TabContent/TabContent.js +2 -2
- package/lib/components/Tabs/Tabs.Skeleton.js +3 -2
- package/lib/components/Tabs/Tabs.js +35 -23
- package/lib/components/Tag/DismissibleTag.js +3 -2
- package/lib/components/Tag/OperationalTag.js +3 -2
- package/lib/components/Tag/SelectableTag.js +2 -2
- package/lib/components/Tag/Tag.Skeleton.js +3 -2
- package/lib/components/Tag/Tag.js +3 -2
- package/lib/components/TextArea/TextArea.Skeleton.js +3 -2
- package/lib/components/TextArea/TextArea.js +3 -3
- package/lib/components/TextArea/index.js +3 -1
- package/lib/components/TextInput/ControlledPasswordInput.js +3 -3
- package/lib/components/TextInput/PasswordInput.js +2 -2
- package/lib/components/TextInput/TextInput.Skeleton.js +3 -2
- package/lib/components/TextInput/TextInput.js +2 -2
- package/lib/components/TextInput/index.js +3 -1
- package/lib/components/Theme/index.js +2 -2
- package/lib/components/Tile/Tile.js +7 -4
- package/lib/components/TileGroup/TileGroup.js +1 -1
- package/lib/components/TimePicker/TimePicker.js +2 -2
- package/lib/components/TimePickerSelect/TimePickerSelect.js +2 -2
- package/lib/components/Toggle/Toggle.Skeleton.js +3 -2
- package/lib/components/Toggle/Toggle.js +3 -2
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +2 -2
- package/lib/components/Toggletip/index.js +4 -3
- package/lib/components/Tooltip/DefinitionTooltip.js +2 -2
- package/lib/components/Tooltip/Tooltip.d.ts +2 -1
- package/lib/components/Tooltip/Tooltip.js +5 -4
- package/lib/components/TreeView/TreeNode.js +8 -5
- package/lib/components/TreeView/TreeView.js +2 -2
- package/lib/components/UIShell/Content.js +2 -2
- package/lib/components/UIShell/Header.js +2 -2
- package/lib/components/UIShell/HeaderGlobalAction.js +2 -2
- package/lib/components/UIShell/HeaderMenu.js +3 -2
- package/lib/components/UIShell/HeaderMenuButton.js +2 -2
- package/lib/components/UIShell/HeaderMenuItem.js +2 -2
- package/lib/components/UIShell/HeaderName.js +2 -2
- package/lib/components/UIShell/HeaderNavigation.js +2 -2
- package/lib/components/UIShell/HeaderPanel.js +3 -3
- package/lib/components/UIShell/HeaderSideNavItems.js +2 -2
- package/lib/components/UIShell/SideNav.js +2 -2
- package/lib/components/UIShell/SideNavDetails.js +2 -2
- package/lib/components/UIShell/SideNavDivider.js +2 -2
- package/lib/components/UIShell/SideNavFooter.js +2 -2
- package/lib/components/UIShell/SideNavHeader.js +2 -2
- package/lib/components/UIShell/SideNavIcon.js +2 -2
- package/lib/components/UIShell/SideNavItem.js +2 -2
- package/lib/components/UIShell/SideNavItems.js +2 -2
- package/lib/components/UIShell/SideNavLink.js +2 -2
- package/lib/components/UIShell/SideNavLinkText.js +2 -2
- package/lib/components/UIShell/SideNavMenu.js +3 -2
- package/lib/components/UIShell/SideNavMenuItem.js +2 -2
- package/lib/components/UIShell/SideNavSwitcher.js +2 -2
- package/lib/components/UIShell/SkipToContent.js +2 -2
- package/lib/components/UIShell/Switcher.js +2 -2
- package/lib/components/UIShell/SwitcherDivider.js +2 -2
- package/lib/components/UIShell/SwitcherItem.js +2 -2
- package/lib/components/UnorderedList/UnorderedList.js +2 -2
- package/lib/index.js +33 -32
- package/lib/internal/FloatingMenu.js +13 -8
- package/lib/internal/motion/MotionSurface.d.ts +35 -0
- package/lib/internal/motion/useMotionEnabled.d.ts +13 -0
- package/lib/internal/motion/useMotionSurface.d.ts +33 -0
- package/lib/internal/useId.js +1 -0
- package/lib/internal/useOverflowItems.js +2 -1
- package/lib/internal/usePresence.d.ts +8 -1
- package/lib/internal/usePresence.js +4 -2
- package/lib/internal/usePresenceContext.d.ts +12 -0
- package/lib/internal/usePresenceContext.js +22 -3
- package/lib/tools/wrapComponent.js +2 -2
- package/package.json +12 -9
- package/telemetry.yml +1 -0
|
@@ -23,8 +23,8 @@ import ListBox from "../ListBox/index.js";
|
|
|
23
23
|
import ListBoxSelection from "../ListBox/next/ListBoxSelection.js";
|
|
24
24
|
import ListBoxTrigger from "../ListBox/next/ListBoxTrigger.js";
|
|
25
25
|
import { mergeRefs } from "../../tools/mergeRefs.js";
|
|
26
|
-
import classNames from "classnames";
|
|
27
26
|
import { cloneElement, forwardRef, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
27
|
+
import cx from "classnames";
|
|
28
28
|
import PropTypes from "prop-types";
|
|
29
29
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
30
30
|
import { Checkmark, WarningAltFilled, WarningFilled } from "@carbon/icons-react";
|
|
@@ -103,8 +103,10 @@ const ComboBox = forwardRef((props, ref) => {
|
|
|
103
103
|
item: itemToString(item),
|
|
104
104
|
inputValue
|
|
105
105
|
}));
|
|
106
|
-
if (filteredItems.length > 0)
|
|
107
|
-
|
|
106
|
+
if (filteredItems.length > 0) {
|
|
107
|
+
const suggestion = itemToString(filteredItems[0]);
|
|
108
|
+
setTypeaheadText(suggestion.slice(inputValue.length));
|
|
109
|
+
} else setTypeaheadText("");
|
|
108
110
|
} else setTypeaheadText("");
|
|
109
111
|
else setTypeaheadText("");
|
|
110
112
|
prevInputLengthRef.current = inputValue.length;
|
|
@@ -305,24 +307,24 @@ const ComboBox = forwardRef((props, ref) => {
|
|
|
305
307
|
warn: warn || false,
|
|
306
308
|
warnText
|
|
307
309
|
});
|
|
308
|
-
const className =
|
|
310
|
+
const className = cx(`${prefix}--combo-box`, {
|
|
309
311
|
[`${prefix}--combo-box--invalid--focused`]: invalid && isFocused,
|
|
310
312
|
[`${prefix}--list-box--up`]: direction === "top",
|
|
311
313
|
[`${prefix}--combo-box--warning`]: normalizedProps.warn,
|
|
312
314
|
[`${prefix}--combo-box--readonly`]: readOnly,
|
|
313
315
|
[`${prefix}--autoalign`]: enableFloatingStyles
|
|
314
316
|
});
|
|
315
|
-
const titleClasses =
|
|
317
|
+
const titleClasses = cx(`${prefix}--label`, { [`${prefix}--label--disabled`]: disabled });
|
|
316
318
|
const helperTextId = `combobox-helper-text-${comboBoxInstanceId}`;
|
|
317
319
|
const warnTextId = `combobox-warn-text-${comboBoxInstanceId}`;
|
|
318
320
|
const invalidTextId = `combobox-invalid-text-${comboBoxInstanceId}`;
|
|
319
|
-
const helperClasses =
|
|
320
|
-
const wrapperClasses =
|
|
321
|
+
const helperClasses = cx(`${prefix}--form__helper-text`, { [`${prefix}--form__helper-text--disabled`]: disabled });
|
|
322
|
+
const wrapperClasses = cx(`${prefix}--list-box__wrapper`, [containerClassName, {
|
|
321
323
|
[`${prefix}--list-box__wrapper--fluid--invalid`]: isFluid && invalid,
|
|
322
324
|
[`${prefix}--list-box__wrapper--slug`]: slug,
|
|
323
325
|
[`${prefix}--list-box__wrapper--decorator`]: decorator
|
|
324
326
|
}]);
|
|
325
|
-
const inputClasses =
|
|
327
|
+
const inputClasses = cx(`${prefix}--text-input`, {
|
|
326
328
|
[`${prefix}--text-input--empty`]: !inputValue,
|
|
327
329
|
[`${prefix}--combo-box--input--focus`]: isFocused
|
|
328
330
|
});
|
|
@@ -541,7 +543,8 @@ const ComboBox = forwardRef((props, ref) => {
|
|
|
541
543
|
if (!isOpen) return;
|
|
542
544
|
const matchingItem = items.find((item) => !isItemDisabled(item) && itemToString(item).toLowerCase().startsWith(inputValue.toLowerCase()));
|
|
543
545
|
if (matchingItem) {
|
|
544
|
-
|
|
546
|
+
const newValue = itemToString(matchingItem);
|
|
547
|
+
downshiftSetInputValue(newValue);
|
|
545
548
|
selectItem(matchingItem);
|
|
546
549
|
}
|
|
547
550
|
}
|
|
@@ -16,8 +16,8 @@ import Button_default from "../Button/index.js";
|
|
|
16
16
|
import { mergeRefs } from "../../tools/mergeRefs.js";
|
|
17
17
|
import { Menu as Menu$1 } from "../Menu/Menu.js";
|
|
18
18
|
import { useAttachedMenu } from "../../internal/useAttachedMenu.js";
|
|
19
|
-
import classNames from "classnames";
|
|
20
19
|
import React, { useRef } from "react";
|
|
20
|
+
import cx from "classnames";
|
|
21
21
|
import PropTypes from "prop-types";
|
|
22
22
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
23
23
|
import { ChevronDown } from "@carbon/icons-react";
|
|
@@ -72,10 +72,10 @@ const ComboButton = React.forwardRef(function ComboButton({ children, className,
|
|
|
72
72
|
function handlePrimaryActionClick(e) {
|
|
73
73
|
if (onClick) onClick(e);
|
|
74
74
|
}
|
|
75
|
-
const containerClasses =
|
|
76
|
-
const menuClasses =
|
|
77
|
-
const primaryActionClasses =
|
|
78
|
-
const triggerClasses =
|
|
75
|
+
const containerClasses = cx(`${prefix}--combo-button__container`, `${prefix}--combo-button__container--${size$1}`, { [`${prefix}--combo-button__container--open`]: open }, className);
|
|
76
|
+
const menuClasses = cx(`${prefix}--combo-button__${menuAlignment}`);
|
|
77
|
+
const primaryActionClasses = cx(`${prefix}--combo-button__primary-action`);
|
|
78
|
+
const triggerClasses = cx(`${prefix}--combo-button__trigger`);
|
|
79
79
|
return /* @__PURE__ */ jsxs("div", {
|
|
80
80
|
...rest,
|
|
81
81
|
className: containerClasses,
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import { warning } from "../../internal/warning.js";
|
|
8
9
|
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
10
|
import { Escape, Tab } from "../../internal/keyboard/keys.js";
|
|
10
11
|
import { match } from "../../internal/keyboard/match.js";
|
|
11
12
|
import { useId } from "../../internal/useId.js";
|
|
12
|
-
import { warning } from "../../internal/warning.js";
|
|
13
13
|
import { deprecate } from "../../prop-types/deprecate.js";
|
|
14
14
|
import { isComponentElement } from "../../internal/utils.js";
|
|
15
15
|
import { useFeatureFlag } from "../FeatureFlags/index.js";
|
|
@@ -27,8 +27,8 @@ import { Dialog } from "../Dialog/Dialog.js";
|
|
|
27
27
|
import { useComposedModalState } from "./useComposedModalState.js";
|
|
28
28
|
import { ComposedModalPresence, ComposedModalPresenceContext, useExclusiveComposedModalPresenceContext } from "./ComposedModalPresence.js";
|
|
29
29
|
import { isTopmostVisibleModal } from "../Modal/isTopmostVisibleModal.js";
|
|
30
|
-
import classNames from "classnames";
|
|
31
30
|
import React, { Children, cloneElement, useContext, useEffect, useRef, useState } from "react";
|
|
31
|
+
import cx from "classnames";
|
|
32
32
|
import PropTypes from "prop-types";
|
|
33
33
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
34
34
|
import { useMergeRefs } from "@floating-ui/react";
|
|
@@ -50,7 +50,7 @@ const ModalBody = React.forwardRef(function ModalBody({ ["aria-label"]: ariaLabe
|
|
|
50
50
|
*/
|
|
51
51
|
const isScrollable = !!contentRef.current && contentRef?.current?.scrollHeight > contentRef?.current?.clientHeight;
|
|
52
52
|
return /* @__PURE__ */ jsx(Layer, {
|
|
53
|
-
className:
|
|
53
|
+
className: cx({
|
|
54
54
|
[`${prefix}--modal-content`]: true,
|
|
55
55
|
[`${prefix}--modal-content--with-form`]: hasForm,
|
|
56
56
|
[`${prefix}--modal-scroll-content`]: hasScrollingContent || isScrollable,
|
|
@@ -160,7 +160,8 @@ const ComposedModalDialog = React.forwardRef(function ComposedModalDialog({ ["ar
|
|
|
160
160
|
onKeyDown?.(event);
|
|
161
161
|
}
|
|
162
162
|
function handleOnMouseDown(evt) {
|
|
163
|
-
|
|
163
|
+
const target = evt.target;
|
|
164
|
+
onMouseDownTarget.current = target;
|
|
164
165
|
}
|
|
165
166
|
function handleOnClick(evt) {
|
|
166
167
|
const { target } = evt;
|
|
@@ -189,14 +190,14 @@ const ComposedModalDialog = React.forwardRef(function ComposedModalDialog({ ["ar
|
|
|
189
190
|
function closeModal(evt) {
|
|
190
191
|
if (!onClose || onClose(evt) !== false) setIsOpen(false);
|
|
191
192
|
}
|
|
192
|
-
const modalClass =
|
|
193
|
+
const modalClass = cx(`${prefix}--modal`, {
|
|
193
194
|
"is-visible": enablePresence || isOpen,
|
|
194
195
|
[`${prefix}--modal--enable-presence`]: presenceContext?.autoEnablePresence,
|
|
195
196
|
[`${prefix}--modal--danger`]: danger,
|
|
196
197
|
[`${prefix}--modal--slug`]: slug,
|
|
197
198
|
[`${prefix}--modal--decorator`]: decorator
|
|
198
199
|
}, customClassName);
|
|
199
|
-
const containerClass =
|
|
200
|
+
const containerClass = cx(`${prefix}--modal-container`, size && `${prefix}--modal-container--${size}`, isFullWidth && `${prefix}--modal-container--full-width`, containerClassName);
|
|
200
201
|
let generatedAriaLabel;
|
|
201
202
|
const childrenWithProps = React.Children.toArray(children).map((child) => {
|
|
202
203
|
if (isComponentElement(child, ModalHeader)) {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { usePresenceContext } from "../../internal/usePresenceContext.js";
|
|
8
|
+
import { PresenceHoldContext, usePresenceContext } from "../../internal/usePresenceContext.js";
|
|
9
9
|
import { useComposedModalState } from "./useComposedModalState.js";
|
|
10
10
|
import { createContext, useContext, useMemo } from "react";
|
|
11
11
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -32,7 +32,10 @@ const ComposedModalPresence = ({ open, _presenceId: presenceId, _autoEnablePrese
|
|
|
32
32
|
if (!isPresent) return null;
|
|
33
33
|
return /* @__PURE__ */ jsx(ComposedModalPresenceContext, {
|
|
34
34
|
value: presenceContextValue,
|
|
35
|
-
children
|
|
35
|
+
children: /* @__PURE__ */ jsx(PresenceHoldContext, {
|
|
36
|
+
value: presenceContextValue,
|
|
37
|
+
children
|
|
38
|
+
})
|
|
36
39
|
});
|
|
37
40
|
};
|
|
38
41
|
const ComposedModalPresenceContext = createContext(void 0);
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
8
|
import { noopFn } from "../../internal/noopFn.js";
|
|
9
|
+
import { usePrefix } from "../../internal/usePrefix.js";
|
|
10
10
|
import Button_default from "../Button/index.js";
|
|
11
11
|
import ButtonSet_default from "../ButtonSet/index.js";
|
|
12
12
|
import InlineLoading_default from "../InlineLoading/index.js";
|
|
13
|
-
import classNames from "classnames";
|
|
14
13
|
import React from "react";
|
|
14
|
+
import cx from "classnames";
|
|
15
15
|
import PropTypes from "prop-types";
|
|
16
16
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
17
17
|
//#region src/components/ComposedModal/ModalFooter.tsx
|
|
@@ -63,8 +63,8 @@ SecondaryButtonSet.propTypes = {
|
|
|
63
63
|
};
|
|
64
64
|
const ModalFooter = React.forwardRef(function ModalFooter({ children, className: customClassName, closeModal = noopFn, danger, dangerDescription = "", inputref, onRequestClose = noopFn, onRequestSubmit = noopFn, primaryButtonDisabled, primaryButtonText, primaryClassName, secondaryButtonText, secondaryButtons, secondaryClassName, loadingStatus = "inactive", loadingDescription, loadingIconDescription, onLoadingSuccess = noopFn, ...rest }, ref) {
|
|
65
65
|
const prefix = usePrefix();
|
|
66
|
-
const footerClass =
|
|
67
|
-
const primaryButtonClass =
|
|
66
|
+
const footerClass = cx(`${prefix}--modal-footer`, customClassName, Array.isArray(secondaryButtons) && secondaryButtons.length === 2 ? `${prefix}--modal-footer--three-button` : null);
|
|
67
|
+
const primaryButtonClass = cx(primaryClassName, loadingStatus !== "inactive" ? `${prefix}--btn--loading` : null);
|
|
68
68
|
const loadingActive = loadingStatus !== "inactive";
|
|
69
69
|
const secondaryButtonProps = {
|
|
70
70
|
closeModal,
|
|
@@ -9,8 +9,8 @@ import { usePrefix } from "../../internal/usePrefix.js";
|
|
|
9
9
|
import { useId } from "../../internal/useId.js";
|
|
10
10
|
import { IconButton } from "../IconButton/index.js";
|
|
11
11
|
import { ComposedModalContext } from "./ComposedModalContext.js";
|
|
12
|
-
import classNames from "classnames";
|
|
13
12
|
import React, { useContext, useEffect } from "react";
|
|
13
|
+
import cx from "classnames";
|
|
14
14
|
import PropTypes from "prop-types";
|
|
15
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
16
|
import { Close } from "@carbon/icons-react";
|
|
@@ -51,11 +51,11 @@ const ModalHeader = React.forwardRef(function ModalHeader({ buttonOnClick, child
|
|
|
51
51
|
closeModal?.(evt);
|
|
52
52
|
buttonOnClick?.(evt);
|
|
53
53
|
}
|
|
54
|
-
const headerClass =
|
|
55
|
-
const labelClass =
|
|
56
|
-
const titleClass =
|
|
57
|
-
const closeClass =
|
|
58
|
-
const closeIconClass =
|
|
54
|
+
const headerClass = cx(`${prefix}--modal-header`, customClassName);
|
|
55
|
+
const labelClass = cx(`${prefix}--modal-header__label ${prefix}--type-delta`, labelClassName);
|
|
56
|
+
const titleClass = cx(`${prefix}--modal-header__heading ${prefix}--type-beta`, titleClassName);
|
|
57
|
+
const closeClass = cx(`${prefix}--modal-close`, closeClassName);
|
|
58
|
+
const closeIconClass = cx(`${prefix}--modal-close__icon`, closeIconClassName);
|
|
59
59
|
return /* @__PURE__ */ jsxs("div", {
|
|
60
60
|
className: headerClass,
|
|
61
61
|
...rest,
|
|
@@ -12,8 +12,8 @@ import { LayoutConstraint } from "../Layout/index.js";
|
|
|
12
12
|
import ContainedListItem_default from "./ContainedListItem/index.js";
|
|
13
13
|
import Search from "../Search/Search.js";
|
|
14
14
|
import ExpandableSearch_default from "../ExpandableSearch/index.js";
|
|
15
|
-
import classNames from "classnames";
|
|
16
15
|
import "react";
|
|
16
|
+
import cx from "classnames";
|
|
17
17
|
import PropTypes from "prop-types";
|
|
18
18
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
19
|
//#region src/components/ContainedList/ContainedList.tsx
|
|
@@ -27,7 +27,7 @@ const filterChildren = (children) => {
|
|
|
27
27
|
const ContainedList = ({ action, children, className, isInset, kind = variants[0], label, size, ...rest }) => {
|
|
28
28
|
const labelId = `${useId("contained-list")}-header`;
|
|
29
29
|
const prefix = usePrefix();
|
|
30
|
-
const classes =
|
|
30
|
+
const classes = cx(`${prefix}--contained-list`, {
|
|
31
31
|
[`${prefix}--contained-list--inset-rulers`]: isInset,
|
|
32
32
|
[`${prefix}--contained-list--${size}`]: size,
|
|
33
33
|
[`${prefix}--layout--size-${size}`]: size
|
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
|
|
8
8
|
import { usePrefix } from "../../../internal/usePrefix.js";
|
|
9
9
|
import { LayoutConstraint } from "../../Layout/index.js";
|
|
10
|
-
import classNames from "classnames";
|
|
11
10
|
import "react";
|
|
11
|
+
import cx from "classnames";
|
|
12
12
|
import PropTypes from "prop-types";
|
|
13
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
//#region src/components/ContainedList/ContainedListItem/ContainedListItem.tsx
|
|
15
15
|
const ContainedListItem = ({ action, children, className, disabled = false, onClick, renderIcon: IconElement, ...rest }) => {
|
|
16
16
|
const prefix = usePrefix();
|
|
17
17
|
const isClickable = onClick !== void 0;
|
|
18
|
-
const classes =
|
|
18
|
+
const classes = cx(`${prefix}--contained-list-item`, className, {
|
|
19
19
|
[`${prefix}--contained-list-item--clickable`]: isClickable,
|
|
20
20
|
[`${prefix}--contained-list-item--with-icon`]: IconElement,
|
|
21
21
|
[`${prefix}--contained-list-item--with-action`]: action
|
|
@@ -14,8 +14,8 @@ import { isComponentElement } from "../../internal/utils.js";
|
|
|
14
14
|
import { LayoutConstraint } from "../Layout/index.js";
|
|
15
15
|
import Switch from "../Switch/Switch.js";
|
|
16
16
|
import IconSwitch from "../Switch/IconSwitch.js";
|
|
17
|
-
import classNames from "classnames";
|
|
18
17
|
import { Children, cloneElement, useContext, useEffect, useRef, useState } from "react";
|
|
18
|
+
import cx from "classnames";
|
|
19
19
|
import PropTypes from "prop-types";
|
|
20
20
|
import { jsx } from "react/jsx-runtime";
|
|
21
21
|
//#region src/components/ContentSwitcher/ContentSwitcher.tsx
|
|
@@ -71,7 +71,7 @@ const ContentSwitcher = ({ children, className, light, lowContrast, selectedInde
|
|
|
71
71
|
const isIconOnly = Children.map(children, (child) => {
|
|
72
72
|
return isComponentElement(child, IconSwitch);
|
|
73
73
|
})?.every((val) => val === true);
|
|
74
|
-
const classes =
|
|
74
|
+
const classes = cx(`${prefix}--content-switcher`, className, {
|
|
75
75
|
[`${prefix}--content-switcher--light`]: light,
|
|
76
76
|
[`${prefix}--content-switcher--${size}`]: size,
|
|
77
77
|
[`${prefix}--layout--size-${size}`]: size,
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
8
|
import { noopFn } from "../../internal/noopFn.js";
|
|
9
|
+
import { usePrefix } from "../../internal/usePrefix.js";
|
|
10
10
|
import { deprecateValuesWithin } from "../../prop-types/deprecateValuesWithin.js";
|
|
11
11
|
import { mapPopoverAlign } from "../../tools/mapPopoverAlign.js";
|
|
12
12
|
import { IconButton } from "../IconButton/index.js";
|
|
13
13
|
import { composeEventHandlers } from "../../tools/events.js";
|
|
14
|
-
import classNames from "classnames";
|
|
15
14
|
import { useCallback, useEffect, useState } from "react";
|
|
15
|
+
import cx from "classnames";
|
|
16
16
|
import PropTypes from "prop-types";
|
|
17
17
|
import { jsx } from "react/jsx-runtime";
|
|
18
18
|
import { debounce } from "es-toolkit/compat";
|
|
@@ -26,7 +26,7 @@ import { debounce } from "es-toolkit/compat";
|
|
|
26
26
|
function Copy({ align = "bottom", autoAlign = false, children, className, feedback = "Copied!", feedbackTimeout = 2e3, onAnimationEnd, onClick = noopFn, ...other }) {
|
|
27
27
|
const [animation, setAnimation] = useState("");
|
|
28
28
|
const prefix = usePrefix();
|
|
29
|
-
const classNames
|
|
29
|
+
const classNames = cx(className, `${prefix}--copy`, {
|
|
30
30
|
[`${prefix}--copy-btn--animating`]: animation,
|
|
31
31
|
[`${prefix}--copy-btn--${animation}`]: animation
|
|
32
32
|
});
|
|
@@ -48,7 +48,7 @@ function Copy({ align = "bottom", autoAlign = false, children, className, feedba
|
|
|
48
48
|
closeOnActivation: false,
|
|
49
49
|
align,
|
|
50
50
|
autoAlign,
|
|
51
|
-
className: classNames
|
|
51
|
+
className: classNames,
|
|
52
52
|
label: animation ? feedback : initialLabel,
|
|
53
53
|
leaveDelayMs: animation ? feedbackTimeout : void 0,
|
|
54
54
|
onClick: composeEventHandlers([onClick, handleClick]),
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
8
|
import { noopFn } from "../../internal/noopFn.js";
|
|
9
|
+
import { usePrefix } from "../../internal/usePrefix.js";
|
|
10
10
|
import { deprecateValuesWithin } from "../../prop-types/deprecateValuesWithin.js";
|
|
11
11
|
import { mapPopoverAlign } from "../../tools/mapPopoverAlign.js";
|
|
12
12
|
import Copy_default from "../Copy/index.js";
|
|
13
13
|
import { LayoutConstraint } from "../Layout/index.js";
|
|
14
|
-
import classNames from "classnames";
|
|
15
14
|
import "react";
|
|
15
|
+
import cx from "classnames";
|
|
16
16
|
import PropTypes from "prop-types";
|
|
17
17
|
import { jsx } from "react/jsx-runtime";
|
|
18
18
|
import { Copy } from "@carbon/icons-react";
|
|
@@ -36,7 +36,7 @@ function CopyButton({ align = "bottom", autoAlign = false, feedback = "Copied!",
|
|
|
36
36
|
onClick,
|
|
37
37
|
align,
|
|
38
38
|
autoAlign,
|
|
39
|
-
className:
|
|
39
|
+
className: cx(className, `${prefix}--copy-btn`),
|
|
40
40
|
"aria-label": iconDescription,
|
|
41
41
|
...other,
|
|
42
42
|
children: /* @__PURE__ */ jsx(Copy, { className: `${prefix}--snippet__icon` })
|
|
@@ -13,7 +13,7 @@ import { getNextSortState } from "./state/sorting.js";
|
|
|
13
13
|
import getDerivedStateFromProps from "./state/getDerivedStateFromProps.js";
|
|
14
14
|
import denormalize from "./tools/denormalize.js";
|
|
15
15
|
import { defaultFilterRows } from "./tools/filter.js";
|
|
16
|
-
import Table from "./Table.js";
|
|
16
|
+
import { Table } from "./Table.js";
|
|
17
17
|
import TableActionList from "./TableActionList.js";
|
|
18
18
|
import TableBatchAction from "./TableBatchAction.js";
|
|
19
19
|
import TableBatchActions from "./TableBatchActions.js";
|
|
@@ -89,7 +89,7 @@ const DataTable = (props) => {
|
|
|
89
89
|
const nextHeaders = headers.map((header) => header.key);
|
|
90
90
|
const hasRowIdsChanged = !isEqual(nextRowIds, state.rowIds);
|
|
91
91
|
const hasHeadersChanged = !isEqual(nextHeaders, Array.from(new Set(Object.keys(state.cellsById).map((id) => id.split(":")[1]))));
|
|
92
|
-
const
|
|
92
|
+
const currentRows = state.rowIds.map((id) => {
|
|
93
93
|
const row = state.rowsById[id];
|
|
94
94
|
return {
|
|
95
95
|
id: row.id,
|
|
@@ -97,7 +97,8 @@ const DataTable = (props) => {
|
|
|
97
97
|
isExpanded: row.isExpanded,
|
|
98
98
|
isSelected: row.isSelected
|
|
99
99
|
};
|
|
100
|
-
})
|
|
100
|
+
});
|
|
101
|
+
const hasRowsChanged = !isEqual(rows, currentRows);
|
|
101
102
|
if (hasRowIdsChanged || hasHeadersChanged || hasRowsChanged) setState((prev) => getDerivedStateFromProps(props, prev));
|
|
102
103
|
}, [headers, rows]);
|
|
103
104
|
const getHeaderProps = ({ header, onClick, isSortable: headerIsSortable, ...rest }) => {
|
|
@@ -9,8 +9,8 @@ import { usePrefix } from "../../internal/usePrefix.js";
|
|
|
9
9
|
import useIsomorphicEffect from "../../internal/useIsomorphicEffect.js";
|
|
10
10
|
import { useWindowEvent } from "../../internal/useEvent.js";
|
|
11
11
|
import { TableContext } from "./TableContext.js";
|
|
12
|
-
import classNames from "classnames";
|
|
13
12
|
import { useCallback, useContext, useRef } from "react";
|
|
13
|
+
import cx from "classnames";
|
|
14
14
|
import PropTypes from "prop-types";
|
|
15
15
|
import { jsx } from "react/jsx-runtime";
|
|
16
16
|
import { debounce } from "es-toolkit/compat";
|
|
@@ -39,7 +39,7 @@ const Table = ({ className, children, useZebraStyles, size = "lg", isSortable =
|
|
|
39
39
|
const { titleId, descriptionId } = useContext(TableContext);
|
|
40
40
|
const prefix = usePrefix();
|
|
41
41
|
const tableRef = useRef(null);
|
|
42
|
-
const componentClass =
|
|
42
|
+
const componentClass = cx(`${prefix}--data-table`, className, {
|
|
43
43
|
[`${prefix}--data-table--${size}`]: size,
|
|
44
44
|
[`${prefix}--data-table--sort`]: isSortable,
|
|
45
45
|
[`${prefix}--data-table--zebra`]: useZebraStyles,
|
|
@@ -146,4 +146,4 @@ Table.propTypes = {
|
|
|
146
146
|
tabIndex: PropTypes.number
|
|
147
147
|
};
|
|
148
148
|
//#endregion
|
|
149
|
-
export { Table as default };
|
|
149
|
+
export { Table, Table as default };
|
|
@@ -9,8 +9,8 @@ import { usePrefix } from "../../internal/usePrefix.js";
|
|
|
9
9
|
import { Text } from "../Text/Text.js";
|
|
10
10
|
import Button_default from "../Button/index.js";
|
|
11
11
|
import TableActionList from "./TableActionList.js";
|
|
12
|
-
import classNames from "classnames";
|
|
13
12
|
import React from "react";
|
|
13
|
+
import cx from "classnames";
|
|
14
14
|
import PropTypes from "prop-types";
|
|
15
15
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
16
16
|
//#region src/components/DataTable/TableBatchActions.tsx
|
|
@@ -47,11 +47,11 @@ const defaultTranslateWithId = (messageId, args = {
|
|
|
47
47
|
const TableBatchActions = ({ className, children, shouldShowBatchActions, totalSelected, totalCount, onCancel, onSelectAll, translateWithId: t = defaultTranslateWithId, ...rest }) => {
|
|
48
48
|
const [isScrolling, setIsScrolling] = React.useState(false);
|
|
49
49
|
const prefix = usePrefix();
|
|
50
|
-
const batchActionsClasses =
|
|
50
|
+
const batchActionsClasses = cx({
|
|
51
51
|
[`${prefix}--batch-actions`]: true,
|
|
52
52
|
[`${prefix}--batch-actions--active`]: shouldShowBatchActions
|
|
53
53
|
}, className);
|
|
54
|
-
const batchSummaryClasses =
|
|
54
|
+
const batchSummaryClasses = cx(`${prefix}--batch-summary`, { [`${prefix}--batch-summary__scroll`]: isScrolling });
|
|
55
55
|
return /* @__PURE__ */ jsxs("div", {
|
|
56
56
|
onScroll: () => {
|
|
57
57
|
setIsScrolling(!isScrolling);
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
|
-
import classNames from "classnames";
|
|
10
9
|
import { forwardRef } from "react";
|
|
10
|
+
import cx from "classnames";
|
|
11
11
|
import PropTypes from "prop-types";
|
|
12
12
|
import { jsx } from "react/jsx-runtime";
|
|
13
13
|
//#region src/components/DataTable/TableCell.tsx
|
|
@@ -19,7 +19,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
19
19
|
*/
|
|
20
20
|
const TableCell = forwardRef((props, ref) => {
|
|
21
21
|
const { children, className, hasAILabelHeader, colSpan, ...rest } = props;
|
|
22
|
-
const tableCellClassNames =
|
|
22
|
+
const tableCellClassNames = cx(className, { [`${usePrefix()}--table-cell--column-slug`]: hasAILabelHeader });
|
|
23
23
|
return /* @__PURE__ */ jsx("td", {
|
|
24
24
|
className: tableCellClassNames ? tableCellClassNames : void 0,
|
|
25
25
|
ref,
|
|
@@ -9,8 +9,8 @@ import { usePrefix } from "../../internal/usePrefix.js";
|
|
|
9
9
|
import { useId } from "../../internal/useId.js";
|
|
10
10
|
import { TableContext } from "./TableContext.js";
|
|
11
11
|
import { Heading, Section } from "../Heading/index.js";
|
|
12
|
-
import classNames from "classnames";
|
|
13
12
|
import { useMemo } from "react";
|
|
13
|
+
import cx from "classnames";
|
|
14
14
|
import PropTypes from "prop-types";
|
|
15
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
16
|
//#region src/components/DataTable/TableContainer.tsx
|
|
@@ -25,7 +25,7 @@ const TableContainer = ({ aiEnabled, className, children, decorator, title, desc
|
|
|
25
25
|
const titleId = `${baseId}-title`;
|
|
26
26
|
const descriptionId = `${baseId}-description`;
|
|
27
27
|
const prefix = usePrefix();
|
|
28
|
-
const tableContainerClasses =
|
|
28
|
+
const tableContainerClasses = cx(className, `${prefix}--data-table-container`, {
|
|
29
29
|
[`${prefix}--data-table--max-width`]: stickyHeader,
|
|
30
30
|
[`${prefix}--data-table-container--static`]: useStaticWidth,
|
|
31
31
|
[`${prefix}--data-table-container--ai-enabled`]: aiEnabled
|
|
@@ -47,7 +47,7 @@ const TableContainer = ({ aiEnabled, className, children, decorator, title, desc
|
|
|
47
47
|
...rest,
|
|
48
48
|
className: tableContainerClasses,
|
|
49
49
|
children: [(title || description || decorator) && /* @__PURE__ */ jsxs("div", {
|
|
50
|
-
className:
|
|
50
|
+
className: cx(`${prefix}--data-table-header`, {
|
|
51
51
|
[`${prefix}--data-table-header__with-decorator`]: decorator,
|
|
52
52
|
[`${prefix}--data-table-header__with-decorator--standalone`]: decorator && !title && !description
|
|
53
53
|
}),
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
9
|
import { isComponentElement } from "../../internal/utils.js";
|
|
10
10
|
import { AILabel } from "../AILabel/index.js";
|
|
11
|
-
import classNames from "classnames";
|
|
12
11
|
import { cloneElement } from "react";
|
|
12
|
+
import cx from "classnames";
|
|
13
13
|
import PropTypes from "prop-types";
|
|
14
14
|
import { jsx } from "react/jsx-runtime";
|
|
15
15
|
//#region src/components/DataTable/TableDecoratorRow.tsx
|
|
@@ -22,7 +22,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
22
22
|
const TableDecoratorRow = ({ className, decorator }) => {
|
|
23
23
|
const prefix = usePrefix();
|
|
24
24
|
return /* @__PURE__ */ jsx("td", {
|
|
25
|
-
className:
|
|
25
|
+
className: cx({
|
|
26
26
|
...className && { [className]: true },
|
|
27
27
|
[`${prefix}--table-column-decorator`]: true,
|
|
28
28
|
[`${prefix}--table-column-decorator--active`]: decorator
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
9
|
import { deprecate } from "../../prop-types/deprecate.js";
|
|
10
10
|
import { requiredIfGivenPropIsTruthy } from "../../prop-types/requiredIfGivenPropIsTruthy.js";
|
|
11
|
-
import classNames from "classnames";
|
|
12
11
|
import "react";
|
|
12
|
+
import cx from "classnames";
|
|
13
13
|
import PropTypes from "prop-types";
|
|
14
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
15
|
import { ChevronRight } from "@carbon/icons-react";
|
|
@@ -24,7 +24,7 @@ const TableExpandHeader = ({ ["aria-controls"]: ariaControls, ["aria-label"]: ar
|
|
|
24
24
|
const prefix = usePrefix();
|
|
25
25
|
return /* @__PURE__ */ jsxs("th", {
|
|
26
26
|
scope: "col",
|
|
27
|
-
className:
|
|
27
|
+
className: cx(`${prefix}--table-expand`, headerClassName),
|
|
28
28
|
"data-previous-value": isExpanded ? "collapsed" : void 0,
|
|
29
29
|
id,
|
|
30
30
|
...rest,
|
|
@@ -11,8 +11,8 @@ import { AILabel } from "../AILabel/index.js";
|
|
|
11
11
|
import TableCell from "./TableCell.js";
|
|
12
12
|
import TableDecoratorRow from "./TableDecoratorRow.js";
|
|
13
13
|
import TableSlugRow from "./TableSlugRow.js";
|
|
14
|
-
import classNames from "classnames";
|
|
15
14
|
import { Children, forwardRef } from "react";
|
|
15
|
+
import cx from "classnames";
|
|
16
16
|
import PropTypes from "prop-types";
|
|
17
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
18
|
import { ChevronRight } from "@carbon/icons-react";
|
|
@@ -38,7 +38,7 @@ const TableExpandRow = forwardRef(({ ["aria-controls"]: ariaControls, ["aria-lab
|
|
|
38
38
|
const normalizedChildren = Children.toArray(children).map((child) => {
|
|
39
39
|
if (!isComponentElement(child, TableSlugRow) && !isComponentElement(child, TableDecoratorRow)) return child;
|
|
40
40
|
});
|
|
41
|
-
const className =
|
|
41
|
+
const className = cx({
|
|
42
42
|
[`${prefix}--parent-row`]: true,
|
|
43
43
|
[`${prefix}--expandable-row`]: isExpanded,
|
|
44
44
|
[`${prefix}--data-table--selected`]: isSelected,
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
9
|
import TableCell from "./TableCell.js";
|
|
10
|
-
import classNames from "classnames";
|
|
11
10
|
import { useRef } from "react";
|
|
11
|
+
import cx from "classnames";
|
|
12
12
|
import PropTypes from "prop-types";
|
|
13
13
|
import { jsx } from "react/jsx-runtime";
|
|
14
14
|
//#region src/components/DataTable/TableExpandedRow.tsx
|
|
@@ -21,7 +21,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
21
21
|
const TableExpandedRow = ({ className: customClassName, children, colSpan, ...rest }) => {
|
|
22
22
|
const rowRef = useRef(null);
|
|
23
23
|
const prefix = usePrefix();
|
|
24
|
-
const className =
|
|
24
|
+
const className = cx(`${prefix}--expandable-row`, customClassName);
|
|
25
25
|
const toggleParentHoverClass = (eventType) => {
|
|
26
26
|
if (rowRef && rowRef.current && rowRef.current.previousElementSibling) {
|
|
27
27
|
const parentNode = rowRef.current.previousElementSibling;
|
|
@@ -10,8 +10,8 @@ import { useId } from "../../internal/useId.js";
|
|
|
10
10
|
import { isComponentElement } from "../../internal/utils.js";
|
|
11
11
|
import { AILabel } from "../AILabel/index.js";
|
|
12
12
|
import { sortStates } from "./state/sortStates.js";
|
|
13
|
-
import classNames from "classnames";
|
|
14
13
|
import { cloneElement, forwardRef, useRef } from "react";
|
|
14
|
+
import cx from "classnames";
|
|
15
15
|
import PropTypes from "prop-types";
|
|
16
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
17
|
import { ArrowUp, ArrowsVertical } from "@carbon/icons-react";
|
|
@@ -53,7 +53,7 @@ const TableHeader = forwardRef((props, ref) => {
|
|
|
53
53
|
size: "mini",
|
|
54
54
|
ref: AILableRef
|
|
55
55
|
}) : candidate;
|
|
56
|
-
const headerLabelClassNames =
|
|
56
|
+
const headerLabelClassNames = cx({
|
|
57
57
|
[`${prefix}--table-header-label`]: true,
|
|
58
58
|
[`${prefix}--table-header-label--slug ${prefix}--table-header-label--ai-label`]: colHasAILabel,
|
|
59
59
|
[`${prefix}--table-header-label--decorator`]: decorator
|
|
@@ -73,7 +73,7 @@ const TableHeader = forwardRef((props, ref) => {
|
|
|
73
73
|
})]
|
|
74
74
|
}) : null
|
|
75
75
|
});
|
|
76
|
-
const className =
|
|
76
|
+
const className = cx(headerClassName, {
|
|
77
77
|
[`${prefix}--table-sort`]: true,
|
|
78
78
|
[`${prefix}--table-sort--active`]: isSortHeader && sortDirection !== sortStates.NONE,
|
|
79
79
|
[`${prefix}--table-sort--descending`]: isSortHeader && sortDirection === sortStates.DESC
|
|
@@ -85,7 +85,7 @@ const TableHeader = forwardRef((props, ref) => {
|
|
|
85
85
|
isSortHeader,
|
|
86
86
|
sortStates
|
|
87
87
|
});
|
|
88
|
-
const headerClasses =
|
|
88
|
+
const headerClasses = cx(headerClassName, `${prefix}--table-sort__header`, {
|
|
89
89
|
[`${prefix}--table-sort__header--ai-label`]: colHasAILabel,
|
|
90
90
|
[`${prefix}--table-sort__header--decorator`]: decorator
|
|
91
91
|
});
|
|
@@ -10,8 +10,8 @@ import { isComponentElement } from "../../internal/utils.js";
|
|
|
10
10
|
import { AILabel } from "../AILabel/index.js";
|
|
11
11
|
import TableDecoratorRow from "./TableDecoratorRow.js";
|
|
12
12
|
import TableSlugRow from "./TableSlugRow.js";
|
|
13
|
-
import classNames from "classnames";
|
|
14
13
|
import { Children, forwardRef } from "react";
|
|
14
|
+
import cx from "classnames";
|
|
15
15
|
import PropTypes from "prop-types";
|
|
16
16
|
import { jsx } from "react/jsx-runtime";
|
|
17
17
|
//#region src/components/DataTable/TableRow.tsx
|
|
@@ -28,7 +28,7 @@ const TableRow = forwardRef((props, ref) => {
|
|
|
28
28
|
if (isComponentElement(child, TableSlugRow)) return !!child.props.slug;
|
|
29
29
|
return isComponentElement(child, TableDecoratorRow) && isComponentElement(child.props.decorator, AILabel);
|
|
30
30
|
});
|
|
31
|
-
const className =
|
|
31
|
+
const className = cx(props.className, {
|
|
32
32
|
[`${prefix}--data-table--selected`]: isSelected,
|
|
33
33
|
[`${prefix}--data-table--slug-row ${prefix}--data-table--ai-label-row`]: rowHasAILabel
|
|
34
34
|
});
|