@drjoshcsimmons/scl 0.1.14 → 0.2.1

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 (258) hide show
  1. package/LICENSE +1 -1
  2. package/dist/components/ui/accordion/accordion.d.ts +1 -1
  3. package/dist/components/ui/accordion/accordion.d.ts.map +1 -1
  4. package/dist/components/ui/accordion/index.d.ts +1 -1
  5. package/dist/components/ui/accordion/index.d.ts.map +1 -1
  6. package/dist/components/ui/alert/alert.d.ts.map +1 -1
  7. package/dist/components/ui/alert/index.d.ts +1 -1
  8. package/dist/components/ui/alert/index.d.ts.map +1 -1
  9. package/dist/components/ui/alert-dialog/alert-dialog.d.ts +2 -2
  10. package/dist/components/ui/alert-dialog/alert-dialog.d.ts.map +1 -1
  11. package/dist/components/ui/alert-dialog/index.d.ts +1 -1
  12. package/dist/components/ui/alert-dialog/index.d.ts.map +1 -1
  13. package/dist/components/ui/avatar/avatar.d.ts +1 -1
  14. package/dist/components/ui/avatar/avatar.d.ts.map +1 -1
  15. package/dist/components/ui/avatar/index.d.ts +1 -1
  16. package/dist/components/ui/avatar/index.d.ts.map +1 -1
  17. package/dist/components/ui/badge/badge.d.ts +1 -1
  18. package/dist/components/ui/badge/badge.d.ts.map +1 -1
  19. package/dist/components/ui/badge/index.d.ts +1 -1
  20. package/dist/components/ui/badge/index.d.ts.map +1 -1
  21. package/dist/components/ui/button/button.d.ts.map +1 -1
  22. package/dist/components/ui/button/index.d.ts +1 -1
  23. package/dist/components/ui/button/index.d.ts.map +1 -1
  24. package/dist/components/ui/card/card.d.ts.map +1 -1
  25. package/dist/components/ui/card/index.d.ts +1 -1
  26. package/dist/components/ui/card/index.d.ts.map +1 -1
  27. package/dist/components/ui/checkbox/checkbox.d.ts +1 -1
  28. package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
  29. package/dist/components/ui/checkbox/index.d.ts.map +1 -1
  30. package/dist/components/ui/collapsible/collapsible.d.ts.map +1 -1
  31. package/dist/components/ui/collapsible/index.d.ts +1 -1
  32. package/dist/components/ui/collapsible/index.d.ts.map +1 -1
  33. package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
  34. package/dist/components/ui/combobox/index.d.ts +1 -1
  35. package/dist/components/ui/combobox/index.d.ts.map +1 -1
  36. package/dist/components/ui/command/command.d.ts.map +1 -1
  37. package/dist/components/ui/command/index.d.ts +1 -1
  38. package/dist/components/ui/command/index.d.ts.map +1 -1
  39. package/dist/components/ui/dialog/dialog.d.ts +1 -1
  40. package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
  41. package/dist/components/ui/dialog/index.d.ts +1 -1
  42. package/dist/components/ui/dialog/index.d.ts.map +1 -1
  43. package/dist/components/ui/dithered-image/dithered-image.d.ts.map +1 -1
  44. package/dist/components/ui/dithered-image/index.d.ts +1 -1
  45. package/dist/components/ui/dithered-image/index.d.ts.map +1 -1
  46. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +1 -1
  47. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +1 -1
  48. package/dist/components/ui/dropdown-menu/index.d.ts +1 -1
  49. package/dist/components/ui/dropdown-menu/index.d.ts.map +1 -1
  50. package/dist/components/ui/form/form.d.ts +1 -1
  51. package/dist/components/ui/form/form.d.ts.map +1 -1
  52. package/dist/components/ui/form/index.d.ts +1 -1
  53. package/dist/components/ui/form/index.d.ts.map +1 -1
  54. package/dist/components/ui/input/index.d.ts.map +1 -1
  55. package/dist/components/ui/input/input.d.ts.map +1 -1
  56. package/dist/components/ui/label/index.d.ts.map +1 -1
  57. package/dist/components/ui/label/label.d.ts +1 -1
  58. package/dist/components/ui/label/label.d.ts.map +1 -1
  59. package/dist/components/ui/popover/index.d.ts +1 -1
  60. package/dist/components/ui/popover/index.d.ts.map +1 -1
  61. package/dist/components/ui/popover/popover.d.ts +1 -1
  62. package/dist/components/ui/popover/popover.d.ts.map +1 -1
  63. package/dist/components/ui/progress/index.d.ts.map +1 -1
  64. package/dist/components/ui/progress/progress.d.ts +1 -1
  65. package/dist/components/ui/progress/progress.d.ts.map +1 -1
  66. package/dist/components/ui/radio-group/index.d.ts.map +1 -1
  67. package/dist/components/ui/radio-group/radio-group.d.ts +1 -1
  68. package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
  69. package/dist/components/ui/scroll-area/index.d.ts.map +1 -1
  70. package/dist/components/ui/scroll-area/scroll-area.d.ts +1 -1
  71. package/dist/components/ui/scroll-area/scroll-area.d.ts.map +1 -1
  72. package/dist/components/ui/select/index.d.ts +1 -1
  73. package/dist/components/ui/select/index.d.ts.map +1 -1
  74. package/dist/components/ui/select/select.d.ts +1 -1
  75. package/dist/components/ui/select/select.d.ts.map +1 -1
  76. package/dist/components/ui/separator/index.d.ts.map +1 -1
  77. package/dist/components/ui/separator/separator.d.ts +1 -1
  78. package/dist/components/ui/separator/separator.d.ts.map +1 -1
  79. package/dist/components/ui/sheet/index.d.ts +1 -1
  80. package/dist/components/ui/sheet/index.d.ts.map +1 -1
  81. package/dist/components/ui/sheet/sheet.d.ts +2 -2
  82. package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
  83. package/dist/components/ui/skeleton/index.d.ts.map +1 -1
  84. package/dist/components/ui/skeleton/skeleton.d.ts.map +1 -1
  85. package/dist/components/ui/slider/index.d.ts.map +1 -1
  86. package/dist/components/ui/slider/slider.d.ts +1 -1
  87. package/dist/components/ui/slider/slider.d.ts.map +1 -1
  88. package/dist/components/ui/statusline/index.d.ts.map +1 -1
  89. package/dist/components/ui/statusline/statusline.d.ts.map +1 -1
  90. package/dist/components/ui/switch/index.d.ts.map +1 -1
  91. package/dist/components/ui/switch/switch.d.ts +1 -1
  92. package/dist/components/ui/switch/switch.d.ts.map +1 -1
  93. package/dist/components/ui/table/index.d.ts +1 -1
  94. package/dist/components/ui/table/index.d.ts.map +1 -1
  95. package/dist/components/ui/table/table.d.ts +1 -1
  96. package/dist/components/ui/table/table.d.ts.map +1 -1
  97. package/dist/components/ui/tabs/index.d.ts +1 -1
  98. package/dist/components/ui/tabs/index.d.ts.map +1 -1
  99. package/dist/components/ui/tabs/tabs.d.ts +1 -1
  100. package/dist/components/ui/tabs/tabs.d.ts.map +1 -1
  101. package/dist/components/ui/terminal-textarea/index.d.ts.map +1 -1
  102. package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts.map +1 -1
  103. package/dist/components/ui/textarea/index.d.ts.map +1 -1
  104. package/dist/components/ui/textarea/textarea.d.ts.map +1 -1
  105. package/dist/components/ui/toggle/index.d.ts.map +1 -1
  106. package/dist/components/ui/toggle/toggle.d.ts +1 -1
  107. package/dist/components/ui/toggle/toggle.d.ts.map +1 -1
  108. package/dist/components/ui/tooltip/index.d.ts +1 -1
  109. package/dist/components/ui/tooltip/index.d.ts.map +1 -1
  110. package/dist/components/ui/tooltip/tooltip.d.ts +1 -1
  111. package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
  112. package/dist/index.d.ts.map +1 -1
  113. package/dist/index.js +12 -12
  114. package/dist/index10.js +42 -44
  115. package/dist/index100.js +4 -13
  116. package/dist/index101.js +30 -9
  117. package/dist/index102.js +13 -30
  118. package/dist/index103.js +649 -3
  119. package/dist/index104.js +30 -25
  120. package/dist/index105.js +3 -5
  121. package/dist/index106.js +44 -51
  122. package/dist/index107.js +30 -30
  123. package/dist/index108.js +55 -30
  124. package/dist/index109.js +29 -47
  125. package/dist/index11.js +5 -11
  126. package/dist/index110.js +44 -646
  127. package/dist/index113.js +47 -11
  128. package/dist/index114.js +42 -200
  129. package/dist/index115.js +12 -22
  130. package/dist/index116.js +194 -388
  131. package/dist/index117.js +21 -47
  132. package/dist/index118.js +392 -40
  133. package/dist/index119.js +6 -21
  134. package/dist/index12.js +2 -2
  135. package/dist/index120.js +48 -9
  136. package/dist/index121.js +15 -32
  137. package/dist/index122.js +3 -12
  138. package/dist/index123.js +38 -6
  139. package/dist/index124.js +18 -48
  140. package/dist/index126.js +3 -3
  141. package/dist/index127.js +3 -3
  142. package/dist/index129.js +1 -1
  143. package/dist/index13.js +2 -2
  144. package/dist/index130.js +1 -1
  145. package/dist/index131.js +2 -5
  146. package/dist/index132.js +2 -3
  147. package/dist/index133.js +5 -24
  148. package/dist/index134.js +3 -113
  149. package/dist/index135.js +23 -15
  150. package/dist/index136.js +107 -519
  151. package/dist/index137.js +14 -126
  152. package/dist/index138.js +516 -125
  153. package/dist/index139.js +128 -2
  154. package/dist/index14.js +4 -13
  155. package/dist/index140.js +134 -2
  156. package/dist/index141.js +65 -69
  157. package/dist/index142.js +68 -8
  158. package/dist/index143.js +9 -14
  159. package/dist/index144.js +14 -66
  160. package/dist/index145.js +65 -64
  161. package/dist/index15.js +43 -67
  162. package/dist/index16.js +3 -30
  163. package/dist/index17.js +75 -80
  164. package/dist/index18.js +11 -13
  165. package/dist/index19.js +4 -4
  166. package/dist/index20.js +5 -12
  167. package/dist/index21.js +15 -15
  168. package/dist/index22.js +21 -24
  169. package/dist/index23.js +7 -14
  170. package/dist/index24.js +11 -11
  171. package/dist/index25.js +66 -72
  172. package/dist/index26.js +15 -17
  173. package/dist/index27.js +57 -51
  174. package/dist/index28.js +2 -10
  175. package/dist/index29.js +9 -12
  176. package/dist/index3.js +18 -18
  177. package/dist/index30.js +27 -60
  178. package/dist/index31.js +15 -15
  179. package/dist/index32.js +24 -47
  180. package/dist/index33.js +16 -16
  181. package/dist/index34.js +1 -4
  182. package/dist/index36.js +11 -11
  183. package/dist/index37.js +21 -18
  184. package/dist/index38.js +99 -38
  185. package/dist/index39.js +37 -64
  186. package/dist/index4.js +24 -31
  187. package/dist/index40.js +10 -48
  188. package/dist/index41.js +48 -99
  189. package/dist/index42.js +65 -10
  190. package/dist/index45.js +237 -33
  191. package/dist/index46.js +11 -241
  192. package/dist/index47.js +33 -237
  193. package/dist/index48.js +241 -11
  194. package/dist/index49.js +16 -258
  195. package/dist/index5.js +13 -26
  196. package/dist/index50.js +125 -12
  197. package/dist/index51.js +25 -524
  198. package/dist/index52.js +71 -20
  199. package/dist/index53.js +206 -131
  200. package/dist/index54.js +11 -73
  201. package/dist/index55.js +54 -330
  202. package/dist/index56.js +249 -231
  203. package/dist/index57.js +225 -11
  204. package/dist/index58.js +9 -82
  205. package/dist/index59.js +11 -249
  206. package/dist/index6.js +66 -36
  207. package/dist/index60.js +130 -9
  208. package/dist/index61.js +21 -129
  209. package/dist/index62.js +860 -18
  210. package/dist/index63.js +9 -860
  211. package/dist/index64.js +82 -9
  212. package/dist/index65.js +256 -27
  213. package/dist/index66.js +12 -435
  214. package/dist/index67.js +244 -55
  215. package/dist/index68.js +7 -7
  216. package/dist/index69.js +511 -206
  217. package/dist/index7.js +5 -5
  218. package/dist/index70.js +5 -4
  219. package/dist/index71.js +435 -12
  220. package/dist/index72.js +318 -107
  221. package/dist/index73.js +3 -3
  222. package/dist/index74.js +1 -1
  223. package/dist/index75.js +156 -249
  224. package/dist/index76.js +66 -5
  225. package/dist/index77.js +44 -25
  226. package/dist/index78.js +23 -64
  227. package/dist/index79.js +5 -123
  228. package/dist/index8.js +5 -5
  229. package/dist/index80.js +50 -13
  230. package/dist/index81.js +32 -133
  231. package/dist/index82.js +1 -1
  232. package/dist/index83.js +7 -218
  233. package/dist/index84.js +124 -13
  234. package/dist/index85.js +13 -67
  235. package/dist/index86.js +133 -32
  236. package/dist/index87.js +216 -45
  237. package/dist/index88.js +14 -52
  238. package/dist/index89.js +66 -47
  239. package/dist/index9.js +19 -26
  240. package/dist/index90.js +48 -9
  241. package/dist/index91.js +49 -45
  242. package/dist/index92.js +9 -8
  243. package/dist/index93.js +29 -47
  244. package/dist/index94.js +9 -30
  245. package/dist/index95.js +8 -8
  246. package/dist/index96.js +24 -54
  247. package/dist/index97.js +5 -10
  248. package/dist/index98.js +55 -4
  249. package/dist/index99.js +11 -30
  250. package/dist/lib/utils.d.ts.map +1 -1
  251. package/dist/tokens/animations.d.ts.map +1 -1
  252. package/dist/tokens/colors.d.ts.map +1 -1
  253. package/dist/tokens/index.d.ts +3 -3
  254. package/dist/tokens/index.d.ts.map +1 -1
  255. package/dist/tokens/shadows.d.ts.map +1 -1
  256. package/dist/tokens/spacing.d.ts.map +1 -1
  257. package/dist/tokens/typography.d.ts.map +1 -1
  258. package/package.json +19 -9
package/dist/index6.js CHANGED
@@ -1,51 +1,81 @@
1
- import { jsx as o, jsxs as g } from "react/jsx-runtime";
2
- import * as l from "react";
3
- import { Root as N, Portal as y, Trigger as x, Overlay as i, Content as r, Title as d, Description as n, Action as m, Cancel as c } from "./index72.js";
4
- import { cn as s } from "./index2.js";
1
+ import { jsx as l, jsxs as g } from "react/jsx-runtime";
2
+ import { Root as N, Portal as y, Trigger as x, Action as r, Cancel as i, Content as m, Description as n, Overlay as c, Title as d } from "./index50.js";
3
+ import * as s from "react";
4
+ import { cn as o } from "./index2.js";
5
5
  import { buttonVariants as f } from "./index9.js";
6
- const P = N, k = x, D = y, p = l.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o(
7
- i,
6
+ const h = N, k = x, D = y, p = s.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ l(
7
+ c,
8
8
  {
9
- className: s("fixed inset-0 z-50 bg-black data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", a),
10
- ...t,
11
- ref: e
9
+ className: o("fixed inset-0 z-50 bg-black data-[state=closed]:hidden", e),
10
+ ...a,
11
+ ref: t
12
12
  }
13
13
  ));
14
- p.displayName = i.displayName;
15
- const A = l.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ g(D, { children: [
16
- /* @__PURE__ */ o(p, {}),
17
- /* @__PURE__ */ o(
18
- r,
14
+ p.displayName = c.displayName;
15
+ const A = s.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ g(D, { children: [
16
+ /* @__PURE__ */ l(p, {}),
17
+ /* @__PURE__ */ l(
18
+ m,
19
19
  {
20
- ref: e,
21
- className: s("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border-2 bg-black p-6 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]", a),
22
- ...t
20
+ ref: t,
21
+ className: o(
22
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border-2 bg-black p-6",
23
+ e
24
+ ),
25
+ ...a
23
26
  }
24
27
  )
25
28
  ] }));
26
- A.displayName = r.displayName;
27
- const u = ({ className: a, ...t }) => /* @__PURE__ */ o("div", { className: s("flex flex-col space-y-2 text-center sm:text-left", a), ...t });
28
- u.displayName = "AlertDialogHeader";
29
- const w = ({ className: a, ...t }) => /* @__PURE__ */ o("div", { className: s("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", a), ...t });
30
- w.displayName = "AlertDialogFooter";
31
- const R = l.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o(d, { ref: e, className: s("text-lg font-semibold", a), ...t }));
32
- R.displayName = d.displayName;
33
- const b = l.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o(n, { ref: e, className: s("text-sm text-muted-foreground", a), ...t }));
34
- b.displayName = n.displayName;
35
- const v = l.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o(m, { ref: e, className: s(f(), a), ...t }));
36
- v.displayName = m.displayName;
37
- const T = l.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o(c, { ref: e, className: s(f({ variant: "outline" }), "mt-2 sm:mt-0", a), ...t }));
38
- T.displayName = c.displayName;
29
+ A.displayName = m.displayName;
30
+ const w = ({ className: e, ...a }) => /* @__PURE__ */ l("div", { className: o("flex flex-col space-y-2 text-center sm:text-left", e), ...a });
31
+ w.displayName = "AlertDialogHeader";
32
+ const R = ({ className: e, ...a }) => /* @__PURE__ */ l(
33
+ "div",
34
+ {
35
+ className: o("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e),
36
+ ...a
37
+ }
38
+ );
39
+ R.displayName = "AlertDialogFooter";
40
+ const b = s.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ l(
41
+ d,
42
+ {
43
+ ref: t,
44
+ className: o("text-lg font-semibold", e),
45
+ ...a
46
+ }
47
+ ));
48
+ b.displayName = d.displayName;
49
+ const v = s.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ l(
50
+ n,
51
+ {
52
+ ref: t,
53
+ className: o("text-sm text-muted-foreground", e),
54
+ ...a
55
+ }
56
+ ));
57
+ v.displayName = n.displayName;
58
+ const u = s.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ l(r, { ref: t, className: o(f(), e), ...a }));
59
+ u.displayName = r.displayName;
60
+ const T = s.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ l(
61
+ i,
62
+ {
63
+ ref: t,
64
+ className: o(f({ variant: "outline" }), "mt-2 sm:mt-0", e),
65
+ ...a
66
+ }
67
+ ));
68
+ T.displayName = i.displayName;
39
69
  export {
40
- P as AlertDialog,
41
- v as AlertDialogAction,
70
+ h as AlertDialog,
71
+ u as AlertDialogAction,
42
72
  T as AlertDialogCancel,
43
73
  A as AlertDialogContent,
44
- b as AlertDialogDescription,
45
- w as AlertDialogFooter,
46
- u as AlertDialogHeader,
74
+ v as AlertDialogDescription,
75
+ R as AlertDialogFooter,
76
+ w as AlertDialogHeader,
47
77
  p as AlertDialogOverlay,
48
78
  D as AlertDialogPortal,
49
- R as AlertDialogTitle,
79
+ b as AlertDialogTitle,
50
80
  k as AlertDialogTrigger
51
81
  };
package/dist/index60.js CHANGED
@@ -1,11 +1,132 @@
1
- import e from "./index119.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 t = e("Check", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]);
1
+ import * as r from "react";
2
+ import { composeEventHandlers as T } from "./index79.js";
3
+ import { useComposedRefs as P } from "./index78.js";
4
+ import { createContextScope as I } from "./index76.js";
5
+ import { useControllableState as M } from "./index80.js";
6
+ import { usePrevious as H } from "./index97.js";
7
+ import { useSize as j } from "./index96.js";
8
+ import { Primitive as y } from "./index81.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) => {
12
+ const {
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
28
+ });
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
+ ] });
63
+ }
64
+ );
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,
71
+ {
72
+ "data-state": g(o.checked),
73
+ "data-disabled": o.disabled ? "" : void 0,
74
+ ...c,
75
+ ref: a
76
+ }
77
+ );
78
+ }
79
+ );
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);
100
+ }
101
+ }, [p, e, c]), /* @__PURE__ */ m(
102
+ "input",
103
+ {
104
+ type: "checkbox",
105
+ "aria-hidden": !0,
106
+ defaultChecked: e,
107
+ ...o,
108
+ tabIndex: -1,
109
+ ref: n,
110
+ style: {
111
+ ...o.style,
112
+ ...w,
113
+ position: "absolute",
114
+ pointerEvents: "none",
115
+ opacity: 0,
116
+ margin: 0
117
+ }
118
+ }
119
+ );
120
+ }
121
+ );
122
+ x.displayName = L;
123
+ function g(t) {
124
+ return t ? "checked" : "unchecked";
125
+ }
126
+ var Q = R, V = _;
9
127
  export {
10
- t as default
128
+ Q as Root,
129
+ R as Switch,
130
+ _ as SwitchThumb,
131
+ V as Thumb
11
132
  };
package/dist/index61.js CHANGED
@@ -1,132 +1,24 @@
1
- import * as r from "react";
2
- import { composeEventHandlers as T } from "./index76.js";
3
- import { useComposedRefs as P } from "./index77.js";
4
- import { createContextScope as I } from "./index78.js";
5
- import { useControllableState as M } from "./index88.js";
6
- import { usePrevious as H } from "./index105.js";
7
- import { useSize as j } from "./index104.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) => {
12
- const {
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
28
- });
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
- ] });
63
- }
64
- );
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,
71
- {
72
- "data-state": g(o.checked),
73
- "data-disabled": o.disabled ? "" : void 0,
74
- ...c,
75
- ref: a
76
- }
77
- );
78
- }
79
- );
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);
100
- }
101
- }, [p, e, c]), /* @__PURE__ */ m(
102
- "input",
103
- {
104
- type: "checkbox",
105
- "aria-hidden": !0,
106
- defaultChecked: e,
107
- ...o,
108
- tabIndex: -1,
109
- ref: n,
110
- style: {
111
- ...o.style,
112
- ...w,
113
- position: "absolute",
114
- pointerEvents: "none",
115
- opacity: 0,
116
- margin: 0
117
- }
118
- }
119
- );
120
- }
121
- );
122
- x.displayName = L;
123
- function g(t) {
124
- return t ? "checked" : "unchecked";
1
+ import * as p from "react";
2
+ import { Primitive as v } from "./index104.js";
3
+ import { jsx as m } from "react/jsx-runtime";
4
+ var d = "Separator", a = "horizontal", l = ["horizontal", "vertical"], i = p.forwardRef((r, n) => {
5
+ const { decorative: e, orientation: t = a, ...s } = r, o = f(t) ? t : a, c = e ? { role: "none" } : { "aria-orientation": o === "vertical" ? o : void 0, role: "separator" };
6
+ return /* @__PURE__ */ m(
7
+ v.div,
8
+ {
9
+ "data-orientation": o,
10
+ ...c,
11
+ ...s,
12
+ ref: n
13
+ }
14
+ );
15
+ });
16
+ i.displayName = d;
17
+ function f(r) {
18
+ return l.includes(r);
125
19
  }
126
- var Q = R, V = _;
20
+ var T = i;
127
21
  export {
128
- Q as Root,
129
- R as Switch,
130
- _ as SwitchThumb,
131
- V as Thumb
22
+ T as Root,
23
+ i as Separator
132
24
  };