@carbon/react 1.89.0 → 1.90.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 +877 -877
- package/README.md +2 -2
- package/es/components/AILabel/index.js +8 -6
- package/es/components/Breadcrumb/BreadcrumbItem.js +2 -0
- package/es/components/Button/Button.js +3 -0
- package/es/components/ChatButton/ChatButton.js +1 -0
- package/es/components/CheckboxGroup/CheckboxGroup.js +21 -2
- package/es/components/ComboBox/ComboBox.js +17 -1
- package/es/components/ComboButton/index.js +1 -0
- package/es/components/ComposedModal/ComposedModal.js +18 -4
- package/es/components/DataTable/DataTable.d.ts +3 -8
- package/es/components/DataTable/DataTable.js +14 -0
- package/es/components/DataTable/Table.js +3 -3
- package/es/components/DataTable/TableExpandHeader.js +5 -1
- package/es/components/DataTable/TableExpandRow.d.ts +33 -5
- package/es/components/DataTable/TableExpandRow.js +5 -2
- package/es/components/DataTable/TableHeader.d.ts +1 -2
- package/es/components/DataTable/TableHeader.js +3 -2
- package/es/components/DataTable/TableRow.d.ts +3 -6
- package/es/components/DataTable/TableRow.js +40 -22
- package/es/components/DataTable/TableSlugRow.js +1 -0
- package/es/components/DataTable/TableToolbarMenu.js +3 -0
- package/es/components/DataTable/state/sorting.d.ts +57 -14
- package/es/components/DataTable/state/sorting.js +42 -50
- package/es/components/DataTable/tools/sorting.js +5 -0
- package/es/components/DatePicker/DatePicker.js +14 -3
- package/es/components/DatePickerInput/DatePickerInput.js +6 -0
- package/es/components/Dialog/Dialog.js +10 -2
- package/es/components/Dropdown/Dropdown.js +16 -4
- package/es/components/ErrorBoundary/ErrorBoundaryContext.js +1 -0
- package/es/components/FileUploader/FileUploader.js +9 -2
- package/es/components/FileUploader/FileUploaderButton.js +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/es/components/FileUploader/FileUploaderItem.js +3 -0
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +2 -0
- package/es/components/FluidNumberInput/FluidNumberInput.js +3 -2
- package/es/components/FluidSearch/FluidSearch.js +3 -2
- package/es/components/FluidSelect/FluidSelect.js +3 -2
- package/es/components/FluidTextInput/FluidTextInput.js +3 -2
- package/es/components/FluidTimePicker/FluidTimePicker.js +11 -4
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +3 -2
- package/es/components/Grid/CSSGrid.js +5 -0
- package/es/components/Grid/Column.js +3 -0
- package/es/components/Grid/ColumnHang.js +1 -0
- package/es/components/Grid/FlexGrid.js +1 -0
- package/es/components/Grid/Row.js +1 -0
- package/es/components/Heading/index.js +3 -1
- package/es/components/IconButton/index.js +4 -2
- package/es/components/IconIndicator/index.js +4 -2
- package/es/components/InlineCheckbox/InlineCheckbox.js +3 -2
- package/es/components/Layout/index.js +6 -4
- package/es/components/LayoutDirection/LayoutDirection.js +2 -0
- package/es/components/Link/Link.js +3 -0
- package/es/components/ListBox/ListBoxMenuItem.js +4 -1
- package/es/components/ListBox/next/ListBoxTrigger.js +3 -2
- package/es/components/Menu/Menu.js +6 -9
- package/es/components/Menu/MenuContext.js +1 -0
- package/es/components/Menu/MenuItem.js +5 -13
- package/es/components/MenuButton/index.js +7 -2
- package/es/components/Modal/Modal.js +15 -6
- package/es/components/ModalWrapper/ModalWrapper.js +2 -0
- package/es/components/MultiSelect/FilterableMultiSelect.js +24 -5
- package/es/components/MultiSelect/MultiSelect.js +21 -5
- package/es/components/Notification/Notification.js +1 -1
- package/es/components/NumberInput/NumberInput.js +18 -7
- package/es/components/OverflowMenu/OverflowMenu.js +2 -0
- package/es/components/OverflowMenu/next/index.js +3 -2
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +2 -0
- package/es/components/PageHeader/PageHeader.d.ts +3 -3
- package/es/components/PageHeader/PageHeader.js +22 -8
- package/es/components/Pagination/Pagination.js +6 -2
- package/es/components/PaginationNav/PaginationNav.js +2 -5
- package/es/components/Popover/index.js +20 -6
- package/es/components/ProgressBar/ProgressBar.js +4 -2
- package/es/components/RadioTile/RadioTile.js +2 -2
- package/es/components/Search/Search.js +2 -2
- package/es/components/Select/Select.js +2 -3
- package/es/components/ShapeIndicator/index.js +4 -2
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts +4 -4
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +1 -2
- package/es/components/SkeletonText/SkeletonText.js +0 -2
- package/es/components/Slider/Slider.js +11 -16
- package/es/components/Stack/HStack.js +1 -0
- package/es/components/Stack/Stack.js +6 -9
- package/es/components/Stack/VStack.js +1 -0
- package/es/components/StructuredList/StructuredList.js +3 -0
- package/es/components/Switch/Switch.js +1 -1
- package/es/components/Tabs/Tabs.js +28 -17
- package/es/components/Tag/DismissibleTag.d.ts +5 -0
- package/es/components/Tag/DismissibleTag.js +8 -1
- package/es/components/Tag/OperationalTag.js +2 -0
- package/es/components/Tag/SelectableTag.js +2 -0
- package/es/components/Tag/Tag.js +4 -0
- package/es/components/Tag/isEllipsisActive.js +1 -0
- package/es/components/Text/Text.js +1 -0
- package/es/components/TextInput/ControlledPasswordInput.js +2 -4
- package/es/components/TextInput/PasswordInput.js +7 -2
- package/es/components/TextInput/TextInput.js +4 -2
- package/es/components/Theme/index.js +8 -3
- package/es/components/Tile/Tile.js +14 -17
- package/es/components/TimePicker/TimePicker.js +1 -0
- package/es/components/Toggle/Toggle.js +1 -1
- package/es/components/Toggletip/index.js +23 -8
- package/es/components/Tooltip/DefinitionTooltip.js +1 -0
- package/es/components/Tooltip/Tooltip.js +30 -23
- package/es/components/TreeView/TreeNode.d.ts +28 -0
- package/es/components/TreeView/TreeNode.js +19 -10
- package/es/components/TreeView/TreeView.js +7 -0
- package/es/components/UIShell/HeaderContainer.js +3 -1
- package/es/components/UIShell/HeaderGlobalAction.js +2 -2
- package/es/components/UIShell/HeaderMenu.js +3 -3
- package/es/components/UIShell/HeaderPanel.js +2 -2
- package/es/components/UIShell/Link.js +2 -0
- package/es/components/UIShell/SideNavItems.js +1 -0
- package/es/components/UIShell/SideNavMenu.js +2 -2
- package/es/components/UIShell/SideNavMenuItem.js +1 -1
- package/es/components/UIShell/SideNavSwitcher.js +1 -1
- package/es/components/UIShell/Switcher.js +2 -1
- package/es/components/UIShell/SwitcherItem.js +4 -2
- package/es/internal/FloatingMenu.js +7 -1
- package/es/internal/Selection.js +12 -3
- package/es/internal/useMergedRefs.js +1 -0
- package/es/internal/useNoInteractiveChildren.js +4 -0
- package/es/internal/useOutsideClick.js +1 -0
- package/es/internal/useOverflowItems.js +6 -0
- package/es/internal/useResizeObserver.js +4 -0
- package/es/internal/useSavedCallback.js +1 -0
- package/es/internal/warning.js +1 -0
- package/es/prop-types/isRequiredOneOf.js +4 -1
- package/es/tools/events.js +3 -1
- package/es/tools/wrapComponent.js +1 -0
- package/lib/components/AILabel/index.js +8 -6
- package/lib/components/Breadcrumb/BreadcrumbItem.js +2 -0
- package/lib/components/Button/Button.js +3 -0
- package/lib/components/ChatButton/ChatButton.js +1 -0
- package/lib/components/CheckboxGroup/CheckboxGroup.js +20 -1
- package/lib/components/ComboBox/ComboBox.js +17 -1
- package/lib/components/ComboButton/index.js +1 -0
- package/lib/components/ComposedModal/ComposedModal.js +18 -4
- package/lib/components/DataTable/DataTable.d.ts +3 -8
- package/lib/components/DataTable/DataTable.js +14 -0
- package/lib/components/DataTable/Table.js +3 -3
- package/lib/components/DataTable/TableExpandHeader.js +5 -1
- package/lib/components/DataTable/TableExpandRow.d.ts +33 -5
- package/lib/components/DataTable/TableExpandRow.js +5 -2
- package/lib/components/DataTable/TableHeader.d.ts +1 -2
- package/lib/components/DataTable/TableHeader.js +3 -2
- package/lib/components/DataTable/TableRow.d.ts +3 -6
- package/lib/components/DataTable/TableRow.js +39 -21
- package/lib/components/DataTable/TableSlugRow.js +1 -0
- package/lib/components/DataTable/TableToolbarMenu.js +3 -0
- package/lib/components/DataTable/state/sorting.d.ts +57 -14
- package/lib/components/DataTable/state/sorting.js +41 -50
- package/lib/components/DataTable/tools/sorting.js +5 -0
- package/lib/components/DatePicker/DatePicker.js +14 -3
- package/lib/components/DatePickerInput/DatePickerInput.js +6 -0
- package/lib/components/Dialog/Dialog.js +10 -2
- package/lib/components/Dropdown/Dropdown.js +16 -4
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +1 -0
- package/lib/components/FileUploader/FileUploader.js +9 -2
- package/lib/components/FileUploader/FileUploaderButton.js +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/lib/components/FileUploader/FileUploaderItem.js +3 -0
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +2 -0
- package/lib/components/FluidNumberInput/FluidNumberInput.js +3 -2
- package/lib/components/FluidSearch/FluidSearch.js +3 -2
- package/lib/components/FluidSelect/FluidSelect.js +3 -2
- package/lib/components/FluidTextInput/FluidTextInput.js +3 -2
- package/lib/components/FluidTimePicker/FluidTimePicker.js +11 -4
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +3 -2
- package/lib/components/Grid/CSSGrid.js +5 -0
- package/lib/components/Grid/Column.js +3 -0
- package/lib/components/Grid/ColumnHang.js +1 -0
- package/lib/components/Grid/FlexGrid.js +1 -0
- package/lib/components/Grid/Row.js +1 -0
- package/lib/components/Heading/index.js +3 -1
- package/lib/components/IconButton/index.js +4 -2
- package/lib/components/IconIndicator/index.js +4 -2
- package/lib/components/InlineCheckbox/InlineCheckbox.js +3 -2
- package/lib/components/Layout/index.js +6 -4
- package/lib/components/LayoutDirection/LayoutDirection.js +2 -0
- package/lib/components/Link/Link.js +3 -0
- package/lib/components/ListBox/ListBoxMenuItem.js +4 -1
- package/lib/components/ListBox/next/ListBoxTrigger.js +3 -2
- package/lib/components/Menu/Menu.js +6 -9
- package/lib/components/Menu/MenuContext.js +1 -0
- package/lib/components/Menu/MenuItem.js +5 -13
- package/lib/components/MenuButton/index.js +7 -2
- package/lib/components/Modal/Modal.js +15 -6
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -0
- package/lib/components/MultiSelect/FilterableMultiSelect.js +24 -5
- package/lib/components/MultiSelect/MultiSelect.js +21 -5
- package/lib/components/Notification/Notification.js +1 -1
- package/lib/components/NumberInput/NumberInput.js +17 -6
- package/lib/components/OverflowMenu/OverflowMenu.js +2 -0
- package/lib/components/OverflowMenu/next/index.js +3 -2
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +2 -0
- package/lib/components/PageHeader/PageHeader.d.ts +3 -3
- package/lib/components/PageHeader/PageHeader.js +22 -8
- package/lib/components/Pagination/Pagination.js +6 -2
- package/lib/components/PaginationNav/PaginationNav.js +2 -5
- package/lib/components/Popover/index.js +20 -6
- package/lib/components/ProgressBar/ProgressBar.js +4 -2
- package/lib/components/RadioTile/RadioTile.js +2 -2
- package/lib/components/Search/Search.js +2 -2
- package/lib/components/Select/Select.js +2 -3
- package/lib/components/ShapeIndicator/index.js +4 -2
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts +4 -4
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +1 -2
- package/lib/components/SkeletonText/SkeletonText.js +0 -2
- package/lib/components/Slider/Slider.js +11 -16
- package/lib/components/Stack/HStack.js +1 -0
- package/lib/components/Stack/Stack.js +6 -9
- package/lib/components/Stack/VStack.js +1 -0
- package/lib/components/StructuredList/StructuredList.js +3 -0
- package/lib/components/Switch/Switch.js +1 -1
- package/lib/components/Tabs/Tabs.js +28 -17
- package/lib/components/Tag/DismissibleTag.d.ts +5 -0
- package/lib/components/Tag/DismissibleTag.js +8 -1
- package/lib/components/Tag/OperationalTag.js +2 -0
- package/lib/components/Tag/SelectableTag.js +2 -0
- package/lib/components/Tag/Tag.js +4 -0
- package/lib/components/Tag/isEllipsisActive.js +1 -0
- package/lib/components/Text/Text.js +1 -0
- package/lib/components/TextInput/ControlledPasswordInput.js +2 -4
- package/lib/components/TextInput/PasswordInput.js +7 -2
- package/lib/components/TextInput/TextInput.js +4 -2
- package/lib/components/Theme/index.js +8 -3
- package/lib/components/Tile/Tile.js +14 -17
- package/lib/components/TimePicker/TimePicker.js +1 -0
- package/lib/components/Toggle/Toggle.js +1 -1
- package/lib/components/Toggletip/index.js +22 -7
- package/lib/components/Tooltip/DefinitionTooltip.js +1 -0
- package/lib/components/Tooltip/Tooltip.js +30 -23
- package/lib/components/TreeView/TreeNode.d.ts +28 -0
- package/lib/components/TreeView/TreeNode.js +19 -10
- package/lib/components/TreeView/TreeView.js +7 -0
- package/lib/components/UIShell/HeaderContainer.js +3 -1
- package/lib/components/UIShell/HeaderGlobalAction.js +2 -2
- package/lib/components/UIShell/HeaderMenu.js +3 -3
- package/lib/components/UIShell/HeaderPanel.js +2 -2
- package/lib/components/UIShell/Link.js +2 -0
- package/lib/components/UIShell/SideNavItems.js +1 -0
- package/lib/components/UIShell/SideNavMenu.js +2 -2
- package/lib/components/UIShell/SideNavMenuItem.js +1 -1
- package/lib/components/UIShell/SideNavSwitcher.js +1 -1
- package/lib/components/UIShell/Switcher.js +2 -1
- package/lib/components/UIShell/SwitcherItem.js +4 -2
- package/lib/internal/FloatingMenu.js +7 -1
- package/lib/internal/Selection.js +12 -3
- package/lib/internal/useMergedRefs.js +1 -0
- package/lib/internal/useNoInteractiveChildren.js +4 -0
- package/lib/internal/useOutsideClick.js +1 -0
- package/lib/internal/useOverflowItems.js +6 -0
- package/lib/internal/useResizeObserver.js +4 -0
- package/lib/internal/useSavedCallback.js +1 -0
- package/lib/internal/warning.js +1 -0
- package/lib/prop-types/isRequiredOneOf.js +4 -1
- package/lib/tools/events.js +3 -1
- package/lib/tools/wrapComponent.js +1 -0
- package/package.json +11 -11
- package/telemetry.yml +14 -0
|
@@ -80,6 +80,7 @@ function Tabs({
|
|
|
80
80
|
}) {
|
|
81
81
|
const baseId = useId.useId('ccs');
|
|
82
82
|
if (dismissable && !onTabCloseRequest) {
|
|
83
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
83
84
|
console.error('dismissable property specified without also providing an onTabCloseRequest property.');
|
|
84
85
|
}
|
|
85
86
|
// The active index is used to track the element which has focus in our tablist
|
|
@@ -166,15 +167,11 @@ function TabsVertical({
|
|
|
166
167
|
};
|
|
167
168
|
const isSm = useMatchMedia.useMatchMedia(smMediaQuery);
|
|
168
169
|
if (!isSm) {
|
|
169
|
-
return (
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
height: height
|
|
175
|
-
}
|
|
176
|
-
}, /*#__PURE__*/React.createElement(Tabs, props, children))
|
|
177
|
-
);
|
|
170
|
+
return /*#__PURE__*/React.createElement(Grid.Grid, {
|
|
171
|
+
style: {
|
|
172
|
+
height: height
|
|
173
|
+
}
|
|
174
|
+
}, /*#__PURE__*/React.createElement(Tabs, props, children));
|
|
178
175
|
}
|
|
179
176
|
return /*#__PURE__*/React.createElement(Tabs, props, children);
|
|
180
177
|
}
|
|
@@ -278,6 +275,7 @@ function TabList({
|
|
|
278
275
|
let hasSecondaryLabelTabs = false;
|
|
279
276
|
if (contained) {
|
|
280
277
|
hasSecondaryLabelTabs = React.Children.toArray(children).some(child => {
|
|
278
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
281
279
|
const _child = child;
|
|
282
280
|
return /*#__PURE__*/React.isValidElement(child) && !!_child.props.secondaryLabel;
|
|
283
281
|
});
|
|
@@ -391,6 +389,7 @@ function TabList({
|
|
|
391
389
|
inline: 'nearest'
|
|
392
390
|
});
|
|
393
391
|
}
|
|
392
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
394
393
|
}, []);
|
|
395
394
|
React.useEffect(() => {
|
|
396
395
|
//adding 1 in calculation for firefox support
|
|
@@ -411,6 +410,7 @@ function TabList({
|
|
|
411
410
|
setSelectedIndex(tabs.current.indexOf(tab));
|
|
412
411
|
}
|
|
413
412
|
}
|
|
413
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
414
414
|
}, []);
|
|
415
415
|
useIsomorphicEffect.default(() => {
|
|
416
416
|
if (ref.current) {
|
|
@@ -497,7 +497,9 @@ function TabList({
|
|
|
497
497
|
hasSecondaryLabel: hasSecondaryLabelTabs,
|
|
498
498
|
contained
|
|
499
499
|
}
|
|
500
|
-
}, /*#__PURE__*/React.cloneElement(
|
|
500
|
+
}, /*#__PURE__*/React.cloneElement(
|
|
501
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
502
|
+
child, {
|
|
501
503
|
ref: node => {
|
|
502
504
|
tabs.current[index] = node;
|
|
503
505
|
}
|
|
@@ -631,6 +633,7 @@ function TabListVertical({
|
|
|
631
633
|
setSelectedIndex(tabs.current.indexOf(tab));
|
|
632
634
|
}
|
|
633
635
|
}
|
|
636
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
634
637
|
}, []);
|
|
635
638
|
React.useEffect(() => {
|
|
636
639
|
function handler() {
|
|
@@ -641,6 +644,7 @@ function TabListVertical({
|
|
|
641
644
|
if (containerTop && containerHeight) {
|
|
642
645
|
// scrolls so selected tab is in view
|
|
643
646
|
if (selectedPositionTop - halfTabHeight < containerTop || selectedPositionTop - containerTop + verticalTabHeight + halfTabHeight > containerHeight) {
|
|
647
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
644
648
|
ref.current && ref.current.scrollTo({
|
|
645
649
|
top: (selectedIndex - 1) * verticalTabHeight,
|
|
646
650
|
behavior: 'smooth'
|
|
@@ -695,7 +699,9 @@ function TabListVertical({
|
|
|
695
699
|
index,
|
|
696
700
|
hasSecondaryLabel: false
|
|
697
701
|
}
|
|
698
|
-
}, /*#__PURE__*/React.cloneElement(
|
|
702
|
+
}, /*#__PURE__*/React.cloneElement(
|
|
703
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
704
|
+
child, {
|
|
699
705
|
ref: node => {
|
|
700
706
|
tabs.current[index] = node;
|
|
701
707
|
}
|
|
@@ -771,7 +777,8 @@ function createLongPressBehavior(ref, direction, setScrollLeft) {
|
|
|
771
777
|
* Tab
|
|
772
778
|
*/
|
|
773
779
|
|
|
774
|
-
|
|
780
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
781
|
+
const Tab = /*#__PURE__*/React.forwardRef(({
|
|
775
782
|
as = 'button',
|
|
776
783
|
children,
|
|
777
784
|
className: customClassName,
|
|
@@ -781,7 +788,7 @@ const Tab = /*#__PURE__*/React.forwardRef(function Tab({
|
|
|
781
788
|
secondaryLabel,
|
|
782
789
|
renderIcon: Icon,
|
|
783
790
|
...rest
|
|
784
|
-
}, forwardRef) {
|
|
791
|
+
}, forwardRef) => {
|
|
785
792
|
const prefix = usePrefix.usePrefix();
|
|
786
793
|
const {
|
|
787
794
|
selectedIndex,
|
|
@@ -805,6 +812,8 @@ const Tab = /*#__PURE__*/React.forwardRef(function Tab({
|
|
|
805
812
|
const id = `${baseId}-tab-${index$1}`;
|
|
806
813
|
const panelId = `${baseId}-tabpanel-${index$1}`;
|
|
807
814
|
const [isEllipsisApplied, setIsEllipsisApplied] = React.useState(false);
|
|
815
|
+
|
|
816
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
808
817
|
const isEllipsisActive = element => {
|
|
809
818
|
setIsEllipsisApplied(element.offsetHeight < element.scrollHeight);
|
|
810
819
|
return element.offsetHeight < element.scrollHeight;
|
|
@@ -1024,7 +1033,8 @@ Tab.propTypes = {
|
|
|
1024
1033
|
*/
|
|
1025
1034
|
|
|
1026
1035
|
const IconTabContext = /*#__PURE__*/React.createContext(false);
|
|
1027
|
-
|
|
1036
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
1037
|
+
const IconTab = /*#__PURE__*/React.forwardRef(({
|
|
1028
1038
|
badgeIndicator,
|
|
1029
1039
|
children,
|
|
1030
1040
|
className: customClassName,
|
|
@@ -1033,7 +1043,7 @@ const IconTab = /*#__PURE__*/React.forwardRef(function IconTab({
|
|
|
1033
1043
|
leaveDelayMs,
|
|
1034
1044
|
label,
|
|
1035
1045
|
...rest
|
|
1036
|
-
}, ref) {
|
|
1046
|
+
}, ref) => {
|
|
1037
1047
|
const prefix = usePrefix.usePrefix();
|
|
1038
1048
|
const value = React.useMemo(() => ({
|
|
1039
1049
|
badgeIndicator
|
|
@@ -1095,11 +1105,12 @@ IconTab.propTypes = {
|
|
|
1095
1105
|
* TabPanel
|
|
1096
1106
|
*/
|
|
1097
1107
|
|
|
1098
|
-
|
|
1108
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
1109
|
+
const TabPanel = /*#__PURE__*/React.forwardRef(({
|
|
1099
1110
|
children,
|
|
1100
1111
|
className: customClassName,
|
|
1101
1112
|
...rest
|
|
1102
|
-
}, forwardRef) {
|
|
1113
|
+
}, forwardRef) => {
|
|
1103
1114
|
const prefix = usePrefix.usePrefix();
|
|
1104
1115
|
const panel = React.useRef(null);
|
|
1105
1116
|
const ref = useMergedRefs.useMergedRefs([forwardRef, panel]);
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import React, { type ReactNode } from 'react';
|
|
8
8
|
import { PolymorphicProps } from '../../types/common';
|
|
9
9
|
import { SIZES, TYPES } from './Tag';
|
|
10
|
+
import { PopoverAlignment } from '../Popover';
|
|
10
11
|
export interface DismissibleTagBaseProps {
|
|
11
12
|
/**
|
|
12
13
|
* Provide a custom className that is applied to the containing <span>
|
|
@@ -20,6 +21,10 @@ export interface DismissibleTagBaseProps {
|
|
|
20
21
|
* Specify if the `DismissibleTag` is disabled
|
|
21
22
|
*/
|
|
22
23
|
disabled?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Specify the tooltip alignment for the dismiss button
|
|
26
|
+
*/
|
|
27
|
+
dismissTooltipAlignment?: PopoverAlignment;
|
|
23
28
|
/**
|
|
24
29
|
* Provide a custom tooltip label for the dismiss button
|
|
25
30
|
*/
|
|
@@ -28,6 +28,7 @@ var utils = require('../../internal/utils.js');
|
|
|
28
28
|
var Text = require('../Text/Text.js');
|
|
29
29
|
|
|
30
30
|
var _Close;
|
|
31
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
31
32
|
const DismissibleTag = /*#__PURE__*/React.forwardRef(({
|
|
32
33
|
className,
|
|
33
34
|
decorator,
|
|
@@ -41,11 +42,13 @@ const DismissibleTag = /*#__PURE__*/React.forwardRef(({
|
|
|
41
42
|
text,
|
|
42
43
|
tagTitle,
|
|
43
44
|
type,
|
|
45
|
+
dismissTooltipAlignment = 'bottom',
|
|
44
46
|
dismissTooltipLabel = 'Dismiss tag',
|
|
45
47
|
...other
|
|
46
48
|
}, forwardRef) => {
|
|
47
49
|
const prefix = usePrefix.usePrefix();
|
|
48
50
|
const tagLabelRef = React.useRef(null);
|
|
51
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
49
52
|
const tagId = id || `tag-${useId.useId()}`;
|
|
50
53
|
const tagClasses = cx(`${prefix}--tag--filter`, className);
|
|
51
54
|
const [isEllipsisApplied, setIsEllipsisApplied] = React.useState(false);
|
|
@@ -92,7 +95,7 @@ const DismissibleTag = /*#__PURE__*/React.forwardRef(({
|
|
|
92
95
|
className: `${prefix}--tag__decorator`
|
|
93
96
|
}, normalizedDecorator) : '', /*#__PURE__*/React.createElement(Tooltip.Tooltip, {
|
|
94
97
|
label: dismissActionLabel,
|
|
95
|
-
align:
|
|
98
|
+
align: dismissTooltipAlignment,
|
|
96
99
|
className: tooltipClasses,
|
|
97
100
|
leaveDelayMs: 0,
|
|
98
101
|
closeOnActivation: true
|
|
@@ -117,6 +120,10 @@ DismissibleTag.propTypes = {
|
|
|
117
120
|
* Specify if the `DismissibleTag` is disabled
|
|
118
121
|
*/
|
|
119
122
|
disabled: PropTypes.bool,
|
|
123
|
+
/**
|
|
124
|
+
* Specify the tooltip alignment for the dismiss button
|
|
125
|
+
*/
|
|
126
|
+
dismissTooltipAlignment: PropTypes.oneOf(['top', 'bottom', 'left', 'right', 'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']),
|
|
120
127
|
/**
|
|
121
128
|
* Provide a custom tooltip label for the dismiss button
|
|
122
129
|
*/
|
|
@@ -35,6 +35,7 @@ const TYPES = {
|
|
|
35
35
|
'cool-gray': 'Cool-Gray',
|
|
36
36
|
'warm-gray': 'Warm-Gray'
|
|
37
37
|
};
|
|
38
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
38
39
|
const OperationalTag = /*#__PURE__*/React.forwardRef(({
|
|
39
40
|
className,
|
|
40
41
|
disabled,
|
|
@@ -47,6 +48,7 @@ const OperationalTag = /*#__PURE__*/React.forwardRef(({
|
|
|
47
48
|
}, forwardRef) => {
|
|
48
49
|
const prefix = usePrefix.usePrefix();
|
|
49
50
|
const tagRef = React.useRef(null);
|
|
51
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
50
52
|
const tagId = id || `tag-${useId.useId()}`;
|
|
51
53
|
const tagClasses = cx(`${prefix}--tag--operational`, className);
|
|
52
54
|
const [isEllipsisApplied, setIsEllipsisApplied] = React.useState(false);
|
|
@@ -24,6 +24,7 @@ var mergeRefs = require('../../tools/mergeRefs.js');
|
|
|
24
24
|
var useControllableState = require('../../internal/useControllableState.js');
|
|
25
25
|
var Text = require('../Text/Text.js');
|
|
26
26
|
|
|
27
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
27
28
|
const SelectableTag = /*#__PURE__*/React.forwardRef(({
|
|
28
29
|
className,
|
|
29
30
|
disabled,
|
|
@@ -39,6 +40,7 @@ const SelectableTag = /*#__PURE__*/React.forwardRef(({
|
|
|
39
40
|
}, forwardRef) => {
|
|
40
41
|
const prefix = usePrefix.usePrefix();
|
|
41
42
|
const tagRef = React.useRef(null);
|
|
43
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
42
44
|
const tagId = id || `tag-${useId.useId()}`;
|
|
43
45
|
const [selectedTag, setSelectedTag] = useControllableState.useControllableState({
|
|
44
46
|
value: selected,
|
|
@@ -46,6 +46,7 @@ const SIZES = {
|
|
|
46
46
|
md: 'md',
|
|
47
47
|
lg: 'lg'
|
|
48
48
|
};
|
|
49
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
49
50
|
const TagBase = /*#__PURE__*/React.forwardRef(({
|
|
50
51
|
children,
|
|
51
52
|
className,
|
|
@@ -68,12 +69,15 @@ const TagBase = /*#__PURE__*/React.forwardRef(({
|
|
|
68
69
|
const prefix = usePrefix.usePrefix();
|
|
69
70
|
const tagRef = React.useRef(null);
|
|
70
71
|
if (filter) {
|
|
72
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
71
73
|
console.warn('The `filter` prop for Tag has been deprecated and will be removed in the next major version. Use DismissibleTag instead.');
|
|
72
74
|
}
|
|
73
75
|
if (onClose) {
|
|
76
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
74
77
|
console.warn('The `onClose` prop for Tag has been deprecated and will be removed in the next major version. Use DismissibleTag instead.');
|
|
75
78
|
}
|
|
76
79
|
const ref = useMergedRefs.useMergedRefs([forwardRef, tagRef]);
|
|
80
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
77
81
|
const tagId = id || `tag-${useId.useId()}`;
|
|
78
82
|
const [isEllipsisApplied, setIsEllipsisApplied] = React.useState(false);
|
|
79
83
|
React.useLayoutEffect(() => {
|
|
@@ -13,6 +13,7 @@ var React = require('react');
|
|
|
13
13
|
require('./index.js');
|
|
14
14
|
var TextDirectionContext = require('./TextDirectionContext.js');
|
|
15
15
|
|
|
16
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
16
17
|
const TextBase = /*#__PURE__*/React.forwardRef(({
|
|
17
18
|
as,
|
|
18
19
|
children,
|
|
@@ -20,7 +20,7 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
20
20
|
var useId = require('../../internal/useId.js');
|
|
21
21
|
var noopFn = require('../../internal/noopFn.js');
|
|
22
22
|
|
|
23
|
-
const ControlledPasswordInput = /*#__PURE__*/React.forwardRef(
|
|
23
|
+
const ControlledPasswordInput = /*#__PURE__*/React.forwardRef(({
|
|
24
24
|
labelText,
|
|
25
25
|
className,
|
|
26
26
|
id,
|
|
@@ -33,9 +33,7 @@ const ControlledPasswordInput = /*#__PURE__*/React.forwardRef(function Controlle
|
|
|
33
33
|
invalidText = '',
|
|
34
34
|
helperText = '',
|
|
35
35
|
light,
|
|
36
|
-
// eslint-disable-next-line react/prop-types
|
|
37
36
|
type = 'password',
|
|
38
|
-
// eslint-disable-next-line react/prop-types
|
|
39
37
|
togglePasswordVisibility,
|
|
40
38
|
tooltipPosition = 'bottom',
|
|
41
39
|
tooltipAlignment = 'center',
|
|
@@ -43,7 +41,7 @@ const ControlledPasswordInput = /*#__PURE__*/React.forwardRef(function Controlle
|
|
|
43
41
|
showPasswordLabel = 'Show password',
|
|
44
42
|
size = undefined,
|
|
45
43
|
...other
|
|
46
|
-
}, ref) {
|
|
44
|
+
}, ref) => {
|
|
47
45
|
const prefix = usePrefix.usePrefix();
|
|
48
46
|
const controlledPasswordInstanceId = useId.useId();
|
|
49
47
|
const errorId = id + '-error-msg';
|
|
@@ -23,7 +23,7 @@ var Tooltip = require('../Tooltip/Tooltip.js');
|
|
|
23
23
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
24
24
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
25
25
|
|
|
26
|
-
const PasswordInput = /*#__PURE__*/React.forwardRef(
|
|
26
|
+
const PasswordInput = /*#__PURE__*/React.forwardRef(({
|
|
27
27
|
className,
|
|
28
28
|
disabled = false,
|
|
29
29
|
helperText,
|
|
@@ -48,7 +48,7 @@ const PasswordInput = /*#__PURE__*/React.forwardRef(function PasswordInput({
|
|
|
48
48
|
warn = false,
|
|
49
49
|
warnText,
|
|
50
50
|
...rest
|
|
51
|
-
}, ref) {
|
|
51
|
+
}, ref) => {
|
|
52
52
|
const [inputType, setInputType] = React.useState(type);
|
|
53
53
|
const prefix = usePrefix.usePrefix();
|
|
54
54
|
const normalizedProps = useNormalizedInputProps.useNormalizedInputProps({
|
|
@@ -65,6 +65,7 @@ const PasswordInput = /*#__PURE__*/React.forwardRef(function PasswordInput({
|
|
|
65
65
|
} = React.useContext(FormContext.FormContext);
|
|
66
66
|
const handleTogglePasswordVisibility = event => {
|
|
67
67
|
setInputType(inputType === 'password' ? 'text' : 'password');
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
68
69
|
onTogglePasswordVisibility && onTogglePasswordVisibility(event);
|
|
69
70
|
};
|
|
70
71
|
const textInputClasses = cx(`${prefix}--text-input`, `${prefix}--password-input`, className, {
|
|
@@ -154,8 +155,10 @@ const PasswordInput = /*#__PURE__*/React.forwardRef(function PasswordInput({
|
|
|
154
155
|
align = tooltipPosition;
|
|
155
156
|
}
|
|
156
157
|
if (!hidePasswordLabel || hidePasswordLabel.trim() === '') {
|
|
158
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
157
159
|
console.warn('Warning: The "hidePasswordLabel" should not be blank.');
|
|
158
160
|
} else if (!showPasswordLabel || showPasswordLabel.trim() === '') {
|
|
161
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
159
162
|
console.warn('Warning: The "showPasswordLabel" should not be blank.');
|
|
160
163
|
}
|
|
161
164
|
const input = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", _rollupPluginBabelHelpers.extends({}, util.textInputProps({
|
|
@@ -184,6 +187,8 @@ const PasswordInput = /*#__PURE__*/React.forwardRef(function PasswordInput({
|
|
|
184
187
|
React.useEffect(() => {
|
|
185
188
|
setInputType(type);
|
|
186
189
|
}, [type]);
|
|
190
|
+
|
|
191
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
187
192
|
const Icon = normalizedProps.icon;
|
|
188
193
|
return /*#__PURE__*/React.createElement("div", {
|
|
189
194
|
className: inputWrapperClasses
|
|
@@ -25,7 +25,7 @@ var index = require('../AILabel/index.js');
|
|
|
25
25
|
var utils = require('../../internal/utils.js');
|
|
26
26
|
var Text = require('../Text/Text.js');
|
|
27
27
|
|
|
28
|
-
const TextInput = /*#__PURE__*/React.forwardRef(
|
|
28
|
+
const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
29
29
|
className,
|
|
30
30
|
decorator,
|
|
31
31
|
disabled = false,
|
|
@@ -49,7 +49,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(function TextInput({
|
|
|
49
49
|
maxCount,
|
|
50
50
|
slug,
|
|
51
51
|
...rest
|
|
52
|
-
}, ref) {
|
|
52
|
+
}, ref) => {
|
|
53
53
|
const prefix = usePrefix.usePrefix();
|
|
54
54
|
const {
|
|
55
55
|
defaultValue,
|
|
@@ -64,6 +64,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(function TextInput({
|
|
|
64
64
|
const [textCount, setTextCount] = React.useState(getInitialTextCount());
|
|
65
65
|
React.useEffect(() => {
|
|
66
66
|
setTextCount(getInitialTextCount());
|
|
67
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
67
68
|
}, [value, defaultValue, enableCounter]);
|
|
68
69
|
const normalizedProps = useNormalizedInputProps.useNormalizedInputProps({
|
|
69
70
|
id,
|
|
@@ -192,6 +193,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(function TextInput({
|
|
|
192
193
|
}
|
|
193
194
|
}
|
|
194
195
|
}, [ariaAnnouncement, prevAnnouncement]);
|
|
196
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
195
197
|
const Icon = normalizedProps.icon;
|
|
196
198
|
|
|
197
199
|
// AILabel is always size `mini`
|
|
@@ -18,16 +18,20 @@ var useMatchMedia = require('../../internal/useMatchMedia.js');
|
|
|
18
18
|
const ThemeContext = /*#__PURE__*/React.createContext({
|
|
19
19
|
theme: 'white'
|
|
20
20
|
});
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
23
|
+
const GlobalTheme = /*#__PURE__*/React.forwardRef(({
|
|
22
24
|
children,
|
|
23
25
|
theme
|
|
24
|
-
}, ref) {
|
|
26
|
+
}, ref) => {
|
|
25
27
|
const value = React.useMemo(() => {
|
|
26
28
|
return {
|
|
27
29
|
theme
|
|
28
30
|
};
|
|
29
31
|
}, [theme]);
|
|
30
|
-
const childrenWithProps = /*#__PURE__*/React.cloneElement(
|
|
32
|
+
const childrenWithProps = /*#__PURE__*/React.cloneElement(
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
34
|
+
children, {
|
|
31
35
|
ref: ref
|
|
32
36
|
});
|
|
33
37
|
return /*#__PURE__*/React.createElement(ThemeContext.Provider, {
|
|
@@ -69,6 +73,7 @@ function Theme({
|
|
|
69
73
|
isDark
|
|
70
74
|
};
|
|
71
75
|
}, [theme]);
|
|
76
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
72
77
|
const BaseComponentAsAny = BaseComponent;
|
|
73
78
|
return /*#__PURE__*/React.createElement(ThemeContext.Provider, {
|
|
74
79
|
value: value
|
|
@@ -29,7 +29,7 @@ var utils = require('../../internal/utils.js');
|
|
|
29
29
|
var Text = require('../Text/Text.js');
|
|
30
30
|
|
|
31
31
|
var _CheckboxCheckedFille, _Checkbox, _ChevronDown, _ChevronDown2;
|
|
32
|
-
const Tile = /*#__PURE__*/React.forwardRef(
|
|
32
|
+
const Tile = /*#__PURE__*/React.forwardRef(({
|
|
33
33
|
children,
|
|
34
34
|
className,
|
|
35
35
|
decorator,
|
|
@@ -37,7 +37,7 @@ const Tile = /*#__PURE__*/React.forwardRef(function Tile({
|
|
|
37
37
|
slug,
|
|
38
38
|
hasRoundedCorners = false,
|
|
39
39
|
...rest
|
|
40
|
-
}, ref) {
|
|
40
|
+
}, ref) => {
|
|
41
41
|
const prefix = usePrefix.usePrefix();
|
|
42
42
|
const tileClasses = cx(`${prefix}--tile`, {
|
|
43
43
|
[`${prefix}--tile--light`]: light,
|
|
@@ -84,7 +84,7 @@ Tile.propTypes = {
|
|
|
84
84
|
*/
|
|
85
85
|
slug: deprecate.deprecate(PropTypes.node, 'The `slug` prop for `Tile` has ' + 'been deprecated in favor of the new `decorator` prop. It will be removed in the next major release.')
|
|
86
86
|
};
|
|
87
|
-
const ClickableTile = /*#__PURE__*/React.forwardRef(
|
|
87
|
+
const ClickableTile = /*#__PURE__*/React.forwardRef(({
|
|
88
88
|
children,
|
|
89
89
|
className,
|
|
90
90
|
clicked = false,
|
|
@@ -98,7 +98,7 @@ const ClickableTile = /*#__PURE__*/React.forwardRef(function ClickableTile({
|
|
|
98
98
|
hasRoundedCorners,
|
|
99
99
|
slug,
|
|
100
100
|
...rest
|
|
101
|
-
}, ref) {
|
|
101
|
+
}, ref) => {
|
|
102
102
|
const prefix = usePrefix.usePrefix();
|
|
103
103
|
const classes = cx(`${prefix}--tile`, `${prefix}--tile--clickable`, {
|
|
104
104
|
[`${prefix}--tile--is-clicked`]: clicked,
|
|
@@ -207,7 +207,8 @@ ClickableTile.propTypes = {
|
|
|
207
207
|
*/
|
|
208
208
|
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
209
209
|
};
|
|
210
|
-
|
|
210
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
211
|
+
const SelectableTile = /*#__PURE__*/React.forwardRef(({
|
|
211
212
|
children,
|
|
212
213
|
className,
|
|
213
214
|
decorator,
|
|
@@ -223,7 +224,7 @@ const SelectableTile = /*#__PURE__*/React.forwardRef(function SelectableTile({
|
|
|
223
224
|
slug,
|
|
224
225
|
hasRoundedCorners,
|
|
225
226
|
...rest
|
|
226
|
-
}, ref) {
|
|
227
|
+
}, ref) => {
|
|
227
228
|
const prefix = usePrefix.usePrefix();
|
|
228
229
|
const clickHandler = onClick;
|
|
229
230
|
const keyDownHandler = onKeyDown;
|
|
@@ -284,9 +285,7 @@ const SelectableTile = /*#__PURE__*/React.forwardRef(function SelectableTile({
|
|
|
284
285
|
onClick: !disabled ? handleClick : undefined,
|
|
285
286
|
role: "checkbox",
|
|
286
287
|
"aria-checked": isSelected,
|
|
287
|
-
onKeyDown: !disabled ? handleKeyDown : undefined
|
|
288
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
289
|
-
,
|
|
288
|
+
onKeyDown: !disabled ? handleKeyDown : undefined,
|
|
290
289
|
tabIndex: !disabled ? tabIndex : undefined,
|
|
291
290
|
ref: ref,
|
|
292
291
|
id: id,
|
|
@@ -366,16 +365,14 @@ SelectableTile.propTypes = {
|
|
|
366
365
|
*/
|
|
367
366
|
value: deprecate.deprecate(PropTypes.oneOfType([PropTypes.string, PropTypes.number]), 'The `value` property is no longer used. It will be removed in the next major release.`')
|
|
368
367
|
};
|
|
369
|
-
const ExpandableTile = /*#__PURE__*/React.forwardRef(
|
|
368
|
+
const ExpandableTile = /*#__PURE__*/React.forwardRef(({
|
|
370
369
|
tabIndex = 0,
|
|
371
370
|
className,
|
|
372
371
|
children,
|
|
373
372
|
decorator,
|
|
374
373
|
expanded = false,
|
|
375
374
|
tileMaxHeight = 0,
|
|
376
|
-
// eslint-disable-line
|
|
377
375
|
tilePadding = 0,
|
|
378
|
-
// eslint-disable-line
|
|
379
376
|
onClick,
|
|
380
377
|
onKeyUp,
|
|
381
378
|
tileCollapsedIconText = 'Interact to expand Tile',
|
|
@@ -386,7 +383,7 @@ const ExpandableTile = /*#__PURE__*/React.forwardRef(function ExpandableTile({
|
|
|
386
383
|
slug,
|
|
387
384
|
hasRoundedCorners,
|
|
388
385
|
...rest
|
|
389
|
-
}, forwardRef) {
|
|
386
|
+
}, forwardRef) => {
|
|
390
387
|
const [isTileMaxHeight, setIsTileMaxHeight] = React.useState(tileMaxHeight);
|
|
391
388
|
const [isTilePadding, setIsTilePadding] = React.useState(tilePadding);
|
|
392
389
|
const [prevExpanded, setPrevExpanded] = React.useState(expanded);
|
|
@@ -611,9 +608,9 @@ ExpandableTile.propTypes = {
|
|
|
611
608
|
tileExpandedLabel: PropTypes.string
|
|
612
609
|
};
|
|
613
610
|
ExpandableTile.displayName = 'ExpandableTile';
|
|
614
|
-
const TileAboveTheFoldContent = /*#__PURE__*/React.forwardRef(
|
|
611
|
+
const TileAboveTheFoldContent = /*#__PURE__*/React.forwardRef(({
|
|
615
612
|
children
|
|
616
|
-
}, ref) {
|
|
613
|
+
}, ref) => {
|
|
617
614
|
const prefix = usePrefix.usePrefix();
|
|
618
615
|
return /*#__PURE__*/React.createElement("div", {
|
|
619
616
|
ref: ref,
|
|
@@ -627,9 +624,9 @@ TileAboveTheFoldContent.propTypes = {
|
|
|
627
624
|
children: PropTypes.node
|
|
628
625
|
};
|
|
629
626
|
TileAboveTheFoldContent.displayName = 'TileAboveTheFoldContent';
|
|
630
|
-
const TileBelowTheFoldContent = /*#__PURE__*/React.forwardRef(
|
|
627
|
+
const TileBelowTheFoldContent = /*#__PURE__*/React.forwardRef(({
|
|
631
628
|
children
|
|
632
|
-
}, ref) {
|
|
629
|
+
}, ref) => {
|
|
633
630
|
const prefix = usePrefix.usePrefix();
|
|
634
631
|
return /*#__PURE__*/React.createElement("div", {
|
|
635
632
|
ref: ref,
|
|
@@ -116,6 +116,7 @@ const TimePicker = frFn((props, ref) => {
|
|
|
116
116
|
}
|
|
117
117
|
};
|
|
118
118
|
const mappedChildren = React.Children.map(children, pickerSelect => {
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
119
120
|
const item = pickerSelect;
|
|
120
121
|
if (item) {
|
|
121
122
|
return /*#__PURE__*/React.cloneElement(item, {
|
|
@@ -71,7 +71,7 @@ function Toggle({
|
|
|
71
71
|
const labelId = `${id}_label`;
|
|
72
72
|
return (
|
|
73
73
|
/*#__PURE__*/
|
|
74
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
74
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
75
75
|
React.createElement("div", {
|
|
76
76
|
className: wrapperClasses,
|
|
77
77
|
onClick: !labelText ? e => {
|
|
@@ -29,6 +29,7 @@ function ToggletipLabel({
|
|
|
29
29
|
}) {
|
|
30
30
|
const prefix = usePrefix.usePrefix();
|
|
31
31
|
const className = cx(`${prefix}--toggletip-label`, customClassName);
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
32
33
|
const BaseComponentAsAny = BaseComponent;
|
|
33
34
|
return /*#__PURE__*/React.createElement(BaseComponentAsAny, _rollupPluginBabelHelpers.extends({
|
|
34
35
|
className: className
|
|
@@ -129,13 +130,25 @@ function Toggletip({
|
|
|
129
130
|
actions.close();
|
|
130
131
|
}
|
|
131
132
|
});
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
133
|
+
React.useEffect(() => {
|
|
134
|
+
if (!ref.current) return;
|
|
135
|
+
const targetDocument = ref.current.ownerDocument || document;
|
|
136
|
+
const eventType = 'PointerEvent' in window ? 'pointerdown' : 'mousedown';
|
|
137
|
+
const handleOutsideClick = event => {
|
|
138
|
+
const node = event.target;
|
|
139
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
140
|
+
if (open && node && !ref.current.contains(node)) {
|
|
141
|
+
setOpen(false);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
const options = {
|
|
145
|
+
capture: true
|
|
146
|
+
};
|
|
147
|
+
targetDocument.addEventListener(eventType, handleOutsideClick, options);
|
|
148
|
+
return () => {
|
|
149
|
+
targetDocument.removeEventListener(eventType, handleOutsideClick, options);
|
|
150
|
+
};
|
|
151
|
+
}, [open]);
|
|
139
152
|
return /*#__PURE__*/React.createElement(ToggletipContext.Provider, {
|
|
140
153
|
value: value
|
|
141
154
|
}, /*#__PURE__*/React.createElement(index.Popover, _rollupPluginBabelHelpers.extends({
|
|
@@ -156,6 +169,7 @@ function Toggletip({
|
|
|
156
169
|
// Get all the properties from Popover except for "open".
|
|
157
170
|
// The Typescript types for PropTypes are really messed up so we need lots of
|
|
158
171
|
// casting. It will be great when we can finally get rid of PropTypes altogether.
|
|
172
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
159
173
|
const {
|
|
160
174
|
open,
|
|
161
175
|
...popoverNonOpenPropTypes
|
|
@@ -183,6 +197,7 @@ const ToggletipButton = /*#__PURE__*/React.forwardRef(function ToggletipButton({
|
|
|
183
197
|
const toggletip = useToggletip();
|
|
184
198
|
const prefix = usePrefix.usePrefix();
|
|
185
199
|
const className = cx(`${prefix}--toggletip-button`, customClassName);
|
|
200
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
186
201
|
const ComponentToggle = BaseComponent ?? 'button';
|
|
187
202
|
if (ComponentToggle !== 'button') {
|
|
188
203
|
return /*#__PURE__*/React.createElement(ComponentToggle, _rollupPluginBabelHelpers.extends({}, toggletip?.onClick, {
|
|
@@ -50,6 +50,7 @@ const DefinitionTooltip = ({
|
|
|
50
50
|
setOpen(false);
|
|
51
51
|
},
|
|
52
52
|
onMouseEnter: () => {
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
53
54
|
openOnHover ? setOpen(true) : null;
|
|
54
55
|
},
|
|
55
56
|
onFocus: () => {
|