@drjoshcsimmons/scl 0.1.0 → 0.1.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 (195) hide show
  1. package/dist/components/ui/alert/alert.d.ts +1 -1
  2. package/dist/components/ui/alert/alert.d.ts.map +1 -1
  3. package/dist/components/ui/badge/badge.d.ts +1 -1
  4. package/dist/components/ui/badge/badge.d.ts.map +1 -1
  5. package/dist/components/ui/button/button.d.ts +1 -1
  6. package/dist/components/ui/button/button.d.ts.map +1 -1
  7. package/dist/components/ui/combobox/combobox.d.ts +31 -0
  8. package/dist/components/ui/combobox/combobox.d.ts.map +1 -0
  9. package/dist/components/ui/combobox/index.d.ts +3 -0
  10. package/dist/components/ui/combobox/index.d.ts.map +1 -0
  11. package/dist/components/ui/command/command.d.ts +85 -0
  12. package/dist/components/ui/command/command.d.ts.map +1 -0
  13. package/dist/components/ui/command/index.d.ts +2 -0
  14. package/dist/components/ui/command/index.d.ts.map +1 -0
  15. package/dist/components/ui/dithered-image/dithered-image.d.ts +6 -2
  16. package/dist/components/ui/dithered-image/dithered-image.d.ts.map +1 -1
  17. package/dist/components/ui/dithered-image/index.d.ts +1 -1
  18. package/dist/components/ui/dithered-image/index.d.ts.map +1 -1
  19. package/dist/components/ui/form/form.d.ts +24 -0
  20. package/dist/components/ui/form/form.d.ts.map +1 -0
  21. package/dist/components/ui/form/index.d.ts +2 -0
  22. package/dist/components/ui/form/index.d.ts.map +1 -0
  23. package/dist/components/ui/progress/progress.d.ts +0 -6
  24. package/dist/components/ui/progress/progress.d.ts.map +1 -1
  25. package/dist/components/ui/scroll-area/scroll-area.d.ts.map +1 -1
  26. package/dist/components/ui/skeleton/skeleton.d.ts +4 -1
  27. package/dist/components/ui/skeleton/skeleton.d.ts.map +1 -1
  28. package/dist/components/ui/statusline/statusline.d.ts.map +1 -1
  29. package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts +0 -5
  30. package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts.map +1 -1
  31. package/dist/index.d.ts +3 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +166 -143
  34. package/dist/index10.js +30 -30
  35. package/dist/index100.js +218 -29
  36. package/dist/index101.js +646 -11
  37. package/dist/index102.js +173 -127
  38. package/dist/index103.js +4 -50
  39. package/dist/index104.js +30 -9
  40. package/dist/index105.js +6 -4
  41. package/dist/index106.js +11 -180
  42. package/dist/index107.js +19 -648
  43. package/dist/index108.js +9 -107
  44. package/dist/index109.js +38 -91
  45. package/dist/index11.js +13 -13
  46. package/dist/index110.js +18 -67
  47. package/dist/index111.js +201 -154
  48. package/dist/index112.js +20 -395
  49. package/dist/index113.js +395 -1675
  50. package/dist/index114.js +2 -278
  51. package/dist/index115.js +49 -128
  52. package/dist/index116.js +65 -32
  53. package/dist/index117.js +19 -1605
  54. package/dist/index118.js +28 -297
  55. package/dist/index119.js +5 -635
  56. package/dist/index12.js +1 -1
  57. package/dist/index120.js +2 -144
  58. package/dist/index121.js +2 -21
  59. package/dist/index122.js +5 -9
  60. package/dist/index123.js +3 -38
  61. package/dist/index124.js +24 -18
  62. package/dist/index125.js +113 -6
  63. package/dist/index126.js +15 -11
  64. package/dist/index127.js +513 -194
  65. package/dist/index128.js +128 -22
  66. package/dist/index129.js +114 -380
  67. package/dist/index13.js +132 -93
  68. package/dist/index130.js +59 -1300
  69. package/dist/index131.js +63 -612
  70. package/dist/index132.js +9 -2
  71. package/dist/index133.js +13 -52
  72. package/dist/index134.js +64 -63
  73. package/dist/index135.js +3 -24
  74. package/dist/index136.js +23 -29
  75. package/dist/index137.js +23 -5
  76. package/dist/index138.js +13 -2
  77. package/dist/index139.js +28 -2
  78. package/dist/index14.js +106 -220
  79. package/dist/index140.js +5 -5
  80. package/dist/index15.js +79 -125
  81. package/dist/index16.js +280 -17
  82. package/dist/index17.js +139 -12
  83. package/dist/index18.js +92 -22
  84. package/dist/index19.js +18 -55
  85. package/dist/index2.js +2 -2
  86. package/dist/index20.js +14 -26
  87. package/dist/index21.js +19 -33
  88. package/dist/index22.js +38 -121
  89. package/dist/index23.js +29 -22
  90. package/dist/index24.js +31 -64
  91. package/dist/index25.js +121 -15
  92. package/dist/index26.js +19 -29
  93. package/dist/index27.js +68 -77
  94. package/dist/index28.js +20 -25
  95. package/dist/index29.js +32 -88
  96. package/dist/index3.js +11 -9
  97. package/dist/index30.js +138 -38
  98. package/dist/index31.js +20 -227
  99. package/dist/index32.js +88 -18
  100. package/dist/index33.js +37 -28
  101. package/dist/index34.js +86 -22
  102. package/dist/index35.js +17 -102
  103. package/dist/index36.js +34 -65
  104. package/dist/index37.js +23 -49
  105. package/dist/index38.js +38 -99
  106. package/dist/index39.js +65 -10
  107. package/dist/index4.js +6 -6
  108. package/dist/index40.js +49 -15
  109. package/dist/index41.js +93 -2256
  110. package/dist/index42.js +10 -32
  111. package/dist/index43.js +15 -18
  112. package/dist/index44.js +2251 -225
  113. package/dist/index45.js +237 -11
  114. package/dist/index46.js +11 -73
  115. package/dist/index47.js +33 -249
  116. package/dist/index48.js +118 -9
  117. package/dist/index49.js +63 -326
  118. package/dist/index5.js +23 -23
  119. package/dist/index50.js +307 -57
  120. package/dist/index51.js +12 -241
  121. package/dist/index52.js +222 -822
  122. package/dist/index53.js +6 -3
  123. package/dist/index54.js +56 -114
  124. package/dist/index55.js +248 -219
  125. package/dist/index56.js +249 -11
  126. package/dist/index57.js +3 -5
  127. package/dist/index58.js +110 -221
  128. package/dist/index59.js +12 -260
  129. package/dist/index6.js +12 -12
  130. package/dist/index60.js +18 -12
  131. package/dist/index61.js +221 -18
  132. package/dist/index62.js +11 -530
  133. package/dist/index63.js +11 -6155
  134. package/dist/index64.js +234 -2626
  135. package/dist/index65.js +230 -292
  136. package/dist/index66.js +504 -646
  137. package/dist/index67.js +155 -824
  138. package/dist/index68.js +128 -23
  139. package/dist/index69.js +319 -311
  140. package/dist/index7.js +22 -22
  141. package/dist/index70.js +72 -4889
  142. package/dist/index71.js +408 -802
  143. package/dist/index72.js +18 -1254
  144. package/dist/index73.js +844 -518
  145. package/dist/index74.js +9 -125
  146. package/dist/index75.js +31 -161
  147. package/dist/index76.js +7 -31
  148. package/dist/index77.js +62 -429
  149. package/dist/index78.js +50 -128
  150. package/dist/index79.js +4 -81
  151. package/dist/index8.js +17 -18
  152. package/dist/index80.js +23 -64
  153. package/dist/index81.js +33 -45
  154. package/dist/index82.js +63 -21
  155. package/dist/index83.js +10 -6
  156. package/dist/index84.js +52 -49
  157. package/dist/index85.js +10 -33
  158. package/dist/index86.js +30 -11
  159. package/dist/index87.js +12 -7
  160. package/dist/index88.js +46 -30
  161. package/dist/index89.js +7 -54
  162. package/dist/index9.js +23 -31
  163. package/dist/index90.js +14 -10
  164. package/dist/index91.js +125 -4
  165. package/dist/index92.js +131 -9
  166. package/dist/index93.js +14 -6
  167. package/dist/index94.js +14 -24
  168. package/dist/index95.js +9 -69
  169. package/dist/index96.js +47 -122
  170. package/dist/index97.js +51 -216
  171. package/dist/index98.js +6 -14
  172. package/dist/index99.js +24 -53
  173. package/dist/tokens/colors.d.ts +26 -86
  174. package/dist/tokens/colors.d.ts.map +1 -1
  175. package/dist/tokens/index.d.ts +12 -84
  176. package/dist/tokens/index.d.ts.map +1 -1
  177. package/package.json +28 -23
  178. package/dist/index141.js +0 -5
  179. package/dist/index142.js +0 -26
  180. package/dist/index143.js +0 -115
  181. package/dist/index144.js +0 -18
  182. package/dist/index145.js +0 -527
  183. package/dist/index146.js +0 -130
  184. package/dist/index147.js +0 -136
  185. package/dist/index148.js +0 -67
  186. package/dist/index149.js +0 -71
  187. package/dist/index150.js +0 -11
  188. package/dist/index151.js +0 -16
  189. package/dist/index152.js +0 -68
  190. package/dist/index153.js +0 -6
  191. package/dist/index154.js +0 -25
  192. package/dist/index155.js +0 -25
  193. package/dist/index156.js +0 -15
  194. package/dist/index157.js +0 -30
  195. package/dist/index158.js +0 -7
package/dist/index79.js CHANGED
@@ -1,83 +1,6 @@
1
- import * as m from "react";
2
- import { createContextScope as $ } from "./index89.js";
3
- import { Primitive as c } from "./index88.js";
4
- import { jsx as l } from "react/jsx-runtime";
5
- var u = "Progress", d = 100, [I] = $(u), [h, R] = I(u), f = m.forwardRef(
6
- (r, e) => {
7
- const {
8
- __scopeProgress: i,
9
- value: o = null,
10
- max: a,
11
- getValueLabel: P = E,
12
- ...N
13
- } = r;
14
- (a || a === 0) && !v(a) && console.error(M(`${a}`, "Progress"));
15
- const t = v(a) ? a : d;
16
- o !== null && !p(o, t) && console.error(V(`${o}`, "Progress"));
17
- const n = p(o, t) ? o : null, b = s(n) ? P(n, t) : void 0;
18
- return /* @__PURE__ */ l(h, { scope: i, value: n, max: t, children: /* @__PURE__ */ l(
19
- c.div,
20
- {
21
- "aria-valuemax": t,
22
- "aria-valuemin": 0,
23
- "aria-valuenow": s(n) ? n : void 0,
24
- "aria-valuetext": b,
25
- role: "progressbar",
26
- "data-state": x(n, t),
27
- "data-value": n ?? void 0,
28
- "data-max": t,
29
- ...N,
30
- ref: e
31
- }
32
- ) });
33
- }
34
- );
35
- f.displayName = u;
36
- var g = "ProgressIndicator", _ = m.forwardRef(
37
- (r, e) => {
38
- const { __scopeProgress: i, ...o } = r, a = R(g, i);
39
- return /* @__PURE__ */ l(
40
- c.div,
41
- {
42
- "data-state": x(a.value, a.max),
43
- "data-value": a.value ?? void 0,
44
- "data-max": a.max,
45
- ...o,
46
- ref: e
47
- }
48
- );
49
- }
50
- );
51
- _.displayName = g;
52
- function E(r, e) {
53
- return `${Math.round(r / e * 100)}%`;
54
- }
55
- function x(r, e) {
56
- return r == null ? "indeterminate" : r === e ? "complete" : "loading";
57
- }
58
- function s(r) {
59
- return typeof r == "number";
60
- }
61
- function v(r) {
62
- return s(r) && !isNaN(r) && r > 0;
63
- }
64
- function p(r, e) {
65
- return s(r) && !isNaN(r) && r <= e && r >= 0;
66
- }
67
- function M(r, e) {
68
- return `Invalid prop \`max\` of value \`${r}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${d}\`.`;
69
- }
70
- function V(r, e) {
71
- return `Invalid prop \`value\` of value \`${r}\` supplied to \`${e}\`. The \`value\` prop must be:
72
- - a positive number
73
- - less than the value passed to \`max\` (or ${d} if no \`max\` prop is set)
74
- - \`null\` or \`undefined\` if the progress is indeterminate.
75
-
76
- Defaulting to \`null\`.`;
77
- }
78
- var D = f;
1
+ import * as t from "react";
2
+ var e = globalThis != null && globalThis.document ? t.useLayoutEffect : () => {
3
+ };
79
4
  export {
80
- f as Progress,
81
- _ as ProgressIndicator,
82
- D as Root
5
+ e as useLayoutEffect
83
6
  };
package/dist/index8.js CHANGED
@@ -1,20 +1,19 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { cva as o } from "./index42.js";
3
- import { cn as b } from "./index2.js";
4
- const a = o(
5
- "inline-flex items-center border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { cva as n } from "./index47.js";
3
+ import { cn as a } from "./index2.js";
4
+ const i = n(
5
+ "inline-flex items-center border-2 px-2.5 py-0.5 text-xs font-semibold uppercase tracking-wider transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
6
6
  {
7
7
  variants: {
8
8
  variant: {
9
- default: "border-[#00ff00] bg-[#00ff00] text-black shadow hover:bg-black hover:text-[#00ff00]",
10
- secondary: "border-[#ff00ff] bg-[#ff00ff] text-black hover:bg-black hover:text-[#ff00ff]",
11
- destructive: "border-[#ff0000] bg-[#ff0000] text-black shadow hover:bg-black hover:text-[#ff0000]",
12
- outline: "text-foreground",
13
- green: "border-[#00ff00] bg-[#00ff00] text-black hover:bg-black hover:text-[#00ff00]",
14
- white: "border-white bg-white text-black hover:bg-black hover:text-white",
15
- yellow: "border-[#ffff00] bg-[#ffff00] text-black hover:bg-black hover:text-[#ffff00]",
16
- hotpink: "border-[#ff00ff] bg-[#ff00ff] text-black hover:bg-black hover:text-[#ff00ff]",
17
- blue: "border-[#0000ff] bg-[#0000ff] text-white hover:bg-black hover:text-[#0000ff] hover:border-[#0000ff]"
9
+ // Filled variants (color bg, black text)
10
+ default: "border-primary bg-primary text-primary-foreground",
11
+ secondary: "border-secondary bg-secondary text-secondary-foreground",
12
+ destructive: "border-destructive bg-destructive text-destructive-foreground",
13
+ // Outline variants (transparent bg, color text/border)
14
+ outline: "border-primary bg-transparent text-primary",
15
+ "secondary-outline": "border-secondary bg-transparent text-secondary",
16
+ "destructive-outline": "border-destructive bg-transparent text-destructive"
18
17
  }
19
18
  },
20
19
  defaultVariants: {
@@ -22,10 +21,10 @@ const a = o(
22
21
  }
23
22
  }
24
23
  );
25
- function n({ className: f, variant: e, ...t }) {
26
- return /* @__PURE__ */ r("div", { className: b(a({ variant: e }), f), ...t });
24
+ function u({ className: r, variant: e, ...t }) {
25
+ return /* @__PURE__ */ o("div", { className: a(i({ variant: e }), r), ...t });
27
26
  }
28
27
  export {
29
- n as Badge,
30
- a as badgeVariants
28
+ u as Badge,
29
+ i as badgeVariants
31
30
  };
package/dist/index80.js CHANGED
@@ -1,70 +1,29 @@
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];
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);
16
6
  }
17
- function _(e, c = []) {
18
- 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 });
26
- };
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}\``);
34
- }
35
- return [p, f];
36
- }
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]
44
- );
45
- };
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
+ };
46
21
  };
47
- return i.scopeName = e, [a, l(i, ...c)];
48
22
  }
49
- function l(...e) {
50
- const c = e[0];
51
- if (e.length === 1) return c;
52
- const o = () => {
53
- const a = e.map((i) => ({
54
- useScope: i(),
55
- scopeName: i.scopeName
56
- }));
57
- return function(r) {
58
- const t = a.reduce((n, { useScope: s, scopeName: p }) => {
59
- const d = s(r)[`__scope${p}`];
60
- return { ...n, ...d };
61
- }, {});
62
- return u.useMemo(() => ({ [`__scope${c.scopeName}`]: t }), [t]);
63
- };
64
- };
65
- return o.scopeName = c.scopeName, o;
23
+ function s(...n) {
24
+ return f.useCallback(i(...n), n);
66
25
  }
67
26
  export {
68
- w as createContext,
69
- _ as createContextScope
27
+ i as composeRefs,
28
+ s as useComposedRefs
70
29
  };
package/dist/index81.js CHANGED
@@ -1,48 +1,36 @@
1
- import r from "react";
2
- import { createContextScope as y } from "./index80.js";
3
- import { useComposedRefs as M } from "./index82.js";
4
- import { createSlot as x } from "./index99.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 f from "react";
2
+ import * as p from "react-dom";
3
+ import { createSlot as c } from "./index97.js";
4
+ import { jsx as l } 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
+ ], h = u.reduce((t, i) => {
24
+ const o = c(`Primitive.${i}`), r = f.forwardRef((e, m) => {
25
+ const { asChild: s, ...a } = e, n = s ? o : i;
26
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ l(n, { ...a, ref: m });
27
+ });
28
+ return r.displayName = `Primitive.${i}`, { ...t, [i]: r };
29
+ }, {});
30
+ function w(t, i) {
31
+ t && p.flushSync(() => t.dispatchEvent(i));
45
32
  }
46
33
  export {
47
- g as createCollection
34
+ h as Primitive,
35
+ w as dispatchDiscreteCustomEvent
48
36
  };
package/dist/index82.js CHANGED
@@ -1,29 +1,71 @@
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);
1
+ import * as a from "react";
2
+ import { useComposedRefs as E } from "./index80.js";
3
+ import { useLayoutEffect as A } from "./index79.js";
4
+ function T(n, e) {
5
+ return a.useReducer((r, t) => e[r][t] ?? r, n);
6
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);
7
+ var R = (n) => {
8
+ const { present: e, children: r } = n, t = v(e), i = typeof r == "function" ? r({ present: t.isPresent }) : a.Children.only(r), c = E(t.ref, P(i));
9
+ return typeof r == "function" || t.isPresent ? a.cloneElement(i, { ref: c }) : null;
10
+ };
11
+ R.displayName = "Presence";
12
+ function v(n) {
13
+ const [e, r] = a.useState(), t = a.useRef(null), i = a.useRef(n), c = a.useRef("none"), p = n ? "mounted" : "unmounted", [N, s] = T(p, {
14
+ mounted: {
15
+ UNMOUNT: "unmounted",
16
+ ANIMATION_OUT: "unmountSuspended"
17
+ },
18
+ unmountSuspended: {
19
+ MOUNT: "mounted",
20
+ ANIMATION_END: "unmounted"
21
+ },
22
+ unmounted: {
23
+ MOUNT: "mounted"
24
+ }
25
+ });
26
+ return a.useEffect(() => {
27
+ const o = l(t.current);
28
+ c.current = N === "mounted" ? o : "none";
29
+ }, [N]), A(() => {
30
+ const o = t.current, m = i.current;
31
+ if (m !== n) {
32
+ const f = c.current, u = l(o);
33
+ n ? s("MOUNT") : u === "none" || (o == null ? void 0 : o.display) === "none" ? s("UNMOUNT") : s(m && f !== u ? "ANIMATION_OUT" : "UNMOUNT"), i.current = n;
34
+ }
35
+ }, [n, s]), A(() => {
36
+ if (e) {
37
+ let o;
38
+ const m = e.ownerDocument.defaultView ?? window, d = (u) => {
39
+ const g = l(t.current).includes(CSS.escape(u.animationName));
40
+ if (u.target === e && g && (s("ANIMATION_END"), !i.current)) {
41
+ const O = e.style.animationFillMode;
42
+ e.style.animationFillMode = "forwards", o = m.setTimeout(() => {
43
+ e.style.animationFillMode === "forwards" && (e.style.animationFillMode = O);
44
+ });
19
45
  }
46
+ }, f = (u) => {
47
+ u.target === e && (c.current = l(t.current));
48
+ };
49
+ return e.addEventListener("animationstart", f), e.addEventListener("animationcancel", d), e.addEventListener("animationend", d), () => {
50
+ m.clearTimeout(o), e.removeEventListener("animationstart", f), e.removeEventListener("animationcancel", d), e.removeEventListener("animationend", d);
20
51
  };
52
+ } else
53
+ s("ANIMATION_END");
54
+ }, [e, s]), {
55
+ isPresent: ["mounted", "unmountSuspended"].includes(N),
56
+ ref: a.useCallback((o) => {
57
+ t.current = o ? getComputedStyle(o) : null, r(o);
58
+ }, [])
21
59
  };
22
60
  }
23
- function s(...n) {
24
- return f.useCallback(i(...n), n);
61
+ function l(n) {
62
+ return (n == null ? void 0 : n.animationName) || "none";
63
+ }
64
+ function P(n) {
65
+ var t, i;
66
+ let e = (t = Object.getOwnPropertyDescriptor(n.props, "ref")) == null ? void 0 : t.get, r = e && "isReactWarning" in e && e.isReactWarning;
67
+ return r ? n.ref : (e = (i = Object.getOwnPropertyDescriptor(n, "ref")) == null ? void 0 : i.get, r = e && "isReactWarning" in e && e.isReactWarning, r ? n.props.ref : n.props.ref || n.ref);
25
68
  }
26
69
  export {
27
- i as composeRefs,
28
- s as useComposedRefs
70
+ R as Presence
29
71
  };
package/dist/index83.js CHANGED
@@ -1,9 +1,13 @@
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
- };
1
+ import * as o from "react";
2
+ import { useLayoutEffect as a } from "./index79.js";
3
+ var s = o[" useId ".trim().toString()] || (() => {
4
+ }), f = 0;
5
+ function i(t) {
6
+ const [e, r] = o.useState(s());
7
+ return a(() => {
8
+ r((u) => u ?? String(f++));
9
+ }, [t]), t || (e ? `radix-${e}` : "");
6
10
  }
7
11
  export {
8
- h as composeEventHandlers
12
+ i as useId
9
13
  };
package/dist/index84.js CHANGED
@@ -1,54 +1,57 @@
1
- import * as n from "react";
2
- import { useLayoutEffect as v } from "./index91.js";
3
- var E = n[" useInsertionEffect ".trim().toString()] || v;
4
- function y({
5
- prop: t,
6
- defaultProp: u,
7
- onChange: o = () => {
8
- },
9
- caller: i
10
- }) {
11
- const [l, e, r] = w({
12
- defaultProp: u,
13
- onChange: o
14
- }), c = t !== void 0, a = c ? t : l;
15
- {
16
- const s = n.useRef(t !== void 0);
17
- n.useEffect(() => {
18
- const f = s.current;
19
- f !== c && console.warn(
20
- `${i} is changing from ${f ? "controlled" : "uncontrolled"} to ${c ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
21
- ), s.current = c;
22
- }, [c, i]);
1
+ import * as i from "react";
2
+ import { jsx as _ } from "react/jsx-runtime";
3
+ function $(e, x = []) {
4
+ let o = [];
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 });
14
+ };
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}\``);
22
+ }
23
+ return [m, S];
23
24
  }
24
- const m = n.useCallback(
25
- (s) => {
26
- var f;
27
- if (c) {
28
- const d = R(s) ? s(t) : s;
29
- d !== t && ((f = r.current) == null || f.call(r, d));
30
- } else
31
- e(s);
32
- },
33
- [c, t, e, r]
34
- );
35
- return [a, m];
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]
32
+ );
33
+ };
34
+ };
35
+ return u.scopeName = e, [f, h(u, ...x)];
36
36
  }
37
- function w({
38
- defaultProp: t,
39
- onChange: u
40
- }) {
41
- const [o, i] = n.useState(t), l = n.useRef(o), e = n.useRef(u);
42
- return E(() => {
43
- e.current = u;
44
- }, [u]), n.useEffect(() => {
45
- var r;
46
- l.current !== o && ((r = e.current) == null || r.call(e, o), l.current = o);
47
- }, [o, l]), [o, i, e];
48
- }
49
- function R(t) {
50
- return typeof t == "function";
37
+ function h(...e) {
38
+ const x = e[0];
39
+ if (e.length === 1) return x;
40
+ const o = () => {
41
+ const f = e.map((u) => ({
42
+ useScope: u(),
43
+ scopeName: u.scopeName
44
+ }));
45
+ return function(r) {
46
+ const n = f.reduce((t, { useScope: c, scopeName: m }) => {
47
+ const a = c(r)[`__scope${m}`];
48
+ return { ...t, ...a };
49
+ }, {});
50
+ return i.useMemo(() => ({ [`__scope${x.scopeName}`]: n }), [n]);
51
+ };
52
+ };
53
+ return o.scopeName = x.scopeName, o;
51
54
  }
52
55
  export {
53
- y as useControllableState
56
+ $ as createContextScope
54
57
  };
package/dist/index85.js CHANGED
@@ -1,36 +1,13 @@
1
- import * as f from "react";
2
- import * as p from "react-dom";
3
- import { createSlot as c } from "./index99.js";
4
- import { jsx as l } 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
- ], h = u.reduce((t, i) => {
24
- const o = c(`Primitive.${i}`), r = f.forwardRef((e, m) => {
25
- const { asChild: s, ...a } = e, n = s ? o : i;
26
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ l(n, { ...a, ref: m });
27
- });
28
- return r.displayName = `Primitive.${i}`, { ...t, [i]: r };
29
- }, {});
30
- function w(t, i) {
31
- t && p.flushSync(() => t.dispatchEvent(i));
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
+ }, []);
32
10
  }
33
11
  export {
34
- h as Primitive,
35
- w as dispatchDiscreteCustomEvent
12
+ o as useCallbackRef
36
13
  };
package/dist/index86.js CHANGED
@@ -1,13 +1,32 @@
1
- import * as o from "react";
2
- import { useLayoutEffect as a } from "./index91.js";
3
- var s = o[" useId ".trim().toString()] || (() => {
4
- }), f = 0;
5
- function i(t) {
6
- const [e, r] = o.useState(s());
7
- return a(() => {
8
- r((u) => u ?? String(f++));
9
- }, [t]), t || (e ? `radix-${e}` : "");
10
- }
1
+ import * as f from "react";
2
+ import "react-dom";
3
+ import { createSlot as l } from "./index54.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
+ }, {});
11
30
  export {
12
- i as useId
31
+ w as Primitive
13
32
  };
package/dist/index87.js CHANGED
@@ -1,10 +1,15 @@
1
- import * as t from "react";
2
- import "react/jsx-runtime";
3
- var r = t.createContext(void 0);
4
- function n(o) {
5
- const e = t.useContext(r);
6
- return o || e || "ltr";
1
+ import { s as r } from "./index105.js";
2
+ function s() {
3
+ return r.useSyncExternalStore(
4
+ e,
5
+ () => !0,
6
+ () => !1
7
+ );
8
+ }
9
+ function e() {
10
+ return () => {
11
+ };
7
12
  }
8
13
  export {
9
- n as useDirection
14
+ s as useIsHydrated
10
15
  };