laif-ds 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/card.js +41 -34
- package/dist/components/ui/data-table.js +122 -0
- package/dist/components/ui/toaster.js +26 -0
- package/dist/components/ui/typo.js +53 -0
- package/dist/dist/_virtual/jsx-runtime.js +6 -0
- package/dist/dist/_virtual/jsx-runtime2.js +5 -0
- package/dist/dist/_virtual/react-jsx-runtime.development.js +5 -0
- package/dist/dist/_virtual/react-jsx-runtime.production.js +5 -0
- package/dist/dist/components/ui/checkbox.js +32 -0
- package/dist/dist/components/ui/scroll-area.js +61 -0
- package/dist/dist/components/ui/table.js +87 -0
- package/dist/dist/lib/utils.js +9 -0
- package/dist/dist/node_modules/@radix-ui/number/dist/index.js +7 -0
- package/dist/dist/node_modules/@radix-ui/primitive/dist/index.js +10 -0
- package/dist/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +136 -0
- package/dist/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +30 -0
- package/dist/dist/node_modules/@radix-ui/react-context/dist/index.js +56 -0
- package/dist/dist/node_modules/@radix-ui/react-direction/dist/index.js +10 -0
- package/dist/dist/node_modules/@radix-ui/react-presence/dist/index.js +72 -0
- package/dist/dist/node_modules/@radix-ui/react-primitive/dist/index.js +32 -0
- package/dist/dist/node_modules/@radix-ui/react-scroll-area/dist/index.js +534 -0
- package/dist/dist/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
- package/dist/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +14 -0
- package/dist/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +33 -0
- package/dist/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +7 -0
- package/dist/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +9 -0
- package/dist/dist/node_modules/@radix-ui/react-use-size/dist/index.js +28 -0
- package/dist/dist/node_modules/clsx/dist/clsx.js +18 -0
- package/dist/dist/node_modules/lucide-react/dist/esm/Icon.js +41 -0
- package/dist/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +28 -0
- package/dist/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +21 -0
- package/dist/dist/node_modules/lucide-react/dist/esm/icons/check.js +13 -0
- package/dist/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +20 -0
- package/dist/dist/node_modules/react/cjs/react-jsx-runtime.development.js +248 -0
- package/dist/dist/node_modules/react/cjs/react-jsx-runtime.production.js +36 -0
- package/dist/dist/node_modules/react/jsx-runtime.js +11 -0
- package/dist/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +2732 -0
- package/dist/index.d.ts +85 -18
- package/dist/index.js +253 -249
- package/dist/node_modules/@tanstack/react-table/build/lib/index.js +103 -0
- package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1896 -0
- package/dist/styles.css +1 -1
- package/package.json +9 -7
- package/dist/components/ui/sonner.js +0 -23
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { useComposedRefs as _ } from "../../react-compose-refs/dist/index.js";
|
|
4
|
+
import { createContextScope as q } from "../../react-context/dist/index.js";
|
|
5
|
+
import { composeEventHandlers as w } from "../../primitive/dist/index.js";
|
|
6
|
+
import { useControllableState as L } from "../../react-use-controllable-state/dist/index.js";
|
|
7
|
+
import { usePrevious as z } from "../../react-use-previous/dist/index.js";
|
|
8
|
+
import { useSize as K } from "../../react-use-size/dist/index.js";
|
|
9
|
+
import { Presence as H } from "../../react-presence/dist/index.js";
|
|
10
|
+
import { Primitive as $ } from "../../react-primitive/dist/index.js";
|
|
11
|
+
import { j as l } from "../../../../_virtual/jsx-runtime.js";
|
|
12
|
+
var E = "Checkbox", [M, U] = q(E), [N, O] = M(E), j = s.forwardRef(
|
|
13
|
+
(e, f) => {
|
|
14
|
+
const {
|
|
15
|
+
__scopeCheckbox: t,
|
|
16
|
+
name: i,
|
|
17
|
+
checked: p,
|
|
18
|
+
defaultChecked: o,
|
|
19
|
+
required: m,
|
|
20
|
+
disabled: c,
|
|
21
|
+
value: h = "on",
|
|
22
|
+
onCheckedChange: k,
|
|
23
|
+
form: d,
|
|
24
|
+
...v
|
|
25
|
+
} = e, [a, x] = s.useState(null), S = _(f, (r) => x(r)), C = s.useRef(!1), R = a ? d || !!a.closest("form") : !0, [u = !1, y] = L({
|
|
26
|
+
prop: p,
|
|
27
|
+
defaultProp: o,
|
|
28
|
+
onChange: k
|
|
29
|
+
}), D = s.useRef(u);
|
|
30
|
+
return s.useEffect(() => {
|
|
31
|
+
const r = a == null ? void 0 : a.form;
|
|
32
|
+
if (r) {
|
|
33
|
+
const b = () => y(D.current);
|
|
34
|
+
return r.addEventListener("reset", b), () => r.removeEventListener("reset", b);
|
|
35
|
+
}
|
|
36
|
+
}, [a, y]), /* @__PURE__ */ l.jsxs(N, { scope: t, state: u, disabled: c, children: [
|
|
37
|
+
/* @__PURE__ */ l.jsx(
|
|
38
|
+
$.button,
|
|
39
|
+
{
|
|
40
|
+
type: "button",
|
|
41
|
+
role: "checkbox",
|
|
42
|
+
"aria-checked": n(u) ? "mixed" : u,
|
|
43
|
+
"aria-required": m,
|
|
44
|
+
"data-state": I(u),
|
|
45
|
+
"data-disabled": c ? "" : void 0,
|
|
46
|
+
disabled: c,
|
|
47
|
+
value: h,
|
|
48
|
+
...v,
|
|
49
|
+
ref: S,
|
|
50
|
+
onKeyDown: w(e.onKeyDown, (r) => {
|
|
51
|
+
r.key === "Enter" && r.preventDefault();
|
|
52
|
+
}),
|
|
53
|
+
onClick: w(e.onClick, (r) => {
|
|
54
|
+
y((b) => n(b) ? !0 : !b), R && (C.current = r.isPropagationStopped(), C.current || r.stopPropagation());
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
R && /* @__PURE__ */ l.jsx(
|
|
59
|
+
T,
|
|
60
|
+
{
|
|
61
|
+
control: a,
|
|
62
|
+
bubbles: !C.current,
|
|
63
|
+
name: i,
|
|
64
|
+
value: h,
|
|
65
|
+
checked: u,
|
|
66
|
+
required: m,
|
|
67
|
+
disabled: c,
|
|
68
|
+
form: d,
|
|
69
|
+
style: { transform: "translateX(-100%)" },
|
|
70
|
+
defaultChecked: n(o) ? !1 : o
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
] });
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
j.displayName = E;
|
|
77
|
+
var P = "CheckboxIndicator", g = s.forwardRef(
|
|
78
|
+
(e, f) => {
|
|
79
|
+
const { __scopeCheckbox: t, forceMount: i, ...p } = e, o = O(P, t);
|
|
80
|
+
return /* @__PURE__ */ l.jsx(H, { present: i || n(o.state) || o.state === !0, children: /* @__PURE__ */ l.jsx(
|
|
81
|
+
$.span,
|
|
82
|
+
{
|
|
83
|
+
"data-state": I(o.state),
|
|
84
|
+
"data-disabled": o.disabled ? "" : void 0,
|
|
85
|
+
...p,
|
|
86
|
+
ref: f,
|
|
87
|
+
style: { pointerEvents: "none", ...e.style }
|
|
88
|
+
}
|
|
89
|
+
) });
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
g.displayName = P;
|
|
93
|
+
var T = (e) => {
|
|
94
|
+
const { control: f, checked: t, bubbles: i = !0, defaultChecked: p, ...o } = e, m = s.useRef(null), c = z(t), h = K(f);
|
|
95
|
+
s.useEffect(() => {
|
|
96
|
+
const d = m.current, v = window.HTMLInputElement.prototype, a = Object.getOwnPropertyDescriptor(v, "checked").set;
|
|
97
|
+
if (c !== t && a) {
|
|
98
|
+
const x = new Event("click", { bubbles: i });
|
|
99
|
+
d.indeterminate = n(t), a.call(d, n(t) ? !1 : t), d.dispatchEvent(x);
|
|
100
|
+
}
|
|
101
|
+
}, [c, t, i]);
|
|
102
|
+
const k = s.useRef(n(t) ? !1 : t);
|
|
103
|
+
return /* @__PURE__ */ l.jsx(
|
|
104
|
+
"input",
|
|
105
|
+
{
|
|
106
|
+
type: "checkbox",
|
|
107
|
+
"aria-hidden": !0,
|
|
108
|
+
defaultChecked: p ?? k.current,
|
|
109
|
+
...o,
|
|
110
|
+
tabIndex: -1,
|
|
111
|
+
ref: m,
|
|
112
|
+
style: {
|
|
113
|
+
...e.style,
|
|
114
|
+
...h,
|
|
115
|
+
position: "absolute",
|
|
116
|
+
pointerEvents: "none",
|
|
117
|
+
opacity: 0,
|
|
118
|
+
margin: 0
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
};
|
|
123
|
+
function n(e) {
|
|
124
|
+
return e === "indeterminate";
|
|
125
|
+
}
|
|
126
|
+
function I(e) {
|
|
127
|
+
return n(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
128
|
+
}
|
|
129
|
+
var V = j, W = g;
|
|
130
|
+
export {
|
|
131
|
+
j as Checkbox,
|
|
132
|
+
g as CheckboxIndicator,
|
|
133
|
+
W as Indicator,
|
|
134
|
+
V as Root,
|
|
135
|
+
U as createCheckboxScope
|
|
136
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as c from "react";
|
|
3
|
+
function r(t, o) {
|
|
4
|
+
if (typeof t == "function")
|
|
5
|
+
return t(o);
|
|
6
|
+
t != null && (t.current = o);
|
|
7
|
+
}
|
|
8
|
+
function s(...t) {
|
|
9
|
+
return (o) => {
|
|
10
|
+
let u = !1;
|
|
11
|
+
const f = t.map((e) => {
|
|
12
|
+
const n = r(e, o);
|
|
13
|
+
return !u && typeof n == "function" && (u = !0), n;
|
|
14
|
+
});
|
|
15
|
+
if (u)
|
|
16
|
+
return () => {
|
|
17
|
+
for (let e = 0; e < f.length; e++) {
|
|
18
|
+
const n = f[e];
|
|
19
|
+
typeof n == "function" ? n() : r(t[e], null);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function l(...t) {
|
|
25
|
+
return c.useCallback(s(...t), t);
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
s as composeRefs,
|
|
29
|
+
l as useComposedRefs
|
|
30
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { j as C } from "../../../../_virtual/jsx-runtime.js";
|
|
4
|
+
function w(o, u = []) {
|
|
5
|
+
let t = [];
|
|
6
|
+
function d(r, e) {
|
|
7
|
+
const c = s.createContext(e), l = t.length;
|
|
8
|
+
t = [...t, e];
|
|
9
|
+
const m = (v) => {
|
|
10
|
+
var i;
|
|
11
|
+
const { scope: a, children: f, ...p } = v, h = ((i = a == null ? void 0 : a[o]) == null ? void 0 : i[l]) || c, x = s.useMemo(() => p, Object.values(p));
|
|
12
|
+
return /* @__PURE__ */ C.jsx(h.Provider, { value: x, children: f });
|
|
13
|
+
};
|
|
14
|
+
m.displayName = r + "Provider";
|
|
15
|
+
function N(v, i) {
|
|
16
|
+
var a;
|
|
17
|
+
const f = ((a = i == null ? void 0 : i[o]) == null ? void 0 : a[l]) || c, p = s.useContext(f);
|
|
18
|
+
if (p) return p;
|
|
19
|
+
if (e !== void 0) return e;
|
|
20
|
+
throw new Error(`\`${v}\` must be used within \`${r}\``);
|
|
21
|
+
}
|
|
22
|
+
return [m, N];
|
|
23
|
+
}
|
|
24
|
+
const n = () => {
|
|
25
|
+
const r = t.map((e) => s.createContext(e));
|
|
26
|
+
return function(e) {
|
|
27
|
+
const c = (e == null ? void 0 : e[o]) || r;
|
|
28
|
+
return s.useMemo(
|
|
29
|
+
() => ({ [`__scope${o}`]: { ...e, [o]: c } }),
|
|
30
|
+
[e, c]
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
return n.scopeName = o, [d, _(n, ...u)];
|
|
35
|
+
}
|
|
36
|
+
function _(...o) {
|
|
37
|
+
const u = o[0];
|
|
38
|
+
if (o.length === 1) return u;
|
|
39
|
+
const t = () => {
|
|
40
|
+
const d = o.map((n) => ({
|
|
41
|
+
useScope: n(),
|
|
42
|
+
scopeName: n.scopeName
|
|
43
|
+
}));
|
|
44
|
+
return function(n) {
|
|
45
|
+
const r = d.reduce((e, { useScope: c, scopeName: l }) => {
|
|
46
|
+
const m = c(n)[`__scope${l}`];
|
|
47
|
+
return { ...e, ...m };
|
|
48
|
+
}, {});
|
|
49
|
+
return s.useMemo(() => ({ [`__scope${u.scopeName}`]: r }), [r]);
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
return t.scopeName = u.scopeName, t;
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
w as createContextScope
|
|
56
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as u from "react";
|
|
3
|
+
import { useComposedRefs as M } from "../../react-compose-refs/dist/index.js";
|
|
4
|
+
import { useLayoutEffect as N } from "../../react-use-layout-effect/dist/index.js";
|
|
5
|
+
function y(n, e) {
|
|
6
|
+
return u.useReducer((r, t) => e[r][t] ?? r, n);
|
|
7
|
+
}
|
|
8
|
+
var g = (n) => {
|
|
9
|
+
const { present: e, children: r } = n, t = E(e), i = typeof r == "function" ? r({ present: t.isPresent }) : u.Children.only(r), c = M(t.ref, R(i));
|
|
10
|
+
return typeof r == "function" || t.isPresent ? u.cloneElement(i, { ref: c }) : null;
|
|
11
|
+
};
|
|
12
|
+
g.displayName = "Presence";
|
|
13
|
+
function E(n) {
|
|
14
|
+
const [e, r] = u.useState(), t = u.useRef({}), i = u.useRef(n), c = u.useRef("none"), O = n ? "mounted" : "unmounted", [p, s] = y(O, {
|
|
15
|
+
mounted: {
|
|
16
|
+
UNMOUNT: "unmounted",
|
|
17
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
18
|
+
},
|
|
19
|
+
unmountSuspended: {
|
|
20
|
+
MOUNT: "mounted",
|
|
21
|
+
ANIMATION_END: "unmounted"
|
|
22
|
+
},
|
|
23
|
+
unmounted: {
|
|
24
|
+
MOUNT: "mounted"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return u.useEffect(() => {
|
|
28
|
+
const o = f(t.current);
|
|
29
|
+
c.current = p === "mounted" ? o : "none";
|
|
30
|
+
}, [p]), N(() => {
|
|
31
|
+
const o = t.current, d = i.current;
|
|
32
|
+
if (d !== n) {
|
|
33
|
+
const a = c.current, m = f(o);
|
|
34
|
+
n ? s("MOUNT") : m === "none" || (o == null ? void 0 : o.display) === "none" ? s("UNMOUNT") : s(d && a !== m ? "ANIMATION_OUT" : "UNMOUNT"), i.current = n;
|
|
35
|
+
}
|
|
36
|
+
}, [n, s]), N(() => {
|
|
37
|
+
if (e) {
|
|
38
|
+
let o;
|
|
39
|
+
const d = e.ownerDocument.defaultView ?? window, a = (l) => {
|
|
40
|
+
const v = f(t.current).includes(l.animationName);
|
|
41
|
+
if (l.target === e && v && (s("ANIMATION_END"), !i.current)) {
|
|
42
|
+
const T = e.style.animationFillMode;
|
|
43
|
+
e.style.animationFillMode = "forwards", o = d.setTimeout(() => {
|
|
44
|
+
e.style.animationFillMode === "forwards" && (e.style.animationFillMode = T);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}, m = (l) => {
|
|
48
|
+
l.target === e && (c.current = f(t.current));
|
|
49
|
+
};
|
|
50
|
+
return e.addEventListener("animationstart", m), e.addEventListener("animationcancel", a), e.addEventListener("animationend", a), () => {
|
|
51
|
+
d.clearTimeout(o), e.removeEventListener("animationstart", m), e.removeEventListener("animationcancel", a), e.removeEventListener("animationend", a);
|
|
52
|
+
};
|
|
53
|
+
} else
|
|
54
|
+
s("ANIMATION_END");
|
|
55
|
+
}, [e, s]), {
|
|
56
|
+
isPresent: ["mounted", "unmountSuspended"].includes(p),
|
|
57
|
+
ref: u.useCallback((o) => {
|
|
58
|
+
o && (t.current = getComputedStyle(o)), r(o);
|
|
59
|
+
}, [])
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function f(n) {
|
|
63
|
+
return (n == null ? void 0 : n.animationName) || "none";
|
|
64
|
+
}
|
|
65
|
+
function R(n) {
|
|
66
|
+
var e, r;
|
|
67
|
+
let t = (e = Object.getOwnPropertyDescriptor(n.props, "ref")) == null ? void 0 : e.get, i = t && "isReactWarning" in t && t.isReactWarning;
|
|
68
|
+
return i ? n.ref : (t = (r = Object.getOwnPropertyDescriptor(n, "ref")) == null ? void 0 : r.get, i = t && "isReactWarning" in t && t.isReactWarning, i ? n.props.ref : n.props.ref || n.ref);
|
|
69
|
+
}
|
|
70
|
+
export {
|
|
71
|
+
g as Presence
|
|
72
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
import "react-dom";
|
|
4
|
+
import { createSlot as p } from "../../react-slot/dist/index.js";
|
|
5
|
+
import { j as u } from "../../../../_virtual/jsx-runtime.js";
|
|
6
|
+
var f = [
|
|
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
|
+
"span",
|
|
21
|
+
"svg",
|
|
22
|
+
"ul"
|
|
23
|
+
], w = f.reduce((o, r) => {
|
|
24
|
+
const t = p(`Primitive.${r}`), i = l.forwardRef((e, a) => {
|
|
25
|
+
const { asChild: m, ...n } = e, s = m ? t : r;
|
|
26
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ u.jsx(s, { ...n, ref: a });
|
|
27
|
+
});
|
|
28
|
+
return i.displayName = `Primitive.${r}`, { ...o, [r]: i };
|
|
29
|
+
}, {});
|
|
30
|
+
export {
|
|
31
|
+
w as Primitive
|
|
32
|
+
};
|