@drjoshcsimmons/scl 0.1.4 → 0.1.5

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 (88) hide show
  1. package/dist/index100.js +8 -14
  2. package/dist/index101.js +50 -9
  3. package/dist/index102.js +218 -49
  4. package/dist/index103.js +29 -218
  5. package/dist/index104.js +178 -27
  6. package/dist/index11.js +2 -2
  7. package/dist/index110.js +1 -1
  8. package/dist/index112.js +1 -1
  9. package/dist/index13.js +2 -2
  10. package/dist/index131.js +1 -1
  11. package/dist/index132.js +1 -1
  12. package/dist/index137.js +11 -21
  13. package/dist/index138.js +26 -11
  14. package/dist/index139.js +4 -27
  15. package/dist/index14.js +2 -2
  16. package/dist/index140.js +22 -4
  17. package/dist/index15.js +2 -2
  18. package/dist/index17.js +1 -1
  19. package/dist/index18.js +2 -2
  20. package/dist/index20.js +2 -2
  21. package/dist/index21.js +1 -1
  22. package/dist/index22.js +1 -1
  23. package/dist/index23.js +1 -1
  24. package/dist/index24.js +1 -1
  25. package/dist/index25.js +3 -3
  26. package/dist/index26.js +1 -1
  27. package/dist/index27.js +3 -3
  28. package/dist/index29.js +1 -1
  29. package/dist/index31.js +1 -1
  30. package/dist/index33.js +1 -1
  31. package/dist/index36.js +2 -2
  32. package/dist/index37.js +1 -1
  33. package/dist/index45.js +7 -7
  34. package/dist/index47.js +33 -435
  35. package/dist/index48.js +111 -147
  36. package/dist/index49.js +65 -302
  37. package/dist/index5.js +1 -1
  38. package/dist/index50.js +60 -12
  39. package/dist/index51.js +253 -32
  40. package/dist/index52.js +7 -7
  41. package/dist/index53.js +302 -65
  42. package/dist/index54.js +4 -4
  43. package/dist/index55.js +4 -1
  44. package/dist/index56.js +9 -249
  45. package/dist/index57.js +432 -57
  46. package/dist/index58.js +6 -6
  47. package/dist/index6.js +1 -1
  48. package/dist/index61.js +234 -99
  49. package/dist/index62.js +12 -260
  50. package/dist/index63.js +860 -12
  51. package/dist/index64.js +9 -82
  52. package/dist/index65.js +505 -211
  53. package/dist/index66.js +138 -507
  54. package/dist/index67.js +17 -21
  55. package/dist/index68.js +16 -854
  56. package/dist/index69.js +336 -9
  57. package/dist/index7.js +1 -1
  58. package/dist/index70.js +126 -250
  59. package/dist/index71.js +82 -31
  60. package/dist/index72.js +216 -311
  61. package/dist/index73.js +222 -214
  62. package/dist/index74.js +30 -17
  63. package/dist/index75.js +197 -91
  64. package/dist/index77.js +25 -44
  65. package/dist/index78.js +5 -25
  66. package/dist/index79.js +53 -6
  67. package/dist/index8.js +1 -1
  68. package/dist/index80.js +52 -49
  69. package/dist/index81.js +10 -33
  70. package/dist/index82.js +4 -11
  71. package/dist/index83.js +30 -8
  72. package/dist/index84.js +12 -3
  73. package/dist/index85.js +51 -5
  74. package/dist/index86.js +33 -24
  75. package/dist/index87.js +65 -177
  76. package/dist/index88.js +10 -68
  77. package/dist/index9.js +2 -2
  78. package/dist/index90.js +46 -30
  79. package/dist/index91.js +7 -54
  80. package/dist/index92.js +3 -10
  81. package/dist/index93.js +6 -4
  82. package/dist/index94.js +24 -12
  83. package/dist/index95.js +647 -51
  84. package/dist/index96.js +112 -637
  85. package/dist/index97.js +126 -116
  86. package/dist/index98.js +13 -134
  87. package/dist/index99.js +14 -13
  88. package/package.json +1 -1
package/dist/index72.js CHANGED
@@ -1,338 +1,243 @@
1
- import * as s from "react";
2
- import { composeEventHandlers as g } from "./index79.js";
3
- import { useComposedRefs as N } from "./index78.js";
4
- import { createContextScope as K } from "./index76.js";
5
- import { DismissableLayer as W } from "./index97.js";
6
- import { useId as $ } from "./index82.js";
7
- import { createPopperScope as S, Root as z, Anchor as J, Content as Q, Arrow as Z } from "./index103.js";
8
- import { Portal as ee } from "./index99.js";
9
- import { Presence as G } from "./index88.js";
10
- import { Primitive as te } from "./index81.js";
11
- import { createSlottable as oe } from "./index95.js";
12
- import { useControllableState as re } from "./index80.js";
13
- import { Root as ne } from "./index104.js";
14
- import { jsx as f, jsxs as se } from "react/jsx-runtime";
15
- var [D] = K("Tooltip", [
16
- S
17
- ]), O = S(), j = "TooltipProvider", ie = 700, L = "tooltip.open", [ae, k] = D(j), F = (t) => {
1
+ import * as i from "react";
2
+ import { composeEventHandlers as P } from "./index78.js";
3
+ import { useComposedRefs as O } from "./index77.js";
4
+ import { createContextScope as G } from "./index76.js";
5
+ import { DismissableLayer as H } from "./index96.js";
6
+ import { useFocusGuards as K } from "./index99.js";
7
+ import { FocusScope as $ } from "./index97.js";
8
+ import { useId as j } from "./index88.js";
9
+ import { createPopperScope as _, Root as U, Anchor as x, Content as V, Arrow as W } from "./index102.js";
10
+ import { Portal as Z } from "./index98.js";
11
+ import { Presence as w } from "./index87.js";
12
+ import { Primitive as E } from "./index86.js";
13
+ import { createSlot as q } from "./index79.js";
14
+ import { useControllableState as z } from "./index85.js";
15
+ import { hideOthers as B } from "./index101.js";
16
+ import J from "./index100.js";
17
+ import { jsx as p } from "react/jsx-runtime";
18
+ var C = "Popover", [b] = G(C, [
19
+ _
20
+ ]), m = _(), [Q, f] = b(C), F = (o) => {
18
21
  const {
19
- __scopeTooltip: o,
20
- delayDuration: e = ie,
21
- skipDelayDuration: r = 300,
22
- disableHoverableContent: n = !1,
23
- children: a
24
- } = t, l = s.useRef(!0), v = s.useRef(!1), i = s.useRef(0);
25
- return s.useEffect(() => {
26
- const p = i.current;
27
- return () => window.clearTimeout(p);
28
- }, []), /* @__PURE__ */ f(
29
- ae,
22
+ __scopePopover: n,
23
+ children: t,
24
+ open: a,
25
+ defaultOpen: e,
26
+ onOpenChange: r,
27
+ modal: s = !1
28
+ } = o, c = m(n), u = i.useRef(null), [l, g] = i.useState(!1), [h, d] = z({
29
+ prop: a,
30
+ defaultProp: e ?? !1,
31
+ onChange: r,
32
+ caller: C
33
+ });
34
+ return /* @__PURE__ */ p(U, { ...c, children: /* @__PURE__ */ p(
35
+ Q,
30
36
  {
31
- scope: o,
32
- isOpenDelayedRef: l,
33
- delayDuration: e,
34
- onOpen: s.useCallback(() => {
35
- window.clearTimeout(i.current), l.current = !1;
36
- }, []),
37
- onClose: s.useCallback(() => {
38
- window.clearTimeout(i.current), i.current = window.setTimeout(
39
- () => l.current = !0,
40
- r
41
- );
42
- }, [r]),
43
- isPointerInTransitRef: v,
44
- onPointerInTransitChange: s.useCallback((p) => {
45
- v.current = p;
46
- }, []),
47
- disableHoverableContent: n,
48
- children: a
49
- }
50
- );
51
- };
52
- F.displayName = j;
53
- var R = "Tooltip", [le, _] = D(R), B = (t) => {
54
- const {
55
- __scopeTooltip: o,
56
- children: e,
57
- open: r,
58
- defaultOpen: n,
59
- onOpenChange: a,
60
- disableHoverableContent: l,
61
- delayDuration: v
62
- } = t, i = k(R, t.__scopeTooltip), p = O(o), [c, d] = s.useState(null), h = $(), u = s.useRef(0), m = l ?? i.disableHoverableContent, y = v ?? i.delayDuration, T = s.useRef(!1), [x, C] = re({
63
- prop: r,
64
- defaultProp: n ?? !1,
65
- onChange: (H) => {
66
- H ? (i.onOpen(), document.dispatchEvent(new CustomEvent(L))) : i.onClose(), a == null || a(H);
67
- },
68
- caller: R
69
- }), w = s.useMemo(() => x ? T.current ? "delayed-open" : "instant-open" : "closed", [x]), P = s.useCallback(() => {
70
- window.clearTimeout(u.current), u.current = 0, T.current = !1, C(!0);
71
- }, [C]), E = s.useCallback(() => {
72
- window.clearTimeout(u.current), u.current = 0, C(!1);
73
- }, [C]), I = s.useCallback(() => {
74
- window.clearTimeout(u.current), u.current = window.setTimeout(() => {
75
- T.current = !0, C(!0), u.current = 0;
76
- }, y);
77
- }, [y, C]);
78
- return s.useEffect(() => () => {
79
- u.current && (window.clearTimeout(u.current), u.current = 0);
80
- }, []), /* @__PURE__ */ f(z, { ...p, children: /* @__PURE__ */ f(
81
- le,
82
- {
83
- scope: o,
84
- contentId: h,
85
- open: x,
86
- stateAttribute: w,
87
- trigger: c,
88
- onTriggerChange: d,
89
- onTriggerEnter: s.useCallback(() => {
90
- i.isOpenDelayedRef.current ? I() : P();
91
- }, [i.isOpenDelayedRef, I, P]),
92
- onTriggerLeave: s.useCallback(() => {
93
- m ? E() : (window.clearTimeout(u.current), u.current = 0);
94
- }, [E, m]),
95
- onOpen: P,
96
- onClose: E,
97
- disableHoverableContent: m,
98
- children: e
37
+ scope: n,
38
+ contentId: j(),
39
+ triggerRef: u,
40
+ open: h,
41
+ onOpenChange: d,
42
+ onOpenToggle: i.useCallback(() => d((R) => !R), [d]),
43
+ hasCustomAnchor: l,
44
+ onCustomAnchorAdd: i.useCallback(() => g(!0), []),
45
+ onCustomAnchorRemove: i.useCallback(() => g(!1), []),
46
+ modal: s,
47
+ children: t
99
48
  }
100
49
  ) });
101
50
  };
102
- B.displayName = R;
103
- var A = "TooltipTrigger", U = s.forwardRef(
104
- (t, o) => {
105
- const { __scopeTooltip: e, ...r } = t, n = _(A, e), a = k(A, e), l = O(e), v = s.useRef(null), i = N(o, v, n.onTriggerChange), p = s.useRef(!1), c = s.useRef(!1), d = s.useCallback(() => p.current = !1, []);
106
- return s.useEffect(() => () => document.removeEventListener("pointerup", d), [d]), /* @__PURE__ */ f(J, { asChild: !0, ...l, children: /* @__PURE__ */ f(
107
- te.button,
51
+ F.displayName = C;
52
+ var N = "PopoverAnchor", S = i.forwardRef(
53
+ (o, n) => {
54
+ const { __scopePopover: t, ...a } = o, e = f(N, t), r = m(t), { onCustomAnchorAdd: s, onCustomAnchorRemove: c } = e;
55
+ return i.useEffect(() => (s(), () => c()), [s, c]), /* @__PURE__ */ p(x, { ...r, ...a, ref: n });
56
+ }
57
+ );
58
+ S.displayName = N;
59
+ var y = "PopoverTrigger", D = i.forwardRef(
60
+ (o, n) => {
61
+ const { __scopePopover: t, ...a } = o, e = f(y, t), r = m(t), s = O(n, e.triggerRef), c = /* @__PURE__ */ p(
62
+ E.button,
108
63
  {
109
- "aria-describedby": n.open ? n.contentId : void 0,
110
- "data-state": n.stateAttribute,
111
- ...r,
112
- ref: i,
113
- onPointerMove: g(t.onPointerMove, (h) => {
114
- h.pointerType !== "touch" && !c.current && !a.isPointerInTransitRef.current && (n.onTriggerEnter(), c.current = !0);
115
- }),
116
- onPointerLeave: g(t.onPointerLeave, () => {
117
- n.onTriggerLeave(), c.current = !1;
118
- }),
119
- onPointerDown: g(t.onPointerDown, () => {
120
- n.open && n.onClose(), p.current = !0, document.addEventListener("pointerup", d, { once: !0 });
121
- }),
122
- onFocus: g(t.onFocus, () => {
123
- p.current || n.onOpen();
124
- }),
125
- onBlur: g(t.onBlur, n.onClose),
126
- onClick: g(t.onClick, n.onClose)
64
+ type: "button",
65
+ "aria-haspopup": "dialog",
66
+ "aria-expanded": e.open,
67
+ "aria-controls": e.contentId,
68
+ "data-state": L(e.open),
69
+ ...a,
70
+ ref: s,
71
+ onClick: P(o.onClick, e.onOpenToggle)
127
72
  }
128
- ) });
73
+ );
74
+ return e.hasCustomAnchor ? c : /* @__PURE__ */ p(x, { asChild: !0, ...r, children: c });
129
75
  }
130
76
  );
131
- U.displayName = A;
132
- var M = "TooltipPortal", [ce, ue] = D(M, {
77
+ D.displayName = y;
78
+ var A = "PopoverPortal", [X, Y] = b(A, {
133
79
  forceMount: void 0
134
- }), V = (t) => {
135
- const { __scopeTooltip: o, forceMount: e, children: r, container: n } = t, a = _(M, o);
136
- return /* @__PURE__ */ f(ce, { scope: o, forceMount: e, children: /* @__PURE__ */ f(G, { present: e || a.open, children: /* @__PURE__ */ f(ee, { asChild: !0, container: n, children: r }) }) });
80
+ }), M = (o) => {
81
+ const { __scopePopover: n, forceMount: t, children: a, container: e } = o, r = f(A, n);
82
+ return /* @__PURE__ */ p(X, { scope: n, forceMount: t, children: /* @__PURE__ */ p(w, { present: t || r.open, children: /* @__PURE__ */ p(Z, { asChild: !0, container: e, children: a }) }) });
137
83
  };
138
- V.displayName = M;
139
- var b = "TooltipContent", Y = s.forwardRef(
140
- (t, o) => {
141
- const e = ue(b, t.__scopeTooltip), { forceMount: r = e.forceMount, side: n = "top", ...a } = t, l = _(b, t.__scopeTooltip);
142
- return /* @__PURE__ */ f(G, { present: r || l.open, children: l.disableHoverableContent ? /* @__PURE__ */ f(q, { side: n, ...a, ref: o }) : /* @__PURE__ */ f(pe, { side: n, ...a, ref: o }) });
84
+ M.displayName = A;
85
+ var v = "PopoverContent", k = i.forwardRef(
86
+ (o, n) => {
87
+ const t = Y(v, o.__scopePopover), { forceMount: a = t.forceMount, ...e } = o, r = f(v, o.__scopePopover);
88
+ return /* @__PURE__ */ p(w, { present: a || r.open, children: r.modal ? /* @__PURE__ */ p(eo, { ...e, ref: n }) : /* @__PURE__ */ p(ro, { ...e, ref: n }) });
143
89
  }
144
- ), pe = s.forwardRef((t, o) => {
145
- const e = _(b, t.__scopeTooltip), r = k(b, t.__scopeTooltip), n = s.useRef(null), a = N(o, n), [l, v] = s.useState(null), { trigger: i, onClose: p } = e, c = n.current, { onPointerInTransitChange: d } = r, h = s.useCallback(() => {
146
- v(null), d(!1);
147
- }, [d]), u = s.useCallback(
148
- (m, y) => {
149
- const T = m.currentTarget, x = { x: m.clientX, y: m.clientY }, C = me(x, T.getBoundingClientRect()), w = Te(x, C), P = ye(y.getBoundingClientRect()), E = xe([...w, ...P]);
150
- v(E), d(!0);
151
- },
152
- [d]
153
- );
154
- return s.useEffect(() => () => h(), [h]), s.useEffect(() => {
155
- if (i && c) {
156
- const m = (T) => u(T, c), y = (T) => u(T, i);
157
- return i.addEventListener("pointerleave", m), c.addEventListener("pointerleave", y), () => {
158
- i.removeEventListener("pointerleave", m), c.removeEventListener("pointerleave", y);
159
- };
160
- }
161
- }, [i, c, u, h]), s.useEffect(() => {
162
- if (l) {
163
- const m = (y) => {
164
- const T = y.target, x = { x: y.clientX, y: y.clientY }, C = (i == null ? void 0 : i.contains(T)) || (c == null ? void 0 : c.contains(T)), w = !Ce(x, l);
165
- C ? h() : w && (h(), p());
166
- };
167
- return document.addEventListener("pointermove", m), () => document.removeEventListener("pointermove", m);
168
- }
169
- }, [i, c, l, p, h]), /* @__PURE__ */ f(q, { ...t, ref: a });
170
- }), [de, fe] = D(R, { isInside: !1 }), ve = oe("TooltipContent"), q = s.forwardRef(
171
- (t, o) => {
172
- const {
173
- __scopeTooltip: e,
174
- children: r,
175
- "aria-label": n,
176
- onEscapeKeyDown: a,
177
- onPointerDownOutside: l,
178
- ...v
179
- } = t, i = _(b, e), p = O(e), { onClose: c } = i;
180
- return s.useEffect(() => (document.addEventListener(L, c), () => document.removeEventListener(L, c)), [c]), s.useEffect(() => {
181
- if (i.trigger) {
182
- const d = (h) => {
183
- const u = h.target;
184
- u != null && u.contains(i.trigger) && c();
185
- };
186
- return window.addEventListener("scroll", d, { capture: !0 }), () => window.removeEventListener("scroll", d, { capture: !0 });
90
+ );
91
+ k.displayName = v;
92
+ var oo = q("PopoverContent.RemoveScroll"), eo = i.forwardRef(
93
+ (o, n) => {
94
+ const t = f(v, o.__scopePopover), a = i.useRef(null), e = O(n, a), r = i.useRef(!1);
95
+ return i.useEffect(() => {
96
+ const s = a.current;
97
+ if (s) return B(s);
98
+ }, []), /* @__PURE__ */ p(J, { as: oo, allowPinchZoom: !0, children: /* @__PURE__ */ p(
99
+ I,
100
+ {
101
+ ...o,
102
+ ref: e,
103
+ trapFocus: t.open,
104
+ disableOutsidePointerEvents: !0,
105
+ onCloseAutoFocus: P(o.onCloseAutoFocus, (s) => {
106
+ var c;
107
+ s.preventDefault(), r.current || (c = t.triggerRef.current) == null || c.focus();
108
+ }),
109
+ onPointerDownOutside: P(
110
+ o.onPointerDownOutside,
111
+ (s) => {
112
+ const c = s.detail.originalEvent, u = c.button === 0 && c.ctrlKey === !0, l = c.button === 2 || u;
113
+ r.current = l;
114
+ },
115
+ { checkForDefaultPrevented: !1 }
116
+ ),
117
+ onFocusOutside: P(
118
+ o.onFocusOutside,
119
+ (s) => s.preventDefault(),
120
+ { checkForDefaultPrevented: !1 }
121
+ )
187
122
  }
188
- }, [i.trigger, c]), /* @__PURE__ */ f(
189
- W,
123
+ ) });
124
+ }
125
+ ), ro = i.forwardRef(
126
+ (o, n) => {
127
+ const t = f(v, o.__scopePopover), a = i.useRef(!1), e = i.useRef(!1);
128
+ return /* @__PURE__ */ p(
129
+ I,
190
130
  {
191
- asChild: !0,
131
+ ...o,
132
+ ref: n,
133
+ trapFocus: !1,
192
134
  disableOutsidePointerEvents: !1,
193
- onEscapeKeyDown: a,
194
- onPointerDownOutside: l,
195
- onFocusOutside: (d) => d.preventDefault(),
196
- onDismiss: c,
197
- children: /* @__PURE__ */ se(
198
- Q,
135
+ onCloseAutoFocus: (r) => {
136
+ var s, c;
137
+ (s = o.onCloseAutoFocus) == null || s.call(o, r), r.defaultPrevented || (a.current || (c = t.triggerRef.current) == null || c.focus(), r.preventDefault()), a.current = !1, e.current = !1;
138
+ },
139
+ onInteractOutside: (r) => {
140
+ var u, l;
141
+ (u = o.onInteractOutside) == null || u.call(o, r), r.defaultPrevented || (a.current = !0, r.detail.originalEvent.type === "pointerdown" && (e.current = !0));
142
+ const s = r.target;
143
+ ((l = t.triggerRef.current) == null ? void 0 : l.contains(s)) && r.preventDefault(), r.detail.originalEvent.type === "focusin" && e.current && r.preventDefault();
144
+ }
145
+ }
146
+ );
147
+ }
148
+ ), I = i.forwardRef(
149
+ (o, n) => {
150
+ const {
151
+ __scopePopover: t,
152
+ trapFocus: a,
153
+ onOpenAutoFocus: e,
154
+ onCloseAutoFocus: r,
155
+ disableOutsidePointerEvents: s,
156
+ onEscapeKeyDown: c,
157
+ onPointerDownOutside: u,
158
+ onFocusOutside: l,
159
+ onInteractOutside: g,
160
+ ...h
161
+ } = o, d = f(v, t), R = m(t);
162
+ return K(), /* @__PURE__ */ p(
163
+ $,
164
+ {
165
+ asChild: !0,
166
+ loop: !0,
167
+ trapped: a,
168
+ onMountAutoFocus: e,
169
+ onUnmountAutoFocus: r,
170
+ children: /* @__PURE__ */ p(
171
+ H,
199
172
  {
200
- "data-state": i.stateAttribute,
201
- ...p,
202
- ...v,
203
- ref: o,
204
- style: {
205
- ...v.style,
206
- "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
207
- "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
208
- "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
209
- "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
210
- "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
211
- },
212
- children: [
213
- /* @__PURE__ */ f(ve, { children: r }),
214
- /* @__PURE__ */ f(de, { scope: e, isInside: !0, children: /* @__PURE__ */ f(ne, { id: i.contentId, role: "tooltip", children: n || r }) })
215
- ]
173
+ asChild: !0,
174
+ disableOutsidePointerEvents: s,
175
+ onInteractOutside: g,
176
+ onEscapeKeyDown: c,
177
+ onPointerDownOutside: u,
178
+ onFocusOutside: l,
179
+ onDismiss: () => d.onOpenChange(!1),
180
+ children: /* @__PURE__ */ p(
181
+ V,
182
+ {
183
+ "data-state": L(d.open),
184
+ role: "dialog",
185
+ id: d.contentId,
186
+ ...R,
187
+ ...h,
188
+ ref: n,
189
+ style: {
190
+ ...h.style,
191
+ "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
192
+ "--radix-popover-content-available-width": "var(--radix-popper-available-width)",
193
+ "--radix-popover-content-available-height": "var(--radix-popper-available-height)",
194
+ "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
195
+ "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
196
+ }
197
+ }
198
+ )
216
199
  }
217
200
  )
218
201
  }
219
202
  );
220
203
  }
221
- );
222
- Y.displayName = b;
223
- var X = "TooltipArrow", he = s.forwardRef(
224
- (t, o) => {
225
- const { __scopeTooltip: e, ...r } = t, n = O(e);
226
- return fe(
227
- X,
228
- e
229
- ).isInside ? null : /* @__PURE__ */ f(Z, { ...n, ...r, ref: o });
204
+ ), T = "PopoverClose", to = i.forwardRef(
205
+ (o, n) => {
206
+ const { __scopePopover: t, ...a } = o, e = f(T, t);
207
+ return /* @__PURE__ */ p(
208
+ E.button,
209
+ {
210
+ type: "button",
211
+ ...a,
212
+ ref: n,
213
+ onClick: P(o.onClick, () => e.onOpenChange(!1))
214
+ }
215
+ );
230
216
  }
231
217
  );
232
- he.displayName = X;
233
- function me(t, o) {
234
- const e = Math.abs(o.top - t.y), r = Math.abs(o.bottom - t.y), n = Math.abs(o.right - t.x), a = Math.abs(o.left - t.x);
235
- switch (Math.min(e, r, n, a)) {
236
- case a:
237
- return "left";
238
- case n:
239
- return "right";
240
- case e:
241
- return "top";
242
- case r:
243
- return "bottom";
244
- default:
245
- throw new Error("unreachable");
246
- }
247
- }
248
- function Te(t, o, e = 5) {
249
- const r = [];
250
- switch (o) {
251
- case "top":
252
- r.push(
253
- { x: t.x - e, y: t.y + e },
254
- { x: t.x + e, y: t.y + e }
255
- );
256
- break;
257
- case "bottom":
258
- r.push(
259
- { x: t.x - e, y: t.y - e },
260
- { x: t.x + e, y: t.y - e }
261
- );
262
- break;
263
- case "left":
264
- r.push(
265
- { x: t.x + e, y: t.y - e },
266
- { x: t.x + e, y: t.y + e }
267
- );
268
- break;
269
- case "right":
270
- r.push(
271
- { x: t.x - e, y: t.y - e },
272
- { x: t.x - e, y: t.y + e }
273
- );
274
- break;
275
- }
276
- return r;
277
- }
278
- function ye(t) {
279
- const { top: o, right: e, bottom: r, left: n } = t;
280
- return [
281
- { x: n, y: o },
282
- { x: e, y: o },
283
- { x: e, y: r },
284
- { x: n, y: r }
285
- ];
286
- }
287
- function Ce(t, o) {
288
- const { x: e, y: r } = t;
289
- let n = !1;
290
- for (let a = 0, l = o.length - 1; a < o.length; l = a++) {
291
- const v = o[a], i = o[l], p = v.x, c = v.y, d = i.x, h = i.y;
292
- c > r != h > r && e < (d - p) * (r - c) / (h - c) + p && (n = !n);
218
+ to.displayName = T;
219
+ var no = "PopoverArrow", ao = i.forwardRef(
220
+ (o, n) => {
221
+ const { __scopePopover: t, ...a } = o, e = m(t);
222
+ return /* @__PURE__ */ p(W, { ...e, ...a, ref: n });
293
223
  }
294
- return n;
295
- }
296
- function xe(t) {
297
- const o = t.slice();
298
- return o.sort((e, r) => e.x < r.x ? -1 : e.x > r.x ? 1 : e.y < r.y ? -1 : e.y > r.y ? 1 : 0), ge(o);
299
- }
300
- function ge(t) {
301
- if (t.length <= 1) return t.slice();
302
- const o = [];
303
- for (let r = 0; r < t.length; r++) {
304
- const n = t[r];
305
- for (; o.length >= 2; ) {
306
- const a = o[o.length - 1], l = o[o.length - 2];
307
- if ((a.x - l.x) * (n.y - l.y) >= (a.y - l.y) * (n.x - l.x)) o.pop();
308
- else break;
309
- }
310
- o.push(n);
311
- }
312
- o.pop();
313
- const e = [];
314
- for (let r = t.length - 1; r >= 0; r--) {
315
- const n = t[r];
316
- for (; e.length >= 2; ) {
317
- const a = e[e.length - 1], l = e[e.length - 2];
318
- if ((a.x - l.x) * (n.y - l.y) >= (a.y - l.y) * (n.x - l.x)) e.pop();
319
- else break;
320
- }
321
- e.push(n);
322
- }
323
- return e.pop(), o.length === 1 && e.length === 1 && o[0].x === e[0].x && o[0].y === e[0].y ? o : o.concat(e);
224
+ );
225
+ ao.displayName = no;
226
+ function L(o) {
227
+ return o ? "open" : "closed";
324
228
  }
325
- var He = F, Ne = B, Se = U, Ge = V, je = Y;
229
+ var _o = F, xo = S, wo = D, Eo = M, bo = k;
326
230
  export {
327
- je as Content,
328
- Ge as Portal,
329
- He as Provider,
330
- Ne as Root,
331
- B as Tooltip,
332
- he as TooltipArrow,
333
- Y as TooltipContent,
334
- V as TooltipPortal,
335
- F as TooltipProvider,
336
- U as TooltipTrigger,
337
- Se as Trigger
231
+ xo as Anchor,
232
+ bo as Content,
233
+ F as Popover,
234
+ S as PopoverAnchor,
235
+ ao as PopoverArrow,
236
+ to as PopoverClose,
237
+ k as PopoverContent,
238
+ M as PopoverPortal,
239
+ D as PopoverTrigger,
240
+ Eo as Portal,
241
+ _o as Root,
242
+ wo as Trigger
338
243
  };