@carbon/react 1.87.0-rc.0 → 1.87.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 +853 -853
- package/es/_virtual/_rollupPluginBabelHelpers.js +4 -4
- package/es/components/Button/Button.js +1 -1
- package/es/components/Button/index.js +5 -1
- package/es/components/ButtonSet/index.js +4 -1
- package/es/components/Checkbox/index.js +4 -1
- package/es/components/ComboBox/ComboBox.js +1 -1
- package/es/components/ComboBox/index.js +4 -1
- package/es/components/ComposedModal/ComposedModal.js +18 -8
- package/es/components/ContainedList/ContainedListItem/index.js +4 -1
- package/es/components/ContainedList/index.js +2 -2
- package/es/components/Copy/Copy.js +1 -1
- package/es/components/Copy/index.js +4 -1
- package/es/components/CopyButton/index.js +4 -1
- package/es/components/DataTable/Table.js +1 -1
- package/es/components/DataTable/state/getDerivedStateFromProps.d.ts +19 -0
- package/es/components/DataTable/state/getDerivedStateFromProps.js +1 -2
- package/es/components/DataTable/state/sorting.d.ts +15 -0
- package/es/components/DataTable/state/sorting.js +1 -2
- package/es/components/DataTable/tools/denormalize.d.ts +22 -0
- package/es/components/DataTable/tools/denormalize.js +1 -2
- package/es/components/DataTable/tools/normalize.d.ts +9 -0
- package/es/components/DataTable/tools/normalize.js +1 -2
- package/es/components/DatePicker/DatePicker.js +18 -11
- package/es/components/DatePicker/index.js +4 -1
- package/es/components/DatePicker/plugins/fixEventsPlugin.d.ts +2 -0
- package/es/components/DatePicker/plugins/rangePlugin.d.ts +2 -0
- package/es/components/DatePickerInput/DatePickerInput.js +6 -0
- package/es/components/DatePickerInput/index.js +4 -1
- package/es/components/Dialog/index.js +2 -2
- package/es/components/Dropdown/Dropdown.js +2 -2
- package/es/components/Dropdown/index.js +4 -1
- package/es/components/FeatureFlags/index.js +2 -2
- package/es/components/FluidSelect/index.js +4 -1
- package/es/components/FluidTextInput/index.js +4 -1
- package/es/components/IconIndicator/index.js +1 -1
- package/es/components/InlineCheckbox/index.js +4 -1
- package/es/components/InlineLoading/index.js +4 -1
- package/es/components/LayoutDirection/LayoutDirection.js +1 -2
- package/es/components/Link/index.js +4 -1
- package/es/components/ListBox/ListBox.js +1 -1
- package/es/components/Loading/index.js +4 -1
- package/es/components/Menu/Menu.d.ts +3 -1
- package/es/components/Menu/Menu.js +3 -1
- package/es/components/Menu/MenuItem.js +1 -1
- package/es/components/Modal/Modal.js +16 -5
- package/es/components/Modal/index.js +4 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +3 -3
- package/es/components/MultiSelect/MultiSelect.js +2 -2
- package/es/components/MultiSelect/filter.js +0 -4
- package/es/components/MultiSelect/tools/itemToString.d.ts +1 -0
- package/es/components/MultiSelect/tools/sorting.d.ts +9 -0
- package/es/components/Notification/Notification.js +2 -2
- package/es/components/NumberInput/NumberInput.js +1 -1
- package/es/components/OverflowMenu/next/index.js +1 -1
- package/es/components/OverflowMenuItem/index.js +4 -1
- package/es/components/OverflowMenuV2/index.d.ts +1 -0
- package/es/components/PageHeader/PageHeader.js +1 -1
- package/es/components/Pagination/experimental/PageSelector.d.ts +19 -0
- package/es/components/Pagination/experimental/Pagination.d.ts +43 -0
- package/es/components/Pagination/experimental/index.d.ts +3 -0
- package/es/components/Popover/index.js +21 -4
- package/es/components/RadioButton/index.js +4 -1
- package/es/components/RadioTile/index.js +4 -1
- package/es/components/Search/Search.js +1 -1
- package/es/components/Search/index.js +4 -1
- package/es/components/Select/index.js +4 -1
- package/es/components/SelectItem/index.js +4 -1
- package/es/components/ShapeIndicator/index.js +1 -1
- package/es/components/SkeletonText/index.js +4 -1
- package/es/components/Slider/Slider.js +1 -1
- package/es/components/Switch/IconSwitch.d.ts +3 -0
- package/es/components/Switch/IconSwitch.js +1 -2
- package/es/components/TabContent/TabContent.js +2 -22
- package/es/components/Tabs/Tabs.js +5 -5
- package/es/components/Tag/DismissibleTag.js +1 -1
- package/es/components/TextArea/TextArea.js +1 -1
- package/es/components/TextArea/index.js +4 -1
- package/es/components/TextInput/index.js +4 -1
- package/es/components/TextInput/util.d.ts +9 -0
- package/es/components/Toggletip/index.js +2 -2
- package/es/components/UIShell/HeaderMenu.js +2 -2
- package/es/components/UIShell/SideNav.js +1 -1
- package/es/components/UIShell/_utils.d.ts +7 -0
- package/es/feature-flags.d.ts +1 -0
- package/es/internal/FloatingMenu.js +1 -1
- package/es/internal/deprecateFieldOnObject.js +1 -1
- package/es/internal/useId.d.ts +21 -0
- package/es/internal/useId.js +27 -1
- package/es/internal/useOverflowItems.js +0 -6
- package/es/node_modules/es-toolkit/dist/compat/function/{debounce.mjs.js → debounce.js} +1 -1
- package/es/node_modules/es-toolkit/dist/compat/function/{throttle.mjs.js → throttle.js} +1 -1
- package/es/prop-types/deprecateComponent.d.ts +1 -0
- package/es/prop-types/deprecateComponent.js +1 -4
- package/es/prop-types/deprecateValuesWithin.d.ts +1 -0
- package/es/prop-types/requiredIfGivenPropIsTruthy.d.ts +14 -0
- package/es/tools/mergeRefs.d.ts +12 -0
- package/es/tools/mergeRefs.js +1 -2
- package/icons/index.js +1 -3
- package/lib/_virtual/_rollupPluginBabelHelpers.js +5 -7
- package/lib/components/AILabel/index.js +35 -43
- package/lib/components/AISkeleton/AISkeletonIcon.js +5 -11
- package/lib/components/AISkeleton/AISkeletonPlaceholder.js +4 -10
- package/lib/components/AISkeleton/AISkeletonText.js +8 -14
- package/lib/components/Accordion/Accordion.Skeleton.js +21 -27
- package/lib/components/Accordion/Accordion.js +11 -17
- package/lib/components/Accordion/AccordionItem.js +19 -25
- package/lib/components/Accordion/AccordionProvider.js +1 -7
- package/lib/components/AspectRatio/AspectRatio.js +7 -13
- package/lib/components/BadgeIndicator/index.js +7 -13
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +7 -13
- package/lib/components/Breadcrumb/Breadcrumb.js +9 -15
- package/lib/components/Breadcrumb/BreadcrumbItem.js +16 -22
- package/lib/components/Button/Button.Skeleton.js +8 -14
- package/lib/components/Button/Button.js +31 -36
- package/lib/components/Button/ButtonBase.js +6 -11
- package/lib/components/Button/index.js +3 -3
- package/lib/components/ButtonSet/ButtonSet.js +6 -12
- package/lib/components/ButtonSet/index.js +2 -2
- package/lib/components/ChatButton/ChatButton.Skeleton.js +5 -11
- package/lib/components/ChatButton/ChatButton.js +12 -18
- package/lib/components/Checkbox/Checkbox.Skeleton.js +6 -12
- package/lib/components/Checkbox/Checkbox.js +33 -39
- package/lib/components/Checkbox/index.js +3 -3
- package/lib/components/CheckboxGroup/CheckboxGroup.js +24 -30
- package/lib/components/ClassPrefix/index.js +3 -10
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +10 -16
- package/lib/components/CodeSnippet/CodeSnippet.js +39 -46
- package/lib/components/ComboBox/ComboBox.js +57 -64
- package/lib/components/ComboBox/index.js +2 -2
- package/lib/components/ComboButton/index.js +20 -28
- package/lib/components/ComposedModal/ComposedModal.js +61 -57
- package/lib/components/ComposedModal/ModalFooter.js +37 -45
- package/lib/components/ComposedModal/ModalHeader.js +23 -31
- package/lib/components/ContainedList/ContainedList.js +18 -24
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +14 -20
- package/lib/components/ContainedList/ContainedListItem/index.js +2 -2
- package/lib/components/ContainedList/index.js +5 -5
- package/lib/components/ContentSwitcher/ContentSwitcher.js +11 -19
- package/lib/components/ContextMenu/useContextMenu.js +1 -1
- package/lib/components/Copy/Copy.js +12 -18
- package/lib/components/Copy/index.js +2 -2
- package/lib/components/CopyButton/CopyButton.js +12 -18
- package/lib/components/CopyButton/index.js +2 -2
- package/lib/components/DangerButton/DangerButton.js +2 -6
- package/lib/components/DataTable/DataTable.js +48 -55
- package/lib/components/DataTable/Table.js +18 -24
- package/lib/components/DataTable/TableActionList.js +2 -2
- package/lib/components/DataTable/TableBatchAction.js +4 -9
- package/lib/components/DataTable/TableBatchActions.js +19 -25
- package/lib/components/DataTable/TableBody.js +5 -10
- package/lib/components/DataTable/TableCell.js +8 -14
- package/lib/components/DataTable/TableContainer.js +14 -20
- package/lib/components/DataTable/TableContext.js +0 -2
- package/lib/components/DataTable/TableDecoratorRow.js +5 -11
- package/lib/components/DataTable/TableExpandHeader.js +16 -22
- package/lib/components/DataTable/TableExpandRow.js +20 -26
- package/lib/components/DataTable/TableExpandedRow.js +8 -14
- package/lib/components/DataTable/TableHead.js +2 -2
- package/lib/components/DataTable/TableHeader.js +26 -32
- package/lib/components/DataTable/TableRow.js +8 -14
- package/lib/components/DataTable/TableSelectAll.js +13 -19
- package/lib/components/DataTable/TableSelectRow.js +15 -21
- package/lib/components/DataTable/TableSlugRow.js +7 -13
- package/lib/components/DataTable/TableToolbar.js +7 -13
- package/lib/components/DataTable/TableToolbarAction.js +5 -10
- package/lib/components/DataTable/TableToolbarContent.js +2 -2
- package/lib/components/DataTable/TableToolbarMenu.js +9 -15
- package/lib/components/DataTable/TableToolbarSearch.js +22 -28
- package/lib/components/DataTable/state/getDerivedStateFromProps.d.ts +19 -0
- package/lib/components/DataTable/state/getDerivedStateFromProps.js +2 -3
- package/lib/components/DataTable/state/sortStates.js +0 -2
- package/lib/components/DataTable/state/sorting.d.ts +15 -0
- package/lib/components/DataTable/state/sorting.js +0 -2
- package/lib/components/DataTable/tools/cells.js +0 -2
- package/lib/components/DataTable/tools/denormalize.d.ts +22 -0
- package/lib/components/DataTable/tools/denormalize.js +1 -2
- package/lib/components/DataTable/tools/filter.js +0 -2
- package/lib/components/DataTable/tools/normalize.d.ts +9 -0
- package/lib/components/DataTable/tools/normalize.js +1 -2
- package/lib/components/DataTable/tools/sorting.js +0 -2
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +25 -31
- package/lib/components/DatePicker/DatePicker.Skeleton.js +14 -20
- package/lib/components/DatePicker/DatePicker.js +65 -66
- package/lib/components/DatePicker/index.js +3 -3
- package/lib/components/DatePicker/plugins/appendToPlugin.js +0 -2
- package/lib/components/DatePicker/plugins/fixEventsPlugin.d.ts +2 -0
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +1 -1
- package/lib/components/DatePicker/plugins/rangePlugin.d.ts +2 -0
- package/lib/components/DatePicker/plugins/rangePlugin.js +2 -6
- package/lib/components/DatePickerInput/DatePickerInput.js +49 -49
- package/lib/components/DatePickerInput/index.js +2 -2
- package/lib/components/Dialog/index.js +72 -80
- package/lib/components/Dropdown/Dropdown.Skeleton.js +8 -14
- package/lib/components/Dropdown/Dropdown.js +49 -55
- package/lib/components/Dropdown/index.js +3 -3
- package/lib/components/ErrorBoundary/ErrorBoundary.js +4 -9
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +0 -2
- package/lib/components/ExpandableSearch/ExpandableSearch.js +6 -11
- package/lib/components/FeatureFlags/index.js +10 -17
- package/lib/components/FileUploader/FileUploader.Skeleton.js +7 -13
- package/lib/components/FileUploader/FileUploader.js +30 -36
- package/lib/components/FileUploader/FileUploaderButton.js +19 -25
- package/lib/components/FileUploader/FileUploaderDropContainer.js +18 -24
- package/lib/components/FileUploader/FileUploaderItem.js +23 -29
- package/lib/components/FileUploader/Filename.js +13 -18
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +7 -13
- package/lib/components/FluidComboBox/FluidComboBox.js +24 -30
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +14 -20
- package/lib/components/FluidDatePicker/FluidDatePicker.js +12 -18
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +4 -8
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +7 -13
- package/lib/components/FluidDropdown/FluidDropdown.js +24 -30
- package/lib/components/FluidForm/FluidForm.js +6 -12
- package/lib/components/FluidForm/FormContext.js +0 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +7 -13
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +36 -42
- package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +7 -13
- package/lib/components/FluidNumberInput/FluidNumberInput.js +30 -36
- package/lib/components/FluidSearch/FluidSearch.Skeleton.js +7 -13
- package/lib/components/FluidSearch/FluidSearch.js +19 -25
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +7 -13
- package/lib/components/FluidSelect/FluidSelect.js +17 -23
- package/lib/components/FluidSelect/index.js +3 -3
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +7 -13
- package/lib/components/FluidTextArea/FluidTextArea.js +25 -31
- package/lib/components/FluidTextInput/FluidPasswordInput.js +18 -22
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +7 -13
- package/lib/components/FluidTextInput/FluidTextInput.js +23 -29
- package/lib/components/FluidTextInput/index.js +3 -3
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +6 -12
- package/lib/components/FluidTimePicker/FluidTimePicker.js +23 -29
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +10 -15
- package/lib/components/Form/Form.js +5 -11
- package/lib/components/FormGroup/FormGroup.js +13 -19
- package/lib/components/FormItem/FormItem.js +5 -11
- package/lib/components/FormLabel/FormLabel.js +6 -12
- package/lib/components/Grid/CSSGrid.js +20 -28
- package/lib/components/Grid/Column.js +31 -37
- package/lib/components/Grid/ColumnHang.js +5 -13
- package/lib/components/Grid/FlexGrid.js +10 -18
- package/lib/components/Grid/Grid.js +9 -16
- package/lib/components/Grid/GridContext.js +7 -14
- package/lib/components/Grid/Row.js +8 -14
- package/lib/components/Heading/index.js +14 -21
- package/lib/components/Icon/Icon.Skeleton.js +4 -10
- package/lib/components/IconButton/index.js +25 -33
- package/lib/components/IconIndicator/index.js +9 -15
- package/lib/components/IdPrefix/index.js +3 -10
- package/lib/components/InlineCheckbox/InlineCheckbox.js +17 -22
- package/lib/components/InlineCheckbox/index.js +2 -2
- package/lib/components/InlineLoading/InlineLoading.js +17 -23
- package/lib/components/InlineLoading/index.js +2 -2
- package/lib/components/Layer/LayerContext.js +1 -7
- package/lib/components/Layer/LayerLevel.js +0 -2
- package/lib/components/Layer/index.js +11 -19
- package/lib/components/Layout/index.js +22 -30
- package/lib/components/LayoutDirection/LayoutDirection.js +6 -13
- package/lib/components/LayoutDirection/LayoutDirectionContext.js +1 -7
- package/lib/components/LayoutDirection/useLayoutDirection.js +0 -2
- package/lib/components/Link/Link.js +15 -21
- package/lib/components/Link/index.js +2 -2
- package/lib/components/ListBox/ListBox.js +17 -23
- package/lib/components/ListBox/ListBoxField.js +7 -12
- package/lib/components/ListBox/ListBoxMenu.js +7 -12
- package/lib/components/ListBox/ListBoxMenuIcon.js +7 -13
- package/lib/components/ListBox/ListBoxMenuItem.js +9 -15
- package/lib/components/ListBox/ListBoxPropTypes.js +2 -8
- package/lib/components/ListBox/ListBoxSelection.js +14 -20
- package/lib/components/ListBox/index.js +7 -7
- package/lib/components/ListBox/next/ListBoxSelection.js +18 -24
- package/lib/components/ListBox/next/ListBoxTrigger.js +7 -13
- package/lib/components/ListItem/ListItem.js +5 -11
- package/lib/components/Loading/Loading.js +14 -20
- package/lib/components/Loading/index.js +2 -2
- package/lib/components/Menu/Menu.d.ts +3 -1
- package/lib/components/Menu/Menu.js +18 -24
- package/lib/components/Menu/MenuContext.js +0 -2
- package/lib/components/Menu/MenuItem.js +44 -52
- package/lib/components/MenuButton/index.js +16 -24
- package/lib/components/Modal/Modal.js +91 -86
- package/lib/components/Modal/index.js +2 -2
- package/lib/components/ModalWrapper/ModalWrapper.js +30 -35
- package/lib/components/MultiSelect/FilterableMultiSelect.js +57 -67
- package/lib/components/MultiSelect/MultiSelect.js +61 -70
- package/lib/components/MultiSelect/MultiSelectPropTypes.js +2 -8
- package/lib/components/MultiSelect/filter.js +0 -6
- package/lib/components/MultiSelect/tools/itemToString.d.ts +1 -0
- package/lib/components/MultiSelect/tools/itemToString.js +1 -7
- package/lib/components/MultiSelect/tools/sorting.d.ts +9 -0
- package/lib/components/MultiSelect/tools/sorting.js +0 -2
- package/lib/components/Notification/Notification.js +118 -126
- package/lib/components/NumberInput/NumberFormatPropTypes.js +21 -27
- package/lib/components/NumberInput/NumberInput.Skeleton.js +8 -14
- package/lib/components/NumberInput/NumberInput.js +66 -74
- package/lib/components/OrderedList/OrderedList.js +8 -14
- package/lib/components/OverflowMenu/OverflowMenu.js +42 -49
- package/lib/components/OverflowMenu/index.js +3 -7
- package/lib/components/OverflowMenu/next/index.js +18 -26
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +27 -33
- package/lib/components/OverflowMenuItem/index.js +2 -2
- package/lib/components/OverflowMenuV2/index.d.ts +1 -0
- package/lib/components/OverflowMenuV2/index.js +2 -8
- package/lib/components/PageHeader/PageHeader.js +70 -78
- package/lib/components/PageHeader/index.js +0 -2
- package/lib/components/Pagination/Pagination.Skeleton.js +10 -16
- package/lib/components/Pagination/Pagination.js +44 -51
- package/lib/components/Pagination/experimental/PageSelector.d.ts +19 -0
- package/lib/components/Pagination/experimental/PageSelector.js +9 -15
- package/lib/components/Pagination/experimental/Pagination.d.ts +43 -0
- package/lib/components/Pagination/experimental/Pagination.js +34 -40
- package/lib/components/Pagination/experimental/index.d.ts +3 -0
- package/lib/components/PaginationNav/PaginationNav.js +54 -60
- package/lib/components/Popover/index.js +56 -47
- package/lib/components/PrimaryButton/PrimaryButton.js +2 -6
- package/lib/components/ProgressBar/ProgressBar.js +25 -31
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +10 -16
- package/lib/components/ProgressIndicator/ProgressIndicator.js +41 -49
- package/lib/components/RadioButton/RadioButton.Skeleton.js +6 -12
- package/lib/components/RadioButton/RadioButton.js +26 -32
- package/lib/components/RadioButton/index.js +2 -2
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +37 -43
- package/lib/components/RadioTile/RadioTile.js +25 -31
- package/lib/components/RadioTile/index.js +2 -2
- package/lib/components/Search/Search.Skeleton.js +7 -13
- package/lib/components/Search/Search.js +33 -39
- package/lib/components/Search/index.js +3 -3
- package/lib/components/SecondaryButton/SecondaryButton.js +2 -6
- package/lib/components/Select/Select.Skeleton.js +8 -14
- package/lib/components/Select/Select.js +42 -48
- package/lib/components/Select/index.js +3 -3
- package/lib/components/SelectItem/SelectItem.js +8 -14
- package/lib/components/SelectItem/index.js +2 -2
- package/lib/components/SelectItemGroup/SelectItemGroup.js +7 -13
- package/lib/components/ShapeIndicator/index.js +12 -18
- package/lib/components/SkeletonIcon/SkeletonIcon.js +4 -10
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +4 -10
- package/lib/components/SkeletonText/SkeletonText.js +11 -17
- package/lib/components/SkeletonText/index.js +2 -2
- package/lib/components/Slider/Slider.Skeleton.js +29 -35
- package/lib/components/Slider/Slider.js +84 -90
- package/lib/components/Slider/SliderHandles.js +18 -24
- package/lib/components/Slider/index.js +3 -3
- package/lib/components/Stack/HStack.js +1 -7
- package/lib/components/Stack/Stack.js +7 -15
- package/lib/components/Stack/VStack.js +1 -7
- package/lib/components/StructuredList/StructuredList.Skeleton.js +15 -21
- package/lib/components/StructuredList/StructuredList.js +60 -68
- package/lib/components/Switch/IconSwitch.d.ts +3 -0
- package/lib/components/Switch/IconSwitch.js +18 -25
- package/lib/components/Switch/Switch.js +14 -20
- package/lib/components/TabContent/TabContent.js +7 -33
- package/lib/components/Tabs/Tabs.Skeleton.js +10 -16
- package/lib/components/Tabs/Tabs.js +121 -129
- package/lib/components/Tabs/usePressable.js +0 -2
- package/lib/components/Tag/DismissibleTag.js +24 -30
- package/lib/components/Tag/OperationalTag.js +16 -22
- package/lib/components/Tag/SelectableTag.js +19 -25
- package/lib/components/Tag/Tag.Skeleton.js +5 -11
- package/lib/components/Tag/Tag.js +28 -34
- package/lib/components/Tag/isEllipsisActive.js +0 -2
- package/lib/components/Text/Text.js +6 -13
- package/lib/components/Text/TextDirection.js +4 -11
- package/lib/components/Text/TextDirectionContext.js +0 -2
- package/lib/components/Text/createTextComponent.js +1 -7
- package/lib/components/Text/index.js +0 -2
- package/lib/components/TextArea/TextArea.Skeleton.js +7 -13
- package/lib/components/TextArea/TextArea.js +49 -55
- package/lib/components/TextArea/index.js +3 -3
- package/lib/components/TextInput/ControlledPasswordInput.js +36 -42
- package/lib/components/TextInput/PasswordInput.js +48 -54
- package/lib/components/TextInput/TextInput.Skeleton.js +7 -13
- package/lib/components/TextInput/TextInput.js +47 -53
- package/lib/components/TextInput/index.js +3 -3
- package/lib/components/TextInput/util.d.ts +9 -0
- package/lib/components/TextInput/util.js +0 -2
- package/lib/components/Theme/index.js +16 -24
- package/lib/components/Tile/Tile.js +92 -100
- package/lib/components/TileGroup/TileGroup.js +15 -22
- package/lib/components/TimePicker/TimePicker.js +39 -45
- package/lib/components/TimePickerSelect/TimePickerSelect.js +10 -16
- package/lib/components/Toggle/Toggle.Skeleton.js +7 -13
- package/lib/components/Toggle/Toggle.js +28 -34
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +12 -20
- package/lib/components/Toggletip/index.js +32 -40
- package/lib/components/Tooltip/DefinitionTooltip.js +14 -22
- package/lib/components/Tooltip/Tooltip.js +19 -27
- package/lib/components/TreeView/TreeContext.js +0 -2
- package/lib/components/TreeView/TreeNode.js +41 -47
- package/lib/components/TreeView/TreeView.js +17 -23
- package/lib/components/UIShell/Content.js +6 -12
- package/lib/components/UIShell/Header.js +4 -10
- package/lib/components/UIShell/HeaderContainer.js +4 -9
- package/lib/components/UIShell/HeaderGlobalAction.js +11 -17
- package/lib/components/UIShell/HeaderGlobalBar.js +2 -2
- package/lib/components/UIShell/HeaderMenu.js +17 -23
- package/lib/components/UIShell/HeaderMenuButton.js +9 -15
- package/lib/components/UIShell/HeaderMenuItem.js +11 -17
- package/lib/components/UIShell/HeaderName.js +8 -14
- package/lib/components/UIShell/HeaderNavigation.js +6 -12
- package/lib/components/UIShell/HeaderPanel.js +11 -17
- package/lib/components/UIShell/HeaderSideNavItems.js +6 -12
- package/lib/components/UIShell/Link.js +6 -11
- package/lib/components/UIShell/SideNav.js +23 -29
- package/lib/components/UIShell/SideNavDetails.js +7 -13
- package/lib/components/UIShell/SideNavDivider.js +5 -11
- package/lib/components/UIShell/SideNavFooter.js +12 -18
- package/lib/components/UIShell/SideNavHeader.js +8 -14
- package/lib/components/UIShell/SideNavIcon.js +6 -12
- package/lib/components/UIShell/SideNavItem.js +6 -12
- package/lib/components/UIShell/SideNavItems.js +9 -15
- package/lib/components/UIShell/SideNavLink.js +13 -19
- package/lib/components/UIShell/SideNavLinkText.js +5 -11
- package/lib/components/UIShell/SideNavMenu.js +20 -26
- package/lib/components/UIShell/SideNavMenuItem.js +13 -19
- package/lib/components/UIShell/SideNavSwitcher.js +13 -19
- package/lib/components/UIShell/SkipToContent.js +7 -13
- package/lib/components/UIShell/Switcher.js +9 -15
- package/lib/components/UIShell/SwitcherDivider.js +4 -10
- package/lib/components/UIShell/SwitcherItem.js +15 -21
- package/lib/components/UIShell/_utils.d.ts +7 -0
- package/lib/components/UIShell/_utils.js +0 -2
- package/lib/components/UnorderedList/UnorderedList.js +7 -13
- package/lib/feature-flags.d.ts +1 -0
- package/lib/feature-flags.js +3 -4
- package/lib/index.js +180 -182
- package/lib/internal/FloatingMenu.js +10 -18
- package/lib/internal/OptimizedResize.js +2 -8
- package/lib/internal/Selection.js +1 -7
- package/lib/internal/clamp.js +0 -2
- package/lib/internal/createClassWrapper.js +1 -7
- package/lib/internal/deprecateFieldOnObject.js +1 -3
- package/lib/internal/environment.js +0 -2
- package/lib/internal/getAnnouncement.js +0 -2
- package/lib/internal/keyboard/keys.js +0 -2
- package/lib/internal/keyboard/match.js +0 -2
- package/lib/internal/keyboard/navigation.js +0 -2
- package/lib/internal/noopFn.js +0 -2
- package/lib/internal/useAttachedMenu.js +0 -2
- package/lib/internal/useControllableState.js +0 -2
- package/lib/internal/useDelayedState.js +0 -2
- package/lib/internal/useEvent.js +0 -2
- package/lib/internal/useId.d.ts +21 -0
- package/lib/internal/useId.js +27 -7
- package/lib/internal/useIdPrefix.js +2 -8
- package/lib/internal/useIsomorphicEffect.js +1 -1
- package/lib/internal/useMatchMedia.js +0 -2
- package/lib/internal/useMergedRefs.js +0 -2
- package/lib/internal/useNoInteractiveChildren.js +0 -2
- package/lib/internal/useNormalizedInputProps.js +2 -8
- package/lib/internal/useOutsideClick.js +0 -2
- package/lib/internal/useOverflowItems.js +1 -7
- package/lib/internal/usePrefix.js +2 -8
- package/lib/internal/usePreviousValue.js +0 -2
- package/lib/internal/useResizeObserver.js +0 -2
- package/lib/internal/useSavedCallback.js +0 -2
- package/lib/internal/utils.js +0 -2
- package/lib/internal/warning.js +0 -2
- package/lib/internal/wrapFocus.js +0 -2
- package/lib/node_modules/es-toolkit/dist/compat/function/{debounce.mjs.js → debounce.js} +1 -3
- package/lib/node_modules/es-toolkit/dist/compat/function/{throttle.mjs.js → throttle.js} +1 -3
- package/lib/node_modules/es-toolkit/dist/function/{debounce.mjs.js → debounce.js} +0 -2
- package/lib/prop-types/AriaPropTypes.js +2 -8
- package/lib/prop-types/deprecate.js +0 -2
- package/lib/prop-types/deprecateComponent.d.ts +1 -0
- package/lib/prop-types/deprecateComponent.js +2 -5
- package/lib/prop-types/deprecateValuesWithin.d.ts +1 -0
- package/lib/prop-types/deprecateValuesWithin.js +1 -1
- package/lib/prop-types/isRequiredOneOf.js +0 -2
- package/lib/prop-types/requiredIfGivenPropIsTruthy.d.ts +14 -0
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +1 -1
- package/lib/tools/events.js +0 -2
- package/lib/tools/mapPopoverAlign.js +0 -2
- package/lib/tools/mergeRefs.d.ts +12 -0
- package/lib/tools/mergeRefs.js +1 -2
- package/lib/tools/setupGetInstanceId.js +0 -2
- package/lib/tools/toggleClass.js +0 -2
- package/lib/tools/wrapComponent.js +4 -10
- package/package.json +11 -11
- /package/es/node_modules/es-toolkit/dist/function/{debounce.mjs.js → debounce.js} +0 -0
|
@@ -7,42 +7,36 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
-
|
|
12
10
|
var PropTypes = require('prop-types');
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
17
|
-
|
|
18
|
-
const NumberFormatOptionsPropType = PropTypes__default["default"].shape({
|
|
12
|
+
const NumberFormatOptionsPropType = PropTypes.shape({
|
|
19
13
|
// Locale Options
|
|
20
|
-
localeMatcher:
|
|
14
|
+
localeMatcher: PropTypes.oneOf(['best fit', 'lookup']),
|
|
21
15
|
// Style Options
|
|
22
|
-
style:
|
|
23
|
-
currency:
|
|
16
|
+
style: PropTypes.oneOf(['decimal', 'currency', 'percent', 'unit']),
|
|
17
|
+
currency: PropTypes.string,
|
|
24
18
|
// e.g., 'USD'
|
|
25
|
-
currencyDisplay:
|
|
26
|
-
currencySign:
|
|
27
|
-
unit:
|
|
19
|
+
currencyDisplay: PropTypes.oneOf(['symbol', 'narrowSymbol', 'code', 'name']),
|
|
20
|
+
currencySign: PropTypes.oneOf(['standard', 'accounting']),
|
|
21
|
+
unit: PropTypes.string,
|
|
28
22
|
// e.g., 'liter', 'mile-per-hour'
|
|
29
|
-
unitDisplay:
|
|
30
|
-
notation:
|
|
31
|
-
compactDisplay:
|
|
32
|
-
signDisplay:
|
|
23
|
+
unitDisplay: PropTypes.oneOf(['short', 'narrow', 'long']),
|
|
24
|
+
notation: PropTypes.oneOf(['standard', 'scientific', 'engineering', 'compact']),
|
|
25
|
+
compactDisplay: PropTypes.oneOf(['short', 'long']),
|
|
26
|
+
signDisplay: PropTypes.oneOf(['auto', 'never', 'always', 'exceptZero']),
|
|
33
27
|
// Digit Options
|
|
34
|
-
minimumIntegerDigits:
|
|
35
|
-
minimumFractionDigits:
|
|
36
|
-
maximumFractionDigits:
|
|
37
|
-
minimumSignificantDigits:
|
|
38
|
-
maximumSignificantDigits:
|
|
39
|
-
useGrouping:
|
|
28
|
+
minimumIntegerDigits: PropTypes.number,
|
|
29
|
+
minimumFractionDigits: PropTypes.number,
|
|
30
|
+
maximumFractionDigits: PropTypes.number,
|
|
31
|
+
minimumSignificantDigits: PropTypes.number,
|
|
32
|
+
maximumSignificantDigits: PropTypes.number,
|
|
33
|
+
useGrouping: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['always', 'auto', 'min2'])]),
|
|
40
34
|
// Misc/Other Options
|
|
41
|
-
numberingSystem:
|
|
35
|
+
numberingSystem: PropTypes.string,
|
|
42
36
|
// e.g., 'latn', 'arab'
|
|
43
|
-
roundingIncrement:
|
|
44
|
-
roundingMode:
|
|
45
|
-
trailingZeroDisplay:
|
|
37
|
+
roundingIncrement: PropTypes.number,
|
|
38
|
+
roundingMode: PropTypes.oneOf(['ceil', 'floor', 'expand', 'trunc', 'halfCeil', 'halfFloor', 'halfExpand', 'halfTrunc', 'halfEven']),
|
|
39
|
+
trailingZeroDisplay: PropTypes.oneOf(['auto', 'stripIfInteger'])
|
|
46
40
|
});
|
|
47
41
|
|
|
48
42
|
exports.NumberFormatOptionsPropType = NumberFormatOptionsPropType;
|
|
@@ -15,12 +15,6 @@ var React = require('react');
|
|
|
15
15
|
var cx = require('classnames');
|
|
16
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
17
|
|
|
18
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
-
|
|
20
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
21
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
22
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
23
|
-
|
|
24
18
|
function NumberInputSkeleton({
|
|
25
19
|
hideLabel,
|
|
26
20
|
className,
|
|
@@ -28,11 +22,11 @@ function NumberInputSkeleton({
|
|
|
28
22
|
...rest
|
|
29
23
|
}) {
|
|
30
24
|
const prefix = usePrefix.usePrefix();
|
|
31
|
-
return /*#__PURE__*/
|
|
32
|
-
className:
|
|
33
|
-
}, rest), !hideLabel && /*#__PURE__*/
|
|
25
|
+
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
|
26
|
+
className: cx(`${prefix}--form-item`, className)
|
|
27
|
+
}, rest), !hideLabel && /*#__PURE__*/React.createElement("span", {
|
|
34
28
|
className: `${prefix}--label ${prefix}--skeleton`
|
|
35
|
-
}), /*#__PURE__*/
|
|
29
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
36
30
|
className: `${prefix}--number ${prefix}--skeleton ${prefix}--number--${size}`
|
|
37
31
|
}));
|
|
38
32
|
}
|
|
@@ -40,15 +34,15 @@ NumberInputSkeleton.propTypes = {
|
|
|
40
34
|
/**
|
|
41
35
|
* Specify an optional className to add to the form item wrapper.
|
|
42
36
|
*/
|
|
43
|
-
className:
|
|
37
|
+
className: PropTypes.string,
|
|
44
38
|
/**
|
|
45
39
|
* Specify whether the label should be hidden, or not
|
|
46
40
|
*/
|
|
47
|
-
hideLabel:
|
|
41
|
+
hideLabel: PropTypes.bool,
|
|
48
42
|
/**
|
|
49
43
|
* Specify the size of the Number Input.
|
|
50
44
|
*/
|
|
51
|
-
size:
|
|
45
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg'])
|
|
52
46
|
};
|
|
53
47
|
|
|
54
|
-
exports
|
|
48
|
+
exports.default = NumberInputSkeleton;
|
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
-
|
|
12
10
|
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
13
11
|
var iconsReact = require('@carbon/icons-react');
|
|
14
12
|
var cx = require('classnames');
|
|
@@ -31,12 +29,6 @@ var index = require('../AILabel/index.js');
|
|
|
31
29
|
var utils = require('../../internal/utils.js');
|
|
32
30
|
var Text = require('../Text/Text.js');
|
|
33
31
|
|
|
34
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
35
|
-
|
|
36
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
37
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
38
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
39
|
-
|
|
40
32
|
var _Subtract, _Add;
|
|
41
33
|
const translationIds = {
|
|
42
34
|
'increment.number': 'increment.number',
|
|
@@ -51,7 +43,7 @@ const defaultTranslations = {
|
|
|
51
43
|
[translationIds['increment.number']]: 'Increment number',
|
|
52
44
|
[translationIds['decrement.number']]: 'Decrement number'
|
|
53
45
|
};
|
|
54
|
-
const NumberInput = /*#__PURE__*/
|
|
46
|
+
const NumberInput = /*#__PURE__*/React.forwardRef(function NumberInput(props, forwardRef) {
|
|
55
47
|
const {
|
|
56
48
|
allowEmpty = false,
|
|
57
49
|
className: customClassName,
|
|
@@ -134,7 +126,7 @@ const NumberInput = /*#__PURE__*/React__default["default"].forwardRef(function N
|
|
|
134
126
|
* Only used when type=text
|
|
135
127
|
* Updated as the user types and formatted on blur.
|
|
136
128
|
*/
|
|
137
|
-
const [inputValue, setInputValue] =
|
|
129
|
+
const [inputValue, setInputValue] = React.useState(() => isNaN(numberValue) ? '' : new utilities.NumberFormatter(locale, formatOptions).format(numberValue));
|
|
138
130
|
const numberingSystem = React.useMemo(() => numberParser.getNumberingSystem(inputValue), [numberParser, inputValue]);
|
|
139
131
|
const numberFormatter = React.useMemo(() => new utilities.NumberFormatter(locale, {
|
|
140
132
|
...formatOptions,
|
|
@@ -147,7 +139,7 @@ const NumberInput = /*#__PURE__*/React__default["default"].forwardRef(function N
|
|
|
147
139
|
}
|
|
148
140
|
const inputRef = React.useRef(null);
|
|
149
141
|
const ref = useMergedRefs.useMergedRefs([forwardRef, inputRef]);
|
|
150
|
-
const numberInputClasses =
|
|
142
|
+
const numberInputClasses = cx({
|
|
151
143
|
[`${prefix}--number`]: true,
|
|
152
144
|
[`${prefix}--number--helpertext`]: true,
|
|
153
145
|
[`${prefix}--number--readonly`]: readOnly,
|
|
@@ -173,12 +165,12 @@ const NumberInput = /*#__PURE__*/React__default["default"].forwardRef(function N
|
|
|
173
165
|
warnText
|
|
174
166
|
});
|
|
175
167
|
const [incrementNumLabel, decrementNumLabel] = [t('increment.number'), t('decrement.number')];
|
|
176
|
-
const wrapperClasses =
|
|
168
|
+
const wrapperClasses = cx(`${prefix}--number__input-wrapper`, {
|
|
177
169
|
[`${prefix}--number__input-wrapper--warning`]: normalizedProps.warn,
|
|
178
170
|
[`${prefix}--number__input-wrapper--slug`]: slug,
|
|
179
171
|
[`${prefix}--number__input-wrapper--decorator`]: decorator
|
|
180
172
|
});
|
|
181
|
-
const iconClasses =
|
|
173
|
+
const iconClasses = cx({
|
|
182
174
|
[`${prefix}--number__invalid`]: normalizedProps.invalid || normalizedProps.warn,
|
|
183
175
|
[`${prefix}--number__invalid--warning`]: normalizedProps.warn
|
|
184
176
|
});
|
|
@@ -230,7 +222,7 @@ const NumberInput = /*#__PURE__*/React__default["default"].forwardRef(function N
|
|
|
230
222
|
setIsFocused(evt.type === 'focus' ? true : false);
|
|
231
223
|
}
|
|
232
224
|
};
|
|
233
|
-
const outerElementClasses =
|
|
225
|
+
const outerElementClasses = cx(`${prefix}--form-item`, {
|
|
234
226
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
235
227
|
[customClassName]: !!customClassName,
|
|
236
228
|
[`${prefix}--number-input--fluid--invalid`]: isFluid && normalizedProps.invalid,
|
|
@@ -317,21 +309,21 @@ const NumberInput = /*#__PURE__*/React__default["default"].forwardRef(function N
|
|
|
317
309
|
setValue(defaultValue);
|
|
318
310
|
}
|
|
319
311
|
}, [defaultValue, isRevertActive, slug]);
|
|
320
|
-
return /*#__PURE__*/
|
|
312
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
321
313
|
className: outerElementClasses,
|
|
322
314
|
onFocus: isFluid ? handleFocus : undefined,
|
|
323
315
|
onBlur: isFluid ? handleFocus : undefined
|
|
324
|
-
}, /*#__PURE__*/
|
|
316
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
325
317
|
className: numberInputClasses,
|
|
326
318
|
"data-invalid": normalizedProps.invalid ? true : undefined
|
|
327
|
-
}, /*#__PURE__*/
|
|
319
|
+
}, /*#__PURE__*/React.createElement(Label, {
|
|
328
320
|
disabled: normalizedProps.disabled,
|
|
329
321
|
hideLabel: hideLabel,
|
|
330
322
|
id: id,
|
|
331
323
|
label: label
|
|
332
|
-
}), /*#__PURE__*/
|
|
324
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
333
325
|
className: wrapperClasses
|
|
334
|
-
}, /*#__PURE__*/
|
|
326
|
+
}, /*#__PURE__*/React.createElement("input", _rollupPluginBabelHelpers.extends({}, rest, {
|
|
335
327
|
"data-invalid": normalizedProps.invalid ? true : undefined,
|
|
336
328
|
"aria-invalid": normalizedProps.invalid,
|
|
337
329
|
"aria-describedby": ariaDescribedBy,
|
|
@@ -412,13 +404,13 @@ const NumberInput = /*#__PURE__*/React__default["default"].forwardRef(function N
|
|
|
412
404
|
step: step,
|
|
413
405
|
type: type,
|
|
414
406
|
value: type === 'number' ? value : inputValue
|
|
415
|
-
})), slug ? normalizedDecorator : decorator ? /*#__PURE__*/
|
|
407
|
+
})), slug ? normalizedDecorator : decorator ? /*#__PURE__*/React.createElement("div", {
|
|
416
408
|
className: `${prefix}--number__input-inner-wrapper--decorator`
|
|
417
|
-
}, normalizedDecorator) : '', Icon ? /*#__PURE__*/
|
|
409
|
+
}, normalizedDecorator) : '', Icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
418
410
|
className: iconClasses
|
|
419
|
-
}) : null, !hideSteppers && /*#__PURE__*/
|
|
411
|
+
}) : null, !hideSteppers && /*#__PURE__*/React.createElement("div", {
|
|
420
412
|
className: `${prefix}--number__controls`
|
|
421
|
-
}, /*#__PURE__*/
|
|
413
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
422
414
|
"aria-label": decrementNumLabel || iconDescription,
|
|
423
415
|
className: `${prefix}--number__control-btn down-icon`,
|
|
424
416
|
disabled: disabled || readOnly,
|
|
@@ -427,11 +419,11 @@ const NumberInput = /*#__PURE__*/React__default["default"].forwardRef(function N
|
|
|
427
419
|
tabIndex: -1,
|
|
428
420
|
title: decrementNumLabel || iconDescription,
|
|
429
421
|
type: "button"
|
|
430
|
-
}, _Subtract || (_Subtract = /*#__PURE__*/
|
|
422
|
+
}, _Subtract || (_Subtract = /*#__PURE__*/React.createElement(iconsReact.Subtract, {
|
|
431
423
|
className: "down-icon"
|
|
432
|
-
}))), /*#__PURE__*/
|
|
424
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
433
425
|
className: `${prefix}--number__rule-divider`
|
|
434
|
-
}), /*#__PURE__*/
|
|
426
|
+
}), /*#__PURE__*/React.createElement("button", {
|
|
435
427
|
"aria-label": incrementNumLabel || iconDescription,
|
|
436
428
|
className: `${prefix}--number__control-btn up-icon`,
|
|
437
429
|
disabled: disabled || readOnly,
|
|
@@ -440,13 +432,13 @@ const NumberInput = /*#__PURE__*/React__default["default"].forwardRef(function N
|
|
|
440
432
|
tabIndex: -1,
|
|
441
433
|
title: incrementNumLabel || iconDescription,
|
|
442
434
|
type: "button"
|
|
443
|
-
}, _Add || (_Add = /*#__PURE__*/
|
|
435
|
+
}, _Add || (_Add = /*#__PURE__*/React.createElement(iconsReact.Add, {
|
|
444
436
|
className: "up-icon"
|
|
445
|
-
}))), /*#__PURE__*/
|
|
437
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
446
438
|
className: `${prefix}--number__rule-divider`
|
|
447
|
-
}))), isFluid && /*#__PURE__*/
|
|
439
|
+
}))), isFluid && /*#__PURE__*/React.createElement("hr", {
|
|
448
440
|
className: `${prefix}--number-input__divider`
|
|
449
|
-
}), normalizedProps.validation ? normalizedProps.validation : /*#__PURE__*/
|
|
441
|
+
}), normalizedProps.validation ? normalizedProps.validation : /*#__PURE__*/React.createElement(HelperText, {
|
|
450
442
|
id: normalizedProps.helperId,
|
|
451
443
|
disabled: disabled,
|
|
452
444
|
description: helperText
|
|
@@ -456,27 +448,27 @@ NumberInput.propTypes = {
|
|
|
456
448
|
/**
|
|
457
449
|
* `true` to allow empty string.
|
|
458
450
|
*/
|
|
459
|
-
allowEmpty:
|
|
451
|
+
allowEmpty: PropTypes.bool,
|
|
460
452
|
/**
|
|
461
453
|
* Specify an optional className to be applied to the wrapper node
|
|
462
454
|
*/
|
|
463
|
-
className:
|
|
455
|
+
className: PropTypes.string,
|
|
464
456
|
/**
|
|
465
457
|
* **Experimental**: Provide a `decorator` component to be rendered inside the `NumberInput` component
|
|
466
458
|
*/
|
|
467
|
-
decorator:
|
|
459
|
+
decorator: PropTypes.node,
|
|
468
460
|
/**
|
|
469
461
|
* Optional starting value for uncontrolled state
|
|
470
462
|
*/
|
|
471
|
-
defaultValue:
|
|
463
|
+
defaultValue: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
472
464
|
/**
|
|
473
465
|
* Specify if the wheel functionality for the input should be disabled, or no t
|
|
474
466
|
*/
|
|
475
|
-
disableWheel:
|
|
467
|
+
disableWheel: PropTypes.bool,
|
|
476
468
|
/**
|
|
477
469
|
* Specify if the control should be disabled, or not
|
|
478
470
|
*/
|
|
479
|
-
disabled:
|
|
471
|
+
disabled: PropTypes.bool,
|
|
480
472
|
/**
|
|
481
473
|
* **Experimental:** Specify Intl.NumberFormat options applied to internal
|
|
482
474
|
* number parsing and formatting. Use with `type="text"`, has no effect when
|
|
@@ -487,66 +479,66 @@ NumberInput.propTypes = {
|
|
|
487
479
|
/**
|
|
488
480
|
* Provide text that is used alongside the control label for additional help
|
|
489
481
|
*/
|
|
490
|
-
helperText:
|
|
482
|
+
helperText: PropTypes.node,
|
|
491
483
|
/**
|
|
492
484
|
* Specify whether you want the underlying label to be visually hidden
|
|
493
485
|
*/
|
|
494
|
-
hideLabel:
|
|
486
|
+
hideLabel: PropTypes.bool,
|
|
495
487
|
/**
|
|
496
488
|
* Specify whether you want the steppers to be hidden
|
|
497
489
|
*/
|
|
498
|
-
hideSteppers:
|
|
490
|
+
hideSteppers: PropTypes.bool,
|
|
499
491
|
/**
|
|
500
492
|
* Provide a description for up/down icons that can be read by screen readers
|
|
501
493
|
*/
|
|
502
|
-
iconDescription:
|
|
494
|
+
iconDescription: PropTypes.string,
|
|
503
495
|
/**
|
|
504
496
|
* Specify a custom `id` for the input
|
|
505
497
|
*/
|
|
506
|
-
id:
|
|
498
|
+
id: PropTypes.string.isRequired,
|
|
507
499
|
/**
|
|
508
500
|
* Instruct the browser which keyboard to display on mobile devices. Defaults
|
|
509
501
|
* to `decimal`, but note that standard numeric keyboards vary across devices
|
|
510
502
|
* and operating systems.
|
|
511
503
|
* @see https://css-tricks.com/everything-you-ever-wanted-to-know-about-inputmode/
|
|
512
504
|
*/
|
|
513
|
-
inputMode:
|
|
505
|
+
inputMode: PropTypes.oneOf(['none', 'text', 'tel', 'url', 'email', 'numeric', 'decimal', 'search']),
|
|
514
506
|
/**
|
|
515
507
|
* Specify if the currently value is invalid.
|
|
516
508
|
*/
|
|
517
|
-
invalid:
|
|
509
|
+
invalid: PropTypes.bool,
|
|
518
510
|
/**
|
|
519
511
|
* Message which is displayed if the value is invalid.
|
|
520
512
|
*/
|
|
521
|
-
invalidText:
|
|
513
|
+
invalidText: PropTypes.node,
|
|
522
514
|
/**
|
|
523
515
|
* Generic `label` that will be used as the textual representation of what
|
|
524
516
|
* this field is for
|
|
525
517
|
*/
|
|
526
|
-
label:
|
|
518
|
+
label: PropTypes.node,
|
|
527
519
|
/**
|
|
528
520
|
* `true` to use the light version.
|
|
529
521
|
*/
|
|
530
|
-
light: deprecate.deprecate(
|
|
522
|
+
light: deprecate.deprecate(PropTypes.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.'),
|
|
531
523
|
/**
|
|
532
524
|
* **Experimental:** Specify a [BCP47](https://www.ietf.org/rfc/bcp/bcp47.txt)
|
|
533
525
|
* language code for parsing and formatting. Use with `type="text"`, has no
|
|
534
526
|
* effect when `type="number"`.
|
|
535
527
|
*/
|
|
536
|
-
locale:
|
|
528
|
+
locale: PropTypes.string,
|
|
537
529
|
/**
|
|
538
530
|
* The maximum value.
|
|
539
531
|
*/
|
|
540
|
-
max:
|
|
532
|
+
max: PropTypes.number,
|
|
541
533
|
/**
|
|
542
534
|
* The minimum value.
|
|
543
535
|
*/
|
|
544
|
-
min:
|
|
536
|
+
min: PropTypes.number,
|
|
545
537
|
/**
|
|
546
538
|
* Provide an optional handler that is called when the input or stepper
|
|
547
539
|
* buttons are blurred.
|
|
548
540
|
*/
|
|
549
|
-
onBlur:
|
|
541
|
+
onBlur: PropTypes.func,
|
|
550
542
|
/**
|
|
551
543
|
* Provide an optional handler that is called when the internal state of
|
|
552
544
|
* NumberInput changes. This handler is called with event and state info.
|
|
@@ -555,60 +547,60 @@ NumberInput.propTypes = {
|
|
|
555
547
|
* parsed and formatted.
|
|
556
548
|
* `(event, { value, direction }) => void`
|
|
557
549
|
*/
|
|
558
|
-
onChange:
|
|
550
|
+
onChange: PropTypes.func,
|
|
559
551
|
/**
|
|
560
552
|
* Provide an optional function to be called when the up/down button is clicked
|
|
561
553
|
*/
|
|
562
|
-
onClick:
|
|
554
|
+
onClick: PropTypes.func,
|
|
563
555
|
/**
|
|
564
556
|
* Provide an optional function to be called when a key is pressed in the number input
|
|
565
557
|
*/
|
|
566
|
-
onKeyUp:
|
|
558
|
+
onKeyUp: PropTypes.func,
|
|
567
559
|
/**
|
|
568
560
|
* When type="text", provide an optional pattern to restrict user input. Has
|
|
569
561
|
* no effect when type="number".
|
|
570
562
|
*/
|
|
571
|
-
pattern:
|
|
563
|
+
pattern: PropTypes.string,
|
|
572
564
|
/**
|
|
573
565
|
* Specify if the component should be read-only
|
|
574
566
|
*/
|
|
575
|
-
readOnly:
|
|
567
|
+
readOnly: PropTypes.bool,
|
|
576
568
|
/**
|
|
577
569
|
* Specify the size of the Number Input.
|
|
578
570
|
*/
|
|
579
|
-
size:
|
|
571
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
580
572
|
/**
|
|
581
573
|
* **Experimental**: Provide a `Slug` component to be rendered inside the
|
|
582
574
|
* `NumberInput` component
|
|
583
575
|
*/
|
|
584
|
-
slug: deprecate.deprecate(
|
|
576
|
+
slug: deprecate.deprecate(PropTypes.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.'),
|
|
585
577
|
/**
|
|
586
578
|
* Specify how much the values should increase/decrease upon clicking on
|
|
587
579
|
* up/down button
|
|
588
580
|
*/
|
|
589
|
-
step:
|
|
581
|
+
step: PropTypes.number,
|
|
590
582
|
/**
|
|
591
583
|
* Provide custom text for the component for each translation id
|
|
592
584
|
*/
|
|
593
|
-
translateWithId:
|
|
585
|
+
translateWithId: PropTypes.func,
|
|
594
586
|
/**
|
|
595
587
|
* **Experimental**: Specify if the input should be of type text or number.
|
|
596
588
|
* Use type="text" with `locale`, `formatOptions`, and guide user input with
|
|
597
589
|
* `pattern` and `inputMode`.
|
|
598
590
|
*/
|
|
599
|
-
type:
|
|
591
|
+
type: PropTypes.oneOf(['number', 'text']),
|
|
600
592
|
/**
|
|
601
593
|
* Specify the value of the input
|
|
602
594
|
*/
|
|
603
|
-
value:
|
|
595
|
+
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
604
596
|
/**
|
|
605
597
|
* Specify whether the control is currently in warning state
|
|
606
598
|
*/
|
|
607
|
-
warn:
|
|
599
|
+
warn: PropTypes.bool,
|
|
608
600
|
/**
|
|
609
601
|
* Provide the text that is displayed when the control is in warning state
|
|
610
602
|
*/
|
|
611
|
-
warnText:
|
|
603
|
+
warnText: PropTypes.node
|
|
612
604
|
};
|
|
613
605
|
const Label = ({
|
|
614
606
|
disabled,
|
|
@@ -617,13 +609,13 @@ const Label = ({
|
|
|
617
609
|
label
|
|
618
610
|
}) => {
|
|
619
611
|
const prefix = usePrefix.usePrefix();
|
|
620
|
-
const className =
|
|
612
|
+
const className = cx({
|
|
621
613
|
[`${prefix}--label`]: true,
|
|
622
614
|
[`${prefix}--label--disabled`]: disabled,
|
|
623
615
|
[`${prefix}--visually-hidden`]: hideLabel
|
|
624
616
|
});
|
|
625
617
|
if (label) {
|
|
626
|
-
return /*#__PURE__*/
|
|
618
|
+
return /*#__PURE__*/React.createElement(Text.Text, {
|
|
627
619
|
as: "label",
|
|
628
620
|
htmlFor: id,
|
|
629
621
|
className: className
|
|
@@ -632,10 +624,10 @@ const Label = ({
|
|
|
632
624
|
return null;
|
|
633
625
|
};
|
|
634
626
|
Label.propTypes = {
|
|
635
|
-
disabled:
|
|
636
|
-
hideLabel:
|
|
637
|
-
id:
|
|
638
|
-
label:
|
|
627
|
+
disabled: PropTypes.bool,
|
|
628
|
+
hideLabel: PropTypes.bool,
|
|
629
|
+
id: PropTypes.string,
|
|
630
|
+
label: PropTypes.node
|
|
639
631
|
};
|
|
640
632
|
function HelperText({
|
|
641
633
|
disabled,
|
|
@@ -643,11 +635,11 @@ function HelperText({
|
|
|
643
635
|
id
|
|
644
636
|
}) {
|
|
645
637
|
const prefix = usePrefix.usePrefix();
|
|
646
|
-
const className =
|
|
638
|
+
const className = cx(`${prefix}--form__helper-text`, {
|
|
647
639
|
[`${prefix}--form__helper-text--disabled`]: disabled
|
|
648
640
|
});
|
|
649
641
|
if (description) {
|
|
650
|
-
return /*#__PURE__*/
|
|
642
|
+
return /*#__PURE__*/React.createElement(Text.Text, {
|
|
651
643
|
as: "div",
|
|
652
644
|
id: id,
|
|
653
645
|
className: className
|
|
@@ -656,9 +648,9 @@ function HelperText({
|
|
|
656
648
|
return null;
|
|
657
649
|
}
|
|
658
650
|
HelperText.propTypes = {
|
|
659
|
-
description:
|
|
660
|
-
disabled:
|
|
661
|
-
id:
|
|
651
|
+
description: PropTypes.node,
|
|
652
|
+
disabled: PropTypes.bool,
|
|
653
|
+
id: PropTypes.string
|
|
662
654
|
};
|
|
663
655
|
|
|
664
656
|
/**
|
|
@@ -15,12 +15,6 @@ var React = require('react');
|
|
|
15
15
|
var cx = require('classnames');
|
|
16
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
17
|
|
|
18
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
-
|
|
20
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
21
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
22
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
23
|
-
|
|
24
18
|
function OrderedList({
|
|
25
19
|
className,
|
|
26
20
|
nested = false,
|
|
@@ -29,13 +23,13 @@ function OrderedList({
|
|
|
29
23
|
...other
|
|
30
24
|
}) {
|
|
31
25
|
const prefix = usePrefix.usePrefix();
|
|
32
|
-
const classNames =
|
|
26
|
+
const classNames = cx({
|
|
33
27
|
[`${prefix}--list--ordered`]: !native,
|
|
34
28
|
[`${prefix}--list--ordered--native`]: native,
|
|
35
29
|
[`${prefix}--list--nested`]: nested,
|
|
36
30
|
[`${prefix}--list--expressive`]: isExpressive
|
|
37
31
|
}, className);
|
|
38
|
-
return /*#__PURE__*/
|
|
32
|
+
return /*#__PURE__*/React.createElement("ol", _rollupPluginBabelHelpers.extends({
|
|
39
33
|
className: classNames
|
|
40
34
|
}, other));
|
|
41
35
|
}
|
|
@@ -43,23 +37,23 @@ OrderedList.propTypes = {
|
|
|
43
37
|
/**
|
|
44
38
|
* Provide list items to be rendered in the ordered list
|
|
45
39
|
*/
|
|
46
|
-
children:
|
|
40
|
+
children: PropTypes.node,
|
|
47
41
|
/**
|
|
48
42
|
* Provide an optional className to be applied to the containing <ol> node
|
|
49
43
|
*/
|
|
50
|
-
className:
|
|
44
|
+
className: PropTypes.string,
|
|
51
45
|
/**
|
|
52
46
|
* Specify whether this ordered list expressive or not
|
|
53
47
|
*/
|
|
54
|
-
isExpressive:
|
|
48
|
+
isExpressive: PropTypes.bool,
|
|
55
49
|
/**
|
|
56
50
|
* Specify whether this ordered list should use native list styles instead of custom counter
|
|
57
51
|
*/
|
|
58
|
-
native:
|
|
52
|
+
native: PropTypes.bool,
|
|
59
53
|
/**
|
|
60
54
|
* Specify whether this ordered list is nested inside of another nested list
|
|
61
55
|
*/
|
|
62
|
-
nested:
|
|
56
|
+
nested: PropTypes.bool
|
|
63
57
|
};
|
|
64
58
|
|
|
65
|
-
exports
|
|
59
|
+
exports.default = OrderedList;
|