@drjoshcsimmons/scl 0.2.7 → 0.3.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 (231) hide show
  1. package/dist/components/ui/accordion/accordion.d.ts.map +1 -1
  2. package/dist/components/ui/alert/alert.d.ts +5 -4
  3. package/dist/components/ui/alert/alert.d.ts.map +1 -1
  4. package/dist/components/ui/alert/index.d.ts +1 -1
  5. package/dist/components/ui/alert/index.d.ts.map +1 -1
  6. package/dist/components/ui/avatar/avatar.d.ts.map +1 -1
  7. package/dist/components/ui/badge/badge.d.ts +4 -6
  8. package/dist/components/ui/badge/badge.d.ts.map +1 -1
  9. package/dist/components/ui/badge/index.d.ts +1 -1
  10. package/dist/components/ui/badge/index.d.ts.map +1 -1
  11. package/dist/components/ui/button/button.d.ts +6 -7
  12. package/dist/components/ui/button/button.d.ts.map +1 -1
  13. package/dist/components/ui/button/index.d.ts +1 -1
  14. package/dist/components/ui/button/index.d.ts.map +1 -1
  15. package/dist/components/ui/card/card.d.ts.map +1 -1
  16. package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
  17. package/dist/components/ui/collapsible/collapsible.d.ts.map +1 -1
  18. package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
  19. package/dist/components/ui/input/input.d.ts.map +1 -1
  20. package/dist/components/ui/label/label.d.ts +1 -2
  21. package/dist/components/ui/label/label.d.ts.map +1 -1
  22. package/dist/components/ui/popover/popover.d.ts.map +1 -1
  23. package/dist/components/ui/progress/progress.d.ts +0 -3
  24. package/dist/components/ui/progress/progress.d.ts.map +1 -1
  25. package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
  26. package/dist/components/ui/scroll-area/scroll-area.d.ts.map +1 -1
  27. package/dist/components/ui/select/select.d.ts.map +1 -1
  28. package/dist/components/ui/separator/separator.d.ts.map +1 -1
  29. package/dist/components/ui/skeleton/skeleton.d.ts +1 -0
  30. package/dist/components/ui/skeleton/skeleton.d.ts.map +1 -1
  31. package/dist/components/ui/slider/slider.d.ts.map +1 -1
  32. package/dist/components/ui/switch/switch.d.ts.map +1 -1
  33. package/dist/components/ui/table/table.d.ts.map +1 -1
  34. package/dist/components/ui/tabs/tabs.d.ts.map +1 -1
  35. package/dist/components/ui/textarea/textarea.d.ts.map +1 -1
  36. package/dist/components/ui/toggle/index.d.ts +1 -1
  37. package/dist/components/ui/toggle/index.d.ts.map +1 -1
  38. package/dist/components/ui/toggle/toggle.d.ts +6 -10
  39. package/dist/components/ui/toggle/toggle.d.ts.map +1 -1
  40. package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
  41. package/dist/globals.css +222 -287
  42. package/dist/index.d.ts +1 -10
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +115 -184
  45. package/dist/index10.js +29 -57
  46. package/dist/index100.js +5 -14
  47. package/dist/index101.js +45 -5
  48. package/dist/index102.js +54 -24
  49. package/dist/index103.js +30 -55
  50. package/dist/index104.js +1 -1
  51. package/dist/index105.js +3 -218
  52. package/dist/index106.js +218 -8
  53. package/dist/index107.js +47 -29
  54. package/dist/index108.js +27 -178
  55. package/dist/index109.js +44 -646
  56. package/dist/index11.js +6 -19
  57. package/dist/index110.js +9 -30
  58. package/dist/index111.js +6 -48
  59. package/dist/index112.js +1 -1
  60. package/dist/index113.js +12 -6
  61. package/dist/index114.js +1 -1
  62. package/dist/index115.js +200 -42
  63. package/dist/index116.js +22 -12
  64. package/dist/index117.js +399 -20
  65. package/dist/index118.js +2 -9
  66. package/dist/index119.js +50 -35
  67. package/dist/index12.js +80 -5
  68. package/dist/index120.js +62 -15
  69. package/dist/index121.js +22 -203
  70. package/dist/index122.js +27 -20
  71. package/dist/index123.js +5 -400
  72. package/dist/index124.js +2 -48
  73. package/dist/index125.js +2 -2
  74. package/dist/index126.js +5 -53
  75. package/dist/index127.js +3 -65
  76. package/dist/index128.js +22 -23
  77. package/dist/index129.js +111 -27
  78. package/dist/index13.js +16 -136
  79. package/dist/index130.js +16 -5
  80. package/dist/index131.js +525 -2
  81. package/dist/index132.js +128 -2
  82. package/dist/index133.js +134 -5
  83. package/dist/index134.js +65 -3
  84. package/dist/index135.js +69 -24
  85. package/dist/index136.js +9 -113
  86. package/dist/index137.js +14 -16
  87. package/dist/index138.js +64 -523
  88. package/dist/index139.js +3 -127
  89. package/dist/index14.js +11 -97
  90. package/dist/index140.js +22 -133
  91. package/dist/index141.js +12 -68
  92. package/dist/index142.js +26 -7
  93. package/dist/index143.js +5 -14
  94. package/dist/index144.js +22 -65
  95. package/dist/index15.js +18 -72
  96. package/dist/index16.js +30 -252
  97. package/dist/index17.js +20 -133
  98. package/dist/index18.js +37 -89
  99. package/dist/index19.js +138 -18
  100. package/dist/index2.js +5 -5
  101. package/dist/index20.js +21 -10
  102. package/dist/index21.js +13 -22
  103. package/dist/index22.js +24 -35
  104. package/dist/index23.js +13 -19
  105. package/dist/index24.js +32 -37
  106. package/dist/index25.js +23 -102
  107. package/dist/index26.js +16 -20
  108. package/dist/index27.js +11 -72
  109. package/dist/index28.js +24 -12
  110. package/dist/index29.js +99 -28
  111. package/dist/index3.js +6 -6
  112. package/dist/index30.js +39 -111
  113. package/dist/index31.js +11 -25
  114. package/dist/index32.js +49 -65
  115. package/dist/index33.js +65 -43
  116. package/dist/index34.js +230 -79
  117. package/dist/index36.js +58 -33
  118. package/dist/index4.js +42 -26
  119. package/dist/index41.js +73 -49
  120. package/dist/index43.js +159 -13
  121. package/dist/index45.js +232 -210
  122. package/dist/index47.js +18 -33
  123. package/dist/index5.js +21 -32
  124. package/dist/index50.js +211 -505
  125. package/dist/index52.js +31 -12
  126. package/dist/index55.js +860 -12
  127. package/dist/index57.js +71 -299
  128. package/dist/index59.js +21 -81
  129. package/dist/index6.js +26 -70
  130. package/dist/index61.js +487 -392
  131. package/dist/index63.js +210 -194
  132. package/dist/index65.js +435 -11
  133. package/dist/index67.js +98 -141
  134. package/dist/index69.js +213 -824
  135. package/dist/index7.js +7 -40
  136. package/dist/index71.js +333 -28
  137. package/dist/index73.js +91 -197
  138. package/dist/index77.js +25 -44
  139. package/dist/index78.js +52 -24
  140. package/dist/index79.js +10 -6
  141. package/dist/index8.js +20 -26
  142. package/dist/index80.js +4 -52
  143. package/dist/index81.js +8 -12
  144. package/dist/index82.js +12 -10
  145. package/dist/index83.js +30 -8
  146. package/dist/index84.js +5 -53
  147. package/dist/index85.js +67 -10
  148. package/dist/index86.js +180 -3
  149. package/dist/index87.js +68 -29
  150. package/dist/index88.js +33 -12
  151. package/dist/index89.js +7 -8
  152. package/dist/index9.js +33 -36
  153. package/dist/index90.js +48 -65
  154. package/dist/index91.js +10 -3
  155. package/dist/index92.js +5 -5
  156. package/dist/index93.js +3 -3
  157. package/dist/index94.js +2 -2
  158. package/dist/index96.js +3 -3
  159. package/dist/index98.js +1 -1
  160. package/dist/index99.js +25 -30
  161. package/dist/lib/utils.d.ts +8 -8
  162. package/dist/lib/utils.d.ts.map +1 -1
  163. package/package.json +5 -46
  164. package/dist/components/ui/alert-dialog/alert-dialog.d.ts +0 -21
  165. package/dist/components/ui/alert-dialog/alert-dialog.d.ts.map +0 -1
  166. package/dist/components/ui/alert-dialog/index.d.ts +0 -2
  167. package/dist/components/ui/alert-dialog/index.d.ts.map +0 -1
  168. package/dist/components/ui/combobox/combobox.d.ts +0 -31
  169. package/dist/components/ui/combobox/combobox.d.ts.map +0 -1
  170. package/dist/components/ui/combobox/index.d.ts +0 -3
  171. package/dist/components/ui/combobox/index.d.ts.map +0 -1
  172. package/dist/components/ui/command/command.d.ts +0 -85
  173. package/dist/components/ui/command/command.d.ts.map +0 -1
  174. package/dist/components/ui/command/index.d.ts +0 -2
  175. package/dist/components/ui/command/index.d.ts.map +0 -1
  176. package/dist/components/ui/dithered-image/dithered-image.d.ts +0 -21
  177. package/dist/components/ui/dithered-image/dithered-image.d.ts.map +0 -1
  178. package/dist/components/ui/dithered-image/index.d.ts +0 -3
  179. package/dist/components/ui/dithered-image/index.d.ts.map +0 -1
  180. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +0 -28
  181. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +0 -1
  182. package/dist/components/ui/dropdown-menu/index.d.ts +0 -2
  183. package/dist/components/ui/dropdown-menu/index.d.ts.map +0 -1
  184. package/dist/components/ui/form/form.d.ts +0 -24
  185. package/dist/components/ui/form/form.d.ts.map +0 -1
  186. package/dist/components/ui/form/index.d.ts +0 -2
  187. package/dist/components/ui/form/index.d.ts.map +0 -1
  188. package/dist/components/ui/sheet/index.d.ts +0 -2
  189. package/dist/components/ui/sheet/index.d.ts.map +0 -1
  190. package/dist/components/ui/sheet/sheet.d.ts +0 -26
  191. package/dist/components/ui/sheet/sheet.d.ts.map +0 -1
  192. package/dist/components/ui/statusline/index.d.ts +0 -2
  193. package/dist/components/ui/statusline/index.d.ts.map +0 -1
  194. package/dist/components/ui/statusline/statusline.d.ts +0 -40
  195. package/dist/components/ui/statusline/statusline.d.ts.map +0 -1
  196. package/dist/components/ui/terminal-textarea/index.d.ts +0 -2
  197. package/dist/components/ui/terminal-textarea/index.d.ts.map +0 -1
  198. package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts +0 -16
  199. package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts.map +0 -1
  200. package/dist/index145.js +0 -67
  201. package/dist/index146.js +0 -6
  202. package/dist/index147.js +0 -25
  203. package/dist/index148.js +0 -15
  204. package/dist/index149.js +0 -30
  205. package/dist/index150.js +0 -7
  206. package/dist/index151.js +0 -25
  207. package/dist/index35.js +0 -20
  208. package/dist/index37.js +0 -28
  209. package/dist/index38.js +0 -102
  210. package/dist/index39.js +0 -41
  211. package/dist/index40.js +0 -13
  212. package/dist/index42.js +0 -68
  213. package/dist/index44.js +0 -2265
  214. package/dist/index46.js +0 -13
  215. package/dist/index48.js +0 -75
  216. package/dist/index49.js +0 -127
  217. package/dist/index51.js +0 -262
  218. package/dist/index53.js +0 -62
  219. package/dist/index54.js +0 -20
  220. package/dist/index56.js +0 -11
  221. package/dist/index58.js +0 -14
  222. package/dist/index60.js +0 -132
  223. package/dist/index62.js +0 -251
  224. package/dist/index64.js +0 -13
  225. package/dist/index66.js +0 -338
  226. package/dist/index68.js +0 -24
  227. package/dist/index70.js +0 -11
  228. package/dist/index72.js +0 -256
  229. package/dist/index74.js +0 -120
  230. package/dist/index75.js +0 -243
  231. package/dist/index76.js +0 -70
package/dist/index45.js CHANGED
@@ -1,239 +1,261 @@
1
- import s from "react";
2
- import { createContextScope as X } from "./index76.js";
3
- import { createCollection as Z } from "./index77.js";
4
- import { useComposedRefs as $ } from "./index78.js";
5
- import { composeEventHandlers as ee } from "./index79.js";
6
- import { useControllableState as M } from "./index80.js";
7
- import { Primitive as V } from "./index81.js";
8
- import { createCollapsibleScope as H, Content as oe, Root as re, Trigger as te } from "./index74.js";
9
- import { useId as ne } from "./index82.js";
10
- import { useDirection as ce } from "./index83.js";
11
- import { jsx as n } from "react/jsx-runtime";
12
- var d = "Accordion", ie = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"], [E, ae, le] = Z(d), [b] = X(d, [
13
- le,
14
- H
15
- ]), S = H(), K = s.forwardRef(
16
- (o, c) => {
17
- const { type: e, ...t } = o, i = t, r = t;
18
- return /* @__PURE__ */ n(E.Provider, { scope: o.__scopeAccordion, children: e === "multiple" ? /* @__PURE__ */ n(fe, { ...r, ref: c }) : /* @__PURE__ */ n(pe, { ...i, ref: c }) });
19
- }
20
- );
21
- K.displayName = d;
22
- var [L, se] = b(d), [z, de] = b(
23
- d,
24
- { collapsible: !1 }
25
- ), pe = s.forwardRef(
26
- (o, c) => {
27
- const {
28
- value: e,
29
- defaultValue: t,
30
- onValueChange: i = () => {
31
- },
32
- collapsible: r = !1,
33
- ...l
34
- } = o, [a, p] = M({
35
- prop: e,
36
- defaultProp: t ?? "",
37
- onChange: i,
38
- caller: d
39
- });
40
- return /* @__PURE__ */ n(
41
- L,
42
- {
43
- scope: o.__scopeAccordion,
44
- value: s.useMemo(() => a ? [a] : [], [a]),
45
- onItemOpen: p,
46
- onItemClose: s.useCallback(() => r && p(""), [r, p]),
47
- children: /* @__PURE__ */ n(z, { scope: o.__scopeAccordion, collapsible: r, children: /* @__PURE__ */ n(G, { ...l, ref: c }) })
48
- }
49
- );
50
- }
51
- ), fe = s.forwardRef((o, c) => {
1
+ import * as s from "react";
2
+ import { composeEventHandlers as p } from "./index84.js";
3
+ import { useComposedRefs as _ } from "./index77.js";
4
+ import { createContextScope as V, createContext as q } from "./index85.js";
5
+ import { useId as R } from "./index91.js";
6
+ import { useControllableState as K } from "./index90.js";
7
+ import { DismissableLayer as U } from "./index92.js";
8
+ import { FocusScope as Y } from "./index93.js";
9
+ import { Portal as Z } from "./index94.js";
10
+ import { Presence as h } from "./index87.js";
11
+ import { Primitive as m } from "./index88.js";
12
+ import { useFocusGuards as z } from "./index95.js";
13
+ import J from "./index96.js";
14
+ import { hideOthers as Q } from "./index97.js";
15
+ import { createSlot as X } from "./index98.js";
16
+ import { jsx as i, jsxs as P, Fragment as O } from "react/jsx-runtime";
17
+ var v = "Dialog", [I] = V(v), [ee, u] = I(v), x = (e) => {
52
18
  const {
53
- value: e,
54
- defaultValue: t,
55
- onValueChange: i = () => {
56
- },
57
- ...r
58
- } = o, [l, a] = M({
59
- prop: e,
60
- defaultProp: t ?? [],
61
- onChange: i,
62
- caller: d
63
- }), p = s.useCallback(
64
- (v) => a((u = []) => [...u, v]),
65
- [a]
66
- ), m = s.useCallback(
67
- (v) => a((u = []) => u.filter((h) => h !== v)),
68
- [a]
69
- );
70
- return /* @__PURE__ */ n(
71
- L,
19
+ __scopeDialog: o,
20
+ children: n,
21
+ open: a,
22
+ defaultOpen: r,
23
+ onOpenChange: t,
24
+ modal: c = !0
25
+ } = e, l = s.useRef(null), d = s.useRef(null), [g, C] = K({
26
+ prop: a,
27
+ defaultProp: r ?? !1,
28
+ onChange: t,
29
+ caller: v
30
+ });
31
+ return /* @__PURE__ */ i(
32
+ ee,
72
33
  {
73
- scope: o.__scopeAccordion,
74
- value: l,
75
- onItemOpen: p,
76
- onItemClose: m,
77
- children: /* @__PURE__ */ n(z, { scope: o.__scopeAccordion, collapsible: !0, children: /* @__PURE__ */ n(G, { ...r, ref: c }) })
34
+ scope: o,
35
+ triggerRef: l,
36
+ contentRef: d,
37
+ contentId: R(),
38
+ titleId: R(),
39
+ descriptionId: R(),
40
+ open: g,
41
+ onOpenChange: C,
42
+ onOpenToggle: s.useCallback(() => C((H) => !H), [C]),
43
+ modal: c,
44
+ children: n
78
45
  }
79
46
  );
80
- }), [ue, I] = b(d), G = s.forwardRef(
81
- (o, c) => {
82
- const { __scopeAccordion: e, disabled: t, dir: i, orientation: r = "vertical", ...l } = o, a = s.useRef(null), p = $(a, c), m = ae(e), u = ce(i) === "ltr", h = ee(o.onKeyDown, (C) => {
83
- var O;
84
- if (!ie.includes(C.key)) return;
85
- const Q = C.target, x = m().filter((N) => {
86
- var T;
87
- return !((T = N.ref.current) != null && T.disabled);
88
- }), A = x.findIndex((N) => N.ref.current === Q), D = x.length;
89
- if (A === -1) return;
90
- C.preventDefault();
91
- let f = A;
92
- const _ = 0, w = D - 1, R = () => {
93
- f = A + 1, f > w && (f = _);
94
- }, P = () => {
95
- f = A - 1, f < _ && (f = w);
96
- };
97
- switch (C.key) {
98
- case "Home":
99
- f = _;
100
- break;
101
- case "End":
102
- f = w;
103
- break;
104
- case "ArrowRight":
105
- r === "horizontal" && (u ? R() : P());
106
- break;
107
- case "ArrowDown":
108
- r === "vertical" && R();
109
- break;
110
- case "ArrowLeft":
111
- r === "horizontal" && (u ? P() : R());
112
- break;
113
- case "ArrowUp":
114
- r === "vertical" && P();
115
- break;
116
- }
117
- const W = f % D;
118
- (O = x[W].ref.current) == null || O.focus();
119
- });
120
- return /* @__PURE__ */ n(
121
- ue,
47
+ };
48
+ x.displayName = v;
49
+ var A = "DialogTrigger", T = s.forwardRef(
50
+ (e, o) => {
51
+ const { __scopeDialog: n, ...a } = e, r = u(A, n), t = _(o, r.triggerRef);
52
+ return /* @__PURE__ */ i(
53
+ m.button,
122
54
  {
123
- scope: e,
124
- disabled: t,
125
- direction: i,
126
- orientation: r,
127
- children: /* @__PURE__ */ n(E.Slot, { scope: e, children: /* @__PURE__ */ n(
128
- V.div,
129
- {
130
- ...l,
131
- "data-orientation": r,
132
- ref: p,
133
- onKeyDown: t ? void 0 : h
134
- }
135
- ) })
55
+ type: "button",
56
+ "aria-haspopup": "dialog",
57
+ "aria-expanded": r.open,
58
+ "aria-controls": r.contentId,
59
+ "data-state": N(r.open),
60
+ ...a,
61
+ ref: t,
62
+ onClick: p(e.onClick, r.onOpenToggle)
136
63
  }
137
64
  );
138
65
  }
139
- ), g = "AccordionItem", [me, k] = b(g), U = s.forwardRef(
140
- (o, c) => {
141
- const { __scopeAccordion: e, value: t, ...i } = o, r = I(g, e), l = se(g, e), a = S(e), p = ne(), m = t && l.value.includes(t) || !1, v = r.disabled || o.disabled;
142
- return /* @__PURE__ */ n(
143
- me,
66
+ );
67
+ T.displayName = A;
68
+ var E = "DialogPortal", [te, b] = I(E, {
69
+ forceMount: void 0
70
+ }), M = (e) => {
71
+ const { __scopeDialog: o, forceMount: n, children: a, container: r } = e, t = u(E, o);
72
+ return /* @__PURE__ */ i(te, { scope: o, forceMount: n, children: s.Children.map(a, (c) => /* @__PURE__ */ i(h, { present: n || t.open, children: /* @__PURE__ */ i(Z, { asChild: !0, container: r, children: c }) })) });
73
+ };
74
+ M.displayName = E;
75
+ var D = "DialogOverlay", w = s.forwardRef(
76
+ (e, o) => {
77
+ const n = b(D, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, t = u(D, e.__scopeDialog);
78
+ return t.modal ? /* @__PURE__ */ i(h, { present: a || t.open, children: /* @__PURE__ */ i(re, { ...r, ref: o }) }) : null;
79
+ }
80
+ );
81
+ w.displayName = D;
82
+ var oe = X("DialogOverlay.RemoveScroll"), re = s.forwardRef(
83
+ (e, o) => {
84
+ const { __scopeDialog: n, ...a } = e, r = u(D, n);
85
+ return (
86
+ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
87
+ // ie. when `Overlay` and `Content` are siblings
88
+ /* @__PURE__ */ i(J, { as: oe, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ i(
89
+ m.div,
90
+ {
91
+ "data-state": N(r.open),
92
+ ...a,
93
+ ref: o,
94
+ style: { pointerEvents: "auto", ...a.style }
95
+ }
96
+ ) })
97
+ );
98
+ }
99
+ ), f = "DialogContent", F = s.forwardRef(
100
+ (e, o) => {
101
+ const n = b(f, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, t = u(f, e.__scopeDialog);
102
+ return /* @__PURE__ */ i(h, { present: a || t.open, children: t.modal ? /* @__PURE__ */ i(ne, { ...r, ref: o }) : /* @__PURE__ */ i(ae, { ...r, ref: o }) });
103
+ }
104
+ );
105
+ F.displayName = f;
106
+ var ne = s.forwardRef(
107
+ (e, o) => {
108
+ const n = u(f, e.__scopeDialog), a = s.useRef(null), r = _(o, n.contentRef, a);
109
+ return s.useEffect(() => {
110
+ const t = a.current;
111
+ if (t) return Q(t);
112
+ }, []), /* @__PURE__ */ i(
113
+ S,
144
114
  {
145
- scope: e,
146
- open: m,
147
- disabled: v,
148
- triggerId: p,
149
- children: /* @__PURE__ */ n(
150
- re,
151
- {
152
- "data-orientation": r.orientation,
153
- "data-state": J(m),
154
- ...a,
155
- ...i,
156
- ref: c,
157
- disabled: v,
158
- open: m,
159
- onOpenChange: (u) => {
160
- u ? l.onItemOpen(t) : l.onItemClose(t);
161
- }
162
- }
115
+ ...e,
116
+ ref: r,
117
+ trapFocus: n.open,
118
+ disableOutsidePointerEvents: !0,
119
+ onCloseAutoFocus: p(e.onCloseAutoFocus, (t) => {
120
+ var c;
121
+ t.preventDefault(), (c = n.triggerRef.current) == null || c.focus();
122
+ }),
123
+ onPointerDownOutside: p(e.onPointerDownOutside, (t) => {
124
+ const c = t.detail.originalEvent, l = c.button === 0 && c.ctrlKey === !0;
125
+ (c.button === 2 || l) && t.preventDefault();
126
+ }),
127
+ onFocusOutside: p(
128
+ e.onFocusOutside,
129
+ (t) => t.preventDefault()
163
130
  )
164
131
  }
165
132
  );
166
133
  }
167
- );
168
- U.displayName = g;
169
- var j = "AccordionHeader", Y = s.forwardRef(
170
- (o, c) => {
171
- const { __scopeAccordion: e, ...t } = o, i = I(d, e), r = k(j, e);
172
- return /* @__PURE__ */ n(
173
- V.h3,
134
+ ), ae = s.forwardRef(
135
+ (e, o) => {
136
+ const n = u(f, e.__scopeDialog), a = s.useRef(!1), r = s.useRef(!1);
137
+ return /* @__PURE__ */ i(
138
+ S,
174
139
  {
175
- "data-orientation": i.orientation,
176
- "data-state": J(r.open),
177
- "data-disabled": r.disabled ? "" : void 0,
178
- ...t,
179
- ref: c
140
+ ...e,
141
+ ref: o,
142
+ trapFocus: !1,
143
+ disableOutsidePointerEvents: !1,
144
+ onCloseAutoFocus: (t) => {
145
+ var c, l;
146
+ (c = e.onCloseAutoFocus) == null || c.call(e, t), t.defaultPrevented || (a.current || (l = n.triggerRef.current) == null || l.focus(), t.preventDefault()), a.current = !1, r.current = !1;
147
+ },
148
+ onInteractOutside: (t) => {
149
+ var d, g;
150
+ (d = e.onInteractOutside) == null || d.call(e, t), t.defaultPrevented || (a.current = !0, t.detail.originalEvent.type === "pointerdown" && (r.current = !0));
151
+ const c = t.target;
152
+ ((g = n.triggerRef.current) == null ? void 0 : g.contains(c)) && t.preventDefault(), t.detail.originalEvent.type === "focusin" && r.current && t.preventDefault();
153
+ }
180
154
  }
181
155
  );
182
156
  }
157
+ ), S = s.forwardRef(
158
+ (e, o) => {
159
+ const { __scopeDialog: n, trapFocus: a, onOpenAutoFocus: r, onCloseAutoFocus: t, ...c } = e, l = u(f, n), d = s.useRef(null), g = _(o, d);
160
+ return z(), /* @__PURE__ */ P(O, { children: [
161
+ /* @__PURE__ */ i(
162
+ Y,
163
+ {
164
+ asChild: !0,
165
+ loop: !0,
166
+ trapped: a,
167
+ onMountAutoFocus: r,
168
+ onUnmountAutoFocus: t,
169
+ children: /* @__PURE__ */ i(
170
+ U,
171
+ {
172
+ role: "dialog",
173
+ id: l.contentId,
174
+ "aria-describedby": l.descriptionId,
175
+ "aria-labelledby": l.titleId,
176
+ "data-state": N(l.open),
177
+ ...c,
178
+ ref: g,
179
+ onDismiss: () => l.onOpenChange(!1)
180
+ }
181
+ )
182
+ }
183
+ ),
184
+ /* @__PURE__ */ P(O, { children: [
185
+ /* @__PURE__ */ i(ie, { titleId: l.titleId }),
186
+ /* @__PURE__ */ i(ce, { contentRef: d, descriptionId: l.descriptionId })
187
+ ] })
188
+ ] });
189
+ }
190
+ ), y = "DialogTitle", W = s.forwardRef(
191
+ (e, o) => {
192
+ const { __scopeDialog: n, ...a } = e, r = u(y, n);
193
+ return /* @__PURE__ */ i(m.h2, { id: r.titleId, ...a, ref: o });
194
+ }
183
195
  );
184
- Y.displayName = j;
185
- var y = "AccordionTrigger", q = s.forwardRef(
186
- (o, c) => {
187
- const { __scopeAccordion: e, ...t } = o, i = I(d, e), r = k(y, e), l = de(y, e), a = S(e);
188
- return /* @__PURE__ */ n(E.ItemSlot, { scope: e, children: /* @__PURE__ */ n(
189
- te,
190
- {
191
- "aria-disabled": r.open && !l.collapsible || void 0,
192
- "data-orientation": i.orientation,
193
- id: r.triggerId,
194
- ...a,
195
- ...t,
196
- ref: c
197
- }
198
- ) });
196
+ W.displayName = y;
197
+ var k = "DialogDescription", G = s.forwardRef(
198
+ (e, o) => {
199
+ const { __scopeDialog: n, ...a } = e, r = u(k, n);
200
+ return /* @__PURE__ */ i(m.p, { id: r.descriptionId, ...a, ref: o });
199
201
  }
200
202
  );
201
- q.displayName = y;
202
- var B = "AccordionContent", F = s.forwardRef(
203
- (o, c) => {
204
- const { __scopeAccordion: e, ...t } = o, i = I(d, e), r = k(B, e), l = S(e);
205
- return /* @__PURE__ */ n(
206
- oe,
203
+ G.displayName = k;
204
+ var L = "DialogClose", $ = s.forwardRef(
205
+ (e, o) => {
206
+ const { __scopeDialog: n, ...a } = e, r = u(L, n);
207
+ return /* @__PURE__ */ i(
208
+ m.button,
207
209
  {
208
- role: "region",
209
- "aria-labelledby": r.triggerId,
210
- "data-orientation": i.orientation,
211
- ...l,
212
- ...t,
213
- ref: c,
214
- style: {
215
- "--radix-accordion-content-height": "var(--radix-collapsible-content-height)",
216
- "--radix-accordion-content-width": "var(--radix-collapsible-content-width)",
217
- ...o.style
218
- }
210
+ type: "button",
211
+ ...a,
212
+ ref: o,
213
+ onClick: p(e.onClick, () => r.onOpenChange(!1))
219
214
  }
220
215
  );
221
216
  }
222
217
  );
223
- F.displayName = B;
224
- function J(o) {
225
- return o ? "open" : "closed";
218
+ $.displayName = L;
219
+ function N(e) {
220
+ return e ? "open" : "closed";
226
221
  }
227
- var Pe = K, Ne = U, ye = Y, Ee = q, Se = F;
222
+ var B = "DialogTitleWarning", [Ne, j] = q(B, {
223
+ contentName: f,
224
+ titleName: y,
225
+ docsSlug: "dialog"
226
+ }), ie = ({ titleId: e }) => {
227
+ const o = j(B), n = `\`${o.contentName}\` requires a \`${o.titleName}\` for the component to be accessible for screen reader users.
228
+
229
+ If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component.
230
+
231
+ For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;
232
+ return s.useEffect(() => {
233
+ e && (document.getElementById(e) || console.error(n));
234
+ }, [n, e]), null;
235
+ }, se = "DialogDescriptionWarning", ce = ({ contentRef: e, descriptionId: o }) => {
236
+ const a = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${j(se).contentName}}.`;
237
+ return s.useEffect(() => {
238
+ var t;
239
+ const r = (t = e.current) == null ? void 0 : t.getAttribute("aria-describedby");
240
+ o && r && (document.getElementById(o) || console.warn(a));
241
+ }, [a, e, o]), null;
242
+ }, Pe = x, Oe = T, Ie = M, xe = w, Ae = F, Te = W, be = G, Me = $;
228
243
  export {
229
- K as Accordion,
230
- F as AccordionContent,
231
- Y as AccordionHeader,
232
- U as AccordionItem,
233
- q as AccordionTrigger,
234
- Se as Content,
235
- ye as Header,
236
- Ne as Item,
244
+ Me as Close,
245
+ Ae as Content,
246
+ be as Description,
247
+ x as Dialog,
248
+ $ as DialogClose,
249
+ F as DialogContent,
250
+ G as DialogDescription,
251
+ w as DialogOverlay,
252
+ M as DialogPortal,
253
+ W as DialogTitle,
254
+ T as DialogTrigger,
255
+ xe as Overlay,
256
+ Ie as Portal,
237
257
  Pe as Root,
238
- Ee as Trigger
258
+ Te as Title,
259
+ Oe as Trigger,
260
+ Ne as WarningProvider
239
261
  };
package/dist/index47.js CHANGED
@@ -1,35 +1,20 @@
1
- import { clsx as O } from "./index43.js";
2
- const m = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, y = O, j = (e, l) => (n) => {
3
- var s;
4
- if ((l == null ? void 0 : l.variants) == null) return y(e, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
5
- const { variants: r, defaultVariants: d } = l, V = Object.keys(r).map((t) => {
6
- const a = n == null ? void 0 : n[t], u = d == null ? void 0 : d[t];
7
- if (a === null) return null;
8
- const i = m(a) || m(u);
9
- return r[t][i];
10
- }), v = n && Object.entries(n).reduce((t, a) => {
11
- let [u, i] = a;
12
- return i === void 0 || (t[u] = i), t;
13
- }, {}), N = l == null || (s = l.compoundVariants) === null || s === void 0 ? void 0 : s.reduce((t, a) => {
14
- let { class: u, className: i, ...f } = a;
15
- return Object.entries(f).every((C) => {
16
- let [c, o] = C;
17
- return Array.isArray(o) ? o.includes({
18
- ...d,
19
- ...v
20
- }[c]) : {
21
- ...d,
22
- ...v
23
- }[c] === o;
24
- }) ? [
25
- ...t,
26
- u,
27
- i
28
- ] : t;
29
- }, []);
30
- return y(e, V, N, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
31
- };
1
+ import * as i from "react";
2
+ import { Primitive as f } from "./index83.js";
3
+ import { jsx as l } from "react/jsx-runtime";
4
+ var m = "Label", r = i.forwardRef((e, o) => /* @__PURE__ */ l(
5
+ f.label,
6
+ {
7
+ ...e,
8
+ ref: o,
9
+ onMouseDown: (t) => {
10
+ var a;
11
+ t.target.closest("button, input, select, textarea") || ((a = e.onMouseDown) == null || a.call(e, t), !t.defaultPrevented && t.detail > 1 && t.preventDefault());
12
+ }
13
+ }
14
+ ));
15
+ r.displayName = m;
16
+ var b = r;
32
17
  export {
33
- j as cva,
34
- y as cx
18
+ r as Label,
19
+ b as Root
35
20
  };
package/dist/index5.js CHANGED
@@ -1,38 +1,27 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { cva as i } from "./index47.js";
3
- import * as o from "react";
4
- import { cn as s } from "./index2.js";
5
- const n = i(
6
- "relative w-full px-4 py-3 text-sm font-medium [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg~*]:pl-7",
7
- {
8
- variants: {
9
- variant: {
10
- default: "bg-primary text-primary-foreground border-2 border-primary [&>svg]:text-primary-foreground",
11
- secondary: "bg-secondary text-secondary-foreground border-2 border-secondary [&>svg]:text-secondary-foreground",
12
- destructive: "bg-destructive text-destructive-foreground border-2 border-destructive [&>svg]:text-destructive-foreground"
13
- }
14
- },
15
- defaultVariants: {
16
- variant: "default"
17
- }
18
- }
19
- ), l = o.forwardRef(({ className: r, variant: e, ...t }, d) => /* @__PURE__ */ a("div", { ref: d, role: "alert", className: s(n({ variant: e }), r), ...t }));
20
- l.displayName = "Alert";
21
- const m = o.forwardRef(
22
- ({ className: r, ...e }, t) => /* @__PURE__ */ a(
23
- "h5",
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import * as a from "react";
3
+ import { cx as s } from "./index2.js";
4
+ /* empty css */
5
+ const o = a.forwardRef(
6
+ ({ className: e, variant: r = "default", ...t }, i) => /* @__PURE__ */ l(
7
+ "div",
24
8
  {
25
- ref: t,
26
- className: s("mb-1 font-medium leading-none tracking-tight", r),
27
- ...e
9
+ ref: i,
10
+ role: "alert",
11
+ className: s("scl-alert", `scl-alert--${r}`, e),
12
+ ...t
28
13
  }
29
14
  )
30
15
  );
31
- m.displayName = "AlertTitle";
32
- const c = o.forwardRef(({ className: r, ...e }, t) => /* @__PURE__ */ a("div", { ref: t, className: s("text-sm [&_p]:leading-relaxed", r), ...e }));
33
- c.displayName = "AlertDescription";
16
+ o.displayName = "Alert";
17
+ const c = a.forwardRef(
18
+ ({ className: e, ...r }, t) => /* @__PURE__ */ l("h5", { ref: t, className: s("scl-alert__title", e), ...r })
19
+ );
20
+ c.displayName = "AlertTitle";
21
+ const m = a.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ l("div", { ref: t, className: s("scl-alert__description", e), ...r }));
22
+ m.displayName = "AlertDescription";
34
23
  export {
35
- l as Alert,
36
- c as AlertDescription,
37
- m as AlertTitle
24
+ o as Alert,
25
+ m as AlertDescription,
26
+ c as AlertTitle
38
27
  };