@carbon/react 1.87.0-rc.0 → 1.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +853 -853
- package/es/_virtual/_rollupPluginBabelHelpers.js +4 -4
- package/es/components/Button/Button.js +1 -1
- package/es/components/Button/index.js +5 -1
- package/es/components/ButtonSet/index.js +4 -1
- package/es/components/Checkbox/index.js +4 -1
- package/es/components/ComboBox/ComboBox.js +1 -1
- package/es/components/ComboBox/index.js +4 -1
- package/es/components/ComposedModal/ComposedModal.js +18 -8
- package/es/components/ContainedList/ContainedListItem/index.js +4 -1
- package/es/components/ContainedList/index.js +2 -2
- package/es/components/Copy/Copy.js +1 -1
- package/es/components/Copy/index.js +4 -1
- package/es/components/CopyButton/index.js +4 -1
- package/es/components/DataTable/Table.js +1 -1
- package/es/components/DataTable/state/getDerivedStateFromProps.d.ts +19 -0
- package/es/components/DataTable/state/getDerivedStateFromProps.js +1 -2
- package/es/components/DataTable/state/sorting.d.ts +15 -0
- package/es/components/DataTable/state/sorting.js +1 -2
- package/es/components/DataTable/tools/denormalize.d.ts +22 -0
- package/es/components/DataTable/tools/denormalize.js +1 -2
- package/es/components/DataTable/tools/normalize.d.ts +9 -0
- package/es/components/DataTable/tools/normalize.js +1 -2
- package/es/components/DatePicker/DatePicker.js +18 -11
- package/es/components/DatePicker/index.js +4 -1
- package/es/components/DatePicker/plugins/fixEventsPlugin.d.ts +2 -0
- package/es/components/DatePicker/plugins/rangePlugin.d.ts +2 -0
- package/es/components/DatePickerInput/DatePickerInput.js +6 -0
- package/es/components/DatePickerInput/index.js +4 -1
- package/es/components/Dialog/index.js +2 -2
- package/es/components/Dropdown/Dropdown.js +2 -2
- package/es/components/Dropdown/index.js +4 -1
- package/es/components/FeatureFlags/index.js +2 -2
- package/es/components/FluidSelect/index.js +4 -1
- package/es/components/FluidTextInput/index.js +4 -1
- package/es/components/IconIndicator/index.js +1 -1
- package/es/components/InlineCheckbox/index.js +4 -1
- package/es/components/InlineLoading/index.js +4 -1
- package/es/components/LayoutDirection/LayoutDirection.js +1 -2
- package/es/components/Link/index.js +4 -1
- package/es/components/ListBox/ListBox.js +1 -1
- package/es/components/Loading/index.js +4 -1
- package/es/components/Menu/Menu.d.ts +3 -1
- package/es/components/Menu/Menu.js +3 -1
- package/es/components/Menu/MenuItem.js +1 -1
- package/es/components/Modal/Modal.js +16 -5
- package/es/components/Modal/index.js +4 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +3 -3
- package/es/components/MultiSelect/MultiSelect.js +2 -2
- package/es/components/MultiSelect/filter.js +0 -4
- package/es/components/MultiSelect/tools/itemToString.d.ts +1 -0
- package/es/components/MultiSelect/tools/sorting.d.ts +9 -0
- package/es/components/Notification/Notification.js +2 -2
- package/es/components/NumberInput/NumberInput.js +1 -1
- package/es/components/OverflowMenu/next/index.js +1 -1
- package/es/components/OverflowMenuItem/index.js +4 -1
- package/es/components/OverflowMenuV2/index.d.ts +1 -0
- package/es/components/PageHeader/PageHeader.js +1 -1
- package/es/components/Pagination/experimental/PageSelector.d.ts +19 -0
- package/es/components/Pagination/experimental/Pagination.d.ts +43 -0
- package/es/components/Pagination/experimental/index.d.ts +3 -0
- package/es/components/Popover/index.js +21 -4
- package/es/components/RadioButton/index.js +4 -1
- package/es/components/RadioTile/index.js +4 -1
- package/es/components/Search/Search.js +1 -1
- package/es/components/Search/index.js +4 -1
- package/es/components/Select/index.js +4 -1
- package/es/components/SelectItem/index.js +4 -1
- package/es/components/ShapeIndicator/index.js +1 -1
- package/es/components/SkeletonText/index.js +4 -1
- package/es/components/Slider/Slider.js +1 -1
- package/es/components/Switch/IconSwitch.d.ts +3 -0
- package/es/components/Switch/IconSwitch.js +1 -2
- package/es/components/TabContent/TabContent.js +2 -22
- package/es/components/Tabs/Tabs.js +5 -5
- package/es/components/Tag/DismissibleTag.js +1 -1
- package/es/components/TextArea/TextArea.js +1 -1
- package/es/components/TextArea/index.js +4 -1
- package/es/components/TextInput/index.js +4 -1
- package/es/components/TextInput/util.d.ts +9 -0
- package/es/components/Toggletip/index.js +2 -2
- package/es/components/UIShell/HeaderMenu.js +2 -2
- package/es/components/UIShell/SideNav.js +1 -1
- package/es/components/UIShell/_utils.d.ts +7 -0
- package/es/feature-flags.d.ts +1 -0
- package/es/internal/FloatingMenu.js +1 -1
- package/es/internal/deprecateFieldOnObject.js +1 -1
- package/es/internal/useId.d.ts +21 -0
- package/es/internal/useId.js +27 -1
- package/es/internal/useOverflowItems.js +0 -6
- package/es/node_modules/es-toolkit/dist/compat/function/{debounce.mjs.js → debounce.js} +1 -1
- package/es/node_modules/es-toolkit/dist/compat/function/{throttle.mjs.js → throttle.js} +1 -1
- package/es/prop-types/deprecateComponent.d.ts +1 -0
- package/es/prop-types/deprecateComponent.js +1 -4
- package/es/prop-types/deprecateValuesWithin.d.ts +1 -0
- package/es/prop-types/requiredIfGivenPropIsTruthy.d.ts +14 -0
- package/es/tools/mergeRefs.d.ts +12 -0
- package/es/tools/mergeRefs.js +1 -2
- package/icons/index.js +1 -3
- package/lib/_virtual/_rollupPluginBabelHelpers.js +5 -7
- package/lib/components/AILabel/index.js +35 -43
- package/lib/components/AISkeleton/AISkeletonIcon.js +5 -11
- package/lib/components/AISkeleton/AISkeletonPlaceholder.js +4 -10
- package/lib/components/AISkeleton/AISkeletonText.js +8 -14
- package/lib/components/Accordion/Accordion.Skeleton.js +21 -27
- package/lib/components/Accordion/Accordion.js +11 -17
- package/lib/components/Accordion/AccordionItem.js +19 -25
- package/lib/components/Accordion/AccordionProvider.js +1 -7
- package/lib/components/AspectRatio/AspectRatio.js +7 -13
- package/lib/components/BadgeIndicator/index.js +7 -13
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +7 -13
- package/lib/components/Breadcrumb/Breadcrumb.js +9 -15
- package/lib/components/Breadcrumb/BreadcrumbItem.js +16 -22
- package/lib/components/Button/Button.Skeleton.js +8 -14
- package/lib/components/Button/Button.js +31 -36
- package/lib/components/Button/ButtonBase.js +6 -11
- package/lib/components/Button/index.js +3 -3
- package/lib/components/ButtonSet/ButtonSet.js +6 -12
- package/lib/components/ButtonSet/index.js +2 -2
- package/lib/components/ChatButton/ChatButton.Skeleton.js +5 -11
- package/lib/components/ChatButton/ChatButton.js +12 -18
- package/lib/components/Checkbox/Checkbox.Skeleton.js +6 -12
- package/lib/components/Checkbox/Checkbox.js +33 -39
- package/lib/components/Checkbox/index.js +3 -3
- package/lib/components/CheckboxGroup/CheckboxGroup.js +24 -30
- package/lib/components/ClassPrefix/index.js +3 -10
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +10 -16
- package/lib/components/CodeSnippet/CodeSnippet.js +39 -46
- package/lib/components/ComboBox/ComboBox.js +57 -64
- package/lib/components/ComboBox/index.js +2 -2
- package/lib/components/ComboButton/index.js +20 -28
- package/lib/components/ComposedModal/ComposedModal.js +61 -57
- package/lib/components/ComposedModal/ModalFooter.js +37 -45
- package/lib/components/ComposedModal/ModalHeader.js +23 -31
- package/lib/components/ContainedList/ContainedList.js +18 -24
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +14 -20
- package/lib/components/ContainedList/ContainedListItem/index.js +2 -2
- package/lib/components/ContainedList/index.js +5 -5
- package/lib/components/ContentSwitcher/ContentSwitcher.js +11 -19
- package/lib/components/ContextMenu/useContextMenu.js +1 -1
- package/lib/components/Copy/Copy.js +12 -18
- package/lib/components/Copy/index.js +2 -2
- package/lib/components/CopyButton/CopyButton.js +12 -18
- package/lib/components/CopyButton/index.js +2 -2
- package/lib/components/DangerButton/DangerButton.js +2 -6
- package/lib/components/DataTable/DataTable.js +48 -55
- package/lib/components/DataTable/Table.js +18 -24
- package/lib/components/DataTable/TableActionList.js +2 -2
- package/lib/components/DataTable/TableBatchAction.js +4 -9
- package/lib/components/DataTable/TableBatchActions.js +19 -25
- package/lib/components/DataTable/TableBody.js +5 -10
- package/lib/components/DataTable/TableCell.js +8 -14
- package/lib/components/DataTable/TableContainer.js +14 -20
- package/lib/components/DataTable/TableContext.js +0 -2
- package/lib/components/DataTable/TableDecoratorRow.js +5 -11
- package/lib/components/DataTable/TableExpandHeader.js +16 -22
- package/lib/components/DataTable/TableExpandRow.js +20 -26
- package/lib/components/DataTable/TableExpandedRow.js +8 -14
- package/lib/components/DataTable/TableHead.js +2 -2
- package/lib/components/DataTable/TableHeader.js +26 -32
- package/lib/components/DataTable/TableRow.js +8 -14
- package/lib/components/DataTable/TableSelectAll.js +13 -19
- package/lib/components/DataTable/TableSelectRow.js +15 -21
- package/lib/components/DataTable/TableSlugRow.js +7 -13
- package/lib/components/DataTable/TableToolbar.js +7 -13
- package/lib/components/DataTable/TableToolbarAction.js +5 -10
- package/lib/components/DataTable/TableToolbarContent.js +2 -2
- package/lib/components/DataTable/TableToolbarMenu.js +9 -15
- package/lib/components/DataTable/TableToolbarSearch.js +22 -28
- package/lib/components/DataTable/state/getDerivedStateFromProps.d.ts +19 -0
- package/lib/components/DataTable/state/getDerivedStateFromProps.js +2 -3
- package/lib/components/DataTable/state/sortStates.js +0 -2
- package/lib/components/DataTable/state/sorting.d.ts +15 -0
- package/lib/components/DataTable/state/sorting.js +0 -2
- package/lib/components/DataTable/tools/cells.js +0 -2
- package/lib/components/DataTable/tools/denormalize.d.ts +22 -0
- package/lib/components/DataTable/tools/denormalize.js +1 -2
- package/lib/components/DataTable/tools/filter.js +0 -2
- package/lib/components/DataTable/tools/normalize.d.ts +9 -0
- package/lib/components/DataTable/tools/normalize.js +1 -2
- package/lib/components/DataTable/tools/sorting.js +0 -2
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +25 -31
- package/lib/components/DatePicker/DatePicker.Skeleton.js +14 -20
- package/lib/components/DatePicker/DatePicker.js +65 -66
- package/lib/components/DatePicker/index.js +3 -3
- package/lib/components/DatePicker/plugins/appendToPlugin.js +0 -2
- package/lib/components/DatePicker/plugins/fixEventsPlugin.d.ts +2 -0
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +1 -1
- package/lib/components/DatePicker/plugins/rangePlugin.d.ts +2 -0
- package/lib/components/DatePicker/plugins/rangePlugin.js +2 -6
- package/lib/components/DatePickerInput/DatePickerInput.js +49 -49
- package/lib/components/DatePickerInput/index.js +2 -2
- package/lib/components/Dialog/index.js +72 -80
- package/lib/components/Dropdown/Dropdown.Skeleton.js +8 -14
- package/lib/components/Dropdown/Dropdown.js +49 -55
- package/lib/components/Dropdown/index.js +3 -3
- package/lib/components/ErrorBoundary/ErrorBoundary.js +4 -9
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +0 -2
- package/lib/components/ExpandableSearch/ExpandableSearch.js +6 -11
- package/lib/components/FeatureFlags/index.js +10 -17
- package/lib/components/FileUploader/FileUploader.Skeleton.js +7 -13
- package/lib/components/FileUploader/FileUploader.js +30 -36
- package/lib/components/FileUploader/FileUploaderButton.js +19 -25
- package/lib/components/FileUploader/FileUploaderDropContainer.js +18 -24
- package/lib/components/FileUploader/FileUploaderItem.js +23 -29
- package/lib/components/FileUploader/Filename.js +13 -18
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +7 -13
- package/lib/components/FluidComboBox/FluidComboBox.js +24 -30
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +14 -20
- package/lib/components/FluidDatePicker/FluidDatePicker.js +12 -18
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +4 -8
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +7 -13
- package/lib/components/FluidDropdown/FluidDropdown.js +24 -30
- package/lib/components/FluidForm/FluidForm.js +6 -12
- package/lib/components/FluidForm/FormContext.js +0 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +7 -13
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +36 -42
- package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +7 -13
- package/lib/components/FluidNumberInput/FluidNumberInput.js +30 -36
- package/lib/components/FluidSearch/FluidSearch.Skeleton.js +7 -13
- package/lib/components/FluidSearch/FluidSearch.js +19 -25
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +7 -13
- package/lib/components/FluidSelect/FluidSelect.js +17 -23
- package/lib/components/FluidSelect/index.js +3 -3
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +7 -13
- package/lib/components/FluidTextArea/FluidTextArea.js +25 -31
- package/lib/components/FluidTextInput/FluidPasswordInput.js +18 -22
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +7 -13
- package/lib/components/FluidTextInput/FluidTextInput.js +23 -29
- package/lib/components/FluidTextInput/index.js +3 -3
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +6 -12
- package/lib/components/FluidTimePicker/FluidTimePicker.js +23 -29
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +10 -15
- package/lib/components/Form/Form.js +5 -11
- package/lib/components/FormGroup/FormGroup.js +13 -19
- package/lib/components/FormItem/FormItem.js +5 -11
- package/lib/components/FormLabel/FormLabel.js +6 -12
- package/lib/components/Grid/CSSGrid.js +20 -28
- package/lib/components/Grid/Column.js +31 -37
- package/lib/components/Grid/ColumnHang.js +5 -13
- package/lib/components/Grid/FlexGrid.js +10 -18
- package/lib/components/Grid/Grid.js +9 -16
- package/lib/components/Grid/GridContext.js +7 -14
- package/lib/components/Grid/Row.js +8 -14
- package/lib/components/Heading/index.js +14 -21
- package/lib/components/Icon/Icon.Skeleton.js +4 -10
- package/lib/components/IconButton/index.js +25 -33
- package/lib/components/IconIndicator/index.js +9 -15
- package/lib/components/IdPrefix/index.js +3 -10
- package/lib/components/InlineCheckbox/InlineCheckbox.js +17 -22
- package/lib/components/InlineCheckbox/index.js +2 -2
- package/lib/components/InlineLoading/InlineLoading.js +17 -23
- package/lib/components/InlineLoading/index.js +2 -2
- package/lib/components/Layer/LayerContext.js +1 -7
- package/lib/components/Layer/LayerLevel.js +0 -2
- package/lib/components/Layer/index.js +11 -19
- package/lib/components/Layout/index.js +22 -30
- package/lib/components/LayoutDirection/LayoutDirection.js +6 -13
- package/lib/components/LayoutDirection/LayoutDirectionContext.js +1 -7
- package/lib/components/LayoutDirection/useLayoutDirection.js +0 -2
- package/lib/components/Link/Link.js +15 -21
- package/lib/components/Link/index.js +2 -2
- package/lib/components/ListBox/ListBox.js +17 -23
- package/lib/components/ListBox/ListBoxField.js +7 -12
- package/lib/components/ListBox/ListBoxMenu.js +7 -12
- package/lib/components/ListBox/ListBoxMenuIcon.js +7 -13
- package/lib/components/ListBox/ListBoxMenuItem.js +9 -15
- package/lib/components/ListBox/ListBoxPropTypes.js +2 -8
- package/lib/components/ListBox/ListBoxSelection.js +14 -20
- package/lib/components/ListBox/index.js +7 -7
- package/lib/components/ListBox/next/ListBoxSelection.js +18 -24
- package/lib/components/ListBox/next/ListBoxTrigger.js +7 -13
- package/lib/components/ListItem/ListItem.js +5 -11
- package/lib/components/Loading/Loading.js +14 -20
- package/lib/components/Loading/index.js +2 -2
- package/lib/components/Menu/Menu.d.ts +3 -1
- package/lib/components/Menu/Menu.js +18 -24
- package/lib/components/Menu/MenuContext.js +0 -2
- package/lib/components/Menu/MenuItem.js +44 -52
- package/lib/components/MenuButton/index.js +16 -24
- package/lib/components/Modal/Modal.js +91 -86
- package/lib/components/Modal/index.js +2 -2
- package/lib/components/ModalWrapper/ModalWrapper.js +30 -35
- package/lib/components/MultiSelect/FilterableMultiSelect.js +57 -67
- package/lib/components/MultiSelect/MultiSelect.js +61 -70
- package/lib/components/MultiSelect/MultiSelectPropTypes.js +2 -8
- package/lib/components/MultiSelect/filter.js +0 -6
- package/lib/components/MultiSelect/tools/itemToString.d.ts +1 -0
- package/lib/components/MultiSelect/tools/itemToString.js +1 -7
- package/lib/components/MultiSelect/tools/sorting.d.ts +9 -0
- package/lib/components/MultiSelect/tools/sorting.js +0 -2
- package/lib/components/Notification/Notification.js +118 -126
- package/lib/components/NumberInput/NumberFormatPropTypes.js +21 -27
- package/lib/components/NumberInput/NumberInput.Skeleton.js +8 -14
- package/lib/components/NumberInput/NumberInput.js +66 -74
- package/lib/components/OrderedList/OrderedList.js +8 -14
- package/lib/components/OverflowMenu/OverflowMenu.js +42 -49
- package/lib/components/OverflowMenu/index.js +3 -7
- package/lib/components/OverflowMenu/next/index.js +18 -26
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +27 -33
- package/lib/components/OverflowMenuItem/index.js +2 -2
- package/lib/components/OverflowMenuV2/index.d.ts +1 -0
- package/lib/components/OverflowMenuV2/index.js +2 -8
- package/lib/components/PageHeader/PageHeader.js +70 -78
- package/lib/components/PageHeader/index.js +0 -2
- package/lib/components/Pagination/Pagination.Skeleton.js +10 -16
- package/lib/components/Pagination/Pagination.js +44 -51
- package/lib/components/Pagination/experimental/PageSelector.d.ts +19 -0
- package/lib/components/Pagination/experimental/PageSelector.js +9 -15
- package/lib/components/Pagination/experimental/Pagination.d.ts +43 -0
- package/lib/components/Pagination/experimental/Pagination.js +34 -40
- package/lib/components/Pagination/experimental/index.d.ts +3 -0
- package/lib/components/PaginationNav/PaginationNav.js +54 -60
- package/lib/components/Popover/index.js +56 -47
- package/lib/components/PrimaryButton/PrimaryButton.js +2 -6
- package/lib/components/ProgressBar/ProgressBar.js +25 -31
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +10 -16
- package/lib/components/ProgressIndicator/ProgressIndicator.js +41 -49
- package/lib/components/RadioButton/RadioButton.Skeleton.js +6 -12
- package/lib/components/RadioButton/RadioButton.js +26 -32
- package/lib/components/RadioButton/index.js +2 -2
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +37 -43
- package/lib/components/RadioTile/RadioTile.js +25 -31
- package/lib/components/RadioTile/index.js +2 -2
- package/lib/components/Search/Search.Skeleton.js +7 -13
- package/lib/components/Search/Search.js +33 -39
- package/lib/components/Search/index.js +3 -3
- package/lib/components/SecondaryButton/SecondaryButton.js +2 -6
- package/lib/components/Select/Select.Skeleton.js +8 -14
- package/lib/components/Select/Select.js +42 -48
- package/lib/components/Select/index.js +3 -3
- package/lib/components/SelectItem/SelectItem.js +8 -14
- package/lib/components/SelectItem/index.js +2 -2
- package/lib/components/SelectItemGroup/SelectItemGroup.js +7 -13
- package/lib/components/ShapeIndicator/index.js +12 -18
- package/lib/components/SkeletonIcon/SkeletonIcon.js +4 -10
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +4 -10
- package/lib/components/SkeletonText/SkeletonText.js +11 -17
- package/lib/components/SkeletonText/index.js +2 -2
- package/lib/components/Slider/Slider.Skeleton.js +29 -35
- package/lib/components/Slider/Slider.js +84 -90
- package/lib/components/Slider/SliderHandles.js +18 -24
- package/lib/components/Slider/index.js +3 -3
- package/lib/components/Stack/HStack.js +1 -7
- package/lib/components/Stack/Stack.js +7 -15
- package/lib/components/Stack/VStack.js +1 -7
- package/lib/components/StructuredList/StructuredList.Skeleton.js +15 -21
- package/lib/components/StructuredList/StructuredList.js +60 -68
- package/lib/components/Switch/IconSwitch.d.ts +3 -0
- package/lib/components/Switch/IconSwitch.js +18 -25
- package/lib/components/Switch/Switch.js +14 -20
- package/lib/components/TabContent/TabContent.js +7 -33
- package/lib/components/Tabs/Tabs.Skeleton.js +10 -16
- package/lib/components/Tabs/Tabs.js +121 -129
- package/lib/components/Tabs/usePressable.js +0 -2
- package/lib/components/Tag/DismissibleTag.js +24 -30
- package/lib/components/Tag/OperationalTag.js +16 -22
- package/lib/components/Tag/SelectableTag.js +19 -25
- package/lib/components/Tag/Tag.Skeleton.js +5 -11
- package/lib/components/Tag/Tag.js +28 -34
- package/lib/components/Tag/isEllipsisActive.js +0 -2
- package/lib/components/Text/Text.js +6 -13
- package/lib/components/Text/TextDirection.js +4 -11
- package/lib/components/Text/TextDirectionContext.js +0 -2
- package/lib/components/Text/createTextComponent.js +1 -7
- package/lib/components/Text/index.js +0 -2
- package/lib/components/TextArea/TextArea.Skeleton.js +7 -13
- package/lib/components/TextArea/TextArea.js +49 -55
- package/lib/components/TextArea/index.js +3 -3
- package/lib/components/TextInput/ControlledPasswordInput.js +36 -42
- package/lib/components/TextInput/PasswordInput.js +48 -54
- package/lib/components/TextInput/TextInput.Skeleton.js +7 -13
- package/lib/components/TextInput/TextInput.js +47 -53
- package/lib/components/TextInput/index.js +3 -3
- package/lib/components/TextInput/util.d.ts +9 -0
- package/lib/components/TextInput/util.js +0 -2
- package/lib/components/Theme/index.js +16 -24
- package/lib/components/Tile/Tile.js +92 -100
- package/lib/components/TileGroup/TileGroup.js +15 -22
- package/lib/components/TimePicker/TimePicker.js +39 -45
- package/lib/components/TimePickerSelect/TimePickerSelect.js +10 -16
- package/lib/components/Toggle/Toggle.Skeleton.js +7 -13
- package/lib/components/Toggle/Toggle.js +28 -34
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +12 -20
- package/lib/components/Toggletip/index.js +32 -40
- package/lib/components/Tooltip/DefinitionTooltip.js +14 -22
- package/lib/components/Tooltip/Tooltip.js +19 -27
- package/lib/components/TreeView/TreeContext.js +0 -2
- package/lib/components/TreeView/TreeNode.js +41 -47
- package/lib/components/TreeView/TreeView.js +17 -23
- package/lib/components/UIShell/Content.js +6 -12
- package/lib/components/UIShell/Header.js +4 -10
- package/lib/components/UIShell/HeaderContainer.js +4 -9
- package/lib/components/UIShell/HeaderGlobalAction.js +11 -17
- package/lib/components/UIShell/HeaderGlobalBar.js +2 -2
- package/lib/components/UIShell/HeaderMenu.js +17 -23
- package/lib/components/UIShell/HeaderMenuButton.js +9 -15
- package/lib/components/UIShell/HeaderMenuItem.js +11 -17
- package/lib/components/UIShell/HeaderName.js +8 -14
- package/lib/components/UIShell/HeaderNavigation.js +6 -12
- package/lib/components/UIShell/HeaderPanel.js +11 -17
- package/lib/components/UIShell/HeaderSideNavItems.js +6 -12
- package/lib/components/UIShell/Link.js +6 -11
- package/lib/components/UIShell/SideNav.js +23 -29
- package/lib/components/UIShell/SideNavDetails.js +7 -13
- package/lib/components/UIShell/SideNavDivider.js +5 -11
- package/lib/components/UIShell/SideNavFooter.js +12 -18
- package/lib/components/UIShell/SideNavHeader.js +8 -14
- package/lib/components/UIShell/SideNavIcon.js +6 -12
- package/lib/components/UIShell/SideNavItem.js +6 -12
- package/lib/components/UIShell/SideNavItems.js +9 -15
- package/lib/components/UIShell/SideNavLink.js +13 -19
- package/lib/components/UIShell/SideNavLinkText.js +5 -11
- package/lib/components/UIShell/SideNavMenu.js +20 -26
- package/lib/components/UIShell/SideNavMenuItem.js +13 -19
- package/lib/components/UIShell/SideNavSwitcher.js +13 -19
- package/lib/components/UIShell/SkipToContent.js +7 -13
- package/lib/components/UIShell/Switcher.js +9 -15
- package/lib/components/UIShell/SwitcherDivider.js +4 -10
- package/lib/components/UIShell/SwitcherItem.js +15 -21
- package/lib/components/UIShell/_utils.d.ts +7 -0
- package/lib/components/UIShell/_utils.js +0 -2
- package/lib/components/UnorderedList/UnorderedList.js +7 -13
- package/lib/feature-flags.d.ts +1 -0
- package/lib/feature-flags.js +3 -4
- package/lib/index.js +180 -182
- package/lib/internal/FloatingMenu.js +10 -18
- package/lib/internal/OptimizedResize.js +2 -8
- package/lib/internal/Selection.js +1 -7
- package/lib/internal/clamp.js +0 -2
- package/lib/internal/createClassWrapper.js +1 -7
- package/lib/internal/deprecateFieldOnObject.js +1 -3
- package/lib/internal/environment.js +0 -2
- package/lib/internal/getAnnouncement.js +0 -2
- package/lib/internal/keyboard/keys.js +0 -2
- package/lib/internal/keyboard/match.js +0 -2
- package/lib/internal/keyboard/navigation.js +0 -2
- package/lib/internal/noopFn.js +0 -2
- package/lib/internal/useAttachedMenu.js +0 -2
- package/lib/internal/useControllableState.js +0 -2
- package/lib/internal/useDelayedState.js +0 -2
- package/lib/internal/useEvent.js +0 -2
- package/lib/internal/useId.d.ts +21 -0
- package/lib/internal/useId.js +27 -7
- package/lib/internal/useIdPrefix.js +2 -8
- package/lib/internal/useIsomorphicEffect.js +1 -1
- package/lib/internal/useMatchMedia.js +0 -2
- package/lib/internal/useMergedRefs.js +0 -2
- package/lib/internal/useNoInteractiveChildren.js +0 -2
- package/lib/internal/useNormalizedInputProps.js +2 -8
- package/lib/internal/useOutsideClick.js +0 -2
- package/lib/internal/useOverflowItems.js +1 -7
- package/lib/internal/usePrefix.js +2 -8
- package/lib/internal/usePreviousValue.js +0 -2
- package/lib/internal/useResizeObserver.js +0 -2
- package/lib/internal/useSavedCallback.js +0 -2
- package/lib/internal/utils.js +0 -2
- package/lib/internal/warning.js +0 -2
- package/lib/internal/wrapFocus.js +0 -2
- package/lib/node_modules/es-toolkit/dist/compat/function/{debounce.mjs.js → debounce.js} +1 -3
- package/lib/node_modules/es-toolkit/dist/compat/function/{throttle.mjs.js → throttle.js} +1 -3
- package/lib/node_modules/es-toolkit/dist/function/{debounce.mjs.js → debounce.js} +0 -2
- package/lib/prop-types/AriaPropTypes.js +2 -8
- package/lib/prop-types/deprecate.js +0 -2
- package/lib/prop-types/deprecateComponent.d.ts +1 -0
- package/lib/prop-types/deprecateComponent.js +2 -5
- package/lib/prop-types/deprecateValuesWithin.d.ts +1 -0
- package/lib/prop-types/deprecateValuesWithin.js +1 -1
- package/lib/prop-types/isRequiredOneOf.js +0 -2
- package/lib/prop-types/requiredIfGivenPropIsTruthy.d.ts +14 -0
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +1 -1
- package/lib/tools/events.js +0 -2
- package/lib/tools/mapPopoverAlign.js +0 -2
- package/lib/tools/mergeRefs.d.ts +12 -0
- package/lib/tools/mergeRefs.js +1 -2
- package/lib/tools/setupGetInstanceId.js +0 -2
- package/lib/tools/toggleClass.js +0 -2
- package/lib/tools/wrapComponent.js +4 -10
- package/package.json +11 -11
- /package/es/node_modules/es-toolkit/dist/function/{debounce.mjs.js → debounce.js} +0 -0
|
@@ -7,18 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
-
|
|
12
10
|
var PropTypes = require('prop-types');
|
|
13
11
|
|
|
14
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
|
-
|
|
16
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
17
|
-
|
|
18
12
|
const listBoxTypes = ['default', 'inline'];
|
|
19
13
|
const listBoxSizes = ['sm', 'md', 'lg'];
|
|
20
|
-
const ListBoxTypePropType =
|
|
21
|
-
const ListBoxSizePropType =
|
|
14
|
+
const ListBoxTypePropType = PropTypes.oneOf(listBoxTypes);
|
|
15
|
+
const ListBoxSizePropType = PropTypes.oneOf(listBoxSizes);
|
|
22
16
|
|
|
23
17
|
exports.ListBoxSizePropType = ListBoxSizePropType;
|
|
24
18
|
exports.ListBoxTypePropType = ListBoxTypePropType;
|
|
@@ -15,12 +15,6 @@ var PropTypes = require('prop-types');
|
|
|
15
15
|
var iconsReact = require('@carbon/icons-react');
|
|
16
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
17
|
|
|
18
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
-
|
|
20
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
21
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
22
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
23
|
-
|
|
24
18
|
var _Close, _Close2;
|
|
25
19
|
const translationIds = {
|
|
26
20
|
'clear.all': 'clear.all',
|
|
@@ -51,7 +45,7 @@ const ListBoxSelection = ({
|
|
|
51
45
|
readOnly
|
|
52
46
|
}) => {
|
|
53
47
|
const prefix = usePrefix.usePrefix();
|
|
54
|
-
const className =
|
|
48
|
+
const className = cx(`${prefix}--list-box__selection`, {
|
|
55
49
|
[`${prefix}--tag--filter`]: selectionCount,
|
|
56
50
|
[`${prefix}--list-box__selection--multi`]: selectionCount
|
|
57
51
|
});
|
|
@@ -66,17 +60,17 @@ const ListBoxSelection = ({
|
|
|
66
60
|
}
|
|
67
61
|
};
|
|
68
62
|
const description = selectionCount ? t('clear.all') : t('clear.selection');
|
|
69
|
-
const tagClasses =
|
|
63
|
+
const tagClasses = cx(`${prefix}--tag`, `${prefix}--tag--filter`, `${prefix}--tag--high-contrast`, {
|
|
70
64
|
[`${prefix}--tag--disabled`]: disabled
|
|
71
65
|
});
|
|
72
66
|
|
|
73
67
|
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
74
|
-
return selectionCount ? /*#__PURE__*/
|
|
68
|
+
return selectionCount ? /*#__PURE__*/React.createElement("div", {
|
|
75
69
|
className: tagClasses
|
|
76
|
-
}, /*#__PURE__*/
|
|
70
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
77
71
|
className: `${prefix}--tag__label`,
|
|
78
72
|
title: `${selectionCount}`
|
|
79
|
-
}, selectionCount), /*#__PURE__*/
|
|
73
|
+
}, selectionCount), /*#__PURE__*/React.createElement("div", {
|
|
80
74
|
role: "button",
|
|
81
75
|
tabIndex: -1,
|
|
82
76
|
className: `${prefix}--tag__close-icon`,
|
|
@@ -84,46 +78,46 @@ const ListBoxSelection = ({
|
|
|
84
78
|
"aria-label": t('clear.all'),
|
|
85
79
|
title: description,
|
|
86
80
|
"aria-disabled": readOnly ? true : undefined
|
|
87
|
-
}, _Close || (_Close = /*#__PURE__*/
|
|
81
|
+
}, _Close || (_Close = /*#__PURE__*/React.createElement(iconsReact.Close, null)))) : /*#__PURE__*/React.createElement("div", {
|
|
88
82
|
role: "button",
|
|
89
83
|
className: className,
|
|
90
84
|
tabIndex: -1,
|
|
91
85
|
onClick: handleOnClick,
|
|
92
86
|
"aria-label": description,
|
|
93
87
|
title: description
|
|
94
|
-
}, selectionCount, _Close2 || (_Close2 = /*#__PURE__*/
|
|
88
|
+
}, selectionCount, _Close2 || (_Close2 = /*#__PURE__*/React.createElement(iconsReact.Close, null)));
|
|
95
89
|
};
|
|
96
90
|
ListBoxSelection.propTypes = {
|
|
97
91
|
/**
|
|
98
92
|
* Specify a function to be invoked when a user interacts with the clear
|
|
99
93
|
* selection element.
|
|
100
94
|
*/
|
|
101
|
-
clearSelection:
|
|
95
|
+
clearSelection: PropTypes.func.isRequired,
|
|
102
96
|
/**
|
|
103
97
|
* Specify whether or not the clear selection element should be disabled
|
|
104
98
|
*/
|
|
105
|
-
disabled:
|
|
99
|
+
disabled: PropTypes.bool,
|
|
106
100
|
/**
|
|
107
101
|
* Specify an optional `onClearSelection` handler that is called when the underlying
|
|
108
102
|
* element is cleared
|
|
109
103
|
*/
|
|
110
|
-
onClearSelection:
|
|
104
|
+
onClearSelection: PropTypes.func,
|
|
111
105
|
/**
|
|
112
106
|
* Whether or not the Dropdown is readonly
|
|
113
107
|
*/
|
|
114
|
-
readOnly:
|
|
108
|
+
readOnly: PropTypes.bool,
|
|
115
109
|
/**
|
|
116
110
|
* Specify an optional `selectionCount` value that will be used to determine
|
|
117
111
|
* whether the selection should display a badge or a single clear icon.
|
|
118
112
|
*/
|
|
119
|
-
selectionCount:
|
|
113
|
+
selectionCount: PropTypes.number,
|
|
120
114
|
/**
|
|
121
115
|
* i18n hook used to provide the appropriate description for the given menu
|
|
122
116
|
* icon. This function takes in an id defined in `translationIds` and should
|
|
123
117
|
* return a string message for that given message id.
|
|
124
118
|
*/
|
|
125
|
-
translateWithId:
|
|
119
|
+
translateWithId: PropTypes.func
|
|
126
120
|
};
|
|
127
121
|
|
|
128
|
-
exports
|
|
122
|
+
exports.default = ListBoxSelection;
|
|
129
123
|
exports.translationIds = translationIds;
|
|
@@ -17,14 +17,14 @@ var ListBoxMenuIcon = require('./ListBoxMenuIcon.js');
|
|
|
17
17
|
var ListBoxMenuItem = require('./ListBoxMenuItem.js');
|
|
18
18
|
var ListBoxSelection = require('./ListBoxSelection.js');
|
|
19
19
|
|
|
20
|
-
const ListBox = Object.assign(ListBox$1
|
|
21
|
-
Field: ListBoxField
|
|
22
|
-
Menu: ListBoxMenu
|
|
23
|
-
MenuIcon: ListBoxMenuIcon
|
|
24
|
-
MenuItem: ListBoxMenuItem
|
|
25
|
-
Selection: ListBoxSelection
|
|
20
|
+
const ListBox = Object.assign(ListBox$1.default, {
|
|
21
|
+
Field: ListBoxField.default,
|
|
22
|
+
Menu: ListBoxMenu.default,
|
|
23
|
+
MenuIcon: ListBoxMenuIcon.default,
|
|
24
|
+
MenuItem: ListBoxMenuItem.default,
|
|
25
|
+
Selection: ListBoxSelection.default
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
exports.ListBoxSizePropType = ListBoxPropTypes.ListBoxSizePropType;
|
|
29
29
|
exports.ListBoxTypePropType = ListBoxPropTypes.ListBoxTypePropType;
|
|
30
|
-
exports
|
|
30
|
+
exports.default = ListBox;
|
|
@@ -16,12 +16,6 @@ var PropTypes = require('prop-types');
|
|
|
16
16
|
var iconsReact = require('@carbon/icons-react');
|
|
17
17
|
var usePrefix = require('../../../internal/usePrefix.js');
|
|
18
18
|
|
|
19
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
|
-
|
|
21
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
22
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
24
|
-
|
|
25
19
|
var _Close, _Close2;
|
|
26
20
|
const defaultTranslations = {
|
|
27
21
|
'clear.all': 'Clear all selected items',
|
|
@@ -40,12 +34,12 @@ function ListBoxSelection({
|
|
|
40
34
|
...rest
|
|
41
35
|
}) {
|
|
42
36
|
const prefix = usePrefix.usePrefix();
|
|
43
|
-
const className =
|
|
37
|
+
const className = cx(`${prefix}--list-box__selection`, {
|
|
44
38
|
[`${prefix}--tag--filter`]: selectionCount,
|
|
45
39
|
[`${prefix}--list-box__selection--multi`]: selectionCount
|
|
46
40
|
});
|
|
47
41
|
const description = selectionCount ? t('clear.all') : t('clear.selection');
|
|
48
|
-
const tagClasses =
|
|
42
|
+
const tagClasses = cx(`${prefix}--tag`, `${prefix}--tag--filter`, `${prefix}--tag--high-contrast`, {
|
|
49
43
|
[`${prefix}--tag--disabled`]: disabled
|
|
50
44
|
});
|
|
51
45
|
function onClick(event) {
|
|
@@ -59,12 +53,12 @@ function ListBoxSelection({
|
|
|
59
53
|
}
|
|
60
54
|
}
|
|
61
55
|
if (selectionCount) {
|
|
62
|
-
return /*#__PURE__*/
|
|
56
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
63
57
|
className: tagClasses
|
|
64
|
-
}, /*#__PURE__*/
|
|
58
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
65
59
|
className: `${prefix}--tag__label`,
|
|
66
60
|
title: selectionCount?.toString()
|
|
67
|
-
}, selectionCount), /*#__PURE__*/
|
|
61
|
+
}, selectionCount), /*#__PURE__*/React.createElement("button", {
|
|
68
62
|
"aria-label": description,
|
|
69
63
|
className: `${prefix}--tag__close-icon`,
|
|
70
64
|
disabled: disabled || readOnly,
|
|
@@ -73,9 +67,9 @@ function ListBoxSelection({
|
|
|
73
67
|
title: description,
|
|
74
68
|
type: "button",
|
|
75
69
|
"aria-disabled": readOnly ? true : undefined
|
|
76
|
-
}, _Close || (_Close = /*#__PURE__*/
|
|
70
|
+
}, _Close || (_Close = /*#__PURE__*/React.createElement(iconsReact.Close, null))));
|
|
77
71
|
}
|
|
78
|
-
return /*#__PURE__*/
|
|
72
|
+
return /*#__PURE__*/React.createElement("button", _rollupPluginBabelHelpers.extends({}, rest, {
|
|
79
73
|
"aria-label": description,
|
|
80
74
|
className: className,
|
|
81
75
|
disabled: disabled || readOnly,
|
|
@@ -84,53 +78,53 @@ function ListBoxSelection({
|
|
|
84
78
|
title: description,
|
|
85
79
|
type: "button",
|
|
86
80
|
"aria-disabled": readOnly ? true : undefined
|
|
87
|
-
}), _Close2 || (_Close2 = /*#__PURE__*/
|
|
81
|
+
}), _Close2 || (_Close2 = /*#__PURE__*/React.createElement(iconsReact.Close, null)));
|
|
88
82
|
}
|
|
89
83
|
ListBoxSelection.propTypes = {
|
|
90
84
|
/**
|
|
91
85
|
* Specify a function to be invoked when a user interacts with the clear
|
|
92
86
|
* selection element.
|
|
93
87
|
*/
|
|
94
|
-
clearSelection:
|
|
88
|
+
clearSelection: PropTypes.func.isRequired,
|
|
95
89
|
/**
|
|
96
90
|
* Specify whether or not the clear selection element should be disabled
|
|
97
91
|
*/
|
|
98
|
-
disabled:
|
|
92
|
+
disabled: PropTypes.bool,
|
|
99
93
|
/**
|
|
100
94
|
* Whether or not the listbox is readonly
|
|
101
95
|
*/
|
|
102
|
-
readOnly:
|
|
96
|
+
readOnly: PropTypes.bool,
|
|
103
97
|
/**
|
|
104
98
|
* Specify an optional `onClearSelection` handler that is called when the underlying
|
|
105
99
|
* element is cleared
|
|
106
100
|
*/
|
|
107
|
-
onClearSelection:
|
|
101
|
+
onClearSelection: PropTypes.func,
|
|
108
102
|
/**
|
|
109
103
|
* Specify an optional `onClick` handler that is called when the underlying
|
|
110
104
|
* clear selection element is clicked
|
|
111
105
|
*/
|
|
112
|
-
onClick:
|
|
106
|
+
onClick: PropTypes.func,
|
|
113
107
|
/**
|
|
114
108
|
* Specify an optional `onClick` handler that is called when the underlying
|
|
115
109
|
* clear selection element is clicked
|
|
116
110
|
*/
|
|
117
|
-
onMouseUp:
|
|
111
|
+
onMouseUp: PropTypes.func,
|
|
118
112
|
/**
|
|
119
113
|
* Specify an optional `onKeyDown` handler that is called when the underlying
|
|
120
114
|
* clear selection element fires a keydown event
|
|
121
115
|
*/
|
|
122
|
-
onKeyDown:
|
|
116
|
+
onKeyDown: PropTypes.func,
|
|
123
117
|
/**
|
|
124
118
|
* Specify an optional `selectionCount` value that will be used to determine
|
|
125
119
|
* whether the selection should display a badge or a single clear icon.
|
|
126
120
|
*/
|
|
127
|
-
selectionCount:
|
|
121
|
+
selectionCount: PropTypes.number,
|
|
128
122
|
/**
|
|
129
123
|
* i18n hook used to provide the appropriate description for the given menu
|
|
130
124
|
* icon. This function takes in an id defined in `translationIds` and should
|
|
131
125
|
* return a string message for that given message id.
|
|
132
126
|
*/
|
|
133
|
-
translateWithId:
|
|
127
|
+
translateWithId: PropTypes.func
|
|
134
128
|
};
|
|
135
129
|
|
|
136
|
-
exports
|
|
130
|
+
exports.default = ListBoxSelection;
|
|
@@ -16,12 +16,6 @@ var PropTypes = require('prop-types');
|
|
|
16
16
|
var iconsReact = require('@carbon/icons-react');
|
|
17
17
|
var usePrefix = require('../../../internal/usePrefix.js');
|
|
18
18
|
|
|
19
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
|
-
|
|
21
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
22
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
24
|
-
|
|
25
19
|
var _ChevronDown;
|
|
26
20
|
const translationIds = {
|
|
27
21
|
'close.menu': 'close.menu',
|
|
@@ -37,39 +31,39 @@ const defaultTranslateWithId = id => defaultTranslations[id];
|
|
|
37
31
|
* state of the menu for a given `ListBox`
|
|
38
32
|
*/
|
|
39
33
|
|
|
40
|
-
const ListBoxTrigger = /*#__PURE__*/
|
|
34
|
+
const ListBoxTrigger = /*#__PURE__*/React.forwardRef(function ListBoxTrigger({
|
|
41
35
|
isOpen,
|
|
42
36
|
translateWithId: t = defaultTranslateWithId,
|
|
43
37
|
...rest
|
|
44
38
|
}, ref) {
|
|
45
39
|
const prefix = usePrefix.usePrefix();
|
|
46
|
-
const className =
|
|
40
|
+
const className = cx({
|
|
47
41
|
[`${prefix}--list-box__menu-icon`]: true,
|
|
48
42
|
[`${prefix}--list-box__menu-icon--open`]: isOpen
|
|
49
43
|
});
|
|
50
44
|
const description = isOpen ? t('close.menu') : t('open.menu');
|
|
51
|
-
return /*#__PURE__*/
|
|
45
|
+
return /*#__PURE__*/React.createElement("button", _rollupPluginBabelHelpers.extends({}, rest, {
|
|
52
46
|
"aria-label": description,
|
|
53
47
|
title: description,
|
|
54
48
|
className: className,
|
|
55
49
|
type: "button",
|
|
56
50
|
tabIndex: -1,
|
|
57
51
|
ref: ref
|
|
58
|
-
}), _ChevronDown || (_ChevronDown = /*#__PURE__*/
|
|
52
|
+
}), _ChevronDown || (_ChevronDown = /*#__PURE__*/React.createElement(iconsReact.ChevronDown, null)));
|
|
59
53
|
});
|
|
60
54
|
ListBoxTrigger.propTypes = {
|
|
61
55
|
/**
|
|
62
56
|
* Specify whether the menu is currently open, which will influence the
|
|
63
57
|
* direction of the menu icon
|
|
64
58
|
*/
|
|
65
|
-
isOpen:
|
|
59
|
+
isOpen: PropTypes.bool.isRequired,
|
|
66
60
|
/**
|
|
67
61
|
* i18n hook used to provide the appropriate description for the given menu
|
|
68
62
|
* icon. This function takes in an id defined in `translationIds` and should
|
|
69
63
|
* return a string message for that given message id.
|
|
70
64
|
*/
|
|
71
|
-
translateWithId:
|
|
65
|
+
translateWithId: PropTypes.func
|
|
72
66
|
};
|
|
73
67
|
|
|
74
|
-
exports
|
|
68
|
+
exports.default = ListBoxTrigger;
|
|
75
69
|
exports.translationIds = translationIds;
|
|
@@ -17,20 +17,14 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
17
17
|
require('../Text/index.js');
|
|
18
18
|
var Text = require('../Text/Text.js');
|
|
19
19
|
|
|
20
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
21
|
-
|
|
22
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
23
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
24
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
25
|
-
|
|
26
20
|
function ListItem({
|
|
27
21
|
className,
|
|
28
22
|
children,
|
|
29
23
|
...other
|
|
30
24
|
}) {
|
|
31
25
|
const prefix = usePrefix.usePrefix();
|
|
32
|
-
const classNames =
|
|
33
|
-
return /*#__PURE__*/
|
|
26
|
+
const classNames = cx(`${prefix}--list__item`, className);
|
|
27
|
+
return /*#__PURE__*/React.createElement(Text.Text, _rollupPluginBabelHelpers.extends({
|
|
34
28
|
as: "li",
|
|
35
29
|
className: classNames
|
|
36
30
|
}, other), children);
|
|
@@ -39,11 +33,11 @@ ListItem.propTypes = {
|
|
|
39
33
|
/**
|
|
40
34
|
* Specify the content for the ListItem
|
|
41
35
|
*/
|
|
42
|
-
children:
|
|
36
|
+
children: PropTypes.node,
|
|
43
37
|
/**
|
|
44
38
|
* Specify an optional className to apply to the underlying `<li>` node
|
|
45
39
|
*/
|
|
46
|
-
className:
|
|
40
|
+
className: PropTypes.string
|
|
47
41
|
};
|
|
48
42
|
|
|
49
|
-
exports
|
|
43
|
+
exports.default = ListItem;
|
|
@@ -16,12 +16,6 @@ var React = require('react');
|
|
|
16
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
17
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
18
18
|
|
|
19
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
|
-
|
|
21
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
22
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
23
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
24
|
-
|
|
25
19
|
function Loading({
|
|
26
20
|
active = true,
|
|
27
21
|
className: customClassName,
|
|
@@ -31,34 +25,34 @@ function Loading({
|
|
|
31
25
|
...rest
|
|
32
26
|
}) {
|
|
33
27
|
const prefix = usePrefix.usePrefix();
|
|
34
|
-
const loadingClassName =
|
|
28
|
+
const loadingClassName = cx(customClassName, {
|
|
35
29
|
[`${prefix}--loading`]: true,
|
|
36
30
|
[`${prefix}--loading--small`]: small,
|
|
37
31
|
[`${prefix}--loading--stop`]: !active
|
|
38
32
|
});
|
|
39
|
-
const overlayClassName =
|
|
33
|
+
const overlayClassName = cx({
|
|
40
34
|
[`${prefix}--loading-overlay`]: true,
|
|
41
35
|
[`${prefix}--loading-overlay--stop`]: !active
|
|
42
36
|
});
|
|
43
|
-
const loading = /*#__PURE__*/
|
|
37
|
+
const loading = /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({}, rest, {
|
|
44
38
|
"aria-atomic": "true",
|
|
45
39
|
"aria-live": active ? 'assertive' : 'off',
|
|
46
40
|
className: loadingClassName
|
|
47
|
-
}), /*#__PURE__*/
|
|
41
|
+
}), /*#__PURE__*/React.createElement("svg", {
|
|
48
42
|
className: `${prefix}--loading__svg`,
|
|
49
43
|
viewBox: "0 0 100 100"
|
|
50
|
-
}, /*#__PURE__*/
|
|
44
|
+
}, /*#__PURE__*/React.createElement("title", null, description), small ? /*#__PURE__*/React.createElement("circle", {
|
|
51
45
|
className: `${prefix}--loading__background`,
|
|
52
46
|
cx: "50%",
|
|
53
47
|
cy: "50%",
|
|
54
48
|
r: "42"
|
|
55
|
-
}) : null, /*#__PURE__*/
|
|
49
|
+
}) : null, /*#__PURE__*/React.createElement("circle", {
|
|
56
50
|
className: `${prefix}--loading__stroke`,
|
|
57
51
|
cx: "50%",
|
|
58
52
|
cy: "50%",
|
|
59
53
|
r: small ? '42' : '44'
|
|
60
54
|
})));
|
|
61
|
-
return withOverlay ? /*#__PURE__*/
|
|
55
|
+
return withOverlay ? /*#__PURE__*/React.createElement("div", {
|
|
62
56
|
className: overlayClassName
|
|
63
57
|
}, loading) : loading;
|
|
64
58
|
}
|
|
@@ -66,27 +60,27 @@ Loading.propTypes = {
|
|
|
66
60
|
/**
|
|
67
61
|
* Specify whether you want the loading indicator to be spinning or not
|
|
68
62
|
*/
|
|
69
|
-
active:
|
|
63
|
+
active: PropTypes.bool,
|
|
70
64
|
/**
|
|
71
65
|
* Provide an optional className to be applied to the containing node
|
|
72
66
|
*/
|
|
73
|
-
className:
|
|
67
|
+
className: PropTypes.string,
|
|
74
68
|
/**
|
|
75
69
|
* Specify a description that would be used to best describe the loading state
|
|
76
70
|
*/
|
|
77
|
-
description:
|
|
71
|
+
description: PropTypes.string,
|
|
78
72
|
/**
|
|
79
73
|
* Provide an `id` to uniquely identify the label
|
|
80
74
|
*/
|
|
81
|
-
id: deprecate.deprecate(
|
|
75
|
+
id: deprecate.deprecate(PropTypes.string, `\nThe prop \`id\` is no longer needed.`),
|
|
82
76
|
/**
|
|
83
77
|
* Specify whether you would like the small variant of <Loading>
|
|
84
78
|
*/
|
|
85
|
-
small:
|
|
79
|
+
small: PropTypes.bool,
|
|
86
80
|
/**
|
|
87
81
|
* Specify whether you want the loader to be applied with an overlay
|
|
88
82
|
*/
|
|
89
|
-
withOverlay:
|
|
83
|
+
withOverlay: PropTypes.bool
|
|
90
84
|
};
|
|
91
85
|
|
|
92
|
-
exports
|
|
86
|
+
exports.default = Loading;
|
|
@@ -36,7 +36,9 @@ export interface MenuProps extends React.HTMLAttributes<HTMLUListElement> {
|
|
|
36
36
|
*/
|
|
37
37
|
mode?: 'full' | 'basic';
|
|
38
38
|
/**
|
|
39
|
-
* Provide an optional function to be called when the Menu should be closed
|
|
39
|
+
* Provide an optional function to be called when the Menu should be closed,
|
|
40
|
+
* including if the Menu is blurred, the user presses escape, or the Menu is
|
|
41
|
+
* a submenu and the user presses ArrowLeft.
|
|
40
42
|
*/
|
|
41
43
|
onClose?: () => void;
|
|
42
44
|
/**
|
|
@@ -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');
|
|
@@ -24,12 +22,6 @@ require('../LayoutDirection/LayoutDirection.js');
|
|
|
24
22
|
var useLayoutDirection = require('../LayoutDirection/useLayoutDirection.js');
|
|
25
23
|
var environment = require('../../internal/environment.js');
|
|
26
24
|
|
|
27
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
28
|
-
|
|
29
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
30
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
31
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
32
|
-
|
|
33
25
|
const spacing = 8; // distance to keep to window edges, in px
|
|
34
26
|
|
|
35
27
|
const Menu = /*#__PURE__*/React.forwardRef(function Menu({
|
|
@@ -274,7 +266,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu({
|
|
|
274
266
|
}
|
|
275
267
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
276
268
|
}, [open]);
|
|
277
|
-
const classNames =
|
|
269
|
+
const classNames = cx(className, `${prefix}--menu`, `${prefix}--menu--${menuSize}`, {
|
|
278
270
|
// --open sets visibility and --shown sets opacity.
|
|
279
271
|
// visibility is needed for focusing elements.
|
|
280
272
|
// opacity is only set once the position has been set correctly
|
|
@@ -286,9 +278,9 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu({
|
|
|
286
278
|
[`${prefix}--menu--with-selectable-items`]: childContext.state.hasSelectableItems,
|
|
287
279
|
[`${prefix}--autoalign`]: !legacyAutoalign
|
|
288
280
|
});
|
|
289
|
-
const rendered = /*#__PURE__*/
|
|
281
|
+
const rendered = /*#__PURE__*/React.createElement(MenuContext.MenuContext.Provider, {
|
|
290
282
|
value: childContext
|
|
291
|
-
}, /*#__PURE__*/
|
|
283
|
+
}, /*#__PURE__*/React.createElement("ul", _rollupPluginBabelHelpers.extends({}, rest, {
|
|
292
284
|
className: classNames,
|
|
293
285
|
role: "menu",
|
|
294
286
|
ref: ref,
|
|
@@ -306,20 +298,20 @@ Menu.propTypes = {
|
|
|
306
298
|
/**
|
|
307
299
|
* A collection of MenuItems to be rendered within this Menu.
|
|
308
300
|
*/
|
|
309
|
-
children:
|
|
301
|
+
children: PropTypes.node,
|
|
310
302
|
/**
|
|
311
303
|
* Additional CSS class names.
|
|
312
304
|
*/
|
|
313
|
-
className:
|
|
305
|
+
className: PropTypes.string,
|
|
314
306
|
/**
|
|
315
307
|
* A label describing the Menu.
|
|
316
308
|
*/
|
|
317
309
|
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
318
|
-
label:
|
|
310
|
+
label: PropTypes.string,
|
|
319
311
|
/**
|
|
320
312
|
* Specify how the menu should align with the button element
|
|
321
313
|
*/
|
|
322
|
-
menuAlignment:
|
|
314
|
+
menuAlignment: PropTypes.string,
|
|
323
315
|
/**
|
|
324
316
|
* **Deprecated**: Menus now always support both icons as well as selectable items and nesting.
|
|
325
317
|
* The mode of this menu. Defaults to full.
|
|
@@ -328,38 +320,40 @@ Menu.propTypes = {
|
|
|
328
320
|
*
|
|
329
321
|
* **This prop is not intended for use and will be set by the respective implementation (like useContextMenu, MenuButton, and ComboButton).**
|
|
330
322
|
*/
|
|
331
|
-
mode: deprecate.deprecate(
|
|
323
|
+
mode: deprecate.deprecate(PropTypes.oneOf(['full', 'basic']), 'Menus now always support both icons as well as selectable items and nesting.'),
|
|
332
324
|
/**
|
|
333
|
-
* Provide an optional function to be called when the Menu should be closed
|
|
325
|
+
* Provide an optional function to be called when the Menu should be closed,
|
|
326
|
+
* including if the Menu is blurred, the user presses escape, or the Menu is
|
|
327
|
+
* a submenu and the user presses ArrowLeft.
|
|
334
328
|
*/
|
|
335
|
-
onClose:
|
|
329
|
+
onClose: PropTypes.func,
|
|
336
330
|
/**
|
|
337
331
|
* Provide an optional function to be called when the Menu is opened.
|
|
338
332
|
*/
|
|
339
|
-
onOpen:
|
|
333
|
+
onOpen: PropTypes.func,
|
|
340
334
|
/**
|
|
341
335
|
* Whether the Menu is open or not.
|
|
342
336
|
*/
|
|
343
|
-
open:
|
|
337
|
+
open: PropTypes.bool,
|
|
344
338
|
/**
|
|
345
339
|
* Specify the size of the Menu.
|
|
346
340
|
*/
|
|
347
|
-
size:
|
|
341
|
+
size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg']),
|
|
348
342
|
/**
|
|
349
343
|
* Specify a DOM node where the Menu should be rendered in. Defaults to document.body.
|
|
350
344
|
*/
|
|
351
345
|
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
352
|
-
target:
|
|
346
|
+
target: PropTypes.object,
|
|
353
347
|
/**
|
|
354
348
|
* Specify the x position of the Menu. Either pass a single number or an array with two numbers describing your activator's boundaries ([x1, x2])
|
|
355
349
|
*/
|
|
356
350
|
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
357
|
-
x:
|
|
351
|
+
x: PropTypes.oneOfType([PropTypes.number, PropTypes.arrayOf(PropTypes.number)]),
|
|
358
352
|
/**
|
|
359
353
|
* Specify the y position of the Menu. Either pass a single number or an array with two numbers describing your activator's boundaries ([y1, y2])
|
|
360
354
|
*/
|
|
361
355
|
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
362
|
-
y:
|
|
356
|
+
y: PropTypes.oneOfType([PropTypes.number, PropTypes.arrayOf(PropTypes.number)])
|
|
363
357
|
};
|
|
364
358
|
|
|
365
359
|
exports.Menu = Menu;
|