@drjoshcsimmons/scl 0.2.1 → 0.2.3

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 (118) hide show
  1. package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts +1 -7
  2. package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts.map +1 -1
  3. package/dist/index100.js +180 -3
  4. package/dist/index101.js +9 -30
  5. package/dist/index102.js +30 -13
  6. package/dist/index103.js +44 -646
  7. package/dist/index104.js +4 -30
  8. package/dist/index105.js +47 -3
  9. package/dist/index106.js +5 -47
  10. package/dist/index107.js +647 -27
  11. package/dist/index108.js +30 -55
  12. package/dist/index109.js +1 -1
  13. package/dist/index11.js +2 -2
  14. package/dist/index110.js +12 -45
  15. package/dist/index111.js +24 -8
  16. package/dist/index112.js +8 -14
  17. package/dist/index113.js +6 -48
  18. package/dist/index114.js +1 -1
  19. package/dist/index115.js +47 -11
  20. package/dist/index116.js +10 -204
  21. package/dist/index117.js +204 -20
  22. package/dist/index118.js +21 -399
  23. package/dist/index119.js +400 -6
  24. package/dist/index12.js +1 -1
  25. package/dist/index120.js +21 -48
  26. package/dist/index121.js +3 -15
  27. package/dist/index122.js +32 -3
  28. package/dist/index123.js +12 -32
  29. package/dist/index124.js +48 -18
  30. package/dist/index125.js +2 -25
  31. package/dist/index126.js +53 -29
  32. package/dist/index127.js +65 -5
  33. package/dist/index128.js +25 -2
  34. package/dist/index129.js +29 -53
  35. package/dist/index13.js +2 -2
  36. package/dist/index130.js +5 -65
  37. package/dist/index136.js +1 -1
  38. package/dist/index137.js +1 -1
  39. package/dist/index14.js +2 -2
  40. package/dist/index141.js +1 -1
  41. package/dist/index15.js +2 -2
  42. package/dist/index17.js +4 -4
  43. package/dist/index18.js +2 -2
  44. package/dist/index20.js +2 -2
  45. package/dist/index21.js +1 -1
  46. package/dist/index22.js +1 -1
  47. package/dist/index23.js +2 -2
  48. package/dist/index24.js +1 -1
  49. package/dist/index25.js +4 -4
  50. package/dist/index26.js +1 -1
  51. package/dist/index27.js +3 -3
  52. package/dist/index29.js +1 -1
  53. package/dist/index31.js +1 -1
  54. package/dist/index33.js +1 -1
  55. package/dist/index34.js +18 -16
  56. package/dist/index36.js +2 -2
  57. package/dist/index37.js +1 -1
  58. package/dist/index4.js +2 -2
  59. package/dist/index45.js +33 -237
  60. package/dist/index46.js +73 -11
  61. package/dist/index47.js +60 -33
  62. package/dist/index48.js +210 -214
  63. package/dist/index49.js +11 -18
  64. package/dist/index5.js +1 -1
  65. package/dist/index50.js +225 -109
  66. package/dist/index51.js +82 -31
  67. package/dist/index52.js +247 -66
  68. package/dist/index53.js +100 -218
  69. package/dist/index54.js +161 -11
  70. package/dist/index55.js +330 -54
  71. package/dist/index56.js +254 -248
  72. package/dist/index57.js +12 -225
  73. package/dist/index58.js +860 -9
  74. package/dist/index59.js +3 -5
  75. package/dist/index6.js +1 -1
  76. package/dist/index60.js +9 -130
  77. package/dist/index61.js +221 -18
  78. package/dist/index62.js +11 -860
  79. package/dist/index63.js +5 -3
  80. package/dist/index64.js +12 -82
  81. package/dist/index65.js +507 -237
  82. package/dist/index66.js +22 -12
  83. package/dist/index67.js +298 -237
  84. package/dist/index68.js +12 -118
  85. package/dist/index69.js +18 -530
  86. package/dist/index7.js +1 -1
  87. package/dist/index70.js +31 -12
  88. package/dist/index71.js +210 -409
  89. package/dist/index72.js +407 -308
  90. package/dist/index73.js +237 -298
  91. package/dist/index74.js +125 -12
  92. package/dist/index75.js +112 -143
  93. package/dist/index76.js +40 -53
  94. package/dist/index77.js +10 -45
  95. package/dist/index78.js +4 -27
  96. package/dist/index79.js +30 -7
  97. package/dist/index8.js +1 -1
  98. package/dist/index80.js +10 -49
  99. package/dist/index81.js +67 -33
  100. package/dist/index82.js +45 -10
  101. package/dist/index83.js +26 -7
  102. package/dist/index84.js +5 -123
  103. package/dist/index85.js +50 -13
  104. package/dist/index86.js +32 -133
  105. package/dist/index87.js +10 -218
  106. package/dist/index88.js +8 -14
  107. package/dist/index89.js +120 -64
  108. package/dist/index9.js +2 -2
  109. package/dist/index90.js +13 -46
  110. package/dist/index91.js +133 -48
  111. package/dist/index92.js +218 -8
  112. package/dist/index93.js +14 -30
  113. package/dist/index94.js +68 -8
  114. package/dist/index95.js +43 -176
  115. package/dist/index96.js +50 -25
  116. package/dist/index97.js +9 -6
  117. package/dist/index99.js +30 -11
  118. package/package.json +1 -1
package/dist/index74.js CHANGED
@@ -1,14 +1,127 @@
1
- import e from "./index121.js";
2
- /**
3
- * @license lucide-react v0.460.0 - ISC
4
- *
5
- * This source code is licensed under the ISC license.
6
- * See the LICENSE file in the root directory of this source tree.
7
- */
8
- const r = e("Search", [
9
- ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
10
- ["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
11
- ]);
1
+ import * as l from "react";
2
+ import { createContextScope as w } from "./index81.js";
3
+ import { useComposedRefs as v } from "./index83.js";
4
+ import { createDialogScope as A, Root as M, Portal as x, Trigger as I, Close as f, WarningProvider as L, Content as $, Description as F, Overlay as G, Title as j } from "./index56.js";
5
+ import { composeEventHandlers as W } from "./index84.js";
6
+ import { createSlottable as Y } from "./index112.js";
7
+ import { jsx as i, jsxs as q } from "react/jsx-runtime";
8
+ var D = "AlertDialog", [B] = w(D, [
9
+ A
10
+ ]), n = A(), m = (e) => {
11
+ const { __scopeAlertDialog: o, ...r } = e, t = n(o);
12
+ return /* @__PURE__ */ i(M, { ...t, ...r, modal: !0 });
13
+ };
14
+ m.displayName = D;
15
+ var H = "AlertDialogTrigger", y = l.forwardRef(
16
+ (e, o) => {
17
+ const { __scopeAlertDialog: r, ...t } = e, a = n(r);
18
+ return /* @__PURE__ */ i(I, { ...a, ...t, ref: o });
19
+ }
20
+ );
21
+ y.displayName = H;
22
+ var V = "AlertDialogPortal", _ = (e) => {
23
+ const { __scopeAlertDialog: o, ...r } = e, t = n(o);
24
+ return /* @__PURE__ */ i(x, { ...t, ...r });
25
+ };
26
+ _.displayName = V;
27
+ var k = "AlertDialogOverlay", N = l.forwardRef(
28
+ (e, o) => {
29
+ const { __scopeAlertDialog: r, ...t } = e, a = n(r);
30
+ return /* @__PURE__ */ i(G, { ...a, ...t, ref: o });
31
+ }
32
+ );
33
+ N.displayName = k;
34
+ var s = "AlertDialogContent", [z, J] = B(s), K = Y("AlertDialogContent"), R = l.forwardRef(
35
+ (e, o) => {
36
+ const { __scopeAlertDialog: r, children: t, ...a } = e, g = n(r), p = l.useRef(null), b = v(o, p), d = l.useRef(null);
37
+ return /* @__PURE__ */ i(
38
+ L,
39
+ {
40
+ contentName: s,
41
+ titleName: C,
42
+ docsSlug: "alert-dialog",
43
+ children: /* @__PURE__ */ i(z, { scope: r, cancelRef: d, children: /* @__PURE__ */ q(
44
+ $,
45
+ {
46
+ role: "alertdialog",
47
+ ...g,
48
+ ...a,
49
+ ref: b,
50
+ onOpenAutoFocus: W(a.onOpenAutoFocus, (c) => {
51
+ var u;
52
+ c.preventDefault(), (u = d.current) == null || u.focus({ preventScroll: !0 });
53
+ }),
54
+ onPointerDownOutside: (c) => c.preventDefault(),
55
+ onInteractOutside: (c) => c.preventDefault(),
56
+ children: [
57
+ /* @__PURE__ */ i(K, { children: t }),
58
+ /* @__PURE__ */ i(U, { contentRef: p })
59
+ ]
60
+ }
61
+ ) })
62
+ }
63
+ );
64
+ }
65
+ );
66
+ R.displayName = s;
67
+ var C = "AlertDialogTitle", h = l.forwardRef(
68
+ (e, o) => {
69
+ const { __scopeAlertDialog: r, ...t } = e, a = n(r);
70
+ return /* @__PURE__ */ i(j, { ...a, ...t, ref: o });
71
+ }
72
+ );
73
+ h.displayName = C;
74
+ var E = "AlertDialogDescription", P = l.forwardRef((e, o) => {
75
+ const { __scopeAlertDialog: r, ...t } = e, a = n(r);
76
+ return /* @__PURE__ */ i(F, { ...a, ...t, ref: o });
77
+ });
78
+ P.displayName = E;
79
+ var Q = "AlertDialogAction", S = l.forwardRef(
80
+ (e, o) => {
81
+ const { __scopeAlertDialog: r, ...t } = e, a = n(r);
82
+ return /* @__PURE__ */ i(f, { ...a, ...t, ref: o });
83
+ }
84
+ );
85
+ S.displayName = Q;
86
+ var T = "AlertDialogCancel", O = l.forwardRef(
87
+ (e, o) => {
88
+ const { __scopeAlertDialog: r, ...t } = e, { cancelRef: a } = J(T, r), g = n(r), p = v(o, a);
89
+ return /* @__PURE__ */ i(f, { ...g, ...t, ref: p });
90
+ }
91
+ );
92
+ O.displayName = T;
93
+ var U = ({ contentRef: e }) => {
94
+ const o = `\`${s}\` requires a description for the component to be accessible for screen reader users.
95
+
96
+ You can add a description to the \`${s}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
97
+
98
+ Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${s}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
99
+
100
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;
101
+ return l.useEffect(() => {
102
+ var t;
103
+ document.getElementById(
104
+ (t = e.current) == null ? void 0 : t.getAttribute("aria-describedby")
105
+ ) || console.warn(o);
106
+ }, [o, e]), null;
107
+ }, ae = m, ie = y, le = _, ne = N, se = R, ce = S, pe = O, ge = h, de = P;
12
108
  export {
13
- r as default
109
+ ce as Action,
110
+ m as AlertDialog,
111
+ S as AlertDialogAction,
112
+ O as AlertDialogCancel,
113
+ R as AlertDialogContent,
114
+ P as AlertDialogDescription,
115
+ N as AlertDialogOverlay,
116
+ _ as AlertDialogPortal,
117
+ h as AlertDialogTitle,
118
+ y as AlertDialogTrigger,
119
+ pe as Cancel,
120
+ se as Content,
121
+ de as Description,
122
+ ne as Overlay,
123
+ le as Portal,
124
+ ae as Root,
125
+ ge as Title,
126
+ ie as Trigger
14
127
  };
package/dist/index75.js CHANGED
@@ -1,163 +1,132 @@
1
- import * as v from "react";
2
- import { composeEventHandlers as g } from "./index79.js";
3
- import { createContextScope as x } from "./index76.js";
4
- import { createRovingFocusGroupScope as C, Root as E, Item as F } from "./index95.js";
5
- import { Presence as w } from "./index89.js";
6
- import { Primitive as b } from "./index81.js";
7
- import { useDirection as D } from "./index83.js";
8
- import { useControllableState as V } from "./index80.js";
9
- import { useId as G } from "./index82.js";
10
- import { jsx as l } from "react/jsx-runtime";
11
- var p = "Tabs", [L] = x(p, [
12
- C
13
- ]), h = C(), [$, T] = L(p), I = v.forwardRef(
14
- (e, r) => {
1
+ import * as r from "react";
2
+ import { composeEventHandlers as T } from "./index84.js";
3
+ import { useComposedRefs as P } from "./index83.js";
4
+ import { createContextScope as I } from "./index81.js";
5
+ import { useControllableState as M } from "./index85.js";
6
+ import { usePrevious as H } from "./index106.js";
7
+ import { useSize as j } from "./index111.js";
8
+ import { Primitive as y } from "./index86.js";
9
+ import { jsxs as A, jsx as m } from "react/jsx-runtime";
10
+ var h = "Switch", [U] = I(h), [q, z] = U(h), R = r.forwardRef(
11
+ (t, a) => {
15
12
  const {
16
- __scopeTabs: s,
17
- value: t,
18
- onValueChange: n,
19
- defaultValue: c,
20
- orientation: o = "horizontal",
21
- dir: d,
22
- activationMode: f = "automatic",
23
- ...m
24
- } = e, i = D(d), [a, u] = V({
25
- prop: t,
26
- onChange: n,
27
- defaultProp: c ?? "",
28
- caller: p
13
+ __scopeSwitch: e,
14
+ name: c,
15
+ checked: o,
16
+ defaultChecked: v,
17
+ required: i,
18
+ disabled: n,
19
+ value: p = "on",
20
+ onCheckedChange: w,
21
+ form: s,
22
+ ...S
23
+ } = t, [d, u] = r.useState(null), b = P(a, (f) => u(f)), C = r.useRef(!1), k = d ? s || !!d.closest("form") : !0, [l, B] = M({
24
+ prop: o,
25
+ defaultProp: v ?? !1,
26
+ onChange: w,
27
+ caller: h
29
28
  });
30
- return /* @__PURE__ */ l(
31
- $,
32
- {
33
- scope: s,
34
- baseId: G(),
35
- value: a,
36
- onValueChange: u,
37
- orientation: o,
38
- dir: i,
39
- activationMode: f,
40
- children: /* @__PURE__ */ l(
41
- b.div,
42
- {
43
- dir: i,
44
- "data-orientation": o,
45
- ...m,
46
- ref: r
47
- }
48
- )
49
- }
50
- );
29
+ return /* @__PURE__ */ A(q, { scope: e, checked: l, disabled: n, children: [
30
+ /* @__PURE__ */ m(
31
+ y.button,
32
+ {
33
+ type: "button",
34
+ role: "switch",
35
+ "aria-checked": l,
36
+ "aria-required": i,
37
+ "data-state": g(l),
38
+ "data-disabled": n ? "" : void 0,
39
+ disabled: n,
40
+ value: p,
41
+ ...S,
42
+ ref: b,
43
+ onClick: T(t.onClick, (f) => {
44
+ B((N) => !N), k && (C.current = f.isPropagationStopped(), C.current || f.stopPropagation());
45
+ })
46
+ }
47
+ ),
48
+ k && /* @__PURE__ */ m(
49
+ x,
50
+ {
51
+ control: d,
52
+ bubbles: !C.current,
53
+ name: c,
54
+ value: p,
55
+ checked: l,
56
+ required: i,
57
+ disabled: n,
58
+ form: s,
59
+ style: { transform: "translateX(-100%)" }
60
+ }
61
+ )
62
+ ] });
51
63
  }
52
64
  );
53
- I.displayName = p;
54
- var R = "TabsList", _ = v.forwardRef(
55
- (e, r) => {
56
- const { __scopeTabs: s, loop: t = !0, ...n } = e, c = T(R, s), o = h(s);
57
- return /* @__PURE__ */ l(
58
- E,
65
+ R.displayName = h;
66
+ var E = "SwitchThumb", _ = r.forwardRef(
67
+ (t, a) => {
68
+ const { __scopeSwitch: e, ...c } = t, o = z(E, e);
69
+ return /* @__PURE__ */ m(
70
+ y.span,
59
71
  {
60
- asChild: !0,
61
- ...o,
62
- orientation: c.orientation,
63
- dir: c.dir,
64
- loop: t,
65
- children: /* @__PURE__ */ l(
66
- b.div,
67
- {
68
- role: "tablist",
69
- "aria-orientation": c.orientation,
70
- ...n,
71
- ref: r
72
- }
73
- )
72
+ "data-state": g(o.checked),
73
+ "data-disabled": o.disabled ? "" : void 0,
74
+ ...c,
75
+ ref: a
74
76
  }
75
77
  );
76
78
  }
77
79
  );
78
- _.displayName = R;
79
- var y = "TabsTrigger", A = v.forwardRef(
80
- (e, r) => {
81
- const { __scopeTabs: s, value: t, disabled: n = !1, ...c } = e, o = T(y, s), d = h(s), f = P(o.baseId, t), m = S(o.baseId, t), i = t === o.value;
82
- return /* @__PURE__ */ l(
83
- F,
84
- {
85
- asChild: !0,
86
- ...d,
87
- focusable: !n,
88
- active: i,
89
- children: /* @__PURE__ */ l(
90
- b.button,
91
- {
92
- type: "button",
93
- role: "tab",
94
- "aria-selected": i,
95
- "aria-controls": m,
96
- "data-state": i ? "active" : "inactive",
97
- "data-disabled": n ? "" : void 0,
98
- disabled: n,
99
- id: f,
100
- ...c,
101
- ref: r,
102
- onMouseDown: g(e.onMouseDown, (a) => {
103
- !n && a.button === 0 && a.ctrlKey === !1 ? o.onValueChange(t) : a.preventDefault();
104
- }),
105
- onKeyDown: g(e.onKeyDown, (a) => {
106
- [" ", "Enter"].includes(a.key) && o.onValueChange(t);
107
- }),
108
- onFocus: g(e.onFocus, () => {
109
- const a = o.activationMode !== "manual";
110
- !i && !n && a && o.onValueChange(t);
111
- })
112
- }
113
- )
80
+ _.displayName = E;
81
+ var L = "SwitchBubbleInput", x = r.forwardRef(
82
+ ({
83
+ __scopeSwitch: t,
84
+ control: a,
85
+ checked: e,
86
+ bubbles: c = !0,
87
+ ...o
88
+ }, v) => {
89
+ const i = r.useRef(null), n = P(i, v), p = H(e), w = j(a);
90
+ return r.useEffect(() => {
91
+ const s = i.current;
92
+ if (!s) return;
93
+ const S = window.HTMLInputElement.prototype, u = Object.getOwnPropertyDescriptor(
94
+ S,
95
+ "checked"
96
+ ).set;
97
+ if (p !== e && u) {
98
+ const b = new Event("click", { bubbles: c });
99
+ u.call(s, e), s.dispatchEvent(b);
114
100
  }
115
- );
116
- }
117
- );
118
- A.displayName = y;
119
- var M = "TabsContent", N = v.forwardRef(
120
- (e, r) => {
121
- const { __scopeTabs: s, value: t, forceMount: n, children: c, ...o } = e, d = T(M, s), f = P(d.baseId, t), m = S(d.baseId, t), i = t === d.value, a = v.useRef(i);
122
- return v.useEffect(() => {
123
- const u = requestAnimationFrame(() => a.current = !1);
124
- return () => cancelAnimationFrame(u);
125
- }, []), /* @__PURE__ */ l(w, { present: n || i, children: ({ present: u }) => /* @__PURE__ */ l(
126
- b.div,
101
+ }, [p, e, c]), /* @__PURE__ */ m(
102
+ "input",
127
103
  {
128
- "data-state": i ? "active" : "inactive",
129
- "data-orientation": d.orientation,
130
- role: "tabpanel",
131
- "aria-labelledby": f,
132
- hidden: !u,
133
- id: m,
134
- tabIndex: 0,
104
+ type: "checkbox",
105
+ "aria-hidden": !0,
106
+ defaultChecked: e,
135
107
  ...o,
136
- ref: r,
108
+ tabIndex: -1,
109
+ ref: n,
137
110
  style: {
138
- ...e.style,
139
- animationDuration: a.current ? "0s" : void 0
140
- },
141
- children: u && c
111
+ ...o.style,
112
+ ...w,
113
+ position: "absolute",
114
+ pointerEvents: "none",
115
+ opacity: 0,
116
+ margin: 0
117
+ }
142
118
  }
143
- ) });
119
+ );
144
120
  }
145
121
  );
146
- N.displayName = M;
147
- function P(e, r) {
148
- return `${e}-trigger-${r}`;
149
- }
150
- function S(e, r) {
151
- return `${e}-content-${r}`;
122
+ x.displayName = L;
123
+ function g(t) {
124
+ return t ? "checked" : "unchecked";
152
125
  }
153
- var Q = I, U = _, W = A, X = N;
126
+ var Q = R, V = _;
154
127
  export {
155
- X as Content,
156
- U as List,
157
128
  Q as Root,
158
- I as Tabs,
159
- N as TabsContent,
160
- _ as TabsList,
161
- A as TabsTrigger,
162
- W as Trigger
129
+ R as Switch,
130
+ _ as SwitchThumb,
131
+ V as Thumb
163
132
  };
package/dist/index76.js CHANGED
@@ -1,70 +1,57 @@
1
- import * as u from "react";
2
- import { jsx as h } from "react/jsx-runtime";
3
- function w(e, c) {
4
- const o = u.createContext(c), a = (r) => {
5
- const { children: t, ...n } = r, s = u.useMemo(() => n, Object.values(n));
6
- return /* @__PURE__ */ h(o.Provider, { value: s, children: t });
7
- };
8
- a.displayName = e + "Provider";
9
- function i(r) {
10
- const t = u.useContext(o);
11
- if (t) return t;
12
- if (c !== void 0) return c;
13
- throw new Error(`\`${r}\` must be used within \`${e}\``);
14
- }
15
- return [a, i];
16
- }
17
- function _(e, c = []) {
1
+ import * as i from "react";
2
+ import { jsx as _ } from "react/jsx-runtime";
3
+ function $(e, x = []) {
18
4
  let o = [];
19
- function a(r, t) {
20
- const n = u.createContext(t), s = o.length;
21
- o = [...o, t];
22
- const p = (d) => {
23
- var S;
24
- const { scope: x, children: C, ...m } = d, v = ((S = x == null ? void 0 : x[e]) == null ? void 0 : S[s]) || n, P = u.useMemo(() => m, Object.values(m));
25
- return /* @__PURE__ */ h(v.Provider, { value: P, children: C });
5
+ function f(r, n) {
6
+ const t = i.createContext(n);
7
+ t.displayName = r + "Context";
8
+ const c = o.length;
9
+ o = [...o, n];
10
+ const m = (a) => {
11
+ var l;
12
+ const { scope: s, children: C, ...p } = a, d = ((l = s == null ? void 0 : s[e]) == null ? void 0 : l[c]) || t, v = i.useMemo(() => p, Object.values(p));
13
+ return /* @__PURE__ */ _(d.Provider, { value: v, children: C });
26
14
  };
27
- p.displayName = r + "Provider";
28
- function f(d, x) {
29
- var v;
30
- const C = ((v = x == null ? void 0 : x[e]) == null ? void 0 : v[s]) || n, m = u.useContext(C);
31
- if (m) return m;
32
- if (t !== void 0) return t;
33
- throw new Error(`\`${d}\` must be used within \`${r}\``);
15
+ m.displayName = r + "Provider";
16
+ function S(a, s) {
17
+ var d;
18
+ const C = ((d = s == null ? void 0 : s[e]) == null ? void 0 : d[c]) || t, p = i.useContext(C);
19
+ if (p) return p;
20
+ if (n !== void 0) return n;
21
+ throw new Error(`\`${a}\` must be used within \`${r}\``);
34
22
  }
35
- return [p, f];
23
+ return [m, S];
36
24
  }
37
- const i = () => {
38
- const r = o.map((t) => u.createContext(t));
39
- return function(n) {
40
- const s = (n == null ? void 0 : n[e]) || r;
41
- return u.useMemo(
42
- () => ({ [`__scope${e}`]: { ...n, [e]: s } }),
43
- [n, s]
25
+ const u = () => {
26
+ const r = o.map((n) => i.createContext(n));
27
+ return function(t) {
28
+ const c = (t == null ? void 0 : t[e]) || r;
29
+ return i.useMemo(
30
+ () => ({ [`__scope${e}`]: { ...t, [e]: c } }),
31
+ [t, c]
44
32
  );
45
33
  };
46
34
  };
47
- return i.scopeName = e, [a, l(i, ...c)];
35
+ return u.scopeName = e, [f, h(u, ...x)];
48
36
  }
49
- function l(...e) {
50
- const c = e[0];
51
- if (e.length === 1) return c;
37
+ function h(...e) {
38
+ const x = e[0];
39
+ if (e.length === 1) return x;
52
40
  const o = () => {
53
- const a = e.map((i) => ({
54
- useScope: i(),
55
- scopeName: i.scopeName
41
+ const f = e.map((u) => ({
42
+ useScope: u(),
43
+ scopeName: u.scopeName
56
44
  }));
57
45
  return function(r) {
58
- const t = a.reduce((n, { useScope: s, scopeName: p }) => {
59
- const d = s(r)[`__scope${p}`];
60
- return { ...n, ...d };
46
+ const n = f.reduce((t, { useScope: c, scopeName: m }) => {
47
+ const a = c(r)[`__scope${m}`];
48
+ return { ...t, ...a };
61
49
  }, {});
62
- return u.useMemo(() => ({ [`__scope${c.scopeName}`]: t }), [t]);
50
+ return i.useMemo(() => ({ [`__scope${x.scopeName}`]: n }), [n]);
63
51
  };
64
52
  };
65
- return o.scopeName = c.scopeName, o;
53
+ return o.scopeName = x.scopeName, o;
66
54
  }
67
55
  export {
68
- w as createContext,
69
- _ as createContextScope
56
+ $ as createContextScope
70
57
  };
package/dist/index77.js CHANGED
@@ -1,48 +1,13 @@
1
- import r from "react";
2
- import { createContextScope as y } from "./index76.js";
3
- import { useComposedRefs as M } from "./index78.js";
4
- import { createSlot as x } from "./index113.js";
5
- import { jsx as u } from "react/jsx-runtime";
6
- function g(s) {
7
- const m = s + "CollectionProvider", [A, N] = y(m), [_, f] = A(
8
- m,
9
- { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
10
- ), p = (c) => {
11
- const { scope: e, children: l } = c, o = r.useRef(null), t = r.useRef(/* @__PURE__ */ new Map()).current;
12
- return /* @__PURE__ */ u(_, { scope: e, itemMap: t, collectionRef: o, children: l });
13
- };
14
- p.displayName = m;
15
- const a = s + "CollectionSlot", E = x(a), C = r.forwardRef(
16
- (c, e) => {
17
- const { scope: l, children: o } = c, t = f(a, l), n = M(e, t.collectionRef);
18
- return /* @__PURE__ */ u(E, { ref: n, children: o });
19
- }
20
- );
21
- C.displayName = a;
22
- const d = s + "CollectionItemSlot", R = "data-radix-collection-item", T = x(d), I = r.forwardRef(
23
- (c, e) => {
24
- const { scope: l, children: o, ...t } = c, n = r.useRef(null), S = M(e, n), i = f(d, l);
25
- return r.useEffect(() => (i.itemMap.set(n, { ref: n, ...t }), () => void i.itemMap.delete(n))), /* @__PURE__ */ u(T, { [R]: "", ref: S, children: o });
26
- }
27
- );
28
- I.displayName = d;
29
- function O(c) {
30
- const e = f(s + "CollectionConsumer", c);
31
- return r.useCallback(() => {
32
- const o = e.collectionRef.current;
33
- if (!o) return [];
34
- const t = Array.from(o.querySelectorAll(`[${R}]`));
35
- return Array.from(e.itemMap.values()).sort(
36
- (i, v) => t.indexOf(i.ref.current) - t.indexOf(v.ref.current)
37
- );
38
- }, [e.collectionRef, e.itemMap]);
39
- }
40
- return [
41
- { Provider: p, Slot: C, ItemSlot: I },
42
- O,
43
- N
44
- ];
1
+ import * as r from "react";
2
+ function o(t) {
3
+ const e = r.useRef(t);
4
+ return r.useEffect(() => {
5
+ e.current = t;
6
+ }), r.useMemo(() => (...n) => {
7
+ var u;
8
+ return (u = e.current) == null ? void 0 : u.call(e, ...n);
9
+ }, []);
45
10
  }
46
11
  export {
47
- g as createCollection
12
+ o as useCallbackRef
48
13
  };
package/dist/index78.js CHANGED
@@ -1,29 +1,6 @@
1
- import * as f from "react";
2
- function l(n, o) {
3
- if (typeof n == "function")
4
- return n(o);
5
- n != null && (n.current = o);
6
- }
7
- function i(...n) {
8
- return (o) => {
9
- let u = !1;
10
- const c = n.map((t) => {
11
- const e = l(t, o);
12
- return !u && typeof e == "function" && (u = !0), e;
13
- });
14
- if (u)
15
- return () => {
16
- for (let t = 0; t < c.length; t++) {
17
- const e = c[t];
18
- typeof e == "function" ? e() : l(n[t], null);
19
- }
20
- };
21
- };
22
- }
23
- function s(...n) {
24
- return f.useCallback(i(...n), n);
25
- }
1
+ import * as t from "react";
2
+ var e = globalThis != null && globalThis.document ? t.useLayoutEffect : () => {
3
+ };
26
4
  export {
27
- i as composeRefs,
28
- s as useComposedRefs
5
+ e as useLayoutEffect
29
6
  };
package/dist/index79.js CHANGED
@@ -1,9 +1,32 @@
1
- function h(f, c, { checkForDefaultPrevented: p = !0 } = {}) {
2
- return function(s) {
3
- if (f == null || f(s), p === !1 || !s.defaultPrevented)
4
- return c == null ? void 0 : c(s);
5
- };
6
- }
1
+ import * as f from "react";
2
+ import "react-dom";
3
+ import { createSlot as l } from "./index47.js";
4
+ import { jsx as n } from "react/jsx-runtime";
5
+ var u = [
6
+ "a",
7
+ "button",
8
+ "div",
9
+ "form",
10
+ "h2",
11
+ "h3",
12
+ "img",
13
+ "input",
14
+ "label",
15
+ "li",
16
+ "nav",
17
+ "ol",
18
+ "p",
19
+ "select",
20
+ "span",
21
+ "svg",
22
+ "ul"
23
+ ], w = u.reduce((t, i) => {
24
+ const o = l(`Primitive.${i}`), r = f.forwardRef((e, m) => {
25
+ const { asChild: a, ...p } = e, s = a ? o : i;
26
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ n(s, { ...p, ref: m });
27
+ });
28
+ return r.displayName = `Primitive.${i}`, { ...t, [i]: r };
29
+ }, {});
7
30
  export {
8
- h as composeEventHandlers
31
+ w as Primitive
9
32
  };
package/dist/index8.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { cva as o } from "./index47.js";
2
+ import { cva as o } from "./index45.js";
3
3
  import { cn as a } from "./index2.js";
4
4
  const i = o(
5
5
  "inline-flex items-center border-2 px-2.5 py-0.5 text-xs font-semibold uppercase tracking-wider focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",