@carbon/ibm-products 2.71.1 → 2.72.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/css/carbon.css +50 -0
- package/css/carbon.css.map +1 -1
- package/css/index-full-carbon.css +560 -185
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +132 -1
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +570 -245
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +358 -33
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/{BigNumbers/BigNumbers.d.ts → BigNumber/BigNumber.d.ts} +5 -5
- package/es/components/{BigNumbers/BigNumbers.js → BigNumber/BigNumber.js} +12 -12
- package/es/components/BigNumber/BigNumberSkeleton.d.ts +17 -0
- package/es/components/{BigNumbers/BigNumbersSkeleton.js → BigNumber/BigNumberSkeleton.js} +16 -16
- package/es/components/{BigNumbers → BigNumber}/constants.d.ts +3 -3
- package/es/components/{BigNumbers → BigNumber}/constants.js +6 -6
- package/es/components/{BigNumbers → BigNumber}/index.d.ts +2 -2
- package/es/components/Coachmark/next/Coachmark/Coachmark.d.ts +72 -0
- package/es/components/Coachmark/next/Coachmark/Coachmark.js +185 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBeacon/CoachmarkBeacon.d.ts +44 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBeacon/index.d.ts +8 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.d.ts +38 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.js +125 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.d.ts +24 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.js +25 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/index.d.ts +10 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts +34 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkContent.js +118 -0
- package/es/components/Coachmark/next/Coachmark/ContentBody.d.ts +23 -0
- package/es/components/Coachmark/next/Coachmark/ContentBody.js +37 -0
- package/es/components/Coachmark/next/Coachmark/ContentHeader.d.ts +21 -0
- package/es/components/Coachmark/next/Coachmark/ContentHeader.js +89 -0
- package/{lib/components/BigNumbers → es/components/Coachmark/next/Coachmark}/index.d.ts +2 -2
- package/es/components/CoachmarkBeacon/CoachmarkBeacon.js +0 -1
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +2 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +30 -5
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +11 -4
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +2 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +1 -1
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +42 -3
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +5 -3
- package/es/components/ConditionBuilder/utils/useEvent.d.ts +8 -0
- package/es/components/ConditionBuilder/utils/useEvent.js +32 -0
- package/es/components/ConditionBuilder/utils/useTranslations.js +1 -1
- package/es/components/EditInPlace/EditInPlace.js +0 -3
- package/es/components/EmptyStates/EmptyState.d.ts +2 -2
- package/es/components/EmptyStates/EmptyState.js +2 -8
- package/es/components/FilterPanel/FilterPanelGroup/index.d.ts +1 -0
- package/es/components/InterstitialScreen/InterstitialScreen.d.ts +1 -25
- package/es/components/InterstitialScreen/InterstitialScreen.js +3 -19
- package/es/components/InterstitialScreen/InterstitialScreenBody.d.ts +1 -1
- package/es/components/InterstitialScreen/InterstitialScreenBody.js +1 -1
- package/es/components/InterstitialScreen/InterstitialScreenFooter.d.ts +1 -1
- package/es/components/InterstitialScreen/InterstitialScreenFooter.js +1 -1
- package/es/components/InterstitialScreen/InterstitialScreenHeader.d.ts +6 -0
- package/es/components/InterstitialScreen/InterstitialScreenHeader.js +1 -1
- package/es/components/InterstitialScreen/_story-assets/InterstitialScreenViewModule/InterstitialScreenViewModule.d.ts +1 -1
- package/es/components/InterstitialScreen/context.d.ts +31 -0
- package/es/components/InterstitialScreen/context.js +18 -0
- package/es/components/InterstitialScreen/index.d.ts +3 -2
- package/es/components/NotificationsPanel/NotificationsPanel.js +36 -13
- package/es/components/PageHeader/PageHeader.d.ts +2 -1
- package/es/components/PageHeader/PageHeader.js +2 -1
- package/es/components/PageHeader/next/PageHeader.d.ts +18 -3
- package/es/components/PageHeader/next/PageHeader.js +260 -12
- package/es/components/PageHeader/next/context.d.ts +25 -0
- package/es/components/PageHeader/next/context.js +30 -0
- package/es/components/PageHeader/next/index.d.ts +3 -3
- package/es/components/PageHeader/next/overflowHandler.d.ts +95 -0
- package/es/components/PageHeader/next/overflowHandler.js +162 -0
- package/es/components/PageHeader/next/utils.d.ts +19 -0
- package/es/components/PageHeader/next/utils.js +68 -0
- package/es/components/ProductiveCard/ProductiveCard.js +2 -1
- package/es/components/ScrollGradient/ScrollGradient.js +1 -2
- package/es/components/SidePanel/SidePanel.d.ts +4 -0
- package/es/components/SidePanel/SidePanel.js +8 -2
- package/es/components/Tearsheet/TearsheetShell.js +8 -5
- package/es/components/TruncatedText/TruncatedText.d.ts +48 -0
- package/es/components/TruncatedText/TruncatedText.js +86 -0
- package/es/components/TruncatedText/index.d.ts +7 -0
- package/es/components/TruncatedText/useTruncatedText.d.ts +16 -0
- package/es/components/TruncatedText/useTruncatedText.js +41 -0
- package/es/components/index.d.ts +3 -1
- package/es/global/js/hooks/useOverflowString.d.ts +2 -2
- package/es/global/js/hooks/useResizeObserver.d.ts +1 -1
- package/es/global/js/package-settings.d.ts +2 -1
- package/es/global/js/package-settings.js +3 -2
- package/es/global/js/utils/checkForOverflow.js +21 -0
- package/es/global/js/utils/makeDraggable/index.d.ts +1 -0
- package/es/global/js/utils/makeDraggable/makeDraggable.d.ts +19 -0
- package/es/global/js/utils/makeDraggable/makeDraggable.js +91 -0
- package/es/global/js/utils/makeDraggable/makeDraggable.stories.d.ts +22 -0
- package/es/index.js +3 -1
- package/es/node_modules/@floating-ui/core/dist/floating-ui.core.js +592 -0
- package/es/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +713 -0
- package/es/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +95 -0
- package/es/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +161 -0
- package/es/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +142 -0
- package/es/settings.d.ts +2 -1
- package/lib/components/{BigNumbers/BigNumbers.d.ts → BigNumber/BigNumber.d.ts} +5 -5
- package/lib/components/{BigNumbers/BigNumbers.js → BigNumber/BigNumber.js} +11 -11
- package/lib/components/BigNumber/BigNumberSkeleton.d.ts +17 -0
- package/lib/components/{BigNumbers/BigNumbersSkeleton.js → BigNumber/BigNumberSkeleton.js} +15 -15
- package/lib/components/{BigNumbers → BigNumber}/constants.d.ts +3 -3
- package/lib/components/{BigNumbers → BigNumber}/constants.js +6 -6
- package/lib/components/BigNumber/index.d.ts +7 -0
- package/lib/components/Coachmark/Coachmark.js +2 -2
- package/lib/components/Coachmark/next/Coachmark/Coachmark.d.ts +72 -0
- package/lib/components/Coachmark/next/Coachmark/Coachmark.js +189 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBeacon/CoachmarkBeacon.d.ts +44 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBeacon/index.d.ts +8 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.d.ts +38 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.js +127 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.d.ts +24 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.js +27 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/index.d.ts +10 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts +34 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.js +122 -0
- package/lib/components/Coachmark/next/Coachmark/ContentBody.d.ts +23 -0
- package/lib/components/Coachmark/next/Coachmark/ContentBody.js +41 -0
- package/lib/components/Coachmark/next/Coachmark/ContentHeader.d.ts +21 -0
- package/lib/components/Coachmark/next/Coachmark/ContentHeader.js +93 -0
- package/lib/components/Coachmark/next/Coachmark/index.d.ts +7 -0
- package/lib/components/CoachmarkBeacon/CoachmarkBeacon.js +0 -1
- package/lib/components/CoachmarkFixed/CoachmarkFixed.js +2 -2
- package/lib/components/CoachmarkStack/CoachmarkStack.js +2 -2
- package/lib/components/CoachmarkStack/CoachmarkStackHome.js +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +2 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +30 -5
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +11 -4
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +1 -1
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +41 -2
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +5 -3
- package/lib/components/ConditionBuilder/utils/useEvent.d.ts +8 -0
- package/lib/components/ConditionBuilder/utils/useEvent.js +34 -0
- package/lib/components/ConditionBuilder/utils/useTranslations.js +1 -1
- package/lib/components/EditInPlace/EditInPlace.js +0 -3
- package/lib/components/EmptyStates/EmptyState.d.ts +2 -2
- package/lib/components/EmptyStates/EmptyState.js +2 -8
- package/lib/components/FilterPanel/FilterPanelGroup/index.d.ts +1 -0
- package/lib/components/InterstitialScreen/InterstitialScreen.d.ts +1 -25
- package/lib/components/InterstitialScreen/InterstitialScreen.js +6 -25
- package/lib/components/InterstitialScreen/InterstitialScreenBody.d.ts +1 -1
- package/lib/components/InterstitialScreen/InterstitialScreenBody.js +6 -6
- package/lib/components/InterstitialScreen/InterstitialScreenFooter.d.ts +1 -1
- package/lib/components/InterstitialScreen/InterstitialScreenFooter.js +9 -9
- package/lib/components/InterstitialScreen/InterstitialScreenHeader.d.ts +6 -0
- package/lib/components/InterstitialScreen/InterstitialScreenHeader.js +5 -5
- package/lib/components/InterstitialScreen/_story-assets/InterstitialScreenViewModule/InterstitialScreenViewModule.d.ts +1 -1
- package/lib/components/InterstitialScreen/context.d.ts +31 -0
- package/lib/components/InterstitialScreen/context.js +21 -0
- package/lib/components/InterstitialScreen/index.d.ts +3 -2
- package/lib/components/NotificationsPanel/NotificationsPanel.js +36 -13
- package/lib/components/PageHeader/PageHeader.d.ts +2 -1
- package/lib/components/PageHeader/PageHeader.js +2 -1
- package/lib/components/PageHeader/next/PageHeader.d.ts +18 -3
- package/lib/components/PageHeader/next/PageHeader.js +261 -7
- package/lib/components/PageHeader/next/context.d.ts +25 -0
- package/lib/components/PageHeader/next/context.js +33 -0
- package/lib/components/PageHeader/next/index.d.ts +3 -3
- package/lib/components/PageHeader/next/overflowHandler.d.ts +95 -0
- package/lib/components/PageHeader/next/overflowHandler.js +166 -0
- package/lib/components/PageHeader/next/utils.d.ts +19 -0
- package/lib/components/PageHeader/next/utils.js +71 -0
- package/lib/components/ProductiveCard/ProductiveCard.js +2 -1
- package/lib/components/ScrollGradient/ScrollGradient.js +1 -2
- package/lib/components/SidePanel/SidePanel.d.ts +4 -0
- package/lib/components/SidePanel/SidePanel.js +8 -2
- package/lib/components/Tearsheet/TearsheetShell.js +8 -5
- package/lib/components/TruncatedText/TruncatedText.d.ts +48 -0
- package/lib/components/TruncatedText/TruncatedText.js +86 -0
- package/lib/components/TruncatedText/index.d.ts +7 -0
- package/lib/components/TruncatedText/useTruncatedText.d.ts +16 -0
- package/lib/components/TruncatedText/useTruncatedText.js +45 -0
- package/lib/components/index.d.ts +3 -1
- package/lib/global/js/hooks/useOverflowString.d.ts +2 -2
- package/lib/global/js/hooks/usePortalTarget.js +2 -2
- package/lib/global/js/hooks/useResizeObserver.d.ts +1 -1
- package/lib/global/js/package-settings.d.ts +2 -1
- package/lib/global/js/package-settings.js +3 -2
- package/lib/global/js/utils/checkForOverflow.js +23 -0
- package/lib/global/js/utils/makeDraggable/index.d.ts +1 -0
- package/lib/global/js/utils/makeDraggable/makeDraggable.d.ts +19 -0
- package/lib/global/js/utils/makeDraggable/makeDraggable.js +93 -0
- package/lib/global/js/utils/makeDraggable/makeDraggable.stories.d.ts +22 -0
- package/lib/index.js +10 -3
- package/lib/node_modules/@floating-ui/core/dist/floating-ui.core.js +600 -0
- package/lib/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +722 -0
- package/lib/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +102 -0
- package/lib/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +182 -0
- package/lib/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +164 -0
- package/lib/settings.d.ts +2 -1
- package/package.json +9 -10
- package/scss/components/{BigNumbers/_big-numbers.scss → BigNumber/_big-number.scss} +5 -5
- package/scss/components/{BigNumbers → BigNumber}/_carbon-imports.scss +3 -3
- package/scss/components/{BigNumbers → BigNumber}/_index-with-carbon.scss +2 -2
- package/scss/components/{BigNumbers → BigNumber}/_index.scss +2 -2
- package/scss/components/Card/_card.scss +2 -0
- package/scss/components/Coachmark/_bubble.scss +62 -0
- package/scss/components/Coachmark/_coachmark-beacon.scss +164 -0
- package/scss/components/Coachmark/_coachmark.scss +15 -0
- package/scss/components/ConditionBuilder/_condition-builder.scss +8 -0
- package/scss/components/PageHeader/_page-header.scss +144 -1
- package/scss/components/Tearsheet/_tearsheet.scss +6 -0
- package/scss/components/TruncatedText/_carbon-imports.scss +6 -0
- package/scss/components/TruncatedText/_index-with-carbon.scss +9 -0
- package/scss/components/TruncatedText/_index.scss +8 -0
- package/scss/components/TruncatedText/_truncated-text.scss +26 -0
- package/scss/components/_index-with-carbon.scss +3 -2
- package/scss/components/_index.scss +3 -2
- package/telemetry.yml +24 -5
- package/es/components/BigNumbers/BigNumbersSkeleton.d.ts +0 -17
- package/lib/components/BigNumbers/BigNumbersSkeleton.d.ts +0 -17
package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js
CHANGED
@@ -28,7 +28,7 @@ const ItemOption = _ref => {
|
|
28
28
|
const {
|
29
29
|
conditionBuilderRef
|
30
30
|
} = useContext(ConditionBuilderContext);
|
31
|
-
const allOptions = config
|
31
|
+
const allOptions = config?.options;
|
32
32
|
const [searchValue, setSearchValue] = useState('');
|
33
33
|
const selection = conditionState.value;
|
34
34
|
const filteredItems = searchValue ? allOptions?.filter(opt => opt.label?.toLowerCase().includes(searchValue.toLowerCase())) : allOptions;
|
@@ -95,7 +95,7 @@ const ItemOption = _ref => {
|
|
95
95
|
className: `${blockClass}__item-option__option-content`
|
96
96
|
}, /*#__PURE__*/React__default.createElement("span", {
|
97
97
|
className: `${blockClass}__item-option__option-label`
|
98
|
-
}, Icon && /*#__PURE__*/React__default.createElement(Icon, null), config
|
98
|
+
}, Icon && /*#__PURE__*/React__default.createElement(Icon, null), config?.isStatement ? getStatementContent(option) : option.label), isSelected && /*#__PURE__*/React__default.createElement(Checkmark, {
|
99
99
|
className: `${blockClass}__checkmark`
|
100
100
|
})));
|
101
101
|
})));
|
@@ -32,7 +32,7 @@ const ItemOptionForValueField = _ref => {
|
|
32
32
|
conditionBuilderRef
|
33
33
|
} = useContext(ConditionBuilderContext);
|
34
34
|
const contentRef = useRef(null);
|
35
|
-
const [allOptions, setAllOptions] = useState(config
|
35
|
+
const [allOptions, setAllOptions] = useState(config?.options);
|
36
36
|
const [searchValue, setSearchValue] = useState('');
|
37
37
|
const filteredItems = allOptions?.filter(opt => opt.label.toLowerCase().includes(searchValue.toLowerCase()));
|
38
38
|
const selection = Array.isArray(conditionState.value) ? conditionState.value : conditionState.value !== undefined ? [conditionState.value] : [];
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
-
import React__default, { useContext, useState, useRef, Fragment } from 'react';
|
8
|
+
import React__default, { useContext, useState, useRef, useEffect, Fragment } from 'react';
|
9
9
|
import ConditionBlock from '../ConditionBlock/ConditionBlock.js';
|
10
10
|
import PropTypes from '../../../_virtual/index.js';
|
11
11
|
import cx from 'classnames';
|
@@ -47,6 +47,45 @@ const ConditionGroupBuilder = _ref => {
|
|
47
47
|
const [showConditionSubGroupPreview, setShowConditionSubGroupPreview] = useState(-1);
|
48
48
|
useState(false);
|
49
49
|
const conditionBuilderContentRef = useRef(null);
|
50
|
+
const scrollParentRef = useRef(null);
|
51
|
+
useEffect(() => {
|
52
|
+
// getting scrollable parent initially
|
53
|
+
if (typeof conditionBuilderRef !== 'function' && conditionBuilderRef?.current) {
|
54
|
+
scrollParentRef.current = getScrollableParent(conditionBuilderRef.current);
|
55
|
+
}
|
56
|
+
}, [conditionBuilderRef]);
|
57
|
+
useEffect(() => {
|
58
|
+
// This fix addresses a flickering issue when hovering over "Add Condition" or "Add Subgroup".
|
59
|
+
// On hover, the component inserts a preview element below, ideally pushing the layout downward to create space.
|
60
|
+
// However, if the container is scrolled to the bottom, the layout may instead shift content upward,
|
61
|
+
// breaking the hover chain and causing the preview to flicker.
|
62
|
+
// Fix: When showing the preview on hover, if the scroll position is at the bottom,
|
63
|
+
// scrolling up by 1px prevents layout shift from breaking the hover chain and eliminates flickering.
|
64
|
+
|
65
|
+
const parent = scrollParentRef.current;
|
66
|
+
let atBottom = false;
|
67
|
+
if (parent instanceof Window || parent === document.body || parent === document.documentElement) {
|
68
|
+
atBottom = window.innerHeight + window.scrollY >= document.body.scrollHeight;
|
69
|
+
} else if (scrollParentRef.current) {
|
70
|
+
const parent = scrollParentRef.current;
|
71
|
+
atBottom = parent.scrollTop + parent.clientHeight >= parent.scrollHeight;
|
72
|
+
}
|
73
|
+
if ((showConditionPreview || showConditionSubGroupPreview) && atBottom) {
|
74
|
+
scrollParentRef.current?.scrollBy(0, -1);
|
75
|
+
}
|
76
|
+
}, [showConditionPreview, showConditionSubGroupPreview]);
|
77
|
+
const getScrollableParent = element => {
|
78
|
+
while (element && element !== document.body) {
|
79
|
+
const style = getComputedStyle(element);
|
80
|
+
const overflowY = style.overflowY;
|
81
|
+
const isScrollable = overflowY === 'auto' || overflowY === 'scroll' || overflowY === 'overlay';
|
82
|
+
if (isScrollable && element.scrollHeight > element.clientHeight) {
|
83
|
+
return element;
|
84
|
+
}
|
85
|
+
element = element.parentElement;
|
86
|
+
}
|
87
|
+
return window; // fallback to window
|
88
|
+
};
|
50
89
|
const onRemoveHandler = (conditionId, evt, conditionIndex) => {
|
51
90
|
if (group && group.conditions && group.conditions.length > 1) {
|
52
91
|
if (variant == HIERARCHICAL_VARIANT) {
|
@@ -327,10 +366,10 @@ const ConditionGroupBuilder = _ref => {
|
|
327
366
|
},
|
328
367
|
hideConditionPreviewHandler: hideConditionPreviewHandler,
|
329
368
|
isLastCondition: isLastCondition
|
330
|
-
})), conditionIndex
|
369
|
+
})), conditionIndex === showConditionSubGroupPreview && (_ConditionPreview || (_ConditionPreview = /*#__PURE__*/React__default.createElement(ConditionPreview, {
|
331
370
|
previewType: "subGroup",
|
332
371
|
group: group
|
333
|
-
}))), conditionIndex
|
372
|
+
}))), conditionIndex === showConditionPreview && (_ConditionPreview2 || (_ConditionPreview2 = /*#__PURE__*/React__default.createElement(ConditionPreview, {
|
334
373
|
previewType: "condition",
|
335
374
|
group: group
|
336
375
|
}))))));
|
@@ -10,10 +10,12 @@ interface ConditionPreviewProps {
|
|
10
10
|
previewType: 'newGroup' | 'subGroup' | 'condition';
|
11
11
|
group: ConditionGroup;
|
12
12
|
colorIndex?: number;
|
13
|
+
className?: string;
|
13
14
|
}
|
14
15
|
declare const ConditionPreview: {
|
15
|
-
({ previewType, group, colorIndex, }: ConditionPreviewProps): React.JSX.Element;
|
16
|
+
({ previewType, group, colorIndex, className, }: ConditionPreviewProps): React.JSX.Element;
|
16
17
|
propTypes: {
|
18
|
+
className: any;
|
17
19
|
/**
|
18
20
|
* index of the color for next group
|
19
21
|
*/
|
@@ -19,7 +19,8 @@ const ConditionPreview = _ref => {
|
|
19
19
|
let {
|
20
20
|
previewType,
|
21
21
|
group,
|
22
|
-
colorIndex
|
22
|
+
colorIndex,
|
23
|
+
className
|
23
24
|
} = _ref;
|
24
25
|
const [animate, setAnimate] = useState(false);
|
25
26
|
const [propertyText, operatorText, valueText, ifText] = useTranslations(['valueText', 'operatorText', 'propertyText', 'ifText']);
|
@@ -39,7 +40,7 @@ const ConditionPreview = _ref => {
|
|
39
40
|
})));
|
40
41
|
};
|
41
42
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, previewType == 'newGroup' && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
42
|
-
className: cx([`${blockClass}__group__row ${blockClass}__group-preview `, {
|
43
|
+
className: cx([`${blockClass}__group__row ${blockClass}__group-preview ${className}`, {
|
43
44
|
[`${blockClass}__group-preview-animate`]: animate
|
44
45
|
}])
|
45
46
|
}, /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
|
@@ -48,7 +49,7 @@ const ConditionPreview = _ref => {
|
|
48
49
|
})), /*#__PURE__*/React__default.createElement("div", {
|
49
50
|
"data-color-index": colorIndex,
|
50
51
|
"aria-hidden": true,
|
51
|
-
className: cx([`${blockClass}__group
|
52
|
+
className: cx([`${blockClass}__group ${blockClass}__condition-wrapper ${blockClass}__group-preview ${blockClass}__group-wrapper ${className}`, {
|
52
53
|
[`${blockClass}__group-preview-animate`]: animate
|
53
54
|
}])
|
54
55
|
}, /*#__PURE__*/React__default.createElement("div", {
|
@@ -84,6 +85,7 @@ const ConditionPreview = _ref => {
|
|
84
85
|
}), getConditionSection())));
|
85
86
|
};
|
86
87
|
ConditionPreview.propTypes = {
|
88
|
+
className: PropTypes.string,
|
87
89
|
/**
|
88
90
|
* index of the color for next group
|
89
91
|
*/
|
@@ -0,0 +1,8 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
import { RefObject } from 'react';
|
8
|
+
export declare const useEvent: <E extends keyof GlobalEventHandlersEventMap>(elementOrRef: HTMLElement | RefObject<Element | null>, eventName: E, callback: (event: GlobalEventHandlersEventMap[E]) => void) => void;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 2025
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import { useRef, useEffect } from 'react';
|
9
|
+
|
10
|
+
const useEvent = (elementOrRef, eventName, callback) => {
|
11
|
+
const savedCallback = useRef(null);
|
12
|
+
useEffect(() => {
|
13
|
+
savedCallback.current = callback;
|
14
|
+
}, [callback]);
|
15
|
+
useEffect(() => {
|
16
|
+
const element = 'current' in elementOrRef ? elementOrRef.current : elementOrRef;
|
17
|
+
if (!element) {
|
18
|
+
return;
|
19
|
+
}
|
20
|
+
const handler = event => {
|
21
|
+
if (savedCallback.current) {
|
22
|
+
savedCallback.current(event);
|
23
|
+
}
|
24
|
+
};
|
25
|
+
element.addEventListener(eventName, handler);
|
26
|
+
return () => {
|
27
|
+
element.removeEventListener(eventName, handler);
|
28
|
+
};
|
29
|
+
}, [elementOrRef, eventName]);
|
30
|
+
};
|
31
|
+
|
32
|
+
export { useEvent };
|
@@ -17,7 +17,7 @@ const useTranslations = (translationKeys, alterTranslationKeyMap) => {
|
|
17
17
|
if (alterTranslationKeyMap?.[translationKey]) {
|
18
18
|
translationKey = alterTranslationKeyMap[translationKey];
|
19
19
|
}
|
20
|
-
if (translateWithId?.(translationKey)) {
|
20
|
+
if (translateWithId?.(translationKey) && translateWithId?.(translationKey) !== translationKey) {
|
21
21
|
return translateWithId(translationKey);
|
22
22
|
} else if (translationsObject[translationKey]) {
|
23
23
|
return translationsObject[translationKey];
|
@@ -179,7 +179,6 @@ let EditInPlace = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
179
179
|
label: cancelLabel,
|
180
180
|
onClick: onCancelHandler,
|
181
181
|
kind: "ghost",
|
182
|
-
tabIndex: 0,
|
183
182
|
key: "cancel",
|
184
183
|
className: `${blockClass}__btn ${blockClass}__btn-cancel`
|
185
184
|
}, _Close || (_Close = /*#__PURE__*/React__default.createElement(Close, {
|
@@ -190,7 +189,6 @@ let EditInPlace = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
190
189
|
label: saveLabel,
|
191
190
|
onClick: onSaveHandler,
|
192
191
|
kind: "ghost",
|
193
|
-
tabIndex: 0,
|
194
192
|
key: "save",
|
195
193
|
className: `${blockClass}__btn ${blockClass}__btn-save`,
|
196
194
|
disabled: !canSave
|
@@ -205,7 +203,6 @@ let EditInPlace = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
205
203
|
label: editLabel,
|
206
204
|
onClick: onFocusHandler,
|
207
205
|
kind: "ghost",
|
208
|
-
tabIndex: 0,
|
209
206
|
key: "edit"
|
210
207
|
}, _Edit || (_Edit = /*#__PURE__*/React__default.createElement(Edit, {
|
211
208
|
size: 16
|
@@ -67,8 +67,8 @@ export interface EmptyStateProps {
|
|
67
67
|
*/
|
68
68
|
title: string | ReactNode;
|
69
69
|
/**
|
70
|
-
* Designates which version of the EmptyState component is being used.
|
71
|
-
*
|
70
|
+
* **Deprecated:** Designates which version of the EmptyState component is being used. Refer to V2 documentation separately.
|
71
|
+
* @deprecated
|
72
72
|
*/
|
73
73
|
v2?: boolean;
|
74
74
|
}
|
@@ -8,12 +8,6 @@
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
import React__default from 'react';
|
10
10
|
import { EmptyStateV2 } from './EmptyStateV2.js';
|
11
|
-
import './ErrorEmptyState/ErrorEmptyState.js';
|
12
|
-
import './NoDataEmptyState/NoDataEmptyState.js';
|
13
|
-
import './NoTagsEmptyState/NoTagsEmptyState.js';
|
14
|
-
import './NotFoundEmptyState/NotFoundEmptyState.js';
|
15
|
-
import './NotificationsEmptyState/NotificationsEmptyState.js';
|
16
|
-
import './UnauthorizedEmptyState/UnauthorizedEmptyState.js';
|
17
11
|
import PropTypes from '../../_virtual/index.js';
|
18
12
|
import cx from 'classnames';
|
19
13
|
import { Button } from '@carbon/react';
|
@@ -138,8 +132,8 @@ EmptyState.propTypes = {
|
|
138
132
|
*/
|
139
133
|
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
|
140
134
|
/**
|
141
|
-
* Designates which version of the EmptyState component is being used.
|
142
|
-
*
|
135
|
+
* **Deprecated:** Designates which version of the EmptyState component is being used. Refer to V2 documentation separately.
|
136
|
+
* @deprecated
|
143
137
|
*/
|
144
138
|
v2: PropTypes.bool
|
145
139
|
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export { FilterPanelGroup } from "./FilterPanelGroup";
|
@@ -8,8 +8,7 @@ import React, { ReactNode, RefObject } from 'react';
|
|
8
8
|
import { InterstitialScreenHeaderProps } from './InterstitialScreenHeader';
|
9
9
|
import { InterstitialScreenBodyProps } from './InterstitialScreenBody';
|
10
10
|
import { InterstitialScreenFooterProps } from './InterstitialScreenFooter';
|
11
|
-
|
12
|
-
export type ActionType = 'close' | 'start' | 'skip' | 'back' | 'next';
|
11
|
+
import { ActionType } from './context';
|
13
12
|
export interface InterstitialScreenProps {
|
14
13
|
/**
|
15
14
|
* Provide the contents of the InterstitialScreen.
|
@@ -46,28 +45,6 @@ export type InterstitialScreenComponent = React.ForwardRefExoticComponent<Inters
|
|
46
45
|
Body: React.FC<InterstitialScreenBodyProps>;
|
47
46
|
Footer: React.FC<InterstitialScreenFooterProps>;
|
48
47
|
};
|
49
|
-
export type disableButtonConfigType = {
|
50
|
-
skip?: boolean;
|
51
|
-
back?: boolean;
|
52
|
-
next?: boolean;
|
53
|
-
start?: boolean;
|
54
|
-
};
|
55
|
-
interface InterstitialScreenContextType {
|
56
|
-
bodyChildrenData?: ReactNode;
|
57
|
-
setBodyChildrenData?: (value: ReactNode) => void;
|
58
|
-
isFullScreen?: boolean;
|
59
|
-
handleClose?: (value: ActionType) => void;
|
60
|
-
progStep: number;
|
61
|
-
setProgStep?: (value: number) => void;
|
62
|
-
bodyScrollRef?: RefObject<HTMLDivElement | null>;
|
63
|
-
scrollRef?: RefObject<HTMLDivElement>;
|
64
|
-
handleGotoStep?: (value: number) => void;
|
65
|
-
stepCount: number;
|
66
|
-
setStepCount?: (value: number) => void;
|
67
|
-
disableButtonConfig?: disableButtonConfigType;
|
68
|
-
setDisableButtonConfig?: (value: disableButtonConfigType) => void;
|
69
|
-
}
|
70
|
-
export declare const InterstitialScreenContext: React.Context<InterstitialScreenContextType>;
|
71
48
|
/**
|
72
49
|
* InterstitialScreen can be a full page or an overlay, and are
|
73
50
|
* shown on the first time a user accesses a new experience
|
@@ -75,4 +52,3 @@ export declare const InterstitialScreenContext: React.Context<InterstitialScreen
|
|
75
52
|
* newly purchased capability is presented).
|
76
53
|
*/
|
77
54
|
export declare let InterstitialScreen: InterstitialScreenComponent;
|
78
|
-
export {};
|
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
import { unstable_FeatureFlags, ComposedModal } from '@carbon/react';
|
10
|
-
import React__default, {
|
10
|
+
import React__default, { useRef, useState, useCallback, useEffect } from 'react';
|
11
11
|
import PropTypes from '../../_virtual/index.js';
|
12
12
|
import cx from 'classnames';
|
13
13
|
import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
@@ -15,28 +15,12 @@ import { pkg } from '../../settings.js';
|
|
15
15
|
import InterstitialScreenHeader from './InterstitialScreenHeader.js';
|
16
16
|
import InterstitialScreenBody from './InterstitialScreenBody.js';
|
17
17
|
import InterstitialScreenFooter from './InterstitialScreenFooter.js';
|
18
|
+
import { InterstitialScreenContext, blockClass } from './context.js';
|
18
19
|
|
19
|
-
// The block part of our conventional BEM class names (blockClass__E--M).
|
20
|
-
const blockClass = `${pkg.prefix}--interstitial-screen`;
|
21
20
|
const componentName = 'InterstitialScreen';
|
22
21
|
|
23
|
-
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
24
|
-
|
25
|
-
// Default values can be included here and then assigned to the prop params,
|
26
|
-
// e.g. prop = defaults.prop,
|
27
|
-
// This gathers default values together neatly and ensures non-primitive
|
28
|
-
// values are initialized early to avoid react making unnecessary re-renders.
|
29
|
-
// Note that default values are not required for props that are 'required',
|
30
|
-
// nor for props where the component can apply undefined values reasonably.
|
31
|
-
// Default values should be provided when the component needs to make a choice
|
32
|
-
// or assumption when a prop is not supplied.
|
33
|
-
|
34
22
|
// Define the type for InterstitialScreen, extending it to include Header
|
35
23
|
|
36
|
-
const InterstitialScreenContext = /*#__PURE__*/createContext({
|
37
|
-
progStep: 0,
|
38
|
-
stepCount: 0
|
39
|
-
});
|
40
24
|
/**
|
41
25
|
* InterstitialScreen can be a full page or an overlay, and are
|
42
26
|
* shown on the first time a user accesses a new experience
|
@@ -213,4 +197,4 @@ InterstitialScreen.propTypes = {
|
|
213
197
|
open: PropTypes.bool
|
214
198
|
};
|
215
199
|
|
216
|
-
export { InterstitialScreen
|
200
|
+
export { InterstitialScreen };
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
import React, { ReactElement, ReactNode } from 'react';
|
8
|
-
import { disableButtonConfigType } from './
|
8
|
+
import { disableButtonConfigType } from './context';
|
9
9
|
import { EnrichedChildren } from './InterstitialScreenHeader';
|
10
10
|
type contentRendererArgs = {
|
11
11
|
handleGotoStep?: (value: number) => void;
|
@@ -8,7 +8,7 @@
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
import React__default, { useState, useContext, useEffect, isValidElement } from 'react';
|
10
10
|
import PropTypes from '../../_virtual/index.js';
|
11
|
-
import { InterstitialScreenContext, blockClass } from './
|
11
|
+
import { InterstitialScreenContext, blockClass } from './context.js';
|
12
12
|
import { ModalBody } from '@carbon/react';
|
13
13
|
import { Carousel } from '../Carousel/Carousel.js';
|
14
14
|
import '../Carousel/CarouselItem.js';
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
import React from 'react';
|
8
|
-
import { ActionType, disableButtonConfigType } from './
|
8
|
+
import { ActionType, disableButtonConfigType } from './context';
|
9
9
|
type actionButtonRendererArgs = {
|
10
10
|
handleGotoStep?: (value: number) => void;
|
11
11
|
progStep?: number;
|
@@ -8,7 +8,7 @@
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
import React__default, { useContext, useRef, useState, useEffect, useMemo } from 'react';
|
10
10
|
import PropTypes from '../../_virtual/index.js';
|
11
|
-
import { InterstitialScreenContext, blockClass } from './
|
11
|
+
import { InterstitialScreenContext, blockClass } from './context.js';
|
12
12
|
import { ModalFooter, Button, InlineLoading } from '@carbon/react';
|
13
13
|
import { clamp } from '../../global/js/utils/clamp.js';
|
14
14
|
import { ArrowRight } from '@carbon/react/icons';
|
@@ -1,3 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2024, 2025
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
1
7
|
import React from 'react';
|
2
8
|
export interface InterstitialScreenHeaderProps {
|
3
9
|
/**
|
@@ -10,7 +10,7 @@ import { usePrefix, ModalHeader, ProgressIndicator, ProgressStep } from '@carbon
|
|
10
10
|
import React__default from 'react';
|
11
11
|
import PropTypes from '../../_virtual/index.js';
|
12
12
|
import cx from 'classnames';
|
13
|
-
import { InterstitialScreenContext, blockClass } from './
|
13
|
+
import { InterstitialScreenContext, blockClass } from './context.js';
|
14
14
|
import { useId } from '../../global/js/utils/useId.js';
|
15
15
|
import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
16
16
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
import React from 'react';
|
8
|
-
import { disableButtonConfigType } from '../../
|
8
|
+
import { disableButtonConfigType } from '../../context';
|
9
9
|
import './_interstitial-screen-view-module.scss';
|
10
10
|
export interface InterstitialScreenViewModuleProps {
|
11
11
|
/**
|
@@ -0,0 +1,31 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2025, 2025
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
import { ReactNode, RefObject } from 'react';
|
8
|
+
export type ActionType = 'close' | 'start' | 'skip' | 'back' | 'next';
|
9
|
+
export type disableButtonConfigType = {
|
10
|
+
skip?: boolean;
|
11
|
+
back?: boolean;
|
12
|
+
next?: boolean;
|
13
|
+
start?: boolean;
|
14
|
+
};
|
15
|
+
export interface InterstitialScreenContextType {
|
16
|
+
bodyChildrenData?: ReactNode;
|
17
|
+
setBodyChildrenData?: (value: ReactNode) => void;
|
18
|
+
isFullScreen?: boolean;
|
19
|
+
handleClose?: (value: ActionType) => void;
|
20
|
+
progStep: number;
|
21
|
+
setProgStep?: (value: number) => void;
|
22
|
+
bodyScrollRef?: RefObject<HTMLDivElement | null>;
|
23
|
+
scrollRef?: RefObject<HTMLDivElement>;
|
24
|
+
handleGotoStep?: (value: number) => void;
|
25
|
+
stepCount: number;
|
26
|
+
setStepCount?: (value: number) => void;
|
27
|
+
disableButtonConfig?: disableButtonConfigType;
|
28
|
+
setDisableButtonConfig?: (value: disableButtonConfigType) => void;
|
29
|
+
}
|
30
|
+
export declare const blockClass: string;
|
31
|
+
export declare const InterstitialScreenContext: import("react").Context<InterstitialScreenContextType>;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 2025
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import { createContext } from 'react';
|
9
|
+
import { pkg } from '../../settings.js';
|
10
|
+
|
11
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
12
|
+
const blockClass = `${pkg.prefix}--interstitial-screen`;
|
13
|
+
const InterstitialScreenContext = /*#__PURE__*/createContext({
|
14
|
+
progStep: 0,
|
15
|
+
stepCount: 0
|
16
|
+
});
|
17
|
+
|
18
|
+
export { InterstitialScreenContext, blockClass };
|
@@ -1,11 +1,12 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright IBM Corp. 2024,
|
2
|
+
* Copyright IBM Corp. 2024, 2025
|
3
3
|
*
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
export { InterstitialScreen } from './InterstitialScreen';
|
8
|
-
export type { InterstitialScreenProps, InterstitialScreenComponent,
|
8
|
+
export type { InterstitialScreenProps, InterstitialScreenComponent, } from './InterstitialScreen';
|
9
|
+
export type { disableButtonConfigType, ActionType } from './context';
|
9
10
|
export type { InterstitialScreenBodyProps } from './InterstitialScreenBody';
|
10
11
|
export type { InterstitialScreenFooterProps } from './InterstitialScreenFooter';
|
11
12
|
export type { InterstitialScreenHeaderProps } from './InterstitialScreenHeader';
|
@@ -28,6 +28,7 @@ import { useId } from '../../global/js/utils/useId.js';
|
|
28
28
|
import { pkg } from '../../settings.js';
|
29
29
|
import { timeAgo } from './utils.js';
|
30
30
|
import { usePresence } from '../../global/js/hooks/usePresence.js';
|
31
|
+
import { useClickOutside } from '../../global/js/hooks/useClickOutside.js';
|
31
32
|
|
32
33
|
var _Close;
|
33
34
|
|
@@ -133,6 +134,7 @@ let NotificationsPanel = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
133
134
|
const supportedLocale = getSupportedLocale(dateTimeLocale, DefaultLocale);
|
134
135
|
usePrefix();
|
135
136
|
const headingId = useId();
|
137
|
+
const isClickOnTrigger = useRef(false);
|
136
138
|
const reducedMotion = usePrefersReducedMotion();
|
137
139
|
const exitAnimationName = reducedMotion ? 'notifications-panel-exit-reduced' : 'notifications-panel-fade-out';
|
138
140
|
const {
|
@@ -142,17 +144,28 @@ let NotificationsPanel = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
142
144
|
// Set the notifications passed to the state within this component
|
143
145
|
setAllNotifications(data);
|
144
146
|
}, [data]);
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
147
|
+
useEffect(() => {
|
148
|
+
const button = triggerButtonRef?.current;
|
149
|
+
const handleClick = () => {
|
150
|
+
isClickOnTrigger.current = true;
|
151
|
+
};
|
152
|
+
button?.addEventListener('click', handleClick, true);
|
153
|
+
return () => {
|
154
|
+
button?.removeEventListener('click', handleClick, true);
|
155
|
+
};
|
156
|
+
}, [triggerButtonRef]);
|
157
|
+
useClickOutside(ref || notificationPanelRef, target => {
|
158
|
+
const element = target;
|
159
|
+
if (!isClickOnTrigger.current) {
|
160
|
+
if (!isActionableElement(element)) {
|
161
|
+
setTimeout(() => {
|
162
|
+
triggerButtonRef?.current?.focus();
|
163
|
+
}, 100);
|
164
|
+
}
|
165
|
+
onClickOutside?.();
|
166
|
+
}
|
167
|
+
isClickOnTrigger.current = false;
|
168
|
+
});
|
156
169
|
const handleKeydown = event => {
|
157
170
|
event.stopPropagation();
|
158
171
|
if (event.key === 'Escape') {
|
@@ -310,6 +323,17 @@ let NotificationsPanel = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
310
323
|
size: 16
|
311
324
|
}))));
|
312
325
|
};
|
326
|
+
const isActionableElement = el => {
|
327
|
+
if (!el) {
|
328
|
+
return false;
|
329
|
+
}
|
330
|
+
const interactiveRoles = new Set(['button', 'link', 'textbox', 'checkbox', 'radio', 'slider', 'spinbutton', 'combobox', 'switch', 'menuitem']);
|
331
|
+
const actionableAncestor = el.closest('button, a, input, select, textarea, [tabindex], [contenteditable="true"], [role]');
|
332
|
+
if (!actionableAncestor) {
|
333
|
+
return false;
|
334
|
+
}
|
335
|
+
return actionableAncestor instanceof HTMLButtonElement || actionableAncestor instanceof HTMLAnchorElement || actionableAncestor instanceof HTMLInputElement || actionableAncestor instanceof HTMLSelectElement || actionableAncestor instanceof HTMLTextAreaElement || actionableAncestor.tabIndex >= 0 || actionableAncestor.isContentEditable || interactiveRoles.has(actionableAncestor.getAttribute('role')?.toLowerCase() ?? '');
|
336
|
+
};
|
313
337
|
const dismissSingleNotification = (event, notification) => {
|
314
338
|
event.preventDefault();
|
315
339
|
event.stopPropagation();
|
@@ -322,8 +346,7 @@ let NotificationsPanel = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
322
346
|
as: "div",
|
323
347
|
role: "dialog",
|
324
348
|
"aria-labelledby": headingId,
|
325
|
-
onKeyDown: handleKeydown
|
326
|
-
tabIndex: 0
|
349
|
+
onKeyDown: handleKeydown
|
327
350
|
}, rest, {
|
328
351
|
id: blockClass,
|
329
352
|
className: cx(blockClass, className, `${blockClass}__container`, {
|
@@ -293,7 +293,8 @@ export type PageHeaderProps = PageHeaderBaseProps & PageActionProps & CollapseHe
|
|
293
293
|
export declare let PageHeader: React.ForwardRefExoticComponent<PageHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
294
294
|
export declare const deprecatedProps: {
|
295
295
|
/**
|
296
|
-
* **Deprecated**
|
296
|
+
* **Deprecated**
|
297
|
+
* see property `enableBreadcrumbScroll`
|
297
298
|
*/
|
298
299
|
disableBreadcrumbScroll: (props: any, propName: any, comp: any, loc: any, propFullName: any, secret: any) => any;
|
299
300
|
/**
|
@@ -552,7 +552,8 @@ const TYPES = {
|
|
552
552
|
const tagTypes = Object.keys(TYPES);
|
553
553
|
const deprecatedProps = {
|
554
554
|
/**
|
555
|
-
* **Deprecated**
|
555
|
+
* **Deprecated**
|
556
|
+
* see property `enableBreadcrumbScroll`
|
556
557
|
*/
|
557
558
|
disableBreadcrumbScroll: deprecateProp(PropTypes.bool, 'Property replaced by `enableBreadcrumbScroll`'),
|
558
559
|
/**
|
@@ -1,10 +1,11 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright IBM Corp. 2025
|
2
|
+
* Copyright IBM Corp. 2025, 2025
|
3
3
|
*
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
import React, { type ComponentType, type FunctionComponent } from 'react';
|
8
|
+
import { IconButtonProps, BreadcrumbItemProps, BreadcrumbProps } from '@carbon/react';
|
8
9
|
import { TYPES } from '@carbon/react/es/components/Tag/Tag';
|
9
10
|
/**
|
10
11
|
* ----------
|
@@ -208,8 +209,19 @@ interface PageHeaderTabBarProps {
|
|
208
209
|
children?: React.ReactNode;
|
209
210
|
className?: string;
|
210
211
|
tags?: TagItem[];
|
212
|
+
scroller?: React.ReactNode;
|
211
213
|
}
|
212
214
|
declare const PageHeaderTabBar: React.ForwardRefExoticComponent<PageHeaderTabBarProps & React.RefAttributes<HTMLDivElement>>;
|
215
|
+
interface PageHeaderScrollButtonProps extends IconButtonProps {
|
216
|
+
collapseText?: string;
|
217
|
+
expandText?: string;
|
218
|
+
}
|
219
|
+
declare const PageHeaderScrollButton: React.ForwardRefExoticComponent<PageHeaderScrollButtonProps & React.RefAttributes<HTMLDivElement>>;
|
220
|
+
declare const PageHeaderTitleBreadcrumb: React.ForwardRefExoticComponent<BreadcrumbItemProps & React.RefAttributes<HTMLLIElement>>;
|
221
|
+
interface PageHeaderBreadcrumbOverflowProps extends BreadcrumbProps {
|
222
|
+
renderOverflowBreadcrumb?: (hiddenBreadcrumbs: HTMLElement[]) => React.ReactElement<BreadcrumbItemProps>;
|
223
|
+
}
|
224
|
+
declare const PageHeaderBreadcrumbOverflow: React.ForwardRefExoticComponent<PageHeaderBreadcrumbOverflowProps & React.RefAttributes<HTMLElement>>;
|
213
225
|
/**
|
214
226
|
* -------
|
215
227
|
* Exports
|
@@ -273,5 +285,8 @@ declare const HeroImage: {
|
|
273
285
|
};
|
274
286
|
};
|
275
287
|
declare const TabBar: React.ForwardRefExoticComponent<PageHeaderTabBarProps & React.RefAttributes<HTMLDivElement>>;
|
276
|
-
|
277
|
-
|
288
|
+
declare const ScrollButton: React.ForwardRefExoticComponent<PageHeaderScrollButtonProps & React.RefAttributes<HTMLDivElement>>;
|
289
|
+
declare const TitleBreadcrumb: React.ForwardRefExoticComponent<BreadcrumbItemProps & React.RefAttributes<HTMLLIElement>>;
|
290
|
+
declare const BreadcrumbOverflow: React.ForwardRefExoticComponent<PageHeaderBreadcrumbOverflowProps & React.RefAttributes<HTMLElement>>;
|
291
|
+
export { PageHeader, PageHeaderBreadcrumbBar, PageHeaderContent, PageHeaderContentPageActions, PageHeaderContentText, PageHeaderHeroImage, PageHeaderTabBar, PageHeaderScrollButton, PageHeaderTitleBreadcrumb, PageHeaderBreadcrumbOverflow, Root, BreadcrumbBar, Content, ContentPageActions, ContentText, HeroImage, TabBar, ScrollButton, TitleBreadcrumb, BreadcrumbOverflow, };
|
292
|
+
export type { PageHeaderProps, PageHeaderBreadcrumbBarProps, PageHeaderContentProps, PageHeaderContentPageActionsProps, PageHeaderContentTextProps, PageHeaderHeroImageProps, PageHeaderTabBarProps, PageHeaderScrollButtonProps, };
|