@carbon/react 1.83.0 → 1.84.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 +909 -874
- package/README.md +1 -1
- package/es/components/AILabel/index.js +27 -30
- package/es/components/AISkeleton/AISkeletonIcon.js +4 -5
- package/es/components/AISkeleton/AISkeletonPlaceholder.js +4 -5
- package/es/components/AISkeleton/AISkeletonText.js +4 -5
- package/es/components/Accordion/Accordion.Skeleton.js +9 -10
- package/es/components/Accordion/Accordion.js +10 -11
- package/es/components/Accordion/AccordionItem.js +13 -14
- package/es/components/Accordion/AccordionProvider.js +4 -5
- package/es/components/AspectRatio/AspectRatio.js +7 -8
- package/es/components/BadgeIndicator/index.js +5 -6
- package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +4 -5
- package/es/components/Button/Button.Skeleton.js +7 -8
- package/es/components/Button/ButtonBase.js +23 -24
- package/es/components/ChatButton/ChatButton.Skeleton.js +5 -6
- package/es/components/ChatButton/ChatButton.js +11 -12
- package/es/components/Checkbox/Checkbox.Skeleton.js +4 -5
- package/es/components/Checkbox/Checkbox.js +19 -20
- package/es/components/CheckboxGroup/CheckboxGroup.js +16 -17
- package/es/components/ClassPrefix/index.js +4 -5
- package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +5 -6
- package/es/components/CodeSnippet/CodeSnippet.js +25 -26
- package/es/components/ComboBox/ComboBox.js +24 -30
- package/es/components/ComboBox/tools/filter.js +9 -12
- package/es/components/ComboButton/index.js +16 -18
- package/es/components/ComposedModal/ComposedModal.js +50 -36
- package/es/components/ComposedModal/ModalFooter.js +37 -42
- package/es/components/ComposedModal/ModalHeader.js +14 -15
- package/es/components/ContainedList/ContainedList.js +10 -11
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +9 -10
- package/es/components/ContentSwitcher/ContentSwitcher.d.ts +9 -29
- package/es/components/ContentSwitcher/ContentSwitcher.js +96 -128
- package/es/components/ContentSwitcher/index.d.ts +3 -4
- package/es/components/ContextMenu/useContextMenu.js +1 -2
- package/es/components/Copy/Copy.js +11 -12
- package/es/components/CopyButton/CopyButton.js +10 -11
- package/es/components/DataTable/DataTable.js +45 -53
- package/es/components/DataTable/Table.js +15 -18
- package/es/components/DataTable/TableBatchAction.js +8 -11
- package/es/components/DataTable/TableBatchActions.js +18 -20
- package/es/components/DataTable/TableBody.js +8 -11
- package/es/components/DataTable/TableContainer.js +9 -10
- package/es/components/DataTable/TableDecoratorRow.js +4 -5
- package/es/components/DataTable/TableExpandHeader.js +14 -15
- package/es/components/DataTable/TableExpandRow.js +13 -14
- package/es/components/DataTable/TableExpandedRow.js +6 -7
- package/es/components/DataTable/TableHeader.js +15 -16
- package/es/components/DataTable/TableSelectAll.js +11 -12
- package/es/components/DataTable/TableSelectRow.js +12 -13
- package/es/components/DataTable/TableSlugRow.js +4 -5
- package/es/components/DataTable/TableToolbar.js +7 -8
- package/es/components/DataTable/TableToolbarMenu.js +8 -9
- package/es/components/DataTable/TableToolbarSearch.js +22 -24
- 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 +11 -12
- package/es/components/DatePicker/DatePicker.Skeleton.js +7 -8
- package/es/components/DatePicker/DatePicker.js +88 -65
- package/es/components/DatePickerInput/DatePickerInput.js +5 -6
- package/es/components/Dialog/index.d.ts +193 -8
- package/es/components/Dialog/index.js +454 -35
- package/es/components/Dropdown/Dropdown.Skeleton.js +6 -7
- package/es/components/Dropdown/Dropdown.js +40 -43
- package/es/components/ErrorBoundary/ErrorBoundary.js +2 -2
- package/es/components/ExpandableSearch/ExpandableSearch.js +9 -10
- package/es/components/FeatureFlags/index.js +11 -12
- package/es/components/FileUploader/FileUploader.Skeleton.js +4 -5
- package/es/components/FileUploader/FileUploader.js +22 -24
- package/es/components/FileUploader/FileUploaderButton.js +16 -17
- package/es/components/FileUploader/FileUploaderDropContainer.js +15 -16
- package/es/components/FileUploader/FileUploaderItem.js +13 -14
- package/es/components/FileUploader/Filename.js +9 -10
- package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +4 -5
- package/es/components/FluidComboBox/FluidComboBox.js +5 -6
- package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +5 -6
- package/es/components/FluidDatePicker/FluidDatePicker.js +10 -11
- package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +4 -5
- package/es/components/FluidDropdown/FluidDropdown.js +5 -6
- package/es/components/FluidForm/FluidForm.js +5 -6
- package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +4 -5
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +6 -7
- package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.js +4 -5
- package/es/components/FluidNumberInput/FluidNumberInput.d.ts +40 -1
- package/es/components/FluidNumberInput/FluidNumberInput.js +38 -5
- package/es/components/FluidSearch/FluidSearch.Skeleton.js +4 -5
- package/es/components/FluidSearch/FluidSearch.js +4 -5
- package/es/components/FluidSelect/FluidSelect.Skeleton.js +4 -5
- package/es/components/FluidSelect/FluidSelect.js +5 -6
- package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +4 -5
- package/es/components/FluidTextArea/FluidTextArea.js +4 -5
- package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +4 -5
- package/es/components/FluidTextInput/FluidTextInput.js +5 -6
- package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +5 -6
- package/es/components/FluidTimePicker/FluidTimePicker.js +11 -12
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +5 -6
- package/es/components/Form/Form.js +5 -6
- package/es/components/FormGroup/FormGroup.js +11 -12
- package/es/components/FormItem/FormItem.js +5 -6
- package/es/components/FormLabel/FormLabel.js +6 -7
- package/es/components/Grid/CSSGrid.js +17 -19
- package/es/components/Grid/Column.js +28 -27
- package/es/components/Grid/ColumnHang.js +6 -7
- package/es/components/Grid/FlexGrid.js +9 -10
- package/es/components/Grid/GridContext.js +5 -6
- package/es/components/Grid/Row.js +8 -9
- package/es/components/Heading/index.js +5 -6
- package/es/components/Icon/Icon.Skeleton.js +4 -5
- package/es/components/IconButton/index.js +20 -21
- package/es/components/IconIndicator/index.js +7 -8
- package/es/components/IdPrefix/index.js +4 -5
- package/es/components/InlineLoading/InlineLoading.js +9 -10
- package/es/components/Layer/index.js +8 -9
- package/es/components/Layout/index.js +21 -26
- package/es/components/LayoutDirection/LayoutDirection.js +6 -7
- package/es/components/Link/Link.d.ts +1 -1
- package/es/components/Link/Link.js +14 -15
- package/es/components/ListBox/ListBoxField.js +6 -7
- package/es/components/ListBox/ListBoxMenu.js +5 -6
- package/es/components/ListBox/ListBoxMenuIcon.js +4 -5
- package/es/components/ListBox/ListBoxMenuItem.js +8 -10
- package/es/components/ListBox/ListBoxSelection.js +8 -9
- package/es/components/ListBox/next/ListBoxSelection.js +9 -10
- package/es/components/ListBox/next/ListBoxTrigger.js +5 -6
- package/es/components/ListItem/ListItem.js +5 -6
- package/es/components/Loading/Loading.js +8 -9
- package/es/components/Menu/Menu.js +23 -24
- package/es/components/Menu/MenuItem.js +39 -44
- package/es/components/MenuButton/index.js +16 -18
- package/es/components/Modal/Modal.js +74 -65
- package/es/components/ModalWrapper/ModalWrapper.js +2 -2
- package/es/components/MultiSelect/FilterableMultiSelect.js +67 -48
- package/es/components/MultiSelect/MultiSelect.js +43 -45
- package/es/components/MultiSelect/tools/sorting.js +11 -15
- package/es/components/Notification/Notification.js +96 -105
- package/es/components/NumberInput/NumberFormatPropTypes.d.ts +29 -0
- package/es/components/NumberInput/NumberFormatPropTypes.js +40 -0
- package/es/components/NumberInput/NumberInput.Skeleton.js +6 -7
- package/es/components/NumberInput/NumberInput.d.ts +39 -3
- package/es/components/NumberInput/NumberInput.js +174 -44
- package/es/components/OrderedList/OrderedList.js +7 -8
- package/es/components/OverflowMenu/OverflowMenu.d.ts +1 -1
- package/es/components/OverflowMenu/OverflowMenu.js +39 -46
- package/es/components/OverflowMenu/next/index.js +12 -13
- package/es/components/PageHeader/PageHeader.d.ts +39 -14
- package/es/components/PageHeader/PageHeader.js +187 -81
- package/es/components/PageHeader/index.d.ts +2 -2
- package/es/components/PageHeader/index.js +1 -1
- package/es/components/Pagination/Pagination.Skeleton.js +4 -5
- package/es/components/Pagination/Pagination.js +24 -25
- package/es/components/Pagination/experimental/PageSelector.js +8 -9
- package/es/components/Pagination/experimental/Pagination.js +20 -21
- package/es/components/PaginationNav/PaginationNav.js +33 -38
- package/es/components/Popover/index.js +26 -28
- package/es/components/ProgressBar/ProgressBar.js +11 -12
- package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +5 -6
- package/es/components/ProgressIndicator/ProgressIndicator.js +29 -32
- package/es/components/RadioTile/RadioTile.js +17 -18
- package/es/components/Search/Search.Skeleton.js +5 -6
- package/es/components/Search/Search.js +26 -29
- package/es/components/Select/Select.Skeleton.js +5 -6
- package/es/components/Select/Select.js +24 -25
- package/es/components/SelectItem/SelectItem.js +8 -9
- package/es/components/SelectItemGroup/SelectItemGroup.js +7 -8
- package/es/components/ShapeIndicator/index.js +7 -8
- package/es/components/SkeletonIcon/SkeletonIcon.js +4 -5
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +4 -5
- package/es/components/SkeletonText/SkeletonText.js +8 -9
- package/es/components/Slider/Slider.Skeleton.js +8 -9
- package/es/components/Slider/Slider.js +75 -83
- package/es/components/Slider/SliderHandles.js +6 -6
- package/es/components/StructuredList/StructuredList.Skeleton.js +5 -6
- package/es/components/Tabs/Tabs.Skeleton.js +5 -6
- package/es/components/Tabs/Tabs.js +83 -98
- package/es/components/Tabs/usePressable.js +7 -8
- package/es/components/Tag/DismissibleTag.js +16 -17
- package/es/components/Tag/OperationalTag.js +10 -11
- package/es/components/Tag/SelectableTag.js +13 -14
- package/es/components/Tag/Tag.Skeleton.js +5 -6
- package/es/components/Tag/Tag.js +19 -20
- package/es/components/Text/Text.js +6 -7
- package/es/components/Text/TextDirection.js +5 -6
- package/es/components/TextArea/TextArea.js +7 -7
- package/es/components/TextInput/ControlledPasswordInput.js +24 -25
- package/es/components/TextInput/PasswordInput.js +26 -27
- package/es/components/TextInput/TextInput.Skeleton.js +5 -6
- package/es/components/TextInput/TextInput.js +27 -28
- package/es/components/TextInput/util.js +14 -17
- package/es/components/Theme/index.js +10 -12
- package/es/components/Tile/Tile.js +68 -74
- package/es/components/TileGroup/TileGroup.d.ts +4 -4
- package/es/components/TileGroup/TileGroup.js +45 -53
- package/es/components/TileGroup/index.d.ts +3 -3
- package/es/components/Toggle/Toggle.Skeleton.js +4 -5
- package/es/components/Toggle/Toggle.js +17 -18
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +6 -7
- package/es/components/Toggletip/index.js +33 -39
- package/es/components/Tooltip/DefinitionTooltip.js +13 -14
- package/es/components/Tooltip/Tooltip.js +15 -16
- package/es/components/TreeView/TreeNode.js +20 -21
- package/es/components/TreeView/TreeView.js +14 -16
- package/es/components/UIShell/Content.js +6 -7
- package/es/components/UIShell/Header.js +5 -6
- package/es/components/UIShell/HeaderContainer.js +5 -6
- package/es/components/UIShell/HeaderGlobalAction.js +12 -13
- package/es/components/UIShell/HeaderMenu.d.ts +10 -112
- package/es/components/UIShell/HeaderMenu.js +154 -201
- package/es/components/UIShell/HeaderMenuButton.js +10 -11
- package/es/components/UIShell/HeaderMenuItem.js +12 -12
- package/es/components/UIShell/HeaderName.js +6 -7
- package/es/components/UIShell/HeaderNavigation.js +7 -8
- package/es/components/UIShell/HeaderPanel.js +9 -10
- package/es/components/UIShell/HeaderSideNavItems.js +5 -6
- package/es/components/UIShell/Link.js +8 -9
- package/es/components/UIShell/SideNav.js +23 -25
- package/es/components/UIShell/SideNavDetails.js +6 -7
- package/es/components/UIShell/SideNavDivider.js +3 -4
- package/es/components/UIShell/SideNavFooter.js +6 -7
- package/es/components/UIShell/SideNavHeader.js +5 -6
- package/es/components/UIShell/SideNavIcon.js +5 -6
- package/es/components/UIShell/SideNavItem.js +5 -6
- package/es/components/UIShell/SideNavItems.js +5 -6
- package/es/components/UIShell/SideNavLink.js +10 -11
- package/es/components/UIShell/SideNavLinkText.js +5 -6
- package/es/components/UIShell/SideNavMenu.js +11 -12
- package/es/components/UIShell/SkipToContent.js +7 -8
- package/es/components/UIShell/Switcher.js +4 -5
- package/es/components/UIShell/SwitcherDivider.js +4 -5
- package/es/components/UnorderedList/UnorderedList.js +6 -7
- package/es/index.js +3 -3
- package/es/internal/FloatingMenu.js +26 -28
- package/es/internal/Selection.js +15 -17
- 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 +2 -4
- 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 +9 -10
- package/es/internal/useOverflowItems.d.ts +29 -0
- package/es/internal/useOverflowItems.js +122 -0
- package/es/internal/useResizeObserver.js +4 -5
- package/es/internal/useSavedCallback.js +1 -3
- package/es/internal/wrapFocus.js +20 -29
- 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.js +9 -11
- 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 +25 -26
- 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 +50 -36
- 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 +9 -29
- package/lib/components/ContentSwitcher/ContentSwitcher.js +94 -126
- 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.js +45 -53
- package/lib/components/DataTable/Table.js +15 -18
- package/lib/components/DataTable/TableBatchAction.js +8 -11
- package/lib/components/DataTable/TableBatchActions.js +18 -20
- package/lib/components/DataTable/TableBody.js +8 -11
- package/lib/components/DataTable/TableContainer.js +9 -10
- package/lib/components/DataTable/TableDecoratorRow.js +4 -5
- package/lib/components/DataTable/TableExpandHeader.js +14 -15
- package/lib/components/DataTable/TableExpandRow.js +13 -14
- package/lib/components/DataTable/TableExpandedRow.js +6 -7
- package/lib/components/DataTable/TableHeader.js +15 -16
- 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/TableToolbarMenu.js +8 -9
- package/lib/components/DataTable/TableToolbarSearch.js +22 -24
- 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.js +5 -6
- package/lib/components/Dialog/index.d.ts +193 -8
- package/lib/components/Dialog/index.js +457 -33
- package/lib/components/Dropdown/Dropdown.Skeleton.js +6 -7
- 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.js +4 -5
- package/lib/components/FileUploader/FileUploader.js +22 -24
- package/lib/components/FileUploader/FileUploaderButton.js +16 -17
- package/lib/components/FileUploader/FileUploaderDropContainer.js +15 -16
- package/lib/components/FileUploader/FileUploaderItem.js +13 -14
- 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.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.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.js +5 -6
- 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 +20 -21
- 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.js +8 -9
- 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 +14 -15
- package/lib/components/ListBox/ListBoxField.js +6 -7
- package/lib/components/ListBox/ListBoxMenu.js +5 -6
- package/lib/components/ListBox/ListBoxMenuIcon.js +4 -5
- 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.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.js +74 -65
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.js +66 -47
- 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 +39 -46
- package/lib/components/OverflowMenu/next/index.js +12 -13
- package/lib/components/PageHeader/PageHeader.d.ts +39 -14
- package/lib/components/PageHeader/PageHeader.js +185 -81
- package/lib/components/PageHeader/index.d.ts +2 -2
- package/lib/components/PageHeader/index.js +0 -2
- 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 -29
- 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.js +4 -5
- 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 +75 -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 +7 -7
- 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 +4 -4
- package/lib/components/TileGroup/TileGroup.js +44 -52
- package/lib/components/TileGroup/index.d.ts +3 -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.js +15 -16
- package/lib/components/TreeView/TreeNode.js +20 -21
- package/lib/components/TreeView/TreeView.js +14 -16
- 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/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 +12 -12
- 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 +36 -36
- package/lib/internal/FloatingMenu.js +26 -28
- package/lib/internal/Selection.js +15 -17
- 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/useOverflowItems.d.ts +29 -0
- package/lib/internal/useOverflowItems.js +126 -0
- package/lib/internal/useResizeObserver.js +4 -5
- package/lib/internal/useSavedCallback.js +1 -3
- package/lib/internal/wrapFocus.js +20 -29
- 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.js +9 -11
- package/package.json +21 -19
- package/telemetry.yml +25 -1
- package/es/components/ContentSwitcher/index.js +0 -13
- package/es/feature-flags.d.ts +0 -7
- package/es/internal/useAnnouncer.js +0 -21
- package/lib/components/ContentSwitcher/index.js +0 -18
- package/lib/feature-flags.d.ts +0 -7
- package/lib/internal/useAnnouncer.js +0 -25
|
@@ -68,15 +68,14 @@ const TabPanelContext = /*#__PURE__*/React.createContext(0);
|
|
|
68
68
|
* Tabs
|
|
69
69
|
*/
|
|
70
70
|
|
|
71
|
-
function Tabs(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
} = _ref;
|
|
71
|
+
function Tabs({
|
|
72
|
+
children,
|
|
73
|
+
defaultSelectedIndex = 0,
|
|
74
|
+
onChange,
|
|
75
|
+
selectedIndex: controlledSelectedIndex,
|
|
76
|
+
dismissable,
|
|
77
|
+
onTabCloseRequest
|
|
78
|
+
}) {
|
|
80
79
|
const baseId = useId('ccs');
|
|
81
80
|
if (dismissable && !onTabCloseRequest) {
|
|
82
81
|
console.error('dismissable property specified without also providing an onTabCloseRequest property.');
|
|
@@ -141,15 +140,14 @@ Tabs.propTypes = {
|
|
|
141
140
|
*/
|
|
142
141
|
selectedIndex: PropTypes.number
|
|
143
142
|
};
|
|
144
|
-
function TabsVertical(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
} = _ref2;
|
|
143
|
+
function TabsVertical({
|
|
144
|
+
children,
|
|
145
|
+
height,
|
|
146
|
+
defaultSelectedIndex = 0,
|
|
147
|
+
onChange,
|
|
148
|
+
selectedIndex: controlledSelectedIndex,
|
|
149
|
+
...rest
|
|
150
|
+
}) {
|
|
153
151
|
const [selectedIndex, setSelectedIndex] = useControllableState({
|
|
154
152
|
value: controlledSelectedIndex,
|
|
155
153
|
defaultValue: defaultSelectedIndex,
|
|
@@ -160,12 +158,9 @@ function TabsVertical(_ref2) {
|
|
|
160
158
|
const props = {
|
|
161
159
|
...rest,
|
|
162
160
|
selectedIndex,
|
|
163
|
-
onChange:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
} = _ref3;
|
|
167
|
-
return setSelectedIndex(selectedIndex);
|
|
168
|
-
}
|
|
161
|
+
onChange: ({
|
|
162
|
+
selectedIndex
|
|
163
|
+
}) => setSelectedIndex(selectedIndex)
|
|
169
164
|
};
|
|
170
165
|
const isSm = useMatchMedia(smMediaQuery);
|
|
171
166
|
if (!isSm) {
|
|
@@ -250,22 +245,21 @@ function getNextIndexVertical(event, total, index) {
|
|
|
250
245
|
* TabList
|
|
251
246
|
*/
|
|
252
247
|
|
|
253
|
-
function TabList(
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
} = _ref4;
|
|
248
|
+
function TabList({
|
|
249
|
+
activation = 'automatic',
|
|
250
|
+
'aria-label': label,
|
|
251
|
+
children,
|
|
252
|
+
className: customClassName,
|
|
253
|
+
contained = false,
|
|
254
|
+
fullWidth = false,
|
|
255
|
+
iconSize,
|
|
256
|
+
leftOverflowButtonProps,
|
|
257
|
+
light,
|
|
258
|
+
rightOverflowButtonProps,
|
|
259
|
+
scrollDebounceWait = 200,
|
|
260
|
+
scrollIntoView,
|
|
261
|
+
...rest
|
|
262
|
+
}) {
|
|
269
263
|
const {
|
|
270
264
|
activeIndex,
|
|
271
265
|
selectedIndex,
|
|
@@ -341,10 +335,9 @@ function TabList(_ref4) {
|
|
|
341
335
|
tabs.current[nextIndex]?.focus();
|
|
342
336
|
}
|
|
343
337
|
}
|
|
344
|
-
function handleBlur(
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
} = _ref5;
|
|
338
|
+
function handleBlur({
|
|
339
|
+
relatedTarget: currentActiveNode
|
|
340
|
+
}) {
|
|
348
341
|
if (ref.current?.contains(currentActiveNode)) {
|
|
349
342
|
return;
|
|
350
343
|
}
|
|
@@ -455,10 +448,9 @@ function TabList(_ref4) {
|
|
|
455
448
|
scrollTabIntoView(tab);
|
|
456
449
|
}, [selectedIndex, isScrollable, children]);
|
|
457
450
|
usePressable(previousButton, {
|
|
458
|
-
onPress(
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
} = _ref6;
|
|
451
|
+
onPress({
|
|
452
|
+
longPress
|
|
453
|
+
}) {
|
|
462
454
|
if (!longPress && ref.current) {
|
|
463
455
|
setScrollLeft(Math.max(scrollLeft - ref.current.scrollWidth / tabs.current.length * 1.5, 0));
|
|
464
456
|
}
|
|
@@ -468,10 +460,9 @@ function TabList(_ref4) {
|
|
|
468
460
|
}
|
|
469
461
|
});
|
|
470
462
|
usePressable(nextButton, {
|
|
471
|
-
onPress(
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
} = _ref7;
|
|
463
|
+
onPress({
|
|
464
|
+
longPress
|
|
465
|
+
}) {
|
|
475
466
|
if (!longPress && ref.current) {
|
|
476
467
|
setScrollLeft(Math.min(scrollLeft + ref.current.scrollWidth / tabs.current.length * 1.5, ref.current.scrollWidth - ref.current.clientWidth));
|
|
477
468
|
}
|
|
@@ -581,15 +572,14 @@ TabList.propTypes = {
|
|
|
581
572
|
|
|
582
573
|
// type TabElement = HTMLElement & { disabled?: boolean };
|
|
583
574
|
|
|
584
|
-
function TabListVertical(
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
} = _ref8;
|
|
575
|
+
function TabListVertical({
|
|
576
|
+
activation = 'automatic',
|
|
577
|
+
'aria-label': label,
|
|
578
|
+
children,
|
|
579
|
+
className: customClassName,
|
|
580
|
+
scrollIntoView,
|
|
581
|
+
...rest
|
|
582
|
+
}) {
|
|
593
583
|
const {
|
|
594
584
|
activeIndex,
|
|
595
585
|
selectedIndex,
|
|
@@ -618,10 +608,9 @@ function TabListVertical(_ref8) {
|
|
|
618
608
|
tabs.current[nextIndex]?.focus();
|
|
619
609
|
}
|
|
620
610
|
}
|
|
621
|
-
function handleBlur(
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
} = _ref9;
|
|
611
|
+
function handleBlur({
|
|
612
|
+
relatedTarget: currentActiveNode
|
|
613
|
+
}) {
|
|
625
614
|
if (ref.current?.contains(currentActiveNode)) {
|
|
626
615
|
return;
|
|
627
616
|
}
|
|
@@ -780,18 +769,17 @@ function createLongPressBehavior(ref, direction, setScrollLeft) {
|
|
|
780
769
|
* Tab
|
|
781
770
|
*/
|
|
782
771
|
|
|
783
|
-
const Tab = /*#__PURE__*/forwardRef(function Tab(
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
} = _ref10;
|
|
772
|
+
const Tab = /*#__PURE__*/forwardRef(function Tab({
|
|
773
|
+
as = 'button',
|
|
774
|
+
children,
|
|
775
|
+
className: customClassName,
|
|
776
|
+
disabled,
|
|
777
|
+
onClick,
|
|
778
|
+
onKeyDown,
|
|
779
|
+
secondaryLabel,
|
|
780
|
+
renderIcon: Icon,
|
|
781
|
+
...rest
|
|
782
|
+
}, forwardRef) {
|
|
795
783
|
const prefix = usePrefix();
|
|
796
784
|
const {
|
|
797
785
|
selectedIndex,
|
|
@@ -1034,17 +1022,16 @@ Tab.propTypes = {
|
|
|
1034
1022
|
*/
|
|
1035
1023
|
|
|
1036
1024
|
const IconTabContext = /*#__PURE__*/createContext(false);
|
|
1037
|
-
const IconTab = /*#__PURE__*/React.forwardRef(function IconTab(
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
} = _ref11;
|
|
1025
|
+
const IconTab = /*#__PURE__*/React.forwardRef(function IconTab({
|
|
1026
|
+
badgeIndicator,
|
|
1027
|
+
children,
|
|
1028
|
+
className: customClassName,
|
|
1029
|
+
defaultOpen = false,
|
|
1030
|
+
enterDelayMs,
|
|
1031
|
+
leaveDelayMs,
|
|
1032
|
+
label,
|
|
1033
|
+
...rest
|
|
1034
|
+
}, ref) {
|
|
1048
1035
|
const prefix = usePrefix();
|
|
1049
1036
|
const value = useMemo(() => ({
|
|
1050
1037
|
badgeIndicator
|
|
@@ -1106,12 +1093,11 @@ IconTab.propTypes = {
|
|
|
1106
1093
|
* TabPanel
|
|
1107
1094
|
*/
|
|
1108
1095
|
|
|
1109
|
-
const TabPanel = /*#__PURE__*/React.forwardRef(function TabPanel(
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
} = _ref12;
|
|
1096
|
+
const TabPanel = /*#__PURE__*/React.forwardRef(function TabPanel({
|
|
1097
|
+
children,
|
|
1098
|
+
className: customClassName,
|
|
1099
|
+
...rest
|
|
1100
|
+
}, forwardRef) {
|
|
1115
1101
|
const prefix = usePrefix();
|
|
1116
1102
|
const panel = useRef(null);
|
|
1117
1103
|
const ref = useMergedRefs([forwardRef, panel]);
|
|
@@ -1186,10 +1172,9 @@ TabPanel.propTypes = {
|
|
|
1186
1172
|
* TabPanels
|
|
1187
1173
|
*/
|
|
1188
1174
|
|
|
1189
|
-
function TabPanels(
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
} = _ref13;
|
|
1175
|
+
function TabPanels({
|
|
1176
|
+
children
|
|
1177
|
+
}) {
|
|
1193
1178
|
const prefix = usePrefix();
|
|
1194
1179
|
const refs = useRef([]);
|
|
1195
1180
|
const hiddenStates = useRef([]);
|
|
@@ -20,14 +20,13 @@ import { useRef, useState, useEffect } from 'react';
|
|
|
20
20
|
* delayLongPressMs?: number,
|
|
21
21
|
* }} options
|
|
22
22
|
*/
|
|
23
|
-
function usePressable(ref
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
23
|
+
function usePressable(ref, {
|
|
24
|
+
onPress,
|
|
25
|
+
onPressIn,
|
|
26
|
+
onPressOut,
|
|
27
|
+
onLongPress,
|
|
28
|
+
delayLongPressMs = 500
|
|
29
|
+
} = {}) {
|
|
31
30
|
const savedOnPress = useRef(onPress);
|
|
32
31
|
const savedOnPressIn = useRef(onPressIn);
|
|
33
32
|
const savedOnPressOut = useRef(onPressOut);
|
|
@@ -22,23 +22,22 @@ import mergeRefs from '../../tools/mergeRefs.js';
|
|
|
22
22
|
import { Text } from '../Text/Text.js';
|
|
23
23
|
|
|
24
24
|
var _Close;
|
|
25
|
-
const DismissibleTag = /*#__PURE__*/forwardRef((
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
} = _ref;
|
|
25
|
+
const DismissibleTag = /*#__PURE__*/forwardRef(({
|
|
26
|
+
className,
|
|
27
|
+
decorator,
|
|
28
|
+
disabled,
|
|
29
|
+
id,
|
|
30
|
+
renderIcon,
|
|
31
|
+
title = 'Dismiss',
|
|
32
|
+
onClose,
|
|
33
|
+
slug,
|
|
34
|
+
size,
|
|
35
|
+
text,
|
|
36
|
+
tagTitle,
|
|
37
|
+
type,
|
|
38
|
+
dismissTooltipLabel = 'Dismiss tag',
|
|
39
|
+
...other
|
|
40
|
+
}, forwardRef) => {
|
|
42
41
|
const prefix = usePrefix();
|
|
43
42
|
const tagLabelRef = useRef(null);
|
|
44
43
|
const tagId = id || `tag-${useId()}`;
|
|
@@ -31,17 +31,16 @@ const TYPES = {
|
|
|
31
31
|
'cool-gray': 'Cool-Gray',
|
|
32
32
|
'warm-gray': 'Warm-Gray'
|
|
33
33
|
};
|
|
34
|
-
const OperationalTag = /*#__PURE__*/forwardRef((
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
} = _ref;
|
|
34
|
+
const OperationalTag = /*#__PURE__*/forwardRef(({
|
|
35
|
+
className,
|
|
36
|
+
disabled,
|
|
37
|
+
id,
|
|
38
|
+
renderIcon,
|
|
39
|
+
size,
|
|
40
|
+
text,
|
|
41
|
+
type = 'gray',
|
|
42
|
+
...other
|
|
43
|
+
}, forwardRef) => {
|
|
45
44
|
const prefix = usePrefix();
|
|
46
45
|
const tagRef = useRef(null);
|
|
47
46
|
const tagId = id || `tag-${useId()}`;
|
|
@@ -20,20 +20,19 @@ import mergeRefs from '../../tools/mergeRefs.js';
|
|
|
20
20
|
import { useControllableState } from '../../internal/useControllableState.js';
|
|
21
21
|
import { Text } from '../Text/Text.js';
|
|
22
22
|
|
|
23
|
-
const SelectableTag = /*#__PURE__*/forwardRef((
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} = _ref;
|
|
23
|
+
const SelectableTag = /*#__PURE__*/forwardRef(({
|
|
24
|
+
className,
|
|
25
|
+
disabled,
|
|
26
|
+
id,
|
|
27
|
+
renderIcon,
|
|
28
|
+
onChange,
|
|
29
|
+
onClick,
|
|
30
|
+
selected,
|
|
31
|
+
size,
|
|
32
|
+
text,
|
|
33
|
+
defaultSelected = false,
|
|
34
|
+
...other
|
|
35
|
+
}, forwardRef) => {
|
|
37
36
|
const prefix = usePrefix();
|
|
38
37
|
const tagRef = useRef(null);
|
|
39
38
|
const tagId = id || `tag-${useId()}`;
|
|
@@ -11,12 +11,11 @@ import React from 'react';
|
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
|
|
14
|
-
function TagSkeleton(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} = _ref;
|
|
14
|
+
function TagSkeleton({
|
|
15
|
+
className,
|
|
16
|
+
size,
|
|
17
|
+
...rest
|
|
18
|
+
}) {
|
|
20
19
|
const prefix = usePrefix();
|
|
21
20
|
const tagClasses = cx(`${prefix}--tag`, `${prefix}--skeleton`, className, {
|
|
22
21
|
[`${prefix}--tag--${size}`]: size,
|
package/es/components/Tag/Tag.js
CHANGED
|
@@ -40,26 +40,25 @@ const SIZES = {
|
|
|
40
40
|
md: 'md',
|
|
41
41
|
lg: 'lg'
|
|
42
42
|
};
|
|
43
|
-
const TagBase = /*#__PURE__*/React.forwardRef((
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
} = _ref;
|
|
43
|
+
const TagBase = /*#__PURE__*/React.forwardRef(({
|
|
44
|
+
children,
|
|
45
|
+
className,
|
|
46
|
+
decorator,
|
|
47
|
+
id,
|
|
48
|
+
type,
|
|
49
|
+
filter,
|
|
50
|
+
// remove filter in next major release - V12
|
|
51
|
+
renderIcon: CustomIconElement,
|
|
52
|
+
title = 'Clear filter',
|
|
53
|
+
// remove title in next major release - V12
|
|
54
|
+
disabled,
|
|
55
|
+
onClose,
|
|
56
|
+
// remove onClose in next major release - V12
|
|
57
|
+
size,
|
|
58
|
+
as: BaseComponent,
|
|
59
|
+
slug,
|
|
60
|
+
...other
|
|
61
|
+
}, forwardRef) => {
|
|
63
62
|
const prefix = usePrefix();
|
|
64
63
|
const tagRef = useRef(null);
|
|
65
64
|
if (filter) {
|
|
@@ -11,13 +11,12 @@ import React, { useContext, Children } from 'react';
|
|
|
11
11
|
import './index.js';
|
|
12
12
|
import { TextDirectionContext } from './TextDirectionContext.js';
|
|
13
13
|
|
|
14
|
-
const TextBase = /*#__PURE__*/React.forwardRef((
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} = _ref;
|
|
14
|
+
const TextBase = /*#__PURE__*/React.forwardRef(({
|
|
15
|
+
as,
|
|
16
|
+
children,
|
|
17
|
+
dir = 'auto',
|
|
18
|
+
...rest
|
|
19
|
+
}, ref) => {
|
|
21
20
|
const context = useContext(TextDirectionContext);
|
|
22
21
|
const textProps = {};
|
|
23
22
|
const BaseComponent = as ?? 'span';
|
|
@@ -10,12 +10,11 @@ import React, { useRef, useMemo, useEffect } from 'react';
|
|
|
10
10
|
import './index.js';
|
|
11
11
|
import { TextDirectionContext } from './TextDirectionContext.js';
|
|
12
12
|
|
|
13
|
-
const TextDirection =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} = _ref;
|
|
13
|
+
const TextDirection = ({
|
|
14
|
+
children,
|
|
15
|
+
dir = 'auto',
|
|
16
|
+
getTextDirection
|
|
17
|
+
}) => {
|
|
19
18
|
const savedCallback = useRef(getTextDirection);
|
|
20
19
|
const value = useMemo(() => {
|
|
21
20
|
return {
|
|
@@ -14,7 +14,7 @@ import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
|
|
|
14
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
15
15
|
import '../FluidForm/FluidForm.js';
|
|
16
16
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
17
|
-
import {
|
|
17
|
+
import { getAnnouncement } from '../../internal/getAnnouncement.js';
|
|
18
18
|
import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
|
|
19
19
|
import { useMergedRefs } from '../../internal/useMergedRefs.js';
|
|
20
20
|
import { useId } from '../../internal/useId.js';
|
|
@@ -40,7 +40,7 @@ const TextArea = frFn((props, forwardRef) => {
|
|
|
40
40
|
light,
|
|
41
41
|
placeholder = '',
|
|
42
42
|
enableCounter = false,
|
|
43
|
-
maxCount
|
|
43
|
+
maxCount,
|
|
44
44
|
counterMode = 'character',
|
|
45
45
|
warn = false,
|
|
46
46
|
warnText = '',
|
|
@@ -65,7 +65,7 @@ const TextArea = frFn((props, forwardRef) => {
|
|
|
65
65
|
if (counterMode === 'character') {
|
|
66
66
|
return strValue.length;
|
|
67
67
|
} else {
|
|
68
|
-
return strValue.match(/\
|
|
68
|
+
return strValue.match(/\p{L}+/gu)?.length || 0;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
const [textCount, setTextCount] = useState(getInitialTextCount());
|
|
@@ -97,8 +97,8 @@ const TextArea = frFn((props, forwardRef) => {
|
|
|
97
97
|
onPaste: evt => {
|
|
98
98
|
if (!disabled) {
|
|
99
99
|
if (counterMode === 'word' && enableCounter && typeof maxCount !== 'undefined' && textareaRef.current !== null) {
|
|
100
|
-
const existingWords = textareaRef.current.value.match(/\
|
|
101
|
-
const pastedWords = evt.clipboardData.getData('Text').match(/\
|
|
100
|
+
const existingWords = textareaRef.current.value.match(/\p{L}+/gu) || [];
|
|
101
|
+
const pastedWords = evt.clipboardData.getData('Text').match(/\p{L}+/gu) || [];
|
|
102
102
|
const totalWords = existingWords.length + pastedWords.length;
|
|
103
103
|
if (totalWords > maxCount) {
|
|
104
104
|
evt.preventDefault();
|
|
@@ -127,7 +127,7 @@ const TextArea = frFn((props, forwardRef) => {
|
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
129
|
if (enableCounter && typeof maxCount !== 'undefined' && textareaRef.current !== null) {
|
|
130
|
-
const matchedWords = evt.target?.value?.match(/\
|
|
130
|
+
const matchedWords = evt.target?.value?.match(/\p{L}+/gu);
|
|
131
131
|
if (matchedWords && matchedWords.length <= maxCount) {
|
|
132
132
|
textareaRef.current.removeAttribute('maxLength');
|
|
133
133
|
setTimeout(() => {
|
|
@@ -220,7 +220,7 @@ const TextArea = frFn((props, forwardRef) => {
|
|
|
220
220
|
}
|
|
221
221
|
const announcerRef = useRef(null);
|
|
222
222
|
const [prevAnnouncement, setPrevAnnouncement] = useState('');
|
|
223
|
-
const ariaAnnouncement =
|
|
223
|
+
const ariaAnnouncement = getAnnouncement(textCount, maxCount, counterMode === 'word' ? 'word' : undefined, counterMode === 'word' ? 'words' : undefined);
|
|
224
224
|
useEffect(() => {
|
|
225
225
|
if (ariaAnnouncement && ariaAnnouncement !== prevAnnouncement) {
|
|
226
226
|
const announcer = announcerRef.current;
|
|
@@ -16,31 +16,30 @@ import { usePrefix } from '../../internal/usePrefix.js';
|
|
|
16
16
|
import { useId } from '../../internal/useId.js';
|
|
17
17
|
import { noopFn } from '../../internal/noopFn.js';
|
|
18
18
|
|
|
19
|
-
const ControlledPasswordInput = /*#__PURE__*/React.forwardRef(function ControlledPasswordInput(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} = _ref;
|
|
19
|
+
const ControlledPasswordInput = /*#__PURE__*/React.forwardRef(function ControlledPasswordInput({
|
|
20
|
+
labelText,
|
|
21
|
+
className,
|
|
22
|
+
id,
|
|
23
|
+
placeholder,
|
|
24
|
+
onChange = noopFn,
|
|
25
|
+
onClick = noopFn,
|
|
26
|
+
disabled = false,
|
|
27
|
+
hideLabel,
|
|
28
|
+
invalid = false,
|
|
29
|
+
invalidText = '',
|
|
30
|
+
helperText = '',
|
|
31
|
+
light,
|
|
32
|
+
// eslint-disable-next-line react/prop-types
|
|
33
|
+
type = 'password',
|
|
34
|
+
// eslint-disable-next-line react/prop-types
|
|
35
|
+
togglePasswordVisibility,
|
|
36
|
+
tooltipPosition = 'bottom',
|
|
37
|
+
tooltipAlignment = 'center',
|
|
38
|
+
hidePasswordLabel = 'Hide password',
|
|
39
|
+
showPasswordLabel = 'Show password',
|
|
40
|
+
size = undefined,
|
|
41
|
+
...other
|
|
42
|
+
}, ref) {
|
|
44
43
|
const prefix = usePrefix();
|
|
45
44
|
const controlledPasswordInstanceId = useId();
|
|
46
45
|
const errorId = id + '-error-msg';
|
|
@@ -19,33 +19,32 @@ import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
|
19
19
|
import deprecate from '../../prop-types/deprecate.js';
|
|
20
20
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
21
21
|
|
|
22
|
-
const PasswordInput = /*#__PURE__*/React.forwardRef(function PasswordInput(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
} = _ref;
|
|
22
|
+
const PasswordInput = /*#__PURE__*/React.forwardRef(function PasswordInput({
|
|
23
|
+
className,
|
|
24
|
+
disabled = false,
|
|
25
|
+
helperText,
|
|
26
|
+
hideLabel,
|
|
27
|
+
hidePasswordLabel = 'Hide password',
|
|
28
|
+
id,
|
|
29
|
+
inline,
|
|
30
|
+
invalid = false,
|
|
31
|
+
invalidText,
|
|
32
|
+
labelText,
|
|
33
|
+
light,
|
|
34
|
+
onChange = () => {},
|
|
35
|
+
onClick = () => {},
|
|
36
|
+
onTogglePasswordVisibility,
|
|
37
|
+
placeholder,
|
|
38
|
+
readOnly,
|
|
39
|
+
size = 'md',
|
|
40
|
+
showPasswordLabel = 'Show password',
|
|
41
|
+
tooltipPosition = 'bottom',
|
|
42
|
+
tooltipAlignment = 'end',
|
|
43
|
+
type = 'password',
|
|
44
|
+
warn = false,
|
|
45
|
+
warnText,
|
|
46
|
+
...rest
|
|
47
|
+
}, ref) {
|
|
49
48
|
const [inputType, setInputType] = useState(type);
|
|
50
49
|
const prefix = usePrefix();
|
|
51
50
|
const normalizedProps = useNormalizedInputProps({
|