@carbon/react 1.83.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 +980 -945
- 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 +31 -34
- 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 +55 -63
- package/es/components/ModalWrapper/ModalWrapper.js +2 -2
- package/es/components/MultiSelect/FilterableMultiSelect.js +46 -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 +35 -41
- package/es/components/OverflowMenu/next/index.js +12 -13
- package/es/components/PageHeader/PageHeader.d.ts +29 -5
- package/es/components/PageHeader/PageHeader.js +119 -73
- 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 -28
- 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 +69 -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 +3 -3
- 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/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 +10 -11
- 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 +2 -2
- 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/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 +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 +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 +55 -63
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.js +45 -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 +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.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 +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.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/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 +10 -11
- 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 +35 -35
- 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/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 +23 -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
|
@@ -22,6 +22,11 @@ require('../FluidForm/FluidForm.js');
|
|
|
22
22
|
var FormContext = require('../FluidForm/FormContext.js');
|
|
23
23
|
require('../Text/index.js');
|
|
24
24
|
var clamp = require('../../internal/clamp.js');
|
|
25
|
+
var useControllableState = require('../../internal/useControllableState.js');
|
|
26
|
+
var utilities = require('@carbon/utilities');
|
|
27
|
+
var keys = require('../../internal/keyboard/keys.js');
|
|
28
|
+
var match = require('../../internal/keyboard/match.js');
|
|
29
|
+
var NumberFormatPropTypes = require('./NumberFormatPropTypes.js');
|
|
25
30
|
var Text = require('../Text/Text.js');
|
|
26
31
|
|
|
27
32
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -52,25 +57,30 @@ const NumberInput = /*#__PURE__*/React__default["default"].forwardRef(function N
|
|
|
52
57
|
disabled = false,
|
|
53
58
|
disableWheel: disableWheelProp = false,
|
|
54
59
|
defaultValue = 0,
|
|
60
|
+
formatOptions,
|
|
55
61
|
helperText = '',
|
|
56
62
|
hideLabel = false,
|
|
57
63
|
hideSteppers,
|
|
58
64
|
iconDescription,
|
|
59
65
|
id,
|
|
60
|
-
|
|
66
|
+
inputMode,
|
|
61
67
|
invalid = false,
|
|
62
68
|
invalidText,
|
|
69
|
+
label,
|
|
63
70
|
light,
|
|
71
|
+
locale = 'en-US',
|
|
64
72
|
max,
|
|
65
73
|
min,
|
|
66
74
|
onChange,
|
|
67
75
|
onClick,
|
|
68
76
|
onKeyUp,
|
|
77
|
+
pattern = '[0-9]*',
|
|
69
78
|
readOnly,
|
|
70
79
|
size = 'md',
|
|
71
80
|
slug,
|
|
72
81
|
step = 1,
|
|
73
82
|
translateWithId: t = id => defaultTranslations[id],
|
|
83
|
+
type = 'number',
|
|
74
84
|
warn = false,
|
|
75
85
|
warnText = '',
|
|
76
86
|
value: controlledValue,
|
|
@@ -81,6 +91,10 @@ const NumberInput = /*#__PURE__*/React__default["default"].forwardRef(function N
|
|
|
81
91
|
isFluid
|
|
82
92
|
} = React.useContext(FormContext.FormContext);
|
|
83
93
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* The input value, only used when type=number
|
|
97
|
+
*/
|
|
84
98
|
const [value, setValue] = React.useState(() => {
|
|
85
99
|
if (controlledValue !== undefined) {
|
|
86
100
|
return controlledValue;
|
|
@@ -94,6 +108,30 @@ const NumberInput = /*#__PURE__*/React__default["default"].forwardRef(function N
|
|
|
94
108
|
return 0;
|
|
95
109
|
});
|
|
96
110
|
const [prevControlledValue, setPrevControlledValue] = React.useState(controlledValue);
|
|
111
|
+
const numberParser = React.useMemo(() => new utilities.NumberParser(locale, formatOptions), [locale, formatOptions]);
|
|
112
|
+
/**
|
|
113
|
+
* The currently parsed number value.
|
|
114
|
+
* Only used when type=text
|
|
115
|
+
* Updated based on the `value` as the user types.
|
|
116
|
+
*/
|
|
117
|
+
const [numberValue, setNumberValue, isControlled] = useControllableState.useControllableState({
|
|
118
|
+
name: 'NumberInput',
|
|
119
|
+
defaultValue: typeof defaultValue === 'string' ? numberParser.parse(defaultValue) : defaultValue,
|
|
120
|
+
value: typeof controlledValue === 'string' ? numberParser.parse(controlledValue) : controlledValue
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The current text value of the input.
|
|
125
|
+
* Only used when type=text
|
|
126
|
+
* Updated as the user types and formatted on blur.
|
|
127
|
+
*/
|
|
128
|
+
const [inputValue, setInputValue] = React__default["default"].useState(() => isNaN(numberValue) ? '' : new utilities.NumberFormatter(locale, formatOptions).format(numberValue));
|
|
129
|
+
const numberingSystem = React.useMemo(() => numberParser.getNumberingSystem(inputValue), [numberParser, inputValue]);
|
|
130
|
+
const numberFormatter = React.useMemo(() => new utilities.NumberFormatter(locale, {
|
|
131
|
+
...formatOptions,
|
|
132
|
+
numberingSystem
|
|
133
|
+
}), [locale, formatOptions, numberingSystem]);
|
|
134
|
+
const format = React.useCallback(value => isNaN(value) || value === null ? '' : numberFormatter.format(value), [numberFormatter]);
|
|
97
135
|
const inputRef = React.useRef(null);
|
|
98
136
|
const ref = useMergedRefs.useMergedRefs([forwardRef, inputRef]);
|
|
99
137
|
const numberInputClasses = cx__default["default"]({
|
|
@@ -108,7 +146,7 @@ const NumberInput = /*#__PURE__*/React__default["default"].forwardRef(function N
|
|
|
108
146
|
const isInputValid = getInputValidity({
|
|
109
147
|
allowEmpty,
|
|
110
148
|
invalid,
|
|
111
|
-
value,
|
|
149
|
+
value: type === 'number' ? value : numberValue,
|
|
112
150
|
max,
|
|
113
151
|
min
|
|
114
152
|
});
|
|
@@ -150,13 +188,24 @@ const NumberInput = /*#__PURE__*/React__default["default"].forwardRef(function N
|
|
|
150
188
|
if (disabled) {
|
|
151
189
|
return;
|
|
152
190
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
onChange
|
|
191
|
+
if (type === 'number') {
|
|
192
|
+
const state = {
|
|
193
|
+
value: allowEmpty && event.target.value === '' ? '' : Number(event.target.value),
|
|
194
|
+
direction: value < event.target.value ? 'up' : 'down'
|
|
195
|
+
};
|
|
196
|
+
setValue(state.value);
|
|
197
|
+
if (onChange) {
|
|
198
|
+
onChange(event, state);
|
|
199
|
+
}
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
if (type === 'text') {
|
|
203
|
+
const _value = allowEmpty && event.target.value === '' ? '' : event.target.value;
|
|
204
|
+
setNumberValue(numberParser.parse(_value));
|
|
205
|
+
setInputValue(_value);
|
|
206
|
+
// The onChange prop isn't called here because it will be called on blur
|
|
207
|
+
// or on click of a stepper, after the number is parsed and formatted
|
|
208
|
+
// according to the locale.
|
|
160
209
|
}
|
|
161
210
|
}
|
|
162
211
|
const handleFocus = evt => {
|
|
@@ -178,21 +227,44 @@ const NumberInput = /*#__PURE__*/React__default["default"].forwardRef(function N
|
|
|
178
227
|
const parts = num.toString().split('.');
|
|
179
228
|
return parts[1] ? parts[1].length : 0;
|
|
180
229
|
};
|
|
181
|
-
const
|
|
230
|
+
const handleStep = (event, direction) => {
|
|
182
231
|
if (inputRef.current) {
|
|
183
|
-
const currentValue = Number(inputRef.current.value);
|
|
232
|
+
const currentValue = type === 'number' ? Number(inputRef.current.value) : numberParser.parse(inputRef.current.value);
|
|
184
233
|
const rawValue = direction === 'up' ? currentValue + step : currentValue - step;
|
|
185
234
|
const precision = Math.max(getDecimalPlaces(currentValue), getDecimalPlaces(step));
|
|
186
235
|
const floatValue = parseFloat(rawValue.toFixed(precision));
|
|
187
236
|
const newValue = clamp.clamp(floatValue, min ?? -Infinity, max ?? Infinity);
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
237
|
+
let state;
|
|
238
|
+
if (type === 'number') {
|
|
239
|
+
state = {
|
|
240
|
+
value: allowEmpty && inputRef.current.value === '' && step === 0 ? '' : newValue,
|
|
241
|
+
direction
|
|
242
|
+
};
|
|
243
|
+
setValue(state.value);
|
|
244
|
+
}
|
|
245
|
+
if (type === 'text') {
|
|
246
|
+
const formattedNewValue = format(newValue);
|
|
247
|
+
state = {
|
|
248
|
+
value: allowEmpty && inputRef.current.value === '' && step === 0 ? '' : formattedNewValue,
|
|
249
|
+
direction
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
// newValue does not need to be parsed because it is derived from
|
|
253
|
+
// currentValue, which is parsed at the beginning of this function
|
|
254
|
+
setNumberValue(newValue);
|
|
255
|
+
setInputValue(formattedNewValue);
|
|
256
|
+
}
|
|
193
257
|
if (onChange) {
|
|
194
258
|
onChange(event, state);
|
|
195
259
|
}
|
|
260
|
+
return state;
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
const handleStepperClick = (event, direction) => {
|
|
264
|
+
if (inputRef.current) {
|
|
265
|
+
const {
|
|
266
|
+
state
|
|
267
|
+
} = handleStep(event, direction);
|
|
196
268
|
if (onClick) {
|
|
197
269
|
onClick(event, state);
|
|
198
270
|
}
|
|
@@ -244,6 +316,15 @@ const NumberInput = /*#__PURE__*/React__default["default"].forwardRef(function N
|
|
|
244
316
|
onClick: onClick,
|
|
245
317
|
onChange: handleOnChange,
|
|
246
318
|
onKeyUp: onKeyUp,
|
|
319
|
+
onKeyDown: e => {
|
|
320
|
+
if (type === 'text') {
|
|
321
|
+
match.match(e, keys.ArrowUp) && handleStep(e, 'up');
|
|
322
|
+
match.match(e, keys.ArrowDown) && handleStep(e, 'down');
|
|
323
|
+
}
|
|
324
|
+
if (rest?.onKeyDown) {
|
|
325
|
+
rest?.onKeyDown(e);
|
|
326
|
+
}
|
|
327
|
+
},
|
|
247
328
|
onFocus: e => {
|
|
248
329
|
if (disableWheelProp) {
|
|
249
330
|
e.target.addEventListener('wheel', disableWheel);
|
|
@@ -256,15 +337,32 @@ const NumberInput = /*#__PURE__*/React__default["default"].forwardRef(function N
|
|
|
256
337
|
if (disableWheelProp) {
|
|
257
338
|
e.target.removeEventListener('wheel', disableWheel);
|
|
258
339
|
}
|
|
340
|
+
if (type === 'text') {
|
|
341
|
+
// When isControlled, the current inputValue needs re-parsed
|
|
342
|
+
// because the consumer's onChange hasn't been called yet and
|
|
343
|
+
// the `numberValue` we have in state is the (stale) value
|
|
344
|
+
// they've passed in.
|
|
345
|
+
const _numberValue = isControlled ? numberParser.parse(inputValue) : numberValue;
|
|
346
|
+
const formattedValue = isNaN(_numberValue) ? '' : format(_numberValue);
|
|
347
|
+
setInputValue(formattedValue);
|
|
348
|
+
if (onChange) {
|
|
349
|
+
const state = {
|
|
350
|
+
value: formattedValue,
|
|
351
|
+
direction: value < e.target.value ? 'up' : 'down'
|
|
352
|
+
};
|
|
353
|
+
onChange(e, state);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
259
356
|
if (rest.onBlur) {
|
|
260
357
|
rest.onBlur(e);
|
|
261
358
|
}
|
|
262
359
|
},
|
|
263
|
-
pattern:
|
|
360
|
+
pattern: pattern,
|
|
361
|
+
inputMode: inputMode,
|
|
264
362
|
readOnly: readOnly,
|
|
265
363
|
step: step,
|
|
266
|
-
type:
|
|
267
|
-
value: value
|
|
364
|
+
type: type,
|
|
365
|
+
value: type === 'number' ? value : inputValue
|
|
268
366
|
})), slug ? normalizedDecorator : decorator ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
269
367
|
className: `${prefix}--number__input-inner-wrapper--decorator`
|
|
270
368
|
}, normalizedDecorator) : '', Icon ? /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
@@ -321,13 +419,20 @@ NumberInput.propTypes = {
|
|
|
321
419
|
*/
|
|
322
420
|
defaultValue: PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string]),
|
|
323
421
|
/**
|
|
324
|
-
* Specify if the wheel functionality for the input should be disabled, or
|
|
422
|
+
* Specify if the wheel functionality for the input should be disabled, or no t
|
|
325
423
|
*/
|
|
326
424
|
disableWheel: PropTypes__default["default"].bool,
|
|
327
425
|
/**
|
|
328
426
|
* Specify if the control should be disabled, or not
|
|
329
427
|
*/
|
|
330
428
|
disabled: PropTypes__default["default"].bool,
|
|
429
|
+
/**
|
|
430
|
+
* **Experimental:** Specify Intl.NumberFormat options applied to internal
|
|
431
|
+
* number parsing and formatting. Use with `type="text"`, has no effect when
|
|
432
|
+
* `type="number"`.
|
|
433
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options
|
|
434
|
+
*/
|
|
435
|
+
formatOptions: NumberFormatPropTypes.NumberFormatOptionsPropType,
|
|
331
436
|
/**
|
|
332
437
|
* Provide text that is used alongside the control label for additional help
|
|
333
438
|
*/
|
|
@@ -348,6 +453,12 @@ NumberInput.propTypes = {
|
|
|
348
453
|
* Specify a custom `id` for the input
|
|
349
454
|
*/
|
|
350
455
|
id: PropTypes__default["default"].string.isRequired,
|
|
456
|
+
/**
|
|
457
|
+
* Instruct the browser which keyboard to display on mobile devices. Note that
|
|
458
|
+
* standard numeric keyboards vary across devices and operating systems.
|
|
459
|
+
* @see https://css-tricks.com/everything-you-ever-wanted-to-know-about-inputmode/
|
|
460
|
+
*/
|
|
461
|
+
inputMode: PropTypes__default["default"].oneOf(['none', 'text', 'tel', 'url', 'email', 'numeric', 'decimal', 'search']),
|
|
351
462
|
/**
|
|
352
463
|
* Specify if the currently value is invalid.
|
|
353
464
|
*/
|
|
@@ -365,6 +476,12 @@ NumberInput.propTypes = {
|
|
|
365
476
|
* `true` to use the light version.
|
|
366
477
|
*/
|
|
367
478
|
light: deprecate["default"](PropTypes__default["default"].bool, 'The `light` prop for `NumberInput` is no longer needed and has ' + 'been deprecated in v11 in favor of the new `Layer` component. It will be moved in the next major release.'),
|
|
479
|
+
/**
|
|
480
|
+
* **Experimental:** Specify a [BCP47](https://www.ietf.org/rfc/bcp/bcp47.txt)
|
|
481
|
+
* language code for parsing and formatting. Use with `type="text"`, has no
|
|
482
|
+
* effect when `type="number"`.
|
|
483
|
+
*/
|
|
484
|
+
locale: PropTypes__default["default"].string,
|
|
368
485
|
/**
|
|
369
486
|
* The maximum value.
|
|
370
487
|
*/
|
|
@@ -376,6 +493,9 @@ NumberInput.propTypes = {
|
|
|
376
493
|
/**
|
|
377
494
|
* Provide an optional handler that is called when the internal state of
|
|
378
495
|
* NumberInput changes. This handler is called with event and state info.
|
|
496
|
+
* When type="number", this is called on every change of the input.
|
|
497
|
+
* When type="text", this is only called on blur after the number has been
|
|
498
|
+
* parsed and formatted.
|
|
379
499
|
* `(event, { value, direction }) => void`
|
|
380
500
|
*/
|
|
381
501
|
onChange: PropTypes__default["default"].func,
|
|
@@ -387,6 +507,11 @@ NumberInput.propTypes = {
|
|
|
387
507
|
* Provide an optional function to be called when a key is pressed in the number input
|
|
388
508
|
*/
|
|
389
509
|
onKeyUp: PropTypes__default["default"].func,
|
|
510
|
+
/**
|
|
511
|
+
* When type="text", provide an optional pattern to restrict user input. Has
|
|
512
|
+
* no effect when type="number".
|
|
513
|
+
*/
|
|
514
|
+
pattern: PropTypes__default["default"].string,
|
|
390
515
|
/**
|
|
391
516
|
* Specify if the component should be read-only
|
|
392
517
|
*/
|
|
@@ -396,17 +521,25 @@ NumberInput.propTypes = {
|
|
|
396
521
|
*/
|
|
397
522
|
size: PropTypes__default["default"].oneOf(['sm', 'md', 'lg']),
|
|
398
523
|
/**
|
|
399
|
-
* **Experimental**: Provide a `Slug` component to be rendered inside the
|
|
524
|
+
* **Experimental**: Provide a `Slug` component to be rendered inside the
|
|
525
|
+
* `NumberInput` component
|
|
400
526
|
*/
|
|
401
527
|
slug: deprecate["default"](PropTypes__default["default"].node, 'The `slug` prop for `NumberInput` is no longer needed and has ' + 'been deprecated in v11 in favor of the new `decorator` prop. It will be moved in the next major release.'),
|
|
402
528
|
/**
|
|
403
|
-
* Specify how much the values should increase/decrease upon clicking on
|
|
529
|
+
* Specify how much the values should increase/decrease upon clicking on
|
|
530
|
+
* up/down button
|
|
404
531
|
*/
|
|
405
532
|
step: PropTypes__default["default"].number,
|
|
406
533
|
/**
|
|
407
534
|
* Provide custom text for the component for each translation id
|
|
408
535
|
*/
|
|
409
536
|
translateWithId: PropTypes__default["default"].func,
|
|
537
|
+
/**
|
|
538
|
+
* **Experimental**: Specify if the input should be of type text or number.
|
|
539
|
+
* Use type="text" with `locale`, `formatOptions`, and guide user input with
|
|
540
|
+
* `pattern` and `inputMode`.
|
|
541
|
+
*/
|
|
542
|
+
type: PropTypes__default["default"].oneOf(['number', 'text']),
|
|
410
543
|
/**
|
|
411
544
|
* Specify the value of the input
|
|
412
545
|
*/
|
|
@@ -420,13 +553,12 @@ NumberInput.propTypes = {
|
|
|
420
553
|
*/
|
|
421
554
|
warnText: PropTypes__default["default"].node
|
|
422
555
|
};
|
|
423
|
-
const Label =
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
} = _ref;
|
|
556
|
+
const Label = ({
|
|
557
|
+
disabled,
|
|
558
|
+
id,
|
|
559
|
+
hideLabel,
|
|
560
|
+
label
|
|
561
|
+
}) => {
|
|
430
562
|
const prefix = usePrefix.usePrefix();
|
|
431
563
|
const className = cx__default["default"]({
|
|
432
564
|
[`${prefix}--label`]: true,
|
|
@@ -448,12 +580,11 @@ Label.propTypes = {
|
|
|
448
580
|
id: PropTypes__default["default"].string,
|
|
449
581
|
label: PropTypes__default["default"].node
|
|
450
582
|
};
|
|
451
|
-
function HelperText(
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
} = _ref2;
|
|
583
|
+
function HelperText({
|
|
584
|
+
disabled,
|
|
585
|
+
description,
|
|
586
|
+
id
|
|
587
|
+
}) {
|
|
457
588
|
const prefix = usePrefix.usePrefix();
|
|
458
589
|
const className = cx__default["default"](`${prefix}--form__helper-text`, {
|
|
459
590
|
[`${prefix}--form__helper-text--disabled`]: disabled
|
|
@@ -486,14 +617,13 @@ HelperText.propTypes = {
|
|
|
486
617
|
* @param {number} config.min
|
|
487
618
|
* @returns {boolean}
|
|
488
619
|
*/
|
|
489
|
-
function getInputValidity(
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
} = _ref3;
|
|
620
|
+
function getInputValidity({
|
|
621
|
+
allowEmpty,
|
|
622
|
+
invalid,
|
|
623
|
+
value,
|
|
624
|
+
max,
|
|
625
|
+
min
|
|
626
|
+
}) {
|
|
497
627
|
if (invalid) {
|
|
498
628
|
return false;
|
|
499
629
|
}
|
|
@@ -21,14 +21,13 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
21
21
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
22
22
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
23
23
|
|
|
24
|
-
function OrderedList(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} = _ref;
|
|
24
|
+
function OrderedList({
|
|
25
|
+
className,
|
|
26
|
+
nested = false,
|
|
27
|
+
native = false,
|
|
28
|
+
isExpressive = false,
|
|
29
|
+
...other
|
|
30
|
+
}) {
|
|
32
31
|
const prefix = usePrefix.usePrefix();
|
|
33
32
|
const classNames = cx__default["default"]({
|
|
34
33
|
[`${prefix}--list--ordered`]: !native,
|
|
@@ -106,7 +106,7 @@ export interface OverflowMenuProps {
|
|
|
106
106
|
*/
|
|
107
107
|
selectorPrimaryFocus?: string;
|
|
108
108
|
/**
|
|
109
|
-
* Specify the size of the OverflowMenu. Currently supports either `sm`,
|
|
109
|
+
* Specify the size of the OverflowMenu. Currently supports either `sm`, `md` (default) or `lg` as an option.
|
|
110
110
|
*/
|
|
111
111
|
size?: 'sm' | 'md' | 'lg';
|
|
112
112
|
/**
|
|
@@ -36,10 +36,7 @@ var invariant__default = /*#__PURE__*/_interopDefaultLegacy(invariant);
|
|
|
36
36
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
37
37
|
|
|
38
38
|
const getInstanceId = setupGetInstanceId.setupGetInstanceId();
|
|
39
|
-
const on =
|
|
40
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
41
|
-
args[_key - 1] = arguments[_key];
|
|
42
|
-
}
|
|
39
|
+
const on = (target, ...args) => {
|
|
43
40
|
target.addEventListener(...args);
|
|
44
41
|
return {
|
|
45
42
|
release() {
|
|
@@ -102,33 +99,32 @@ const getMenuOffset = (menuBody, direction, trigger, flip) => {
|
|
|
102
99
|
};
|
|
103
100
|
}
|
|
104
101
|
};
|
|
105
|
-
const OverflowMenu = /*#__PURE__*/React.forwardRef((
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
} = _ref;
|
|
102
|
+
const OverflowMenu = /*#__PURE__*/React.forwardRef(({
|
|
103
|
+
align,
|
|
104
|
+
['aria-label']: ariaLabel = null,
|
|
105
|
+
ariaLabel: deprecatedAriaLabel,
|
|
106
|
+
children,
|
|
107
|
+
className,
|
|
108
|
+
direction = FloatingMenu.DIRECTION_BOTTOM,
|
|
109
|
+
flipped = false,
|
|
110
|
+
focusTrap = true,
|
|
111
|
+
iconClass,
|
|
112
|
+
iconDescription = 'Options',
|
|
113
|
+
id,
|
|
114
|
+
light,
|
|
115
|
+
menuOffset = getMenuOffset,
|
|
116
|
+
menuOffsetFlip = getMenuOffset,
|
|
117
|
+
menuOptionsClass,
|
|
118
|
+
onClick = noopFn.noopFn,
|
|
119
|
+
onClose = noopFn.noopFn,
|
|
120
|
+
onOpen = noopFn.noopFn,
|
|
121
|
+
open: openProp,
|
|
122
|
+
renderIcon: IconElement = iconsReact.OverflowMenuVertical,
|
|
123
|
+
selectorPrimaryFocus = '[data-floating-menu-primary-focus]',
|
|
124
|
+
size = 'md',
|
|
125
|
+
innerRef,
|
|
126
|
+
...other
|
|
127
|
+
}, ref) => {
|
|
132
128
|
const prefix = React.useContext(usePrefix.PrefixContext);
|
|
133
129
|
const [open, setOpen] = React.useState(openProp ?? false);
|
|
134
130
|
const [click, setClick] = React.useState(false);
|
|
@@ -166,10 +162,9 @@ const OverflowMenu = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
166
162
|
}
|
|
167
163
|
prevOpenState.current = open;
|
|
168
164
|
}, [open, onClose]);
|
|
169
|
-
useOutsideClick.useOutsideClick(wrapperRef,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
} = _ref2;
|
|
165
|
+
useOutsideClick.useOutsideClick(wrapperRef, ({
|
|
166
|
+
target
|
|
167
|
+
}) => {
|
|
173
168
|
if (open && (!menuBodyRef.current || target instanceof Node && !menuBodyRef.current.contains(target))) {
|
|
174
169
|
closeMenu();
|
|
175
170
|
}
|
|
@@ -229,11 +224,10 @@ const OverflowMenu = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
229
224
|
* Focuses the next enabled overflow menu item given the currently focused
|
|
230
225
|
* item index and direction to move.
|
|
231
226
|
*/
|
|
232
|
-
const handleOverflowMenuItemFocus =
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
} = _ref3;
|
|
227
|
+
const handleOverflowMenuItemFocus = ({
|
|
228
|
+
currentIndex = 0,
|
|
229
|
+
direction
|
|
230
|
+
}) => {
|
|
237
231
|
const enabledIndices = React.Children.toArray(children).reduce((acc, curr, i) => {
|
|
238
232
|
if (/*#__PURE__*/React__default["default"].isValidElement(curr) && !curr.props.disabled) {
|
|
239
233
|
acc.push(i);
|
|
@@ -480,7 +474,7 @@ OverflowMenu.propTypes = {
|
|
|
480
474
|
*/
|
|
481
475
|
selectorPrimaryFocus: PropTypes__default["default"].string,
|
|
482
476
|
/**
|
|
483
|
-
* Specify the size of the OverflowMenu. Currently supports either `sm`,
|
|
477
|
+
* Specify the size of the OverflowMenu. Currently supports either `sm`, `md` (default) or `lg` as an option.
|
|
484
478
|
*/
|
|
485
479
|
size: PropTypes__default["default"].oneOf(['sm', 'md', 'lg'])
|
|
486
480
|
};
|
|
@@ -33,19 +33,18 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
33
33
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
34
34
|
|
|
35
35
|
const defaultSize = 'md';
|
|
36
|
-
const OverflowMenu = /*#__PURE__*/React__default["default"].forwardRef(function OverflowMenu(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
} = _ref;
|
|
36
|
+
const OverflowMenu = /*#__PURE__*/React__default["default"].forwardRef(function OverflowMenu({
|
|
37
|
+
autoAlign = false,
|
|
38
|
+
children,
|
|
39
|
+
className,
|
|
40
|
+
label = 'Options',
|
|
41
|
+
renderIcon: IconElement = iconsReact.OverflowMenuVertical,
|
|
42
|
+
size = defaultSize,
|
|
43
|
+
menuAlignment = 'bottom-start',
|
|
44
|
+
tooltipAlignment,
|
|
45
|
+
menuTarget,
|
|
46
|
+
...rest
|
|
47
|
+
}, forwardRef) {
|
|
49
48
|
const enableFloatingStyles = index.useFeatureFlag('enable-v12-dynamic-floating-styles') || autoAlign;
|
|
50
49
|
const {
|
|
51
50
|
refs,
|
|
@@ -23,8 +23,32 @@ declare const PageHeader: React.ForwardRefExoticComponent<PageHeaderProps & Reac
|
|
|
23
23
|
* -----------------------
|
|
24
24
|
*/
|
|
25
25
|
interface PageHeaderBreadcrumbBarProps {
|
|
26
|
+
/**
|
|
27
|
+
* `true` by default to render BreadcrumbBar bottom border.
|
|
28
|
+
*/
|
|
29
|
+
border?: Boolean;
|
|
26
30
|
children?: React.ReactNode;
|
|
27
31
|
className?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Provide an optional icon to render in front of the PageHeaderContent's title.
|
|
34
|
+
*/
|
|
35
|
+
renderIcon?: ComponentType | FunctionComponent;
|
|
36
|
+
/**
|
|
37
|
+
* The PageHeaderBreadcrumbBar's content actions
|
|
38
|
+
*/
|
|
39
|
+
contentActions?: React.ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* `true` to set content actions flush against page actions
|
|
42
|
+
*/
|
|
43
|
+
contentActionsFlush?: Boolean;
|
|
44
|
+
/**
|
|
45
|
+
* The PageHeaderContent's page actions
|
|
46
|
+
*/
|
|
47
|
+
pageActions?: React.ReactNode;
|
|
48
|
+
/**
|
|
49
|
+
* `true` to set page actions flush with page
|
|
50
|
+
*/
|
|
51
|
+
pageActionsFlush?: Boolean;
|
|
28
52
|
}
|
|
29
53
|
declare const PageHeaderBreadcrumbBar: React.ForwardRefExoticComponent<PageHeaderBreadcrumbBarProps & React.RefAttributes<HTMLDivElement>>;
|
|
30
54
|
/**
|
|
@@ -80,10 +104,10 @@ interface PageHeaderContentPageActionsProps {
|
|
|
80
104
|
/**
|
|
81
105
|
* The PageHeaderContent's page actions
|
|
82
106
|
*/
|
|
83
|
-
|
|
107
|
+
actions?: React.ReactNode;
|
|
84
108
|
}
|
|
85
109
|
declare const PageHeaderContentPageActions: {
|
|
86
|
-
({ className, children, menuButtonLabel,
|
|
110
|
+
({ className, children, menuButtonLabel, actions, ...other }: PageHeaderContentPageActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
87
111
|
displayName: string;
|
|
88
112
|
propTypes: {
|
|
89
113
|
/**
|
|
@@ -101,7 +125,7 @@ declare const PageHeaderContentPageActions: {
|
|
|
101
125
|
/**
|
|
102
126
|
* The PageHeaderContent's page actions
|
|
103
127
|
*/
|
|
104
|
-
|
|
128
|
+
actions: PropTypes.Requireable<NonNullable<any[] | PropTypes.ReactNodeLike>>;
|
|
105
129
|
};
|
|
106
130
|
};
|
|
107
131
|
/**
|
|
@@ -194,7 +218,7 @@ declare const Root: React.ForwardRefExoticComponent<PageHeaderProps & React.RefA
|
|
|
194
218
|
declare const BreadcrumbBar: React.ForwardRefExoticComponent<PageHeaderBreadcrumbBarProps & React.RefAttributes<HTMLDivElement>>;
|
|
195
219
|
declare const Content: React.ForwardRefExoticComponent<PageHeaderContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
196
220
|
declare const ContentPageActions: {
|
|
197
|
-
({ className, children, menuButtonLabel,
|
|
221
|
+
({ className, children, menuButtonLabel, actions, ...other }: PageHeaderContentPageActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
198
222
|
displayName: string;
|
|
199
223
|
propTypes: {
|
|
200
224
|
/**
|
|
@@ -212,7 +236,7 @@ declare const ContentPageActions: {
|
|
|
212
236
|
/**
|
|
213
237
|
* The PageHeaderContent's page actions
|
|
214
238
|
*/
|
|
215
|
-
|
|
239
|
+
actions: PropTypes.Requireable<NonNullable<any[] | PropTypes.ReactNodeLike>>;
|
|
216
240
|
};
|
|
217
241
|
};
|
|
218
242
|
declare const ContentText: {
|