@drjoshcsimmons/scl 0.2.2 → 0.2.4

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 (127) hide show
  1. package/dist/index100.js +181 -9
  2. package/dist/index101.js +54 -3
  3. package/dist/index102.js +30 -650
  4. package/dist/index103.js +30 -6
  5. package/dist/index104.js +14 -24
  6. package/dist/index105.js +1 -1
  7. package/dist/index106.js +47 -29
  8. package/dist/index107.js +45 -12
  9. package/dist/index108.js +51 -177
  10. package/dist/index109.js +29 -47
  11. package/dist/index11.js +2 -2
  12. package/dist/index110.js +10 -52
  13. package/dist/index111.js +650 -30
  14. package/dist/index112.js +7 -46
  15. package/dist/index113.js +48 -6
  16. package/dist/index114.js +1 -1
  17. package/dist/index115.js +11 -47
  18. package/dist/index116.js +204 -10
  19. package/dist/index117.js +20 -204
  20. package/dist/index118.js +399 -21
  21. package/dist/index119.js +20 -399
  22. package/dist/index12.js +1 -1
  23. package/dist/index120.js +9 -48
  24. package/dist/index121.js +32 -15
  25. package/dist/index122.js +12 -3
  26. package/dist/index123.js +6 -38
  27. package/dist/index124.js +48 -18
  28. package/dist/index125.js +25 -2
  29. package/dist/index126.js +29 -53
  30. package/dist/index127.js +5 -65
  31. package/dist/index128.js +2 -25
  32. package/dist/index129.js +53 -29
  33. package/dist/index13.js +2 -2
  34. package/dist/index130.js +65 -5
  35. package/dist/index131.js +5 -2
  36. package/dist/index132.js +3 -2
  37. package/dist/index133.js +24 -5
  38. package/dist/index134.js +113 -3
  39. package/dist/index135.js +15 -23
  40. package/dist/index136.js +519 -107
  41. package/dist/index137.js +126 -14
  42. package/dist/index138.js +125 -516
  43. package/dist/index139.js +2 -128
  44. package/dist/index14.js +2 -2
  45. package/dist/index140.js +2 -134
  46. package/dist/index141.js +69 -65
  47. package/dist/index142.js +8 -68
  48. package/dist/index143.js +14 -9
  49. package/dist/index144.js +66 -14
  50. package/dist/index145.js +64 -65
  51. package/dist/index15.js +2 -2
  52. package/dist/index17.js +4 -4
  53. package/dist/index18.js +2 -2
  54. package/dist/index20.js +2 -2
  55. package/dist/index21.js +1 -1
  56. package/dist/index22.js +1 -1
  57. package/dist/index23.js +2 -2
  58. package/dist/index24.js +1 -1
  59. package/dist/index25.js +4 -4
  60. package/dist/index26.js +1 -1
  61. package/dist/index27.js +3 -3
  62. package/dist/index29.js +1 -1
  63. package/dist/index31.js +1 -1
  64. package/dist/index33.js +1 -1
  65. package/dist/index36.js +2 -2
  66. package/dist/index37.js +1 -1
  67. package/dist/index4.js +2 -2
  68. package/dist/index45.js +237 -33
  69. package/dist/index46.js +11 -125
  70. package/dist/index47.js +33 -237
  71. package/dist/index48.js +60 -11
  72. package/dist/index49.js +114 -56
  73. package/dist/index5.js +1 -1
  74. package/dist/index50.js +116 -64
  75. package/dist/index51.js +407 -213
  76. package/dist/index52.js +823 -299
  77. package/dist/index53.js +9 -530
  78. package/dist/index54.js +9 -225
  79. package/dist/index55.js +130 -9
  80. package/dist/index56.js +530 -11
  81. package/dist/index57.js +161 -11
  82. package/dist/index58.js +70 -118
  83. package/dist/index59.js +16 -308
  84. package/dist/index6.js +1 -1
  85. package/dist/index60.js +236 -12
  86. package/dist/index61.js +11 -18
  87. package/dist/index62.js +27 -18
  88. package/dist/index63.js +298 -242
  89. package/dist/index64.js +12 -118
  90. package/dist/index65.js +239 -140
  91. package/dist/index66.js +12 -260
  92. package/dist/index67.js +22 -12
  93. package/dist/index68.js +215 -72
  94. package/dist/index69.js +11 -860
  95. package/dist/index7.js +1 -1
  96. package/dist/index70.js +241 -9
  97. package/dist/index71.js +72 -30
  98. package/dist/index72.js +12 -249
  99. package/dist/index73.js +225 -212
  100. package/dist/index74.js +336 -12
  101. package/dist/index75.js +244 -425
  102. package/dist/index77.js +44 -25
  103. package/dist/index78.js +25 -5
  104. package/dist/index79.js +6 -8
  105. package/dist/index8.js +1 -1
  106. package/dist/index80.js +50 -44
  107. package/dist/index81.js +33 -51
  108. package/dist/index82.js +10 -33
  109. package/dist/index83.js +7 -10
  110. package/dist/index84.js +3 -7
  111. package/dist/index85.js +65 -51
  112. package/dist/index86.js +8 -10
  113. package/dist/index87.js +4 -4
  114. package/dist/index88.js +6 -30
  115. package/dist/index89.js +24 -12
  116. package/dist/index9.js +2 -2
  117. package/dist/index90.js +5 -5
  118. package/dist/index91.js +13 -217
  119. package/dist/index92.js +134 -13
  120. package/dist/index93.js +216 -66
  121. package/dist/index94.js +14 -9
  122. package/dist/index95.js +47 -29
  123. package/dist/index96.js +8 -12
  124. package/dist/index97.js +29 -134
  125. package/dist/index98.js +49 -47
  126. package/dist/index99.js +9 -50
  127. package/package.json +1 -1
package/dist/index145.js CHANGED
@@ -1,68 +1,67 @@
1
- var N = function(r) {
2
- return r.tagName === "TEXTAREA";
3
- }, b = function(r, e) {
4
- if (!(r instanceof Element))
5
- return !1;
6
- var t = window.getComputedStyle(r);
7
- return (
8
- // not-not-scrollable
9
- t[e] !== "hidden" && // contains scroll inside self
10
- !(t.overflowY === t.overflowX && !N(r) && t[e] === "visible")
11
- );
12
- }, D = function(r) {
13
- return b(r, "overflowY");
14
- }, E = function(r) {
15
- return b(r, "overflowX");
16
- }, T = function(r, e) {
17
- var t = e.ownerDocument, l = e;
18
- do {
19
- typeof ShadowRoot < "u" && l instanceof ShadowRoot && (l = l.host);
20
- var f = g(r, l);
21
- if (f) {
22
- var n = m(r, l), i = n[1], o = n[2];
23
- if (i > o)
24
- return !0;
1
+ import { __assign as d } from "./index125.js";
2
+ function l(r) {
3
+ return r;
4
+ }
5
+ function h(r, t) {
6
+ t === void 0 && (t = l);
7
+ var e = [], o = !1, c = {
8
+ read: function() {
9
+ if (o)
10
+ throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
11
+ return e.length ? e[e.length - 1] : r;
12
+ },
13
+ useMedium: function(u) {
14
+ var n = t(u, o);
15
+ return e.push(n), function() {
16
+ e = e.filter(function(i) {
17
+ return i !== n;
18
+ });
19
+ };
20
+ },
21
+ assignSyncMedium: function(u) {
22
+ for (o = !0; e.length; ) {
23
+ var n = e;
24
+ e = [], n.forEach(u);
25
+ }
26
+ e = {
27
+ push: function(i) {
28
+ return u(i);
29
+ },
30
+ filter: function() {
31
+ return e;
32
+ }
33
+ };
34
+ },
35
+ assignMedium: function(u) {
36
+ o = !0;
37
+ var n = [];
38
+ if (e.length) {
39
+ var i = e;
40
+ e = [], i.forEach(u), n = e;
41
+ }
42
+ var s = function() {
43
+ var f = n;
44
+ n = [], f.forEach(u);
45
+ }, a = function() {
46
+ return Promise.resolve().then(s);
47
+ };
48
+ a(), e = {
49
+ push: function(f) {
50
+ n.push(f), a();
51
+ },
52
+ filter: function(f) {
53
+ return n = n.filter(f), e;
54
+ }
55
+ };
25
56
  }
26
- l = l.parentNode;
27
- } while (l && l !== t.body);
28
- return !1;
29
- }, H = function(r) {
30
- var e = r.scrollTop, t = r.scrollHeight, l = r.clientHeight;
31
- return [
32
- e,
33
- t,
34
- l
35
- ];
36
- }, p = function(r) {
37
- var e = r.scrollLeft, t = r.scrollWidth, l = r.clientWidth;
38
- return [
39
- e,
40
- t,
41
- l
42
- ];
43
- }, g = function(r, e) {
44
- return r === "v" ? D(e) : E(e);
45
- }, m = function(r, e) {
46
- return r === "v" ? H(e) : p(e);
47
- }, B = function(r, e) {
48
- return r === "h" && e === "rtl" ? -1 : 1;
49
- }, V = function(r, e, t, l, f) {
50
- var n = B(r, window.getComputedStyle(e).direction), i = n * l, o = t.target, d = e.contains(o), c = !1, s = i > 0, h = 0, S = 0;
51
- do {
52
- if (!o)
53
- break;
54
- var u = m(r, o), v = u[0], C = u[1], y = u[2], w = C - y - n * v;
55
- (v || w) && g(r, o) && (h += w, S += v);
56
- var a = o.parentNode;
57
- o = a && a.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? a.host : a;
58
- } while (
59
- // portaled content
60
- !d && o !== document.body || // self content
61
- d && (e.contains(o) || e === o)
62
- );
63
- return (s && Math.abs(h) < 1 || !s && Math.abs(S) < 1) && (c = !0), c;
64
- };
57
+ };
58
+ return c;
59
+ }
60
+ function v(r) {
61
+ r === void 0 && (r = {});
62
+ var t = h(null);
63
+ return t.options = d({ async: !0, ssr: !1 }, r), t;
64
+ }
65
65
  export {
66
- V as handleScroll,
67
- T as locationCouldBeScrolled
66
+ v as createSidecarMedium
68
67
  };
package/dist/index15.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { jsx as o, jsxs as r } from "react/jsx-runtime";
2
- import { Root as p, Close as i, Portal as x, Trigger as N, Content as n, Description as c, Overlay as d, Title as m } from "./index66.js";
2
+ import { Root as p, Close as i, Portal as x, Trigger as N, Content as n, Description as c, Overlay as d, Title as m } from "./index65.js";
3
3
  import * as l from "react";
4
4
  import { cn as t } from "./index2.js";
5
- import y from "./index67.js";
5
+ import y from "./index66.js";
6
6
  const j = p, z = N, D = x, F = i, f = l.forwardRef(({ className: e, ...a }, s) => /* @__PURE__ */ o(
7
7
  d,
8
8
  {
package/dist/index17.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { jsxs as p, jsx as a } from "react/jsx-runtime";
2
- import { Root as w, Group as h, Portal as d, RadioGroup as N, Sub as v, Trigger as R, CheckboxItem as m, ItemIndicator as l, Content as c, Item as u, Label as f, RadioItem as y, Separator as b, SubContent as g, SubTrigger as x } from "./index54.js";
2
+ import { Root as w, Group as h, Portal as d, RadioGroup as N, Sub as v, Trigger as R, CheckboxItem as m, ItemIndicator as l, Content as c, Item as u, Label as f, RadioItem as y, Separator as b, SubContent as g, SubTrigger as x } from "./index68.js";
3
3
  import * as s from "react";
4
4
  import { cn as n } from "./index2.js";
5
- import D from "./index55.js";
6
- import M from "./index56.js";
7
- import S from "./index57.js";
5
+ import D from "./index53.js";
6
+ import M from "./index61.js";
7
+ import S from "./index69.js";
8
8
  const H = w, J = R, K = h, O = d, Q = v, U = N, I = s.forwardRef(({ className: e, inset: r, children: o, ...t }, i) => /* @__PURE__ */ p(
9
9
  x,
10
10
  {
package/dist/index18.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
- import { Root as F } from "./index49.js";
2
+ import { Root as F } from "./index48.js";
3
3
  import * as s from "react";
4
- import { FormProvider as u, Controller as p, useFormContext as x } from "./index63.js";
4
+ import { FormProvider as u, Controller as p, useFormContext as x } from "./index75.js";
5
5
  import { cn as a } from "./index2.js";
6
6
  import { Label as I } from "./index20.js";
7
7
  const D = u, f = s.createContext({}), M = ({
package/dist/index20.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
- import { Root as o } from "./index61.js";
3
- import { cva as t } from "./index45.js";
2
+ import { Root as o } from "./index59.js";
3
+ import { cva as t } from "./index47.js";
4
4
  import * as i from "react";
5
5
  import { cn as s } from "./index2.js";
6
6
  const l = t(
package/dist/index21.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { Root as c, Anchor as m, Trigger as s, Portal as i, Content as r } from "./index51.js";
2
+ import { Root as c, Anchor as m, Trigger as s, Portal as i, Content as r } from "./index70.js";
3
3
  import * as l from "react";
4
4
  import { cn as d } from "./index2.js";
5
5
  const h = c, v = s, y = m, f = l.forwardRef(({ className: e, align: t = "center", sideOffset: n = 4, ...a }, p) => /* @__PURE__ */ o(i, { children: /* @__PURE__ */ o(
package/dist/index22.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsxs as e, jsx as o } from "react/jsx-runtime";
2
- import { Root as n, Indicator as d } from "./index68.js";
2
+ import { Root as n, Indicator as d } from "./index58.js";
3
3
  import * as l from "react";
4
4
  import { cn as c } from "./index2.js";
5
5
  const f = l.forwardRef(
package/dist/index23.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { Root as i, Item as t, Indicator as d } from "./index73.js";
2
+ import { Root as i, Item as t, Indicator as d } from "./index60.js";
3
3
  import * as s from "react";
4
4
  import { cn as m } from "./index2.js";
5
- import l from "./index56.js";
5
+ import l from "./index61.js";
6
6
  const c = s.forwardRef(({ className: e, ...o }, a) => /* @__PURE__ */ r(i, { className: m("grid gap-2", e), ...o, ref: a }));
7
7
  c.displayName = i.displayName;
8
8
  const n = s.forwardRef(({ className: e, ...o }, a) => /* @__PURE__ */ r(
package/dist/index24.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsxs as m, jsx as r } from "react/jsx-runtime";
2
- import { Root as i, Viewport as p, Corner as d, ScrollAreaScrollbar as c, ScrollAreaThumb as f } from "./index53.js";
2
+ import { Root as i, Viewport as p, Corner as d, ScrollAreaScrollbar as c, ScrollAreaThumb as f } from "./index56.js";
3
3
  import * as s from "react";
4
4
  import { cn as n } from "./index2.js";
5
5
  const h = s.forwardRef(({ className: l, children: e, ...a }, o) => /* @__PURE__ */ m(
package/dist/index25.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
- import { Root as N, Group as b, Value as g, Portal as S, Content as c, Viewport as v, Item as m, ItemIndicator as R, ItemText as C, Label as n, ScrollDownButton as p, ScrollUpButton as d, Separator as f, Trigger as y, Icon as j } from "./index69.js";
2
+ import { Root as N, Group as b, Value as g, Portal as S, Content as c, Viewport as v, Item as m, ItemIndicator as R, ItemText as C, Label as n, ScrollDownButton as p, ScrollUpButton as d, Separator as f, Trigger as y, Icon as j } from "./index52.js";
3
3
  import * as o from "react";
4
4
  import { cn as l } from "./index2.js";
5
- import I from "./index55.js";
6
- import u from "./index48.js";
7
- import B from "./index70.js";
5
+ import I from "./index53.js";
6
+ import u from "./index46.js";
7
+ import B from "./index54.js";
8
8
  const E = N, F = b, H = g, k = o.forwardRef(({ className: t, children: a, ...r }, s) => /* @__PURE__ */ i(
9
9
  y,
10
10
  {
package/dist/index26.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx as l } from "react/jsx-runtime";
2
- import { Root as o } from "./index62.js";
2
+ import { Root as o } from "./index67.js";
3
3
  import * as f from "react";
4
4
  import { cn as i } from "./index2.js";
5
5
  const s = f.forwardRef(({ className: a, orientation: r = "horizontal", decorative: m = !0, ...p }, t) => /* @__PURE__ */ l(
package/dist/index27.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { jsx as s, jsxs as i } from "react/jsx-runtime";
2
- import { Root as x, Close as l, Portal as g, Trigger as N, Content as n, Description as m, Overlay as c, Title as d } from "./index66.js";
3
- import { cva as y } from "./index45.js";
2
+ import { Root as x, Close as l, Portal as g, Trigger as N, Content as n, Description as m, Overlay as c, Title as d } from "./index65.js";
3
+ import { cva as y } from "./index47.js";
4
4
  import * as a from "react";
5
5
  import { cn as r } from "./index2.js";
6
- import b from "./index67.js";
6
+ import b from "./index66.js";
7
7
  const H = x, O = N, P = l, u = g, f = a.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ s(
8
8
  c,
9
9
  {
package/dist/index29.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsxs as b, jsx as e } from "react/jsx-runtime";
2
- import { Root as n, Track as a, Range as p, Thumb as l } from "./index75.js";
2
+ import { Root as n, Track as a, Range as p, Thumb as l } from "./index51.js";
3
3
  import * as d from "react";
4
4
  import { cn as h } from "./index2.js";
5
5
  const g = d.forwardRef(({ className: i, defaultValue: r, value: o, ...s }, m) => {
package/dist/index31.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { Root as i, Thumb as t } from "./index58.js";
2
+ import { Root as i, Thumb as t } from "./index55.js";
3
3
  import * as n from "react";
4
4
  import { cn as r } from "./index2.js";
5
5
  const c = n.forwardRef(({ className: o, ...s }, a) => /* @__PURE__ */ e(
package/dist/index33.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
- import { Root as d, Content as o, List as n, Trigger as c } from "./index65.js";
2
+ import { Root as d, Content as o, List as n, Trigger as c } from "./index57.js";
3
3
  import * as s from "react";
4
4
  import { cn as r } from "./index2.js";
5
5
  const g = d, f = s.forwardRef(({ className: e, ...t }, i) => /* @__PURE__ */ a(
package/dist/index36.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { Root as e } from "./index71.js";
3
- import { cva as s } from "./index45.js";
2
+ import { Root as e } from "./index62.js";
3
+ import { cva as s } from "./index47.js";
4
4
  import * as m from "react";
5
5
  import { cn as p } from "./index2.js";
6
6
  const f = s(
package/dist/index37.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { Root as p, Trigger as n, Portal as s, Content as i, Provider as l } from "./index52.js";
2
+ import { Root as p, Trigger as n, Portal as s, Content as i, Provider as l } from "./index74.js";
3
3
  import * as m from "react";
4
4
  import { cn as d } from "./index2.js";
5
5
  const c = ({
package/dist/index4.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { jsx as r, jsxs as m } from "react/jsx-runtime";
2
- import { Root as c, Content as n, Item as l, Header as f, Trigger as d } from "./index47.js";
2
+ import { Root as c, Content as n, Item as l, Header as f, Trigger as d } from "./index45.js";
3
3
  import * as s from "react";
4
4
  import { cn as i } from "./index2.js";
5
- import p from "./index48.js";
5
+ import p from "./index46.js";
6
6
  const v = c, N = s.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ r(l, { ref: o, className: i("border-b-2 w-full", e), ...t }));
7
7
  N.displayName = "AccordionItem";
8
8
  const x = s.forwardRef(({ className: e, children: t, ...o }, a) => /* @__PURE__ */ r(f, { className: "flex", children: /* @__PURE__ */ m(
package/dist/index45.js CHANGED
@@ -1,35 +1,239 @@
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 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 "./index49.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) => {
52
+ 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,
72
+ {
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 }) })
78
+ }
79
+ );
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,
122
+ {
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
+ ) })
136
+ }
137
+ );
138
+ }
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,
144
+ {
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
+ }
163
+ )
164
+ }
165
+ );
166
+ }
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,
174
+ {
175
+ "data-orientation": i.orientation,
176
+ "data-state": J(r.open),
177
+ "data-disabled": r.disabled ? "" : void 0,
178
+ ...t,
179
+ ref: c
180
+ }
181
+ );
182
+ }
183
+ );
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
+ ) });
199
+ }
200
+ );
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,
207
+ {
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
+ }
219
+ }
220
+ );
221
+ }
222
+ );
223
+ F.displayName = B;
224
+ function J(o) {
225
+ return o ? "open" : "closed";
226
+ }
227
+ var Pe = K, Ne = U, ye = Y, Ee = q, Se = F;
32
228
  export {
33
- j as cva,
34
- y as cx
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,
237
+ Pe as Root,
238
+ Ee as Trigger
35
239
  };