@carbon/react 1.87.0-rc.0 → 1.87.1-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 +739 -739
- 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
|
@@ -18,12 +18,6 @@ var useId = require('../../internal/useId.js');
|
|
|
18
18
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
19
19
|
var useIsomorphicEffect = require('../../internal/useIsomorphicEffect.js');
|
|
20
20
|
|
|
21
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
22
|
-
|
|
23
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
24
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
25
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
26
|
-
|
|
27
21
|
function ProgressBar({
|
|
28
22
|
className,
|
|
29
23
|
helperText,
|
|
@@ -55,32 +49,32 @@ function ProgressBar({
|
|
|
55
49
|
cappedValue = max;
|
|
56
50
|
}
|
|
57
51
|
const percentage = (cappedValue ?? NaN) / max;
|
|
58
|
-
const wrapperClasses =
|
|
52
|
+
const wrapperClasses = cx(`${prefix}--progress-bar`, `${prefix}--progress-bar--${size}`, `${prefix}--progress-bar--${type}`, {
|
|
59
53
|
[`${prefix}--progress-bar--indeterminate`]: indeterminate,
|
|
60
54
|
[`${prefix}--progress-bar--finished`]: isFinished,
|
|
61
55
|
[`${prefix}--progress-bar--error`]: isError
|
|
62
56
|
}, className);
|
|
63
|
-
const labelClasses =
|
|
57
|
+
const labelClasses = cx(`${prefix}--progress-bar__label`, {
|
|
64
58
|
[`${prefix}--visually-hidden`]: hideLabel
|
|
65
59
|
});
|
|
66
60
|
let StatusIcon = null;
|
|
67
61
|
if (isError) {
|
|
68
|
-
StatusIcon = /*#__PURE__*/
|
|
69
|
-
return /*#__PURE__*/
|
|
62
|
+
StatusIcon = /*#__PURE__*/React.forwardRef(function ErrorFilled16(props, ref) {
|
|
63
|
+
return /*#__PURE__*/React.createElement(iconsReact.ErrorFilled, _rollupPluginBabelHelpers.extends({
|
|
70
64
|
ref: ref,
|
|
71
65
|
size: 16
|
|
72
66
|
}, props));
|
|
73
67
|
});
|
|
74
68
|
} else if (isFinished) {
|
|
75
|
-
StatusIcon = /*#__PURE__*/
|
|
76
|
-
return /*#__PURE__*/
|
|
69
|
+
StatusIcon = /*#__PURE__*/React.forwardRef(function CheckmarkFilled16(props, ref) {
|
|
70
|
+
return /*#__PURE__*/React.createElement(iconsReact.CheckmarkFilled, _rollupPluginBabelHelpers.extends({
|
|
77
71
|
ref: ref,
|
|
78
72
|
size: 16
|
|
79
73
|
}, props));
|
|
80
74
|
});
|
|
81
75
|
}
|
|
82
76
|
const ref = React.useRef(null);
|
|
83
|
-
useIsomorphicEffect
|
|
77
|
+
useIsomorphicEffect.default(() => {
|
|
84
78
|
if (ref.current) {
|
|
85
79
|
if (!isFinished && !isError) {
|
|
86
80
|
ref.current.style.transform = `scaleX(${percentage})`;
|
|
@@ -89,16 +83,16 @@ function ProgressBar({
|
|
|
89
83
|
}
|
|
90
84
|
}
|
|
91
85
|
}, [percentage, isFinished, isError]);
|
|
92
|
-
return /*#__PURE__*/
|
|
86
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
93
87
|
className: wrapperClasses
|
|
94
|
-
}, /*#__PURE__*/
|
|
88
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
95
89
|
className: labelClasses,
|
|
96
90
|
id: labelId
|
|
97
|
-
}, /*#__PURE__*/
|
|
91
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
98
92
|
className: `${prefix}--progress-bar__label-text`
|
|
99
|
-
}, label), StatusIcon && /*#__PURE__*/
|
|
93
|
+
}, label), StatusIcon && /*#__PURE__*/React.createElement(StatusIcon, {
|
|
100
94
|
className: `${prefix}--progress-bar__status-icon`
|
|
101
|
-
})), /*#__PURE__*/
|
|
95
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
102
96
|
className: `${prefix}--progress-bar__track`,
|
|
103
97
|
role: "progressbar",
|
|
104
98
|
"aria-busy": !isFinished,
|
|
@@ -108,13 +102,13 @@ function ProgressBar({
|
|
|
108
102
|
"aria-valuemin": !indeterminate ? 0 : undefined,
|
|
109
103
|
"aria-valuemax": !indeterminate ? max : undefined,
|
|
110
104
|
"aria-valuenow": !indeterminate ? cappedValue : undefined
|
|
111
|
-
}, /*#__PURE__*/
|
|
105
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
112
106
|
className: `${prefix}--progress-bar__bar`,
|
|
113
107
|
ref: ref
|
|
114
|
-
})), helperText && /*#__PURE__*/
|
|
108
|
+
})), helperText && /*#__PURE__*/React.createElement("div", {
|
|
115
109
|
id: helperTextId,
|
|
116
110
|
className: `${prefix}--progress-bar__helper-text`
|
|
117
|
-
}, helperText, /*#__PURE__*/
|
|
111
|
+
}, helperText, /*#__PURE__*/React.createElement("div", {
|
|
118
112
|
className: `${prefix}--visually-hidden`,
|
|
119
113
|
"aria-live": "polite",
|
|
120
114
|
id: helperId
|
|
@@ -124,39 +118,39 @@ ProgressBar.propTypes = {
|
|
|
124
118
|
/**
|
|
125
119
|
* Additional CSS class names.
|
|
126
120
|
*/
|
|
127
|
-
className:
|
|
121
|
+
className: PropTypes.string,
|
|
128
122
|
/**
|
|
129
123
|
* The current progress as a textual representation.
|
|
130
124
|
*/
|
|
131
|
-
helperText:
|
|
125
|
+
helperText: PropTypes.string,
|
|
132
126
|
/**
|
|
133
127
|
* Whether the label should be visually hidden.
|
|
134
128
|
*/
|
|
135
|
-
hideLabel:
|
|
129
|
+
hideLabel: PropTypes.bool,
|
|
136
130
|
/**
|
|
137
131
|
* A label describing the progress bar.
|
|
138
132
|
*/
|
|
139
|
-
label:
|
|
133
|
+
label: PropTypes.string.isRequired,
|
|
140
134
|
/**
|
|
141
135
|
* The maximum value.
|
|
142
136
|
*/
|
|
143
|
-
max:
|
|
137
|
+
max: PropTypes.number,
|
|
144
138
|
/**
|
|
145
139
|
* Specify the size of the ProgressBar.
|
|
146
140
|
*/
|
|
147
|
-
size:
|
|
141
|
+
size: PropTypes.oneOf(['small', 'big']),
|
|
148
142
|
/**
|
|
149
143
|
* Specify the status.
|
|
150
144
|
*/
|
|
151
|
-
status:
|
|
145
|
+
status: PropTypes.oneOf(['active', 'finished', 'error']),
|
|
152
146
|
/**
|
|
153
147
|
* Defines the alignment variant of the progress bar.
|
|
154
148
|
*/
|
|
155
|
-
type:
|
|
149
|
+
type: PropTypes.oneOf(['default', 'inline', 'indented']),
|
|
156
150
|
/**
|
|
157
151
|
* The current value.
|
|
158
152
|
*/
|
|
159
|
-
value:
|
|
153
|
+
value: PropTypes.number
|
|
160
154
|
};
|
|
161
155
|
|
|
162
|
-
exports
|
|
156
|
+
exports.default = ProgressBar;
|
|
@@ -16,22 +16,16 @@ var cx = require('classnames');
|
|
|
16
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
17
|
var iconsReact = require('@carbon/icons-react');
|
|
18
18
|
|
|
19
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
|
-
|
|
21
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
22
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
24
|
-
|
|
25
19
|
var _CircleDash, _Step, _Step2, _Step3, _Step4;
|
|
26
20
|
function Step() {
|
|
27
21
|
const prefix = usePrefix.usePrefix();
|
|
28
|
-
return /*#__PURE__*/
|
|
22
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
29
23
|
className: `${prefix}--progress-step ${prefix}--progress-step--incomplete`
|
|
30
|
-
}, /*#__PURE__*/
|
|
24
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
31
25
|
className: `${prefix}--progress-step-button ${prefix}--progress-step-button--unclickable`
|
|
32
|
-
}, _CircleDash || (_CircleDash = /*#__PURE__*/
|
|
26
|
+
}, _CircleDash || (_CircleDash = /*#__PURE__*/React.createElement(iconsReact.CircleDash, null)), /*#__PURE__*/React.createElement("p", {
|
|
33
27
|
className: `${prefix}--progress-label`
|
|
34
|
-
}), /*#__PURE__*/
|
|
28
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
35
29
|
className: `${prefix}--progress-line`
|
|
36
30
|
})));
|
|
37
31
|
}
|
|
@@ -41,22 +35,22 @@ function ProgressIndicatorSkeleton({
|
|
|
41
35
|
...rest
|
|
42
36
|
}) {
|
|
43
37
|
const prefix = usePrefix.usePrefix();
|
|
44
|
-
return /*#__PURE__*/
|
|
45
|
-
className:
|
|
38
|
+
return /*#__PURE__*/React.createElement("ul", _rollupPluginBabelHelpers.extends({
|
|
39
|
+
className: cx(`${prefix}--progress`, `${prefix}--skeleton`, {
|
|
46
40
|
[`${prefix}--progress--vertical`]: vertical
|
|
47
41
|
}, className)
|
|
48
|
-
}, rest), _Step || (_Step = /*#__PURE__*/
|
|
42
|
+
}, rest), _Step || (_Step = /*#__PURE__*/React.createElement(Step, null)), _Step2 || (_Step2 = /*#__PURE__*/React.createElement(Step, null)), _Step3 || (_Step3 = /*#__PURE__*/React.createElement(Step, null)), _Step4 || (_Step4 = /*#__PURE__*/React.createElement(Step, null)));
|
|
49
43
|
}
|
|
50
44
|
ProgressIndicatorSkeleton.propTypes = {
|
|
51
45
|
/**
|
|
52
46
|
* Specify an optional className to add.
|
|
53
47
|
*/
|
|
54
|
-
className:
|
|
48
|
+
className: PropTypes.string,
|
|
55
49
|
/**
|
|
56
50
|
* Determines whether or not the ProgressIndicator should be rendered vertically.
|
|
57
51
|
*/
|
|
58
|
-
vertical:
|
|
52
|
+
vertical: PropTypes.bool
|
|
59
53
|
};
|
|
60
54
|
|
|
61
55
|
exports.ProgressIndicatorSkeleton = ProgressIndicatorSkeleton;
|
|
62
|
-
exports
|
|
56
|
+
exports.default = ProgressIndicatorSkeleton;
|
|
@@ -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 cx = require('classnames');
|
|
14
12
|
var PropTypes = require('prop-types');
|
|
@@ -20,12 +18,6 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
20
18
|
require('../Text/index.js');
|
|
21
19
|
var Text = require('../Text/Text.js');
|
|
22
20
|
|
|
23
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
24
|
-
|
|
25
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
26
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
27
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
28
|
-
|
|
29
21
|
const defaultTranslations = {
|
|
30
22
|
'carbon.progress-step.complete': 'Complete',
|
|
31
23
|
'carbon.progress-step.incomplete': 'Incomplete',
|
|
@@ -52,7 +44,7 @@ function ProgressIndicator({
|
|
|
52
44
|
const prefix = usePrefix.usePrefix();
|
|
53
45
|
const [currentIndex, setCurrentIndex] = React.useState(controlledIndex);
|
|
54
46
|
const [prevControlledIndex, setPrevControlledIndex] = React.useState(controlledIndex);
|
|
55
|
-
const className =
|
|
47
|
+
const className = cx({
|
|
56
48
|
[`${prefix}--progress`]: true,
|
|
57
49
|
[`${prefix}--progress--vertical`]: vertical,
|
|
58
50
|
[`${prefix}--progress--space-equal`]: spaceEqually && !vertical,
|
|
@@ -62,17 +54,17 @@ function ProgressIndicator({
|
|
|
62
54
|
setCurrentIndex(controlledIndex);
|
|
63
55
|
setPrevControlledIndex(controlledIndex);
|
|
64
56
|
}
|
|
65
|
-
return /*#__PURE__*/
|
|
57
|
+
return /*#__PURE__*/React.createElement("ul", _rollupPluginBabelHelpers.extends({
|
|
66
58
|
className: className
|
|
67
|
-
}, rest),
|
|
68
|
-
if (! /*#__PURE__*/
|
|
59
|
+
}, rest), React.Children.map(children, (child, index) => {
|
|
60
|
+
if (! /*#__PURE__*/React.isValidElement(child)) {
|
|
69
61
|
return null;
|
|
70
62
|
}
|
|
71
63
|
|
|
72
64
|
// only setup click handlers if onChange event is passed
|
|
73
65
|
const onClick = onChange ? () => onChange(index) : undefined;
|
|
74
66
|
if (index === currentIndex) {
|
|
75
|
-
return /*#__PURE__*/
|
|
67
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
76
68
|
complete: child.props.complete,
|
|
77
69
|
current: child.props.complete ? false : true,
|
|
78
70
|
index,
|
|
@@ -80,14 +72,14 @@ function ProgressIndicator({
|
|
|
80
72
|
});
|
|
81
73
|
}
|
|
82
74
|
if (index < currentIndex) {
|
|
83
|
-
return /*#__PURE__*/
|
|
75
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
84
76
|
complete: true,
|
|
85
77
|
index,
|
|
86
78
|
onClick
|
|
87
79
|
});
|
|
88
80
|
}
|
|
89
81
|
if (index > currentIndex) {
|
|
90
|
-
return /*#__PURE__*/
|
|
82
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
91
83
|
complete: child.props.complete || false,
|
|
92
84
|
index,
|
|
93
85
|
onClick
|
|
@@ -101,27 +93,27 @@ ProgressIndicator.propTypes = {
|
|
|
101
93
|
* Provide `<ProgressStep>` components to be rendered in the
|
|
102
94
|
* `<ProgressIndicator>`
|
|
103
95
|
*/
|
|
104
|
-
children:
|
|
96
|
+
children: PropTypes.node,
|
|
105
97
|
/**
|
|
106
98
|
* Provide an optional className to be applied to the containing node
|
|
107
99
|
*/
|
|
108
|
-
className:
|
|
100
|
+
className: PropTypes.string,
|
|
109
101
|
/**
|
|
110
102
|
* Optionally specify the current step array index
|
|
111
103
|
*/
|
|
112
|
-
currentIndex:
|
|
104
|
+
currentIndex: PropTypes.number,
|
|
113
105
|
/**
|
|
114
106
|
* Optional callback called if a ProgressStep is clicked on. Returns the index of the step.
|
|
115
107
|
*/
|
|
116
|
-
onChange:
|
|
108
|
+
onChange: PropTypes.func,
|
|
117
109
|
/**
|
|
118
110
|
* Specify whether the progress steps should be split equally in size in the div
|
|
119
111
|
*/
|
|
120
|
-
spaceEqually:
|
|
112
|
+
spaceEqually: PropTypes.bool,
|
|
121
113
|
/**
|
|
122
114
|
* Determines whether or not the ProgressIndicator should be rendered vertically.
|
|
123
115
|
*/
|
|
124
|
-
vertical:
|
|
116
|
+
vertical: PropTypes.bool
|
|
125
117
|
};
|
|
126
118
|
function ProgressStep({
|
|
127
119
|
label,
|
|
@@ -137,7 +129,7 @@ function ProgressStep({
|
|
|
137
129
|
...rest
|
|
138
130
|
}) {
|
|
139
131
|
const prefix = usePrefix.usePrefix();
|
|
140
|
-
const classes =
|
|
132
|
+
const classes = cx({
|
|
141
133
|
[`${prefix}--progress-step`]: true,
|
|
142
134
|
[`${prefix}--progress-step--current`]: current,
|
|
143
135
|
[`${prefix}--progress-step--complete`]: complete,
|
|
@@ -158,17 +150,17 @@ function ProgressStep({
|
|
|
158
150
|
prefix
|
|
159
151
|
}) => {
|
|
160
152
|
if (invalid) {
|
|
161
|
-
return /*#__PURE__*/
|
|
153
|
+
return /*#__PURE__*/React.createElement(iconsReact.Warning, {
|
|
162
154
|
className: `${prefix}--progress__warning`
|
|
163
|
-
}, /*#__PURE__*/
|
|
155
|
+
}, /*#__PURE__*/React.createElement("title", null, description));
|
|
164
156
|
}
|
|
165
157
|
if (current) {
|
|
166
|
-
return /*#__PURE__*/
|
|
158
|
+
return /*#__PURE__*/React.createElement(iconsReact.Incomplete, null, /*#__PURE__*/React.createElement("title", null, description));
|
|
167
159
|
}
|
|
168
160
|
if (complete) {
|
|
169
|
-
return /*#__PURE__*/
|
|
161
|
+
return /*#__PURE__*/React.createElement(iconsReact.CheckmarkOutline, null, /*#__PURE__*/React.createElement("title", null, description));
|
|
170
162
|
}
|
|
171
|
-
return /*#__PURE__*/
|
|
163
|
+
return /*#__PURE__*/React.createElement(iconsReact.CircleDash, null, /*#__PURE__*/React.createElement("title", null, description));
|
|
172
164
|
};
|
|
173
165
|
let message = t('carbon.progress-step.incomplete');
|
|
174
166
|
if (current) {
|
|
@@ -180,11 +172,11 @@ function ProgressStep({
|
|
|
180
172
|
if (invalid) {
|
|
181
173
|
message = t('carbon.progress-step.invalid');
|
|
182
174
|
}
|
|
183
|
-
return /*#__PURE__*/
|
|
175
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
184
176
|
className: classes
|
|
185
|
-
}, /*#__PURE__*/
|
|
177
|
+
}, /*#__PURE__*/React.createElement("button", _rollupPluginBabelHelpers.extends({
|
|
186
178
|
type: "button",
|
|
187
|
-
className:
|
|
179
|
+
className: cx(`${prefix}--progress-step-button`, {
|
|
188
180
|
[`${prefix}--progress-step-button--unclickable`]: !onClick || current
|
|
189
181
|
}),
|
|
190
182
|
disabled: disabled,
|
|
@@ -193,23 +185,23 @@ function ProgressStep({
|
|
|
193
185
|
onClick: !current ? onClick : undefined,
|
|
194
186
|
onKeyDown: handleKeyDown,
|
|
195
187
|
title: label
|
|
196
|
-
}, rest), /*#__PURE__*/
|
|
188
|
+
}, rest), /*#__PURE__*/React.createElement(SVGIcon, {
|
|
197
189
|
complete: complete,
|
|
198
190
|
current: current,
|
|
199
191
|
description: description,
|
|
200
192
|
invalid: invalid,
|
|
201
193
|
prefix: prefix
|
|
202
|
-
}), /*#__PURE__*/
|
|
194
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
203
195
|
className: `${prefix}--progress-text`
|
|
204
|
-
}, /*#__PURE__*/
|
|
196
|
+
}, /*#__PURE__*/React.createElement(Text.Text, {
|
|
205
197
|
as: "p",
|
|
206
198
|
className: `${prefix}--progress-label`
|
|
207
|
-
}, label), secondaryLabel !== null && secondaryLabel !== undefined ? /*#__PURE__*/
|
|
199
|
+
}, label), secondaryLabel !== null && secondaryLabel !== undefined ? /*#__PURE__*/React.createElement(Text.Text, {
|
|
208
200
|
as: "p",
|
|
209
201
|
className: `${prefix}--progress-optional`
|
|
210
|
-
}, secondaryLabel) : null), /*#__PURE__*/
|
|
202
|
+
}, secondaryLabel) : null), /*#__PURE__*/React.createElement("span", {
|
|
211
203
|
className: `${prefix}--assistive-text`
|
|
212
|
-
}, message), /*#__PURE__*/
|
|
204
|
+
}, message), /*#__PURE__*/React.createElement("span", {
|
|
213
205
|
className: `${prefix}--progress-line`
|
|
214
206
|
})));
|
|
215
207
|
}
|
|
@@ -217,56 +209,56 @@ ProgressStep.propTypes = {
|
|
|
217
209
|
/**
|
|
218
210
|
* Provide an optional className to be applied to the containing `<li>` node
|
|
219
211
|
*/
|
|
220
|
-
className:
|
|
212
|
+
className: PropTypes.string,
|
|
221
213
|
/**
|
|
222
214
|
* Specify whether the step has been completed
|
|
223
215
|
*/
|
|
224
|
-
complete:
|
|
216
|
+
complete: PropTypes.bool,
|
|
225
217
|
/**
|
|
226
218
|
* Specify whether the step is the current step
|
|
227
219
|
*/
|
|
228
|
-
current:
|
|
220
|
+
current: PropTypes.bool,
|
|
229
221
|
/**
|
|
230
222
|
* Provide a description for the `<ProgressStep>`
|
|
231
223
|
*/
|
|
232
|
-
description:
|
|
224
|
+
description: PropTypes.string,
|
|
233
225
|
/**
|
|
234
226
|
* Specify whether the step is disabled
|
|
235
227
|
*/
|
|
236
|
-
disabled:
|
|
228
|
+
disabled: PropTypes.bool,
|
|
237
229
|
/**
|
|
238
230
|
* Index of the current step within the ProgressIndicator
|
|
239
231
|
*/
|
|
240
|
-
index:
|
|
232
|
+
index: PropTypes.number,
|
|
241
233
|
/**
|
|
242
234
|
* Specify whether the step is invalid
|
|
243
235
|
*/
|
|
244
|
-
invalid:
|
|
236
|
+
invalid: PropTypes.bool,
|
|
245
237
|
/**
|
|
246
238
|
* Provide the label for the `<ProgressStep>`
|
|
247
239
|
*/
|
|
248
|
-
label:
|
|
240
|
+
label: PropTypes.node.isRequired,
|
|
249
241
|
/**
|
|
250
242
|
* A callback called if the step is clicked or the enter key is pressed
|
|
251
243
|
*/
|
|
252
|
-
onClick:
|
|
244
|
+
onClick: PropTypes.func,
|
|
253
245
|
/**
|
|
254
246
|
* Provide the props that describe a progress step tooltip
|
|
255
247
|
*/
|
|
256
|
-
overflowTooltipProps:
|
|
248
|
+
overflowTooltipProps: PropTypes.object,
|
|
257
249
|
/**
|
|
258
250
|
* Provide an optional secondary label
|
|
259
251
|
*/
|
|
260
|
-
secondaryLabel:
|
|
252
|
+
secondaryLabel: PropTypes.string,
|
|
261
253
|
/**
|
|
262
254
|
* The ID of the tooltip content.
|
|
263
255
|
*/
|
|
264
|
-
tooltipId:
|
|
256
|
+
tooltipId: PropTypes.string,
|
|
265
257
|
/**
|
|
266
258
|
* Optional method that takes in a message id and returns an
|
|
267
259
|
* internationalized string.
|
|
268
260
|
*/
|
|
269
|
-
translateWithId:
|
|
261
|
+
translateWithId: PropTypes.func
|
|
270
262
|
};
|
|
271
263
|
|
|
272
264
|
exports.ProgressIndicator = ProgressIndicator;
|
|
@@ -15,23 +15,17 @@ 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 RadioButtonSkeleton(props) {
|
|
25
19
|
const {
|
|
26
20
|
className,
|
|
27
21
|
...rest
|
|
28
22
|
} = props;
|
|
29
23
|
const prefix = usePrefix.usePrefix();
|
|
30
|
-
return /*#__PURE__*/
|
|
31
|
-
className:
|
|
32
|
-
}, rest), /*#__PURE__*/
|
|
24
|
+
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
|
25
|
+
className: cx(`${prefix}--radio-button-wrapper`, className)
|
|
26
|
+
}, rest), /*#__PURE__*/React.createElement("div", {
|
|
33
27
|
className: `${prefix}--radio-button ${prefix}--skeleton`
|
|
34
|
-
}), /*#__PURE__*/
|
|
28
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
35
29
|
className: `${prefix}--radio-button__label ${prefix}--skeleton`
|
|
36
30
|
}));
|
|
37
31
|
}
|
|
@@ -39,8 +33,8 @@ RadioButtonSkeleton.propTypes = {
|
|
|
39
33
|
/**
|
|
40
34
|
* Specify an optional className to add.
|
|
41
35
|
*/
|
|
42
|
-
className:
|
|
36
|
+
className: PropTypes.string
|
|
43
37
|
};
|
|
44
38
|
|
|
45
39
|
exports.RadioButtonSkeleton = RadioButtonSkeleton;
|
|
46
|
-
exports
|
|
40
|
+
exports.default = RadioButtonSkeleton;
|
|
@@ -22,13 +22,7 @@ var index = require('../AILabel/index.js');
|
|
|
22
22
|
var utils = require('../../internal/utils.js');
|
|
23
23
|
var Text = require('../Text/Text.js');
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
28
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
29
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
30
|
-
|
|
31
|
-
const RadioButton = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => {
|
|
25
|
+
const RadioButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
32
26
|
const {
|
|
33
27
|
className,
|
|
34
28
|
decorator,
|
|
@@ -50,10 +44,10 @@ const RadioButton = /*#__PURE__*/React__default["default"].forwardRef((props, re
|
|
|
50
44
|
function handleOnChange(event) {
|
|
51
45
|
onChange(value, name, event);
|
|
52
46
|
}
|
|
53
|
-
const innerLabelClasses =
|
|
47
|
+
const innerLabelClasses = cx(`${prefix}--radio-button__label-text`, {
|
|
54
48
|
[`${prefix}--visually-hidden`]: hideLabel
|
|
55
49
|
});
|
|
56
|
-
const wrapperClasses =
|
|
50
|
+
const wrapperClasses = cx(className, `${prefix}--radio-button-wrapper`, {
|
|
57
51
|
[`${prefix}--radio-button-wrapper--label-${labelPosition}`]: labelPosition !== 'right',
|
|
58
52
|
[`${prefix}--radio-button-wrapper--slug`]: slug,
|
|
59
53
|
[`${prefix}--radio-button-wrapper--decorator`]: decorator
|
|
@@ -64,26 +58,26 @@ const RadioButton = /*#__PURE__*/React__default["default"].forwardRef((props, re
|
|
|
64
58
|
const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/React.cloneElement(candidate, {
|
|
65
59
|
size: candidate.props?.['kind'] === 'inline' ? 'md' : 'mini'
|
|
66
60
|
}) : null;
|
|
67
|
-
return /*#__PURE__*/
|
|
61
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
68
62
|
className: wrapperClasses
|
|
69
|
-
}, /*#__PURE__*/
|
|
63
|
+
}, /*#__PURE__*/React.createElement("input", _rollupPluginBabelHelpers.extends({}, rest, {
|
|
70
64
|
type: "radio",
|
|
71
65
|
className: `${prefix}--radio-button`,
|
|
72
66
|
onChange: handleOnChange,
|
|
73
67
|
id: uniqueId,
|
|
74
|
-
ref: mergeRefs
|
|
68
|
+
ref: mergeRefs.default(inputRef, ref),
|
|
75
69
|
disabled: disabled,
|
|
76
70
|
value: value,
|
|
77
71
|
name: name,
|
|
78
72
|
required: required
|
|
79
|
-
})), /*#__PURE__*/
|
|
73
|
+
})), /*#__PURE__*/React.createElement("label", {
|
|
80
74
|
htmlFor: uniqueId,
|
|
81
75
|
className: `${prefix}--radio-button__label`
|
|
82
|
-
}, /*#__PURE__*/
|
|
76
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
83
77
|
className: `${prefix}--radio-button__appearance`
|
|
84
|
-
}), labelText && /*#__PURE__*/
|
|
78
|
+
}), labelText && /*#__PURE__*/React.createElement(Text.Text, {
|
|
85
79
|
className: innerLabelClasses
|
|
86
|
-
}, labelText, slug ? normalizedDecorator : decorator ? /*#__PURE__*/
|
|
80
|
+
}, labelText, slug ? normalizedDecorator : decorator ? /*#__PURE__*/React.createElement("div", {
|
|
87
81
|
className: `${prefix}--radio-button-wrapper-inner--decorator`
|
|
88
82
|
}, normalizedDecorator) : '')));
|
|
89
83
|
});
|
|
@@ -92,66 +86,66 @@ RadioButton.propTypes = {
|
|
|
92
86
|
/**
|
|
93
87
|
* Specify whether the `<RadioButton>` is currently checked
|
|
94
88
|
*/
|
|
95
|
-
checked:
|
|
89
|
+
checked: PropTypes.bool,
|
|
96
90
|
/**
|
|
97
91
|
* Provide an optional className to be applied to the containing node
|
|
98
92
|
*/
|
|
99
|
-
className:
|
|
93
|
+
className: PropTypes.string,
|
|
100
94
|
/**
|
|
101
95
|
* **Experimental**: Provide a decorator component to be rendered inside the `RadioButton` component
|
|
102
96
|
*/
|
|
103
|
-
decorator:
|
|
97
|
+
decorator: PropTypes.node,
|
|
104
98
|
/**
|
|
105
99
|
* Specify whether the `<RadioButton>` should be checked by default
|
|
106
100
|
*/
|
|
107
|
-
defaultChecked:
|
|
101
|
+
defaultChecked: PropTypes.bool,
|
|
108
102
|
/**
|
|
109
103
|
* Specify whether the control is disabled
|
|
110
104
|
*/
|
|
111
|
-
disabled:
|
|
105
|
+
disabled: PropTypes.bool,
|
|
112
106
|
/**
|
|
113
107
|
* Specify whether the label should be hidden, or not
|
|
114
108
|
*/
|
|
115
|
-
hideLabel:
|
|
109
|
+
hideLabel: PropTypes.bool,
|
|
116
110
|
/**
|
|
117
111
|
* Provide a unique id for the underlying `<input>` node
|
|
118
112
|
*/
|
|
119
|
-
id:
|
|
113
|
+
id: PropTypes.string,
|
|
120
114
|
/**
|
|
121
115
|
* Provide where label text should be placed
|
|
122
116
|
* NOTE: `top`/`bottom` are deprecated
|
|
123
117
|
*/
|
|
124
|
-
labelPosition:
|
|
118
|
+
labelPosition: PropTypes.oneOf(['right', 'left']),
|
|
125
119
|
/**
|
|
126
120
|
* Provide label text to be read by screen readers when interacting with the
|
|
127
121
|
* control
|
|
128
122
|
*/
|
|
129
|
-
labelText:
|
|
123
|
+
labelText: PropTypes.node.isRequired,
|
|
130
124
|
/**
|
|
131
125
|
* Provide a name for the underlying `<input>` node
|
|
132
126
|
*/
|
|
133
|
-
name:
|
|
127
|
+
name: PropTypes.string,
|
|
134
128
|
/**
|
|
135
129
|
* Provide an optional `onChange` hook that is called each time the value of
|
|
136
130
|
* the underlying `<input>` changes
|
|
137
131
|
*/
|
|
138
|
-
onChange:
|
|
132
|
+
onChange: PropTypes.func,
|
|
139
133
|
/**
|
|
140
134
|
* Provide a handler that is invoked when a user clicks on the control
|
|
141
135
|
*/
|
|
142
|
-
onClick:
|
|
136
|
+
onClick: PropTypes.func,
|
|
143
137
|
/**
|
|
144
138
|
* `true` to specify if the control is required.
|
|
145
139
|
*/
|
|
146
|
-
required:
|
|
140
|
+
required: PropTypes.bool,
|
|
147
141
|
/**
|
|
148
142
|
* **Experimental**: Provide a `Slug` component to be rendered inside the `RadioButton` component
|
|
149
143
|
*/
|
|
150
|
-
slug: deprecate.deprecate(
|
|
144
|
+
slug: deprecate.deprecate(PropTypes.node, 'The `slug` prop has been deprecated and will be removed in the next major version. Use the decorator prop instead.'),
|
|
151
145
|
/**
|
|
152
146
|
* Specify the value of the `<RadioButton>`
|
|
153
147
|
*/
|
|
154
|
-
value:
|
|
148
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
155
149
|
};
|
|
156
150
|
|
|
157
|
-
exports
|
|
151
|
+
exports.default = RadioButton;
|