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.
- package/dist/_virtual/index.js +5 -2
- package/dist/_virtual/index3.js +2 -7
- package/dist/_virtual/index4.js +2 -5
- package/dist/_virtual/index5.js +4 -4
- package/dist/_virtual/index6.js +5 -2
- package/dist/_virtual/index7.js +5 -2
- package/dist/_virtual/index8.js +5 -0
- package/dist/_virtual/index9.js +5 -0
- package/dist/_virtual/use-sync-external-store-shim.development.js +5 -0
- package/dist/_virtual/use-sync-external-store-shim.production.js +5 -0
- package/dist/components/ui/checkbox.js +12 -12
- package/dist/components/ui/data-table.js +10 -10
- package/dist/components/ui/gantt/components/Chart/Chart.js +1 -1
- package/dist/components/ui/message-input.js +1 -1
- package/dist/components/ui/tables/data-cross-table/data-cross-table.js +348 -0
- package/dist/components/ui/tables/data-cross-table/edit-controls.js +47 -0
- package/dist/components/ui/tables/data-cross-table/editable-input.js +100 -0
- package/dist/components/ui/tables/data-cross-table/truncated-text.js +19 -0
- package/dist/index.d.ts +29 -3
- package/dist/index.js +1 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +126 -122
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +10 -6
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +44 -42
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +33 -43
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +237 -120
- package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +17 -16
- package/dist/node_modules/@radix-ui/react-context-menu/dist/index.js +95 -94
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +20 -19
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +3 -3
- package/dist/node_modules/@radix-ui/react-hover-card/dist/index.js +14 -13
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +136 -136
- package/dist/node_modules/@radix-ui/react-menubar/dist/index.js +70 -68
- package/dist/node_modules/@radix-ui/react-navigation-menu/dist/index.js +66 -64
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +10 -9
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +16 -16
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +11 -10
- package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +161 -146
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +87 -84
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +269 -257
- package/dist/node_modules/@radix-ui/react-slider/dist/index.js +3 -3
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +29 -28
- package/dist/node_modules/@radix-ui/react-switch/dist/index.js +101 -86
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +23 -22
- package/dist/node_modules/@radix-ui/react-toggle/dist/index.js +17 -16
- package/dist/node_modules/@radix-ui/react-toggle-group/dist/index.js +25 -23
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +77 -76
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +43 -21
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +16 -0
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +18 -18
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +36 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +491 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +53 -0
- package/dist/node_modules/classnames/index.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/property-information/lib/html.js +9 -9
- package/dist/node_modules/react-hook-form/dist/index.esm.js +88 -88
- package/dist/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/react-resizable-panels/dist/react-resizable-panels.browser.esm.js +830 -801
- package/dist/node_modules/recharts/es6/util/ReactUtils.js +1 -1
- package/dist/node_modules/remeda/dist/chunk-AIG3BDKO.js +9 -0
- package/dist/node_modules/remeda/dist/{chunk-A3PVMI4K.js → chunk-KI5X74E2.js} +1 -1
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +3 -3
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +68 -0
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +56 -0
- package/dist/node_modules/use-sync-external-store/shim/index.js +11 -0
- package/dist/styles.css +1 -1
- package/package.json +2 -1
- package/dist/components/ui/data-cross-table.js +0 -216
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-arrow/dist/index.js +0 -25
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-collection/dist/index.js +0 -49
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -128
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -138
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-menu/dist/index.js +0 -625
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-popper/dist/index.js +0 -221
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-portal/dist/index.js +0 -17
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-primitive/dist/index.js +0 -37
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-roving-focus/dist/index.js +0 -184
- package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -55
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-collection/dist/index.js +0 -49
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-primitive/dist/index.js +0 -33
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -55
- package/dist/node_modules/remeda/dist/chunk-OAMXQXGR.js +0 -9
|
@@ -4,12 +4,12 @@ import { clamp as $ } from "../../number/dist/index.js";
|
|
|
4
4
|
import { composeEventHandlers as C } from "../../primitive/dist/index.js";
|
|
5
5
|
import { useComposedRefs as M } from "../../react-compose-refs/dist/index.js";
|
|
6
6
|
import { createContextScope as ce } from "../../react-context/dist/index.js";
|
|
7
|
-
import { useControllableState as le } from "
|
|
7
|
+
import { useControllableState as le } from "../../react-use-controllable-state/dist/index.js";
|
|
8
8
|
import { useDirection as de } from "../../react-direction/dist/index.js";
|
|
9
9
|
import { usePrevious as ue } from "../../react-use-previous/dist/index.js";
|
|
10
10
|
import { useSize as fe } from "../../react-use-size/dist/index.js";
|
|
11
|
-
import { Primitive as K } from "
|
|
12
|
-
import { createCollection as me } from "
|
|
11
|
+
import { Primitive as K } from "../../react-primitive/dist/index.js";
|
|
12
|
+
import { createCollection as me } from "../../react-collection/dist/index.js";
|
|
13
13
|
import { jsx as v, jsxs as pe } from "react/jsx-runtime";
|
|
14
14
|
var j = ["PageUp", "PageDown"], X = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], G = {
|
|
15
15
|
"from-left": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as l from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { useComposedRefs as y } from "../../react-compose-refs/dist/index.js";
|
|
4
4
|
import { jsx as p, Fragment as S } from "react/jsx-runtime";
|
|
5
5
|
// @__NO_SIDE_EFFECTS__
|
|
6
6
|
function g(e) {
|
|
7
|
-
const t = /* @__PURE__ */ E(e),
|
|
8
|
-
const { children: i, ...
|
|
9
|
-
if (
|
|
10
|
-
const
|
|
11
|
-
return /* @__PURE__ */ p(t, { ...
|
|
7
|
+
const t = /* @__PURE__ */ E(e), n = l.forwardRef((o, r) => {
|
|
8
|
+
const { children: i, ...c } = o, a = l.Children.toArray(i), s = a.find(C);
|
|
9
|
+
if (s) {
|
|
10
|
+
const f = s.props.children, m = a.map((u) => u === s ? l.Children.count(f) > 1 ? l.Children.only(null) : l.isValidElement(f) ? f.props.children : null : u);
|
|
11
|
+
return /* @__PURE__ */ p(t, { ...c, ref: r, children: l.isValidElement(f) ? l.cloneElement(f, void 0, m) : null });
|
|
12
12
|
}
|
|
13
|
-
return /* @__PURE__ */ p(t, { ...
|
|
13
|
+
return /* @__PURE__ */ p(t, { ...c, ref: r, children: i });
|
|
14
14
|
});
|
|
15
|
-
return
|
|
15
|
+
return n.displayName = `${e}.Slot`, n;
|
|
16
16
|
}
|
|
17
|
-
var
|
|
17
|
+
var _ = /* @__PURE__ */ g("Slot");
|
|
18
18
|
// @__NO_SIDE_EFFECTS__
|
|
19
19
|
function E(e) {
|
|
20
|
-
const t = l.forwardRef((
|
|
21
|
-
const { children: r, ...i } = o;
|
|
20
|
+
const t = l.forwardRef((n, o) => {
|
|
21
|
+
const { children: r, ...i } = n, c = l.isValidElement(r) ? b(r) : void 0, a = y(c, o);
|
|
22
22
|
if (l.isValidElement(r)) {
|
|
23
|
-
const
|
|
24
|
-
return r.type !== l.Fragment && (s.ref =
|
|
23
|
+
const s = R(i, r.props);
|
|
24
|
+
return r.type !== l.Fragment && (s.ref = a), l.cloneElement(r, s);
|
|
25
25
|
}
|
|
26
26
|
return l.Children.count(r) > 1 ? l.Children.only(null) : null;
|
|
27
27
|
});
|
|
@@ -29,31 +29,32 @@ function E(e) {
|
|
|
29
29
|
}
|
|
30
30
|
var d = Symbol("radix.slottable");
|
|
31
31
|
// @__NO_SIDE_EFFECTS__
|
|
32
|
-
function
|
|
33
|
-
const t = ({ children:
|
|
32
|
+
function x(e) {
|
|
33
|
+
const t = ({ children: n }) => /* @__PURE__ */ p(S, { children: n });
|
|
34
34
|
return t.displayName = `${e}.Slottable`, t.__radixId = d, t;
|
|
35
35
|
}
|
|
36
36
|
function C(e) {
|
|
37
37
|
return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === d;
|
|
38
38
|
}
|
|
39
39
|
function R(e, t) {
|
|
40
|
-
const
|
|
41
|
-
for (const
|
|
42
|
-
const r = e[
|
|
43
|
-
/^on[A-Z]/.test(
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
const n = { ...t };
|
|
41
|
+
for (const o in t) {
|
|
42
|
+
const r = e[o], i = t[o];
|
|
43
|
+
/^on[A-Z]/.test(o) ? r && i ? n[o] = (...a) => {
|
|
44
|
+
const s = i(...a);
|
|
45
|
+
return r(...a), s;
|
|
46
|
+
} : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
|
|
46
47
|
}
|
|
47
|
-
return { ...e, ...
|
|
48
|
+
return { ...e, ...n };
|
|
48
49
|
}
|
|
49
50
|
function b(e) {
|
|
50
|
-
var
|
|
51
|
-
let t = (
|
|
52
|
-
return
|
|
51
|
+
var o, r;
|
|
52
|
+
let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
53
|
+
return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
53
54
|
}
|
|
54
55
|
export {
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
_ as Root,
|
|
57
|
+
_ as Slot,
|
|
57
58
|
g as createSlot,
|
|
58
|
-
|
|
59
|
+
x as createSlottable
|
|
59
60
|
};
|
|
@@ -1,119 +1,134 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import * as
|
|
3
|
-
import { composeEventHandlers as
|
|
4
|
-
import { useComposedRefs as
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import { composeEventHandlers as T } from "../../primitive/dist/index.js";
|
|
4
|
+
import { useComposedRefs as P } from "../../react-compose-refs/dist/index.js";
|
|
5
5
|
import { createContextScope as I } from "../../react-context/dist/index.js";
|
|
6
6
|
import { useControllableState as M } from "../../react-use-controllable-state/dist/index.js";
|
|
7
|
-
import { usePrevious as
|
|
7
|
+
import { usePrevious as H } from "../../react-use-previous/dist/index.js";
|
|
8
8
|
import { useSize as j } from "../../react-use-size/dist/index.js";
|
|
9
|
-
import { Primitive as
|
|
10
|
-
import { jsxs as
|
|
11
|
-
var
|
|
12
|
-
(
|
|
9
|
+
import { Primitive as y } from "../../react-primitive/dist/index.js";
|
|
10
|
+
import { jsxs as A, jsx as m } from "react/jsx-runtime";
|
|
11
|
+
var h = "Switch", [U, Q] = I(h), [q, z] = U(h), R = r.forwardRef(
|
|
12
|
+
(t, a) => {
|
|
13
13
|
const {
|
|
14
|
-
__scopeSwitch:
|
|
15
|
-
name:
|
|
16
|
-
checked:
|
|
17
|
-
defaultChecked:
|
|
18
|
-
required:
|
|
19
|
-
disabled:
|
|
20
|
-
value:
|
|
21
|
-
onCheckedChange:
|
|
22
|
-
form:
|
|
23
|
-
...
|
|
24
|
-
} =
|
|
25
|
-
prop:
|
|
26
|
-
defaultProp:
|
|
27
|
-
onChange:
|
|
14
|
+
__scopeSwitch: e,
|
|
15
|
+
name: c,
|
|
16
|
+
checked: o,
|
|
17
|
+
defaultChecked: S,
|
|
18
|
+
required: i,
|
|
19
|
+
disabled: n,
|
|
20
|
+
value: p = "on",
|
|
21
|
+
onCheckedChange: w,
|
|
22
|
+
form: s,
|
|
23
|
+
...v
|
|
24
|
+
} = t, [u, d] = r.useState(null), b = P(a, (f) => d(f)), C = r.useRef(!1), k = u ? s || !!u.closest("form") : !0, [l, B] = M({
|
|
25
|
+
prop: o,
|
|
26
|
+
defaultProp: S ?? !1,
|
|
27
|
+
onChange: w,
|
|
28
|
+
caller: h
|
|
28
29
|
});
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ A(q, { scope: e, checked: l, disabled: n, children: [
|
|
30
31
|
/* @__PURE__ */ m(
|
|
31
|
-
|
|
32
|
+
y.button,
|
|
32
33
|
{
|
|
33
34
|
type: "button",
|
|
34
35
|
role: "switch",
|
|
35
36
|
"aria-checked": l,
|
|
36
|
-
"aria-required":
|
|
37
|
-
"data-state":
|
|
38
|
-
"data-disabled":
|
|
39
|
-
disabled:
|
|
40
|
-
value:
|
|
41
|
-
...
|
|
42
|
-
ref:
|
|
43
|
-
onClick:
|
|
44
|
-
|
|
37
|
+
"aria-required": i,
|
|
38
|
+
"data-state": g(l),
|
|
39
|
+
"data-disabled": n ? "" : void 0,
|
|
40
|
+
disabled: n,
|
|
41
|
+
value: p,
|
|
42
|
+
...v,
|
|
43
|
+
ref: b,
|
|
44
|
+
onClick: T(t.onClick, (f) => {
|
|
45
|
+
B((N) => !N), k && (C.current = f.isPropagationStopped(), C.current || f.stopPropagation());
|
|
45
46
|
})
|
|
46
47
|
}
|
|
47
48
|
),
|
|
48
49
|
k && /* @__PURE__ */ m(
|
|
49
|
-
|
|
50
|
+
x,
|
|
50
51
|
{
|
|
51
|
-
control:
|
|
52
|
-
bubbles: !
|
|
53
|
-
name:
|
|
54
|
-
value:
|
|
52
|
+
control: u,
|
|
53
|
+
bubbles: !C.current,
|
|
54
|
+
name: c,
|
|
55
|
+
value: p,
|
|
55
56
|
checked: l,
|
|
56
|
-
required:
|
|
57
|
-
disabled:
|
|
58
|
-
form:
|
|
57
|
+
required: i,
|
|
58
|
+
disabled: n,
|
|
59
|
+
form: s,
|
|
59
60
|
style: { transform: "translateX(-100%)" }
|
|
60
61
|
}
|
|
61
62
|
)
|
|
62
63
|
] });
|
|
63
64
|
}
|
|
64
65
|
);
|
|
65
|
-
|
|
66
|
-
var
|
|
67
|
-
(
|
|
68
|
-
const { __scopeSwitch:
|
|
66
|
+
R.displayName = h;
|
|
67
|
+
var E = "SwitchThumb", _ = r.forwardRef(
|
|
68
|
+
(t, a) => {
|
|
69
|
+
const { __scopeSwitch: e, ...c } = t, o = z(E, e);
|
|
69
70
|
return /* @__PURE__ */ m(
|
|
70
|
-
|
|
71
|
+
y.span,
|
|
71
72
|
{
|
|
72
|
-
"data-state":
|
|
73
|
-
"data-disabled":
|
|
74
|
-
...
|
|
75
|
-
ref:
|
|
73
|
+
"data-state": g(o.checked),
|
|
74
|
+
"data-disabled": o.disabled ? "" : void 0,
|
|
75
|
+
...c,
|
|
76
|
+
ref: a
|
|
76
77
|
}
|
|
77
78
|
);
|
|
78
79
|
}
|
|
79
80
|
);
|
|
80
|
-
|
|
81
|
-
var
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
...c,
|
|
101
|
-
position: "absolute",
|
|
102
|
-
pointerEvents: "none",
|
|
103
|
-
opacity: 0,
|
|
104
|
-
margin: 0
|
|
81
|
+
_.displayName = E;
|
|
82
|
+
var L = "SwitchBubbleInput", x = r.forwardRef(
|
|
83
|
+
({
|
|
84
|
+
__scopeSwitch: t,
|
|
85
|
+
control: a,
|
|
86
|
+
checked: e,
|
|
87
|
+
bubbles: c = !0,
|
|
88
|
+
...o
|
|
89
|
+
}, S) => {
|
|
90
|
+
const i = r.useRef(null), n = P(i, S), p = H(e), w = j(a);
|
|
91
|
+
return r.useEffect(() => {
|
|
92
|
+
const s = i.current;
|
|
93
|
+
if (!s) return;
|
|
94
|
+
const v = window.HTMLInputElement.prototype, d = Object.getOwnPropertyDescriptor(
|
|
95
|
+
v,
|
|
96
|
+
"checked"
|
|
97
|
+
).set;
|
|
98
|
+
if (p !== e && d) {
|
|
99
|
+
const b = new Event("click", { bubbles: c });
|
|
100
|
+
d.call(s, e), s.dispatchEvent(b);
|
|
105
101
|
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
102
|
+
}, [p, e, c]), /* @__PURE__ */ m(
|
|
103
|
+
"input",
|
|
104
|
+
{
|
|
105
|
+
type: "checkbox",
|
|
106
|
+
"aria-hidden": !0,
|
|
107
|
+
defaultChecked: e,
|
|
108
|
+
...o,
|
|
109
|
+
tabIndex: -1,
|
|
110
|
+
ref: n,
|
|
111
|
+
style: {
|
|
112
|
+
...o.style,
|
|
113
|
+
...w,
|
|
114
|
+
position: "absolute",
|
|
115
|
+
pointerEvents: "none",
|
|
116
|
+
opacity: 0,
|
|
117
|
+
margin: 0
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
x.displayName = L;
|
|
124
|
+
function g(t) {
|
|
125
|
+
return t ? "checked" : "unchecked";
|
|
111
126
|
}
|
|
112
|
-
var
|
|
127
|
+
var V = R, Y = _;
|
|
113
128
|
export {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
129
|
+
V as Root,
|
|
130
|
+
R as Switch,
|
|
131
|
+
_ as SwitchThumb,
|
|
132
|
+
Y as Thumb,
|
|
133
|
+
Q as createSwitchScope
|
|
119
134
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as v from "react";
|
|
3
|
-
import { composeEventHandlers as
|
|
3
|
+
import { composeEventHandlers as g } from "../../primitive/dist/index.js";
|
|
4
4
|
import { createContextScope as x } from "../../react-context/dist/index.js";
|
|
5
5
|
import { createRovingFocusGroupScope as C, Root as E, Item as F } from "../../react-roving-focus/dist/index.js";
|
|
6
6
|
import { Presence as w } from "../../react-presence/dist/index.js";
|
|
@@ -8,10 +8,10 @@ import { Primitive as b } from "../../react-primitive/dist/index.js";
|
|
|
8
8
|
import { useDirection as D } from "../../react-direction/dist/index.js";
|
|
9
9
|
import { useControllableState as V } from "../../react-use-controllable-state/dist/index.js";
|
|
10
10
|
import { useId as G } from "../../react-id/dist/index.js";
|
|
11
|
-
import { jsx as
|
|
12
|
-
var
|
|
11
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
12
|
+
var p = "Tabs", [L, Q] = x(p, [
|
|
13
13
|
C
|
|
14
|
-
]), h = C(), [$, T] = L(
|
|
14
|
+
]), h = C(), [$, T] = L(p), I = v.forwardRef(
|
|
15
15
|
(e, r) => {
|
|
16
16
|
const {
|
|
17
17
|
__scopeTabs: s,
|
|
@@ -22,22 +22,23 @@ var g = "Tabs", [L, Q] = x(g, [
|
|
|
22
22
|
dir: d,
|
|
23
23
|
activationMode: f = "automatic",
|
|
24
24
|
...m
|
|
25
|
-
} = e, i = D(d), [a,
|
|
25
|
+
} = e, i = D(d), [a, u] = V({
|
|
26
26
|
prop: t,
|
|
27
27
|
onChange: n,
|
|
28
|
-
defaultProp: c
|
|
28
|
+
defaultProp: c ?? "",
|
|
29
|
+
caller: p
|
|
29
30
|
});
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ l(
|
|
31
32
|
$,
|
|
32
33
|
{
|
|
33
34
|
scope: s,
|
|
34
35
|
baseId: G(),
|
|
35
36
|
value: a,
|
|
36
|
-
onValueChange:
|
|
37
|
+
onValueChange: u,
|
|
37
38
|
orientation: o,
|
|
38
39
|
dir: i,
|
|
39
40
|
activationMode: f,
|
|
40
|
-
children: /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ l(
|
|
41
42
|
b.div,
|
|
42
43
|
{
|
|
43
44
|
dir: i,
|
|
@@ -50,11 +51,11 @@ var g = "Tabs", [L, Q] = x(g, [
|
|
|
50
51
|
);
|
|
51
52
|
}
|
|
52
53
|
);
|
|
53
|
-
I.displayName =
|
|
54
|
+
I.displayName = p;
|
|
54
55
|
var R = "TabsList", _ = v.forwardRef(
|
|
55
56
|
(e, r) => {
|
|
56
57
|
const { __scopeTabs: s, loop: t = !0, ...n } = e, c = T(R, s), o = h(s);
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
+
return /* @__PURE__ */ l(
|
|
58
59
|
E,
|
|
59
60
|
{
|
|
60
61
|
asChild: !0,
|
|
@@ -62,7 +63,7 @@ var R = "TabsList", _ = v.forwardRef(
|
|
|
62
63
|
orientation: c.orientation,
|
|
63
64
|
dir: c.dir,
|
|
64
65
|
loop: t,
|
|
65
|
-
children: /* @__PURE__ */
|
|
66
|
+
children: /* @__PURE__ */ l(
|
|
66
67
|
b.div,
|
|
67
68
|
{
|
|
68
69
|
role: "tablist",
|
|
@@ -79,14 +80,14 @@ _.displayName = R;
|
|
|
79
80
|
var y = "TabsTrigger", A = v.forwardRef(
|
|
80
81
|
(e, r) => {
|
|
81
82
|
const { __scopeTabs: s, value: t, disabled: n = !1, ...c } = e, o = T(y, s), d = h(s), f = N(o.baseId, t), m = P(o.baseId, t), i = t === o.value;
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
+
return /* @__PURE__ */ l(
|
|
83
84
|
F,
|
|
84
85
|
{
|
|
85
86
|
asChild: !0,
|
|
86
87
|
...d,
|
|
87
88
|
focusable: !n,
|
|
88
89
|
active: i,
|
|
89
|
-
children: /* @__PURE__ */
|
|
90
|
+
children: /* @__PURE__ */ l(
|
|
90
91
|
b.button,
|
|
91
92
|
{
|
|
92
93
|
type: "button",
|
|
@@ -99,13 +100,13 @@ var y = "TabsTrigger", A = v.forwardRef(
|
|
|
99
100
|
id: f,
|
|
100
101
|
...c,
|
|
101
102
|
ref: r,
|
|
102
|
-
onMouseDown:
|
|
103
|
+
onMouseDown: g(e.onMouseDown, (a) => {
|
|
103
104
|
!n && a.button === 0 && a.ctrlKey === !1 ? o.onValueChange(t) : a.preventDefault();
|
|
104
105
|
}),
|
|
105
|
-
onKeyDown:
|
|
106
|
+
onKeyDown: g(e.onKeyDown, (a) => {
|
|
106
107
|
[" ", "Enter"].includes(a.key) && o.onValueChange(t);
|
|
107
108
|
}),
|
|
108
|
-
onFocus:
|
|
109
|
+
onFocus: g(e.onFocus, () => {
|
|
109
110
|
const a = o.activationMode !== "manual";
|
|
110
111
|
!i && !n && a && o.onValueChange(t);
|
|
111
112
|
})
|
|
@@ -120,16 +121,16 @@ var S = "TabsContent", M = v.forwardRef(
|
|
|
120
121
|
(e, r) => {
|
|
121
122
|
const { __scopeTabs: s, value: t, forceMount: n, children: c, ...o } = e, d = T(S, s), f = N(d.baseId, t), m = P(d.baseId, t), i = t === d.value, a = v.useRef(i);
|
|
122
123
|
return v.useEffect(() => {
|
|
123
|
-
const
|
|
124
|
-
return () => cancelAnimationFrame(
|
|
125
|
-
}, []), /* @__PURE__ */
|
|
124
|
+
const u = requestAnimationFrame(() => a.current = !1);
|
|
125
|
+
return () => cancelAnimationFrame(u);
|
|
126
|
+
}, []), /* @__PURE__ */ l(w, { present: n || i, children: ({ present: u }) => /* @__PURE__ */ l(
|
|
126
127
|
b.div,
|
|
127
128
|
{
|
|
128
129
|
"data-state": i ? "active" : "inactive",
|
|
129
130
|
"data-orientation": d.orientation,
|
|
130
131
|
role: "tabpanel",
|
|
131
132
|
"aria-labelledby": f,
|
|
132
|
-
hidden: !
|
|
133
|
+
hidden: !u,
|
|
133
134
|
id: m,
|
|
134
135
|
tabIndex: 0,
|
|
135
136
|
...o,
|
|
@@ -138,7 +139,7 @@ var S = "TabsContent", M = v.forwardRef(
|
|
|
138
139
|
...e.style,
|
|
139
140
|
animationDuration: a.current ? "0s" : void 0
|
|
140
141
|
},
|
|
141
|
-
children:
|
|
142
|
+
children: u && c
|
|
142
143
|
}
|
|
143
144
|
) });
|
|
144
145
|
}
|
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import * as
|
|
3
|
-
import { composeEventHandlers as
|
|
4
|
-
import { useControllableState as
|
|
5
|
-
import { Primitive as
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import { composeEventHandlers as m } from "../../primitive/dist/index.js";
|
|
4
|
+
import { useControllableState as p } from "../../react-use-controllable-state/dist/index.js";
|
|
5
|
+
import { Primitive as c } from "../../react-primitive/dist/index.js";
|
|
6
6
|
import { jsx as u } from "react/jsx-runtime";
|
|
7
|
-
var
|
|
8
|
-
const { pressed: s, defaultPressed:
|
|
7
|
+
var r = "Toggle", t = f.forwardRef((e, a) => {
|
|
8
|
+
const { pressed: s, defaultPressed: d, onPressedChange: i, ...l } = e, [o, n] = p({
|
|
9
9
|
prop: s,
|
|
10
|
-
onChange:
|
|
11
|
-
defaultProp:
|
|
10
|
+
onChange: i,
|
|
11
|
+
defaultProp: d ?? !1,
|
|
12
|
+
caller: r
|
|
12
13
|
});
|
|
13
14
|
return /* @__PURE__ */ u(
|
|
14
|
-
|
|
15
|
+
c.button,
|
|
15
16
|
{
|
|
16
17
|
type: "button",
|
|
17
18
|
"aria-pressed": o,
|
|
18
19
|
"data-state": o ? "on" : "off",
|
|
19
20
|
"data-disabled": e.disabled ? "" : void 0,
|
|
20
|
-
...
|
|
21
|
-
ref:
|
|
22
|
-
onClick:
|
|
23
|
-
e.disabled ||
|
|
21
|
+
...l,
|
|
22
|
+
ref: a,
|
|
23
|
+
onClick: m(e.onClick, () => {
|
|
24
|
+
e.disabled || n(!o);
|
|
24
25
|
})
|
|
25
26
|
}
|
|
26
27
|
);
|
|
27
28
|
});
|
|
28
|
-
|
|
29
|
-
var C =
|
|
29
|
+
t.displayName = r;
|
|
30
|
+
var C = t;
|
|
30
31
|
export {
|
|
31
32
|
C as Root,
|
|
32
|
-
|
|
33
|
+
t as Toggle
|
|
33
34
|
};
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import p from "react";
|
|
3
3
|
import { createContextScope as S } from "../../react-context/dist/index.js";
|
|
4
4
|
import { Primitive as G } from "../../react-primitive/dist/index.js";
|
|
5
|
-
import { createRovingFocusGroupScope as P, Item as V, Root as
|
|
6
|
-
import { Toggle as
|
|
5
|
+
import { createRovingFocusGroupScope as P, Item as V, Root as M } from "../../react-roving-focus/dist/index.js";
|
|
6
|
+
import { Toggle as A } from "../../react-toggle/dist/index.js";
|
|
7
7
|
import { useControllableState as _ } from "../../react-use-controllable-state/dist/index.js";
|
|
8
|
-
import { useDirection as
|
|
8
|
+
import { useDirection as F } from "../../react-direction/dist/index.js";
|
|
9
9
|
import { jsx as l } from "react/jsx-runtime";
|
|
10
|
-
var
|
|
10
|
+
var c = "ToggleGroup", [C, z] = S(c, [
|
|
11
11
|
P
|
|
12
12
|
]), I = P(), f = p.forwardRef((e, r) => {
|
|
13
13
|
const { type: a, ...t } = e;
|
|
@@ -15,10 +15,10 @@ var v = "ToggleGroup", [C, z] = S(v, [
|
|
|
15
15
|
return /* @__PURE__ */ l(w, { ...t, ref: r });
|
|
16
16
|
if (a === "multiple")
|
|
17
17
|
return /* @__PURE__ */ l(D, { ...t, ref: r });
|
|
18
|
-
throw new Error(`Missing prop \`type\` expected on \`${
|
|
18
|
+
throw new Error(`Missing prop \`type\` expected on \`${c}\``);
|
|
19
19
|
});
|
|
20
|
-
f.displayName =
|
|
21
|
-
var [h, x] = C(
|
|
20
|
+
f.displayName = c;
|
|
21
|
+
var [h, x] = C(c), w = p.forwardRef((e, r) => {
|
|
22
22
|
const {
|
|
23
23
|
value: a,
|
|
24
24
|
defaultValue: t,
|
|
@@ -27,15 +27,16 @@ var [h, x] = C(v), w = p.forwardRef((e, r) => {
|
|
|
27
27
|
...n
|
|
28
28
|
} = e, [s, o] = _({
|
|
29
29
|
prop: a,
|
|
30
|
-
defaultProp: t,
|
|
31
|
-
onChange: u
|
|
30
|
+
defaultProp: t ?? "",
|
|
31
|
+
onChange: u,
|
|
32
|
+
caller: c
|
|
32
33
|
});
|
|
33
34
|
return /* @__PURE__ */ l(
|
|
34
35
|
h,
|
|
35
36
|
{
|
|
36
37
|
scope: e.__scopeToggleGroup,
|
|
37
38
|
type: "single",
|
|
38
|
-
value: s ? [s] : [],
|
|
39
|
+
value: p.useMemo(() => s ? [s] : [], [s]),
|
|
39
40
|
onItemActivate: o,
|
|
40
41
|
onItemDeactivate: p.useCallback(() => o(""), [o]),
|
|
41
42
|
children: /* @__PURE__ */ l(R, { ...n, ref: r })
|
|
@@ -48,15 +49,16 @@ var [h, x] = C(v), w = p.forwardRef((e, r) => {
|
|
|
48
49
|
onValueChange: u = () => {
|
|
49
50
|
},
|
|
50
51
|
...n
|
|
51
|
-
} = e, [s
|
|
52
|
+
} = e, [s, o] = _({
|
|
52
53
|
prop: a,
|
|
53
|
-
defaultProp: t,
|
|
54
|
-
onChange: u
|
|
54
|
+
defaultProp: t ?? [],
|
|
55
|
+
onChange: u,
|
|
56
|
+
caller: c
|
|
55
57
|
}), i = p.useCallback(
|
|
56
|
-
(
|
|
58
|
+
(g) => o((v = []) => [...v, g]),
|
|
57
59
|
[o]
|
|
58
60
|
), d = p.useCallback(
|
|
59
|
-
(
|
|
61
|
+
(g) => o((v = []) => v.filter((y) => y !== g)),
|
|
60
62
|
[o]
|
|
61
63
|
);
|
|
62
64
|
return /* @__PURE__ */ l(
|
|
@@ -71,8 +73,8 @@ var [h, x] = C(v), w = p.forwardRef((e, r) => {
|
|
|
71
73
|
}
|
|
72
74
|
);
|
|
73
75
|
});
|
|
74
|
-
f.displayName =
|
|
75
|
-
var [E, N] = C(
|
|
76
|
+
f.displayName = c;
|
|
77
|
+
var [E, N] = C(c), R = p.forwardRef(
|
|
76
78
|
(e, r) => {
|
|
77
79
|
const {
|
|
78
80
|
__scopeToggleGroup: a,
|
|
@@ -82,18 +84,18 @@ var [E, N] = C(v), R = p.forwardRef(
|
|
|
82
84
|
dir: s,
|
|
83
85
|
loop: o = !0,
|
|
84
86
|
...i
|
|
85
|
-
} = e, d = I(a),
|
|
87
|
+
} = e, d = I(a), g = F(s), v = { role: "group", dir: g, ...i };
|
|
86
88
|
return /* @__PURE__ */ l(E, { scope: a, rovingFocus: u, disabled: t, children: u ? /* @__PURE__ */ l(
|
|
87
|
-
|
|
89
|
+
M,
|
|
88
90
|
{
|
|
89
91
|
asChild: !0,
|
|
90
92
|
...d,
|
|
91
93
|
orientation: n,
|
|
92
|
-
dir:
|
|
94
|
+
dir: g,
|
|
93
95
|
loop: o,
|
|
94
|
-
children: /* @__PURE__ */ l(G.div, { ...
|
|
96
|
+
children: /* @__PURE__ */ l(G.div, { ...v, ref: r })
|
|
95
97
|
}
|
|
96
|
-
) : /* @__PURE__ */ l(G.div, { ...
|
|
98
|
+
) : /* @__PURE__ */ l(G.div, { ...v, ref: r }) });
|
|
97
99
|
}
|
|
98
100
|
), m = "ToggleGroupItem", b = p.forwardRef(
|
|
99
101
|
(e, r) => {
|
|
@@ -116,7 +118,7 @@ var T = p.forwardRef(
|
|
|
116
118
|
(e, r) => {
|
|
117
119
|
const { __scopeToggleGroup: a, value: t, ...u } = e, n = x(m, a), s = { role: "radio", "aria-checked": e.pressed, "aria-pressed": void 0 }, o = n.type === "single" ? s : void 0;
|
|
118
120
|
return /* @__PURE__ */ l(
|
|
119
|
-
|
|
121
|
+
A,
|
|
120
122
|
{
|
|
121
123
|
...o,
|
|
122
124
|
...u,
|