@adam-milo/ui 1.0.28 → 1.0.29
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/dist/index.cjs +1 -1
- package/dist/index.js +3 -1
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +1 -1
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +1 -1
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +1 -1
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +1 -1
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +1 -1
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +2 -2
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +1 -1
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +1 -1
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +1 -1
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +43 -12
- package/dist/index2.cjs +1 -1
- package/dist/index2.js +1 -1
- package/dist/index20.cjs +1 -0
- package/dist/index20.js +14 -0
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +20 -299
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +298 -13
- package/dist/index24.cjs +1 -0
- package/dist/index24.js +16 -0
- package/dist/{index26.cjs → index27.cjs} +1 -1
- package/dist/{index26.js → index27.js} +21 -21
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +2 -2
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +1 -1
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +18 -3
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +3 -8
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +7 -66
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +66 -35
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +31 -56
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +60 -6
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +6 -208
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +203 -20
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +23 -202
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +204 -10
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +1 -1
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +10 -289
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +288 -13
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +14 -39
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +36 -82
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +84 -9
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +8 -65
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +68 -3
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +3 -11
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +11 -31
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +30 -118
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +2 -2
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +120 -9
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +8 -14
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +14 -22
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +291 -33
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +22 -622
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +35 -35
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +620 -33
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +37 -5
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +36 -8
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +1 -1
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +5 -3
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +8 -33
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +3 -178
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +31 -17
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +165 -706
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +16 -149
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +697 -149
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +150 -43
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +170 -10
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +83 -14
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +1 -1
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +41 -96
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +10 -85
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +15 -7
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +99 -26
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +8 -34
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +27 -14
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +30 -41
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +13 -6
- package/dist/index88.cjs +1 -0
- package/dist/index88.js +48 -0
- package/dist/index89.cjs +1 -0
- package/dist/index89.js +9 -0
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +2 -2
- package/dist/src/components/typography/text/Text.component.d.ts +93 -0
- package/dist/src/components/typography/text/Text.component.d.ts.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/index21.cjs +0 -1
- package/dist/index21.js +0 -22
- package/dist/index38.cjs +0 -1
- package/dist/index38.js +0 -21
- package/dist/index62.cjs +0 -1
- package/dist/index62.js +0 -297
- /package/dist/{index34.cjs → index35.cjs} +0 -0
- /package/dist/{index34.js → index35.js} +0 -0
package/dist/index65.js
CHANGED
|
@@ -1,625 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (shouldFallback) {
|
|
13
|
-
width = offsetWidth;
|
|
14
|
-
height = offsetHeight;
|
|
15
|
-
}
|
|
16
|
-
return {
|
|
17
|
-
width,
|
|
18
|
-
height,
|
|
19
|
-
$: shouldFallback
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
function unwrapElement(element) {
|
|
23
|
-
return !isElement(element) ? element.contextElement : element;
|
|
24
|
-
}
|
|
25
|
-
function getScale(element) {
|
|
26
|
-
const domElement = unwrapElement(element);
|
|
27
|
-
if (!isHTMLElement(domElement)) {
|
|
28
|
-
return createCoords(1);
|
|
29
|
-
}
|
|
30
|
-
const rect = domElement.getBoundingClientRect();
|
|
31
|
-
const {
|
|
32
|
-
width,
|
|
33
|
-
height,
|
|
34
|
-
$
|
|
35
|
-
} = getCssDimensions(domElement);
|
|
36
|
-
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
37
|
-
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
38
|
-
if (!x || !Number.isFinite(x)) {
|
|
39
|
-
x = 1;
|
|
40
|
-
}
|
|
41
|
-
if (!y || !Number.isFinite(y)) {
|
|
42
|
-
y = 1;
|
|
43
|
-
}
|
|
44
|
-
return {
|
|
45
|
-
x,
|
|
46
|
-
y
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
const noOffsets = /* @__PURE__ */ createCoords(0);
|
|
50
|
-
function getVisualOffsets(element) {
|
|
51
|
-
const win = getWindow(element);
|
|
52
|
-
if (!isWebKit() || !win.visualViewport) {
|
|
53
|
-
return noOffsets;
|
|
54
|
-
}
|
|
55
|
-
return {
|
|
56
|
-
x: win.visualViewport.offsetLeft,
|
|
57
|
-
y: win.visualViewport.offsetTop
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
61
|
-
if (isFixed === void 0) {
|
|
62
|
-
isFixed = false;
|
|
63
|
-
}
|
|
64
|
-
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
return isFixed;
|
|
68
|
-
}
|
|
69
|
-
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
70
|
-
if (includeScale === void 0) {
|
|
71
|
-
includeScale = false;
|
|
72
|
-
}
|
|
73
|
-
if (isFixedStrategy === void 0) {
|
|
74
|
-
isFixedStrategy = false;
|
|
75
|
-
}
|
|
76
|
-
const clientRect = element.getBoundingClientRect();
|
|
77
|
-
const domElement = unwrapElement(element);
|
|
78
|
-
let scale = createCoords(1);
|
|
79
|
-
if (includeScale) {
|
|
80
|
-
if (offsetParent) {
|
|
81
|
-
if (isElement(offsetParent)) {
|
|
82
|
-
scale = getScale(offsetParent);
|
|
83
|
-
}
|
|
84
|
-
} else {
|
|
85
|
-
scale = getScale(element);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
89
|
-
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
90
|
-
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
91
|
-
let width = clientRect.width / scale.x;
|
|
92
|
-
let height = clientRect.height / scale.y;
|
|
93
|
-
if (domElement) {
|
|
94
|
-
const win = getWindow(domElement);
|
|
95
|
-
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
96
|
-
let currentWin = win;
|
|
97
|
-
let currentIFrame = getFrameElement(currentWin);
|
|
98
|
-
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
99
|
-
const iframeScale = getScale(currentIFrame);
|
|
100
|
-
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
101
|
-
const css = getComputedStyle$1(currentIFrame);
|
|
102
|
-
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
103
|
-
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
104
|
-
x *= iframeScale.x;
|
|
105
|
-
y *= iframeScale.y;
|
|
106
|
-
width *= iframeScale.x;
|
|
107
|
-
height *= iframeScale.y;
|
|
108
|
-
x += left;
|
|
109
|
-
y += top;
|
|
110
|
-
currentWin = getWindow(currentIFrame);
|
|
111
|
-
currentIFrame = getFrameElement(currentWin);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return rectToClientRect({
|
|
115
|
-
width,
|
|
116
|
-
height,
|
|
117
|
-
x,
|
|
118
|
-
y
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
function getWindowScrollBarX(element, rect) {
|
|
122
|
-
const leftScroll = getNodeScroll(element).scrollLeft;
|
|
123
|
-
if (!rect) {
|
|
124
|
-
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
125
|
-
}
|
|
126
|
-
return rect.left + leftScroll;
|
|
127
|
-
}
|
|
128
|
-
function getHTMLOffset(documentElement, scroll) {
|
|
129
|
-
const htmlRect = documentElement.getBoundingClientRect();
|
|
130
|
-
const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
|
|
131
|
-
const y = htmlRect.top + scroll.scrollTop;
|
|
132
|
-
return {
|
|
133
|
-
x,
|
|
134
|
-
y
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
138
|
-
let {
|
|
139
|
-
elements,
|
|
140
|
-
rect,
|
|
141
|
-
offsetParent,
|
|
142
|
-
strategy
|
|
143
|
-
} = _ref;
|
|
144
|
-
const isFixed = strategy === "fixed";
|
|
145
|
-
const documentElement = getDocumentElement(offsetParent);
|
|
146
|
-
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
|
147
|
-
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
148
|
-
return rect;
|
|
149
|
-
}
|
|
150
|
-
let scroll = {
|
|
151
|
-
scrollLeft: 0,
|
|
152
|
-
scrollTop: 0
|
|
153
|
-
};
|
|
154
|
-
let scale = createCoords(1);
|
|
155
|
-
const offsets = createCoords(0);
|
|
156
|
-
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
157
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
158
|
-
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
159
|
-
scroll = getNodeScroll(offsetParent);
|
|
160
|
-
}
|
|
161
|
-
if (isHTMLElement(offsetParent)) {
|
|
162
|
-
const offsetRect = getBoundingClientRect(offsetParent);
|
|
163
|
-
scale = getScale(offsetParent);
|
|
164
|
-
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
165
|
-
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
169
|
-
return {
|
|
170
|
-
width: rect.width * scale.x,
|
|
171
|
-
height: rect.height * scale.y,
|
|
172
|
-
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
|
|
173
|
-
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
function getClientRects(element) {
|
|
177
|
-
return Array.from(element.getClientRects());
|
|
178
|
-
}
|
|
179
|
-
function getDocumentRect(element) {
|
|
180
|
-
const html = getDocumentElement(element);
|
|
181
|
-
const scroll = getNodeScroll(element);
|
|
182
|
-
const body = element.ownerDocument.body;
|
|
183
|
-
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
184
|
-
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
185
|
-
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
186
|
-
const y = -scroll.scrollTop;
|
|
187
|
-
if (getComputedStyle$1(body).direction === "rtl") {
|
|
188
|
-
x += max(html.clientWidth, body.clientWidth) - width;
|
|
189
|
-
}
|
|
190
|
-
return {
|
|
191
|
-
width,
|
|
192
|
-
height,
|
|
193
|
-
x,
|
|
194
|
-
y
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
const SCROLLBAR_MAX = 25;
|
|
198
|
-
function getViewportRect(element, strategy) {
|
|
199
|
-
const win = getWindow(element);
|
|
200
|
-
const html = getDocumentElement(element);
|
|
201
|
-
const visualViewport = win.visualViewport;
|
|
202
|
-
let width = html.clientWidth;
|
|
203
|
-
let height = html.clientHeight;
|
|
204
|
-
let x = 0;
|
|
205
|
-
let y = 0;
|
|
206
|
-
if (visualViewport) {
|
|
207
|
-
width = visualViewport.width;
|
|
208
|
-
height = visualViewport.height;
|
|
209
|
-
const visualViewportBased = isWebKit();
|
|
210
|
-
if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
|
|
211
|
-
x = visualViewport.offsetLeft;
|
|
212
|
-
y = visualViewport.offsetTop;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
const windowScrollbarX = getWindowScrollBarX(html);
|
|
216
|
-
if (windowScrollbarX <= 0) {
|
|
217
|
-
const doc = html.ownerDocument;
|
|
218
|
-
const body = doc.body;
|
|
219
|
-
const bodyStyles = getComputedStyle(body);
|
|
220
|
-
const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
221
|
-
const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
222
|
-
if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
|
|
223
|
-
width -= clippingStableScrollbarWidth;
|
|
224
|
-
}
|
|
225
|
-
} else if (windowScrollbarX <= SCROLLBAR_MAX) {
|
|
226
|
-
width += windowScrollbarX;
|
|
227
|
-
}
|
|
228
|
-
return {
|
|
229
|
-
width,
|
|
230
|
-
height,
|
|
231
|
-
x,
|
|
232
|
-
y
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
const absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
236
|
-
function getInnerBoundingClientRect(element, strategy) {
|
|
237
|
-
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
|
|
238
|
-
const top = clientRect.top + element.clientTop;
|
|
239
|
-
const left = clientRect.left + element.clientLeft;
|
|
240
|
-
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
241
|
-
const width = element.clientWidth * scale.x;
|
|
242
|
-
const height = element.clientHeight * scale.y;
|
|
243
|
-
const x = left * scale.x;
|
|
244
|
-
const y = top * scale.y;
|
|
245
|
-
return {
|
|
246
|
-
width,
|
|
247
|
-
height,
|
|
248
|
-
x,
|
|
249
|
-
y
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
253
|
-
let rect;
|
|
254
|
-
if (clippingAncestor === "viewport") {
|
|
255
|
-
rect = getViewportRect(element, strategy);
|
|
256
|
-
} else if (clippingAncestor === "document") {
|
|
257
|
-
rect = getDocumentRect(getDocumentElement(element));
|
|
258
|
-
} else if (isElement(clippingAncestor)) {
|
|
259
|
-
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
260
|
-
} else {
|
|
261
|
-
const visualOffsets = getVisualOffsets(element);
|
|
262
|
-
rect = {
|
|
263
|
-
x: clippingAncestor.x - visualOffsets.x,
|
|
264
|
-
y: clippingAncestor.y - visualOffsets.y,
|
|
265
|
-
width: clippingAncestor.width,
|
|
266
|
-
height: clippingAncestor.height
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
return rectToClientRect(rect);
|
|
270
|
-
}
|
|
271
|
-
function hasFixedPositionAncestor(element, stopNode) {
|
|
272
|
-
const parentNode = getParentNode(element);
|
|
273
|
-
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
274
|
-
return false;
|
|
275
|
-
}
|
|
276
|
-
return getComputedStyle$1(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
|
|
277
|
-
}
|
|
278
|
-
function getClippingElementAncestors(element, cache) {
|
|
279
|
-
const cachedResult = cache.get(element);
|
|
280
|
-
if (cachedResult) {
|
|
281
|
-
return cachedResult;
|
|
282
|
-
}
|
|
283
|
-
let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
|
|
284
|
-
let currentContainingBlockComputedStyle = null;
|
|
285
|
-
const elementIsFixed = getComputedStyle$1(element).position === "fixed";
|
|
286
|
-
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
287
|
-
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
288
|
-
const computedStyle = getComputedStyle$1(currentNode);
|
|
289
|
-
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
290
|
-
if (!currentNodeIsContaining && computedStyle.position === "fixed") {
|
|
291
|
-
currentContainingBlockComputedStyle = null;
|
|
292
|
-
}
|
|
293
|
-
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
294
|
-
if (shouldDropCurrentNode) {
|
|
295
|
-
result = result.filter((ancestor) => ancestor !== currentNode);
|
|
296
|
-
} else {
|
|
297
|
-
currentContainingBlockComputedStyle = computedStyle;
|
|
298
|
-
}
|
|
299
|
-
currentNode = getParentNode(currentNode);
|
|
300
|
-
}
|
|
301
|
-
cache.set(element, result);
|
|
302
|
-
return result;
|
|
303
|
-
}
|
|
304
|
-
function getClippingRect(_ref) {
|
|
305
|
-
let {
|
|
306
|
-
element,
|
|
307
|
-
boundary,
|
|
308
|
-
rootBoundary,
|
|
309
|
-
strategy
|
|
310
|
-
} = _ref;
|
|
311
|
-
const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
312
|
-
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
313
|
-
const firstClippingAncestor = clippingAncestors[0];
|
|
314
|
-
const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
|
|
315
|
-
const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
|
|
316
|
-
accRect.top = max(rect.top, accRect.top);
|
|
317
|
-
accRect.right = min(rect.right, accRect.right);
|
|
318
|
-
accRect.bottom = min(rect.bottom, accRect.bottom);
|
|
319
|
-
accRect.left = max(rect.left, accRect.left);
|
|
320
|
-
return accRect;
|
|
321
|
-
}, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
|
|
322
|
-
return {
|
|
323
|
-
width: clippingRect.right - clippingRect.left,
|
|
324
|
-
height: clippingRect.bottom - clippingRect.top,
|
|
325
|
-
x: clippingRect.left,
|
|
326
|
-
y: clippingRect.top
|
|
327
|
-
};
|
|
328
|
-
}
|
|
329
|
-
function getDimensions(element) {
|
|
330
|
-
const {
|
|
331
|
-
width,
|
|
332
|
-
height
|
|
333
|
-
} = getCssDimensions(element);
|
|
334
|
-
return {
|
|
335
|
-
width,
|
|
336
|
-
height
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
340
|
-
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
341
|
-
const documentElement = getDocumentElement(offsetParent);
|
|
342
|
-
const isFixed = strategy === "fixed";
|
|
343
|
-
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
344
|
-
let scroll = {
|
|
345
|
-
scrollLeft: 0,
|
|
346
|
-
scrollTop: 0
|
|
347
|
-
};
|
|
348
|
-
const offsets = createCoords(0);
|
|
349
|
-
function setLeftRTLScrollbarOffset() {
|
|
350
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
351
|
-
}
|
|
352
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
353
|
-
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
354
|
-
scroll = getNodeScroll(offsetParent);
|
|
355
|
-
}
|
|
356
|
-
if (isOffsetParentAnElement) {
|
|
357
|
-
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
358
|
-
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
359
|
-
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
360
|
-
} else if (documentElement) {
|
|
361
|
-
setLeftRTLScrollbarOffset();
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
if (isFixed && !isOffsetParentAnElement && documentElement) {
|
|
365
|
-
setLeftRTLScrollbarOffset();
|
|
366
|
-
}
|
|
367
|
-
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
368
|
-
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
369
|
-
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
370
|
-
return {
|
|
371
|
-
x,
|
|
372
|
-
y,
|
|
373
|
-
width: rect.width,
|
|
374
|
-
height: rect.height
|
|
375
|
-
};
|
|
376
|
-
}
|
|
377
|
-
function isStaticPositioned(element) {
|
|
378
|
-
return getComputedStyle$1(element).position === "static";
|
|
379
|
-
}
|
|
380
|
-
function getTrueOffsetParent(element, polyfill) {
|
|
381
|
-
if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") {
|
|
382
|
-
return null;
|
|
383
|
-
}
|
|
384
|
-
if (polyfill) {
|
|
385
|
-
return polyfill(element);
|
|
386
|
-
}
|
|
387
|
-
let rawOffsetParent = element.offsetParent;
|
|
388
|
-
if (getDocumentElement(element) === rawOffsetParent) {
|
|
389
|
-
rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
390
|
-
}
|
|
391
|
-
return rawOffsetParent;
|
|
392
|
-
}
|
|
393
|
-
function getOffsetParent(element, polyfill) {
|
|
394
|
-
const win = getWindow(element);
|
|
395
|
-
if (isTopLayer(element)) {
|
|
396
|
-
return win;
|
|
397
|
-
}
|
|
398
|
-
if (!isHTMLElement(element)) {
|
|
399
|
-
let svgOffsetParent = getParentNode(element);
|
|
400
|
-
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
|
401
|
-
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
402
|
-
return svgOffsetParent;
|
|
403
|
-
}
|
|
404
|
-
svgOffsetParent = getParentNode(svgOffsetParent);
|
|
405
|
-
}
|
|
406
|
-
return win;
|
|
407
|
-
}
|
|
408
|
-
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
409
|
-
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
|
|
410
|
-
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
411
|
-
}
|
|
412
|
-
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
|
|
413
|
-
return win;
|
|
414
|
-
}
|
|
415
|
-
return offsetParent || getContainingBlock(element) || win;
|
|
416
|
-
}
|
|
417
|
-
const getElementRects = async function(data) {
|
|
418
|
-
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
419
|
-
const getDimensionsFn = this.getDimensions;
|
|
420
|
-
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
421
|
-
return {
|
|
422
|
-
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
423
|
-
floating: {
|
|
424
|
-
x: 0,
|
|
425
|
-
y: 0,
|
|
426
|
-
width: floatingDimensions.width,
|
|
427
|
-
height: floatingDimensions.height
|
|
428
|
-
}
|
|
429
|
-
};
|
|
430
|
-
};
|
|
431
|
-
function isRTL(element) {
|
|
432
|
-
return getComputedStyle$1(element).direction === "rtl";
|
|
433
|
-
}
|
|
434
|
-
const platform = {
|
|
435
|
-
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
436
|
-
getDocumentElement,
|
|
437
|
-
getClippingRect,
|
|
438
|
-
getOffsetParent,
|
|
439
|
-
getElementRects,
|
|
440
|
-
getClientRects,
|
|
441
|
-
getDimensions,
|
|
442
|
-
getScale,
|
|
443
|
-
isElement,
|
|
444
|
-
isRTL
|
|
445
|
-
};
|
|
446
|
-
function rectsAreEqual(a, b) {
|
|
447
|
-
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
448
|
-
}
|
|
449
|
-
function observeMove(element, onMove) {
|
|
450
|
-
let io = null;
|
|
451
|
-
let timeoutId;
|
|
452
|
-
const root = getDocumentElement(element);
|
|
453
|
-
function cleanup() {
|
|
454
|
-
var _io;
|
|
455
|
-
clearTimeout(timeoutId);
|
|
456
|
-
(_io = io) == null || _io.disconnect();
|
|
457
|
-
io = null;
|
|
458
|
-
}
|
|
459
|
-
function refresh(skip, threshold) {
|
|
460
|
-
if (skip === void 0) {
|
|
461
|
-
skip = false;
|
|
462
|
-
}
|
|
463
|
-
if (threshold === void 0) {
|
|
464
|
-
threshold = 1;
|
|
465
|
-
}
|
|
466
|
-
cleanup();
|
|
467
|
-
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
468
|
-
const {
|
|
469
|
-
left,
|
|
470
|
-
top,
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Primitive } from "./index53.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
var NAME = "Arrow";
|
|
5
|
+
var Arrow = React.forwardRef((props, forwardedRef) => {
|
|
6
|
+
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
Primitive.svg,
|
|
9
|
+
{
|
|
10
|
+
...arrowProps,
|
|
11
|
+
ref: forwardedRef,
|
|
471
12
|
width,
|
|
472
|
-
height
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
const insetRight = floor(root.clientWidth - (left + width));
|
|
482
|
-
const insetBottom = floor(root.clientHeight - (top + height));
|
|
483
|
-
const insetLeft = floor(left);
|
|
484
|
-
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
485
|
-
const options = {
|
|
486
|
-
rootMargin,
|
|
487
|
-
threshold: max(0, min(1, threshold)) || 1
|
|
488
|
-
};
|
|
489
|
-
let isFirstUpdate = true;
|
|
490
|
-
function handleObserve(entries) {
|
|
491
|
-
const ratio = entries[0].intersectionRatio;
|
|
492
|
-
if (ratio !== threshold) {
|
|
493
|
-
if (!isFirstUpdate) {
|
|
494
|
-
return refresh();
|
|
495
|
-
}
|
|
496
|
-
if (!ratio) {
|
|
497
|
-
timeoutId = setTimeout(() => {
|
|
498
|
-
refresh(false, 1e-7);
|
|
499
|
-
}, 1e3);
|
|
500
|
-
} else {
|
|
501
|
-
refresh(false, ratio);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
505
|
-
refresh();
|
|
506
|
-
}
|
|
507
|
-
isFirstUpdate = false;
|
|
508
|
-
}
|
|
509
|
-
try {
|
|
510
|
-
io = new IntersectionObserver(handleObserve, {
|
|
511
|
-
...options,
|
|
512
|
-
// Handle <iframe>s
|
|
513
|
-
root: root.ownerDocument
|
|
514
|
-
});
|
|
515
|
-
} catch (_e) {
|
|
516
|
-
io = new IntersectionObserver(handleObserve, options);
|
|
517
|
-
}
|
|
518
|
-
io.observe(element);
|
|
519
|
-
}
|
|
520
|
-
refresh(true);
|
|
521
|
-
return cleanup;
|
|
522
|
-
}
|
|
523
|
-
function autoUpdate(reference, floating, update, options) {
|
|
524
|
-
if (options === void 0) {
|
|
525
|
-
options = {};
|
|
526
|
-
}
|
|
527
|
-
const {
|
|
528
|
-
ancestorScroll = true,
|
|
529
|
-
ancestorResize = true,
|
|
530
|
-
elementResize = typeof ResizeObserver === "function",
|
|
531
|
-
layoutShift = typeof IntersectionObserver === "function",
|
|
532
|
-
animationFrame = false
|
|
533
|
-
} = options;
|
|
534
|
-
const referenceEl = unwrapElement(reference);
|
|
535
|
-
const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
|
|
536
|
-
ancestors.forEach((ancestor) => {
|
|
537
|
-
ancestorScroll && ancestor.addEventListener("scroll", update, {
|
|
538
|
-
passive: true
|
|
539
|
-
});
|
|
540
|
-
ancestorResize && ancestor.addEventListener("resize", update);
|
|
541
|
-
});
|
|
542
|
-
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
543
|
-
let reobserveFrame = -1;
|
|
544
|
-
let resizeObserver = null;
|
|
545
|
-
if (elementResize) {
|
|
546
|
-
resizeObserver = new ResizeObserver((_ref) => {
|
|
547
|
-
let [firstEntry] = _ref;
|
|
548
|
-
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
549
|
-
resizeObserver.unobserve(floating);
|
|
550
|
-
cancelAnimationFrame(reobserveFrame);
|
|
551
|
-
reobserveFrame = requestAnimationFrame(() => {
|
|
552
|
-
var _resizeObserver;
|
|
553
|
-
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
|
|
554
|
-
});
|
|
555
|
-
}
|
|
556
|
-
update();
|
|
557
|
-
});
|
|
558
|
-
if (referenceEl && !animationFrame) {
|
|
559
|
-
resizeObserver.observe(referenceEl);
|
|
560
|
-
}
|
|
561
|
-
resizeObserver.observe(floating);
|
|
562
|
-
}
|
|
563
|
-
let frameId;
|
|
564
|
-
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
565
|
-
if (animationFrame) {
|
|
566
|
-
frameLoop();
|
|
567
|
-
}
|
|
568
|
-
function frameLoop() {
|
|
569
|
-
const nextRefRect = getBoundingClientRect(reference);
|
|
570
|
-
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
|
|
571
|
-
update();
|
|
572
|
-
}
|
|
573
|
-
prevRefRect = nextRefRect;
|
|
574
|
-
frameId = requestAnimationFrame(frameLoop);
|
|
575
|
-
}
|
|
576
|
-
update();
|
|
577
|
-
return () => {
|
|
578
|
-
var _resizeObserver2;
|
|
579
|
-
ancestors.forEach((ancestor) => {
|
|
580
|
-
ancestorScroll && ancestor.removeEventListener("scroll", update);
|
|
581
|
-
ancestorResize && ancestor.removeEventListener("resize", update);
|
|
582
|
-
});
|
|
583
|
-
cleanupIo == null || cleanupIo();
|
|
584
|
-
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
|
|
585
|
-
resizeObserver = null;
|
|
586
|
-
if (animationFrame) {
|
|
587
|
-
cancelAnimationFrame(frameId);
|
|
588
|
-
}
|
|
589
|
-
};
|
|
590
|
-
}
|
|
591
|
-
const offset = offset$1;
|
|
592
|
-
const shift = shift$1;
|
|
593
|
-
const flip = flip$1;
|
|
594
|
-
const size = size$1;
|
|
595
|
-
const hide = hide$1;
|
|
596
|
-
const arrow = arrow$1;
|
|
597
|
-
const limitShift = limitShift$1;
|
|
598
|
-
const computePosition = (reference, floating, options) => {
|
|
599
|
-
const cache = /* @__PURE__ */ new Map();
|
|
600
|
-
const mergedOptions = {
|
|
601
|
-
platform,
|
|
602
|
-
...options
|
|
603
|
-
};
|
|
604
|
-
const platformWithCache = {
|
|
605
|
-
...mergedOptions.platform,
|
|
606
|
-
_c: cache
|
|
607
|
-
};
|
|
608
|
-
return computePosition$1(reference, floating, {
|
|
609
|
-
...mergedOptions,
|
|
610
|
-
platform: platformWithCache
|
|
611
|
-
});
|
|
612
|
-
};
|
|
13
|
+
height,
|
|
14
|
+
viewBox: "0 0 30 10",
|
|
15
|
+
preserveAspectRatio: "none",
|
|
16
|
+
children: props.asChild ? children : /* @__PURE__ */ jsx("polygon", { points: "0,0 30,0 15,10" })
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
Arrow.displayName = NAME;
|
|
21
|
+
var Root = Arrow;
|
|
613
22
|
export {
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
computePosition,
|
|
617
|
-
flip,
|
|
618
|
-
getOverflowAncestors,
|
|
619
|
-
hide,
|
|
620
|
-
limitShift,
|
|
621
|
-
offset,
|
|
622
|
-
platform,
|
|
623
|
-
shift,
|
|
624
|
-
size
|
|
23
|
+
Arrow,
|
|
24
|
+
Root
|
|
625
25
|
};
|
package/dist/index66.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./index57.cjs");function r(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const o=r(e);exports.useSize=function(e){const[r,i]=o.useState(void 0);return t.useLayoutEffect(()=>{if(e){i({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,n;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,n=t.blockSize}else o=e.offsetWidth,n=e.offsetHeight;i({width:o,height:n})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}i(void 0)},[e]),r};
|