@carbon/react 1.83.0-rc.0 → 1.84.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 +895 -790
- package/README.md +1 -1
- package/es/components/AILabel/index.js +37 -40
- package/es/components/AISkeleton/AISkeletonIcon.js +6 -7
- package/es/components/AISkeleton/AISkeletonPlaceholder.js +6 -7
- package/es/components/AISkeleton/AISkeletonText.js +6 -7
- package/es/components/Accordion/Accordion.Skeleton.js +24 -25
- package/es/components/Accordion/Accordion.js +13 -14
- package/es/components/Accordion/AccordionItem.js +22 -23
- package/es/components/Accordion/AccordionProvider.js +6 -7
- package/es/components/AspectRatio/AspectRatio.js +9 -10
- package/es/components/BadgeIndicator/index.js +7 -8
- package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +9 -10
- package/es/components/Breadcrumb/Breadcrumb.js +3 -3
- package/es/components/Breadcrumb/BreadcrumbItem.js +9 -9
- package/es/components/Button/Button.Skeleton.js +10 -11
- package/es/components/Button/Button.js +5 -5
- package/es/components/Button/ButtonBase.js +27 -28
- package/es/components/ButtonSet/ButtonSet.js +2 -2
- package/es/components/ChatButton/ChatButton.Skeleton.js +7 -8
- package/es/components/ChatButton/ChatButton.js +13 -14
- package/es/components/Checkbox/Checkbox.Skeleton.js +8 -9
- package/es/components/Checkbox/Checkbox.js +33 -34
- package/es/components/CheckboxGroup/CheckboxGroup.js +28 -29
- package/es/components/ClassPrefix/index.js +6 -7
- package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +12 -13
- package/es/components/CodeSnippet/CodeSnippet.js +41 -42
- package/es/components/ComboBox/ComboBox.js +42 -48
- package/es/components/ComboBox/tools/filter.js +9 -12
- package/es/components/ComboButton/index.js +22 -24
- package/es/components/ComposedModal/ComposedModal.js +49 -52
- package/es/components/ComposedModal/ModalFooter.js +42 -47
- package/es/components/ComposedModal/ModalHeader.js +21 -22
- package/es/components/ContainedList/ContainedList.js +17 -18
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +16 -17
- package/es/components/ContentSwitcher/ContentSwitcher.d.ts +17 -29
- package/es/components/ContentSwitcher/ContentSwitcher.js +100 -126
- package/es/components/ContentSwitcher/index.d.ts +3 -4
- package/es/components/ContextMenu/useContextMenu.js +1 -2
- package/es/components/Copy/Copy.js +13 -14
- package/es/components/CopyButton/CopyButton.js +14 -15
- package/es/components/DangerButton/DangerButton.js +2 -2
- package/es/components/DataTable/DataTable.d.ts +81 -283
- package/es/components/DataTable/DataTable.js +124 -172
- package/es/components/DataTable/Table.d.ts +2 -2
- package/es/components/DataTable/Table.js +19 -22
- package/es/components/DataTable/TableActionList.d.ts +1 -1
- package/es/components/DataTable/TableBatchAction.js +9 -12
- package/es/components/DataTable/TableBatchActions.js +27 -29
- package/es/components/DataTable/TableBody.d.ts +3 -3
- package/es/components/DataTable/TableBody.js +9 -12
- 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 +15 -16
- package/es/components/DataTable/TableDecoratorRow.js +8 -9
- package/es/components/DataTable/TableExpandHeader.d.ts +2 -3
- package/es/components/DataTable/TableExpandHeader.js +18 -19
- package/es/components/DataTable/TableExpandRow.js +20 -21
- package/es/components/DataTable/TableExpandedRow.d.ts +3 -3
- package/es/components/DataTable/TableExpandedRow.js +10 -11
- package/es/components/DataTable/TableHead.d.ts +1 -1
- package/es/components/DataTable/TableHeader.d.ts +4 -4
- package/es/components/DataTable/TableHeader.js +29 -30
- package/es/components/DataTable/TableRow.d.ts +3 -4
- package/es/components/DataTable/TableRow.js +4 -4
- package/es/components/DataTable/TableSelectAll.js +14 -15
- package/es/components/DataTable/TableSelectRow.js +16 -17
- package/es/components/DataTable/TableSlugRow.js +7 -8
- package/es/components/DataTable/TableToolbar.js +9 -10
- package/es/components/DataTable/TableToolbarAction.js +2 -2
- package/es/components/DataTable/TableToolbarContent.d.ts +1 -1
- package/es/components/DataTable/TableToolbarMenu.js +10 -11
- package/es/components/DataTable/TableToolbarSearch.js +24 -26
- package/es/components/DataTable/index.d.ts +1 -1
- package/es/components/DataTable/state/sorting.js +3 -4
- package/es/components/DataTable/tools/filter.js +10 -12
- package/es/components/DataTable/tools/normalize.js +6 -8
- package/es/components/DataTable/tools/sorting.js +24 -30
- package/es/components/DataTableSkeleton/DataTableSkeleton.js +26 -27
- package/es/components/DatePicker/DatePicker.Skeleton.js +15 -16
- package/es/components/DatePicker/DatePicker.js +104 -81
- package/es/components/DatePickerInput/DatePickerInput.d.ts +3 -4
- package/es/components/DatePickerInput/DatePickerInput.js +24 -25
- package/es/components/Dialog/index.d.ts +194 -10
- package/es/components/Dialog/index.js +458 -39
- package/es/components/Dropdown/Dropdown.Skeleton.d.ts +2 -3
- package/es/components/Dropdown/Dropdown.Skeleton.js +10 -11
- package/es/components/Dropdown/Dropdown.d.ts +3 -3
- package/es/components/Dropdown/Dropdown.js +57 -60
- package/es/components/ErrorBoundary/ErrorBoundary.js +4 -4
- package/es/components/ExpandableSearch/ExpandableSearch.js +11 -12
- package/es/components/FeatureFlags/index.js +13 -14
- package/es/components/FileUploader/FileUploader.Skeleton.d.ts +3 -3
- package/es/components/FileUploader/FileUploader.Skeleton.js +9 -10
- package/es/components/FileUploader/FileUploader.d.ts +2 -3
- package/es/components/FileUploader/FileUploader.js +33 -35
- package/es/components/FileUploader/FileUploaderButton.d.ts +2 -3
- package/es/components/FileUploader/FileUploaderButton.js +20 -21
- package/es/components/FileUploader/FileUploaderDropContainer.d.ts +2 -3
- package/es/components/FileUploader/FileUploaderDropContainer.js +20 -21
- package/es/components/FileUploader/FileUploaderItem.d.ts +2 -3
- package/es/components/FileUploader/FileUploaderItem.js +26 -27
- package/es/components/FileUploader/Filename.d.ts +3 -4
- package/es/components/FileUploader/Filename.js +16 -17
- package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +9 -10
- package/es/components/FluidComboBox/FluidComboBox.js +8 -9
- package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +16 -17
- package/es/components/FluidDatePicker/FluidDatePicker.js +13 -14
- package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +3 -3
- package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +9 -10
- package/es/components/FluidDropdown/FluidDropdown.js +8 -9
- package/es/components/FluidForm/FluidForm.d.ts +3 -4
- package/es/components/FluidForm/FluidForm.js +8 -9
- package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +9 -10
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +10 -11
- package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.js +9 -10
- package/es/components/FluidNumberInput/FluidNumberInput.d.ts +40 -1
- package/es/components/FluidNumberInput/FluidNumberInput.js +41 -8
- package/es/components/FluidSearch/FluidSearch.Skeleton.js +9 -10
- package/es/components/FluidSearch/FluidSearch.js +7 -8
- package/es/components/FluidSelect/FluidSelect.Skeleton.js +9 -10
- package/es/components/FluidSelect/FluidSelect.js +8 -9
- package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +9 -10
- package/es/components/FluidTextArea/FluidTextArea.js +7 -8
- package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +9 -10
- package/es/components/FluidTextInput/FluidTextInput.js +9 -10
- package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +8 -9
- package/es/components/FluidTimePicker/FluidTimePicker.js +23 -24
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +7 -8
- package/es/components/Form/Form.js +7 -8
- package/es/components/FormGroup/FormGroup.d.ts +3 -4
- package/es/components/FormGroup/FormGroup.js +15 -16
- package/es/components/FormItem/FormItem.js +7 -8
- package/es/components/FormLabel/FormLabel.js +8 -9
- package/es/components/Grid/CSSGrid.js +23 -25
- package/es/components/Grid/Column.js +32 -31
- package/es/components/Grid/ColumnHang.js +8 -9
- package/es/components/Grid/FlexGrid.js +12 -13
- package/es/components/Grid/Grid.js +3 -3
- package/es/components/Grid/GridContext.d.ts +2 -2
- package/es/components/Grid/GridContext.js +6 -7
- package/es/components/Grid/Row.js +10 -11
- package/es/components/Heading/index.js +13 -14
- package/es/components/Icon/Icon.Skeleton.js +6 -7
- package/es/components/IconButton/index.js +30 -26
- package/es/components/IconIndicator/index.js +10 -11
- package/es/components/IdPrefix/index.js +6 -7
- package/es/components/InlineCheckbox/InlineCheckbox.js +6 -6
- package/es/components/InlineLoading/InlineLoading.js +19 -20
- package/es/components/Layer/LayerContext.js +2 -2
- package/es/components/Layer/index.d.ts +4 -0
- package/es/components/Layer/index.js +21 -15
- package/es/components/Layout/index.js +24 -29
- package/es/components/LayoutDirection/LayoutDirection.js +10 -11
- package/es/components/LayoutDirection/LayoutDirectionContext.js +2 -2
- package/es/components/Link/Link.d.ts +1 -1
- package/es/components/Link/Link.js +19 -20
- 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 +8 -9
- package/es/components/ListBox/ListBoxMenu.d.ts +2 -3
- package/es/components/ListBox/ListBoxMenu.js +7 -8
- package/es/components/ListBox/ListBoxMenuIcon.js +8 -9
- package/es/components/ListBox/ListBoxMenuItem.d.ts +2 -3
- package/es/components/ListBox/ListBoxMenuItem.js +11 -13
- package/es/components/ListBox/ListBoxSelection.js +14 -15
- package/es/components/ListBox/next/ListBoxSelection.js +16 -17
- package/es/components/ListBox/next/ListBoxTrigger.js +8 -9
- package/es/components/ListItem/ListItem.js +7 -8
- package/es/components/Loading/Loading.d.ts +3 -3
- package/es/components/Loading/Loading.js +14 -15
- package/es/components/Menu/Menu.js +26 -27
- package/es/components/Menu/MenuItem.js +55 -60
- package/es/components/MenuButton/index.js +20 -22
- package/es/components/Modal/Modal.d.ts +2 -3
- package/es/components/Modal/Modal.js +85 -93
- package/es/components/ModalWrapper/ModalWrapper.js +9 -9
- package/es/components/MultiSelect/FilterableMultiSelect.js +68 -74
- package/es/components/MultiSelect/MultiSelect.js +65 -67
- package/es/components/MultiSelect/tools/sorting.js +11 -15
- package/es/components/Notification/Notification.js +137 -146
- package/es/components/NumberInput/NumberFormatPropTypes.d.ts +29 -0
- package/es/components/NumberInput/NumberFormatPropTypes.js +40 -0
- package/es/components/NumberInput/NumberInput.Skeleton.js +10 -11
- package/es/components/NumberInput/NumberInput.d.ts +39 -3
- package/es/components/NumberInput/NumberInput.js +195 -65
- package/es/components/OrderedList/OrderedList.js +9 -10
- package/es/components/OverflowMenu/OverflowMenu.d.ts +1 -1
- package/es/components/OverflowMenu/OverflowMenu.js +42 -48
- package/es/components/OverflowMenu/index.js +3 -3
- package/es/components/OverflowMenu/next/index.js +17 -18
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +4 -4
- package/es/components/OverflowMenuV2/index.js +3 -3
- package/es/components/PageHeader/PageHeader.d.ts +29 -5
- package/es/components/PageHeader/PageHeader.js +136 -90
- package/es/components/Pagination/Pagination.Skeleton.js +12 -13
- package/es/components/Pagination/Pagination.js +40 -41
- package/es/components/Pagination/experimental/PageSelector.js +11 -12
- package/es/components/Pagination/experimental/Pagination.js +34 -35
- package/es/components/PaginationNav/PaginationNav.js +63 -68
- package/es/components/Popover/index.js +40 -42
- package/es/components/PrimaryButton/PrimaryButton.js +2 -2
- package/es/components/ProgressBar/ProgressBar.js +24 -25
- package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +12 -13
- package/es/components/ProgressIndicator/ProgressIndicator.js +49 -52
- 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 +28 -29
- package/es/components/Search/Search.Skeleton.js +9 -10
- package/es/components/Search/Search.js +36 -38
- package/es/components/SecondaryButton/SecondaryButton.js +2 -2
- package/es/components/Select/Select.Skeleton.js +10 -11
- package/es/components/Select/Select.js +42 -43
- package/es/components/SelectItem/SelectItem.js +10 -11
- package/es/components/SelectItemGroup/SelectItemGroup.js +9 -10
- package/es/components/ShapeIndicator/index.js +13 -14
- package/es/components/SkeletonIcon/SkeletonIcon.d.ts +0 -4
- package/es/components/SkeletonIcon/SkeletonIcon.js +7 -12
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +6 -7
- package/es/components/SkeletonText/SkeletonText.js +12 -13
- package/es/components/Slider/Slider.Skeleton.js +25 -26
- package/es/components/Slider/Slider.js +99 -113
- package/es/components/Slider/SliderHandles.js +20 -20
- 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 +17 -18
- 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 +12 -13
- package/es/components/Tabs/Tabs.js +141 -156
- package/es/components/Tabs/usePressable.js +7 -8
- package/es/components/Tag/DismissibleTag.js +26 -27
- package/es/components/Tag/OperationalTag.js +16 -17
- package/es/components/Tag/SelectableTag.js +19 -20
- package/es/components/Tag/Tag.Skeleton.js +7 -8
- package/es/components/Tag/Tag.js +33 -34
- package/es/components/Text/Text.js +9 -10
- package/es/components/Text/TextDirection.js +7 -8
- package/es/components/Text/createTextComponent.js +2 -2
- package/es/components/TextArea/TextArea.Skeleton.js +4 -4
- package/es/components/TextArea/TextArea.js +22 -22
- package/es/components/TextInput/ControlledPasswordInput.d.ts +2 -3
- package/es/components/TextInput/ControlledPasswordInput.js +36 -37
- package/es/components/TextInput/PasswordInput.js +40 -41
- package/es/components/TextInput/TextInput.Skeleton.js +9 -10
- package/es/components/TextInput/TextInput.js +43 -44
- package/es/components/TextInput/util.js +14 -17
- package/es/components/Theme/index.js +19 -21
- package/es/components/Tile/Tile.js +98 -104
- 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 +8 -9
- package/es/components/Toggle/Toggle.js +27 -28
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +14 -15
- package/es/components/Toggletip/index.js +43 -49
- package/es/components/Tooltip/DefinitionTooltip.js +17 -18
- package/es/components/Tooltip/Tooltip.d.ts +3 -0
- package/es/components/Tooltip/Tooltip.js +39 -28
- package/es/components/TreeView/TreeNode.js +64 -56
- package/es/components/TreeView/TreeView.js +44 -37
- package/es/components/UIShell/Content.js +8 -9
- package/es/components/UIShell/Header.js +7 -8
- package/es/components/UIShell/HeaderContainer.js +7 -8
- package/es/components/UIShell/HeaderGlobalAction.js +14 -15
- package/es/components/UIShell/HeaderGlobalBar.d.ts +1 -1
- package/es/components/UIShell/HeaderMenu.d.ts +10 -112
- package/es/components/UIShell/HeaderMenu.js +154 -201
- package/es/components/UIShell/HeaderMenuButton.js +14 -15
- package/es/components/UIShell/HeaderMenuItem.js +21 -20
- package/es/components/UIShell/HeaderName.js +9 -10
- package/es/components/UIShell/HeaderNavigation.js +10 -11
- package/es/components/UIShell/HeaderPanel.js +11 -12
- package/es/components/UIShell/HeaderSideNavItems.js +7 -8
- package/es/components/UIShell/Link.js +11 -12
- package/es/components/UIShell/SideNav.js +30 -32
- package/es/components/UIShell/SideNavDetails.js +9 -10
- package/es/components/UIShell/SideNavDivider.js +6 -7
- package/es/components/UIShell/SideNavFooter.js +13 -14
- package/es/components/UIShell/SideNavHeader.js +8 -9
- package/es/components/UIShell/SideNavIcon.js +7 -8
- package/es/components/UIShell/SideNavItem.js +7 -8
- package/es/components/UIShell/SideNavItems.js +10 -11
- package/es/components/UIShell/SideNavLink.js +15 -16
- package/es/components/UIShell/SideNavLinkText.js +7 -8
- package/es/components/UIShell/SideNavMenu.js +20 -21
- package/es/components/UIShell/SideNavMenuItem.js +5 -5
- package/es/components/UIShell/SideNavSwitcher.js +8 -8
- package/es/components/UIShell/SkipToContent.js +9 -10
- package/es/components/UIShell/Switcher.js +12 -13
- package/es/components/UIShell/SwitcherDivider.js +6 -7
- package/es/components/UIShell/SwitcherItem.js +3 -3
- package/es/components/UnorderedList/UnorderedList.js +8 -9
- package/es/index.js +25 -26
- package/es/internal/FloatingMenu.js +30 -32
- package/es/internal/Selection.js +15 -17
- package/{lib/feature-flags.d.ts → es/internal/__mocks__/mockHTMLElement.d.ts} +4 -2
- package/es/internal/createClassWrapper.js +2 -2
- package/es/internal/getAnnouncement.d.ts +8 -0
- package/es/internal/getAnnouncement.js +22 -0
- package/es/internal/keyboard/match.js +6 -7
- package/es/internal/useControllableState.d.ts +1 -1
- package/es/internal/useControllableState.js +8 -9
- package/es/internal/useDelayedState.js +1 -2
- package/es/internal/useDocumentLang.d.ts +12 -0
- package/es/internal/useId.js +4 -6
- package/es/internal/useIdPrefix.js +3 -3
- package/es/internal/useMatchMedia.js +1 -2
- package/es/internal/useMergedRefs.d.ts +1 -1
- package/es/internal/useNoInteractiveChildren.js +2 -4
- package/es/internal/useNormalizedInputProps.js +12 -13
- package/es/internal/usePrefix.js +3 -3
- package/es/internal/useResizeObserver.d.ts +14 -0
- package/es/internal/useResizeObserver.js +73 -0
- package/es/internal/useSavedCallback.js +1 -3
- package/es/internal/wrapFocus.js +23 -35
- package/es/prop-types/deprecate.js +1 -4
- package/es/prop-types/deprecateValuesWithin.js +1 -4
- package/es/prop-types/isRequiredOneOf.js +1 -4
- package/es/prop-types/requiredIfGivenPropIsTruthy.js +1 -4
- package/es/tools/events.js +1 -4
- package/es/tools/mergeRefs.js +9 -14
- package/es/tools/uniqueId.js +1 -2
- package/es/tools/wrapComponent.d.ts +3 -4
- package/es/tools/wrapComponent.js +11 -13
- package/es/types/common.d.ts +0 -2
- package/lib/components/AILabel/index.js +27 -30
- package/lib/components/AISkeleton/AISkeletonIcon.js +4 -5
- package/lib/components/AISkeleton/AISkeletonPlaceholder.js +4 -5
- package/lib/components/AISkeleton/AISkeletonText.js +4 -5
- package/lib/components/Accordion/Accordion.Skeleton.js +9 -10
- package/lib/components/Accordion/Accordion.js +10 -11
- package/lib/components/Accordion/AccordionItem.js +13 -14
- package/lib/components/Accordion/AccordionProvider.js +4 -5
- package/lib/components/AspectRatio/AspectRatio.js +7 -8
- package/lib/components/BadgeIndicator/index.js +5 -6
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +4 -5
- package/lib/components/Button/Button.Skeleton.js +7 -8
- package/lib/components/Button/ButtonBase.js +23 -24
- package/lib/components/ChatButton/ChatButton.Skeleton.js +5 -6
- package/lib/components/ChatButton/ChatButton.js +11 -12
- package/lib/components/Checkbox/Checkbox.Skeleton.js +4 -5
- package/lib/components/Checkbox/Checkbox.js +19 -20
- package/lib/components/CheckboxGroup/CheckboxGroup.js +16 -17
- package/lib/components/ClassPrefix/index.js +4 -5
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +5 -6
- package/lib/components/CodeSnippet/CodeSnippet.js +27 -29
- package/lib/components/ComboBox/ComboBox.js +24 -30
- package/lib/components/ComboBox/tools/filter.js +9 -12
- package/lib/components/ComboButton/index.js +16 -18
- package/lib/components/ComposedModal/ComposedModal.js +31 -34
- package/lib/components/ComposedModal/ModalFooter.js +37 -42
- package/lib/components/ComposedModal/ModalHeader.js +14 -15
- package/lib/components/ContainedList/ContainedList.js +10 -11
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +9 -10
- package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +17 -29
- package/lib/components/ContentSwitcher/ContentSwitcher.js +98 -124
- package/lib/components/ContentSwitcher/index.d.ts +3 -4
- package/lib/components/ContextMenu/useContextMenu.js +1 -2
- package/lib/components/Copy/Copy.js +11 -12
- package/lib/components/CopyButton/CopyButton.js +10 -11
- package/lib/components/DataTable/DataTable.d.ts +81 -283
- package/lib/components/DataTable/DataTable.js +123 -172
- package/lib/components/DataTable/Table.d.ts +2 -2
- package/lib/components/DataTable/Table.js +15 -18
- package/lib/components/DataTable/TableActionList.d.ts +1 -1
- package/lib/components/DataTable/TableBatchAction.js +8 -11
- package/lib/components/DataTable/TableBatchActions.js +18 -20
- package/lib/components/DataTable/TableBody.d.ts +3 -3
- package/lib/components/DataTable/TableBody.js +8 -11
- package/lib/components/DataTable/TableCell.d.ts +3 -4
- package/lib/components/DataTable/TableContainer.d.ts +2 -3
- package/lib/components/DataTable/TableContainer.js +9 -10
- package/lib/components/DataTable/TableDecoratorRow.js +4 -5
- package/lib/components/DataTable/TableExpandHeader.d.ts +2 -3
- package/lib/components/DataTable/TableExpandHeader.js +14 -15
- package/lib/components/DataTable/TableExpandRow.js +13 -14
- package/lib/components/DataTable/TableExpandedRow.d.ts +3 -3
- package/lib/components/DataTable/TableExpandedRow.js +6 -7
- package/lib/components/DataTable/TableHead.d.ts +1 -1
- package/lib/components/DataTable/TableHeader.d.ts +4 -4
- package/lib/components/DataTable/TableHeader.js +15 -16
- package/lib/components/DataTable/TableRow.d.ts +3 -4
- package/lib/components/DataTable/TableSelectAll.js +11 -12
- package/lib/components/DataTable/TableSelectRow.js +12 -13
- package/lib/components/DataTable/TableSlugRow.js +4 -5
- package/lib/components/DataTable/TableToolbar.js +7 -8
- package/lib/components/DataTable/TableToolbarContent.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarMenu.js +8 -9
- package/lib/components/DataTable/TableToolbarSearch.js +22 -24
- package/lib/components/DataTable/index.d.ts +1 -1
- package/lib/components/DataTable/state/sorting.js +3 -4
- package/lib/components/DataTable/tools/filter.js +10 -12
- package/lib/components/DataTable/tools/normalize.js +6 -8
- package/lib/components/DataTable/tools/sorting.js +24 -30
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +11 -12
- package/lib/components/DatePicker/DatePicker.Skeleton.js +7 -8
- package/lib/components/DatePicker/DatePicker.js +87 -64
- package/lib/components/DatePickerInput/DatePickerInput.d.ts +3 -4
- package/lib/components/DatePickerInput/DatePickerInput.js +5 -6
- package/lib/components/Dialog/index.d.ts +194 -10
- package/lib/components/Dialog/index.js +457 -33
- package/lib/components/Dropdown/Dropdown.Skeleton.d.ts +2 -3
- package/lib/components/Dropdown/Dropdown.Skeleton.js +6 -7
- package/lib/components/Dropdown/Dropdown.d.ts +3 -3
- package/lib/components/Dropdown/Dropdown.js +40 -43
- package/lib/components/ErrorBoundary/ErrorBoundary.js +2 -2
- package/lib/components/ExpandableSearch/ExpandableSearch.js +9 -10
- package/lib/components/FeatureFlags/index.js +11 -12
- package/lib/components/FileUploader/FileUploader.Skeleton.d.ts +3 -3
- package/lib/components/FileUploader/FileUploader.Skeleton.js +4 -5
- package/lib/components/FileUploader/FileUploader.d.ts +2 -3
- package/lib/components/FileUploader/FileUploader.js +22 -24
- package/lib/components/FileUploader/FileUploaderButton.d.ts +2 -3
- package/lib/components/FileUploader/FileUploaderButton.js +16 -17
- package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +2 -3
- package/lib/components/FileUploader/FileUploaderDropContainer.js +15 -16
- package/lib/components/FileUploader/FileUploaderItem.d.ts +2 -3
- package/lib/components/FileUploader/FileUploaderItem.js +13 -14
- package/lib/components/FileUploader/Filename.d.ts +3 -4
- package/lib/components/FileUploader/Filename.js +9 -10
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +4 -5
- package/lib/components/FluidComboBox/FluidComboBox.js +5 -6
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +5 -6
- package/lib/components/FluidDatePicker/FluidDatePicker.js +10 -11
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +4 -5
- package/lib/components/FluidDropdown/FluidDropdown.js +5 -6
- package/lib/components/FluidForm/FluidForm.d.ts +3 -4
- package/lib/components/FluidForm/FluidForm.js +5 -6
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +4 -5
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +6 -7
- package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +4 -5
- package/lib/components/FluidNumberInput/FluidNumberInput.d.ts +40 -1
- package/lib/components/FluidNumberInput/FluidNumberInput.js +38 -5
- package/lib/components/FluidSearch/FluidSearch.Skeleton.js +4 -5
- package/lib/components/FluidSearch/FluidSearch.js +4 -5
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +4 -5
- package/lib/components/FluidSelect/FluidSelect.js +5 -6
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +4 -5
- package/lib/components/FluidTextArea/FluidTextArea.js +4 -5
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +4 -5
- package/lib/components/FluidTextInput/FluidTextInput.js +5 -6
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +5 -6
- package/lib/components/FluidTimePicker/FluidTimePicker.js +11 -12
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +5 -6
- package/lib/components/Form/Form.js +5 -6
- package/lib/components/FormGroup/FormGroup.d.ts +3 -4
- package/lib/components/FormGroup/FormGroup.js +11 -12
- package/lib/components/FormItem/FormItem.js +5 -6
- package/lib/components/FormLabel/FormLabel.js +6 -7
- package/lib/components/Grid/CSSGrid.js +17 -19
- package/lib/components/Grid/Column.js +28 -27
- package/lib/components/Grid/ColumnHang.js +6 -7
- package/lib/components/Grid/FlexGrid.js +9 -10
- package/lib/components/Grid/GridContext.d.ts +2 -2
- package/lib/components/Grid/GridContext.js +10 -29
- package/lib/components/Grid/Row.js +8 -9
- package/lib/components/Heading/index.js +5 -6
- package/lib/components/Icon/Icon.Skeleton.js +4 -5
- package/lib/components/IconButton/index.js +26 -22
- package/lib/components/IconIndicator/index.js +7 -8
- package/lib/components/IdPrefix/index.js +4 -5
- package/lib/components/InlineLoading/InlineLoading.js +9 -10
- package/lib/components/Layer/index.d.ts +4 -0
- package/lib/components/Layer/index.js +16 -10
- package/lib/components/Layout/index.js +21 -26
- package/lib/components/LayoutDirection/LayoutDirection.js +6 -7
- package/lib/components/Link/Link.d.ts +1 -1
- package/lib/components/Link/Link.js +15 -16
- package/lib/components/ListBox/ListBox.d.ts +2 -3
- package/lib/components/ListBox/ListBoxField.d.ts +3 -4
- package/lib/components/ListBox/ListBoxField.js +6 -7
- package/lib/components/ListBox/ListBoxMenu.d.ts +2 -3
- package/lib/components/ListBox/ListBoxMenu.js +5 -6
- package/lib/components/ListBox/ListBoxMenuIcon.js +4 -5
- package/lib/components/ListBox/ListBoxMenuItem.d.ts +2 -3
- package/lib/components/ListBox/ListBoxMenuItem.js +8 -10
- package/lib/components/ListBox/ListBoxSelection.js +8 -9
- package/lib/components/ListBox/next/ListBoxSelection.js +9 -10
- package/lib/components/ListBox/next/ListBoxTrigger.js +5 -6
- package/lib/components/ListItem/ListItem.js +5 -6
- package/lib/components/Loading/Loading.d.ts +3 -3
- package/lib/components/Loading/Loading.js +8 -9
- package/lib/components/Menu/Menu.js +23 -24
- package/lib/components/Menu/MenuItem.js +39 -44
- package/lib/components/MenuButton/index.js +16 -18
- package/lib/components/Modal/Modal.d.ts +2 -3
- package/lib/components/Modal/Modal.js +55 -63
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.js +46 -52
- package/lib/components/MultiSelect/MultiSelect.js +43 -45
- package/lib/components/MultiSelect/tools/sorting.js +11 -15
- package/lib/components/Notification/Notification.js +96 -105
- package/lib/components/NumberInput/NumberFormatPropTypes.d.ts +29 -0
- package/lib/components/NumberInput/NumberFormatPropTypes.js +48 -0
- package/lib/components/NumberInput/NumberInput.Skeleton.js +6 -7
- package/lib/components/NumberInput/NumberInput.d.ts +39 -3
- package/lib/components/NumberInput/NumberInput.js +173 -43
- package/lib/components/OrderedList/OrderedList.js +7 -8
- package/lib/components/OverflowMenu/OverflowMenu.d.ts +1 -1
- package/lib/components/OverflowMenu/OverflowMenu.js +35 -41
- package/lib/components/OverflowMenu/next/index.js +12 -13
- package/lib/components/PageHeader/PageHeader.d.ts +29 -5
- package/lib/components/PageHeader/PageHeader.js +119 -73
- package/lib/components/Pagination/Pagination.Skeleton.js +4 -5
- package/lib/components/Pagination/Pagination.js +24 -25
- package/lib/components/Pagination/experimental/PageSelector.js +8 -9
- package/lib/components/Pagination/experimental/Pagination.js +20 -21
- package/lib/components/PaginationNav/PaginationNav.js +33 -38
- package/lib/components/Popover/index.js +26 -28
- package/lib/components/ProgressBar/ProgressBar.js +11 -12
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +5 -6
- package/lib/components/ProgressIndicator/ProgressIndicator.js +29 -32
- package/lib/components/RadioTile/RadioTile.js +17 -18
- package/lib/components/Search/Search.Skeleton.js +5 -6
- package/lib/components/Search/Search.js +26 -28
- package/lib/components/Select/Select.Skeleton.js +5 -6
- package/lib/components/Select/Select.js +24 -25
- package/lib/components/SelectItem/SelectItem.js +8 -9
- package/lib/components/SelectItemGroup/SelectItemGroup.js +7 -8
- package/lib/components/ShapeIndicator/index.js +7 -8
- package/lib/components/SkeletonIcon/SkeletonIcon.d.ts +0 -4
- package/lib/components/SkeletonIcon/SkeletonIcon.js +5 -10
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +4 -5
- package/lib/components/SkeletonText/SkeletonText.js +8 -9
- package/lib/components/Slider/Slider.Skeleton.js +8 -9
- package/lib/components/Slider/Slider.js +69 -83
- package/lib/components/Slider/SliderHandles.js +6 -6
- package/lib/components/StructuredList/StructuredList.Skeleton.js +5 -6
- package/lib/components/Tabs/Tabs.Skeleton.js +5 -6
- package/lib/components/Tabs/Tabs.js +83 -98
- package/lib/components/Tabs/usePressable.js +7 -8
- package/lib/components/Tag/DismissibleTag.js +16 -17
- package/lib/components/Tag/OperationalTag.js +10 -11
- package/lib/components/Tag/SelectableTag.js +13 -14
- package/lib/components/Tag/Tag.Skeleton.js +5 -6
- package/lib/components/Tag/Tag.js +19 -20
- package/lib/components/Text/Text.js +6 -7
- package/lib/components/Text/TextDirection.js +5 -6
- package/lib/components/TextArea/TextArea.js +3 -3
- package/lib/components/TextInput/ControlledPasswordInput.d.ts +2 -3
- package/lib/components/TextInput/ControlledPasswordInput.js +24 -25
- package/lib/components/TextInput/PasswordInput.js +26 -27
- package/lib/components/TextInput/TextInput.Skeleton.js +5 -6
- package/lib/components/TextInput/TextInput.js +27 -28
- package/lib/components/TextInput/util.js +14 -17
- package/lib/components/Theme/index.js +10 -12
- package/lib/components/Tile/Tile.js +68 -74
- package/lib/components/TileGroup/TileGroup.d.ts +3 -4
- package/lib/components/TimePicker/TimePicker.d.ts +2 -3
- package/lib/components/Toggle/Toggle.Skeleton.js +4 -5
- package/lib/components/Toggle/Toggle.js +17 -18
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +6 -7
- package/lib/components/Toggletip/index.js +33 -39
- package/lib/components/Tooltip/DefinitionTooltip.js +13 -14
- package/lib/components/Tooltip/Tooltip.d.ts +3 -0
- package/lib/components/Tooltip/Tooltip.js +33 -22
- package/lib/components/TreeView/TreeNode.js +40 -32
- package/lib/components/TreeView/TreeView.js +41 -34
- package/lib/components/UIShell/Content.js +6 -7
- package/lib/components/UIShell/Header.js +5 -6
- package/lib/components/UIShell/HeaderContainer.js +5 -6
- package/lib/components/UIShell/HeaderGlobalAction.js +12 -13
- package/lib/components/UIShell/HeaderGlobalBar.d.ts +1 -1
- package/lib/components/UIShell/HeaderMenu.d.ts +10 -112
- package/lib/components/UIShell/HeaderMenu.js +152 -199
- package/lib/components/UIShell/HeaderMenuButton.js +10 -11
- package/lib/components/UIShell/HeaderMenuItem.js +17 -16
- package/lib/components/UIShell/HeaderName.js +6 -7
- package/lib/components/UIShell/HeaderNavigation.js +7 -8
- package/lib/components/UIShell/HeaderPanel.js +9 -10
- package/lib/components/UIShell/HeaderSideNavItems.js +5 -6
- package/lib/components/UIShell/Link.js +8 -9
- package/lib/components/UIShell/SideNav.js +23 -25
- package/lib/components/UIShell/SideNavDetails.js +6 -7
- package/lib/components/UIShell/SideNavDivider.js +3 -4
- package/lib/components/UIShell/SideNavFooter.js +6 -7
- package/lib/components/UIShell/SideNavHeader.js +5 -6
- package/lib/components/UIShell/SideNavIcon.js +5 -6
- package/lib/components/UIShell/SideNavItem.js +5 -6
- package/lib/components/UIShell/SideNavItems.js +5 -6
- package/lib/components/UIShell/SideNavLink.js +10 -11
- package/lib/components/UIShell/SideNavLinkText.js +5 -6
- package/lib/components/UIShell/SideNavMenu.js +11 -12
- package/lib/components/UIShell/SkipToContent.js +7 -8
- package/lib/components/UIShell/Switcher.js +4 -5
- package/lib/components/UIShell/SwitcherDivider.js +4 -5
- package/lib/components/UnorderedList/UnorderedList.js +6 -7
- package/lib/index.js +81 -82
- package/lib/internal/FloatingMenu.js +26 -28
- package/lib/internal/Selection.js +15 -17
- package/{es/feature-flags.d.ts → lib/internal/__mocks__/mockHTMLElement.d.ts} +4 -2
- package/lib/internal/getAnnouncement.d.ts +8 -0
- package/lib/internal/getAnnouncement.js +26 -0
- package/lib/internal/keyboard/match.js +6 -7
- package/lib/internal/useControllableState.d.ts +1 -1
- package/lib/internal/useControllableState.js +8 -9
- package/lib/internal/useDelayedState.js +1 -2
- package/lib/internal/useDocumentLang.d.ts +12 -0
- package/lib/internal/useId.js +2 -4
- package/lib/internal/useMatchMedia.js +1 -2
- package/lib/internal/useMergedRefs.d.ts +1 -1
- package/lib/internal/useNoInteractiveChildren.js +2 -4
- package/lib/internal/useNormalizedInputProps.js +9 -10
- package/lib/internal/useResizeObserver.d.ts +14 -0
- package/lib/internal/useResizeObserver.js +77 -0
- package/lib/internal/useSavedCallback.js +1 -3
- package/lib/internal/wrapFocus.js +23 -35
- package/lib/prop-types/deprecate.js +1 -4
- package/lib/prop-types/deprecateValuesWithin.js +1 -4
- package/lib/prop-types/isRequiredOneOf.js +1 -4
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +1 -4
- package/lib/tools/events.js +1 -4
- package/lib/tools/mergeRefs.js +9 -14
- package/lib/tools/uniqueId.js +1 -2
- package/lib/tools/wrapComponent.d.ts +3 -4
- package/lib/tools/wrapComponent.js +9 -11
- package/lib/types/common.d.ts +0 -2
- package/package.json +21 -20
- package/scss/components/content-switcher/_tokens.scss +9 -0
- package/telemetry.yml +27 -2
- package/es/components/ContentSwitcher/index.js +0 -13
- package/es/components/DataTable/index.js +0 -76
- package/es/internal/useAnnouncer.js +0 -21
- package/lib/components/ContentSwitcher/index.js +0 -18
- package/lib/components/DataTable/index.js +0 -82
- package/lib/internal/useAnnouncer.js +0 -25
|
@@ -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';
|
|
@@ -20,16 +20,15 @@ import { Text } from '../components/Text/Text.js';
|
|
|
20
20
|
* helper messages, and conditionally provides the appropriate validation
|
|
21
21
|
* message and accompanying icon.
|
|
22
22
|
*/
|
|
23
|
-
const useNormalizedInputProps =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} = _ref;
|
|
23
|
+
const useNormalizedInputProps = ({
|
|
24
|
+
id,
|
|
25
|
+
readOnly,
|
|
26
|
+
disabled,
|
|
27
|
+
invalid,
|
|
28
|
+
invalidText,
|
|
29
|
+
warn,
|
|
30
|
+
warnText
|
|
31
|
+
}) => {
|
|
33
32
|
const prefix = usePrefix();
|
|
34
33
|
const normalizedProps = {
|
|
35
34
|
disabled: !readOnly && disabled,
|
|
@@ -43,14 +42,14 @@ const useNormalizedInputProps = _ref => {
|
|
|
43
42
|
};
|
|
44
43
|
if (normalizedProps.invalid) {
|
|
45
44
|
normalizedProps.icon = WarningFilled;
|
|
46
|
-
normalizedProps.validation = /*#__PURE__*/
|
|
45
|
+
normalizedProps.validation = /*#__PURE__*/React.createElement(Text, {
|
|
47
46
|
as: "div",
|
|
48
47
|
className: `${prefix}--form-requirement`,
|
|
49
48
|
id: normalizedProps.invalidId
|
|
50
49
|
}, invalidText);
|
|
51
50
|
} else if (normalizedProps.warn) {
|
|
52
51
|
normalizedProps.icon = WarningAltFilled;
|
|
53
|
-
normalizedProps.validation = /*#__PURE__*/
|
|
52
|
+
normalizedProps.validation = /*#__PURE__*/React.createElement(Text, {
|
|
54
53
|
as: "div",
|
|
55
54
|
className: `${prefix}--form-requirement`,
|
|
56
55
|
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,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,73 @@
|
|
|
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 = ({
|
|
11
|
+
ref,
|
|
12
|
+
onResize
|
|
13
|
+
}) => {
|
|
14
|
+
const [width, setWidth] = useState(-1);
|
|
15
|
+
const [height, setHeight] = useState(-1);
|
|
16
|
+
const entriesToHandle = useRef(null);
|
|
17
|
+
const cb = useRef(onResize);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
// ref for onResize removes it as dependency from useLayoutEffect
|
|
20
|
+
// This significantly reduces repeated calls if a function is redefined on every
|
|
21
|
+
// render
|
|
22
|
+
cb.current = onResize;
|
|
23
|
+
}, [onResize]);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const getInitialSize = () => {
|
|
26
|
+
if (ref.current) {
|
|
27
|
+
const refComputedStyle = window.getComputedStyle(ref.current);
|
|
28
|
+
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);
|
|
29
|
+
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);
|
|
30
|
+
setWidth(initialWidth);
|
|
31
|
+
setHeight(initialHeight);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
if (!ref?.current || width >= 0 && height >= 0) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
getInitialSize();
|
|
38
|
+
}, [width, height]);
|
|
39
|
+
useLayoutEffect(() => {
|
|
40
|
+
if (!ref?.current) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const doCallbacks = () => {
|
|
44
|
+
if (!ref?.current || !Array.isArray(entriesToHandle?.current)) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const entry = entriesToHandle.current[0];
|
|
48
|
+
setWidth(entry.contentRect.width);
|
|
49
|
+
setHeight(entry.contentRect.height);
|
|
50
|
+
cb.current && cb.current(entry.contentRect);
|
|
51
|
+
};
|
|
52
|
+
const observer = new ResizeObserver(entries => {
|
|
53
|
+
// always update entriesToHandle
|
|
54
|
+
entriesToHandle.current = entries;
|
|
55
|
+
window.requestAnimationFrame(() => {
|
|
56
|
+
// do callbacks
|
|
57
|
+
doCallbacks();
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// observe all refs passed
|
|
62
|
+
observer.observe(ref.current);
|
|
63
|
+
return () => {
|
|
64
|
+
observer.disconnect();
|
|
65
|
+
};
|
|
66
|
+
}, []);
|
|
67
|
+
return {
|
|
68
|
+
width,
|
|
69
|
+
height
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export { useResizeObserver };
|
|
@@ -20,9 +20,7 @@ const useSavedCallback = callback => {
|
|
|
20
20
|
useEffect(() => {
|
|
21
21
|
savedCallback.current = callback;
|
|
22
22
|
}, [callback]);
|
|
23
|
-
return useCallback(
|
|
24
|
-
return savedCallback.current ? savedCallback.current(...arguments) : undefined;
|
|
25
|
-
}, []);
|
|
23
|
+
return useCallback((...args) => savedCallback.current ? savedCallback.current(...args) : undefined, []);
|
|
26
24
|
};
|
|
27
25
|
|
|
28
26
|
export { useSavedCallback };
|
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
|
|
|
@@ -31,8 +30,7 @@ const DOCUMENT_POSITION_BROAD_FOLLOWING = typeof Node !== 'undefined' ? Node.DOC
|
|
|
31
30
|
* @returns {boolean} Whether the node or one of its ancestors is in a floating
|
|
32
31
|
* menu.
|
|
33
32
|
*/
|
|
34
|
-
const elementOrParentIsFloatingMenu =
|
|
35
|
-
let selectorsFloatingMenus = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
33
|
+
const elementOrParentIsFloatingMenu = (node, selectorsFloatingMenus = []) => {
|
|
36
34
|
if (node instanceof Element && typeof node.closest === 'function') {
|
|
37
35
|
const allSelectorsFloatingMenus = ['.cds--overflow-menu-options', '.cds--tooltip', '.flatpickr-calendar', ...selectorsFloatingMenus];
|
|
38
36
|
return allSelectorsFloatingMenus.some(selector => !!node.closest(selector));
|
|
@@ -44,36 +42,29 @@ const elementOrParentIsFloatingMenu = function (node) {
|
|
|
44
42
|
* Ensures the focus is kept within the given container by implementing
|
|
45
43
|
* "focus-wrap" behavior.
|
|
46
44
|
*/
|
|
47
|
-
const wrapFocus =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
} = _ref;
|
|
45
|
+
const wrapFocus = ({
|
|
46
|
+
bodyNode,
|
|
47
|
+
startTrapNode,
|
|
48
|
+
endTrapNode,
|
|
49
|
+
currentActiveNode,
|
|
50
|
+
oldActiveNode,
|
|
51
|
+
selectorsFloatingMenus
|
|
52
|
+
}) => {
|
|
56
53
|
if (bodyNode && currentActiveNode && oldActiveNode && !bodyNode.contains(currentActiveNode) && !elementOrParentIsFloatingMenu(currentActiveNode, selectorsFloatingMenus)) {
|
|
57
54
|
const comparisonResult = oldActiveNode.compareDocumentPosition(currentActiveNode);
|
|
58
55
|
if (currentActiveNode === startTrapNode || comparisonResult & DOCUMENT_POSITION_BROAD_PRECEDING) {
|
|
59
|
-
const tabbableElement = Array.from(bodyNode.querySelectorAll(selectorTabbable)).reverse().find(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
} = _ref2;
|
|
63
|
-
return Boolean(offsetParent);
|
|
64
|
-
});
|
|
56
|
+
const tabbableElement = Array.from(bodyNode.querySelectorAll(selectorTabbable)).reverse().find(({
|
|
57
|
+
offsetParent
|
|
58
|
+
}) => Boolean(offsetParent));
|
|
65
59
|
if (tabbableElement) {
|
|
66
60
|
tabbableElement.focus();
|
|
67
61
|
} else if (bodyNode !== oldActiveNode) {
|
|
68
62
|
bodyNode.focus();
|
|
69
63
|
}
|
|
70
64
|
} else if (currentActiveNode === endTrapNode || comparisonResult & DOCUMENT_POSITION_BROAD_FOLLOWING) {
|
|
71
|
-
const tabbableElement = Array.from(bodyNode.querySelectorAll(selectorTabbable)).find(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
} = _ref3;
|
|
75
|
-
return Boolean(offsetParent);
|
|
76
|
-
});
|
|
65
|
+
const tabbableElement = Array.from(bodyNode.querySelectorAll(selectorTabbable)).find(({
|
|
66
|
+
offsetParent
|
|
67
|
+
}) => Boolean(offsetParent));
|
|
77
68
|
if (tabbableElement) {
|
|
78
69
|
tabbableElement.focus();
|
|
79
70
|
} else if (bodyNode !== oldActiveNode) {
|
|
@@ -89,18 +80,15 @@ const wrapFocus = _ref => {
|
|
|
89
80
|
*
|
|
90
81
|
* Note: This must be called *before* focus moves using `onKeyDown` or similar.
|
|
91
82
|
*/
|
|
92
|
-
const wrapFocusWithoutSentinels =
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
} = _ref4;
|
|
83
|
+
const wrapFocusWithoutSentinels = ({
|
|
84
|
+
containerNode,
|
|
85
|
+
currentActiveNode,
|
|
86
|
+
event
|
|
87
|
+
}) => {
|
|
98
88
|
if (!containerNode) return;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
}, []);
|
|
89
|
+
if (['blur', 'focusout', 'focusin', 'focus'].includes(event.type) && process.env.NODE_ENV !== 'production') {
|
|
90
|
+
throw new Error(`Error: wrapFocusWithoutSentinels(...) called in unsupported ${event.type} event.\n\nCall wrapFocusWithoutSentinels(...) from onKeyDown instead.`);
|
|
91
|
+
}
|
|
104
92
|
|
|
105
93
|
// Use `tabbable` to get the focusable elements in tab order.
|
|
106
94
|
// `selectorTabbable` returns elements in DOM order which is why it's not
|
|
@@ -9,7 +9,7 @@ import { warning } from '../internal/warning.js';
|
|
|
9
9
|
|
|
10
10
|
const didWarnAboutDeprecation = {};
|
|
11
11
|
function deprecate(propType, message) {
|
|
12
|
-
function checker(props, propName, componentName) {
|
|
12
|
+
function checker(props, propName, componentName, ...rest) {
|
|
13
13
|
if (props[propName] === undefined) {
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
@@ -20,9 +20,6 @@ function deprecate(propType, message) {
|
|
|
20
20
|
};
|
|
21
21
|
process.env.NODE_ENV !== "production" ? warning(false, message || `The prop \`${propName}\` has been deprecated for the ` + `${componentName} component. It will be removed in the next major ` + `release`) : void 0;
|
|
22
22
|
}
|
|
23
|
-
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
|
|
24
|
-
rest[_key - 3] = arguments[_key];
|
|
25
|
-
}
|
|
26
23
|
return propType(props, propName, componentName, ...rest);
|
|
27
24
|
}
|
|
28
25
|
return checker;
|
|
@@ -9,7 +9,7 @@ import { warning } from '../internal/warning.js';
|
|
|
9
9
|
|
|
10
10
|
const didWarnAboutDeprecation = {};
|
|
11
11
|
function deprecateValuesWithin(propType, allowedValues, propMappingFunction) {
|
|
12
|
-
return function checker(props, propName, componentName) {
|
|
12
|
+
return function checker(props, propName, componentName, ...rest) {
|
|
13
13
|
if (props[propName] === undefined) {
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
@@ -25,9 +25,6 @@ function deprecateValuesWithin(propType, allowedValues, propMappingFunction) {
|
|
|
25
25
|
process.env.NODE_ENV !== "production" ? warning(false, message) : void 0;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
|
|
29
|
-
rest[_key - 3] = arguments[_key];
|
|
30
|
-
}
|
|
31
28
|
return propType(props, propName, componentName, ...rest);
|
|
32
29
|
};
|
|
33
30
|
}
|
|
@@ -15,13 +15,10 @@
|
|
|
15
15
|
*/
|
|
16
16
|
const isRequiredOneOf = propTypes => {
|
|
17
17
|
const names = Object.keys(propTypes);
|
|
18
|
-
const checker = propType =>
|
|
18
|
+
const checker = propType => (props, propName, componentName, ...rest) => {
|
|
19
19
|
if (process.env.NODE_ENV !== 'production' && names.every(name => typeof props[name] === 'undefined')) {
|
|
20
20
|
return new Error(`${componentName} requires one of the following props: ${names.join(', ')}`);
|
|
21
21
|
}
|
|
22
|
-
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
|
|
23
|
-
rest[_key - 3] = arguments[_key];
|
|
24
|
-
}
|
|
25
22
|
return propType(props, propName, componentName, ...rest);
|
|
26
23
|
};
|
|
27
24
|
return names.reduce((acc, name) => ({
|
|
@@ -13,13 +13,10 @@
|
|
|
13
13
|
* becomes required if the prop corresponding to the provided prop name exists.
|
|
14
14
|
*/
|
|
15
15
|
function requiredIfGivenPropIsTruthy(name, propType) {
|
|
16
|
-
return function check(props, propName, componentName) {
|
|
16
|
+
return function check(props, propName, componentName, ...rest) {
|
|
17
17
|
if (process.env.NODE_ENV !== 'production' && props[name] == true && props[propName] == null) {
|
|
18
18
|
return new Error(`You must provide a value for \`${propName}\` in \`${componentName}\` if \`${name}\` exists.`);
|
|
19
19
|
}
|
|
20
|
-
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
|
|
21
|
-
rest[_key - 3] = arguments[_key];
|
|
22
|
-
}
|
|
23
20
|
return propType(props, propName, componentName, ...rest);
|
|
24
21
|
};
|
|
25
22
|
}
|
package/es/tools/events.js
CHANGED
|
@@ -14,10 +14,7 @@
|
|
|
14
14
|
* @param handlers - An array of event handler functions.
|
|
15
15
|
* @returns A composite event handler.
|
|
16
16
|
*/
|
|
17
|
-
const composeEventHandlers = handlers =>
|
|
18
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
19
|
-
args[_key - 1] = arguments[_key];
|
|
20
|
-
}
|
|
17
|
+
const composeEventHandlers = handlers => (event, ...args) => {
|
|
21
18
|
for (const handler of handlers) {
|
|
22
19
|
if (event.defaultPrevented) {
|
|
23
20
|
break;
|
package/es/tools/mergeRefs.js
CHANGED
|
@@ -9,20 +9,15 @@
|
|
|
9
9
|
* @param {...Ref<Element>} refs List of React refs to merge.
|
|
10
10
|
* @returns {Ref<Element>} Merged React ref.
|
|
11
11
|
*/
|
|
12
|
-
const mergeRefs =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} else if (Object(ref) === ref) {
|
|
22
|
-
ref.current = el;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
};
|
|
12
|
+
const mergeRefs = (...refs) => el => {
|
|
13
|
+
refs.forEach(ref => {
|
|
14
|
+
// https://github.com/facebook/react/issues/13029#issuecomment-410002316
|
|
15
|
+
if (typeof ref === 'function') {
|
|
16
|
+
ref(el);
|
|
17
|
+
} else if (Object(ref) === ref) {
|
|
18
|
+
ref.current = el;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
26
21
|
};
|
|
27
22
|
var mergeRefs$1 = mergeRefs;
|
|
28
23
|
|
package/es/tools/uniqueId.js
CHANGED
|
@@ -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;
|
|
@@ -7,32 +7,30 @@
|
|
|
7
7
|
|
|
8
8
|
import cx from 'classnames';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
|
-
import
|
|
10
|
+
import React from 'react';
|
|
11
11
|
import { usePrefix } from '../internal/usePrefix.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @param {{ name: string, type: string, className?: string | (prefix: string) => string }} props
|
|
15
15
|
* @returns
|
|
16
16
|
*/
|
|
17
|
-
const wrapComponent =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} = _ref;
|
|
17
|
+
const wrapComponent = ({
|
|
18
|
+
name,
|
|
19
|
+
className: getClassName,
|
|
20
|
+
type
|
|
21
|
+
}) => {
|
|
23
22
|
/**
|
|
24
23
|
*
|
|
25
24
|
* @param {{ className?: string, [x: string]: any}} param0
|
|
26
25
|
* @returns
|
|
27
26
|
*/
|
|
28
|
-
function Component(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} = _ref2;
|
|
27
|
+
function Component({
|
|
28
|
+
className: baseClassName,
|
|
29
|
+
...other
|
|
30
|
+
}) {
|
|
33
31
|
const prefix = usePrefix();
|
|
34
32
|
const componentClass = cx(typeof getClassName === 'function' ? getClassName(prefix) : getClassName, baseClassName);
|
|
35
|
-
return /*#__PURE__*/
|
|
33
|
+
return /*#__PURE__*/React.createElement(type, {
|
|
36
34
|
...other,
|
|
37
35
|
// Prevent Weird quirk where `cx` will evaluate to an empty string, '',
|
|
38
36
|
// and so we have empty `class` attributes in the resulting markup
|
package/es/types/common.d.ts
CHANGED
|
@@ -4,8 +4,6 @@
|
|
|
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 * as React from 'react';
|
|
8
|
-
export type ReactAttr<T = HTMLElement> = React.HTMLAttributes<T>;
|
|
9
7
|
/**
|
|
10
8
|
* For "as" props. Creates an "as" property that supports native html tags such as 'span', 'a', 'button' as well as custom functional components
|
|
11
9
|
* All native props for the supplied html tag/component are inferred as part of the base component props, allowing us to use props like `href` on an 'a' element etc
|
|
@@ -29,12 +29,11 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
29
29
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
30
30
|
|
|
31
31
|
var _Undo;
|
|
32
|
-
const AILabelContent = /*#__PURE__*/React__default["default"].forwardRef(function AILabelContent(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} = _ref;
|
|
32
|
+
const AILabelContent = /*#__PURE__*/React__default["default"].forwardRef(function AILabelContent({
|
|
33
|
+
className,
|
|
34
|
+
children,
|
|
35
|
+
...rest
|
|
36
|
+
}, ref) {
|
|
38
37
|
const prefix = usePrefix.usePrefix();
|
|
39
38
|
const hasAILabelActions = React__default["default"].Children.toArray(children).some(child => {
|
|
40
39
|
const item = child;
|
|
@@ -59,12 +58,11 @@ AILabelContent.propTypes = {
|
|
|
59
58
|
*/
|
|
60
59
|
className: PropTypes__default["default"].string
|
|
61
60
|
};
|
|
62
|
-
const AILabelActions = /*#__PURE__*/React__default["default"].forwardRef(function AILabelActions(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
} = _ref2;
|
|
61
|
+
const AILabelActions = /*#__PURE__*/React__default["default"].forwardRef(function AILabelActions({
|
|
62
|
+
className,
|
|
63
|
+
children,
|
|
64
|
+
...rest
|
|
65
|
+
}, ref) {
|
|
68
66
|
const prefix = usePrefix.usePrefix();
|
|
69
67
|
const aiLabelActionsClasses = cx__default["default"](className, {
|
|
70
68
|
[`${prefix}--ai-label-actions`]: true
|
|
@@ -90,24 +88,23 @@ AILabelActions.propTypes = {
|
|
|
90
88
|
* @deprecated Use NewPopoverAlignment instead.
|
|
91
89
|
*/
|
|
92
90
|
|
|
93
|
-
const AILabel = /*#__PURE__*/React__default["default"].forwardRef(function AILabel(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
} = _ref3;
|
|
91
|
+
const AILabel = /*#__PURE__*/React__default["default"].forwardRef(function AILabel({
|
|
92
|
+
aiText = 'AI',
|
|
93
|
+
aiTextLabel,
|
|
94
|
+
textLabel,
|
|
95
|
+
align,
|
|
96
|
+
autoAlign = true,
|
|
97
|
+
children,
|
|
98
|
+
className,
|
|
99
|
+
kind = 'default',
|
|
100
|
+
onRevertClick,
|
|
101
|
+
revertActive,
|
|
102
|
+
revertLabel = 'Revert to AI input',
|
|
103
|
+
slugLabel = 'Show information',
|
|
104
|
+
['aria-label']: ariaLabel = 'Show information',
|
|
105
|
+
size = 'xs',
|
|
106
|
+
...rest
|
|
107
|
+
}, ref) {
|
|
111
108
|
const prefix = usePrefix.usePrefix();
|
|
112
109
|
const id = useId.useId('AILabel');
|
|
113
110
|
const aiLabelClasses = cx__default["default"](className, {
|
|
@@ -22,11 +22,10 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
22
22
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
23
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
24
24
|
|
|
25
|
-
const AISkeletonIcon =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} = _ref;
|
|
25
|
+
const AISkeletonIcon = ({
|
|
26
|
+
className,
|
|
27
|
+
...rest
|
|
28
|
+
}) => {
|
|
30
29
|
const prefix = usePrefix.usePrefix();
|
|
31
30
|
const AISkeletonIconClasses = cx__default["default"](className, {
|
|
32
31
|
[`${prefix}--skeleton__icon--ai`]: true
|
|
@@ -22,11 +22,10 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
22
22
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
23
23
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
24
24
|
|
|
25
|
-
const AISkeletonPlaceholder =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} = _ref;
|
|
25
|
+
const AISkeletonPlaceholder = ({
|
|
26
|
+
className,
|
|
27
|
+
...other
|
|
28
|
+
}) => {
|
|
30
29
|
const prefix = usePrefix.usePrefix();
|
|
31
30
|
const AISkeletonPlaceholderClasses = cx__default["default"]({
|
|
32
31
|
className,
|
|
@@ -22,11 +22,10 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
22
22
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
23
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
24
24
|
|
|
25
|
-
const AISkeletonText =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} = _ref;
|
|
25
|
+
const AISkeletonText = ({
|
|
26
|
+
className,
|
|
27
|
+
...rest
|
|
28
|
+
}) => {
|
|
30
29
|
const prefix = usePrefix.usePrefix();
|
|
31
30
|
const aiSkeletonTextClasses = cx__default["default"](className, {
|
|
32
31
|
[`${prefix}--skeleton__text--ai`]: true
|
|
@@ -24,16 +24,15 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
24
24
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
25
25
|
|
|
26
26
|
var _SkeletonText, _SkeletonText2, _SkeletonText3;
|
|
27
|
-
function AccordionSkeleton(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} = _ref;
|
|
27
|
+
function AccordionSkeleton({
|
|
28
|
+
align = 'end',
|
|
29
|
+
className,
|
|
30
|
+
count = 4,
|
|
31
|
+
isFlush,
|
|
32
|
+
open = true,
|
|
33
|
+
ordered = false,
|
|
34
|
+
...rest
|
|
35
|
+
}) {
|
|
37
36
|
const prefix = usePrefix.usePrefix();
|
|
38
37
|
const classes = cx__default["default"](`${prefix}--accordion`, `${prefix}--skeleton`, className, {
|
|
39
38
|
[`${prefix}--accordion--${align}`]: align,
|
|
@@ -22,17 +22,16 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
22
22
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
23
23
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
24
24
|
|
|
25
|
-
function Accordion(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
} = _ref;
|
|
25
|
+
function Accordion({
|
|
26
|
+
align = 'end',
|
|
27
|
+
children,
|
|
28
|
+
className: customClassName,
|
|
29
|
+
disabled = false,
|
|
30
|
+
isFlush = false,
|
|
31
|
+
ordered = false,
|
|
32
|
+
size,
|
|
33
|
+
...rest
|
|
34
|
+
}) {
|
|
36
35
|
const prefix = usePrefix.usePrefix();
|
|
37
36
|
const className = cx__default["default"](`${prefix}--accordion`, customClassName, {
|
|
38
37
|
[`${prefix}--accordion--${align}`]: align,
|