@wrdagency/blockout 0.0.19 → 0.1.0

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 (167) hide show
  1. package/dist/2NBKRL7C-7XoDiJp9.js +85 -0
  2. package/dist/2RSXSRCN-qt84MtKs.js +61 -0
  3. package/dist/4CMBR7SL-BHIN8rB4.js +308 -0
  4. package/dist/5JTVDSTH-CG1NL6Fw.js +174 -0
  5. package/dist/5VQZOHHZ-CscZGerP.js +59 -0
  6. package/dist/6VRAQV3D-Clhw_nNS.js +201 -0
  7. package/dist/7PRQYBBV-91wrWGjk.js +17 -0
  8. package/dist/ArrowRight.es-xyNbtVOa.js +60 -0
  9. package/dist/DG5U6ZEL-CVj-Czp2.js +17 -0
  10. package/dist/F5MUBM3I-87B2_4WK.js +54 -0
  11. package/dist/LMDWO4NN--KEvZePp.js +610 -0
  12. package/dist/MTZPJQMC-DyCWBG18.js +14 -0
  13. package/dist/P7GR5CS5-BoOYUfSQ.js +19 -0
  14. package/dist/PFRGBC2K-BEg8ahbY.js +303 -0
  15. package/dist/RS7LB2H4-D0fWv5qu.js +15 -0
  16. package/dist/RZ4GPYOB-13-5LlEb.js +37 -0
  17. package/dist/S43UC3DV-Dn8EFLaT.js +22 -0
  18. package/dist/Square.es-KJLdY11q.js +72 -0
  19. package/dist/T7VMP3TM-DeRMoW8g.js +77 -0
  20. package/dist/TP7N7UIH-BHb1rEeb.js +34 -0
  21. package/dist/UQQRIHDV-Bu8e1bYU.js +69 -0
  22. package/dist/UYGDZTLQ-DcCmv5SE.js +12 -0
  23. package/dist/VIIRIBF3-D5DmZNtI.js +26 -0
  24. package/dist/WMYDSCNQ-DECXdiUT.js +1346 -0
  25. package/dist/WYCIER3C-8jmp2F15.js +175 -0
  26. package/dist/YV4JVR4I-LkUIiJWj.js +351 -0
  27. package/dist/assets/button.css +1 -1
  28. package/dist/assets/index.css +1 -1
  29. package/dist/assets/index10.css +1 -1
  30. package/dist/assets/index11.css +1 -1
  31. package/dist/assets/index12.css +1 -1
  32. package/dist/assets/index13.css +1 -1
  33. package/dist/assets/index14.css +1 -0
  34. package/dist/assets/index15.css +1 -0
  35. package/dist/assets/index16.css +1 -0
  36. package/dist/assets/index17.css +1 -0
  37. package/dist/assets/index18.css +1 -0
  38. package/dist/assets/index19.css +1 -0
  39. package/dist/assets/index2.css +1 -1
  40. package/dist/assets/index3.css +1 -1
  41. package/dist/assets/index4.css +1 -1
  42. package/dist/assets/index5.css +1 -1
  43. package/dist/assets/index6.css +1 -1
  44. package/dist/assets/index7.css +1 -1
  45. package/dist/assets/index8.css +1 -1
  46. package/dist/assets/index9.css +1 -1
  47. package/dist/assets/style.css +1 -1
  48. package/dist/assets/style2.css +1 -0
  49. package/dist/assets/style3.css +1 -0
  50. package/dist/assets/style4.css +1 -0
  51. package/dist/assets/styles.css +1 -1
  52. package/dist/components/block-editor/editor.d.ts +5 -0
  53. package/dist/components/block-editor/editor.js +6 -0
  54. package/dist/components/block-editor/index.d.ts +1 -0
  55. package/dist/components/block-editor/index.js +4 -0
  56. package/dist/components/breadcrumbs/index.js +87 -31
  57. package/dist/components/button/button.d.ts +1 -1
  58. package/dist/components/button/button.js +5 -5
  59. package/dist/components/button/icon.d.ts +1 -2
  60. package/dist/components/button/icon.js +10 -3
  61. package/dist/components/button/index.d.ts +4 -0
  62. package/dist/components/controls/base-control/affix.js +7 -7
  63. package/dist/components/controls/base-control/index.js +11 -11
  64. package/dist/components/controls/base-popover-control/index.d.ts +9 -0
  65. package/dist/components/controls/base-popover-control/index.js +47 -0
  66. package/dist/components/controls/checkbox-control/index.d.ts +8 -0
  67. package/dist/components/controls/checkbox-control/index.js +57 -0
  68. package/dist/components/controls/choice-control/choice.js +13 -11
  69. package/dist/components/controls/choice-control/index.js +1 -1
  70. package/dist/components/controls/index.d.ts +4 -1
  71. package/dist/components/controls/index.js +25 -16
  72. package/dist/components/controls/number-control/index.js +29 -27
  73. package/dist/components/controls/password-control/index.js +1 -1
  74. package/dist/components/controls/recurrence-control/index.d.ts +8 -0
  75. package/dist/components/controls/recurrence-control/index.js +208 -0
  76. package/dist/components/controls/select-control/component.d.ts +12 -0
  77. package/dist/components/controls/select-control/component.js +1879 -0
  78. package/dist/components/controls/select-control/index.d.ts +2 -12
  79. package/dist/components/controls/select-control/index.js +5 -1860
  80. package/dist/components/controls/select-control/options.d.ts +7 -0
  81. package/dist/components/controls/select-control/options.js +9 -0
  82. package/dist/components/controls/textarea-control/index.js +1 -1
  83. package/dist/components/controls/toggle-control/index.js +11 -9
  84. package/dist/components/controls/toggle-group-control/index.d.ts +19 -0
  85. package/dist/components/controls/toggle-group-control/index.js +50 -0
  86. package/dist/components/data-table/header.js +120 -171
  87. package/dist/components/data-table/index.js +1 -1
  88. package/dist/components/filesystem/file.d.ts +7 -0
  89. package/dist/components/filesystem/file.js +44 -0
  90. package/dist/components/filesystem/folder.d.ts +6 -0
  91. package/dist/components/filesystem/folder.js +160 -0
  92. package/dist/components/filesystem/icon.d.ts +7 -0
  93. package/dist/components/filesystem/icon.js +908 -0
  94. package/dist/components/filesystem/index.js +14 -0
  95. package/dist/components/filesystem/list.d.ts +4 -0
  96. package/dist/components/filesystem/list.js +18 -0
  97. package/dist/components/filesystem/root.d.ts +3 -0
  98. package/dist/components/filesystem/root.js +7 -0
  99. package/dist/components/form/components/index.js +12 -12
  100. package/dist/components/form/components/pagination.js +23 -16
  101. package/dist/components/index.d.ts +5 -0
  102. package/dist/components/index.js +50 -31
  103. package/dist/components/markdown/{index.d.ts → editor/component.d.ts} +2 -2
  104. package/dist/components/markdown/editor/component.js +25583 -0
  105. package/dist/components/markdown/editor/index.d.ts +1 -0
  106. package/dist/components/markdown/editor/index.js +4 -0
  107. package/dist/components/markdown/formats.js +29 -27
  108. package/dist/components/markdown/index.js +5 -25842
  109. package/dist/components/markdown/prose.d.ts +3 -0
  110. package/dist/components/markdown/prose.js +15 -0
  111. package/dist/components/menu/index.js +24 -23
  112. package/dist/components/menu/item.js +1 -1
  113. package/dist/components/menu/items/action.js +1 -1
  114. package/dist/components/menu/items/spacer.js +14 -42
  115. package/dist/components/menu/items/submenu.js +2 -2
  116. package/dist/components/menu/items/toggle.js +25 -91
  117. package/dist/components/progress/index.js +1 -1
  118. package/dist/components/tabs/index.js +12 -0
  119. package/dist/components/tabs/list.d.ts +7 -0
  120. package/dist/components/tabs/list.js +42 -0
  121. package/dist/components/tabs/panel.d.ts +8 -0
  122. package/dist/components/tabs/panel.js +132 -0
  123. package/dist/components/tabs/root.d.ts +9 -0
  124. package/dist/components/tabs/root.js +173 -0
  125. package/dist/components/tabs/tab.d.ts +7 -0
  126. package/dist/components/tabs/tab.js +81 -0
  127. package/dist/components/toolbar/index.js +27 -0
  128. package/dist/components/toolbar/root.d.ts +6 -0
  129. package/dist/components/toolbar/root.js +6 -0
  130. package/dist/composite-provider-DxKEAxsZ.js +10 -0
  131. package/dist/floating-ui.dom-BqewRPVB.js +1124 -0
  132. package/dist/hooks/state.d.ts +4 -0
  133. package/dist/hooks/state.js +7 -0
  134. package/dist/hooks/theme.js +7 -38
  135. package/dist/index-1AjPIqTN.js +73 -0
  136. package/dist/index-B5y9bioP.js +258 -0
  137. package/dist/index-BI5rPXbu.js +391 -0
  138. package/dist/index.js +63 -40
  139. package/dist/{item-D9r2-3fk.js → item-BrZqCoM7.js} +240 -234
  140. package/dist/options-Cfoqhxw2.js +96 -0
  141. package/dist/primitives/index.d.ts +2 -0
  142. package/dist/primitives/index.js +4 -0
  143. package/dist/primitives/resizable/index.js +1 -1
  144. package/dist/primitives/scroll-area/index.d.ts +7 -0
  145. package/dist/primitives/scroll-area/index.js +545 -0
  146. package/dist/primitives/truncate/index.d.ts +7 -0
  147. package/dist/primitives/truncate/index.js +46 -0
  148. package/dist/primitives/visually-hidden/index.d.ts +2 -2
  149. package/dist/primitives/visually-hidden/index.js +13 -3
  150. package/dist/root-CdR32nP9.js +73 -0
  151. package/dist/tslib.es6-DN7pKd6F.js +44 -0
  152. package/dist/types/date.d.ts +39 -0
  153. package/dist/types/date.js +1749 -0
  154. package/dist/types/options.d.ts +8 -6
  155. package/dist/utils/components.d.ts +5 -0
  156. package/dist/utils/components.js +14 -0
  157. package/dist/utils/date.d.ts +1 -0
  158. package/dist/utils/date.js +15 -0
  159. package/dist/utils/string.d.ts +4 -0
  160. package/dist/utils/string.js +18 -0
  161. package/package.json +4 -1
  162. package/dist/2NBKRL7C-D-Q0qGRV.js +0 -81
  163. package/dist/P7GR5CS5-qyeuZVEs.js +0 -640
  164. package/dist/T7VMP3TM-BxgFbvdx.js +0 -2106
  165. package/dist/UQQRIHDV-BGs025hb.js +0 -1046
  166. package/dist/VIIRIBF3-D9clDhln.js +0 -21
  167. package/dist/floating-ui.dom-9sqP7IwC.js +0 -1512
@@ -0,0 +1,85 @@
1
+ import { a as _ } from "./VIIRIBF3-D5DmZNtI.js";
2
+ import { C as H, a as P } from "./P7GR5CS5-BoOYUfSQ.js";
3
+ import { c as T, r as y, f as k, a as w, q as A, _ as D, i as N, j as R, e as F, P as j, Q as q, R as B, m as C, o as f, D as K } from "./LMDWO4NN--KEvZePp.js";
4
+ import { createContext as V } from "react";
5
+ import { u as W } from "./UQQRIHDV-Bu8e1bYU.js";
6
+ import { u as L } from "./6VRAQV3D-Clhw_nNS.js";
7
+ import { a as Q } from "./YV4JVR4I-LkUIiJWj.js";
8
+ import { a as x } from "./PFRGBC2K-BEg8ahbY.js";
9
+ var g = T(
10
+ [P],
11
+ [H]
12
+ ), oe = g.useContext, z = g.useScopedContext;
13
+ V(
14
+ void 0
15
+ );
16
+ var G = "div";
17
+ function J(a, o, u) {
18
+ var r;
19
+ if (!a) return !1;
20
+ if (x(a)) return !0;
21
+ const i = o == null ? void 0 : o.find((t) => {
22
+ var l;
23
+ return t.element === u ? !1 : ((l = t.element) == null ? void 0 : l.getAttribute("aria-expanded")) === "true";
24
+ }), c = (r = i == null ? void 0 : i.element) == null ? void 0 : r.getAttribute("aria-controls");
25
+ if (!c) return !1;
26
+ const n = K(a).getElementById(c);
27
+ return n ? x(n) ? !0 : !!n.querySelector("[role=menuitem][aria-expanded=true]") : !1;
28
+ }
29
+ var U = w(
30
+ function(o) {
31
+ var u = o, {
32
+ store: r,
33
+ hideOnClick: i = !0,
34
+ preventScrollOnKeyDown: c = !0,
35
+ focusOnHover: s,
36
+ blurOnHoverEnd: n
37
+ } = u, t = D(u, [
38
+ "store",
39
+ "hideOnClick",
40
+ "preventScrollOnKeyDown",
41
+ "focusOnHover",
42
+ "blurOnHoverEnd"
43
+ ]);
44
+ const l = _(!0), M = z();
45
+ r = r || l || M, N(
46
+ r,
47
+ process.env.NODE_ENV !== "production" && "MenuItem must be wrapped in a MenuList, Menu or Menubar component"
48
+ );
49
+ const m = t.onClick, b = R(i), p = "hideAll" in r ? r.hideAll : void 0, d = !!p, O = F((e) => {
50
+ m == null || m(e), !(e.defaultPrevented || j(e) || q(e) || !p || e.currentTarget.getAttribute("aria-haspopup") === "menu") && b(e) && p();
51
+ }), h = Q(
52
+ r,
53
+ (e) => "contentElement" in e ? e.contentElement : null
54
+ ), E = B(h, "menuitem");
55
+ return t = C(f({
56
+ role: E
57
+ }, t), {
58
+ onClick: O
59
+ }), t = L(f({
60
+ store: r,
61
+ preventScrollOnKeyDown: c
62
+ }, t)), t = W(C(f({
63
+ store: r
64
+ }, t), {
65
+ focusOnHover(e) {
66
+ const v = () => typeof s == "function" ? s(e) : s ?? !0;
67
+ if (!r || !v()) return !1;
68
+ const { baseElement: I, items: S } = r.getState();
69
+ return d ? (e.currentTarget.hasAttribute("aria-expanded") && e.currentTarget.focus(), !0) : J(I, S, e.currentTarget) ? (e.currentTarget.focus(), !0) : !1;
70
+ },
71
+ blurOnHoverEnd(e) {
72
+ return typeof n == "function" ? n(e) : n ?? d;
73
+ }
74
+ })), t;
75
+ }
76
+ ), ue = y(
77
+ k(function(o) {
78
+ const u = U(o);
79
+ return A(G, u);
80
+ })
81
+ );
82
+ export {
83
+ ue as M,
84
+ oe as u
85
+ };
@@ -0,0 +1,61 @@
1
+ import { u as A } from "./PFRGBC2K-BEg8ahbY.js";
2
+ import { a as B, _ as m, C as p, t as O, F as x, e as _, h as H, k as Y, G as j, H as G, I as C, m as L, n as V, o as T, f as z, q as J } from "./LMDWO4NN--KEvZePp.js";
3
+ import { useRef as w, useState as D, useEffect as Q } from "react";
4
+ var W = "button";
5
+ function M(s) {
6
+ if (!s.isTrusted) return !1;
7
+ const t = s.currentTarget;
8
+ return s.key === "Enter" ? p(t) || t.tagName === "SUMMARY" || t.tagName === "A" : s.key === " " ? p(t) || t.tagName === "SUMMARY" || t.tagName === "INPUT" || t.tagName === "SELECT" : !1;
9
+ }
10
+ var X = Symbol("command"), Z = B(
11
+ function(t) {
12
+ var o = t, { clickOnEnter: d = !0, clickOnSpace: u = !0 } = o, r = m(o, ["clickOnEnter", "clickOnSpace"]);
13
+ const c = w(null), [K, R] = D(!1);
14
+ Q(() => {
15
+ c.current && R(p(c.current));
16
+ }, []);
17
+ const [U, k] = D(!1), f = w(!1), y = O(r), [E, F] = x(r, X, !0), P = r.onKeyDown, I = _((e) => {
18
+ P == null || P(e);
19
+ const a = e.currentTarget;
20
+ if (e.defaultPrevented || E || y || !H(e) || Y(a) || a.isContentEditable) return;
21
+ const i = d && e.key === "Enter", n = u && e.key === " ", v = e.key === "Enter" && !d, l = e.key === " " && !u;
22
+ if (v || l) {
23
+ e.preventDefault();
24
+ return;
25
+ }
26
+ if (i || n) {
27
+ const S = M(e);
28
+ if (i) {
29
+ if (!S) {
30
+ e.preventDefault();
31
+ const b = e, { view: $ } = b, q = m(b, ["view"]), N = () => C(a, q);
32
+ j() ? G(a, "keyup", N) : queueMicrotask(N);
33
+ }
34
+ } else n && (f.current = !0, S || (e.preventDefault(), k(!0)));
35
+ }
36
+ }), g = r.onKeyUp, h = _((e) => {
37
+ if (g == null || g(e), e.defaultPrevented || E || y || e.metaKey) return;
38
+ const a = u && e.key === " ";
39
+ if (f.current && a && (f.current = !1, !M(e))) {
40
+ e.preventDefault(), k(!1);
41
+ const i = e.currentTarget, n = e, { view: v } = n, l = m(n, ["view"]);
42
+ queueMicrotask(() => C(i, l));
43
+ }
44
+ });
45
+ return r = L(T(T({
46
+ "data-active": U || void 0,
47
+ type: K ? "button" : void 0
48
+ }, F), r), {
49
+ ref: V(c, r.ref),
50
+ onKeyDown: I,
51
+ onKeyUp: h
52
+ }), r = A(r), r;
53
+ }
54
+ );
55
+ z(function(t) {
56
+ const o = Z(t);
57
+ return J(W, o);
58
+ });
59
+ export {
60
+ Z as u
61
+ };
@@ -0,0 +1,308 @@
1
+ import { t as H, c as k, s as M, i as K, g as $, f as _, b as Q, e as p } from "./YV4JVR4I-LkUIiJWj.js";
2
+ import { X as S, Y as R, a0 as ee, U as L, J as te, D as ne, Z as re, s as ie, o as se } from "./LMDWO4NN--KEvZePp.js";
3
+ import { r as q, f as oe } from "./7PRQYBBV-91wrWGjk.js";
4
+ function le(e) {
5
+ var i;
6
+ const t = e.find((a) => !!a.element), o = [...e].reverse().find((a) => !!a.element);
7
+ let s = (i = t == null ? void 0 : t.element) == null ? void 0 : i.parentElement;
8
+ for (; s && (o != null && o.element); ) {
9
+ if (o && s.contains(o.element))
10
+ return s;
11
+ s = s.parentElement;
12
+ }
13
+ return ne(s).body;
14
+ }
15
+ function ae(e) {
16
+ return e == null ? void 0 : e.__unstablePrivateStore;
17
+ }
18
+ function de(e = {}) {
19
+ var i;
20
+ H(e, e.store);
21
+ const t = (i = e.store) == null ? void 0 : i.getState(), o = S(
22
+ e.items,
23
+ t == null ? void 0 : t.items,
24
+ e.defaultItems,
25
+ []
26
+ ), s = new Map(o.map((r) => [r.id, r])), a = {
27
+ items: o,
28
+ renderedItems: S(t == null ? void 0 : t.renderedItems, [])
29
+ }, d = ae(e.store), c = k(
30
+ { items: o, renderedItems: a.renderedItems },
31
+ d
32
+ ), n = k(a, e.store), x = (r) => {
33
+ const l = te(r, (u) => u.element);
34
+ c.setState("renderedItems", l), n.setState("renderedItems", l);
35
+ };
36
+ M(n, () => K(c)), M(c, () => $(c, ["items"], (r) => {
37
+ n.setState("items", r.items);
38
+ })), M(c, () => $(c, ["renderedItems"], (r) => {
39
+ let l = !0, u = requestAnimationFrame(() => {
40
+ const { renderedItems: m } = n.getState();
41
+ r.renderedItems !== m && x(r.renderedItems);
42
+ });
43
+ if (typeof IntersectionObserver != "function")
44
+ return () => cancelAnimationFrame(u);
45
+ const g = () => {
46
+ if (l) {
47
+ l = !1;
48
+ return;
49
+ }
50
+ cancelAnimationFrame(u), u = requestAnimationFrame(() => x(r.renderedItems));
51
+ }, F = le(r.renderedItems), f = new IntersectionObserver(g, { root: F });
52
+ for (const m of r.renderedItems)
53
+ m.element && f.observe(m.element);
54
+ return () => {
55
+ cancelAnimationFrame(u), f.disconnect();
56
+ };
57
+ }));
58
+ const E = (r, l, u = !1) => {
59
+ let g;
60
+ return l((f) => {
61
+ const m = f.findIndex(({ id: b }) => b === r.id), w = f.slice();
62
+ if (m !== -1) {
63
+ g = f[m];
64
+ const b = L(L({}, g), r);
65
+ w[m] = b, s.set(r.id, b);
66
+ } else
67
+ w.push(r), s.set(r.id, r);
68
+ return w;
69
+ }), () => {
70
+ l((f) => {
71
+ if (!g)
72
+ return u && s.delete(r.id), f.filter(({ id: b }) => b !== r.id);
73
+ const m = f.findIndex(({ id: b }) => b === r.id);
74
+ if (m === -1) return f;
75
+ const w = f.slice();
76
+ return w[m] = g, s.set(r.id, g), w;
77
+ });
78
+ };
79
+ }, P = (r) => E(
80
+ r,
81
+ (l) => c.setState("items", l),
82
+ !0
83
+ );
84
+ return R(L({}, n), {
85
+ registerItem: P,
86
+ renderItem: (r) => ee(
87
+ P(r),
88
+ E(
89
+ r,
90
+ (l) => c.setState("renderedItems", l)
91
+ )
92
+ ),
93
+ item: (r) => {
94
+ if (!r) return null;
95
+ let l = s.get(r);
96
+ if (!l) {
97
+ const { items: u } = c.getState();
98
+ l = u.find((g) => g.id === r), l && s.set(r, l);
99
+ }
100
+ return l || null;
101
+ },
102
+ // @ts-expect-error Internal
103
+ __unstablePrivateStore: c
104
+ });
105
+ }
106
+ function ue(e, i, t) {
107
+ return re(i, [t.store]), _(e, t, "items", "setItems"), e;
108
+ }
109
+ var ce = { id: null };
110
+ function h(e, i) {
111
+ return e.find((t) => i ? !t.disabled && t.id !== i : !t.disabled);
112
+ }
113
+ function fe(e, i) {
114
+ return e.filter((t) => i ? !t.disabled && t.id !== i : !t.disabled);
115
+ }
116
+ function Y(e, i) {
117
+ return e.filter((t) => t.rowId === i);
118
+ }
119
+ function me(e, i, t = !1) {
120
+ const o = e.findIndex((s) => s.id === i);
121
+ return [
122
+ ...e.slice(o + 1),
123
+ ...t ? [ce] : [],
124
+ ...e.slice(0, o)
125
+ ];
126
+ }
127
+ function G(e) {
128
+ const i = [];
129
+ for (const t of e) {
130
+ const o = i.find((s) => {
131
+ var a;
132
+ return ((a = s[0]) == null ? void 0 : a.rowId) === t.rowId;
133
+ });
134
+ o ? o.push(t) : i.push([t]);
135
+ }
136
+ return i;
137
+ }
138
+ function J(e) {
139
+ let i = 0;
140
+ for (const { length: t } of e)
141
+ t > i && (i = t);
142
+ return i;
143
+ }
144
+ function ve(e) {
145
+ return {
146
+ id: "__EMPTY_ITEM__",
147
+ disabled: !0,
148
+ rowId: e
149
+ };
150
+ }
151
+ function Ie(e, i, t) {
152
+ const o = J(e);
153
+ for (const s of e)
154
+ for (let a = 0; a < o; a += 1) {
155
+ const d = s[a];
156
+ if (!d || t && d.disabled) {
157
+ const n = a === 0 && t ? h(s) : s[a - 1];
158
+ s[a] = n && i !== n.id && t ? n : ve(n == null ? void 0 : n.rowId);
159
+ }
160
+ }
161
+ return e;
162
+ }
163
+ function Se(e) {
164
+ const i = G(e), t = J(i), o = [];
165
+ for (let s = 0; s < t; s += 1)
166
+ for (const a of i) {
167
+ const d = a[s];
168
+ d && o.push(R(L({}, d), {
169
+ // If there's no rowId, it means that it's not a grid composite, but
170
+ // a single row instead. So, instead of verticalizing it, that is,
171
+ // assigning a different rowId based on the column index, we keep it
172
+ // undefined so they will be part of the same row. This is useful
173
+ // when using up/down on one-dimensional composites.
174
+ rowId: d.rowId ? `${s}` : void 0
175
+ }));
176
+ }
177
+ return o;
178
+ }
179
+ function ge(e = {}) {
180
+ var i;
181
+ const t = (i = e.store) == null ? void 0 : i.getState(), o = de(e), s = S(
182
+ e.activeId,
183
+ t == null ? void 0 : t.activeId,
184
+ e.defaultActiveId
185
+ ), a = R(L({}, o.getState()), {
186
+ id: S(
187
+ e.id,
188
+ t == null ? void 0 : t.id,
189
+ `id-${Math.random().toString(36).slice(2, 8)}`
190
+ ),
191
+ activeId: s,
192
+ baseElement: S(t == null ? void 0 : t.baseElement, null),
193
+ includesBaseElement: S(
194
+ e.includesBaseElement,
195
+ t == null ? void 0 : t.includesBaseElement,
196
+ s === null
197
+ ),
198
+ moves: S(t == null ? void 0 : t.moves, 0),
199
+ orientation: S(
200
+ e.orientation,
201
+ t == null ? void 0 : t.orientation,
202
+ "both"
203
+ ),
204
+ rtl: S(e.rtl, t == null ? void 0 : t.rtl, !1),
205
+ virtualFocus: S(
206
+ e.virtualFocus,
207
+ t == null ? void 0 : t.virtualFocus,
208
+ !1
209
+ ),
210
+ focusLoop: S(e.focusLoop, t == null ? void 0 : t.focusLoop, !1),
211
+ focusWrap: S(e.focusWrap, t == null ? void 0 : t.focusWrap, !1),
212
+ focusShift: S(e.focusShift, t == null ? void 0 : t.focusShift, !1)
213
+ }), d = k(a, o, e.store);
214
+ M(
215
+ d,
216
+ () => Q(d, ["renderedItems", "activeId"], (n) => {
217
+ d.setState("activeId", (x) => {
218
+ var E;
219
+ return x !== void 0 ? x : (E = h(n.renderedItems)) == null ? void 0 : E.id;
220
+ });
221
+ })
222
+ );
223
+ const c = (n = "next", x = {}) => {
224
+ var E, P;
225
+ const r = d.getState(), {
226
+ skip: l = 0,
227
+ activeId: u = r.activeId,
228
+ focusShift: g = r.focusShift,
229
+ focusLoop: F = r.focusLoop,
230
+ focusWrap: f = r.focusWrap,
231
+ includesBaseElement: m = r.includesBaseElement,
232
+ renderedItems: w = r.renderedItems,
233
+ rtl: b = r.rtl
234
+ } = x, y = n === "up" || n === "down", D = n === "next" || n === "down", X = D ? b && !y : !b || y, Z = g && !l;
235
+ let v = y ? oe(
236
+ Ie(G(w), u, Z)
237
+ ) : w;
238
+ if (v = X ? q(v) : v, v = y ? Se(v) : v, u == null)
239
+ return (E = h(v)) == null ? void 0 : E.id;
240
+ const C = v.find((I) => I.id === u);
241
+ if (!C)
242
+ return (P = h(v)) == null ? void 0 : P.id;
243
+ const z = v.some((I) => I.rowId), j = v.indexOf(C), N = v.slice(j + 1), O = Y(N, C.rowId);
244
+ if (l) {
245
+ const I = fe(O, u), B = I.slice(l)[0] || // If we can't find an item, just return the last one.
246
+ I[I.length - 1];
247
+ return B == null ? void 0 : B.id;
248
+ }
249
+ const V = F && (y ? F !== "horizontal" : F !== "vertical"), T = z && f && (y ? f !== "horizontal" : f !== "vertical"), A = D ? (!z || y) && V && m : y ? m : !1;
250
+ if (V) {
251
+ const I = T && !A ? v : Y(v, C.rowId), B = me(I, u, A), U = h(B, u);
252
+ return U == null ? void 0 : U.id;
253
+ }
254
+ if (T) {
255
+ const I = h(
256
+ // We can use nextItems, which contains all the next items, including
257
+ // items from other rows, to wrap between rows. However, if there is a
258
+ // null item (the composite container), we'll only use the next items in
259
+ // the row. So moving next from the last item will focus on the
260
+ // composite container. On grid composites, horizontal navigation never
261
+ // focuses on the composite container, only vertical.
262
+ A ? O : N,
263
+ u
264
+ );
265
+ return A ? (I == null ? void 0 : I.id) || null : I == null ? void 0 : I.id;
266
+ }
267
+ const W = h(O, u);
268
+ return !W && A ? null : W == null ? void 0 : W.id;
269
+ };
270
+ return R(L(L({}, o), d), {
271
+ setBaseElement: (n) => d.setState("baseElement", n),
272
+ setActiveId: (n) => d.setState("activeId", n),
273
+ move: (n) => {
274
+ n !== void 0 && (d.setState("activeId", n), d.setState("moves", (x) => x + 1));
275
+ },
276
+ first: () => {
277
+ var n;
278
+ return (n = h(d.getState().renderedItems)) == null ? void 0 : n.id;
279
+ },
280
+ last: () => {
281
+ var n;
282
+ return (n = h(q(d.getState().renderedItems))) == null ? void 0 : n.id;
283
+ },
284
+ next: (n) => (n !== void 0 && typeof n == "number" && (n = { skip: n }), c("next", n)),
285
+ previous: (n) => (n !== void 0 && typeof n == "number" && (n = { skip: n }), c("previous", n)),
286
+ down: (n) => (n !== void 0 && typeof n == "number" && (n = { skip: n }), c("down", n)),
287
+ up: (n) => (n !== void 0 && typeof n == "number" && (n = { skip: n }), c("up", n))
288
+ });
289
+ }
290
+ function be(e) {
291
+ const i = ie(e.id);
292
+ return se({ id: i }, e);
293
+ }
294
+ function xe(e, i, t) {
295
+ return e = ue(e, i, t), _(e, t, "activeId", "setActiveId"), _(e, t, "includesBaseElement"), _(e, t, "virtualFocus"), _(e, t, "orientation"), _(e, t, "rtl"), _(e, t, "focusLoop"), _(e, t, "focusWrap"), _(e, t, "focusShift"), e;
296
+ }
297
+ function Ee(e = {}) {
298
+ e = be(e);
299
+ const [i, t] = p(ge, e);
300
+ return xe(i, t, e);
301
+ }
302
+ export {
303
+ de as a,
304
+ xe as b,
305
+ ge as c,
306
+ be as d,
307
+ Ee as u
308
+ };
@@ -0,0 +1,174 @@
1
+ import { g as v, s as Z, i as K, f as $, a as ee } from "./5VQZOHHZ-CscZGerP.js";
2
+ import { u as te, a as re } from "./P7GR5CS5-BoOYUfSQ.js";
3
+ import { f as oe, h as ne, u as se } from "./PFRGBC2K-BEg8ahbY.js";
4
+ import { f as ie, a as ue, _ as O, i as ae, u as ce, b as B, d as E, g as le, e as C, h as I, j as fe, k as z, l as de, m as me, n as pe, o as M, p as ve, q as ge } from "./LMDWO4NN--KEvZePp.js";
5
+ import { f as ye, r as Ee } from "./7PRQYBBV-91wrWGjk.js";
6
+ import { useRef as R, useEffect as L, useState as Ie, useCallback as Pe } from "react";
7
+ import { jsx as Ce } from "react/jsx-runtime";
8
+ var Fe = "div";
9
+ function Se(r) {
10
+ return r.some((i) => !!i.rowId);
11
+ }
12
+ function we(r) {
13
+ const i = r.target;
14
+ return i && !z(i) ? !1 : r.key.length === 1 && !r.ctrlKey && !r.metaKey;
15
+ }
16
+ function Ke(r) {
17
+ return r.key === "Shift" || r.key === "Control" || r.key === "Alt" || r.key === "Meta";
18
+ }
19
+ function H(r, i, l) {
20
+ return C((e) => {
21
+ var n;
22
+ if (i == null || i(e), e.defaultPrevented || e.isPropagationStopped() || !I(e) || Ke(e) || we(e)) return;
23
+ const f = r.getState(), m = (n = v(r, f.activeId)) == null ? void 0 : n.element;
24
+ if (!m) return;
25
+ const s = e, { view: h } = s, w = O(s, ["view"]), c = l == null ? void 0 : l.current;
26
+ m !== c && m.focus(), ve(m, e.type, w) || e.preventDefault(), e.currentTarget.contains(m) && e.stopPropagation();
27
+ });
28
+ }
29
+ function he(r) {
30
+ return $(
31
+ ye(Ee(ee(r)))
32
+ );
33
+ }
34
+ function ke(r) {
35
+ const [i, l] = Ie(!1), e = Pe(() => l(!0), []), n = r.useState(
36
+ (f) => v(r, f.activeId)
37
+ );
38
+ return L(() => {
39
+ const f = n == null ? void 0 : n.element;
40
+ i && f && (l(!1), f.focus({ preventScroll: !0 }));
41
+ }, [n, i]), e;
42
+ }
43
+ var Ae = ue(
44
+ function(i) {
45
+ var l = i, {
46
+ store: e,
47
+ composite: n = !0,
48
+ focusOnMove: f = n,
49
+ moveOnKeyPress: m = !0
50
+ } = l, s = O(l, [
51
+ "store",
52
+ "composite",
53
+ "focusOnMove",
54
+ "moveOnKeyPress"
55
+ ]);
56
+ const h = te();
57
+ e = e || h, ae(
58
+ e,
59
+ process.env.NODE_ENV !== "production" && "Composite must receive a `store` prop or be wrapped in a CompositeProvider component."
60
+ );
61
+ const w = R(null), c = R(null), U = ke(e), F = e.useState("moves"), [, V] = ce(
62
+ n ? e.setBaseElement : null
63
+ );
64
+ L(() => {
65
+ var t;
66
+ if (!e || !F || !n || !f) return;
67
+ const { activeId: o } = e.getState(), u = (t = v(e, o)) == null ? void 0 : t.element;
68
+ u && oe(u);
69
+ }, [e, F, n, f]), B(() => {
70
+ if (!e || !F || !n) return;
71
+ const { baseElement: t, activeId: o } = e.getState();
72
+ if (!(o === null) || !t) return;
73
+ const a = c.current;
74
+ c.current = null, a && E(a, { relatedTarget: t }), ne(t) || t.focus();
75
+ }, [e, F, n]);
76
+ const k = e.useState("activeId"), A = e.useState("virtualFocus");
77
+ B(() => {
78
+ var t;
79
+ if (!e || !n || !A) return;
80
+ const o = c.current;
81
+ if (c.current = null, !o) return;
82
+ const a = ((t = v(e, k)) == null ? void 0 : t.element) || le(o);
83
+ a !== o && E(o, { relatedTarget: a });
84
+ }, [e, k, A, n]);
85
+ const j = H(
86
+ e,
87
+ s.onKeyDownCapture,
88
+ c
89
+ ), N = H(
90
+ e,
91
+ s.onKeyUpCapture,
92
+ c
93
+ ), _ = s.onFocusCapture, q = C((t) => {
94
+ if (_ == null || _(t), t.defaultPrevented || !e) return;
95
+ const { virtualFocus: o } = e.getState();
96
+ if (!o) return;
97
+ const u = t.relatedTarget, a = Z(t.currentTarget);
98
+ I(t) && a && (t.stopPropagation(), c.current = u);
99
+ }), b = s.onFocus, G = C((t) => {
100
+ if (b == null || b(t), t.defaultPrevented || !n || !e) return;
101
+ const { relatedTarget: o } = t, { virtualFocus: u } = e.getState();
102
+ u ? I(t) && !K(e, o) && queueMicrotask(U) : I(t) && e.setActiveId(null);
103
+ }), T = s.onBlurCapture, W = C((t) => {
104
+ var o;
105
+ if (T == null || T(t), t.defaultPrevented || !e) return;
106
+ const { virtualFocus: u, activeId: a } = e.getState();
107
+ if (!u) return;
108
+ const p = (o = v(e, a)) == null ? void 0 : o.element, g = t.relatedTarget, S = K(e, g), d = c.current;
109
+ c.current = null, I(t) && S ? (g === p ? d && d !== g && E(d, t) : p ? E(p, t) : d && E(d, t), t.stopPropagation()) : !K(e, t.target) && p && E(p, t);
110
+ }), D = s.onKeyDown, J = fe(m), Q = C((t) => {
111
+ var o;
112
+ if (D == null || D(t), t.nativeEvent.isComposing || t.defaultPrevented || !e || !I(t)) return;
113
+ const { orientation: u, renderedItems: a, activeId: p } = e.getState(), g = v(e, p);
114
+ if ((o = g == null ? void 0 : g.element) != null && o.isConnected) return;
115
+ const S = u !== "horizontal", d = u !== "vertical", y = Se(a);
116
+ if ((t.key === "ArrowLeft" || t.key === "ArrowRight" || t.key === "Home" || t.key === "End") && z(t.currentTarget)) return;
117
+ const x = {
118
+ ArrowUp: (y || S) && (() => {
119
+ if (y) {
120
+ const P = he(a);
121
+ return P == null ? void 0 : P.id;
122
+ }
123
+ return e == null ? void 0 : e.last();
124
+ }),
125
+ ArrowRight: (y || d) && e.first,
126
+ ArrowDown: (y || S) && e.first,
127
+ ArrowLeft: (y || d) && e.last,
128
+ Home: e.first,
129
+ End: e.last,
130
+ PageUp: e.first,
131
+ PageDown: e.last
132
+ }[t.key];
133
+ if (x) {
134
+ const P = x();
135
+ if (P !== void 0) {
136
+ if (!J(t)) return;
137
+ t.preventDefault(), e.move(P);
138
+ }
139
+ }
140
+ });
141
+ s = de(
142
+ s,
143
+ (t) => /* @__PURE__ */ Ce(re, { value: e, children: t }),
144
+ [e]
145
+ );
146
+ const X = e.useState((t) => {
147
+ var o;
148
+ if (e && n && t.virtualFocus)
149
+ return (o = v(e, t.activeId)) == null ? void 0 : o.id;
150
+ });
151
+ s = me(M({
152
+ "aria-activedescendant": X
153
+ }, s), {
154
+ ref: pe(w, V, s.ref),
155
+ onKeyDownCapture: j,
156
+ onKeyUpCapture: N,
157
+ onFocusCapture: q,
158
+ onFocus: G,
159
+ onBlurCapture: W,
160
+ onKeyDown: Q
161
+ });
162
+ const Y = e.useState(
163
+ (t) => n && (t.virtualFocus || t.activeId === null)
164
+ );
165
+ return s = se(M({ focusable: Y }, s)), s;
166
+ }
167
+ ), ze = ie(function(i) {
168
+ const l = Ae(i);
169
+ return ge(Fe, l);
170
+ });
171
+ export {
172
+ ze as C,
173
+ Ae as u
174
+ };
@@ -0,0 +1,59 @@
1
+ import { k as o, D as u } from "./LMDWO4NN--KEvZePp.js";
2
+ var f = { id: null };
3
+ function a(n, t, i = !1) {
4
+ const e = n.findIndex((s) => s.id === t);
5
+ return [
6
+ ...n.slice(e + 1),
7
+ ...i ? [f] : [],
8
+ ...n.slice(0, e)
9
+ ];
10
+ }
11
+ function d(n, t) {
12
+ return n.find((i) => !i.disabled);
13
+ }
14
+ function I(n, t) {
15
+ return t && n.item(t) || null;
16
+ }
17
+ function S(n) {
18
+ const t = [];
19
+ for (const i of n) {
20
+ const e = t.find((s) => {
21
+ var l;
22
+ return ((l = s[0]) == null ? void 0 : l.rowId) === i.rowId;
23
+ });
24
+ e ? e.push(i) : t.push([i]);
25
+ }
26
+ return t;
27
+ }
28
+ function v(n, t = !1) {
29
+ if (o(n))
30
+ n.setSelectionRange(
31
+ t ? n.value.length : 0,
32
+ n.value.length
33
+ );
34
+ else if (n.isContentEditable) {
35
+ const i = u(n).getSelection();
36
+ i == null || i.selectAllChildren(n), t && (i == null || i.collapseToEnd());
37
+ }
38
+ }
39
+ var r = Symbol("FOCUS_SILENTLY");
40
+ function g(n) {
41
+ n[r] = !0, n.focus({ preventScroll: !0 });
42
+ }
43
+ function p(n) {
44
+ const t = n[r];
45
+ return delete n[r], t;
46
+ }
47
+ function F(n, t, i) {
48
+ return !(!t || t === i || !n.item(t.id));
49
+ }
50
+ export {
51
+ S as a,
52
+ v as b,
53
+ g as c,
54
+ a as d,
55
+ d as f,
56
+ I as g,
57
+ F as i,
58
+ p as s
59
+ };