@arolariu/components 0.0.11 → 0.0.13
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/cjs/components/ui/alert-dialog.js +1 -1
- package/dist/cjs/components/ui/carousel.js +1 -1
- package/dist/cjs/components/ui/menubar.js +1 -1
- package/dist/cjs/components/ui/pagination.js +1 -1
- package/dist/cjs/components/ui/popover.js +1 -1
- package/dist/cjs/components/ui/scroll-area.js +1 -1
- package/dist/cjs/components/ui/sidebar.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/es/components/ui/accordion.js +50 -8
- package/dist/es/components/ui/alert-dialog.js +118 -22
- package/dist/es/components/ui/alert.js +52 -14
- package/dist/es/components/ui/aspect-ratio.js +4 -2
- package/dist/es/components/ui/avatar.js +42 -6
- package/dist/es/components/ui/badge.js +28 -13
- package/dist/es/components/ui/breadcrumb.js +78 -10
- package/dist/es/components/ui/button.js +37 -21
- package/dist/es/components/ui/calendar.js +52 -29
- package/dist/es/components/ui/card.js +51 -6
- package/dist/es/components/ui/carousel.js +142 -32
- package/dist/es/components/ui/chart.js +169 -42
- package/dist/es/components/ui/checkbox.js +23 -2
- package/dist/es/components/ui/collapsible.js +24 -6
- package/dist/es/components/ui/command.js +136 -18
- package/dist/es/components/ui/context-menu.js +187 -30
- package/dist/es/components/ui/dialog.js +100 -18
- package/dist/es/components/ui/drawer.js +98 -18
- package/dist/es/components/ui/dropdown-menu.js +195 -30
- package/dist/es/components/ui/form.js +59 -8
- package/dist/es/components/ui/hover-card.js +30 -9
- package/dist/es/components/ui/input-otp.js +47 -6
- package/dist/es/components/ui/input.js +14 -1
- package/dist/es/components/ui/label.js +15 -2
- package/dist/es/components/ui/menubar.js +228 -47
- package/dist/es/components/ui/navigation-menu.js +146 -17
- package/dist/es/components/ui/pagination.js +96 -15
- package/dist/es/components/ui/popover.js +33 -10
- package/dist/es/components/ui/progress.js +24 -2
- package/dist/es/components/ui/radio-group.js +35 -4
- package/dist/es/components/ui/resizable.js +36 -6
- package/dist/es/components/ui/scroll-area.js +51 -4
- package/dist/es/components/ui/select.js +143 -22
- package/dist/es/components/ui/separator.js +19 -2
- package/dist/es/components/ui/sheet.js +99 -17
- package/dist/es/components/ui/sidebar.js +512 -112
- package/dist/es/components/ui/skeleton.js +8 -1
- package/dist/es/components/ui/slider.js +56 -4
- package/dist/es/components/ui/sonner.js +15 -7
- package/dist/es/components/ui/switch.js +24 -2
- package/dist/es/components/ui/table.js +87 -9
- package/dist/es/components/ui/tabs.js +54 -8
- package/dist/es/components/ui/textarea.js +11 -1
- package/dist/es/components/ui/toggle-group.js +48 -9
- package/dist/es/components/ui/toggle.js +31 -16
- package/dist/es/components/ui/tooltip.js +45 -11
- package/dist/types/index.d.ts +46 -46
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +12 -2
- package/dist/umd/arolariu-components.umd.js +0 -7
|
@@ -2,21 +2,36 @@ import { jsx as n } from "react/jsx-runtime";
|
|
|
2
2
|
import { Slot as i } from "@radix-ui/react-slot";
|
|
3
3
|
import { cva as d } from "class-variance-authority";
|
|
4
4
|
import { cn as o } from "../../lib/utils.js";
|
|
5
|
-
const l = d(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
const l = d(
|
|
6
|
+
"inline-flex items-center justify-center rounded-md border border-neutral-200 px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-neutral-950 focus-visible:ring-neutral-950/50 focus-visible:ring-[3px] aria-invalid:ring-red-500/20 dark:aria-invalid:ring-red-500/40 aria-invalid:border-red-500 transition-[color,box-shadow] overflow-hidden dark:border-neutral-800 dark:focus-visible:border-neutral-300 dark:focus-visible:ring-neutral-300/50 dark:aria-invalid:ring-red-900/20 dark:dark:aria-invalid:ring-red-900/40 dark:aria-invalid:border-red-900",
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "border-transparent bg-neutral-900 text-neutral-50 [a&]:hover:bg-neutral-900/90 dark:bg-neutral-50 dark:text-neutral-900 dark:[a&]:hover:bg-neutral-50/90",
|
|
11
|
+
secondary: "border-transparent bg-neutral-100 text-neutral-900 [a&]:hover:bg-neutral-100/90 dark:bg-neutral-800 dark:text-neutral-50 dark:[a&]:hover:bg-neutral-800/90",
|
|
12
|
+
destructive: "border-transparent bg-red-500 text-white [a&]:hover:bg-red-500/90 focus-visible:ring-red-500/20 dark:focus-visible:ring-red-500/40 dark:bg-red-900 dark:[a&]:hover:bg-red-900/90 dark:focus-visible:ring-red-900/20 dark:dark:focus-visible:ring-red-900/40",
|
|
13
|
+
outline: "text-neutral-950 [a&]:hover:bg-neutral-100 [a&]:hover:text-neutral-900 dark:text-neutral-50 dark:[a&]:hover:bg-neutral-800 dark:[a&]:hover:text-neutral-50"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
variant: "default"
|
|
12
18
|
}
|
|
13
|
-
},
|
|
14
|
-
defaultVariants: {
|
|
15
|
-
variant: "default"
|
|
16
19
|
}
|
|
17
|
-
|
|
18
|
-
function k({
|
|
19
|
-
|
|
20
|
+
);
|
|
21
|
+
function k({
|
|
22
|
+
className: r,
|
|
23
|
+
variant: e,
|
|
24
|
+
asChild: a = !1,
|
|
25
|
+
...t
|
|
26
|
+
}) {
|
|
27
|
+
return /* @__PURE__ */ n(
|
|
28
|
+
a ? i : "span",
|
|
29
|
+
{
|
|
30
|
+
"data-slot": "badge",
|
|
31
|
+
className: o(l({ variant: e }), r),
|
|
32
|
+
...t
|
|
33
|
+
}
|
|
34
|
+
);
|
|
20
35
|
}
|
|
21
36
|
export {
|
|
22
37
|
k as Badge,
|
|
@@ -3,25 +3,93 @@ import { Slot as o } from "@radix-ui/react-slot";
|
|
|
3
3
|
import { ChevronRight as l, MoreHorizontal as i } from "lucide-react";
|
|
4
4
|
import { cn as t } from "../../lib/utils.js";
|
|
5
5
|
function p({ ...r }) {
|
|
6
|
-
return a("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...r });
|
|
6
|
+
return /* @__PURE__ */ a("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...r });
|
|
7
7
|
}
|
|
8
8
|
function f({ className: r, ...e }) {
|
|
9
|
-
return
|
|
9
|
+
return /* @__PURE__ */ a(
|
|
10
|
+
"ol",
|
|
11
|
+
{
|
|
12
|
+
"data-slot": "breadcrumb-list",
|
|
13
|
+
className: t(
|
|
14
|
+
"text-neutral-500 flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5 dark:text-neutral-400",
|
|
15
|
+
r
|
|
16
|
+
),
|
|
17
|
+
...e
|
|
18
|
+
}
|
|
19
|
+
);
|
|
10
20
|
}
|
|
11
21
|
function x({ className: r, ...e }) {
|
|
12
|
-
return
|
|
22
|
+
return /* @__PURE__ */ a(
|
|
23
|
+
"li",
|
|
24
|
+
{
|
|
25
|
+
"data-slot": "breadcrumb-item",
|
|
26
|
+
className: t("inline-flex items-center gap-1.5", r),
|
|
27
|
+
...e
|
|
28
|
+
}
|
|
29
|
+
);
|
|
13
30
|
}
|
|
14
|
-
function g({
|
|
15
|
-
|
|
31
|
+
function g({
|
|
32
|
+
asChild: r,
|
|
33
|
+
className: e,
|
|
34
|
+
...n
|
|
35
|
+
}) {
|
|
36
|
+
return /* @__PURE__ */ a(
|
|
37
|
+
r ? o : "a",
|
|
38
|
+
{
|
|
39
|
+
"data-slot": "breadcrumb-link",
|
|
40
|
+
className: t("hover:text-neutral-950 transition-colors dark:hover:text-neutral-50", e),
|
|
41
|
+
...n
|
|
42
|
+
}
|
|
43
|
+
);
|
|
16
44
|
}
|
|
17
45
|
function N({ className: r, ...e }) {
|
|
18
|
-
return
|
|
46
|
+
return /* @__PURE__ */ a(
|
|
47
|
+
"span",
|
|
48
|
+
{
|
|
49
|
+
"data-slot": "breadcrumb-page",
|
|
50
|
+
role: "link",
|
|
51
|
+
"aria-disabled": "true",
|
|
52
|
+
"aria-current": "page",
|
|
53
|
+
className: t("text-neutral-950 font-normal dark:text-neutral-50", r),
|
|
54
|
+
...e
|
|
55
|
+
}
|
|
56
|
+
);
|
|
19
57
|
}
|
|
20
|
-
function k({
|
|
21
|
-
|
|
58
|
+
function k({
|
|
59
|
+
children: r,
|
|
60
|
+
className: e,
|
|
61
|
+
...n
|
|
62
|
+
}) {
|
|
63
|
+
return /* @__PURE__ */ a(
|
|
64
|
+
"li",
|
|
65
|
+
{
|
|
66
|
+
"data-slot": "breadcrumb-separator",
|
|
67
|
+
role: "presentation",
|
|
68
|
+
"aria-hidden": "true",
|
|
69
|
+
className: t("[&>svg]:size-3.5", e),
|
|
70
|
+
...n,
|
|
71
|
+
children: r != null ? r : /* @__PURE__ */ a(l, {})
|
|
72
|
+
}
|
|
73
|
+
);
|
|
22
74
|
}
|
|
23
|
-
function B({
|
|
24
|
-
|
|
75
|
+
function B({
|
|
76
|
+
className: r,
|
|
77
|
+
...e
|
|
78
|
+
}) {
|
|
79
|
+
return /* @__PURE__ */ s(
|
|
80
|
+
"span",
|
|
81
|
+
{
|
|
82
|
+
"data-slot": "breadcrumb-ellipsis",
|
|
83
|
+
role: "presentation",
|
|
84
|
+
"aria-hidden": "true",
|
|
85
|
+
className: t("flex size-9 items-center justify-center", r),
|
|
86
|
+
...e,
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ a(i, { className: "size-4" }),
|
|
89
|
+
/* @__PURE__ */ a("span", { className: "sr-only", children: "More" })
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
);
|
|
25
93
|
}
|
|
26
94
|
export {
|
|
27
95
|
p as Breadcrumb,
|
|
@@ -2,30 +2,46 @@ import { jsx as i } from "react/jsx-runtime";
|
|
|
2
2
|
import { Slot as d } from "@radix-ui/react-slot";
|
|
3
3
|
import { cva as o } from "class-variance-authority";
|
|
4
4
|
import { cn as s } from "../../lib/utils.js";
|
|
5
|
-
const l = o(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
const l = o(
|
|
6
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-neutral-950 focus-visible:ring-neutral-950/50 focus-visible:ring-[3px] aria-invalid:ring-red-500/20 dark:aria-invalid:ring-red-500/40 aria-invalid:border-red-500 dark:focus-visible:border-neutral-300 dark:focus-visible:ring-neutral-300/50 dark:aria-invalid:ring-red-900/20 dark:dark:aria-invalid:ring-red-900/40 dark:aria-invalid:border-red-900",
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "bg-neutral-900 text-neutral-50 shadow-xs hover:bg-neutral-900/90 dark:bg-neutral-50 dark:text-neutral-900 dark:hover:bg-neutral-50/90",
|
|
11
|
+
destructive: "bg-red-500 text-white shadow-xs hover:bg-red-500/90 focus-visible:ring-red-500/20 dark:focus-visible:ring-red-500/40 dark:bg-red-900 dark:hover:bg-red-900/90 dark:focus-visible:ring-red-900/20 dark:dark:focus-visible:ring-red-900/40",
|
|
12
|
+
outline: "border border-neutral-200 bg-white shadow-xs hover:bg-neutral-100 hover:text-neutral-900 dark:border-neutral-800 dark:bg-neutral-950 dark:hover:bg-neutral-800 dark:hover:text-neutral-50",
|
|
13
|
+
secondary: "bg-neutral-100 text-neutral-900 shadow-xs hover:bg-neutral-100/80 dark:bg-neutral-800 dark:text-neutral-50 dark:hover:bg-neutral-800/80",
|
|
14
|
+
ghost: "hover:bg-neutral-100 hover:text-neutral-900 dark:hover:bg-neutral-800 dark:hover:text-neutral-50",
|
|
15
|
+
link: "text-neutral-900 underline-offset-4 hover:underline dark:text-neutral-50"
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
19
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
20
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
21
|
+
icon: "size-9"
|
|
22
|
+
}
|
|
14
23
|
},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
19
|
-
icon: "size-9"
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
variant: "default",
|
|
26
|
+
size: "default"
|
|
20
27
|
}
|
|
21
|
-
},
|
|
22
|
-
defaultVariants: {
|
|
23
|
-
variant: "default",
|
|
24
|
-
size: "default"
|
|
25
28
|
}
|
|
26
|
-
|
|
27
|
-
function k({
|
|
28
|
-
|
|
29
|
+
);
|
|
30
|
+
function k({
|
|
31
|
+
className: r,
|
|
32
|
+
variant: e,
|
|
33
|
+
size: a,
|
|
34
|
+
asChild: t = !1,
|
|
35
|
+
...n
|
|
36
|
+
}) {
|
|
37
|
+
return /* @__PURE__ */ i(
|
|
38
|
+
t ? d : "button",
|
|
39
|
+
{
|
|
40
|
+
"data-slot": "button",
|
|
41
|
+
className: s(l({ variant: e, size: a, className: r })),
|
|
42
|
+
...n
|
|
43
|
+
}
|
|
44
|
+
);
|
|
29
45
|
}
|
|
30
46
|
export {
|
|
31
47
|
k as Button,
|
|
@@ -3,35 +3,58 @@ import { ChevronRight as o, ChevronLeft as i } from "lucide-react";
|
|
|
3
3
|
import { DayPicker as c } from "react-day-picker";
|
|
4
4
|
import { cn as e } from "../../lib/utils.js";
|
|
5
5
|
import { buttonVariants as n } from "./button.js";
|
|
6
|
-
function h({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
6
|
+
function h({
|
|
7
|
+
className: d,
|
|
8
|
+
classNames: s,
|
|
9
|
+
showOutsideDays: u = !0,
|
|
10
|
+
...l
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ r(
|
|
13
|
+
c,
|
|
14
|
+
{
|
|
15
|
+
showOutsideDays: u,
|
|
16
|
+
className: e("p-3", d),
|
|
17
|
+
classNames: {
|
|
18
|
+
months: "flex flex-col sm:flex-row gap-2",
|
|
19
|
+
month: "flex flex-col gap-4",
|
|
20
|
+
caption: "flex justify-center pt-1 relative items-center w-full",
|
|
21
|
+
caption_label: "text-sm font-medium",
|
|
22
|
+
nav: "flex items-center gap-1",
|
|
23
|
+
nav_button: e(
|
|
24
|
+
n({ variant: "outline" }),
|
|
25
|
+
"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"
|
|
26
|
+
),
|
|
27
|
+
nav_button_previous: "absolute left-1",
|
|
28
|
+
nav_button_next: "absolute right-1",
|
|
29
|
+
table: "w-full border-collapse space-x-1",
|
|
30
|
+
head_row: "flex",
|
|
31
|
+
head_cell: "text-neutral-500 rounded-md w-8 font-normal text-[0.8rem] dark:text-neutral-400",
|
|
32
|
+
row: "flex w-full mt-2",
|
|
33
|
+
cell: e(
|
|
34
|
+
"relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-neutral-100 [&:has([aria-selected].day-range-end)]:rounded-r-md dark:[&:has([aria-selected])]:bg-neutral-800",
|
|
35
|
+
l.mode === "range" ? "[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md" : "[&:has([aria-selected])]:rounded-md"
|
|
36
|
+
),
|
|
37
|
+
day: e(
|
|
38
|
+
n({ variant: "ghost" }),
|
|
39
|
+
"size-8 p-0 font-normal aria-selected:opacity-100"
|
|
40
|
+
),
|
|
41
|
+
day_range_start: "day-range-start aria-selected:bg-neutral-900 aria-selected:text-neutral-50 dark:aria-selected:bg-neutral-50 dark:aria-selected:text-neutral-900",
|
|
42
|
+
day_range_end: "day-range-end aria-selected:bg-neutral-900 aria-selected:text-neutral-50 dark:aria-selected:bg-neutral-50 dark:aria-selected:text-neutral-900",
|
|
43
|
+
day_selected: "bg-neutral-900 text-neutral-50 hover:bg-neutral-900 hover:text-neutral-50 focus:bg-neutral-900 focus:text-neutral-50 dark:bg-neutral-50 dark:text-neutral-900 dark:hover:bg-neutral-50 dark:hover:text-neutral-900 dark:focus:bg-neutral-50 dark:focus:text-neutral-900",
|
|
44
|
+
day_today: "bg-neutral-100 text-neutral-900 dark:bg-neutral-800 dark:text-neutral-50",
|
|
45
|
+
day_outside: "day-outside text-neutral-500 aria-selected:text-neutral-500 dark:text-neutral-400 dark:aria-selected:text-neutral-400",
|
|
46
|
+
day_disabled: "text-neutral-500 opacity-50 dark:text-neutral-400",
|
|
47
|
+
day_range_middle: "aria-selected:bg-neutral-100 aria-selected:text-neutral-900 dark:aria-selected:bg-neutral-800 dark:aria-selected:text-neutral-50",
|
|
48
|
+
day_hidden: "invisible",
|
|
49
|
+
...s
|
|
50
|
+
},
|
|
51
|
+
components: {
|
|
52
|
+
IconLeft: ({ className: a, ...t }) => /* @__PURE__ */ r(i, { className: e("size-4", a), ...t }),
|
|
53
|
+
IconRight: ({ className: a, ...t }) => /* @__PURE__ */ r(o, { className: e("size-4", a), ...t })
|
|
54
|
+
},
|
|
55
|
+
...l
|
|
56
|
+
}
|
|
57
|
+
);
|
|
35
58
|
}
|
|
36
59
|
export {
|
|
37
60
|
h as Calendar
|
|
@@ -1,22 +1,67 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { cn as e } from "../../lib/utils.js";
|
|
3
3
|
function o({ className: t, ...r }) {
|
|
4
|
-
return
|
|
4
|
+
return /* @__PURE__ */ a(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
"data-slot": "card",
|
|
8
|
+
className: e(
|
|
9
|
+
"bg-white text-neutral-950 flex flex-col gap-6 rounded-xl border border-neutral-200 py-6 shadow-sm dark:bg-neutral-950 dark:text-neutral-50 dark:border-neutral-800",
|
|
10
|
+
t
|
|
11
|
+
),
|
|
12
|
+
...r
|
|
13
|
+
}
|
|
14
|
+
);
|
|
5
15
|
}
|
|
6
16
|
function l({ className: t, ...r }) {
|
|
7
|
-
return
|
|
17
|
+
return /* @__PURE__ */ a(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
"data-slot": "card-header",
|
|
21
|
+
className: e("flex flex-col gap-1.5 px-6", t),
|
|
22
|
+
...r
|
|
23
|
+
}
|
|
24
|
+
);
|
|
8
25
|
}
|
|
9
26
|
function s({ className: t, ...r }) {
|
|
10
|
-
return
|
|
27
|
+
return /* @__PURE__ */ a(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
"data-slot": "card-title",
|
|
31
|
+
className: e("leading-none font-semibold", t),
|
|
32
|
+
...r
|
|
33
|
+
}
|
|
34
|
+
);
|
|
11
35
|
}
|
|
12
36
|
function c({ className: t, ...r }) {
|
|
13
|
-
return
|
|
37
|
+
return /* @__PURE__ */ a(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
"data-slot": "card-description",
|
|
41
|
+
className: e("text-neutral-500 text-sm dark:text-neutral-400", t),
|
|
42
|
+
...r
|
|
43
|
+
}
|
|
44
|
+
);
|
|
14
45
|
}
|
|
15
46
|
function i({ className: t, ...r }) {
|
|
16
|
-
return
|
|
47
|
+
return /* @__PURE__ */ a(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
"data-slot": "card-content",
|
|
51
|
+
className: e("px-6", t),
|
|
52
|
+
...r
|
|
53
|
+
}
|
|
54
|
+
);
|
|
17
55
|
}
|
|
18
56
|
function u({ className: t, ...r }) {
|
|
19
|
-
return
|
|
57
|
+
return /* @__PURE__ */ a(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
"data-slot": "card-footer",
|
|
61
|
+
className: e("flex items-center px-6", t),
|
|
62
|
+
...r
|
|
63
|
+
}
|
|
64
|
+
);
|
|
20
65
|
}
|
|
21
66
|
export {
|
|
22
67
|
o as Card,
|
|
@@ -1,29 +1,43 @@
|
|
|
1
1
|
import { jsx as n, jsxs as h } from "react/jsx-runtime";
|
|
2
2
|
import * as l from "react";
|
|
3
|
-
import
|
|
4
|
-
import { ArrowLeft as
|
|
3
|
+
import z from "embla-carousel-react";
|
|
4
|
+
import { ArrowLeft as g, ArrowRight as p } from "lucide-react";
|
|
5
5
|
import { cn as d } from "../../lib/utils.js";
|
|
6
6
|
import { Button as v } from "./button.js";
|
|
7
7
|
const N = l.createContext(null);
|
|
8
8
|
function m() {
|
|
9
|
-
const
|
|
10
|
-
if (!
|
|
9
|
+
const o = l.useContext(N);
|
|
10
|
+
if (!o)
|
|
11
11
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
12
|
-
return
|
|
12
|
+
return o;
|
|
13
13
|
}
|
|
14
|
-
function I({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
function I({
|
|
15
|
+
orientation: o = "horizontal",
|
|
16
|
+
opts: r,
|
|
17
|
+
setApi: t,
|
|
18
|
+
plugins: s,
|
|
19
|
+
className: c,
|
|
20
|
+
children: i,
|
|
21
|
+
...u
|
|
22
|
+
}) {
|
|
23
|
+
const [b, e] = z(
|
|
24
|
+
{
|
|
25
|
+
...r,
|
|
26
|
+
axis: o === "horizontal" ? "x" : "y"
|
|
27
|
+
},
|
|
28
|
+
s
|
|
29
|
+
), [w, S] = l.useState(!1), [y, P] = l.useState(!1), f = l.useCallback((a) => {
|
|
30
|
+
a && (S(a.canScrollPrev()), P(a.canScrollNext()));
|
|
20
31
|
}, []), x = l.useCallback(() => {
|
|
21
32
|
e == null || e.scrollPrev();
|
|
22
33
|
}, [e]), C = l.useCallback(() => {
|
|
23
34
|
e == null || e.scrollNext();
|
|
24
|
-
}, [e]),
|
|
25
|
-
|
|
26
|
-
|
|
35
|
+
}, [e]), k = l.useCallback(
|
|
36
|
+
(a) => {
|
|
37
|
+
a.key === "ArrowLeft" ? (a.preventDefault(), x()) : a.key === "ArrowRight" && (a.preventDefault(), C());
|
|
38
|
+
},
|
|
39
|
+
[x, C]
|
|
40
|
+
);
|
|
27
41
|
return l.useEffect(() => {
|
|
28
42
|
!e || !t || t(e);
|
|
29
43
|
}, [e, t]), l.useEffect(() => {
|
|
@@ -31,32 +45,128 @@ function I({ orientation: r = "horizontal", opts: o, setApi: t, plugins: s, clas
|
|
|
31
45
|
return f(e), e.on("reInit", f), e.on("select", f), () => {
|
|
32
46
|
e == null || e.off("select", f);
|
|
33
47
|
};
|
|
34
|
-
}, [e, f]),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
}, [e, f]), /* @__PURE__ */ n(
|
|
49
|
+
N.Provider,
|
|
50
|
+
{
|
|
51
|
+
value: {
|
|
52
|
+
carouselRef: b,
|
|
53
|
+
api: e,
|
|
54
|
+
opts: r,
|
|
55
|
+
orientation: o || ((r == null ? void 0 : r.axis) === "y" ? "vertical" : "horizontal"),
|
|
56
|
+
scrollPrev: x,
|
|
57
|
+
scrollNext: C,
|
|
58
|
+
canScrollPrev: w,
|
|
59
|
+
canScrollNext: y
|
|
60
|
+
},
|
|
61
|
+
children: /* @__PURE__ */ n(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
onKeyDownCapture: k,
|
|
65
|
+
className: d("relative", c),
|
|
66
|
+
role: "region",
|
|
67
|
+
"aria-roledescription": "carousel",
|
|
68
|
+
"data-slot": "carousel",
|
|
69
|
+
...u,
|
|
70
|
+
children: i
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
);
|
|
44
75
|
}
|
|
45
|
-
function K({ className:
|
|
76
|
+
function K({ className: o, ...r }) {
|
|
46
77
|
const { carouselRef: t, orientation: s } = m();
|
|
47
|
-
return
|
|
78
|
+
return /* @__PURE__ */ n(
|
|
79
|
+
"div",
|
|
80
|
+
{
|
|
81
|
+
ref: t,
|
|
82
|
+
className: "overflow-hidden",
|
|
83
|
+
"data-slot": "carousel-content",
|
|
84
|
+
children: /* @__PURE__ */ n(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
className: d(
|
|
88
|
+
"flex",
|
|
89
|
+
s === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
|
|
90
|
+
o
|
|
91
|
+
),
|
|
92
|
+
...r
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
);
|
|
48
97
|
}
|
|
49
|
-
function L({ className:
|
|
98
|
+
function L({ className: o, ...r }) {
|
|
50
99
|
const { orientation: t } = m();
|
|
51
|
-
return
|
|
100
|
+
return /* @__PURE__ */ n(
|
|
101
|
+
"div",
|
|
102
|
+
{
|
|
103
|
+
role: "group",
|
|
104
|
+
"aria-roledescription": "slide",
|
|
105
|
+
"data-slot": "carousel-item",
|
|
106
|
+
className: d(
|
|
107
|
+
"min-w-0 shrink-0 grow-0 basis-full",
|
|
108
|
+
t === "horizontal" ? "pl-4" : "pt-4",
|
|
109
|
+
o
|
|
110
|
+
),
|
|
111
|
+
...r
|
|
112
|
+
}
|
|
113
|
+
);
|
|
52
114
|
}
|
|
53
|
-
function B({
|
|
115
|
+
function B({
|
|
116
|
+
className: o,
|
|
117
|
+
variant: r = "outline",
|
|
118
|
+
size: t = "icon",
|
|
119
|
+
...s
|
|
120
|
+
}) {
|
|
54
121
|
const { orientation: c, scrollPrev: i, canScrollPrev: u } = m();
|
|
55
|
-
return
|
|
122
|
+
return /* @__PURE__ */ h(
|
|
123
|
+
v,
|
|
124
|
+
{
|
|
125
|
+
"data-slot": "carousel-previous",
|
|
126
|
+
variant: r,
|
|
127
|
+
size: t,
|
|
128
|
+
className: d(
|
|
129
|
+
"absolute size-8 rounded-full",
|
|
130
|
+
c === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
131
|
+
o
|
|
132
|
+
),
|
|
133
|
+
disabled: !u,
|
|
134
|
+
onClick: i,
|
|
135
|
+
...s,
|
|
136
|
+
children: [
|
|
137
|
+
/* @__PURE__ */ n(g, {}),
|
|
138
|
+
/* @__PURE__ */ n("span", { className: "sr-only", children: "Previous slide" })
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
);
|
|
56
142
|
}
|
|
57
|
-
function q({
|
|
143
|
+
function q({
|
|
144
|
+
className: o,
|
|
145
|
+
variant: r = "outline",
|
|
146
|
+
size: t = "icon",
|
|
147
|
+
...s
|
|
148
|
+
}) {
|
|
58
149
|
const { orientation: c, scrollNext: i, canScrollNext: u } = m();
|
|
59
|
-
return
|
|
150
|
+
return /* @__PURE__ */ h(
|
|
151
|
+
v,
|
|
152
|
+
{
|
|
153
|
+
"data-slot": "carousel-next",
|
|
154
|
+
variant: r,
|
|
155
|
+
size: t,
|
|
156
|
+
className: d(
|
|
157
|
+
"absolute size-8 rounded-full",
|
|
158
|
+
c === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
159
|
+
o
|
|
160
|
+
),
|
|
161
|
+
disabled: !u,
|
|
162
|
+
onClick: i,
|
|
163
|
+
...s,
|
|
164
|
+
children: [
|
|
165
|
+
/* @__PURE__ */ n(p, {}),
|
|
166
|
+
/* @__PURE__ */ n("span", { className: "sr-only", children: "Next slide" })
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
);
|
|
60
170
|
}
|
|
61
171
|
export {
|
|
62
172
|
I as Carousel,
|