@adam-milo/ui 1.0.24 → 1.0.25

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 (158) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +3 -1
  3. package/dist/index10.cjs +1 -1
  4. package/dist/index10.js +1 -1
  5. package/dist/index11.cjs +1 -1
  6. package/dist/index11.js +1 -1
  7. package/dist/index12.cjs +1 -1
  8. package/dist/index12.js +1 -1
  9. package/dist/index13.cjs +1 -1
  10. package/dist/index13.js +1 -1
  11. package/dist/index14.cjs +1 -1
  12. package/dist/index14.js +1 -1
  13. package/dist/index15.cjs +1 -1
  14. package/dist/index15.js +2 -2
  15. package/dist/index16.cjs +1 -1
  16. package/dist/index16.js +1 -1
  17. package/dist/index17.cjs +1 -1
  18. package/dist/index17.js +1 -1
  19. package/dist/index18.cjs +1 -1
  20. package/dist/index18.js +36 -12
  21. package/dist/index19.cjs +1 -0
  22. package/dist/index19.js +14 -0
  23. package/dist/index2.cjs +1 -1
  24. package/dist/index2.js +1 -1
  25. package/dist/index21.cjs +1 -1
  26. package/dist/index21.js +20 -299
  27. package/dist/index22.cjs +1 -1
  28. package/dist/index22.js +298 -13
  29. package/dist/index23.cjs +1 -0
  30. package/dist/index23.js +16 -0
  31. package/dist/{index25.cjs → index26.cjs} +1 -1
  32. package/dist/{index25.js → index26.js} +21 -21
  33. package/dist/index3.cjs +1 -1
  34. package/dist/index3.js +2 -2
  35. package/dist/index38.cjs +1 -1
  36. package/dist/index38.js +18 -3
  37. package/dist/index4.cjs +1 -1
  38. package/dist/index4.js +1 -1
  39. package/dist/index40.cjs +1 -1
  40. package/dist/index40.js +3 -67
  41. package/dist/index41.cjs +1 -1
  42. package/dist/index41.js +6 -34
  43. package/dist/index42.cjs +1 -1
  44. package/dist/index42.js +64 -58
  45. package/dist/index43.cjs +1 -1
  46. package/dist/index43.js +35 -6
  47. package/dist/index44.cjs +1 -1
  48. package/dist/index44.js +53 -201
  49. package/dist/index45.cjs +1 -1
  50. package/dist/index45.js +6 -25
  51. package/dist/index46.cjs +1 -1
  52. package/dist/index46.js +190 -186
  53. package/dist/index47.cjs +1 -1
  54. package/dist/index47.js +24 -9
  55. package/dist/index48.cjs +1 -1
  56. package/dist/index48.js +193 -278
  57. package/dist/index49.cjs +1 -1
  58. package/dist/index49.js +11 -15
  59. package/dist/index5.cjs +1 -1
  60. package/dist/index5.js +1 -1
  61. package/dist/index50.cjs +1 -1
  62. package/dist/index50.js +287 -37
  63. package/dist/index51.cjs +1 -1
  64. package/dist/index51.js +14 -85
  65. package/dist/index52.cjs +1 -1
  66. package/dist/index52.js +38 -9
  67. package/dist/index53.cjs +1 -1
  68. package/dist/index53.js +80 -62
  69. package/dist/index54.cjs +1 -1
  70. package/dist/index54.js +11 -3
  71. package/dist/index55.cjs +1 -1
  72. package/dist/index55.js +66 -9
  73. package/dist/index56.cjs +1 -1
  74. package/dist/index56.js +3 -31
  75. package/dist/index57.cjs +1 -1
  76. package/dist/index57.js +12 -120
  77. package/dist/index58.cjs +1 -1
  78. package/dist/index58.js +30 -7
  79. package/dist/index59.cjs +1 -1
  80. package/dist/index59.js +118 -13
  81. package/dist/index6.cjs +1 -1
  82. package/dist/index6.js +2 -2
  83. package/dist/index60.cjs +1 -1
  84. package/dist/index60.js +7 -293
  85. package/dist/index61.cjs +1 -1
  86. package/dist/index61.js +14 -22
  87. package/dist/index62.cjs +1 -1
  88. package/dist/index62.js +291 -33
  89. package/dist/index63.cjs +1 -1
  90. package/dist/index63.js +22 -622
  91. package/dist/index64.cjs +1 -1
  92. package/dist/index64.js +35 -35
  93. package/dist/index65.cjs +1 -1
  94. package/dist/index65.js +620 -33
  95. package/dist/index66.cjs +1 -1
  96. package/dist/index66.js +37 -5
  97. package/dist/index67.cjs +1 -1
  98. package/dist/index67.js +36 -8
  99. package/dist/index68.cjs +1 -1
  100. package/dist/index68.js +5 -3
  101. package/dist/index69.cjs +1 -1
  102. package/dist/index69.js +8 -33
  103. package/dist/index7.cjs +1 -1
  104. package/dist/index7.js +1 -1
  105. package/dist/index70.cjs +1 -1
  106. package/dist/index70.js +3 -178
  107. package/dist/index71.cjs +1 -1
  108. package/dist/index71.js +31 -17
  109. package/dist/index72.cjs +1 -1
  110. package/dist/index72.js +165 -706
  111. package/dist/index73.cjs +1 -1
  112. package/dist/index73.js +16 -149
  113. package/dist/index74.cjs +1 -1
  114. package/dist/index74.js +697 -149
  115. package/dist/index75.cjs +1 -1
  116. package/dist/index75.js +146 -80
  117. package/dist/index76.cjs +1 -1
  118. package/dist/index76.js +170 -44
  119. package/dist/index77.cjs +1 -1
  120. package/dist/index77.js +44 -10
  121. package/dist/index78.cjs +1 -1
  122. package/dist/index78.js +11 -17
  123. package/dist/index79.cjs +1 -1
  124. package/dist/index79.js +14 -97
  125. package/dist/index8.cjs +1 -1
  126. package/dist/index8.js +1 -1
  127. package/dist/index80.cjs +1 -1
  128. package/dist/index80.js +99 -8
  129. package/dist/index81.cjs +1 -1
  130. package/dist/index81.js +82 -23
  131. package/dist/index82.cjs +1 -1
  132. package/dist/index82.js +9 -14
  133. package/dist/index83.cjs +1 -1
  134. package/dist/index83.js +25 -44
  135. package/dist/index84.cjs +1 -1
  136. package/dist/index84.js +33 -5
  137. package/dist/index85.cjs +1 -1
  138. package/dist/index85.js +12 -33
  139. package/dist/index86.cjs +1 -0
  140. package/dist/index86.js +48 -0
  141. package/dist/index87.cjs +1 -0
  142. package/dist/index87.js +9 -0
  143. package/dist/index9.cjs +1 -1
  144. package/dist/index9.js +2 -2
  145. package/dist/src/components/layout/container/Container.component.d.ts +26 -0
  146. package/dist/src/components/layout/container/Container.component.d.ts.map +1 -0
  147. package/dist/src/index.d.ts +2 -0
  148. package/dist/src/index.d.ts.map +1 -1
  149. package/dist/style.css +1 -1
  150. package/package.json +1 -1
  151. package/dist/index20.cjs +0 -1
  152. package/dist/index20.js +0 -22
  153. package/dist/index36.cjs +0 -1
  154. package/dist/index36.js +0 -21
  155. package/dist/index39.cjs +0 -1
  156. package/dist/index39.js +0 -11
  157. /package/dist/{index33.cjs → index34.cjs} +0 -0
  158. /package/dist/{index33.js → index34.js} +0 -0
package/dist/index65.js CHANGED
@@ -1,38 +1,625 @@
1
- import { __rest, __assign } from "./index64.js";
2
- import * as React from "react";
3
- import { zeroRightClassName, fullWidthClassName } from "./index67.js";
4
- import { effectCar } from "./index68.js";
5
- import { useMergeRefs } from "./index69.js";
6
- var nothing = function() {
7
- return;
1
+ import { offset as offset$1, shift as shift$1, flip as flip$1, size as size$1, hide as hide$1, limitShift as limitShift$1, computePosition as computePosition$1, arrow as arrow$1 } from "./index74.js";
2
+ import { createCoords, round, max, min, rectToClientRect, floor } from "./index75.js";
3
+ import { isElement, getDocumentElement, getOverflowAncestors, getComputedStyle as getComputedStyle$1, isHTMLElement, getWindow, isTopLayer, getParentNode, isLastTraversableNode, isTableElement, isContainingBlock, getContainingBlock, getNodeName, isOverflowElement, getNodeScroll, getFrameElement, isWebKit } from "./index76.js";
4
+ function getCssDimensions(element) {
5
+ const css = getComputedStyle$1(element);
6
+ let width = parseFloat(css.width) || 0;
7
+ let height = parseFloat(css.height) || 0;
8
+ const hasOffset = isHTMLElement(element);
9
+ const offsetWidth = hasOffset ? element.offsetWidth : width;
10
+ const offsetHeight = hasOffset ? element.offsetHeight : height;
11
+ const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
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
+ };
8
430
  };
9
- var RemoveScroll = React.forwardRef(function(props, parentRef) {
10
- var ref = React.useRef(null);
11
- var _a = React.useState({
12
- onScrollCapture: nothing,
13
- onWheelCapture: nothing,
14
- onTouchMoveCapture: nothing
15
- }), callbacks = _a[0], setCallbacks = _a[1];
16
- var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? "div" : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]);
17
- var SideCar = sideCar;
18
- var containerRef = useMergeRefs([ref, parentRef]);
19
- var containerProps = __assign(__assign({}, rest), callbacks);
20
- return React.createElement(
21
- React.Fragment,
22
- null,
23
- enabled && React.createElement(SideCar, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
24
- forwardProps ? React.cloneElement(React.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
25
- );
26
- });
27
- RemoveScroll.defaultProps = {
28
- enabled: true,
29
- removeScrollBar: true,
30
- inert: false
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
31
445
  };
32
- RemoveScroll.classNames = {
33
- fullWidth: fullWidthClassName,
34
- zeroRight: zeroRightClassName
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,
471
+ width,
472
+ height
473
+ } = elementRectForRootMargin;
474
+ if (!skip) {
475
+ onMove();
476
+ }
477
+ if (!width || !height) {
478
+ return;
479
+ }
480
+ const insetTop = floor(top);
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
+ });
35
612
  };
36
613
  export {
37
- RemoveScroll
614
+ arrow,
615
+ autoUpdate,
616
+ computePosition,
617
+ flip,
618
+ getOverflowAncestors,
619
+ hide,
620
+ limitShift,
621
+ offset,
622
+ platform,
623
+ shift,
624
+ size
38
625
  };
package/dist/index66.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./index70.cjs"),r=require("./index68.cjs"),i=require("./index71.cjs").exportSidecar(r.effectCar,e.RemoveScrollSideCar);module.exports=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),exports.__assign=function(){return exports.__assign=Object.assign||function(r){for(var t,e=1,o=arguments.length;e<o;e++)for(var n in t=arguments[e])Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r},exports.__assign.apply(this,arguments)},"function"==typeof SuppressedError&&SuppressedError,exports.__rest=function(r,t){var e={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&t.indexOf(o)<0&&(e[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(r);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(r,o[n])&&(e[o[n]]=r[o[n]])}return e},exports.__spreadArray=function(r,t,e){if(e||2===arguments.length)for(var o,n=0,p=t.length;n<p;n++)!o&&n in t||(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return r.concat(o||Array.prototype.slice.call(t))};