@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
|
@@ -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/TabContent/TabContent.tsx
|
|
@@ -19,7 +19,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
19
19
|
*/
|
|
20
20
|
function TabContent(props) {
|
|
21
21
|
const { className, selected, children, ...other } = props;
|
|
22
|
-
const tabContentClasses =
|
|
22
|
+
const tabContentClasses = cx(`${usePrefix()}--tab-content`, className);
|
|
23
23
|
return /* @__PURE__ */ jsx("div", {
|
|
24
24
|
role: "tabpanel",
|
|
25
25
|
...other,
|
|
@@ -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/Tabs/Tabs.Skeleton.tsx
|
|
@@ -30,7 +30,7 @@ function Tab() {
|
|
|
30
30
|
function TabsSkeleton({ className, contained, ...rest }) {
|
|
31
31
|
const prefix = usePrefix();
|
|
32
32
|
return /* @__PURE__ */ jsx("div", {
|
|
33
|
-
className:
|
|
33
|
+
className: cx(className, `${prefix}--tabs`, `${prefix}--skeleton`, { [`${prefix}--tabs--contained`]: contained }),
|
|
34
34
|
...rest,
|
|
35
35
|
children: /* @__PURE__ */ jsxs("ul", {
|
|
36
36
|
className: `${prefix}--tabs__nav`,
|
|
@@ -55,4 +55,4 @@ TabsSkeleton.propTypes = {
|
|
|
55
55
|
contained: PropTypes.bool
|
|
56
56
|
};
|
|
57
57
|
//#endregion
|
|
58
|
-
export { TabsSkeleton as default };
|
|
58
|
+
export { TabsSkeleton, TabsSkeleton as default };
|
|
@@ -16,13 +16,13 @@ import { isComponentElement } from "../../internal/utils.js";
|
|
|
16
16
|
import { useMergedRefs } from "../../internal/useMergedRefs.js";
|
|
17
17
|
import { useEvent } from "../../internal/useEvent.js";
|
|
18
18
|
import { Tooltip } from "../Tooltip/Tooltip.js";
|
|
19
|
-
import BadgeIndicator from "../BadgeIndicator/index.js";
|
|
19
|
+
import { BadgeIndicator } from "../BadgeIndicator/index.js";
|
|
20
20
|
import { useControllableState } from "../../internal/useControllableState.js";
|
|
21
|
-
import { GridAsGridComponent } from "../Grid/Grid.js";
|
|
21
|
+
import { Grid as GridAsGridComponent } from "../Grid/Grid.js";
|
|
22
22
|
import { useMatchMedia } from "../../internal/useMatchMedia.js";
|
|
23
23
|
import { usePressable } from "./usePressable.js";
|
|
24
|
-
import classNames from "classnames";
|
|
25
24
|
import React, { Children, cloneElement, createContext, forwardRef, isValidElement, 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 { ChevronLeft, ChevronRight, Close } from "@carbon/icons-react";
|
|
@@ -189,6 +189,7 @@ function getNextIndexVertical(event, total, index) {
|
|
|
189
189
|
function TabList({ activation = "automatic", "aria-label": label, children, className: customClassName, contained = false, fullWidth = false, iconSize, leftOverflowButtonProps, light, rightOverflowButtonProps, scrollDebounceWait = 200, scrollIntoView, size, ...rest }) {
|
|
190
190
|
const { activeIndex, selectedIndex, setSelectedIndex, setActiveIndex, dismissable } = React.useContext(TabsContext);
|
|
191
191
|
const prefix = usePrefix();
|
|
192
|
+
const containerRef = useRef(null);
|
|
192
193
|
const ref = useRef(null);
|
|
193
194
|
const previousButton = useRef(null);
|
|
194
195
|
const nextButton = useRef(null);
|
|
@@ -197,7 +198,7 @@ function TabList({ activation = "automatic", "aria-label": label, children, clas
|
|
|
197
198
|
const hasSecondaryLabelTabs = contained && Children.toArray(children).some((child) => isComponentElement(child, Tab) && typeof child.props.secondaryLabel !== "undefined");
|
|
198
199
|
const isLg = useMatchMedia(lgMediaQuery);
|
|
199
200
|
const distributeWidth = fullWidth && contained && isLg && React.Children.toArray(children).length < 9;
|
|
200
|
-
const className =
|
|
201
|
+
const className = cx(`${prefix}--tabs`, {
|
|
201
202
|
[`${prefix}--tabs--contained`]: contained,
|
|
202
203
|
[`${prefix}--tabs--light`]: light,
|
|
203
204
|
[`${prefix}--tabs__icon--default`]: iconSize === "default",
|
|
@@ -209,15 +210,28 @@ function TabList({ activation = "automatic", "aria-label": label, children, clas
|
|
|
209
210
|
[`${prefix}--tabs--dismissable`]: dismissable
|
|
210
211
|
}, customClassName);
|
|
211
212
|
const [isNextButtonVisible, setIsNextButtonVisible] = useState(ref.current ? scrollLeft + ref.current.clientWidth < ref.current.scrollWidth : false);
|
|
213
|
+
const updateOverflowState = useCallback(() => {
|
|
214
|
+
if (!containerRef.current || !ref.current) return;
|
|
215
|
+
const hasOverflow = ref.current.scrollWidth > containerRef.current.clientWidth + 1;
|
|
216
|
+
setIsNextButtonVisible(hasOverflow && ref.current.scrollLeft + ref.current.clientWidth + 1 < ref.current.scrollWidth);
|
|
217
|
+
setIsScrollable(hasOverflow);
|
|
218
|
+
}, []);
|
|
212
219
|
const isPreviousButtonVisible = ref.current ? isScrollable && scrollLeft > 0 : false;
|
|
213
|
-
const previousButtonClasses =
|
|
214
|
-
const nextButtonClasses =
|
|
220
|
+
const previousButtonClasses = cx(`${prefix}--tab--overflow-nav-button`, `${prefix}--tab--overflow-nav-button--previous`, { [`${prefix}--tab--overflow-nav-button--hidden`]: !isPreviousButtonVisible });
|
|
221
|
+
const nextButtonClasses = cx(`${prefix}--tab--overflow-nav-button`, `${prefix}--tab--overflow-nav-button--next`, { [`${prefix}--tab--overflow-nav-button--hidden`]: !isNextButtonVisible });
|
|
215
222
|
const tabs = useRef([]);
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
223
|
+
const debouncedUpdateScroll = useMemo(() => debounce(() => {
|
|
224
|
+
if (ref.current) setScrollLeft(ref.current.scrollLeft);
|
|
225
|
+
}, scrollDebounceWait), [scrollDebounceWait]);
|
|
226
|
+
useEffect(() => {
|
|
227
|
+
return () => {
|
|
228
|
+
debouncedUpdateScroll.cancel();
|
|
229
|
+
};
|
|
230
|
+
}, [debouncedUpdateScroll]);
|
|
231
|
+
const handleScroll = useCallback(() => {
|
|
232
|
+
updateOverflowState();
|
|
233
|
+
debouncedUpdateScroll();
|
|
234
|
+
}, [debouncedUpdateScroll, updateOverflowState]);
|
|
221
235
|
function onKeyDown(event) {
|
|
222
236
|
if (matches(event, [
|
|
223
237
|
ArrowRight$1,
|
|
@@ -263,12 +277,11 @@ function TabList({ activation = "automatic", "aria-label": label, children, clas
|
|
|
263
277
|
});
|
|
264
278
|
}, []);
|
|
265
279
|
useEffect(() => {
|
|
266
|
-
|
|
267
|
-
if (dismissable && ref.current) setIsScrollable(ref.current.scrollWidth > ref.current.clientWidth + 1);
|
|
280
|
+
updateOverflowState();
|
|
268
281
|
}, [
|
|
269
282
|
children,
|
|
270
|
-
|
|
271
|
-
|
|
283
|
+
scrollLeft,
|
|
284
|
+
updateOverflowState
|
|
272
285
|
]);
|
|
273
286
|
useEffect(() => {
|
|
274
287
|
if (tabs.current[selectedIndex]?.disabled) {
|
|
@@ -282,17 +295,15 @@ function TabList({ activation = "automatic", "aria-label": label, children, clas
|
|
|
282
295
|
}
|
|
283
296
|
}, []);
|
|
284
297
|
useIsomorphicEffect(() => {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
window.addEventListener("resize", debouncedHandler);
|
|
298
|
+
const element = containerRef.current;
|
|
299
|
+
if (!element) return;
|
|
300
|
+
updateOverflowState();
|
|
301
|
+
const resizeObserver = new ResizeObserver(updateOverflowState);
|
|
302
|
+
resizeObserver.observe(element);
|
|
291
303
|
return () => {
|
|
292
|
-
|
|
293
|
-
window.removeEventListener("resize", debouncedHandler);
|
|
304
|
+
resizeObserver.disconnect();
|
|
294
305
|
};
|
|
295
|
-
}, []);
|
|
306
|
+
}, [updateOverflowState]);
|
|
296
307
|
useIsomorphicEffect(() => {
|
|
297
308
|
if (scrollLeft !== null && ref.current) ref.current.scrollLeft = scrollLeft;
|
|
298
309
|
}, [scrollLeft]);
|
|
@@ -324,6 +335,7 @@ function TabList({ activation = "automatic", "aria-label": label, children, clas
|
|
|
324
335
|
}
|
|
325
336
|
});
|
|
326
337
|
return /* @__PURE__ */ jsxs("div", {
|
|
338
|
+
ref: containerRef,
|
|
327
339
|
className,
|
|
328
340
|
children: [
|
|
329
341
|
/* @__PURE__ */ jsx("button", {
|
|
@@ -342,7 +354,7 @@ function TabList({ activation = "automatic", "aria-label": label, children, clas
|
|
|
342
354
|
ref,
|
|
343
355
|
role: "tablist",
|
|
344
356
|
className: `${prefix}--tab--list`,
|
|
345
|
-
onScroll:
|
|
357
|
+
onScroll: handleScroll,
|
|
346
358
|
onKeyDown,
|
|
347
359
|
onBlur: handleBlur,
|
|
348
360
|
children: Children.map(children, (child, index) => {
|
|
@@ -446,7 +458,7 @@ function TabListVertical({ activation = "automatic", "aria-label": label, childr
|
|
|
446
458
|
const [isOverflowingBottom, setIsOverflowingBottom] = useState(false);
|
|
447
459
|
const [isOverflowingTop, setIsOverflowingTop] = useState(false);
|
|
448
460
|
const isSm = useMatchMedia(smMediaQuery);
|
|
449
|
-
const className =
|
|
461
|
+
const className = cx(`${prefix}--tabs`, `${prefix}--tabs--vertical`, `${prefix}--tabs--contained`, { [`${prefix}--layout--size-${size}`]: size }, customClassName);
|
|
450
462
|
const tabs = useRef([]);
|
|
451
463
|
function onKeyDown(event) {
|
|
452
464
|
if (matches(event, [
|
|
@@ -623,7 +635,7 @@ const Tab = forwardRef(({ as = "button", children, className: customClassName, d
|
|
|
623
635
|
setIsEllipsisApplied(element.offsetHeight < element.scrollHeight);
|
|
624
636
|
return element.offsetHeight < element.scrollHeight;
|
|
625
637
|
};
|
|
626
|
-
const className =
|
|
638
|
+
const className = cx(`${prefix}--tabs__nav-item`, `${prefix}--tabs__nav-link`, {
|
|
627
639
|
[`${prefix}--tabs__nav-item--selected`]: selectedIndex === index,
|
|
628
640
|
[`${prefix}--tabs__nav-item--disabled`]: disabled,
|
|
629
641
|
[`${prefix}--tabs__nav-item--hover-off`]: ignoreHover
|
|
@@ -679,7 +691,7 @@ const Tab = forwardRef(({ as = "button", children, className: customClassName, d
|
|
|
679
691
|
onKeyDown?.(event);
|
|
680
692
|
};
|
|
681
693
|
const DismissIcon = /* @__PURE__ */ jsx("div", {
|
|
682
|
-
className:
|
|
694
|
+
className: cx({
|
|
683
695
|
[`${prefix}--tabs__nav-item--close`]: dismissable,
|
|
684
696
|
[`${prefix}--tabs__nav-item--close--hidden`]: !dismissable
|
|
685
697
|
}),
|
|
@@ -689,7 +701,7 @@ const Tab = forwardRef(({ as = "button", children, className: customClassName, d
|
|
|
689
701
|
"aria-disabled": disabled,
|
|
690
702
|
"aria-hidden": selectedIndex === index && dismissable ? "false" : "true",
|
|
691
703
|
disabled,
|
|
692
|
-
className:
|
|
704
|
+
className: cx({
|
|
693
705
|
[`${prefix}--tabs__nav-item--close-icon`]: dismissable,
|
|
694
706
|
[`${prefix}--visually-hidden`]: !dismissable,
|
|
695
707
|
[`${prefix}--tabs__nav-item--close-icon--selected`]: selectedIndex === index,
|
|
@@ -776,7 +788,7 @@ const Tab = forwardRef(({ as = "button", children, className: customClassName, d
|
|
|
776
788
|
children
|
|
777
789
|
}),
|
|
778
790
|
!dismissable && Icon && /* @__PURE__ */ jsx("div", {
|
|
779
|
-
className:
|
|
791
|
+
className: cx(`${prefix}--tabs__nav-item--icon`, { [`${prefix}--visually-hidden`]: !hasIcon }),
|
|
780
792
|
children: !dismissable && Icon && /* @__PURE__ */ jsx(Icon, { size: 16 })
|
|
781
793
|
})
|
|
782
794
|
]
|
|
@@ -840,7 +852,7 @@ const IconTab = React.forwardRef(({ badgeIndicator, children, className: customC
|
|
|
840
852
|
const prefix = usePrefix();
|
|
841
853
|
const value = useMemo(() => ({ badgeIndicator }), [badgeIndicator]);
|
|
842
854
|
const hasSize20 = isValidElement(children) && (children.props.size === 20 || children.props.size === "20");
|
|
843
|
-
const classNames
|
|
855
|
+
const classNames = cx(`${prefix}--tabs__nav-item--icon-only`, customClassName, { [`${prefix}--tabs__nav-item--icon-only__20`]: hasSize20 });
|
|
844
856
|
return /* @__PURE__ */ jsx(IconTabContext.Provider, {
|
|
845
857
|
value,
|
|
846
858
|
children: /* @__PURE__ */ jsx(Tooltip, {
|
|
@@ -851,7 +863,7 @@ const IconTab = React.forwardRef(({ badgeIndicator, children, className: customC
|
|
|
851
863
|
label,
|
|
852
864
|
leaveDelayMs,
|
|
853
865
|
children: /* @__PURE__ */ jsx(Tab, {
|
|
854
|
-
className: classNames
|
|
866
|
+
className: classNames,
|
|
855
867
|
ref,
|
|
856
868
|
...rest,
|
|
857
869
|
children
|
|
@@ -899,7 +911,7 @@ const TabPanel = React.forwardRef(({ children, className: customClassName, ...re
|
|
|
899
911
|
const index = React.useContext(TabPanelContext);
|
|
900
912
|
const id = `${baseId}-tabpanel-${index}`;
|
|
901
913
|
const tabId = `${baseId}-tab-${index}`;
|
|
902
|
-
const className =
|
|
914
|
+
const className = cx(`${prefix}--tab-content`, customClassName);
|
|
903
915
|
return /* @__PURE__ */ jsx("div", {
|
|
904
916
|
...rest,
|
|
905
917
|
"aria-labelledby": tabId,
|
|
@@ -16,8 +16,8 @@ import { AILabel } from "../AILabel/index.js";
|
|
|
16
16
|
import { mergeRefs } from "../../tools/mergeRefs.js";
|
|
17
17
|
import { isEllipsisActive } from "./isEllipsisActive.js";
|
|
18
18
|
import Tag, { SIZES, TYPES } from "./Tag.js";
|
|
19
|
-
import classNames from "classnames";
|
|
20
19
|
import { cloneElement, forwardRef, 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 } from "@carbon/icons-react";
|
|
@@ -33,7 +33,7 @@ const DismissibleTag = forwardRef(({ className, decorator, disabled, id, renderI
|
|
|
33
33
|
const tagLabelRef = useRef(null);
|
|
34
34
|
const generatedTagId = useId();
|
|
35
35
|
const tagId = id ?? `tag-${generatedTagId}`;
|
|
36
|
-
const tagClasses =
|
|
36
|
+
const tagClasses = cx(`${prefix}--tag--filter`, className);
|
|
37
37
|
const [isEllipsisApplied, setIsEllipsisApplied] = useState(false);
|
|
38
38
|
useIsomorphicEffect(() => {
|
|
39
39
|
const newElement = tagLabelRef.current?.getElementsByClassName(`${prefix}--tag__label`)[0];
|
|
@@ -51,7 +51,7 @@ const DismissibleTag = forwardRef(({ className, decorator, disabled, id, renderI
|
|
|
51
51
|
size: "sm",
|
|
52
52
|
kind: "inline"
|
|
53
53
|
}) : candidate;
|
|
54
|
-
const tooltipClasses =
|
|
54
|
+
const tooltipClasses = cx(`${prefix}--icon-tooltip`, `${prefix}--tag-label-tooltip`);
|
|
55
55
|
const { onClick, ...otherProps } = other;
|
|
56
56
|
const dismissActionLabel = isEllipsisApplied ? dismissTooltipLabel : title;
|
|
57
57
|
return /* @__PURE__ */ jsx(Tag, {
|
|
@@ -166,5 +166,6 @@ DismissibleTag.propTypes = {
|
|
|
166
166
|
*/
|
|
167
167
|
type: PropTypes.oneOf(Object.keys(TYPES))
|
|
168
168
|
};
|
|
169
|
+
Object.keys(TYPES);
|
|
169
170
|
//#endregion
|
|
170
171
|
export { DismissibleTag as default };
|
|
@@ -13,8 +13,8 @@ import { Tooltip } from "../Tooltip/Tooltip.js";
|
|
|
13
13
|
import { mergeRefs } from "../../tools/mergeRefs.js";
|
|
14
14
|
import { isEllipsisActive } from "./isEllipsisActive.js";
|
|
15
15
|
import Tag, { SIZES } from "./Tag.js";
|
|
16
|
-
import classNames from "classnames";
|
|
17
16
|
import { forwardRef, useRef, useState } from "react";
|
|
17
|
+
import cx from "classnames";
|
|
18
18
|
import PropTypes from "prop-types";
|
|
19
19
|
import { jsx } from "react/jsx-runtime";
|
|
20
20
|
//#region src/components/Tag/OperationalTag.tsx
|
|
@@ -41,13 +41,13 @@ const OperationalTag = forwardRef(({ className, disabled, id, renderIcon, size,
|
|
|
41
41
|
const tagRef = useRef(null);
|
|
42
42
|
const generatedTagId = useId();
|
|
43
43
|
const tagId = id ?? `tag-${generatedTagId}`;
|
|
44
|
-
const tagClasses =
|
|
44
|
+
const tagClasses = cx(`${prefix}--tag--operational`, className);
|
|
45
45
|
const [isEllipsisApplied, setIsEllipsisApplied] = useState(false);
|
|
46
46
|
useIsomorphicEffect(() => {
|
|
47
47
|
const newElement = tagRef.current?.getElementsByClassName(`${prefix}--tag__label`)[0];
|
|
48
48
|
setIsEllipsisApplied(isEllipsisActive(newElement));
|
|
49
49
|
}, [prefix, tagRef]);
|
|
50
|
-
const tooltipClasses =
|
|
50
|
+
const tooltipClasses = cx(`${prefix}--icon-tooltip`, `${prefix}--tag-label-tooltip`);
|
|
51
51
|
const combinedRef = mergeRefs(tagRef, forwardRef);
|
|
52
52
|
if (isEllipsisApplied) return /* @__PURE__ */ jsx(Tooltip, {
|
|
53
53
|
label: text,
|
|
@@ -119,5 +119,6 @@ OperationalTag.propTypes = {
|
|
|
119
119
|
*/
|
|
120
120
|
type: PropTypes.oneOf(Object.keys(TYPES))
|
|
121
121
|
};
|
|
122
|
+
Object.keys(TYPES);
|
|
122
123
|
//#endregion
|
|
123
124
|
export { OperationalTag as default };
|
|
@@ -14,8 +14,8 @@ import { mergeRefs } from "../../tools/mergeRefs.js";
|
|
|
14
14
|
import { useControllableState } from "../../internal/useControllableState.js";
|
|
15
15
|
import { isEllipsisActive } from "./isEllipsisActive.js";
|
|
16
16
|
import Tag, { SIZES } from "./Tag.js";
|
|
17
|
-
import classNames from "classnames";
|
|
18
17
|
import { forwardRef, useRef, useState } from "react";
|
|
18
|
+
import cx from "classnames";
|
|
19
19
|
import PropTypes from "prop-types";
|
|
20
20
|
import { jsx } from "react/jsx-runtime";
|
|
21
21
|
//#region src/components/Tag/SelectableTag.tsx
|
|
@@ -35,13 +35,13 @@ const SelectableTag = forwardRef(({ className, disabled, id, renderIcon, onChang
|
|
|
35
35
|
onChange,
|
|
36
36
|
defaultValue: defaultSelected
|
|
37
37
|
});
|
|
38
|
-
const tagClasses =
|
|
38
|
+
const tagClasses = cx(`${prefix}--tag--selectable`, className, { [`${prefix}--tag--selectable-selected`]: selectedTag });
|
|
39
39
|
const [isEllipsisApplied, setIsEllipsisApplied] = useState(false);
|
|
40
40
|
useIsomorphicEffect(() => {
|
|
41
41
|
const newElement = tagRef.current?.getElementsByClassName(`${prefix}--tag__label`)[0];
|
|
42
42
|
setIsEllipsisApplied(isEllipsisActive(newElement));
|
|
43
43
|
}, [prefix, tagRef]);
|
|
44
|
-
const tooltipClasses =
|
|
44
|
+
const tooltipClasses = cx(`${prefix}--icon-tooltip`, `${prefix}--tag-label-tooltip`);
|
|
45
45
|
const combinedRef = mergeRefs(tagRef, forwardRef);
|
|
46
46
|
const handleClick = (e) => {
|
|
47
47
|
setSelectedTag(!selectedTag);
|
|
@@ -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/Tag/Tag.Skeleton.tsx
|
|
@@ -20,7 +20,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
20
20
|
function TagSkeleton({ className, size, ...rest }) {
|
|
21
21
|
const prefix = usePrefix();
|
|
22
22
|
return /* @__PURE__ */ jsx("span", {
|
|
23
|
-
className:
|
|
23
|
+
className: cx(`${prefix}--tag`, `${prefix}--skeleton`, className, {
|
|
24
24
|
[`${prefix}--tag--${size}`]: size,
|
|
25
25
|
[`${prefix}--layout--size-${size}`]: size
|
|
26
26
|
}),
|
|
@@ -39,4 +39,4 @@ TagSkeleton.propTypes = {
|
|
|
39
39
|
size: PropTypes.oneOf(["sm"])
|
|
40
40
|
};
|
|
41
41
|
//#endregion
|
|
42
|
-
export { TagSkeleton as default };
|
|
42
|
+
export { TagSkeleton, TagSkeleton as default };
|
package/es/components/Tag/Tag.js
CHANGED
|
@@ -15,8 +15,8 @@ import { useMergedRefs } from "../../internal/useMergedRefs.js";
|
|
|
15
15
|
import { DefinitionTooltip } from "../Tooltip/DefinitionTooltip.js";
|
|
16
16
|
import { AILabel } from "../AILabel/index.js";
|
|
17
17
|
import { isEllipsisActive } from "./isEllipsisActive.js";
|
|
18
|
-
import classNames from "classnames";
|
|
19
18
|
import React, { cloneElement, useRef, useState } from "react";
|
|
19
|
+
import cx from "classnames";
|
|
20
20
|
import PropTypes from "prop-types";
|
|
21
21
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
22
|
import { Close } from "@carbon/icons-react";
|
|
@@ -64,7 +64,7 @@ const Tag = React.forwardRef(({ children, className, decorator, id, type, filter
|
|
|
64
64
|
`${prefix}--tag--filter`,
|
|
65
65
|
`${prefix}--tag--operational`
|
|
66
66
|
].some((el) => className?.includes(el));
|
|
67
|
-
const tagClasses =
|
|
67
|
+
const tagClasses = cx(`${prefix}--tag`, className, {
|
|
68
68
|
[`${prefix}--tag--disabled`]: disabled,
|
|
69
69
|
[`${prefix}--tag--filter`]: filter,
|
|
70
70
|
[`${prefix}--tag--${size}`]: size,
|
|
@@ -111,7 +111,7 @@ const Tag = React.forwardRef(({ children, className, decorator, id, type, filter
|
|
|
111
111
|
]
|
|
112
112
|
});
|
|
113
113
|
const ComponentTag = BaseComponent ?? (other.onClick || className?.includes(`${prefix}--tag--operational`) ? "button" : "div");
|
|
114
|
-
const labelClasses =
|
|
114
|
+
const labelClasses = cx({ [`${prefix}--tag__label`]: !isInteractiveTag });
|
|
115
115
|
return /* @__PURE__ */ jsxs(ComponentTag, {
|
|
116
116
|
ref,
|
|
117
117
|
disabled,
|
|
@@ -201,5 +201,6 @@ Tag.propTypes = {
|
|
|
201
201
|
*/
|
|
202
202
|
type: PropTypes.oneOf(Object.keys(TYPES))
|
|
203
203
|
};
|
|
204
|
+
Object.keys(TYPES);
|
|
204
205
|
//#endregion
|
|
205
206
|
export { SIZES, TYPES, Tag 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/TextArea/TextArea.Skeleton.tsx
|
|
@@ -21,7 +21,7 @@ const TextAreaSkeleton = (props) => {
|
|
|
21
21
|
const { className, hideLabel, ...rest } = props;
|
|
22
22
|
const prefix = usePrefix();
|
|
23
23
|
return /* @__PURE__ */ jsxs("div", {
|
|
24
|
-
className:
|
|
24
|
+
className: cx(`${prefix}--form-item`, className),
|
|
25
25
|
...rest,
|
|
26
26
|
children: [!hideLabel && /* @__PURE__ */ jsx("span", { className: `${prefix}--label ${prefix}--skeleton` }), /* @__PURE__ */ jsx("div", { className: `${prefix}--skeleton ${prefix}--text-area` })]
|
|
27
27
|
});
|
|
@@ -37,4 +37,4 @@ TextAreaSkeleton.propTypes = {
|
|
|
37
37
|
hideLabel: PropTypes.bool
|
|
38
38
|
};
|
|
39
39
|
//#endregion
|
|
40
|
-
export { TextAreaSkeleton as default };
|
|
40
|
+
export { TextAreaSkeleton, TextAreaSkeleton as default };
|
|
@@ -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 { usePrefix } from "../../internal/usePrefix.js";
|
|
9
10
|
import { Text } from "../Text/Text.js";
|
|
10
11
|
import useIsomorphicEffect from "../../internal/useIsomorphicEffect.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 { isComponentElement } from "../../internal/utils.js";
|
|
15
15
|
import { useMergedRefs } from "../../internal/useMergedRefs.js";
|
|
@@ -17,8 +17,8 @@ import { hasHelperText } from "../../internal/hasHelperText.js";
|
|
|
17
17
|
import { AILabel } from "../AILabel/index.js";
|
|
18
18
|
import { FormContext } from "../FluidForm/FormContext.js";
|
|
19
19
|
import { getAnnouncement } from "../../internal/getAnnouncement.js";
|
|
20
|
-
import classNames from "classnames";
|
|
21
20
|
import { cloneElement, forwardRef, useContext, useEffect, useRef, useState } from "react";
|
|
21
|
+
import cx from "classnames";
|
|
22
22
|
import PropTypes from "prop-types";
|
|
23
23
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
24
24
|
import { WarningAltFilled, WarningFilled } from "@carbon/icons-react";
|
|
@@ -137,28 +137,28 @@ const TextArea = forwardRef((props, forwardRef) => {
|
|
|
137
137
|
if (!disabled && onClick) onClick(evt);
|
|
138
138
|
}
|
|
139
139
|
};
|
|
140
|
-
const formItemClasses =
|
|
141
|
-
const textAreaWrapperClasses =
|
|
140
|
+
const formItemClasses = cx(`${prefix}--form-item`, className);
|
|
141
|
+
const textAreaWrapperClasses = cx(`${prefix}--text-area__wrapper`, {
|
|
142
142
|
[`${prefix}--text-area__wrapper--cols`]: other.cols,
|
|
143
143
|
[`${prefix}--text-area__wrapper--readonly`]: other.readOnly,
|
|
144
144
|
[`${prefix}--text-area__wrapper--warn`]: warn,
|
|
145
145
|
[`${prefix}--text-area__wrapper--slug`]: slug,
|
|
146
146
|
[`${prefix}--text-area__wrapper--decorator`]: decorator
|
|
147
147
|
});
|
|
148
|
-
const labelClasses =
|
|
148
|
+
const labelClasses = cx(`${prefix}--label`, {
|
|
149
149
|
[`${prefix}--visually-hidden`]: hideLabel && !isFluid,
|
|
150
150
|
[`${prefix}--label--disabled`]: disabled
|
|
151
151
|
});
|
|
152
|
-
const textareaClasses =
|
|
152
|
+
const textareaClasses = cx(`${prefix}--text-area`, {
|
|
153
153
|
[`${prefix}--text-area--light`]: light,
|
|
154
154
|
[`${prefix}--text-area--invalid`]: invalid,
|
|
155
155
|
[`${prefix}--text-area--warn`]: warn
|
|
156
156
|
});
|
|
157
|
-
const counterClasses =
|
|
157
|
+
const counterClasses = cx(`${prefix}--label`, {
|
|
158
158
|
[`${prefix}--label--disabled`]: disabled,
|
|
159
159
|
[`${prefix}--text-area__label-counter`]: true
|
|
160
160
|
});
|
|
161
|
-
const helperTextClasses =
|
|
161
|
+
const helperTextClasses = cx(`${prefix}--form__helper-text`, { [`${prefix}--form__helper-text--disabled`]: disabled });
|
|
162
162
|
const label = typeof labelText !== "undefined" && labelText !== null && /* @__PURE__ */ jsx(Text, {
|
|
163
163
|
as: "label",
|
|
164
164
|
htmlFor: id,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import TextArea from "./TextArea.js";
|
|
9
|
-
import "./TextArea.Skeleton.js";
|
|
9
|
+
import { TextAreaSkeleton } from "./TextArea.Skeleton.js";
|
|
10
10
|
//#region src/components/TextArea/index.ts
|
|
11
11
|
/**
|
|
12
12
|
* Copyright IBM Corp. 2016, 2023
|
|
@@ -16,4 +16,4 @@ import "./TextArea.Skeleton.js";
|
|
|
16
16
|
*/
|
|
17
17
|
var TextArea_default = TextArea;
|
|
18
18
|
//#endregion
|
|
19
|
-
export { TextArea_default as default };
|
|
19
|
+
export { TextArea, TextAreaSkeleton, TextArea_default as default };
|
|
@@ -5,14 +5,14 @@
|
|
|
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 { useId } from "../../internal/useId.js";
|
|
10
|
-
import { noopFn } from "../../internal/noopFn.js";
|
|
11
11
|
import { deprecate } from "../../prop-types/deprecate.js";
|
|
12
12
|
import { hasHelperText } from "../../internal/hasHelperText.js";
|
|
13
13
|
import { getTextInputProps } from "./util.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
|
import { View, ViewOff, WarningFilled } from "@carbon/icons-react";
|
|
@@ -38,18 +38,18 @@ const ControlledPasswordInput = forwardRef(({ labelText, className, id, placehol
|
|
|
38
38
|
placeholder,
|
|
39
39
|
type,
|
|
40
40
|
ref,
|
|
41
|
-
className:
|
|
41
|
+
className: cx(`${prefix}--text-input`, `${prefix}--password-input`, className, {
|
|
42
42
|
[`${prefix}--text-input--light`]: light,
|
|
43
43
|
[`${prefix}--text-input--invalid`]: invalid,
|
|
44
44
|
[`${prefix}--text-input--${size}`]: size
|
|
45
45
|
}),
|
|
46
46
|
...other
|
|
47
47
|
};
|
|
48
|
-
const labelClasses =
|
|
48
|
+
const labelClasses = cx(`${prefix}--label`, {
|
|
49
49
|
[`${prefix}--visually-hidden`]: hideLabel,
|
|
50
50
|
[`${prefix}--label--disabled`]: disabled
|
|
51
51
|
});
|
|
52
|
-
const helperTextClasses =
|
|
52
|
+
const helperTextClasses = cx(`${prefix}--form__helper-text`, { [`${prefix}--form__helper-text--disabled`]: disabled });
|
|
53
53
|
const label = typeof labelText !== "undefined" && labelText !== null && /* @__PURE__ */ jsx("label", {
|
|
54
54
|
htmlFor: id,
|
|
55
55
|
className: labelClasses,
|
|
@@ -62,7 +62,7 @@ const ControlledPasswordInput = forwardRef(({ labelText, className, id, placehol
|
|
|
62
62
|
}) : null;
|
|
63
63
|
const passwordIsVisible = type === "text";
|
|
64
64
|
const passwordVisibilityIcon = passwordIsVisible ? /* @__PURE__ */ jsx(ViewOff, { className: `${prefix}--icon-visibility-off` }) : /* @__PURE__ */ jsx(View, { className: `${prefix}--icon-visibility-on` });
|
|
65
|
-
const passwordVisibilityToggleClasses =
|
|
65
|
+
const passwordVisibilityToggleClasses = cx(`${prefix}--text-input--password__visibility__toggle`, `${prefix}--btn`, `${prefix}--btn--icon-only`, `${prefix}--tooltip__trigger`, `${prefix}--tooltip--a11y`, {
|
|
66
66
|
[`${prefix}--tooltip--${tooltipPosition}`]: tooltipPosition,
|
|
67
67
|
[`${prefix}--tooltip--align-${tooltipAlignment}`]: tooltipAlignment
|
|
68
68
|
});
|
|
@@ -12,8 +12,8 @@ import { hasHelperText } from "../../internal/hasHelperText.js";
|
|
|
12
12
|
import { useNormalizedInputProps } from "../../internal/useNormalizedInputProps.js";
|
|
13
13
|
import { FormContext } from "../FluidForm/FormContext.js";
|
|
14
14
|
import { getTextInputProps } from "./util.js";
|
|
15
|
-
import classNames from "classnames";
|
|
16
15
|
import { forwardRef, useContext, useEffect, useState } from "react";
|
|
16
|
+
import cx from "classnames";
|
|
17
17
|
import PropTypes from "prop-types";
|
|
18
18
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
19
19
|
import { View, ViewOff } from "@carbon/icons-react";
|
|
@@ -51,7 +51,7 @@ const PasswordInput = forwardRef(({ className, disabled = false, helperText, hid
|
|
|
51
51
|
},
|
|
52
52
|
placeholder,
|
|
53
53
|
type: inputType,
|
|
54
|
-
className:
|
|
54
|
+
className: cx(`${prefix}--text-input`, `${prefix}--password-input`, className, {
|
|
55
55
|
[`${prefix}--text-input--light`]: light,
|
|
56
56
|
[`${prefix}--text-input--invalid`]: normalizedProps.invalid,
|
|
57
57
|
[`${prefix}--text-input--warning`]: normalizedProps.warn,
|
|
@@ -61,29 +61,29 @@ const PasswordInput = forwardRef(({ className, disabled = false, helperText, hid
|
|
|
61
61
|
ref,
|
|
62
62
|
...rest
|
|
63
63
|
};
|
|
64
|
-
const inputWrapperClasses =
|
|
64
|
+
const inputWrapperClasses = cx(`${prefix}--form-item`, `${prefix}--text-input-wrapper`, `${prefix}--password-input-wrapper`, {
|
|
65
65
|
[`${prefix}--text-input-wrapper--readonly`]: readOnly,
|
|
66
66
|
[`${prefix}--text-input-wrapper--light`]: light,
|
|
67
67
|
[`${prefix}--text-input-wrapper--inline`]: inline,
|
|
68
68
|
[`${prefix}--text-input-wrapper--inline--invalid`]: inline && normalizedProps.invalid,
|
|
69
69
|
[`${prefix}--text-input--fluid`]: isFluid
|
|
70
70
|
});
|
|
71
|
-
const labelClasses =
|
|
71
|
+
const labelClasses = cx(`${prefix}--label`, {
|
|
72
72
|
[`${prefix}--visually-hidden`]: hideLabel,
|
|
73
73
|
[`${prefix}--label--disabled`]: disabled,
|
|
74
74
|
[`${prefix}--label--inline`]: inline,
|
|
75
75
|
[`${prefix}--label--inline--${size}`]: inline && !!size
|
|
76
76
|
});
|
|
77
|
-
const helperTextClasses =
|
|
77
|
+
const helperTextClasses = cx(`${prefix}--form__helper-text`, {
|
|
78
78
|
[`${prefix}--form__helper-text--disabled`]: disabled,
|
|
79
79
|
[`${prefix}--form__helper-text--inline`]: inline
|
|
80
80
|
});
|
|
81
|
-
const fieldOuterWrapperClasses =
|
|
82
|
-
const fieldWrapperClasses =
|
|
81
|
+
const fieldOuterWrapperClasses = cx(`${prefix}--text-input__field-outer-wrapper`, { [`${prefix}--text-input__field-outer-wrapper--inline`]: inline });
|
|
82
|
+
const fieldWrapperClasses = cx(`${prefix}--text-input__field-wrapper`, {
|
|
83
83
|
[`${prefix}--text-input__field-wrapper--warning`]: normalizedProps.warn,
|
|
84
84
|
[`${prefix}--layout--size-${size}`]: size
|
|
85
85
|
});
|
|
86
|
-
const iconClasses =
|
|
86
|
+
const iconClasses = cx({
|
|
87
87
|
[`${prefix}--text-input__invalid-icon`]: normalizedProps.invalid || normalizedProps.warn,
|
|
88
88
|
[`${prefix}--text-input__invalid-icon--warning`]: normalizedProps.warn
|
|
89
89
|
});
|
|
@@ -99,11 +99,11 @@ const PasswordInput = forwardRef(({ className, disabled = false, helperText, hid
|
|
|
99
99
|
});
|
|
100
100
|
const passwordIsVisible = inputType === "text";
|
|
101
101
|
const passwordVisibilityIcon = passwordIsVisible ? /* @__PURE__ */ jsx(ViewOff, { className: `${prefix}--icon-visibility-off` }) : /* @__PURE__ */ jsx(View, { className: `${prefix}--icon-visibility-on` });
|
|
102
|
-
const passwordVisibilityToggleClasses =
|
|
102
|
+
const passwordVisibilityToggleClasses = cx(`${prefix}--text-input--password__visibility__toggle`, `${prefix}--btn`, `${prefix}--tooltip__trigger`, `${prefix}--tooltip--a11y`, {
|
|
103
103
|
[`${prefix}--tooltip--${tooltipPosition}`]: tooltipPosition,
|
|
104
104
|
[`${prefix}--tooltip--align-${tooltipAlignment}`]: tooltipAlignment
|
|
105
105
|
});
|
|
106
|
-
const tooltipClasses =
|
|
106
|
+
const tooltipClasses = cx(`${prefix}--toggle-password-tooltip`, `${prefix}--icon-tooltip`);
|
|
107
107
|
let align = void 0;
|
|
108
108
|
if (tooltipPosition === "top" || tooltipPosition === "bottom") {
|
|
109
109
|
if (tooltipAlignment === "center") align = tooltipPosition;
|
|
@@ -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/TextInput/TextInput.Skeleton.tsx
|
|
@@ -20,7 +20,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
20
20
|
const TextInputSkeleton = ({ hideLabel, className, size, ...rest }) => {
|
|
21
21
|
const prefix = usePrefix();
|
|
22
22
|
return /* @__PURE__ */ jsxs("div", {
|
|
23
|
-
className:
|
|
23
|
+
className: cx(`${prefix}--form-item`, className, { [`${prefix}--layout--size-${size}`]: size }),
|
|
24
24
|
...rest,
|
|
25
25
|
children: [!hideLabel && /* @__PURE__ */ jsx("span", { className: `${prefix}--label ${prefix}--skeleton` }), /* @__PURE__ */ jsx("div", { className: `${prefix}--skeleton ${prefix}--text-input` })]
|
|
26
26
|
});
|
|
@@ -45,4 +45,4 @@ TextInputSkeleton.propTypes = {
|
|
|
45
45
|
])
|
|
46
46
|
};
|
|
47
47
|
//#endregion
|
|
48
|
-
export { TextInputSkeleton as default };
|
|
48
|
+
export { TextInputSkeleton, TextInputSkeleton as default };
|