@ichaingo/ui 1.1.0
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/.babelrc +12 -0
- package/README.md +103 -0
- package/components.json +21 -0
- package/dist/accordion.d.ts +13 -0
- package/dist/accordion.mjs +64 -0
- package/dist/alert-dialog.d.ts +27 -0
- package/dist/alert-dialog.mjs +146 -0
- package/dist/alert.d.ts +16 -0
- package/dist/alert.mjs +66 -0
- package/dist/aspect-ratio.d.ts +6 -0
- package/dist/aspect-ratio.mjs +10 -0
- package/dist/avatar.d.ts +11 -0
- package/dist/avatar.mjs +53 -0
- package/dist/badge.d.ts +14 -0
- package/dist/badge.mjs +39 -0
- package/dist/breadcrumb.d.ts +20 -0
- package/dist/breadcrumb.mjs +102 -0
- package/dist/button.d.ts +15 -0
- package/dist/button.mjs +49 -0
- package/dist/calendar.d.ts +23 -0
- package/dist/calendar.mjs +173 -0
- package/dist/card.d.ts +18 -0
- package/dist/card.mjs +90 -0
- package/dist/carousel.d.ts +42 -0
- package/dist/carousel.mjs +177 -0
- package/dist/checkbox.d.ts +7 -0
- package/dist/checkbox.mjs +31 -0
- package/dist/collapsible.d.ts +10 -0
- package/dist/collapsible.mjs +34 -0
- package/dist/command.d.ts +31 -0
- package/dist/command.mjs +170 -0
- package/dist/context-menu.d.ts +42 -0
- package/dist/context-menu.mjs +223 -0
- package/dist/dialog.d.ts +27 -0
- package/dist/dialog.mjs +136 -0
- package/dist/dropdown-menu.d.ts +42 -0
- package/dist/dropdown-menu.mjs +231 -0
- package/dist/form.d.ts +38 -0
- package/dist/form.mjs +101 -0
- package/dist/hover-card.d.ts +11 -0
- package/dist/hover-card.mjs +38 -0
- package/dist/input.d.ts +6 -0
- package/dist/input.mjs +21 -0
- package/dist/label.d.ts +7 -0
- package/dist/label.mjs +23 -0
- package/dist/menubar.d.ts +44 -0
- package/dist/menubar.mjs +251 -0
- package/dist/navigation-menu.d.ts +26 -0
- package/dist/navigation-menu.mjs +170 -0
- package/dist/pagination.d.ts +33 -0
- package/dist/pagination.mjs +116 -0
- package/dist/popover.d.ts +13 -0
- package/dist/popover.mjs +44 -0
- package/dist/progress.d.ts +7 -0
- package/dist/progress.mjs +31 -0
- package/dist/radio-group.d.ts +9 -0
- package/dist/radio-group.mjs +45 -0
- package/dist/resizable.d.ts +13 -0
- package/dist/resizable.mjs +48 -0
- package/dist/scroll-area.d.ts +9 -0
- package/dist/scroll-area.mjs +60 -0
- package/dist/select.d.ts +27 -0
- package/dist/select.mjs +169 -0
- package/dist/separator.d.ts +7 -0
- package/dist/separator.mjs +26 -0
- package/dist/sheet.d.ts +23 -0
- package/dist/sheet.mjs +126 -0
- package/dist/skeleton.d.ts +5 -0
- package/dist/skeleton.mjs +15 -0
- package/dist/slider.d.ts +7 -0
- package/dist/slider.mjs +63 -0
- package/dist/sonner.d.ts +6 -0
- package/dist/sonner.mjs +22 -0
- package/dist/switch.d.ts +7 -0
- package/dist/switch.mjs +31 -0
- package/dist/table.d.ts +20 -0
- package/dist/table.mjs +114 -0
- package/dist/tabs.d.ts +13 -0
- package/dist/tabs.mjs +67 -0
- package/dist/textarea.d.ts +6 -0
- package/dist/textarea.mjs +18 -0
- package/dist/toggle-group.d.ts +16 -0
- package/dist/toggle-group.mjs +62 -0
- package/dist/toggle.d.ts +14 -0
- package/dist/toggle.mjs +43 -0
- package/dist/tooltip.d.ts +13 -0
- package/dist/tooltip.mjs +55 -0
- package/dist/utils-B7J70Nno.js +8 -0
- package/eslint.config.mjs +12 -0
- package/package.json +273 -0
- package/postcss.config.js +6 -0
- package/src/components/ui/accordion.tsx +64 -0
- package/src/components/ui/alert-dialog.tsx +155 -0
- package/src/components/ui/alert.tsx +66 -0
- package/src/components/ui/aspect-ratio.tsx +9 -0
- package/src/components/ui/avatar.tsx +51 -0
- package/src/components/ui/badge.tsx +46 -0
- package/src/components/ui/breadcrumb.tsx +109 -0
- package/src/components/ui/button.tsx +59 -0
- package/src/components/ui/calendar.tsx +211 -0
- package/src/components/ui/card.tsx +92 -0
- package/src/components/ui/carousel.tsx +239 -0
- package/src/components/ui/checkbox.tsx +30 -0
- package/src/components/ui/collapsible.tsx +31 -0
- package/src/components/ui/command.tsx +182 -0
- package/src/components/ui/context-menu.tsx +250 -0
- package/src/components/ui/dialog.tsx +141 -0
- package/src/components/ui/dropdown-menu.tsx +255 -0
- package/src/components/ui/form.tsx +165 -0
- package/src/components/ui/hover-card.tsx +42 -0
- package/src/components/ui/input.tsx +21 -0
- package/src/components/ui/label.tsx +24 -0
- package/src/components/ui/menubar.tsx +274 -0
- package/src/components/ui/navigation-menu.tsx +168 -0
- package/src/components/ui/pagination.tsx +125 -0
- package/src/components/ui/popover.tsx +46 -0
- package/src/components/ui/progress.tsx +29 -0
- package/src/components/ui/radio-group.tsx +43 -0
- package/src/components/ui/resizable.tsx +54 -0
- package/src/components/ui/scroll-area.tsx +56 -0
- package/src/components/ui/select.tsx +183 -0
- package/src/components/ui/separator.tsx +26 -0
- package/src/components/ui/sheet.tsx +137 -0
- package/src/components/ui/skeleton.tsx +13 -0
- package/src/components/ui/slider.tsx +61 -0
- package/src/components/ui/sonner.tsx +23 -0
- package/src/components/ui/switch.tsx +29 -0
- package/src/components/ui/table.tsx +114 -0
- package/src/components/ui/tabs.tsx +64 -0
- package/src/components/ui/textarea.tsx +18 -0
- package/src/components/ui/toggle-group.tsx +71 -0
- package/src/components/ui/toggle.tsx +45 -0
- package/src/components/ui/tooltip.tsx +59 -0
- package/src/index.ts +46 -0
- package/src/lib/utils.ts +6 -0
- package/src/style.css +0 -0
- package/tailwind.config.js +52 -0
- package/tsconfig.json +19 -0
- package/tsconfig.lib.json +54 -0
- package/tsconfig.spec.json +32 -0
- package/vite.config.ts +136 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsx as a, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { Slot as o } from "@radix-ui/react-slot";
|
|
3
|
+
import { ChevronRight as i, MoreHorizontal as l } from "lucide-react";
|
|
4
|
+
import { c as t } from "./utils-B7J70Nno.js";
|
|
5
|
+
function p({ ...r }) {
|
|
6
|
+
return /* @__PURE__ */ a("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...r });
|
|
7
|
+
}
|
|
8
|
+
function f({ className: r, ...e }) {
|
|
9
|
+
return /* @__PURE__ */ a(
|
|
10
|
+
"ol",
|
|
11
|
+
{
|
|
12
|
+
"data-slot": "breadcrumb-list",
|
|
13
|
+
className: t(
|
|
14
|
+
"text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
|
|
15
|
+
r
|
|
16
|
+
),
|
|
17
|
+
...e
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
function g({ className: r, ...e }) {
|
|
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
|
+
);
|
|
30
|
+
}
|
|
31
|
+
function x({
|
|
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-foreground transition-colors", e),
|
|
41
|
+
...n
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
function h({ className: r, ...e }) {
|
|
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-foreground font-normal", r),
|
|
54
|
+
...e
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
function N({
|
|
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 ?? /* @__PURE__ */ a(i, {})
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
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(l, { className: "size-4" }),
|
|
89
|
+
/* @__PURE__ */ a("span", { className: "sr-only", children: "More" })
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
export {
|
|
95
|
+
p as Breadcrumb,
|
|
96
|
+
B as BreadcrumbEllipsis,
|
|
97
|
+
g as BreadcrumbItem,
|
|
98
|
+
x as BreadcrumbLink,
|
|
99
|
+
f as BreadcrumbList,
|
|
100
|
+
h as BreadcrumbPage,
|
|
101
|
+
N as BreadcrumbSeparator
|
|
102
|
+
};
|
package/dist/button.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ClassProp } from 'class-variance-authority/types';
|
|
2
|
+
import { JSX } from 'react/jsx-runtime';
|
|
3
|
+
import * as React_2 from 'react';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
export declare function Button({ className, variant, size, asChild, ...props }: React_2.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
7
|
+
asChild?: boolean;
|
|
8
|
+
}): JSX.Element;
|
|
9
|
+
|
|
10
|
+
export declare const buttonVariants: (props?: ({
|
|
11
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
12
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
13
|
+
} & ClassProp) | undefined) => string;
|
|
14
|
+
|
|
15
|
+
export { }
|
package/dist/button.mjs
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Slot as s } from "@radix-ui/react-slot";
|
|
3
|
+
import { cva as a } from "class-variance-authority";
|
|
4
|
+
import { c as d } from "./utils-B7J70Nno.js";
|
|
5
|
+
const c = a(
|
|
6
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all 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-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
11
|
+
destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
12
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
13
|
+
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
14
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
15
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
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
|
+
}
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
variant: "default",
|
|
26
|
+
size: "default"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
function b({
|
|
31
|
+
className: e,
|
|
32
|
+
variant: r,
|
|
33
|
+
size: t,
|
|
34
|
+
asChild: i = !1,
|
|
35
|
+
...n
|
|
36
|
+
}) {
|
|
37
|
+
return /* @__PURE__ */ o(
|
|
38
|
+
i ? s : "button",
|
|
39
|
+
{
|
|
40
|
+
"data-slot": "button",
|
|
41
|
+
className: d(c({ variant: r, size: t, className: e })),
|
|
42
|
+
...n
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
b as Button,
|
|
48
|
+
c as buttonVariants
|
|
49
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ClassProp } from 'class-variance-authority/types';
|
|
2
|
+
import { DayButton } from 'react-day-picker';
|
|
3
|
+
import { DayPicker } from 'react-day-picker';
|
|
4
|
+
import { JSX } from 'react/jsx-runtime';
|
|
5
|
+
import * as React_2 from 'react';
|
|
6
|
+
import { VariantProps } from 'class-variance-authority';
|
|
7
|
+
|
|
8
|
+
declare function Button({ className, variant, size, asChild, ...props }: React_2.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
}): JSX.Element;
|
|
11
|
+
|
|
12
|
+
declare const buttonVariants: (props?: ({
|
|
13
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
14
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
15
|
+
} & ClassProp) | undefined) => string;
|
|
16
|
+
|
|
17
|
+
export declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }: React_2.ComponentProps<typeof DayPicker> & {
|
|
18
|
+
buttonVariant?: React_2.ComponentProps<typeof Button>["variant"];
|
|
19
|
+
}): JSX.Element;
|
|
20
|
+
|
|
21
|
+
export declare function CalendarDayButton({ className, day, modifiers, ...props }: React_2.ComponentProps<typeof DayButton>): JSX.Element;
|
|
22
|
+
|
|
23
|
+
export { }
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import * as m from "react";
|
|
3
|
+
import { ChevronLeftIcon as b, ChevronRightIcon as w, ChevronDownIcon as _ } from "lucide-react";
|
|
4
|
+
import { getDefaultClassNames as p, DayPicker as h } from "react-day-picker";
|
|
5
|
+
import { c as e } from "./utils-B7J70Nno.js";
|
|
6
|
+
import { buttonVariants as f, Button as y } from "./button.mjs";
|
|
7
|
+
function j({
|
|
8
|
+
className: i,
|
|
9
|
+
classNames: g,
|
|
10
|
+
showOutsideDays: r = !0,
|
|
11
|
+
captionLayout: s = "label",
|
|
12
|
+
buttonVariant: l = "ghost",
|
|
13
|
+
formatters: u,
|
|
14
|
+
components: c,
|
|
15
|
+
...x
|
|
16
|
+
}) {
|
|
17
|
+
const t = p();
|
|
18
|
+
return /* @__PURE__ */ n(
|
|
19
|
+
h,
|
|
20
|
+
{
|
|
21
|
+
showOutsideDays: r,
|
|
22
|
+
className: e(
|
|
23
|
+
"bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
24
|
+
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
25
|
+
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
26
|
+
i
|
|
27
|
+
),
|
|
28
|
+
captionLayout: s,
|
|
29
|
+
formatters: {
|
|
30
|
+
formatMonthDropdown: (a) => a.toLocaleString("default", { month: "short" }),
|
|
31
|
+
...u
|
|
32
|
+
},
|
|
33
|
+
classNames: {
|
|
34
|
+
root: e("w-fit", t.root),
|
|
35
|
+
months: e(
|
|
36
|
+
"flex gap-4 flex-col md:flex-row relative",
|
|
37
|
+
t.months
|
|
38
|
+
),
|
|
39
|
+
month: e("flex flex-col w-full gap-4", t.month),
|
|
40
|
+
nav: e(
|
|
41
|
+
"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",
|
|
42
|
+
t.nav
|
|
43
|
+
),
|
|
44
|
+
button_previous: e(
|
|
45
|
+
f({ variant: l }),
|
|
46
|
+
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
47
|
+
t.button_previous
|
|
48
|
+
),
|
|
49
|
+
button_next: e(
|
|
50
|
+
f({ variant: l }),
|
|
51
|
+
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
52
|
+
t.button_next
|
|
53
|
+
),
|
|
54
|
+
month_caption: e(
|
|
55
|
+
"flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",
|
|
56
|
+
t.month_caption
|
|
57
|
+
),
|
|
58
|
+
dropdowns: e(
|
|
59
|
+
"w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",
|
|
60
|
+
t.dropdowns
|
|
61
|
+
),
|
|
62
|
+
dropdown_root: e(
|
|
63
|
+
"relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",
|
|
64
|
+
t.dropdown_root
|
|
65
|
+
),
|
|
66
|
+
dropdown: e(
|
|
67
|
+
"absolute bg-popover inset-0 opacity-0",
|
|
68
|
+
t.dropdown
|
|
69
|
+
),
|
|
70
|
+
caption_label: e(
|
|
71
|
+
"select-none font-medium",
|
|
72
|
+
s === "label" ? "text-sm" : "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",
|
|
73
|
+
t.caption_label
|
|
74
|
+
),
|
|
75
|
+
table: "w-full border-collapse",
|
|
76
|
+
weekdays: e("flex", t.weekdays),
|
|
77
|
+
weekday: e(
|
|
78
|
+
"text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",
|
|
79
|
+
t.weekday
|
|
80
|
+
),
|
|
81
|
+
week: e("flex w-full mt-2", t.week),
|
|
82
|
+
week_number_header: e(
|
|
83
|
+
"select-none w-(--cell-size)",
|
|
84
|
+
t.week_number_header
|
|
85
|
+
),
|
|
86
|
+
week_number: e(
|
|
87
|
+
"text-[0.8rem] select-none text-muted-foreground",
|
|
88
|
+
t.week_number
|
|
89
|
+
),
|
|
90
|
+
day: e(
|
|
91
|
+
"relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",
|
|
92
|
+
t.day
|
|
93
|
+
),
|
|
94
|
+
range_start: e(
|
|
95
|
+
"rounded-l-md bg-accent",
|
|
96
|
+
t.range_start
|
|
97
|
+
),
|
|
98
|
+
range_middle: e("rounded-none", t.range_middle),
|
|
99
|
+
range_end: e("rounded-r-md bg-accent", t.range_end),
|
|
100
|
+
today: e(
|
|
101
|
+
"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
|
|
102
|
+
t.today
|
|
103
|
+
),
|
|
104
|
+
outside: e(
|
|
105
|
+
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
106
|
+
t.outside
|
|
107
|
+
),
|
|
108
|
+
disabled: e(
|
|
109
|
+
"text-muted-foreground opacity-50",
|
|
110
|
+
t.disabled
|
|
111
|
+
),
|
|
112
|
+
hidden: e("invisible", t.hidden),
|
|
113
|
+
...g
|
|
114
|
+
},
|
|
115
|
+
components: {
|
|
116
|
+
Root: ({ className: a, rootRef: d, ...o }) => /* @__PURE__ */ n(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
"data-slot": "calendar",
|
|
120
|
+
ref: d,
|
|
121
|
+
className: e(a),
|
|
122
|
+
...o
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
Chevron: ({ className: a, orientation: d, ...o }) => d === "left" ? /* @__PURE__ */ n(b, { className: e("size-4", a), ...o }) : d === "right" ? /* @__PURE__ */ n(
|
|
126
|
+
w,
|
|
127
|
+
{
|
|
128
|
+
className: e("size-4", a),
|
|
129
|
+
...o
|
|
130
|
+
}
|
|
131
|
+
) : /* @__PURE__ */ n(_, { className: e("size-4", a), ...o }),
|
|
132
|
+
DayButton: v,
|
|
133
|
+
WeekNumber: ({ children: a, ...d }) => /* @__PURE__ */ n("td", { ...d, children: /* @__PURE__ */ n("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: a }) }),
|
|
134
|
+
...c
|
|
135
|
+
},
|
|
136
|
+
...x
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
function v({
|
|
141
|
+
className: i,
|
|
142
|
+
day: g,
|
|
143
|
+
modifiers: r,
|
|
144
|
+
...s
|
|
145
|
+
}) {
|
|
146
|
+
const l = p(), u = m.useRef(null);
|
|
147
|
+
return m.useEffect(() => {
|
|
148
|
+
var c;
|
|
149
|
+
r.focused && ((c = u.current) == null || c.focus());
|
|
150
|
+
}, [r.focused]), /* @__PURE__ */ n(
|
|
151
|
+
y,
|
|
152
|
+
{
|
|
153
|
+
ref: u,
|
|
154
|
+
variant: "ghost",
|
|
155
|
+
size: "icon",
|
|
156
|
+
"data-day": g.date.toLocaleDateString(),
|
|
157
|
+
"data-selected-single": r.selected && !r.range_start && !r.range_end && !r.range_middle,
|
|
158
|
+
"data-range-start": r.range_start,
|
|
159
|
+
"data-range-end": r.range_end,
|
|
160
|
+
"data-range-middle": r.range_middle,
|
|
161
|
+
className: e(
|
|
162
|
+
"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
|
|
163
|
+
l.day,
|
|
164
|
+
i
|
|
165
|
+
),
|
|
166
|
+
...s
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
export {
|
|
171
|
+
j as Calendar,
|
|
172
|
+
v as CalendarDayButton
|
|
173
|
+
};
|
package/dist/card.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
import * as React_2 from 'react';
|
|
3
|
+
|
|
4
|
+
export declare function Card({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
5
|
+
|
|
6
|
+
export declare function CardAction({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
7
|
+
|
|
8
|
+
export declare function CardContent({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
9
|
+
|
|
10
|
+
export declare function CardDescription({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
11
|
+
|
|
12
|
+
export declare function CardFooter({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
13
|
+
|
|
14
|
+
export declare function CardHeader({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
15
|
+
|
|
16
|
+
export declare function CardTitle({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { }
|
package/dist/card.mjs
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { c as o } from "./utils-B7J70Nno.js";
|
|
3
|
+
function n({ className: t, ...a }) {
|
|
4
|
+
return /* @__PURE__ */ r(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
"data-slot": "card",
|
|
8
|
+
className: o(
|
|
9
|
+
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
|
|
10
|
+
t
|
|
11
|
+
),
|
|
12
|
+
...a
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
function s({ className: t, ...a }) {
|
|
17
|
+
return /* @__PURE__ */ r(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
"data-slot": "card-header",
|
|
21
|
+
className: o(
|
|
22
|
+
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
23
|
+
t
|
|
24
|
+
),
|
|
25
|
+
...a
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
function c({ className: t, ...a }) {
|
|
30
|
+
return /* @__PURE__ */ r(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
"data-slot": "card-title",
|
|
34
|
+
className: o("leading-none font-semibold", t),
|
|
35
|
+
...a
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
function i({ className: t, ...a }) {
|
|
40
|
+
return /* @__PURE__ */ r(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
"data-slot": "card-description",
|
|
44
|
+
className: o("text-muted-foreground text-sm", t),
|
|
45
|
+
...a
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
function l({ className: t, ...a }) {
|
|
50
|
+
return /* @__PURE__ */ r(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
"data-slot": "card-action",
|
|
54
|
+
className: o(
|
|
55
|
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
56
|
+
t
|
|
57
|
+
),
|
|
58
|
+
...a
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
function u({ className: t, ...a }) {
|
|
63
|
+
return /* @__PURE__ */ r(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
"data-slot": "card-content",
|
|
67
|
+
className: o("px-6", t),
|
|
68
|
+
...a
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
function f({ className: t, ...a }) {
|
|
73
|
+
return /* @__PURE__ */ r(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
"data-slot": "card-footer",
|
|
77
|
+
className: o("flex items-center px-6 [.border-t]:pt-6", t),
|
|
78
|
+
...a
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
n as Card,
|
|
84
|
+
l as CardAction,
|
|
85
|
+
u as CardContent,
|
|
86
|
+
i as CardDescription,
|
|
87
|
+
f as CardFooter,
|
|
88
|
+
s as CardHeader,
|
|
89
|
+
c as CardTitle
|
|
90
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ClassProp } from 'class-variance-authority/types';
|
|
2
|
+
import { default as default_2 } from 'embla-carousel-react';
|
|
3
|
+
import { JSX } from 'react/jsx-runtime';
|
|
4
|
+
import * as React_2 from 'react';
|
|
5
|
+
import { UseEmblaCarouselType } from 'embla-carousel-react';
|
|
6
|
+
import { VariantProps } from 'class-variance-authority';
|
|
7
|
+
|
|
8
|
+
declare function Button({ className, variant, size, asChild, ...props }: React_2.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
}): JSX.Element;
|
|
11
|
+
|
|
12
|
+
declare const buttonVariants: (props?: ({
|
|
13
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
14
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
15
|
+
} & ClassProp) | undefined) => string;
|
|
16
|
+
|
|
17
|
+
export declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React_2.ComponentProps<"div"> & CarouselProps): JSX.Element;
|
|
18
|
+
|
|
19
|
+
export declare type CarouselApi = UseEmblaCarouselType[1];
|
|
20
|
+
|
|
21
|
+
export declare function CarouselContent({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
22
|
+
|
|
23
|
+
export declare function CarouselItem({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
|
|
24
|
+
|
|
25
|
+
export declare function CarouselNext({ className, variant, size, ...props }: React_2.ComponentProps<typeof Button>): JSX.Element;
|
|
26
|
+
|
|
27
|
+
declare type CarouselOptions = UseCarouselParameters[0];
|
|
28
|
+
|
|
29
|
+
declare type CarouselPlugin = UseCarouselParameters[1];
|
|
30
|
+
|
|
31
|
+
export declare function CarouselPrevious({ className, variant, size, ...props }: React_2.ComponentProps<typeof Button>): JSX.Element;
|
|
32
|
+
|
|
33
|
+
declare type CarouselProps = {
|
|
34
|
+
opts?: CarouselOptions;
|
|
35
|
+
plugins?: CarouselPlugin;
|
|
36
|
+
orientation?: "horizontal" | "vertical";
|
|
37
|
+
setApi?: (api: CarouselApi) => void;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
declare type UseCarouselParameters = Parameters<typeof default_2>;
|
|
41
|
+
|
|
42
|
+
export { }
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { jsx as n, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
import z from "embla-carousel-react";
|
|
4
|
+
import { ArrowLeft as g, ArrowRight as p } from "lucide-react";
|
|
5
|
+
import { c as d } from "./utils-B7J70Nno.js";
|
|
6
|
+
import { Button as v } from "./button.mjs";
|
|
7
|
+
const N = l.createContext(null);
|
|
8
|
+
function m() {
|
|
9
|
+
const o = l.useContext(N);
|
|
10
|
+
if (!o)
|
|
11
|
+
throw new Error("useCarousel must be used within a <Carousel />");
|
|
12
|
+
return o;
|
|
13
|
+
}
|
|
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()));
|
|
31
|
+
}, []), x = l.useCallback(() => {
|
|
32
|
+
e == null || e.scrollPrev();
|
|
33
|
+
}, [e]), C = l.useCallback(() => {
|
|
34
|
+
e == null || e.scrollNext();
|
|
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
|
+
);
|
|
41
|
+
return l.useEffect(() => {
|
|
42
|
+
!e || !t || t(e);
|
|
43
|
+
}, [e, t]), l.useEffect(() => {
|
|
44
|
+
if (e)
|
|
45
|
+
return f(e), e.on("reInit", f), e.on("select", f), () => {
|
|
46
|
+
e == null || e.off("select", f);
|
|
47
|
+
};
|
|
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
|
+
);
|
|
75
|
+
}
|
|
76
|
+
function K({ className: o, ...r }) {
|
|
77
|
+
const { carouselRef: t, orientation: s } = m();
|
|
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
|
+
);
|
|
97
|
+
}
|
|
98
|
+
function L({ className: o, ...r }) {
|
|
99
|
+
const { orientation: t } = m();
|
|
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
|
+
);
|
|
114
|
+
}
|
|
115
|
+
function B({
|
|
116
|
+
className: o,
|
|
117
|
+
variant: r = "outline",
|
|
118
|
+
size: t = "icon",
|
|
119
|
+
...s
|
|
120
|
+
}) {
|
|
121
|
+
const { orientation: c, scrollPrev: i, canScrollPrev: u } = m();
|
|
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
|
+
);
|
|
142
|
+
}
|
|
143
|
+
function q({
|
|
144
|
+
className: o,
|
|
145
|
+
variant: r = "outline",
|
|
146
|
+
size: t = "icon",
|
|
147
|
+
...s
|
|
148
|
+
}) {
|
|
149
|
+
const { orientation: c, scrollNext: i, canScrollNext: u } = m();
|
|
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
|
+
);
|
|
170
|
+
}
|
|
171
|
+
export {
|
|
172
|
+
I as Carousel,
|
|
173
|
+
K as CarouselContent,
|
|
174
|
+
L as CarouselItem,
|
|
175
|
+
q as CarouselNext,
|
|
176
|
+
B as CarouselPrevious
|
|
177
|
+
};
|