@gardenfi/garden-book 0.2.31 → 0.3.0-beta.2

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 (147) hide show
  1. package/dist/BulletList/BulletList.d.ts +21 -0
  2. package/dist/BulletList/index.d.ts +2 -0
  3. package/dist/BulletList/index.js +31 -0
  4. package/dist/CardList/CardList.d.ts +32 -0
  5. package/dist/CardList/index.d.ts +2 -0
  6. package/dist/CardList/index.js +141 -0
  7. package/dist/Checkbox/Checkbox.js +7 -0
  8. package/dist/Checkbox/RadixCheckbox.d.ts +3 -0
  9. package/dist/Checkbox/RadixCheckbox.js +27 -0
  10. package/dist/Checkbox/index.d.ts +1 -0
  11. package/dist/Checkbox/index.js +4 -5
  12. package/dist/DashboardLayout/DashboardLayout.d.ts +23 -0
  13. package/dist/DashboardLayout/DashboardNavbar.d.ts +11 -0
  14. package/dist/DashboardLayout/DashboardNavbar.js +32 -0
  15. package/dist/DashboardLayout/DashboardSidebar.d.ts +30 -0
  16. package/dist/DashboardLayout/DashboardSidebar.js +139 -0
  17. package/dist/DashboardLayout/MobileMenu.d.ts +11 -0
  18. package/dist/DashboardLayout/MobileMenu.js +126 -0
  19. package/dist/DashboardLayout/PageHeader.d.ts +13 -0
  20. package/dist/DashboardLayout/PageHeader.js +47 -0
  21. package/dist/DashboardLayout/index.d.ts +10 -0
  22. package/dist/DashboardLayout/index.js +93 -0
  23. package/dist/DataTable/DataTable.d.ts +50 -0
  24. package/dist/DataTable/Table.d.ts +7 -0
  25. package/dist/DataTable/Table.js +57 -0
  26. package/dist/DataTable/index.d.ts +2 -0
  27. package/dist/DataTable/index.js +269 -0
  28. package/dist/DataTable/useAnimatedTable.d.ts +8 -0
  29. package/dist/DataTable/useAnimatedTable.js +44 -0
  30. package/dist/DirectionalIconHover/DirectionalIconHover.d.ts +12 -0
  31. package/dist/DirectionalIconHover/index.d.ts +2 -0
  32. package/dist/DirectionalIconHover/index.js +72 -0
  33. package/dist/EmptyState/EmptyState.d.ts +20 -0
  34. package/dist/EmptyState/index.d.ts +2 -0
  35. package/dist/EmptyState/index.js +35 -0
  36. package/dist/ErrorState/ErrorState.d.ts +17 -0
  37. package/dist/ErrorState/errorMessages.d.ts +2 -0
  38. package/dist/ErrorState/errorMessages.js +13 -0
  39. package/dist/ErrorState/index.d.ts +2 -0
  40. package/dist/ErrorState/index.js +37 -0
  41. package/dist/Field/Field.d.ts +14 -0
  42. package/dist/Field/index.d.ts +2 -0
  43. package/dist/Field/index.js +14 -0
  44. package/dist/HamburgerIcon/HamburgerIcon.d.ts +5 -0
  45. package/dist/HamburgerIcon/index.d.ts +2 -0
  46. package/dist/HamburgerIcon/index.js +47 -0
  47. package/dist/InfoTooltip/InfoTooltip.d.ts +22 -0
  48. package/dist/InfoTooltip/index.d.ts +2 -0
  49. package/dist/InfoTooltip/index.js +81 -0
  50. package/dist/Input/Input.d.ts +19 -0
  51. package/dist/Input/index.d.ts +2 -0
  52. package/dist/Input/index.js +113 -0
  53. package/dist/Logo/index.d.ts +0 -1
  54. package/dist/Logo/index.js +8 -10
  55. package/dist/OTPInput/OTPInput.d.ts +11 -0
  56. package/dist/OTPInput/index.d.ts +2 -0
  57. package/dist/OTPInput/index.js +88 -0
  58. package/dist/Pagination/Pagination.d.ts +16 -0
  59. package/dist/Pagination/index.d.ts +2 -0
  60. package/dist/Pagination/index.js +111 -0
  61. package/dist/Portal/Portal.d.ts +8 -0
  62. package/dist/Portal/index.d.ts +2 -0
  63. package/dist/Portal/index.js +11 -0
  64. package/dist/ResponsiveModal/ResponsiveModal.d.ts +14 -0
  65. package/dist/ResponsiveModal/index.d.ts +2 -0
  66. package/dist/ResponsiveModal/index.js +62 -0
  67. package/dist/SelectDropdown/SelectDropdown.d.ts +41 -0
  68. package/dist/SelectDropdown/index.d.ts +2 -0
  69. package/dist/SelectDropdown/index.js +195 -0
  70. package/dist/Skeleton/Skeleton.d.ts +3 -0
  71. package/dist/Skeleton/index.d.ts +2 -0
  72. package/dist/Skeleton/index.js +12 -0
  73. package/dist/StatCard/StatCard.d.ts +20 -0
  74. package/dist/StatCard/index.d.ts +2 -0
  75. package/dist/StatCard/index.js +42 -0
  76. package/dist/StateContainer/StateContainer.d.ts +8 -0
  77. package/dist/StateContainer/index.d.ts +2 -0
  78. package/dist/StateContainer/index.js +15 -0
  79. package/dist/StatusChip/StatusChip.d.ts +11 -0
  80. package/dist/StatusChip/index.d.ts +2 -0
  81. package/dist/StatusChip/index.js +33 -0
  82. package/dist/Switch/Switch.d.ts +3 -0
  83. package/dist/Switch/index.d.ts +1 -0
  84. package/dist/Switch/index.js +31 -0
  85. package/dist/Toast/Toast.d.ts +15 -0
  86. package/dist/Toast/Toast.js +93 -0
  87. package/dist/Toast/Toaster.d.ts +5 -0
  88. package/dist/Toast/Toaster.js +30 -0
  89. package/dist/Toast/index.d.ts +5 -0
  90. package/dist/Toast/index.js +16 -0
  91. package/dist/Toast/useToast.d.ts +46 -0
  92. package/dist/Toast/useToast.js +76 -0
  93. package/dist/ToggleGroup/ToggleGroup.d.ts +15 -0
  94. package/dist/ToggleGroup/index.d.ts +2 -0
  95. package/dist/ToggleGroup/index.js +57 -0
  96. package/dist/Typography/Typography.d.ts +2 -2
  97. package/dist/Viewport/Viewport.d.ts +11 -0
  98. package/dist/Viewport/index.d.ts +2 -0
  99. package/dist/Viewport/index.js +7 -0
  100. package/dist/index.d.ts +24 -0
  101. package/dist/index.js +386 -314
  102. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +532 -0
  103. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +403 -0
  104. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +232 -0
  105. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +136 -0
  106. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +128 -0
  107. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +24 -0
  108. package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +251 -0
  109. package/dist/node_modules/@radix-ui/react-collection/dist/index.js +48 -0
  110. package/dist/node_modules/@radix-ui/{react-slot → react-collection/node_modules/@radix-ui/react-slot}/dist/index.js +1 -1
  111. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +1 -1
  112. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
  113. package/dist/node_modules/@radix-ui/react-direction/dist/index.js +10 -0
  114. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +29 -26
  115. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +208 -0
  116. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +624 -0
  117. package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
  118. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +221 -0
  119. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +1 -1
  120. package/dist/node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
  121. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +183 -0
  122. package/dist/node_modules/@radix-ui/react-switch/dist/index.js +132 -0
  123. package/dist/node_modules/@radix-ui/react-toast/dist/index.js +446 -0
  124. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +330 -0
  125. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.js +11 -0
  126. package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +8 -0
  127. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +27 -0
  128. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +32 -0
  129. package/dist/node_modules/lucide-react/dist/esm/Icon.js +40 -0
  130. package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +23 -0
  131. package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +20 -0
  132. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-down.js +14 -0
  133. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-up-down.js +16 -0
  134. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-up.js +14 -0
  135. package/dist/node_modules/lucide-react/dist/esm/icons/check.js +11 -0
  136. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +13 -0
  137. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +11 -0
  138. package/dist/node_modules/lucide-react/dist/esm/icons/circle-alert.js +15 -0
  139. package/dist/node_modules/lucide-react/dist/esm/icons/eye-off.js +28 -0
  140. package/dist/node_modules/lucide-react/dist/esm/icons/eye.js +20 -0
  141. package/dist/node_modules/lucide-react/dist/esm/icons/log-out.js +15 -0
  142. package/dist/node_modules/lucide-react/dist/esm/icons/x.js +14 -0
  143. package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +11 -0
  144. package/dist/style.css +1 -1
  145. package/package.json +12 -3
  146. package/dist/Logo/Code4renaLogo.d.ts +0 -5
  147. package/dist/Logo/Code4renaLogo.js +0 -45
@@ -0,0 +1,403 @@
1
+ import { computePosition as st, offset as rt, shift as ct, flip as lt, size as ft, hide as ut, arrow as ht, limitShift as at } from "../../core/dist/floating-ui.core.js";
2
+ import { createCoords as y, round as z, max as E, min as N, rectToClientRect as J, floor as D } from "../../utils/dist/floating-ui.utils.js";
3
+ import { isElement as v, getDocumentElement as b, getOverflowAncestors as $, getComputedStyle as R, isHTMLElement as T, getWindow as O, isTopLayer as V, getParentNode as S, isLastTraversableNode as A, isTableElement as dt, isContainingBlock as Q, getContainingBlock as gt, getNodeName as _, isOverflowElement as q, getNodeScroll as H, getFrameElement as U, isWebKit as Y } from "../../utils/dist/floating-ui.utils.dom.js";
4
+ function Z(t) {
5
+ const e = R(t);
6
+ let i = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
7
+ const n = T(t), r = n ? t.offsetWidth : i, s = n ? t.offsetHeight : o, c = z(i) !== r || z(o) !== s;
8
+ return c && (i = r, o = s), {
9
+ width: i,
10
+ height: o,
11
+ $: c
12
+ };
13
+ }
14
+ function X(t) {
15
+ return v(t) ? t : t.contextElement;
16
+ }
17
+ function F(t) {
18
+ const e = X(t);
19
+ if (!T(e))
20
+ return y(1);
21
+ const i = e.getBoundingClientRect(), {
22
+ width: o,
23
+ height: n,
24
+ $: r
25
+ } = Z(e);
26
+ let s = (r ? z(i.width) : i.width) / o, c = (r ? z(i.height) : i.height) / n;
27
+ return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
28
+ x: s,
29
+ y: c
30
+ };
31
+ }
32
+ const pt = /* @__PURE__ */ y(0);
33
+ function tt(t) {
34
+ const e = O(t);
35
+ return !Y() || !e.visualViewport ? pt : {
36
+ x: e.visualViewport.offsetLeft,
37
+ y: e.visualViewport.offsetTop
38
+ };
39
+ }
40
+ function mt(t, e, i) {
41
+ return e === void 0 && (e = !1), !i || e && i !== O(t) ? !1 : e;
42
+ }
43
+ function L(t, e, i, o) {
44
+ e === void 0 && (e = !1), i === void 0 && (i = !1);
45
+ const n = t.getBoundingClientRect(), r = X(t);
46
+ let s = y(1);
47
+ e && (o ? v(o) && (s = F(o)) : s = F(t));
48
+ const c = mt(r, i, o) ? tt(r) : y(0);
49
+ let l = (n.left + c.x) / s.x, f = (n.top + c.y) / s.y, u = n.width / s.x, a = n.height / s.y;
50
+ if (r) {
51
+ const d = O(r), h = o && v(o) ? O(o) : o;
52
+ let m = d, p = U(m);
53
+ for (; p && o && h !== m; ) {
54
+ const w = F(p), g = p.getBoundingClientRect(), x = R(p), C = g.left + (p.clientLeft + parseFloat(x.paddingLeft)) * w.x, W = g.top + (p.clientTop + parseFloat(x.paddingTop)) * w.y;
55
+ l *= w.x, f *= w.y, u *= w.x, a *= w.y, l += C, f += W, m = O(p), p = U(m);
56
+ }
57
+ }
58
+ return J({
59
+ width: u,
60
+ height: a,
61
+ x: l,
62
+ y: f
63
+ });
64
+ }
65
+ function I(t, e) {
66
+ const i = H(t).scrollLeft;
67
+ return e ? e.left + i : L(b(t)).left + i;
68
+ }
69
+ function et(t, e) {
70
+ const i = t.getBoundingClientRect(), o = i.left + e.scrollLeft - I(t, i), n = i.top + e.scrollTop;
71
+ return {
72
+ x: o,
73
+ y: n
74
+ };
75
+ }
76
+ function wt(t) {
77
+ let {
78
+ elements: e,
79
+ rect: i,
80
+ offsetParent: o,
81
+ strategy: n
82
+ } = t;
83
+ const r = n === "fixed", s = b(o), c = e ? V(e.floating) : !1;
84
+ if (o === s || c && r)
85
+ return i;
86
+ let l = {
87
+ scrollLeft: 0,
88
+ scrollTop: 0
89
+ }, f = y(1);
90
+ const u = y(0), a = T(o);
91
+ if ((a || !a && !r) && ((_(o) !== "body" || q(s)) && (l = H(o)), a)) {
92
+ const h = L(o);
93
+ f = F(o), u.x = h.x + o.clientLeft, u.y = h.y + o.clientTop;
94
+ }
95
+ const d = s && !a && !r ? et(s, l) : y(0);
96
+ return {
97
+ width: i.width * f.x,
98
+ height: i.height * f.y,
99
+ x: i.x * f.x - l.scrollLeft * f.x + u.x + d.x,
100
+ y: i.y * f.y - l.scrollTop * f.y + u.y + d.y
101
+ };
102
+ }
103
+ function yt(t) {
104
+ return Array.from(t.getClientRects());
105
+ }
106
+ function xt(t) {
107
+ const e = b(t), i = H(t), o = t.ownerDocument.body, n = E(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), r = E(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
108
+ let s = -i.scrollLeft + I(t);
109
+ const c = -i.scrollTop;
110
+ return R(o).direction === "rtl" && (s += E(e.clientWidth, o.clientWidth) - n), {
111
+ width: n,
112
+ height: r,
113
+ x: s,
114
+ y: c
115
+ };
116
+ }
117
+ const K = 25;
118
+ function vt(t, e) {
119
+ const i = O(t), o = b(t), n = i.visualViewport;
120
+ let r = o.clientWidth, s = o.clientHeight, c = 0, l = 0;
121
+ if (n) {
122
+ r = n.width, s = n.height;
123
+ const u = Y();
124
+ (!u || u && e === "fixed") && (c = n.offsetLeft, l = n.offsetTop);
125
+ }
126
+ const f = I(o);
127
+ if (f <= 0) {
128
+ const u = o.ownerDocument, a = u.body, d = getComputedStyle(a), h = u.compatMode === "CSS1Compat" && parseFloat(d.marginLeft) + parseFloat(d.marginRight) || 0, m = Math.abs(o.clientWidth - a.clientWidth - h);
129
+ m <= K && (r -= m);
130
+ } else f <= K && (r += f);
131
+ return {
132
+ width: r,
133
+ height: s,
134
+ x: c,
135
+ y: l
136
+ };
137
+ }
138
+ function Rt(t, e) {
139
+ const i = L(t, !0, e === "fixed"), o = i.top + t.clientTop, n = i.left + t.clientLeft, r = T(t) ? F(t) : y(1), s = t.clientWidth * r.x, c = t.clientHeight * r.y, l = n * r.x, f = o * r.y;
140
+ return {
141
+ width: s,
142
+ height: c,
143
+ x: l,
144
+ y: f
145
+ };
146
+ }
147
+ function j(t, e, i) {
148
+ let o;
149
+ if (e === "viewport")
150
+ o = vt(t, i);
151
+ else if (e === "document")
152
+ o = xt(b(t));
153
+ else if (v(e))
154
+ o = Rt(e, i);
155
+ else {
156
+ const n = tt(t);
157
+ o = {
158
+ x: e.x - n.x,
159
+ y: e.y - n.y,
160
+ width: e.width,
161
+ height: e.height
162
+ };
163
+ }
164
+ return J(o);
165
+ }
166
+ function it(t, e) {
167
+ const i = S(t);
168
+ return i === e || !v(i) || A(i) ? !1 : R(i).position === "fixed" || it(i, e);
169
+ }
170
+ function bt(t, e) {
171
+ const i = e.get(t);
172
+ if (i)
173
+ return i;
174
+ let o = $(t, [], !1).filter((c) => v(c) && _(c) !== "body"), n = null;
175
+ const r = R(t).position === "fixed";
176
+ let s = r ? S(t) : t;
177
+ for (; v(s) && !A(s); ) {
178
+ const c = R(s), l = Q(s);
179
+ !l && c.position === "fixed" && (n = null), (r ? !l && !n : !l && c.position === "static" && !!n && (n.position === "absolute" || n.position === "fixed") || q(s) && !l && it(t, s)) ? o = o.filter((u) => u !== s) : n = c, s = S(s);
180
+ }
181
+ return e.set(t, o), o;
182
+ }
183
+ function Ct(t) {
184
+ let {
185
+ element: e,
186
+ boundary: i,
187
+ rootBoundary: o,
188
+ strategy: n
189
+ } = t;
190
+ const s = [...i === "clippingAncestors" ? V(e) ? [] : bt(e, this._c) : [].concat(i), o], c = j(e, s[0], n);
191
+ let l = c.top, f = c.right, u = c.bottom, a = c.left;
192
+ for (let d = 1; d < s.length; d++) {
193
+ const h = j(e, s[d], n);
194
+ l = E(h.top, l), f = N(h.right, f), u = N(h.bottom, u), a = E(h.left, a);
195
+ }
196
+ return {
197
+ width: f - a,
198
+ height: u - l,
199
+ x: a,
200
+ y: l
201
+ };
202
+ }
203
+ function Ot(t) {
204
+ const {
205
+ width: e,
206
+ height: i
207
+ } = Z(t);
208
+ return {
209
+ width: e,
210
+ height: i
211
+ };
212
+ }
213
+ function Lt(t, e, i) {
214
+ const o = T(e), n = b(e), r = i === "fixed", s = L(t, !0, r, e);
215
+ let c = {
216
+ scrollLeft: 0,
217
+ scrollTop: 0
218
+ };
219
+ const l = y(0);
220
+ function f() {
221
+ l.x = I(n);
222
+ }
223
+ if (o || !o && !r)
224
+ if ((_(e) !== "body" || q(n)) && (c = H(e)), o) {
225
+ const h = L(e, !0, r, e);
226
+ l.x = h.x + e.clientLeft, l.y = h.y + e.clientTop;
227
+ } else n && f();
228
+ r && !o && n && f();
229
+ const u = n && !o && !r ? et(n, c) : y(0), a = s.left + c.scrollLeft - l.x - u.x, d = s.top + c.scrollTop - l.y - u.y;
230
+ return {
231
+ x: a,
232
+ y: d,
233
+ width: s.width,
234
+ height: s.height
235
+ };
236
+ }
237
+ function M(t) {
238
+ return R(t).position === "static";
239
+ }
240
+ function G(t, e) {
241
+ if (!T(t) || R(t).position === "fixed")
242
+ return null;
243
+ if (e)
244
+ return e(t);
245
+ let i = t.offsetParent;
246
+ return b(t) === i && (i = i.ownerDocument.body), i;
247
+ }
248
+ function ot(t, e) {
249
+ const i = O(t);
250
+ if (V(t))
251
+ return i;
252
+ if (!T(t)) {
253
+ let n = S(t);
254
+ for (; n && !A(n); ) {
255
+ if (v(n) && !M(n))
256
+ return n;
257
+ n = S(n);
258
+ }
259
+ return i;
260
+ }
261
+ let o = G(t, e);
262
+ for (; o && dt(o) && M(o); )
263
+ o = G(o, e);
264
+ return o && A(o) && M(o) && !Q(o) ? i : o || gt(t) || i;
265
+ }
266
+ const Tt = async function(t) {
267
+ const e = this.getOffsetParent || ot, i = this.getDimensions, o = await i(t.floating);
268
+ return {
269
+ reference: Lt(t.reference, await e(t.floating), t.strategy),
270
+ floating: {
271
+ x: 0,
272
+ y: 0,
273
+ width: o.width,
274
+ height: o.height
275
+ }
276
+ };
277
+ };
278
+ function Et(t) {
279
+ return R(t).direction === "rtl";
280
+ }
281
+ const Ft = {
282
+ convertOffsetParentRelativeRectToViewportRelativeRect: wt,
283
+ getDocumentElement: b,
284
+ getClippingRect: Ct,
285
+ getOffsetParent: ot,
286
+ getElementRects: Tt,
287
+ getClientRects: yt,
288
+ getDimensions: Ot,
289
+ getScale: F,
290
+ isElement: v,
291
+ isRTL: Et
292
+ };
293
+ function nt(t, e) {
294
+ return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
295
+ }
296
+ function St(t, e) {
297
+ let i = null, o;
298
+ const n = b(t);
299
+ function r() {
300
+ var c;
301
+ clearTimeout(o), (c = i) == null || c.disconnect(), i = null;
302
+ }
303
+ function s(c, l) {
304
+ c === void 0 && (c = !1), l === void 0 && (l = 1), r();
305
+ const f = t.getBoundingClientRect(), {
306
+ left: u,
307
+ top: a,
308
+ width: d,
309
+ height: h
310
+ } = f;
311
+ if (c || e(), !d || !h)
312
+ return;
313
+ const m = D(a), p = D(n.clientWidth - (u + d)), w = D(n.clientHeight - (a + h)), g = D(u), C = {
314
+ rootMargin: -m + "px " + -p + "px " + -w + "px " + -g + "px",
315
+ threshold: E(0, N(1, l)) || 1
316
+ };
317
+ let W = !0;
318
+ function k(P) {
319
+ const B = P[0].intersectionRatio;
320
+ if (B !== l) {
321
+ if (!W)
322
+ return s();
323
+ B ? s(!1, B) : o = setTimeout(() => {
324
+ s(!1, 1e-7);
325
+ }, 1e3);
326
+ }
327
+ B === 1 && !nt(f, t.getBoundingClientRect()) && s(), W = !1;
328
+ }
329
+ try {
330
+ i = new IntersectionObserver(k, {
331
+ ...C,
332
+ // Handle <iframe>s
333
+ root: n.ownerDocument
334
+ });
335
+ } catch {
336
+ i = new IntersectionObserver(k, C);
337
+ }
338
+ i.observe(t);
339
+ }
340
+ return s(!0), r;
341
+ }
342
+ function zt(t, e, i, o) {
343
+ o === void 0 && (o = {});
344
+ const {
345
+ ancestorScroll: n = !0,
346
+ ancestorResize: r = !0,
347
+ elementResize: s = typeof ResizeObserver == "function",
348
+ layoutShift: c = typeof IntersectionObserver == "function",
349
+ animationFrame: l = !1
350
+ } = o, f = X(t), u = n || r ? [...f ? $(f) : [], ...e ? $(e) : []] : [];
351
+ u.forEach((g) => {
352
+ n && g.addEventListener("scroll", i, {
353
+ passive: !0
354
+ }), r && g.addEventListener("resize", i);
355
+ });
356
+ const a = f && c ? St(f, i) : null;
357
+ let d = -1, h = null;
358
+ s && (h = new ResizeObserver((g) => {
359
+ let [x] = g;
360
+ x && x.target === f && h && e && (h.unobserve(e), cancelAnimationFrame(d), d = requestAnimationFrame(() => {
361
+ var C;
362
+ (C = h) == null || C.observe(e);
363
+ })), i();
364
+ }), f && !l && h.observe(f), e && h.observe(e));
365
+ let m, p = l ? L(t) : null;
366
+ l && w();
367
+ function w() {
368
+ const g = L(t);
369
+ p && !nt(p, g) && i(), p = g, m = requestAnimationFrame(w);
370
+ }
371
+ return i(), () => {
372
+ var g;
373
+ u.forEach((x) => {
374
+ n && x.removeEventListener("scroll", i), r && x.removeEventListener("resize", i);
375
+ }), a == null || a(), (g = h) == null || g.disconnect(), h = null, l && cancelAnimationFrame(m);
376
+ };
377
+ }
378
+ const At = rt, Ht = ct, It = lt, Mt = ft, Nt = ut, $t = ht, Vt = at, _t = (t, e, i) => {
379
+ const o = /* @__PURE__ */ new Map(), n = {
380
+ platform: Ft,
381
+ ...i
382
+ }, r = {
383
+ ...n.platform,
384
+ _c: o
385
+ };
386
+ return st(t, e, {
387
+ ...n,
388
+ platform: r
389
+ });
390
+ };
391
+ export {
392
+ $t as arrow,
393
+ zt as autoUpdate,
394
+ _t as computePosition,
395
+ It as flip,
396
+ $ as getOverflowAncestors,
397
+ Nt as hide,
398
+ Vt as limitShift,
399
+ At as offset,
400
+ Ft as platform,
401
+ Ht as shift,
402
+ Mt as size
403
+ };
@@ -0,0 +1,232 @@
1
+ import { computePosition as I, offset as J, shift as K, flip as N, size as Q, hide as T, arrow as z, limitShift as X } from "../../dom/dist/floating-ui.dom.js";
2
+ import { autoUpdate as pe, platform as ge } from "../../dom/dist/floating-ui.dom.js";
3
+ import * as f 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, n) {
9
+ if (e === n)
10
+ return !0;
11
+ if (typeof e != typeof n)
12
+ return !1;
13
+ if (typeof e == "function" && e.toString() === n.toString())
14
+ return !0;
15
+ let t, r, s;
16
+ if (e && n && typeof e == "object") {
17
+ if (Array.isArray(e)) {
18
+ if (t = e.length, t !== n.length) return !1;
19
+ for (r = t; r-- !== 0; )
20
+ if (!R(e[r], n[r]))
21
+ return !1;
22
+ return !0;
23
+ }
24
+ if (s = Object.keys(e), t = s.length, t !== Object.keys(n).length)
25
+ return !1;
26
+ for (r = t; r-- !== 0; )
27
+ if (!{}.hasOwnProperty.call(n, s[r]))
28
+ return !1;
29
+ for (r = t; r-- !== 0; ) {
30
+ const p = s[r];
31
+ if (!(p === "_owner" && e.$$typeof) && !R(e[p], n[p]))
32
+ return !1;
33
+ }
34
+ return !0;
35
+ }
36
+ return e !== e && n !== n;
37
+ }
38
+ function A(e) {
39
+ return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
40
+ }
41
+ function L(e, n) {
42
+ const t = A(e);
43
+ return Math.round(n * t) / t;
44
+ }
45
+ function k(e) {
46
+ const n = f.useRef(e);
47
+ return w(() => {
48
+ n.current = e;
49
+ }), n;
50
+ }
51
+ function fe(e) {
52
+ e === void 0 && (e = {});
53
+ const {
54
+ placement: n = "bottom",
55
+ strategy: t = "absolute",
56
+ middleware: r = [],
57
+ platform: s,
58
+ elements: {
59
+ reference: p,
60
+ floating: q
61
+ } = {},
62
+ transform: D = !0,
63
+ whileElementsMounted: E,
64
+ open: x
65
+ } = e, [i, C] = f.useState({
66
+ x: 0,
67
+ y: 0,
68
+ strategy: t,
69
+ placement: n,
70
+ middlewareData: {},
71
+ isPositioned: !1
72
+ }), [M, B] = f.useState(r);
73
+ R(M, r) || B(r);
74
+ const [U, V] = f.useState(null), [W, G] = f.useState(null), O = f.useCallback((o) => {
75
+ o !== a.current && (a.current = o, V(o));
76
+ }, []), _ = f.useCallback((o) => {
77
+ o !== m.current && (m.current = o, G(o));
78
+ }, []), u = p || U, l = q || W, a = f.useRef(null), m = f.useRef(null), y = f.useRef(i), H = E != null, S = k(E), P = k(s), v = k(x), g = f.useCallback(() => {
79
+ if (!a.current || !m.current)
80
+ return;
81
+ const o = {
82
+ placement: n,
83
+ strategy: t,
84
+ middleware: M
85
+ };
86
+ P.current && (o.platform = P.current), I(a.current, m.current, o).then((h) => {
87
+ const d = {
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
94
+ };
95
+ $.current && !R(y.current, d) && (y.current = d, Z.flushSync(() => {
96
+ C(d);
97
+ }));
98
+ });
99
+ }, [M, n, t, P, v]);
100
+ w(() => {
101
+ x === !1 && y.current.isPositioned && (y.current.isPositioned = !1, C((o) => ({
102
+ ...o,
103
+ isPositioned: !1
104
+ })));
105
+ }, [x]);
106
+ const $ = f.useRef(!1);
107
+ w(() => ($.current = !0, () => {
108
+ $.current = !1;
109
+ }), []), w(() => {
110
+ if (u && (a.current = u), l && (m.current = l), u && l) {
111
+ if (S.current)
112
+ return S.current(u, l, g);
113
+ g();
114
+ }
115
+ }, [u, l, g, S, H]);
116
+ const F = f.useMemo(() => ({
117
+ reference: a,
118
+ floating: m,
119
+ setReference: O,
120
+ setFloating: _
121
+ }), [O, _]), c = f.useMemo(() => ({
122
+ reference: u,
123
+ floating: l
124
+ }), [u, l]), j = f.useMemo(() => {
125
+ const o = {
126
+ position: t,
127
+ left: 0,
128
+ top: 0
129
+ };
130
+ if (!c.floating)
131
+ return o;
132
+ const h = L(c.floating, i.x), d = L(c.floating, i.y);
133
+ return D ? {
134
+ ...o,
135
+ transform: "translate(" + h + "px, " + d + "px)",
136
+ ...A(c.floating) >= 1.5 && {
137
+ willChange: "transform"
138
+ }
139
+ } : {
140
+ position: t,
141
+ left: h,
142
+ top: d
143
+ };
144
+ }, [t, D, c.floating, i.x, i.y]);
145
+ return f.useMemo(() => ({
146
+ ...i,
147
+ update: g,
148
+ refs: F,
149
+ elements: c,
150
+ floatingStyles: j
151
+ }), [i, g, F, c, j]);
152
+ }
153
+ const te = (e) => {
154
+ function n(t) {
155
+ return {}.hasOwnProperty.call(t, "current");
156
+ }
157
+ return {
158
+ name: "arrow",
159
+ options: e,
160
+ fn(t) {
161
+ const {
162
+ element: r,
163
+ padding: s
164
+ } = typeof e == "function" ? e(t) : e;
165
+ return r && n(r) ? r.current != null ? z({
166
+ element: r.current,
167
+ padding: s
168
+ }).fn(t) : {} : r ? z({
169
+ element: r,
170
+ padding: s
171
+ }).fn(t) : {};
172
+ }
173
+ };
174
+ }, oe = (e, n) => {
175
+ const t = J(e);
176
+ return {
177
+ name: t.name,
178
+ fn: t.fn,
179
+ options: [e, n]
180
+ };
181
+ }, se = (e, n) => {
182
+ const t = K(e);
183
+ return {
184
+ name: t.name,
185
+ fn: t.fn,
186
+ options: [e, n]
187
+ };
188
+ }, ie = (e, n) => ({
189
+ fn: X(e).fn,
190
+ options: [e, n]
191
+ }), ue = (e, n) => {
192
+ const t = N(e);
193
+ return {
194
+ name: t.name,
195
+ fn: t.fn,
196
+ options: [e, n]
197
+ };
198
+ }, le = (e, n) => {
199
+ const t = Q(e);
200
+ return {
201
+ name: t.name,
202
+ fn: t.fn,
203
+ options: [e, n]
204
+ };
205
+ }, ce = (e, n) => {
206
+ const t = T(e);
207
+ return {
208
+ name: t.name,
209
+ fn: t.fn,
210
+ options: [e, n]
211
+ };
212
+ }, ae = (e, n) => {
213
+ const t = te(e);
214
+ return {
215
+ name: t.name,
216
+ fn: t.fn,
217
+ options: [e, n]
218
+ };
219
+ };
220
+ export {
221
+ ae as arrow,
222
+ pe as autoUpdate,
223
+ I as computePosition,
224
+ ue as flip,
225
+ ce as hide,
226
+ ie as limitShift,
227
+ oe as offset,
228
+ ge as platform,
229
+ se as shift,
230
+ le as size,
231
+ fe as useFloating
232
+ };