@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
|
@@ -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 PropTypes = require('prop-types');
|
|
14
12
|
var React = require('react');
|
|
@@ -22,14 +20,8 @@ var deprecateValuesWithin = require('../../prop-types/deprecateValuesWithin.js')
|
|
|
22
20
|
var index = require('../BadgeIndicator/index.js');
|
|
23
21
|
var mapPopoverAlign = require('../../tools/mapPopoverAlign.js');
|
|
24
22
|
|
|
25
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
26
|
-
|
|
27
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
28
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
29
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
30
|
-
|
|
31
23
|
const IconButtonKinds = ['primary', 'secondary', 'ghost', 'tertiary'];
|
|
32
|
-
const IconButton = /*#__PURE__*/
|
|
24
|
+
const IconButton = /*#__PURE__*/React.forwardRef(function IconButton({
|
|
33
25
|
align,
|
|
34
26
|
autoAlign = false,
|
|
35
27
|
badgeCount,
|
|
@@ -50,14 +42,14 @@ const IconButton = /*#__PURE__*/React__default["default"].forwardRef(function Ic
|
|
|
50
42
|
...rest
|
|
51
43
|
}, ref) {
|
|
52
44
|
const prefix = usePrefix.usePrefix();
|
|
53
|
-
const tooltipClasses =
|
|
45
|
+
const tooltipClasses = cx(wrapperClasses, `${prefix}--icon-tooltip`, {
|
|
54
46
|
[`${prefix}--icon-tooltip--disabled`]: disabled
|
|
55
47
|
});
|
|
56
48
|
if (badgeCount && (kind !== 'ghost' || size !== 'lg')) {
|
|
57
49
|
console.warn("The prop BadgeCount must be used with hasIconOnly=true, kind='ghost' and size='lg'");
|
|
58
50
|
}
|
|
59
51
|
const badgeId = useId.useId('badge-indicator');
|
|
60
|
-
return /*#__PURE__*/
|
|
52
|
+
return /*#__PURE__*/React.createElement(Tooltip.Tooltip, {
|
|
61
53
|
align: align,
|
|
62
54
|
autoAlign: autoAlign,
|
|
63
55
|
closeOnActivation: closeOnActivation,
|
|
@@ -68,7 +60,7 @@ const IconButton = /*#__PURE__*/React__default["default"].forwardRef(function Ic
|
|
|
68
60
|
highContrast: highContrast,
|
|
69
61
|
label: label,
|
|
70
62
|
leaveDelayMs: leaveDelayMs
|
|
71
|
-
}, /*#__PURE__*/
|
|
63
|
+
}, /*#__PURE__*/React.createElement(ButtonBase.default, _rollupPluginBabelHelpers.extends({}, rest, {
|
|
72
64
|
disabled: disabled,
|
|
73
65
|
kind: kind,
|
|
74
66
|
ref: ref,
|
|
@@ -77,7 +69,7 @@ const IconButton = /*#__PURE__*/React__default["default"].forwardRef(function Ic
|
|
|
77
69
|
hasIconOnly: true,
|
|
78
70
|
className: className,
|
|
79
71
|
"aria-describedby": rest['aria-describedby'] || badgeCount && badgeId
|
|
80
|
-
}), children, !disabled && badgeCount !== undefined && /*#__PURE__*/
|
|
72
|
+
}), children, !disabled && badgeCount !== undefined && /*#__PURE__*/React.createElement(index.BadgeIndicator, {
|
|
81
73
|
id: badgeId,
|
|
82
74
|
count: badgeCount > 0 ? badgeCount : undefined
|
|
83
75
|
})));
|
|
@@ -86,7 +78,7 @@ IconButton.propTypes = {
|
|
|
86
78
|
/**
|
|
87
79
|
* Specify how the trigger should align with the tooltip
|
|
88
80
|
*/
|
|
89
|
-
align: deprecateValuesWithin
|
|
81
|
+
align: deprecateValuesWithin.default(PropTypes.oneOf(['top', 'top-left',
|
|
90
82
|
// deprecated use top-start instead
|
|
91
83
|
'top-right',
|
|
92
84
|
// deprecated use top-end instead
|
|
@@ -111,56 +103,56 @@ IconButton.propTypes = {
|
|
|
111
103
|
/**
|
|
112
104
|
* **Experimental**: Will attempt to automatically align the tooltip
|
|
113
105
|
*/
|
|
114
|
-
autoAlign:
|
|
106
|
+
autoAlign: PropTypes.bool,
|
|
115
107
|
/**
|
|
116
108
|
* **Experimental**: Display a badge on the button. An empty/dot badge if 0, a numbered badge if > 0.
|
|
117
109
|
* Must be used with size="lg", kind="ghost" and hasIconOnly=true
|
|
118
110
|
*/
|
|
119
|
-
badgeCount:
|
|
111
|
+
badgeCount: PropTypes.number,
|
|
120
112
|
/**
|
|
121
113
|
* Optionally specify an href for your IconButton to become an `<a>` element
|
|
122
114
|
*/
|
|
123
|
-
href:
|
|
115
|
+
href: PropTypes.string,
|
|
124
116
|
/**
|
|
125
117
|
* Provide an icon or asset to be rendered inside of the IconButton
|
|
126
118
|
*/
|
|
127
|
-
children:
|
|
119
|
+
children: PropTypes.node,
|
|
128
120
|
/**
|
|
129
121
|
* Specify an optional className to be added to your Button
|
|
130
122
|
*/
|
|
131
|
-
className:
|
|
123
|
+
className: PropTypes.string,
|
|
132
124
|
/**
|
|
133
125
|
* Determines whether the tooltip should close when inner content is activated (click, Enter or Space)
|
|
134
126
|
*/
|
|
135
|
-
closeOnActivation:
|
|
127
|
+
closeOnActivation: PropTypes.bool,
|
|
136
128
|
/**
|
|
137
129
|
* Specify whether the tooltip should be open when it first renders
|
|
138
130
|
*/
|
|
139
|
-
defaultOpen:
|
|
131
|
+
defaultOpen: PropTypes.bool,
|
|
140
132
|
/**
|
|
141
133
|
* Specify whether a drop shadow should be rendered on the tooltip
|
|
142
134
|
*/
|
|
143
|
-
dropShadow:
|
|
135
|
+
dropShadow: PropTypes.bool,
|
|
144
136
|
/**
|
|
145
137
|
* Specify whether the Button should be disabled, or not
|
|
146
138
|
*/
|
|
147
|
-
disabled:
|
|
139
|
+
disabled: PropTypes.bool,
|
|
148
140
|
/**
|
|
149
141
|
* Specify the duration in milliseconds to delay before displaying the tooltip
|
|
150
142
|
*/
|
|
151
|
-
enterDelayMs:
|
|
143
|
+
enterDelayMs: PropTypes.number,
|
|
152
144
|
/**
|
|
153
145
|
* Specify whether the IconButton is currently selected
|
|
154
146
|
*/
|
|
155
|
-
isSelected:
|
|
147
|
+
isSelected: PropTypes.bool,
|
|
156
148
|
/**
|
|
157
149
|
* Render the tooltip using the high-contrast theme
|
|
158
150
|
*/
|
|
159
|
-
highContrast:
|
|
151
|
+
highContrast: PropTypes.bool,
|
|
160
152
|
/**
|
|
161
153
|
* Specify the type of button to be used as the base for the IconButton
|
|
162
154
|
*/
|
|
163
|
-
kind:
|
|
155
|
+
kind: PropTypes.oneOf(IconButtonKinds),
|
|
164
156
|
/**
|
|
165
157
|
* Provide the label to be rendered inside of the Tooltip. The label will use
|
|
166
158
|
* `aria-labelledby` and will fully describe the child node that is provided.
|
|
@@ -172,27 +164,27 @@ IconButton.propTypes = {
|
|
|
172
164
|
* If using `badgeCount={0}`, make sure the label explains that there is a
|
|
173
165
|
* new notification.
|
|
174
166
|
*/
|
|
175
|
-
label:
|
|
167
|
+
label: PropTypes.node.isRequired,
|
|
176
168
|
/**
|
|
177
169
|
* Specify the duration in milliseconds to delay before hiding the tooltip
|
|
178
170
|
*/
|
|
179
|
-
leaveDelayMs:
|
|
171
|
+
leaveDelayMs: PropTypes.number,
|
|
180
172
|
/**
|
|
181
173
|
* Optionally specify a `rel` when using an `<a>` element.
|
|
182
174
|
*/
|
|
183
|
-
rel:
|
|
175
|
+
rel: PropTypes.string,
|
|
184
176
|
/**
|
|
185
177
|
* Specify the size of the Button.
|
|
186
178
|
*/
|
|
187
|
-
size:
|
|
179
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
188
180
|
/**
|
|
189
181
|
* Optionally specify a `target` when using an `<a>` element.
|
|
190
182
|
*/
|
|
191
|
-
target:
|
|
183
|
+
target: PropTypes.string,
|
|
192
184
|
/**
|
|
193
185
|
* Specify an optional className to be added to your Tooltip wrapper
|
|
194
186
|
*/
|
|
195
|
-
wrapperClasses:
|
|
187
|
+
wrapperClasses: PropTypes.string
|
|
196
188
|
};
|
|
197
189
|
|
|
198
190
|
exports.IconButton = IconButton;
|
|
@@ -15,12 +15,6 @@ var cx = require('classnames');
|
|
|
15
15
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
16
16
|
var iconsReact = require('@carbon/icons-react');
|
|
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
|
const IconIndicatorKinds = ['failed', 'caution-major', 'caution-minor', 'undefined', 'succeeded', 'normal', 'in-progress', 'incomplete', 'not-started', 'pending', 'unknown', 'informative'];
|
|
25
19
|
const iconTypes = {
|
|
26
20
|
failed: iconsReact.ErrorFilled,
|
|
@@ -36,7 +30,7 @@ const iconTypes = {
|
|
|
36
30
|
unknown: iconsReact.UnknownFilled,
|
|
37
31
|
informative: iconsReact.WarningSquareFilled
|
|
38
32
|
};
|
|
39
|
-
const IconIndicator = /*#__PURE__*/
|
|
33
|
+
const IconIndicator = /*#__PURE__*/React.forwardRef(function IconIndicatorContent({
|
|
40
34
|
className: customClassName,
|
|
41
35
|
kind,
|
|
42
36
|
label,
|
|
@@ -44,17 +38,17 @@ const IconIndicator = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
44
38
|
...rest
|
|
45
39
|
}, ref) {
|
|
46
40
|
const prefix = usePrefix.usePrefix();
|
|
47
|
-
const classNames =
|
|
41
|
+
const classNames = cx(`${prefix}--icon-indicator`, customClassName, {
|
|
48
42
|
[`${prefix}--icon-indicator--20`]: size == 20
|
|
49
43
|
});
|
|
50
44
|
const IconForKind = iconTypes[kind];
|
|
51
45
|
if (!IconForKind) {
|
|
52
46
|
return null;
|
|
53
47
|
}
|
|
54
|
-
return /*#__PURE__*/
|
|
48
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
55
49
|
className: classNames,
|
|
56
50
|
ref: ref
|
|
57
|
-
}, /*#__PURE__*/
|
|
51
|
+
}, /*#__PURE__*/React.createElement(IconForKind, {
|
|
58
52
|
size: size,
|
|
59
53
|
className: `${prefix}--icon-indicator--${kind}`
|
|
60
54
|
}), label);
|
|
@@ -63,21 +57,21 @@ IconIndicator.propTypes = {
|
|
|
63
57
|
/**
|
|
64
58
|
* Specify an optional className to add.
|
|
65
59
|
*/
|
|
66
|
-
className:
|
|
60
|
+
className: PropTypes.string,
|
|
67
61
|
/**
|
|
68
62
|
* Specify the kind of the Icon Indicator
|
|
69
63
|
*/
|
|
70
|
-
kind:
|
|
64
|
+
kind: PropTypes.oneOf(IconIndicatorKinds).isRequired,
|
|
71
65
|
/**
|
|
72
66
|
* Label next to the icon.
|
|
73
67
|
*/
|
|
74
|
-
label:
|
|
68
|
+
label: PropTypes.string.isRequired,
|
|
75
69
|
/**
|
|
76
70
|
* Specify the size of the Icon Indicator. Defaults to 16.
|
|
77
71
|
*/
|
|
78
|
-
size:
|
|
72
|
+
size: PropTypes.oneOf([16, 20])
|
|
79
73
|
};
|
|
80
74
|
|
|
81
75
|
exports.IconIndicator = IconIndicator;
|
|
82
76
|
exports.IconIndicatorKinds = IconIndicatorKinds;
|
|
83
|
-
exports
|
|
77
|
+
exports.default = IconIndicator;
|
|
@@ -7,31 +7,24 @@
|
|
|
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
|
var React = require('react');
|
|
14
12
|
var useIdPrefix = require('../../internal/useIdPrefix.js');
|
|
15
13
|
|
|
16
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
|
-
|
|
18
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
19
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
20
|
-
|
|
21
14
|
function IdPrefix({
|
|
22
15
|
children,
|
|
23
16
|
prefix
|
|
24
17
|
}) {
|
|
25
|
-
return /*#__PURE__*/
|
|
18
|
+
return /*#__PURE__*/React.createElement(useIdPrefix.IdPrefixContext.Provider, {
|
|
26
19
|
value: prefix
|
|
27
20
|
}, children);
|
|
28
21
|
}
|
|
29
22
|
IdPrefix.propTypes = {
|
|
30
|
-
children:
|
|
23
|
+
children: PropTypes.node,
|
|
31
24
|
/**
|
|
32
25
|
* The value used to prefix the auto-generated id placed on some DOM elements
|
|
33
26
|
*/
|
|
34
|
-
prefix:
|
|
27
|
+
prefix: PropTypes.string
|
|
35
28
|
};
|
|
36
29
|
|
|
37
30
|
exports.IdPrefix = IdPrefix;
|
|
@@ -15,12 +15,7 @@ var deprecate = require('../../prop-types/deprecate.js');
|
|
|
15
15
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
16
16
|
var useMergedRefs = require('../../internal/useMergedRefs.js');
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
21
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
22
|
-
|
|
23
|
-
const InlineCheckbox = /*#__PURE__*/React__default["default"].forwardRef(function InlineCheckbox(props, forwardRef) {
|
|
18
|
+
const InlineCheckbox = /*#__PURE__*/React.forwardRef(function InlineCheckbox(props, forwardRef) {
|
|
24
19
|
const {
|
|
25
20
|
['aria-label']: ariaLabel,
|
|
26
21
|
ariaLabel: deprecatedAriaLabel,
|
|
@@ -65,19 +60,19 @@ const InlineCheckbox = /*#__PURE__*/React__default["default"].forwardRef(functio
|
|
|
65
60
|
}
|
|
66
61
|
onClick?.(evt);
|
|
67
62
|
}
|
|
68
|
-
return /*#__PURE__*/
|
|
63
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
69
64
|
className: `${prefix}--checkbox--inline`
|
|
70
|
-
}, /*#__PURE__*/
|
|
65
|
+
}, /*#__PURE__*/React.createElement("input", inputProps),
|
|
71
66
|
/*#__PURE__*/
|
|
72
67
|
/* eslint-disable jsx-a11y/label-has-for,jsx-a11y/label-has-associated-control,jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions */
|
|
73
|
-
|
|
68
|
+
React.createElement("label", {
|
|
74
69
|
htmlFor: id,
|
|
75
70
|
className: `${prefix}--checkbox-label`,
|
|
76
71
|
title: title,
|
|
77
72
|
onClick: evt => {
|
|
78
73
|
evt.stopPropagation();
|
|
79
74
|
}
|
|
80
|
-
}, /*#__PURE__*/
|
|
75
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
81
76
|
className: `${prefix}--visually-hidden`
|
|
82
77
|
}, deprecatedAriaLabel || ariaLabel)));
|
|
83
78
|
});
|
|
@@ -85,48 +80,48 @@ InlineCheckbox.propTypes = {
|
|
|
85
80
|
/**
|
|
86
81
|
* Specify the label for the control
|
|
87
82
|
*/
|
|
88
|
-
['aria-label']:
|
|
83
|
+
['aria-label']: PropTypes.string.isRequired,
|
|
89
84
|
/**
|
|
90
85
|
* Deprecated, please use `aria-label` instead.
|
|
91
86
|
* Specify the label for the control
|
|
92
87
|
*/
|
|
93
|
-
ariaLabel: deprecate.deprecate(
|
|
88
|
+
ariaLabel: deprecate.deprecate(PropTypes.string.isRequired, 'The `ariaLabel` prop has been deprecated in favor of `aria-label`. This prop will be removed in the next major release.'),
|
|
94
89
|
/**
|
|
95
90
|
* Specify whether the underlying control is checked, or not
|
|
96
91
|
*/
|
|
97
|
-
checked:
|
|
92
|
+
checked: PropTypes.bool,
|
|
98
93
|
/**
|
|
99
94
|
* Specify whether the underlying input control should be disabled
|
|
100
95
|
*/
|
|
101
|
-
disabled:
|
|
96
|
+
disabled: PropTypes.bool,
|
|
102
97
|
/**
|
|
103
98
|
* Provide an `id` for the underlying input control
|
|
104
99
|
*/
|
|
105
|
-
id:
|
|
100
|
+
id: PropTypes.string.isRequired,
|
|
106
101
|
/**
|
|
107
102
|
* Specify whether the control is in an indeterminate state
|
|
108
103
|
*/
|
|
109
|
-
indeterminate:
|
|
104
|
+
indeterminate: PropTypes.bool,
|
|
110
105
|
/**
|
|
111
106
|
* Provide a `name` for the underlying input control
|
|
112
107
|
*/
|
|
113
|
-
name:
|
|
108
|
+
name: PropTypes.string.isRequired,
|
|
114
109
|
/**
|
|
115
110
|
* Provide an optional hook that is called each time the input is updated
|
|
116
111
|
*/
|
|
117
|
-
onChange:
|
|
112
|
+
onChange: PropTypes.func,
|
|
118
113
|
/**
|
|
119
114
|
* Provide a handler that is invoked when a user clicks on the control
|
|
120
115
|
*/
|
|
121
|
-
onClick:
|
|
116
|
+
onClick: PropTypes.func,
|
|
122
117
|
/**
|
|
123
118
|
* Provide a handler that is invoked on the key down event for the control
|
|
124
119
|
*/
|
|
125
|
-
onKeyDown:
|
|
120
|
+
onKeyDown: PropTypes.func,
|
|
126
121
|
/**
|
|
127
122
|
* Provide an optional tooltip for the InlineCheckbox
|
|
128
123
|
*/
|
|
129
|
-
title:
|
|
124
|
+
title: PropTypes.string
|
|
130
125
|
};
|
|
131
126
|
|
|
132
|
-
exports
|
|
127
|
+
exports.default = InlineCheckbox;
|
|
@@ -17,12 +17,6 @@ var iconsReact = require('@carbon/icons-react');
|
|
|
17
17
|
var Loading = require('../Loading/Loading.js');
|
|
18
18
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
19
19
|
|
|
20
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
21
|
-
|
|
22
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
24
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
25
|
-
|
|
26
20
|
const InlineLoading = ({
|
|
27
21
|
className,
|
|
28
22
|
status = 'active',
|
|
@@ -33,7 +27,7 @@ const InlineLoading = ({
|
|
|
33
27
|
...rest
|
|
34
28
|
}) => {
|
|
35
29
|
const prefix = usePrefix.usePrefix();
|
|
36
|
-
const loadingClasses =
|
|
30
|
+
const loadingClasses = cx(`${prefix}--inline-loading`, className);
|
|
37
31
|
const timerRef = React.useRef(null);
|
|
38
32
|
React.useEffect(() => {
|
|
39
33
|
if (status === 'finished') {
|
|
@@ -53,20 +47,20 @@ const InlineLoading = ({
|
|
|
53
47
|
const getLoading = () => {
|
|
54
48
|
let iconLabel = iconDescription ? iconDescription : status;
|
|
55
49
|
if (status === 'error') {
|
|
56
|
-
return /*#__PURE__*/
|
|
50
|
+
return /*#__PURE__*/React.createElement(iconsReact.ErrorFilled, {
|
|
57
51
|
className: `${prefix}--inline-loading--error`
|
|
58
|
-
}, /*#__PURE__*/
|
|
52
|
+
}, /*#__PURE__*/React.createElement("title", null, iconLabel));
|
|
59
53
|
}
|
|
60
54
|
if (status === 'finished') {
|
|
61
|
-
return /*#__PURE__*/
|
|
55
|
+
return /*#__PURE__*/React.createElement(iconsReact.CheckmarkFilled, {
|
|
62
56
|
className: `${prefix}--inline-loading__checkmark-container`
|
|
63
|
-
}, /*#__PURE__*/
|
|
57
|
+
}, /*#__PURE__*/React.createElement("title", null, iconLabel));
|
|
64
58
|
}
|
|
65
59
|
if (status === 'active') {
|
|
66
60
|
if (!iconDescription) {
|
|
67
61
|
iconLabel = 'loading';
|
|
68
62
|
}
|
|
69
|
-
return /*#__PURE__*/
|
|
63
|
+
return /*#__PURE__*/React.createElement(Loading.default, {
|
|
70
64
|
small: true,
|
|
71
65
|
description: iconLabel,
|
|
72
66
|
withOverlay: false,
|
|
@@ -77,20 +71,20 @@ const InlineLoading = ({
|
|
|
77
71
|
if (!iconDescription) {
|
|
78
72
|
iconLabel = 'not loading';
|
|
79
73
|
}
|
|
80
|
-
return /*#__PURE__*/
|
|
74
|
+
return /*#__PURE__*/React.createElement("title", {
|
|
81
75
|
className: `${prefix}--inline-loading__inactive-status`
|
|
82
76
|
}, iconLabel);
|
|
83
77
|
}
|
|
84
78
|
return undefined;
|
|
85
79
|
};
|
|
86
|
-
const loadingText = description && /*#__PURE__*/
|
|
80
|
+
const loadingText = description && /*#__PURE__*/React.createElement("div", {
|
|
87
81
|
className: `${prefix}--inline-loading__text`
|
|
88
82
|
}, description);
|
|
89
83
|
const loading = getLoading();
|
|
90
|
-
const loadingAnimation = loading && /*#__PURE__*/
|
|
84
|
+
const loadingAnimation = loading && /*#__PURE__*/React.createElement("div", {
|
|
91
85
|
className: `${prefix}--inline-loading__animation`
|
|
92
86
|
}, loading);
|
|
93
|
-
return /*#__PURE__*/
|
|
87
|
+
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
|
94
88
|
className: loadingClasses
|
|
95
89
|
}, rest, {
|
|
96
90
|
"aria-live": rest['aria-live'] ?? 'assertive'
|
|
@@ -100,28 +94,28 @@ InlineLoading.propTypes = {
|
|
|
100
94
|
/**
|
|
101
95
|
* Specify a custom className to be applied to the container node
|
|
102
96
|
*/
|
|
103
|
-
className:
|
|
97
|
+
className: PropTypes.string,
|
|
104
98
|
/**
|
|
105
99
|
* Specify the description for the inline loading text
|
|
106
100
|
*/
|
|
107
|
-
description:
|
|
101
|
+
description: PropTypes.node,
|
|
108
102
|
/**
|
|
109
103
|
* Specify the description for the inline loading text
|
|
110
104
|
*/
|
|
111
|
-
iconDescription:
|
|
105
|
+
iconDescription: PropTypes.string,
|
|
112
106
|
/**
|
|
113
107
|
* Provide an optional handler to be invoked when <InlineLoading> is
|
|
114
108
|
* successful
|
|
115
109
|
*/
|
|
116
|
-
onSuccess:
|
|
110
|
+
onSuccess: PropTypes.func,
|
|
117
111
|
/**
|
|
118
112
|
* Specify the loading status
|
|
119
113
|
*/
|
|
120
|
-
status:
|
|
114
|
+
status: PropTypes.oneOf(['inactive', 'active', 'finished', 'error']),
|
|
121
115
|
/**
|
|
122
116
|
* Provide a delay for the `setTimeout` for success
|
|
123
117
|
*/
|
|
124
|
-
successDelay:
|
|
118
|
+
successDelay: PropTypes.number
|
|
125
119
|
};
|
|
126
120
|
|
|
127
|
-
exports
|
|
121
|
+
exports.default = InlineLoading;
|
|
@@ -7,14 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
-
|
|
12
10
|
var React = require('react');
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
17
|
-
|
|
18
|
-
const LayerContext = /*#__PURE__*/React__default["default"].createContext(1);
|
|
12
|
+
const LayerContext = /*#__PURE__*/React.createContext(1);
|
|
19
13
|
|
|
20
14
|
exports.LayerContext = LayerContext;
|
|
@@ -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 React = require('react');
|
|
14
12
|
var PropTypes = require('prop-types');
|
|
@@ -18,24 +16,18 @@ var LayerContext = require('./LayerContext.js');
|
|
|
18
16
|
var LayerLevel = require('./LayerLevel.js');
|
|
19
17
|
var clamp = require('../../internal/clamp.js');
|
|
20
18
|
|
|
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
19
|
/**
|
|
28
20
|
* A custom hook that will return information about the current layer. A common
|
|
29
21
|
* field to pull from this is the `level` for the layer that the component that
|
|
30
22
|
* calls this hook is currently in
|
|
31
23
|
*/
|
|
32
24
|
function useLayer() {
|
|
33
|
-
const level =
|
|
25
|
+
const level = React.useContext(LayerContext.LayerContext);
|
|
34
26
|
return {
|
|
35
27
|
level
|
|
36
28
|
};
|
|
37
29
|
}
|
|
38
|
-
const Layer = /*#__PURE__*/
|
|
30
|
+
const Layer = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
39
31
|
const {
|
|
40
32
|
as,
|
|
41
33
|
className: customClassName,
|
|
@@ -44,18 +36,18 @@ const Layer = /*#__PURE__*/React__default["default"].forwardRef((props, ref) =>
|
|
|
44
36
|
withBackground = false,
|
|
45
37
|
...rest
|
|
46
38
|
} = props;
|
|
47
|
-
const contextLevel =
|
|
39
|
+
const contextLevel = React.useContext(LayerContext.LayerContext);
|
|
48
40
|
const level = overrideLevel ?? contextLevel;
|
|
49
41
|
const prefix = usePrefix.usePrefix();
|
|
50
|
-
const className =
|
|
42
|
+
const className = cx(`${prefix}--layer-${LayerLevel.levels[level]}`, {
|
|
51
43
|
[`${prefix}--layer__with-background`]: withBackground
|
|
52
44
|
}, customClassName);
|
|
53
45
|
// The level should be between MIN_LEVEL and MAX_LEVEL
|
|
54
46
|
const value = clamp.clamp(level + 1, LayerLevel.MIN_LEVEL, LayerLevel.MAX_LEVEL);
|
|
55
47
|
const BaseComponent = as || 'div';
|
|
56
|
-
return /*#__PURE__*/
|
|
48
|
+
return /*#__PURE__*/React.createElement(LayerContext.LayerContext.Provider, {
|
|
57
49
|
value: value
|
|
58
|
-
}, /*#__PURE__*/
|
|
50
|
+
}, /*#__PURE__*/React.createElement(BaseComponent, _rollupPluginBabelHelpers.extends({
|
|
59
51
|
ref: ref
|
|
60
52
|
}, rest, {
|
|
61
53
|
className: className
|
|
@@ -67,24 +59,24 @@ Layer.propTypes = {
|
|
|
67
59
|
* Specify a custom component or element to be rendered as the top-level
|
|
68
60
|
* element in the component
|
|
69
61
|
*/
|
|
70
|
-
as:
|
|
62
|
+
as: PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.elementType]),
|
|
71
63
|
/**
|
|
72
64
|
* Provide child elements to be rendered inside of `Theme`
|
|
73
65
|
*/
|
|
74
|
-
children:
|
|
66
|
+
children: PropTypes.node,
|
|
75
67
|
/**
|
|
76
68
|
* Provide a custom class name to be used on the outermost element rendered by
|
|
77
69
|
* the component
|
|
78
70
|
*/
|
|
79
|
-
className:
|
|
71
|
+
className: PropTypes.string,
|
|
80
72
|
/**
|
|
81
73
|
* Specify the layer level and override any existing levels based on hierarchy
|
|
82
74
|
*/
|
|
83
|
-
level:
|
|
75
|
+
level: PropTypes.oneOf([0, 1, 2]),
|
|
84
76
|
/**
|
|
85
77
|
* Applies a css background-color set to $layer-background
|
|
86
78
|
*/
|
|
87
|
-
withBackground:
|
|
79
|
+
withBackground: PropTypes.bool
|
|
88
80
|
};
|
|
89
81
|
|
|
90
82
|
exports.Layer = Layer;
|