@pixpilot/shadcn 0.3.0 → 0.3.2
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/_virtual/rolldown_runtime.cjs +25 -1
- package/dist/components/index.cjs +30 -1
- package/dist/components/index.js +30 -1
- package/dist/components/ui/OrContinueWithSeparator.cjs +30 -1
- package/dist/components/ui/OrContinueWithSeparator.js +27 -1
- package/dist/components/ui/alert-dialog.cjs +101 -1
- package/dist/components/ui/alert-dialog.js +87 -1
- package/dist/components/ui/alert.cjs +45 -1
- package/dist/components/ui/alert.d.cts +4 -4
- package/dist/components/ui/alert.js +39 -1
- package/dist/components/ui/avatar.cjs +37 -1
- package/dist/components/ui/avatar.js +31 -1
- package/dist/components/ui/badge.cjs +33 -1
- package/dist/components/ui/badge.js +27 -1
- package/dist/components/ui/button.cjs +52 -1
- package/dist/components/ui/button.js +46 -1
- package/dist/components/ui/calendar.cjs +113 -1
- package/dist/components/ui/calendar.js +107 -1
- package/dist/components/ui/card.cjs +67 -1
- package/dist/components/ui/card.js +58 -1
- package/dist/components/ui/checkbox.cjs +31 -1
- package/dist/components/ui/checkbox.js +26 -1
- package/dist/components/ui/command.cjs +104 -1
- package/dist/components/ui/command.js +91 -1
- package/dist/components/ui/dialog.cjs +102 -1
- package/dist/components/ui/dialog.js +88 -1
- package/dist/components/ui/dropdown-menu.cjs +144 -1
- package/dist/components/ui/dropdown-menu.js +125 -1
- package/dist/components/ui/file-upload.cjs +926 -1
- package/dist/components/ui/file-upload.js +910 -1
- package/dist/components/ui/form.cjs +101 -1
- package/dist/components/ui/form.js +89 -1
- package/dist/components/ui/index.cjs +29 -1
- package/dist/components/ui/index.js +29 -1
- package/dist/components/ui/input.cjs +20 -1
- package/dist/components/ui/input.js +17 -1
- package/dist/components/ui/label.cjs +21 -1
- package/dist/components/ui/label.js +17 -1
- package/dist/components/ui/pagination.cjs +92 -1
- package/dist/components/ui/pagination.js +82 -1
- package/dist/components/ui/popover.cjs +44 -1
- package/dist/components/ui/popover.js +37 -1
- package/dist/components/ui/radio-group.cjs +36 -1
- package/dist/components/ui/radio-group.js +30 -1
- package/dist/components/ui/select.cjs +116 -1
- package/dist/components/ui/select.js +102 -1
- package/dist/components/ui/separator.cjs +23 -1
- package/dist/components/ui/separator.js +19 -1
- package/dist/components/ui/shadcn-io/tags/index.cjs +146 -1
- package/dist/components/ui/shadcn-io/tags/index.js +134 -1
- package/dist/components/ui/shadcn-io/tags-input-inline/index.cjs +66 -1
- package/dist/components/ui/shadcn-io/tags-input-inline/index.js +57 -1
- package/dist/components/ui/sheet.cjs +96 -1
- package/dist/components/ui/sheet.js +84 -1
- package/dist/components/ui/slider.cjs +42 -1
- package/dist/components/ui/slider.js +38 -1
- package/dist/components/ui/switch.cjs +28 -1
- package/dist/components/ui/switch.js +24 -1
- package/dist/components/ui/tabs.cjs +45 -1
- package/dist/components/ui/tabs.js +38 -1
- package/dist/components/ui/textarea.cjs +19 -1
- package/dist/components/ui/textarea.js +16 -1
- package/dist/components/ui/tooltip.cjs +45 -1
- package/dist/components/ui/tooltip.d.cts +5 -5
- package/dist/components/ui/tooltip.js +38 -1
- package/dist/index.cjs +189 -1
- package/dist/index.js +34 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/lib/utils.cjs +13 -1
- package/dist/lib/utils.js +10 -1
- package/package.json +1 -1
|
@@ -1 +1,52 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_utils = require('../../lib/utils.cjs');
|
|
3
|
+
require('../../lib/index.cjs');
|
|
4
|
+
let class_variance_authority = require("class-variance-authority");
|
|
5
|
+
class_variance_authority = require_rolldown_runtime.__toESM(class_variance_authority);
|
|
6
|
+
let react = require("react");
|
|
7
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
10
|
+
let __radix_ui_react_slot = require("@radix-ui/react-slot");
|
|
11
|
+
__radix_ui_react_slot = require_rolldown_runtime.__toESM(__radix_ui_react_slot);
|
|
12
|
+
|
|
13
|
+
//#region src/components/ui/button.tsx
|
|
14
|
+
const buttonVariants = (0, class_variance_authority.cva)("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", {
|
|
15
|
+
variants: {
|
|
16
|
+
variant: {
|
|
17
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
18
|
+
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
19
|
+
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",
|
|
20
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
21
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
22
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
23
|
+
},
|
|
24
|
+
size: {
|
|
25
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
26
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
27
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
28
|
+
icon: "size-9",
|
|
29
|
+
"icon-sm": "size-8",
|
|
30
|
+
"icon-lg": "size-10"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
defaultVariants: {
|
|
34
|
+
variant: "default",
|
|
35
|
+
size: "default"
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
function Button({ className, variant, size, asChild = false,...props }) {
|
|
39
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(asChild ? __radix_ui_react_slot.Slot : "button", {
|
|
40
|
+
"data-slot": "button",
|
|
41
|
+
className: require_utils.cn(buttonVariants({
|
|
42
|
+
variant,
|
|
43
|
+
size,
|
|
44
|
+
className
|
|
45
|
+
})),
|
|
46
|
+
...props
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
exports.Button = Button;
|
|
52
|
+
exports.buttonVariants = buttonVariants;
|
|
@@ -1 +1,46 @@
|
|
|
1
|
-
import{cn
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import "../../lib/index.js";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
7
|
+
|
|
8
|
+
//#region src/components/ui/button.tsx
|
|
9
|
+
const buttonVariants = cva("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", {
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
13
|
+
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
14
|
+
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",
|
|
15
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
16
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
17
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
21
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
22
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
23
|
+
icon: "size-9",
|
|
24
|
+
"icon-sm": "size-8",
|
|
25
|
+
"icon-lg": "size-10"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
defaultVariants: {
|
|
29
|
+
variant: "default",
|
|
30
|
+
size: "default"
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
function Button({ className, variant, size, asChild = false,...props }) {
|
|
34
|
+
return /* @__PURE__ */ jsx(asChild ? Slot : "button", {
|
|
35
|
+
"data-slot": "button",
|
|
36
|
+
className: cn(buttonVariants({
|
|
37
|
+
variant,
|
|
38
|
+
size,
|
|
39
|
+
className
|
|
40
|
+
})),
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
export { Button, buttonVariants };
|
|
@@ -1 +1,113 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_utils = require('../../lib/utils.cjs');
|
|
3
|
+
require('../../lib/index.cjs');
|
|
4
|
+
const require_button = require('./button.cjs');
|
|
5
|
+
let react = require("react");
|
|
6
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
9
|
+
let lucide_react = require("lucide-react");
|
|
10
|
+
lucide_react = require_rolldown_runtime.__toESM(lucide_react);
|
|
11
|
+
let react_day_picker = require("react-day-picker");
|
|
12
|
+
react_day_picker = require_rolldown_runtime.__toESM(react_day_picker);
|
|
13
|
+
|
|
14
|
+
//#region src/components/ui/calendar.tsx
|
|
15
|
+
function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", formatters, components,...props }) {
|
|
16
|
+
const defaultClassNames = (0, react_day_picker.getDefaultClassNames)();
|
|
17
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_day_picker.DayPicker, {
|
|
18
|
+
showOutsideDays,
|
|
19
|
+
className: require_utils.cn("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent", String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className),
|
|
20
|
+
captionLayout,
|
|
21
|
+
formatters: {
|
|
22
|
+
formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
|
|
23
|
+
...formatters
|
|
24
|
+
},
|
|
25
|
+
classNames: {
|
|
26
|
+
root: require_utils.cn("w-fit", defaultClassNames.root),
|
|
27
|
+
months: require_utils.cn("flex gap-4 flex-col md:flex-row relative", defaultClassNames.months),
|
|
28
|
+
month: require_utils.cn("flex flex-col w-full gap-4", defaultClassNames.month),
|
|
29
|
+
nav: require_utils.cn("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between", defaultClassNames.nav),
|
|
30
|
+
button_previous: require_utils.cn(require_button.buttonVariants({ variant: buttonVariant }), "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none", defaultClassNames.button_previous),
|
|
31
|
+
button_next: require_utils.cn(require_button.buttonVariants({ variant: buttonVariant }), "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none", defaultClassNames.button_next),
|
|
32
|
+
month_caption: require_utils.cn("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)", defaultClassNames.month_caption),
|
|
33
|
+
dropdowns: require_utils.cn("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5", defaultClassNames.dropdowns),
|
|
34
|
+
dropdown_root: require_utils.cn("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md", defaultClassNames.dropdown_root),
|
|
35
|
+
dropdown: require_utils.cn("absolute bg-popover inset-0 opacity-0", defaultClassNames.dropdown),
|
|
36
|
+
caption_label: require_utils.cn("select-none font-medium", captionLayout === "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", defaultClassNames.caption_label),
|
|
37
|
+
table: "w-full border-collapse",
|
|
38
|
+
weekdays: require_utils.cn("flex", defaultClassNames.weekdays),
|
|
39
|
+
weekday: require_utils.cn("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none", defaultClassNames.weekday),
|
|
40
|
+
week: require_utils.cn("flex w-full mt-2", defaultClassNames.week),
|
|
41
|
+
week_number_header: require_utils.cn("select-none w-(--cell-size)", defaultClassNames.week_number_header),
|
|
42
|
+
week_number: require_utils.cn("text-[0.8rem] select-none text-muted-foreground", defaultClassNames.week_number),
|
|
43
|
+
day: require_utils.cn("relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none", props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md" : "[&:first-child[data-selected=true]_button]:rounded-l-md", defaultClassNames.day),
|
|
44
|
+
range_start: require_utils.cn("rounded-l-md bg-accent", defaultClassNames.range_start),
|
|
45
|
+
range_middle: require_utils.cn("rounded-none", defaultClassNames.range_middle),
|
|
46
|
+
range_end: require_utils.cn("rounded-r-md bg-accent", defaultClassNames.range_end),
|
|
47
|
+
today: require_utils.cn("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none", defaultClassNames.today),
|
|
48
|
+
outside: require_utils.cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
|
|
49
|
+
disabled: require_utils.cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
|
|
50
|
+
hidden: require_utils.cn("invisible", defaultClassNames.hidden),
|
|
51
|
+
...classNames
|
|
52
|
+
},
|
|
53
|
+
components: {
|
|
54
|
+
Root: ({ className: className$1, rootRef,...props$1 }) => {
|
|
55
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
56
|
+
"data-slot": "calendar",
|
|
57
|
+
ref: rootRef,
|
|
58
|
+
className: require_utils.cn(className$1),
|
|
59
|
+
...props$1
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
Chevron: ({ className: className$1, orientation,...props$1 }) => {
|
|
63
|
+
if (orientation === "left") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronLeftIcon, {
|
|
64
|
+
className: require_utils.cn("size-4", className$1),
|
|
65
|
+
...props$1
|
|
66
|
+
});
|
|
67
|
+
if (orientation === "right") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronRightIcon, {
|
|
68
|
+
className: require_utils.cn("size-4", className$1),
|
|
69
|
+
...props$1
|
|
70
|
+
});
|
|
71
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.ChevronDownIcon, {
|
|
72
|
+
className: require_utils.cn("size-4", className$1),
|
|
73
|
+
...props$1
|
|
74
|
+
});
|
|
75
|
+
},
|
|
76
|
+
DayButton: CalendarDayButton,
|
|
77
|
+
WeekNumber: ({ children,...props$1 }) => {
|
|
78
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
79
|
+
...props$1,
|
|
80
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
81
|
+
className: "flex size-(--cell-size) items-center justify-center text-center",
|
|
82
|
+
children
|
|
83
|
+
})
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
...components
|
|
87
|
+
},
|
|
88
|
+
...props
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function CalendarDayButton({ className, day, modifiers,...props }) {
|
|
92
|
+
const defaultClassNames = (0, react_day_picker.getDefaultClassNames)();
|
|
93
|
+
const ref = react.useRef(null);
|
|
94
|
+
react.useEffect(() => {
|
|
95
|
+
if (modifiers.focused) ref.current?.focus();
|
|
96
|
+
}, [modifiers.focused]);
|
|
97
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_button.Button, {
|
|
98
|
+
ref,
|
|
99
|
+
variant: "ghost",
|
|
100
|
+
size: "icon",
|
|
101
|
+
"data-day": day.date.toLocaleDateString(),
|
|
102
|
+
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
103
|
+
"data-range-start": modifiers.range_start,
|
|
104
|
+
"data-range-end": modifiers.range_end,
|
|
105
|
+
"data-range-middle": modifiers.range_middle,
|
|
106
|
+
className: require_utils.cn("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", defaultClassNames.day, className),
|
|
107
|
+
...props
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
//#endregion
|
|
112
|
+
exports.Calendar = Calendar;
|
|
113
|
+
exports.CalendarDayButton = CalendarDayButton;
|
|
@@ -1 +1,107 @@
|
|
|
1
|
-
import{cn
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import "../../lib/index.js";
|
|
3
|
+
import { Button, buttonVariants } from "./button.js";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
7
|
+
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
8
|
+
|
|
9
|
+
//#region src/components/ui/calendar.tsx
|
|
10
|
+
function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", formatters, components,...props }) {
|
|
11
|
+
const defaultClassNames = getDefaultClassNames();
|
|
12
|
+
return /* @__PURE__ */ jsx(DayPicker, {
|
|
13
|
+
showOutsideDays,
|
|
14
|
+
className: cn("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent", String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className),
|
|
15
|
+
captionLayout,
|
|
16
|
+
formatters: {
|
|
17
|
+
formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
|
|
18
|
+
...formatters
|
|
19
|
+
},
|
|
20
|
+
classNames: {
|
|
21
|
+
root: cn("w-fit", defaultClassNames.root),
|
|
22
|
+
months: cn("flex gap-4 flex-col md:flex-row relative", defaultClassNames.months),
|
|
23
|
+
month: cn("flex flex-col w-full gap-4", defaultClassNames.month),
|
|
24
|
+
nav: cn("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between", defaultClassNames.nav),
|
|
25
|
+
button_previous: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none", defaultClassNames.button_previous),
|
|
26
|
+
button_next: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none", defaultClassNames.button_next),
|
|
27
|
+
month_caption: cn("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)", defaultClassNames.month_caption),
|
|
28
|
+
dropdowns: cn("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5", defaultClassNames.dropdowns),
|
|
29
|
+
dropdown_root: cn("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md", defaultClassNames.dropdown_root),
|
|
30
|
+
dropdown: cn("absolute bg-popover inset-0 opacity-0", defaultClassNames.dropdown),
|
|
31
|
+
caption_label: cn("select-none font-medium", captionLayout === "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", defaultClassNames.caption_label),
|
|
32
|
+
table: "w-full border-collapse",
|
|
33
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
34
|
+
weekday: cn("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none", defaultClassNames.weekday),
|
|
35
|
+
week: cn("flex w-full mt-2", defaultClassNames.week),
|
|
36
|
+
week_number_header: cn("select-none w-(--cell-size)", defaultClassNames.week_number_header),
|
|
37
|
+
week_number: cn("text-[0.8rem] select-none text-muted-foreground", defaultClassNames.week_number),
|
|
38
|
+
day: cn("relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none", props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md" : "[&:first-child[data-selected=true]_button]:rounded-l-md", defaultClassNames.day),
|
|
39
|
+
range_start: cn("rounded-l-md bg-accent", defaultClassNames.range_start),
|
|
40
|
+
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
41
|
+
range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
|
|
42
|
+
today: cn("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none", defaultClassNames.today),
|
|
43
|
+
outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
|
|
44
|
+
disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
|
|
45
|
+
hidden: cn("invisible", defaultClassNames.hidden),
|
|
46
|
+
...classNames
|
|
47
|
+
},
|
|
48
|
+
components: {
|
|
49
|
+
Root: ({ className: className$1, rootRef,...props$1 }) => {
|
|
50
|
+
return /* @__PURE__ */ jsx("div", {
|
|
51
|
+
"data-slot": "calendar",
|
|
52
|
+
ref: rootRef,
|
|
53
|
+
className: cn(className$1),
|
|
54
|
+
...props$1
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
Chevron: ({ className: className$1, orientation,...props$1 }) => {
|
|
58
|
+
if (orientation === "left") return /* @__PURE__ */ jsx(ChevronLeftIcon, {
|
|
59
|
+
className: cn("size-4", className$1),
|
|
60
|
+
...props$1
|
|
61
|
+
});
|
|
62
|
+
if (orientation === "right") return /* @__PURE__ */ jsx(ChevronRightIcon, {
|
|
63
|
+
className: cn("size-4", className$1),
|
|
64
|
+
...props$1
|
|
65
|
+
});
|
|
66
|
+
return /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
67
|
+
className: cn("size-4", className$1),
|
|
68
|
+
...props$1
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
DayButton: CalendarDayButton,
|
|
72
|
+
WeekNumber: ({ children,...props$1 }) => {
|
|
73
|
+
return /* @__PURE__ */ jsx("td", {
|
|
74
|
+
...props$1,
|
|
75
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
76
|
+
className: "flex size-(--cell-size) items-center justify-center text-center",
|
|
77
|
+
children
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
...components
|
|
82
|
+
},
|
|
83
|
+
...props
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function CalendarDayButton({ className, day, modifiers,...props }) {
|
|
87
|
+
const defaultClassNames = getDefaultClassNames();
|
|
88
|
+
const ref = React.useRef(null);
|
|
89
|
+
React.useEffect(() => {
|
|
90
|
+
if (modifiers.focused) ref.current?.focus();
|
|
91
|
+
}, [modifiers.focused]);
|
|
92
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
93
|
+
ref,
|
|
94
|
+
variant: "ghost",
|
|
95
|
+
size: "icon",
|
|
96
|
+
"data-day": day.date.toLocaleDateString(),
|
|
97
|
+
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
98
|
+
"data-range-start": modifiers.range_start,
|
|
99
|
+
"data-range-end": modifiers.range_end,
|
|
100
|
+
"data-range-middle": modifiers.range_middle,
|
|
101
|
+
className: cn("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", defaultClassNames.day, className),
|
|
102
|
+
...props
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
//#endregion
|
|
107
|
+
export { Calendar, CalendarDayButton };
|
|
@@ -1 +1,67 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_utils = require('../../lib/utils.cjs');
|
|
3
|
+
require('../../lib/index.cjs');
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
8
|
+
|
|
9
|
+
//#region src/components/ui/card.tsx
|
|
10
|
+
function Card({ className,...props }) {
|
|
11
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
12
|
+
"data-slot": "card",
|
|
13
|
+
className: require_utils.cn("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm", className),
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function CardHeader({ className,...props }) {
|
|
18
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
19
|
+
"data-slot": "card-header",
|
|
20
|
+
className: require_utils.cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className),
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function CardTitle({ className,...props }) {
|
|
25
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
26
|
+
"data-slot": "card-title",
|
|
27
|
+
className: require_utils.cn("leading-none font-semibold", className),
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function CardDescription({ className,...props }) {
|
|
32
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
33
|
+
"data-slot": "card-description",
|
|
34
|
+
className: require_utils.cn("text-muted-foreground text-sm", className),
|
|
35
|
+
...props
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function CardAction({ className,...props }) {
|
|
39
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
40
|
+
"data-slot": "card-action",
|
|
41
|
+
className: require_utils.cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
|
|
42
|
+
...props
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function CardContent({ className,...props }) {
|
|
46
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
47
|
+
"data-slot": "card-content",
|
|
48
|
+
className: require_utils.cn("px-6", className),
|
|
49
|
+
...props
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function CardFooter({ className,...props }) {
|
|
53
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
54
|
+
"data-slot": "card-footer",
|
|
55
|
+
className: require_utils.cn("flex items-center px-6 [.border-t]:pt-6", className),
|
|
56
|
+
...props
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
61
|
+
exports.Card = Card;
|
|
62
|
+
exports.CardAction = CardAction;
|
|
63
|
+
exports.CardContent = CardContent;
|
|
64
|
+
exports.CardDescription = CardDescription;
|
|
65
|
+
exports.CardFooter = CardFooter;
|
|
66
|
+
exports.CardHeader = CardHeader;
|
|
67
|
+
exports.CardTitle = CardTitle;
|
|
@@ -1 +1,58 @@
|
|
|
1
|
-
import{cn
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import "../../lib/index.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/ui/card.tsx
|
|
7
|
+
function Card({ className,...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx("div", {
|
|
9
|
+
"data-slot": "card",
|
|
10
|
+
className: cn("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm", className),
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function CardHeader({ className,...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx("div", {
|
|
16
|
+
"data-slot": "card-header",
|
|
17
|
+
className: cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className),
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function CardTitle({ className,...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx("div", {
|
|
23
|
+
"data-slot": "card-title",
|
|
24
|
+
className: cn("leading-none font-semibold", className),
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function CardDescription({ className,...props }) {
|
|
29
|
+
return /* @__PURE__ */ jsx("div", {
|
|
30
|
+
"data-slot": "card-description",
|
|
31
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function CardAction({ className,...props }) {
|
|
36
|
+
return /* @__PURE__ */ jsx("div", {
|
|
37
|
+
"data-slot": "card-action",
|
|
38
|
+
className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function CardContent({ className,...props }) {
|
|
43
|
+
return /* @__PURE__ */ jsx("div", {
|
|
44
|
+
"data-slot": "card-content",
|
|
45
|
+
className: cn("px-6", className),
|
|
46
|
+
...props
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function CardFooter({ className,...props }) {
|
|
50
|
+
return /* @__PURE__ */ jsx("div", {
|
|
51
|
+
"data-slot": "card-footer",
|
|
52
|
+
className: cn("flex items-center px-6 [.border-t]:pt-6", className),
|
|
53
|
+
...props
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
@@ -1 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
5
|
+
const require_utils = require('../../lib/utils.cjs');
|
|
6
|
+
require('../../lib/index.cjs');
|
|
7
|
+
let react = require("react");
|
|
8
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
11
|
+
let lucide_react = require("lucide-react");
|
|
12
|
+
lucide_react = require_rolldown_runtime.__toESM(lucide_react);
|
|
13
|
+
let __radix_ui_react_checkbox = require("@radix-ui/react-checkbox");
|
|
14
|
+
__radix_ui_react_checkbox = require_rolldown_runtime.__toESM(__radix_ui_react_checkbox);
|
|
15
|
+
|
|
16
|
+
//#region src/components/ui/checkbox.tsx
|
|
17
|
+
function Checkbox({ className,...props }) {
|
|
18
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_checkbox.Root, {
|
|
19
|
+
"data-slot": "checkbox",
|
|
20
|
+
className: require_utils.cn("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
21
|
+
...props,
|
|
22
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_checkbox.Indicator, {
|
|
23
|
+
"data-slot": "checkbox-indicator",
|
|
24
|
+
className: "grid place-content-center text-current transition-none",
|
|
25
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CheckIcon, { className: "size-3.5" })
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
exports.Checkbox = Checkbox;
|
|
@@ -1 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
import "../../lib/index.js";
|
|
6
|
+
import "react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import { CheckIcon } from "lucide-react";
|
|
9
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
10
|
+
|
|
11
|
+
//#region src/components/ui/checkbox.tsx
|
|
12
|
+
function Checkbox({ className,...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(CheckboxPrimitive.Root, {
|
|
14
|
+
"data-slot": "checkbox",
|
|
15
|
+
className: cn("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
16
|
+
...props,
|
|
17
|
+
children: /* @__PURE__ */ jsx(CheckboxPrimitive.Indicator, {
|
|
18
|
+
"data-slot": "checkbox-indicator",
|
|
19
|
+
className: "grid place-content-center text-current transition-none",
|
|
20
|
+
children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-3.5" })
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
export { Checkbox };
|