@drjoshcsimmons/scl 0.1.0 → 0.1.1

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 (195) hide show
  1. package/dist/components/ui/alert/alert.d.ts +1 -1
  2. package/dist/components/ui/alert/alert.d.ts.map +1 -1
  3. package/dist/components/ui/badge/badge.d.ts +1 -1
  4. package/dist/components/ui/badge/badge.d.ts.map +1 -1
  5. package/dist/components/ui/button/button.d.ts +1 -1
  6. package/dist/components/ui/button/button.d.ts.map +1 -1
  7. package/dist/components/ui/combobox/combobox.d.ts +31 -0
  8. package/dist/components/ui/combobox/combobox.d.ts.map +1 -0
  9. package/dist/components/ui/combobox/index.d.ts +3 -0
  10. package/dist/components/ui/combobox/index.d.ts.map +1 -0
  11. package/dist/components/ui/command/command.d.ts +85 -0
  12. package/dist/components/ui/command/command.d.ts.map +1 -0
  13. package/dist/components/ui/command/index.d.ts +2 -0
  14. package/dist/components/ui/command/index.d.ts.map +1 -0
  15. package/dist/components/ui/dithered-image/dithered-image.d.ts +6 -2
  16. package/dist/components/ui/dithered-image/dithered-image.d.ts.map +1 -1
  17. package/dist/components/ui/dithered-image/index.d.ts +1 -1
  18. package/dist/components/ui/dithered-image/index.d.ts.map +1 -1
  19. package/dist/components/ui/form/form.d.ts +24 -0
  20. package/dist/components/ui/form/form.d.ts.map +1 -0
  21. package/dist/components/ui/form/index.d.ts +2 -0
  22. package/dist/components/ui/form/index.d.ts.map +1 -0
  23. package/dist/components/ui/progress/progress.d.ts +0 -6
  24. package/dist/components/ui/progress/progress.d.ts.map +1 -1
  25. package/dist/components/ui/scroll-area/scroll-area.d.ts.map +1 -1
  26. package/dist/components/ui/skeleton/skeleton.d.ts +4 -1
  27. package/dist/components/ui/skeleton/skeleton.d.ts.map +1 -1
  28. package/dist/components/ui/statusline/statusline.d.ts.map +1 -1
  29. package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts +0 -5
  30. package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts.map +1 -1
  31. package/dist/index.d.ts +3 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +166 -143
  34. package/dist/index10.js +30 -30
  35. package/dist/index100.js +9 -30
  36. package/dist/index101.js +50 -15
  37. package/dist/index102.js +212 -128
  38. package/dist/index103.js +4 -50
  39. package/dist/index104.js +30 -9
  40. package/dist/index105.js +6 -4
  41. package/dist/index106.js +19 -179
  42. package/dist/index107.js +9 -650
  43. package/dist/index108.js +38 -107
  44. package/dist/index109.js +17 -90
  45. package/dist/index11.js +13 -13
  46. package/dist/index110.js +11 -66
  47. package/dist/index111.js +201 -154
  48. package/dist/index112.js +20 -395
  49. package/dist/index113.js +395 -1675
  50. package/dist/index114.js +2 -278
  51. package/dist/index115.js +49 -128
  52. package/dist/index116.js +65 -32
  53. package/dist/index117.js +2 -1611
  54. package/dist/index118.js +2 -298
  55. package/dist/index119.js +22 -632
  56. package/dist/index12.js +1 -1
  57. package/dist/index120.js +29 -144
  58. package/dist/index121.js +5 -21
  59. package/dist/index122.js +5 -9
  60. package/dist/index123.js +3 -38
  61. package/dist/index124.js +24 -18
  62. package/dist/index125.js +113 -6
  63. package/dist/index126.js +15 -11
  64. package/dist/index127.js +513 -194
  65. package/dist/index128.js +128 -22
  66. package/dist/index129.js +114 -380
  67. package/dist/index13.js +132 -93
  68. package/dist/index130.js +59 -1300
  69. package/dist/index131.js +63 -612
  70. package/dist/index132.js +9 -2
  71. package/dist/index133.js +13 -52
  72. package/dist/index134.js +64 -63
  73. package/dist/index135.js +3 -24
  74. package/dist/index136.js +23 -29
  75. package/dist/index137.js +23 -5
  76. package/dist/index138.js +13 -2
  77. package/dist/index139.js +28 -2
  78. package/dist/index14.js +106 -220
  79. package/dist/index140.js +5 -5
  80. package/dist/index15.js +79 -125
  81. package/dist/index16.js +280 -17
  82. package/dist/index17.js +139 -12
  83. package/dist/index18.js +92 -22
  84. package/dist/index19.js +18 -55
  85. package/dist/index2.js +2 -2
  86. package/dist/index20.js +14 -26
  87. package/dist/index21.js +19 -33
  88. package/dist/index22.js +38 -121
  89. package/dist/index23.js +29 -22
  90. package/dist/index24.js +31 -64
  91. package/dist/index25.js +121 -15
  92. package/dist/index26.js +19 -29
  93. package/dist/index27.js +68 -77
  94. package/dist/index28.js +20 -25
  95. package/dist/index29.js +32 -88
  96. package/dist/index3.js +11 -9
  97. package/dist/index30.js +138 -38
  98. package/dist/index31.js +20 -227
  99. package/dist/index32.js +88 -18
  100. package/dist/index33.js +37 -28
  101. package/dist/index34.js +86 -22
  102. package/dist/index35.js +17 -102
  103. package/dist/index36.js +34 -65
  104. package/dist/index37.js +23 -49
  105. package/dist/index38.js +38 -99
  106. package/dist/index39.js +65 -10
  107. package/dist/index4.js +6 -6
  108. package/dist/index40.js +49 -15
  109. package/dist/index41.js +93 -2256
  110. package/dist/index42.js +10 -32
  111. package/dist/index43.js +15 -18
  112. package/dist/index44.js +2251 -225
  113. package/dist/index45.js +33 -11
  114. package/dist/index46.js +116 -64
  115. package/dist/index47.js +207 -219
  116. package/dist/index48.js +5 -3
  117. package/dist/index49.js +54 -330
  118. package/dist/index5.js +23 -23
  119. package/dist/index50.js +244 -55
  120. package/dist/index51.js +9 -241
  121. package/dist/index52.js +60 -847
  122. package/dist/index53.js +236 -9
  123. package/dist/index54.js +11 -118
  124. package/dist/index55.js +300 -215
  125. package/dist/index56.js +4 -3
  126. package/dist/index57.js +225 -11
  127. package/dist/index58.js +11 -236
  128. package/dist/index59.js +27 -256
  129. package/dist/index6.js +12 -12
  130. package/dist/index60.js +260 -12
  131. package/dist/index61.js +12 -22
  132. package/dist/index62.js +94 -506
  133. package/dist/index63.js +12 -6155
  134. package/dist/index64.js +20 -2631
  135. package/dist/index65.js +16 -296
  136. package/dist/index66.js +232 -663
  137. package/dist/index67.js +125 -825
  138. package/dist/index68.js +159 -23
  139. package/dist/index69.js +241 -315
  140. package/dist/index7.js +22 -22
  141. package/dist/index70.js +72 -4889
  142. package/dist/index71.js +503 -802
  143. package/dist/index72.js +412 -1235
  144. package/dist/index73.js +323 -521
  145. package/dist/index74.js +839 -104
  146. package/dist/index75.js +9 -161
  147. package/dist/index76.js +67 -30
  148. package/dist/index77.js +22 -430
  149. package/dist/index78.js +6 -129
  150. package/dist/index79.js +48 -75
  151. package/dist/index8.js +17 -18
  152. package/dist/index80.js +42 -64
  153. package/dist/index81.js +50 -44
  154. package/dist/index82.js +32 -25
  155. package/dist/index83.js +10 -6
  156. package/dist/index84.js +7 -51
  157. package/dist/index85.js +5 -33
  158. package/dist/index86.js +24 -10
  159. package/dist/index87.js +68 -7
  160. package/dist/index88.js +55 -30
  161. package/dist/index89.js +10 -54
  162. package/dist/index9.js +23 -31
  163. package/dist/index90.js +4 -11
  164. package/dist/index91.js +30 -4
  165. package/dist/index92.js +1 -1
  166. package/dist/index93.js +180 -5
  167. package/dist/index94.js +14 -24
  168. package/dist/index95.js +643 -62
  169. package/dist/index96.js +5 -5
  170. package/dist/index97.js +128 -212
  171. package/dist/index98.js +2 -2
  172. package/dist/index99.js +13 -52
  173. package/dist/tokens/colors.d.ts +26 -86
  174. package/dist/tokens/colors.d.ts.map +1 -1
  175. package/dist/tokens/index.d.ts +12 -84
  176. package/dist/tokens/index.d.ts.map +1 -1
  177. package/package.json +26 -22
  178. package/dist/index141.js +0 -5
  179. package/dist/index142.js +0 -26
  180. package/dist/index143.js +0 -115
  181. package/dist/index144.js +0 -18
  182. package/dist/index145.js +0 -527
  183. package/dist/index146.js +0 -130
  184. package/dist/index147.js +0 -136
  185. package/dist/index148.js +0 -67
  186. package/dist/index149.js +0 -71
  187. package/dist/index150.js +0 -11
  188. package/dist/index151.js +0 -16
  189. package/dist/index152.js +0 -68
  190. package/dist/index153.js +0 -6
  191. package/dist/index154.js +0 -25
  192. package/dist/index155.js +0 -25
  193. package/dist/index156.js +0 -15
  194. package/dist/index157.js +0 -30
  195. package/dist/index158.js +0 -7
package/dist/index127.js CHANGED
@@ -1,208 +1,527 @@
1
- import { computePosition as I, offset as J, shift as K, flip as N, size as Q, hide as T, limitShift as X, arrow as z } from "./index129.js";
2
- import { autoUpdate as pe, platform as ge } from "./index129.js";
3
- import * as o from "react";
4
- import { useLayoutEffect as Y } from "react";
5
- import * as Z from "react-dom";
6
- var b = typeof document < "u", ee = function() {
7
- }, w = b ? Y : ee;
8
- function R(e, t) {
9
- if (e === t)
10
- return !0;
11
- if (typeof e != typeof t)
12
- return !1;
13
- if (typeof e == "function" && e.toString() === t.toString())
14
- return !0;
15
- let n, r, i;
16
- if (e && t && typeof e == "object") {
17
- if (Array.isArray(e)) {
18
- if (n = e.length, n !== t.length) return !1;
19
- for (r = n; r-- !== 0; )
20
- if (!R(e[r], t[r]))
21
- return !1;
22
- return !0;
23
- }
24
- if (i = Object.keys(e), n = i.length, n !== Object.keys(t).length)
25
- return !1;
26
- for (r = n; r-- !== 0; )
27
- if (!{}.hasOwnProperty.call(t, i[r]))
28
- return !1;
29
- for (r = n; r-- !== 0; ) {
30
- const p = i[r];
31
- if (!(p === "_owner" && e.$$typeof) && !R(e[p], t[p]))
32
- return !1;
33
- }
34
- return !0;
1
+ import { evaluate as L, getSideAxis as T, getSide as j, clamp as X, getOppositePlacement as ee, getExpandedPlacements as te, getOppositeAxisPlacements as ne, getAlignmentSides as ie, getAlignment as z, min as $, max as W, getPaddingObject as J, rectToClientRect as _, getOppositeAxis as K, getAlignmentAxis as N, sides as se, getAxisLength as Q } from "./index128.js";
2
+ function I(t, e, d) {
3
+ let {
4
+ reference: a,
5
+ floating: r
6
+ } = t;
7
+ const n = T(e), o = N(e), m = Q(o), u = j(e), h = n === "y", c = a.x + a.width / 2 - r.width / 2, s = a.y + a.height / 2 - r.height / 2, f = a[m] / 2 - r[m] / 2;
8
+ let i;
9
+ switch (u) {
10
+ case "top":
11
+ i = {
12
+ x: c,
13
+ y: a.y - r.height
14
+ };
15
+ break;
16
+ case "bottom":
17
+ i = {
18
+ x: c,
19
+ y: a.y + a.height
20
+ };
21
+ break;
22
+ case "right":
23
+ i = {
24
+ x: a.x + a.width,
25
+ y: s
26
+ };
27
+ break;
28
+ case "left":
29
+ i = {
30
+ x: a.x - r.width,
31
+ y: s
32
+ };
33
+ break;
34
+ default:
35
+ i = {
36
+ x: a.x,
37
+ y: a.y
38
+ };
35
39
  }
36
- return e !== e && t !== t;
40
+ switch (z(e)) {
41
+ case "start":
42
+ i[o] -= f * (d && h ? -1 : 1);
43
+ break;
44
+ case "end":
45
+ i[o] += f * (d && h ? -1 : 1);
46
+ break;
47
+ }
48
+ return i;
37
49
  }
38
- function A(e) {
39
- return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
50
+ const ce = async (t, e, d) => {
51
+ const {
52
+ placement: a = "bottom",
53
+ strategy: r = "absolute",
54
+ middleware: n = [],
55
+ platform: o
56
+ } = d, m = n.filter(Boolean), u = await (o.isRTL == null ? void 0 : o.isRTL(e));
57
+ let h = await o.getElementRects({
58
+ reference: t,
59
+ floating: e,
60
+ strategy: r
61
+ }), {
62
+ x: c,
63
+ y: s
64
+ } = I(h, a, u), f = a, i = {}, l = 0;
65
+ for (let g = 0; g < m.length; g++) {
66
+ const {
67
+ name: x,
68
+ fn: y
69
+ } = m[g], {
70
+ x: A,
71
+ y: p,
72
+ data: v,
73
+ reset: w
74
+ } = await y({
75
+ x: c,
76
+ y: s,
77
+ initialPlacement: a,
78
+ placement: f,
79
+ strategy: r,
80
+ middlewareData: i,
81
+ rects: h,
82
+ platform: o,
83
+ elements: {
84
+ reference: t,
85
+ floating: e
86
+ }
87
+ });
88
+ c = A ?? c, s = p ?? s, i = {
89
+ ...i,
90
+ [x]: {
91
+ ...i[x],
92
+ ...v
93
+ }
94
+ }, w && l <= 50 && (l++, typeof w == "object" && (w.placement && (f = w.placement), w.rects && (h = w.rects === !0 ? await o.getElementRects({
95
+ reference: t,
96
+ floating: e,
97
+ strategy: r
98
+ }) : w.rects), {
99
+ x: c,
100
+ y: s
101
+ } = I(h, f, u)), g = -1);
102
+ }
103
+ return {
104
+ x: c,
105
+ y: s,
106
+ placement: f,
107
+ strategy: r,
108
+ middlewareData: i
109
+ };
110
+ };
111
+ async function Y(t, e) {
112
+ var d;
113
+ e === void 0 && (e = {});
114
+ const {
115
+ x: a,
116
+ y: r,
117
+ platform: n,
118
+ rects: o,
119
+ elements: m,
120
+ strategy: u
121
+ } = t, {
122
+ boundary: h = "clippingAncestors",
123
+ rootBoundary: c = "viewport",
124
+ elementContext: s = "floating",
125
+ altBoundary: f = !1,
126
+ padding: i = 0
127
+ } = L(e, t), l = J(i), x = m[f ? s === "floating" ? "reference" : "floating" : s], y = _(await n.getClippingRect({
128
+ element: (d = await (n.isElement == null ? void 0 : n.isElement(x))) == null || d ? x : x.contextElement || await (n.getDocumentElement == null ? void 0 : n.getDocumentElement(m.floating)),
129
+ boundary: h,
130
+ rootBoundary: c,
131
+ strategy: u
132
+ })), A = s === "floating" ? {
133
+ x: a,
134
+ y: r,
135
+ width: o.floating.width,
136
+ height: o.floating.height
137
+ } : o.reference, p = await (n.getOffsetParent == null ? void 0 : n.getOffsetParent(m.floating)), v = await (n.isElement == null ? void 0 : n.isElement(p)) ? await (n.getScale == null ? void 0 : n.getScale(p)) || {
138
+ x: 1,
139
+ y: 1
140
+ } : {
141
+ x: 1,
142
+ y: 1
143
+ }, w = _(n.convertOffsetParentRelativeRectToViewportRelativeRect ? await n.convertOffsetParentRelativeRectToViewportRelativeRect({
144
+ elements: m,
145
+ rect: A,
146
+ offsetParent: p,
147
+ strategy: u
148
+ }) : A);
149
+ return {
150
+ top: (y.top - w.top + l.top) / v.y,
151
+ bottom: (w.bottom - y.bottom + l.bottom) / v.y,
152
+ left: (y.left - w.left + l.left) / v.x,
153
+ right: (w.right - y.right + l.right) / v.x
154
+ };
40
155
  }
41
- function L(e, t) {
42
- const n = A(e);
43
- return Math.round(t * n) / n;
156
+ const le = (t) => ({
157
+ name: "arrow",
158
+ options: t,
159
+ async fn(e) {
160
+ const {
161
+ x: d,
162
+ y: a,
163
+ placement: r,
164
+ rects: n,
165
+ platform: o,
166
+ elements: m,
167
+ middlewareData: u
168
+ } = e, {
169
+ element: h,
170
+ padding: c = 0
171
+ } = L(t, e) || {};
172
+ if (h == null)
173
+ return {};
174
+ const s = J(c), f = {
175
+ x: d,
176
+ y: a
177
+ }, i = N(r), l = Q(i), g = await o.getDimensions(h), x = i === "y", y = x ? "top" : "left", A = x ? "bottom" : "right", p = x ? "clientHeight" : "clientWidth", v = n.reference[l] + n.reference[i] - f[i] - n.floating[l], w = f[i] - n.reference[i], P = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(h));
178
+ let C = P ? P[p] : 0;
179
+ (!C || !await (o.isElement == null ? void 0 : o.isElement(P))) && (C = m.floating[p] || n.floating[l]);
180
+ const M = v / 2 - w / 2, k = C / 2 - g[l] / 2 - 1, O = $(s[y], k), H = $(s[A], k), D = O, F = C - g[l] - H, b = C / 2 - g[l] / 2 + M, B = X(D, b, F), E = !u.arrow && z(r) != null && b !== B && n.reference[l] / 2 - (b < D ? O : H) - g[l] / 2 < 0, S = E ? b < D ? b - D : b - F : 0;
181
+ return {
182
+ [i]: f[i] + S,
183
+ data: {
184
+ [i]: B,
185
+ centerOffset: b - B - S,
186
+ ...E && {
187
+ alignmentOffset: S
188
+ }
189
+ },
190
+ reset: E
191
+ };
192
+ }
193
+ }), re = function(t) {
194
+ return t === void 0 && (t = {}), {
195
+ name: "flip",
196
+ options: t,
197
+ async fn(e) {
198
+ var d, a;
199
+ const {
200
+ placement: r,
201
+ middlewareData: n,
202
+ rects: o,
203
+ initialPlacement: m,
204
+ platform: u,
205
+ elements: h
206
+ } = e, {
207
+ mainAxis: c = !0,
208
+ crossAxis: s = !0,
209
+ fallbackPlacements: f,
210
+ fallbackStrategy: i = "bestFit",
211
+ fallbackAxisSideDirection: l = "none",
212
+ flipAlignment: g = !0,
213
+ ...x
214
+ } = L(t, e);
215
+ if ((d = n.arrow) != null && d.alignmentOffset)
216
+ return {};
217
+ const y = j(r), A = T(m), p = j(m) === m, v = await (u.isRTL == null ? void 0 : u.isRTL(h.floating)), w = f || (p || !g ? [ee(m)] : te(m)), P = l !== "none";
218
+ !f && P && w.push(...ne(m, g, l, v));
219
+ const C = [m, ...w], M = await Y(e, x), k = [];
220
+ let O = ((a = n.flip) == null ? void 0 : a.overflows) || [];
221
+ if (c && k.push(M[y]), s) {
222
+ const b = ie(r, o, v);
223
+ k.push(M[b[0]], M[b[1]]);
224
+ }
225
+ if (O = [...O, {
226
+ placement: r,
227
+ overflows: k
228
+ }], !k.every((b) => b <= 0)) {
229
+ var H, D;
230
+ const b = (((H = n.flip) == null ? void 0 : H.index) || 0) + 1, B = C[b];
231
+ if (B && (!(s === "alignment" ? A !== T(B) : !1) || // We leave the current main axis only if every placement on that axis
232
+ // overflows the main axis.
233
+ O.every((R) => T(R.placement) === A ? R.overflows[0] > 0 : !0)))
234
+ return {
235
+ data: {
236
+ index: b,
237
+ overflows: O
238
+ },
239
+ reset: {
240
+ placement: B
241
+ }
242
+ };
243
+ let E = (D = O.filter((S) => S.overflows[0] <= 0).sort((S, R) => S.overflows[1] - R.overflows[1])[0]) == null ? void 0 : D.placement;
244
+ if (!E)
245
+ switch (i) {
246
+ case "bestFit": {
247
+ var F;
248
+ const S = (F = O.filter((R) => {
249
+ if (P) {
250
+ const V = T(R.placement);
251
+ return V === A || // Create a bias to the `y` side axis due to horizontal
252
+ // reading directions favoring greater width.
253
+ V === "y";
254
+ }
255
+ return !0;
256
+ }).map((R) => [R.placement, R.overflows.filter((V) => V > 0).reduce((V, Z) => V + Z, 0)]).sort((R, V) => R[1] - V[1])[0]) == null ? void 0 : F[0];
257
+ S && (E = S);
258
+ break;
259
+ }
260
+ case "initialPlacement":
261
+ E = m;
262
+ break;
263
+ }
264
+ if (r !== E)
265
+ return {
266
+ reset: {
267
+ placement: E
268
+ }
269
+ };
270
+ }
271
+ return {};
272
+ }
273
+ };
274
+ };
275
+ function q(t, e) {
276
+ return {
277
+ top: t.top - e.height,
278
+ right: t.right - e.width,
279
+ bottom: t.bottom - e.height,
280
+ left: t.left - e.width
281
+ };
44
282
  }
45
- function k(e) {
46
- const t = o.useRef(e);
47
- return w(() => {
48
- t.current = e;
49
- }), t;
283
+ function G(t) {
284
+ return se.some((e) => t[e] >= 0);
50
285
  }
51
- function oe(e) {
52
- e === void 0 && (e = {});
286
+ const fe = function(t) {
287
+ return t === void 0 && (t = {}), {
288
+ name: "hide",
289
+ options: t,
290
+ async fn(e) {
291
+ const {
292
+ rects: d
293
+ } = e, {
294
+ strategy: a = "referenceHidden",
295
+ ...r
296
+ } = L(t, e);
297
+ switch (a) {
298
+ case "referenceHidden": {
299
+ const n = await Y(e, {
300
+ ...r,
301
+ elementContext: "reference"
302
+ }), o = q(n, d.reference);
303
+ return {
304
+ data: {
305
+ referenceHiddenOffsets: o,
306
+ referenceHidden: G(o)
307
+ }
308
+ };
309
+ }
310
+ case "escaped": {
311
+ const n = await Y(e, {
312
+ ...r,
313
+ altBoundary: !0
314
+ }), o = q(n, d.floating);
315
+ return {
316
+ data: {
317
+ escapedOffsets: o,
318
+ escaped: G(o)
319
+ }
320
+ };
321
+ }
322
+ default:
323
+ return {};
324
+ }
325
+ }
326
+ };
327
+ }, U = /* @__PURE__ */ new Set(["left", "top"]);
328
+ async function oe(t, e) {
53
329
  const {
54
- placement: t = "bottom",
55
- strategy: n = "absolute",
56
- middleware: r = [],
57
- platform: i,
58
- elements: {
59
- reference: p,
60
- floating: q
61
- } = {},
62
- transform: D = !0,
63
- whileElementsMounted: E,
64
- open: x
65
- } = e, [s, C] = o.useState({
66
- x: 0,
67
- y: 0,
68
- strategy: n,
69
- placement: t,
70
- middlewareData: {},
71
- isPositioned: !1
72
- }), [M, B] = o.useState(r);
73
- R(M, r) || B(r);
74
- const [U, V] = o.useState(null), [W, G] = o.useState(null), O = o.useCallback((f) => {
75
- f !== a.current && (a.current = f, V(f));
76
- }, []), _ = o.useCallback((f) => {
77
- f !== d.current && (d.current = f, G(f));
78
- }, []), u = p || U, l = q || W, a = o.useRef(null), d = o.useRef(null), y = o.useRef(s), H = E != null, S = k(E), P = k(i), v = k(x), g = o.useCallback(() => {
79
- if (!a.current || !d.current)
80
- return;
81
- const f = {
82
- placement: t,
83
- strategy: n,
84
- middleware: M
85
- };
86
- P.current && (f.platform = P.current), I(a.current, d.current, f).then((h) => {
87
- const m = {
88
- ...h,
89
- // The floating element's position may be recomputed while it's closed
90
- // but still mounted (such as when transitioning out). To ensure
91
- // `isPositioned` will be `false` initially on the next open, avoid
92
- // setting it to `true` when `open === false` (must be specified).
93
- isPositioned: v.current !== !1
330
+ placement: d,
331
+ platform: a,
332
+ elements: r
333
+ } = t, n = await (a.isRTL == null ? void 0 : a.isRTL(r.floating)), o = j(d), m = z(d), u = T(d) === "y", h = U.has(o) ? -1 : 1, c = n && u ? -1 : 1, s = L(e, t);
334
+ let {
335
+ mainAxis: f,
336
+ crossAxis: i,
337
+ alignmentAxis: l
338
+ } = typeof s == "number" ? {
339
+ mainAxis: s,
340
+ crossAxis: 0,
341
+ alignmentAxis: null
342
+ } : {
343
+ mainAxis: s.mainAxis || 0,
344
+ crossAxis: s.crossAxis || 0,
345
+ alignmentAxis: s.alignmentAxis
346
+ };
347
+ return m && typeof l == "number" && (i = m === "end" ? l * -1 : l), u ? {
348
+ x: i * c,
349
+ y: f * h
350
+ } : {
351
+ x: f * h,
352
+ y: i * c
353
+ };
354
+ }
355
+ const me = function(t) {
356
+ return t === void 0 && (t = 0), {
357
+ name: "offset",
358
+ options: t,
359
+ async fn(e) {
360
+ var d, a;
361
+ const {
362
+ x: r,
363
+ y: n,
364
+ placement: o,
365
+ middlewareData: m
366
+ } = e, u = await oe(e, t);
367
+ return o === ((d = m.offset) == null ? void 0 : d.placement) && (a = m.arrow) != null && a.alignmentOffset ? {} : {
368
+ x: r + u.x,
369
+ y: n + u.y,
370
+ data: {
371
+ ...u,
372
+ placement: o
373
+ }
94
374
  };
95
- $.current && !R(y.current, m) && (y.current = m, Z.flushSync(() => {
96
- C(m);
97
- }));
98
- });
99
- }, [M, t, n, P, v]);
100
- w(() => {
101
- x === !1 && y.current.isPositioned && (y.current.isPositioned = !1, C((f) => ({
102
- ...f,
103
- isPositioned: !1
104
- })));
105
- }, [x]);
106
- const $ = o.useRef(!1);
107
- w(() => ($.current = !0, () => {
108
- $.current = !1;
109
- }), []), w(() => {
110
- if (u && (a.current = u), l && (d.current = l), u && l) {
111
- if (S.current)
112
- return S.current(u, l, g);
113
- g();
114
375
  }
115
- }, [u, l, g, S, H]);
116
- const F = o.useMemo(() => ({
117
- reference: a,
118
- floating: d,
119
- setReference: O,
120
- setFloating: _
121
- }), [O, _]), c = o.useMemo(() => ({
122
- reference: u,
123
- floating: l
124
- }), [u, l]), j = o.useMemo(() => {
125
- const f = {
126
- position: n,
127
- left: 0,
128
- top: 0
129
- };
130
- if (!c.floating)
131
- return f;
132
- const h = L(c.floating, s.x), m = L(c.floating, s.y);
133
- return D ? {
134
- ...f,
135
- transform: "translate(" + h + "px, " + m + "px)",
136
- ...A(c.floating) >= 1.5 && {
137
- willChange: "transform"
376
+ };
377
+ }, de = function(t) {
378
+ return t === void 0 && (t = {}), {
379
+ name: "shift",
380
+ options: t,
381
+ async fn(e) {
382
+ const {
383
+ x: d,
384
+ y: a,
385
+ placement: r
386
+ } = e, {
387
+ mainAxis: n = !0,
388
+ crossAxis: o = !1,
389
+ limiter: m = {
390
+ fn: (x) => {
391
+ let {
392
+ x: y,
393
+ y: A
394
+ } = x;
395
+ return {
396
+ x: y,
397
+ y: A
398
+ };
399
+ }
400
+ },
401
+ ...u
402
+ } = L(t, e), h = {
403
+ x: d,
404
+ y: a
405
+ }, c = await Y(e, u), s = T(j(r)), f = K(s);
406
+ let i = h[f], l = h[s];
407
+ if (n) {
408
+ const x = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", A = i + c[x], p = i - c[y];
409
+ i = X(A, i, p);
138
410
  }
139
- } : {
140
- position: n,
141
- left: h,
142
- top: m
143
- };
144
- }, [n, D, c.floating, s.x, s.y]);
145
- return o.useMemo(() => ({
146
- ...s,
147
- update: g,
148
- refs: F,
149
- elements: c,
150
- floatingStyles: j
151
- }), [s, g, F, c, j]);
152
- }
153
- const te = (e) => {
154
- function t(n) {
155
- return {}.hasOwnProperty.call(n, "current");
156
- }
157
- return {
158
- name: "arrow",
159
- options: e,
160
- fn(n) {
411
+ if (o) {
412
+ const x = s === "y" ? "top" : "left", y = s === "y" ? "bottom" : "right", A = l + c[x], p = l - c[y];
413
+ l = X(A, l, p);
414
+ }
415
+ const g = m.fn({
416
+ ...e,
417
+ [f]: i,
418
+ [s]: l
419
+ });
420
+ return {
421
+ ...g,
422
+ data: {
423
+ x: g.x - d,
424
+ y: g.y - a,
425
+ enabled: {
426
+ [f]: n,
427
+ [s]: o
428
+ }
429
+ }
430
+ };
431
+ }
432
+ };
433
+ }, xe = function(t) {
434
+ return t === void 0 && (t = {}), {
435
+ options: t,
436
+ fn(e) {
161
437
  const {
162
- element: r,
163
- padding: i
164
- } = typeof e == "function" ? e(n) : e;
165
- return r && t(r) ? r.current != null ? z({
166
- element: r.current,
167
- padding: i
168
- }).fn(n) : {} : r ? z({
169
- element: r,
170
- padding: i
171
- }).fn(n) : {};
438
+ x: d,
439
+ y: a,
440
+ placement: r,
441
+ rects: n,
442
+ middlewareData: o
443
+ } = e, {
444
+ offset: m = 0,
445
+ mainAxis: u = !0,
446
+ crossAxis: h = !0
447
+ } = L(t, e), c = {
448
+ x: d,
449
+ y: a
450
+ }, s = T(r), f = K(s);
451
+ let i = c[f], l = c[s];
452
+ const g = L(m, e), x = typeof g == "number" ? {
453
+ mainAxis: g,
454
+ crossAxis: 0
455
+ } : {
456
+ mainAxis: 0,
457
+ crossAxis: 0,
458
+ ...g
459
+ };
460
+ if (u) {
461
+ const p = f === "y" ? "height" : "width", v = n.reference[f] - n.floating[p] + x.mainAxis, w = n.reference[f] + n.reference[p] - x.mainAxis;
462
+ i < v ? i = v : i > w && (i = w);
463
+ }
464
+ if (h) {
465
+ var y, A;
466
+ const p = f === "y" ? "width" : "height", v = U.has(j(r)), w = n.reference[s] - n.floating[p] + (v && ((y = o.offset) == null ? void 0 : y[s]) || 0) + (v ? 0 : x.crossAxis), P = n.reference[s] + n.reference[p] + (v ? 0 : ((A = o.offset) == null ? void 0 : A[s]) || 0) - (v ? x.crossAxis : 0);
467
+ l < w ? l = w : l > P && (l = P);
468
+ }
469
+ return {
470
+ [f]: i,
471
+ [s]: l
472
+ };
172
473
  }
173
474
  };
174
- }, fe = (e, t) => ({
175
- ...J(e),
176
- options: [e, t]
177
- }), ie = (e, t) => ({
178
- ...K(e),
179
- options: [e, t]
180
- }), se = (e, t) => ({
181
- ...X(e),
182
- options: [e, t]
183
- }), ue = (e, t) => ({
184
- ...N(e),
185
- options: [e, t]
186
- }), le = (e, t) => ({
187
- ...Q(e),
188
- options: [e, t]
189
- }), ce = (e, t) => ({
190
- ...T(e),
191
- options: [e, t]
192
- }), ae = (e, t) => ({
193
- ...te(e),
194
- options: [e, t]
195
- });
475
+ }, ge = function(t) {
476
+ return t === void 0 && (t = {}), {
477
+ name: "size",
478
+ options: t,
479
+ async fn(e) {
480
+ var d, a;
481
+ const {
482
+ placement: r,
483
+ rects: n,
484
+ platform: o,
485
+ elements: m
486
+ } = e, {
487
+ apply: u = () => {
488
+ },
489
+ ...h
490
+ } = L(t, e), c = await Y(e, h), s = j(r), f = z(r), i = T(r) === "y", {
491
+ width: l,
492
+ height: g
493
+ } = n.floating;
494
+ let x, y;
495
+ s === "top" || s === "bottom" ? (x = s, y = f === (await (o.isRTL == null ? void 0 : o.isRTL(m.floating)) ? "start" : "end") ? "left" : "right") : (y = s, x = f === "end" ? "top" : "bottom");
496
+ const A = g - c.top - c.bottom, p = l - c.left - c.right, v = $(g - c[x], A), w = $(l - c[y], p), P = !e.middlewareData.shift;
497
+ let C = v, M = w;
498
+ if ((d = e.middlewareData.shift) != null && d.enabled.x && (M = p), (a = e.middlewareData.shift) != null && a.enabled.y && (C = A), P && !f) {
499
+ const O = W(c.left, 0), H = W(c.right, 0), D = W(c.top, 0), F = W(c.bottom, 0);
500
+ i ? M = l - 2 * (O !== 0 || H !== 0 ? O + H : W(c.left, c.right)) : C = g - 2 * (D !== 0 || F !== 0 ? D + F : W(c.top, c.bottom));
501
+ }
502
+ await u({
503
+ ...e,
504
+ availableWidth: M,
505
+ availableHeight: C
506
+ });
507
+ const k = await o.getDimensions(m.floating);
508
+ return l !== k.width || g !== k.height ? {
509
+ reset: {
510
+ rects: !0
511
+ }
512
+ } : {};
513
+ }
514
+ };
515
+ };
196
516
  export {
197
- ae as arrow,
198
- pe as autoUpdate,
199
- I as computePosition,
200
- ue as flip,
201
- ce as hide,
202
- se as limitShift,
203
- fe as offset,
204
- ge as platform,
205
- ie as shift,
206
- le as size,
207
- oe as useFloating
517
+ le as arrow,
518
+ ce as computePosition,
519
+ Y as detectOverflow,
520
+ re as flip,
521
+ fe as hide,
522
+ xe as limitShift,
523
+ me as offset,
524
+ _ as rectToClientRect,
525
+ de as shift,
526
+ ge as size
208
527
  };