@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
|
@@ -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',
|
|
@@ -87,7 +79,7 @@ forwardRef) {
|
|
|
87
79
|
// Slug styling places a border around the popover content so the caret
|
|
88
80
|
// needs to be placed 1px further outside the popover content. To do so,
|
|
89
81
|
// we look to see if any of the children has a className containing "slug"
|
|
90
|
-
const initialCaretHeight =
|
|
82
|
+
const initialCaretHeight = React.Children.toArray(children).some(x => {
|
|
91
83
|
return x?.props?.className?.includes('slug') || x?.props?.className?.includes('ai-label');
|
|
92
84
|
}) ? 7 : 6;
|
|
93
85
|
// These defaults match the defaults defined in packages/styles/scss/components/popover/_popover.scss
|
|
@@ -95,7 +87,7 @@ forwardRef) {
|
|
|
95
87
|
offset: 10,
|
|
96
88
|
caretHeight: initialCaretHeight
|
|
97
89
|
});
|
|
98
|
-
useIsomorphicEffect
|
|
90
|
+
useIsomorphicEffect.default(() => {
|
|
99
91
|
// The popover is only offset when a caret is present. Technically, the custom properties
|
|
100
92
|
// accessed below can be set by a user even if caret=false, but doing so does not follow
|
|
101
93
|
// the design specification for Popover.
|
|
@@ -196,7 +188,7 @@ forwardRef) {
|
|
|
196
188
|
}, [floatingStyles, refs.floating, enableFloatingStyles, middlewareData, placement, caret]);
|
|
197
189
|
const ref = useMergedRefs.useMergedRefs([forwardRef, popover]);
|
|
198
190
|
const currentAlignment = autoAlign && placement !== align ? placement : align;
|
|
199
|
-
const className =
|
|
191
|
+
const className = cx({
|
|
200
192
|
[`${prefix}--popover-container`]: true,
|
|
201
193
|
[`${prefix}--popover--caret`]: caret,
|
|
202
194
|
[`${prefix}--popover--drop-shadow`]: dropShadow,
|
|
@@ -206,7 +198,7 @@ forwardRef) {
|
|
|
206
198
|
[`${prefix}--popover--${currentAlignment}`]: true,
|
|
207
199
|
[`${prefix}--popover--tab-tip`]: isTabTip
|
|
208
200
|
}, customClassName);
|
|
209
|
-
const mappedChildren =
|
|
201
|
+
const mappedChildren = React.Children.map(children, child => {
|
|
210
202
|
const item = child;
|
|
211
203
|
const displayName = item?.type?.displayName;
|
|
212
204
|
|
|
@@ -220,11 +212,11 @@ forwardRef) {
|
|
|
220
212
|
const isTriggerElement = item?.type === 'button';
|
|
221
213
|
const isTriggerComponent = enableFloatingStyles && displayName && ['ToggletipButton'].includes(displayName);
|
|
222
214
|
const isAllowedTriggerComponent = enableFloatingStyles && !['ToggletipContent', 'PopoverContent'].includes(displayName);
|
|
223
|
-
if (/*#__PURE__*/
|
|
215
|
+
if (/*#__PURE__*/React.isValidElement(item) && (isTriggerElement || isTriggerComponent || isAllowedTriggerComponent)) {
|
|
224
216
|
const className = item?.props?.className;
|
|
225
217
|
const ref = (item?.props).ref;
|
|
226
|
-
const tabTipClasses =
|
|
227
|
-
return /*#__PURE__*/
|
|
218
|
+
const tabTipClasses = cx(`${prefix}--popover--tab-tip__button`, className);
|
|
219
|
+
return /*#__PURE__*/React.cloneElement(item, {
|
|
228
220
|
className: isTabTip && item?.type === 'button' ? tabTipClasses : className || '',
|
|
229
221
|
// With cloneElement, if you pass a `ref`, it overrides the original ref.
|
|
230
222
|
// https://react.dev/reference/react/cloneElement#parameters
|
|
@@ -256,9 +248,9 @@ forwardRef) {
|
|
|
256
248
|
}
|
|
257
249
|
});
|
|
258
250
|
const BaseComponentAsAny = BaseComponent;
|
|
259
|
-
return /*#__PURE__*/
|
|
251
|
+
return /*#__PURE__*/React.createElement(PopoverContext.Provider, {
|
|
260
252
|
value: value
|
|
261
|
-
}, /*#__PURE__*/
|
|
253
|
+
}, /*#__PURE__*/React.createElement(BaseComponentAsAny, _rollupPluginBabelHelpers.extends({}, rest, {
|
|
262
254
|
className: className,
|
|
263
255
|
ref: ref
|
|
264
256
|
}), enableFloatingStyles || isTabTip ? mappedChildren : children));
|
|
@@ -273,7 +265,7 @@ Popover.propTypes = {
|
|
|
273
265
|
/**
|
|
274
266
|
* Specify how the popover should align with the trigger element
|
|
275
267
|
*/
|
|
276
|
-
align: deprecateValuesWithin
|
|
268
|
+
align: deprecateValuesWithin.default(PropTypes.oneOf(['top', 'top-left',
|
|
277
269
|
// deprecated use top-start instead
|
|
278
270
|
'top-right',
|
|
279
271
|
// deprecated use top-end instead
|
|
@@ -299,54 +291,54 @@ Popover.propTypes = {
|
|
|
299
291
|
* Provide a custom element or component to render the top-level node for the
|
|
300
292
|
* component.
|
|
301
293
|
*/
|
|
302
|
-
as:
|
|
294
|
+
as: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]),
|
|
303
295
|
/**
|
|
304
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.
|
|
305
297
|
*/
|
|
306
|
-
autoAlign:
|
|
298
|
+
autoAlign: PropTypes.bool,
|
|
307
299
|
/**
|
|
308
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.
|
|
309
301
|
*/
|
|
310
|
-
autoAlignBoundary:
|
|
311
|
-
x:
|
|
312
|
-
y:
|
|
313
|
-
width:
|
|
314
|
-
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
|
|
315
307
|
})]),
|
|
316
308
|
/**
|
|
317
309
|
* Specify whether a caret should be rendered
|
|
318
310
|
*/
|
|
319
|
-
caret:
|
|
311
|
+
caret: PropTypes.bool,
|
|
320
312
|
/**
|
|
321
313
|
* Provide elements to be rendered inside of the component
|
|
322
314
|
*/
|
|
323
|
-
children:
|
|
315
|
+
children: PropTypes.node,
|
|
324
316
|
/**
|
|
325
317
|
* Provide a custom class name to be added to the outermost node in the
|
|
326
318
|
* component
|
|
327
319
|
*/
|
|
328
|
-
className:
|
|
320
|
+
className: PropTypes.string,
|
|
329
321
|
/**
|
|
330
322
|
* Specify whether a drop shadow should be rendered on the popover
|
|
331
323
|
*/
|
|
332
|
-
dropShadow:
|
|
324
|
+
dropShadow: PropTypes.bool,
|
|
333
325
|
/**
|
|
334
326
|
* Render the component using the high-contrast variant
|
|
335
327
|
*/
|
|
336
|
-
highContrast:
|
|
328
|
+
highContrast: PropTypes.bool,
|
|
337
329
|
/**
|
|
338
330
|
* Render the component using the tab tip variant
|
|
339
331
|
*/
|
|
340
|
-
isTabTip:
|
|
332
|
+
isTabTip: PropTypes.bool,
|
|
341
333
|
/**
|
|
342
334
|
* Specify a handler for closing popover.
|
|
343
335
|
* The handler should take care of closing the popover, e.g. changing the `open` prop.
|
|
344
336
|
*/
|
|
345
|
-
onRequestClose:
|
|
337
|
+
onRequestClose: PropTypes.func,
|
|
346
338
|
/**
|
|
347
339
|
* Specify whether the component is currently open or closed
|
|
348
340
|
*/
|
|
349
|
-
open:
|
|
341
|
+
open: PropTypes.bool.isRequired
|
|
350
342
|
};
|
|
351
343
|
function PopoverContentRenderFunction(
|
|
352
344
|
// eslint-disable-next-line react/prop-types
|
|
@@ -360,39 +352,56 @@ function PopoverContentRenderFunction(
|
|
|
360
352
|
setFloating,
|
|
361
353
|
caretRef,
|
|
362
354
|
autoAlign
|
|
363
|
-
} =
|
|
364
|
-
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]);
|
|
365
359
|
const enableFloatingStyles = index.useFeatureFlag('enable-v12-dynamic-floating-styles') || autoAlign;
|
|
366
|
-
|
|
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, {
|
|
367
374
|
className: `${prefix}--popover`
|
|
368
|
-
}), /*#__PURE__*/
|
|
369
|
-
className:
|
|
375
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
376
|
+
className: cx(`${prefix}--popover-content`, className, {
|
|
377
|
+
[`${prefix}--tooltip-content--multiline`]: isMultiLine
|
|
378
|
+
}),
|
|
370
379
|
ref: ref
|
|
371
|
-
}, children, enableFloatingStyles && /*#__PURE__*/
|
|
372
|
-
className:
|
|
380
|
+
}, children, enableFloatingStyles && /*#__PURE__*/React.createElement("span", {
|
|
381
|
+
className: cx({
|
|
373
382
|
[`${prefix}--popover-caret`]: true,
|
|
374
383
|
[`${prefix}--popover--auto-align`]: true
|
|
375
384
|
}),
|
|
376
385
|
ref: caretRef
|
|
377
|
-
})), !enableFloatingStyles && /*#__PURE__*/
|
|
378
|
-
className:
|
|
386
|
+
})), !enableFloatingStyles && /*#__PURE__*/React.createElement("span", {
|
|
387
|
+
className: cx({
|
|
379
388
|
[`${prefix}--popover-caret`]: true
|
|
380
389
|
}),
|
|
381
390
|
ref: caretRef
|
|
382
391
|
}));
|
|
383
392
|
}
|
|
384
|
-
const PopoverContent = /*#__PURE__*/
|
|
393
|
+
const PopoverContent = /*#__PURE__*/React.forwardRef(PopoverContentRenderFunction);
|
|
385
394
|
PopoverContent.displayName = 'PopoverContent';
|
|
386
395
|
PopoverContent.propTypes = {
|
|
387
396
|
/**
|
|
388
397
|
* Provide elements to be rendered inside of the component
|
|
389
398
|
*/
|
|
390
|
-
children:
|
|
399
|
+
children: PropTypes.node,
|
|
391
400
|
/**
|
|
392
401
|
* Provide a custom class name to be added to the outermost node in the
|
|
393
402
|
* component
|
|
394
403
|
*/
|
|
395
|
-
className:
|
|
404
|
+
className: PropTypes.string
|
|
396
405
|
};
|
|
397
406
|
|
|
398
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;
|