laif-ds 0.1.86 → 0.1.88
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/app-multiple-select-dropdown.js +109 -86
- package/dist/components/ui/async-select.js +182 -151
- package/dist/components/ui/multiple-selector.js +203 -191
- package/dist/components/ui/weekly-calendar/appointment-card.js +39 -39
- package/dist/components/ui/weekly-calendar/day-column.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
- package/dist/components/ui/command-portal.js +0 -67
|
@@ -1,93 +1,93 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as l, jsxs as s } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo as n } from "react";
|
|
4
4
|
import c from "../../../_virtual/dayjs.min.js";
|
|
5
5
|
import { useCalendar as b } from "./calendar-context.js";
|
|
6
6
|
import { l as m } from "../../../_virtual/lodash.js";
|
|
7
7
|
import { hexContrast as v, hexToRgba as u, cn as g } from "../../../lib/utils.js";
|
|
8
|
-
import { TooltipProvider as
|
|
8
|
+
import { TooltipProvider as T, Tooltip as N, TooltipTrigger as y, TooltipContent as C } from "../tooltip.js";
|
|
9
9
|
import { Typo as k } from "../typo.js";
|
|
10
|
-
const
|
|
10
|
+
const H = ({ appointment: e }) => {
|
|
11
11
|
const { setSelectedAppointmentId: h } = b(), f = n(() => {
|
|
12
|
-
if (
|
|
12
|
+
if (e.color)
|
|
13
13
|
return {
|
|
14
|
-
backgroundColor: u(
|
|
15
|
-
borderColor: u(
|
|
16
|
-
color: v(
|
|
14
|
+
backgroundColor: u(e.color, 0.75),
|
|
15
|
+
borderColor: u(e.color, 1),
|
|
16
|
+
color: v(e.color),
|
|
17
17
|
backdropFilter: "blur(5px)"
|
|
18
18
|
};
|
|
19
|
-
}, [
|
|
20
|
-
const
|
|
19
|
+
}, [e.color]), o = e.endTime || c(`2000-01-01 ${e.startTime}`).add(1, "hour").format("HH:mm"), x = n(() => {
|
|
20
|
+
const r = c(`2000-01-01 ${e.startTime}`), a = c(`2000-01-01 ${o}`).diff(r, "minute"), i = Math.floor(a / 60), d = a % 60;
|
|
21
21
|
return i === 0 ? `${d}m` : d === 0 ? `${i}h` : `${i}h ${d}m`;
|
|
22
|
-
}, [
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
22
|
+
}, [e.startTime, o]);
|
|
23
|
+
return /* @__PURE__ */ l(T, { delayDuration: 300, children: /* @__PURE__ */ s(N, { children: [
|
|
24
|
+
/* @__PURE__ */ l(y, { asChild: !0, children: /* @__PURE__ */ s(
|
|
25
25
|
"div",
|
|
26
26
|
{
|
|
27
|
-
onClick: (
|
|
28
|
-
|
|
27
|
+
onClick: (r) => {
|
|
28
|
+
r.preventDefault(), r.stopPropagation(), h(e.id);
|
|
29
29
|
},
|
|
30
30
|
style: f,
|
|
31
31
|
className: g(
|
|
32
32
|
"border-d-border flex h-full cursor-pointer flex-col justify-start rounded-r-md border border-l-4 p-2 shadow-md transition-all duration-200 ease-in-out hover:scale-105",
|
|
33
|
-
|
|
33
|
+
e.className
|
|
34
34
|
),
|
|
35
35
|
children: [
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
|
|
36
|
+
/* @__PURE__ */ l("div", { className: "text-sm font-semibold", children: e?.title?.length > 15 ? e?.title?.slice(0, 15) + "..." : e?.title }),
|
|
37
|
+
/* @__PURE__ */ s("div", { className: "text-xs", children: [
|
|
38
|
+
e?.startTime,
|
|
39
39
|
" - ",
|
|
40
|
-
|
|
40
|
+
o
|
|
41
41
|
] }),
|
|
42
|
-
|
|
42
|
+
e?.attributes?.filter((r) => r.showPreview).map((r, t) => /* @__PURE__ */ s(
|
|
43
43
|
"div",
|
|
44
44
|
{
|
|
45
45
|
className: "bg-d-background/30 mt-1 rounded p-1 text-xs",
|
|
46
46
|
children: [
|
|
47
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ l("span", { className: "font-semibold", children: r.key }),
|
|
48
48
|
":",
|
|
49
49
|
" ",
|
|
50
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ l("span", { className: "font-medium", children: r.value })
|
|
51
51
|
]
|
|
52
52
|
},
|
|
53
|
-
|
|
53
|
+
t
|
|
54
54
|
))
|
|
55
55
|
]
|
|
56
56
|
}
|
|
57
57
|
) }),
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
/* @__PURE__ */ s(C, { side: "right", variant: "card", children: [
|
|
59
|
+
e?.title && /* @__PURE__ */ s(k, { children: [
|
|
60
|
+
e?.title,
|
|
61
61
|
" (",
|
|
62
62
|
x,
|
|
63
63
|
")"
|
|
64
64
|
] }),
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
|
|
65
|
+
/* @__PURE__ */ s("div", { className: "text-d-accent-foreground", children: [
|
|
66
|
+
e?.startTime,
|
|
67
67
|
" - ",
|
|
68
|
-
|
|
68
|
+
o
|
|
69
69
|
] }),
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ s("div", { className: "mt-2 mb-3.5 flex flex-col", children: [
|
|
71
|
+
/* @__PURE__ */ l("span", { className: "font-medium", children: "Descrizione:" }),
|
|
72
|
+
/* @__PURE__ */ l("span", { className: "text-d-accent-foreground text-xs", children: e?.description || "-" })
|
|
73
73
|
] }),
|
|
74
|
-
|
|
74
|
+
e?.attributes && e.attributes.filter((r) => r.showTooltip).length > 0 && /* @__PURE__ */ l("div", { className: "space-y-1", children: e.attributes.filter((r) => r.showTooltip).map((r, t) => /* @__PURE__ */ s(
|
|
75
75
|
"div",
|
|
76
76
|
{
|
|
77
77
|
className: "flex items-start justify-between gap-4 py-1 text-right",
|
|
78
78
|
children: [
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
m.upperFirst(
|
|
79
|
+
/* @__PURE__ */ s("span", { className: "font-medium", children: [
|
|
80
|
+
m.upperFirst(r.key),
|
|
81
81
|
":"
|
|
82
82
|
] }),
|
|
83
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ l("span", { className: "text-d-accent-foreground max-w-[200px]", children: typeof r.value == "string" ? m.upperFirst(r.value) : r.value })
|
|
84
84
|
]
|
|
85
85
|
},
|
|
86
|
-
|
|
87
|
-
)) })
|
|
86
|
+
t
|
|
87
|
+
)) })
|
|
88
88
|
] })
|
|
89
89
|
] }) });
|
|
90
90
|
};
|
|
91
91
|
export {
|
|
92
|
-
|
|
92
|
+
H as AppointmentCard
|
|
93
93
|
};
|
|
@@ -47,7 +47,7 @@ const F = ({ date: d, weekdayInfo: h }) => {
|
|
|
47
47
|
"div",
|
|
48
48
|
{
|
|
49
49
|
className: m(
|
|
50
|
-
"bg-d-card border-b-d-border sticky top-0 h-14 border-
|
|
50
|
+
"bg-d-card border-b-d-border sticky top-0 h-14 border-b backdrop-blur-sm",
|
|
51
51
|
"flex items-center pl-3",
|
|
52
52
|
s ? "!border-t-d-primary border-t-3" : "border-d-border"
|
|
53
53
|
),
|
package/dist/index.d.ts
CHANGED
|
@@ -187,7 +187,7 @@ export declare function AspectRatio({ ...props }: AspectRatioProps): JSX.Element
|
|
|
187
187
|
|
|
188
188
|
declare type AspectRatioProps = React.ComponentProps<typeof AspectRatioPrimitive.Root>;
|
|
189
189
|
|
|
190
|
-
export declare function AsyncSelect<T>({ fetcher, preload, filterFn, renderOption, getOptionValue, getDisplayValue, notFound, loadingSkeleton, label, labelClassName, placeholder, value, onChange, disabled, width,
|
|
190
|
+
export declare function AsyncSelect<T>({ fetcher, preload, filterFn, renderOption, getOptionValue, getDisplayValue, notFound, loadingSkeleton, label, labelClassName, placeholder, value, onChange, disabled, width, triggerClassName, noResultsMessage, clearable, size, }: AsyncSelectProps<T>): JSX.Element;
|
|
191
191
|
|
|
192
192
|
declare interface AsyncSelectProps<T> extends VariantProps<typeof asyncSelectTriggerVariants> {
|
|
193
193
|
fetcher: (query?: string) => Promise<T[]>;
|
|
@@ -204,8 +204,7 @@ declare interface AsyncSelectProps<T> extends VariantProps<typeof asyncSelectTri
|
|
|
204
204
|
labelClassName?: string;
|
|
205
205
|
placeholder?: string;
|
|
206
206
|
disabled?: boolean;
|
|
207
|
-
width?: string | number;
|
|
208
|
-
className?: string;
|
|
207
|
+
width?: string | number | "auto";
|
|
209
208
|
triggerClassName?: string;
|
|
210
209
|
noResultsMessage?: string;
|
|
211
210
|
clearable?: boolean;
|
|
@@ -294,8 +293,9 @@ export declare interface CalendarAppointment {
|
|
|
294
293
|
color?: string;
|
|
295
294
|
attributes?: {
|
|
296
295
|
key: string;
|
|
297
|
-
value: default_3.ReactNode;
|
|
296
|
+
value: default_3.ReactNode | string;
|
|
298
297
|
showPreview?: boolean;
|
|
298
|
+
showTooltip?: boolean;
|
|
299
299
|
}[];
|
|
300
300
|
className?: string;
|
|
301
301
|
groupBy?: string;
|