@carbon/react 1.87.0-rc.0 → 1.87.1-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +739 -739
- package/es/_virtual/_rollupPluginBabelHelpers.js +4 -4
- package/es/components/Button/Button.js +1 -1
- package/es/components/Button/index.js +5 -1
- package/es/components/ButtonSet/index.js +4 -1
- package/es/components/Checkbox/index.js +4 -1
- package/es/components/ComboBox/ComboBox.js +1 -1
- package/es/components/ComboBox/index.js +4 -1
- package/es/components/ComposedModal/ComposedModal.js +18 -8
- package/es/components/ContainedList/ContainedListItem/index.js +4 -1
- package/es/components/ContainedList/index.js +2 -2
- package/es/components/Copy/Copy.js +1 -1
- package/es/components/Copy/index.js +4 -1
- package/es/components/CopyButton/index.js +4 -1
- package/es/components/DataTable/Table.js +1 -1
- package/es/components/DataTable/state/getDerivedStateFromProps.d.ts +19 -0
- package/es/components/DataTable/state/getDerivedStateFromProps.js +1 -2
- package/es/components/DataTable/state/sorting.d.ts +15 -0
- package/es/components/DataTable/state/sorting.js +1 -2
- package/es/components/DataTable/tools/denormalize.d.ts +22 -0
- package/es/components/DataTable/tools/denormalize.js +1 -2
- package/es/components/DataTable/tools/normalize.d.ts +9 -0
- package/es/components/DataTable/tools/normalize.js +1 -2
- package/es/components/DatePicker/DatePicker.js +18 -11
- package/es/components/DatePicker/index.js +4 -1
- package/es/components/DatePicker/plugins/fixEventsPlugin.d.ts +2 -0
- package/es/components/DatePicker/plugins/rangePlugin.d.ts +2 -0
- package/es/components/DatePickerInput/DatePickerInput.js +6 -0
- package/es/components/DatePickerInput/index.js +4 -1
- package/es/components/Dialog/index.js +2 -2
- package/es/components/Dropdown/Dropdown.js +2 -2
- package/es/components/Dropdown/index.js +4 -1
- package/es/components/FeatureFlags/index.js +2 -2
- package/es/components/FluidSelect/index.js +4 -1
- package/es/components/FluidTextInput/index.js +4 -1
- package/es/components/IconIndicator/index.js +1 -1
- package/es/components/InlineCheckbox/index.js +4 -1
- package/es/components/InlineLoading/index.js +4 -1
- package/es/components/LayoutDirection/LayoutDirection.js +1 -2
- package/es/components/Link/index.js +4 -1
- package/es/components/ListBox/ListBox.js +1 -1
- package/es/components/Loading/index.js +4 -1
- package/es/components/Menu/Menu.d.ts +3 -1
- package/es/components/Menu/Menu.js +3 -1
- package/es/components/Menu/MenuItem.js +1 -1
- package/es/components/Modal/Modal.js +16 -5
- package/es/components/Modal/index.js +4 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +3 -3
- package/es/components/MultiSelect/MultiSelect.js +2 -2
- package/es/components/MultiSelect/filter.js +0 -4
- package/es/components/MultiSelect/tools/itemToString.d.ts +1 -0
- package/es/components/MultiSelect/tools/sorting.d.ts +9 -0
- package/es/components/Notification/Notification.js +2 -2
- package/es/components/NumberInput/NumberInput.js +1 -1
- package/es/components/OverflowMenu/next/index.js +1 -1
- package/es/components/OverflowMenuItem/index.js +4 -1
- package/es/components/OverflowMenuV2/index.d.ts +1 -0
- package/es/components/PageHeader/PageHeader.js +1 -1
- package/es/components/Pagination/experimental/PageSelector.d.ts +19 -0
- package/es/components/Pagination/experimental/Pagination.d.ts +43 -0
- package/es/components/Pagination/experimental/index.d.ts +3 -0
- package/es/components/Popover/index.js +21 -4
- package/es/components/RadioButton/index.js +4 -1
- package/es/components/RadioTile/index.js +4 -1
- package/es/components/Search/Search.js +1 -1
- package/es/components/Search/index.js +4 -1
- package/es/components/Select/index.js +4 -1
- package/es/components/SelectItem/index.js +4 -1
- package/es/components/ShapeIndicator/index.js +1 -1
- package/es/components/SkeletonText/index.js +4 -1
- package/es/components/Slider/Slider.js +1 -1
- package/es/components/Switch/IconSwitch.d.ts +3 -0
- package/es/components/Switch/IconSwitch.js +1 -2
- package/es/components/TabContent/TabContent.js +2 -22
- package/es/components/Tabs/Tabs.js +5 -5
- package/es/components/Tag/DismissibleTag.js +1 -1
- package/es/components/TextArea/TextArea.js +1 -1
- package/es/components/TextArea/index.js +4 -1
- package/es/components/TextInput/index.js +4 -1
- package/es/components/TextInput/util.d.ts +9 -0
- package/es/components/Toggletip/index.js +2 -2
- package/es/components/UIShell/HeaderMenu.js +2 -2
- package/es/components/UIShell/SideNav.js +1 -1
- package/es/components/UIShell/_utils.d.ts +7 -0
- package/es/feature-flags.d.ts +1 -0
- package/es/internal/FloatingMenu.js +1 -1
- package/es/internal/deprecateFieldOnObject.js +1 -1
- package/es/internal/useId.d.ts +21 -0
- package/es/internal/useId.js +27 -1
- package/es/internal/useOverflowItems.js +0 -6
- package/es/node_modules/es-toolkit/dist/compat/function/{debounce.mjs.js → debounce.js} +1 -1
- package/es/node_modules/es-toolkit/dist/compat/function/{throttle.mjs.js → throttle.js} +1 -1
- package/es/prop-types/deprecateComponent.d.ts +1 -0
- package/es/prop-types/deprecateComponent.js +1 -4
- package/es/prop-types/deprecateValuesWithin.d.ts +1 -0
- package/es/prop-types/requiredIfGivenPropIsTruthy.d.ts +14 -0
- package/es/tools/mergeRefs.d.ts +12 -0
- package/es/tools/mergeRefs.js +1 -2
- package/icons/index.js +1 -3
- package/lib/_virtual/_rollupPluginBabelHelpers.js +5 -7
- package/lib/components/AILabel/index.js +35 -43
- package/lib/components/AISkeleton/AISkeletonIcon.js +5 -11
- package/lib/components/AISkeleton/AISkeletonPlaceholder.js +4 -10
- package/lib/components/AISkeleton/AISkeletonText.js +8 -14
- package/lib/components/Accordion/Accordion.Skeleton.js +21 -27
- package/lib/components/Accordion/Accordion.js +11 -17
- package/lib/components/Accordion/AccordionItem.js +19 -25
- package/lib/components/Accordion/AccordionProvider.js +1 -7
- package/lib/components/AspectRatio/AspectRatio.js +7 -13
- package/lib/components/BadgeIndicator/index.js +7 -13
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +7 -13
- package/lib/components/Breadcrumb/Breadcrumb.js +9 -15
- package/lib/components/Breadcrumb/BreadcrumbItem.js +16 -22
- package/lib/components/Button/Button.Skeleton.js +8 -14
- package/lib/components/Button/Button.js +31 -36
- package/lib/components/Button/ButtonBase.js +6 -11
- package/lib/components/Button/index.js +3 -3
- package/lib/components/ButtonSet/ButtonSet.js +6 -12
- package/lib/components/ButtonSet/index.js +2 -2
- package/lib/components/ChatButton/ChatButton.Skeleton.js +5 -11
- package/lib/components/ChatButton/ChatButton.js +12 -18
- package/lib/components/Checkbox/Checkbox.Skeleton.js +6 -12
- package/lib/components/Checkbox/Checkbox.js +33 -39
- package/lib/components/Checkbox/index.js +3 -3
- package/lib/components/CheckboxGroup/CheckboxGroup.js +24 -30
- package/lib/components/ClassPrefix/index.js +3 -10
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +10 -16
- package/lib/components/CodeSnippet/CodeSnippet.js +39 -46
- package/lib/components/ComboBox/ComboBox.js +57 -64
- package/lib/components/ComboBox/index.js +2 -2
- package/lib/components/ComboButton/index.js +20 -28
- package/lib/components/ComposedModal/ComposedModal.js +61 -57
- package/lib/components/ComposedModal/ModalFooter.js +37 -45
- package/lib/components/ComposedModal/ModalHeader.js +23 -31
- package/lib/components/ContainedList/ContainedList.js +18 -24
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +14 -20
- package/lib/components/ContainedList/ContainedListItem/index.js +2 -2
- package/lib/components/ContainedList/index.js +5 -5
- package/lib/components/ContentSwitcher/ContentSwitcher.js +11 -19
- package/lib/components/ContextMenu/useContextMenu.js +1 -1
- package/lib/components/Copy/Copy.js +12 -18
- package/lib/components/Copy/index.js +2 -2
- package/lib/components/CopyButton/CopyButton.js +12 -18
- package/lib/components/CopyButton/index.js +2 -2
- package/lib/components/DangerButton/DangerButton.js +2 -6
- package/lib/components/DataTable/DataTable.js +48 -55
- package/lib/components/DataTable/Table.js +18 -24
- package/lib/components/DataTable/TableActionList.js +2 -2
- package/lib/components/DataTable/TableBatchAction.js +4 -9
- package/lib/components/DataTable/TableBatchActions.js +19 -25
- package/lib/components/DataTable/TableBody.js +5 -10
- package/lib/components/DataTable/TableCell.js +8 -14
- package/lib/components/DataTable/TableContainer.js +14 -20
- package/lib/components/DataTable/TableContext.js +0 -2
- package/lib/components/DataTable/TableDecoratorRow.js +5 -11
- package/lib/components/DataTable/TableExpandHeader.js +16 -22
- package/lib/components/DataTable/TableExpandRow.js +20 -26
- package/lib/components/DataTable/TableExpandedRow.js +8 -14
- package/lib/components/DataTable/TableHead.js +2 -2
- package/lib/components/DataTable/TableHeader.js +26 -32
- package/lib/components/DataTable/TableRow.js +8 -14
- package/lib/components/DataTable/TableSelectAll.js +13 -19
- package/lib/components/DataTable/TableSelectRow.js +15 -21
- package/lib/components/DataTable/TableSlugRow.js +7 -13
- package/lib/components/DataTable/TableToolbar.js +7 -13
- package/lib/components/DataTable/TableToolbarAction.js +5 -10
- package/lib/components/DataTable/TableToolbarContent.js +2 -2
- package/lib/components/DataTable/TableToolbarMenu.js +9 -15
- package/lib/components/DataTable/TableToolbarSearch.js +22 -28
- package/lib/components/DataTable/state/getDerivedStateFromProps.d.ts +19 -0
- package/lib/components/DataTable/state/getDerivedStateFromProps.js +2 -3
- package/lib/components/DataTable/state/sortStates.js +0 -2
- package/lib/components/DataTable/state/sorting.d.ts +15 -0
- package/lib/components/DataTable/state/sorting.js +0 -2
- package/lib/components/DataTable/tools/cells.js +0 -2
- package/lib/components/DataTable/tools/denormalize.d.ts +22 -0
- package/lib/components/DataTable/tools/denormalize.js +1 -2
- package/lib/components/DataTable/tools/filter.js +0 -2
- package/lib/components/DataTable/tools/normalize.d.ts +9 -0
- package/lib/components/DataTable/tools/normalize.js +1 -2
- package/lib/components/DataTable/tools/sorting.js +0 -2
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +25 -31
- package/lib/components/DatePicker/DatePicker.Skeleton.js +14 -20
- package/lib/components/DatePicker/DatePicker.js +65 -66
- package/lib/components/DatePicker/index.js +3 -3
- package/lib/components/DatePicker/plugins/appendToPlugin.js +0 -2
- package/lib/components/DatePicker/plugins/fixEventsPlugin.d.ts +2 -0
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +1 -1
- package/lib/components/DatePicker/plugins/rangePlugin.d.ts +2 -0
- package/lib/components/DatePicker/plugins/rangePlugin.js +2 -6
- package/lib/components/DatePickerInput/DatePickerInput.js +49 -49
- package/lib/components/DatePickerInput/index.js +2 -2
- package/lib/components/Dialog/index.js +72 -80
- package/lib/components/Dropdown/Dropdown.Skeleton.js +8 -14
- package/lib/components/Dropdown/Dropdown.js +49 -55
- package/lib/components/Dropdown/index.js +3 -3
- package/lib/components/ErrorBoundary/ErrorBoundary.js +4 -9
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +0 -2
- package/lib/components/ExpandableSearch/ExpandableSearch.js +6 -11
- package/lib/components/FeatureFlags/index.js +10 -17
- package/lib/components/FileUploader/FileUploader.Skeleton.js +7 -13
- package/lib/components/FileUploader/FileUploader.js +30 -36
- package/lib/components/FileUploader/FileUploaderButton.js +19 -25
- package/lib/components/FileUploader/FileUploaderDropContainer.js +18 -24
- package/lib/components/FileUploader/FileUploaderItem.js +23 -29
- package/lib/components/FileUploader/Filename.js +13 -18
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +7 -13
- package/lib/components/FluidComboBox/FluidComboBox.js +24 -30
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +14 -20
- package/lib/components/FluidDatePicker/FluidDatePicker.js +12 -18
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +4 -8
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +7 -13
- package/lib/components/FluidDropdown/FluidDropdown.js +24 -30
- package/lib/components/FluidForm/FluidForm.js +6 -12
- package/lib/components/FluidForm/FormContext.js +0 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +7 -13
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +36 -42
- package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +7 -13
- package/lib/components/FluidNumberInput/FluidNumberInput.js +30 -36
- package/lib/components/FluidSearch/FluidSearch.Skeleton.js +7 -13
- package/lib/components/FluidSearch/FluidSearch.js +19 -25
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +7 -13
- package/lib/components/FluidSelect/FluidSelect.js +17 -23
- package/lib/components/FluidSelect/index.js +3 -3
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +7 -13
- package/lib/components/FluidTextArea/FluidTextArea.js +25 -31
- package/lib/components/FluidTextInput/FluidPasswordInput.js +18 -22
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +7 -13
- package/lib/components/FluidTextInput/FluidTextInput.js +23 -29
- package/lib/components/FluidTextInput/index.js +3 -3
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +6 -12
- package/lib/components/FluidTimePicker/FluidTimePicker.js +23 -29
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +10 -15
- package/lib/components/Form/Form.js +5 -11
- package/lib/components/FormGroup/FormGroup.js +13 -19
- package/lib/components/FormItem/FormItem.js +5 -11
- package/lib/components/FormLabel/FormLabel.js +6 -12
- package/lib/components/Grid/CSSGrid.js +20 -28
- package/lib/components/Grid/Column.js +31 -37
- package/lib/components/Grid/ColumnHang.js +5 -13
- package/lib/components/Grid/FlexGrid.js +10 -18
- package/lib/components/Grid/Grid.js +9 -16
- package/lib/components/Grid/GridContext.js +7 -14
- package/lib/components/Grid/Row.js +8 -14
- package/lib/components/Heading/index.js +14 -21
- package/lib/components/Icon/Icon.Skeleton.js +4 -10
- package/lib/components/IconButton/index.js +25 -33
- package/lib/components/IconIndicator/index.js +9 -15
- package/lib/components/IdPrefix/index.js +3 -10
- package/lib/components/InlineCheckbox/InlineCheckbox.js +17 -22
- package/lib/components/InlineCheckbox/index.js +2 -2
- package/lib/components/InlineLoading/InlineLoading.js +17 -23
- package/lib/components/InlineLoading/index.js +2 -2
- package/lib/components/Layer/LayerContext.js +1 -7
- package/lib/components/Layer/LayerLevel.js +0 -2
- package/lib/components/Layer/index.js +11 -19
- package/lib/components/Layout/index.js +22 -30
- package/lib/components/LayoutDirection/LayoutDirection.js +6 -13
- package/lib/components/LayoutDirection/LayoutDirectionContext.js +1 -7
- package/lib/components/LayoutDirection/useLayoutDirection.js +0 -2
- package/lib/components/Link/Link.js +15 -21
- package/lib/components/Link/index.js +2 -2
- package/lib/components/ListBox/ListBox.js +17 -23
- package/lib/components/ListBox/ListBoxField.js +7 -12
- package/lib/components/ListBox/ListBoxMenu.js +7 -12
- package/lib/components/ListBox/ListBoxMenuIcon.js +7 -13
- package/lib/components/ListBox/ListBoxMenuItem.js +9 -15
- package/lib/components/ListBox/ListBoxPropTypes.js +2 -8
- package/lib/components/ListBox/ListBoxSelection.js +14 -20
- package/lib/components/ListBox/index.js +7 -7
- package/lib/components/ListBox/next/ListBoxSelection.js +18 -24
- package/lib/components/ListBox/next/ListBoxTrigger.js +7 -13
- package/lib/components/ListItem/ListItem.js +5 -11
- package/lib/components/Loading/Loading.js +14 -20
- package/lib/components/Loading/index.js +2 -2
- package/lib/components/Menu/Menu.d.ts +3 -1
- package/lib/components/Menu/Menu.js +18 -24
- package/lib/components/Menu/MenuContext.js +0 -2
- package/lib/components/Menu/MenuItem.js +44 -52
- package/lib/components/MenuButton/index.js +16 -24
- package/lib/components/Modal/Modal.js +91 -86
- package/lib/components/Modal/index.js +2 -2
- package/lib/components/ModalWrapper/ModalWrapper.js +30 -35
- package/lib/components/MultiSelect/FilterableMultiSelect.js +57 -67
- package/lib/components/MultiSelect/MultiSelect.js +61 -70
- package/lib/components/MultiSelect/MultiSelectPropTypes.js +2 -8
- package/lib/components/MultiSelect/filter.js +0 -6
- package/lib/components/MultiSelect/tools/itemToString.d.ts +1 -0
- package/lib/components/MultiSelect/tools/itemToString.js +1 -7
- package/lib/components/MultiSelect/tools/sorting.d.ts +9 -0
- package/lib/components/MultiSelect/tools/sorting.js +0 -2
- package/lib/components/Notification/Notification.js +118 -126
- package/lib/components/NumberInput/NumberFormatPropTypes.js +21 -27
- package/lib/components/NumberInput/NumberInput.Skeleton.js +8 -14
- package/lib/components/NumberInput/NumberInput.js +66 -74
- package/lib/components/OrderedList/OrderedList.js +8 -14
- package/lib/components/OverflowMenu/OverflowMenu.js +42 -49
- package/lib/components/OverflowMenu/index.js +3 -7
- package/lib/components/OverflowMenu/next/index.js +18 -26
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +27 -33
- package/lib/components/OverflowMenuItem/index.js +2 -2
- package/lib/components/OverflowMenuV2/index.d.ts +1 -0
- package/lib/components/OverflowMenuV2/index.js +2 -8
- package/lib/components/PageHeader/PageHeader.js +70 -78
- package/lib/components/PageHeader/index.js +0 -2
- package/lib/components/Pagination/Pagination.Skeleton.js +10 -16
- package/lib/components/Pagination/Pagination.js +44 -51
- package/lib/components/Pagination/experimental/PageSelector.d.ts +19 -0
- package/lib/components/Pagination/experimental/PageSelector.js +9 -15
- package/lib/components/Pagination/experimental/Pagination.d.ts +43 -0
- package/lib/components/Pagination/experimental/Pagination.js +34 -40
- package/lib/components/Pagination/experimental/index.d.ts +3 -0
- package/lib/components/PaginationNav/PaginationNav.js +54 -60
- package/lib/components/Popover/index.js +56 -47
- package/lib/components/PrimaryButton/PrimaryButton.js +2 -6
- package/lib/components/ProgressBar/ProgressBar.js +25 -31
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +10 -16
- package/lib/components/ProgressIndicator/ProgressIndicator.js +41 -49
- package/lib/components/RadioButton/RadioButton.Skeleton.js +6 -12
- package/lib/components/RadioButton/RadioButton.js +26 -32
- package/lib/components/RadioButton/index.js +2 -2
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +37 -43
- package/lib/components/RadioTile/RadioTile.js +25 -31
- package/lib/components/RadioTile/index.js +2 -2
- package/lib/components/Search/Search.Skeleton.js +7 -13
- package/lib/components/Search/Search.js +33 -39
- package/lib/components/Search/index.js +3 -3
- package/lib/components/SecondaryButton/SecondaryButton.js +2 -6
- package/lib/components/Select/Select.Skeleton.js +8 -14
- package/lib/components/Select/Select.js +42 -48
- package/lib/components/Select/index.js +3 -3
- package/lib/components/SelectItem/SelectItem.js +8 -14
- package/lib/components/SelectItem/index.js +2 -2
- package/lib/components/SelectItemGroup/SelectItemGroup.js +7 -13
- package/lib/components/ShapeIndicator/index.js +12 -18
- package/lib/components/SkeletonIcon/SkeletonIcon.js +4 -10
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +4 -10
- package/lib/components/SkeletonText/SkeletonText.js +11 -17
- package/lib/components/SkeletonText/index.js +2 -2
- package/lib/components/Slider/Slider.Skeleton.js +29 -35
- package/lib/components/Slider/Slider.js +84 -90
- package/lib/components/Slider/SliderHandles.js +18 -24
- package/lib/components/Slider/index.js +3 -3
- package/lib/components/Stack/HStack.js +1 -7
- package/lib/components/Stack/Stack.js +7 -15
- package/lib/components/Stack/VStack.js +1 -7
- package/lib/components/StructuredList/StructuredList.Skeleton.js +15 -21
- package/lib/components/StructuredList/StructuredList.js +60 -68
- package/lib/components/Switch/IconSwitch.d.ts +3 -0
- package/lib/components/Switch/IconSwitch.js +18 -25
- package/lib/components/Switch/Switch.js +14 -20
- package/lib/components/TabContent/TabContent.js +7 -33
- package/lib/components/Tabs/Tabs.Skeleton.js +10 -16
- package/lib/components/Tabs/Tabs.js +121 -129
- package/lib/components/Tabs/usePressable.js +0 -2
- package/lib/components/Tag/DismissibleTag.js +24 -30
- package/lib/components/Tag/OperationalTag.js +16 -22
- package/lib/components/Tag/SelectableTag.js +19 -25
- package/lib/components/Tag/Tag.Skeleton.js +5 -11
- package/lib/components/Tag/Tag.js +28 -34
- package/lib/components/Tag/isEllipsisActive.js +0 -2
- package/lib/components/Text/Text.js +6 -13
- package/lib/components/Text/TextDirection.js +4 -11
- package/lib/components/Text/TextDirectionContext.js +0 -2
- package/lib/components/Text/createTextComponent.js +1 -7
- package/lib/components/Text/index.js +0 -2
- package/lib/components/TextArea/TextArea.Skeleton.js +7 -13
- package/lib/components/TextArea/TextArea.js +49 -55
- package/lib/components/TextArea/index.js +3 -3
- package/lib/components/TextInput/ControlledPasswordInput.js +36 -42
- package/lib/components/TextInput/PasswordInput.js +48 -54
- package/lib/components/TextInput/TextInput.Skeleton.js +7 -13
- package/lib/components/TextInput/TextInput.js +47 -53
- package/lib/components/TextInput/index.js +3 -3
- package/lib/components/TextInput/util.d.ts +9 -0
- package/lib/components/TextInput/util.js +0 -2
- package/lib/components/Theme/index.js +16 -24
- package/lib/components/Tile/Tile.js +92 -100
- package/lib/components/TileGroup/TileGroup.js +15 -22
- package/lib/components/TimePicker/TimePicker.js +39 -45
- package/lib/components/TimePickerSelect/TimePickerSelect.js +10 -16
- package/lib/components/Toggle/Toggle.Skeleton.js +7 -13
- package/lib/components/Toggle/Toggle.js +28 -34
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +12 -20
- package/lib/components/Toggletip/index.js +32 -40
- package/lib/components/Tooltip/DefinitionTooltip.js +14 -22
- package/lib/components/Tooltip/Tooltip.js +19 -27
- package/lib/components/TreeView/TreeContext.js +0 -2
- package/lib/components/TreeView/TreeNode.js +41 -47
- package/lib/components/TreeView/TreeView.js +17 -23
- package/lib/components/UIShell/Content.js +6 -12
- package/lib/components/UIShell/Header.js +4 -10
- package/lib/components/UIShell/HeaderContainer.js +4 -9
- package/lib/components/UIShell/HeaderGlobalAction.js +11 -17
- package/lib/components/UIShell/HeaderGlobalBar.js +2 -2
- package/lib/components/UIShell/HeaderMenu.js +17 -23
- package/lib/components/UIShell/HeaderMenuButton.js +9 -15
- package/lib/components/UIShell/HeaderMenuItem.js +11 -17
- package/lib/components/UIShell/HeaderName.js +8 -14
- package/lib/components/UIShell/HeaderNavigation.js +6 -12
- package/lib/components/UIShell/HeaderPanel.js +11 -17
- package/lib/components/UIShell/HeaderSideNavItems.js +6 -12
- package/lib/components/UIShell/Link.js +6 -11
- package/lib/components/UIShell/SideNav.js +23 -29
- package/lib/components/UIShell/SideNavDetails.js +7 -13
- package/lib/components/UIShell/SideNavDivider.js +5 -11
- package/lib/components/UIShell/SideNavFooter.js +12 -18
- package/lib/components/UIShell/SideNavHeader.js +8 -14
- package/lib/components/UIShell/SideNavIcon.js +6 -12
- package/lib/components/UIShell/SideNavItem.js +6 -12
- package/lib/components/UIShell/SideNavItems.js +9 -15
- package/lib/components/UIShell/SideNavLink.js +13 -19
- package/lib/components/UIShell/SideNavLinkText.js +5 -11
- package/lib/components/UIShell/SideNavMenu.js +20 -26
- package/lib/components/UIShell/SideNavMenuItem.js +13 -19
- package/lib/components/UIShell/SideNavSwitcher.js +13 -19
- package/lib/components/UIShell/SkipToContent.js +7 -13
- package/lib/components/UIShell/Switcher.js +9 -15
- package/lib/components/UIShell/SwitcherDivider.js +4 -10
- package/lib/components/UIShell/SwitcherItem.js +15 -21
- package/lib/components/UIShell/_utils.d.ts +7 -0
- package/lib/components/UIShell/_utils.js +0 -2
- package/lib/components/UnorderedList/UnorderedList.js +7 -13
- package/lib/feature-flags.d.ts +1 -0
- package/lib/feature-flags.js +3 -4
- package/lib/index.js +180 -182
- package/lib/internal/FloatingMenu.js +10 -18
- package/lib/internal/OptimizedResize.js +2 -8
- package/lib/internal/Selection.js +1 -7
- package/lib/internal/clamp.js +0 -2
- package/lib/internal/createClassWrapper.js +1 -7
- package/lib/internal/deprecateFieldOnObject.js +1 -3
- package/lib/internal/environment.js +0 -2
- package/lib/internal/getAnnouncement.js +0 -2
- package/lib/internal/keyboard/keys.js +0 -2
- package/lib/internal/keyboard/match.js +0 -2
- package/lib/internal/keyboard/navigation.js +0 -2
- package/lib/internal/noopFn.js +0 -2
- package/lib/internal/useAttachedMenu.js +0 -2
- package/lib/internal/useControllableState.js +0 -2
- package/lib/internal/useDelayedState.js +0 -2
- package/lib/internal/useEvent.js +0 -2
- package/lib/internal/useId.d.ts +21 -0
- package/lib/internal/useId.js +27 -7
- package/lib/internal/useIdPrefix.js +2 -8
- package/lib/internal/useIsomorphicEffect.js +1 -1
- package/lib/internal/useMatchMedia.js +0 -2
- package/lib/internal/useMergedRefs.js +0 -2
- package/lib/internal/useNoInteractiveChildren.js +0 -2
- package/lib/internal/useNormalizedInputProps.js +2 -8
- package/lib/internal/useOutsideClick.js +0 -2
- package/lib/internal/useOverflowItems.js +1 -7
- package/lib/internal/usePrefix.js +2 -8
- package/lib/internal/usePreviousValue.js +0 -2
- package/lib/internal/useResizeObserver.js +0 -2
- package/lib/internal/useSavedCallback.js +0 -2
- package/lib/internal/utils.js +0 -2
- package/lib/internal/warning.js +0 -2
- package/lib/internal/wrapFocus.js +0 -2
- package/lib/node_modules/es-toolkit/dist/compat/function/{debounce.mjs.js → debounce.js} +1 -3
- package/lib/node_modules/es-toolkit/dist/compat/function/{throttle.mjs.js → throttle.js} +1 -3
- package/lib/node_modules/es-toolkit/dist/function/{debounce.mjs.js → debounce.js} +0 -2
- package/lib/prop-types/AriaPropTypes.js +2 -8
- package/lib/prop-types/deprecate.js +0 -2
- package/lib/prop-types/deprecateComponent.d.ts +1 -0
- package/lib/prop-types/deprecateComponent.js +2 -5
- package/lib/prop-types/deprecateValuesWithin.d.ts +1 -0
- package/lib/prop-types/deprecateValuesWithin.js +1 -1
- package/lib/prop-types/isRequiredOneOf.js +0 -2
- package/lib/prop-types/requiredIfGivenPropIsTruthy.d.ts +14 -0
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +1 -1
- package/lib/tools/events.js +0 -2
- package/lib/tools/mapPopoverAlign.js +0 -2
- package/lib/tools/mergeRefs.d.ts +12 -0
- package/lib/tools/mergeRefs.js +1 -2
- package/lib/tools/setupGetInstanceId.js +0 -2
- package/lib/tools/toggleClass.js +0 -2
- package/lib/tools/wrapComponent.js +4 -10
- package/package.json +11 -11
- /package/es/node_modules/es-toolkit/dist/function/{debounce.mjs.js → debounce.js} +0 -0
|
@@ -22,13 +22,6 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
22
22
|
var index = require('../IconButton/index.js');
|
|
23
23
|
var isEqual = require('react-fast-compare');
|
|
24
24
|
|
|
25
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
26
|
-
|
|
27
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
28
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
29
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
30
|
-
var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
|
|
31
|
-
|
|
32
25
|
var _CaretLeft, _CaretRight;
|
|
33
26
|
function mapPageSizesToObject(sizes) {
|
|
34
27
|
return typeof sizes[0] === 'object' && sizes[0] !== null ? sizes : sizes.map(size => ({
|
|
@@ -40,7 +33,7 @@ function renderSelectItems(total) {
|
|
|
40
33
|
let counter = 1;
|
|
41
34
|
const itemArr = [];
|
|
42
35
|
while (counter <= total) {
|
|
43
|
-
itemArr.push(/*#__PURE__*/
|
|
36
|
+
itemArr.push(/*#__PURE__*/React.createElement(SelectItem.default, {
|
|
44
37
|
key: counter,
|
|
45
38
|
value: counter,
|
|
46
39
|
text: String(counter)
|
|
@@ -60,7 +53,7 @@ function getPageSize(pageSizes, pageSize) {
|
|
|
60
53
|
}
|
|
61
54
|
return pageSizes[0].value;
|
|
62
55
|
}
|
|
63
|
-
const Pagination = /*#__PURE__*/
|
|
56
|
+
const Pagination = /*#__PURE__*/React.forwardRef(function Pagination({
|
|
64
57
|
backwardText = 'Previous page',
|
|
65
58
|
className: customClassName = '',
|
|
66
59
|
disabled = false,
|
|
@@ -99,20 +92,20 @@ const Pagination = /*#__PURE__*/React__default["default"].forwardRef(function Pa
|
|
|
99
92
|
return getPageSize(pageSizes, controlledPageSize);
|
|
100
93
|
});
|
|
101
94
|
const [prevControlledPageSize, setPrevControlledPageSize] = React.useState(controlledPageSize);
|
|
102
|
-
const className =
|
|
95
|
+
const className = cx({
|
|
103
96
|
[`${prefix}--pagination`]: true,
|
|
104
97
|
[`${prefix}--pagination--${size}`]: size,
|
|
105
98
|
[customClassName]: !!customClassName
|
|
106
99
|
});
|
|
107
100
|
const totalPages = totalItems ? Math.max(Math.ceil(totalItems / pageSize), 1) : 1;
|
|
108
101
|
const backButtonDisabled = disabled || page === 1;
|
|
109
|
-
const backButtonClasses =
|
|
102
|
+
const backButtonClasses = cx({
|
|
110
103
|
[`${prefix}--pagination__button`]: true,
|
|
111
104
|
[`${prefix}--pagination__button--backward`]: true,
|
|
112
105
|
[`${prefix}--pagination__button--no-index`]: backButtonDisabled
|
|
113
106
|
});
|
|
114
107
|
const forwardButtonDisabled = disabled || page === totalPages && !pagesUnknown;
|
|
115
|
-
const forwardButtonClasses =
|
|
108
|
+
const forwardButtonClasses = cx({
|
|
116
109
|
[`${prefix}--pagination__button`]: true,
|
|
117
110
|
[`${prefix}--pagination__button--forward`]: true,
|
|
118
111
|
[`${prefix}--pagination__button--no-index`]: forwardButtonDisabled
|
|
@@ -144,7 +137,7 @@ const Pagination = /*#__PURE__*/React__default["default"].forwardRef(function Pa
|
|
|
144
137
|
setPageSize(getPageSize(pageSizes, controlledPageSize));
|
|
145
138
|
setPrevControlledPageSize(controlledPageSize);
|
|
146
139
|
}
|
|
147
|
-
if (!
|
|
140
|
+
if (!isEqual(controlledPageSizes, prevPageSizes)) {
|
|
148
141
|
const pageSizes = mapPageSizesToObject(controlledPageSizes);
|
|
149
142
|
const hasPageSize = pageSizes.find(size => {
|
|
150
143
|
return size.value === pageSize;
|
|
@@ -220,16 +213,16 @@ const Pagination = /*#__PURE__*/React__default["default"].forwardRef(function Pa
|
|
|
220
213
|
});
|
|
221
214
|
}
|
|
222
215
|
}
|
|
223
|
-
return /*#__PURE__*/
|
|
216
|
+
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
|
224
217
|
className: className,
|
|
225
218
|
ref: ref
|
|
226
|
-
}, rest), /*#__PURE__*/
|
|
219
|
+
}, rest), /*#__PURE__*/React.createElement("div", {
|
|
227
220
|
className: `${prefix}--pagination__left`
|
|
228
|
-
}, /*#__PURE__*/
|
|
221
|
+
}, /*#__PURE__*/React.createElement("label", {
|
|
229
222
|
id: `${prefix}-pagination-select-${inputId}-count-label`,
|
|
230
223
|
className: `${prefix}--pagination__text`,
|
|
231
224
|
htmlFor: `${prefix}-pagination-select-${inputId}`
|
|
232
|
-
}, itemsPerPageText), /*#__PURE__*/
|
|
225
|
+
}, itemsPerPageText), /*#__PURE__*/React.createElement(Select.default, {
|
|
233
226
|
id: `${prefix}-pagination-select-${inputId}`,
|
|
234
227
|
className: `${prefix}--select__item-count`,
|
|
235
228
|
labelText: "",
|
|
@@ -239,17 +232,17 @@ const Pagination = /*#__PURE__*/React__default["default"].forwardRef(function Pa
|
|
|
239
232
|
onChange: handleSizeChange,
|
|
240
233
|
disabled: pageSizeInputDisabled || disabled,
|
|
241
234
|
value: pageSize
|
|
242
|
-
}, pageSizes.map(sizeObj => /*#__PURE__*/
|
|
235
|
+
}, pageSizes.map(sizeObj => /*#__PURE__*/React.createElement(SelectItem.default, {
|
|
243
236
|
key: sizeObj.value,
|
|
244
237
|
value: sizeObj.value,
|
|
245
238
|
text: String(sizeObj.text)
|
|
246
|
-
}))), /*#__PURE__*/
|
|
239
|
+
}))), /*#__PURE__*/React.createElement("span", {
|
|
247
240
|
className: `${prefix}--pagination__text ${prefix}--pagination__items-count`
|
|
248
|
-
}, pagesUnknown || !totalItems ? totalItems === 0 ? itemRangeText(0, 0, 0) : itemText(pageSize * (page - 1) + 1, page * pageSize) : itemRangeText(Math.min(pageSize * (page - 1) + 1, totalItems), Math.min(page * pageSize, totalItems), totalItems))), /*#__PURE__*/
|
|
241
|
+
}, pagesUnknown || !totalItems ? totalItems === 0 ? itemRangeText(0, 0, 0) : itemText(pageSize * (page - 1) + 1, page * pageSize) : itemRangeText(Math.min(pageSize * (page - 1) + 1, totalItems), Math.min(page * pageSize, totalItems), totalItems))), /*#__PURE__*/React.createElement("div", {
|
|
249
242
|
className: `${prefix}--pagination__right`
|
|
250
|
-
}, pagesUnknown ? /*#__PURE__*/
|
|
243
|
+
}, pagesUnknown ? /*#__PURE__*/React.createElement("span", {
|
|
251
244
|
className: `${prefix}--pagination__text ${prefix}--pagination__page-text ${prefix}--pagination__unknown-pages-text`
|
|
252
|
-
}, pageText(page)) : /*#__PURE__*/
|
|
245
|
+
}, pageText(page)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Select.default, {
|
|
253
246
|
id: `${prefix}-pagination-select-${inputId}-right`,
|
|
254
247
|
className: `${prefix}--select__page-number`,
|
|
255
248
|
labelText: `Page of ${totalPages} pages`,
|
|
@@ -258,11 +251,11 @@ const Pagination = /*#__PURE__*/React__default["default"].forwardRef(function Pa
|
|
|
258
251
|
onChange: handlePageInputChange,
|
|
259
252
|
value: page,
|
|
260
253
|
disabled: pageInputDisabled || disabled
|
|
261
|
-
}, selectItems), /*#__PURE__*/
|
|
254
|
+
}, selectItems), /*#__PURE__*/React.createElement("span", {
|
|
262
255
|
className: `${prefix}--pagination__text`
|
|
263
|
-
}, pageRangeText(page, totalPages))), /*#__PURE__*/
|
|
256
|
+
}, pageRangeText(page, totalPages))), /*#__PURE__*/React.createElement("div", {
|
|
264
257
|
className: `${prefix}--pagination__control-buttons`
|
|
265
|
-
}, /*#__PURE__*/
|
|
258
|
+
}, /*#__PURE__*/React.createElement(index.IconButton, {
|
|
266
259
|
align: "top",
|
|
267
260
|
disabled: backButtonDisabled,
|
|
268
261
|
kind: "ghost",
|
|
@@ -271,7 +264,7 @@ const Pagination = /*#__PURE__*/React__default["default"].forwardRef(function Pa
|
|
|
271
264
|
"aria-label": backwardText,
|
|
272
265
|
onClick: decrementPage,
|
|
273
266
|
ref: backBtnRef
|
|
274
|
-
}, _CaretLeft || (_CaretLeft = /*#__PURE__*/
|
|
267
|
+
}, _CaretLeft || (_CaretLeft = /*#__PURE__*/React.createElement(iconsReact.CaretLeft, null))), /*#__PURE__*/React.createElement(index.IconButton, {
|
|
275
268
|
align: "top-end",
|
|
276
269
|
disabled: forwardButtonDisabled || isLastPage,
|
|
277
270
|
kind: "ghost",
|
|
@@ -280,95 +273,95 @@ const Pagination = /*#__PURE__*/React__default["default"].forwardRef(function Pa
|
|
|
280
273
|
"aria-label": forwardText,
|
|
281
274
|
onClick: incrementPage,
|
|
282
275
|
ref: forwardBtnRef
|
|
283
|
-
}, _CaretRight || (_CaretRight = /*#__PURE__*/
|
|
276
|
+
}, _CaretRight || (_CaretRight = /*#__PURE__*/React.createElement(iconsReact.CaretRight, null))))));
|
|
284
277
|
});
|
|
285
278
|
Pagination.propTypes = {
|
|
286
279
|
/**
|
|
287
280
|
* The description for the backward icon.
|
|
288
281
|
*/
|
|
289
|
-
backwardText:
|
|
282
|
+
backwardText: PropTypes.string,
|
|
290
283
|
/**
|
|
291
284
|
* The CSS class names.
|
|
292
285
|
*/
|
|
293
|
-
className:
|
|
286
|
+
className: PropTypes.string,
|
|
294
287
|
/**
|
|
295
288
|
* `true` if the backward/forward buttons, as well as the page select elements, should be disabled.
|
|
296
289
|
*/
|
|
297
|
-
disabled:
|
|
290
|
+
disabled: PropTypes.bool,
|
|
298
291
|
/**
|
|
299
292
|
* The description for the forward icon.
|
|
300
293
|
*/
|
|
301
|
-
forwardText:
|
|
294
|
+
forwardText: PropTypes.string,
|
|
302
295
|
/**
|
|
303
296
|
* The unique ID of this component instance.
|
|
304
297
|
*/
|
|
305
|
-
id:
|
|
298
|
+
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
306
299
|
// TODO: remove when v9 is deprecated
|
|
307
300
|
/**
|
|
308
301
|
* `true` if the current page should be the last page.
|
|
309
302
|
*/
|
|
310
|
-
isLastPage:
|
|
303
|
+
isLastPage: PropTypes.bool,
|
|
311
304
|
/**
|
|
312
305
|
* The function returning a translatable text showing where the current page is,
|
|
313
306
|
* in a manner of the range of items.
|
|
314
307
|
*/
|
|
315
|
-
itemRangeText:
|
|
308
|
+
itemRangeText: PropTypes.func,
|
|
316
309
|
/**
|
|
317
310
|
* A variant of `itemRangeText`, used if the total number of items is unknown.
|
|
318
311
|
*/
|
|
319
|
-
itemText:
|
|
312
|
+
itemText: PropTypes.func,
|
|
320
313
|
/**
|
|
321
314
|
* The translatable text indicating the number of items per page.
|
|
322
315
|
*/
|
|
323
|
-
itemsPerPageText:
|
|
316
|
+
itemsPerPageText: PropTypes.string,
|
|
324
317
|
/**
|
|
325
318
|
* The callback function called when the current page changes.
|
|
326
319
|
*/
|
|
327
|
-
onChange:
|
|
320
|
+
onChange: PropTypes.func,
|
|
328
321
|
/**
|
|
329
322
|
* The current page.
|
|
330
323
|
*/
|
|
331
|
-
page:
|
|
324
|
+
page: PropTypes.number,
|
|
332
325
|
/**
|
|
333
326
|
* `true` if the select box to change the page should be disabled.
|
|
334
327
|
*/
|
|
335
|
-
pageInputDisabled:
|
|
336
|
-
pageNumberText:
|
|
328
|
+
pageInputDisabled: PropTypes.bool,
|
|
329
|
+
pageNumberText: PropTypes.string,
|
|
337
330
|
/**
|
|
338
331
|
* A function returning PII showing where the current page is.
|
|
339
332
|
*/
|
|
340
|
-
pageRangeText:
|
|
333
|
+
pageRangeText: PropTypes.func,
|
|
341
334
|
/**
|
|
342
335
|
* The number dictating how many items a page contains.
|
|
343
336
|
*/
|
|
344
|
-
pageSize:
|
|
337
|
+
pageSize: PropTypes.number,
|
|
345
338
|
/**
|
|
346
339
|
* `true` if the select box to change the items per page should be disabled.
|
|
347
340
|
*/
|
|
348
|
-
pageSizeInputDisabled:
|
|
341
|
+
pageSizeInputDisabled: PropTypes.bool,
|
|
349
342
|
/**
|
|
350
343
|
* The choices for `pageSize`.
|
|
351
344
|
*/
|
|
352
|
-
pageSizes:
|
|
353
|
-
text:
|
|
354
|
-
value:
|
|
345
|
+
pageSizes: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number.isRequired), PropTypes.arrayOf(PropTypes.shape({
|
|
346
|
+
text: PropTypes.string.isRequired,
|
|
347
|
+
value: PropTypes.number.isRequired
|
|
355
348
|
}).isRequired)]).isRequired,
|
|
356
349
|
/**
|
|
357
350
|
* The translatable text showing the current page.
|
|
358
351
|
*/
|
|
359
|
-
pageText:
|
|
352
|
+
pageText: PropTypes.func,
|
|
360
353
|
/**
|
|
361
354
|
* `true` if the total number of items is unknown.
|
|
362
355
|
*/
|
|
363
|
-
pagesUnknown:
|
|
356
|
+
pagesUnknown: PropTypes.bool,
|
|
364
357
|
/**
|
|
365
358
|
* Specify the size of the Pagination.
|
|
366
359
|
*/
|
|
367
|
-
size:
|
|
360
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
368
361
|
/**
|
|
369
362
|
* The total number of items.
|
|
370
363
|
*/
|
|
371
|
-
totalItems:
|
|
364
|
+
totalItems: PropTypes.number
|
|
372
365
|
};
|
|
373
366
|
|
|
374
|
-
exports
|
|
367
|
+
exports.default = Pagination;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default PageSelector;
|
|
2
|
+
declare function PageSelector({ className, currentPage, id, labelText, totalPages, ...other }: {
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
className?: null | undefined;
|
|
5
|
+
currentPage: any;
|
|
6
|
+
id?: number | undefined;
|
|
7
|
+
labelText?: string | undefined;
|
|
8
|
+
totalPages: any;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare namespace PageSelector {
|
|
11
|
+
namespace propTypes {
|
|
12
|
+
let className: PropTypes.Requireable<string>;
|
|
13
|
+
let currentPage: PropTypes.Validator<number>;
|
|
14
|
+
let id: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
15
|
+
let labelText: PropTypes.Requireable<string>;
|
|
16
|
+
let totalPages: PropTypes.Validator<number>;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
import PropTypes from 'prop-types';
|
|
@@ -19,12 +19,6 @@ require('../../Select/Select.Skeleton.js');
|
|
|
19
19
|
var SelectItem = require('../../SelectItem/SelectItem.js');
|
|
20
20
|
var usePrefix = require('../../../internal/usePrefix.js');
|
|
21
21
|
|
|
22
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
|
-
|
|
24
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
25
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
26
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
27
|
-
|
|
28
22
|
function PageSelector({
|
|
29
23
|
className = null,
|
|
30
24
|
currentPage,
|
|
@@ -39,7 +33,7 @@ function PageSelector({
|
|
|
39
33
|
const renderPages = total => {
|
|
40
34
|
const pages = [];
|
|
41
35
|
for (let counter = 1; counter <= total; counter += 1) {
|
|
42
|
-
pages.push(/*#__PURE__*/
|
|
36
|
+
pages.push(/*#__PURE__*/React.createElement(SelectItem.default, {
|
|
43
37
|
key: counter,
|
|
44
38
|
value: counter,
|
|
45
39
|
text: String(counter)
|
|
@@ -47,8 +41,8 @@ function PageSelector({
|
|
|
47
41
|
}
|
|
48
42
|
return pages;
|
|
49
43
|
};
|
|
50
|
-
return /*#__PURE__*/
|
|
51
|
-
className:
|
|
44
|
+
return /*#__PURE__*/React.createElement(Select.default, _rollupPluginBabelHelpers.extends({
|
|
45
|
+
className: cx(namespace, className),
|
|
52
46
|
hideLabel: true,
|
|
53
47
|
id: instanceId || id,
|
|
54
48
|
inline: true,
|
|
@@ -58,18 +52,18 @@ function PageSelector({
|
|
|
58
52
|
}
|
|
59
53
|
PageSelector.propTypes = {
|
|
60
54
|
/** Extra class names to add. */
|
|
61
|
-
className:
|
|
55
|
+
className: PropTypes.string,
|
|
62
56
|
/** The current page. */
|
|
63
|
-
currentPage:
|
|
57
|
+
currentPage: PropTypes.number.isRequired,
|
|
64
58
|
/** The unique ID of this component instance. */
|
|
65
|
-
id:
|
|
59
|
+
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
66
60
|
/** Translatable string to label the page selector element. */
|
|
67
|
-
labelText:
|
|
61
|
+
labelText: PropTypes.string,
|
|
68
62
|
/**
|
|
69
63
|
* Total number of pages.
|
|
70
64
|
* This value is calculated using a valid `totalItems` prop passed to the parent `Unstable_Pagination`.
|
|
71
65
|
*/
|
|
72
|
-
totalPages:
|
|
66
|
+
totalPages: PropTypes.number.isRequired
|
|
73
67
|
};
|
|
74
68
|
|
|
75
|
-
exports
|
|
69
|
+
exports.default = PageSelector;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export default Pagination;
|
|
2
|
+
declare function Pagination({ backwardText, children, className, disabled, forwardText, id, initialPage, itemsPerPageText, itemRangeText, itemText, onChange, pageRangeText, pageSize, pageSizes, pageText, pagesUnknown, totalItems, ...other }: {
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
backwardText?: string | undefined;
|
|
5
|
+
children?: undefined;
|
|
6
|
+
className?: null | undefined;
|
|
7
|
+
disabled?: boolean | undefined;
|
|
8
|
+
forwardText?: string | undefined;
|
|
9
|
+
id?: number | undefined;
|
|
10
|
+
initialPage?: number | undefined;
|
|
11
|
+
itemsPerPageText?: string | undefined;
|
|
12
|
+
itemRangeText?: ((min: any, max: any, total: any) => string) | undefined;
|
|
13
|
+
itemText?: ((min: any, max: any) => string) | undefined;
|
|
14
|
+
onChange: any;
|
|
15
|
+
pageRangeText?: ((current: any, total: any) => string) | undefined;
|
|
16
|
+
pageSize?: number | undefined;
|
|
17
|
+
pageSizes?: undefined;
|
|
18
|
+
pageText?: ((page: any) => string) | undefined;
|
|
19
|
+
pagesUnknown?: boolean | undefined;
|
|
20
|
+
totalItems?: undefined;
|
|
21
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare namespace Pagination {
|
|
23
|
+
namespace propTypes {
|
|
24
|
+
let backwardText: PropTypes.Requireable<string>;
|
|
25
|
+
let children: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
|
|
26
|
+
let className: PropTypes.Requireable<string>;
|
|
27
|
+
let disabled: PropTypes.Requireable<boolean>;
|
|
28
|
+
let forwardText: PropTypes.Requireable<string>;
|
|
29
|
+
let id: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
|
|
30
|
+
let initialPage: PropTypes.Requireable<number>;
|
|
31
|
+
let itemRangeText: PropTypes.Requireable<(...args: any[]) => any>;
|
|
32
|
+
let itemText: PropTypes.Requireable<(...args: any[]) => any>;
|
|
33
|
+
let itemsPerPageText: PropTypes.Requireable<string>;
|
|
34
|
+
let onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
35
|
+
let pageRangeText: PropTypes.Requireable<(...args: any[]) => any>;
|
|
36
|
+
let pageSize: PropTypes.Requireable<number>;
|
|
37
|
+
let pageSizes: PropTypes.Requireable<(number | null | undefined)[]>;
|
|
38
|
+
let pageText: PropTypes.Requireable<(...args: any[]) => any>;
|
|
39
|
+
let pagesUnknown: PropTypes.Requireable<boolean>;
|
|
40
|
+
let totalItems: PropTypes.Requireable<number>;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
import PropTypes from 'prop-types';
|
|
@@ -20,12 +20,6 @@ var SelectItem = require('../../SelectItem/SelectItem.js');
|
|
|
20
20
|
var index = require('../../IconButton/index.js');
|
|
21
21
|
var usePrefix = require('../../../internal/usePrefix.js');
|
|
22
22
|
|
|
23
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
24
|
-
|
|
25
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
26
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
27
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
28
|
-
|
|
29
23
|
var _CaretLeft, _CaretRight;
|
|
30
24
|
function Pagination({
|
|
31
25
|
backwardText = 'Previous page',
|
|
@@ -73,15 +67,15 @@ function Pagination({
|
|
|
73
67
|
});
|
|
74
68
|
}
|
|
75
69
|
const namespace = `${prefix}--unstable-pagination`;
|
|
76
|
-
return /*#__PURE__*/
|
|
77
|
-
className:
|
|
78
|
-
}, other), /*#__PURE__*/
|
|
70
|
+
return /*#__PURE__*/React.createElement("section", _rollupPluginBabelHelpers.extends({
|
|
71
|
+
className: cx(namespace, className)
|
|
72
|
+
}, other), /*#__PURE__*/React.createElement("div", {
|
|
79
73
|
className: `${namespace}__left`
|
|
80
|
-
}, pageSizes && /*#__PURE__*/
|
|
74
|
+
}, pageSizes && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("label", {
|
|
81
75
|
id: `${namespace}__page-sizer__counter-${id}`,
|
|
82
76
|
className: `${namespace}__text`,
|
|
83
77
|
htmlFor: `${namespace}__page-sizer__input-${id}`
|
|
84
|
-
}, itemsPerPageText), /*#__PURE__*/
|
|
78
|
+
}, itemsPerPageText), /*#__PURE__*/React.createElement(Select.default, {
|
|
85
79
|
id: `${namespace}__page-sizer__input-${id}`,
|
|
86
80
|
className: `${namespace}__page-sizer`,
|
|
87
81
|
labelText: "",
|
|
@@ -90,117 +84,117 @@ function Pagination({
|
|
|
90
84
|
inline: true,
|
|
91
85
|
onChange: event => setCurrentPageSize(Number(event.target.value)),
|
|
92
86
|
value: currentPageSize
|
|
93
|
-
}, pageSizes.map(size => /*#__PURE__*/
|
|
87
|
+
}, pageSizes.map(size => /*#__PURE__*/React.createElement(SelectItem.default, {
|
|
94
88
|
key: size,
|
|
95
89
|
value: size,
|
|
96
90
|
text: String(size)
|
|
97
|
-
})))), /*#__PURE__*/
|
|
91
|
+
})))), /*#__PURE__*/React.createElement("span", {
|
|
98
92
|
className: `${namespace}__text`
|
|
99
|
-
}, totalItems && !pagesUnknown && itemRangeText(Math.min(currentPageSize * (currentPage - 1) + 1, totalItems), Math.min(currentPage * currentPageSize, totalItems), totalItems), totalItems && pagesUnknown && itemText(currentPageSize * (currentPage - 1) + 1, currentPage * currentPageSize), !totalItems && itemText(currentPageSize * (currentPage - 1) + 1, currentPage * currentPageSize))), /*#__PURE__*/
|
|
93
|
+
}, totalItems && !pagesUnknown && itemRangeText(Math.min(currentPageSize * (currentPage - 1) + 1, totalItems), Math.min(currentPage * currentPageSize, totalItems), totalItems), totalItems && pagesUnknown && itemText(currentPageSize * (currentPage - 1) + 1, currentPage * currentPageSize), !totalItems && itemText(currentPageSize * (currentPage - 1) + 1, currentPage * currentPageSize))), /*#__PURE__*/React.createElement("div", {
|
|
100
94
|
className: `${namespace}__right`
|
|
101
95
|
}, children && totalItems && children({
|
|
102
96
|
currentPage,
|
|
103
97
|
currentPageSize,
|
|
104
98
|
onSetPage,
|
|
105
99
|
totalPages
|
|
106
|
-
}), children && totalItems && !pagesUnknown && /*#__PURE__*/
|
|
100
|
+
}), children && totalItems && !pagesUnknown && /*#__PURE__*/React.createElement("span", {
|
|
107
101
|
className: `${namespace}__text`
|
|
108
|
-
}, pageRangeText('', totalPages)), children && !totalItems && /*#__PURE__*/
|
|
102
|
+
}, pageRangeText('', totalPages)), children && !totalItems && /*#__PURE__*/React.createElement("span", {
|
|
109
103
|
className: `${namespace}__text`
|
|
110
|
-
}, pageText(currentPage)), !children && /*#__PURE__*/
|
|
104
|
+
}, pageText(currentPage)), !children && /*#__PURE__*/React.createElement("span", {
|
|
111
105
|
className: `${namespace}__text`
|
|
112
|
-
}, !totalItems ? pageText(currentPage) : pageRangeText(currentPage, totalPages)), /*#__PURE__*/
|
|
106
|
+
}, !totalItems ? pageText(currentPage) : pageRangeText(currentPage, totalPages)), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(index.IconButton, {
|
|
113
107
|
align: "top",
|
|
114
108
|
disabled: backButtonDisabled,
|
|
115
109
|
kind: "ghost",
|
|
116
|
-
className:
|
|
110
|
+
className: cx(`${namespace}__button`, `${namespace}__button--backward`, {
|
|
117
111
|
[`${namespace}__button--no-index`]: backButtonDisabled
|
|
118
112
|
}),
|
|
119
113
|
label: backwardText,
|
|
120
114
|
onClick: () => decrementPage()
|
|
121
|
-
}, _CaretLeft || (_CaretLeft = /*#__PURE__*/
|
|
115
|
+
}, _CaretLeft || (_CaretLeft = /*#__PURE__*/React.createElement(iconsReact.CaretLeft, null))), /*#__PURE__*/React.createElement(index.IconButton, {
|
|
122
116
|
align: "top-right",
|
|
123
117
|
disabled: forwardButtonDisabled,
|
|
124
118
|
kind: "ghost",
|
|
125
|
-
className:
|
|
119
|
+
className: cx(`${namespace}__button`, `${namespace}__button--forward`, {
|
|
126
120
|
[`${namespace}__button--no-index`]: forwardButtonDisabled
|
|
127
121
|
}),
|
|
128
122
|
label: forwardText,
|
|
129
123
|
onClick: () => incrementPage()
|
|
130
|
-
}, _CaretRight || (_CaretRight = /*#__PURE__*/
|
|
124
|
+
}, _CaretRight || (_CaretRight = /*#__PURE__*/React.createElement(iconsReact.CaretRight, null))))));
|
|
131
125
|
}
|
|
132
126
|
Pagination.propTypes = {
|
|
133
127
|
/**
|
|
134
128
|
* The description for the backward icon.
|
|
135
129
|
*/
|
|
136
|
-
backwardText:
|
|
130
|
+
backwardText: PropTypes.string,
|
|
137
131
|
/**
|
|
138
132
|
* The children of the pagination component.
|
|
139
133
|
*/
|
|
140
|
-
children:
|
|
134
|
+
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
141
135
|
/**
|
|
142
136
|
* Extra classes to add.
|
|
143
137
|
*/
|
|
144
|
-
className:
|
|
138
|
+
className: PropTypes.string,
|
|
145
139
|
/**
|
|
146
140
|
* `true` if the backward/forward buttons should be disabled.
|
|
147
141
|
*/
|
|
148
|
-
disabled:
|
|
142
|
+
disabled: PropTypes.bool,
|
|
149
143
|
/**
|
|
150
144
|
* The description for the forward icon.
|
|
151
145
|
*/
|
|
152
|
-
forwardText:
|
|
146
|
+
forwardText: PropTypes.string,
|
|
153
147
|
/** The unique ID of this component instance. */
|
|
154
|
-
id:
|
|
148
|
+
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
155
149
|
/**
|
|
156
150
|
* The initial active page when the component is first mounted.
|
|
157
151
|
*/
|
|
158
|
-
initialPage:
|
|
152
|
+
initialPage: PropTypes.number,
|
|
159
153
|
/**
|
|
160
154
|
* The function returning a translatable text showing where the current page is,
|
|
161
155
|
* in a manner of the range of items.
|
|
162
156
|
*/
|
|
163
|
-
itemRangeText:
|
|
157
|
+
itemRangeText: PropTypes.func,
|
|
164
158
|
/**
|
|
165
159
|
* A variant of `itemRangeText`, used if the total number of items is unknown.
|
|
166
160
|
*/
|
|
167
|
-
itemText:
|
|
161
|
+
itemText: PropTypes.func,
|
|
168
162
|
/**
|
|
169
163
|
* The translatable text indicating the number of items per page.
|
|
170
164
|
*/
|
|
171
|
-
itemsPerPageText:
|
|
165
|
+
itemsPerPageText: PropTypes.string,
|
|
172
166
|
/**
|
|
173
167
|
* The callback function called when the current page changes.
|
|
174
168
|
*/
|
|
175
|
-
onChange:
|
|
169
|
+
onChange: PropTypes.func,
|
|
176
170
|
/**
|
|
177
171
|
* The function returning a translatable text showing where the current page is,
|
|
178
172
|
* in a manner of the total number of pages.
|
|
179
173
|
*/
|
|
180
|
-
pageRangeText:
|
|
174
|
+
pageRangeText: PropTypes.func,
|
|
181
175
|
/**
|
|
182
176
|
* The number dictating how many items a page contains.
|
|
183
177
|
*/
|
|
184
|
-
pageSize:
|
|
178
|
+
pageSize: PropTypes.number,
|
|
185
179
|
/**
|
|
186
180
|
* The choices for `pageSize`.
|
|
187
181
|
*/
|
|
188
|
-
pageSizes:
|
|
182
|
+
pageSizes: PropTypes.arrayOf(PropTypes.number),
|
|
189
183
|
/**
|
|
190
184
|
* The translatable text showing the current page.
|
|
191
185
|
*/
|
|
192
|
-
pageText:
|
|
186
|
+
pageText: PropTypes.func,
|
|
193
187
|
/**
|
|
194
188
|
* `true` if total number of pages is unknown.
|
|
195
189
|
*/
|
|
196
|
-
pagesUnknown:
|
|
190
|
+
pagesUnknown: PropTypes.bool,
|
|
197
191
|
/**
|
|
198
192
|
* The total number of items.
|
|
199
193
|
* You need to provide total items to calculate total page,
|
|
200
194
|
* which is required by a child like the `PageSelector`
|
|
201
195
|
* to know how many pages to display.
|
|
202
196
|
*/
|
|
203
|
-
totalItems:
|
|
197
|
+
totalItems: PropTypes.number
|
|
204
198
|
};
|
|
205
199
|
|
|
206
|
-
exports
|
|
200
|
+
exports.default = Pagination;
|