@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 cx = require('classnames');
|
|
14
12
|
var PropTypes = require('prop-types');
|
|
@@ -27,12 +25,6 @@ var useLayoutDirection = require('../LayoutDirection/useLayoutDirection.js');
|
|
|
27
25
|
require('../Text/index.js');
|
|
28
26
|
var Text = require('../Text/Text.js');
|
|
29
27
|
|
|
30
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
31
|
-
|
|
32
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
33
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
34
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
35
|
-
|
|
36
28
|
var _Checkmark, _CaretLeft, _CaretRight;
|
|
37
29
|
const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem({
|
|
38
30
|
children,
|
|
@@ -134,7 +126,7 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem({
|
|
|
134
126
|
}
|
|
135
127
|
pendingKeyboardClick.current = false;
|
|
136
128
|
}
|
|
137
|
-
const classNames =
|
|
129
|
+
const classNames = cx(className, `${prefix}--menu-item`, {
|
|
138
130
|
[`${prefix}--menu-item--disabled`]: isDisabled,
|
|
139
131
|
[`${prefix}--menu-item--danger`]: isDanger
|
|
140
132
|
});
|
|
@@ -179,11 +171,11 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem({
|
|
|
179
171
|
}
|
|
180
172
|
});
|
|
181
173
|
}, [floatingStyles, refs.floating]);
|
|
182
|
-
return /*#__PURE__*/
|
|
174
|
+
return /*#__PURE__*/React.createElement(react.FloatingFocusManager, {
|
|
183
175
|
context: floatingContext,
|
|
184
176
|
order: ['reference', 'floating'],
|
|
185
177
|
modal: false
|
|
186
|
-
}, /*#__PURE__*/
|
|
178
|
+
}, /*#__PURE__*/React.createElement("li", _rollupPluginBabelHelpers.extends({
|
|
187
179
|
role: "menuitem"
|
|
188
180
|
}, rest, {
|
|
189
181
|
ref: ref,
|
|
@@ -195,19 +187,19 @@ const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem({
|
|
|
195
187
|
onClick: handleClick,
|
|
196
188
|
onKeyDown: handleKeyDown,
|
|
197
189
|
onKeyUp: handleKeyUp
|
|
198
|
-
}, getReferenceProps()), /*#__PURE__*/
|
|
190
|
+
}, getReferenceProps()), /*#__PURE__*/React.createElement("div", {
|
|
199
191
|
className: `${prefix}--menu-item__selection-icon`
|
|
200
|
-
}, rest['aria-checked'] && (_Checkmark || (_Checkmark = /*#__PURE__*/
|
|
192
|
+
}, rest['aria-checked'] && (_Checkmark || (_Checkmark = /*#__PURE__*/React.createElement(iconsReact.Checkmark, null)))), /*#__PURE__*/React.createElement("div", {
|
|
201
193
|
className: `${prefix}--menu-item__icon`
|
|
202
|
-
}, IconElement && /*#__PURE__*/
|
|
194
|
+
}, IconElement && /*#__PURE__*/React.createElement(IconElement, null)), /*#__PURE__*/React.createElement(Text.Text, {
|
|
203
195
|
as: "div",
|
|
204
196
|
className: `${prefix}--menu-item__label`,
|
|
205
197
|
title: label
|
|
206
|
-
}, label), shortcut && !hasChildren && /*#__PURE__*/
|
|
198
|
+
}, label), shortcut && !hasChildren && /*#__PURE__*/React.createElement("div", {
|
|
207
199
|
className: `${prefix}--menu-item__shortcut`
|
|
208
|
-
}, shortcut), hasChildren && /*#__PURE__*/
|
|
200
|
+
}, shortcut), hasChildren && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
209
201
|
className: `${prefix}--menu-item__shortcut`
|
|
210
|
-
}, rtl ? _CaretLeft || (_CaretLeft = /*#__PURE__*/
|
|
202
|
+
}, rtl ? _CaretLeft || (_CaretLeft = /*#__PURE__*/React.createElement(iconsReact.CaretLeft, null)) : _CaretRight || (_CaretRight = /*#__PURE__*/React.createElement(iconsReact.CaretRight, null))), /*#__PURE__*/React.createElement(Menu.Menu, _rollupPluginBabelHelpers.extends({
|
|
211
203
|
label: label,
|
|
212
204
|
open: submenuOpen,
|
|
213
205
|
onClose: () => {
|
|
@@ -221,38 +213,38 @@ MenuItem.propTypes = {
|
|
|
221
213
|
/**
|
|
222
214
|
* Optionally provide another Menu to create a submenu. props.children can't be used to specify the content of the MenuItem itself. Use props.label instead.
|
|
223
215
|
*/
|
|
224
|
-
children:
|
|
216
|
+
children: PropTypes.node,
|
|
225
217
|
/**
|
|
226
218
|
* Additional CSS class names.
|
|
227
219
|
*/
|
|
228
|
-
className:
|
|
220
|
+
className: PropTypes.string,
|
|
229
221
|
/**
|
|
230
222
|
* Specify whether the MenuItem is disabled or not.
|
|
231
223
|
*/
|
|
232
|
-
disabled:
|
|
224
|
+
disabled: PropTypes.bool,
|
|
233
225
|
/**
|
|
234
226
|
* Specify the kind of the MenuItem.
|
|
235
227
|
*/
|
|
236
|
-
kind:
|
|
228
|
+
kind: PropTypes.oneOf(['default', 'danger']),
|
|
237
229
|
/**
|
|
238
230
|
* A required label titling the MenuItem. Will be rendered as its text content.
|
|
239
231
|
*/
|
|
240
|
-
label:
|
|
232
|
+
label: PropTypes.string.isRequired,
|
|
241
233
|
/**
|
|
242
234
|
* Provide an optional function to be called when the MenuItem is clicked.
|
|
243
235
|
*/
|
|
244
236
|
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
245
|
-
onClick:
|
|
237
|
+
onClick: PropTypes.func,
|
|
246
238
|
/**
|
|
247
239
|
* A component used to render an icon.
|
|
248
240
|
*/
|
|
249
241
|
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
250
|
-
renderIcon:
|
|
242
|
+
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
251
243
|
/**
|
|
252
244
|
* Provide a shortcut for the action of this MenuItem. Note that the component will only render it as a hint but not actually register the shortcut.
|
|
253
245
|
*/
|
|
254
246
|
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
255
|
-
shortcut:
|
|
247
|
+
shortcut: PropTypes.string
|
|
256
248
|
};
|
|
257
249
|
const MenuItemSelectable = /*#__PURE__*/React.forwardRef(function MenuItemSelectable({
|
|
258
250
|
className,
|
|
@@ -280,8 +272,8 @@ const MenuItemSelectable = /*#__PURE__*/React.forwardRef(function MenuItemSelect
|
|
|
280
272
|
});
|
|
281
273
|
}
|
|
282
274
|
}, [context.state.hasSelectableItems, context]);
|
|
283
|
-
const classNames =
|
|
284
|
-
return /*#__PURE__*/
|
|
275
|
+
const classNames = cx(className, `${prefix}--menu-item-selectable--selected`);
|
|
276
|
+
return /*#__PURE__*/React.createElement(MenuItem, _rollupPluginBabelHelpers.extends({}, rest, {
|
|
285
277
|
ref: forwardRef,
|
|
286
278
|
label: label,
|
|
287
279
|
className: classNames,
|
|
@@ -294,26 +286,26 @@ MenuItemSelectable.propTypes = {
|
|
|
294
286
|
/**
|
|
295
287
|
* Additional CSS class names.
|
|
296
288
|
*/
|
|
297
|
-
className:
|
|
289
|
+
className: PropTypes.string,
|
|
298
290
|
/**
|
|
299
291
|
* Specify whether the option should be selected by default.
|
|
300
292
|
*/
|
|
301
293
|
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
302
|
-
defaultSelected:
|
|
294
|
+
defaultSelected: PropTypes.bool,
|
|
303
295
|
/**
|
|
304
296
|
* A required label titling this option.
|
|
305
297
|
*/
|
|
306
|
-
label:
|
|
298
|
+
label: PropTypes.string.isRequired,
|
|
307
299
|
/**
|
|
308
300
|
* Provide an optional function to be called when the selection state changes.
|
|
309
301
|
*/
|
|
310
302
|
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
311
|
-
onChange:
|
|
303
|
+
onChange: PropTypes.func,
|
|
312
304
|
/**
|
|
313
305
|
* Pass a bool to props.selected to control the state of this option.
|
|
314
306
|
*/
|
|
315
307
|
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
316
|
-
selected:
|
|
308
|
+
selected: PropTypes.bool
|
|
317
309
|
};
|
|
318
310
|
const MenuItemGroup = /*#__PURE__*/React.forwardRef(function MenuItemGroup({
|
|
319
311
|
children,
|
|
@@ -322,12 +314,12 @@ const MenuItemGroup = /*#__PURE__*/React.forwardRef(function MenuItemGroup({
|
|
|
322
314
|
...rest
|
|
323
315
|
}, forwardRef) {
|
|
324
316
|
const prefix = usePrefix.usePrefix();
|
|
325
|
-
const classNames =
|
|
326
|
-
return /*#__PURE__*/
|
|
317
|
+
const classNames = cx(className, `${prefix}--menu-item-group`);
|
|
318
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
327
319
|
className: classNames,
|
|
328
320
|
role: "none",
|
|
329
321
|
ref: forwardRef
|
|
330
|
-
}, /*#__PURE__*/
|
|
322
|
+
}, /*#__PURE__*/React.createElement("ul", _rollupPluginBabelHelpers.extends({}, rest, {
|
|
331
323
|
role: "group",
|
|
332
324
|
"aria-label": label
|
|
333
325
|
}), children));
|
|
@@ -336,15 +328,15 @@ MenuItemGroup.propTypes = {
|
|
|
336
328
|
/**
|
|
337
329
|
* A collection of MenuItems to be rendered within this group.
|
|
338
330
|
*/
|
|
339
|
-
children:
|
|
331
|
+
children: PropTypes.node,
|
|
340
332
|
/**
|
|
341
333
|
* Additional CSS class names.
|
|
342
334
|
*/
|
|
343
|
-
className:
|
|
335
|
+
className: PropTypes.string,
|
|
344
336
|
/**
|
|
345
337
|
* A required label titling this group.
|
|
346
338
|
*/
|
|
347
|
-
label:
|
|
339
|
+
label: PropTypes.string.isRequired
|
|
348
340
|
};
|
|
349
341
|
const defaultItemToString = item => item.toString();
|
|
350
342
|
const MenuItemRadioGroup = /*#__PURE__*/React.forwardRef(function MenuItemRadioGroup({
|
|
@@ -375,15 +367,15 @@ const MenuItemRadioGroup = /*#__PURE__*/React.forwardRef(function MenuItemRadioG
|
|
|
375
367
|
});
|
|
376
368
|
}
|
|
377
369
|
}, [context.state.hasSelectableItems, context]);
|
|
378
|
-
const classNames =
|
|
379
|
-
return /*#__PURE__*/
|
|
370
|
+
const classNames = cx(className, `${prefix}--menu-item-radio-group`);
|
|
371
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
380
372
|
className: classNames,
|
|
381
373
|
role: "none",
|
|
382
374
|
ref: forwardRef
|
|
383
|
-
}, /*#__PURE__*/
|
|
375
|
+
}, /*#__PURE__*/React.createElement("ul", _rollupPluginBabelHelpers.extends({}, rest, {
|
|
384
376
|
role: "group",
|
|
385
377
|
"aria-label": label
|
|
386
|
-
}), items.map((item, i) => /*#__PURE__*/
|
|
378
|
+
}), items.map((item, i) => /*#__PURE__*/React.createElement(MenuItem, {
|
|
387
379
|
key: i,
|
|
388
380
|
label: itemToString(item),
|
|
389
381
|
role: "menuitemradio",
|
|
@@ -397,42 +389,42 @@ MenuItemRadioGroup.propTypes = {
|
|
|
397
389
|
/**
|
|
398
390
|
* Additional CSS class names.
|
|
399
391
|
*/
|
|
400
|
-
className:
|
|
392
|
+
className: PropTypes.string,
|
|
401
393
|
/**
|
|
402
394
|
* Specify the default selected item. Must match the type of props.items.
|
|
403
395
|
*/
|
|
404
|
-
defaultSelectedItem:
|
|
396
|
+
defaultSelectedItem: PropTypes.any,
|
|
405
397
|
/**
|
|
406
398
|
* Provide a function to convert an item to the string that will be rendered. Defaults to item.toString().
|
|
407
399
|
*/
|
|
408
400
|
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
409
|
-
itemToString:
|
|
401
|
+
itemToString: PropTypes.func,
|
|
410
402
|
/**
|
|
411
403
|
* Provide the options for this radio group. Can be of any type, as long as you provide an appropriate props.itemToString function.
|
|
412
404
|
*/
|
|
413
405
|
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
414
|
-
items:
|
|
406
|
+
items: PropTypes.array,
|
|
415
407
|
/**
|
|
416
408
|
* A required label titling this radio group.
|
|
417
409
|
*/
|
|
418
|
-
label:
|
|
410
|
+
label: PropTypes.string.isRequired,
|
|
419
411
|
/**
|
|
420
412
|
* Provide an optional function to be called when the selection changes.
|
|
421
413
|
*/
|
|
422
414
|
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
423
|
-
onChange:
|
|
415
|
+
onChange: PropTypes.func,
|
|
424
416
|
/**
|
|
425
417
|
* Provide props.selectedItem to control the state of this radio group. Must match the type of props.items.
|
|
426
418
|
*/
|
|
427
|
-
selectedItem:
|
|
419
|
+
selectedItem: PropTypes.any
|
|
428
420
|
};
|
|
429
421
|
const MenuItemDivider = /*#__PURE__*/React.forwardRef(function MenuItemDivider({
|
|
430
422
|
className,
|
|
431
423
|
...rest
|
|
432
424
|
}, forwardRef) {
|
|
433
425
|
const prefix = usePrefix.usePrefix();
|
|
434
|
-
const classNames =
|
|
435
|
-
return /*#__PURE__*/
|
|
426
|
+
const classNames = cx(className, `${prefix}--menu-item-divider`);
|
|
427
|
+
return /*#__PURE__*/React.createElement("li", _rollupPluginBabelHelpers.extends({}, rest, {
|
|
436
428
|
className: classNames,
|
|
437
429
|
role: "separator",
|
|
438
430
|
ref: forwardRef
|
|
@@ -442,7 +434,7 @@ MenuItemDivider.propTypes = {
|
|
|
442
434
|
/**
|
|
443
435
|
* Additional CSS class names.
|
|
444
436
|
*/
|
|
445
|
-
className:
|
|
437
|
+
className: PropTypes.string
|
|
446
438
|
};
|
|
447
439
|
|
|
448
440
|
exports.MenuItem = MenuItem;
|
|
@@ -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');
|
|
@@ -25,12 +23,6 @@ var react = require('@floating-ui/react');
|
|
|
25
23
|
var index = require('../FeatureFlags/index.js');
|
|
26
24
|
var mergeRefs = require('../../tools/mergeRefs.js');
|
|
27
25
|
|
|
28
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
29
|
-
|
|
30
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
31
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
32
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
33
|
-
|
|
34
26
|
const validButtonKinds = ['primary', 'tertiary', 'ghost'];
|
|
35
27
|
const defaultButtonKind = 'primary';
|
|
36
28
|
const MenuButton = /*#__PURE__*/React.forwardRef(function MenuButton({
|
|
@@ -94,7 +86,7 @@ const MenuButton = /*#__PURE__*/React.forwardRef(function MenuButton({
|
|
|
94
86
|
middleware: middlewares,
|
|
95
87
|
whileElementsMounted: react.autoUpdate
|
|
96
88
|
});
|
|
97
|
-
const ref = mergeRefs
|
|
89
|
+
const ref = mergeRefs.default(forwardRef, triggerRef);
|
|
98
90
|
const {
|
|
99
91
|
open,
|
|
100
92
|
handleClick: hookOnClick,
|
|
@@ -117,16 +109,16 @@ const MenuButton = /*#__PURE__*/React.forwardRef(function MenuButton({
|
|
|
117
109
|
hookOnClick();
|
|
118
110
|
}
|
|
119
111
|
}
|
|
120
|
-
const containerClasses =
|
|
121
|
-
const triggerClasses =
|
|
112
|
+
const containerClasses = cx(`${prefix}--menu-button__container`, className);
|
|
113
|
+
const triggerClasses = cx(`${prefix}--menu-button__trigger`, {
|
|
122
114
|
[`${prefix}--menu-button__trigger--open`]: open
|
|
123
115
|
});
|
|
124
|
-
const menuClasses =
|
|
125
|
-
return /*#__PURE__*/
|
|
116
|
+
const menuClasses = cx(`${prefix}--menu-button__${menuAlignment}`);
|
|
117
|
+
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({}, rest, {
|
|
126
118
|
ref: ref,
|
|
127
119
|
"aria-owns": open ? id : undefined,
|
|
128
120
|
className: containerClasses
|
|
129
|
-
}), /*#__PURE__*/
|
|
121
|
+
}), /*#__PURE__*/React.createElement(Button.default, {
|
|
130
122
|
ref: refs.setReference,
|
|
131
123
|
className: triggerClasses,
|
|
132
124
|
size: size,
|
|
@@ -139,7 +131,7 @@ const MenuButton = /*#__PURE__*/React.forwardRef(function MenuButton({
|
|
|
139
131
|
onClick: handleClick,
|
|
140
132
|
onMouseDown: handleMousedown,
|
|
141
133
|
"aria-controls": open ? id : undefined
|
|
142
|
-
}, label), /*#__PURE__*/
|
|
134
|
+
}, label), /*#__PURE__*/React.createElement(Menu.Menu, {
|
|
143
135
|
containerRef: triggerRef,
|
|
144
136
|
menuAlignment: menuAlignment,
|
|
145
137
|
className: menuClasses,
|
|
@@ -157,43 +149,43 @@ MenuButton.propTypes = {
|
|
|
157
149
|
/**
|
|
158
150
|
* A collection of MenuItems to be rendered as actions for this MenuButton.
|
|
159
151
|
*/
|
|
160
|
-
children:
|
|
152
|
+
children: PropTypes.node.isRequired,
|
|
161
153
|
/**
|
|
162
154
|
* Additional CSS class names.
|
|
163
155
|
*/
|
|
164
|
-
className:
|
|
156
|
+
className: PropTypes.string,
|
|
165
157
|
/**
|
|
166
158
|
* Specify whether the MenuButton should be disabled, or not.
|
|
167
159
|
*/
|
|
168
|
-
disabled:
|
|
160
|
+
disabled: PropTypes.bool,
|
|
169
161
|
/**
|
|
170
162
|
* Specify the type of button to be used as the base for the trigger button.
|
|
171
163
|
*/
|
|
172
164
|
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
173
|
-
kind:
|
|
165
|
+
kind: PropTypes.oneOf(validButtonKinds),
|
|
174
166
|
/**
|
|
175
167
|
* Provide the label to be rendered on the trigger button.
|
|
176
168
|
*/
|
|
177
|
-
label:
|
|
169
|
+
label: PropTypes.string.isRequired,
|
|
178
170
|
/**
|
|
179
171
|
* Experimental property. Specify how the menu should align with the button element
|
|
180
172
|
*/
|
|
181
|
-
menuAlignment:
|
|
173
|
+
menuAlignment: PropTypes.oneOf(['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end']),
|
|
182
174
|
/**
|
|
183
175
|
* Specify the size of the button and menu.
|
|
184
176
|
*/
|
|
185
177
|
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
186
|
-
size:
|
|
178
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
187
179
|
/**
|
|
188
180
|
* Specify the tabIndex of the button.
|
|
189
181
|
*/
|
|
190
182
|
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
191
|
-
tabIndex:
|
|
183
|
+
tabIndex: PropTypes.number,
|
|
192
184
|
/**
|
|
193
185
|
* Specify a DOM node where the Menu should be rendered in. Defaults to document.body.
|
|
194
186
|
*/
|
|
195
187
|
|
|
196
|
-
menuTarget:
|
|
188
|
+
menuTarget: PropTypes.instanceOf(typeof Element !== 'undefined' ? Element : Object)
|
|
197
189
|
};
|
|
198
190
|
|
|
199
191
|
exports.MenuButton = MenuButton;
|