@carbon/react 1.112.0-rc.0 → 1.113.0-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 +925 -925
- package/es/components/AILabel/index.js +6 -6
- package/es/components/AISkeleton/AISkeletonIcon.js +2 -2
- package/es/components/AISkeleton/AISkeletonPlaceholder.js +2 -2
- package/es/components/AISkeleton/AISkeletonText.js +2 -2
- package/es/components/Accordion/Accordion.Skeleton.js +3 -3
- package/es/components/Accordion/Accordion.js +2 -2
- package/es/components/Accordion/AccordionItem.js +2 -2
- package/es/components/AspectRatio/AspectRatio.js +2 -2
- package/es/components/BadgeIndicator/index.js +4 -4
- package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +3 -3
- package/es/components/Breadcrumb/Breadcrumb.js +2 -2
- package/es/components/Breadcrumb/BreadcrumbItem.js +3 -3
- package/es/components/Button/Button.Skeleton.js +3 -3
- package/es/components/Button/Button.js +2 -2
- package/es/components/Button/ButtonBase.js +2 -2
- package/es/components/Button/index.js +3 -3
- package/es/components/ButtonSet/ButtonSet.js +3 -3
- package/es/components/ButtonSet/index.js +1 -1
- package/es/components/ChatButton/ChatButton.Skeleton.js +2 -2
- package/es/components/ChatButton/ChatButton.js +3 -3
- package/es/components/Checkbox/Checkbox.Skeleton.js +3 -3
- package/es/components/Checkbox/Checkbox.js +4 -4
- package/es/components/Checkbox/index.js +2 -2
- package/es/components/CheckboxGroup/CheckboxGroup.js +2 -2
- package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +3 -3
- package/es/components/CodeSnippet/CodeSnippet.js +2 -2
- package/es/components/ComboBox/ComboBox.js +12 -9
- package/es/components/ComboBox/index.js +1 -1
- package/es/components/ComboButton/index.js +5 -5
- package/es/components/ComposedModal/ComposedModal.js +7 -6
- package/es/components/ComposedModal/ComposedModalPresence.js +5 -2
- package/es/components/ComposedModal/ModalFooter.js +4 -4
- package/es/components/ComposedModal/ModalHeader.js +6 -6
- package/es/components/ContainedList/ContainedList.js +2 -2
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +2 -2
- package/es/components/ContainedList/ContainedListItem/index.js +1 -1
- package/es/components/ContentSwitcher/ContentSwitcher.js +2 -2
- package/es/components/Copy/Copy.js +4 -4
- package/es/components/Copy/index.js +1 -1
- package/es/components/CopyButton/CopyButton.js +3 -3
- package/es/components/CopyButton/index.js +1 -1
- package/es/components/DataTable/DataTable.js +4 -3
- package/es/components/DataTable/Table.js +3 -3
- package/es/components/DataTable/TableBatchActions.js +3 -3
- package/es/components/DataTable/TableCell.js +2 -2
- package/es/components/DataTable/TableContainer.js +3 -3
- package/es/components/DataTable/TableDecoratorRow.js +2 -2
- package/es/components/DataTable/TableExpandHeader.js +2 -2
- package/es/components/DataTable/TableExpandRow.js +2 -2
- package/es/components/DataTable/TableExpandedRow.js +2 -2
- package/es/components/DataTable/TableHeader.js +4 -4
- package/es/components/DataTable/TableRow.js +2 -2
- package/es/components/DataTable/TableSelectAll.js +2 -2
- package/es/components/DataTable/TableSelectRow.js +2 -2
- package/es/components/DataTable/TableSlugRow.js +2 -2
- package/es/components/DataTable/TableToolbar.js +3 -3
- package/es/components/DataTable/TableToolbarMenu.js +4 -4
- package/es/components/DataTable/TableToolbarSearch.js +3 -3
- package/es/components/DataTable/state/sorting.js +3 -2
- package/es/components/DataTable/tools/sorting.js +1 -1
- package/es/components/DataTableSkeleton/DataTableSkeleton.js +2 -2
- package/es/components/DatePicker/DatePicker.Skeleton.js +4 -4
- package/es/components/DatePicker/DatePicker.js +4 -5
- package/es/components/DatePicker/index.js +2 -2
- package/es/components/DatePicker/plugins/fixEventsPlugin.d.ts +2 -5
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +5 -12
- package/es/components/DatePickerInput/DatePickerInput.js +7 -7
- package/es/components/DatePickerInput/index.js +1 -1
- package/es/components/Dialog/Dialog.js +9 -9
- package/es/components/Dialog/index.js +1 -1
- package/es/components/Dropdown/Dropdown.Skeleton.js +4 -4
- package/es/components/Dropdown/Dropdown.js +5 -5
- package/es/components/Dropdown/index.js +2 -2
- package/es/components/ExpandableSearch/ExpandableSearch.js +2 -2
- package/es/components/ExpandableSearch/index.js +1 -1
- package/es/components/FeatureFlags/index.d.ts +3 -1
- package/es/components/FeatureFlags/index.js +5 -1
- package/es/components/FileUploader/FileUploader.Skeleton.js +4 -4
- package/es/components/FileUploader/FileUploader.js +11 -8
- package/es/components/FileUploader/FileUploaderButton.js +3 -3
- package/es/components/FileUploader/FileUploaderDropContainer.js +8 -6
- package/es/components/FileUploader/FileUploaderItem.js +3 -3
- package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +2 -2
- package/es/components/FluidComboBox/FluidComboBox.js +3 -3
- package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +3 -3
- package/es/components/FluidDatePicker/FluidDatePicker.js +3 -3
- package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +2 -2
- package/es/components/FluidDropdown/FluidDropdown.js +3 -3
- package/es/components/FluidForm/FluidForm.js +3 -3
- package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +2 -2
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +4 -4
- package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.js +2 -2
- package/es/components/FluidNumberInput/FluidNumberInput.js +3 -3
- package/es/components/FluidSearch/FluidSearch.Skeleton.js +2 -2
- package/es/components/FluidSearch/FluidSearch.js +3 -3
- package/es/components/FluidSelect/FluidSelect.Skeleton.js +2 -2
- package/es/components/FluidSelect/FluidSelect.js +3 -3
- package/es/components/FluidSelect/index.js +2 -2
- package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +2 -2
- package/es/components/FluidTextArea/FluidTextArea.js +3 -3
- package/es/components/FluidTextInput/FluidPasswordInput.js +3 -3
- package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +2 -2
- package/es/components/FluidTextInput/FluidTextInput.js +4 -4
- package/es/components/FluidTextInput/index.js +3 -3
- package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +2 -2
- package/es/components/FluidTimePicker/FluidTimePicker.js +3 -3
- package/es/components/FluidTimePickerSelect/index.js +1 -1
- package/es/components/Form/Form.js +2 -2
- package/es/components/FormGroup/FormGroup.js +2 -2
- package/es/components/FormItem/FormItem.js +2 -2
- package/es/components/FormLabel/FormLabel.js +2 -2
- package/es/components/Grid/CSSGrid.js +4 -4
- package/es/components/Grid/Column.js +3 -3
- package/es/components/Grid/ColumnHang.js +3 -3
- package/es/components/Grid/FlexGrid.js +3 -3
- package/es/components/Grid/Grid.js +3 -3
- package/es/components/Grid/Row.js +2 -2
- package/es/components/Icon/Icon.Skeleton.js +3 -3
- package/es/components/IconButton/index.js +4 -3
- package/es/components/IconIndicator/index.js +4 -4
- package/es/components/InlineCheckbox/index.js +1 -1
- package/es/components/InlineLoading/InlineLoading.js +2 -2
- package/es/components/InlineLoading/index.js +1 -1
- package/es/components/Layer/LayerLevel.js +1 -1
- package/es/components/Layer/index.js +2 -2
- package/es/components/Layout/index.js +3 -3
- package/es/components/LayoutDirection/LayoutDirection.js +1 -1
- package/es/components/Link/Link.js +2 -2
- package/es/components/Link/index.js +1 -1
- package/es/components/ListBox/ListBox.js +2 -2
- package/es/components/ListBox/ListBoxMenuIcon.js +2 -2
- package/es/components/ListBox/ListBoxMenuItem.js +4 -3
- package/es/components/ListBox/ListBoxSelection.js +3 -3
- package/es/components/ListBox/index.js +2 -2
- package/es/components/ListBox/next/ListBoxSelection.d.ts +12 -2
- package/es/components/ListBox/next/ListBoxSelection.js +10 -5
- package/es/components/ListBox/next/ListBoxTrigger.js +2 -2
- package/es/components/ListItem/ListItem.js +2 -2
- package/es/components/Loading/Loading.js +3 -3
- package/es/components/Loading/index.js +1 -1
- package/es/components/Menu/Menu.js +3 -3
- package/es/components/Menu/MenuItem.js +9 -9
- package/es/components/MenuButton/index.js +4 -4
- package/es/components/Modal/Modal.js +11 -11
- package/es/components/Modal/ModalPresence.js +5 -2
- package/es/components/Modal/index.js +2 -2
- package/es/components/ModalWrapper/ModalWrapper.js +2 -2
- package/es/components/MultiSelect/FilterableMultiSelect.js +23 -11
- package/es/components/MultiSelect/MultiSelect.js +7 -7
- package/es/components/Notification/Notification.js +10 -10
- package/es/components/NumberInput/NumberInput.Skeleton.js +2 -2
- package/es/components/NumberInput/NumberInput.js +21 -11
- package/es/components/OrderedList/OrderedList.js +2 -2
- package/es/components/OverflowMenu/OverflowMenu.js +7 -7
- package/es/components/OverflowMenu/index.js +2 -2
- package/es/components/OverflowMenu/next/index.js +4 -4
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +4 -4
- package/es/components/OverflowMenuItem/index.js +1 -1
- package/es/components/OverflowMenuV2/index.js +1 -1
- package/es/components/PageHeader/PageHeader.js +15 -15
- package/es/components/PageHeader/index.js +1 -1
- package/es/components/Pagination/Pagination.Skeleton.js +3 -3
- package/es/components/Pagination/Pagination.d.ts +18 -1
- package/es/components/Pagination/Pagination.js +33 -8
- package/es/components/Pagination/experimental/PageSelector.d.ts +4 -0
- package/es/components/Pagination/experimental/PageSelector.js +16 -3
- package/es/components/Pagination/experimental/Pagination-story.d.ts +100 -65
- package/es/components/Pagination/experimental/Pagination.d.ts +4 -0
- package/es/components/Pagination/experimental/Pagination.js +12 -5
- package/es/components/PaginationNav/PaginationNav.js +8 -6
- package/es/components/Popover/index.js +14 -6
- package/es/components/ProgressBar/ProgressBar.js +3 -3
- package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +3 -3
- package/es/components/ProgressIndicator/ProgressIndicator.js +4 -4
- package/es/components/RadioButton/RadioButton.Skeleton.js +3 -3
- package/es/components/RadioButton/RadioButton.js +3 -3
- package/es/components/RadioButton/index.js +1 -1
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +4 -4
- package/es/components/RadioTile/RadioTile.js +3 -3
- package/es/components/RadioTile/index.js +1 -1
- package/es/components/Search/Search.Skeleton.js +3 -3
- package/es/components/Search/Search.js +4 -4
- package/es/components/Search/index.js +2 -2
- package/es/components/Select/Select.Skeleton.js +3 -3
- package/es/components/Select/Select.js +6 -6
- package/es/components/Select/index.js +2 -2
- package/es/components/SelectItem/SelectItem.js +2 -2
- package/es/components/SelectItem/index.js +1 -1
- package/es/components/SelectItemGroup/SelectItemGroup.js +2 -2
- package/es/components/ShapeIndicator/index.js +4 -4
- package/es/components/SkeletonIcon/SkeletonIcon.js +2 -2
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +2 -2
- package/es/components/SkeletonText/SkeletonText.js +2 -2
- package/es/components/SkeletonText/index.js +1 -1
- package/es/components/Slider/Slider.Skeleton.js +7 -7
- package/es/components/Slider/Slider.js +22 -20
- package/es/components/Stack/Stack.js +2 -2
- package/es/components/StructuredList/StructuredList.Skeleton.js +3 -3
- package/es/components/StructuredList/StructuredList.js +7 -7
- package/es/components/Switch/IconSwitch.js +6 -5
- package/es/components/Switch/Switch.js +3 -3
- package/es/components/TabContent/TabContent.js +2 -2
- package/es/components/Tabs/Tabs.Skeleton.js +3 -3
- package/es/components/Tabs/Tabs.js +45 -33
- package/es/components/Tag/DismissibleTag.js +4 -3
- package/es/components/Tag/OperationalTag.js +4 -3
- package/es/components/Tag/SelectableTag.js +3 -3
- package/es/components/Tag/Tag.Skeleton.js +3 -3
- package/es/components/Tag/Tag.js +4 -3
- package/es/components/TextArea/TextArea.Skeleton.js +3 -3
- package/es/components/TextArea/TextArea.js +8 -8
- package/es/components/TextArea/index.js +2 -2
- package/es/components/TextInput/ControlledPasswordInput.js +6 -6
- package/es/components/TextInput/PasswordInput.js +10 -10
- package/es/components/TextInput/TextInput.Skeleton.js +3 -3
- package/es/components/TextInput/TextInput.js +9 -9
- package/es/components/TextInput/index.js +2 -2
- package/es/components/Theme/index.js +2 -2
- package/es/components/Tile/Tile.js +14 -11
- package/es/components/TileGroup/TileGroup.js +1 -1
- package/es/components/TimePicker/TimePicker.js +5 -5
- package/es/components/TimePickerSelect/TimePickerSelect.js +2 -2
- package/es/components/Toggle/Toggle.Skeleton.js +3 -3
- package/es/components/Toggle/Toggle.js +6 -6
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +2 -2
- package/es/components/Toggletip/index.js +6 -6
- package/es/components/Tooltip/DefinitionTooltip.js +2 -2
- package/es/components/Tooltip/Tooltip.d.ts +2 -1
- package/es/components/Tooltip/Tooltip.js +5 -4
- package/es/components/TreeView/TreeNode.js +11 -8
- package/es/components/TreeView/TreeView.js +2 -2
- package/es/components/UIShell/Content.js +2 -2
- package/es/components/UIShell/Header.js +2 -2
- package/es/components/UIShell/HeaderGlobalAction.js +2 -2
- package/es/components/UIShell/HeaderMenu.js +4 -4
- package/es/components/UIShell/HeaderMenuButton.js +2 -2
- package/es/components/UIShell/HeaderMenuItem.js +2 -2
- package/es/components/UIShell/HeaderName.js +2 -2
- package/es/components/UIShell/HeaderNavigation.js +2 -2
- package/es/components/UIShell/HeaderPanel.js +3 -3
- package/es/components/UIShell/HeaderSideNavItems.js +2 -2
- package/es/components/UIShell/SideNav.js +3 -3
- package/es/components/UIShell/SideNavDetails.js +2 -2
- package/es/components/UIShell/SideNavDivider.js +2 -2
- package/es/components/UIShell/SideNavFooter.js +2 -2
- package/es/components/UIShell/SideNavHeader.js +2 -2
- package/es/components/UIShell/SideNavIcon.js +2 -2
- package/es/components/UIShell/SideNavItem.js +2 -2
- package/es/components/UIShell/SideNavItems.js +2 -2
- package/es/components/UIShell/SideNavLink.js +2 -2
- package/es/components/UIShell/SideNavLinkText.js +2 -2
- package/es/components/UIShell/SideNavMenu.js +3 -3
- package/es/components/UIShell/SideNavMenuItem.js +3 -3
- package/es/components/UIShell/SideNavSwitcher.js +2 -2
- package/es/components/UIShell/SkipToContent.js +2 -2
- package/es/components/UIShell/Switcher.js +2 -2
- package/es/components/UIShell/SwitcherDivider.js +3 -3
- package/es/components/UIShell/SwitcherItem.js +4 -4
- package/es/components/UnorderedList/UnorderedList.js +2 -2
- package/es/feature-flags.js +1 -0
- package/es/index.js +30 -30
- package/es/internal/FloatingMenu.js +12 -9
- package/es/internal/motion/MotionSurface.d.ts +35 -0
- package/es/internal/motion/useMotionEnabled.d.ts +13 -0
- package/es/internal/motion/useMotionSurface.d.ts +33 -0
- package/es/internal/useId.js +1 -1
- package/es/internal/useOverflowItems.js +2 -1
- package/es/internal/usePresence.d.ts +8 -1
- package/es/internal/usePresence.js +4 -2
- package/es/internal/usePresenceContext.d.ts +12 -0
- package/es/internal/usePresenceContext.js +23 -5
- package/es/tools/wrapComponent.js +2 -2
- package/lib/components/AILabel/index.js +4 -4
- package/lib/components/AISkeleton/AISkeletonIcon.js +2 -2
- package/lib/components/AISkeleton/AISkeletonPlaceholder.js +2 -2
- package/lib/components/AISkeleton/AISkeletonText.js +2 -2
- package/lib/components/Accordion/Accordion.Skeleton.js +3 -2
- package/lib/components/Accordion/Accordion.js +2 -2
- package/lib/components/Accordion/AccordionItem.js +2 -2
- package/lib/components/AspectRatio/AspectRatio.js +2 -2
- package/lib/components/BadgeIndicator/index.js +3 -2
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +3 -2
- package/lib/components/Breadcrumb/Breadcrumb.js +2 -2
- package/lib/components/Breadcrumb/BreadcrumbItem.js +2 -2
- package/lib/components/Button/Button.Skeleton.js +3 -2
- package/lib/components/Button/Button.js +2 -2
- package/lib/components/Button/ButtonBase.js +2 -2
- package/lib/components/Button/index.js +7 -1
- package/lib/components/ButtonSet/ButtonSet.js +2 -2
- package/lib/components/ButtonSet/index.js +3 -1
- package/lib/components/ChatButton/ChatButton.Skeleton.js +2 -2
- package/lib/components/ChatButton/ChatButton.js +2 -2
- package/lib/components/Checkbox/Checkbox.Skeleton.js +3 -2
- package/lib/components/Checkbox/Checkbox.js +3 -3
- package/lib/components/Checkbox/index.js +3 -1
- package/lib/components/CheckboxGroup/CheckboxGroup.js +2 -2
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +3 -2
- package/lib/components/CodeSnippet/CodeSnippet.js +2 -2
- package/lib/components/ComboBox/ComboBox.js +8 -5
- package/lib/components/ComboBox/index.js +3 -1
- package/lib/components/ComboButton/index.js +2 -2
- package/lib/components/ComposedModal/ComposedModal.js +5 -4
- package/lib/components/ComposedModal/ComposedModalPresence.js +4 -1
- package/lib/components/ComposedModal/ModalFooter.js +3 -3
- package/lib/components/ComposedModal/ModalHeader.js +2 -2
- package/lib/components/ContainedList/ContainedList.js +2 -2
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +2 -2
- package/lib/components/ContainedList/ContainedListItem/index.js +3 -1
- package/lib/components/ContentSwitcher/ContentSwitcher.js +2 -2
- package/lib/components/Copy/Copy.js +3 -3
- package/lib/components/Copy/index.js +3 -1
- package/lib/components/CopyButton/CopyButton.js +3 -3
- package/lib/components/CopyButton/index.js +3 -1
- package/lib/components/DataTable/DataTable.js +4 -3
- package/lib/components/DataTable/Table.js +3 -2
- package/lib/components/DataTable/TableBatchActions.js +2 -2
- package/lib/components/DataTable/TableCell.js +2 -2
- package/lib/components/DataTable/TableContainer.js +2 -2
- package/lib/components/DataTable/TableDecoratorRow.js +2 -2
- package/lib/components/DataTable/TableExpandHeader.js +2 -2
- package/lib/components/DataTable/TableExpandRow.js +2 -2
- package/lib/components/DataTable/TableExpandedRow.js +2 -2
- package/lib/components/DataTable/TableHeader.js +2 -2
- package/lib/components/DataTable/TableRow.js +2 -2
- package/lib/components/DataTable/TableSelectAll.js +2 -2
- package/lib/components/DataTable/TableSelectRow.js +2 -2
- package/lib/components/DataTable/TableSlugRow.js +2 -2
- package/lib/components/DataTable/TableToolbar.js +3 -2
- package/lib/components/DataTable/TableToolbarMenu.js +3 -3
- package/lib/components/DataTable/TableToolbarSearch.js +3 -3
- package/lib/components/DataTable/state/sorting.js +3 -1
- package/lib/components/DataTable/tools/sorting.js +2 -0
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +2 -2
- package/lib/components/DatePicker/DatePicker.Skeleton.js +3 -2
- package/lib/components/DatePicker/DatePicker.js +3 -4
- package/lib/components/DatePicker/index.js +3 -1
- package/lib/components/DatePicker/plugins/fixEventsPlugin.d.ts +2 -5
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +5 -12
- package/lib/components/DatePickerInput/DatePickerInput.js +3 -3
- package/lib/components/DatePickerInput/index.js +3 -1
- package/lib/components/Dialog/Dialog.js +3 -3
- package/lib/components/Dialog/index.js +8 -0
- package/lib/components/Dropdown/Dropdown.Skeleton.js +3 -2
- package/lib/components/Dropdown/Dropdown.js +2 -2
- package/lib/components/Dropdown/index.js +3 -1
- package/lib/components/ExpandableSearch/ExpandableSearch.js +2 -2
- package/lib/components/ExpandableSearch/index.js +3 -1
- package/lib/components/FeatureFlags/index.d.ts +3 -1
- package/lib/components/FeatureFlags/index.js +5 -1
- package/lib/components/FileUploader/FileUploader.Skeleton.js +4 -3
- package/lib/components/FileUploader/FileUploader.js +9 -6
- package/lib/components/FileUploader/FileUploaderButton.js +3 -3
- package/lib/components/FileUploader/FileUploaderDropContainer.js +8 -6
- package/lib/components/FileUploader/FileUploaderItem.js +3 -3
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +2 -2
- package/lib/components/FluidComboBox/FluidComboBox.js +2 -2
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +2 -2
- package/lib/components/FluidDatePicker/FluidDatePicker.js +2 -2
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +2 -2
- package/lib/components/FluidDropdown/FluidDropdown.js +2 -2
- package/lib/components/FluidForm/FluidForm.js +2 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +2 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +2 -2
- package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +2 -2
- package/lib/components/FluidNumberInput/FluidNumberInput.js +2 -2
- package/lib/components/FluidSearch/FluidSearch.Skeleton.js +2 -2
- package/lib/components/FluidSearch/FluidSearch.js +2 -2
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +2 -2
- package/lib/components/FluidSelect/FluidSelect.js +2 -2
- package/lib/components/FluidSelect/index.js +3 -1
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +2 -2
- package/lib/components/FluidTextArea/FluidTextArea.js +2 -2
- package/lib/components/FluidTextInput/FluidPasswordInput.js +2 -2
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +2 -2
- package/lib/components/FluidTextInput/FluidTextInput.js +2 -2
- package/lib/components/FluidTextInput/index.js +5 -2
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +2 -2
- package/lib/components/FluidTimePicker/FluidTimePicker.js +2 -2
- package/lib/components/FluidTimePickerSelect/index.js +3 -1
- package/lib/components/Form/Form.js +2 -2
- package/lib/components/FormGroup/FormGroup.js +2 -2
- package/lib/components/FormItem/FormItem.js +2 -2
- package/lib/components/FormLabel/FormLabel.js +2 -2
- package/lib/components/Grid/CSSGrid.js +3 -3
- package/lib/components/Grid/Column.js +2 -2
- package/lib/components/Grid/ColumnHang.js +3 -3
- package/lib/components/Grid/FlexGrid.js +3 -3
- package/lib/components/Grid/Grid.js +3 -3
- package/lib/components/Grid/Row.js +2 -2
- package/lib/components/Icon/Icon.Skeleton.js +3 -2
- package/lib/components/IconButton/index.js +4 -3
- package/lib/components/IconIndicator/index.js +4 -2
- package/lib/components/InlineCheckbox/index.js +3 -1
- package/lib/components/InlineLoading/InlineLoading.js +2 -2
- package/lib/components/InlineLoading/index.js +3 -1
- package/lib/components/Layer/LayerLevel.js +1 -0
- package/lib/components/Layer/index.js +2 -2
- package/lib/components/Layout/index.js +2 -2
- package/lib/components/LayoutDirection/LayoutDirection.js +1 -0
- package/lib/components/Link/Link.js +2 -2
- package/lib/components/Link/index.js +3 -1
- package/lib/components/ListBox/ListBox.js +2 -2
- package/lib/components/ListBox/ListBoxMenuIcon.js +2 -2
- package/lib/components/ListBox/ListBoxMenuItem.js +4 -3
- package/lib/components/ListBox/ListBoxSelection.js +2 -2
- package/lib/components/ListBox/index.js +3 -1
- package/lib/components/ListBox/next/ListBoxSelection.d.ts +12 -2
- package/lib/components/ListBox/next/ListBoxSelection.js +9 -4
- package/lib/components/ListBox/next/ListBoxTrigger.js +2 -2
- package/lib/components/ListItem/ListItem.js +2 -2
- package/lib/components/Loading/Loading.js +2 -2
- package/lib/components/Loading/index.js +3 -1
- package/lib/components/Menu/Menu.js +2 -2
- package/lib/components/Menu/MenuItem.js +2 -2
- package/lib/components/MenuButton/index.js +2 -2
- package/lib/components/Modal/Modal.js +7 -6
- package/lib/components/Modal/ModalPresence.js +4 -1
- package/lib/components/Modal/index.js +6 -2
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.js +19 -7
- package/lib/components/MultiSelect/MultiSelect.js +3 -3
- package/lib/components/Notification/Notification.js +4 -4
- package/lib/components/NumberInput/NumberInput.Skeleton.js +2 -2
- package/lib/components/NumberInput/NumberInput.js +16 -5
- package/lib/components/OrderedList/OrderedList.js +2 -2
- package/lib/components/OverflowMenu/OverflowMenu.js +5 -3
- package/lib/components/OverflowMenu/index.js +3 -2
- package/lib/components/OverflowMenu/next/index.js +2 -2
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +3 -3
- package/lib/components/OverflowMenuItem/index.js +3 -1
- package/lib/components/OverflowMenuV2/index.js +1 -1
- package/lib/components/PageHeader/PageHeader.js +5 -5
- package/lib/components/PageHeader/index.js +14 -0
- package/lib/components/Pagination/Pagination.Skeleton.js +3 -2
- package/lib/components/Pagination/Pagination.d.ts +18 -1
- package/lib/components/Pagination/Pagination.js +31 -6
- package/lib/components/Pagination/experimental/PageSelector.d.ts +4 -0
- package/lib/components/Pagination/experimental/PageSelector.js +9 -2
- package/lib/components/Pagination/experimental/Pagination-story.d.ts +100 -65
- package/lib/components/Pagination/experimental/Pagination.d.ts +4 -0
- package/lib/components/Pagination/experimental/Pagination.js +9 -2
- package/lib/components/PaginationNav/PaginationNav.js +6 -4
- package/lib/components/Popover/index.js +10 -2
- package/lib/components/ProgressBar/ProgressBar.js +2 -2
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +3 -2
- package/lib/components/ProgressIndicator/ProgressIndicator.js +2 -2
- package/lib/components/RadioButton/RadioButton.Skeleton.js +3 -2
- package/lib/components/RadioButton/RadioButton.js +2 -2
- package/lib/components/RadioButton/index.js +3 -1
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +2 -2
- package/lib/components/RadioTile/RadioTile.js +3 -3
- package/lib/components/RadioTile/index.js +3 -1
- package/lib/components/Search/Search.Skeleton.js +3 -2
- package/lib/components/Search/Search.js +3 -3
- package/lib/components/Search/index.js +3 -1
- package/lib/components/Select/Select.Skeleton.js +3 -2
- package/lib/components/Select/Select.js +2 -2
- package/lib/components/Select/index.js +3 -1
- package/lib/components/SelectItem/SelectItem.js +2 -2
- package/lib/components/SelectItem/index.js +3 -1
- package/lib/components/SelectItemGroup/SelectItemGroup.js +2 -2
- package/lib/components/ShapeIndicator/index.js +4 -2
- package/lib/components/SkeletonIcon/SkeletonIcon.js +2 -2
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +2 -2
- package/lib/components/SkeletonText/SkeletonText.js +2 -2
- package/lib/components/SkeletonText/index.js +3 -1
- package/lib/components/Slider/Slider.Skeleton.js +2 -2
- package/lib/components/Slider/Slider.js +8 -6
- package/lib/components/Stack/Stack.js +2 -2
- package/lib/components/StructuredList/StructuredList.Skeleton.js +2 -2
- package/lib/components/StructuredList/StructuredList.js +2 -2
- package/lib/components/Switch/IconSwitch.js +5 -4
- package/lib/components/Switch/Switch.js +3 -3
- package/lib/components/TabContent/TabContent.js +2 -2
- package/lib/components/Tabs/Tabs.Skeleton.js +3 -2
- package/lib/components/Tabs/Tabs.js +35 -23
- package/lib/components/Tag/DismissibleTag.js +3 -2
- package/lib/components/Tag/OperationalTag.js +3 -2
- package/lib/components/Tag/SelectableTag.js +2 -2
- package/lib/components/Tag/Tag.Skeleton.js +3 -2
- package/lib/components/Tag/Tag.js +3 -2
- package/lib/components/TextArea/TextArea.Skeleton.js +3 -2
- package/lib/components/TextArea/TextArea.js +3 -3
- package/lib/components/TextArea/index.js +3 -1
- package/lib/components/TextInput/ControlledPasswordInput.js +3 -3
- package/lib/components/TextInput/PasswordInput.js +2 -2
- package/lib/components/TextInput/TextInput.Skeleton.js +3 -2
- package/lib/components/TextInput/TextInput.js +2 -2
- package/lib/components/TextInput/index.js +3 -1
- package/lib/components/Theme/index.js +2 -2
- package/lib/components/Tile/Tile.js +7 -4
- package/lib/components/TileGroup/TileGroup.js +1 -1
- package/lib/components/TimePicker/TimePicker.js +2 -2
- package/lib/components/TimePickerSelect/TimePickerSelect.js +2 -2
- package/lib/components/Toggle/Toggle.Skeleton.js +3 -2
- package/lib/components/Toggle/Toggle.js +3 -2
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +2 -2
- package/lib/components/Toggletip/index.js +4 -3
- package/lib/components/Tooltip/DefinitionTooltip.js +2 -2
- package/lib/components/Tooltip/Tooltip.d.ts +2 -1
- package/lib/components/Tooltip/Tooltip.js +5 -4
- package/lib/components/TreeView/TreeNode.js +8 -5
- package/lib/components/TreeView/TreeView.js +2 -2
- package/lib/components/UIShell/Content.js +2 -2
- package/lib/components/UIShell/Header.js +2 -2
- package/lib/components/UIShell/HeaderGlobalAction.js +2 -2
- package/lib/components/UIShell/HeaderMenu.js +3 -2
- package/lib/components/UIShell/HeaderMenuButton.js +2 -2
- package/lib/components/UIShell/HeaderMenuItem.js +2 -2
- package/lib/components/UIShell/HeaderName.js +2 -2
- package/lib/components/UIShell/HeaderNavigation.js +2 -2
- package/lib/components/UIShell/HeaderPanel.js +3 -3
- package/lib/components/UIShell/HeaderSideNavItems.js +2 -2
- package/lib/components/UIShell/SideNav.js +2 -2
- package/lib/components/UIShell/SideNavDetails.js +2 -2
- package/lib/components/UIShell/SideNavDivider.js +2 -2
- package/lib/components/UIShell/SideNavFooter.js +2 -2
- package/lib/components/UIShell/SideNavHeader.js +2 -2
- package/lib/components/UIShell/SideNavIcon.js +2 -2
- package/lib/components/UIShell/SideNavItem.js +2 -2
- package/lib/components/UIShell/SideNavItems.js +2 -2
- package/lib/components/UIShell/SideNavLink.js +2 -2
- package/lib/components/UIShell/SideNavLinkText.js +2 -2
- package/lib/components/UIShell/SideNavMenu.js +3 -2
- package/lib/components/UIShell/SideNavMenuItem.js +2 -2
- package/lib/components/UIShell/SideNavSwitcher.js +2 -2
- package/lib/components/UIShell/SkipToContent.js +2 -2
- package/lib/components/UIShell/Switcher.js +2 -2
- package/lib/components/UIShell/SwitcherDivider.js +2 -2
- package/lib/components/UIShell/SwitcherItem.js +2 -2
- package/lib/components/UnorderedList/UnorderedList.js +2 -2
- package/lib/feature-flags.js +1 -0
- package/lib/index.js +33 -32
- package/lib/internal/FloatingMenu.js +13 -8
- package/lib/internal/motion/MotionSurface.d.ts +35 -0
- package/lib/internal/motion/useMotionEnabled.d.ts +13 -0
- package/lib/internal/motion/useMotionSurface.d.ts +33 -0
- package/lib/internal/useId.js +1 -0
- package/lib/internal/useOverflowItems.js +2 -1
- package/lib/internal/usePresence.d.ts +8 -1
- package/lib/internal/usePresence.js +4 -2
- package/lib/internal/usePresenceContext.d.ts +12 -0
- package/lib/internal/usePresenceContext.js +22 -3
- package/lib/tools/wrapComponent.js +2 -2
- package/package.json +19 -13
- package/telemetry.yml +3 -1
|
@@ -5,22 +5,22 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import { noopFn } from "../../internal/noopFn.js";
|
|
9
|
+
import { warning } from "../../internal/warning.js";
|
|
8
10
|
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
11
|
import { Text } from "../Text/Text.js";
|
|
10
12
|
import { Escape, Tab } from "../../internal/keyboard/keys.js";
|
|
11
13
|
import { match, matches } from "../../internal/keyboard/match.js";
|
|
12
14
|
import useIsomorphicEffect from "../../internal/useIsomorphicEffect.js";
|
|
13
15
|
import { useId } from "../../internal/useId.js";
|
|
14
|
-
import { noopFn } from "../../internal/noopFn.js";
|
|
15
|
-
import { warning } from "../../internal/warning.js";
|
|
16
16
|
import { deprecate } from "../../prop-types/deprecate.js";
|
|
17
17
|
import { deprecateValuesWithin } from "../../prop-types/deprecateValuesWithin.js";
|
|
18
18
|
import { useFeatureFlag } from "../FeatureFlags/index.js";
|
|
19
19
|
import { useInteractiveChildrenNeedDescription, useNoInteractiveChildren } from "../../internal/useNoInteractiveChildren.js";
|
|
20
20
|
import Button_default from "../Button/index.js";
|
|
21
21
|
import { wrapFocus, wrapFocusWithoutSentinels } from "../../internal/wrapFocus.js";
|
|
22
|
-
import classNames from "classnames";
|
|
23
22
|
import { useEffect, useRef, useState } from "react";
|
|
23
|
+
import cx from "classnames";
|
|
24
24
|
import PropTypes from "prop-types";
|
|
25
25
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
26
26
|
import { CheckmarkFilled, Close, ErrorFilled, InformationFilled, InformationSquareFilled, WarningAltFilled, WarningFilled } from "@carbon/icons-react";
|
|
@@ -49,7 +49,7 @@ function useEscapeToClose(ref, callback, override = true) {
|
|
|
49
49
|
}
|
|
50
50
|
function NotificationActionButton({ children, className: customClassName, onClick, inline, ...rest }) {
|
|
51
51
|
return /* @__PURE__ */ jsx(Button_default, {
|
|
52
|
-
className:
|
|
52
|
+
className: cx(customClassName, { [`${usePrefix()}--actionable-notification__action-button`]: true }),
|
|
53
53
|
kind: inline ? "ghost" : "tertiary",
|
|
54
54
|
onClick,
|
|
55
55
|
size: "sm",
|
|
@@ -77,8 +77,8 @@ NotificationActionButton.propTypes = {
|
|
|
77
77
|
};
|
|
78
78
|
function NotificationButton({ "aria-label": ariaLabel = "close notification", ariaLabel: deprecatedAriaLabel, className, type = "button", renderIcon: IconTag = Close, name, notificationType = "toast", ...rest }) {
|
|
79
79
|
const prefix = usePrefix();
|
|
80
|
-
const buttonClassName =
|
|
81
|
-
const iconClassName =
|
|
80
|
+
const buttonClassName = cx(className, { [`${prefix}--${notificationType}-notification__close-button`]: notificationType });
|
|
81
|
+
const iconClassName = cx({ [`${prefix}--${notificationType}-notification__close-icon`]: notificationType });
|
|
82
82
|
return /* @__PURE__ */ jsx("button", {
|
|
83
83
|
...rest,
|
|
84
84
|
type,
|
|
@@ -164,7 +164,7 @@ NotificationIcon.propTypes = {
|
|
|
164
164
|
function ToastNotification({ ["aria-label"]: ariaLabel, ariaLabel: deprecatedAriaLabel, role = "status", onClose, onCloseButtonClick = noopFn, statusIconDescription, className, children, kind = "error", lowContrast, hideCloseButton = false, timeout = 0, title, caption, subtitle, ...rest }) {
|
|
165
165
|
const [isOpen, setIsOpen] = useState(true);
|
|
166
166
|
const prefix = usePrefix();
|
|
167
|
-
const containerClassName =
|
|
167
|
+
const containerClassName = cx(className, {
|
|
168
168
|
[`${prefix}--toast-notification`]: true,
|
|
169
169
|
[`${prefix}--toast-notification--low-contrast`]: lowContrast,
|
|
170
170
|
[`${prefix}--toast-notification--${kind}`]: kind
|
|
@@ -313,7 +313,7 @@ ToastNotification.propTypes = {
|
|
|
313
313
|
function InlineNotification({ ["aria-label"]: ariaLabel, children, title, subtitle, role = "status", onClose, onCloseButtonClick = noopFn, statusIconDescription, className, kind = "error", lowContrast, hideCloseButton = false, ...rest }) {
|
|
314
314
|
const [isOpen, setIsOpen] = useState(true);
|
|
315
315
|
const prefix = usePrefix();
|
|
316
|
-
const containerClassName =
|
|
316
|
+
const containerClassName = cx(className, {
|
|
317
317
|
[`${prefix}--inline-notification`]: true,
|
|
318
318
|
[`${prefix}--inline-notification--low-contrast`]: lowContrast,
|
|
319
319
|
[`${prefix}--inline-notification--${kind}`]: kind,
|
|
@@ -432,7 +432,7 @@ function ActionableNotification({ actionButtonLabel, ["aria-label"]: ariaLabel,
|
|
|
432
432
|
const prefix = usePrefix();
|
|
433
433
|
const id = useId("actionable-notification");
|
|
434
434
|
const subtitleId = useId("actionable-notification-subtitle");
|
|
435
|
-
const containerClassName =
|
|
435
|
+
const containerClassName = cx(className, {
|
|
436
436
|
[`${prefix}--actionable-notification`]: true,
|
|
437
437
|
[`${prefix}--actionable-notification--toast`]: !inline,
|
|
438
438
|
[`${prefix}--actionable-notification--low-contrast`]: lowContrast,
|
|
@@ -648,7 +648,7 @@ const propMappingFunction = (deprecatedValue) => {
|
|
|
648
648
|
};
|
|
649
649
|
function Callout({ actionButtonLabel, children, onActionButtonClick, title, titleId, subtitle, statusIconDescription, className, kind = "info", lowContrast, ...rest }) {
|
|
650
650
|
const prefix = usePrefix();
|
|
651
|
-
const containerClassName =
|
|
651
|
+
const containerClassName = cx(className, {
|
|
652
652
|
[`${prefix}--actionable-notification`]: true,
|
|
653
653
|
[`${prefix}--actionable-notification--low-contrast`]: lowContrast,
|
|
654
654
|
[`${prefix}--actionable-notification--${kind}`]: kind,
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
|
-
import classNames from "classnames";
|
|
10
9
|
import "react";
|
|
10
|
+
import cx from "classnames";
|
|
11
11
|
import PropTypes from "prop-types";
|
|
12
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
//#region src/components/NumberInput/NumberInput.Skeleton.tsx
|
|
@@ -20,7 +20,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
20
20
|
function NumberInputSkeleton({ hideLabel, className, size = "md", ...rest }) {
|
|
21
21
|
const prefix = usePrefix();
|
|
22
22
|
return /* @__PURE__ */ jsxs("div", {
|
|
23
|
-
className:
|
|
23
|
+
className: cx(`${prefix}--form-item`, className),
|
|
24
24
|
...rest,
|
|
25
25
|
children: [!hideLabel && /* @__PURE__ */ jsx("span", { className: `${prefix}--label ${prefix}--skeleton` }), /* @__PURE__ */ jsx("div", { className: `${prefix}--number ${prefix}--skeleton ${prefix}--number--${size}` })]
|
|
26
26
|
});
|
|
@@ -18,8 +18,8 @@ import { FormContext } from "../FluidForm/FormContext.js";
|
|
|
18
18
|
import { useControllableState } from "../../internal/useControllableState.js";
|
|
19
19
|
import { clamp } from "../../internal/clamp.js";
|
|
20
20
|
import { NumberFormatOptionsPropType } from "./NumberFormatPropTypes.js";
|
|
21
|
-
import classNames from "classnames";
|
|
22
21
|
import React, { cloneElement, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
22
|
+
import cx from "classnames";
|
|
23
23
|
import PropTypes from "prop-types";
|
|
24
24
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
25
25
|
import { Add, Subtract } from "@carbon/icons-react";
|
|
@@ -150,13 +150,22 @@ const validateNumberSeparators = (input, locale) => {
|
|
|
150
150
|
const sign = "[\\-\\u2212]?";
|
|
151
151
|
const scientific = `([eE][+-]?${digit}+)?`;
|
|
152
152
|
const usesGrouping = group && (groupSeparator?.trim() === "" ? /[\u00A0\u202F\s]/.test(input) : groupSeparator === "," || groupSeparator === "٬" ? /[,٬]/.test(input) : groupSeparator ? input.includes(groupSeparator) : false);
|
|
153
|
+
const isIndianLocale = locale === "en-IN" || locale.toLowerCase().endsWith("-in");
|
|
153
154
|
const scientificMatch = input?.match(/^([^eE]+)([eE][+-]?.*)?$/);
|
|
154
155
|
const baseNumber = scientificMatch ? scientificMatch[1] : input;
|
|
155
156
|
let integerPart;
|
|
156
157
|
if (decimalSeparator === "." || decimalSeparator === "٫") integerPart = baseNumber?.split(/[.,]/)[0];
|
|
157
158
|
else integerPart = baseNumber?.split(decimalSeparator)[0];
|
|
158
|
-
|
|
159
|
-
|
|
159
|
+
let integerRegex;
|
|
160
|
+
if (!usesGrouping) integerRegex = new RegExp(`^${sign}${digit}+$`);
|
|
161
|
+
else if (isIndianLocale) integerRegex = new RegExp(`^${sign}(${digit}{1,3}|${digit}{1,3}${group}${digit}{3}|${digit}{1,2}(${group}${digit}{2})+${group}${digit}{3})$`);
|
|
162
|
+
else integerRegex = new RegExp(`^${sign}(${digit}{1,3}|${digit}{1,3}(${group}${digit}{3})+)$`);
|
|
163
|
+
if (!integerRegex.test(integerPart)) return false;
|
|
164
|
+
let fullRegex;
|
|
165
|
+
if (!usesGrouping) fullRegex = new RegExp(`^${sign}${digit}+(${decimal}${digit}+)?${scientific}$`);
|
|
166
|
+
else if (isIndianLocale) fullRegex = new RegExp(`^${sign}(${digit}{1,3}|${digit}{1,3}${group}${digit}{3}|${digit}{1,2}(${group}${digit}{2})+${group}${digit}{3})(${decimal}${digit}+)?${scientific}$`);
|
|
167
|
+
else fullRegex = new RegExp(`^${sign}${digit}{1,3}(${group}${digit}{3})*(${decimal}${digit}+)?${scientific}$`);
|
|
168
|
+
return fullRegex.test(input);
|
|
160
169
|
};
|
|
161
170
|
const NumberInput = React.forwardRef((props, forwardRef) => {
|
|
162
171
|
const { allowEmpty = false, className: customClassName, decorator, disabled = false, disableWheel: disableWheelProp = false, formatOptions, helperText = "", hideLabel = false, hideSteppers, iconDescription, id, inputMode = "decimal", invalid = false, invalidText, label, light, locale = "en-US", max, min, onBlur, onStepperBlur, onChange, onClick, onKeyUp, pattern = "[0-9]*", readOnly, size = "md", slug, step = 1, translateWithId: t = defaultTranslateWithId, type = "number", defaultValue = type === "number" ? 0 : NaN, validate, warn = false, warnText = "", stepStartValue = 0, value: controlledValue, ...rest } = props;
|
|
@@ -214,7 +223,7 @@ const NumberInput = React.forwardRef((props, forwardRef) => {
|
|
|
214
223
|
]);
|
|
215
224
|
const inputRef = useRef(null);
|
|
216
225
|
const ref = useMergedRefs([forwardRef, inputRef]);
|
|
217
|
-
const numberInputClasses =
|
|
226
|
+
const numberInputClasses = cx({
|
|
218
227
|
[`${prefix}--number`]: true,
|
|
219
228
|
[`${prefix}--number--helpertext`]: true,
|
|
220
229
|
[`${prefix}--number--readonly`]: readOnly,
|
|
@@ -241,12 +250,12 @@ const NumberInput = React.forwardRef((props, forwardRef) => {
|
|
|
241
250
|
warnText
|
|
242
251
|
});
|
|
243
252
|
const [incrementNumLabel, decrementNumLabel] = [t("increment.number"), t("decrement.number")];
|
|
244
|
-
const wrapperClasses =
|
|
253
|
+
const wrapperClasses = cx(`${prefix}--number__input-wrapper`, {
|
|
245
254
|
[`${prefix}--number__input-wrapper--warning`]: normalizedProps.warn,
|
|
246
255
|
[`${prefix}--number__input-wrapper--slug`]: slug,
|
|
247
256
|
[`${prefix}--number__input-wrapper--decorator`]: decorator
|
|
248
257
|
});
|
|
249
|
-
const iconClasses =
|
|
258
|
+
const iconClasses = cx({
|
|
250
259
|
[`${prefix}--number__invalid`]: normalizedProps.invalid || normalizedProps.warn,
|
|
251
260
|
[`${prefix}--number__invalid--warning`]: normalizedProps.warn
|
|
252
261
|
});
|
|
@@ -283,7 +292,7 @@ const NumberInput = React.forwardRef((props, forwardRef) => {
|
|
|
283
292
|
if ("type" in evt.target && evt.target.type === "button") setIsFocused(false);
|
|
284
293
|
else setIsFocused(evt.type === "focus");
|
|
285
294
|
};
|
|
286
|
-
const outerElementClasses =
|
|
295
|
+
const outerElementClasses = cx(`${prefix}--form-item`, {
|
|
287
296
|
...customClassName ? { [customClassName]: true } : {},
|
|
288
297
|
[`${prefix}--number-input--fluid--invalid`]: isFluid && normalizedProps.invalid,
|
|
289
298
|
[`${prefix}--number-input--fluid--focus`]: isFluid && isFocused,
|
|
@@ -410,7 +419,8 @@ const NumberInput = React.forwardRef((props, forwardRef) => {
|
|
|
410
419
|
onBlur(e, value);
|
|
411
420
|
return;
|
|
412
421
|
}
|
|
413
|
-
|
|
422
|
+
const parsedTextValue = parsedValueForBlur ?? (isControlled ? numberParser.parse(inputValue) : numberValue);
|
|
423
|
+
onBlur(e, parsedTextValue);
|
|
414
424
|
}
|
|
415
425
|
},
|
|
416
426
|
pattern,
|
|
@@ -658,7 +668,7 @@ NumberInput.propTypes = {
|
|
|
658
668
|
};
|
|
659
669
|
const Label = ({ disabled, id, hideLabel, label }) => {
|
|
660
670
|
const prefix = usePrefix();
|
|
661
|
-
const className =
|
|
671
|
+
const className = cx({
|
|
662
672
|
[`${prefix}--label`]: true,
|
|
663
673
|
[`${prefix}--label--disabled`]: disabled,
|
|
664
674
|
[`${prefix}--visually-hidden`]: hideLabel
|
|
@@ -673,7 +683,7 @@ const Label = ({ disabled, id, hideLabel, label }) => {
|
|
|
673
683
|
};
|
|
674
684
|
const HelperText = ({ disabled, description, id }) => {
|
|
675
685
|
const prefix = usePrefix();
|
|
676
|
-
const className =
|
|
686
|
+
const className = cx(`${prefix}--form__helper-text`, { [`${prefix}--form__helper-text--disabled`]: disabled });
|
|
677
687
|
if (description) return /* @__PURE__ */ jsx(Text, {
|
|
678
688
|
as: "div",
|
|
679
689
|
id,
|
|
@@ -728,4 +738,4 @@ function disableWheel(e) {
|
|
|
728
738
|
e.preventDefault();
|
|
729
739
|
}
|
|
730
740
|
//#endregion
|
|
731
|
-
export { NumberInput, validateNumberSeparators };
|
|
741
|
+
export { NumberInput, parseNumberWithLocale, validateNumberSeparators };
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
|
-
import classNames from "classnames";
|
|
10
9
|
import "react";
|
|
10
|
+
import cx from "classnames";
|
|
11
11
|
import PropTypes from "prop-types";
|
|
12
12
|
import { jsx } from "react/jsx-runtime";
|
|
13
13
|
//#region src/components/OrderedList/OrderedList.tsx
|
|
@@ -20,7 +20,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
20
20
|
function OrderedList({ className, nested = false, native = false, isExpressive = false, ...other }) {
|
|
21
21
|
const prefix = usePrefix();
|
|
22
22
|
return /* @__PURE__ */ jsx("ol", {
|
|
23
|
-
className:
|
|
23
|
+
className: cx({
|
|
24
24
|
[`${prefix}--list--ordered`]: !native,
|
|
25
25
|
[`${prefix}--list--ordered--native`]: native,
|
|
26
26
|
[`${prefix}--list--nested`]: nested,
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import { noopFn } from "../../internal/noopFn.js";
|
|
8
9
|
import { PrefixContext } from "../../internal/usePrefix.js";
|
|
9
10
|
import { ArrowDown, ArrowLeft, ArrowRight as ArrowRight$1, ArrowUp as ArrowUp$1, Escape, Tab } from "../../internal/keyboard/keys.js";
|
|
10
11
|
import { matches } from "../../internal/keyboard/match.js";
|
|
11
12
|
import { setupGetInstanceId } from "../../tools/setupGetInstanceId.js";
|
|
12
|
-
import { noopFn } from "../../internal/noopFn.js";
|
|
13
13
|
import { deprecate } from "../../prop-types/deprecate.js";
|
|
14
14
|
import { deprecateValuesWithin } from "../../prop-types/deprecateValuesWithin.js";
|
|
15
15
|
import { mapPopoverAlign } from "../../tools/mapPopoverAlign.js";
|
|
@@ -17,8 +17,8 @@ import { IconButton } from "../IconButton/index.js";
|
|
|
17
17
|
import { mergeRefs } from "../../tools/mergeRefs.js";
|
|
18
18
|
import { DIRECTION_BOTTOM, FloatingMenu } from "../../internal/FloatingMenu.js";
|
|
19
19
|
import { useOutsideClick } from "../../internal/useOutsideClick.js";
|
|
20
|
-
import classNames from "classnames";
|
|
21
20
|
import React, { Children, cloneElement, forwardRef, isValidElement, useCallback, useContext, useEffect, useReducer, useRef, useState } from "react";
|
|
21
|
+
import cx from "classnames";
|
|
22
22
|
import PropTypes from "prop-types";
|
|
23
23
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
24
24
|
import { OverflowMenuVertical } from "@carbon/icons-react";
|
|
@@ -231,21 +231,21 @@ const OverflowMenu = forwardRef(({ align, ["aria-label"]: ariaLabel = null, aria
|
|
|
231
231
|
return document.body;
|
|
232
232
|
};
|
|
233
233
|
const menuBodyId = `overflow-menu-${instanceId.current}__menu-body`;
|
|
234
|
-
const overflowMenuClasses =
|
|
234
|
+
const overflowMenuClasses = cx(className, `${prefix}--overflow-menu`, {
|
|
235
235
|
[`${prefix}--overflow-menu--open`]: open,
|
|
236
236
|
[`${prefix}--overflow-menu--light`]: light,
|
|
237
237
|
[`${prefix}--overflow-menu--${size}`]: size,
|
|
238
238
|
[`${prefix}--layout--size-${size}`]: size
|
|
239
239
|
});
|
|
240
|
-
const overflowMenuOptionsClasses =
|
|
240
|
+
const overflowMenuOptionsClasses = cx(menuOptionsClass, `${prefix}--overflow-menu-options`, {
|
|
241
241
|
[`${prefix}--overflow-menu--flip`]: flipped,
|
|
242
242
|
[`${prefix}--overflow-menu-options--open`]: open,
|
|
243
243
|
[`${prefix}--overflow-menu-options--light`]: light,
|
|
244
244
|
[`${prefix}--overflow-menu-options--${size}`]: size,
|
|
245
245
|
[`${prefix}--layout--size-${size}`]: size
|
|
246
246
|
});
|
|
247
|
-
const overflowMenuIconClasses =
|
|
248
|
-
const overflowMenuWrapperClasses =
|
|
247
|
+
const overflowMenuIconClasses = cx(`${prefix}--overflow-menu__icon`, iconClass);
|
|
248
|
+
const overflowMenuWrapperClasses = cx(`${prefix}--overflow-menu__wrapper`);
|
|
249
249
|
const childrenWithProps = Children.toArray(children).map((child, index) => {
|
|
250
250
|
if (isValidElement(child)) {
|
|
251
251
|
const childElement = child;
|
|
@@ -454,4 +454,4 @@ OverflowMenu.propTypes = {
|
|
|
454
454
|
])
|
|
455
455
|
};
|
|
456
456
|
//#endregion
|
|
457
|
-
export { OverflowMenu as default };
|
|
457
|
+
export { OverflowMenu, OverflowMenu as default, getMenuOffset };
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import { useFeatureFlag } from "../FeatureFlags/index.js";
|
|
9
9
|
import { OverflowMenu as OverflowMenu$1 } from "./next/index.js";
|
|
10
|
-
import OverflowMenu$2 from "./OverflowMenu.js";
|
|
10
|
+
import { OverflowMenu as OverflowMenu$2 } from "./OverflowMenu.js";
|
|
11
11
|
import { forwardRef } from "react";
|
|
12
12
|
import { jsx } from "react/jsx-runtime";
|
|
13
13
|
//#region src/components/OverflowMenu/index.tsx
|
|
@@ -29,4 +29,4 @@ const OverflowMenu = forwardRef((props, ref) => {
|
|
|
29
29
|
OverflowMenu.displayName = "OverflowMenu";
|
|
30
30
|
OverflowMenu.propTypes = OverflowMenu$2.propTypes;
|
|
31
31
|
//#endregion
|
|
32
|
-
export { OverflowMenu as default };
|
|
32
|
+
export { OverflowMenu, OverflowMenu as default };
|
|
@@ -14,8 +14,8 @@ import { IconButton } from "../../IconButton/index.js";
|
|
|
14
14
|
import { mergeRefs } from "../../../tools/mergeRefs.js";
|
|
15
15
|
import { Menu as Menu$1 } from "../../Menu/Menu.js";
|
|
16
16
|
import { useAttachedMenu } from "../../../internal/useAttachedMenu.js";
|
|
17
|
-
import classNames from "classnames";
|
|
18
17
|
import React, { useEffect, useRef } from "react";
|
|
18
|
+
import cx from "classnames";
|
|
19
19
|
import PropTypes from "prop-types";
|
|
20
20
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
21
|
import { OverflowMenuVertical } from "@carbon/icons-react";
|
|
@@ -65,9 +65,9 @@ const OverflowMenu = React.forwardRef(({ autoAlign = false, children, className,
|
|
|
65
65
|
function handleTriggerClick() {
|
|
66
66
|
if (triggerRef.current) hookOnClick();
|
|
67
67
|
}
|
|
68
|
-
const containerClasses =
|
|
69
|
-
const menuClasses =
|
|
70
|
-
const triggerClasses =
|
|
68
|
+
const containerClasses = cx(className, `${prefix}--overflow-menu__container`, { [`${prefix}--autoalign`]: enableFloatingStyles });
|
|
69
|
+
const menuClasses = cx(`${prefix}--overflow-menu__${menuAlignment}`);
|
|
70
|
+
const triggerClasses = cx(`${prefix}--overflow-menu`, { [`${prefix}--overflow-menu--open`]: open }, size !== defaultSize && `${prefix}--overflow-menu--${size}`, size !== defaultSize && `${prefix}--layout--size-${size}`);
|
|
71
71
|
const floatingRef = mergeRefs(triggerRef, refs.setReference);
|
|
72
72
|
return /* @__PURE__ */ jsxs("div", {
|
|
73
73
|
...rest,
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import { warning } from "../../internal/warning.js";
|
|
8
9
|
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
10
|
import { Text } from "../Text/Text.js";
|
|
10
11
|
import { ArrowDown, ArrowUp } from "../../internal/keyboard/keys.js";
|
|
11
12
|
import { match } from "../../internal/keyboard/match.js";
|
|
12
13
|
import { useId } from "../../internal/useId.js";
|
|
13
|
-
import { warning } from "../../internal/warning.js";
|
|
14
|
-
import classNames from "classnames";
|
|
15
14
|
import { forwardRef } from "react";
|
|
15
|
+
import cx from "classnames";
|
|
16
16
|
import PropTypes from "prop-types";
|
|
17
17
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
18
18
|
//#region src/components/OverflowMenuItem/OverflowMenuItem.tsx
|
|
@@ -40,8 +40,8 @@ const OverflowMenuItem = forwardRef((props, ref) => {
|
|
|
40
40
|
if (closeMenu) closeMenu();
|
|
41
41
|
}
|
|
42
42
|
warning(!!closeMenu, "`<OverflowMenuItem>` detected missing `closeMenu` prop. `closeMenu` is required to let `<OverflowMenu>` close the menu upon actions on `<OverflowMenuItem>`. Please make sure `<OverflowMenuItem>` is a direct child of `<OverflowMenu>.");
|
|
43
|
-
const overflowMenuBtnClasses =
|
|
44
|
-
const overflowMenuItemClasses =
|
|
43
|
+
const overflowMenuBtnClasses = cx(`${prefix}--overflow-menu-options__btn`, className);
|
|
44
|
+
const overflowMenuItemClasses = cx(`${prefix}--overflow-menu-options__option`, {
|
|
45
45
|
[`${prefix}--overflow-menu--divider`]: hasDivider,
|
|
46
46
|
[`${prefix}--overflow-menu-options__option--danger`]: isDelete,
|
|
47
47
|
[`${prefix}--overflow-menu-options__option--disabled`]: disabled
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import { warning } from "../../internal/warning.js";
|
|
9
9
|
import { FeatureFlags } from "../FeatureFlags/index.js";
|
|
10
|
-
import OverflowMenu from "../OverflowMenu/index.js";
|
|
10
|
+
import { OverflowMenu } from "../OverflowMenu/index.js";
|
|
11
11
|
import "react";
|
|
12
12
|
import { jsx } from "react/jsx-runtime";
|
|
13
13
|
//#region src/components/OverflowMenuV2/index.js
|
|
@@ -14,15 +14,15 @@ import { Popover, PopoverContent } from "../Popover/index.js";
|
|
|
14
14
|
import { DefinitionTooltip } from "../Tooltip/DefinitionTooltip.js";
|
|
15
15
|
import { MenuItem } from "../Menu/MenuItem.js";
|
|
16
16
|
import { deprecateComponent } from "../../prop-types/deprecateComponent.js";
|
|
17
|
-
import { GridAsGridComponent } from "../Grid/Grid.js";
|
|
17
|
+
import { Grid as GridAsGridComponent } from "../Grid/Grid.js";
|
|
18
18
|
import Column from "../Grid/Column.js";
|
|
19
19
|
import { MenuButton } from "../MenuButton/index.js";
|
|
20
20
|
import { useMatchMedia } from "../../internal/useMatchMedia.js";
|
|
21
21
|
import Tag from "../Tag/Tag.js";
|
|
22
22
|
import OperationalTag from "../Tag/OperationalTag.js";
|
|
23
23
|
import useOverflowItems from "../../internal/useOverflowItems.js";
|
|
24
|
-
import classNames from "classnames";
|
|
25
24
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
25
|
+
import cx from "classnames";
|
|
26
26
|
import PropTypes from "prop-types";
|
|
27
27
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
28
28
|
import { createOverflowHandler } from "@carbon/utilities";
|
|
@@ -47,7 +47,7 @@ const usePageHeaderDeprecation = (componentName) => {
|
|
|
47
47
|
const PageHeader = React.forwardRef(({ className, children, ...other }, ref) => {
|
|
48
48
|
usePageHeaderDeprecation("PageHeader");
|
|
49
49
|
return /* @__PURE__ */ jsx("div", {
|
|
50
|
-
className:
|
|
50
|
+
className: cx({ [`${usePrefix()}--page-header`]: true }, className),
|
|
51
51
|
ref,
|
|
52
52
|
...other,
|
|
53
53
|
children
|
|
@@ -57,14 +57,14 @@ PageHeader.displayName = "PageHeader";
|
|
|
57
57
|
const PageHeaderBreadcrumbBar = React.forwardRef(({ border = true, className, children, renderIcon: IconElement, contentActions, contentActionsFlush, pageActions, pageActionsFlush, ...other }, ref) => {
|
|
58
58
|
usePageHeaderDeprecation("PageHeaderBreadcrumbBar");
|
|
59
59
|
const prefix = usePrefix();
|
|
60
|
-
const classNames
|
|
60
|
+
const classNames = cx({
|
|
61
61
|
[`${prefix}--page-header__breadcrumb-bar`]: true,
|
|
62
62
|
[`${prefix}--page-header__breadcrumb-bar-border`]: border,
|
|
63
63
|
[`${prefix}--page-header__breadcrumb__actions-flush`]: pageActionsFlush
|
|
64
64
|
}, className);
|
|
65
|
-
const contentActionsClasses =
|
|
65
|
+
const contentActionsClasses = cx({ [`${prefix}--page-header__breadcrumb__content-actions`]: !contentActionsFlush });
|
|
66
66
|
return /* @__PURE__ */ jsx("div", {
|
|
67
|
-
className: classNames
|
|
67
|
+
className: classNames,
|
|
68
68
|
ref,
|
|
69
69
|
...other,
|
|
70
70
|
children: /* @__PURE__ */ jsx(GridAsGridComponent, { children: /* @__PURE__ */ jsx(Column, {
|
|
@@ -94,7 +94,7 @@ PageHeaderBreadcrumbBar.displayName = "PageHeaderBreadcrumbBar";
|
|
|
94
94
|
const PageHeaderContent = React.forwardRef(({ className, children, title, renderIcon: IconElement, contextualActions, pageActions, ...other }, ref) => {
|
|
95
95
|
usePageHeaderDeprecation("PageHeaderContent");
|
|
96
96
|
const prefix = usePrefix();
|
|
97
|
-
const classNames
|
|
97
|
+
const classNames = cx({ [`${prefix}--page-header__content`]: true }, className);
|
|
98
98
|
const titleRef = useRef(null);
|
|
99
99
|
const [isEllipsisApplied, setIsEllipsisApplied] = useState(false);
|
|
100
100
|
const isEllipsisActive = (element) => {
|
|
@@ -105,7 +105,7 @@ const PageHeaderContent = React.forwardRef(({ className, children, title, render
|
|
|
105
105
|
if (titleRef.current) isEllipsisActive(titleRef.current);
|
|
106
106
|
}, [title]);
|
|
107
107
|
return /* @__PURE__ */ jsx("div", {
|
|
108
|
-
className: classNames
|
|
108
|
+
className: classNames,
|
|
109
109
|
ref,
|
|
110
110
|
...other,
|
|
111
111
|
children: /* @__PURE__ */ jsx(GridAsGridComponent, { children: /* @__PURE__ */ jsxs(Column, {
|
|
@@ -177,7 +177,7 @@ PageHeaderContent.propTypes = {
|
|
|
177
177
|
};
|
|
178
178
|
const PageHeaderContentPageActions = ({ className, children, menuButtonLabel = "Actions", actions, ...other }) => {
|
|
179
179
|
usePageHeaderDeprecation("PageHeaderContentPageActions");
|
|
180
|
-
const classNames
|
|
180
|
+
const classNames = cx({ [`${usePrefix()}--page-header__content__page-actions`]: true }, className);
|
|
181
181
|
const containerRef = useRef(null);
|
|
182
182
|
const offsetRef = useRef(null);
|
|
183
183
|
const [menuButtonVisibility, setMenuButtonVisibility] = useState(false);
|
|
@@ -200,7 +200,7 @@ const PageHeaderContentPageActions = ({ className, children, menuButtonLabel = "
|
|
|
200
200
|
});
|
|
201
201
|
}, []);
|
|
202
202
|
return /* @__PURE__ */ jsx("div", {
|
|
203
|
-
className: classNames
|
|
203
|
+
className: classNames,
|
|
204
204
|
ref: containerRef,
|
|
205
205
|
...other,
|
|
206
206
|
children: actions && /* @__PURE__ */ jsx(Fragment, { children: Array.isArray(actions) && /* @__PURE__ */ jsxs(Fragment, { children: [actions.map((action) => /* @__PURE__ */ jsx("div", { children: React.cloneElement(action.body, {
|
|
@@ -245,7 +245,7 @@ const PageHeaderContentText = ({ className, children, subtitle, ...other }) => {
|
|
|
245
245
|
usePageHeaderDeprecation("PageHeaderContentText");
|
|
246
246
|
const prefix = usePrefix();
|
|
247
247
|
return /* @__PURE__ */ jsxs("div", {
|
|
248
|
-
className:
|
|
248
|
+
className: cx({ [`${prefix}--page-header__content__body`]: true }, className),
|
|
249
249
|
...other,
|
|
250
250
|
children: [subtitle && /* @__PURE__ */ jsx(Text, {
|
|
251
251
|
as: "h3",
|
|
@@ -271,10 +271,10 @@ PageHeaderContentText.propTypes = {
|
|
|
271
271
|
};
|
|
272
272
|
const PageHeaderHeroImage = ({ className, children, ...other }) => {
|
|
273
273
|
usePageHeaderDeprecation("PageHeaderHeroImage");
|
|
274
|
-
const classNames
|
|
274
|
+
const classNames = cx({ [`${usePrefix()}--page-header__hero-image`]: true }, className);
|
|
275
275
|
const isLg = useMatchMedia(`(min-width: ${breakpoints.lg.width})`);
|
|
276
276
|
return /* @__PURE__ */ jsx(AspectRatio, {
|
|
277
|
-
className: classNames
|
|
277
|
+
className: classNames,
|
|
278
278
|
...other,
|
|
279
279
|
ratio: isLg ? "2x1" : "3x2",
|
|
280
280
|
children
|
|
@@ -294,7 +294,7 @@ PageHeaderHeroImage.propTypes = {
|
|
|
294
294
|
const PageHeaderTabBar = React.forwardRef(({ className, children, tags = [], ...other }, ref) => {
|
|
295
295
|
usePageHeaderDeprecation("PageHeaderTabBar");
|
|
296
296
|
const prefix = usePrefix();
|
|
297
|
-
const classNames
|
|
297
|
+
const classNames = cx({ [`${prefix}--page-header__tab-bar`]: true }, className);
|
|
298
298
|
const [openPopover, setOpenPopover] = useState(false);
|
|
299
299
|
const tagSize = tags[0]?.size || "md";
|
|
300
300
|
const instanceId = useId("PageHeaderTabBar");
|
|
@@ -355,7 +355,7 @@ const PageHeaderTabBar = React.forwardRef(({ className, children, tags = [], ...
|
|
|
355
355
|
})]
|
|
356
356
|
});
|
|
357
357
|
return /* @__PURE__ */ jsx("div", {
|
|
358
|
-
className: classNames
|
|
358
|
+
className: classNames,
|
|
359
359
|
ref,
|
|
360
360
|
...other,
|
|
361
361
|
children: /* @__PURE__ */ jsx(GridAsGridComponent, { children: /* @__PURE__ */ jsx(Column, {
|
|
@@ -25,4 +25,4 @@ var PageHeader_exports = /* @__PURE__ */ __exportAll({
|
|
|
25
25
|
TabBar: () => TabBar
|
|
26
26
|
});
|
|
27
27
|
//#endregion
|
|
28
|
-
export { PageHeader_exports };
|
|
28
|
+
export { BreadcrumbBar, Content, ContentPageActions, ContentText, HeroImage, PageHeader, PageHeaderBreadcrumbBar, PageHeaderContent, PageHeaderContentPageActions, PageHeaderContentText, PageHeaderHeroImage, PageHeaderTabBar, PageHeader_exports, Root, TabBar };
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
9
|
import SkeletonText_default from "../SkeletonText/index.js";
|
|
10
|
-
import classNames from "classnames";
|
|
11
10
|
import "react";
|
|
11
|
+
import cx from "classnames";
|
|
12
12
|
import PropTypes from "prop-types";
|
|
13
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
//#region src/components/Pagination/Pagination.Skeleton.tsx
|
|
@@ -21,7 +21,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
21
21
|
function PaginationSkeleton({ className, ...rest }) {
|
|
22
22
|
const prefix = usePrefix();
|
|
23
23
|
return /* @__PURE__ */ jsxs("div", {
|
|
24
|
-
className:
|
|
24
|
+
className: cx(`${prefix}--pagination`, `${prefix}--skeleton`, className),
|
|
25
25
|
...rest,
|
|
26
26
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
27
27
|
className: `${prefix}--pagination__left`,
|
|
@@ -42,4 +42,4 @@ PaginationSkeleton.propTypes = {
|
|
|
42
42
|
*/
|
|
43
43
|
className: PropTypes.string };
|
|
44
44
|
//#endregion
|
|
45
|
-
export { PaginationSkeleton as default };
|
|
45
|
+
export { PaginationSkeleton, PaginationSkeleton as default };
|
|
@@ -81,6 +81,22 @@ export interface PaginationProps extends Omit<React.HTMLAttributes<HTMLDivElemen
|
|
|
81
81
|
* A function returning the label for the page select.
|
|
82
82
|
*/
|
|
83
83
|
pageSelectLabelText?: (total: number) => string;
|
|
84
|
+
/**
|
|
85
|
+
* Provide a custom render function for the page-selection control.
|
|
86
|
+
* When provided, the default `<Select>` is replaced with the returned node.
|
|
87
|
+
*/
|
|
88
|
+
renderPageSelect?: (props: {
|
|
89
|
+
/** The currently active page. */
|
|
90
|
+
currentPage: number;
|
|
91
|
+
/** Total number of pages derived from `totalItems` and `pageSize`. */
|
|
92
|
+
totalPages: number;
|
|
93
|
+
/** Current page size. */
|
|
94
|
+
currentPageSize: number;
|
|
95
|
+
/** The computed accessible label for the page-selection control. */
|
|
96
|
+
pageSelectLabelText: string;
|
|
97
|
+
/** Sets the active page. */
|
|
98
|
+
onSetPage: (page: number | string) => void;
|
|
99
|
+
}) => React.ReactNode;
|
|
84
100
|
/**
|
|
85
101
|
* The number dictating how many items a page contains.
|
|
86
102
|
*/
|
|
@@ -98,7 +114,8 @@ export interface PaginationProps extends Omit<React.HTMLAttributes<HTMLDivElemen
|
|
|
98
114
|
*/
|
|
99
115
|
pageText?: (page: number, pagesUnknown?: boolean) => string;
|
|
100
116
|
/**
|
|
101
|
-
* `true`
|
|
117
|
+
* `true` when the total number of pages is unknown. Hides the page selection
|
|
118
|
+
* control.
|
|
102
119
|
*/
|
|
103
120
|
pagesUnknown?: boolean;
|
|
104
121
|
/**
|