@definable/ui 0.1.32 → 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/components/alert-dialog.js +15 -15
- package/dist/components/alert.js +21 -21
- package/dist/components/avatar.js +7 -7
- package/dist/components/badge.js +10 -10
- package/dist/components/button.d.ts +1 -1
- package/dist/components/button.js +20 -18
- package/dist/components/calendar.js +26 -26
- package/dist/components/card.js +14 -14
- package/dist/components/carousel.js +39 -39
- package/dist/components/checkbox.js +7 -7
- package/dist/components/collapse.js +17 -17
- package/dist/components/command-menu.js +30 -30
- package/dist/components/command.js +52 -52
- package/dist/components/confirmation-modal.js +23 -23
- package/dist/components/context-menu.js +30 -30
- package/dist/components/dialog.js +32 -32
- package/dist/components/drawer.js +6 -6
- package/dist/components/dropdown-menu.js +16 -16
- package/dist/components/image-cropper-modal.js +27 -27
- package/dist/components/image-cropper.js +27 -27
- package/dist/components/input.js +9 -9
- package/dist/components/loader.js +3 -3
- package/dist/components/loading-placeholder.js +4 -4
- package/dist/components/mention.js +18 -18
- package/dist/components/modal.js +39 -39
- package/dist/components/picker.js +30 -30
- package/dist/components/popover.js +7 -7
- package/dist/components/progress.js +13 -13
- package/dist/components/radio-group.js +19 -19
- package/dist/components/scroll-area.js +20 -20
- package/dist/components/select.js +25 -25
- package/dist/components/selection-bar.js +17 -17
- package/dist/components/separator.js +8 -8
- package/dist/components/skeleton.js +8 -8
- package/dist/components/slider.js +11 -11
- package/dist/components/stepper.js +1 -1
- package/dist/components/switch.js +8 -8
- package/dist/components/table-empty.js +6 -6
- package/dist/components/table-mobile.js +45 -45
- package/dist/components/table.js +66 -66
- package/dist/components/tabs.js +16 -16
- package/dist/components/textarea.js +4 -4
- package/dist/components/use-toast.js +9 -9
- package/dist/icons/icons.d.ts +2 -0
- package/dist/icons/providers/byteplus.d.ts +2 -0
- package/dist/icons/providers/index.d.ts +2 -0
- package/dist/icons/providers/kling.d.ts +2 -0
- package/dist/index.js +285 -218
- package/dist/{stepper-modal-JXpOXOV2.js → stepper-modal-Bh6gsg8o.js} +79 -79
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -2,14 +2,14 @@ import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import * as a from "react";
|
|
3
3
|
import * as e from "@radix-ui/react-select";
|
|
4
4
|
import { ChevronDown as N, Search as S, Check as v } from "lucide-react";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as d } from "../lib/utils.js";
|
|
6
6
|
import { Input as C } from "./input.js";
|
|
7
7
|
const I = e.Root, E = e.Group, L = e.Value, R = a.forwardRef(({ className: o, children: s, ...r }, n) => /* @__PURE__ */ c(
|
|
8
8
|
e.Trigger,
|
|
9
9
|
{
|
|
10
10
|
ref: n,
|
|
11
|
-
className:
|
|
12
|
-
"flex h-10 w-full items-center justify-between rounded-md border border-
|
|
11
|
+
className: d(
|
|
12
|
+
"flex h-10 w-full items-center justify-between rounded-md border border-light bg-secondary px-3 py-2 text-sm ring-offset-white dark:ring-offset-[#1F1F20] placeholder:text-tertiary focus:outline-none focus:ring-2 focus:ring-black/20 dark:focus:ring-white/20 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
13
13
|
o
|
|
14
14
|
),
|
|
15
15
|
...r,
|
|
@@ -20,7 +20,7 @@ const I = e.Root, E = e.Group, L = e.Value, R = a.forwardRef(({ className: o, ch
|
|
|
20
20
|
}
|
|
21
21
|
));
|
|
22
22
|
R.displayName = e.Trigger.displayName;
|
|
23
|
-
const g = a.forwardRef(({ className: o, children: s, position: r = "popper", searchable: n, onSearch: m, searchPlaceholder:
|
|
23
|
+
const g = a.forwardRef(({ className: o, children: s, position: r = "popper", searchable: n, onSearch: m, searchPlaceholder: f = "Search...", ...p }, i) => {
|
|
24
24
|
const [y, b] = a.useState(""), u = a.useRef(null);
|
|
25
25
|
a.useEffect(() => {
|
|
26
26
|
n && u.current && setTimeout(() => {
|
|
@@ -38,22 +38,22 @@ const g = a.forwardRef(({ className: o, children: s, position: r = "popper", sea
|
|
|
38
38
|
return /* @__PURE__ */ t(e.Portal, { children: /* @__PURE__ */ c(
|
|
39
39
|
e.Content,
|
|
40
40
|
{
|
|
41
|
-
ref:
|
|
42
|
-
className:
|
|
43
|
-
"relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-
|
|
41
|
+
ref: i,
|
|
42
|
+
className: d(
|
|
43
|
+
"relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-card text-primary shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
44
44
|
r === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
45
45
|
o
|
|
46
46
|
),
|
|
47
47
|
position: r,
|
|
48
|
-
...
|
|
48
|
+
...p,
|
|
49
49
|
children: [
|
|
50
50
|
n && /* @__PURE__ */ t(
|
|
51
51
|
"div",
|
|
52
52
|
{
|
|
53
|
-
className: "px-2 py-1.5 sticky top-0 bg-
|
|
53
|
+
className: "px-2 py-1.5 sticky top-0 bg-card z-10 border-b",
|
|
54
54
|
onClick: h,
|
|
55
55
|
children: /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
56
|
-
/* @__PURE__ */ t(S, { className: "absolute left-2 top-1/2 transform -translate-y-1/2 h-3.5 w-3.5 text-
|
|
56
|
+
/* @__PURE__ */ t(S, { className: "absolute left-2 top-1/2 transform -translate-y-1/2 h-3.5 w-3.5 text-tertiary" }),
|
|
57
57
|
/* @__PURE__ */ t(
|
|
58
58
|
C,
|
|
59
59
|
{
|
|
@@ -62,7 +62,7 @@ const g = a.forwardRef(({ className: o, children: s, position: r = "popper", sea
|
|
|
62
62
|
onChange: w,
|
|
63
63
|
onClick: h,
|
|
64
64
|
onKeyDown: x,
|
|
65
|
-
placeholder:
|
|
65
|
+
placeholder: f,
|
|
66
66
|
className: "h-7 text-xs pl-7"
|
|
67
67
|
}
|
|
68
68
|
)
|
|
@@ -72,7 +72,7 @@ const g = a.forwardRef(({ className: o, children: s, position: r = "popper", sea
|
|
|
72
72
|
/* @__PURE__ */ t(
|
|
73
73
|
e.Viewport,
|
|
74
74
|
{
|
|
75
|
-
className:
|
|
75
|
+
className: d(
|
|
76
76
|
"p-1",
|
|
77
77
|
r === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
78
78
|
),
|
|
@@ -84,21 +84,21 @@ const g = a.forwardRef(({ className: o, children: s, position: r = "popper", sea
|
|
|
84
84
|
) });
|
|
85
85
|
});
|
|
86
86
|
g.displayName = e.Content.displayName;
|
|
87
|
-
const
|
|
87
|
+
const k = a.forwardRef(({ className: o, ...s }, r) => /* @__PURE__ */ t(
|
|
88
88
|
e.Label,
|
|
89
89
|
{
|
|
90
90
|
ref: r,
|
|
91
|
-
className:
|
|
91
|
+
className: d("py-1.5 pl-8 pr-2 text-sm font-semibold", o),
|
|
92
92
|
...s
|
|
93
93
|
}
|
|
94
94
|
));
|
|
95
|
-
|
|
96
|
-
const
|
|
95
|
+
k.displayName = e.Label.displayName;
|
|
96
|
+
const V = a.forwardRef(({ className: o, children: s, ...r }, n) => /* @__PURE__ */ c(
|
|
97
97
|
e.Item,
|
|
98
98
|
{
|
|
99
99
|
ref: n,
|
|
100
|
-
className:
|
|
101
|
-
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-
|
|
100
|
+
className: d(
|
|
101
|
+
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-hover focus:text-primary data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
102
102
|
o
|
|
103
103
|
),
|
|
104
104
|
...r,
|
|
@@ -108,14 +108,14 @@ const k = a.forwardRef(({ className: o, children: s, ...r }, n) => /* @__PURE__
|
|
|
108
108
|
]
|
|
109
109
|
}
|
|
110
110
|
));
|
|
111
|
-
|
|
111
|
+
V.displayName = e.Item.displayName;
|
|
112
112
|
const T = a.forwardRef(({ children: o, searchPlaceholder: s, ...r }, n) => {
|
|
113
|
-
const [m,
|
|
113
|
+
const [m, f] = a.useState(""), p = a.Children.map(o, (i) => a.isValidElement(i) && i.type === g ? a.cloneElement(i, {
|
|
114
114
|
searchable: !0,
|
|
115
|
-
onSearch:
|
|
115
|
+
onSearch: f,
|
|
116
116
|
searchPlaceholder: s
|
|
117
|
-
}) :
|
|
118
|
-
return /* @__PURE__ */ t(I, { ...r, children:
|
|
117
|
+
}) : i);
|
|
118
|
+
return /* @__PURE__ */ t(I, { ...r, children: p });
|
|
119
119
|
});
|
|
120
120
|
T.displayName = "SearchableSelect";
|
|
121
121
|
export {
|
|
@@ -123,8 +123,8 @@ export {
|
|
|
123
123
|
I as Select,
|
|
124
124
|
g as SelectContent,
|
|
125
125
|
E as SelectGroup,
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
V as SelectItem,
|
|
127
|
+
k as SelectLabel,
|
|
128
128
|
R as SelectTrigger,
|
|
129
129
|
L as SelectValue
|
|
130
130
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import { AnimatePresence as o, motion as d } from "framer-motion";
|
|
3
|
-
import { Check as h, X as
|
|
4
|
-
import { Button as
|
|
5
|
-
function
|
|
6
|
-
selectedCount:
|
|
3
|
+
import { Check as h, X as g, Download as p, Trash as x } from "lucide-react";
|
|
4
|
+
import { Button as t } from "./button.js";
|
|
5
|
+
function y({
|
|
6
|
+
selectedCount: c,
|
|
7
7
|
onEnable: a,
|
|
8
8
|
onDisable: s,
|
|
9
|
-
onDelete:
|
|
10
|
-
onDownload:
|
|
9
|
+
onDelete: r,
|
|
10
|
+
onDownload: l,
|
|
11
11
|
onCancel: m,
|
|
12
12
|
show: n
|
|
13
13
|
}) {
|
|
@@ -20,34 +20,34 @@ function w({
|
|
|
20
20
|
className: "fixed bottom-4 left-1/2 -translate-x-1/2 w-fit bg-secondary rounded-lg border shadow-lg z-50",
|
|
21
21
|
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-6 px-4 py-2", children: [
|
|
22
22
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
23
|
-
/* @__PURE__ */ e("span", { className: "bg-primary text-
|
|
23
|
+
/* @__PURE__ */ e("span", { className: "bg-primary text-white w-8 h-8 rounded-lg flex items-center justify-center", children: c }),
|
|
24
24
|
"Selected"
|
|
25
25
|
] }),
|
|
26
|
-
/* @__PURE__ */ e("div", { className: "h-4 w-px bg-
|
|
26
|
+
/* @__PURE__ */ e("div", { className: "h-4 w-px bg-light" }),
|
|
27
27
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
28
|
-
a && /* @__PURE__ */ i(
|
|
28
|
+
a && /* @__PURE__ */ i(t, { variant: "ghost", size: "sm", onClick: a, children: [
|
|
29
29
|
/* @__PURE__ */ e(h, { className: "mr-2 h-4 w-4" }),
|
|
30
30
|
"Enable"
|
|
31
31
|
] }),
|
|
32
|
-
s && /* @__PURE__ */ i(
|
|
33
|
-
/* @__PURE__ */ e(
|
|
32
|
+
s && /* @__PURE__ */ i(t, { variant: "ghost", size: "sm", onClick: s, children: [
|
|
33
|
+
/* @__PURE__ */ e(g, { className: "mr-2 h-4 w-4" }),
|
|
34
34
|
"Disable"
|
|
35
35
|
] }),
|
|
36
|
-
|
|
37
|
-
/* @__PURE__ */ e(
|
|
36
|
+
l && /* @__PURE__ */ i(t, { variant: "ghost", size: "sm", onClick: l, children: [
|
|
37
|
+
/* @__PURE__ */ e(p, { className: "mr-2 h-4 w-4" }),
|
|
38
38
|
"Download"
|
|
39
39
|
] }),
|
|
40
|
-
|
|
40
|
+
r && /* @__PURE__ */ i(t, { variant: "ghost", size: "sm", className: "text-red-500", onClick: r, children: [
|
|
41
41
|
/* @__PURE__ */ e(x, { className: "mr-2 h-4 w-4" }),
|
|
42
42
|
"Delete"
|
|
43
43
|
] })
|
|
44
44
|
] }),
|
|
45
|
-
/* @__PURE__ */ e("div", { className: "h-4 w-px bg-
|
|
46
|
-
/* @__PURE__ */ e(
|
|
45
|
+
/* @__PURE__ */ e("div", { className: "h-4 w-px bg-light" }),
|
|
46
|
+
/* @__PURE__ */ e(t, { variant: "ghost", size: "sm", onClick: m, children: "Cancel" })
|
|
47
47
|
] })
|
|
48
48
|
}
|
|
49
49
|
) });
|
|
50
50
|
}
|
|
51
51
|
export {
|
|
52
|
-
|
|
52
|
+
y as SelectionBar
|
|
53
53
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import * as l from "react";
|
|
3
3
|
import * as o from "@radix-ui/react-separator";
|
|
4
|
-
import { cn as
|
|
5
|
-
const s =
|
|
6
|
-
({ className: a, orientation: r = "horizontal", decorative: t = !0, ...m },
|
|
4
|
+
import { cn as e } from "../lib/utils.js";
|
|
5
|
+
const s = l.forwardRef(
|
|
6
|
+
({ className: a, orientation: r = "horizontal", decorative: t = !0, ...m }, i) => /* @__PURE__ */ p(
|
|
7
7
|
o.Root,
|
|
8
8
|
{
|
|
9
|
-
ref:
|
|
9
|
+
ref: i,
|
|
10
10
|
decorative: t,
|
|
11
11
|
orientation: r,
|
|
12
|
-
className:
|
|
13
|
-
"shrink-0 bg-
|
|
12
|
+
className: e(
|
|
13
|
+
"shrink-0 bg-light dark:bg-dark",
|
|
14
14
|
r === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
15
15
|
a
|
|
16
16
|
),
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cn as
|
|
3
|
-
function
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { cn as m } from "../lib/utils.js";
|
|
3
|
+
function i({
|
|
4
4
|
className: e,
|
|
5
|
-
...
|
|
5
|
+
...o
|
|
6
6
|
}) {
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ r(
|
|
8
8
|
"div",
|
|
9
9
|
{
|
|
10
|
-
className:
|
|
11
|
-
...
|
|
10
|
+
className: m("animate-pulse rounded-md bg-hover/60", e),
|
|
11
|
+
...o
|
|
12
12
|
}
|
|
13
13
|
);
|
|
14
14
|
}
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
i as Skeleton
|
|
17
17
|
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { jsxs as a, jsx as
|
|
1
|
+
import { jsxs as a, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import * as t from "react";
|
|
3
3
|
import * as e from "@radix-ui/react-slider";
|
|
4
|
-
import { cn as
|
|
5
|
-
const
|
|
6
|
-
var
|
|
4
|
+
import { cn as c } from "../lib/utils.js";
|
|
5
|
+
const n = t.forwardRef(({ className: l, ...r }, s) => {
|
|
6
|
+
var o;
|
|
7
7
|
return /* @__PURE__ */ a(
|
|
8
8
|
e.Root,
|
|
9
9
|
{
|
|
10
10
|
ref: s,
|
|
11
|
-
className:
|
|
11
|
+
className: c(
|
|
12
12
|
"relative flex w-full touch-none select-none items-center",
|
|
13
13
|
l
|
|
14
14
|
),
|
|
15
|
-
...
|
|
15
|
+
...r,
|
|
16
16
|
children: [
|
|
17
|
-
/* @__PURE__ */
|
|
17
|
+
/* @__PURE__ */ i(e.Track, { className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20", children: /* @__PURE__ */ i(
|
|
18
18
|
"div",
|
|
19
19
|
{
|
|
20
20
|
className: "absolute h-full bg-primary",
|
|
21
|
-
style: { width: `${(((
|
|
21
|
+
style: { width: `${(((o = r.value) == null ? void 0 : o[0]) || 0) * 100}%` }
|
|
22
22
|
}
|
|
23
23
|
) }),
|
|
24
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ i(e.Thumb, { className: "block h-4 w-4 rounded-full border border-primary/50 bg-secondary shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-black/20 dark:focus-visible:ring-white/20 disabled:pointer-events-none disabled:opacity-50 hover:scale-110 active:scale-90" })
|
|
25
25
|
]
|
|
26
26
|
}
|
|
27
27
|
);
|
|
28
28
|
});
|
|
29
|
-
|
|
29
|
+
n.displayName = e.Root.displayName;
|
|
30
30
|
export {
|
|
31
|
-
|
|
31
|
+
n as Slider
|
|
32
32
|
};
|
|
@@ -3,22 +3,22 @@ import * as t from "react";
|
|
|
3
3
|
import * as e from "@radix-ui/react-switch";
|
|
4
4
|
import { cn as a } from "../lib/utils.js";
|
|
5
5
|
import { motion as n } from "framer-motion";
|
|
6
|
-
const
|
|
6
|
+
const l = t.forwardRef(({ className: o, ...r }, s) => /* @__PURE__ */ i(
|
|
7
7
|
e.Root,
|
|
8
8
|
{
|
|
9
9
|
className: a(
|
|
10
|
-
"peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-
|
|
11
|
-
|
|
10
|
+
"peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-black/20 dark:focus-visible:ring-white/20 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-[#1F1F20] disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-[var(--text-primary)] data-[state=unchecked]:bg-[var(--border-input)]",
|
|
11
|
+
o
|
|
12
12
|
),
|
|
13
|
-
...
|
|
13
|
+
...r,
|
|
14
14
|
ref: s,
|
|
15
15
|
children: /* @__PURE__ */ i(e.Thumb, { asChild: !0, children: /* @__PURE__ */ i(
|
|
16
16
|
n.div,
|
|
17
17
|
{
|
|
18
|
-
className: "block h-4 w-4 rounded-full bg-
|
|
18
|
+
className: "block h-4 w-4 rounded-full bg-[var(--bg-card)] shadow-lg ring-0",
|
|
19
19
|
initial: !1,
|
|
20
20
|
animate: {
|
|
21
|
-
x:
|
|
21
|
+
x: r.checked ? 16 : 0
|
|
22
22
|
},
|
|
23
23
|
transition: {
|
|
24
24
|
type: "spring",
|
|
@@ -29,7 +29,7 @@ const c = t.forwardRef(({ className: r, ...o }, s) => /* @__PURE__ */ i(
|
|
|
29
29
|
) })
|
|
30
30
|
}
|
|
31
31
|
));
|
|
32
|
-
|
|
32
|
+
l.displayName = e.Root.displayName;
|
|
33
33
|
export {
|
|
34
|
-
|
|
34
|
+
l as Switch
|
|
35
35
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
|
-
import { FolderOpen as
|
|
3
|
-
import { Button as
|
|
2
|
+
import { FolderOpen as l } from "lucide-react";
|
|
3
|
+
import { Button as m } from "./button.js";
|
|
4
4
|
function x({
|
|
5
5
|
title: a = "No data available",
|
|
6
6
|
description: s = "Get started by creating your first record.",
|
|
7
7
|
actionLabel: c = "Create New",
|
|
8
8
|
onAction: t,
|
|
9
|
-
icon:
|
|
9
|
+
icon: i = /* @__PURE__ */ e(l, { className: "w-10 h-10 text-tertiary" })
|
|
10
10
|
}) {
|
|
11
11
|
return /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-12 px-4", children: /* @__PURE__ */ r("div", { className: "space-y-5 text-center", children: [
|
|
12
|
-
/* @__PURE__ */ e("div", { className: "flex justify-center", children:
|
|
12
|
+
/* @__PURE__ */ e("div", { className: "flex justify-center", children: i }),
|
|
13
13
|
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
14
14
|
/* @__PURE__ */ e("h3", { className: "text-lg font-medium", children: a }),
|
|
15
|
-
/* @__PURE__ */ e("p", { className: "text-sm text-
|
|
15
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-tertiary max-w-sm mx-auto", children: s })
|
|
16
16
|
] }),
|
|
17
|
-
t && /* @__PURE__ */ e(
|
|
17
|
+
t && /* @__PURE__ */ e(m, { onClick: t, children: c })
|
|
18
18
|
] }) });
|
|
19
19
|
}
|
|
20
20
|
export {
|
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cn as
|
|
3
|
-
import { Checkbox as
|
|
4
|
-
import { Tooltip as
|
|
5
|
-
import { useState as
|
|
1
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { cn as c } from "../lib/utils.js";
|
|
3
|
+
import { Checkbox as u } from "./checkbox.js";
|
|
4
|
+
import { Tooltip as f } from "./tooltip.js";
|
|
5
|
+
import { useState as g } from "react";
|
|
6
6
|
import { ChevronRight as x } from "lucide-react";
|
|
7
7
|
function V({
|
|
8
|
-
data:
|
|
9
|
-
columns:
|
|
10
|
-
showCheckbox:
|
|
8
|
+
data: h,
|
|
9
|
+
columns: l,
|
|
10
|
+
showCheckbox: n = !0,
|
|
11
11
|
onRowClick: t,
|
|
12
|
-
selectedItems:
|
|
13
|
-
onSelect:
|
|
14
|
-
isLoading:
|
|
15
|
-
loadingRows:
|
|
12
|
+
selectedItems: d,
|
|
13
|
+
onSelect: o,
|
|
14
|
+
isLoading: m = !1,
|
|
15
|
+
loadingRows: v = 3
|
|
16
16
|
}) {
|
|
17
|
-
const [
|
|
18
|
-
return
|
|
17
|
+
const [b, p] = g(null);
|
|
18
|
+
return m ? /* @__PURE__ */ r("div", { className: "space-y-4", children: Array(v).fill(0).map((a, s) => /* @__PURE__ */ i(
|
|
19
19
|
"div",
|
|
20
20
|
{
|
|
21
21
|
className: "border border-light rounded-xl p-4 space-y-4 shadow-sm bg-card animate-pulse",
|
|
22
22
|
children: [
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
|
|
23
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
24
|
+
/* @__PURE__ */ r("div", { className: "h-5 bg-hover/70 rounded-md w-2/5" }),
|
|
25
|
+
n && /* @__PURE__ */ r("div", { className: "h-4 w-4 rounded-md bg-hover/50" })
|
|
26
26
|
] }),
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
] }, `skeleton-col-${
|
|
27
|
+
/* @__PURE__ */ r("div", { className: "space-y-3 pt-2", children: l.slice(0, 4).map((e, N) => /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
28
|
+
/* @__PURE__ */ r("div", { className: "h-4 bg-hover/40 rounded-md w-1/4" }),
|
|
29
|
+
/* @__PURE__ */ r("div", { className: "h-4 bg-hover/60 rounded-md", style: { width: Math.random() * 50 + 30 + "%" } })
|
|
30
|
+
] }, `skeleton-col-${e.id}`)) })
|
|
31
31
|
]
|
|
32
32
|
},
|
|
33
33
|
`skeleton-${s}`
|
|
34
|
-
)) }) :
|
|
34
|
+
)) }) : h.length === 0 ? null : /* @__PURE__ */ r("div", { className: "space-y-4", children: h.map((a, s) => /* @__PURE__ */ i(
|
|
35
35
|
"div",
|
|
36
36
|
{
|
|
37
|
-
className:
|
|
37
|
+
className: c(
|
|
38
38
|
"border border-light/40 rounded-xl overflow-hidden bg-card shadow-sm transition-all duration-200",
|
|
39
39
|
t && "cursor-pointer hover:border-primary/30 hover:shadow-md hover:bg-card"
|
|
40
40
|
),
|
|
41
41
|
onClick: () => t == null ? void 0 : t(a),
|
|
42
42
|
children: [
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 border-b border-light bg-hover/5", children: [
|
|
44
|
+
/* @__PURE__ */ r("div", { className: "font-medium", children: l[0].cell(a) || `Item ${s + 1}` }),
|
|
45
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
46
|
+
n && /* @__PURE__ */ r(
|
|
47
|
+
u,
|
|
48
48
|
{
|
|
49
|
-
checked:
|
|
50
|
-
onClick: (
|
|
51
|
-
|
|
49
|
+
checked: d == null ? void 0 : d.has(a.id),
|
|
50
|
+
onClick: (e) => {
|
|
51
|
+
e.stopPropagation(), o == null || o(a.id, !(d != null && d.has(a.id)));
|
|
52
52
|
},
|
|
53
|
-
className: "data-[state=checked]:bg-primary data-[state=checked]:text-
|
|
53
|
+
className: "data-[state=checked]:bg-primary data-[state=checked]:text-white"
|
|
54
54
|
}
|
|
55
55
|
),
|
|
56
|
-
t && /* @__PURE__ */
|
|
56
|
+
t && /* @__PURE__ */ r(x, { className: "h-4 w-4 text-tertiary/50" })
|
|
57
57
|
] })
|
|
58
58
|
] }),
|
|
59
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ r("div", { className: "px-4 py-3 space-y-3", children: l.slice(1).map((e) => /* @__PURE__ */ i(
|
|
60
60
|
"div",
|
|
61
61
|
{
|
|
62
62
|
className: "flex items-start gap-3 text-sm group",
|
|
63
|
-
onMouseEnter: () =>
|
|
64
|
-
onMouseLeave: () =>
|
|
63
|
+
onMouseEnter: () => e.tooltipValue && p(`${s}-${e.id}`),
|
|
64
|
+
onMouseLeave: () => p(null),
|
|
65
65
|
children: [
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
"flex-1 min-w-0 text-
|
|
69
|
-
|
|
70
|
-
), children:
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
/* @__PURE__ */ r("div", { className: "font-medium text-tertiary w-1/3 min-w-[80px] text-xs uppercase tracking-wide pt-0.5", children: e.header }),
|
|
67
|
+
/* @__PURE__ */ r("div", { className: c(
|
|
68
|
+
"flex-1 min-w-0 text-primary/90 group-hover:text-primary transition-colors",
|
|
69
|
+
e.truncate && "truncate"
|
|
70
|
+
), children: e.cell(a) }),
|
|
71
|
+
e.tooltipValue && b === `${s}-${e.id}` && /* @__PURE__ */ r(
|
|
72
|
+
f,
|
|
73
73
|
{
|
|
74
|
-
content:
|
|
74
|
+
content: e.tooltipValue(a),
|
|
75
75
|
side: "bottom",
|
|
76
76
|
align: "start",
|
|
77
77
|
isVisible: !0
|
|
@@ -79,7 +79,7 @@ function V({
|
|
|
79
79
|
)
|
|
80
80
|
]
|
|
81
81
|
},
|
|
82
|
-
|
|
82
|
+
e.id
|
|
83
83
|
)) })
|
|
84
84
|
]
|
|
85
85
|
},
|