@carbon/react 1.86.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 +871 -871
- package/es/_virtual/_rollupPluginBabelHelpers.js +4 -4
- package/es/components/Button/Button.Skeleton.js +2 -1
- package/es/components/Button/Button.d.ts +1 -1
- package/es/components/Button/Button.js +3 -3
- package/es/components/Button/ButtonBase.js +2 -0
- 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/CodeSnippet/CodeSnippet.js +1 -0
- package/es/components/ComboBox/ComboBox.d.ts +7 -0
- package/es/components/ComboBox/ComboBox.js +11 -2
- package/es/components/ComboBox/index.js +4 -1
- package/es/components/ComposedModal/ComposedModal.js +18 -8
- package/es/components/ContainedList/ContainedList.d.ts +1 -1
- package/es/components/ContainedList/ContainedList.js +3 -3
- 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.Skeleton.js +4 -4
- 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/FluidNumberInput/FluidNumberInput.d.ts +3 -2
- package/es/components/FluidNumberInput/FluidNumberInput.js +3 -2
- package/es/components/FluidSelect/index.js +4 -1
- package/es/components/FluidTextInput/index.js +4 -1
- package/es/components/IconButton/index.d.ts +1 -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.d.ts +7 -0
- package/es/components/MultiSelect/FilterableMultiSelect.js +20 -10
- 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.d.ts +3 -2
- package/es/components/NumberInput/NumberInput.js +5 -4
- 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 +26 -8
- 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.d.ts +1 -1
- package/es/components/Toggletip/index.js +3 -3
- 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/useEvent.d.ts +2 -2
- package/es/internal/useEvent.js +4 -3
- 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 +9 -14
- package/lib/components/Button/Button.d.ts +1 -1
- package/lib/components/Button/Button.js +32 -37
- package/lib/components/Button/ButtonBase.js +8 -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 +40 -46
- package/lib/components/ComboBox/ComboBox.d.ts +7 -0
- package/lib/components/ComboBox/ComboBox.js +65 -63
- 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.d.ts +1 -1
- package/lib/components/ContainedList/ContainedList.js +19 -25
- 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 +10 -16
- 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.d.ts +3 -2
- package/lib/components/FluidNumberInput/FluidNumberInput.js +33 -38
- 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.d.ts +1 -1
- 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.d.ts +7 -0
- package/lib/components/MultiSelect/FilterableMultiSelect.js +71 -71
- 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.d.ts +3 -2
- package/lib/components/NumberInput/NumberInput.js +70 -77
- 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 +60 -50
- 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.d.ts +1 -1
- package/lib/components/Toggletip/index.js +33 -41
- 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.d.ts +2 -2
- package/lib/internal/useEvent.js +4 -5
- 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 +12 -12
- package/telemetry.yml +1 -0
- /package/es/node_modules/es-toolkit/dist/function/{debounce.mjs.js → debounce.js} +0 -0
|
@@ -20,12 +20,6 @@ var layout = require('@carbon/layout');
|
|
|
20
20
|
var useMatchMedia = require('../../internal/useMatchMedia.js');
|
|
21
21
|
var clamp = require('../../internal/clamp.js');
|
|
22
22
|
|
|
23
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
24
|
-
|
|
25
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
26
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
27
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
28
|
-
|
|
29
23
|
var _CaretRight, _CaretLeft, _option;
|
|
30
24
|
const translationIds = {
|
|
31
25
|
'carbon.pagination-nav.next': 'Next',
|
|
@@ -81,15 +75,15 @@ function DirectionButton({
|
|
|
81
75
|
onClick
|
|
82
76
|
}) {
|
|
83
77
|
const prefix = usePrefix.usePrefix();
|
|
84
|
-
return /*#__PURE__*/
|
|
78
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
85
79
|
className: `${prefix}--pagination-nav__list-item`
|
|
86
|
-
}, /*#__PURE__*/
|
|
80
|
+
}, /*#__PURE__*/React.createElement(index.IconButton, {
|
|
87
81
|
align: "bottom",
|
|
88
82
|
disabled: disabled,
|
|
89
83
|
kind: "ghost",
|
|
90
84
|
label: label,
|
|
91
85
|
onClick: onClick
|
|
92
|
-
}, direction === 'forward' ? _CaretRight || (_CaretRight = /*#__PURE__*/
|
|
86
|
+
}, direction === 'forward' ? _CaretRight || (_CaretRight = /*#__PURE__*/React.createElement(iconsReact.CaretRight, null)) : _CaretLeft || (_CaretLeft = /*#__PURE__*/React.createElement(iconsReact.CaretLeft, null))));
|
|
93
87
|
}
|
|
94
88
|
function PaginationItem({
|
|
95
89
|
page,
|
|
@@ -99,17 +93,17 @@ function PaginationItem({
|
|
|
99
93
|
}) {
|
|
100
94
|
const prefix = usePrefix.usePrefix();
|
|
101
95
|
const itemLabel = t('carbon.pagination-nav.item');
|
|
102
|
-
return /*#__PURE__*/
|
|
96
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
103
97
|
className: `${prefix}--pagination-nav__list-item`
|
|
104
|
-
}, /*#__PURE__*/
|
|
98
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
105
99
|
type: "button",
|
|
106
|
-
className:
|
|
100
|
+
className: cx(`${prefix}--pagination-nav__page`, {
|
|
107
101
|
[`${prefix}--pagination-nav__page--active`]: isActive
|
|
108
102
|
}),
|
|
109
103
|
onClick: onClick,
|
|
110
104
|
"data-page": page,
|
|
111
105
|
"aria-current": isActive ? 'page' : undefined
|
|
112
|
-
}, /*#__PURE__*/
|
|
106
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
113
107
|
className: `${prefix}--pagination-nav__accessibility-label`
|
|
114
108
|
}, isActive ? `${t('carbon.pagination-nav.active')}, ${itemLabel}` : itemLabel), page));
|
|
115
109
|
}
|
|
@@ -125,47 +119,47 @@ function PaginationOverflow({
|
|
|
125
119
|
|
|
126
120
|
//If overflow is disabled, return a select tag with no select options
|
|
127
121
|
if (disableOverflow === true && count > 1) {
|
|
128
|
-
return /*#__PURE__*/
|
|
122
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
129
123
|
className: `${prefix}--pagination-nav__list-item`
|
|
130
|
-
}, /*#__PURE__*/
|
|
124
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
131
125
|
className: `${prefix}--pagination-nav__select`
|
|
132
|
-
}, /*#__PURE__*/
|
|
126
|
+
}, /*#__PURE__*/React.createElement("select", {
|
|
133
127
|
className: `${prefix}--pagination-nav__page ${prefix}--pagination-nav__page--select`,
|
|
134
128
|
"aria-label": `Select ${t('carbon.pagination-nav.item')} number`,
|
|
135
129
|
disabled: true
|
|
136
|
-
}), /*#__PURE__*/
|
|
130
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
137
131
|
className: `${prefix}--pagination-nav__select-icon-wrapper`
|
|
138
|
-
}, /*#__PURE__*/
|
|
132
|
+
}, /*#__PURE__*/React.createElement(iconsReact.OverflowMenuHorizontal, {
|
|
139
133
|
className: `${prefix}--pagination-nav__select-icon`
|
|
140
134
|
}))));
|
|
141
135
|
}
|
|
142
136
|
if (count > 1) {
|
|
143
|
-
return /*#__PURE__*/
|
|
137
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
144
138
|
className: `${prefix}--pagination-nav__list-item`
|
|
145
|
-
}, /*#__PURE__*/
|
|
139
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
146
140
|
className: `${prefix}--pagination-nav__select`
|
|
147
|
-
}, /*#__PURE__*/
|
|
141
|
+
}, /*#__PURE__*/React.createElement("select", {
|
|
148
142
|
className: `${prefix}--pagination-nav__page ${prefix}--pagination-nav__page--select`,
|
|
149
143
|
"aria-label": `Select ${t('carbon.pagination-nav.item')} number`,
|
|
150
144
|
onChange: e => {
|
|
151
145
|
const index = Number(e.target.value);
|
|
152
146
|
onSelect?.(index);
|
|
153
147
|
}
|
|
154
|
-
}, _option || (_option = /*#__PURE__*/
|
|
148
|
+
}, _option || (_option = /*#__PURE__*/React.createElement("option", {
|
|
155
149
|
value: "",
|
|
156
150
|
hidden: true
|
|
157
|
-
})), [...Array(count)].map((e, i) => /*#__PURE__*/
|
|
151
|
+
})), [...Array(count)].map((e, i) => /*#__PURE__*/React.createElement("option", {
|
|
158
152
|
value: (fromIndex + i).toString(),
|
|
159
153
|
"data-page": fromIndex + i + 1,
|
|
160
154
|
key: `overflow-${fromIndex + i}`
|
|
161
|
-
}, fromIndex + i + 1))), /*#__PURE__*/
|
|
155
|
+
}, fromIndex + i + 1))), /*#__PURE__*/React.createElement("div", {
|
|
162
156
|
className: `${prefix}--pagination-nav__select-icon-wrapper`
|
|
163
|
-
}, /*#__PURE__*/
|
|
157
|
+
}, /*#__PURE__*/React.createElement(iconsReact.OverflowMenuHorizontal, {
|
|
164
158
|
className: `${prefix}--pagination-nav__select-icon`
|
|
165
159
|
}))));
|
|
166
160
|
}
|
|
167
161
|
if (count === 1) {
|
|
168
|
-
return /*#__PURE__*/
|
|
162
|
+
return /*#__PURE__*/React.createElement(PaginationItem, {
|
|
169
163
|
page: fromIndex + 1,
|
|
170
164
|
translateWithId: t,
|
|
171
165
|
onClick: () => {
|
|
@@ -175,7 +169,7 @@ function PaginationOverflow({
|
|
|
175
169
|
}
|
|
176
170
|
return null;
|
|
177
171
|
}
|
|
178
|
-
const PaginationNav = /*#__PURE__*/
|
|
172
|
+
const PaginationNav = /*#__PURE__*/React.forwardRef(function PaginationNav({
|
|
179
173
|
className,
|
|
180
174
|
onChange = () => {},
|
|
181
175
|
totalItems = NaN,
|
|
@@ -269,20 +263,20 @@ const PaginationNav = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
269
263
|
React.useEffect(() => {
|
|
270
264
|
setIsOverFlowDisabled(disableOverflow);
|
|
271
265
|
}, [disableOverflow]);
|
|
272
|
-
const classNames =
|
|
266
|
+
const classNames = cx(`${prefix}--pagination-nav`, className, {
|
|
273
267
|
[`${prefix}--layout--size-${size}`]: size
|
|
274
268
|
});
|
|
275
269
|
const backwardButtonDisabled = !loop && currentPage === 0;
|
|
276
270
|
const forwardButtonDisabled = !loop && currentPage === totalItems - 1;
|
|
277
271
|
const startOffset = itemsDisplayedOnPage <= 4 && currentPage > 1 ? 0 : 1;
|
|
278
|
-
return /*#__PURE__*/
|
|
272
|
+
return /*#__PURE__*/React.createElement("nav", _rollupPluginBabelHelpers.extends({
|
|
279
273
|
className: classNames,
|
|
280
274
|
ref: ref
|
|
281
275
|
}, rest, {
|
|
282
276
|
"aria-label": "pagination"
|
|
283
|
-
}), /*#__PURE__*/
|
|
277
|
+
}), /*#__PURE__*/React.createElement("ul", {
|
|
284
278
|
className: `${prefix}--pagination-nav__list`
|
|
285
|
-
}, /*#__PURE__*/
|
|
279
|
+
}, /*#__PURE__*/React.createElement(DirectionButton, {
|
|
286
280
|
direction: "backward",
|
|
287
281
|
"aria-label": t('carbon.pagination-nav.previous'),
|
|
288
282
|
label: t('carbon.pagination-nav.previous'),
|
|
@@ -291,21 +285,21 @@ const PaginationNav = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
291
285
|
}),
|
|
292
286
|
// render first item if at least 5 items can be displayed or
|
|
293
287
|
// 4 items can be displayed and the current page is either 0 or 1
|
|
294
|
-
(itemsDisplayedOnPage >= 5 || itemsDisplayedOnPage <= 4 && currentPage <= 1) && /*#__PURE__*/
|
|
288
|
+
(itemsDisplayedOnPage >= 5 || itemsDisplayedOnPage <= 4 && currentPage <= 1) && /*#__PURE__*/React.createElement(PaginationItem, {
|
|
295
289
|
page: 1,
|
|
296
290
|
translateWithId: t,
|
|
297
291
|
isActive: currentPage === 0,
|
|
298
292
|
onClick: () => {
|
|
299
293
|
jumpToItem(0);
|
|
300
294
|
}
|
|
301
|
-
}), /*#__PURE__*/
|
|
295
|
+
}), /*#__PURE__*/React.createElement(PaginationOverflow, {
|
|
302
296
|
fromIndex: startOffset,
|
|
303
297
|
count: cuts.front,
|
|
304
298
|
onSelect: jumpToItem,
|
|
305
299
|
disableOverflow: isOverflowDisabled
|
|
306
300
|
}),
|
|
307
301
|
// render items between overflows
|
|
308
|
-
[...Array(totalItems)].map((e, i) => i).slice(startOffset + cuts.front, (1 + cuts.back) * -1).map(item => /*#__PURE__*/
|
|
302
|
+
[...Array(totalItems)].map((e, i) => i).slice(startOffset + cuts.front, (1 + cuts.back) * -1).map(item => /*#__PURE__*/React.createElement(PaginationItem, {
|
|
309
303
|
key: `item-${item}`,
|
|
310
304
|
page: item + 1,
|
|
311
305
|
translateWithId: t,
|
|
@@ -313,27 +307,27 @@ const PaginationNav = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
313
307
|
onClick: () => {
|
|
314
308
|
jumpToItem(item);
|
|
315
309
|
}
|
|
316
|
-
})), /*#__PURE__*/
|
|
310
|
+
})), /*#__PURE__*/React.createElement(PaginationOverflow, {
|
|
317
311
|
fromIndex: totalItems - cuts.back - 1,
|
|
318
312
|
count: cuts.back,
|
|
319
313
|
onSelect: jumpToItem,
|
|
320
314
|
disableOverflow: isOverflowDisabled
|
|
321
315
|
}),
|
|
322
316
|
// render last item unless there is only one in total
|
|
323
|
-
totalItems > 1 && /*#__PURE__*/
|
|
317
|
+
totalItems > 1 && /*#__PURE__*/React.createElement(PaginationItem, {
|
|
324
318
|
page: totalItems,
|
|
325
319
|
translateWithId: t,
|
|
326
320
|
isActive: currentPage === totalItems - 1,
|
|
327
321
|
onClick: () => {
|
|
328
322
|
jumpToItem(totalItems - 1);
|
|
329
323
|
}
|
|
330
|
-
}), /*#__PURE__*/
|
|
324
|
+
}), /*#__PURE__*/React.createElement(DirectionButton, {
|
|
331
325
|
direction: "forward",
|
|
332
326
|
"aria-label": t('carbon.pagination-nav.next'),
|
|
333
327
|
label: t('carbon.pagination-nav.next'),
|
|
334
328
|
disabled: forwardButtonDisabled,
|
|
335
329
|
onClick: jumpToNext
|
|
336
|
-
})), /*#__PURE__*/
|
|
330
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
337
331
|
"aria-live": "polite",
|
|
338
332
|
"aria-atomic": "true",
|
|
339
333
|
className: `${prefix}--pagination-nav__accessibility-label`
|
|
@@ -343,100 +337,100 @@ DirectionButton.propTypes = {
|
|
|
343
337
|
/**
|
|
344
338
|
* The direction this button represents ("forward" or "backward").
|
|
345
339
|
*/
|
|
346
|
-
direction:
|
|
340
|
+
direction: PropTypes.oneOf(['forward', 'backward']),
|
|
347
341
|
/**
|
|
348
342
|
* Whether or not the button should be disabled.
|
|
349
343
|
*/
|
|
350
|
-
disabled:
|
|
344
|
+
disabled: PropTypes.bool,
|
|
351
345
|
/**
|
|
352
346
|
* The label shown in the button's tooltip.
|
|
353
347
|
*/
|
|
354
|
-
label:
|
|
348
|
+
label: PropTypes.string,
|
|
355
349
|
/**
|
|
356
350
|
* The callback function called when the button is clicked.
|
|
357
351
|
*/
|
|
358
|
-
onClick:
|
|
352
|
+
onClick: PropTypes.func
|
|
359
353
|
};
|
|
360
354
|
PaginationItem.propTypes = {
|
|
361
355
|
/**
|
|
362
356
|
* Whether or not this is the currently active page.
|
|
363
357
|
*/
|
|
364
|
-
isActive:
|
|
358
|
+
isActive: PropTypes.bool,
|
|
365
359
|
/**
|
|
366
360
|
* The callback function called when the item is clicked.
|
|
367
361
|
*/
|
|
368
|
-
onClick:
|
|
362
|
+
onClick: PropTypes.func,
|
|
369
363
|
/**
|
|
370
364
|
* The page number this item represents.
|
|
371
365
|
*/
|
|
372
|
-
page:
|
|
366
|
+
page: PropTypes.number,
|
|
373
367
|
/**
|
|
374
368
|
* Specify a custom translation function that takes in a message identifier
|
|
375
369
|
* and returns the localized string for the message
|
|
376
370
|
*/
|
|
377
|
-
translateWithId:
|
|
371
|
+
translateWithId: PropTypes.func
|
|
378
372
|
};
|
|
379
373
|
PaginationOverflow.propTypes = {
|
|
380
374
|
/**
|
|
381
375
|
* How many items to display in this overflow.
|
|
382
376
|
*/
|
|
383
|
-
count:
|
|
377
|
+
count: PropTypes.number,
|
|
384
378
|
/**
|
|
385
379
|
* From which index on this overflow should start displaying pages.
|
|
386
380
|
*/
|
|
387
|
-
fromIndex:
|
|
381
|
+
fromIndex: PropTypes.number,
|
|
388
382
|
/**
|
|
389
383
|
* The callback function called when the user selects a page from the overflow.
|
|
390
384
|
*/
|
|
391
|
-
onSelect:
|
|
385
|
+
onSelect: PropTypes.func,
|
|
392
386
|
/**
|
|
393
387
|
* Specify a custom translation function that takes in a message identifier
|
|
394
388
|
* and returns the localized string for the message
|
|
395
389
|
*/
|
|
396
|
-
translateWithId:
|
|
390
|
+
translateWithId: PropTypes.func
|
|
397
391
|
};
|
|
398
392
|
PaginationNav.displayName = 'PaginationNav';
|
|
399
393
|
PaginationNav.propTypes = {
|
|
400
394
|
/**
|
|
401
395
|
* Additional CSS class names.
|
|
402
396
|
*/
|
|
403
|
-
className:
|
|
397
|
+
className: PropTypes.string,
|
|
404
398
|
/**
|
|
405
399
|
* If true, the '...' pagination overflow will not render page links between the first and last rendered buttons.
|
|
406
400
|
* Set this to true if you are having performance problems with large data sets.
|
|
407
401
|
*/
|
|
408
|
-
disableOverflow:
|
|
402
|
+
disableOverflow: PropTypes.bool,
|
|
409
403
|
// eslint-disable-line react/prop-types
|
|
410
404
|
|
|
411
405
|
/**
|
|
412
406
|
* The number of items to be shown (minimum of 4 unless props.items < 4).
|
|
413
407
|
*/
|
|
414
|
-
itemsShown:
|
|
408
|
+
itemsShown: PropTypes.number,
|
|
415
409
|
/**
|
|
416
410
|
* Whether user should be able to loop through the items when reaching first / last.
|
|
417
411
|
*/
|
|
418
|
-
loop:
|
|
412
|
+
loop: PropTypes.bool,
|
|
419
413
|
/**
|
|
420
414
|
* The callback function called when the current page changes.
|
|
421
415
|
*/
|
|
422
|
-
onChange:
|
|
416
|
+
onChange: PropTypes.func,
|
|
423
417
|
/**
|
|
424
418
|
* The index of current page.
|
|
425
419
|
*/
|
|
426
|
-
page:
|
|
420
|
+
page: PropTypes.number,
|
|
427
421
|
/**
|
|
428
422
|
* Specify the size of the PaginationNav.
|
|
429
423
|
*/
|
|
430
|
-
size:
|
|
424
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
431
425
|
/**
|
|
432
426
|
* The total number of items.
|
|
433
427
|
*/
|
|
434
|
-
totalItems:
|
|
428
|
+
totalItems: PropTypes.number,
|
|
435
429
|
/**
|
|
436
430
|
* Specify a custom translation function that takes in a message identifier
|
|
437
431
|
* and returns the localized string for the message
|
|
438
432
|
*/
|
|
439
|
-
translateWithId:
|
|
433
|
+
translateWithId: PropTypes.func
|
|
440
434
|
};
|
|
441
435
|
|
|
442
|
-
exports
|
|
436
|
+
exports.default = PaginationNav;
|
|
@@ -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');
|
|
@@ -23,13 +21,7 @@ var react = require('@floating-ui/react');
|
|
|
23
21
|
var index = require('../FeatureFlags/index.js');
|
|
24
22
|
var index$1 = require('../Toggletip/index.js');
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
29
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
30
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
31
|
-
|
|
32
|
-
const PopoverContext = /*#__PURE__*/React__default["default"].createContext({
|
|
24
|
+
const PopoverContext = /*#__PURE__*/React.createContext({
|
|
33
25
|
setFloating: {
|
|
34
26
|
current: null
|
|
35
27
|
},
|
|
@@ -44,7 +36,7 @@ const PopoverContext = /*#__PURE__*/React__default["default"].createContext({
|
|
|
44
36
|
* @deprecated Use NewPopoverAlignment instead.
|
|
45
37
|
*/
|
|
46
38
|
|
|
47
|
-
const Popover = /*#__PURE__*/
|
|
39
|
+
const Popover = /*#__PURE__*/React.forwardRef(function PopoverRenderFunction({
|
|
48
40
|
isTabTip,
|
|
49
41
|
align: initialAlign = isTabTip ? 'bottom-start' : 'bottom',
|
|
50
42
|
as: BaseComponent = 'span',
|
|
@@ -69,9 +61,10 @@ forwardRef) {
|
|
|
69
61
|
const enableFloatingStyles = index.useFeatureFlag('enable-v12-dynamic-floating-styles') || autoAlign;
|
|
70
62
|
let align = mapPopoverAlign.mapPopoverAlign(initialAlign);
|
|
71
63
|
|
|
72
|
-
//
|
|
73
|
-
useEvent.
|
|
74
|
-
|
|
64
|
+
// The `Popover` should close whenever it and its children loses focus
|
|
65
|
+
useEvent.useEvent(popover, 'focusout', event => {
|
|
66
|
+
const relatedTarget = event.relatedTarget;
|
|
67
|
+
if (!popover.current?.contains(relatedTarget)) {
|
|
75
68
|
onRequestClose?.();
|
|
76
69
|
}
|
|
77
70
|
});
|
|
@@ -86,7 +79,7 @@ forwardRef) {
|
|
|
86
79
|
// Slug styling places a border around the popover content so the caret
|
|
87
80
|
// needs to be placed 1px further outside the popover content. To do so,
|
|
88
81
|
// we look to see if any of the children has a className containing "slug"
|
|
89
|
-
const initialCaretHeight =
|
|
82
|
+
const initialCaretHeight = React.Children.toArray(children).some(x => {
|
|
90
83
|
return x?.props?.className?.includes('slug') || x?.props?.className?.includes('ai-label');
|
|
91
84
|
}) ? 7 : 6;
|
|
92
85
|
// These defaults match the defaults defined in packages/styles/scss/components/popover/_popover.scss
|
|
@@ -94,7 +87,7 @@ forwardRef) {
|
|
|
94
87
|
offset: 10,
|
|
95
88
|
caretHeight: initialCaretHeight
|
|
96
89
|
});
|
|
97
|
-
useIsomorphicEffect
|
|
90
|
+
useIsomorphicEffect.default(() => {
|
|
98
91
|
// The popover is only offset when a caret is present. Technically, the custom properties
|
|
99
92
|
// accessed below can be set by a user even if caret=false, but doing so does not follow
|
|
100
93
|
// the design specification for Popover.
|
|
@@ -195,7 +188,7 @@ forwardRef) {
|
|
|
195
188
|
}, [floatingStyles, refs.floating, enableFloatingStyles, middlewareData, placement, caret]);
|
|
196
189
|
const ref = useMergedRefs.useMergedRefs([forwardRef, popover]);
|
|
197
190
|
const currentAlignment = autoAlign && placement !== align ? placement : align;
|
|
198
|
-
const className =
|
|
191
|
+
const className = cx({
|
|
199
192
|
[`${prefix}--popover-container`]: true,
|
|
200
193
|
[`${prefix}--popover--caret`]: caret,
|
|
201
194
|
[`${prefix}--popover--drop-shadow`]: dropShadow,
|
|
@@ -205,7 +198,7 @@ forwardRef) {
|
|
|
205
198
|
[`${prefix}--popover--${currentAlignment}`]: true,
|
|
206
199
|
[`${prefix}--popover--tab-tip`]: isTabTip
|
|
207
200
|
}, customClassName);
|
|
208
|
-
const mappedChildren =
|
|
201
|
+
const mappedChildren = React.Children.map(children, child => {
|
|
209
202
|
const item = child;
|
|
210
203
|
const displayName = item?.type?.displayName;
|
|
211
204
|
|
|
@@ -219,11 +212,11 @@ forwardRef) {
|
|
|
219
212
|
const isTriggerElement = item?.type === 'button';
|
|
220
213
|
const isTriggerComponent = enableFloatingStyles && displayName && ['ToggletipButton'].includes(displayName);
|
|
221
214
|
const isAllowedTriggerComponent = enableFloatingStyles && !['ToggletipContent', 'PopoverContent'].includes(displayName);
|
|
222
|
-
if (/*#__PURE__*/
|
|
215
|
+
if (/*#__PURE__*/React.isValidElement(item) && (isTriggerElement || isTriggerComponent || isAllowedTriggerComponent)) {
|
|
223
216
|
const className = item?.props?.className;
|
|
224
217
|
const ref = (item?.props).ref;
|
|
225
|
-
const tabTipClasses =
|
|
226
|
-
return /*#__PURE__*/
|
|
218
|
+
const tabTipClasses = cx(`${prefix}--popover--tab-tip__button`, className);
|
|
219
|
+
return /*#__PURE__*/React.cloneElement(item, {
|
|
227
220
|
className: isTabTip && item?.type === 'button' ? tabTipClasses : className || '',
|
|
228
221
|
// With cloneElement, if you pass a `ref`, it overrides the original ref.
|
|
229
222
|
// https://react.dev/reference/react/cloneElement#parameters
|
|
@@ -255,9 +248,9 @@ forwardRef) {
|
|
|
255
248
|
}
|
|
256
249
|
});
|
|
257
250
|
const BaseComponentAsAny = BaseComponent;
|
|
258
|
-
return /*#__PURE__*/
|
|
251
|
+
return /*#__PURE__*/React.createElement(PopoverContext.Provider, {
|
|
259
252
|
value: value
|
|
260
|
-
}, /*#__PURE__*/
|
|
253
|
+
}, /*#__PURE__*/React.createElement(BaseComponentAsAny, _rollupPluginBabelHelpers.extends({}, rest, {
|
|
261
254
|
className: className,
|
|
262
255
|
ref: ref
|
|
263
256
|
}), enableFloatingStyles || isTabTip ? mappedChildren : children));
|
|
@@ -272,7 +265,7 @@ Popover.propTypes = {
|
|
|
272
265
|
/**
|
|
273
266
|
* Specify how the popover should align with the trigger element
|
|
274
267
|
*/
|
|
275
|
-
align: deprecateValuesWithin
|
|
268
|
+
align: deprecateValuesWithin.default(PropTypes.oneOf(['top', 'top-left',
|
|
276
269
|
// deprecated use top-start instead
|
|
277
270
|
'top-right',
|
|
278
271
|
// deprecated use top-end instead
|
|
@@ -298,54 +291,54 @@ Popover.propTypes = {
|
|
|
298
291
|
* Provide a custom element or component to render the top-level node for the
|
|
299
292
|
* component.
|
|
300
293
|
*/
|
|
301
|
-
as:
|
|
294
|
+
as: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]),
|
|
302
295
|
/**
|
|
303
296
|
* Will auto-align the popover on first render if it is not visible. This prop is currently experimental and is subject to future changes.
|
|
304
297
|
*/
|
|
305
|
-
autoAlign:
|
|
298
|
+
autoAlign: PropTypes.bool,
|
|
306
299
|
/**
|
|
307
300
|
* Specify a bounding element to be used for autoAlign calculations. The viewport is used by default. This prop is currently experimental and is subject to future changes.
|
|
308
301
|
*/
|
|
309
|
-
autoAlignBoundary:
|
|
310
|
-
x:
|
|
311
|
-
y:
|
|
312
|
-
width:
|
|
313
|
-
height:
|
|
302
|
+
autoAlignBoundary: PropTypes.oneOfType([PropTypes.oneOf(['clippingAncestors']), PropTypes.elementType, PropTypes.arrayOf(PropTypes.elementType), PropTypes.exact({
|
|
303
|
+
x: PropTypes.number.isRequired,
|
|
304
|
+
y: PropTypes.number.isRequired,
|
|
305
|
+
width: PropTypes.number.isRequired,
|
|
306
|
+
height: PropTypes.number.isRequired
|
|
314
307
|
})]),
|
|
315
308
|
/**
|
|
316
309
|
* Specify whether a caret should be rendered
|
|
317
310
|
*/
|
|
318
|
-
caret:
|
|
311
|
+
caret: PropTypes.bool,
|
|
319
312
|
/**
|
|
320
313
|
* Provide elements to be rendered inside of the component
|
|
321
314
|
*/
|
|
322
|
-
children:
|
|
315
|
+
children: PropTypes.node,
|
|
323
316
|
/**
|
|
324
317
|
* Provide a custom class name to be added to the outermost node in the
|
|
325
318
|
* component
|
|
326
319
|
*/
|
|
327
|
-
className:
|
|
320
|
+
className: PropTypes.string,
|
|
328
321
|
/**
|
|
329
322
|
* Specify whether a drop shadow should be rendered on the popover
|
|
330
323
|
*/
|
|
331
|
-
dropShadow:
|
|
324
|
+
dropShadow: PropTypes.bool,
|
|
332
325
|
/**
|
|
333
326
|
* Render the component using the high-contrast variant
|
|
334
327
|
*/
|
|
335
|
-
highContrast:
|
|
328
|
+
highContrast: PropTypes.bool,
|
|
336
329
|
/**
|
|
337
330
|
* Render the component using the tab tip variant
|
|
338
331
|
*/
|
|
339
|
-
isTabTip:
|
|
332
|
+
isTabTip: PropTypes.bool,
|
|
340
333
|
/**
|
|
341
334
|
* Specify a handler for closing popover.
|
|
342
335
|
* The handler should take care of closing the popover, e.g. changing the `open` prop.
|
|
343
336
|
*/
|
|
344
|
-
onRequestClose:
|
|
337
|
+
onRequestClose: PropTypes.func,
|
|
345
338
|
/**
|
|
346
339
|
* Specify whether the component is currently open or closed
|
|
347
340
|
*/
|
|
348
|
-
open:
|
|
341
|
+
open: PropTypes.bool.isRequired
|
|
349
342
|
};
|
|
350
343
|
function PopoverContentRenderFunction(
|
|
351
344
|
// eslint-disable-next-line react/prop-types
|
|
@@ -359,39 +352,56 @@ function PopoverContentRenderFunction(
|
|
|
359
352
|
setFloating,
|
|
360
353
|
caretRef,
|
|
361
354
|
autoAlign
|
|
362
|
-
} =
|
|
363
|
-
const
|
|
355
|
+
} = React.useContext(PopoverContext);
|
|
356
|
+
const textRef = React.useRef(null);
|
|
357
|
+
const [isMultiLine, setIsMultiLine] = React.useState(false);
|
|
358
|
+
const ref = useMergedRefs.useMergedRefs([setFloating, textRef, forwardRef]);
|
|
364
359
|
const enableFloatingStyles = index.useFeatureFlag('enable-v12-dynamic-floating-styles') || autoAlign;
|
|
365
|
-
|
|
360
|
+
React.useEffect(() => {
|
|
361
|
+
checkIfMultiLine();
|
|
362
|
+
}, [children]);
|
|
363
|
+
const checkIfMultiLine = () => {
|
|
364
|
+
const el = textRef.current;
|
|
365
|
+
if (el) {
|
|
366
|
+
const style = getComputedStyle(el);
|
|
367
|
+
const lineHeight = parseFloat(style.lineHeight);
|
|
368
|
+
const height = el.offsetHeight;
|
|
369
|
+
const lines = Math.floor(height / lineHeight);
|
|
370
|
+
setIsMultiLine(lines > 1);
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
return /*#__PURE__*/React.createElement("span", _rollupPluginBabelHelpers.extends({}, rest, {
|
|
366
374
|
className: `${prefix}--popover`
|
|
367
|
-
}), /*#__PURE__*/
|
|
368
|
-
className:
|
|
375
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
376
|
+
className: cx(`${prefix}--popover-content`, className, {
|
|
377
|
+
[`${prefix}--tooltip-content--multiline`]: isMultiLine
|
|
378
|
+
}),
|
|
369
379
|
ref: ref
|
|
370
|
-
}, children, enableFloatingStyles && /*#__PURE__*/
|
|
371
|
-
className:
|
|
380
|
+
}, children, enableFloatingStyles && /*#__PURE__*/React.createElement("span", {
|
|
381
|
+
className: cx({
|
|
372
382
|
[`${prefix}--popover-caret`]: true,
|
|
373
383
|
[`${prefix}--popover--auto-align`]: true
|
|
374
384
|
}),
|
|
375
385
|
ref: caretRef
|
|
376
|
-
})), !enableFloatingStyles && /*#__PURE__*/
|
|
377
|
-
className:
|
|
386
|
+
})), !enableFloatingStyles && /*#__PURE__*/React.createElement("span", {
|
|
387
|
+
className: cx({
|
|
378
388
|
[`${prefix}--popover-caret`]: true
|
|
379
389
|
}),
|
|
380
390
|
ref: caretRef
|
|
381
391
|
}));
|
|
382
392
|
}
|
|
383
|
-
const PopoverContent = /*#__PURE__*/
|
|
393
|
+
const PopoverContent = /*#__PURE__*/React.forwardRef(PopoverContentRenderFunction);
|
|
384
394
|
PopoverContent.displayName = 'PopoverContent';
|
|
385
395
|
PopoverContent.propTypes = {
|
|
386
396
|
/**
|
|
387
397
|
* Provide elements to be rendered inside of the component
|
|
388
398
|
*/
|
|
389
|
-
children:
|
|
399
|
+
children: PropTypes.node,
|
|
390
400
|
/**
|
|
391
401
|
* Provide a custom class name to be added to the outermost node in the
|
|
392
402
|
* component
|
|
393
403
|
*/
|
|
394
|
-
className:
|
|
404
|
+
className: PropTypes.string
|
|
395
405
|
};
|
|
396
406
|
|
|
397
407
|
exports.Popover = Popover;
|
|
@@ -14,12 +14,8 @@ var React = require('react');
|
|
|
14
14
|
var Button = require('../Button/Button.js');
|
|
15
15
|
require('../Button/Button.Skeleton.js');
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
20
|
-
|
|
21
|
-
const PrimaryButton = props => /*#__PURE__*/React__default["default"].createElement(Button["default"], _rollupPluginBabelHelpers["extends"]({
|
|
17
|
+
const PrimaryButton = props => /*#__PURE__*/React.createElement(Button.default, _rollupPluginBabelHelpers.extends({
|
|
22
18
|
kind: "primary"
|
|
23
19
|
}, props));
|
|
24
20
|
|
|
25
|
-
exports
|
|
21
|
+
exports.default = PrimaryButton;
|