@carbon/ibm-products 2.88.0 → 2.89.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 +17 -4
- package/css/carbon.css.map +1 -1
- package/css/index-full-carbon.css +106 -33
- 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 +54 -29
- 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 +89 -29
- 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 +104 -32
- 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/AboutModal/AboutModal.d.ts.map +1 -1
- package/es/components/AboutModal/AboutModal.js +2 -2
- package/es/components/Coachmark/next/Coachmark/Coachmark.d.ts +17 -0
- package/es/components/Coachmark/next/Coachmark/Coachmark.d.ts.map +1 -1
- package/es/components/Coachmark/next/Coachmark/Coachmark.js +35 -5
- package/es/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts +1 -9
- package/es/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts.map +1 -1
- package/es/components/Coachmark/next/Coachmark/CoachmarkContent.js +48 -47
- package/es/components/Coachmark/next/Coachmark/CoachmarkTagline/CoachmarkTagline.js +4 -1
- package/es/components/Coachmark/next/Coachmark/ContentHeader.d.ts.map +1 -1
- package/es/components/Coachmark/next/Coachmark/ContentHeader.js +26 -11
- package/es/components/Coachmark/next/Coachmark/context.d.ts +1 -0
- package/es/components/Coachmark/next/Coachmark/context.d.ts.map +1 -1
- package/es/components/ConditionBuilder/ConditionBuilder.types.d.ts +1 -1
- package/es/components/ConditionBuilder/ConditionBuilder.types.d.ts.map +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts.map +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +4 -15
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts.map +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +22 -15
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts.map +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +6 -3
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts.map +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +9 -3
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts.map +1 -1
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +4 -14
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +1 -1
- package/es/components/DelimitedList/DelimitedList.d.ts +1 -0
- package/es/components/DelimitedList/DelimitedList.d.ts.map +1 -1
- package/es/components/DelimitedList/DelimitedList.js +6 -0
- package/es/components/StringFormatter/StringFormatter.d.ts +1 -0
- package/es/components/StringFormatter/StringFormatter.d.ts.map +1 -1
- package/es/components/StringFormatter/StringFormatter.js +6 -0
- package/es/components/Tearsheet/next/Tearsheet.d.ts.map +1 -1
- package/es/components/Tearsheet/next/Tearsheet.js +6 -9
- package/es/components/Tearsheet/next/TearsheetBody.d.ts.map +1 -1
- package/es/components/Tearsheet/next/TearsheetBody.js +5 -2
- package/es/components/Tearsheet/next/TearsheetHeader.d.ts +1 -1
- package/es/components/Tearsheet/next/TearsheetHeader.d.ts.map +1 -1
- package/es/components/Tearsheet/next/TearsheetHeader.js +11 -10
- package/es/components/Tearsheet/next/TearsheetHeaderContent.d.ts.map +1 -1
- package/es/components/Tearsheet/next/TearsheetHeaderContent.js +26 -7
- package/es/components/Tearsheet/next/context.d.ts +4 -2
- package/es/components/Tearsheet/next/context.d.ts.map +1 -1
- package/es/components/Tearsheet/next/context.js +4 -2
- package/es/global/js/hooks/useCollapsible.d.ts.map +1 -1
- package/es/global/js/hooks/useCollapsible.js +7 -5
- package/es/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/es/index.js +1 -1
- package/es/node_modules/@carbon/icons-react/es/Icon.js +1 -1
- package/es/settings.js +8 -2
- package/lib/components/AboutModal/AboutModal.d.ts.map +1 -1
- package/lib/components/AboutModal/AboutModal.js +1 -1
- package/lib/components/Coachmark/next/Coachmark/Coachmark.d.ts +17 -0
- package/lib/components/Coachmark/next/Coachmark/Coachmark.d.ts.map +1 -1
- package/lib/components/Coachmark/next/Coachmark/Coachmark.js +35 -5
- package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts +1 -9
- package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts.map +1 -1
- package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.js +47 -46
- package/lib/components/Coachmark/next/Coachmark/CoachmarkTagline/CoachmarkTagline.js +4 -1
- package/lib/components/Coachmark/next/Coachmark/ContentHeader.d.ts.map +1 -1
- package/lib/components/Coachmark/next/Coachmark/ContentHeader.js +26 -11
- package/lib/components/Coachmark/next/Coachmark/context.d.ts +1 -0
- package/lib/components/Coachmark/next/Coachmark/context.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilder.types.d.ts +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilder.types.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +3 -14
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +22 -15
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +6 -3
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +9 -3
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +3 -13
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +1 -1
- package/lib/components/DelimitedList/DelimitedList.d.ts +1 -0
- package/lib/components/DelimitedList/DelimitedList.d.ts.map +1 -1
- package/lib/components/DelimitedList/DelimitedList.js +6 -0
- package/lib/components/StringFormatter/StringFormatter.d.ts +1 -0
- package/lib/components/StringFormatter/StringFormatter.d.ts.map +1 -1
- package/lib/components/StringFormatter/StringFormatter.js +6 -0
- package/lib/components/Tearsheet/next/Tearsheet.d.ts.map +1 -1
- package/lib/components/Tearsheet/next/Tearsheet.js +6 -9
- package/lib/components/Tearsheet/next/TearsheetBody.d.ts.map +1 -1
- package/lib/components/Tearsheet/next/TearsheetBody.js +4 -1
- package/lib/components/Tearsheet/next/TearsheetHeader.d.ts +1 -1
- package/lib/components/Tearsheet/next/TearsheetHeader.d.ts.map +1 -1
- package/lib/components/Tearsheet/next/TearsheetHeader.js +11 -10
- package/lib/components/Tearsheet/next/TearsheetHeaderContent.d.ts.map +1 -1
- package/lib/components/Tearsheet/next/TearsheetHeaderContent.js +24 -5
- package/lib/components/Tearsheet/next/context.d.ts +4 -2
- package/lib/components/Tearsheet/next/context.d.ts.map +1 -1
- package/lib/components/Tearsheet/next/context.js +4 -2
- package/lib/global/js/hooks/useCollapsible.d.ts.map +1 -1
- package/lib/global/js/hooks/useCollapsible.js +7 -5
- package/lib/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/lib/index.js +2 -2
- package/lib/node_modules/@carbon/icons-react/lib/Icon.js +1 -1
- package/lib/settings.js +8 -1
- package/package.json +15 -15
- package/scss/components/Coachmark/_coachmark.scss +25 -1
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +16 -0
- package/scss/components/PageHeader/_page-header.scss +30 -22
- package/scss/components/Tearsheet/_tearsheet_next.scss +40 -7
- package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.js +0 -110
- package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.js +0 -32
- package/es/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -416
- package/es/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -509
- package/es/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -86
- package/es/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -145
- package/es/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -130
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.js +0 -111
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.js +0 -33
- package/lib/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -420
- package/lib/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -515
- package/lib/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -92
- package/lib/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -162
- package/lib/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -149
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2020, 2026
|
|
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
|
-
//#region ../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
9
|
-
function hasWindow() {
|
|
10
|
-
return typeof window !== "undefined";
|
|
11
|
-
}
|
|
12
|
-
function getNodeName(node) {
|
|
13
|
-
if (isNode(node)) return (node.nodeName || "").toLowerCase();
|
|
14
|
-
return "#document";
|
|
15
|
-
}
|
|
16
|
-
function getWindow(node) {
|
|
17
|
-
var _node$ownerDocument;
|
|
18
|
-
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
19
|
-
}
|
|
20
|
-
function getDocumentElement(node) {
|
|
21
|
-
var _ref;
|
|
22
|
-
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
23
|
-
}
|
|
24
|
-
function isNode(value) {
|
|
25
|
-
if (!hasWindow()) return false;
|
|
26
|
-
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
27
|
-
}
|
|
28
|
-
function isElement(value) {
|
|
29
|
-
if (!hasWindow()) return false;
|
|
30
|
-
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
31
|
-
}
|
|
32
|
-
function isHTMLElement(value) {
|
|
33
|
-
if (!hasWindow()) return false;
|
|
34
|
-
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
35
|
-
}
|
|
36
|
-
function isShadowRoot(value) {
|
|
37
|
-
if (!hasWindow() || typeof ShadowRoot === "undefined") return false;
|
|
38
|
-
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
39
|
-
}
|
|
40
|
-
function isOverflowElement(element) {
|
|
41
|
-
const { overflow, overflowX, overflowY, display } = getComputedStyle(element);
|
|
42
|
-
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !["inline", "contents"].includes(display);
|
|
43
|
-
}
|
|
44
|
-
function isTableElement(element) {
|
|
45
|
-
return [
|
|
46
|
-
"table",
|
|
47
|
-
"td",
|
|
48
|
-
"th"
|
|
49
|
-
].includes(getNodeName(element));
|
|
50
|
-
}
|
|
51
|
-
function isTopLayer(element) {
|
|
52
|
-
return [":popover-open", ":modal"].some((selector) => {
|
|
53
|
-
try {
|
|
54
|
-
return element.matches(selector);
|
|
55
|
-
} catch (e) {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
function isContainingBlock(elementOrCss) {
|
|
61
|
-
const webkit = isWebKit();
|
|
62
|
-
const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
|
|
63
|
-
return [
|
|
64
|
-
"transform",
|
|
65
|
-
"translate",
|
|
66
|
-
"scale",
|
|
67
|
-
"rotate",
|
|
68
|
-
"perspective"
|
|
69
|
-
].some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || [
|
|
70
|
-
"transform",
|
|
71
|
-
"translate",
|
|
72
|
-
"scale",
|
|
73
|
-
"rotate",
|
|
74
|
-
"perspective",
|
|
75
|
-
"filter"
|
|
76
|
-
].some((value) => (css.willChange || "").includes(value)) || [
|
|
77
|
-
"paint",
|
|
78
|
-
"layout",
|
|
79
|
-
"strict",
|
|
80
|
-
"content"
|
|
81
|
-
].some((value) => (css.contain || "").includes(value));
|
|
82
|
-
}
|
|
83
|
-
function getContainingBlock(element) {
|
|
84
|
-
let currentNode = getParentNode(element);
|
|
85
|
-
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
86
|
-
if (isContainingBlock(currentNode)) return currentNode;
|
|
87
|
-
else if (isTopLayer(currentNode)) return null;
|
|
88
|
-
currentNode = getParentNode(currentNode);
|
|
89
|
-
}
|
|
90
|
-
return null;
|
|
91
|
-
}
|
|
92
|
-
function isWebKit() {
|
|
93
|
-
if (typeof CSS === "undefined" || !CSS.supports) return false;
|
|
94
|
-
return CSS.supports("-webkit-backdrop-filter", "none");
|
|
95
|
-
}
|
|
96
|
-
function isLastTraversableNode(node) {
|
|
97
|
-
return [
|
|
98
|
-
"html",
|
|
99
|
-
"body",
|
|
100
|
-
"#document"
|
|
101
|
-
].includes(getNodeName(node));
|
|
102
|
-
}
|
|
103
|
-
function getComputedStyle(element) {
|
|
104
|
-
return getWindow(element).getComputedStyle(element);
|
|
105
|
-
}
|
|
106
|
-
function getNodeScroll(element) {
|
|
107
|
-
if (isElement(element)) return {
|
|
108
|
-
scrollLeft: element.scrollLeft,
|
|
109
|
-
scrollTop: element.scrollTop
|
|
110
|
-
};
|
|
111
|
-
return {
|
|
112
|
-
scrollLeft: element.scrollX,
|
|
113
|
-
scrollTop: element.scrollY
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
function getParentNode(node) {
|
|
117
|
-
if (getNodeName(node) === "html") return node;
|
|
118
|
-
const result = node.assignedSlot || node.parentNode || isShadowRoot(node) && node.host || getDocumentElement(node);
|
|
119
|
-
return isShadowRoot(result) ? result.host : result;
|
|
120
|
-
}
|
|
121
|
-
function getNearestOverflowAncestor(node) {
|
|
122
|
-
const parentNode = getParentNode(node);
|
|
123
|
-
if (isLastTraversableNode(parentNode)) return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
124
|
-
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) return parentNode;
|
|
125
|
-
return getNearestOverflowAncestor(parentNode);
|
|
126
|
-
}
|
|
127
|
-
function getOverflowAncestors(node, list, traverseIframes) {
|
|
128
|
-
var _node$ownerDocument2;
|
|
129
|
-
if (list === void 0) list = [];
|
|
130
|
-
if (traverseIframes === void 0) traverseIframes = true;
|
|
131
|
-
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
132
|
-
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
133
|
-
const win = getWindow(scrollableAncestor);
|
|
134
|
-
if (isBody) {
|
|
135
|
-
const frameElement = getFrameElement(win);
|
|
136
|
-
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
137
|
-
}
|
|
138
|
-
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
139
|
-
}
|
|
140
|
-
function getFrameElement(win) {
|
|
141
|
-
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
//#endregion
|
|
145
|
-
export { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isOverflowElement, isTableElement, isTopLayer, isWebKit };
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2020, 2026
|
|
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
|
-
//#region ../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
9
|
-
const min = Math.min;
|
|
10
|
-
const max = Math.max;
|
|
11
|
-
const round = Math.round;
|
|
12
|
-
const floor = Math.floor;
|
|
13
|
-
const createCoords = (v) => ({
|
|
14
|
-
x: v,
|
|
15
|
-
y: v
|
|
16
|
-
});
|
|
17
|
-
const oppositeSideMap = {
|
|
18
|
-
left: "right",
|
|
19
|
-
right: "left",
|
|
20
|
-
bottom: "top",
|
|
21
|
-
top: "bottom"
|
|
22
|
-
};
|
|
23
|
-
const oppositeAlignmentMap = {
|
|
24
|
-
start: "end",
|
|
25
|
-
end: "start"
|
|
26
|
-
};
|
|
27
|
-
function clamp(start, value, end) {
|
|
28
|
-
return max(start, min(value, end));
|
|
29
|
-
}
|
|
30
|
-
function evaluate(value, param) {
|
|
31
|
-
return typeof value === "function" ? value(param) : value;
|
|
32
|
-
}
|
|
33
|
-
function getSide(placement) {
|
|
34
|
-
return placement.split("-")[0];
|
|
35
|
-
}
|
|
36
|
-
function getAlignment(placement) {
|
|
37
|
-
return placement.split("-")[1];
|
|
38
|
-
}
|
|
39
|
-
function getOppositeAxis(axis) {
|
|
40
|
-
return axis === "x" ? "y" : "x";
|
|
41
|
-
}
|
|
42
|
-
function getAxisLength(axis) {
|
|
43
|
-
return axis === "y" ? "height" : "width";
|
|
44
|
-
}
|
|
45
|
-
function getSideAxis(placement) {
|
|
46
|
-
return ["top", "bottom"].includes(getSide(placement)) ? "y" : "x";
|
|
47
|
-
}
|
|
48
|
-
function getAlignmentAxis(placement) {
|
|
49
|
-
return getOppositeAxis(getSideAxis(placement));
|
|
50
|
-
}
|
|
51
|
-
function getAlignmentSides(placement, rects, rtl) {
|
|
52
|
-
if (rtl === void 0) rtl = false;
|
|
53
|
-
const alignment = getAlignment(placement);
|
|
54
|
-
const alignmentAxis = getAlignmentAxis(placement);
|
|
55
|
-
const length = getAxisLength(alignmentAxis);
|
|
56
|
-
let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
|
|
57
|
-
if (rects.reference[length] > rects.floating[length]) mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
58
|
-
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
59
|
-
}
|
|
60
|
-
function getExpandedPlacements(placement) {
|
|
61
|
-
const oppositePlacement = getOppositePlacement(placement);
|
|
62
|
-
return [
|
|
63
|
-
getOppositeAlignmentPlacement(placement),
|
|
64
|
-
oppositePlacement,
|
|
65
|
-
getOppositeAlignmentPlacement(oppositePlacement)
|
|
66
|
-
];
|
|
67
|
-
}
|
|
68
|
-
function getOppositeAlignmentPlacement(placement) {
|
|
69
|
-
return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
|
|
70
|
-
}
|
|
71
|
-
function getSideList(side, isStart, rtl) {
|
|
72
|
-
const lr = ["left", "right"];
|
|
73
|
-
const rl = ["right", "left"];
|
|
74
|
-
const tb = ["top", "bottom"];
|
|
75
|
-
const bt = ["bottom", "top"];
|
|
76
|
-
switch (side) {
|
|
77
|
-
case "top":
|
|
78
|
-
case "bottom":
|
|
79
|
-
if (rtl) return isStart ? rl : lr;
|
|
80
|
-
return isStart ? lr : rl;
|
|
81
|
-
case "left":
|
|
82
|
-
case "right": return isStart ? tb : bt;
|
|
83
|
-
default: return [];
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
87
|
-
const alignment = getAlignment(placement);
|
|
88
|
-
let list = getSideList(getSide(placement), direction === "start", rtl);
|
|
89
|
-
if (alignment) {
|
|
90
|
-
list = list.map((side) => side + "-" + alignment);
|
|
91
|
-
if (flipAlignment) list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
92
|
-
}
|
|
93
|
-
return list;
|
|
94
|
-
}
|
|
95
|
-
function getOppositePlacement(placement) {
|
|
96
|
-
return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
|
|
97
|
-
}
|
|
98
|
-
function expandPaddingObject(padding) {
|
|
99
|
-
return {
|
|
100
|
-
top: 0,
|
|
101
|
-
right: 0,
|
|
102
|
-
bottom: 0,
|
|
103
|
-
left: 0,
|
|
104
|
-
...padding
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
function getPaddingObject(padding) {
|
|
108
|
-
return typeof padding !== "number" ? expandPaddingObject(padding) : {
|
|
109
|
-
top: padding,
|
|
110
|
-
right: padding,
|
|
111
|
-
bottom: padding,
|
|
112
|
-
left: padding
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
function rectToClientRect(rect) {
|
|
116
|
-
const { x, y, width, height } = rect;
|
|
117
|
-
return {
|
|
118
|
-
width,
|
|
119
|
-
height,
|
|
120
|
-
top: y,
|
|
121
|
-
left: x,
|
|
122
|
-
right: x + width,
|
|
123
|
-
bottom: y + height,
|
|
124
|
-
x,
|
|
125
|
-
y
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
//#endregion
|
|
130
|
-
export { clamp, createCoords, evaluate, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, rectToClientRect, round };
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2020, 2026
|
|
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
|
-
const require_runtime = require('../../../../../_virtual/_rolldown/runtime.js');
|
|
9
|
-
const require_index = require('../../../../../node_modules/classnames/index.js');
|
|
10
|
-
const require_settings = require('../../../../../settings.js');
|
|
11
|
-
const require_useIsomorphicEffect = require('../../../../../global/js/hooks/useIsomorphicEffect.js');
|
|
12
|
-
const require_floating_ui_dom = require('../../../../../node_modules/@floating-ui/dom/dist/floating-ui.dom.js');
|
|
13
|
-
const require_floating_ui_react_dom = require('../../../../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js');
|
|
14
|
-
let react = require("react");
|
|
15
|
-
react = require_runtime.__toESM(react);
|
|
16
|
-
let _carbon_react = require("@carbon/react");
|
|
17
|
-
|
|
18
|
-
//#region src/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.tsx
|
|
19
|
-
var import_classnames = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
|
|
20
|
-
const CoachmarkBubble = (0, react.forwardRef)((props, ref) => {
|
|
21
|
-
const { children, align, target, className, dropShadow = true, highContrast = false, caret = false, open, ...rest } = props;
|
|
22
|
-
const { theme } = (0, _carbon_react.useTheme)();
|
|
23
|
-
const carbonPrefix = (0, _carbon_react.usePrefix)();
|
|
24
|
-
const tooltipRef = (0, react.useRef)(null);
|
|
25
|
-
const arrowRef = (0, react.useRef)(null);
|
|
26
|
-
const targetRef = (0, react.useRef)(null);
|
|
27
|
-
require_useIsomorphicEffect.useIsomorphicEffect(() => {
|
|
28
|
-
if (target) {
|
|
29
|
-
if (typeof target === "string") {
|
|
30
|
-
if (target === "#" || target.trim() === "") return;
|
|
31
|
-
targetRef.current = document.querySelector(target);
|
|
32
|
-
} else if ("current" in target) targetRef.current = target.current;
|
|
33
|
-
else targetRef.current = target;
|
|
34
|
-
if (targetRef.current && tooltipRef.current && arrowRef.current && open) {
|
|
35
|
-
targetRef.current.scrollIntoView({
|
|
36
|
-
behavior: "smooth",
|
|
37
|
-
block: "center",
|
|
38
|
-
inline: "center"
|
|
39
|
-
});
|
|
40
|
-
const middlewares = [
|
|
41
|
-
require_floating_ui_react_dom.offset(10),
|
|
42
|
-
require_floating_ui_react_dom.flip(),
|
|
43
|
-
require_floating_ui_react_dom.shift({ padding: 5 }),
|
|
44
|
-
require_floating_ui_react_dom.arrow({ element: arrowRef.current })
|
|
45
|
-
];
|
|
46
|
-
const cleanup = require_floating_ui_dom.autoUpdate(targetRef.current, tooltipRef.current, () => {
|
|
47
|
-
if (targetRef.current && tooltipRef.current) require_floating_ui_dom.computePosition(targetRef.current, tooltipRef.current, {
|
|
48
|
-
placement: align,
|
|
49
|
-
strategy: "fixed",
|
|
50
|
-
middleware: middlewares
|
|
51
|
-
}).then(({ x, y, placement, middlewareData }) => {
|
|
52
|
-
if (tooltipRef.current) Object.assign(tooltipRef.current.style, {
|
|
53
|
-
left: `${x}px`,
|
|
54
|
-
top: `${y}px`
|
|
55
|
-
});
|
|
56
|
-
const arrowX = middlewareData.arrow?.x;
|
|
57
|
-
const arrowY = middlewareData.arrow?.y;
|
|
58
|
-
const staticSide = {
|
|
59
|
-
top: "bottom",
|
|
60
|
-
right: "left",
|
|
61
|
-
bottom: "top",
|
|
62
|
-
left: "right"
|
|
63
|
-
}[placement.split("-")[0]];
|
|
64
|
-
if (staticSide && arrowRef.current) Object.assign(arrowRef.current.style, {
|
|
65
|
-
left: arrowX != null ? `${arrowX}px` : "",
|
|
66
|
-
top: arrowY != null ? `${arrowY}px` : "",
|
|
67
|
-
right: "",
|
|
68
|
-
bottom: "",
|
|
69
|
-
[staticSide]: "-4px"
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
}, { animationFrame: true });
|
|
73
|
-
return () => {
|
|
74
|
-
cleanup();
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}, [
|
|
79
|
-
target,
|
|
80
|
-
open,
|
|
81
|
-
align
|
|
82
|
-
]);
|
|
83
|
-
if (!target) return null;
|
|
84
|
-
const mergedRefs = (node) => {
|
|
85
|
-
tooltipRef.current = node;
|
|
86
|
-
if (typeof ref === "function") ref(node);
|
|
87
|
-
else if (ref) ref.current = node;
|
|
88
|
-
};
|
|
89
|
-
return /* @__PURE__ */ react.default.createElement("div", {
|
|
90
|
-
...rest,
|
|
91
|
-
ref: mergedRefs,
|
|
92
|
-
className: (0, import_classnames.default)({
|
|
93
|
-
[`${carbonPrefix}--g100`]: theme === "white" && highContrast || theme === "g100" && !highContrast,
|
|
94
|
-
[`${carbonPrefix}--g90`]: theme === "g10" && highContrast || theme === "g90" && !highContrast,
|
|
95
|
-
[`${carbonPrefix}--g10`]: theme === "g90" && highContrast || theme === "g10" && !highContrast,
|
|
96
|
-
[`${carbonPrefix}--white`]: theme === "g100" && highContrast || theme === "white" && !highContrast,
|
|
97
|
-
[`${require_settings.pkg.prefix}__bubble`]: true,
|
|
98
|
-
[`${require_settings.pkg.prefix}__bubble-open`]: open,
|
|
99
|
-
[`${require_settings.pkg.prefix}__bubble-drop-shadow`]: dropShadow,
|
|
100
|
-
[`${require_settings.pkg.prefix}__bubble-high-contrast`]: highContrast,
|
|
101
|
-
[`${require_settings.pkg.prefix}__bubble-hidden`]: !targetRef.current
|
|
102
|
-
}, className)
|
|
103
|
-
}, /* @__PURE__ */ react.default.createElement("div", {
|
|
104
|
-
ref: arrowRef,
|
|
105
|
-
className: !caret ? `${require_settings.pkg.prefix}__bubble__arrow` : ""
|
|
106
|
-
}), children);
|
|
107
|
-
});
|
|
108
|
-
CoachmarkBubble.displayName = "CoachmarkBubble";
|
|
109
|
-
|
|
110
|
-
//#endregion
|
|
111
|
-
exports.CoachmarkBubble = CoachmarkBubble;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2020, 2026
|
|
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
|
-
const require_runtime = require('../../../../../_virtual/_rolldown/runtime.js');
|
|
9
|
-
const require_index = require('../../../../../node_modules/classnames/index.js');
|
|
10
|
-
const require_settings = require('../../../../../settings.js');
|
|
11
|
-
let react = require("react");
|
|
12
|
-
react = require_runtime.__toESM(react);
|
|
13
|
-
|
|
14
|
-
//#region src/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.tsx
|
|
15
|
-
/**
|
|
16
|
-
* @license
|
|
17
|
-
*
|
|
18
|
-
* Copyright IBM Corp. 2025
|
|
19
|
-
*
|
|
20
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
21
|
-
* LICENSE file in the root directory of this source tree.
|
|
22
|
-
*/
|
|
23
|
-
var import_classnames = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
|
|
24
|
-
const CoachmarkBubbleHeader = ({ children, className, ...rest }) => {
|
|
25
|
-
return /* @__PURE__ */ react.default.createElement("header", {
|
|
26
|
-
...rest,
|
|
27
|
-
className: (0, import_classnames.default)(`${require_settings.pkg.prefix}__bubble__header`, className)
|
|
28
|
-
}, children);
|
|
29
|
-
};
|
|
30
|
-
CoachmarkBubbleHeader.displayName = "CoachmarkBubbleHeader";
|
|
31
|
-
|
|
32
|
-
//#endregion
|
|
33
|
-
exports.CoachmarkBubbleHeader = CoachmarkBubbleHeader;
|