@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
|
@@ -28,13 +28,6 @@ var useOutsideClick = require('../../internal/useOutsideClick.js');
|
|
|
28
28
|
var deprecateValuesWithin = require('../../prop-types/deprecateValuesWithin.js');
|
|
29
29
|
var mapPopoverAlign = require('../../tools/mapPopoverAlign.js');
|
|
30
30
|
|
|
31
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
32
|
-
|
|
33
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
34
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
35
|
-
var invariant__default = /*#__PURE__*/_interopDefaultLegacy(invariant);
|
|
36
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
37
|
-
|
|
38
31
|
const getInstanceId = setupGetInstanceId.setupGetInstanceId();
|
|
39
32
|
const on = (target, ...args) => {
|
|
40
33
|
target.addEventListener(...args);
|
|
@@ -75,7 +68,7 @@ const getMenuOffset = (menuBody, direction, trigger, flip) => {
|
|
|
75
68
|
const triggerButtonPositionProp = triggerButtonPositionProps[direction];
|
|
76
69
|
const triggerButtonPositionFactor = triggerButtonPositionFactors[direction];
|
|
77
70
|
if (process.env.NODE_ENV !== 'production') {
|
|
78
|
-
!(triggerButtonPositionProp && triggerButtonPositionFactor) ? process.env.NODE_ENV !== "production" ?
|
|
71
|
+
!(triggerButtonPositionProp && triggerButtonPositionFactor) ? process.env.NODE_ENV !== "production" ? invariant(false, '[OverflowMenu] wrong floating menu direction: `%s`', direction) : invariant(false) : void 0;
|
|
79
72
|
}
|
|
80
73
|
const {
|
|
81
74
|
offsetWidth: menuWidth,
|
|
@@ -229,7 +222,7 @@ const OverflowMenu = /*#__PURE__*/React.forwardRef(({
|
|
|
229
222
|
direction
|
|
230
223
|
}) => {
|
|
231
224
|
const enabledIndices = React.Children.toArray(children).reduce((acc, curr, i) => {
|
|
232
|
-
if (/*#__PURE__*/
|
|
225
|
+
if (/*#__PURE__*/React.isValidElement(curr) && !curr.props.disabled) {
|
|
233
226
|
acc.push(i);
|
|
234
227
|
}
|
|
235
228
|
return acc;
|
|
@@ -279,18 +272,18 @@ const OverflowMenu = /*#__PURE__*/React.forwardRef(({
|
|
|
279
272
|
return document.body;
|
|
280
273
|
};
|
|
281
274
|
const menuBodyId = `overflow-menu-${instanceId.current}__menu-body`;
|
|
282
|
-
const overflowMenuClasses =
|
|
275
|
+
const overflowMenuClasses = cx(className, `${prefix}--overflow-menu`, {
|
|
283
276
|
[`${prefix}--overflow-menu--open`]: open,
|
|
284
277
|
[`${prefix}--overflow-menu--light`]: light,
|
|
285
278
|
[`${prefix}--overflow-menu--${size}`]: size
|
|
286
279
|
});
|
|
287
|
-
const overflowMenuOptionsClasses =
|
|
280
|
+
const overflowMenuOptionsClasses = cx(menuOptionsClass, `${prefix}--overflow-menu-options`, {
|
|
288
281
|
[`${prefix}--overflow-menu--flip`]: flipped,
|
|
289
282
|
[`${prefix}--overflow-menu-options--open`]: open,
|
|
290
283
|
[`${prefix}--overflow-menu-options--light`]: light,
|
|
291
284
|
[`${prefix}--overflow-menu-options--${size}`]: size
|
|
292
285
|
});
|
|
293
|
-
const overflowMenuIconClasses =
|
|
286
|
+
const overflowMenuIconClasses = cx(`${prefix}--overflow-menu__icon`, iconClass);
|
|
294
287
|
const childrenWithProps = React.Children.toArray(children).map((child, index) => {
|
|
295
288
|
if (/*#__PURE__*/React.isValidElement(child)) {
|
|
296
289
|
const childElement = child;
|
|
@@ -305,7 +298,7 @@ const OverflowMenu = /*#__PURE__*/React.forwardRef(({
|
|
|
305
298
|
}
|
|
306
299
|
return null;
|
|
307
300
|
});
|
|
308
|
-
const menuBody = /*#__PURE__*/
|
|
301
|
+
const menuBody = /*#__PURE__*/React.createElement("ul", {
|
|
309
302
|
className: overflowMenuOptionsClasses,
|
|
310
303
|
tabIndex: -1,
|
|
311
304
|
role: "menu",
|
|
@@ -313,7 +306,7 @@ const OverflowMenu = /*#__PURE__*/React.forwardRef(({
|
|
|
313
306
|
onKeyDown: handleKeyPress,
|
|
314
307
|
id: menuBodyId
|
|
315
308
|
}, childrenWithProps);
|
|
316
|
-
const wrappedMenuBody = /*#__PURE__*/
|
|
309
|
+
const wrappedMenuBody = /*#__PURE__*/React.createElement(FloatingMenu.FloatingMenu, {
|
|
317
310
|
focusTrap: focusTrap,
|
|
318
311
|
triggerRef: triggerRef,
|
|
319
312
|
menuDirection: direction,
|
|
@@ -326,12 +319,12 @@ const OverflowMenu = /*#__PURE__*/React.forwardRef(({
|
|
|
326
319
|
}, /*#__PURE__*/React.cloneElement(menuBody, {
|
|
327
320
|
'data-floating-menu-direction': direction
|
|
328
321
|
}));
|
|
329
|
-
const combinedRef = innerRef ? mergeRefs
|
|
330
|
-
return /*#__PURE__*/
|
|
322
|
+
const combinedRef = innerRef ? mergeRefs.default(triggerRef, innerRef, ref) : mergeRefs.default(triggerRef, ref);
|
|
323
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
331
324
|
className: `${prefix}--overflow-menu__wrapper`,
|
|
332
325
|
"aria-owns": open ? menuBodyId : undefined,
|
|
333
326
|
ref: wrapperRef
|
|
334
|
-
}, /*#__PURE__*/
|
|
327
|
+
}, /*#__PURE__*/React.createElement(index.IconButton, _rollupPluginBabelHelpers.extends({}, other, {
|
|
335
328
|
align: align,
|
|
336
329
|
type: "button",
|
|
337
330
|
"aria-haspopup": true,
|
|
@@ -344,7 +337,7 @@ const OverflowMenu = /*#__PURE__*/React.forwardRef(({
|
|
|
344
337
|
size: size,
|
|
345
338
|
label: iconDescription,
|
|
346
339
|
kind: "ghost"
|
|
347
|
-
}), /*#__PURE__*/
|
|
340
|
+
}), /*#__PURE__*/React.createElement(IconElement, {
|
|
348
341
|
className: overflowMenuIconClasses,
|
|
349
342
|
"aria-label": iconDescription
|
|
350
343
|
})), open && hasMountedTrigger && wrappedMenuBody));
|
|
@@ -353,7 +346,7 @@ OverflowMenu.propTypes = {
|
|
|
353
346
|
/**
|
|
354
347
|
* Specify how the trigger should align with the tooltip
|
|
355
348
|
*/
|
|
356
|
-
align: deprecateValuesWithin
|
|
349
|
+
align: deprecateValuesWithin.default(PropTypes.oneOf(['top', 'top-left',
|
|
357
350
|
// deprecated use top-start instead
|
|
358
351
|
'top-right',
|
|
359
352
|
// deprecated use top-end instead
|
|
@@ -378,106 +371,106 @@ OverflowMenu.propTypes = {
|
|
|
378
371
|
/**
|
|
379
372
|
* Specify a label to be read by screen readers on the container node
|
|
380
373
|
*/
|
|
381
|
-
['aria-label']:
|
|
374
|
+
['aria-label']: PropTypes.string,
|
|
382
375
|
/**
|
|
383
376
|
* Deprecated, please use `aria-label` instead.
|
|
384
377
|
* Specify a label to be read by screen readers on the container note.
|
|
385
378
|
*/
|
|
386
|
-
ariaLabel: deprecate.deprecate(
|
|
379
|
+
ariaLabel: deprecate.deprecate(PropTypes.string, 'This prop syntax has been deprecated. Please use the new `aria-label`.'),
|
|
387
380
|
/**
|
|
388
381
|
* The child nodes.
|
|
389
382
|
*/
|
|
390
|
-
children:
|
|
383
|
+
children: PropTypes.node,
|
|
391
384
|
/**
|
|
392
385
|
* The CSS class names.
|
|
393
386
|
*/
|
|
394
|
-
className:
|
|
387
|
+
className: PropTypes.string,
|
|
395
388
|
/**
|
|
396
389
|
* The menu direction.
|
|
397
390
|
*/
|
|
398
|
-
direction:
|
|
391
|
+
direction: PropTypes.oneOf([FloatingMenu.DIRECTION_TOP, FloatingMenu.DIRECTION_BOTTOM]),
|
|
399
392
|
/**
|
|
400
393
|
* `true` if the menu alignment should be flipped.
|
|
401
394
|
*/
|
|
402
|
-
flipped:
|
|
395
|
+
flipped: PropTypes.bool,
|
|
403
396
|
/**
|
|
404
397
|
* Enable or disable focus trap behavior
|
|
405
398
|
*/
|
|
406
|
-
focusTrap:
|
|
399
|
+
focusTrap: PropTypes.bool,
|
|
407
400
|
/**
|
|
408
401
|
* The CSS class for the icon.
|
|
409
402
|
*/
|
|
410
|
-
iconClass:
|
|
403
|
+
iconClass: PropTypes.string,
|
|
411
404
|
/**
|
|
412
405
|
* The icon description.
|
|
413
406
|
*/
|
|
414
|
-
iconDescription:
|
|
407
|
+
iconDescription: PropTypes.string,
|
|
415
408
|
/**
|
|
416
409
|
* The element ID.
|
|
417
410
|
*/
|
|
418
|
-
id:
|
|
411
|
+
id: PropTypes.string,
|
|
419
412
|
/**
|
|
420
413
|
* `true` to use the light version. For use on $ui-01 backgrounds only.
|
|
421
414
|
* Don't use this to make OverflowMenu background color same as container background color.
|
|
422
415
|
*/
|
|
423
|
-
light: deprecate.deprecate(
|
|
416
|
+
light: deprecate.deprecate(PropTypes.bool, 'The `light` prop for `OverflowMenu` is no longer needed and has been deprecated. It will be removed in the next major release. Use the Layer component instead.'),
|
|
424
417
|
/**
|
|
425
418
|
* The adjustment in position applied to the floating menu.
|
|
426
419
|
*/
|
|
427
|
-
menuOffset:
|
|
428
|
-
top:
|
|
429
|
-
left:
|
|
430
|
-
}),
|
|
420
|
+
menuOffset: PropTypes.oneOfType([PropTypes.shape({
|
|
421
|
+
top: PropTypes.number.isRequired,
|
|
422
|
+
left: PropTypes.number.isRequired
|
|
423
|
+
}), PropTypes.func]),
|
|
431
424
|
/**
|
|
432
425
|
* The adjustment in position applied to the floating menu.
|
|
433
426
|
*/
|
|
434
|
-
menuOffsetFlip:
|
|
435
|
-
top:
|
|
436
|
-
left:
|
|
437
|
-
}),
|
|
427
|
+
menuOffsetFlip: PropTypes.oneOfType([PropTypes.shape({
|
|
428
|
+
top: PropTypes.number.isRequired,
|
|
429
|
+
left: PropTypes.number.isRequired
|
|
430
|
+
}), PropTypes.func]),
|
|
438
431
|
/**
|
|
439
432
|
* The class to apply to the menu options
|
|
440
433
|
*/
|
|
441
|
-
menuOptionsClass:
|
|
434
|
+
menuOptionsClass: PropTypes.string,
|
|
442
435
|
/**
|
|
443
436
|
* The event handler for the `click` event.
|
|
444
437
|
*/
|
|
445
|
-
onClick:
|
|
438
|
+
onClick: PropTypes.func,
|
|
446
439
|
/**
|
|
447
440
|
* Function called when menu is closed
|
|
448
441
|
*/
|
|
449
|
-
onClose:
|
|
442
|
+
onClose: PropTypes.func,
|
|
450
443
|
/**
|
|
451
444
|
* The event handler for the `focus` event.
|
|
452
445
|
*/
|
|
453
|
-
onFocus:
|
|
446
|
+
onFocus: PropTypes.func,
|
|
454
447
|
/**
|
|
455
448
|
* The event handler for the `keydown` event.
|
|
456
449
|
*/
|
|
457
|
-
onKeyDown:
|
|
450
|
+
onKeyDown: PropTypes.func,
|
|
458
451
|
/**
|
|
459
452
|
* Function called when menu is opened
|
|
460
453
|
*/
|
|
461
|
-
onOpen:
|
|
454
|
+
onOpen: PropTypes.func,
|
|
462
455
|
/**
|
|
463
456
|
* `true` if the menu should be open.
|
|
464
457
|
*/
|
|
465
|
-
open:
|
|
458
|
+
open: PropTypes.bool,
|
|
466
459
|
/**
|
|
467
460
|
* A component used to render an icon.
|
|
468
461
|
*/
|
|
469
|
-
renderIcon:
|
|
462
|
+
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
470
463
|
/**
|
|
471
464
|
* Specify a CSS selector that matches the DOM element that should
|
|
472
465
|
* be focused when the OverflowMenu opens
|
|
473
466
|
*/
|
|
474
|
-
selectorPrimaryFocus:
|
|
467
|
+
selectorPrimaryFocus: PropTypes.string,
|
|
475
468
|
/**
|
|
476
469
|
* Specify the size of the OverflowMenu. Currently supports either `sm`, `md` (default) or `lg` as an option.
|
|
477
470
|
*/
|
|
478
|
-
size:
|
|
471
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg'])
|
|
479
472
|
};
|
|
480
473
|
|
|
481
474
|
exports.OverflowMenu = OverflowMenu;
|
|
482
|
-
exports
|
|
475
|
+
exports.default = OverflowMenu;
|
|
483
476
|
exports.getMenuOffset = getMenuOffset;
|
|
@@ -15,15 +15,11 @@ var index = require('../FeatureFlags/index.js');
|
|
|
15
15
|
var index$1 = require('./next/index.js');
|
|
16
16
|
var OverflowMenu$1 = require('./OverflowMenu.js');
|
|
17
17
|
|
|
18
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
-
|
|
20
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
21
|
-
|
|
22
18
|
const OverflowMenu = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
23
19
|
const enableV12OverflowMenu = index.useFeatureFlag('enable-v12-overflowmenu');
|
|
24
|
-
return enableV12OverflowMenu ? /*#__PURE__*/
|
|
20
|
+
return enableV12OverflowMenu ? /*#__PURE__*/React.createElement(index$1.OverflowMenu, _rollupPluginBabelHelpers.extends({}, props, {
|
|
25
21
|
ref: ref
|
|
26
|
-
})) : /*#__PURE__*/
|
|
22
|
+
})) : /*#__PURE__*/React.createElement(OverflowMenu$1.OverflowMenu, _rollupPluginBabelHelpers.extends({}, props, {
|
|
27
23
|
ref: ref
|
|
28
24
|
}));
|
|
29
25
|
});
|
|
@@ -31,4 +27,4 @@ OverflowMenu.displayName = 'OverflowMenu';
|
|
|
31
27
|
OverflowMenu.propTypes = OverflowMenu$1.OverflowMenu.propTypes;
|
|
32
28
|
|
|
33
29
|
exports.OverflowMenu = OverflowMenu;
|
|
34
|
-
exports
|
|
30
|
+
exports.default = OverflowMenu;
|
|
@@ -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');
|
|
@@ -26,14 +24,8 @@ var useAttachedMenu = require('../../../internal/useAttachedMenu.js');
|
|
|
26
24
|
var deprecateValuesWithin = require('../../../prop-types/deprecateValuesWithin.js');
|
|
27
25
|
var mapPopoverAlign = require('../../../tools/mapPopoverAlign.js');
|
|
28
26
|
|
|
29
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
30
|
-
|
|
31
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
32
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
33
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
34
|
-
|
|
35
27
|
const defaultSize = 'md';
|
|
36
|
-
const OverflowMenu = /*#__PURE__*/
|
|
28
|
+
const OverflowMenu = /*#__PURE__*/React.forwardRef(function OverflowMenu({
|
|
37
29
|
autoAlign = false,
|
|
38
30
|
children,
|
|
39
31
|
className,
|
|
@@ -99,19 +91,19 @@ const OverflowMenu = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
99
91
|
hookOnClick();
|
|
100
92
|
}
|
|
101
93
|
}
|
|
102
|
-
const containerClasses =
|
|
94
|
+
const containerClasses = cx(className, `${prefix}--overflow-menu__container`, {
|
|
103
95
|
[`${prefix}--autoalign`]: enableFloatingStyles
|
|
104
96
|
});
|
|
105
|
-
const menuClasses =
|
|
106
|
-
const triggerClasses =
|
|
97
|
+
const menuClasses = cx(`${prefix}--overflow-menu__${menuAlignment}`);
|
|
98
|
+
const triggerClasses = cx(`${prefix}--overflow-menu`, {
|
|
107
99
|
[`${prefix}--overflow-menu--open`]: open
|
|
108
100
|
}, size !== defaultSize && `${prefix}--overflow-menu--${size}`);
|
|
109
|
-
const floatingRef = mergeRefs
|
|
110
|
-
return /*#__PURE__*/
|
|
101
|
+
const floatingRef = mergeRefs.default(triggerRef, refs.setReference);
|
|
102
|
+
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({}, rest, {
|
|
111
103
|
className: containerClasses,
|
|
112
104
|
"aria-owns": open ? id : undefined,
|
|
113
105
|
ref: forwardRef
|
|
114
|
-
}), /*#__PURE__*/
|
|
106
|
+
}), /*#__PURE__*/React.createElement(index$1.IconButton, {
|
|
115
107
|
"aria-controls": open ? id : undefined,
|
|
116
108
|
"aria-haspopup": true,
|
|
117
109
|
"aria-expanded": open,
|
|
@@ -122,9 +114,9 @@ const OverflowMenu = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
122
114
|
label: label,
|
|
123
115
|
align: tooltipAlignment,
|
|
124
116
|
kind: "ghost"
|
|
125
|
-
}, /*#__PURE__*/
|
|
117
|
+
}, /*#__PURE__*/React.createElement(IconElement, {
|
|
126
118
|
className: `${prefix}--overflow-menu__icon`
|
|
127
|
-
})), /*#__PURE__*/
|
|
119
|
+
})), /*#__PURE__*/React.createElement(Menu.Menu, {
|
|
128
120
|
containerRef: triggerRef,
|
|
129
121
|
ref: refs.setFloating,
|
|
130
122
|
menuAlignment: menuAlignment,
|
|
@@ -144,35 +136,35 @@ OverflowMenu.propTypes = {
|
|
|
144
136
|
/**
|
|
145
137
|
* **Experimental**: Will attempt to automatically align the floating element to avoid collisions with the viewport and being clipped by ancestor elements.
|
|
146
138
|
*/
|
|
147
|
-
autoAlign:
|
|
139
|
+
autoAlign: PropTypes.bool,
|
|
148
140
|
/**
|
|
149
141
|
* A collection of MenuItems to be rendered within this OverflowMenu.
|
|
150
142
|
*/
|
|
151
|
-
children:
|
|
143
|
+
children: PropTypes.node,
|
|
152
144
|
/**
|
|
153
145
|
* Additional CSS class names for the trigger button.
|
|
154
146
|
*/
|
|
155
|
-
className:
|
|
147
|
+
className: PropTypes.string,
|
|
156
148
|
/**
|
|
157
149
|
* A label describing the options available. Is used in the trigger tooltip and as the menu's accessible label.
|
|
158
150
|
*/
|
|
159
|
-
label:
|
|
151
|
+
label: PropTypes.string,
|
|
160
152
|
/**
|
|
161
153
|
* Experimental property. Specify how the menu should align with the button element
|
|
162
154
|
*/
|
|
163
|
-
menuAlignment:
|
|
155
|
+
menuAlignment: PropTypes.oneOf(['top-start', 'top-end', 'bottom-start', 'bottom-end']),
|
|
164
156
|
/**
|
|
165
157
|
* A component used to render an icon.
|
|
166
158
|
*/
|
|
167
|
-
renderIcon:
|
|
159
|
+
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
168
160
|
/**
|
|
169
161
|
* Specify the size of the menu, from a list of available sizes.
|
|
170
162
|
*/
|
|
171
|
-
size:
|
|
163
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
172
164
|
/**
|
|
173
165
|
* Specify how the trigger tooltip should be aligned.
|
|
174
166
|
*/
|
|
175
|
-
tooltipAlignment: deprecateValuesWithin
|
|
167
|
+
tooltipAlignment: deprecateValuesWithin.default(PropTypes.oneOf(['top', 'top-left',
|
|
176
168
|
// deprecated use top-start instead
|
|
177
169
|
'top-right',
|
|
178
170
|
// deprecated use top-end instead
|
|
@@ -197,7 +189,7 @@ OverflowMenu.propTypes = {
|
|
|
197
189
|
/**
|
|
198
190
|
* Specify a DOM node where the Menu should be rendered in. Defaults to document.body.
|
|
199
191
|
*/
|
|
200
|
-
menuTarget:
|
|
192
|
+
menuTarget: PropTypes.instanceOf(typeof Element !== 'undefined' ? Element : Object)
|
|
201
193
|
};
|
|
202
194
|
|
|
203
195
|
exports.OverflowMenu = OverflowMenu;
|
|
@@ -20,12 +20,6 @@ var warning = require('../../internal/warning.js');
|
|
|
20
20
|
require('../Text/index.js');
|
|
21
21
|
var Text = require('../Text/Text.js');
|
|
22
22
|
|
|
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
23
|
const frFn = React.forwardRef;
|
|
30
24
|
const OverflowMenuItem = frFn((props, ref) => {
|
|
31
25
|
const {
|
|
@@ -67,8 +61,8 @@ const OverflowMenuItem = frFn((props, ref) => {
|
|
|
67
61
|
}
|
|
68
62
|
}
|
|
69
63
|
process.env.NODE_ENV !== "production" ? warning.warning(!!closeMenu, '`<OverflowMenuItem>` detected missing `closeMenu` prop. ' + '`closeMenu` is required to let `<OverflowMenu>` close the menu upon actions on `<OverflowMenuItem>`. ' + 'Please make sure `<OverflowMenuItem>` is a direct child of `<OverflowMenu>.') : void 0;
|
|
70
|
-
const overflowMenuBtnClasses =
|
|
71
|
-
const overflowMenuItemClasses =
|
|
64
|
+
const overflowMenuBtnClasses = cx(`${prefix}--overflow-menu-options__btn`, className);
|
|
65
|
+
const overflowMenuItemClasses = cx(`${prefix}--overflow-menu-options__option`, {
|
|
72
66
|
[`${prefix}--overflow-menu--divider`]: hasDivider,
|
|
73
67
|
[`${prefix}--overflow-menu-options__option--danger`]: isDelete,
|
|
74
68
|
[`${prefix}--overflow-menu-options__option--disabled`]: disabled
|
|
@@ -78,15 +72,15 @@ const OverflowMenuItem = frFn((props, ref) => {
|
|
|
78
72
|
if (typeof itemText !== 'string') {
|
|
79
73
|
return itemText;
|
|
80
74
|
}
|
|
81
|
-
return /*#__PURE__*/
|
|
75
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
82
76
|
className: `${prefix}--overflow-menu-options__option-content`
|
|
83
77
|
}, itemText);
|
|
84
78
|
})();
|
|
85
|
-
return /*#__PURE__*/
|
|
79
|
+
return /*#__PURE__*/React.createElement(Text.Text, {
|
|
86
80
|
as: "li",
|
|
87
81
|
className: overflowMenuItemClasses,
|
|
88
82
|
role: "none"
|
|
89
|
-
}, /*#__PURE__*/
|
|
83
|
+
}, /*#__PURE__*/React.createElement(TagToUse, _rollupPluginBabelHelpers.extends({
|
|
90
84
|
className: overflowMenuBtnClasses,
|
|
91
85
|
disabled: disabled,
|
|
92
86
|
href: href,
|
|
@@ -113,57 +107,57 @@ OverflowMenuItem.propTypes = {
|
|
|
113
107
|
/**
|
|
114
108
|
* The CSS class name to be placed on the button element
|
|
115
109
|
*/
|
|
116
|
-
className:
|
|
110
|
+
className: PropTypes.string,
|
|
117
111
|
/**
|
|
118
112
|
* A callback to tell the parent menu component that the menu should be closed.
|
|
119
113
|
*/
|
|
120
|
-
closeMenu:
|
|
114
|
+
closeMenu: PropTypes.func,
|
|
121
115
|
/**
|
|
122
116
|
* `true` to make this menu item disabled.
|
|
123
117
|
*/
|
|
124
|
-
disabled:
|
|
125
|
-
handleOverflowMenuItemFocus:
|
|
118
|
+
disabled: PropTypes.bool,
|
|
119
|
+
handleOverflowMenuItemFocus: PropTypes.func,
|
|
126
120
|
/**
|
|
127
121
|
* `true` to make this menu item a divider.
|
|
128
122
|
*/
|
|
129
|
-
hasDivider:
|
|
123
|
+
hasDivider: PropTypes.bool,
|
|
130
124
|
/**
|
|
131
125
|
* If given, overflow item will render as a link with the given href
|
|
132
126
|
*/
|
|
133
|
-
href:
|
|
134
|
-
index:
|
|
127
|
+
href: PropTypes.string,
|
|
128
|
+
index: PropTypes.number,
|
|
135
129
|
/**
|
|
136
130
|
* `true` to make this menu item a "danger button".
|
|
137
131
|
*/
|
|
138
|
-
isDelete:
|
|
132
|
+
isDelete: PropTypes.bool,
|
|
139
133
|
/**
|
|
140
134
|
* The text in the menu item.
|
|
141
135
|
*/
|
|
142
|
-
itemText:
|
|
136
|
+
itemText: PropTypes.node.isRequired,
|
|
143
137
|
/**
|
|
144
138
|
* event handlers
|
|
145
139
|
*/
|
|
146
|
-
onBlur:
|
|
147
|
-
onClick:
|
|
148
|
-
onFocus:
|
|
149
|
-
onKeyDown:
|
|
150
|
-
onKeyUp:
|
|
151
|
-
onMouseDown:
|
|
152
|
-
onMouseEnter:
|
|
153
|
-
onMouseLeave:
|
|
154
|
-
onMouseUp:
|
|
140
|
+
onBlur: PropTypes.func,
|
|
141
|
+
onClick: PropTypes.func,
|
|
142
|
+
onFocus: PropTypes.func,
|
|
143
|
+
onKeyDown: PropTypes.func,
|
|
144
|
+
onKeyUp: PropTypes.func,
|
|
145
|
+
onMouseDown: PropTypes.func,
|
|
146
|
+
onMouseEnter: PropTypes.func,
|
|
147
|
+
onMouseLeave: PropTypes.func,
|
|
148
|
+
onMouseUp: PropTypes.func,
|
|
155
149
|
/**
|
|
156
150
|
* `true` if this menu item has long text and requires a browser tooltip
|
|
157
151
|
*/
|
|
158
|
-
requireTitle:
|
|
152
|
+
requireTitle: PropTypes.bool,
|
|
159
153
|
/**
|
|
160
154
|
* Specify a title for the OverflowMenuItem
|
|
161
155
|
*/
|
|
162
|
-
title:
|
|
156
|
+
title: PropTypes.string,
|
|
163
157
|
/**
|
|
164
158
|
* The CSS class name to be placed on the wrapper list item element
|
|
165
159
|
*/
|
|
166
|
-
wrapperClassName:
|
|
160
|
+
wrapperClassName: PropTypes.string
|
|
167
161
|
};
|
|
168
162
|
|
|
169
|
-
exports
|
|
163
|
+
exports.default = OverflowMenuItem;
|
|
@@ -13,5 +13,5 @@ var OverflowMenuItem = require('./OverflowMenuItem.js');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
exports.OverflowMenuItem = OverflowMenuItem
|
|
17
|
-
exports
|
|
16
|
+
exports.OverflowMenuItem = OverflowMenuItem.default;
|
|
17
|
+
exports.default = OverflowMenuItem.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function OverflowMenuV2(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,26 +7,20 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
-
|
|
12
10
|
var React = require('react');
|
|
13
11
|
var warning = require('../../internal/warning.js');
|
|
14
12
|
var index = require('../FeatureFlags/index.js');
|
|
15
13
|
var index$1 = require('../OverflowMenu/index.js');
|
|
16
14
|
|
|
17
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
|
-
|
|
19
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
20
|
-
|
|
21
15
|
let didWarnAboutDeprecation = false;
|
|
22
16
|
function OverflowMenuV2(props) {
|
|
23
17
|
if (process.env.NODE_ENV !== 'production') {
|
|
24
18
|
process.env.NODE_ENV !== "production" ? warning.warning(didWarnAboutDeprecation, '`<OverflowMenuV2>` is deprecated and will be removed in the next major version. Use `<OverflowMenu>` with the `enable-v12-overflowmenu` feature flag instead.') : void 0;
|
|
25
19
|
didWarnAboutDeprecation = true;
|
|
26
20
|
}
|
|
27
|
-
return /*#__PURE__*/
|
|
21
|
+
return /*#__PURE__*/React.createElement(index.FeatureFlags, {
|
|
28
22
|
enableV12Overflowmenu: true
|
|
29
|
-
}, /*#__PURE__*/
|
|
23
|
+
}, /*#__PURE__*/React.createElement(index$1.default, props));
|
|
30
24
|
}
|
|
31
25
|
|
|
32
26
|
exports.OverflowMenuV2 = OverflowMenuV2;
|