laif-ds 0.1.34 → 0.1.36

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 (84) hide show
  1. package/dist/_virtual/index.js +5 -2
  2. package/dist/_virtual/index3.js +2 -7
  3. package/dist/_virtual/index4.js +2 -5
  4. package/dist/_virtual/index5.js +4 -4
  5. package/dist/_virtual/index6.js +5 -2
  6. package/dist/_virtual/index7.js +5 -2
  7. package/dist/_virtual/index8.js +5 -0
  8. package/dist/_virtual/index9.js +5 -0
  9. package/dist/_virtual/use-sync-external-store-shim.development.js +5 -0
  10. package/dist/_virtual/use-sync-external-store-shim.production.js +5 -0
  11. package/dist/components/ui/checkbox.js +12 -12
  12. package/dist/components/ui/data-table.js +10 -10
  13. package/dist/components/ui/gantt/components/Chart/Chart.js +1 -1
  14. package/dist/components/ui/message-input.js +1 -1
  15. package/dist/components/ui/tables/data-cross-table/data-cross-table.js +348 -0
  16. package/dist/components/ui/tables/data-cross-table/edit-controls.js +47 -0
  17. package/dist/components/ui/tables/data-cross-table/editable-input.js +100 -0
  18. package/dist/components/ui/tables/data-cross-table/truncated-text.js +19 -0
  19. package/dist/index.d.ts +29 -3
  20. package/dist/index.js +1 -1
  21. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +126 -122
  22. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +10 -6
  23. package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +44 -42
  24. package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +33 -43
  25. package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +237 -120
  26. package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +17 -16
  27. package/dist/node_modules/@radix-ui/react-context-menu/dist/index.js +95 -94
  28. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +20 -19
  29. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +3 -3
  30. package/dist/node_modules/@radix-ui/react-hover-card/dist/index.js +14 -13
  31. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +136 -136
  32. package/dist/node_modules/@radix-ui/react-menubar/dist/index.js +70 -68
  33. package/dist/node_modules/@radix-ui/react-navigation-menu/dist/index.js +66 -64
  34. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +10 -9
  35. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +16 -16
  36. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +11 -10
  37. package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +161 -146
  38. package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +87 -84
  39. package/dist/node_modules/@radix-ui/react-select/dist/index.js +269 -257
  40. package/dist/node_modules/@radix-ui/react-slider/dist/index.js +3 -3
  41. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +29 -28
  42. package/dist/node_modules/@radix-ui/react-switch/dist/index.js +101 -86
  43. package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +23 -22
  44. package/dist/node_modules/@radix-ui/react-toggle/dist/index.js +17 -16
  45. package/dist/node_modules/@radix-ui/react-toggle-group/dist/index.js +25 -23
  46. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +77 -76
  47. package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +43 -21
  48. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +16 -0
  49. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +18 -18
  50. package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +36 -0
  51. package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +491 -0
  52. package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +53 -0
  53. package/dist/node_modules/classnames/index.js +1 -1
  54. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
  55. package/dist/node_modules/property-information/lib/html.js +9 -9
  56. package/dist/node_modules/react-hook-form/dist/index.esm.js +88 -88
  57. package/dist/node_modules/react-is/index.js +1 -1
  58. package/dist/node_modules/react-resizable-panels/dist/react-resizable-panels.browser.esm.js +830 -801
  59. package/dist/node_modules/recharts/es6/util/ReactUtils.js +1 -1
  60. package/dist/node_modules/remeda/dist/chunk-AIG3BDKO.js +9 -0
  61. package/dist/node_modules/remeda/dist/{chunk-A3PVMI4K.js → chunk-KI5X74E2.js} +1 -1
  62. package/dist/node_modules/style-to-object/cjs/index.js +1 -1
  63. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +3 -3
  64. package/dist/node_modules/unified/lib/index.js +1 -1
  65. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +68 -0
  66. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +56 -0
  67. package/dist/node_modules/use-sync-external-store/shim/index.js +11 -0
  68. package/dist/styles.css +1 -1
  69. package/package.json +2 -1
  70. package/dist/components/ui/data-cross-table.js +0 -216
  71. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-arrow/dist/index.js +0 -25
  72. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-collection/dist/index.js +0 -49
  73. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -128
  74. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -138
  75. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-menu/dist/index.js +0 -625
  76. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-popper/dist/index.js +0 -221
  77. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-portal/dist/index.js +0 -17
  78. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-primitive/dist/index.js +0 -37
  79. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-roving-focus/dist/index.js +0 -184
  80. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -55
  81. package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-collection/dist/index.js +0 -49
  82. package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-primitive/dist/index.js +0 -33
  83. package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -55
  84. package/dist/node_modules/remeda/dist/chunk-OAMXQXGR.js +0 -9
@@ -1,221 +0,0 @@
1
- "use client";
2
- import * as s from "react";
3
- import { useFloating as xe, offset as Pe, shift as ye, flip as Ae, size as ve, arrow as Ce, hide as be, limitShift as Se } from "../../../../../../@floating-ui/react-dom/dist/floating-ui.react-dom.js";
4
- import { Root as Oe } from "../../react-arrow/dist/index.js";
5
- import { useComposedRefs as j } from "../../../../../react-compose-refs/dist/index.js";
6
- import { createContextScope as Re } from "../../../../../react-context/dist/index.js";
7
- import { Primitive as z } from "../../react-primitive/dist/index.js";
8
- import { useCallbackRef as Ee } from "../../../../../react-use-callback-ref/dist/index.js";
9
- import { useLayoutEffect as T } from "../../../../../react-use-layout-effect/dist/index.js";
10
- import { useSize as Ne } from "../../../../../react-use-size/dist/index.js";
11
- import { jsx as f } from "react/jsx-runtime";
12
- import { autoUpdate as _e } from "../../../../../../@floating-ui/dom/dist/floating-ui.dom.js";
13
- var N = "Popper", [L, Ue] = Re(N), [$e, Z] = L(N), U = (e) => {
14
- const { __scopePopper: i, children: n } = e, [t, a] = s.useState(null);
15
- return /* @__PURE__ */ f($e, { scope: i, anchor: t, onAnchorChange: a, children: n });
16
- };
17
- U.displayName = N;
18
- var q = "PopperAnchor", G = s.forwardRef(
19
- (e, i) => {
20
- const { __scopePopper: n, virtualRef: t, ...a } = e, r = Z(q, n), o = s.useRef(null), w = j(i, o);
21
- return s.useEffect(() => {
22
- r.onAnchorChange((t == null ? void 0 : t.current) || o.current);
23
- }), t ? null : /* @__PURE__ */ f(z.div, { ...a, ref: w });
24
- }
25
- );
26
- G.displayName = q;
27
- var _ = "PopperContent", [He, We] = L(_), J = s.forwardRef(
28
- (e, i) => {
29
- var Y, M, X, D, F, k;
30
- const {
31
- __scopePopper: n,
32
- side: t = "bottom",
33
- sideOffset: a = 0,
34
- align: r = "center",
35
- alignOffset: o = 0,
36
- arrowPadding: w = 0,
37
- avoidCollisions: p = !0,
38
- collisionBoundary: c = [],
39
- collisionPadding: x = 0,
40
- sticky: m = "partial",
41
- hideWhenDetached: y = !1,
42
- updatePositionStrategy: A = "optimized",
43
- onPlaced: l,
44
- ...d
45
- } = e, v = Z(_, n), [h, C] = s.useState(null), ee = j(i, (P) => C(P)), [E, te] = s.useState(null), g = Ne(E), re = (g == null ? void 0 : g.width) ?? 0, $ = (g == null ? void 0 : g.height) ?? 0, oe = t + (r !== "center" ? "-" + r : ""), ne = typeof x == "number" ? x : { top: 0, right: 0, bottom: 0, left: 0, ...x }, H = Array.isArray(c) ? c : [c], ae = H.length > 0, b = {
46
- padding: ne,
47
- boundary: H.filter(Ye),
48
- // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
49
- altBoundary: ae
50
- }, { refs: ie, floatingStyles: W, placement: se, isPositioned: S, middlewareData: u } = xe({
51
- // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
52
- strategy: "fixed",
53
- placement: oe,
54
- whileElementsMounted: (...P) => _e(...P, {
55
- animationFrame: A === "always"
56
- }),
57
- elements: {
58
- reference: v.anchor
59
- },
60
- middleware: [
61
- Pe({ mainAxis: a + $, alignmentAxis: o }),
62
- p && ye({
63
- mainAxis: !0,
64
- crossAxis: !1,
65
- limiter: m === "partial" ? Se() : void 0,
66
- ...b
67
- }),
68
- p && Ae({ ...b }),
69
- ve({
70
- ...b,
71
- apply: ({ elements: P, rects: B, availableWidth: he, availableHeight: ge }) => {
72
- const { width: ue, height: we } = B.reference, R = P.floating.style;
73
- R.setProperty("--radix-popper-available-width", `${he}px`), R.setProperty("--radix-popper-available-height", `${ge}px`), R.setProperty("--radix-popper-anchor-width", `${ue}px`), R.setProperty("--radix-popper-anchor-height", `${we}px`);
74
- }
75
- }),
76
- E && Ce({ element: E, padding: w }),
77
- Me({ arrowWidth: re, arrowHeight: $ }),
78
- y && be({ strategy: "referenceHidden", ...b })
79
- ]
80
- }), [I, pe] = V(se), O = Ee(l);
81
- T(() => {
82
- S && (O == null || O());
83
- }, [S, O]);
84
- const ce = (Y = u.arrow) == null ? void 0 : Y.x, de = (M = u.arrow) == null ? void 0 : M.y, le = ((X = u.arrow) == null ? void 0 : X.centerOffset) !== 0, [fe, me] = s.useState();
85
- return T(() => {
86
- h && me(window.getComputedStyle(h).zIndex);
87
- }, [h]), /* @__PURE__ */ f(
88
- "div",
89
- {
90
- ref: ie.setFloating,
91
- "data-radix-popper-content-wrapper": "",
92
- style: {
93
- ...W,
94
- transform: S ? W.transform : "translate(0, -200%)",
95
- // keep off the page when measuring
96
- minWidth: "max-content",
97
- zIndex: fe,
98
- "--radix-popper-transform-origin": [
99
- (D = u.transformOrigin) == null ? void 0 : D.x,
100
- (F = u.transformOrigin) == null ? void 0 : F.y
101
- ].join(" "),
102
- // hide the content if using the hide middleware and should be hidden
103
- // set visibility to hidden and disable pointer events so the UI behaves
104
- // as if the PopperContent isn't there at all
105
- ...((k = u.hide) == null ? void 0 : k.referenceHidden) && {
106
- visibility: "hidden",
107
- pointerEvents: "none"
108
- }
109
- },
110
- dir: e.dir,
111
- children: /* @__PURE__ */ f(
112
- He,
113
- {
114
- scope: n,
115
- placedSide: I,
116
- onArrowChange: te,
117
- arrowX: ce,
118
- arrowY: de,
119
- shouldHideArrow: le,
120
- children: /* @__PURE__ */ f(
121
- z.div,
122
- {
123
- "data-side": I,
124
- "data-align": pe,
125
- ...d,
126
- ref: ee,
127
- style: {
128
- ...d.style,
129
- // if the PopperContent hasn't been placed yet (not all measurements done)
130
- // we prevent animations so that users's animation don't kick in too early referring wrong sides
131
- animation: S ? void 0 : "none"
132
- }
133
- }
134
- )
135
- }
136
- )
137
- }
138
- );
139
- }
140
- );
141
- J.displayName = _;
142
- var K = "PopperArrow", Ie = {
143
- top: "bottom",
144
- right: "left",
145
- bottom: "top",
146
- left: "right"
147
- }, Q = s.forwardRef(function(i, n) {
148
- const { __scopePopper: t, ...a } = i, r = We(K, t), o = Ie[r.placedSide];
149
- return (
150
- // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
151
- // doesn't report size as we'd expect on SVG elements.
152
- // it reports their bounding box which is effectively the largest path inside the SVG.
153
- /* @__PURE__ */ f(
154
- "span",
155
- {
156
- ref: r.onArrowChange,
157
- style: {
158
- position: "absolute",
159
- left: r.arrowX,
160
- top: r.arrowY,
161
- [o]: 0,
162
- transformOrigin: {
163
- top: "",
164
- right: "0 0",
165
- bottom: "center 0",
166
- left: "100% 0"
167
- }[r.placedSide],
168
- transform: {
169
- top: "translateY(100%)",
170
- right: "translateY(50%) rotate(90deg) translateX(-50%)",
171
- bottom: "rotate(180deg)",
172
- left: "translateY(50%) rotate(-90deg) translateX(50%)"
173
- }[r.placedSide],
174
- visibility: r.shouldHideArrow ? "hidden" : void 0
175
- },
176
- children: /* @__PURE__ */ f(
177
- Oe,
178
- {
179
- ...a,
180
- ref: n,
181
- style: {
182
- ...a.style,
183
- // ensures the element can be measured correctly (mostly for if SVG)
184
- display: "block"
185
- }
186
- }
187
- )
188
- }
189
- )
190
- );
191
- });
192
- Q.displayName = K;
193
- function Ye(e) {
194
- return e !== null;
195
- }
196
- var Me = (e) => ({
197
- name: "transformOrigin",
198
- options: e,
199
- fn(i) {
200
- var v, h, C;
201
- const { placement: n, rects: t, middlewareData: a } = i, o = ((v = a.arrow) == null ? void 0 : v.centerOffset) !== 0, w = o ? 0 : e.arrowWidth, p = o ? 0 : e.arrowHeight, [c, x] = V(n), m = { start: "0%", center: "50%", end: "100%" }[x], y = (((h = a.arrow) == null ? void 0 : h.x) ?? 0) + w / 2, A = (((C = a.arrow) == null ? void 0 : C.y) ?? 0) + p / 2;
202
- let l = "", d = "";
203
- return c === "bottom" ? (l = o ? m : `${y}px`, d = `${-p}px`) : c === "top" ? (l = o ? m : `${y}px`, d = `${t.floating.height + p}px`) : c === "right" ? (l = `${-p}px`, d = o ? m : `${A}px`) : c === "left" && (l = `${t.floating.width + p}px`, d = o ? m : `${A}px`), { data: { x: l, y: d } };
204
- }
205
- });
206
- function V(e) {
207
- const [i, n = "center"] = e.split("-");
208
- return [i, n];
209
- }
210
- var qe = U, Ge = G, Je = J, Ke = Q;
211
- export {
212
- Ge as Anchor,
213
- Ke as Arrow,
214
- Je as Content,
215
- U as Popper,
216
- G as PopperAnchor,
217
- Q as PopperArrow,
218
- J as PopperContent,
219
- qe as Root,
220
- Ue as createPopperScope
221
- };
@@ -1,17 +0,0 @@
1
- "use client";
2
- import * as r from "react";
3
- import m from "react-dom";
4
- import { Primitive as c } from "../../react-primitive/dist/index.js";
5
- import { useLayoutEffect as u } from "../../../../../react-use-layout-effect/dist/index.js";
6
- import { jsx as l } from "react/jsx-runtime";
7
- var p = "Portal", d = r.forwardRef((e, a) => {
8
- var o;
9
- const { container: i, ...n } = e, [s, f] = r.useState(!1);
10
- u(() => f(!0), []);
11
- const t = i || s && ((o = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : o.body);
12
- return t ? m.createPortal(/* @__PURE__ */ l(c.div, { ...n, ref: a }), t) : null;
13
- });
14
- d.displayName = p;
15
- export {
16
- d as Portal
17
- };
@@ -1,37 +0,0 @@
1
- "use client";
2
- import * as c from "react";
3
- import * as f from "react-dom";
4
- import { createSlot as p } from "../../../../../react-slot/dist/index.js";
5
- import { jsx as l } from "react/jsx-runtime";
6
- var u = [
7
- "a",
8
- "button",
9
- "div",
10
- "form",
11
- "h2",
12
- "h3",
13
- "img",
14
- "input",
15
- "label",
16
- "li",
17
- "nav",
18
- "ol",
19
- "p",
20
- "select",
21
- "span",
22
- "svg",
23
- "ul"
24
- ], h = u.reduce((t, i) => {
25
- const e = p(`Primitive.${i}`), r = c.forwardRef((o, s) => {
26
- const { asChild: m, ...a } = o, n = m ? e : i;
27
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ l(n, { ...a, ref: s });
28
- });
29
- return r.displayName = `Primitive.${i}`, { ...t, [i]: r };
30
- }, {});
31
- function w(t, i) {
32
- t && f.flushSync(() => t.dispatchEvent(i));
33
- }
34
- export {
35
- h as Primitive,
36
- w as dispatchDiscreteCustomEvent
37
- };
@@ -1,184 +0,0 @@
1
- "use client";
2
- import * as c from "react";
3
- import { composeEventHandlers as p } from "../../../../../primitive/dist/index.js";
4
- import { createCollection as V } from "../../react-collection/dist/index.js";
5
- import { useComposedRefs as j } from "../../../../../react-compose-refs/dist/index.js";
6
- import { createContextScope as z } from "../../../../../react-context/dist/index.js";
7
- import { useId as q } from "../../../../../react-id/dist/index.js";
8
- import { Primitive as x } from "../../react-primitive/dist/index.js";
9
- import { useCallbackRef as J } from "../../../../../react-use-callback-ref/dist/index.js";
10
- import { useControllableState as Q } from "../../react-use-controllable-state/dist/index.js";
11
- import { useDirection as W } from "../../../../../react-direction/dist/index.js";
12
- import { jsx as d } from "react/jsx-runtime";
13
- var _ = "rovingFocusGroup.onEntryFocus", X = { bubbles: !1, cancelable: !0 }, I = "RovingFocusGroup", [y, G, Z] = V(I), [$, Fe] = z(
14
- I,
15
- [Z]
16
- ), [ee, oe] = $(I), N = c.forwardRef(
17
- (e, r) => /* @__PURE__ */ d(y.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d(y.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d(te, { ...e, ref: r }) }) })
18
- );
19
- N.displayName = I;
20
- var te = c.forwardRef((e, r) => {
21
- const {
22
- __scopeRovingFocusGroup: s,
23
- orientation: o,
24
- loop: E = !1,
25
- dir: w,
26
- currentTabStopId: v,
27
- defaultCurrentTabStopId: C,
28
- onCurrentTabStopIdChange: T,
29
- onEntryFocus: m,
30
- preventScrollOnEntryFocus: u = !1,
31
- ...b
32
- } = e, F = c.useRef(null), g = j(r, F), R = W(w), [t, l] = Q({
33
- prop: v,
34
- defaultProp: C ?? null,
35
- onChange: T,
36
- caller: I
37
- }), [S, i] = c.useState(!1), a = J(m), k = G(s), h = c.useRef(!1), [L, D] = c.useState(0);
38
- return c.useEffect(() => {
39
- const n = F.current;
40
- if (n)
41
- return n.addEventListener(_, a), () => n.removeEventListener(_, a);
42
- }, [a]), /* @__PURE__ */ d(
43
- ee,
44
- {
45
- scope: s,
46
- orientation: o,
47
- dir: R,
48
- loop: E,
49
- currentTabStopId: t,
50
- onItemFocus: c.useCallback(
51
- (n) => l(n),
52
- [l]
53
- ),
54
- onItemShiftTab: c.useCallback(() => i(!0), []),
55
- onFocusableItemAdd: c.useCallback(
56
- () => D((n) => n + 1),
57
- []
58
- ),
59
- onFocusableItemRemove: c.useCallback(
60
- () => D((n) => n - 1),
61
- []
62
- ),
63
- children: /* @__PURE__ */ d(
64
- x.div,
65
- {
66
- tabIndex: S || L === 0 ? -1 : 0,
67
- "data-orientation": o,
68
- ...b,
69
- ref: g,
70
- style: { outline: "none", ...e.style },
71
- onMouseDown: p(e.onMouseDown, () => {
72
- h.current = !0;
73
- }),
74
- onFocus: p(e.onFocus, (n) => {
75
- const U = !h.current;
76
- if (n.target === n.currentTarget && U && !S) {
77
- const P = new CustomEvent(_, X);
78
- if (n.currentTarget.dispatchEvent(P), !P.defaultPrevented) {
79
- const A = k().filter((f) => f.focusable), B = A.find((f) => f.active), Y = A.find((f) => f.id === t), H = [B, Y, ...A].filter(
80
- Boolean
81
- ).map((f) => f.ref.current);
82
- M(H, u);
83
- }
84
- }
85
- h.current = !1;
86
- }),
87
- onBlur: p(e.onBlur, () => i(!1))
88
- }
89
- )
90
- }
91
- );
92
- }), O = "RovingFocusGroupItem", K = c.forwardRef(
93
- (e, r) => {
94
- const {
95
- __scopeRovingFocusGroup: s,
96
- focusable: o = !0,
97
- active: E = !1,
98
- tabStopId: w,
99
- children: v,
100
- ...C
101
- } = e, T = q(), m = w || T, u = oe(O, s), b = u.currentTabStopId === m, F = G(s), { onFocusableItemAdd: g, onFocusableItemRemove: R } = u;
102
- return c.useEffect(() => {
103
- if (o)
104
- return g(), () => R();
105
- }, [o, g, R]), /* @__PURE__ */ d(
106
- y.ItemSlot,
107
- {
108
- scope: s,
109
- id: m,
110
- focusable: o,
111
- active: E,
112
- children: /* @__PURE__ */ d(
113
- x.span,
114
- {
115
- tabIndex: b ? 0 : -1,
116
- "data-orientation": u.orientation,
117
- ...C,
118
- ref: r,
119
- onMouseDown: p(e.onMouseDown, (t) => {
120
- o ? u.onItemFocus(m) : t.preventDefault();
121
- }),
122
- onFocus: p(e.onFocus, () => u.onItemFocus(m)),
123
- onKeyDown: p(e.onKeyDown, (t) => {
124
- if (t.key === "Tab" && t.shiftKey) {
125
- u.onItemShiftTab();
126
- return;
127
- }
128
- if (t.target !== t.currentTarget) return;
129
- const l = ce(t, u.orientation, u.dir);
130
- if (l !== void 0) {
131
- if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey) return;
132
- t.preventDefault();
133
- let i = F().filter((a) => a.focusable).map((a) => a.ref.current);
134
- if (l === "last") i.reverse();
135
- else if (l === "prev" || l === "next") {
136
- l === "prev" && i.reverse();
137
- const a = i.indexOf(t.currentTarget);
138
- i = u.loop ? se(i, a + 1) : i.slice(a + 1);
139
- }
140
- setTimeout(() => M(i));
141
- }
142
- }),
143
- children: typeof v == "function" ? v({ isCurrentTabStop: b }) : v
144
- }
145
- )
146
- }
147
- );
148
- }
149
- );
150
- K.displayName = O;
151
- var re = {
152
- ArrowLeft: "prev",
153
- ArrowUp: "prev",
154
- ArrowRight: "next",
155
- ArrowDown: "next",
156
- PageUp: "first",
157
- Home: "first",
158
- PageDown: "last",
159
- End: "last"
160
- };
161
- function ne(e, r) {
162
- return r !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
163
- }
164
- function ce(e, r, s) {
165
- const o = ne(e.key, s);
166
- if (!(r === "vertical" && ["ArrowLeft", "ArrowRight"].includes(o)) && !(r === "horizontal" && ["ArrowUp", "ArrowDown"].includes(o)))
167
- return re[o];
168
- }
169
- function M(e, r = !1) {
170
- const s = document.activeElement;
171
- for (const o of e)
172
- if (o === s || (o.focus({ preventScroll: r }), document.activeElement !== s)) return;
173
- }
174
- function se(e, r) {
175
- return e.map((s, o) => e[(r + o) % e.length]);
176
- }
177
- var ge = N, Re = K;
178
- export {
179
- Re as Item,
180
- ge as Root,
181
- N as RovingFocusGroup,
182
- K as RovingFocusGroupItem,
183
- Fe as createRovingFocusGroupScope
184
- };
@@ -1,55 +0,0 @@
1
- "use client";
2
- import * as n from "react";
3
- import { useLayoutEffect as v } from "../../../../../react-use-layout-effect/dist/index.js";
4
- var E = n[" useInsertionEffect ".trim().toString()] || v;
5
- function y({
6
- prop: t,
7
- defaultProp: u,
8
- onChange: e = () => {
9
- },
10
- caller: i
11
- }) {
12
- const [l, o, r] = w({
13
- defaultProp: u,
14
- onChange: e
15
- }), c = t !== void 0, a = c ? t : l;
16
- {
17
- const s = n.useRef(t !== void 0);
18
- n.useEffect(() => {
19
- const f = s.current;
20
- f !== c && console.warn(
21
- `${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.`
22
- ), s.current = c;
23
- }, [c, i]);
24
- }
25
- const m = n.useCallback(
26
- (s) => {
27
- var f;
28
- if (c) {
29
- const d = R(s) ? s(t) : s;
30
- d !== t && ((f = r.current) == null || f.call(r, d));
31
- } else
32
- o(s);
33
- },
34
- [c, t, o, r]
35
- );
36
- return [a, m];
37
- }
38
- function w({
39
- defaultProp: t,
40
- onChange: u
41
- }) {
42
- const [e, i] = n.useState(t), l = n.useRef(e), o = n.useRef(u);
43
- return E(() => {
44
- o.current = u;
45
- }, [u]), n.useEffect(() => {
46
- var r;
47
- l.current !== e && ((r = o.current) == null || r.call(o, e), l.current = e);
48
- }, [e, l]), [e, i, o];
49
- }
50
- function R(t) {
51
- return typeof t == "function";
52
- }
53
- export {
54
- y as useControllableState
55
- };
@@ -1,49 +0,0 @@
1
- "use client";
2
- import r from "react";
3
- import { createContextScope as y } from "../../../../../react-context/dist/index.js";
4
- import { useComposedRefs as M } from "../../../../../react-compose-refs/dist/index.js";
5
- import { createSlot as x } from "../../../../../react-slot/dist/index.js";
6
- import { jsx as d } from "react/jsx-runtime";
7
- function g(s) {
8
- const m = s + "CollectionProvider", [A, N] = y(m), [_, f] = A(
9
- m,
10
- { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
11
- ), p = (c) => {
12
- const { scope: e, children: l } = c, o = r.useRef(null), t = r.useRef(/* @__PURE__ */ new Map()).current;
13
- return /* @__PURE__ */ d(_, { scope: e, itemMap: t, collectionRef: o, children: l });
14
- };
15
- p.displayName = m;
16
- const u = s + "CollectionSlot", E = x(u), C = r.forwardRef(
17
- (c, e) => {
18
- const { scope: l, children: o } = c, t = f(u, l), n = M(e, t.collectionRef);
19
- return /* @__PURE__ */ d(E, { ref: n, children: o });
20
- }
21
- );
22
- C.displayName = u;
23
- const a = s + "CollectionItemSlot", R = "data-radix-collection-item", T = x(a), I = r.forwardRef(
24
- (c, e) => {
25
- const { scope: l, children: o, ...t } = c, n = r.useRef(null), S = M(e, n), i = f(a, l);
26
- return r.useEffect(() => (i.itemMap.set(n, { ref: n, ...t }), () => void i.itemMap.delete(n))), /* @__PURE__ */ d(T, { [R]: "", ref: S, children: o });
27
- }
28
- );
29
- I.displayName = a;
30
- function O(c) {
31
- const e = f(s + "CollectionConsumer", c);
32
- return r.useCallback(() => {
33
- const o = e.collectionRef.current;
34
- if (!o) return [];
35
- const t = Array.from(o.querySelectorAll(`[${R}]`));
36
- return Array.from(e.itemMap.values()).sort(
37
- (i, v) => t.indexOf(i.ref.current) - t.indexOf(v.ref.current)
38
- );
39
- }, [e.collectionRef, e.itemMap]);
40
- }
41
- return [
42
- { Provider: p, Slot: C, ItemSlot: I },
43
- O,
44
- N
45
- ];
46
- }
47
- export {
48
- g as createCollection
49
- };
@@ -1,33 +0,0 @@
1
- "use client";
2
- import * as l from "react";
3
- import "react-dom";
4
- import { createSlot as n } from "../../../../../react-slot/dist/index.js";
5
- import { jsx as f } from "react/jsx-runtime";
6
- var u = [
7
- "a",
8
- "button",
9
- "div",
10
- "form",
11
- "h2",
12
- "h3",
13
- "img",
14
- "input",
15
- "label",
16
- "li",
17
- "nav",
18
- "ol",
19
- "p",
20
- "select",
21
- "span",
22
- "svg",
23
- "ul"
24
- ], w = u.reduce((t, i) => {
25
- const o = n(`Primitive.${i}`), r = l.forwardRef((e, m) => {
26
- const { asChild: a, ...p } = e, s = a ? o : i;
27
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(s, { ...p, ref: m });
28
- });
29
- return r.displayName = `Primitive.${i}`, { ...t, [i]: r };
30
- }, {});
31
- export {
32
- w as Primitive
33
- };
@@ -1,55 +0,0 @@
1
- "use client";
2
- import * as n from "react";
3
- import { useLayoutEffect as v } from "../../../../../react-use-layout-effect/dist/index.js";
4
- var E = n[" useInsertionEffect ".trim().toString()] || v;
5
- function y({
6
- prop: t,
7
- defaultProp: u,
8
- onChange: e = () => {
9
- },
10
- caller: i
11
- }) {
12
- const [l, o, r] = w({
13
- defaultProp: u,
14
- onChange: e
15
- }), c = t !== void 0, a = c ? t : l;
16
- {
17
- const s = n.useRef(t !== void 0);
18
- n.useEffect(() => {
19
- const f = s.current;
20
- f !== c && console.warn(
21
- `${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.`
22
- ), s.current = c;
23
- }, [c, i]);
24
- }
25
- const m = n.useCallback(
26
- (s) => {
27
- var f;
28
- if (c) {
29
- const d = R(s) ? s(t) : s;
30
- d !== t && ((f = r.current) == null || f.call(r, d));
31
- } else
32
- o(s);
33
- },
34
- [c, t, o, r]
35
- );
36
- return [a, m];
37
- }
38
- function w({
39
- defaultProp: t,
40
- onChange: u
41
- }) {
42
- const [e, i] = n.useState(t), l = n.useRef(e), o = n.useRef(u);
43
- return E(() => {
44
- o.current = u;
45
- }, [u]), n.useEffect(() => {
46
- var r;
47
- l.current !== e && ((r = o.current) == null || r.call(o, e), l.current = e);
48
- }, [e, l]), [e, i, o];
49
- }
50
- function R(t) {
51
- return typeof t == "function";
52
- }
53
- export {
54
- y as useControllableState
55
- };
@@ -1,9 +0,0 @@
1
- "use client";
2
- import { a } from "./chunk-WIMGWYZL.js";
3
- function i(...r) {
4
- return a(e, r);
5
- }
6
- var e = (r, t) => r.length >= t;
7
- export {
8
- i as a
9
- };