@definable/ui 0.1.31 → 0.1.35
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 +27 -27
- 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 +55 -55
- package/dist/components/confirmation-modal.js +23 -23
- package/dist/components/context-menu.js +30 -30
- package/dist/components/dialog.js +33 -33
- package/dist/components/drawer.js +7 -7
- package/dist/components/dropdown-menu.js +16 -16
- package/dist/components/dropzone.js +3 -3
- package/dist/components/image-cropper-modal.js +57 -57
- package/dist/components/image-cropper.js +45 -45
- package/dist/components/input.js +9 -9
- package/dist/components/loader.js +4 -4
- 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 +28 -28
- package/dist/components/selection-bar.js +18 -18
- package/dist/components/separator.js +8 -8
- package/dist/components/sheet.js +28 -28
- package/dist/components/skeleton.js +8 -8
- package/dist/components/slider.js +13 -13
- 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 +36 -36
- package/dist/components/table.js +80 -80
- package/dist/components/tabs.js +16 -16
- package/dist/components/textarea.js +9 -9
- package/dist/components/tooltip.js +5 -5
- package/dist/components/use-toast.js +9 -9
- package/dist/index.js +1 -1
- package/dist/{stepper-modal-JXpOXOV2.js → stepper-modal-Bh6gsg8o.js} +79 -79
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import { Button as
|
|
1
|
+
import { jsx as l, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { Button as m } from "./button.js";
|
|
3
3
|
import { Modal as v } from "./modal.js";
|
|
4
4
|
const w = ({
|
|
5
5
|
open: e = !1,
|
|
6
6
|
onOpenChange: s,
|
|
7
|
-
title:
|
|
8
|
-
description:
|
|
7
|
+
title: c,
|
|
8
|
+
description: d,
|
|
9
9
|
cancelText: a = "Cancel",
|
|
10
10
|
actionText: f = "Continue",
|
|
11
11
|
onCancel: t,
|
|
12
12
|
onAction: r,
|
|
13
|
-
actionVariant:
|
|
14
|
-
className:
|
|
13
|
+
actionVariant: x = "default",
|
|
14
|
+
className: u
|
|
15
15
|
}) => /* @__PURE__ */ l(
|
|
16
16
|
v,
|
|
17
17
|
{
|
|
18
18
|
isOpen: e,
|
|
19
19
|
onClose: () => s == null ? void 0 : s(!1),
|
|
20
20
|
size: "sm",
|
|
21
|
-
className:
|
|
22
|
-
children: /* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
className: u,
|
|
22
|
+
children: /* @__PURE__ */ i("div", { className: "space-y-4 p-6", children: [
|
|
23
|
+
/* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
24
|
+
c && /* @__PURE__ */ l("h2", { className: "text-lg font-semibold", children: c }),
|
|
25
|
+
d && /* @__PURE__ */ l("p", { className: "text-sm text-tertiary", children: d })
|
|
26
26
|
] }),
|
|
27
|
-
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ i("div", { className: "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 pt-4", children: [
|
|
28
28
|
/* @__PURE__ */ l(
|
|
29
|
-
|
|
29
|
+
m,
|
|
30
30
|
{
|
|
31
31
|
variant: "outline",
|
|
32
32
|
onClick: () => {
|
|
@@ -37,9 +37,9 @@ const w = ({
|
|
|
37
37
|
}
|
|
38
38
|
),
|
|
39
39
|
/* @__PURE__ */ l(
|
|
40
|
-
|
|
40
|
+
m,
|
|
41
41
|
{
|
|
42
|
-
variant:
|
|
42
|
+
variant: x === "destructive" ? "destructive" : "default",
|
|
43
43
|
onClick: () => {
|
|
44
44
|
r == null || r(), s == null || s(!1);
|
|
45
45
|
},
|
package/dist/components/alert.js
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { cn as
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import { cva as u } from "class-variance-authority";
|
|
4
|
+
import { cn as i } from "../lib/utils.js";
|
|
5
5
|
import { ConfirmationModal as v } from "./confirmation-modal.js";
|
|
6
|
-
const g =
|
|
6
|
+
const g = u(
|
|
7
7
|
"relative w-full rounded-lg border p-4",
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
|
-
default: "bg-
|
|
12
|
-
destructive: "border-
|
|
11
|
+
default: "bg-secondary text-primary",
|
|
12
|
+
destructive: "border-red-500/50 text-red-500 dark:border-red-500"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
defaultVariants: {
|
|
16
16
|
variant: "default"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
),
|
|
19
|
+
), x = d.forwardRef(({ className: t, variant: r, isOpen: e, onClose: o, onConfirm: l, title: m, description: n, confirmText: s, cancelText: f, ...c }, p) => e !== void 0 && o && l && m && n ? /* @__PURE__ */ a(
|
|
20
20
|
v,
|
|
21
21
|
{
|
|
22
22
|
isOpen: e,
|
|
23
23
|
onClose: o,
|
|
24
24
|
onConfirm: l,
|
|
25
|
-
title:
|
|
25
|
+
title: m,
|
|
26
26
|
description: n,
|
|
27
|
-
confirmText:
|
|
28
|
-
cancelText:
|
|
27
|
+
confirmText: s,
|
|
28
|
+
cancelText: f,
|
|
29
29
|
type: r === "destructive" ? "danger" : "warning"
|
|
30
30
|
}
|
|
31
31
|
) : /* @__PURE__ */ a(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
34
|
-
ref:
|
|
34
|
+
ref: p,
|
|
35
35
|
role: "alert",
|
|
36
|
-
className:
|
|
37
|
-
...
|
|
36
|
+
className: i(g({ variant: r }), t),
|
|
37
|
+
...c
|
|
38
38
|
}
|
|
39
39
|
));
|
|
40
|
-
|
|
41
|
-
const
|
|
40
|
+
x.displayName = "Alert";
|
|
41
|
+
const y = d.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ a(
|
|
42
42
|
"h5",
|
|
43
43
|
{
|
|
44
44
|
ref: e,
|
|
45
|
-
className:
|
|
45
|
+
className: i("mb-1 font-medium leading-none tracking-tight", t),
|
|
46
46
|
...r
|
|
47
47
|
}
|
|
48
48
|
));
|
|
49
|
-
|
|
50
|
-
const A =
|
|
49
|
+
y.displayName = "AlertTitle";
|
|
50
|
+
const A = d.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ a(
|
|
51
51
|
"div",
|
|
52
52
|
{
|
|
53
53
|
ref: e,
|
|
54
|
-
className:
|
|
54
|
+
className: i("text-sm [&_p]:leading-relaxed", t),
|
|
55
55
|
...r
|
|
56
56
|
}
|
|
57
57
|
));
|
|
58
58
|
A.displayName = "AlertDescription";
|
|
59
59
|
export {
|
|
60
|
-
|
|
60
|
+
x as Alert,
|
|
61
61
|
A as AlertDescription,
|
|
62
|
-
|
|
62
|
+
y as AlertTitle
|
|
63
63
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import * as t from "react";
|
|
3
3
|
import { cn as f } from "../lib/utils.js";
|
|
4
|
-
const
|
|
4
|
+
const s = t.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ l(
|
|
5
5
|
"div",
|
|
6
6
|
{
|
|
7
7
|
ref: r,
|
|
@@ -12,8 +12,8 @@ const o = t.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ l(
|
|
|
12
12
|
...e
|
|
13
13
|
}
|
|
14
14
|
));
|
|
15
|
-
|
|
16
|
-
const
|
|
15
|
+
s.displayName = "Avatar";
|
|
16
|
+
const o = t.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ l(
|
|
17
17
|
"img",
|
|
18
18
|
{
|
|
19
19
|
ref: r,
|
|
@@ -21,13 +21,13 @@ const s = t.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ l(
|
|
|
21
21
|
...e
|
|
22
22
|
}
|
|
23
23
|
));
|
|
24
|
-
|
|
24
|
+
o.displayName = "AvatarImage";
|
|
25
25
|
const m = t.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ l(
|
|
26
26
|
"div",
|
|
27
27
|
{
|
|
28
28
|
ref: r,
|
|
29
29
|
className: f(
|
|
30
|
-
"flex h-full w-full items-center justify-center rounded-full bg-
|
|
30
|
+
"flex h-full w-full items-center justify-center rounded-full bg-hover text-tertiary",
|
|
31
31
|
a
|
|
32
32
|
),
|
|
33
33
|
...e
|
|
@@ -35,7 +35,7 @@ const m = t.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ l(
|
|
|
35
35
|
));
|
|
36
36
|
m.displayName = "AvatarFallback";
|
|
37
37
|
export {
|
|
38
|
-
|
|
38
|
+
s as Avatar,
|
|
39
39
|
m as AvatarFallback,
|
|
40
|
-
|
|
40
|
+
o as AvatarImage
|
|
41
41
|
};
|
package/dist/components/badge.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { cva as n } from "class-variance-authority";
|
|
3
|
-
import { cn as
|
|
3
|
+
import { cn as o } from "../lib/utils.js";
|
|
4
4
|
const i = n(
|
|
5
|
-
"inline-flex items-center rounded-md px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
5
|
+
"inline-flex items-center rounded-md px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-black/20 dark:focus:ring-white/20 focus:ring-offset-2",
|
|
6
6
|
{
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
|
9
|
-
default: "border-transparent bg-primary text-
|
|
10
|
-
secondary: "border-transparent bg-secondary text-
|
|
11
|
-
destructive: "border-transparent bg-
|
|
12
|
-
outline: "text-
|
|
9
|
+
default: "border-transparent bg-primary text-white hover:bg-primary/80",
|
|
10
|
+
secondary: "border-transparent bg-secondary text-primary hover:bg-secondary/80",
|
|
11
|
+
destructive: "border-transparent bg-red-500 text-white hover:bg-red-500/80",
|
|
12
|
+
outline: "text-primary"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
defaultVariants: {
|
|
@@ -17,10 +17,10 @@ const i = n(
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
);
|
|
20
|
-
function
|
|
21
|
-
return /* @__PURE__ */
|
|
20
|
+
function f({ className: r, variant: t, ...e }) {
|
|
21
|
+
return /* @__PURE__ */ a("div", { className: o(i({ variant: t }), r), ...e });
|
|
22
22
|
}
|
|
23
23
|
export {
|
|
24
|
-
|
|
24
|
+
f as Badge,
|
|
25
25
|
i as badgeVariants
|
|
26
26
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode, ButtonHTMLAttributes } from 'react';
|
|
2
|
-
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'outline';
|
|
2
|
+
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'outline' | 'brand';
|
|
3
3
|
type ButtonSize = 'icon' | 'sm' | 'md' | 'lg';
|
|
4
4
|
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
5
|
variant?: ButtonVariant;
|
|
@@ -1,54 +1,56 @@
|
|
|
1
1
|
import { jsxs as t, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
2
|
+
import { forwardRef as k } from "react";
|
|
3
3
|
const x = {
|
|
4
4
|
icon: "p-0",
|
|
5
5
|
sm: "px-2.5 py-1 text-[12px]",
|
|
6
6
|
md: "px-4 py-1.5 text-[13px]",
|
|
7
7
|
lg: "px-5 py-2 text-[14px]"
|
|
8
|
-
}, b =
|
|
8
|
+
}, b = k(({
|
|
9
9
|
variant: o = "primary",
|
|
10
|
-
size:
|
|
11
|
-
children:
|
|
12
|
-
leftIcon:
|
|
13
|
-
rightIcon:
|
|
10
|
+
size: d = "md",
|
|
11
|
+
children: s,
|
|
12
|
+
leftIcon: c,
|
|
13
|
+
rightIcon: i,
|
|
14
14
|
isLoading: r = !1,
|
|
15
15
|
fullWidth: n = !1,
|
|
16
|
-
className:
|
|
16
|
+
className: l = "",
|
|
17
17
|
disabled: e,
|
|
18
|
-
...
|
|
19
|
-
},
|
|
18
|
+
...h
|
|
19
|
+
}, p) => /* @__PURE__ */ t(
|
|
20
20
|
"button",
|
|
21
21
|
{
|
|
22
|
-
ref:
|
|
22
|
+
ref: p,
|
|
23
23
|
className: `
|
|
24
24
|
inline-flex items-center justify-center gap-2 font-medium rounded
|
|
25
25
|
transition-all duration-200 active:scale-95
|
|
26
26
|
${(() => {
|
|
27
27
|
switch (o) {
|
|
28
28
|
case "primary":
|
|
29
|
-
return "bg-black hover:bg-black/90 dark:bg-
|
|
29
|
+
return "bg-black hover:bg-black/90 dark:bg-white dark:hover:bg-white/90 text-white dark:text-black";
|
|
30
30
|
case "secondary":
|
|
31
31
|
return "bg-secondary dark:bg-dark-secondary border-light dark:border-dark text-primary dark:text-dark-primary hover:bg-hover dark:hover:bg-dark-hover";
|
|
32
32
|
case "ghost":
|
|
33
33
|
return "text-secondary dark:text-dark-secondary hover:text-primary dark:hover:text-dark-primary hover:bg-hover dark:hover:bg-dark-hover";
|
|
34
34
|
case "outline":
|
|
35
|
-
return "border border-light bg-card text-
|
|
35
|
+
return "border border-light dark:border-dark bg-card text-primary dark:text-dark-primary hover:bg-hover dark:hover:bg-dark-hover";
|
|
36
|
+
case "brand":
|
|
37
|
+
return "bg-brand hover:opacity-90 text-white";
|
|
36
38
|
}
|
|
37
39
|
})()}
|
|
38
|
-
${x[
|
|
40
|
+
${x[d]}
|
|
39
41
|
${n ? "w-full" : ""}
|
|
40
42
|
${e || r ? "opacity-50 cursor-not-allowed" : ""}
|
|
41
|
-
${
|
|
43
|
+
${l}
|
|
42
44
|
`,
|
|
43
45
|
disabled: e || r,
|
|
44
|
-
...
|
|
46
|
+
...h,
|
|
45
47
|
children: [
|
|
46
48
|
r ? /* @__PURE__ */ t("svg", { className: "animate-spin w-4 h-4", fill: "none", viewBox: "0 0 24 24", children: [
|
|
47
49
|
/* @__PURE__ */ a("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
48
50
|
/* @__PURE__ */ a("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
|
|
49
|
-
] }) :
|
|
50
|
-
|
|
51
|
-
!r &&
|
|
51
|
+
] }) : c,
|
|
52
|
+
s,
|
|
53
|
+
!r && i
|
|
52
54
|
]
|
|
53
55
|
}
|
|
54
56
|
));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as f, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as y from "react";
|
|
3
3
|
import { ChevronLeft as k, ChevronRight as A } from "lucide-react";
|
|
4
4
|
import { DateTime as o } from "luxon";
|
|
5
|
-
import { Button as
|
|
6
|
-
import { cn as
|
|
7
|
-
const j =
|
|
5
|
+
import { Button as p } from "./button.js";
|
|
6
|
+
import { cn as v } from "../lib/utils.js";
|
|
7
|
+
const j = y.forwardRef(
|
|
8
8
|
({
|
|
9
9
|
className: x,
|
|
10
10
|
mode: T = "single",
|
|
@@ -13,29 +13,29 @@ const j = p.forwardRef(
|
|
|
13
13
|
disabled: s,
|
|
14
14
|
fromDate: m,
|
|
15
15
|
toDate: c,
|
|
16
|
-
...
|
|
16
|
+
...w
|
|
17
17
|
}, D) => {
|
|
18
|
-
const [a,
|
|
18
|
+
const [a, l] = y.useState(() => e && !Array.isArray(e) ? o.fromJSDate(e) : o.local()), h = (r) => e ? Array.isArray(e) ? e.some(
|
|
19
19
|
(n) => o.fromJSDate(n).hasSame(r, "day")
|
|
20
|
-
) : o.fromJSDate(e).hasSame(r, "day") : !1, M = (r) => r.hasSame(o.local(), "day"),
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
|
|
20
|
+
) : o.fromJSDate(e).hasSame(r, "day") : !1, M = (r) => r.hasSame(o.local(), "day"), u = (r) => s ? s(r.toJSDate()) : !!(m && r < o.fromJSDate(m) || c && r > o.fromJSDate(c)), N = () => {
|
|
21
|
+
l((r) => r.minus({ months: 1 }));
|
|
22
|
+
}, g = () => {
|
|
23
|
+
l((r) => r.plus({ months: 1 }));
|
|
24
24
|
}, S = (r) => {
|
|
25
|
-
|
|
25
|
+
u(r) || i == null || i(r.toJSDate());
|
|
26
26
|
};
|
|
27
27
|
a.daysInMonth;
|
|
28
|
-
const
|
|
29
|
-
return /* @__PURE__ */
|
|
28
|
+
const d = a.startOf("month"), C = d.minus({ days: d.weekday % 7 }), J = Array.from({ length: 42 }, (r, n) => C.plus({ days: n }));
|
|
29
|
+
return /* @__PURE__ */ f(
|
|
30
30
|
"div",
|
|
31
31
|
{
|
|
32
32
|
ref: D,
|
|
33
|
-
className:
|
|
34
|
-
...
|
|
33
|
+
className: v("w-full p-3 space-y-4", x),
|
|
34
|
+
...w,
|
|
35
35
|
children: [
|
|
36
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ f("div", { className: "flex items-center justify-between", children: [
|
|
37
37
|
/* @__PURE__ */ t(
|
|
38
|
-
|
|
38
|
+
p,
|
|
39
39
|
{
|
|
40
40
|
variant: "outline",
|
|
41
41
|
size: "icon",
|
|
@@ -46,28 +46,28 @@ const j = p.forwardRef(
|
|
|
46
46
|
),
|
|
47
47
|
/* @__PURE__ */ t("div", { className: "font-medium", children: a.toFormat("MMMM yyyy") }),
|
|
48
48
|
/* @__PURE__ */ t(
|
|
49
|
-
|
|
49
|
+
p,
|
|
50
50
|
{
|
|
51
51
|
variant: "outline",
|
|
52
52
|
size: "icon",
|
|
53
|
-
onClick:
|
|
53
|
+
onClick: g,
|
|
54
54
|
className: "h-7 w-7",
|
|
55
55
|
children: /* @__PURE__ */ t(A, { className: "h-4 w-4" })
|
|
56
56
|
}
|
|
57
57
|
)
|
|
58
58
|
] }),
|
|
59
|
-
/* @__PURE__ */ t("div", { className: "grid grid-cols-7 text-center text-xs leading-6 text-
|
|
59
|
+
/* @__PURE__ */ t("div", { className: "grid grid-cols-7 text-center text-xs leading-6 text-tertiary", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((r, n) => /* @__PURE__ */ t("div", { children: r }, n)) }),
|
|
60
60
|
/* @__PURE__ */ t("div", { className: "grid grid-cols-7 text-center", children: J.map((r, n) => {
|
|
61
61
|
const b = r.month === a.month;
|
|
62
62
|
return /* @__PURE__ */ t(
|
|
63
63
|
"div",
|
|
64
64
|
{
|
|
65
|
-
className:
|
|
65
|
+
className: v(
|
|
66
66
|
"h-9 w-9 p-0 font-normal flex items-center justify-center",
|
|
67
|
-
!b && "text-
|
|
68
|
-
|
|
69
|
-
M(r) && !
|
|
70
|
-
|
|
67
|
+
!b && "text-tertiary opacity-50",
|
|
68
|
+
h(r) && "bg-primary text-white rounded-md",
|
|
69
|
+
M(r) && !h(r) && "border border-primary rounded-md",
|
|
70
|
+
u(r) ? "text-tertiary opacity-50 cursor-not-allowed" : "cursor-pointer hover:bg-hover rounded-md"
|
|
71
71
|
),
|
|
72
72
|
onClick: () => S(r),
|
|
73
73
|
children: r.day
|
package/dist/components/card.js
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { cn as
|
|
4
|
-
const s =
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import { cn as o } from "../lib/utils.js";
|
|
4
|
+
const s = d.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ t(
|
|
5
5
|
"div",
|
|
6
6
|
{
|
|
7
7
|
ref: r,
|
|
8
|
-
className:
|
|
9
|
-
"rounded-lg border-
|
|
10
|
-
|
|
8
|
+
className: o(
|
|
9
|
+
"rounded-lg border-light bg-card text-primary ",
|
|
10
|
+
a
|
|
11
11
|
),
|
|
12
|
-
...
|
|
12
|
+
...e
|
|
13
13
|
}
|
|
14
14
|
));
|
|
15
15
|
s.displayName = "Card";
|
|
16
|
-
const i =
|
|
16
|
+
const i = d.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ t(
|
|
17
17
|
"div",
|
|
18
18
|
{
|
|
19
19
|
ref: r,
|
|
20
|
-
className:
|
|
21
|
-
...
|
|
20
|
+
className: o("flex flex-col space-y-1.5 p-6", a),
|
|
21
|
+
...e
|
|
22
22
|
}
|
|
23
23
|
));
|
|
24
24
|
i.displayName = "CardHeader";
|
|
25
|
-
const
|
|
25
|
+
const l = d.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ t(
|
|
26
26
|
"h3",
|
|
27
27
|
{
|
|
28
28
|
ref: r,
|
|
29
|
-
className:
|
|
30
|
-
...
|
|
29
|
+
className: o("text-lg font-semibold leading-none tracking-tight", a),
|
|
30
|
+
...e
|
|
31
31
|
}
|
|
32
32
|
));
|
|
33
|
-
|
|
34
|
-
const
|
|
33
|
+
l.displayName = "CardTitle";
|
|
34
|
+
const m = d.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ t(
|
|
35
35
|
"p",
|
|
36
36
|
{
|
|
37
37
|
ref: r,
|
|
38
|
-
className:
|
|
39
|
-
...
|
|
38
|
+
className: o("text-sm text-tertiary", a),
|
|
39
|
+
...e
|
|
40
40
|
}
|
|
41
41
|
));
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
const n =
|
|
42
|
+
m.displayName = "CardDescription";
|
|
43
|
+
const c = d.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ t("div", { ref: r, className: o("p-6 pt-0", a), ...e }));
|
|
44
|
+
c.displayName = "CardContent";
|
|
45
|
+
const n = d.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ t(
|
|
46
46
|
"div",
|
|
47
47
|
{
|
|
48
48
|
ref: r,
|
|
49
|
-
className:
|
|
50
|
-
...
|
|
49
|
+
className: o("flex items-center p-6 pt-0", a),
|
|
50
|
+
...e
|
|
51
51
|
}
|
|
52
52
|
));
|
|
53
53
|
n.displayName = "CardFooter";
|
|
54
54
|
export {
|
|
55
55
|
s as Card,
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
c as CardContent,
|
|
57
|
+
m as CardDescription,
|
|
58
58
|
n as CardFooter,
|
|
59
59
|
i as CardHeader,
|
|
60
|
-
|
|
60
|
+
l as CardTitle
|
|
61
61
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsxs as l, jsx as
|
|
1
|
+
import { jsxs as l, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { useState as c, useEffect as C } from "react";
|
|
3
|
-
import { AnimatePresence as I, motion as
|
|
3
|
+
import { AnimatePresence as I, motion as g } from "framer-motion";
|
|
4
4
|
function E({
|
|
5
|
-
slides:
|
|
6
|
-
interval:
|
|
5
|
+
slides: a,
|
|
6
|
+
interval: n = 5e3,
|
|
7
7
|
showIndicators: b = !0,
|
|
8
8
|
className: x = ""
|
|
9
9
|
}) {
|
|
10
|
-
const [
|
|
10
|
+
const [r, o] = c(0), [m, s] = c(0), [u, d] = c(!1);
|
|
11
11
|
C(() => {
|
|
12
|
-
if (
|
|
13
|
-
const
|
|
14
|
-
s(1), o((
|
|
15
|
-
},
|
|
16
|
-
return () => clearInterval(
|
|
17
|
-
}, [
|
|
12
|
+
if (u) return;
|
|
13
|
+
const t = setInterval(() => {
|
|
14
|
+
s(1), o((e) => (e + 1) % a.length);
|
|
15
|
+
}, n);
|
|
16
|
+
return () => clearInterval(t);
|
|
17
|
+
}, [n, a.length, u]);
|
|
18
18
|
const y = {
|
|
19
|
-
enter: (
|
|
20
|
-
x:
|
|
19
|
+
enter: (t) => ({
|
|
20
|
+
x: t > 0 ? 1e3 : -1e3,
|
|
21
21
|
opacity: 0
|
|
22
22
|
}),
|
|
23
23
|
center: {
|
|
@@ -25,23 +25,23 @@ function E({
|
|
|
25
25
|
x: 0,
|
|
26
26
|
opacity: 1
|
|
27
27
|
},
|
|
28
|
-
exit: (
|
|
28
|
+
exit: (t) => ({
|
|
29
29
|
zIndex: 0,
|
|
30
|
-
x:
|
|
30
|
+
x: t < 0 ? 1e3 : -1e3,
|
|
31
31
|
opacity: 0
|
|
32
32
|
})
|
|
33
|
-
}, f = 1e4, v = (
|
|
34
|
-
s(
|
|
35
|
-
}, N = (
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
s(
|
|
33
|
+
}, f = 1e4, v = (t, e) => Math.abs(t) * e, p = (t) => {
|
|
34
|
+
s(t), o((e) => (e + t + a.length) % a.length);
|
|
35
|
+
}, N = (t) => {
|
|
36
|
+
d(!0);
|
|
37
|
+
const e = t > r ? 1 : -1;
|
|
38
|
+
s(e), o(t), setTimeout(() => d(!1), n);
|
|
39
39
|
};
|
|
40
40
|
return /* @__PURE__ */ l("div", { className: `relative overflow-hidden ${x}`, children: [
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
|
|
41
|
+
/* @__PURE__ */ i(I, { initial: !1, custom: m, children: /* @__PURE__ */ l(
|
|
42
|
+
g.div,
|
|
43
43
|
{
|
|
44
|
-
custom:
|
|
44
|
+
custom: m,
|
|
45
45
|
variants: y,
|
|
46
46
|
initial: "enter",
|
|
47
47
|
animate: "center",
|
|
@@ -53,45 +53,45 @@ function E({
|
|
|
53
53
|
drag: "x",
|
|
54
54
|
dragConstraints: { left: 0, right: 0 },
|
|
55
55
|
dragElastic: 1,
|
|
56
|
-
onDragEnd: (
|
|
57
|
-
const h = v(
|
|
58
|
-
h < -f ?
|
|
56
|
+
onDragEnd: (t, { offset: e, velocity: w }) => {
|
|
57
|
+
const h = v(e.x, w.x);
|
|
58
|
+
h < -f ? p(1) : h > f && p(-1);
|
|
59
59
|
},
|
|
60
60
|
className: "absolute inset-0",
|
|
61
61
|
children: [
|
|
62
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ i("div", { className: "absolute inset-0 bg-gradient-to-b from-primary/20", children: /* @__PURE__ */ i(
|
|
63
63
|
"img",
|
|
64
64
|
{
|
|
65
|
-
src:
|
|
65
|
+
src: a[r].image,
|
|
66
66
|
alt: "carousel",
|
|
67
67
|
className: "w-full h-full object-cover"
|
|
68
68
|
}
|
|
69
69
|
) }),
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
|
|
70
|
+
/* @__PURE__ */ i("div", { className: "absolute bottom-20 left-8 text-primary", children: /* @__PURE__ */ l(
|
|
71
|
+
g.h1,
|
|
72
72
|
{
|
|
73
73
|
className: "text-4xl font-semibold",
|
|
74
74
|
initial: { y: 20, opacity: 0 },
|
|
75
75
|
animate: { y: 0, opacity: 1 },
|
|
76
76
|
transition: { delay: 0.2 },
|
|
77
77
|
children: [
|
|
78
|
-
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
|
|
78
|
+
a[r].title,
|
|
79
|
+
/* @__PURE__ */ i("br", {}),
|
|
80
|
+
a[r].subtitle
|
|
81
81
|
]
|
|
82
82
|
}
|
|
83
83
|
) })
|
|
84
84
|
]
|
|
85
85
|
},
|
|
86
|
-
|
|
86
|
+
r
|
|
87
87
|
) }),
|
|
88
|
-
b && /* @__PURE__ */
|
|
88
|
+
b && /* @__PURE__ */ i("div", { className: "absolute bottom-8 left-8 flex gap-2 z-10", children: a.map((t, e) => /* @__PURE__ */ i(
|
|
89
89
|
"button",
|
|
90
90
|
{
|
|
91
|
-
onClick: () => N(
|
|
92
|
-
className: `w-8 h-1 rounded-full transition-all duration-300 ${
|
|
91
|
+
onClick: () => N(e),
|
|
92
|
+
className: `w-8 h-1 rounded-full transition-all duration-300 ${e === r ? "bg-primary" : "bg-primary/30 hover:bg-primary/50"}`
|
|
93
93
|
},
|
|
94
|
-
|
|
94
|
+
e
|
|
95
95
|
)) })
|
|
96
96
|
] });
|
|
97
97
|
}
|