@epilot/volt-ui 1.1.2 → 1.1.3

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 (214) hide show
  1. package/dist/components/spinner/spinner.d.ts +12 -0
  2. package/dist/index.cjs.js +51 -1
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.es.js +11793 -133
  5. package/dist/style.css +1 -1
  6. package/package.json +1 -1
  7. package/dist/index.cjs10.js +0 -1
  8. package/dist/index.cjs100.js +0 -1
  9. package/dist/index.cjs101.js +0 -1
  10. package/dist/index.cjs102.js +0 -1
  11. package/dist/index.cjs103.js +0 -1
  12. package/dist/index.cjs104.js +0 -1
  13. package/dist/index.cjs105.js +0 -1
  14. package/dist/index.cjs106.js +0 -1
  15. package/dist/index.cjs107.js +0 -1
  16. package/dist/index.cjs11.js +0 -1
  17. package/dist/index.cjs12.js +0 -1
  18. package/dist/index.cjs13.js +0 -1
  19. package/dist/index.cjs14.js +0 -1
  20. package/dist/index.cjs15.js +0 -1
  21. package/dist/index.cjs16.js +0 -1
  22. package/dist/index.cjs17.js +0 -1
  23. package/dist/index.cjs18.js +0 -1
  24. package/dist/index.cjs19.js +0 -1
  25. package/dist/index.cjs20.js +0 -1
  26. package/dist/index.cjs21.js +0 -1
  27. package/dist/index.cjs22.js +0 -1
  28. package/dist/index.cjs23.js +0 -1
  29. package/dist/index.cjs24.js +0 -1
  30. package/dist/index.cjs25.js +0 -1
  31. package/dist/index.cjs26.js +0 -1
  32. package/dist/index.cjs27.js +0 -1
  33. package/dist/index.cjs28.js +0 -1
  34. package/dist/index.cjs29.js +0 -1
  35. package/dist/index.cjs30.js +0 -1
  36. package/dist/index.cjs31.js +0 -1
  37. package/dist/index.cjs32.js +0 -1
  38. package/dist/index.cjs33.js +0 -1
  39. package/dist/index.cjs34.js +0 -1
  40. package/dist/index.cjs35.js +0 -1
  41. package/dist/index.cjs36.js +0 -1
  42. package/dist/index.cjs37.js +0 -1
  43. package/dist/index.cjs38.js +0 -1
  44. package/dist/index.cjs39.js +0 -1
  45. package/dist/index.cjs4.js +0 -1
  46. package/dist/index.cjs40.js +0 -1
  47. package/dist/index.cjs41.js +0 -5
  48. package/dist/index.cjs42.js +0 -1
  49. package/dist/index.cjs43.js +0 -1
  50. package/dist/index.cjs44.js +0 -1
  51. package/dist/index.cjs45.js +0 -7
  52. package/dist/index.cjs46.js +0 -1
  53. package/dist/index.cjs47.js +0 -1
  54. package/dist/index.cjs48.js +0 -1
  55. package/dist/index.cjs49.js +0 -1
  56. package/dist/index.cjs5.js +0 -1
  57. package/dist/index.cjs50.js +0 -1
  58. package/dist/index.cjs51.js +0 -1
  59. package/dist/index.cjs52.js +0 -1
  60. package/dist/index.cjs53.js +0 -1
  61. package/dist/index.cjs54.js +0 -1
  62. package/dist/index.cjs55.js +0 -1
  63. package/dist/index.cjs56.js +0 -1
  64. package/dist/index.cjs57.js +0 -1
  65. package/dist/index.cjs58.js +0 -1
  66. package/dist/index.cjs59.js +0 -1
  67. package/dist/index.cjs6.js +0 -1
  68. package/dist/index.cjs60.js +0 -1
  69. package/dist/index.cjs61.js +0 -1
  70. package/dist/index.cjs62.js +0 -1
  71. package/dist/index.cjs63.js +0 -1
  72. package/dist/index.cjs64.js +0 -1
  73. package/dist/index.cjs65.js +0 -1
  74. package/dist/index.cjs66.js +0 -1
  75. package/dist/index.cjs67.js +0 -1
  76. package/dist/index.cjs68.js +0 -1
  77. package/dist/index.cjs69.js +0 -1
  78. package/dist/index.cjs7.js +0 -1
  79. package/dist/index.cjs70.js +0 -1
  80. package/dist/index.cjs71.js +0 -1
  81. package/dist/index.cjs72.js +0 -1
  82. package/dist/index.cjs73.js +0 -1
  83. package/dist/index.cjs74.js +0 -1
  84. package/dist/index.cjs75.js +0 -1
  85. package/dist/index.cjs76.js +0 -1
  86. package/dist/index.cjs77.js +0 -1
  87. package/dist/index.cjs78.js +0 -1
  88. package/dist/index.cjs79.js +0 -1
  89. package/dist/index.cjs8.js +0 -1
  90. package/dist/index.cjs80.js +0 -1
  91. package/dist/index.cjs81.js +0 -1
  92. package/dist/index.cjs82.js +0 -1
  93. package/dist/index.cjs83.js +0 -1
  94. package/dist/index.cjs84.js +0 -1
  95. package/dist/index.cjs85.js +0 -1
  96. package/dist/index.cjs86.js +0 -1
  97. package/dist/index.cjs87.js +0 -1
  98. package/dist/index.cjs88.js +0 -1
  99. package/dist/index.cjs89.js +0 -1
  100. package/dist/index.cjs9.js +0 -1
  101. package/dist/index.cjs90.js +0 -1
  102. package/dist/index.cjs91.js +0 -1
  103. package/dist/index.cjs92.js +0 -4
  104. package/dist/index.cjs93.js +0 -1
  105. package/dist/index.cjs94.js +0 -1
  106. package/dist/index.cjs95.js +0 -1
  107. package/dist/index.cjs96.js +0 -1
  108. package/dist/index.cjs97.js +0 -1
  109. package/dist/index.cjs98.js +0 -38
  110. package/dist/index.cjs99.js +0 -1
  111. package/dist/index.es10.js +0 -29
  112. package/dist/index.es100.js +0 -16
  113. package/dist/index.es101.js +0 -68
  114. package/dist/index.es102.js +0 -6
  115. package/dist/index.es103.js +0 -25
  116. package/dist/index.es104.js +0 -25
  117. package/dist/index.es105.js +0 -15
  118. package/dist/index.es106.js +0 -30
  119. package/dist/index.es107.js +0 -7
  120. package/dist/index.es11.js +0 -250
  121. package/dist/index.es12.js +0 -230
  122. package/dist/index.es13.js +0 -34
  123. package/dist/index.es14.js +0 -43
  124. package/dist/index.es15.js +0 -43
  125. package/dist/index.es16.js +0 -115
  126. package/dist/index.es17.js +0 -24
  127. package/dist/index.es18.js +0 -36
  128. package/dist/index.es19.js +0 -137
  129. package/dist/index.es20.js +0 -50
  130. package/dist/index.es21.js +0 -54
  131. package/dist/index.es22.js +0 -74
  132. package/dist/index.es23.js +0 -172
  133. package/dist/index.es24.js +0 -89
  134. package/dist/index.es25.js +0 -113
  135. package/dist/index.es26.js +0 -85
  136. package/dist/index.es27.js +0 -61
  137. package/dist/index.es28.js +0 -73
  138. package/dist/index.es29.js +0 -746
  139. package/dist/index.es30.js +0 -17
  140. package/dist/index.es31.js +0 -2763
  141. package/dist/index.es32.js +0 -62
  142. package/dist/index.es33.js +0 -35
  143. package/dist/index.es34.js +0 -126
  144. package/dist/index.es35.js +0 -862
  145. package/dist/index.es36.js +0 -20
  146. package/dist/index.es37.js +0 -331
  147. package/dist/index.es38.js +0 -132
  148. package/dist/index.es39.js +0 -24
  149. package/dist/index.es4.js +0 -6
  150. package/dist/index.es40.js +0 -243
  151. package/dist/index.es41.js +0 -262
  152. package/dist/index.es42.js +0 -251
  153. package/dist/index.es43.js +0 -238
  154. package/dist/index.es44.js +0 -239
  155. package/dist/index.es45.js +0 -127
  156. package/dist/index.es46.js +0 -163
  157. package/dist/index.es47.js +0 -29
  158. package/dist/index.es48.js +0 -9
  159. package/dist/index.es49.js +0 -70
  160. package/dist/index.es5.js +0 -52
  161. package/dist/index.es50.js +0 -127
  162. package/dist/index.es51.js +0 -17
  163. package/dist/index.es52.js +0 -137
  164. package/dist/index.es53.js +0 -13
  165. package/dist/index.es54.js +0 -221
  166. package/dist/index.es55.js +0 -16
  167. package/dist/index.es56.js +0 -71
  168. package/dist/index.es57.js +0 -36
  169. package/dist/index.es58.js +0 -50
  170. package/dist/index.es59.js +0 -54
  171. package/dist/index.es6.js +0 -66
  172. package/dist/index.es60.js +0 -52
  173. package/dist/index.es61.js +0 -11
  174. package/dist/index.es62.js +0 -11
  175. package/dist/index.es63.js +0 -32
  176. package/dist/index.es64.js +0 -32
  177. package/dist/index.es65.js +0 -48
  178. package/dist/index.es66.js +0 -120
  179. package/dist/index.es67.js +0 -10
  180. package/dist/index.es68.js +0 -183
  181. package/dist/index.es69.js +0 -8
  182. package/dist/index.es7.js +0 -167
  183. package/dist/index.es70.js +0 -27
  184. package/dist/index.es71.js +0 -312
  185. package/dist/index.es72.js +0 -6
  186. package/dist/index.es73.js +0 -50
  187. package/dist/index.es74.js +0 -13
  188. package/dist/index.es75.js +0 -6
  189. package/dist/index.es76.js +0 -50
  190. package/dist/index.es77.js +0 -32
  191. package/dist/index.es78.js +0 -11
  192. package/dist/index.es79.js +0 -50
  193. package/dist/index.es8.js +0 -39
  194. package/dist/index.es80.js +0 -14
  195. package/dist/index.es81.js +0 -208
  196. package/dist/index.es82.js +0 -24
  197. package/dist/index.es83.js +0 -402
  198. package/dist/index.es84.js +0 -17
  199. package/dist/index.es85.js +0 -32
  200. package/dist/index.es86.js +0 -27
  201. package/dist/index.es87.js +0 -31
  202. package/dist/index.es88.js +0 -7
  203. package/dist/index.es89.js +0 -7
  204. package/dist/index.es9.js +0 -33
  205. package/dist/index.es90.js +0 -5
  206. package/dist/index.es91.js +0 -26
  207. package/dist/index.es92.js +0 -112
  208. package/dist/index.es93.js +0 -18
  209. package/dist/index.es94.js +0 -527
  210. package/dist/index.es95.js +0 -130
  211. package/dist/index.es96.js +0 -136
  212. package/dist/index.es97.js +0 -67
  213. package/dist/index.es98.js +0 -71
  214. package/dist/index.es99.js +0 -11
@@ -1,50 +0,0 @@
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
- };
@@ -1,54 +0,0 @@
1
- import * as n from "react";
2
- import { useLayoutEffect as v } from "./index.es75.js";
3
- var E = n[" useInsertionEffect ".trim().toString()] || v;
4
- function y({
5
- prop: t,
6
- defaultProp: u,
7
- onChange: o = () => {
8
- },
9
- caller: i
10
- }) {
11
- const [l, e, r] = w({
12
- defaultProp: u,
13
- onChange: o
14
- }), c = t !== void 0, a = c ? t : l;
15
- {
16
- const s = n.useRef(t !== void 0);
17
- n.useEffect(() => {
18
- const f = s.current;
19
- f !== c && console.warn(
20
- `${i} is changing from ${f ? "controlled" : "uncontrolled"} to ${c ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
21
- ), s.current = c;
22
- }, [c, i]);
23
- }
24
- const m = n.useCallback(
25
- (s) => {
26
- var f;
27
- if (c) {
28
- const d = R(s) ? s(t) : s;
29
- d !== t && ((f = r.current) == null || f.call(r, d));
30
- } else
31
- e(s);
32
- },
33
- [c, t, e, r]
34
- );
35
- return [a, m];
36
- }
37
- function w({
38
- defaultProp: t,
39
- onChange: u
40
- }) {
41
- const [o, i] = n.useState(t), l = n.useRef(o), e = n.useRef(u);
42
- return E(() => {
43
- e.current = u;
44
- }, [u]), n.useEffect(() => {
45
- var r;
46
- l.current !== o && ((r = e.current) == null || r.call(e, o), l.current = o);
47
- }, [o, l]), [o, i, e];
48
- }
49
- function R(t) {
50
- return typeof t == "function";
51
- }
52
- export {
53
- y as useControllableState
54
- };
package/dist/index.es6.js DELETED
@@ -1,66 +0,0 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { Root as n } from "./index.es32.js";
3
- import { cva as a } from "./index.es33.js";
4
- import { Separator as s } from "./index.es17.js";
5
- import { cn as e } from "./index.es4.js";
6
- const i = a(
7
- "volt-group/button-group volt-flex volt-w-fit volt-items-stretch [&>*:focus-visible]:z-10 [&>*:focus-visible]:relative has-[>[data-slot=button-group]]:gap-2",
8
- {
9
- variants: {
10
- orientation: {
11
- horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
12
- vertical: "volt-flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"
13
- }
14
- },
15
- defaultVariants: {
16
- orientation: "horizontal"
17
- }
18
- }
19
- ), f = ({
20
- className: o,
21
- orientation: t,
22
- ...r
23
- }) => /* @__PURE__ */ l(
24
- "div",
25
- {
26
- role: "group",
27
- "data-slot": "button-group",
28
- "data-orientation": t,
29
- className: e(i({ orientation: t }), o),
30
- ...r
31
- }
32
- ), h = ({
33
- className: o,
34
- asChild: t = !1,
35
- ...r
36
- }) => /* @__PURE__ */ l(
37
- t ? n : "div",
38
- {
39
- className: e(
40
- "volt-bg-gray-a4 volt-flex volt-items-center volt-gap-2 volt-rounded-md volt-border volt-px-4 volt-py-3 volt-text-sm volt-font-medium volt-shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='volt-size-'])]:size-4",
41
- o
42
- ),
43
- ...r
44
- }
45
- ), b = ({
46
- className: o,
47
- orientation: t = "vertical",
48
- ...r
49
- }) => /* @__PURE__ */ l(
50
- s,
51
- {
52
- "data-slot": "volt-button-group-separator",
53
- orientation: t,
54
- className: e(
55
- "volt-m-0 volt-relative volt-self-stretch volt-data-[orientation=vertical]:h-px",
56
- o
57
- ),
58
- ...r
59
- }
60
- );
61
- export {
62
- f as ButtonGroup,
63
- b as ButtonGroupSeparator,
64
- h as ButtonGroupText,
65
- i as buttonGroupVariants
66
- };
@@ -1,52 +0,0 @@
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
- };
@@ -1,11 +0,0 @@
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
- };
@@ -1,11 +0,0 @@
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
- };
@@ -1,32 +0,0 @@
1
- import * as a from "react";
2
- import { Primitive as o } from "./index.es57.js";
3
- import { jsx as t } from "react/jsx-runtime";
4
- var d = Object.freeze({
5
- // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
6
- position: "absolute",
7
- border: 0,
8
- width: 1,
9
- height: 1,
10
- padding: 0,
11
- margin: -1,
12
- overflow: "hidden",
13
- clip: "rect(0, 0, 0, 0)",
14
- whiteSpace: "nowrap",
15
- wordWrap: "normal"
16
- }), l = "VisuallyHidden", e = a.forwardRef(
17
- (r, i) => /* @__PURE__ */ t(
18
- o.span,
19
- {
20
- ...r,
21
- ref: i,
22
- style: { ...d, ...r.style }
23
- }
24
- )
25
- );
26
- e.displayName = l;
27
- var p = e;
28
- export {
29
- p as Root,
30
- d as VISUALLY_HIDDEN_STYLES,
31
- e as VisuallyHidden
32
- };
@@ -1,32 +0,0 @@
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
- };
@@ -1,48 +0,0 @@
1
- import r from "react";
2
- import { createContextScope as y } from "./index.es49.js";
3
- import { useComposedRefs as M } from "./index.es47.js";
4
- import { createSlot as x } from "./index.es79.js";
5
- import { jsx as u } from "react/jsx-runtime";
6
- function g(s) {
7
- const m = s + "CollectionProvider", [A, N] = y(m), [_, f] = A(
8
- m,
9
- { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
10
- ), p = (c) => {
11
- const { scope: e, children: l } = c, o = r.useRef(null), t = r.useRef(/* @__PURE__ */ new Map()).current;
12
- return /* @__PURE__ */ u(_, { scope: e, itemMap: t, collectionRef: o, children: l });
13
- };
14
- p.displayName = m;
15
- const a = s + "CollectionSlot", E = x(a), C = r.forwardRef(
16
- (c, e) => {
17
- const { scope: l, children: o } = c, t = f(a, l), n = M(e, t.collectionRef);
18
- return /* @__PURE__ */ u(E, { ref: n, children: o });
19
- }
20
- );
21
- C.displayName = a;
22
- const d = s + "CollectionItemSlot", R = "data-radix-collection-item", T = x(d), I = r.forwardRef(
23
- (c, e) => {
24
- const { scope: l, children: o, ...t } = c, n = r.useRef(null), S = M(e, n), i = f(d, l);
25
- return r.useEffect(() => (i.itemMap.set(n, { ref: n, ...t }), () => void i.itemMap.delete(n))), /* @__PURE__ */ u(T, { [R]: "", ref: S, children: o });
26
- }
27
- );
28
- I.displayName = d;
29
- function O(c) {
30
- const e = f(s + "CollectionConsumer", c);
31
- return r.useCallback(() => {
32
- const o = e.collectionRef.current;
33
- if (!o) return [];
34
- const t = Array.from(o.querySelectorAll(`[${R}]`));
35
- return Array.from(e.itemMap.values()).sort(
36
- (i, v) => t.indexOf(i.ref.current) - t.indexOf(v.ref.current)
37
- );
38
- }, [e.collectionRef, e.itemMap]);
39
- }
40
- return [
41
- { Provider: p, Slot: C, ItemSlot: I },
42
- O,
43
- N
44
- ];
45
- }
46
- export {
47
- g as createCollection
48
- };
@@ -1,120 +0,0 @@
1
- import * as o from "react";
2
- import { composeEventHandlers as T } from "./index.es48.js";
3
- import { createContextScope as S } from "./index.es49.js";
4
- import { useControllableState as D } from "./index.es59.js";
5
- import { useLayoutEffect as L } from "./index.es75.js";
6
- import { useComposedRefs as M } from "./index.es47.js";
7
- import { Primitive as v } from "./index.es57.js";
8
- import { Presence as k } from "./index.es56.js";
9
- import { useId as F } from "./index.es53.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
- };
@@ -1,10 +0,0 @@
1
- import * as t from "react";
2
- import "react/jsx-runtime";
3
- var r = t.createContext(void 0);
4
- function n(o) {
5
- const e = t.useContext(r);
6
- return o || e || "ltr";
7
- }
8
- export {
9
- n as useDirection
10
- };
@@ -1,183 +0,0 @@
1
- import * as c from "react";
2
- import { composeEventHandlers as p } from "./index.es48.js";
3
- import { createCollection as V } from "./index.es65.js";
4
- import { useComposedRefs as j } from "./index.es47.js";
5
- import { createContextScope as z } from "./index.es49.js";
6
- import { useId as q } from "./index.es53.js";
7
- import { Primitive as G } from "./index.es57.js";
8
- import { useCallbackRef as J } from "./index.es74.js";
9
- import { useControllableState as Q } from "./index.es59.js";
10
- import { useDirection as W } from "./index.es67.js";
11
- import { jsx as d } from "react/jsx-runtime";
12
- var y = "rovingFocusGroup.onEntryFocus", X = { bubbles: !1, cancelable: !0 }, I = "RovingFocusGroup", [D, N, Z] = V(I), [$, Fe] = z(
13
- I,
14
- [Z]
15
- ), [ee, oe] = $(I), O = c.forwardRef(
16
- (e, r) => /* @__PURE__ */ d(D.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d(D.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d(te, { ...e, ref: r }) }) })
17
- );
18
- O.displayName = I;
19
- var te = c.forwardRef((e, r) => {
20
- const {
21
- __scopeRovingFocusGroup: s,
22
- orientation: o,
23
- loop: T = !1,
24
- dir: w,
25
- currentTabStopId: v,
26
- defaultCurrentTabStopId: C,
27
- onCurrentTabStopIdChange: S,
28
- onEntryFocus: m,
29
- preventScrollOnEntryFocus: u = !1,
30
- ...b
31
- } = e, F = c.useRef(null), g = j(r, F), R = W(w), [E, t] = Q({
32
- prop: v,
33
- defaultProp: C ?? null,
34
- onChange: S,
35
- caller: I
36
- }), [i, h] = c.useState(!1), a = J(m), l = N(s), A = c.useRef(!1), [L, P] = c.useState(0);
37
- return c.useEffect(() => {
38
- const n = F.current;
39
- if (n)
40
- return n.addEventListener(y, a), () => n.removeEventListener(y, a);
41
- }, [a]), /* @__PURE__ */ d(
42
- ee,
43
- {
44
- scope: s,
45
- orientation: o,
46
- dir: R,
47
- loop: T,
48
- currentTabStopId: E,
49
- onItemFocus: c.useCallback(
50
- (n) => t(n),
51
- [t]
52
- ),
53
- onItemShiftTab: c.useCallback(() => h(!0), []),
54
- onFocusableItemAdd: c.useCallback(
55
- () => P((n) => n + 1),
56
- []
57
- ),
58
- onFocusableItemRemove: c.useCallback(
59
- () => P((n) => n - 1),
60
- []
61
- ),
62
- children: /* @__PURE__ */ d(
63
- G.div,
64
- {
65
- tabIndex: i || L === 0 ? -1 : 0,
66
- "data-orientation": o,
67
- ...b,
68
- ref: g,
69
- style: { outline: "none", ...e.style },
70
- onMouseDown: p(e.onMouseDown, () => {
71
- A.current = !0;
72
- }),
73
- onFocus: p(e.onFocus, (n) => {
74
- const U = !A.current;
75
- if (n.target === n.currentTarget && U && !i) {
76
- const x = new CustomEvent(y, X);
77
- if (n.currentTarget.dispatchEvent(x), !x.defaultPrevented) {
78
- const _ = l().filter((f) => f.focusable), B = _.find((f) => f.active), Y = _.find((f) => f.id === E), H = [B, Y, ..._].filter(
79
- Boolean
80
- ).map((f) => f.ref.current);
81
- k(H, u);
82
- }
83
- }
84
- A.current = !1;
85
- }),
86
- onBlur: p(e.onBlur, () => h(!1))
87
- }
88
- )
89
- }
90
- );
91
- }), K = "RovingFocusGroupItem", M = c.forwardRef(
92
- (e, r) => {
93
- const {
94
- __scopeRovingFocusGroup: s,
95
- focusable: o = !0,
96
- active: T = !1,
97
- tabStopId: w,
98
- children: v,
99
- ...C
100
- } = e, S = q(), m = w || S, u = oe(K, s), b = u.currentTabStopId === m, F = N(s), { onFocusableItemAdd: g, onFocusableItemRemove: R, currentTabStopId: E } = u;
101
- return c.useEffect(() => {
102
- if (o)
103
- return g(), () => R();
104
- }, [o, g, R]), /* @__PURE__ */ d(
105
- D.ItemSlot,
106
- {
107
- scope: s,
108
- id: m,
109
- focusable: o,
110
- active: T,
111
- children: /* @__PURE__ */ d(
112
- G.span,
113
- {
114
- tabIndex: b ? 0 : -1,
115
- "data-orientation": u.orientation,
116
- ...C,
117
- ref: r,
118
- onMouseDown: p(e.onMouseDown, (t) => {
119
- o ? u.onItemFocus(m) : t.preventDefault();
120
- }),
121
- onFocus: p(e.onFocus, () => u.onItemFocus(m)),
122
- onKeyDown: p(e.onKeyDown, (t) => {
123
- if (t.key === "Tab" && t.shiftKey) {
124
- u.onItemShiftTab();
125
- return;
126
- }
127
- if (t.target !== t.currentTarget) return;
128
- const i = ce(t, u.orientation, u.dir);
129
- if (i !== void 0) {
130
- if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey) return;
131
- t.preventDefault();
132
- let a = F().filter((l) => l.focusable).map((l) => l.ref.current);
133
- if (i === "last") a.reverse();
134
- else if (i === "prev" || i === "next") {
135
- i === "prev" && a.reverse();
136
- const l = a.indexOf(t.currentTarget);
137
- a = u.loop ? se(a, l + 1) : a.slice(l + 1);
138
- }
139
- setTimeout(() => k(a));
140
- }
141
- }),
142
- children: typeof v == "function" ? v({ isCurrentTabStop: b, hasTabStop: E != null }) : v
143
- }
144
- )
145
- }
146
- );
147
- }
148
- );
149
- M.displayName = K;
150
- var re = {
151
- ArrowLeft: "prev",
152
- ArrowUp: "prev",
153
- ArrowRight: "next",
154
- ArrowDown: "next",
155
- PageUp: "first",
156
- Home: "first",
157
- PageDown: "last",
158
- End: "last"
159
- };
160
- function ne(e, r) {
161
- return r !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
162
- }
163
- function ce(e, r, s) {
164
- const o = ne(e.key, s);
165
- if (!(r === "vertical" && ["ArrowLeft", "ArrowRight"].includes(o)) && !(r === "horizontal" && ["ArrowUp", "ArrowDown"].includes(o)))
166
- return re[o];
167
- }
168
- function k(e, r = !1) {
169
- const s = document.activeElement;
170
- for (const o of e)
171
- if (o === s || (o.focus({ preventScroll: r }), document.activeElement !== s)) return;
172
- }
173
- function se(e, r) {
174
- return e.map((s, o) => e[(r + o) % e.length]);
175
- }
176
- var ge = O, Re = M;
177
- export {
178
- Re as Item,
179
- ge as Root,
180
- O as RovingFocusGroup,
181
- M as RovingFocusGroupItem,
182
- Fe as createRovingFocusGroupScope
183
- };
@@ -1,8 +0,0 @@
1
- import * as u from "react";
2
- function t(r) {
3
- const e = u.useRef({ value: r, previous: r });
4
- return u.useMemo(() => (e.current.value !== r && (e.current.previous = e.current.value, e.current.value = r), e.current.previous), [r]);
5
- }
6
- export {
7
- t as usePrevious
8
- };