@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.
Files changed (137) hide show
  1. package/css/carbon.css +17 -4
  2. package/css/carbon.css.map +1 -1
  3. package/css/index-full-carbon.css +106 -33
  4. package/css/index-full-carbon.css.map +1 -1
  5. package/css/index-full-carbon.min.css +1 -1
  6. package/css/index-full-carbon.min.css.map +1 -1
  7. package/css/index-without-carbon-released-only.css +54 -29
  8. package/css/index-without-carbon-released-only.css.map +1 -1
  9. package/css/index-without-carbon-released-only.min.css +1 -1
  10. package/css/index-without-carbon-released-only.min.css.map +1 -1
  11. package/css/index-without-carbon.css +89 -29
  12. package/css/index-without-carbon.css.map +1 -1
  13. package/css/index-without-carbon.min.css +1 -1
  14. package/css/index-without-carbon.min.css.map +1 -1
  15. package/css/index.css +104 -32
  16. package/css/index.css.map +1 -1
  17. package/css/index.min.css +1 -1
  18. package/css/index.min.css.map +1 -1
  19. package/es/components/AboutModal/AboutModal.d.ts.map +1 -1
  20. package/es/components/AboutModal/AboutModal.js +2 -2
  21. package/es/components/Coachmark/next/Coachmark/Coachmark.d.ts +17 -0
  22. package/es/components/Coachmark/next/Coachmark/Coachmark.d.ts.map +1 -1
  23. package/es/components/Coachmark/next/Coachmark/Coachmark.js +35 -5
  24. package/es/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts +1 -9
  25. package/es/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts.map +1 -1
  26. package/es/components/Coachmark/next/Coachmark/CoachmarkContent.js +48 -47
  27. package/es/components/Coachmark/next/Coachmark/CoachmarkTagline/CoachmarkTagline.js +4 -1
  28. package/es/components/Coachmark/next/Coachmark/ContentHeader.d.ts.map +1 -1
  29. package/es/components/Coachmark/next/Coachmark/ContentHeader.js +26 -11
  30. package/es/components/Coachmark/next/Coachmark/context.d.ts +1 -0
  31. package/es/components/Coachmark/next/Coachmark/context.d.ts.map +1 -1
  32. package/es/components/ConditionBuilder/ConditionBuilder.types.d.ts +1 -1
  33. package/es/components/ConditionBuilder/ConditionBuilder.types.d.ts.map +1 -1
  34. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts.map +1 -1
  35. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +4 -15
  36. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +1 -1
  37. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts.map +1 -1
  38. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +22 -15
  39. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts.map +1 -1
  40. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +6 -3
  41. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts.map +1 -1
  42. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +9 -3
  43. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts.map +1 -1
  44. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +4 -14
  45. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +1 -1
  46. package/es/components/DelimitedList/DelimitedList.d.ts +1 -0
  47. package/es/components/DelimitedList/DelimitedList.d.ts.map +1 -1
  48. package/es/components/DelimitedList/DelimitedList.js +6 -0
  49. package/es/components/StringFormatter/StringFormatter.d.ts +1 -0
  50. package/es/components/StringFormatter/StringFormatter.d.ts.map +1 -1
  51. package/es/components/StringFormatter/StringFormatter.js +6 -0
  52. package/es/components/Tearsheet/next/Tearsheet.d.ts.map +1 -1
  53. package/es/components/Tearsheet/next/Tearsheet.js +6 -9
  54. package/es/components/Tearsheet/next/TearsheetBody.d.ts.map +1 -1
  55. package/es/components/Tearsheet/next/TearsheetBody.js +5 -2
  56. package/es/components/Tearsheet/next/TearsheetHeader.d.ts +1 -1
  57. package/es/components/Tearsheet/next/TearsheetHeader.d.ts.map +1 -1
  58. package/es/components/Tearsheet/next/TearsheetHeader.js +11 -10
  59. package/es/components/Tearsheet/next/TearsheetHeaderContent.d.ts.map +1 -1
  60. package/es/components/Tearsheet/next/TearsheetHeaderContent.js +26 -7
  61. package/es/components/Tearsheet/next/context.d.ts +4 -2
  62. package/es/components/Tearsheet/next/context.d.ts.map +1 -1
  63. package/es/components/Tearsheet/next/context.js +4 -2
  64. package/es/global/js/hooks/useCollapsible.d.ts.map +1 -1
  65. package/es/global/js/hooks/useCollapsible.js +7 -5
  66. package/es/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/es/index.js +1 -1
  67. package/es/node_modules/@carbon/icons-react/es/Icon.js +1 -1
  68. package/es/settings.js +8 -2
  69. package/lib/components/AboutModal/AboutModal.d.ts.map +1 -1
  70. package/lib/components/AboutModal/AboutModal.js +1 -1
  71. package/lib/components/Coachmark/next/Coachmark/Coachmark.d.ts +17 -0
  72. package/lib/components/Coachmark/next/Coachmark/Coachmark.d.ts.map +1 -1
  73. package/lib/components/Coachmark/next/Coachmark/Coachmark.js +35 -5
  74. package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts +1 -9
  75. package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts.map +1 -1
  76. package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.js +47 -46
  77. package/lib/components/Coachmark/next/Coachmark/CoachmarkTagline/CoachmarkTagline.js +4 -1
  78. package/lib/components/Coachmark/next/Coachmark/ContentHeader.d.ts.map +1 -1
  79. package/lib/components/Coachmark/next/Coachmark/ContentHeader.js +26 -11
  80. package/lib/components/Coachmark/next/Coachmark/context.d.ts +1 -0
  81. package/lib/components/Coachmark/next/Coachmark/context.d.ts.map +1 -1
  82. package/lib/components/ConditionBuilder/ConditionBuilder.types.d.ts +1 -1
  83. package/lib/components/ConditionBuilder/ConditionBuilder.types.d.ts.map +1 -1
  84. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts.map +1 -1
  85. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +3 -14
  86. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +1 -1
  87. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts.map +1 -1
  88. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +22 -15
  89. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts.map +1 -1
  90. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +6 -3
  91. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts.map +1 -1
  92. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +9 -3
  93. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts.map +1 -1
  94. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +3 -13
  95. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +1 -1
  96. package/lib/components/DelimitedList/DelimitedList.d.ts +1 -0
  97. package/lib/components/DelimitedList/DelimitedList.d.ts.map +1 -1
  98. package/lib/components/DelimitedList/DelimitedList.js +6 -0
  99. package/lib/components/StringFormatter/StringFormatter.d.ts +1 -0
  100. package/lib/components/StringFormatter/StringFormatter.d.ts.map +1 -1
  101. package/lib/components/StringFormatter/StringFormatter.js +6 -0
  102. package/lib/components/Tearsheet/next/Tearsheet.d.ts.map +1 -1
  103. package/lib/components/Tearsheet/next/Tearsheet.js +6 -9
  104. package/lib/components/Tearsheet/next/TearsheetBody.d.ts.map +1 -1
  105. package/lib/components/Tearsheet/next/TearsheetBody.js +4 -1
  106. package/lib/components/Tearsheet/next/TearsheetHeader.d.ts +1 -1
  107. package/lib/components/Tearsheet/next/TearsheetHeader.d.ts.map +1 -1
  108. package/lib/components/Tearsheet/next/TearsheetHeader.js +11 -10
  109. package/lib/components/Tearsheet/next/TearsheetHeaderContent.d.ts.map +1 -1
  110. package/lib/components/Tearsheet/next/TearsheetHeaderContent.js +24 -5
  111. package/lib/components/Tearsheet/next/context.d.ts +4 -2
  112. package/lib/components/Tearsheet/next/context.d.ts.map +1 -1
  113. package/lib/components/Tearsheet/next/context.js +4 -2
  114. package/lib/global/js/hooks/useCollapsible.d.ts.map +1 -1
  115. package/lib/global/js/hooks/useCollapsible.js +7 -5
  116. package/lib/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/lib/index.js +2 -2
  117. package/lib/node_modules/@carbon/icons-react/lib/Icon.js +1 -1
  118. package/lib/settings.js +8 -1
  119. package/package.json +15 -15
  120. package/scss/components/Coachmark/_coachmark.scss +25 -1
  121. package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +16 -0
  122. package/scss/components/PageHeader/_page-header.scss +30 -22
  123. package/scss/components/Tearsheet/_tearsheet_next.scss +40 -7
  124. package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.js +0 -110
  125. package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.js +0 -32
  126. package/es/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -416
  127. package/es/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -509
  128. package/es/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -86
  129. package/es/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -145
  130. package/es/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -130
  131. package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.js +0 -111
  132. package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.js +0 -33
  133. package/lib/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -420
  134. package/lib/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -515
  135. package/lib/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -92
  136. package/lib/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -162
  137. package/lib/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -149
@@ -1,509 +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
- import { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isOverflowElement, isTableElement, isTopLayer, isWebKit } from "../../utils/dist/floating-ui.utils.dom.js";
9
- import { createCoords, floor, max, min, rectToClientRect, round } from "../../utils/dist/floating-ui.utils.js";
10
- import { arrow as arrow$1, computePosition as computePosition$1, flip as flip$1, offset as offset$1, shift as shift$1 } from "../../core/dist/floating-ui.core.js";
11
-
12
- //#region ../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
13
- function getCssDimensions(element) {
14
- const css = getComputedStyle(element);
15
- let width = parseFloat(css.width) || 0;
16
- let height = parseFloat(css.height) || 0;
17
- const hasOffset = isHTMLElement(element);
18
- const offsetWidth = hasOffset ? element.offsetWidth : width;
19
- const offsetHeight = hasOffset ? element.offsetHeight : height;
20
- const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
21
- if (shouldFallback) {
22
- width = offsetWidth;
23
- height = offsetHeight;
24
- }
25
- return {
26
- width,
27
- height,
28
- $: shouldFallback
29
- };
30
- }
31
- function unwrapElement(element) {
32
- return !isElement(element) ? element.contextElement : element;
33
- }
34
- function getScale(element) {
35
- const domElement = unwrapElement(element);
36
- if (!isHTMLElement(domElement)) return createCoords(1);
37
- const rect = domElement.getBoundingClientRect();
38
- const { width, height, $ } = getCssDimensions(domElement);
39
- let x = ($ ? round(rect.width) : rect.width) / width;
40
- let y = ($ ? round(rect.height) : rect.height) / height;
41
- if (!x || !Number.isFinite(x)) x = 1;
42
- if (!y || !Number.isFinite(y)) y = 1;
43
- return {
44
- x,
45
- y
46
- };
47
- }
48
- const noOffsets = /* @__PURE__ */ createCoords(0);
49
- function getVisualOffsets(element) {
50
- const win = getWindow(element);
51
- if (!isWebKit() || !win.visualViewport) return noOffsets;
52
- return {
53
- x: win.visualViewport.offsetLeft,
54
- y: win.visualViewport.offsetTop
55
- };
56
- }
57
- function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
58
- if (isFixed === void 0) isFixed = false;
59
- if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) return false;
60
- return isFixed;
61
- }
62
- function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
63
- if (includeScale === void 0) includeScale = false;
64
- if (isFixedStrategy === void 0) isFixedStrategy = false;
65
- const clientRect = element.getBoundingClientRect();
66
- const domElement = unwrapElement(element);
67
- let scale = createCoords(1);
68
- if (includeScale) if (offsetParent) {
69
- if (isElement(offsetParent)) scale = getScale(offsetParent);
70
- } else scale = getScale(element);
71
- const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
72
- let x = (clientRect.left + visualOffsets.x) / scale.x;
73
- let y = (clientRect.top + visualOffsets.y) / scale.y;
74
- let width = clientRect.width / scale.x;
75
- let height = clientRect.height / scale.y;
76
- if (domElement) {
77
- const win = getWindow(domElement);
78
- const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
79
- let currentWin = win;
80
- let currentIFrame = getFrameElement(currentWin);
81
- while (currentIFrame && offsetParent && offsetWin !== currentWin) {
82
- const iframeScale = getScale(currentIFrame);
83
- const iframeRect = currentIFrame.getBoundingClientRect();
84
- const css = getComputedStyle(currentIFrame);
85
- const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
86
- const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
87
- x *= iframeScale.x;
88
- y *= iframeScale.y;
89
- width *= iframeScale.x;
90
- height *= iframeScale.y;
91
- x += left;
92
- y += top;
93
- currentWin = getWindow(currentIFrame);
94
- currentIFrame = getFrameElement(currentWin);
95
- }
96
- }
97
- return rectToClientRect({
98
- width,
99
- height,
100
- x,
101
- y
102
- });
103
- }
104
- function getWindowScrollBarX(element, rect) {
105
- const leftScroll = getNodeScroll(element).scrollLeft;
106
- if (!rect) return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
107
- return rect.left + leftScroll;
108
- }
109
- function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
110
- if (ignoreScrollbarX === void 0) ignoreScrollbarX = false;
111
- const htmlRect = documentElement.getBoundingClientRect();
112
- return {
113
- x: htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 : getWindowScrollBarX(documentElement, htmlRect)),
114
- y: htmlRect.top + scroll.scrollTop
115
- };
116
- }
117
- function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
118
- let { elements, rect, offsetParent, strategy } = _ref;
119
- const isFixed = strategy === "fixed";
120
- const documentElement = getDocumentElement(offsetParent);
121
- const topLayer = elements ? isTopLayer(elements.floating) : false;
122
- if (offsetParent === documentElement || topLayer && isFixed) return rect;
123
- let scroll = {
124
- scrollLeft: 0,
125
- scrollTop: 0
126
- };
127
- let scale = createCoords(1);
128
- const offsets = createCoords(0);
129
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
130
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
131
- if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) scroll = getNodeScroll(offsetParent);
132
- if (isHTMLElement(offsetParent)) {
133
- const offsetRect = getBoundingClientRect(offsetParent);
134
- scale = getScale(offsetParent);
135
- offsets.x = offsetRect.x + offsetParent.clientLeft;
136
- offsets.y = offsetRect.y + offsetParent.clientTop;
137
- }
138
- }
139
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
140
- return {
141
- width: rect.width * scale.x,
142
- height: rect.height * scale.y,
143
- x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
144
- y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
145
- };
146
- }
147
- function getClientRects(element) {
148
- return Array.from(element.getClientRects());
149
- }
150
- function getDocumentRect(element) {
151
- const html = getDocumentElement(element);
152
- const scroll = getNodeScroll(element);
153
- const body = element.ownerDocument.body;
154
- const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
155
- const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
156
- let x = -scroll.scrollLeft + getWindowScrollBarX(element);
157
- const y = -scroll.scrollTop;
158
- if (getComputedStyle(body).direction === "rtl") x += max(html.clientWidth, body.clientWidth) - width;
159
- return {
160
- width,
161
- height,
162
- x,
163
- y
164
- };
165
- }
166
- function getViewportRect(element, strategy) {
167
- const win = getWindow(element);
168
- const html = getDocumentElement(element);
169
- const visualViewport = win.visualViewport;
170
- let width = html.clientWidth;
171
- let height = html.clientHeight;
172
- let x = 0;
173
- let y = 0;
174
- if (visualViewport) {
175
- width = visualViewport.width;
176
- height = visualViewport.height;
177
- const visualViewportBased = isWebKit();
178
- if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
179
- x = visualViewport.offsetLeft;
180
- y = visualViewport.offsetTop;
181
- }
182
- }
183
- return {
184
- width,
185
- height,
186
- x,
187
- y
188
- };
189
- }
190
- function getInnerBoundingClientRect(element, strategy) {
191
- const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
192
- const top = clientRect.top + element.clientTop;
193
- const left = clientRect.left + element.clientLeft;
194
- const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
195
- return {
196
- width: element.clientWidth * scale.x,
197
- height: element.clientHeight * scale.y,
198
- x: left * scale.x,
199
- y: top * scale.y
200
- };
201
- }
202
- function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
203
- let rect;
204
- if (clippingAncestor === "viewport") rect = getViewportRect(element, strategy);
205
- else if (clippingAncestor === "document") rect = getDocumentRect(getDocumentElement(element));
206
- else if (isElement(clippingAncestor)) rect = getInnerBoundingClientRect(clippingAncestor, strategy);
207
- else {
208
- const visualOffsets = getVisualOffsets(element);
209
- rect = {
210
- x: clippingAncestor.x - visualOffsets.x,
211
- y: clippingAncestor.y - visualOffsets.y,
212
- width: clippingAncestor.width,
213
- height: clippingAncestor.height
214
- };
215
- }
216
- return rectToClientRect(rect);
217
- }
218
- function hasFixedPositionAncestor(element, stopNode) {
219
- const parentNode = getParentNode(element);
220
- if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) return false;
221
- return getComputedStyle(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
222
- }
223
- function getClippingElementAncestors(element, cache) {
224
- const cachedResult = cache.get(element);
225
- if (cachedResult) return cachedResult;
226
- let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
227
- let currentContainingBlockComputedStyle = null;
228
- const elementIsFixed = getComputedStyle(element).position === "fixed";
229
- let currentNode = elementIsFixed ? getParentNode(element) : element;
230
- while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
231
- const computedStyle = getComputedStyle(currentNode);
232
- const currentNodeIsContaining = isContainingBlock(currentNode);
233
- if (!currentNodeIsContaining && computedStyle.position === "fixed") currentContainingBlockComputedStyle = null;
234
- if (elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && ["absolute", "fixed"].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode)) result = result.filter((ancestor) => ancestor !== currentNode);
235
- else currentContainingBlockComputedStyle = computedStyle;
236
- currentNode = getParentNode(currentNode);
237
- }
238
- cache.set(element, result);
239
- return result;
240
- }
241
- function getClippingRect(_ref) {
242
- let { element, boundary, rootBoundary, strategy } = _ref;
243
- const clippingAncestors = [...boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary), rootBoundary];
244
- const firstClippingAncestor = clippingAncestors[0];
245
- const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
246
- const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
247
- accRect.top = max(rect.top, accRect.top);
248
- accRect.right = min(rect.right, accRect.right);
249
- accRect.bottom = min(rect.bottom, accRect.bottom);
250
- accRect.left = max(rect.left, accRect.left);
251
- return accRect;
252
- }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
253
- return {
254
- width: clippingRect.right - clippingRect.left,
255
- height: clippingRect.bottom - clippingRect.top,
256
- x: clippingRect.left,
257
- y: clippingRect.top
258
- };
259
- }
260
- function getDimensions(element) {
261
- const { width, height } = getCssDimensions(element);
262
- return {
263
- width,
264
- height
265
- };
266
- }
267
- function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
268
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
269
- const documentElement = getDocumentElement(offsetParent);
270
- const isFixed = strategy === "fixed";
271
- const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
272
- let scroll = {
273
- scrollLeft: 0,
274
- scrollTop: 0
275
- };
276
- const offsets = createCoords(0);
277
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
278
- if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) scroll = getNodeScroll(offsetParent);
279
- if (isOffsetParentAnElement) {
280
- const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
281
- offsets.x = offsetRect.x + offsetParent.clientLeft;
282
- offsets.y = offsetRect.y + offsetParent.clientTop;
283
- } else if (documentElement) offsets.x = getWindowScrollBarX(documentElement);
284
- }
285
- const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
286
- return {
287
- x: rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x,
288
- y: rect.top + scroll.scrollTop - offsets.y - htmlOffset.y,
289
- width: rect.width,
290
- height: rect.height
291
- };
292
- }
293
- function isStaticPositioned(element) {
294
- return getComputedStyle(element).position === "static";
295
- }
296
- function getTrueOffsetParent(element, polyfill) {
297
- if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") return null;
298
- if (polyfill) return polyfill(element);
299
- let rawOffsetParent = element.offsetParent;
300
- if (getDocumentElement(element) === rawOffsetParent) rawOffsetParent = rawOffsetParent.ownerDocument.body;
301
- return rawOffsetParent;
302
- }
303
- function getOffsetParent(element, polyfill) {
304
- const win = getWindow(element);
305
- if (isTopLayer(element)) return win;
306
- if (!isHTMLElement(element)) {
307
- let svgOffsetParent = getParentNode(element);
308
- while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
309
- if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) return svgOffsetParent;
310
- svgOffsetParent = getParentNode(svgOffsetParent);
311
- }
312
- return win;
313
- }
314
- let offsetParent = getTrueOffsetParent(element, polyfill);
315
- while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) offsetParent = getTrueOffsetParent(offsetParent, polyfill);
316
- if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) return win;
317
- return offsetParent || getContainingBlock(element) || win;
318
- }
319
- const getElementRects = async function(data) {
320
- const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
321
- const getDimensionsFn = this.getDimensions;
322
- const floatingDimensions = await getDimensionsFn(data.floating);
323
- return {
324
- reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
325
- floating: {
326
- x: 0,
327
- y: 0,
328
- width: floatingDimensions.width,
329
- height: floatingDimensions.height
330
- }
331
- };
332
- };
333
- function isRTL(element) {
334
- return getComputedStyle(element).direction === "rtl";
335
- }
336
- const platform = {
337
- convertOffsetParentRelativeRectToViewportRelativeRect,
338
- getDocumentElement,
339
- getClippingRect,
340
- getOffsetParent,
341
- getElementRects,
342
- getClientRects,
343
- getDimensions,
344
- getScale,
345
- isElement,
346
- isRTL
347
- };
348
- function rectsAreEqual(a, b) {
349
- return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
350
- }
351
- function observeMove(element, onMove) {
352
- let io = null;
353
- let timeoutId;
354
- const root = getDocumentElement(element);
355
- function cleanup() {
356
- var _io;
357
- clearTimeout(timeoutId);
358
- (_io = io) == null || _io.disconnect();
359
- io = null;
360
- }
361
- function refresh(skip, threshold) {
362
- if (skip === void 0) skip = false;
363
- if (threshold === void 0) threshold = 1;
364
- cleanup();
365
- const elementRectForRootMargin = element.getBoundingClientRect();
366
- const { left, top, width, height } = elementRectForRootMargin;
367
- if (!skip) onMove();
368
- if (!width || !height) return;
369
- const insetTop = floor(top);
370
- const insetRight = floor(root.clientWidth - (left + width));
371
- const insetBottom = floor(root.clientHeight - (top + height));
372
- const insetLeft = floor(left);
373
- const options = {
374
- rootMargin: -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px",
375
- threshold: max(0, min(1, threshold)) || 1
376
- };
377
- let isFirstUpdate = true;
378
- function handleObserve(entries) {
379
- const ratio = entries[0].intersectionRatio;
380
- if (ratio !== threshold) {
381
- if (!isFirstUpdate) return refresh();
382
- if (!ratio) timeoutId = setTimeout(() => {
383
- refresh(false, 1e-7);
384
- }, 1e3);
385
- else refresh(false, ratio);
386
- }
387
- if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) refresh();
388
- isFirstUpdate = false;
389
- }
390
- try {
391
- io = new IntersectionObserver(handleObserve, {
392
- ...options,
393
- root: root.ownerDocument
394
- });
395
- } catch (e) {
396
- io = new IntersectionObserver(handleObserve, options);
397
- }
398
- io.observe(element);
399
- }
400
- refresh(true);
401
- return cleanup;
402
- }
403
- /**
404
- * Automatically updates the position of the floating element when necessary.
405
- * Should only be called when the floating element is mounted on the DOM or
406
- * visible on the screen.
407
- * @returns cleanup function that should be invoked when the floating element is
408
- * removed from the DOM or hidden from the screen.
409
- * @see https://floating-ui.com/docs/autoUpdate
410
- */
411
- function autoUpdate(reference, floating, update, options) {
412
- if (options === void 0) options = {};
413
- const { ancestorScroll = true, ancestorResize = true, elementResize = typeof ResizeObserver === "function", layoutShift = typeof IntersectionObserver === "function", animationFrame = false } = options;
414
- const referenceEl = unwrapElement(reference);
415
- const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
416
- ancestors.forEach((ancestor) => {
417
- ancestorScroll && ancestor.addEventListener("scroll", update, { passive: true });
418
- ancestorResize && ancestor.addEventListener("resize", update);
419
- });
420
- const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
421
- let reobserveFrame = -1;
422
- let resizeObserver = null;
423
- if (elementResize) {
424
- resizeObserver = new ResizeObserver((_ref) => {
425
- let [firstEntry] = _ref;
426
- if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
427
- resizeObserver.unobserve(floating);
428
- cancelAnimationFrame(reobserveFrame);
429
- reobserveFrame = requestAnimationFrame(() => {
430
- var _resizeObserver;
431
- (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
432
- });
433
- }
434
- update();
435
- });
436
- if (referenceEl && !animationFrame) resizeObserver.observe(referenceEl);
437
- resizeObserver.observe(floating);
438
- }
439
- let frameId;
440
- let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
441
- if (animationFrame) frameLoop();
442
- function frameLoop() {
443
- const nextRefRect = getBoundingClientRect(reference);
444
- if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) update();
445
- prevRefRect = nextRefRect;
446
- frameId = requestAnimationFrame(frameLoop);
447
- }
448
- update();
449
- return () => {
450
- var _resizeObserver2;
451
- ancestors.forEach((ancestor) => {
452
- ancestorScroll && ancestor.removeEventListener("scroll", update);
453
- ancestorResize && ancestor.removeEventListener("resize", update);
454
- });
455
- cleanupIo?.();
456
- (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
457
- resizeObserver = null;
458
- if (animationFrame) cancelAnimationFrame(frameId);
459
- };
460
- }
461
- /**
462
- * Modifies the placement by translating the floating element along the
463
- * specified axes.
464
- * A number (shorthand for `mainAxis` or distance), or an axes configuration
465
- * object may be passed.
466
- * @see https://floating-ui.com/docs/offset
467
- */
468
- const offset = offset$1;
469
- /**
470
- * Optimizes the visibility of the floating element by shifting it in order to
471
- * keep it in view when it will overflow the clipping boundary.
472
- * @see https://floating-ui.com/docs/shift
473
- */
474
- const shift = shift$1;
475
- /**
476
- * Optimizes the visibility of the floating element by flipping the `placement`
477
- * in order to keep it in view when the preferred placement(s) will overflow the
478
- * clipping boundary. Alternative to `autoPlacement`.
479
- * @see https://floating-ui.com/docs/flip
480
- */
481
- const flip = flip$1;
482
- /**
483
- * Provides data to position an inner element of the floating element so that it
484
- * appears centered to the reference element.
485
- * @see https://floating-ui.com/docs/arrow
486
- */
487
- const arrow = arrow$1;
488
- /**
489
- * Computes the `x` and `y` coordinates that will place the floating element
490
- * next to a given reference element.
491
- */
492
- const computePosition = (reference, floating, options) => {
493
- const cache = /* @__PURE__ */ new Map();
494
- const mergedOptions = {
495
- platform,
496
- ...options
497
- };
498
- const platformWithCache = {
499
- ...mergedOptions.platform,
500
- _c: cache
501
- };
502
- return computePosition$1(reference, floating, {
503
- ...mergedOptions,
504
- platform: platformWithCache
505
- });
506
- };
507
-
508
- //#endregion
509
- export { arrow, autoUpdate, computePosition, flip, offset, platform, shift };
@@ -1,86 +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
- import { getOverflowAncestors } from "../../utils/dist/floating-ui.utils.dom.js";
9
- import { arrow as arrow$2, autoUpdate, computePosition, flip as flip$1, offset as offset$1, platform, shift as shift$1 } from "../../dom/dist/floating-ui.dom.js";
10
- import { useEffect, useLayoutEffect } from "react";
11
- import "react-dom";
12
-
13
- //#region ../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
14
- /**
15
- * Provides data to position an inner element of the floating element so that it
16
- * appears centered to the reference element.
17
- * This wraps the core `arrow` middleware to allow React refs as the element.
18
- * @see https://floating-ui.com/docs/arrow
19
- */
20
- const arrow$1 = (options) => {
21
- function isRef(value) {
22
- return {}.hasOwnProperty.call(value, "current");
23
- }
24
- return {
25
- name: "arrow",
26
- options,
27
- fn(state) {
28
- const { element, padding } = typeof options === "function" ? options(state) : options;
29
- if (element && isRef(element)) {
30
- if (element.current != null) return arrow$2({
31
- element: element.current,
32
- padding
33
- }).fn(state);
34
- return {};
35
- }
36
- if (element) return arrow$2({
37
- element,
38
- padding
39
- }).fn(state);
40
- return {};
41
- }
42
- };
43
- };
44
- /**
45
- * Modifies the placement by translating the floating element along the
46
- * specified axes.
47
- * A number (shorthand for `mainAxis` or distance), or an axes configuration
48
- * object may be passed.
49
- * @see https://floating-ui.com/docs/offset
50
- */
51
- const offset = (options, deps) => ({
52
- ...offset$1(options),
53
- options: [options, deps]
54
- });
55
- /**
56
- * Optimizes the visibility of the floating element by shifting it in order to
57
- * keep it in view when it will overflow the clipping boundary.
58
- * @see https://floating-ui.com/docs/shift
59
- */
60
- const shift = (options, deps) => ({
61
- ...shift$1(options),
62
- options: [options, deps]
63
- });
64
- /**
65
- * Optimizes the visibility of the floating element by flipping the `placement`
66
- * in order to keep it in view when the preferred placement(s) will overflow the
67
- * clipping boundary. Alternative to `autoPlacement`.
68
- * @see https://floating-ui.com/docs/flip
69
- */
70
- const flip = (options, deps) => ({
71
- ...flip$1(options),
72
- options: [options, deps]
73
- });
74
- /**
75
- * Provides data to position an inner element of the floating element so that it
76
- * appears centered to the reference element.
77
- * This wraps the core `arrow` middleware to allow React refs as the element.
78
- * @see https://floating-ui.com/docs/arrow
79
- */
80
- const arrow = (options, deps) => ({
81
- ...arrow$1(options),
82
- options: [options, deps]
83
- });
84
-
85
- //#endregion
86
- export { arrow, flip, offset, shift };