laif-ds 0.1.75 → 0.1.76
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/accordion.js +1 -1
- package/dist/components/ui/alert-dialog.js +3 -3
- package/dist/components/ui/alert.js +3 -3
- package/dist/components/ui/app-multiple-select-dropdown.js +12 -12
- package/dist/components/ui/async-select.js +18 -18
- package/dist/components/ui/card.js +26 -26
- package/dist/components/ui/chat-message.js +6 -6
- package/dist/components/ui/chat.js +44 -44
- package/dist/components/ui/context-menu.js +2 -2
- package/dist/components/ui/dialog.js +7 -7
- package/dist/components/ui/drawer.js +33 -33
- package/dist/components/ui/dropdown-menu.js +20 -20
- package/dist/components/ui/file-preview.js +51 -51
- package/dist/components/ui/gantt/components/Controls/Controls.js +60 -51
- package/dist/components/ui/hover-card.js +5 -5
- package/dist/components/ui/input-selector.js +19 -19
- package/dist/components/ui/interrupt-prompt.js +6 -6
- package/dist/components/ui/markdown-renderer.js +16 -16
- package/dist/components/ui/menubar.js +26 -26
- package/dist/components/ui/message-input.js +9 -9
- package/dist/components/ui/multiple-selector.js +20 -20
- package/dist/components/ui/navigation-menu.js +5 -5
- package/dist/components/ui/popover.js +4 -4
- package/dist/components/ui/prompt-suggestions.js +11 -11
- package/dist/components/ui/resizable.js +2 -2
- package/dist/components/ui/sheet.js +16 -16
- package/dist/components/ui/sidebar.js +23 -24
- package/dist/components/ui/table-skeleton.js +36 -36
- package/dist/components/ui/table.js +25 -25
- package/dist/components/ui/toggle-group.js +15 -15
- package/dist/components/ui/weekly-calendar/appointment-card.js +24 -24
- package/dist/styles.css +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
3
|
-
import { Root as
|
|
3
|
+
import { Root as i, Trigger as l, Content as d, Close as c, Title as g, Description as f, Portal as u, Overlay as m } from "../../node_modules/@radix-ui/react-dialog/dist/index.js";
|
|
4
4
|
import { cn as o } from "../../lib/utils.js";
|
|
5
5
|
import p from "../../node_modules/lucide-react/dist/esm/icons/x.js";
|
|
6
6
|
function w({
|
|
7
7
|
...t
|
|
8
8
|
}) {
|
|
9
|
-
return /* @__PURE__ */ e(
|
|
9
|
+
return /* @__PURE__ */ e(i, { "data-slot": "dialog", ...t });
|
|
10
10
|
}
|
|
11
11
|
function z({
|
|
12
12
|
...t
|
|
@@ -37,7 +37,7 @@ function v({
|
|
|
37
37
|
function k({
|
|
38
38
|
className: t,
|
|
39
39
|
children: a,
|
|
40
|
-
...
|
|
40
|
+
...s
|
|
41
41
|
}) {
|
|
42
42
|
return /* @__PURE__ */ n(x, { "data-slot": "dialog-portal", children: [
|
|
43
43
|
/* @__PURE__ */ e(v, {}),
|
|
@@ -45,14 +45,14 @@ function k({
|
|
|
45
45
|
d,
|
|
46
46
|
{
|
|
47
47
|
"data-slot": "dialog-content",
|
|
48
|
-
onPointerDownOutside: (
|
|
49
|
-
|
|
48
|
+
onPointerDownOutside: (r) => {
|
|
49
|
+
r.target?.closest("[data-command-portal]") && r.preventDefault();
|
|
50
50
|
},
|
|
51
51
|
className: o(
|
|
52
|
-
"bg-d-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
|
|
52
|
+
"bg-d-background 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 border-d-border fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
|
|
53
53
|
t
|
|
54
54
|
),
|
|
55
|
-
...
|
|
55
|
+
...s,
|
|
56
56
|
children: [
|
|
57
57
|
a,
|
|
58
58
|
/* @__PURE__ */ n(c, { className: "ring-offset-d-background focus:ring-d-ring data-[state=open]:bg-d-accent data-[state=open]:text-d-secondary-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", children: [
|
|
@@ -3,23 +3,23 @@ import { jsx as t, jsxs as o } from "react/jsx-runtime";
|
|
|
3
3
|
import { Drawer as e } from "../../node_modules/vaul/dist/index.js";
|
|
4
4
|
import { cn as d } from "../../lib/utils.js";
|
|
5
5
|
function w({
|
|
6
|
-
...
|
|
6
|
+
...r
|
|
7
7
|
}) {
|
|
8
|
-
return /* @__PURE__ */ t(e.Root, { "data-slot": "drawer", ...
|
|
8
|
+
return /* @__PURE__ */ t(e.Root, { "data-slot": "drawer", ...r });
|
|
9
9
|
}
|
|
10
10
|
function m({
|
|
11
|
-
...
|
|
11
|
+
...r
|
|
12
12
|
}) {
|
|
13
|
-
return /* @__PURE__ */ t(e.Trigger, { "data-slot": "drawer-trigger", ...
|
|
13
|
+
return /* @__PURE__ */ t(e.Trigger, { "data-slot": "drawer-trigger", ...r });
|
|
14
14
|
}
|
|
15
15
|
function n({
|
|
16
|
-
...
|
|
16
|
+
...r
|
|
17
17
|
}) {
|
|
18
|
-
return /* @__PURE__ */ t(e.Portal, { "data-slot": "drawer-portal", ...
|
|
18
|
+
return /* @__PURE__ */ t(e.Portal, { "data-slot": "drawer-portal", ...r });
|
|
19
19
|
}
|
|
20
20
|
function l({
|
|
21
|
-
className:
|
|
22
|
-
...
|
|
21
|
+
className: r,
|
|
22
|
+
...a
|
|
23
23
|
}) {
|
|
24
24
|
return /* @__PURE__ */ t(
|
|
25
25
|
e.Overlay,
|
|
@@ -27,15 +27,15 @@ function l({
|
|
|
27
27
|
"data-slot": "drawer-overlay",
|
|
28
28
|
className: d(
|
|
29
29
|
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
30
|
-
|
|
30
|
+
r
|
|
31
31
|
),
|
|
32
|
-
...
|
|
32
|
+
...a
|
|
33
33
|
}
|
|
34
34
|
);
|
|
35
35
|
}
|
|
36
36
|
function f({
|
|
37
|
-
className:
|
|
38
|
-
children:
|
|
37
|
+
className: r,
|
|
38
|
+
children: a,
|
|
39
39
|
...i
|
|
40
40
|
}) {
|
|
41
41
|
return /* @__PURE__ */ o(n, { "data-slot": "drawer-portal", children: [
|
|
@@ -45,76 +45,76 @@ function f({
|
|
|
45
45
|
{
|
|
46
46
|
"data-slot": "drawer-content",
|
|
47
47
|
className: d(
|
|
48
|
-
"group/drawer-content bg-d-background fixed z-50 flex h-auto flex-col",
|
|
48
|
+
"border-d-border group/drawer-content bg-d-background fixed z-50 flex h-auto flex-col",
|
|
49
49
|
"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b",
|
|
50
50
|
"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t",
|
|
51
51
|
"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
52
52
|
"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",
|
|
53
|
-
|
|
53
|
+
r
|
|
54
54
|
),
|
|
55
55
|
...i,
|
|
56
56
|
children: [
|
|
57
57
|
/* @__PURE__ */ t("div", { className: "bg-d-secondary mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }),
|
|
58
|
-
|
|
58
|
+
a
|
|
59
59
|
]
|
|
60
60
|
}
|
|
61
61
|
)
|
|
62
62
|
] });
|
|
63
63
|
}
|
|
64
|
-
function v({ className:
|
|
64
|
+
function v({ className: r, ...a }) {
|
|
65
65
|
return /* @__PURE__ */ t(
|
|
66
66
|
"div",
|
|
67
67
|
{
|
|
68
68
|
"data-slot": "drawer-header",
|
|
69
|
-
className: d("flex flex-col gap-1.5 p-4",
|
|
70
|
-
...
|
|
69
|
+
className: d("flex flex-col gap-1.5 p-4", r),
|
|
70
|
+
...a
|
|
71
71
|
}
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
|
-
function p({ className:
|
|
74
|
+
function p({ className: r, ...a }) {
|
|
75
75
|
return /* @__PURE__ */ t(
|
|
76
76
|
"div",
|
|
77
77
|
{
|
|
78
78
|
"data-slot": "drawer-footer",
|
|
79
|
-
className: d("mt-auto flex flex-col gap-2 p-4",
|
|
80
|
-
...
|
|
79
|
+
className: d("mt-auto flex flex-col gap-2 p-4", r),
|
|
80
|
+
...a
|
|
81
81
|
}
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
className:
|
|
86
|
-
...
|
|
84
|
+
function b({
|
|
85
|
+
className: r,
|
|
86
|
+
...a
|
|
87
87
|
}) {
|
|
88
88
|
return /* @__PURE__ */ t(
|
|
89
89
|
e.Title,
|
|
90
90
|
{
|
|
91
91
|
"data-slot": "drawer-title",
|
|
92
|
-
className: d("text-d-foreground font-semibold",
|
|
93
|
-
...
|
|
92
|
+
className: d("text-d-foreground font-semibold", r),
|
|
93
|
+
...a
|
|
94
94
|
}
|
|
95
95
|
);
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
className:
|
|
99
|
-
...
|
|
97
|
+
function g({
|
|
98
|
+
className: r,
|
|
99
|
+
...a
|
|
100
100
|
}) {
|
|
101
101
|
return /* @__PURE__ */ t(
|
|
102
102
|
e.Description,
|
|
103
103
|
{
|
|
104
104
|
"data-slot": "drawer-description",
|
|
105
|
-
className: d("text-d-secondary-foreground text-sm",
|
|
106
|
-
...
|
|
105
|
+
className: d("text-d-secondary-foreground text-sm", r),
|
|
106
|
+
...a
|
|
107
107
|
}
|
|
108
108
|
);
|
|
109
109
|
}
|
|
110
110
|
export {
|
|
111
111
|
w as Drawer,
|
|
112
112
|
f as DrawerContent,
|
|
113
|
-
|
|
113
|
+
g as DrawerDescription,
|
|
114
114
|
p as DrawerFooter,
|
|
115
115
|
v as DrawerHeader,
|
|
116
116
|
l as DrawerOverlay,
|
|
117
117
|
n as DrawerPortal,
|
|
118
|
-
|
|
118
|
+
b as DrawerTitle,
|
|
119
119
|
m as DrawerTrigger
|
|
120
120
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as a, jsxs as i } from "react/jsx-runtime";
|
|
3
|
-
import * as
|
|
3
|
+
import * as r from "react";
|
|
4
4
|
import { Root as w, Trigger as x, Portal as N, Content as l, Item as m, Label as c, Separator as p, SubTrigger as f, SubContent as u, CheckboxItem as g, ItemIndicator as b, RadioItem as h } from "../../node_modules/@radix-ui/react-dropdown-menu/dist/index.js";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as s } from "../../lib/utils.js";
|
|
6
6
|
import y from "../../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
|
|
7
7
|
import v from "../../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
8
8
|
import R from "../../node_modules/lucide-react/dist/esm/icons/circle.js";
|
|
9
|
-
const B = w, E = x, I =
|
|
9
|
+
const B = w, E = x, I = r.forwardRef(({ className: e, inset: t, children: o, ...n }, d) => /* @__PURE__ */ i(
|
|
10
10
|
f,
|
|
11
11
|
{
|
|
12
12
|
ref: d,
|
|
13
|
-
className:
|
|
13
|
+
className: s(
|
|
14
14
|
"focus:bg-accent data-[state=open]:bg-accent flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
15
15
|
t && "pl-8",
|
|
16
16
|
e
|
|
@@ -23,25 +23,25 @@ const B = w, E = x, I = s.forwardRef(({ className: e, inset: t, children: o, ...
|
|
|
23
23
|
}
|
|
24
24
|
));
|
|
25
25
|
I.displayName = f.displayName;
|
|
26
|
-
const C =
|
|
26
|
+
const C = r.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a(
|
|
27
27
|
u,
|
|
28
28
|
{
|
|
29
29
|
ref: o,
|
|
30
|
-
className:
|
|
31
|
-
"bg-popover text-popover-foreground 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 z-50 min-w-[8rem] origin-[--radix-dropdown-menu-content-transform-origin] overflow-hidden rounded-md border p-1 shadow-lg",
|
|
30
|
+
className: s(
|
|
31
|
+
"bg-popover text-popover-foreground 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 border-d-border z-50 min-w-[8rem] origin-[--radix-dropdown-menu-content-transform-origin] overflow-hidden rounded-md border p-1 shadow-lg",
|
|
32
32
|
e
|
|
33
33
|
),
|
|
34
34
|
...t
|
|
35
35
|
}
|
|
36
36
|
));
|
|
37
37
|
C.displayName = u.displayName;
|
|
38
|
-
const D =
|
|
38
|
+
const D = r.forwardRef(({ className: e, sideOffset: t = 4, ...o }, n) => /* @__PURE__ */ a(N, { children: /* @__PURE__ */ a(
|
|
39
39
|
l,
|
|
40
40
|
{
|
|
41
41
|
ref: n,
|
|
42
42
|
sideOffset: t,
|
|
43
|
-
className:
|
|
44
|
-
"bg-popover text-popover-foreground z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
43
|
+
className: s(
|
|
44
|
+
"bg-popover text-popover-foreground border-d-border z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
45
45
|
"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 origin-[--radix-dropdown-menu-content-transform-origin]",
|
|
46
46
|
e
|
|
47
47
|
),
|
|
@@ -49,11 +49,11 @@ const D = s.forwardRef(({ className: e, sideOffset: t = 4, ...o }, n) => /* @__P
|
|
|
49
49
|
}
|
|
50
50
|
) }));
|
|
51
51
|
D.displayName = l.displayName;
|
|
52
|
-
const M =
|
|
52
|
+
const M = r.forwardRef(({ className: e, inset: t, ...o }, n) => /* @__PURE__ */ a(
|
|
53
53
|
m,
|
|
54
54
|
{
|
|
55
55
|
ref: n,
|
|
56
|
-
className:
|
|
56
|
+
className: s(
|
|
57
57
|
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
58
58
|
t && "pl-8",
|
|
59
59
|
e
|
|
@@ -62,11 +62,11 @@ const M = s.forwardRef(({ className: e, inset: t, ...o }, n) => /* @__PURE__ */
|
|
|
62
62
|
}
|
|
63
63
|
));
|
|
64
64
|
M.displayName = m.displayName;
|
|
65
|
-
const S =
|
|
65
|
+
const S = r.forwardRef(({ className: e, children: t, checked: o, ...n }, d) => /* @__PURE__ */ i(
|
|
66
66
|
g,
|
|
67
67
|
{
|
|
68
68
|
ref: d,
|
|
69
|
-
className:
|
|
69
|
+
className: s(
|
|
70
70
|
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
71
71
|
e
|
|
72
72
|
),
|
|
@@ -79,11 +79,11 @@ const S = s.forwardRef(({ className: e, children: t, checked: o, ...n }, d) => /
|
|
|
79
79
|
}
|
|
80
80
|
));
|
|
81
81
|
S.displayName = g.displayName;
|
|
82
|
-
const z =
|
|
82
|
+
const z = r.forwardRef(({ className: e, children: t, ...o }, n) => /* @__PURE__ */ i(
|
|
83
83
|
h,
|
|
84
84
|
{
|
|
85
85
|
ref: n,
|
|
86
|
-
className:
|
|
86
|
+
className: s(
|
|
87
87
|
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
88
88
|
e
|
|
89
89
|
),
|
|
@@ -95,11 +95,11 @@ const z = s.forwardRef(({ className: e, children: t, ...o }, n) => /* @__PURE__
|
|
|
95
95
|
}
|
|
96
96
|
));
|
|
97
97
|
z.displayName = h.displayName;
|
|
98
|
-
const k =
|
|
98
|
+
const k = r.forwardRef(({ className: e, inset: t, ...o }, n) => /* @__PURE__ */ a(
|
|
99
99
|
c,
|
|
100
100
|
{
|
|
101
101
|
ref: n,
|
|
102
|
-
className:
|
|
102
|
+
className: s(
|
|
103
103
|
"px-2 py-1.5 text-sm font-semibold",
|
|
104
104
|
t && "pl-8",
|
|
105
105
|
e
|
|
@@ -108,11 +108,11 @@ const k = s.forwardRef(({ className: e, inset: t, ...o }, n) => /* @__PURE__ */
|
|
|
108
108
|
}
|
|
109
109
|
));
|
|
110
110
|
k.displayName = c.displayName;
|
|
111
|
-
const T =
|
|
111
|
+
const T = r.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a(
|
|
112
112
|
p,
|
|
113
113
|
{
|
|
114
114
|
ref: o,
|
|
115
|
-
className:
|
|
115
|
+
className: s("bg-muted -mx-1 my-1 h-px", e),
|
|
116
116
|
...t
|
|
117
117
|
}
|
|
118
118
|
));
|
|
@@ -1,82 +1,82 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
4
|
-
import { motion as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
8
|
-
(e,
|
|
2
|
+
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
|
3
|
+
import i, { useEffect as h } from "react";
|
|
4
|
+
import { motion as l } from "framer-motion";
|
|
5
|
+
import n from "../../node_modules/lucide-react/dist/esm/icons/x.js";
|
|
6
|
+
import y from "../../node_modules/lucide-react/dist/esm/icons/file.js";
|
|
7
|
+
const w = i.forwardRef(
|
|
8
|
+
(e, t) => e.file.type.startsWith("image/") ? /* @__PURE__ */ r(s, { ...e, ref: t }) : e.file.type.startsWith("text/") || e.file.name.endsWith(".txt") || e.file.name.endsWith(".md") ? /* @__PURE__ */ r(m, { ...e, ref: t }) : /* @__PURE__ */ r(u, { ...e, ref: t })
|
|
9
9
|
);
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
({ file: e, onRemove:
|
|
13
|
-
|
|
10
|
+
w.displayName = "FilePreview";
|
|
11
|
+
const s = i.forwardRef(
|
|
12
|
+
({ file: e, onRemove: t }, d) => /* @__PURE__ */ a(
|
|
13
|
+
l.div,
|
|
14
14
|
{
|
|
15
|
-
ref:
|
|
16
|
-
className: "relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",
|
|
15
|
+
ref: d,
|
|
16
|
+
className: "border-d-border relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",
|
|
17
17
|
layout: !0,
|
|
18
18
|
initial: { opacity: 0, y: "100%" },
|
|
19
19
|
animate: { opacity: 1, y: 0 },
|
|
20
20
|
exit: { opacity: 0, y: "100%" },
|
|
21
21
|
children: [
|
|
22
22
|
/* @__PURE__ */ a("div", { className: "flex w-full items-center space-x-2", children: [
|
|
23
|
-
/* @__PURE__ */
|
|
23
|
+
/* @__PURE__ */ r(
|
|
24
24
|
"img",
|
|
25
25
|
{
|
|
26
26
|
alt: `Attachment ${e.name}`,
|
|
27
|
-
className: "bg-d-secondary grid h-10 w-10 shrink-0 place-items-center rounded-sm border object-cover",
|
|
27
|
+
className: "bg-d-secondary border-d-border grid h-10 w-10 shrink-0 place-items-center rounded-sm border object-cover",
|
|
28
28
|
src: URL.createObjectURL(e)
|
|
29
29
|
}
|
|
30
30
|
),
|
|
31
|
-
/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ r("span", { className: "text-d-secondary-foreground w-full truncate", children: e.name })
|
|
32
32
|
] }),
|
|
33
|
-
|
|
33
|
+
t ? /* @__PURE__ */ r(
|
|
34
34
|
"button",
|
|
35
35
|
{
|
|
36
|
-
className: "bg-d-background absolute -top-2 -right-2 flex h-4 w-4 items-center justify-center rounded-full border",
|
|
36
|
+
className: "bg-d-background border-d-border absolute -top-2 -right-2 flex h-4 w-4 items-center justify-center rounded-full border",
|
|
37
37
|
type: "button",
|
|
38
|
-
onClick:
|
|
38
|
+
onClick: t,
|
|
39
39
|
"aria-label": "Remove attachment",
|
|
40
|
-
children: /* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ r(n, { className: "h-2.5 w-2.5" })
|
|
41
41
|
}
|
|
42
42
|
) : null
|
|
43
43
|
]
|
|
44
44
|
}
|
|
45
45
|
)
|
|
46
46
|
);
|
|
47
|
-
|
|
48
|
-
const m =
|
|
49
|
-
({ file: e, onRemove:
|
|
50
|
-
const [
|
|
51
|
-
return
|
|
47
|
+
s.displayName = "ImageFilePreview";
|
|
48
|
+
const m = i.forwardRef(
|
|
49
|
+
({ file: e, onRemove: t }, d) => {
|
|
50
|
+
const [b, f] = i.useState("");
|
|
51
|
+
return h(() => {
|
|
52
52
|
if (typeof window > "u") return;
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
},
|
|
53
|
+
const o = new FileReader();
|
|
54
|
+
o.onload = (x) => {
|
|
55
|
+
const c = x.target?.result;
|
|
56
|
+
f(c.slice(0, 50) + (c.length > 50 ? "..." : ""));
|
|
57
|
+
}, o.readAsText(e);
|
|
58
58
|
}, [e]), /* @__PURE__ */ a(
|
|
59
|
-
|
|
59
|
+
l.div,
|
|
60
60
|
{
|
|
61
|
-
ref:
|
|
62
|
-
className: "relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",
|
|
61
|
+
ref: d,
|
|
62
|
+
className: "border-d-border relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",
|
|
63
63
|
layout: !0,
|
|
64
64
|
initial: { opacity: 0, y: "100%" },
|
|
65
65
|
animate: { opacity: 1, y: 0 },
|
|
66
66
|
exit: { opacity: 0, y: "100%" },
|
|
67
67
|
children: [
|
|
68
68
|
/* @__PURE__ */ a("div", { className: "flex w-full items-center space-x-2", children: [
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ r("div", { className: "bg-d-secondary border-d-border grid h-10 w-10 shrink-0 place-items-center rounded-sm border p-0.5", children: /* @__PURE__ */ r("div", { className: "text-d-secondary-foreground h-full w-full overflow-hidden text-[6px] leading-none", children: b || "Loading..." }) }),
|
|
70
|
+
/* @__PURE__ */ r("span", { className: "text-d-secondary-foreground w-full truncate", children: e.name })
|
|
71
71
|
] }),
|
|
72
|
-
|
|
72
|
+
t ? /* @__PURE__ */ r(
|
|
73
73
|
"button",
|
|
74
74
|
{
|
|
75
|
-
className: "bg-d-background absolute -top-2 -right-2 flex h-4 w-4 items-center justify-center rounded-full border",
|
|
75
|
+
className: "bg-d-background border-d-border absolute -top-2 -right-2 flex h-4 w-4 items-center justify-center rounded-full border",
|
|
76
76
|
type: "button",
|
|
77
|
-
onClick:
|
|
77
|
+
onClick: t,
|
|
78
78
|
"aria-label": "Remove attachment",
|
|
79
|
-
children: /* @__PURE__ */
|
|
79
|
+
children: /* @__PURE__ */ r(n, { className: "h-2.5 w-2.5" })
|
|
80
80
|
}
|
|
81
81
|
) : null
|
|
82
82
|
]
|
|
@@ -85,29 +85,29 @@ const m = l.forwardRef(
|
|
|
85
85
|
}
|
|
86
86
|
);
|
|
87
87
|
m.displayName = "TextFilePreview";
|
|
88
|
-
const u =
|
|
89
|
-
({ file: e, onRemove:
|
|
90
|
-
|
|
88
|
+
const u = i.forwardRef(
|
|
89
|
+
({ file: e, onRemove: t }, d) => /* @__PURE__ */ a(
|
|
90
|
+
l.div,
|
|
91
91
|
{
|
|
92
|
-
ref:
|
|
93
|
-
className: "relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",
|
|
92
|
+
ref: d,
|
|
93
|
+
className: "border-d-border relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",
|
|
94
94
|
layout: !0,
|
|
95
95
|
initial: { opacity: 0, y: "100%" },
|
|
96
96
|
animate: { opacity: 1, y: 0 },
|
|
97
97
|
exit: { opacity: 0, y: "100%" },
|
|
98
98
|
children: [
|
|
99
99
|
/* @__PURE__ */ a("div", { className: "flex w-full items-center space-x-2", children: [
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ r("div", { className: "bg-d-secondary border-d-border grid h-10 w-10 shrink-0 place-items-center rounded-sm border", children: /* @__PURE__ */ r(y, { className: "text-d-foreground h-6 w-6" }) }),
|
|
101
|
+
/* @__PURE__ */ r("span", { className: "text-d-secondary-foreground w-full truncate", children: e.name })
|
|
102
102
|
] }),
|
|
103
|
-
|
|
103
|
+
t ? /* @__PURE__ */ r(
|
|
104
104
|
"button",
|
|
105
105
|
{
|
|
106
|
-
className: "bg-d-background absolute -top-2 -right-2 flex h-4 w-4 items-center justify-center rounded-full border",
|
|
106
|
+
className: "bg-d-background border-d-border absolute -top-2 -right-2 flex h-4 w-4 items-center justify-center rounded-full border",
|
|
107
107
|
type: "button",
|
|
108
|
-
onClick:
|
|
108
|
+
onClick: t,
|
|
109
109
|
"aria-label": "Remove attachment",
|
|
110
|
-
children: /* @__PURE__ */
|
|
110
|
+
children: /* @__PURE__ */ r(n, { className: "h-2.5 w-2.5" })
|
|
111
111
|
}
|
|
112
112
|
) : null
|
|
113
113
|
]
|
|
@@ -116,5 +116,5 @@ const u = l.forwardRef(
|
|
|
116
116
|
);
|
|
117
117
|
u.displayName = "GenericFilePreview";
|
|
118
118
|
export {
|
|
119
|
-
|
|
119
|
+
w as FilePreview
|
|
120
120
|
};
|
|
@@ -1,84 +1,93 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
3
|
-
import { useContext as y, useState as h, useMemo as f, useCallback as
|
|
3
|
+
import { useContext as y, useState as h, useMemo as f, useCallback as a } from "react";
|
|
4
4
|
import G from "../../../../../_virtual/dayjs.min.js";
|
|
5
5
|
import { cn as P } from "../../../../../lib/utils.js";
|
|
6
6
|
import { Button as g } from "../../../button.js";
|
|
7
|
-
import { Select as S, SelectTrigger as
|
|
7
|
+
import { Select as S, SelectTrigger as b, SelectValue as x, SelectContent as v, SelectItem as C } from "../../../select.js";
|
|
8
8
|
import { GanttContext as B } from "../Gantt/GanttContext.js";
|
|
9
9
|
import { useGanttCalculate as L } from "../../hooks/useGanttCalculate.js";
|
|
10
10
|
import M from "../../../../../node_modules/lucide-react/dist/esm/icons/chevron-left.js";
|
|
11
11
|
import R from "../../../../../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
|
|
12
|
-
import { GanttDimensionsSettings as
|
|
12
|
+
import { GanttDimensionsSettings as l } from "../../constants/DimensionsSettings.js";
|
|
13
13
|
import { DragStepOptions as u } from "../../constants/DragStepOptions.js";
|
|
14
14
|
const Y = ({ className: D }) => {
|
|
15
|
-
const { calculate: s } = L(), { settings:
|
|
16
|
-
Object.keys(
|
|
17
|
-
(e) => e ===
|
|
15
|
+
const { calculate: s } = L(), { settings: r, setSettings: p, currentDate: j } = y(B), [z, c] = h(r.dimension), [t, m] = h(
|
|
16
|
+
Object.keys(l).findIndex(
|
|
17
|
+
(e) => e === r.dimension
|
|
18
18
|
)
|
|
19
|
-
),
|
|
20
|
-
label:
|
|
19
|
+
), o = f(() => Object.keys(l).map((e, i) => ({
|
|
20
|
+
label: l[e].label,
|
|
21
21
|
value: e,
|
|
22
22
|
index: i
|
|
23
|
-
})), []), N =
|
|
23
|
+
})), []), N = a(
|
|
24
24
|
(e) => {
|
|
25
|
-
const i =
|
|
25
|
+
const i = o.findIndex((V) => V.value === e);
|
|
26
26
|
c(e), m(i), s(e);
|
|
27
27
|
},
|
|
28
|
-
[s,
|
|
29
|
-
), O =
|
|
30
|
-
if (t <
|
|
31
|
-
const e = Object.keys(
|
|
28
|
+
[s, o]
|
|
29
|
+
), O = a(() => {
|
|
30
|
+
if (t < o.length - 1) {
|
|
31
|
+
const e = Object.keys(l)[t + 1];
|
|
32
32
|
c(e), m(t + 1), s(e);
|
|
33
33
|
}
|
|
34
|
-
}, [s,
|
|
34
|
+
}, [s, o.length, t]), k = a(() => {
|
|
35
35
|
if (t > 0) {
|
|
36
|
-
const e = Object.keys(
|
|
36
|
+
const e = Object.keys(l)[t - 1];
|
|
37
37
|
c(e), m(t - 1), s(e);
|
|
38
38
|
}
|
|
39
39
|
}, [s, t]), I = f(() => Object.keys(u).map((e) => ({
|
|
40
40
|
label: u[e].label,
|
|
41
41
|
value: e
|
|
42
|
-
})), []), w =
|
|
42
|
+
})), []), w = a(
|
|
43
43
|
(e) => {
|
|
44
44
|
p(() => {
|
|
45
|
-
const i = { ...
|
|
46
|
-
return i.dragStepSize = e, i.gridSize = u[e].seconds /
|
|
45
|
+
const i = { ...r };
|
|
46
|
+
return i.dragStepSize = e, i.gridSize = u[e].seconds / l[i.dimension].secondsInPixel, i;
|
|
47
47
|
});
|
|
48
48
|
},
|
|
49
|
-
[p,
|
|
49
|
+
[p, r]
|
|
50
|
+
);
|
|
51
|
+
return /* @__PURE__ */ d(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
className: P(
|
|
55
|
+
"border-d-border flex items-center gap-2 border-b p-4",
|
|
56
|
+
D
|
|
57
|
+
),
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ n(
|
|
60
|
+
g,
|
|
61
|
+
{
|
|
62
|
+
variant: "outline",
|
|
63
|
+
size: "icon",
|
|
64
|
+
onClick: k,
|
|
65
|
+
disabled: t <= 0,
|
|
66
|
+
children: /* @__PURE__ */ n(M, { className: "h-4 w-4" })
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ d(S, { value: z, onValueChange: N, children: [
|
|
70
|
+
/* @__PURE__ */ n(b, { className: "w-[180px]", children: /* @__PURE__ */ n(x, { placeholder: "Seleziona dimensione" }) }),
|
|
71
|
+
/* @__PURE__ */ n(v, { className: "z-100", children: o.map((e) => /* @__PURE__ */ n(C, { value: e.value, children: e.label }, e.value)) })
|
|
72
|
+
] }),
|
|
73
|
+
/* @__PURE__ */ n(
|
|
74
|
+
g,
|
|
75
|
+
{
|
|
76
|
+
variant: "outline",
|
|
77
|
+
size: "icon",
|
|
78
|
+
onClick: O,
|
|
79
|
+
disabled: t >= o.length - 1,
|
|
80
|
+
children: /* @__PURE__ */ n(R, { className: "h-4 w-4" })
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
/* @__PURE__ */ n("div", { className: "px-4 text-sm font-medium", children: G.unix(j).format("ddd, ll") }),
|
|
84
|
+
/* @__PURE__ */ d(S, { value: r.dragStepSize, onValueChange: w, children: [
|
|
85
|
+
/* @__PURE__ */ n(b, { className: "w-[180px]", children: /* @__PURE__ */ n(x, { placeholder: "Seleziona step" }) }),
|
|
86
|
+
/* @__PURE__ */ n(v, { children: I.map((e) => /* @__PURE__ */ n(C, { value: e.value, children: e.label }, e.value)) })
|
|
87
|
+
] })
|
|
88
|
+
]
|
|
89
|
+
}
|
|
50
90
|
);
|
|
51
|
-
return /* @__PURE__ */ d("div", { className: P("flex items-center gap-2 border-b p-4", D), children: [
|
|
52
|
-
/* @__PURE__ */ n(
|
|
53
|
-
g,
|
|
54
|
-
{
|
|
55
|
-
variant: "outline",
|
|
56
|
-
size: "icon",
|
|
57
|
-
onClick: k,
|
|
58
|
-
disabled: t <= 0,
|
|
59
|
-
children: /* @__PURE__ */ n(M, { className: "h-4 w-4" })
|
|
60
|
-
}
|
|
61
|
-
),
|
|
62
|
-
/* @__PURE__ */ d(S, { value: z, onValueChange: N, children: [
|
|
63
|
-
/* @__PURE__ */ n(x, { className: "w-[180px]", children: /* @__PURE__ */ n(v, { placeholder: "Seleziona dimensione" }) }),
|
|
64
|
-
/* @__PURE__ */ n(b, { className: "z-100", children: l.map((e) => /* @__PURE__ */ n(C, { value: e.value, children: e.label }, e.value)) })
|
|
65
|
-
] }),
|
|
66
|
-
/* @__PURE__ */ n(
|
|
67
|
-
g,
|
|
68
|
-
{
|
|
69
|
-
variant: "outline",
|
|
70
|
-
size: "icon",
|
|
71
|
-
onClick: O,
|
|
72
|
-
disabled: t >= l.length - 1,
|
|
73
|
-
children: /* @__PURE__ */ n(R, { className: "h-4 w-4" })
|
|
74
|
-
}
|
|
75
|
-
),
|
|
76
|
-
/* @__PURE__ */ n("div", { className: "px-4 text-sm font-medium", children: G.unix(j).format("ddd, ll") }),
|
|
77
|
-
/* @__PURE__ */ d(S, { value: a.dragStepSize, onValueChange: w, children: [
|
|
78
|
-
/* @__PURE__ */ n(x, { className: "w-[180px]", children: /* @__PURE__ */ n(v, { placeholder: "Seleziona step" }) }),
|
|
79
|
-
/* @__PURE__ */ n(b, { children: I.map((e) => /* @__PURE__ */ n(C, { value: e.value, children: e.label }, e.value)) })
|
|
80
|
-
] })
|
|
81
|
-
] });
|
|
82
91
|
};
|
|
83
92
|
export {
|
|
84
93
|
Y as default
|