@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
|
@@ -43,8 +43,7 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
43
43
|
* @param {func} callback - function to be called
|
|
44
44
|
* @param {bool} override - escape hatch to conditionally call the callback
|
|
45
45
|
*/
|
|
46
|
-
function useEscapeToClose(ref, callback) {
|
|
47
|
-
let override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
46
|
+
function useEscapeToClose(ref, callback, override = true) {
|
|
48
47
|
const handleKeyDown = event => {
|
|
49
48
|
// The callback should only be called when focus is on or within the container
|
|
50
49
|
const elementContainsFocus = ref.current && document.activeElement === ref.current || ref.current?.contains(document.activeElement);
|
|
@@ -59,14 +58,13 @@ function useEscapeToClose(ref, callback) {
|
|
|
59
58
|
return () => document.removeEventListener('keydown', handleKeyDown, false);
|
|
60
59
|
});
|
|
61
60
|
}
|
|
62
|
-
function NotificationActionButton(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
} = _ref;
|
|
61
|
+
function NotificationActionButton({
|
|
62
|
+
children,
|
|
63
|
+
className: customClassName,
|
|
64
|
+
onClick,
|
|
65
|
+
inline,
|
|
66
|
+
...rest
|
|
67
|
+
}) {
|
|
70
68
|
const prefix = usePrefix.usePrefix();
|
|
71
69
|
const className = cx__default["default"](customClassName, {
|
|
72
70
|
[`${prefix}--actionable-notification__action-button`]: true
|
|
@@ -102,17 +100,16 @@ NotificationActionButton.propTypes = {
|
|
|
102
100
|
* ==================
|
|
103
101
|
*/
|
|
104
102
|
|
|
105
|
-
function NotificationButton(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
} = _ref2;
|
|
103
|
+
function NotificationButton({
|
|
104
|
+
'aria-label': ariaLabel = 'close notification',
|
|
105
|
+
ariaLabel: deprecatedAriaLabel,
|
|
106
|
+
className,
|
|
107
|
+
type = 'button',
|
|
108
|
+
renderIcon: IconTag = iconsReact.Close,
|
|
109
|
+
name,
|
|
110
|
+
notificationType = 'toast',
|
|
111
|
+
...rest
|
|
112
|
+
}) {
|
|
116
113
|
const prefix = usePrefix.usePrefix();
|
|
117
114
|
const buttonClassName = cx__default["default"](className, {
|
|
118
115
|
[`${prefix}--${notificationType}-notification__close-button`]: notificationType
|
|
@@ -177,12 +174,11 @@ const iconTypes = {
|
|
|
177
174
|
info: iconsReact.InformationFilled,
|
|
178
175
|
['info-square']: iconsReact.InformationSquareFilled
|
|
179
176
|
};
|
|
180
|
-
function NotificationIcon(
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
} = _ref3;
|
|
177
|
+
function NotificationIcon({
|
|
178
|
+
iconDescription,
|
|
179
|
+
kind,
|
|
180
|
+
notificationType
|
|
181
|
+
}) {
|
|
186
182
|
const prefix = usePrefix.usePrefix();
|
|
187
183
|
const IconForKind = iconTypes[kind];
|
|
188
184
|
if (!IconForKind) {
|
|
@@ -204,26 +200,25 @@ NotificationIcon.propTypes = {
|
|
|
204
200
|
* =================
|
|
205
201
|
*/
|
|
206
202
|
|
|
207
|
-
function ToastNotification(
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
} = _ref4;
|
|
203
|
+
function ToastNotification({
|
|
204
|
+
['aria-label']: ariaLabel,
|
|
205
|
+
// @ts-expect-error: deprecated prop
|
|
206
|
+
ariaLabel: deprecatedAriaLabel,
|
|
207
|
+
role = 'status',
|
|
208
|
+
onClose,
|
|
209
|
+
onCloseButtonClick = noopFn.noopFn,
|
|
210
|
+
statusIconDescription,
|
|
211
|
+
className,
|
|
212
|
+
children,
|
|
213
|
+
kind = 'error',
|
|
214
|
+
lowContrast,
|
|
215
|
+
hideCloseButton = false,
|
|
216
|
+
timeout = 0,
|
|
217
|
+
title,
|
|
218
|
+
caption,
|
|
219
|
+
subtitle,
|
|
220
|
+
...rest
|
|
221
|
+
}) {
|
|
227
222
|
const [isOpen, setIsOpen] = React.useState(true);
|
|
228
223
|
const prefix = usePrefix.usePrefix();
|
|
229
224
|
const containerClassName = cx__default["default"](className, {
|
|
@@ -361,22 +356,21 @@ ToastNotification.propTypes = {
|
|
|
361
356
|
* ==================
|
|
362
357
|
*/
|
|
363
358
|
|
|
364
|
-
function InlineNotification(
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
} = _ref5;
|
|
359
|
+
function InlineNotification({
|
|
360
|
+
['aria-label']: ariaLabel,
|
|
361
|
+
children,
|
|
362
|
+
title,
|
|
363
|
+
subtitle,
|
|
364
|
+
role = 'status',
|
|
365
|
+
onClose,
|
|
366
|
+
onCloseButtonClick = noopFn.noopFn,
|
|
367
|
+
statusIconDescription,
|
|
368
|
+
className,
|
|
369
|
+
kind = 'error',
|
|
370
|
+
lowContrast,
|
|
371
|
+
hideCloseButton = false,
|
|
372
|
+
...rest
|
|
373
|
+
}) {
|
|
380
374
|
const [isOpen, setIsOpen] = React.useState(true);
|
|
381
375
|
const prefix = usePrefix.usePrefix();
|
|
382
376
|
const containerClassName = cx__default["default"](className, {
|
|
@@ -483,29 +477,28 @@ InlineNotification.propTypes = {
|
|
|
483
477
|
* ======================
|
|
484
478
|
*/
|
|
485
479
|
|
|
486
|
-
function ActionableNotification(
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
} = _ref6;
|
|
480
|
+
function ActionableNotification({
|
|
481
|
+
actionButtonLabel,
|
|
482
|
+
['aria-label']: ariaLabel,
|
|
483
|
+
// @ts-expect-error: deprecated prop
|
|
484
|
+
ariaLabel: deprecatedAriaLabel,
|
|
485
|
+
children,
|
|
486
|
+
role = 'alertdialog',
|
|
487
|
+
onActionButtonClick,
|
|
488
|
+
onClose,
|
|
489
|
+
onCloseButtonClick = noopFn.noopFn,
|
|
490
|
+
statusIconDescription,
|
|
491
|
+
className,
|
|
492
|
+
inline = false,
|
|
493
|
+
kind = 'error',
|
|
494
|
+
lowContrast,
|
|
495
|
+
hideCloseButton = false,
|
|
496
|
+
hasFocus = true,
|
|
497
|
+
closeOnEscape = true,
|
|
498
|
+
title,
|
|
499
|
+
subtitle,
|
|
500
|
+
...rest
|
|
501
|
+
}) {
|
|
509
502
|
const [isOpen, setIsOpen] = React.useState(true);
|
|
510
503
|
const prefix = usePrefix.usePrefix();
|
|
511
504
|
const id = useId.useId('actionable-notification');
|
|
@@ -528,11 +521,10 @@ function ActionableNotification(_ref6) {
|
|
|
528
521
|
button?.focus();
|
|
529
522
|
}
|
|
530
523
|
});
|
|
531
|
-
function handleBlur(
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
} = _ref7;
|
|
524
|
+
function handleBlur({
|
|
525
|
+
target: oldActiveNode,
|
|
526
|
+
relatedTarget: currentActiveNode
|
|
527
|
+
}) {
|
|
536
528
|
if (isOpen && currentActiveNode && oldActiveNode && role === 'alertdialog') {
|
|
537
529
|
const {
|
|
538
530
|
current: bodyNode
|
|
@@ -718,20 +710,19 @@ const propMappingFunction = deprecatedValue => {
|
|
|
718
710
|
};
|
|
719
711
|
return mapping[deprecatedValue];
|
|
720
712
|
};
|
|
721
|
-
function Callout(
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
} = _ref8;
|
|
713
|
+
function Callout({
|
|
714
|
+
actionButtonLabel,
|
|
715
|
+
children,
|
|
716
|
+
onActionButtonClick,
|
|
717
|
+
title,
|
|
718
|
+
titleId,
|
|
719
|
+
subtitle,
|
|
720
|
+
statusIconDescription,
|
|
721
|
+
className,
|
|
722
|
+
kind = 'info',
|
|
723
|
+
lowContrast,
|
|
724
|
+
...rest
|
|
725
|
+
}) {
|
|
735
726
|
const prefix = usePrefix.usePrefix();
|
|
736
727
|
const containerClassName = cx__default["default"](className, {
|
|
737
728
|
[`${prefix}--actionable-notification`]: true,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
export declare const NumberFormatOptionsPropType: PropTypes.Requireable<PropTypes.InferProps<{
|
|
9
|
+
localeMatcher: PropTypes.Requireable<string>;
|
|
10
|
+
style: PropTypes.Requireable<string>;
|
|
11
|
+
currency: PropTypes.Requireable<string>;
|
|
12
|
+
currencyDisplay: PropTypes.Requireable<string>;
|
|
13
|
+
currencySign: PropTypes.Requireable<string>;
|
|
14
|
+
unit: PropTypes.Requireable<string>;
|
|
15
|
+
unitDisplay: PropTypes.Requireable<string>;
|
|
16
|
+
notation: PropTypes.Requireable<string>;
|
|
17
|
+
compactDisplay: PropTypes.Requireable<string>;
|
|
18
|
+
signDisplay: PropTypes.Requireable<string>;
|
|
19
|
+
minimumIntegerDigits: PropTypes.Requireable<number>;
|
|
20
|
+
minimumFractionDigits: PropTypes.Requireable<number>;
|
|
21
|
+
maximumFractionDigits: PropTypes.Requireable<number>;
|
|
22
|
+
minimumSignificantDigits: PropTypes.Requireable<number>;
|
|
23
|
+
maximumSignificantDigits: PropTypes.Requireable<number>;
|
|
24
|
+
useGrouping: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
|
|
25
|
+
numberingSystem: PropTypes.Requireable<string>;
|
|
26
|
+
roundingIncrement: PropTypes.Requireable<number>;
|
|
27
|
+
roundingMode: PropTypes.Requireable<string>;
|
|
28
|
+
trailingZeroDisplay: PropTypes.Requireable<string>;
|
|
29
|
+
}>>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
+
|
|
12
|
+
var PropTypes = require('prop-types');
|
|
13
|
+
|
|
14
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
|
+
|
|
16
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
17
|
+
|
|
18
|
+
const NumberFormatOptionsPropType = PropTypes__default["default"].shape({
|
|
19
|
+
// Locale Options
|
|
20
|
+
localeMatcher: PropTypes__default["default"].oneOf(['best fit', 'lookup']),
|
|
21
|
+
// Style Options
|
|
22
|
+
style: PropTypes__default["default"].oneOf(['decimal', 'currency', 'percent', 'unit']),
|
|
23
|
+
currency: PropTypes__default["default"].string,
|
|
24
|
+
// e.g., 'USD'
|
|
25
|
+
currencyDisplay: PropTypes__default["default"].oneOf(['symbol', 'narrowSymbol', 'code', 'name']),
|
|
26
|
+
currencySign: PropTypes__default["default"].oneOf(['standard', 'accounting']),
|
|
27
|
+
unit: PropTypes__default["default"].string,
|
|
28
|
+
// e.g., 'liter', 'mile-per-hour'
|
|
29
|
+
unitDisplay: PropTypes__default["default"].oneOf(['short', 'narrow', 'long']),
|
|
30
|
+
notation: PropTypes__default["default"].oneOf(['standard', 'scientific', 'engineering', 'compact']),
|
|
31
|
+
compactDisplay: PropTypes__default["default"].oneOf(['short', 'long']),
|
|
32
|
+
signDisplay: PropTypes__default["default"].oneOf(['auto', 'never', 'always', 'exceptZero']),
|
|
33
|
+
// Digit Options
|
|
34
|
+
minimumIntegerDigits: PropTypes__default["default"].number,
|
|
35
|
+
minimumFractionDigits: PropTypes__default["default"].number,
|
|
36
|
+
maximumFractionDigits: PropTypes__default["default"].number,
|
|
37
|
+
minimumSignificantDigits: PropTypes__default["default"].number,
|
|
38
|
+
maximumSignificantDigits: PropTypes__default["default"].number,
|
|
39
|
+
useGrouping: PropTypes__default["default"].oneOfType([PropTypes__default["default"].bool, PropTypes__default["default"].oneOf(['always', 'auto', 'min2'])]),
|
|
40
|
+
// Misc/Other Options
|
|
41
|
+
numberingSystem: PropTypes__default["default"].string,
|
|
42
|
+
// e.g., 'latn', 'arab'
|
|
43
|
+
roundingIncrement: PropTypes__default["default"].number,
|
|
44
|
+
roundingMode: PropTypes__default["default"].oneOf(['ceil', 'floor', 'expand', 'trunc', 'halfCeil', 'halfFloor', 'halfExpand', 'halfTrunc', 'halfEven']),
|
|
45
|
+
trailingZeroDisplay: PropTypes__default["default"].oneOf(['auto', 'stripIfInteger'])
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
exports.NumberFormatOptionsPropType = NumberFormatOptionsPropType;
|
|
@@ -21,13 +21,12 @@ 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 NumberInputSkeleton(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} = _ref;
|
|
24
|
+
function NumberInputSkeleton({
|
|
25
|
+
hideLabel,
|
|
26
|
+
className,
|
|
27
|
+
size = 'md',
|
|
28
|
+
...rest
|
|
29
|
+
}) {
|
|
31
30
|
const prefix = usePrefix.usePrefix();
|
|
32
31
|
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
|
33
32
|
className: cx__default["default"](`${prefix}--form-item`, className)
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React, { ReactNode } from 'react';
|
|
8
8
|
import { TranslateWithId } from '../../types/common';
|
|
9
|
+
import { type NumberFormatOptions } from '@carbon/utilities';
|
|
9
10
|
export declare const translationIds: {
|
|
10
11
|
readonly 'increment.number': "increment.number";
|
|
11
12
|
readonly 'decrement.number': "decrement.number";
|
|
@@ -25,7 +26,8 @@ export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
|
|
|
25
26
|
*/
|
|
26
27
|
className?: string;
|
|
27
28
|
/**
|
|
28
|
-
* **Experimental**: Provide a `decorator` component to be rendered inside the
|
|
29
|
+
* **Experimental**: Provide a `decorator` component to be rendered inside the
|
|
30
|
+
* `TextInput` component
|
|
29
31
|
*/
|
|
30
32
|
decorator?: ReactNode;
|
|
31
33
|
/**
|
|
@@ -40,6 +42,13 @@ export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
|
|
|
40
42
|
* Specify if the control should be disabled, or not
|
|
41
43
|
*/
|
|
42
44
|
disabled?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* **Experimental:** Specify Intl.NumberFormat options applied to internal
|
|
47
|
+
* number parsing and formatting. Use with `type="text"`, has no effect when
|
|
48
|
+
* `type="number"`.
|
|
49
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options
|
|
50
|
+
*/
|
|
51
|
+
formatOptions?: NumberFormatOptions;
|
|
43
52
|
/**
|
|
44
53
|
* Provide text that is used alongside the control label for additional help
|
|
45
54
|
*/
|
|
@@ -60,6 +69,12 @@ export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
|
|
|
60
69
|
* Specify a custom `id` for the input
|
|
61
70
|
*/
|
|
62
71
|
id: string;
|
|
72
|
+
/**
|
|
73
|
+
* Instruct the browser which keyboard to display on mobile devices. Note that
|
|
74
|
+
* standard numeric keyboards vary across devices and operating systems.
|
|
75
|
+
* @see https://css-tricks.com/everything-you-ever-wanted-to-know-about-inputmode/
|
|
76
|
+
*/
|
|
77
|
+
inputMode?: React.HTMLAttributes<HTMLInputElement>['inputMode'];
|
|
63
78
|
/**
|
|
64
79
|
* Specify if the currently value is invalid.
|
|
65
80
|
*/
|
|
@@ -77,9 +92,16 @@ export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
|
|
|
77
92
|
* `true` to use the light version.
|
|
78
93
|
*
|
|
79
94
|
* @deprecated The `light` prop for `NumberInput` is no longer needed and has
|
|
80
|
-
*
|
|
95
|
+
* been deprecated in v11 in favor of the new `Layer` component. It will be
|
|
96
|
+
* removed in the next major release.
|
|
81
97
|
*/
|
|
82
98
|
light?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* **Experimental:** Specify a [BCP47](https://www.ietf.org/rfc/bcp/bcp47.txt)
|
|
101
|
+
* language code for parsing and formatting. Use with `type="text"`, has no
|
|
102
|
+
* effect when `type="number"`.
|
|
103
|
+
*/
|
|
104
|
+
locale?: string;
|
|
83
105
|
/**
|
|
84
106
|
* The maximum value.
|
|
85
107
|
*/
|
|
@@ -91,9 +113,12 @@ export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
|
|
|
91
113
|
/**
|
|
92
114
|
* Provide an optional handler that is called when the internal state of
|
|
93
115
|
* NumberInput changes. This handler is called with event and state info.
|
|
116
|
+
* When type="number", this is called on every change of the input.
|
|
117
|
+
* When type="text", this is only called on blur after the number has been
|
|
118
|
+
* parsed and formatted.
|
|
94
119
|
* `(event, { value, direction }) => void`
|
|
95
120
|
*/
|
|
96
|
-
onChange?: (event: React.MouseEvent<HTMLButtonElement>, state: {
|
|
121
|
+
onChange?: (event: React.MouseEvent<HTMLButtonElement> | React.FocusEvent<HTMLInputElement> | React.KeyboardEvent<HTMLInputElement>, state: {
|
|
97
122
|
value: number | string;
|
|
98
123
|
direction: string;
|
|
99
124
|
}) => void;
|
|
@@ -108,6 +133,11 @@ export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
|
|
|
108
133
|
* Provide an optional function to be called when a key is pressed in the number input
|
|
109
134
|
*/
|
|
110
135
|
onKeyUp?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
136
|
+
/**
|
|
137
|
+
* When type="text", provide an optional pattern to restrict user input. Has
|
|
138
|
+
* no effect when type="number".
|
|
139
|
+
*/
|
|
140
|
+
pattern?: string;
|
|
111
141
|
/**
|
|
112
142
|
* Specify if the component should be read-only
|
|
113
143
|
*/
|
|
@@ -125,6 +155,12 @@ export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
|
|
|
125
155
|
* Specify how much the values should increase/decrease upon clicking on up/down button
|
|
126
156
|
*/
|
|
127
157
|
step?: number;
|
|
158
|
+
/**
|
|
159
|
+
* **Experimental**: Specify if the input should be of type text or number.
|
|
160
|
+
* Use type="text" with `locale`, `formatOptions`, and guide user input with
|
|
161
|
+
* `pattern` and `inputMode`.
|
|
162
|
+
*/
|
|
163
|
+
type?: 'number' | 'text';
|
|
128
164
|
/**
|
|
129
165
|
* Specify the value of the input
|
|
130
166
|
*/
|