@carbon/react 1.112.0 → 1.113.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 +959 -959
- 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 +3 -3
- package/es/components/DatePicker/index.js +2 -2
- 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 +58 -0
- package/es/components/FeatureFlags/index.js +4 -2
- 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.js +3 -3
- 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 +9 -9
- 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.d.ts +1 -2
- package/es/components/MultiSelect/FilterableMultiSelect.js +12 -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/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 +2 -2
- package/lib/components/DatePicker/index.js +3 -1
- 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 +58 -0
- package/lib/components/FeatureFlags/index.js +3 -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.js +2 -2
- 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 +5 -4
- 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.d.ts +1 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.js +8 -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/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 +14 -11
- package/telemetry.yml +1 -0
|
@@ -5,19 +5,19 @@
|
|
|
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 { usePrefix } from "../../internal/usePrefix.js";
|
|
9
10
|
import { Enter, Escape, Space } from "../../internal/keyboard/keys.js";
|
|
10
11
|
import { match } from "../../internal/keyboard/match.js";
|
|
11
12
|
import { useId } from "../../internal/useId.js";
|
|
12
|
-
import { noopFn } from "../../internal/noopFn.js";
|
|
13
13
|
import { deprecate } from "../../prop-types/deprecate.js";
|
|
14
14
|
import { useMergedRefs } from "../../internal/useMergedRefs.js";
|
|
15
15
|
import { Tooltip } from "../Tooltip/Tooltip.js";
|
|
16
16
|
import { composeEventHandlers } from "../../tools/events.js";
|
|
17
17
|
import { FormContext } from "../FluidForm/FormContext.js";
|
|
18
18
|
import { isSearchValuePresent } from "./utils.js";
|
|
19
|
-
import classNames from "classnames";
|
|
20
19
|
import React, { useContext, useEffect, useRef, useState } from "react";
|
|
20
|
+
import cx from "classnames";
|
|
21
21
|
import PropTypes from "prop-types";
|
|
22
22
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
23
23
|
import { Close, Search } from "@carbon/icons-react";
|
|
@@ -40,7 +40,7 @@ const Search$1 = React.forwardRef(({ autoComplete = "off", className, closeButto
|
|
|
40
40
|
const searchId = `${uniqueId}-search`;
|
|
41
41
|
const [hasContent, setHasContent] = useState(hasPropValue || false);
|
|
42
42
|
const isExpandableCollapsed = !!onExpand && !isExpanded;
|
|
43
|
-
const searchClasses =
|
|
43
|
+
const searchClasses = cx({
|
|
44
44
|
[`${prefix}--search`]: true,
|
|
45
45
|
[`${prefix}--search--${size}`]: size,
|
|
46
46
|
[`${prefix}--layout--size-${size}`]: size,
|
|
@@ -48,7 +48,7 @@ const Search$1 = React.forwardRef(({ autoComplete = "off", className, closeButto
|
|
|
48
48
|
[`${prefix}--search--disabled`]: disabled,
|
|
49
49
|
[`${prefix}--search--fluid`]: isFluid
|
|
50
50
|
}, className);
|
|
51
|
-
const clearClasses =
|
|
51
|
+
const clearClasses = cx({
|
|
52
52
|
[`${prefix}--search-close`]: true,
|
|
53
53
|
[`${prefix}--search-close--hidden`]: !hasContent || !isExpanded
|
|
54
54
|
});
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import Search from "./Search.js";
|
|
9
|
-
import "./Search.Skeleton.js";
|
|
9
|
+
import { SearchSkeleton } from "./Search.Skeleton.js";
|
|
10
10
|
//#region src/components/Search/index.tsx
|
|
11
11
|
/**
|
|
12
12
|
* Copyright IBM Corp. 2016, 2023
|
|
@@ -16,4 +16,4 @@ import "./Search.Skeleton.js";
|
|
|
16
16
|
*/
|
|
17
17
|
var Search_default = Search;
|
|
18
18
|
//#endregion
|
|
19
|
-
export { Search_default as default };
|
|
19
|
+
export { Search, SearchSkeleton, Search_default as default };
|
|
@@ -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/Select/Select.Skeleton.tsx
|
|
@@ -20,7 +20,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
20
20
|
const SelectSkeleton = ({ hideLabel, className, ...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", {
|
|
26
26
|
className: `${prefix}--select ${prefix}--skeleton`,
|
|
@@ -39,4 +39,4 @@ SelectSkeleton.propTypes = {
|
|
|
39
39
|
hideLabel: PropTypes.bool
|
|
40
40
|
};
|
|
41
41
|
//#endregion
|
|
42
|
-
export { SelectSkeleton as default };
|
|
42
|
+
export { SelectSkeleton, SelectSkeleton as default };
|
|
@@ -14,8 +14,8 @@ import { useNormalizedInputProps } from "../../internal/useNormalizedInputProps.
|
|
|
14
14
|
import { AILabel } from "../AILabel/index.js";
|
|
15
15
|
import { composeEventHandlers } from "../../tools/events.js";
|
|
16
16
|
import { FormContext } from "../FluidForm/FormContext.js";
|
|
17
|
-
import classNames from "classnames";
|
|
18
17
|
import React, { cloneElement, forwardRef, useContext, useState } from "react";
|
|
18
|
+
import cx from "classnames";
|
|
19
19
|
import PropTypes from "prop-types";
|
|
20
20
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
21
21
|
import { ChevronDown, WarningAltFilled, WarningFilled } from "@carbon/icons-react";
|
|
@@ -43,7 +43,7 @@ const Select = forwardRef(({ className, decorator, id, inline = false, labelText
|
|
|
43
43
|
warn,
|
|
44
44
|
warnText
|
|
45
45
|
});
|
|
46
|
-
const selectClasses =
|
|
46
|
+
const selectClasses = cx({
|
|
47
47
|
[`${prefix}--select`]: true,
|
|
48
48
|
[`${prefix}--select--inline`]: inline,
|
|
49
49
|
[`${prefix}--select--light`]: light,
|
|
@@ -58,13 +58,13 @@ const Select = forwardRef(({ className, decorator, id, inline = false, labelText
|
|
|
58
58
|
[`${prefix}--select--${size}`]: size,
|
|
59
59
|
[`${prefix}--layout--size-${size}`]: size
|
|
60
60
|
});
|
|
61
|
-
const labelClasses =
|
|
61
|
+
const labelClasses = cx(`${prefix}--label`, {
|
|
62
62
|
[`${prefix}--visually-hidden`]: hideLabel,
|
|
63
63
|
[`${prefix}--label--disabled`]: normalizedProps.disabled
|
|
64
64
|
});
|
|
65
|
-
const inputClasses =
|
|
65
|
+
const inputClasses = cx({ [`${prefix}--select-input`]: true });
|
|
66
66
|
const error = normalizedProps.validation;
|
|
67
|
-
const helperTextClasses =
|
|
67
|
+
const helperTextClasses = cx(`${prefix}--form__helper-text`, { [`${prefix}--form__helper-text--disabled`]: normalizedProps.disabled });
|
|
68
68
|
const helper = hasHelperText(helperText) ? /* @__PURE__ */ jsx(Text, {
|
|
69
69
|
as: "div",
|
|
70
70
|
id: normalizedProps.helperId,
|
|
@@ -120,7 +120,7 @@ const Select = forwardRef(({ className, decorator, id, inline = false, labelText
|
|
|
120
120
|
] });
|
|
121
121
|
})();
|
|
122
122
|
return /* @__PURE__ */ jsx("div", {
|
|
123
|
-
className:
|
|
123
|
+
className: cx(`${prefix}--form-item`, className),
|
|
124
124
|
children: /* @__PURE__ */ jsxs("div", {
|
|
125
125
|
className: selectClasses,
|
|
126
126
|
children: [
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import Select from "./Select.js";
|
|
9
|
-
import "./Select.Skeleton.js";
|
|
9
|
+
import { SelectSkeleton } from "./Select.Skeleton.js";
|
|
10
10
|
//#region src/components/Select/index.ts
|
|
11
11
|
/**
|
|
12
12
|
* Copyright IBM Corp. 2016, 2023
|
|
@@ -16,4 +16,4 @@ import "./Select.Skeleton.js";
|
|
|
16
16
|
*/
|
|
17
17
|
var Select_default = Select;
|
|
18
18
|
//#endregion
|
|
19
|
-
export { Select_default as default };
|
|
19
|
+
export { Select, SelectSkeleton, Select_default as default };
|
|
@@ -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/SelectItem/SelectItem.tsx
|
|
@@ -18,7 +18,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
18
18
|
* LICENSE file in the root directory of this source tree.
|
|
19
19
|
*/
|
|
20
20
|
const SelectItem = ({ className, value = "", disabled = false, hidden = false, text = "", ...other }) => {
|
|
21
|
-
const selectItemClasses =
|
|
21
|
+
const selectItemClasses = cx({
|
|
22
22
|
[`${usePrefix()}--select-option`]: true,
|
|
23
23
|
...className && { [className]: className }
|
|
24
24
|
});
|
|
@@ -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/SelectItemGroup/SelectItemGroup.tsx
|
|
@@ -19,7 +19,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
19
19
|
*/
|
|
20
20
|
const SelectItemGroup = ({ children, className, disabled = false, label, ...other }) => {
|
|
21
21
|
return /* @__PURE__ */ jsx("optgroup", {
|
|
22
|
-
className:
|
|
22
|
+
className: cx(`${usePrefix()}--select-optgroup`, className),
|
|
23
23
|
label,
|
|
24
24
|
disabled,
|
|
25
25
|
...other,
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
9
|
import { DefinitionTooltip } from "../Tooltip/DefinitionTooltip.js";
|
|
10
|
-
import classNames from "classnames";
|
|
11
10
|
import React from "react";
|
|
11
|
+
import cx from "classnames";
|
|
12
12
|
import PropTypes from "prop-types";
|
|
13
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { Caution, CircleFill, CircleStroke, Critical, CriticalSeverity, DiamondFill, LowSeverity } from "@carbon/icons-react";
|
|
@@ -64,7 +64,7 @@ const shapeTypes = {
|
|
|
64
64
|
};
|
|
65
65
|
const ShapeIndicator = React.forwardRef(({ align = "right", autoAlign = false, className: customClassName, compact = false, kind, label, shapeDescription, textSize = 12 }, ref) => {
|
|
66
66
|
const prefix = usePrefix();
|
|
67
|
-
const classNames
|
|
67
|
+
const classNames = cx(`${prefix}--shape-indicator`, customClassName, { [`${prefix}--shape-indicator--14`]: textSize == 14 });
|
|
68
68
|
const ShapeForKind = shapeTypes[kind];
|
|
69
69
|
if (!ShapeForKind) return null;
|
|
70
70
|
const shapeElement = /* @__PURE__ */ jsx(ShapeForKind, {
|
|
@@ -72,7 +72,7 @@ const ShapeIndicator = React.forwardRef(({ align = "right", autoAlign = false, c
|
|
|
72
72
|
className: `${prefix}--shape-indicator--${kind}`
|
|
73
73
|
});
|
|
74
74
|
return /* @__PURE__ */ jsx("div", {
|
|
75
|
-
className: classNames
|
|
75
|
+
className: classNames,
|
|
76
76
|
ref,
|
|
77
77
|
children: compact ? /* @__PURE__ */ jsxs(DefinitionTooltip, {
|
|
78
78
|
align,
|
|
@@ -136,4 +136,4 @@ ShapeIndicator.propTypes = {
|
|
|
136
136
|
textSize: PropTypes.oneOf([12, 14])
|
|
137
137
|
};
|
|
138
138
|
//#endregion
|
|
139
|
-
export { ShapeIndicator as default };
|
|
139
|
+
export { ShapeIndicator, ShapeIndicator as default, ShapeIndicatorKinds };
|
|
@@ -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/SkeletonIcon/SkeletonIcon.tsx
|
|
@@ -19,7 +19,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
19
19
|
*/
|
|
20
20
|
const SkeletonIcon = ({ className, ...other }) => {
|
|
21
21
|
return /* @__PURE__ */ jsx("div", {
|
|
22
|
-
className:
|
|
22
|
+
className: cx(className, { [`${usePrefix()}--icon--skeleton`]: true }),
|
|
23
23
|
...other
|
|
24
24
|
});
|
|
25
25
|
};
|
|
@@ -6,14 +6,14 @@
|
|
|
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/SkeletonPlaceholder/SkeletonPlaceholder.tsx
|
|
14
14
|
const SkeletonPlaceholder = ({ className, ...other }) => {
|
|
15
15
|
return /* @__PURE__ */ jsx("div", {
|
|
16
|
-
className:
|
|
16
|
+
className: cx({ [`${usePrefix()}--skeleton__placeholder`]: true }, className),
|
|
17
17
|
...other
|
|
18
18
|
});
|
|
19
19
|
};
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
9
|
import useIsomorphicEffect from "../../internal/useIsomorphicEffect.js";
|
|
10
|
-
import classNames from "classnames";
|
|
11
10
|
import { useRef } from "react";
|
|
11
|
+
import cx from "classnames";
|
|
12
12
|
import PropTypes from "prop-types";
|
|
13
13
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
14
14
|
//#region src/components/SkeletonText/SkeletonText.tsx
|
|
@@ -28,7 +28,7 @@ function getRandomInt(min, max, n) {
|
|
|
28
28
|
}
|
|
29
29
|
const SkeletonText = ({ paragraph = false, lineCount = 3, width = "100%", heading = false, className = "", ...rest }) => {
|
|
30
30
|
const prefix = usePrefix();
|
|
31
|
-
const skeletonTextClasses =
|
|
31
|
+
const skeletonTextClasses = cx({
|
|
32
32
|
[`${prefix}--skeleton__text`]: true,
|
|
33
33
|
[`${prefix}--skeleton__heading`]: heading,
|
|
34
34
|
[className]: className
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
9
|
import useIsomorphicEffect from "../../internal/useIsomorphicEffect.js";
|
|
10
10
|
import { LowerHandle, UpperHandle } from "./SliderHandles.js";
|
|
11
|
-
import classNames from "classnames";
|
|
12
11
|
import { useState } from "react";
|
|
12
|
+
import cx from "classnames";
|
|
13
13
|
import PropTypes from "prop-types";
|
|
14
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
15
|
//#region src/components/Slider/Slider.Skeleton.tsx
|
|
@@ -25,16 +25,16 @@ const SliderSkeleton = ({ ariaLabel = "slider handle", unstable_ariaLabelHandleU
|
|
|
25
25
|
useIsomorphicEffect(() => {
|
|
26
26
|
setIsRtl(document ? document.dir === "rtl" : false);
|
|
27
27
|
}, []);
|
|
28
|
-
const containerClasses =
|
|
28
|
+
const containerClasses = cx(`${prefix}--slider-container`, `${prefix}--skeleton`, {
|
|
29
29
|
[`${prefix}--slider-container--two-handles`]: twoHandles,
|
|
30
30
|
[`${prefix}--slider-container--rtl`]: isRtl
|
|
31
31
|
});
|
|
32
|
-
const lowerThumbClasses =
|
|
33
|
-
const upperThumbClasses =
|
|
34
|
-
const lowerThumbWrapperClasses =
|
|
35
|
-
const upperThumbWrapperClasses =
|
|
32
|
+
const lowerThumbClasses = cx(`${prefix}--slider__thumb`, { [`${prefix}--slider__thumb--lower`]: twoHandles });
|
|
33
|
+
const upperThumbClasses = cx(`${prefix}--slider__thumb`, { [`${prefix}--slider__thumb--upper`]: twoHandles });
|
|
34
|
+
const lowerThumbWrapperClasses = cx(`${prefix}--slider__thumb-wrapper`, { [`${prefix}--slider__thumb-wrapper--lower`]: twoHandles });
|
|
35
|
+
const upperThumbWrapperClasses = cx(`${prefix}--slider__thumb-wrapper`, { [`${prefix}--slider__thumb-wrapper--upper`]: twoHandles });
|
|
36
36
|
return /* @__PURE__ */ jsxs("div", {
|
|
37
|
-
className:
|
|
37
|
+
className: cx(`${prefix}--form-item`, className),
|
|
38
38
|
...rest,
|
|
39
39
|
children: [!hideLabel && /* @__PURE__ */ jsx("span", { className: `${prefix}--label ${prefix}--skeleton` }), /* @__PURE__ */ jsxs("div", {
|
|
40
40
|
className: containerClasses,
|
|
@@ -15,8 +15,8 @@ import { Tooltip } from "../Tooltip/Tooltip.js";
|
|
|
15
15
|
import { useNormalizedInputProps } from "../../internal/useNormalizedInputProps.js";
|
|
16
16
|
import { clamp } from "../../internal/clamp.js";
|
|
17
17
|
import { LowerHandle, LowerHandleFocus, UpperHandle, UpperHandleFocus } from "./SliderHandles.js";
|
|
18
|
-
import classNames from "classnames";
|
|
19
18
|
import { useEffect, useMemo, useReducer, useRef } from "react";
|
|
19
|
+
import cx from "classnames";
|
|
20
20
|
import PropTypes from "prop-types";
|
|
21
21
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
22
22
|
import { WarningAltFilled, WarningFilled } from "@carbon/icons-react";
|
|
@@ -63,8 +63,8 @@ const calcRawLeftPercent = ({ max, min, value }) => {
|
|
|
63
63
|
* A value of `16` limits updates to at most ~60 per second.
|
|
64
64
|
*/
|
|
65
65
|
const EVENT_THROTTLE = 16;
|
|
66
|
-
const DRAG_EVENT_TYPES = new Set(["mousemove", "touchmove"]);
|
|
67
|
-
const DRAG_STOP_EVENT_TYPES = new Set([
|
|
66
|
+
const DRAG_EVENT_TYPES = /* @__PURE__ */ new Set(["mousemove", "touchmove"]);
|
|
67
|
+
const DRAG_STOP_EVENT_TYPES = /* @__PURE__ */ new Set([
|
|
68
68
|
"mouseup",
|
|
69
69
|
"touchend",
|
|
70
70
|
"touchcancel"
|
|
@@ -294,8 +294,9 @@ const Slider = (props) => {
|
|
|
294
294
|
onDragRef.current = (evt, activeHandle) => {
|
|
295
295
|
activeHandle = activeHandle ?? stateRef.current.activeHandle;
|
|
296
296
|
if (disabled || readOnly) return;
|
|
297
|
+
const clientX = getClientXFromEvent(evt);
|
|
297
298
|
const { value, left } = calcValue({
|
|
298
|
-
clientX
|
|
299
|
+
clientX,
|
|
299
300
|
value: stateRef.current.value
|
|
300
301
|
});
|
|
301
302
|
if (twoHandles && activeHandle) setValueLeftForHandle(activeHandle, {
|
|
@@ -334,7 +335,8 @@ const Slider = (props) => {
|
|
|
334
335
|
else return;
|
|
335
336
|
if (evt.shiftKey) delta *= stepMultiplier;
|
|
336
337
|
if (twoHandles && state.activeHandle) {
|
|
337
|
-
const
|
|
338
|
+
const currentValue = state.activeHandle === "lower" ? state.value : state.valueUpper;
|
|
339
|
+
const { value, left } = calcValue({ value: calcValueForDelta(currentValue ?? min, delta, step) });
|
|
338
340
|
setValueLeftForHandle(state.activeHandle, {
|
|
339
341
|
value: nearestStepValue(value),
|
|
340
342
|
left
|
|
@@ -599,23 +601,23 @@ const Slider = (props) => {
|
|
|
599
601
|
const showWarning = normalizedProps.warn || correctedPosition === "lower" && isValid;
|
|
600
602
|
const showWarningUpper = normalizedUpperProps.warn || correctedPosition === (twoHandles ? "upper" : "lower") && (twoHandles ? isValidUpper : isValid);
|
|
601
603
|
const labelId = `${id}-label`;
|
|
602
|
-
const labelClasses =
|
|
604
|
+
const labelClasses = cx(`${prefix}--label`, {
|
|
603
605
|
[`${prefix}--visually-hidden`]: hideLabel,
|
|
604
606
|
[`${prefix}--label--disabled`]: disabled
|
|
605
607
|
});
|
|
606
|
-
const containerClasses =
|
|
608
|
+
const containerClasses = cx(`${prefix}--slider-container`, {
|
|
607
609
|
[`${prefix}--slider-container--two-handles`]: twoHandles,
|
|
608
610
|
[`${prefix}--slider-container--disabled`]: disabled,
|
|
609
611
|
[`${prefix}--slider-container--readonly`]: readOnly,
|
|
610
612
|
[`${prefix}--slider-container--rtl`]: isRtl
|
|
611
613
|
});
|
|
612
|
-
const sliderClasses =
|
|
614
|
+
const sliderClasses = cx(`${prefix}--slider`, {
|
|
613
615
|
[`${prefix}--slider--disabled`]: disabled,
|
|
614
616
|
[`${prefix}--slider--readonly`]: readOnly
|
|
615
617
|
});
|
|
616
618
|
const fixedInputClasses = [`${prefix}--text-input`, `${prefix}--slider-text-input`];
|
|
617
619
|
const conditionalInputClasses = { [`${prefix}--text-input--light`]: light };
|
|
618
|
-
const lowerInputClasses =
|
|
620
|
+
const lowerInputClasses = cx([
|
|
619
621
|
...fixedInputClasses,
|
|
620
622
|
`${prefix}--slider-text-input--lower`,
|
|
621
623
|
conditionalInputClasses,
|
|
@@ -624,7 +626,7 @@ const Slider = (props) => {
|
|
|
624
626
|
[`${prefix}--slider-text-input--warn`]: showWarning
|
|
625
627
|
}
|
|
626
628
|
]);
|
|
627
|
-
const upperInputClasses =
|
|
629
|
+
const upperInputClasses = cx([
|
|
628
630
|
...fixedInputClasses,
|
|
629
631
|
`${prefix}--slider-text-input--upper`,
|
|
630
632
|
conditionalInputClasses,
|
|
@@ -633,7 +635,7 @@ const Slider = (props) => {
|
|
|
633
635
|
[`${prefix}--slider-text-input--warn`]: showWarningUpper
|
|
634
636
|
}
|
|
635
637
|
]);
|
|
636
|
-
const lowerInputWrapperClasses =
|
|
638
|
+
const lowerInputWrapperClasses = cx([
|
|
637
639
|
`${prefix}--text-input-wrapper`,
|
|
638
640
|
`${prefix}--slider-text-input-wrapper`,
|
|
639
641
|
`${prefix}--slider-text-input-wrapper--lower`,
|
|
@@ -642,7 +644,7 @@ const Slider = (props) => {
|
|
|
642
644
|
[`${prefix}--slider-text-input-wrapper--hidden`]: hideTextInput
|
|
643
645
|
}
|
|
644
646
|
]);
|
|
645
|
-
const upperInputWrapperClasses =
|
|
647
|
+
const upperInputWrapperClasses = cx([
|
|
646
648
|
`${prefix}--text-input-wrapper`,
|
|
647
649
|
`${prefix}--slider-text-input-wrapper`,
|
|
648
650
|
`${prefix}--slider-text-input-wrapper--upper`,
|
|
@@ -651,14 +653,14 @@ const Slider = (props) => {
|
|
|
651
653
|
[`${prefix}--slider-text-input-wrapper--hidden`]: hideTextInput
|
|
652
654
|
}
|
|
653
655
|
]);
|
|
654
|
-
const lowerThumbClasses =
|
|
655
|
-
const upperThumbClasses =
|
|
656
|
-
const lowerThumbWrapperClasses =
|
|
656
|
+
const lowerThumbClasses = cx(`${prefix}--slider__thumb`, { [`${prefix}--slider__thumb--lower`]: twoHandles });
|
|
657
|
+
const upperThumbClasses = cx(`${prefix}--slider__thumb`, { [`${prefix}--slider__thumb--upper`]: twoHandles });
|
|
658
|
+
const lowerThumbWrapperClasses = cx([
|
|
657
659
|
`${prefix}--icon-tooltip`,
|
|
658
660
|
`${prefix}--slider__thumb-wrapper`,
|
|
659
661
|
{ [`${prefix}--slider__thumb-wrapper--lower`]: twoHandles }
|
|
660
662
|
]);
|
|
661
|
-
const upperThumbWrapperClasses =
|
|
663
|
+
const upperThumbWrapperClasses = cx([
|
|
662
664
|
`${prefix}--icon-tooltip`,
|
|
663
665
|
`${prefix}--slider__thumb-wrapper`,
|
|
664
666
|
{ [`${prefix}--slider__thumb-wrapper--upper`]: twoHandles }
|
|
@@ -666,7 +668,7 @@ const Slider = (props) => {
|
|
|
666
668
|
const lowerThumbWrapperProps = { style: { insetInlineStart: `${state.left}%` } };
|
|
667
669
|
const upperThumbWrapperProps = { style: { insetInlineStart: `${state.leftUpper}%` } };
|
|
668
670
|
return /* @__PURE__ */ jsxs("div", {
|
|
669
|
-
className:
|
|
671
|
+
className: cx(`${prefix}--form-item`, className),
|
|
670
672
|
children: [
|
|
671
673
|
/* @__PURE__ */ jsx(Text, {
|
|
672
674
|
as: "label",
|
|
@@ -808,18 +810,18 @@ const Slider = (props) => {
|
|
|
808
810
|
}),
|
|
809
811
|
(normalizedProps.invalid || normalizedUpperProps.invalid) && /* @__PURE__ */ jsx(Text, {
|
|
810
812
|
as: "div",
|
|
811
|
-
className:
|
|
813
|
+
className: cx(`${prefix}--slider__validation-msg`, `${prefix}--slider__validation-msg--invalid`, `${prefix}--form-requirement`),
|
|
812
814
|
children: invalidText
|
|
813
815
|
}),
|
|
814
816
|
(normalizedProps.warn || normalizedUpperProps.warn) && /* @__PURE__ */ jsx(Text, {
|
|
815
817
|
as: "div",
|
|
816
|
-
className:
|
|
818
|
+
className: cx(`${prefix}--slider__validation-msg`, `${prefix}--form-requirement`),
|
|
817
819
|
children: warnText
|
|
818
820
|
}),
|
|
819
821
|
correctedValue && /* @__PURE__ */ jsx(Text, {
|
|
820
822
|
as: "div",
|
|
821
823
|
role: "alert",
|
|
822
|
-
className:
|
|
824
|
+
className: cx(`${prefix}--slider__status-msg`, `${prefix}--form-requirement`),
|
|
823
825
|
children: t(translationIds["carbon.slider.auto-correct-announcement"], { correctedValue })
|
|
824
826
|
})
|
|
825
827
|
]
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
|
-
import classNames from "classnames";
|
|
10
9
|
import { forwardRef } from "react";
|
|
10
|
+
import cx from "classnames";
|
|
11
11
|
import PropTypes from "prop-types";
|
|
12
12
|
import { jsx } from "react/jsx-runtime";
|
|
13
13
|
import { spacing } from "@carbon/layout";
|
|
@@ -42,7 +42,7 @@ const SPACING_STEPS = Array.from({ length: spacing.length - 1 }, (_, step) => st
|
|
|
42
42
|
const Stack = forwardRef((props, ref) => {
|
|
43
43
|
const { as: BaseComponent = "div", children, className: customClassName, gap, orientation = "vertical", ...rest } = props;
|
|
44
44
|
const prefix = usePrefix();
|
|
45
|
-
const className =
|
|
45
|
+
const className = cx(customClassName, {
|
|
46
46
|
[`${prefix}--stack-${orientation}`]: true,
|
|
47
47
|
[`${prefix}--stack-scale-${gap}`]: typeof gap === "number"
|
|
48
48
|
});
|
|
@@ -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/StructuredList/StructuredList.Skeleton.tsx
|
|
@@ -19,7 +19,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
19
19
|
*/
|
|
20
20
|
function StructuredListSkeleton({ rowCount = 5, className, ...rest }) {
|
|
21
21
|
const prefix = usePrefix();
|
|
22
|
-
const classNames
|
|
22
|
+
const classNames = cx(`${prefix}--skeleton`, `${prefix}--structured-list`, className);
|
|
23
23
|
const rows = new Array(rowCount).fill(null).map((_, i) => /* @__PURE__ */ jsxs("div", {
|
|
24
24
|
className: `${prefix}--structured-list-row`,
|
|
25
25
|
children: [
|
|
@@ -29,7 +29,7 @@ function StructuredListSkeleton({ rowCount = 5, className, ...rest }) {
|
|
|
29
29
|
]
|
|
30
30
|
}, i));
|
|
31
31
|
return /* @__PURE__ */ jsxs("div", {
|
|
32
|
-
className: classNames
|
|
32
|
+
className: classNames,
|
|
33
33
|
...rest,
|
|
34
34
|
children: [/* @__PURE__ */ jsx("div", {
|
|
35
35
|
className: `${prefix}--structured-list-thead`,
|
|
@@ -10,8 +10,8 @@ import { Text } from "../Text/Text.js";
|
|
|
10
10
|
import { useId } from "../../internal/useId.js";
|
|
11
11
|
import { deprecate } from "../../prop-types/deprecate.js";
|
|
12
12
|
import { useOutsideClick } from "../../internal/useOutsideClick.js";
|
|
13
|
-
import classNames from "classnames";
|
|
14
13
|
import React, { useRef, useState } from "react";
|
|
14
|
+
import cx from "classnames";
|
|
15
15
|
import PropTypes from "prop-types";
|
|
16
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
17
|
import { RadioButton, RadioButtonChecked } from "@carbon/icons-react";
|
|
@@ -27,7 +27,7 @@ const GridSelectedRowDispatchContext = React.createContext(null);
|
|
|
27
27
|
function StructuredListWrapper(props) {
|
|
28
28
|
const { children, selection, className, ["aria-label"]: ariaLabel = "Structured list section", ariaLabel: deprecatedAriaLabel, isCondensed, isFlush, selectedInitialRow, ...other } = props;
|
|
29
29
|
const prefix = usePrefix();
|
|
30
|
-
const classes =
|
|
30
|
+
const classes = cx(`${prefix}--structured-list`, {
|
|
31
31
|
[`${prefix}--structured-list--selection`]: selection,
|
|
32
32
|
[`${prefix}--structured-list--condensed`]: isCondensed,
|
|
33
33
|
[`${prefix}--structured-list--flush`]: isFlush && !selection
|
|
@@ -86,7 +86,7 @@ function StructuredListHead(props) {
|
|
|
86
86
|
const { children, className, ...other } = props;
|
|
87
87
|
return /* @__PURE__ */ jsx("div", {
|
|
88
88
|
role: "rowgroup",
|
|
89
|
-
className:
|
|
89
|
+
className: cx(`${usePrefix()}--structured-list-thead`, className),
|
|
90
90
|
...other,
|
|
91
91
|
children
|
|
92
92
|
});
|
|
@@ -104,7 +104,7 @@ StructuredListHead.propTypes = {
|
|
|
104
104
|
function StructuredListBody(props) {
|
|
105
105
|
const { children, className, ...other } = props;
|
|
106
106
|
return /* @__PURE__ */ jsx("div", {
|
|
107
|
-
className:
|
|
107
|
+
className: cx(`${usePrefix()}--structured-list-tbody`, className),
|
|
108
108
|
role: "rowgroup",
|
|
109
109
|
...other,
|
|
110
110
|
children
|
|
@@ -135,7 +135,7 @@ function StructuredListRow(props) {
|
|
|
135
135
|
const setSelectedRow = React.useContext(GridSelectedRowDispatchContext);
|
|
136
136
|
const prefix = usePrefix();
|
|
137
137
|
const value = { id: rowId };
|
|
138
|
-
const classes =
|
|
138
|
+
const classes = cx(`${prefix}--structured-list-row`, {
|
|
139
139
|
[`${prefix}--structured-list-row--header-row`]: head,
|
|
140
140
|
[`${prefix}--structured-list-row--focused-within`]: hasFocusWithin && !selection || hasFocusWithin && selection && (selectedRow === rowId || selectedRow === null),
|
|
141
141
|
[`${prefix}--structured-list-row--selected`]: selectedRow === rowId
|
|
@@ -211,7 +211,7 @@ function StructuredListInput(props) {
|
|
|
211
211
|
const defaultId = useId("structureListInput");
|
|
212
212
|
const { className, name = `structured-list-input-${defaultId}`, title, id, onChange, ...other } = props;
|
|
213
213
|
const prefix = usePrefix();
|
|
214
|
-
const classes =
|
|
214
|
+
const classes = cx(`${prefix}--structured-list-input`, `${prefix}--visually-hidden`, className);
|
|
215
215
|
const row = React.useContext(GridRowContext);
|
|
216
216
|
const selectedRow = React.useContext(GridSelectedRowStateContext);
|
|
217
217
|
const setSelectedRow = React.useContext(GridSelectedRowDispatchContext);
|
|
@@ -264,7 +264,7 @@ StructuredListInput.propTypes = {
|
|
|
264
264
|
function StructuredListCell(props) {
|
|
265
265
|
const { children, className, head, noWrap, ...other } = props;
|
|
266
266
|
const prefix = usePrefix();
|
|
267
|
-
const classes =
|
|
267
|
+
const classes = cx({
|
|
268
268
|
[`${prefix}--structured-list-th`]: head,
|
|
269
269
|
[`${prefix}--structured-list-td`]: !head,
|
|
270
270
|
[`${prefix}--structured-list-content--nowrap`]: noWrap
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
8
|
import { noopFn } from "../../internal/noopFn.js";
|
|
9
|
+
import { usePrefix } from "../../internal/usePrefix.js";
|
|
10
10
|
import { IconButton } from "../IconButton/index.js";
|
|
11
|
-
import classNames from "classnames";
|
|
12
11
|
import { forwardRef, useState } from "react";
|
|
12
|
+
import cx from "classnames";
|
|
13
13
|
import PropTypes from "prop-types";
|
|
14
14
|
import { jsx } from "react/jsx-runtime";
|
|
15
15
|
//#region src/components/Switch/IconSwitch.tsx
|
|
@@ -32,11 +32,12 @@ const IconSwitch = forwardRef((props, ref) => {
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
const handleKeyDown = (event) => {
|
|
35
|
+
const key = event.key || event.which;
|
|
35
36
|
onKeyDown({
|
|
36
37
|
index,
|
|
37
38
|
name,
|
|
38
39
|
text,
|
|
39
|
-
key
|
|
40
|
+
key
|
|
40
41
|
});
|
|
41
42
|
};
|
|
42
43
|
const handleMouseEnter = () => {
|
|
@@ -45,8 +46,8 @@ const IconSwitch = forwardRef((props, ref) => {
|
|
|
45
46
|
const handleMouseLeave = () => {
|
|
46
47
|
setIsHovered(false);
|
|
47
48
|
};
|
|
48
|
-
const classes =
|
|
49
|
-
const iconButtonClasses =
|
|
49
|
+
const classes = cx(className, `${prefix}--content-switcher-btn`, { [`${prefix}--content-switcher--selected`]: selected });
|
|
50
|
+
const iconButtonClasses = cx(`${prefix}--content-switcher-popover__wrapper`, {
|
|
50
51
|
[`${prefix}--content-switcher-popover--selected`]: selected,
|
|
51
52
|
[`${prefix}--content-switcher-popover--disabled`]: disabled
|
|
52
53
|
});
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
8
|
import { noopFn } from "../../internal/noopFn.js";
|
|
10
|
-
import
|
|
9
|
+
import { usePrefix } from "../../internal/usePrefix.js";
|
|
11
10
|
import React from "react";
|
|
11
|
+
import cx from "classnames";
|
|
12
12
|
import PropTypes from "prop-types";
|
|
13
13
|
import { jsx } from "react/jsx-runtime";
|
|
14
14
|
//#region src/components/Switch/Switch.tsx
|
|
@@ -41,7 +41,7 @@ const Switch = React.forwardRef((props, tabRef) => {
|
|
|
41
41
|
const commonProps = {
|
|
42
42
|
onClick: handleClick,
|
|
43
43
|
onKeyDown: handleKeyDown,
|
|
44
|
-
className:
|
|
44
|
+
className: cx(className, `${prefix}--content-switcher-btn`, { [`${prefix}--content-switcher--selected`]: selected }),
|
|
45
45
|
disabled
|
|
46
46
|
};
|
|
47
47
|
return /* @__PURE__ */ jsx("button", {
|