@carbon/react 1.82.1 → 1.83.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 +943 -828
- package/es/components/AILabel/index.js +13 -13
- 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 +15 -15
- package/es/components/Accordion/Accordion.js +3 -3
- package/es/components/Accordion/AccordionItem.js +9 -9
- package/es/components/Accordion/AccordionProvider.js +2 -2
- package/es/components/AccordionItem/index.d.ts +9 -0
- package/es/components/AspectRatio/AspectRatio.js +2 -2
- package/es/components/BadgeIndicator/index.js +3 -3
- package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +5 -5
- package/es/components/Breadcrumb/Breadcrumb.js +3 -3
- package/es/components/Breadcrumb/BreadcrumbItem.js +9 -9
- package/es/components/Button/Button.Skeleton.js +3 -3
- package/es/components/Button/Button.js +5 -5
- package/es/components/Button/ButtonBase.js +5 -5
- package/es/components/ButtonSet/ButtonSet.js +2 -2
- package/es/components/ChatButton/ChatButton.Skeleton.js +2 -2
- package/es/components/ChatButton/ChatButton.js +3 -3
- package/es/components/Checkbox/Checkbox.Skeleton.js +4 -4
- package/es/components/Checkbox/Checkbox.js +15 -15
- package/es/components/CheckboxGroup/CheckboxGroup.js +12 -12
- package/es/components/ClassPrefix/index.js +2 -2
- package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +7 -7
- package/es/components/CodeSnippet/CodeSnippet.js +16 -16
- package/es/components/ComboBox/ComboBox.js +18 -18
- package/es/components/ComboButton/index.js +7 -7
- package/es/components/ComposedModal/ComposedModal.js +20 -20
- package/es/components/ComposedModal/ModalFooter.js +8 -8
- package/es/components/ComposedModal/ModalHeader.js +8 -8
- package/es/components/ContainedList/ContainedList.js +7 -7
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +7 -7
- package/es/components/ContentSwitcher/ContentSwitcher.d.ts +8 -0
- package/es/components/ContentSwitcher/ContentSwitcher.js +13 -7
- package/es/components/Copy/Copy.js +2 -2
- package/es/components/CopyButton/CopyButton.js +4 -4
- package/es/components/DangerButton/DangerButton.js +2 -2
- package/es/components/DataTable/DataTable.d.ts +81 -283
- package/es/components/DataTable/DataTable.js +83 -123
- package/es/components/DataTable/Table.d.ts +2 -2
- package/es/components/DataTable/Table.js +4 -4
- package/es/components/DataTable/TableActionList.d.ts +1 -1
- package/es/components/DataTable/TableBatchAction.js +2 -2
- package/es/components/DataTable/TableBatchActions.js +9 -9
- package/es/components/DataTable/TableBody.d.ts +3 -3
- package/es/components/DataTable/TableBody.js +2 -2
- package/es/components/DataTable/TableCell.d.ts +3 -4
- package/es/components/DataTable/TableCell.js +2 -2
- package/es/components/DataTable/TableContainer.d.ts +2 -3
- package/es/components/DataTable/TableContainer.js +6 -6
- package/es/components/DataTable/TableDecoratorRow.js +4 -4
- package/es/components/DataTable/TableExpandHeader.d.ts +2 -3
- package/es/components/DataTable/TableExpandHeader.js +4 -4
- package/es/components/DataTable/TableExpandRow.js +8 -8
- package/es/components/DataTable/TableExpandedRow.d.ts +3 -3
- package/es/components/DataTable/TableExpandedRow.js +4 -4
- package/es/components/DataTable/TableHead.d.ts +1 -1
- package/es/components/DataTable/TableHeader.d.ts +4 -4
- package/es/components/DataTable/TableHeader.js +15 -15
- package/es/components/DataTable/TableRow.d.ts +3 -4
- package/es/components/DataTable/TableRow.js +4 -4
- package/es/components/DataTable/TableSelectAll.js +3 -3
- package/es/components/DataTable/TableSelectRow.js +4 -4
- package/es/components/DataTable/TableSlugRow.js +3 -3
- package/es/components/DataTable/TableToolbar.js +2 -2
- package/es/components/DataTable/TableToolbarAction.js +2 -2
- package/es/components/DataTable/TableToolbarContent.d.ts +1 -1
- package/es/components/DataTable/TableToolbarMenu.js +2 -2
- package/es/components/DataTable/TableToolbarSearch.js +2 -2
- package/es/components/DataTable/index.d.ts +1 -1
- package/es/components/DataTableSkeleton/DataTableSkeleton.js +15 -15
- package/es/components/DatePicker/DatePicker.Skeleton.js +8 -8
- package/es/components/DatePicker/DatePicker.d.ts +1 -1
- package/es/components/DatePicker/DatePicker.js +23 -20
- package/es/components/DatePickerInput/DatePickerInput.d.ts +3 -4
- package/es/components/DatePickerInput/DatePickerInput.js +19 -19
- package/es/components/Dialog/index.d.ts +5 -6
- package/es/components/Dialog/index.js +10 -10
- package/es/components/Dropdown/Dropdown.Skeleton.d.ts +2 -3
- package/es/components/Dropdown/Dropdown.Skeleton.js +4 -4
- package/es/components/Dropdown/Dropdown.d.ts +3 -3
- package/es/components/Dropdown/Dropdown.js +18 -18
- package/es/components/ErrorBoundary/ErrorBoundary.js +2 -2
- package/es/components/ExpandableSearch/ExpandableSearch.js +3 -3
- package/es/components/FeatureFlags/index.js +2 -2
- package/es/components/FileUploader/FileUploader.Skeleton.d.ts +3 -3
- package/es/components/FileUploader/FileUploader.Skeleton.js +5 -5
- package/es/components/FileUploader/FileUploader.d.ts +2 -3
- package/es/components/FileUploader/FileUploader.js +12 -12
- package/es/components/FileUploader/FileUploaderButton.d.ts +3 -4
- package/es/components/FileUploader/FileUploaderButton.js +6 -5
- package/es/components/FileUploader/FileUploaderDropContainer.d.ts +2 -3
- package/es/components/FileUploader/FileUploaderDropContainer.js +5 -5
- package/es/components/FileUploader/FileUploaderItem.d.ts +2 -3
- package/es/components/FileUploader/FileUploaderItem.js +13 -13
- package/es/components/FileUploader/Filename.d.ts +3 -4
- package/es/components/FileUploader/Filename.js +7 -7
- package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +5 -5
- package/es/components/FluidComboBox/FluidComboBox.js +4 -4
- package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +11 -11
- package/es/components/FluidDatePicker/FluidDatePicker.js +4 -4
- package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +3 -3
- package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +5 -5
- package/es/components/FluidDropdown/FluidDropdown.js +4 -4
- package/es/components/FluidForm/FluidForm.d.ts +3 -4
- package/es/components/FluidForm/FluidForm.js +3 -3
- package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +5 -5
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +5 -5
- package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.js +5 -5
- package/es/components/FluidNumberInput/FluidNumberInput.js +4 -4
- package/es/components/FluidSearch/FluidSearch.Skeleton.js +5 -5
- package/es/components/FluidSearch/FluidSearch.js +4 -4
- package/es/components/FluidSelect/FluidSelect.Skeleton.js +5 -5
- package/es/components/FluidSelect/FluidSelect.js +4 -4
- package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +5 -5
- package/es/components/FluidTextArea/FluidTextArea.js +3 -3
- package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +5 -5
- package/es/components/FluidTextInput/FluidTextInput.js +5 -5
- package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +3 -3
- package/es/components/FluidTimePicker/FluidTimePicker.js +13 -13
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +3 -3
- package/es/components/Form/Form.js +2 -2
- package/es/components/FormGroup/FormGroup.d.ts +3 -4
- package/es/components/FormGroup/FormGroup.js +4 -4
- package/es/components/FormItem/FormItem.js +2 -2
- package/es/components/FormLabel/FormLabel.js +2 -2
- package/es/components/Grid/CSSGrid.js +8 -8
- package/es/components/Grid/Column.d.ts +5 -5
- package/es/components/Grid/Column.js +15 -15
- package/es/components/Grid/ColumnHang.js +2 -2
- package/es/components/Grid/FlexGrid.js +4 -4
- package/es/components/Grid/Grid.js +3 -3
- package/es/components/Grid/GridContext.d.ts +2 -2
- package/es/components/Grid/GridContext.js +1 -1
- package/es/components/Grid/Row.js +2 -2
- package/es/components/Heading/index.js +9 -9
- package/es/components/Icon/Icon.Skeleton.js +2 -2
- package/es/components/IconButton/index.js +11 -6
- package/es/components/IconIndicator/index.js +4 -4
- package/es/components/IdPrefix/index.js +2 -2
- package/es/components/InlineCheckbox/InlineCheckbox.js +6 -6
- package/es/components/InlineLoading/InlineLoading.js +10 -10
- package/es/components/Layer/LayerContext.js +2 -2
- package/es/components/Layer/index.d.ts +4 -0
- package/es/components/Layer/index.js +15 -8
- package/es/components/Layout/index.js +5 -5
- package/es/components/LayoutDirection/LayoutDirection.js +4 -4
- package/es/components/LayoutDirection/LayoutDirectionContext.js +2 -2
- package/es/components/LayoutDirection/index.d.ts +8 -0
- package/es/components/Link/Link.js +6 -6
- package/es/components/ListBox/ListBox.d.ts +2 -3
- package/es/components/ListBox/ListBox.js +5 -5
- package/es/components/ListBox/ListBoxField.d.ts +3 -4
- package/es/components/ListBox/ListBoxField.js +2 -2
- package/es/components/ListBox/ListBoxMenu.d.ts +2 -3
- package/es/components/ListBox/ListBoxMenu.js +2 -2
- package/es/components/ListBox/ListBoxMenuIcon.js +4 -4
- package/es/components/ListBox/ListBoxMenuItem.d.ts +2 -3
- package/es/components/ListBox/ListBoxMenuItem.js +3 -3
- package/es/components/ListBox/ListBoxSelection.js +6 -6
- package/es/components/ListBox/next/ListBoxSelection.js +7 -7
- package/es/components/ListBox/next/ListBoxTrigger.js +4 -4
- package/es/components/ListItem/ListItem.js +2 -2
- package/es/components/Loading/Loading.d.ts +3 -3
- package/es/components/Loading/Loading.js +6 -6
- package/es/components/Menu/Menu.js +5 -4
- package/es/components/Menu/MenuItem.js +18 -17
- package/es/components/MenuButton/index.js +4 -4
- package/es/components/Modal/Modal.d.ts +3 -4
- package/es/components/Modal/Modal.js +40 -38
- package/es/components/ModalWrapper/ModalWrapper.js +7 -7
- package/es/components/MultiSelect/FilterableMultiSelect.js +22 -26
- package/es/components/MultiSelect/MultiSelect.js +23 -23
- package/es/components/Notification/Notification.js +41 -41
- package/es/components/NumberInput/NumberInput.Skeleton.js +4 -4
- package/es/components/NumberInput/NumberInput.js +22 -22
- package/es/components/OrderedList/OrderedList.js +2 -2
- package/es/components/OverflowMenu/OverflowMenu.js +7 -7
- package/es/components/OverflowMenu/index.js +3 -3
- package/es/components/OverflowMenu/next/index.js +6 -6
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +4 -4
- package/es/components/OverflowMenuV2/index.js +3 -3
- package/es/components/PageHeader/PageHeader.js +29 -29
- package/es/components/Pagination/Pagination.Skeleton.js +8 -8
- package/es/components/Pagination/Pagination.js +17 -17
- package/es/components/Pagination/experimental/PageSelector.js +3 -3
- package/es/components/Pagination/experimental/Pagination.js +14 -14
- package/es/components/PaginationNav/PaginationNav.js +31 -31
- package/es/components/Popover/index.js +15 -15
- package/es/components/PrimaryButton/PrimaryButton.js +2 -2
- package/es/components/ProgressBar/ProgressBar.js +13 -13
- package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +7 -7
- package/es/components/ProgressIndicator/ProgressIndicator.js +20 -20
- package/es/components/RadioButton/RadioButton.Skeleton.js +4 -4
- package/es/components/RadioButton/RadioButton.js +10 -10
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +16 -16
- package/es/components/RadioTile/RadioTile.js +12 -12
- package/es/components/Search/Search.Skeleton.js +4 -4
- package/es/components/Search/Search.js +11 -11
- package/es/components/SecondaryButton/SecondaryButton.js +2 -2
- package/es/components/Select/Select.Skeleton.js +5 -5
- package/es/components/Select/Select.js +19 -19
- package/es/components/SelectItem/SelectItem.js +2 -2
- package/es/components/SelectItemGroup/SelectItemGroup.js +2 -2
- package/es/components/ShapeIndicator/index.js +7 -7
- package/es/components/SkeletonIcon/SkeletonIcon.d.ts +0 -4
- package/es/components/SkeletonIcon/SkeletonIcon.js +3 -7
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +2 -2
- package/es/components/SkeletonText/SkeletonText.js +4 -4
- package/es/components/Slider/Slider.Skeleton.js +17 -17
- package/es/components/Slider/Slider.d.ts +8 -0
- package/es/components/Slider/Slider.js +44 -38
- package/es/components/Slider/SliderHandles.js +19 -19
- package/es/components/Stack/HStack.js +2 -2
- package/es/components/Stack/Stack.js +2 -2
- package/es/components/Stack/VStack.js +2 -2
- package/es/components/StructuredList/StructuredList.Skeleton.js +12 -12
- package/es/components/StructuredList/StructuredList.js +24 -24
- package/es/components/Switch/IconSwitch.js +3 -3
- package/es/components/Switch/Switch.js +4 -4
- package/es/components/TabContent/TabContent.js +2 -2
- package/es/components/Tabs/Tabs.Skeleton.js +7 -7
- package/es/components/Tabs/Tabs.js +65 -62
- package/es/components/Tag/DismissibleTag.d.ts +4 -0
- package/es/components/Tag/DismissibleTag.js +18 -13
- package/es/components/Tag/OperationalTag.js +6 -6
- package/es/components/Tag/SelectableTag.d.ts +4 -0
- package/es/components/Tag/SelectableTag.js +18 -9
- package/es/components/Tag/Tag.Skeleton.js +2 -2
- package/es/components/Tag/Tag.js +15 -15
- package/es/components/Text/Text.js +4 -4
- package/es/components/Text/TextDirection.js +2 -2
- package/es/components/Text/createTextComponent.js +2 -2
- package/es/components/TextArea/TextArea.Skeleton.js +4 -4
- package/es/components/TextArea/TextArea.js +19 -19
- package/es/components/TextInput/ControlledPasswordInput.d.ts +2 -3
- package/es/components/TextInput/ControlledPasswordInput.js +13 -13
- package/es/components/TextInput/PasswordInput.js +15 -15
- package/es/components/TextInput/TextInput.Skeleton.js +4 -4
- package/es/components/TextInput/TextInput.js +17 -17
- package/es/components/Theme/index.js +10 -10
- package/es/components/Tile/Tile.js +36 -36
- package/es/components/TileGroup/TileGroup.d.ts +3 -4
- package/es/components/TileGroup/TileGroup.js +8 -8
- package/es/components/TimePicker/TimePicker.d.ts +2 -3
- package/es/components/TimePicker/TimePicker.js +14 -14
- package/es/components/TimePickerSelect/TimePickerSelect.js +4 -4
- package/es/components/Toggle/Toggle.Skeleton.js +4 -4
- package/es/components/Toggle/Toggle.js +10 -10
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +8 -8
- package/es/components/Toggletip/index.js +12 -12
- package/es/components/Tooltip/DefinitionTooltip.js +4 -4
- package/es/components/Tooltip/Tooltip.d.ts +3 -0
- package/es/components/Tooltip/Tooltip.js +25 -13
- package/es/components/TreeView/TreeNode.js +45 -36
- package/es/components/TreeView/TreeView.js +30 -21
- package/es/components/UIShell/Content.js +2 -2
- package/es/components/UIShell/Header.js +2 -2
- package/es/components/UIShell/HeaderContainer.js +2 -2
- package/es/components/UIShell/HeaderGlobalAction.js +3 -3
- package/es/components/UIShell/HeaderGlobalBar.d.ts +1 -1
- package/es/components/UIShell/HeaderMenu.js +14 -14
- package/es/components/UIShell/HeaderMenuButton.js +4 -4
- package/es/components/UIShell/HeaderMenuItem.js +11 -9
- package/es/components/UIShell/HeaderName.js +3 -3
- package/es/components/UIShell/HeaderNavigation.js +3 -3
- package/es/components/UIShell/HeaderPanel.js +3 -3
- package/es/components/UIShell/HeaderSideNavItems.js +2 -2
- package/es/components/UIShell/Link.js +3 -3
- package/es/components/UIShell/SideNav.js +7 -7
- package/es/components/UIShell/SideNavDetails.js +3 -3
- package/es/components/UIShell/SideNavDivider.js +3 -3
- package/es/components/UIShell/SideNavFooter.js +7 -7
- package/es/components/UIShell/SideNavHeader.js +3 -3
- package/es/components/UIShell/SideNavIcon.js +2 -2
- package/es/components/UIShell/SideNavItem.js +2 -2
- package/es/components/UIShell/SideNavItems.js +5 -5
- package/es/components/UIShell/SideNavLink.js +5 -5
- package/es/components/UIShell/SideNavLinkText.js +2 -2
- package/es/components/UIShell/SideNavMenu.js +10 -10
- package/es/components/UIShell/SideNavMenuItem.js +5 -5
- package/es/components/UIShell/SideNavSwitcher.js +8 -8
- package/es/components/UIShell/SkipToContent.js +2 -2
- package/es/components/UIShell/Switcher.js +9 -9
- package/es/components/UIShell/SwitcherDivider.js +2 -2
- package/es/components/UIShell/SwitcherItem.js +3 -3
- package/es/components/UnorderedList/UnorderedList.js +2 -2
- package/es/feature-flags.d.ts +7 -0
- package/es/index.js +25 -26
- package/es/internal/FloatingMenu.js +4 -4
- package/es/internal/__mocks__/mockHTMLElement.d.ts +9 -0
- package/es/internal/createClassWrapper.js +2 -2
- package/es/internal/debounce.d.ts +8 -0
- package/es/internal/environment.d.ts +12 -0
- package/es/internal/useId.js +2 -2
- package/es/internal/useIdPrefix.js +3 -3
- package/es/internal/useNormalizedInputProps.js +3 -3
- package/es/internal/usePrefix.js +3 -3
- package/es/internal/usePreviousValue.d.ts +17 -0
- package/es/internal/usePreviousValue.js +28 -0
- package/es/internal/useResizeObserver.d.ts +14 -0
- package/es/internal/useResizeObserver.js +74 -0
- package/es/internal/wrapFocus.js +3 -6
- package/es/prop-types/AriaPropTypes.d.ts +8 -0
- package/es/tools/wrapComponent.d.ts +3 -4
- package/es/tools/wrapComponent.js +2 -2
- package/es/types/common.d.ts +0 -2
- package/lib/components/AccordionItem/index.d.ts +9 -0
- package/lib/components/CodeSnippet/CodeSnippet.js +2 -3
- package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +8 -0
- package/lib/components/ContentSwitcher/ContentSwitcher.js +7 -1
- package/lib/components/DataTable/DataTable.d.ts +81 -283
- package/lib/components/DataTable/DataTable.js +82 -123
- package/lib/components/DataTable/Table.d.ts +2 -2
- package/lib/components/DataTable/TableActionList.d.ts +1 -1
- package/lib/components/DataTable/TableBody.d.ts +3 -3
- package/lib/components/DataTable/TableCell.d.ts +3 -4
- package/lib/components/DataTable/TableContainer.d.ts +2 -3
- package/lib/components/DataTable/TableExpandHeader.d.ts +2 -3
- package/lib/components/DataTable/TableExpandedRow.d.ts +3 -3
- package/lib/components/DataTable/TableHead.d.ts +1 -1
- package/lib/components/DataTable/TableHeader.d.ts +4 -4
- package/lib/components/DataTable/TableRow.d.ts +3 -4
- package/lib/components/DataTable/TableToolbarContent.d.ts +1 -1
- package/lib/components/DataTable/index.d.ts +1 -1
- package/lib/components/DatePicker/DatePicker.d.ts +1 -1
- package/lib/components/DatePicker/DatePicker.js +6 -3
- package/lib/components/DatePickerInput/DatePickerInput.d.ts +3 -4
- package/lib/components/Dialog/index.d.ts +5 -6
- package/lib/components/Dropdown/Dropdown.Skeleton.d.ts +2 -3
- package/lib/components/Dropdown/Dropdown.d.ts +3 -3
- package/lib/components/FileUploader/FileUploader.Skeleton.d.ts +3 -3
- package/lib/components/FileUploader/FileUploader.d.ts +2 -3
- package/lib/components/FileUploader/FileUploaderButton.d.ts +3 -4
- package/lib/components/FileUploader/FileUploaderButton.js +3 -2
- package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +2 -3
- package/lib/components/FileUploader/FileUploaderItem.d.ts +2 -3
- package/lib/components/FileUploader/Filename.d.ts +3 -4
- package/lib/components/FluidForm/FluidForm.d.ts +3 -4
- package/lib/components/FormGroup/FormGroup.d.ts +3 -4
- package/lib/components/Grid/Column.d.ts +5 -5
- package/lib/components/Grid/Column.js +10 -10
- package/lib/components/Grid/GridContext.d.ts +2 -2
- package/lib/components/Grid/GridContext.js +5 -23
- package/lib/components/IconButton/index.js +6 -1
- package/lib/components/Layer/index.d.ts +4 -0
- package/lib/components/Layer/index.js +9 -2
- package/lib/components/LayoutDirection/index.d.ts +8 -0
- package/lib/components/Link/Link.js +1 -1
- package/lib/components/ListBox/ListBox.d.ts +2 -3
- package/lib/components/ListBox/ListBoxField.d.ts +3 -4
- package/lib/components/ListBox/ListBoxMenu.d.ts +2 -3
- package/lib/components/ListBox/ListBoxMenuItem.d.ts +2 -3
- package/lib/components/Loading/Loading.d.ts +3 -3
- package/lib/components/Menu/Menu.js +2 -1
- package/lib/components/Menu/MenuItem.js +2 -1
- package/lib/components/Modal/Modal.d.ts +3 -4
- package/lib/components/Modal/Modal.js +5 -3
- package/lib/components/MultiSelect/FilterableMultiSelect.js +1 -5
- package/lib/components/SkeletonIcon/SkeletonIcon.d.ts +0 -4
- package/lib/components/SkeletonIcon/SkeletonIcon.js +1 -5
- package/lib/components/Slider/Slider.d.ts +8 -0
- package/lib/components/Slider/Slider.js +6 -0
- package/lib/components/Tabs/Tabs.js +5 -2
- package/lib/components/Tag/DismissibleTag.d.ts +4 -0
- package/lib/components/Tag/DismissibleTag.js +8 -3
- package/lib/components/Tag/SelectableTag.d.ts +4 -0
- package/lib/components/Tag/SelectableTag.js +12 -3
- package/lib/components/TextInput/ControlledPasswordInput.d.ts +2 -3
- package/lib/components/TileGroup/TileGroup.d.ts +3 -4
- package/lib/components/TimePicker/TimePicker.d.ts +2 -3
- package/lib/components/Tooltip/Tooltip.d.ts +3 -0
- package/lib/components/Tooltip/Tooltip.js +18 -6
- package/lib/components/TreeView/TreeNode.js +20 -11
- package/lib/components/TreeView/TreeView.js +27 -18
- package/lib/components/UIShell/HeaderGlobalBar.d.ts +1 -1
- package/lib/components/UIShell/HeaderMenuItem.js +7 -5
- package/lib/components/UIShell/Switcher.js +3 -3
- package/lib/feature-flags.d.ts +7 -0
- package/lib/index.js +50 -51
- package/lib/internal/__mocks__/mockHTMLElement.d.ts +9 -0
- package/lib/internal/debounce.d.ts +8 -0
- package/lib/internal/environment.d.ts +12 -0
- package/lib/internal/usePreviousValue.d.ts +17 -0
- package/lib/internal/usePreviousValue.js +32 -0
- package/lib/internal/useResizeObserver.d.ts +14 -0
- package/lib/internal/useResizeObserver.js +78 -0
- package/lib/internal/wrapFocus.js +3 -6
- package/lib/prop-types/AriaPropTypes.d.ts +8 -0
- package/lib/tools/wrapComponent.d.ts +3 -4
- package/lib/types/common.d.ts +0 -2
- package/package.json +5 -6
- package/scss/components/content-switcher/_tokens.scss +9 -0
- package/telemetry.yml +5 -1
- package/es/components/DataTable/index.js +0 -76
- package/es/prop-types/tools/getDisplayName.js +0 -34
- package/es/prop-types/types.js +0 -13
- package/lib/components/DataTable/index.js +0 -82
- package/lib/prop-types/tools/getDisplayName.js +0 -38
- package/lib/prop-types/types.js +0 -17
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import cx from 'classnames';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
|
-
import
|
|
11
|
+
import React from 'react';
|
|
12
12
|
import SideNavLinkText from './SideNavLinkText.js';
|
|
13
13
|
import Link from './Link.js';
|
|
14
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
15
15
|
|
|
16
|
-
const SideNavMenuItem = /*#__PURE__*/
|
|
16
|
+
const SideNavMenuItem = /*#__PURE__*/React.forwardRef(function SideNavMenuItem(props, ref) {
|
|
17
17
|
const prefix = usePrefix();
|
|
18
18
|
const {
|
|
19
19
|
children,
|
|
@@ -27,12 +27,12 @@ const SideNavMenuItem = /*#__PURE__*/React__default.forwardRef(function SideNavM
|
|
|
27
27
|
[`${prefix}--side-nav__link`]: true,
|
|
28
28
|
[`${prefix}--side-nav__link--current`]: isActive
|
|
29
29
|
});
|
|
30
|
-
return /*#__PURE__*/
|
|
30
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
31
31
|
className: className
|
|
32
|
-
}, /*#__PURE__*/
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Component, _extends({}, rest, {
|
|
33
33
|
className: linkClassName,
|
|
34
34
|
ref: ref
|
|
35
|
-
}), /*#__PURE__*/
|
|
35
|
+
}), /*#__PURE__*/React.createElement(SideNavLinkText, null, children)));
|
|
36
36
|
});
|
|
37
37
|
SideNavMenuItem.displayName = 'SideNavMenuItem';
|
|
38
38
|
SideNavMenuItem.propTypes = {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { ChevronDown } from '@carbon/icons-react';
|
|
9
9
|
import cx from 'classnames';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
|
-
import
|
|
11
|
+
import React, { forwardRef } from 'react';
|
|
12
12
|
import { useId } from '../../internal/useId.js';
|
|
13
13
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
14
|
|
|
@@ -25,30 +25,30 @@ const SideNavSwitcher = /*#__PURE__*/forwardRef(function SideNavSwitcher(props,
|
|
|
25
25
|
const className = cx(`${prefix}--side-nav__switcher`, customClassName);
|
|
26
26
|
|
|
27
27
|
// Note for usage around `onBlur`: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-onchange.md
|
|
28
|
-
return /*#__PURE__*/
|
|
28
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
29
29
|
className: className
|
|
30
|
-
}, /*#__PURE__*/
|
|
30
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
31
31
|
htmlFor: id,
|
|
32
32
|
className: `${prefix}--assistive-text`
|
|
33
|
-
}, labelText), /*#__PURE__*/
|
|
33
|
+
}, labelText), /*#__PURE__*/React.createElement("select", {
|
|
34
34
|
id: id,
|
|
35
35
|
className: `${prefix}--side-nav__select`,
|
|
36
36
|
defaultValue: "",
|
|
37
37
|
onBlur: onChange,
|
|
38
38
|
onChange: onChange,
|
|
39
39
|
ref: ref
|
|
40
|
-
}, /*#__PURE__*/
|
|
40
|
+
}, /*#__PURE__*/React.createElement("option", {
|
|
41
41
|
className: `${prefix}--side-nav__option`,
|
|
42
42
|
disabled: true,
|
|
43
43
|
hidden: true,
|
|
44
44
|
value: ""
|
|
45
|
-
}, labelText), options.map(option => /*#__PURE__*/
|
|
45
|
+
}, labelText), options.map(option => /*#__PURE__*/React.createElement("option", {
|
|
46
46
|
key: option,
|
|
47
47
|
className: `${prefix}--side-nav__option`,
|
|
48
48
|
value: option
|
|
49
|
-
}, option))), /*#__PURE__*/
|
|
49
|
+
}, option))), /*#__PURE__*/React.createElement("div", {
|
|
50
50
|
className: `${prefix}--side-nav__switcher-chevron`
|
|
51
|
-
}, _ChevronDown || (_ChevronDown = /*#__PURE__*/
|
|
51
|
+
}, _ChevronDown || (_ChevronDown = /*#__PURE__*/React.createElement(ChevronDown, {
|
|
52
52
|
size: 20
|
|
53
53
|
}))));
|
|
54
54
|
});
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import cx from 'classnames';
|
|
10
|
-
import
|
|
10
|
+
import React from 'react';
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
|
|
@@ -21,7 +21,7 @@ function SkipToContent(_ref) {
|
|
|
21
21
|
} = _ref;
|
|
22
22
|
const prefix = usePrefix();
|
|
23
23
|
const className = cx(`${prefix}--skip-to-content`, customClassName);
|
|
24
|
-
return /*#__PURE__*/
|
|
24
|
+
return /*#__PURE__*/React.createElement("a", _extends({}, rest, {
|
|
25
25
|
className: className,
|
|
26
26
|
href: href,
|
|
27
27
|
tabIndex: tabIndex
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
-
import
|
|
9
|
+
import React, { forwardRef, useRef } from 'react';
|
|
10
10
|
import cx from 'classnames';
|
|
11
11
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
12
12
|
import { useMergedRefs } from '../../internal/useMergedRefs.js';
|
|
13
13
|
import PropTypes from 'prop-types';
|
|
14
14
|
import { AriaLabelPropType } from '../../prop-types/AriaPropTypes.js';
|
|
15
|
-
import
|
|
15
|
+
import SwitcherItem from './SwitcherItem.js';
|
|
16
16
|
|
|
17
17
|
const Switcher = /*#__PURE__*/forwardRef(function Switcher(props, forwardRef) {
|
|
18
18
|
const switcherRef = useRef(null);
|
|
@@ -37,8 +37,8 @@ const Switcher = /*#__PURE__*/forwardRef(function Switcher(props, forwardRef) {
|
|
|
37
37
|
currentIndex,
|
|
38
38
|
direction
|
|
39
39
|
} = _ref;
|
|
40
|
-
const enabledIndices =
|
|
41
|
-
if (/*#__PURE__*/
|
|
40
|
+
const enabledIndices = React.Children.toArray(children).reduce((acc, curr, i) => {
|
|
41
|
+
if (/*#__PURE__*/React.isValidElement(curr) && Object.keys(curr.props).length !== 0 && curr.type === SwitcherItem) {
|
|
42
42
|
acc.push(i);
|
|
43
43
|
}
|
|
44
44
|
return acc;
|
|
@@ -64,23 +64,23 @@ const Switcher = /*#__PURE__*/forwardRef(function Switcher(props, forwardRef) {
|
|
|
64
64
|
switcherItem.focus();
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
-
const childrenWithProps =
|
|
67
|
+
const childrenWithProps = React.Children.toArray(children).map((child, index) => {
|
|
68
68
|
// only setup click handlers if onChange event is passed
|
|
69
|
-
if (/*#__PURE__*/
|
|
70
|
-
return /*#__PURE__*/
|
|
69
|
+
if (/*#__PURE__*/React.isValidElement(child) && child.type === SwitcherItem) {
|
|
70
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
71
71
|
handleSwitcherItemFocus,
|
|
72
72
|
index,
|
|
73
73
|
key: index,
|
|
74
74
|
expanded
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
return /*#__PURE__*/
|
|
77
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
78
78
|
index,
|
|
79
79
|
key: index,
|
|
80
80
|
expanded
|
|
81
81
|
});
|
|
82
82
|
});
|
|
83
|
-
return /*#__PURE__*/
|
|
83
|
+
return /*#__PURE__*/React.createElement("ul", _extends({
|
|
84
84
|
ref: ref,
|
|
85
85
|
className: className
|
|
86
86
|
}, accessibilityLabel), childrenWithProps);
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
-
import
|
|
9
|
+
import React from 'react';
|
|
10
10
|
import cx from 'classnames';
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
@@ -20,7 +20,7 @@ const SwitcherDivider = _ref => {
|
|
|
20
20
|
const classNames = cx(`${prefix}--switcher__item--divider`, {
|
|
21
21
|
[customClassName || '']: !!customClassName
|
|
22
22
|
});
|
|
23
|
-
return /*#__PURE__*/
|
|
23
|
+
return /*#__PURE__*/React.createElement("hr", _extends({}, other, {
|
|
24
24
|
className: classNames
|
|
25
25
|
}));
|
|
26
26
|
};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
-
import
|
|
9
|
+
import React, { forwardRef } from 'react';
|
|
10
10
|
import cx from 'classnames';
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
12
|
import Link from './Link.js';
|
|
@@ -59,9 +59,9 @@ const SwitcherItem = /*#__PURE__*/forwardRef(function SwitcherItem(props, forwar
|
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
return /*#__PURE__*/
|
|
62
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
63
63
|
className: classNames
|
|
64
|
-
}, /*#__PURE__*/
|
|
64
|
+
}, /*#__PURE__*/React.createElement(Link, _extends({
|
|
65
65
|
onKeyDown: evt => {
|
|
66
66
|
setTabFocus(evt);
|
|
67
67
|
onKeyDown(evt);
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
|
-
import
|
|
10
|
+
import React from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
|
|
@@ -23,7 +23,7 @@ function UnorderedList(_ref) {
|
|
|
23
23
|
[`${prefix}--list--nested`]: nested,
|
|
24
24
|
[`${prefix}--list--expressive`]: isExpressive
|
|
25
25
|
});
|
|
26
|
-
return /*#__PURE__*/
|
|
26
|
+
return /*#__PURE__*/React.createElement("ul", _extends({
|
|
27
27
|
className: classNames
|
|
28
28
|
}, other));
|
|
29
29
|
}
|
package/es/index.js
CHANGED
|
@@ -33,7 +33,29 @@ export { default as useContextMenu } from './components/ContextMenu/useContextMe
|
|
|
33
33
|
export { default as Copy } from './components/Copy/Copy.js';
|
|
34
34
|
export { default as CopyButton } from './components/CopyButton/CopyButton.js';
|
|
35
35
|
export { default as DangerButton } from './components/DangerButton/DangerButton.js';
|
|
36
|
-
|
|
36
|
+
export { default as DataTable } from './components/DataTable/DataTable.js';
|
|
37
|
+
export { Table } from './components/DataTable/Table.js';
|
|
38
|
+
export { default as TableActionList } from './components/DataTable/TableActionList.js';
|
|
39
|
+
export { default as TableBatchAction } from './components/DataTable/TableBatchAction.js';
|
|
40
|
+
export { default as TableBatchActions } from './components/DataTable/TableBatchActions.js';
|
|
41
|
+
export { default as TableBody } from './components/DataTable/TableBody.js';
|
|
42
|
+
export { default as TableCell } from './components/DataTable/TableCell.js';
|
|
43
|
+
export { default as TableContainer } from './components/DataTable/TableContainer.js';
|
|
44
|
+
export { default as TableExpandHeader } from './components/DataTable/TableExpandHeader.js';
|
|
45
|
+
export { default as TableDecoratorRow } from './components/DataTable/TableDecoratorRow.js';
|
|
46
|
+
export { default as TableExpandRow } from './components/DataTable/TableExpandRow.js';
|
|
47
|
+
export { default as TableExpandedRow } from './components/DataTable/TableExpandedRow.js';
|
|
48
|
+
export { default as TableHead } from './components/DataTable/TableHead.js';
|
|
49
|
+
export { default as TableHeader } from './components/DataTable/TableHeader.js';
|
|
50
|
+
export { default as TableRow } from './components/DataTable/TableRow.js';
|
|
51
|
+
export { default as TableSelectAll } from './components/DataTable/TableSelectAll.js';
|
|
52
|
+
export { default as TableSelectRow } from './components/DataTable/TableSelectRow.js';
|
|
53
|
+
export { default as TableSlugRow } from './components/DataTable/TableSlugRow.js';
|
|
54
|
+
export { default as TableToolbar } from './components/DataTable/TableToolbar.js';
|
|
55
|
+
export { default as TableToolbarAction } from './components/DataTable/TableToolbarAction.js';
|
|
56
|
+
export { default as TableToolbarContent } from './components/DataTable/TableToolbarContent.js';
|
|
57
|
+
export { default as TableToolbarSearch } from './components/DataTable/TableToolbarSearch.js';
|
|
58
|
+
export { default as TableToolbarMenu } from './components/DataTable/TableToolbarMenu.js';
|
|
37
59
|
export { default as DataTableSkeleton } from './components/DataTableSkeleton/DataTableSkeleton.js';
|
|
38
60
|
export { default as DatePicker } from './components/DatePicker/DatePicker.js';
|
|
39
61
|
export { default as DatePickerSkeleton } from './components/DatePicker/DatePicker.Skeleton.js';
|
|
@@ -192,6 +214,8 @@ export { Heading, Section } from './components/Heading/index.js';
|
|
|
192
214
|
export { IconButton, IconButtonKinds } from './components/IconButton/index.js';
|
|
193
215
|
export { Layer, useLayer } from './components/Layer/index.js';
|
|
194
216
|
export { Layout as unstable_Layout } from './components/Layout/index.js';
|
|
217
|
+
export { LayoutDirection as unstable_LayoutDirection } from './components/LayoutDirection/LayoutDirection.js';
|
|
218
|
+
export { useLayoutDirection as unstable_useLayoutDirection } from './components/LayoutDirection/useLayoutDirection.js';
|
|
195
219
|
export { OverflowMenuV2 as unstable_OverflowMenuV2 } from './components/OverflowMenuV2/index.js';
|
|
196
220
|
export { Popover, PopoverContent } from './components/Popover/index.js';
|
|
197
221
|
export { default as ProgressBar } from './components/ProgressBar/ProgressBar.js';
|
|
@@ -214,30 +238,5 @@ export { default as unstable_Pagination } from './components/Pagination/experime
|
|
|
214
238
|
export { default as ContainedListItem } from './components/ContainedList/ContainedListItem/ContainedListItem.js';
|
|
215
239
|
export { default as ContainedList } from './components/ContainedList/ContainedList.js';
|
|
216
240
|
export { default as SliderSkeleton } from './components/Slider/Slider.Skeleton.js';
|
|
217
|
-
export { LayoutDirection as unstable_LayoutDirection } from './components/LayoutDirection/LayoutDirection.js';
|
|
218
|
-
export { useLayoutDirection as unstable_useLayoutDirection } from './components/LayoutDirection/useLayoutDirection.js';
|
|
219
241
|
export { Text as unstable_Text } from './components/Text/Text.js';
|
|
220
242
|
export { TextDirection as unstable_TextDirection } from './components/Text/TextDirection.js';
|
|
221
|
-
export { default as DataTable } from './components/DataTable/DataTable.js';
|
|
222
|
-
export { Table } from './components/DataTable/Table.js';
|
|
223
|
-
export { default as TableActionList } from './components/DataTable/TableActionList.js';
|
|
224
|
-
export { default as TableBatchAction } from './components/DataTable/TableBatchAction.js';
|
|
225
|
-
export { default as TableBatchActions } from './components/DataTable/TableBatchActions.js';
|
|
226
|
-
export { default as TableBody } from './components/DataTable/TableBody.js';
|
|
227
|
-
export { default as TableCell } from './components/DataTable/TableCell.js';
|
|
228
|
-
export { default as TableContainer } from './components/DataTable/TableContainer.js';
|
|
229
|
-
export { default as TableDecoratorRow } from './components/DataTable/TableDecoratorRow.js';
|
|
230
|
-
export { default as TableExpandHeader } from './components/DataTable/TableExpandHeader.js';
|
|
231
|
-
export { default as TableExpandRow } from './components/DataTable/TableExpandRow.js';
|
|
232
|
-
export { default as TableExpandedRow } from './components/DataTable/TableExpandedRow.js';
|
|
233
|
-
export { default as TableHead } from './components/DataTable/TableHead.js';
|
|
234
|
-
export { default as TableHeader } from './components/DataTable/TableHeader.js';
|
|
235
|
-
export { default as TableRow } from './components/DataTable/TableRow.js';
|
|
236
|
-
export { default as TableSelectAll } from './components/DataTable/TableSelectAll.js';
|
|
237
|
-
export { default as TableSelectRow } from './components/DataTable/TableSelectRow.js';
|
|
238
|
-
export { default as TableSlugRow } from './components/DataTable/TableSlugRow.js';
|
|
239
|
-
export { default as TableToolbar } from './components/DataTable/TableToolbar.js';
|
|
240
|
-
export { default as TableToolbarAction } from './components/DataTable/TableToolbarAction.js';
|
|
241
|
-
export { default as TableToolbarContent } from './components/DataTable/TableToolbarContent.js';
|
|
242
|
-
export { default as TableToolbarSearch } from './components/DataTable/TableToolbarSearch.js';
|
|
243
|
-
export { default as TableToolbarMenu } from './components/DataTable/TableToolbarMenu.js';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import React, { useContext, useState, useRef, useCallback, useEffect, cloneElement } from 'react';
|
|
9
9
|
import * as FeatureFlags from '@carbon/feature-flags';
|
|
10
10
|
import ReactDOM from 'react-dom';
|
|
11
11
|
import window from 'window-or-global';
|
|
@@ -276,15 +276,15 @@ const FloatingMenu = _ref2 => {
|
|
|
276
276
|
const focusTrapWithoutSentinels = FeatureFlags.enabled('enable-experimental-focus-wrap-without-sentinels');
|
|
277
277
|
if (typeof document !== 'undefined') {
|
|
278
278
|
const portalTarget = target ? target() : document.body;
|
|
279
|
-
return /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/
|
|
279
|
+
return /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/React.createElement("div", {
|
|
280
280
|
onBlur: focusTrap && !focusTrapWithoutSentinels ? handleBlur : undefined,
|
|
281
281
|
onKeyDown: focusTrapWithoutSentinels ? handleKeyDown : undefined
|
|
282
|
-
}, !focusTrapWithoutSentinels && /*#__PURE__*/
|
|
282
|
+
}, !focusTrapWithoutSentinels && /*#__PURE__*/React.createElement("span", {
|
|
283
283
|
ref: startSentinelRef,
|
|
284
284
|
tabIndex: 0,
|
|
285
285
|
role: "link",
|
|
286
286
|
className: `${prefix}--visually-hidden`
|
|
287
|
-
}, "Focus sentinel"), getChildrenWithProps(), !focusTrapWithoutSentinels && /*#__PURE__*/
|
|
287
|
+
}, "Focus sentinel"), getChildrenWithProps(), !focusTrapWithoutSentinels && /*#__PURE__*/React.createElement("span", {
|
|
288
288
|
ref: endSentinelRef,
|
|
289
289
|
tabIndex: 0,
|
|
290
290
|
role: "link",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025, 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
export declare const mockHTMLElement: (options: HTMLElement) => {
|
|
8
|
+
mockRestore: () => void;
|
|
9
|
+
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import React from 'react';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Wrap a class component with a functional component. This prevents an end-user
|
|
@@ -13,7 +13,7 @@ import React__default from 'react';
|
|
|
13
13
|
*/
|
|
14
14
|
const createClassWrapper = Component => {
|
|
15
15
|
const ClassWrapper = props => {
|
|
16
|
-
return /*#__PURE__*/
|
|
16
|
+
return /*#__PURE__*/React.createElement(Component, props);
|
|
17
17
|
};
|
|
18
18
|
const name = Component.displayName || Component.name;
|
|
19
19
|
ClassWrapper.displayName = `ClassWrapper(${name})`;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Indicate whether current execution environment can access the DOM.
|
|
9
|
+
*
|
|
10
|
+
* @see https://github.com/facebook/fbjs/blob/4d1751311d3f67af2dcce2e40df8512a23c7b9c6/packages/fbjs/src/core/ExecutionEnvironment.js#L12
|
|
11
|
+
*/
|
|
12
|
+
export declare const canUseDOM: boolean;
|
package/es/internal/useId.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import React, { useState, useEffect, useLayoutEffect } from 'react';
|
|
9
9
|
import { setupGetInstanceId } from '../tools/setupGetInstanceId.js';
|
|
10
10
|
import { canUseDOM } from './environment.js';
|
|
11
11
|
import { useIdPrefix } from './useIdPrefix.js';
|
|
@@ -17,7 +17,7 @@ import { useIdPrefix } from './useIdPrefix.js';
|
|
|
17
17
|
// https://github.com/webpack/webpack/issues/14814
|
|
18
18
|
// https://github.com/mui/material-ui/issues/41190
|
|
19
19
|
const _React = {
|
|
20
|
-
...
|
|
20
|
+
...React
|
|
21
21
|
};
|
|
22
22
|
const instanceId = setupGetInstanceId();
|
|
23
23
|
const useIsomorphicLayoutEffect = canUseDOM ? useLayoutEffect : useEffect;
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import React from 'react';
|
|
9
9
|
|
|
10
|
-
const IdPrefixContext = /*#__PURE__*/
|
|
10
|
+
const IdPrefixContext = /*#__PURE__*/React.createContext(null);
|
|
11
11
|
function useIdPrefix() {
|
|
12
|
-
return
|
|
12
|
+
return React.useContext(IdPrefixContext);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export { IdPrefixContext, useIdPrefix };
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import React from 'react';
|
|
9
9
|
import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
|
|
10
10
|
import '../components/Text/index.js';
|
|
11
11
|
import { usePrefix } from './usePrefix.js';
|
|
@@ -43,14 +43,14 @@ const useNormalizedInputProps = _ref => {
|
|
|
43
43
|
};
|
|
44
44
|
if (normalizedProps.invalid) {
|
|
45
45
|
normalizedProps.icon = WarningFilled;
|
|
46
|
-
normalizedProps.validation = /*#__PURE__*/
|
|
46
|
+
normalizedProps.validation = /*#__PURE__*/React.createElement(Text, {
|
|
47
47
|
as: "div",
|
|
48
48
|
className: `${prefix}--form-requirement`,
|
|
49
49
|
id: normalizedProps.invalidId
|
|
50
50
|
}, invalidText);
|
|
51
51
|
} else if (normalizedProps.warn) {
|
|
52
52
|
normalizedProps.icon = WarningAltFilled;
|
|
53
|
-
normalizedProps.validation = /*#__PURE__*/
|
|
53
|
+
normalizedProps.validation = /*#__PURE__*/React.createElement(Text, {
|
|
54
54
|
as: "div",
|
|
55
55
|
className: `${prefix}--form-requirement`,
|
|
56
56
|
id: normalizedProps.warnId
|
package/es/internal/usePrefix.js
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import React from 'react';
|
|
9
9
|
|
|
10
|
-
const PrefixContext = /*#__PURE__*/
|
|
10
|
+
const PrefixContext = /*#__PURE__*/React.createContext('cds');
|
|
11
11
|
function usePrefix() {
|
|
12
|
-
return
|
|
12
|
+
return React.useContext(PrefixContext);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export { PrefixContext, usePrefix };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Stores the previous value of a given input.
|
|
9
|
+
*
|
|
10
|
+
* @param value - The current value.
|
|
11
|
+
* @returns The value before the current render.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const [count, setCount] = useState(0);
|
|
15
|
+
* const prevCount = usePreviousValue(count);
|
|
16
|
+
*/
|
|
17
|
+
export declare const usePreviousValue: <T>(value: T) => T | undefined;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { useRef, useEffect } from 'react';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Stores the previous value of a given input.
|
|
12
|
+
*
|
|
13
|
+
* @param value - The current value.
|
|
14
|
+
* @returns The value before the current render.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* const [count, setCount] = useState(0);
|
|
18
|
+
* const prevCount = usePreviousValue(count);
|
|
19
|
+
*/
|
|
20
|
+
const usePreviousValue = value => {
|
|
21
|
+
const ref = useRef(undefined);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
ref.current = value;
|
|
24
|
+
}, [value]);
|
|
25
|
+
return ref.current;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { usePreviousValue };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025, 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { RefObject } from 'react';
|
|
8
|
+
export declare const useResizeObserver: ({ ref, onResize, }: {
|
|
9
|
+
ref: RefObject<HTMLElement>;
|
|
10
|
+
onResize?: (rect: DOMRectReadOnly) => void;
|
|
11
|
+
}) => {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { useState, useRef, useEffect, useLayoutEffect } from 'react';
|
|
9
|
+
|
|
10
|
+
const useResizeObserver = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
ref,
|
|
13
|
+
onResize
|
|
14
|
+
} = _ref;
|
|
15
|
+
const [width, setWidth] = useState(-1);
|
|
16
|
+
const [height, setHeight] = useState(-1);
|
|
17
|
+
const entriesToHandle = useRef(null);
|
|
18
|
+
const cb = useRef(onResize);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
// ref for onResize removes it as dependency from useLayoutEffect
|
|
21
|
+
// This significantly reduces repeated calls if a function is redefined on every
|
|
22
|
+
// render
|
|
23
|
+
cb.current = onResize;
|
|
24
|
+
}, [onResize]);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
const getInitialSize = () => {
|
|
27
|
+
if (ref.current) {
|
|
28
|
+
const refComputedStyle = window.getComputedStyle(ref.current);
|
|
29
|
+
const initialWidth = (ref.current?.offsetWidth ?? 0) - (typeof refComputedStyle?.paddingLeft === 'string' && refComputedStyle?.paddingLeft.length ? parseFloat(refComputedStyle?.paddingLeft) : 0) - (typeof refComputedStyle?.paddingRight === 'string' && refComputedStyle?.paddingRight.length ? parseFloat(refComputedStyle?.paddingRight) : 0);
|
|
30
|
+
const initialHeight = (ref.current?.offsetHeight ?? 0) - (typeof refComputedStyle?.paddingTop === 'string' && refComputedStyle?.paddingTop.length ? parseFloat(refComputedStyle?.paddingTop) : 0) - (typeof refComputedStyle?.paddingBottom === 'string' && refComputedStyle?.paddingBottom.length ? parseFloat(refComputedStyle?.paddingBottom) : 0);
|
|
31
|
+
setWidth(initialWidth);
|
|
32
|
+
setHeight(initialHeight);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
if (!ref?.current || width >= 0 && height >= 0) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
getInitialSize();
|
|
39
|
+
}, [width, height]);
|
|
40
|
+
useLayoutEffect(() => {
|
|
41
|
+
if (!ref?.current) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const doCallbacks = () => {
|
|
45
|
+
if (!ref?.current || !Array.isArray(entriesToHandle?.current)) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const entry = entriesToHandle.current[0];
|
|
49
|
+
setWidth(entry.contentRect.width);
|
|
50
|
+
setHeight(entry.contentRect.height);
|
|
51
|
+
cb.current && cb.current(entry.contentRect);
|
|
52
|
+
};
|
|
53
|
+
const observer = new ResizeObserver(entries => {
|
|
54
|
+
// always update entriesToHandle
|
|
55
|
+
entriesToHandle.current = entries;
|
|
56
|
+
window.requestAnimationFrame(() => {
|
|
57
|
+
// do callbacks
|
|
58
|
+
doCallbacks();
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// observe all refs passed
|
|
63
|
+
observer.observe(ref.current);
|
|
64
|
+
return () => {
|
|
65
|
+
observer.disconnect();
|
|
66
|
+
};
|
|
67
|
+
}, []);
|
|
68
|
+
return {
|
|
69
|
+
width,
|
|
70
|
+
height
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export { useResizeObserver };
|
package/es/internal/wrapFocus.js
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { useEffect } from 'react';
|
|
9
8
|
import { tabbable } from 'tabbable';
|
|
10
9
|
import { selectorTabbable } from './keyboard/navigation.js';
|
|
11
10
|
|
|
@@ -96,11 +95,9 @@ const wrapFocusWithoutSentinels = _ref4 => {
|
|
|
96
95
|
event
|
|
97
96
|
} = _ref4;
|
|
98
97
|
if (!containerNode) return;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
}, []);
|
|
98
|
+
if (['blur', 'focusout', 'focusin', 'focus'].includes(event.type) && process.env.NODE_ENV !== 'production') {
|
|
99
|
+
throw new Error(`Error: wrapFocusWithoutSentinels(...) called in unsupported ${event.type} event.\n\nCall wrapFocusWithoutSentinels(...) from onKeyDown instead.`);
|
|
100
|
+
}
|
|
104
101
|
|
|
105
102
|
// Use `tabbable` to get the focusable elements in tab order.
|
|
106
103
|
// `selectorTabbable` returns elements in DOM order which is why it's not
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
export declare const AriaLabelPropType: PropTypes.ValidationMap<any>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import { ReactAttr } from '../types/common';
|
|
7
|
+
import React, { type HTMLAttributes } from 'react';
|
|
9
8
|
type HTMLTagName = keyof HTMLElementTagNameMap;
|
|
10
9
|
type WrapComponentArgs<T extends HTMLTagName> = {
|
|
11
10
|
name: string;
|
|
@@ -16,5 +15,5 @@ type WrapComponentArgs<T extends HTMLTagName> = {
|
|
|
16
15
|
* @param {{ name: string, type: string, className?: string | (prefix: string) => string }} props
|
|
17
16
|
* @returns
|
|
18
17
|
*/
|
|
19
|
-
declare const wrapComponent: <T extends HTMLTagName>({ name, className: getClassName, type, }: WrapComponentArgs<T>) => ((props:
|
|
18
|
+
declare const wrapComponent: <T extends HTMLTagName>({ name, className: getClassName, type, }: WrapComponentArgs<T>) => ((props: HTMLAttributes<T>) => React.ReactElement<any>);
|
|
20
19
|
export default wrapComponent;
|