@epilot/volt-ui 1.1.2-alpha.4 → 1.1.2-alpha.6

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 (213) hide show
  1. package/dist/components/button/button.d.ts +2 -2
  2. package/dist/index.cjs.js +1 -51
  3. package/dist/index.cjs10.js +1 -0
  4. package/dist/index.cjs100.js +1 -0
  5. package/dist/index.cjs101.js +1 -0
  6. package/dist/index.cjs102.js +1 -0
  7. package/dist/index.cjs103.js +1 -0
  8. package/dist/index.cjs104.js +1 -0
  9. package/dist/index.cjs105.js +1 -0
  10. package/dist/index.cjs106.js +1 -0
  11. package/dist/index.cjs107.js +1 -0
  12. package/dist/index.cjs11.js +1 -0
  13. package/dist/index.cjs12.js +1 -0
  14. package/dist/index.cjs13.js +1 -0
  15. package/dist/index.cjs14.js +1 -0
  16. package/dist/index.cjs15.js +1 -0
  17. package/dist/index.cjs16.js +1 -0
  18. package/dist/index.cjs17.js +1 -0
  19. package/dist/index.cjs18.js +1 -0
  20. package/dist/index.cjs19.js +1 -0
  21. package/dist/index.cjs20.js +1 -0
  22. package/dist/index.cjs21.js +1 -0
  23. package/dist/index.cjs22.js +1 -0
  24. package/dist/index.cjs23.js +1 -0
  25. package/dist/index.cjs24.js +1 -0
  26. package/dist/index.cjs25.js +1 -0
  27. package/dist/index.cjs26.js +1 -0
  28. package/dist/index.cjs27.js +1 -0
  29. package/dist/index.cjs28.js +1 -0
  30. package/dist/index.cjs29.js +1 -0
  31. package/dist/index.cjs30.js +1 -0
  32. package/dist/index.cjs31.js +1 -0
  33. package/dist/index.cjs32.js +1 -0
  34. package/dist/index.cjs33.js +1 -0
  35. package/dist/index.cjs34.js +1 -0
  36. package/dist/index.cjs35.js +1 -0
  37. package/dist/index.cjs36.js +1 -0
  38. package/dist/index.cjs37.js +1 -0
  39. package/dist/index.cjs38.js +1 -0
  40. package/dist/index.cjs39.js +1 -0
  41. package/dist/index.cjs4.js +1 -0
  42. package/dist/index.cjs40.js +1 -0
  43. package/dist/index.cjs41.js +5 -0
  44. package/dist/index.cjs42.js +1 -0
  45. package/dist/index.cjs43.js +1 -0
  46. package/dist/index.cjs44.js +1 -0
  47. package/dist/index.cjs45.js +7 -0
  48. package/dist/index.cjs46.js +1 -0
  49. package/dist/index.cjs47.js +1 -0
  50. package/dist/index.cjs48.js +1 -0
  51. package/dist/index.cjs49.js +1 -0
  52. package/dist/index.cjs5.js +1 -0
  53. package/dist/index.cjs50.js +1 -0
  54. package/dist/index.cjs51.js +1 -0
  55. package/dist/index.cjs52.js +1 -0
  56. package/dist/index.cjs53.js +1 -0
  57. package/dist/index.cjs54.js +1 -0
  58. package/dist/index.cjs55.js +1 -0
  59. package/dist/index.cjs56.js +1 -0
  60. package/dist/index.cjs57.js +1 -0
  61. package/dist/index.cjs58.js +1 -0
  62. package/dist/index.cjs59.js +1 -0
  63. package/dist/index.cjs6.js +1 -0
  64. package/dist/index.cjs60.js +1 -0
  65. package/dist/index.cjs61.js +1 -0
  66. package/dist/index.cjs62.js +1 -0
  67. package/dist/index.cjs63.js +1 -0
  68. package/dist/index.cjs64.js +1 -0
  69. package/dist/index.cjs65.js +1 -0
  70. package/dist/index.cjs66.js +1 -0
  71. package/dist/index.cjs67.js +1 -0
  72. package/dist/index.cjs68.js +1 -0
  73. package/dist/index.cjs69.js +1 -0
  74. package/dist/index.cjs7.js +1 -0
  75. package/dist/index.cjs70.js +1 -0
  76. package/dist/index.cjs71.js +1 -0
  77. package/dist/index.cjs72.js +1 -0
  78. package/dist/index.cjs73.js +1 -0
  79. package/dist/index.cjs74.js +1 -0
  80. package/dist/index.cjs75.js +1 -0
  81. package/dist/index.cjs76.js +1 -0
  82. package/dist/index.cjs77.js +1 -0
  83. package/dist/index.cjs78.js +1 -0
  84. package/dist/index.cjs79.js +1 -0
  85. package/dist/index.cjs8.js +1 -0
  86. package/dist/index.cjs80.js +1 -0
  87. package/dist/index.cjs81.js +1 -0
  88. package/dist/index.cjs82.js +1 -0
  89. package/dist/index.cjs83.js +1 -0
  90. package/dist/index.cjs84.js +1 -0
  91. package/dist/index.cjs85.js +1 -0
  92. package/dist/index.cjs86.js +1 -0
  93. package/dist/index.cjs87.js +1 -0
  94. package/dist/index.cjs88.js +1 -0
  95. package/dist/index.cjs89.js +1 -0
  96. package/dist/index.cjs9.js +1 -0
  97. package/dist/index.cjs90.js +1 -0
  98. package/dist/index.cjs91.js +1 -0
  99. package/dist/index.cjs92.js +4 -0
  100. package/dist/index.cjs93.js +1 -0
  101. package/dist/index.cjs94.js +1 -0
  102. package/dist/index.cjs95.js +1 -0
  103. package/dist/index.cjs96.js +1 -0
  104. package/dist/index.cjs97.js +1 -0
  105. package/dist/index.cjs98.js +38 -0
  106. package/dist/index.cjs99.js +1 -0
  107. package/dist/index.es.js +133 -11724
  108. package/dist/index.es10.js +29 -0
  109. package/dist/index.es100.js +16 -0
  110. package/dist/index.es101.js +68 -0
  111. package/dist/index.es102.js +6 -0
  112. package/dist/index.es103.js +25 -0
  113. package/dist/index.es104.js +25 -0
  114. package/dist/index.es105.js +15 -0
  115. package/dist/index.es106.js +30 -0
  116. package/dist/index.es107.js +7 -0
  117. package/dist/index.es11.js +250 -0
  118. package/dist/index.es12.js +230 -0
  119. package/dist/index.es13.js +34 -0
  120. package/dist/index.es14.js +43 -0
  121. package/dist/index.es15.js +43 -0
  122. package/dist/index.es16.js +115 -0
  123. package/dist/index.es17.js +24 -0
  124. package/dist/index.es18.js +36 -0
  125. package/dist/index.es19.js +137 -0
  126. package/dist/index.es20.js +50 -0
  127. package/dist/index.es21.js +54 -0
  128. package/dist/index.es22.js +74 -0
  129. package/dist/index.es23.js +172 -0
  130. package/dist/index.es24.js +89 -0
  131. package/dist/index.es25.js +113 -0
  132. package/dist/index.es26.js +85 -0
  133. package/dist/index.es27.js +61 -0
  134. package/dist/index.es28.js +73 -0
  135. package/dist/index.es29.js +746 -0
  136. package/dist/index.es30.js +17 -0
  137. package/dist/index.es31.js +2763 -0
  138. package/dist/index.es32.js +62 -0
  139. package/dist/index.es33.js +35 -0
  140. package/dist/index.es34.js +126 -0
  141. package/dist/index.es35.js +862 -0
  142. package/dist/index.es36.js +20 -0
  143. package/dist/index.es37.js +331 -0
  144. package/dist/index.es38.js +132 -0
  145. package/dist/index.es39.js +24 -0
  146. package/dist/index.es4.js +6 -0
  147. package/dist/index.es40.js +243 -0
  148. package/dist/index.es41.js +262 -0
  149. package/dist/index.es42.js +251 -0
  150. package/dist/index.es43.js +238 -0
  151. package/dist/index.es44.js +239 -0
  152. package/dist/index.es45.js +127 -0
  153. package/dist/index.es46.js +163 -0
  154. package/dist/index.es47.js +29 -0
  155. package/dist/index.es48.js +32 -0
  156. package/dist/index.es49.js +9 -0
  157. package/dist/index.es5.js +52 -0
  158. package/dist/index.es50.js +70 -0
  159. package/dist/index.es51.js +54 -0
  160. package/dist/index.es52.js +8 -0
  161. package/dist/index.es53.js +27 -0
  162. package/dist/index.es54.js +36 -0
  163. package/dist/index.es55.js +183 -0
  164. package/dist/index.es56.js +10 -0
  165. package/dist/index.es57.js +71 -0
  166. package/dist/index.es58.js +6 -0
  167. package/dist/index.es59.js +48 -0
  168. package/dist/index.es6.js +66 -0
  169. package/dist/index.es60.js +127 -0
  170. package/dist/index.es61.js +17 -0
  171. package/dist/index.es62.js +137 -0
  172. package/dist/index.es63.js +13 -0
  173. package/dist/index.es64.js +221 -0
  174. package/dist/index.es65.js +16 -0
  175. package/dist/index.es66.js +50 -0
  176. package/dist/index.es67.js +13 -0
  177. package/dist/index.es68.js +6 -0
  178. package/dist/index.es69.js +32 -0
  179. package/dist/index.es7.js +167 -0
  180. package/dist/index.es70.js +52 -0
  181. package/dist/index.es71.js +11 -0
  182. package/dist/index.es72.js +32 -0
  183. package/dist/index.es73.js +11 -0
  184. package/dist/index.es74.js +50 -0
  185. package/dist/index.es75.js +50 -0
  186. package/dist/index.es76.js +11 -0
  187. package/dist/index.es77.js +120 -0
  188. package/dist/index.es78.js +312 -0
  189. package/dist/index.es79.js +50 -0
  190. package/dist/index.es8.js +39 -0
  191. package/dist/index.es80.js +14 -0
  192. package/dist/index.es81.js +208 -0
  193. package/dist/index.es82.js +24 -0
  194. package/dist/index.es83.js +402 -0
  195. package/dist/index.es84.js +17 -0
  196. package/dist/index.es85.js +32 -0
  197. package/dist/index.es86.js +27 -0
  198. package/dist/index.es87.js +31 -0
  199. package/dist/index.es88.js +7 -0
  200. package/dist/index.es89.js +7 -0
  201. package/dist/index.es9.js +33 -0
  202. package/dist/index.es90.js +5 -0
  203. package/dist/index.es91.js +26 -0
  204. package/dist/index.es92.js +112 -0
  205. package/dist/index.es93.js +18 -0
  206. package/dist/index.es94.js +527 -0
  207. package/dist/index.es95.js +130 -0
  208. package/dist/index.es96.js +136 -0
  209. package/dist/index.es97.js +67 -0
  210. package/dist/index.es98.js +71 -0
  211. package/dist/index.es99.js +11 -0
  212. package/dist/style.css +1 -7320
  213. package/package.json +1 -1
@@ -0,0 +1,167 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import * as r from "react";
3
+ import { createContext as f, useContext as g, useMemo as p } from "react";
4
+ import { cn as n } from "./index.es4.js";
5
+ import { Label as m } from "./index.es13.js";
6
+ import { cva as x } from "./index.es33.js";
7
+ const u = f(null), C = () => {
8
+ const t = g(u);
9
+ if (!t)
10
+ throw new Error("FieldInput must be used within a Field component");
11
+ return t;
12
+ }, k = ({ className: t, ...l }) => /* @__PURE__ */ e(
13
+ "div",
14
+ {
15
+ "data-slot": "field-group",
16
+ className: n(
17
+ "volt-group/field-group volt-@container/field-group volt-flex volt-w-full volt-flex-col volt-gap-2 volt-*:data-[slot=field-group]:gap-2 [&>div[data-slot=field]+[data-slot=field-description]]:pl-3",
18
+ t
19
+ ),
20
+ ...l
21
+ }
22
+ ), L = ({
23
+ className: t,
24
+ ...l
25
+ }) => /* @__PURE__ */ e(
26
+ "fieldset",
27
+ {
28
+ "data-slot": "field-set",
29
+ className: n("volt-flex volt-flex-col volt-gap-6", t),
30
+ ...l
31
+ }
32
+ ), h = x(
33
+ "volt-relative volt-flex-col volt-*:w-full [&>.sr-only]:w-auto volt-group/field volt-flex volt-w-full volt-py-2 volt-px-3 volt-gap-1 volt-corner-squircle-lg volt-rounded-lg volt-transition-all volt-duration-75 volt-data-[focused=true]:outline-2 volt-data-[focused=true]:outline-offset-2",
34
+ {
35
+ variants: {
36
+ variant: {
37
+ default: "volt-bg-gray-a3 volt-hover:bg-gray-a4 volt-data-[focused=true]:outline-gray-a8",
38
+ highlight: "volt-bg-accent-a3 volt-hover:bg-accent-a4 volt-data-[focused=true]:outline-accent-a8",
39
+ readonly: "volt-bg-gray-a3 volt-data-[focused=true]:outline-gray-a8",
40
+ destructive: "volt-bg-error-soft volt-hover:bg-error-a4 volt-data-[focused=true]:outline-error-a8"
41
+ }
42
+ },
43
+ defaultVariants: {
44
+ variant: "default"
45
+ }
46
+ }
47
+ ), R = ({ className: t, variant: l, children: o, ...v }) => {
48
+ const i = r.useRef(null), [s, d] = r.useState(!1);
49
+ return /* @__PURE__ */ e(u.Provider, { value: { inputRef: i }, children: /* @__PURE__ */ e(
50
+ "div",
51
+ {
52
+ role: "group",
53
+ "data-slot": "field",
54
+ className: n(h({ variant: l }), t),
55
+ "data-focused": s ? "true" : "false",
56
+ onFocusCapture: () => d(!0),
57
+ onBlurCapture: () => d(!1),
58
+ ...v,
59
+ children: o
60
+ }
61
+ ) });
62
+ }, I = ({ className: t, ...l }) => /* @__PURE__ */ e(
63
+ "div",
64
+ {
65
+ "data-slot": "field-content",
66
+ className: n(
67
+ "volt-group/field-content volt-flex volt-flex-1 volt-flex-col volt-gap-2 volt-leading-snug",
68
+ t
69
+ ),
70
+ ...l
71
+ }
72
+ ), M = ({
73
+ className: t,
74
+ ...l
75
+ }) => /* @__PURE__ */ e(
76
+ m,
77
+ {
78
+ "data-slot": "field-label",
79
+ className: n(
80
+ "volt-group/field-label volt-min-h-5 volt-text-xs volt-peer/field-label volt-flex volt-w-fit volt-gap-2 volt-leading-snug volt-group-data-[disabled=true]/field:opacity-50",
81
+ "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border volt-*:data-[slot=field]:p-4",
82
+ "volt-has-data-[state=checked]:bg-accent-a3/5 volt-has-data-[state=checked]:border-accent-a3 volt-dark:has-data-[state=checked]:bg-accent-a3/10",
83
+ t
84
+ ),
85
+ ...l
86
+ }
87
+ ), S = ({
88
+ className: t,
89
+ showOnHover: l = !0,
90
+ ...o
91
+ }) => /* @__PURE__ */ e(
92
+ "div",
93
+ {
94
+ "data-slot": "field-label-content",
95
+ className: n(
96
+ "volt-inline-flex volt-items-center volt-gap-1 volt-transition-opacity",
97
+ {
98
+ "volt-w-0 volt-h-0 volt-opacity-0 volt-pointer-events-none volt-group-hover/field:w-auto volt-group-hover/field:h-auto volt-group-hover/field:opacity-100 volt-group-hover/field:pointer-events-auto": l
99
+ },
100
+ t
101
+ ),
102
+ ...o
103
+ }
104
+ ), V = ({
105
+ className: t,
106
+ ...l
107
+ }) => /* @__PURE__ */ e(
108
+ "p",
109
+ {
110
+ "data-slot": "field-description",
111
+ className: n(
112
+ "volt-text-gray-default volt-text-xs volt-leading-normal volt-font-normal",
113
+ "volt-last:mt-0 volt-nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",
114
+ "[&>a:hover]:text-gray-default [&>a]:underline [&>a]:underline-offset-4",
115
+ t
116
+ ),
117
+ ...l
118
+ }
119
+ ), j = ({
120
+ className: t,
121
+ children: l,
122
+ errors: o,
123
+ ...v
124
+ }) => {
125
+ const i = p(() => {
126
+ var d;
127
+ if (l)
128
+ return l;
129
+ if (!(o != null && o.length))
130
+ return null;
131
+ const s = [
132
+ ...new Map(o.map((a) => [a == null ? void 0 : a.message, a])).values()
133
+ ];
134
+ return (s == null ? void 0 : s.length) == 1 ? (d = s[0]) == null ? void 0 : d.message : /* @__PURE__ */ e("ul", { className: "volt-flex volt-list-disc volt-flex-col volt-m-0", children: s.map(
135
+ (a, c) => (a == null ? void 0 : a.message) && /* @__PURE__ */ e(
136
+ "li",
137
+ {
138
+ className: "volt-text-error-light volt-text-xs volt-font-normal volt-my-1 volt-marker:text-error-light",
139
+ children: a.message
140
+ },
141
+ c
142
+ )
143
+ ) });
144
+ }, [l, o]);
145
+ return i ? /* @__PURE__ */ e(
146
+ "div",
147
+ {
148
+ role: "alert",
149
+ "data-slot": "field-error",
150
+ className: n("volt-text-error-light volt-text-xs volt-font-normal", t),
151
+ ...v,
152
+ children: i
153
+ }
154
+ ) : null;
155
+ };
156
+ export {
157
+ R as Field,
158
+ I as FieldContent,
159
+ V as FieldDescription,
160
+ j as FieldError,
161
+ k as FieldGroup,
162
+ M as FieldLabel,
163
+ S as FieldLabelContent,
164
+ L as FieldSet,
165
+ h as fieldVariants,
166
+ C as useFieldContext
167
+ };
@@ -0,0 +1,52 @@
1
+ var S = function(r) {
2
+ if (typeof document > "u")
3
+ return null;
4
+ var u = Array.isArray(r) ? r[0] : r;
5
+ return u.ownerDocument.body;
6
+ }, f = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), p = {}, h = 0, W = function(r) {
7
+ return r && (r.host || W(r.parentNode));
8
+ }, D = function(r, u) {
9
+ return u.map(function(e) {
10
+ if (r.contains(e))
11
+ return e;
12
+ var n = W(e);
13
+ return n && r.contains(n) ? n : (console.error("aria-hidden", e, "in not contained inside", r, ". Doing nothing"), null);
14
+ }).filter(function(e) {
15
+ return !!e;
16
+ });
17
+ }, E = function(r, u, e, n) {
18
+ var i = D(u, Array.isArray(r) ? r : [r]);
19
+ p[e] || (p[e] = /* @__PURE__ */ new WeakMap());
20
+ var s = p[e], l = [], o = /* @__PURE__ */ new Set(), b = new Set(i), y = function(t) {
21
+ !t || o.has(t) || (o.add(t), y(t.parentNode));
22
+ };
23
+ i.forEach(y);
24
+ var A = function(t) {
25
+ !t || b.has(t) || Array.prototype.forEach.call(t.children, function(a) {
26
+ if (o.has(a))
27
+ A(a);
28
+ else
29
+ try {
30
+ var c = a.getAttribute(n), w = c !== null && c !== "false", d = (f.get(a) || 0) + 1, M = (s.get(a) || 0) + 1;
31
+ f.set(a, d), s.set(a, M), l.push(a), d === 1 && w && v.set(a, !0), M === 1 && a.setAttribute(e, "true"), w || a.setAttribute(n, "true");
32
+ } catch (k) {
33
+ console.error("aria-hidden: cannot operate on ", a, k);
34
+ }
35
+ });
36
+ };
37
+ return A(u), o.clear(), h++, function() {
38
+ l.forEach(function(t) {
39
+ var a = f.get(t) - 1, c = s.get(t) - 1;
40
+ f.set(t, a), s.set(t, c), a || (v.has(t) || t.removeAttribute(n), v.delete(t)), c || t.removeAttribute(e);
41
+ }), h--, h || (f = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), p = {});
42
+ };
43
+ }, C = function(r, u, e) {
44
+ e === void 0 && (e = "data-aria-hidden");
45
+ var n = Array.from(Array.isArray(r) ? r : [r]), i = S(r);
46
+ return i ? (n.push.apply(n, Array.from(i.querySelectorAll("[aria-live], script"))), E(n, i, e, "aria-hidden")) : function() {
47
+ return null;
48
+ };
49
+ };
50
+ export {
51
+ C as hideOthers
52
+ };
@@ -0,0 +1,11 @@
1
+ import { __assign as m } from "./index.es86.js";
2
+ import * as r from "react";
3
+ import { RemoveScroll as e } from "./index.es87.js";
4
+ import t from "./index.es88.js";
5
+ var s = r.forwardRef(function(a, o) {
6
+ return r.createElement(e, m({}, a, { ref: o, sideCar: t }));
7
+ });
8
+ s.classNames = e.classNames;
9
+ export {
10
+ s as default
11
+ };
@@ -0,0 +1,32 @@
1
+ import * as f from "react";
2
+ import "react-dom";
3
+ import { createSlot as l } from "./index.es32.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
+ }, {});
30
+ export {
31
+ w as Primitive
32
+ };
@@ -0,0 +1,11 @@
1
+ import "react";
2
+ import { jsx as e, Fragment as o } from "react/jsx-runtime";
3
+ var l = Symbol("radix.slottable");
4
+ // @__NO_SIDE_EFFECTS__
5
+ function n(r) {
6
+ const t = ({ children: a }) => /* @__PURE__ */ e(o, { children: a });
7
+ return t.displayName = `${r}.Slottable`, t.__radixId = l, t;
8
+ }
9
+ export {
10
+ n as createSlottable
11
+ };
@@ -0,0 +1,50 @@
1
+ import * as l from "react";
2
+ import { composeRefs as m } from "./index.es47.js";
3
+ import { jsx as u } from "react/jsx-runtime";
4
+ // @__NO_SIDE_EFFECTS__
5
+ function b(e) {
6
+ const n = /* @__PURE__ */ y(e), o = l.forwardRef((t, r) => {
7
+ const { children: i, ...c } = t, s = l.Children.toArray(i), a = s.find(E);
8
+ if (a) {
9
+ const f = a.props.children, d = s.map((p) => p === a ? l.Children.count(f) > 1 ? l.Children.only(null) : l.isValidElement(f) ? f.props.children : null : p);
10
+ return /* @__PURE__ */ u(n, { ...c, ref: r, children: l.isValidElement(f) ? l.cloneElement(f, void 0, d) : null });
11
+ }
12
+ return /* @__PURE__ */ u(n, { ...c, ref: r, children: i });
13
+ });
14
+ return o.displayName = `${e}.Slot`, o;
15
+ }
16
+ // @__NO_SIDE_EFFECTS__
17
+ function y(e) {
18
+ const n = l.forwardRef((o, t) => {
19
+ const { children: r, ...i } = o;
20
+ if (l.isValidElement(r)) {
21
+ const c = S(r), s = C(i, r.props);
22
+ return r.type !== l.Fragment && (s.ref = t ? m(t, c) : c), l.cloneElement(r, s);
23
+ }
24
+ return l.Children.count(r) > 1 ? l.Children.only(null) : null;
25
+ });
26
+ return n.displayName = `${e}.SlotClone`, n;
27
+ }
28
+ var g = Symbol("radix.slottable");
29
+ function E(e) {
30
+ return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === g;
31
+ }
32
+ function C(e, n) {
33
+ const o = { ...n };
34
+ for (const t in n) {
35
+ const r = e[t], i = n[t];
36
+ /^on[A-Z]/.test(t) ? r && i ? o[t] = (...s) => {
37
+ const a = i(...s);
38
+ return r(...s), a;
39
+ } : r && (o[t] = r) : t === "style" ? o[t] = { ...r, ...i } : t === "className" && (o[t] = [r, i].filter(Boolean).join(" "));
40
+ }
41
+ return { ...e, ...o };
42
+ }
43
+ function S(e) {
44
+ var t, r;
45
+ let n = (t = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : t.get, o = n && "isReactWarning" in n && n.isReactWarning;
46
+ return o ? e.ref : (n = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, o = n && "isReactWarning" in n && n.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
47
+ }
48
+ export {
49
+ b as createSlot
50
+ };
@@ -0,0 +1,50 @@
1
+ import * as l from "react";
2
+ import { composeRefs as m } from "./index.es47.js";
3
+ import { jsx as u } from "react/jsx-runtime";
4
+ // @__NO_SIDE_EFFECTS__
5
+ function b(e) {
6
+ const n = /* @__PURE__ */ y(e), o = l.forwardRef((t, r) => {
7
+ const { children: i, ...c } = t, s = l.Children.toArray(i), a = s.find(E);
8
+ if (a) {
9
+ const f = a.props.children, d = s.map((p) => p === a ? l.Children.count(f) > 1 ? l.Children.only(null) : l.isValidElement(f) ? f.props.children : null : p);
10
+ return /* @__PURE__ */ u(n, { ...c, ref: r, children: l.isValidElement(f) ? l.cloneElement(f, void 0, d) : null });
11
+ }
12
+ return /* @__PURE__ */ u(n, { ...c, ref: r, children: i });
13
+ });
14
+ return o.displayName = `${e}.Slot`, o;
15
+ }
16
+ // @__NO_SIDE_EFFECTS__
17
+ function y(e) {
18
+ const n = l.forwardRef((o, t) => {
19
+ const { children: r, ...i } = o;
20
+ if (l.isValidElement(r)) {
21
+ const c = S(r), s = C(i, r.props);
22
+ return r.type !== l.Fragment && (s.ref = t ? m(t, c) : c), l.cloneElement(r, s);
23
+ }
24
+ return l.Children.count(r) > 1 ? l.Children.only(null) : null;
25
+ });
26
+ return n.displayName = `${e}.SlotClone`, n;
27
+ }
28
+ var g = Symbol("radix.slottable");
29
+ function E(e) {
30
+ return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === g;
31
+ }
32
+ function C(e, n) {
33
+ const o = { ...n };
34
+ for (const t in n) {
35
+ const r = e[t], i = n[t];
36
+ /^on[A-Z]/.test(t) ? r && i ? o[t] = (...s) => {
37
+ const a = i(...s);
38
+ return r(...s), a;
39
+ } : r && (o[t] = r) : t === "style" ? o[t] = { ...r, ...i } : t === "className" && (o[t] = [r, i].filter(Boolean).join(" "));
40
+ }
41
+ return { ...e, ...o };
42
+ }
43
+ function S(e) {
44
+ var t, r;
45
+ let n = (t = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : t.get, o = n && "isReactWarning" in n && n.isReactWarning;
46
+ return o ? e.ref : (n = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, o = n && "isReactWarning" in n && n.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
47
+ }
48
+ export {
49
+ b as createSlot
50
+ };
@@ -0,0 +1,11 @@
1
+ import "react";
2
+ import { jsx as e, Fragment as o } from "react/jsx-runtime";
3
+ var l = Symbol("radix.slottable");
4
+ // @__NO_SIDE_EFFECTS__
5
+ function n(r) {
6
+ const t = ({ children: a }) => /* @__PURE__ */ e(o, { children: a });
7
+ return t.displayName = `${r}.Slottable`, t.__radixId = l, t;
8
+ }
9
+ export {
10
+ n as createSlottable
11
+ };
@@ -0,0 +1,120 @@
1
+ import * as o from "react";
2
+ import { composeEventHandlers as T } from "./index.es49.js";
3
+ import { createContextScope as S } from "./index.es50.js";
4
+ import { useControllableState as D } from "./index.es51.js";
5
+ import { useLayoutEffect as L } from "./index.es68.js";
6
+ import { useComposedRefs as M } from "./index.es47.js";
7
+ import { Primitive as v } from "./index.es54.js";
8
+ import { Presence as k } from "./index.es57.js";
9
+ import { useId as F } from "./index.es63.js";
10
+ import { jsx as c } from "react/jsx-runtime";
11
+ var u = "Collapsible", [B, W] = S(u), [G, g] = B(u), w = o.forwardRef(
12
+ (e, a) => {
13
+ const {
14
+ __scopeCollapsible: i,
15
+ open: r,
16
+ defaultOpen: t,
17
+ disabled: l,
18
+ onOpenChange: s,
19
+ ...m
20
+ } = e, [d, p] = D({
21
+ prop: r,
22
+ defaultProp: t ?? !1,
23
+ onChange: s,
24
+ caller: u
25
+ });
26
+ return /* @__PURE__ */ c(
27
+ G,
28
+ {
29
+ scope: i,
30
+ disabled: l,
31
+ contentId: F(),
32
+ open: d,
33
+ onOpenToggle: o.useCallback(() => p((C) => !C), [p]),
34
+ children: /* @__PURE__ */ c(
35
+ v.div,
36
+ {
37
+ "data-state": h(d),
38
+ "data-disabled": l ? "" : void 0,
39
+ ...m,
40
+ ref: a
41
+ }
42
+ )
43
+ }
44
+ );
45
+ }
46
+ );
47
+ w.displayName = u;
48
+ var A = "CollapsibleTrigger", I = o.forwardRef(
49
+ (e, a) => {
50
+ const { __scopeCollapsible: i, ...r } = e, t = g(A, i);
51
+ return /* @__PURE__ */ c(
52
+ v.button,
53
+ {
54
+ type: "button",
55
+ "aria-controls": t.contentId,
56
+ "aria-expanded": t.open || !1,
57
+ "data-state": h(t.open),
58
+ "data-disabled": t.disabled ? "" : void 0,
59
+ disabled: t.disabled,
60
+ ...r,
61
+ ref: a,
62
+ onClick: T(e.onClick, t.onOpenToggle)
63
+ }
64
+ );
65
+ }
66
+ );
67
+ I.displayName = A;
68
+ var R = "CollapsibleContent", O = o.forwardRef(
69
+ (e, a) => {
70
+ const { forceMount: i, ...r } = e, t = g(R, e.__scopeCollapsible);
71
+ return /* @__PURE__ */ c(k, { present: i || t.open, children: ({ present: l }) => /* @__PURE__ */ c($, { ...r, ref: a, present: l }) });
72
+ }
73
+ );
74
+ O.displayName = R;
75
+ var $ = o.forwardRef((e, a) => {
76
+ const { __scopeCollapsible: i, present: r, children: t, ...l } = e, s = g(R, i), [m, d] = o.useState(r), p = o.useRef(null), C = M(a, p), y = o.useRef(0), x = y.current, N = o.useRef(0), P = N.current, b = s.open || m, _ = o.useRef(b), f = o.useRef(void 0);
77
+ return o.useEffect(() => {
78
+ const n = requestAnimationFrame(() => _.current = !1);
79
+ return () => cancelAnimationFrame(n);
80
+ }, []), L(() => {
81
+ const n = p.current;
82
+ if (n) {
83
+ f.current = f.current || {
84
+ transitionDuration: n.style.transitionDuration,
85
+ animationName: n.style.animationName
86
+ }, n.style.transitionDuration = "0s", n.style.animationName = "none";
87
+ const E = n.getBoundingClientRect();
88
+ y.current = E.height, N.current = E.width, _.current || (n.style.transitionDuration = f.current.transitionDuration, n.style.animationName = f.current.animationName), d(r);
89
+ }
90
+ }, [s.open, r]), /* @__PURE__ */ c(
91
+ v.div,
92
+ {
93
+ "data-state": h(s.open),
94
+ "data-disabled": s.disabled ? "" : void 0,
95
+ id: s.contentId,
96
+ hidden: !b,
97
+ ...l,
98
+ ref: C,
99
+ style: {
100
+ "--radix-collapsible-content-height": x ? `${x}px` : void 0,
101
+ "--radix-collapsible-content-width": P ? `${P}px` : void 0,
102
+ ...e.style
103
+ },
104
+ children: b && t
105
+ }
106
+ );
107
+ });
108
+ function h(e) {
109
+ return e ? "open" : "closed";
110
+ }
111
+ var X = w, Y = I, Z = O;
112
+ export {
113
+ w as Collapsible,
114
+ O as CollapsibleContent,
115
+ I as CollapsibleTrigger,
116
+ Z as Content,
117
+ X as Root,
118
+ Y as Trigger,
119
+ W as createCollapsibleScope
120
+ };