@weing-dev/ui-kit-primitive 0.5.1 → 0.5.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.
package/dist/feedback.js CHANGED
@@ -1,23 +1,305 @@
1
- import { c as h, j as g } from "./compiler-runtime-BFrE5JtX.js";
1
+ import { c as E, j as w } from "./compiler-runtime-BFrE5JtX.js";
2
2
  import d from "react";
3
- import ge from "react-dom";
4
- import { c as me } from "./bind-D3ZJ5k4I.js";
5
- import { useAnimation as he, motion as pe } from "framer-motion";
6
- const be = (t) => {
7
- const e = h.c(7), {
8
- children: s,
9
- dimmedColor: o,
10
- onClose: n
11
- } = t;
12
- let c;
13
- e[0] === Symbol.for("react.memo_cache_sentinel") ? (c = {
3
+ import gt from "react-dom";
4
+ import { c as dt } from "./bind-D3ZJ5k4I.js";
5
+ import { useAnimation as Ct, motion as wt } from "framer-motion";
6
+ const Et = "_Trigger_1h92q_2", St = "_Content_1h92q_9", $t = {
7
+ Trigger: Et,
8
+ Content: St
9
+ }, _t = d.createContext(null), bt = () => {
10
+ const o = d.use(_t);
11
+ if (!o)
12
+ throw new Error("FloatingAnchor.Trigger and FloatingAnchor.Content must be used inside FloatingAnchor.Root");
13
+ return o;
14
+ }, ht = (o, t, n, e) => {
15
+ const {
16
+ width: s,
17
+ height: r
18
+ } = t, {
19
+ top: c,
20
+ left: l,
21
+ right: i,
22
+ bottom: a,
23
+ width: v,
24
+ height: m
25
+ } = o;
26
+ switch (n) {
27
+ case "top":
28
+ return {
29
+ top: c - r - e,
30
+ left: l + (v - s) / 2
31
+ };
32
+ case "top-start":
33
+ return {
34
+ top: c - r - e,
35
+ left: l
36
+ };
37
+ case "top-end":
38
+ return {
39
+ top: c - r - e,
40
+ left: i - s
41
+ };
42
+ case "bottom":
43
+ return {
44
+ top: a + e,
45
+ left: l + (v - s) / 2
46
+ };
47
+ case "bottom-start":
48
+ return {
49
+ top: a + e,
50
+ left: l
51
+ };
52
+ case "bottom-end":
53
+ return {
54
+ top: a + e,
55
+ left: i - s
56
+ };
57
+ case "left":
58
+ return {
59
+ top: c + (m - r) / 2,
60
+ left: l - s - e
61
+ };
62
+ case "left-start":
63
+ return {
64
+ top: c,
65
+ left: l - s - e
66
+ };
67
+ case "left-end":
68
+ return {
69
+ top: a - r,
70
+ left: l - s - e
71
+ };
72
+ case "right":
73
+ return {
74
+ top: c + (m - r) / 2,
75
+ left: i + e
76
+ };
77
+ case "right-start":
78
+ return {
79
+ top: c,
80
+ left: i + e
81
+ };
82
+ case "right-end":
83
+ return {
84
+ top: a - r,
85
+ left: i + e
86
+ };
87
+ }
88
+ }, Ot = (o) => {
89
+ switch (o) {
90
+ case "top":
91
+ return "bottom";
92
+ case "top-start":
93
+ return "bottom-start";
94
+ case "top-end":
95
+ return "bottom-end";
96
+ case "bottom":
97
+ return "top";
98
+ case "bottom-start":
99
+ return "top-start";
100
+ case "bottom-end":
101
+ return "top-end";
102
+ case "left":
103
+ return "right";
104
+ case "left-start":
105
+ return "right-start";
106
+ case "left-end":
107
+ return "right-end";
108
+ case "right":
109
+ return "left";
110
+ case "right-start":
111
+ return "left-start";
112
+ case "right-end":
113
+ return "left-end";
114
+ }
115
+ }, pt = (o, t, n, e) => {
116
+ if (n.startsWith("top") || n.startsWith("bottom")) {
117
+ const l = e - o.top, i = o.top + t.height - (window.innerHeight - e);
118
+ return Math.max(l, i, 0);
119
+ }
120
+ const r = e - o.left, c = o.left + t.width - (window.innerWidth - e);
121
+ return Math.max(r, c, 0);
122
+ }, Rt = (o, t, n) => {
123
+ const e = window.innerWidth - t.width - n, s = window.innerHeight - t.height - n;
124
+ return {
125
+ left: Math.max(n, Math.min(o.left, e)),
126
+ top: Math.max(n, Math.min(o.top, s))
127
+ };
128
+ }, vt = dt.bind($t), Dt = (o) => {
129
+ const t = E.c(41), {
130
+ children: n,
131
+ placement: e,
132
+ offset: s,
133
+ flip: r,
134
+ shift: c,
135
+ open: l,
136
+ defaultOpen: i,
137
+ onOpenChange: a,
138
+ closeOnOutsideClick: v,
139
+ closeOnEscape: m
140
+ } = o, _ = e === void 0 ? "bottom-start" : e, p = s === void 0 ? 6 : s, f = r === void 0 ? !1 : r, S = c === void 0 ? !1 : c, $ = i === void 0 ? !1 : i, R = v === void 0 ? !0 : v, z = m === void 0 ? !0 : m, st = d.useId(), [Z, tt] = d.useState($), j = l !== void 0, u = j ? l : Z;
141
+ process.env.NODE_ENV !== "production" && l !== void 0 && !a && console.warn("open을 제어하는 경우 onOpenChange 핸들러도 함께 제공해야 합니다. 그렇지 않으면 내부 상태가 외부 상태와 동기화되지 않을 수 있습니다.");
142
+ let D;
143
+ t[0] !== j || t[1] !== a ? (D = (x) => {
144
+ j || tt(x), a == null || a(x);
145
+ }, t[0] = j, t[1] = a, t[2] = D) : D = t[2];
146
+ const y = D, [h, B] = d.useState(null), [g, rt] = d.useState(null), [C, et] = d.useState(null);
147
+ let P, N;
148
+ t[3] !== h || t[4] !== f || t[5] !== g || t[6] !== p || t[7] !== u || t[8] !== _ || t[9] !== S ? (P = () => {
149
+ if (!u || !h || !g)
150
+ return;
151
+ let x = null;
152
+ const b = () => {
153
+ x === null && (x = requestAnimationFrame(() => {
154
+ x = null, T();
155
+ }));
156
+ }, T = () => {
157
+ const ot = h.getBoundingClientRect(), k = {
158
+ width: g.offsetWidth,
159
+ height: g.offsetHeight
160
+ };
161
+ let O = ht(ot, k, _, p);
162
+ if (f) {
163
+ const X = pt(O, k, _, 8);
164
+ if (X > 0) {
165
+ const nt = Ot(_), Y = ht(ot, k, nt, p);
166
+ pt(Y, k, nt, 8) < X && (O = Y);
167
+ }
168
+ }
169
+ S && (O = Rt(O, k, 8)), et(O);
170
+ };
171
+ T(), window.addEventListener("scroll", b, !0), window.addEventListener("resize", b);
172
+ const Q = new ResizeObserver(b);
173
+ return Q.observe(h), Q.observe(g), () => {
174
+ x !== null && cancelAnimationFrame(x), window.removeEventListener("scroll", b, !0), window.removeEventListener("resize", b), Q.disconnect();
175
+ };
176
+ }, N = [u, h, g, _, p, f, S], t[3] = h, t[4] = f, t[5] = g, t[6] = p, t[7] = u, t[8] = _, t[9] = S, t[10] = P, t[11] = N) : (P = t[10], N = t[11]), d.useLayoutEffect(P, N);
177
+ let M, G;
178
+ t[12] !== h || t[13] !== R || t[14] !== g || t[15] !== u || t[16] !== y ? (M = () => {
179
+ if (!u || !R)
180
+ return;
181
+ const x = (b) => {
182
+ const T = b.target;
183
+ T instanceof Node && (h != null && h.contains(T) || g != null && g.contains(T) || y(!1));
184
+ };
185
+ return document.addEventListener("pointerdown", x), () => document.removeEventListener("pointerdown", x);
186
+ }, G = [u, h, g, R, y], t[12] = h, t[13] = R, t[14] = g, t[15] = u, t[16] = y, t[17] = M, t[18] = G) : (M = t[17], G = t[18]), d.useEffect(M, G);
187
+ let A, W;
188
+ t[19] !== z || t[20] !== u || t[21] !== y ? (A = () => {
189
+ if (!u || !z)
190
+ return;
191
+ const x = (b) => {
192
+ b.key === "Escape" && y(!1);
193
+ };
194
+ return document.addEventListener("keydown", x), () => document.removeEventListener("keydown", x);
195
+ }, W = [u, z, y], t[19] = z, t[20] = u, t[21] = y, t[22] = A, t[23] = W) : (A = t[22], W = t[23]), d.useEffect(A, W);
196
+ let V;
197
+ t[24] !== st || t[25] !== u || t[26] !== C || t[27] !== y ? (V = {
198
+ open: u,
199
+ setOpen: y,
200
+ setAnchorEl: B,
201
+ setFloatingEl: rt,
202
+ position: C,
203
+ contentId: st
204
+ }, t[24] = st, t[25] = u, t[26] = C, t[27] = y, t[28] = V) : V = t[28];
205
+ const I = V, U = d.useRef(!1);
206
+ let J, F;
207
+ t[29] !== g || t[30] !== u || t[31] !== C ? (J = () => {
208
+ if (!u) {
209
+ U.current = !1;
210
+ return;
211
+ }
212
+ if (!g || !C || U.current)
213
+ return;
214
+ U.current = !0, (g.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])') ?? g).focus();
215
+ }, F = [u, g, C], t[29] = g, t[30] = u, t[31] = C, t[32] = J, t[33] = F) : (J = t[32], F = t[33]), d.useEffect(J, F);
216
+ const K = d.useRef(!1);
217
+ let H, L;
218
+ t[34] !== h || t[35] !== u ? (H = () => {
219
+ K.current && !u && (h == null || h.focus()), K.current = u;
220
+ }, L = [u, h], t[34] = h, t[35] = u, t[36] = H, t[37] = L) : (H = t[36], L = t[37]), d.useEffect(H, L);
221
+ let q;
222
+ return t[38] !== n || t[39] !== I ? (q = /* @__PURE__ */ w.jsx(_t.Provider, { value: I, children: n }), t[38] = n, t[39] = I, t[40] = q) : q = t[40], q;
223
+ }, Nt = (o) => {
224
+ const t = E.c(9), {
225
+ children: n
226
+ } = o, {
227
+ open: e,
228
+ setOpen: s,
229
+ setAnchorEl: r,
230
+ contentId: c
231
+ } = bt();
232
+ if (typeof n != "function")
233
+ return process.env.NODE_ENV !== "production" && console.error("[FloatingAnchor] Trigger의 children은 함수여야 합니다: <FloatingAnchor.Trigger>{(props) => <button {...props}>열기</button>}</FloatingAnchor.Trigger>"), null;
234
+ let l;
235
+ if (t[0] !== n || t[1] !== c || t[2] !== e || t[3] !== r || t[4] !== s) {
236
+ let i;
237
+ t[6] !== e || t[7] !== s ? (i = () => s(!e), t[6] = e, t[7] = s, t[8] = i) : i = t[8], l = n({
238
+ ref: r,
239
+ "aria-expanded": e,
240
+ "aria-controls": c,
241
+ "aria-haspopup": "dialog",
242
+ className: vt("Trigger"),
243
+ onClick: i
244
+ }), t[0] = n, t[1] = c, t[2] = e, t[3] = r, t[4] = s, t[5] = l;
245
+ } else
246
+ l = t[5];
247
+ return l;
248
+ }, At = (o) => {
249
+ const t = E.c(29);
250
+ let n, e, s, r, c;
251
+ t[0] !== o ? ({
252
+ children: n,
253
+ className: e,
254
+ portalRoot: s,
255
+ style: c,
256
+ ...r
257
+ } = o, t[0] = o, t[1] = n, t[2] = e, t[3] = s, t[4] = r, t[5] = c) : (n = t[1], e = t[2], s = t[3], r = t[4], c = t[5]);
258
+ const {
259
+ open: l,
260
+ setFloatingEl: i,
261
+ position: a,
262
+ contentId: v
263
+ } = bt();
264
+ if (!l)
265
+ return null;
266
+ let m;
267
+ if (t[6] !== n || t[7] !== e || t[8] !== v || t[9] !== s || t[10] !== a || t[11] !== r || t[12] !== i || t[13] !== c) {
268
+ let _;
269
+ t[15] !== e ? (_ = vt("Content", e), t[15] = e, t[16] = _) : _ = t[16];
270
+ const p = (a == null ? void 0 : a.top) ?? 0, f = (a == null ? void 0 : a.left) ?? 0, S = a ? "visible" : "hidden";
271
+ let $;
272
+ t[17] !== c || t[18] !== p || t[19] !== f || t[20] !== S ? ($ = {
273
+ position: "fixed",
274
+ top: p,
275
+ left: f,
276
+ visibility: S,
277
+ ...c
278
+ }, t[17] = c, t[18] = p, t[19] = f, t[20] = S, t[21] = $) : $ = t[21];
279
+ let R;
280
+ t[22] !== n || t[23] !== v || t[24] !== r || t[25] !== i || t[26] !== _ || t[27] !== $ ? (R = /* @__PURE__ */ w.jsx("div", { ref: i, id: v, role: "dialog", tabIndex: -1, className: _, style: $, ...r, children: n }), t[22] = n, t[23] = v, t[24] = r, t[25] = i, t[26] = _, t[27] = $, t[28] = R) : R = t[28], m = gt.createPortal(R, s ?? document.body), t[6] = n, t[7] = e, t[8] = v, t[9] = s, t[10] = a, t[11] = r, t[12] = i, t[13] = c, t[14] = m;
281
+ } else
282
+ m = t[14];
283
+ return m;
284
+ }, me = {
285
+ Root: Dt,
286
+ Trigger: Nt,
287
+ Content: At
288
+ }, Ft = (o) => {
289
+ const t = E.c(7), {
290
+ children: n,
291
+ dimmedColor: e,
292
+ onClose: s
293
+ } = o;
294
+ let r;
295
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = {
14
296
  transparent: "transparent",
15
297
  light: "#00000033",
16
298
  dark: "#0000007a"
17
- }, e[0] = c) : c = e[0];
18
- const l = c[o];
299
+ }, t[0] = r) : r = t[0];
300
+ const l = r[e];
19
301
  let i;
20
- e[1] !== l ? (i = {
302
+ t[1] !== l ? (i = {
21
303
  position: "fixed",
22
304
  top: 0,
23
305
  left: 0,
@@ -25,361 +307,362 @@ const be = (t) => {
25
307
  height: "100dvh",
26
308
  zIndex: 9999,
27
309
  backgroundColor: l
28
- }, e[1] = l, e[2] = i) : i = e[2];
29
- let m;
30
- return e[3] !== s || e[4] !== n || e[5] !== i ? (m = /* @__PURE__ */ g.jsx("div", { style: i, onClick: n, children: s }), e[3] = s, e[4] = n, e[5] = i, e[6] = m) : m = e[6], m;
31
- }, et = (t) => {
32
- const e = h.c(11), {
33
- children: s,
34
- visible: o,
35
- dimmedColor: n,
36
- selector: c,
37
- onClose: r
38
- } = t, l = n === void 0 ? "dark" : n, i = c === void 0 ? "body" : c, [m, b] = d.useState(null);
39
- let f, p;
40
- e[0] !== i ? (f = () => {
41
- b(document.querySelector(i));
42
- }, p = [i], e[0] = i, e[1] = f, e[2] = p) : (f = e[1], p = e[2]), d.useEffect(f, p);
43
- let u;
44
- e[3] !== s || e[4] !== l || e[5] !== r || e[6] !== m || e[7] !== o ? (u = m && o ? ge.createPortal(/* @__PURE__ */ g.jsx(be, { onClose: r, dimmedColor: l, children: s }), m) : /* @__PURE__ */ g.jsx(d.Fragment, {}), e[3] = s, e[4] = l, e[5] = r, e[6] = m, e[7] = o, e[8] = u) : u = e[8];
310
+ }, t[1] = l, t[2] = i) : i = t[2];
45
311
  let a;
46
- return e[9] !== u ? (a = /* @__PURE__ */ g.jsx(d.Fragment, { children: u }), e[9] = u, e[10] = a) : a = e[10], a;
47
- }, ye = {
312
+ return t[3] !== n || t[4] !== s || t[5] !== i ? (a = /* @__PURE__ */ w.jsx("div", { style: i, onClick: s, children: n }), t[3] = n, t[4] = s, t[5] = i, t[6] = a) : a = t[6], a;
313
+ }, he = (o) => {
314
+ const t = E.c(11), {
315
+ children: n,
316
+ visible: e,
317
+ dimmedColor: s,
318
+ selector: r,
319
+ onClose: c
320
+ } = o, l = s === void 0 ? "dark" : s, i = r === void 0 ? "body" : r, [a, v] = d.useState(null);
321
+ let m, _;
322
+ t[0] !== i ? (m = () => {
323
+ v(document.querySelector(i));
324
+ }, _ = [i], t[0] = i, t[1] = m, t[2] = _) : (m = t[1], _ = t[2]), d.useEffect(m, _);
325
+ let p;
326
+ t[3] !== n || t[4] !== l || t[5] !== c || t[6] !== a || t[7] !== e ? (p = a && e ? gt.createPortal(/* @__PURE__ */ w.jsx(Ft, { onClose: c, dimmedColor: l, children: n }), a) : /* @__PURE__ */ w.jsx(d.Fragment, {}), t[3] = n, t[4] = l, t[5] = c, t[6] = a, t[7] = e, t[8] = p) : p = t[8];
327
+ let f;
328
+ return t[9] !== p ? (f = /* @__PURE__ */ w.jsx(d.Fragment, { children: p }), t[9] = p, t[10] = f) : f = t[10], f;
329
+ }, Lt = {
48
330
  id: "",
49
331
  bodyScroll: !1,
50
332
  dimmedDisabled: !1
51
- }, ce = d.createContext(ye), Ce = "_Layer_14dap_2", xe = "_bodyScroll_14dap_2", ve = "_Contents_14dap_13", Se = "_Dimmed_14dap_23", De = {
52
- Layer: Ce,
53
- bodyScroll: xe,
54
- Contents: ve,
55
- Dimmed: Se
56
- }, re = me.bind(De), $e = () => {
57
- const t = h.c(10), e = d.useId(), s = d.useRef(null);
58
- let o;
59
- t[0] !== e ? (o = (a) => ({
60
- popoverTargetAction: a,
61
- popoverTarget: e
62
- }), t[0] = e, t[1] = o) : o = t[1];
63
- const n = o;
64
- let c;
65
- t[2] !== n ? (c = {
66
- hide: n("hide"),
67
- toggle: n("toggle"),
68
- show: n("show")
69
- }, t[2] = n, t[3] = c) : c = t[3];
70
- const r = c;
333
+ }, ft = d.createContext(Lt), It = "_Layer_14dap_2", Tt = "_bodyScroll_14dap_2", kt = "_Contents_14dap_13", jt = "_Dimmed_14dap_23", Pt = {
334
+ Layer: It,
335
+ bodyScroll: Tt,
336
+ Contents: kt,
337
+ Dimmed: jt
338
+ }, ut = dt.bind(Pt), Mt = () => {
339
+ const o = E.c(10), t = d.useId(), n = d.useRef(null);
340
+ let e;
341
+ o[0] !== t ? (e = (f) => ({
342
+ popoverTargetAction: f,
343
+ popoverTarget: t
344
+ }), o[0] = t, o[1] = e) : e = o[1];
345
+ const s = e;
346
+ let r;
347
+ o[2] !== s ? (r = {
348
+ hide: s("hide"),
349
+ toggle: s("toggle"),
350
+ show: s("show")
351
+ }, o[2] = s, o[3] = r) : r = o[3];
352
+ const c = r;
71
353
  let l;
72
- t[4] === Symbol.for("react.memo_cache_sentinel") ? (l = () => {
73
- var a;
74
- return (a = s.current) == null ? void 0 : a.showPopover();
75
- }, t[4] = l) : l = t[4];
354
+ o[4] === Symbol.for("react.memo_cache_sentinel") ? (l = () => {
355
+ var f;
356
+ return (f = n.current) == null ? void 0 : f.showPopover();
357
+ }, o[4] = l) : l = o[4];
76
358
  const i = l;
359
+ let a;
360
+ o[5] === Symbol.for("react.memo_cache_sentinel") ? (a = () => {
361
+ var f;
362
+ return (f = n.current) == null ? void 0 : f.hidePopover();
363
+ }, o[5] = a) : a = o[5];
364
+ const v = a;
77
365
  let m;
78
- t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = () => {
79
- var a;
80
- return (a = s.current) == null ? void 0 : a.hidePopover();
81
- }, t[5] = m) : m = t[5];
82
- const b = m;
83
- let f;
84
- t[6] === Symbol.for("react.memo_cache_sentinel") ? (f = () => {
85
- var a;
86
- return (a = s.current) == null ? void 0 : a.togglePopover();
87
- }, t[6] = f) : f = t[6];
88
- const p = f;
89
- let u;
90
- return t[7] !== r || t[8] !== e ? (u = {
91
- id: e,
92
- controlAttr: r,
93
- ref: s,
366
+ o[6] === Symbol.for("react.memo_cache_sentinel") ? (m = () => {
367
+ var f;
368
+ return (f = n.current) == null ? void 0 : f.togglePopover();
369
+ }, o[6] = m) : m = o[6];
370
+ const _ = m;
371
+ let p;
372
+ return o[7] !== c || o[8] !== t ? (p = {
373
+ id: t,
374
+ controlAttr: c,
375
+ ref: n,
94
376
  show: i,
95
- hide: b,
96
- toggle: p
97
- }, t[7] = r, t[8] = e, t[9] = u) : u = t[9], u;
98
- }, Ee = (t) => {
99
- const e = h.c(8), {
100
- onClick: s,
101
- ...o
102
- } = t, {
103
- id: n,
104
- dimmedDisabled: c
105
- } = d.use(ce), r = re("Dimmed", o.className);
377
+ hide: v,
378
+ toggle: _
379
+ }, o[7] = c, o[8] = t, o[9] = p) : p = o[9], p;
380
+ }, Wt = (o) => {
381
+ const t = E.c(8), {
382
+ onClick: n,
383
+ ...e
384
+ } = o, {
385
+ id: s,
386
+ dimmedDisabled: r
387
+ } = d.use(ft), c = ut("Dimmed", e.className);
106
388
  let l;
107
- e[0] !== c || e[1] !== n || e[2] !== s ? (l = !c && {
108
- onClick: s,
389
+ t[0] !== r || t[1] !== s || t[2] !== n ? (l = !r && {
390
+ onClick: n,
109
391
  popoverTargetAction: "hide",
110
- popoverTarget: n
111
- }, e[0] = c, e[1] = n, e[2] = s, e[3] = l) : l = e[3];
392
+ popoverTarget: s
393
+ }, t[0] = r, t[1] = s, t[2] = n, t[3] = l) : l = t[3];
112
394
  let i;
113
- return e[4] !== o || e[5] !== r || e[6] !== l ? (i = /* @__PURE__ */ g.jsx("button", { ...o, className: r, ...l }), e[4] = o, e[5] = r, e[6] = l, e[7] = i) : i = e[7], i;
114
- }, je = (t) => {
115
- const e = h.c(8);
116
- let s, o, n;
117
- if (e[0] !== t) {
395
+ return t[4] !== e || t[5] !== c || t[6] !== l ? (i = /* @__PURE__ */ w.jsx("button", { ...e, className: c, ...l }), t[4] = e, t[5] = c, t[6] = l, t[7] = i) : i = t[7], i;
396
+ }, Vt = (o) => {
397
+ const t = E.c(8);
398
+ let n, e, s;
399
+ if (t[0] !== o) {
118
400
  const {
119
- children: r,
401
+ children: c,
120
402
  ...l
121
- } = t;
122
- s = r, o = l, n = re("Contents", l.className), e[0] = t, e[1] = s, e[2] = o, e[3] = n;
403
+ } = o;
404
+ n = c, e = l, s = ut("Contents", l.className), t[0] = o, t[1] = n, t[2] = e, t[3] = s;
123
405
  } else
124
- s = e[1], o = e[2], n = e[3];
125
- let c;
126
- return e[4] !== s || e[5] !== o || e[6] !== n ? (c = /* @__PURE__ */ g.jsx("div", { ...o, className: n, children: s }), e[4] = s, e[5] = o, e[6] = n, e[7] = c) : c = e[7], c;
127
- }, we = (t) => {
128
- const e = h.c(5), {
129
- children: s,
130
- ...o
131
- } = t, {
132
- id: n,
133
- bodyScroll: c
134
- } = d.use(ce), r = "manual", l = re("Layer", o.className, {
135
- bodyScroll: c
406
+ n = t[1], e = t[2], s = t[3];
407
+ let r;
408
+ return t[4] !== n || t[5] !== e || t[6] !== s ? (r = /* @__PURE__ */ w.jsx("div", { ...e, className: s, children: n }), t[4] = n, t[5] = e, t[6] = s, t[7] = r) : r = t[7], r;
409
+ }, Ht = (o) => {
410
+ const t = E.c(5), {
411
+ children: n,
412
+ ...e
413
+ } = o, {
414
+ id: s,
415
+ bodyScroll: r
416
+ } = d.use(ft), c = "manual", l = ut("Layer", e.className, {
417
+ bodyScroll: r
136
418
  });
137
419
  let i;
138
- return e[0] !== s || e[1] !== n || e[2] !== o || e[3] !== l ? (i = /* @__PURE__ */ g.jsx("div", { ...o, id: n, popover: r, className: l, children: s }), e[0] = s, e[1] = n, e[2] = o, e[3] = l, e[4] = i) : i = e[4], i;
139
- }, Ne = (t) => {
140
- const e = h.c(10);
141
- let s, o, n;
142
- e[0] !== t ? ({
143
- children: s,
144
- dimmedDisabled: n,
145
- ...o
146
- } = t, e[0] = t, e[1] = s, e[2] = o, e[3] = n) : (s = e[1], o = e[2], n = e[3]);
147
- const c = n === void 0 ? !1 : n;
148
- let r;
149
- e[4] !== c || e[5] !== o ? (r = {
150
- ...o,
151
- dimmedDisabled: c
152
- }, e[4] = c, e[5] = o, e[6] = r) : r = e[6];
153
- const l = r;
420
+ return t[0] !== n || t[1] !== s || t[2] !== e || t[3] !== l ? (i = /* @__PURE__ */ w.jsx("div", { ...e, id: s, popover: c, className: l, children: n }), t[0] = n, t[1] = s, t[2] = e, t[3] = l, t[4] = i) : i = t[4], i;
421
+ }, qt = (o) => {
422
+ const t = E.c(10);
423
+ let n, e, s;
424
+ t[0] !== o ? ({
425
+ children: n,
426
+ dimmedDisabled: s,
427
+ ...e
428
+ } = o, t[0] = o, t[1] = n, t[2] = e, t[3] = s) : (n = t[1], e = t[2], s = t[3]);
429
+ const r = s === void 0 ? !1 : s;
430
+ let c;
431
+ t[4] !== r || t[5] !== e ? (c = {
432
+ ...e,
433
+ dimmedDisabled: r
434
+ }, t[4] = r, t[5] = e, t[6] = c) : c = t[6];
435
+ const l = c;
154
436
  let i;
155
- return e[7] !== s || e[8] !== l ? (i = /* @__PURE__ */ g.jsx(ce, { value: l, children: s }), e[7] = s, e[8] = l, e[9] = i) : i = e[9], i;
156
- }, tt = {
157
- Root: Ne,
158
- Layer: we,
159
- Dimmed: Ee,
160
- Contents: je,
161
- usePopup: $e
162
- }, Re = "_Dimmed_dueb9_2", ke = "_Wrapper_dueb9_21", Ie = "_open_dueb9_28", Pe = "_top_dueb9_31", Le = "_bottom_dueb9_38", Oe = "_left_dueb9_46", Te = "_right_dueb9_53", Ae = {
163
- Dimmed: Re,
164
- Wrapper: ke,
165
- open: Ie,
166
- top: Pe,
167
- bottom: Le,
168
- left: Oe,
169
- right: Te
170
- }, Fe = {}, ae = d.createContext(Fe), de = me.bind(Ae), Me = () => {
171
- const t = h.c(3), {
172
- open: e,
173
- handleClose: s
174
- } = d.use(ae);
175
- if (!e)
437
+ return t[7] !== n || t[8] !== l ? (i = /* @__PURE__ */ w.jsx(ft, { value: l, children: n }), t[7] = n, t[8] = l, t[9] = i) : i = t[9], i;
438
+ }, pe = {
439
+ Root: qt,
440
+ Layer: Ht,
441
+ Dimmed: Wt,
442
+ Contents: Vt,
443
+ usePopup: Mt
444
+ }, zt = "_Dimmed_dueb9_2", Bt = "_Wrapper_dueb9_21", Gt = "_open_dueb9_28", Ut = "_top_dueb9_31", Jt = "_bottom_dueb9_38", Kt = "_left_dueb9_46", Qt = "_right_dueb9_53", Xt = {
445
+ Dimmed: zt,
446
+ Wrapper: Bt,
447
+ open: Gt,
448
+ top: Ut,
449
+ bottom: Jt,
450
+ left: Kt,
451
+ right: Qt
452
+ }, Yt = {}, mt = d.createContext(Yt), yt = dt.bind(Xt), Zt = () => {
453
+ const o = E.c(3), {
454
+ open: t,
455
+ handleClose: n
456
+ } = d.use(mt);
457
+ if (!t)
176
458
  return null;
177
- let o;
178
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (o = de("Dimmed"), t[0] = o) : o = t[0];
179
- let n;
180
- return t[1] !== s ? (n = /* @__PURE__ */ g.jsx("div", { className: o, onClick: s }), t[1] = s, t[2] = n) : n = t[2], n;
181
- }, We = (t) => {
182
- const e = h.c(59), {
183
- children: s,
184
- ...o
185
- } = t, {
186
- open: n,
187
- dragElastic: c,
188
- dragConstraints: r,
459
+ let e;
460
+ o[0] === Symbol.for("react.memo_cache_sentinel") ? (e = yt("Dimmed"), o[0] = e) : e = o[0];
461
+ let s;
462
+ return o[1] !== n ? (s = /* @__PURE__ */ w.jsx("div", { className: e, onClick: n }), o[1] = n, o[2] = s) : s = o[2], s;
463
+ }, te = (o) => {
464
+ const t = E.c(59), {
465
+ children: n,
466
+ ...e
467
+ } = o, {
468
+ open: s,
469
+ dragElastic: r,
470
+ dragConstraints: c,
189
471
  drag: l,
190
472
  direction: i,
191
- dragDirectionLock: m,
192
- dragMomentum: b,
193
- handleClose: f
194
- } = d.use(ae), p = l === void 0 ? !0 : l, u = i === void 0 ? "bottom" : i, a = m === void 0 ? !0 : m, J = b === void 0 ? !1 : b, K = he(), fe = d.useRef(null), [Q, ue] = d.useState(0);
195
- let N, R;
196
- e[0] === Symbol.for("react.memo_cache_sentinel") ? (N = () => {
197
- window != null && ue(window.innerHeight);
198
- }, R = [], e[0] = N, e[1] = R) : (N = e[0], R = e[1]), d.useEffect(N, R);
199
- let k;
200
- e[2] === Symbol.for("react.memo_cache_sentinel") ? (k = {
473
+ dragDirectionLock: a,
474
+ dragMomentum: v,
475
+ handleClose: m
476
+ } = d.use(mt), _ = l === void 0 ? !0 : l, p = i === void 0 ? "bottom" : i, f = a === void 0 ? !0 : a, S = v === void 0 ? !1 : v, $ = Ct(), R = d.useRef(null), [z, st] = d.useState(0);
477
+ let Z, tt;
478
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (Z = () => {
479
+ window != null && st(window.innerHeight);
480
+ }, tt = [], t[0] = Z, t[1] = tt) : (Z = t[0], tt = t[1]), d.useEffect(Z, tt);
481
+ let j;
482
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (j = {
201
483
  y: "100%",
202
484
  x: 0
203
- }, e[2] = k) : k = e[2];
204
- const U = n ? 0 : "100%";
485
+ }, t[2] = j) : j = t[2];
486
+ const u = s ? 0 : "100%";
487
+ let D;
488
+ t[3] !== u ? (D = {
489
+ y: u
490
+ }, t[3] = u, t[4] = D) : D = t[4];
205
491
  let y;
206
- e[3] !== U ? (y = {
207
- y: U
208
- }, e[3] = U, e[4] = y) : y = e[4];
209
- let I;
210
- e[5] === Symbol.for("react.memo_cache_sentinel") ? (I = {
492
+ t[5] === Symbol.for("react.memo_cache_sentinel") ? (y = {
211
493
  top: 0.05,
212
494
  bottom: 1
213
- }, e[5] = I) : I = e[5];
214
- let C;
215
- e[6] !== Q ? (C = {
495
+ }, t[5] = y) : y = t[5];
496
+ let h;
497
+ t[6] !== z ? (h = {
216
498
  top: 0,
217
- bottom: Q
218
- }, e[6] = Q, e[7] = C) : C = e[7];
219
- let x;
220
- e[8] !== C || e[9] !== y ? (x = {
221
- initial: k,
222
- animate: y,
499
+ bottom: z
500
+ }, t[6] = z, t[7] = h) : h = t[7];
501
+ let B;
502
+ t[8] !== h || t[9] !== D ? (B = {
503
+ initial: j,
504
+ animate: D,
223
505
  drag: "y",
224
- dragElastic: I,
225
- dragConstraints: C,
226
- shouldClose: Ge
227
- }, e[8] = C, e[9] = y, e[10] = x) : x = e[10];
228
- let P;
229
- e[11] === Symbol.for("react.memo_cache_sentinel") ? (P = {
506
+ dragElastic: y,
507
+ dragConstraints: h,
508
+ shouldClose: oe
509
+ }, t[8] = h, t[9] = D, t[10] = B) : B = t[10];
510
+ let g;
511
+ t[11] === Symbol.for("react.memo_cache_sentinel") ? (g = {
230
512
  y: "-100%",
231
513
  x: 0
232
- }, e[11] = P) : P = e[11];
233
- const X = n ? 0 : "-100%";
234
- let v;
235
- e[12] !== X ? (v = {
236
- y: X
237
- }, e[12] = X, e[13] = v) : v = e[13];
238
- let L, O;
239
- e[14] === Symbol.for("react.memo_cache_sentinel") ? (L = {
514
+ }, t[11] = g) : g = t[11];
515
+ const rt = s ? 0 : "-100%";
516
+ let C;
517
+ t[12] !== rt ? (C = {
518
+ y: rt
519
+ }, t[12] = rt, t[13] = C) : C = t[13];
520
+ let et, P;
521
+ t[14] === Symbol.for("react.memo_cache_sentinel") ? (et = {
240
522
  top: 1,
241
523
  bottom: 0.05
242
- }, O = {
524
+ }, P = {
243
525
  bottom: 0
244
- }, e[14] = L, e[15] = O) : (L = e[14], O = e[15]);
245
- let S;
246
- e[16] !== v ? (S = {
247
- initial: P,
248
- animate: v,
526
+ }, t[14] = et, t[15] = P) : (et = t[14], P = t[15]);
527
+ let N;
528
+ t[16] !== C ? (N = {
529
+ initial: g,
530
+ animate: C,
249
531
  drag: "y",
250
- dragElastic: L,
251
- dragConstraints: O,
252
- shouldClose: Ve
253
- }, e[16] = v, e[17] = S) : S = e[17];
254
- let T;
255
- e[18] === Symbol.for("react.memo_cache_sentinel") ? (T = {
532
+ dragElastic: et,
533
+ dragConstraints: P,
534
+ shouldClose: ne
535
+ }, t[16] = C, t[17] = N) : N = t[17];
536
+ let M;
537
+ t[18] === Symbol.for("react.memo_cache_sentinel") ? (M = {
256
538
  x: "-100%",
257
539
  y: 0
258
- }, e[18] = T) : T = e[18];
259
- const Y = n ? 0 : "-100%";
260
- let D;
261
- e[19] !== Y ? (D = {
262
- x: Y
263
- }, e[19] = Y, e[20] = D) : D = e[20];
264
- let A, F;
265
- e[21] === Symbol.for("react.memo_cache_sentinel") ? (A = {
540
+ }, t[18] = M) : M = t[18];
541
+ const G = s ? 0 : "-100%";
542
+ let A;
543
+ t[19] !== G ? (A = {
544
+ x: G
545
+ }, t[19] = G, t[20] = A) : A = t[20];
546
+ let W, V;
547
+ t[21] === Symbol.for("react.memo_cache_sentinel") ? (W = {
266
548
  left: 1,
267
549
  right: 0.05
268
- }, F = {
550
+ }, V = {
269
551
  right: 0
270
- }, e[21] = A, e[22] = F) : (A = e[21], F = e[22]);
271
- let $;
272
- e[23] !== D ? ($ = {
273
- initial: T,
274
- animate: D,
552
+ }, t[21] = W, t[22] = V) : (W = t[21], V = t[22]);
553
+ let I;
554
+ t[23] !== A ? (I = {
555
+ initial: M,
556
+ animate: A,
275
557
  drag: "x",
276
- dragElastic: A,
277
- dragConstraints: F,
278
- shouldClose: qe
279
- }, e[23] = D, e[24] = $) : $ = e[24];
280
- let M;
281
- e[25] === Symbol.for("react.memo_cache_sentinel") ? (M = {
558
+ dragElastic: W,
559
+ dragConstraints: V,
560
+ shouldClose: se
561
+ }, t[23] = A, t[24] = I) : I = t[24];
562
+ let U;
563
+ t[25] === Symbol.for("react.memo_cache_sentinel") ? (U = {
282
564
  x: "100%",
283
565
  y: 0
284
- }, e[25] = M) : M = e[25];
285
- const Z = n ? 0 : "100%";
286
- let E;
287
- e[26] !== Z ? (E = {
288
- x: Z
289
- }, e[26] = Z, e[27] = E) : E = e[27];
290
- let W, H;
291
- e[28] === Symbol.for("react.memo_cache_sentinel") ? (W = {
566
+ }, t[25] = U) : U = t[25];
567
+ const J = s ? 0 : "100%";
568
+ let F;
569
+ t[26] !== J ? (F = {
570
+ x: J
571
+ }, t[26] = J, t[27] = F) : F = t[27];
572
+ let K, H;
573
+ t[28] === Symbol.for("react.memo_cache_sentinel") ? (K = {
292
574
  left: 0.05,
293
575
  right: 1
294
576
  }, H = {
295
577
  left: 0
296
- }, e[28] = W, e[29] = H) : (W = e[28], H = e[29]);
297
- let j;
298
- e[30] !== E ? (j = {
299
- initial: M,
300
- animate: E,
578
+ }, t[28] = K, t[29] = H) : (K = t[28], H = t[29]);
579
+ let L;
580
+ t[30] !== F ? (L = {
581
+ initial: U,
582
+ animate: F,
301
583
  drag: "x",
302
- dragElastic: W,
584
+ dragElastic: K,
303
585
  dragConstraints: H,
304
- shouldClose: ze
305
- }, e[30] = E, e[31] = j) : j = e[31];
306
- let G;
307
- e[32] !== x || e[33] !== S || e[34] !== $ || e[35] !== j ? (G = {
308
- bottom: x,
309
- top: S,
310
- left: $,
311
- right: j
312
- }, e[32] = x, e[33] = S, e[34] = $, e[35] = j, e[36] = G) : G = e[36];
313
- const _ = G[u], ee = p && _.drag, te = c ?? _.dragElastic, oe = r ?? _.dragConstraints;
314
- let V;
315
- e[37] === Symbol.for("react.memo_cache_sentinel") ? (V = {
586
+ shouldClose: re
587
+ }, t[30] = F, t[31] = L) : L = t[31];
588
+ let q;
589
+ t[32] !== B || t[33] !== N || t[34] !== I || t[35] !== L ? (q = {
590
+ bottom: B,
591
+ top: N,
592
+ left: I,
593
+ right: L
594
+ }, t[32] = B, t[33] = N, t[34] = I, t[35] = L, t[36] = q) : q = t[36];
595
+ const b = q[p], T = _ && b.drag, Q = r ?? b.dragElastic, ot = c ?? b.dragConstraints;
596
+ let k;
597
+ t[37] === Symbol.for("react.memo_cache_sentinel") ? (k = {
316
598
  type: "tween",
317
599
  duration: 0.25,
318
600
  ease: "easeInOut"
319
- }, e[37] = V) : V = e[37];
320
- let w;
321
- e[38] !== _.animate ? (w = {
322
- ..._.animate,
323
- transition: V
324
- }, e[38] = _.animate, e[39] = w) : w = e[39];
325
- let q;
326
- e[40] !== _ || e[41] !== a || e[42] !== J || e[43] !== ee || e[44] !== te || e[45] !== oe || e[46] !== w ? (q = {
327
- ..._,
328
- dragDirectionLock: a,
329
- dragMomentum: J,
330
- drag: ee,
331
- dragElastic: te,
332
- dragConstraints: oe,
333
- animate: w
334
- }, e[40] = _, e[41] = a, e[42] = J, e[43] = ee, e[44] = te, e[45] = oe, e[46] = w, e[47] = q) : q = e[47];
335
- const se = q;
336
- let z;
337
- e[48] !== _ || e[49] !== K || e[50] !== f ? (z = (Ke, _e) => {
338
- _.shouldClose(_e) ? f == null || f() : K.start("visible");
339
- }, e[48] = _, e[49] = K, e[50] = f, e[51] = z) : z = e[51];
340
- const ne = z, le = pe, ie = de("Wrapper", o.className, u, {
341
- open: n
601
+ }, t[37] = k) : k = t[37];
602
+ let O;
603
+ t[38] !== b.animate ? (O = {
604
+ ...b.animate,
605
+ transition: k
606
+ }, t[38] = b.animate, t[39] = O) : O = t[39];
607
+ let X;
608
+ t[40] !== b || t[41] !== f || t[42] !== S || t[43] !== T || t[44] !== Q || t[45] !== ot || t[46] !== O ? (X = {
609
+ ...b,
610
+ dragDirectionLock: f,
611
+ dragMomentum: S,
612
+ drag: T,
613
+ dragElastic: Q,
614
+ dragConstraints: ot,
615
+ animate: O
616
+ }, t[40] = b, t[41] = f, t[42] = S, t[43] = T, t[44] = Q, t[45] = ot, t[46] = O, t[47] = X) : X = t[47];
617
+ const nt = X;
618
+ let Y;
619
+ t[48] !== b || t[49] !== $ || t[50] !== m ? (Y = (ie, xt) => {
620
+ b.shouldClose(xt) ? m == null || m() : $.start("visible");
621
+ }, t[48] = b, t[49] = $, t[50] = m, t[51] = Y) : Y = t[51];
622
+ const lt = Y, ct = wt, at = yt("Wrapper", e.className, p, {
623
+ open: s
342
624
  });
343
- let B;
344
- return e[52] !== s || e[53] !== ne || e[54] !== se || e[55] !== o || e[56] !== le.div || e[57] !== ie ? (B = /* @__PURE__ */ g.jsx(le.div, { ...o, ...se, ref: fe, className: ie, onDragEnd: ne, children: s }), e[52] = s, e[53] = ne, e[54] = se, e[55] = o, e[56] = le.div, e[57] = ie, e[58] = B) : B = e[58], B;
345
- }, He = (t) => {
346
- const e = h.c(11);
347
- let s, o;
348
- e[0] !== t ? ({
349
- children: s,
350
- ...o
351
- } = t, e[0] = t, e[1] = s, e[2] = o) : (s = e[1], o = e[2]);
352
- let n;
353
- e[3] !== o ? (n = {
354
- ...o
355
- }, e[3] = o, e[4] = n) : n = e[4];
356
- const c = n;
357
- let r, l;
358
- e[5] !== o.open ? (r = () => (document.body.style.overflow = o.open ? "hidden" : "", Be), l = [o.open], e[5] = o.open, e[6] = r, e[7] = l) : (r = e[6], l = e[7]), d.useEffect(r, l);
625
+ let it;
626
+ return t[52] !== n || t[53] !== lt || t[54] !== nt || t[55] !== e || t[56] !== ct.div || t[57] !== at ? (it = /* @__PURE__ */ w.jsx(ct.div, { ...e, ...nt, ref: R, className: at, onDragEnd: lt, children: n }), t[52] = n, t[53] = lt, t[54] = nt, t[55] = e, t[56] = ct.div, t[57] = at, t[58] = it) : it = t[58], it;
627
+ }, ee = (o) => {
628
+ const t = E.c(11);
629
+ let n, e;
630
+ t[0] !== o ? ({
631
+ children: n,
632
+ ...e
633
+ } = o, t[0] = o, t[1] = n, t[2] = e) : (n = t[1], e = t[2]);
634
+ let s;
635
+ t[3] !== e ? (s = {
636
+ ...e
637
+ }, t[3] = e, t[4] = s) : s = t[4];
638
+ const r = s;
639
+ let c, l;
640
+ t[5] !== e.open ? (c = () => (document.body.style.overflow = e.open ? "hidden" : "", le), l = [e.open], t[5] = e.open, t[6] = c, t[7] = l) : (c = t[6], l = t[7]), d.useEffect(c, l);
359
641
  let i;
360
- return e[8] !== s || e[9] !== c ? (i = /* @__PURE__ */ g.jsx(ae, { value: c, children: s }), e[8] = s, e[9] = c, e[10] = i) : i = e[10], i;
361
- }, ot = {
362
- Root: He,
363
- Content: We,
364
- Dimmed: Me
642
+ return t[8] !== n || t[9] !== r ? (i = /* @__PURE__ */ w.jsx(mt, { value: r, children: n }), t[8] = n, t[9] = r, t[10] = i) : i = t[10], i;
643
+ }, ge = {
644
+ Root: ee,
645
+ Content: te,
646
+ Dimmed: Zt
365
647
  };
366
- function Ge(t) {
367
- return t.offset.y > 20;
648
+ function oe(o) {
649
+ return o.offset.y > 20;
368
650
  }
369
- function Ve(t) {
370
- return t.offset.y < -20;
651
+ function ne(o) {
652
+ return o.offset.y < -20;
371
653
  }
372
- function qe(t) {
373
- return t.offset.x < -20;
654
+ function se(o) {
655
+ return o.offset.x < -20;
374
656
  }
375
- function ze(t) {
376
- return t.offset.x > 20;
657
+ function re(o) {
658
+ return o.offset.x > 20;
377
659
  }
378
- function Be() {
660
+ function le() {
379
661
  document.body.style.overflow = "";
380
662
  }
381
663
  export {
382
- et as Modal,
383
- tt as Popup,
384
- ot as Sheet
664
+ me as FloatingAnchor,
665
+ he as Modal,
666
+ pe as Popup,
667
+ ge as Sheet
385
668
  };