@deftui/react 0.0.0-stage → 0.0.1
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/index.d.mts +24 -0
- package/dist/index.mjs +24 -0
- package/dist/styles.css +88 -0
- package/dist/styles.shadcn.css +537 -0
- package/dist/styles.tokens.css +87 -0
- package/dist/vendor/coss/form.d.mts +4 -0
- package/dist/vendor/coss/form.mjs +12 -0
- package/dist/vendor/coss/hooks/use-copy-to-clipboard.d.mts +7 -0
- package/dist/vendor/coss/hooks/use-copy-to-clipboard.mjs +30 -0
- package/dist/vendor/coss/hooks/use-media-query.d.mts +20 -0
- package/dist/vendor/coss/hooks/use-media-query.mjs +57 -0
- package/dist/vendor/coss/scroll-area.d.mts +10 -0
- package/dist/vendor/coss/scroll-area.mjs +39 -0
- package/dist/vendor/shadcn/alert-dialog.d.mts +14 -0
- package/dist/vendor/shadcn/alert-dialog.mjs +80 -0
- package/dist/vendor/shadcn/badge.d.mts +7 -0
- package/dist/vendor/shadcn/badge.mjs +28 -0
- package/dist/vendor/shadcn/breadcrumb.d.mts +10 -0
- package/dist/vendor/shadcn/breadcrumb.mjs +71 -0
- package/dist/vendor/shadcn/button.d.mts +8 -0
- package/dist/vendor/shadcn/button.mjs +43 -0
- package/dist/vendor/shadcn/calendar.d.mts +7 -0
- package/dist/vendor/shadcn/calendar.mjs +107 -0
- package/dist/vendor/shadcn/card.d.mts +11 -0
- package/dist/vendor/shadcn/card.mjs +55 -0
- package/dist/vendor/shadcn/carousel.d.mts +19 -0
- package/dist/vendor/shadcn/carousel.mjs +131 -0
- package/dist/vendor/shadcn/combobox.d.mts +20 -0
- package/dist/vendor/shadcn/combobox.mjs +151 -0
- package/dist/vendor/shadcn/dialog.d.mts +15 -0
- package/dist/vendor/shadcn/dialog.mjs +91 -0
- package/dist/vendor/shadcn/drawer.d.mts +13 -0
- package/dist/vendor/shadcn/drawer.mjs +122 -0
- package/dist/vendor/shadcn/dropdown-menu.d.mts +28 -0
- package/dist/vendor/shadcn/dropdown-menu.mjs +130 -0
- package/dist/vendor/shadcn/empty.d.mts +11 -0
- package/dist/vendor/shadcn/empty.mjs +58 -0
- package/dist/vendor/shadcn/field.d.mts +14 -0
- package/dist/vendor/shadcn/field.mjs +60 -0
- package/dist/vendor/shadcn/input-group.d.mts +12 -0
- package/dist/vendor/shadcn/input-group.mjs +78 -0
- package/dist/vendor/shadcn/input.d.mts +3 -0
- package/dist/vendor/shadcn/input.mjs +14 -0
- package/dist/vendor/shadcn/kbd.d.mts +3 -0
- package/dist/vendor/shadcn/kbd.mjs +18 -0
- package/dist/vendor/shadcn/label.d.mts +3 -0
- package/dist/vendor/shadcn/label.mjs +13 -0
- package/dist/vendor/shadcn/lib/utils.mjs +1 -0
- package/dist/vendor/shadcn/pagination.d.mts +17 -0
- package/dist/vendor/shadcn/pagination.mjs +79 -0
- package/dist/vendor/shadcn/popover.d.mts +8 -0
- package/dist/vendor/shadcn/popover.mjs +47 -0
- package/dist/vendor/shadcn/progress.d.mts +7 -0
- package/dist/vendor/shadcn/progress.mjs +43 -0
- package/dist/vendor/shadcn/radio-group.d.mts +5 -0
- package/dist/vendor/shadcn/radio-group.mjs +26 -0
- package/dist/vendor/shadcn/select.d.mts +12 -0
- package/dist/vendor/shadcn/select.mjs +97 -0
- package/dist/vendor/shadcn/separator.d.mts +3 -0
- package/dist/vendor/shadcn/separator.mjs +14 -0
- package/dist/vendor/shadcn/sheet.mjs +69 -0
- package/dist/vendor/shadcn/sidebar.d.mts +60 -0
- package/dist/vendor/shadcn/sidebar.mjs +366 -0
- package/dist/vendor/shadcn/skeleton.mjs +3 -0
- package/dist/vendor/shadcn/spinner.d.mts +2 -0
- package/dist/vendor/shadcn/spinner.mjs +14 -0
- package/dist/vendor/shadcn/switch.d.mts +5 -0
- package/dist/vendor/shadcn/switch.mjs +18 -0
- package/dist/vendor/shadcn/table.d.mts +9 -0
- package/dist/vendor/shadcn/table.mjs +59 -0
- package/dist/vendor/shadcn/tabs.d.mts +10 -0
- package/dist/vendor/shadcn/tabs.mjs +44 -0
- package/dist/vendor/shadcn/textarea.d.mts +3 -0
- package/dist/vendor/shadcn/textarea.mjs +12 -0
- package/dist/vendor/shadcn/toast.d.mts +5 -0
- package/dist/vendor/shadcn/toast.mjs +122 -0
- package/dist/vendor/shadcn/tooltip.d.mts +5 -0
- package/dist/vendor/shadcn/tooltip.mjs +33 -0
- package/dist/vendor.css +1 -0
- package/dist/widgets/breadcrumb.d.mts +17 -0
- package/dist/widgets/breadcrumb.mjs +22 -0
- package/dist/widgets/datetime-picker.d.mts +25 -0
- package/dist/widgets/datetime-picker.mjs +75 -0
- package/dist/widgets/image-display.d.mts +12 -0
- package/dist/widgets/image-display.mjs +29 -0
- package/dist/widgets/index.d.mts +186 -0
- package/dist/widgets/index.mjs +187 -0
- package/dist/widgets/pagination.d.mts +10 -0
- package/dist/widgets/pagination.mjs +12 -0
- package/dist/widgets/sidebar.d.mts +26 -0
- package/dist/widgets/sidebar.mjs +27 -0
- package/dist/widgets/toast.d.mts +2 -0
- package/dist/widgets/toast.mjs +1 -0
- package/package.json +53 -4
- package/README.md +0 -3
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--background: oklch(1 0 0);
|
|
3
|
+
--foreground: oklch(0.145 0 0);
|
|
4
|
+
|
|
5
|
+
--ring: oklch(0.708 0 0);
|
|
6
|
+
--input: oklch(0.922 0 0);
|
|
7
|
+
--border: oklch(0.922 0 0);
|
|
8
|
+
|
|
9
|
+
--card: oklch(1 0 0);
|
|
10
|
+
--muted: oklch(0.97 0 0);
|
|
11
|
+
--accent: oklch(0.97 0 0);
|
|
12
|
+
--popover: oklch(1 0 0);
|
|
13
|
+
--primary: oklch(0.205 0 0);
|
|
14
|
+
--secondary: oklch(0.97 0 0);
|
|
15
|
+
|
|
16
|
+
--card-foreground: oklch(0.145 0 0);
|
|
17
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
18
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
19
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
20
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
21
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
22
|
+
|
|
23
|
+
--info: oklch(0.488 0.243 264.376);
|
|
24
|
+
--warning: oklch(0.555 0.163 48.998);
|
|
25
|
+
--success: oklch(0.527 0.154 150.069);
|
|
26
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
27
|
+
|
|
28
|
+
--chart-1: oklch(0.87 0 0);
|
|
29
|
+
--chart-2: oklch(0.556 0 0);
|
|
30
|
+
--chart-3: oklch(0.439 0 0);
|
|
31
|
+
--chart-4: oklch(0.371 0 0);
|
|
32
|
+
--chart-5: oklch(0.269 0 0);
|
|
33
|
+
|
|
34
|
+
--sidebar: oklch(0.985 0 0);
|
|
35
|
+
--sidebar-ring: oklch(0.708 0 0);
|
|
36
|
+
--sidebar-accent: oklch(0.97 0 0);
|
|
37
|
+
--sidebar-border: oklch(0.922 0 0);
|
|
38
|
+
--sidebar-primary: oklch(0.205 0 0);
|
|
39
|
+
--sidebar-foreground: oklch(0.145 0 0);
|
|
40
|
+
--sidebar-accent-foreground: oklch(0.205 0 0);
|
|
41
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
42
|
+
|
|
43
|
+
--radius: 0.625rem;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.dark {
|
|
47
|
+
--background: oklch(0.145 0 0);
|
|
48
|
+
--foreground: oklch(0.985 0 0);
|
|
49
|
+
|
|
50
|
+
--ring: oklch(0.556 0 0);
|
|
51
|
+
--input: oklch(1 0 0 / 15%);
|
|
52
|
+
--border: oklch(1 0 0 / 10%);
|
|
53
|
+
|
|
54
|
+
--card: oklch(0.205 0 0);
|
|
55
|
+
--muted: oklch(0.269 0 0);
|
|
56
|
+
--accent: oklch(0.269 0 0);
|
|
57
|
+
--popover: oklch(0.205 0 0);
|
|
58
|
+
--primary: oklch(0.922 0 0);
|
|
59
|
+
--secondary: oklch(0.269 0 0);
|
|
60
|
+
|
|
61
|
+
--card-foreground: oklch(0.985 0 0);
|
|
62
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
63
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
64
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
65
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
66
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
67
|
+
|
|
68
|
+
--info: oklch(0.707 0.165 254.624);
|
|
69
|
+
--warning: oklch(0.828 0.189 84.429);
|
|
70
|
+
--success: oklch(0.792 0.209 151.711);
|
|
71
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
72
|
+
|
|
73
|
+
--chart-1: oklch(0.87 0 0);
|
|
74
|
+
--chart-2: oklch(0.556 0 0);
|
|
75
|
+
--chart-3: oklch(0.439 0 0);
|
|
76
|
+
--chart-4: oklch(0.371 0 0);
|
|
77
|
+
--chart-5: oklch(0.269 0 0);
|
|
78
|
+
|
|
79
|
+
--sidebar: oklch(0.205 0 0);
|
|
80
|
+
--sidebar-ring: oklch(0.556 0 0);
|
|
81
|
+
--sidebar-accent: oklch(0.269 0 0);
|
|
82
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
83
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
84
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
85
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
86
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
87
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Form as FormPrimitive } from "@base-ui/react/form";
|
|
4
|
+
// src/vendor/coss/form.tsx
|
|
5
|
+
function Form({ className, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(FormPrimitive, {
|
|
7
|
+
className,
|
|
8
|
+
"data-slot": "form",
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export { Form, FormPrimitive };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
// src/vendor/coss/hooks/use-copy-to-clipboard.ts
|
|
4
|
+
function useCopyToClipboard({ timeout = 2e3, onCopy } = {}) {
|
|
5
|
+
const [isCopied, setIsCopied] = React$1.useState(false);
|
|
6
|
+
const timeoutIdRef = React$1.useRef(null);
|
|
7
|
+
const copyToClipboard = (value) => {
|
|
8
|
+
if (typeof window === "undefined" || !navigator.clipboard.writeText) return;
|
|
9
|
+
if (!value) return;
|
|
10
|
+
navigator.clipboard.writeText(value).then(() => {
|
|
11
|
+
if (timeoutIdRef.current) clearTimeout(timeoutIdRef.current);
|
|
12
|
+
setIsCopied(true);
|
|
13
|
+
if (onCopy) onCopy();
|
|
14
|
+
if (timeout !== 0) timeoutIdRef.current = setTimeout(() => {
|
|
15
|
+
setIsCopied(false);
|
|
16
|
+
timeoutIdRef.current = null;
|
|
17
|
+
}, timeout);
|
|
18
|
+
}, console.error);
|
|
19
|
+
};
|
|
20
|
+
React$1.useEffect(() => {
|
|
21
|
+
return () => {
|
|
22
|
+
if (timeoutIdRef.current) clearTimeout(timeoutIdRef.current);
|
|
23
|
+
};
|
|
24
|
+
}, []);
|
|
25
|
+
return {
|
|
26
|
+
copyToClipboard,
|
|
27
|
+
isCopied
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export { useCopyToClipboard };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const BREAKPOINTS: {
|
|
2
|
+
readonly "2xl": 1536;
|
|
3
|
+
readonly "3xl": 1600;
|
|
4
|
+
readonly "4xl": 2000;
|
|
5
|
+
readonly lg: 1024;
|
|
6
|
+
readonly md: 768;
|
|
7
|
+
readonly sm: 640;
|
|
8
|
+
readonly xl: 1280;
|
|
9
|
+
};
|
|
10
|
+
type Breakpoint = keyof typeof BREAKPOINTS;
|
|
11
|
+
type BreakpointQuery = Breakpoint | `max-${Breakpoint}` | `${Breakpoint}:max-${Breakpoint}`;
|
|
12
|
+
export type MediaQueryInput = {
|
|
13
|
+
min?: Breakpoint | number;
|
|
14
|
+
max?: Breakpoint | number;
|
|
15
|
+
/** Touch-like input (finger). Use "fine" for mouse/trackpad. */
|
|
16
|
+
pointer?: "coarse" | "fine";
|
|
17
|
+
};
|
|
18
|
+
export declare function useMediaQuery(query: BreakpointQuery | MediaQueryInput | (string & {})): boolean;
|
|
19
|
+
export declare function useIsMobile(): boolean;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useSyncExternalStore } from "react";
|
|
3
|
+
// src/vendor/coss/hooks/use-media-query.ts
|
|
4
|
+
const BREAKPOINTS = {
|
|
5
|
+
"2xl": 1536,
|
|
6
|
+
"3xl": 1600,
|
|
7
|
+
"4xl": 2e3,
|
|
8
|
+
lg: 1024,
|
|
9
|
+
md: 768,
|
|
10
|
+
sm: 640,
|
|
11
|
+
xl: 1280
|
|
12
|
+
};
|
|
13
|
+
function resolveMin(value) {
|
|
14
|
+
return `(min-width: ${typeof value === "number" ? value : BREAKPOINTS[value]}px)`;
|
|
15
|
+
}
|
|
16
|
+
function resolveMax(value) {
|
|
17
|
+
return `(max-width: ${(typeof value === "number" ? value : BREAKPOINTS[value]) - 1}px)`;
|
|
18
|
+
}
|
|
19
|
+
function parseQuery(query) {
|
|
20
|
+
if (typeof query !== "string") {
|
|
21
|
+
const parts = [];
|
|
22
|
+
if (query.min != null) parts.push(resolveMin(query.min));
|
|
23
|
+
if (query.max != null) parts.push(resolveMax(query.max));
|
|
24
|
+
if (query.pointer === "coarse") parts.push("(pointer: coarse)");
|
|
25
|
+
if (query.pointer === "fine") parts.push("(pointer: fine)");
|
|
26
|
+
if (parts.length === 0) return "(min-width: 0px)";
|
|
27
|
+
return parts.join(" and ");
|
|
28
|
+
}
|
|
29
|
+
if (query.startsWith("(")) return query;
|
|
30
|
+
const parts = [];
|
|
31
|
+
for (const segment of query.split(":")) if (segment.startsWith("max-")) {
|
|
32
|
+
const bp = segment.slice(4);
|
|
33
|
+
if (bp in BREAKPOINTS) parts.push(resolveMax(bp));
|
|
34
|
+
} else if (segment in BREAKPOINTS) parts.push(resolveMin(segment));
|
|
35
|
+
return parts.length > 0 ? parts.join(" and ") : query;
|
|
36
|
+
}
|
|
37
|
+
function getServerSnapshot() {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
function useMediaQuery(query) {
|
|
41
|
+
const mediaQuery = parseQuery(query);
|
|
42
|
+
const subscribe = useCallback((callback) => {
|
|
43
|
+
if (typeof window === "undefined") return () => {};
|
|
44
|
+
const mql = window.matchMedia(mediaQuery);
|
|
45
|
+
mql.addEventListener("change", callback);
|
|
46
|
+
return () => mql.removeEventListener("change", callback);
|
|
47
|
+
}, [mediaQuery]);
|
|
48
|
+
const getSnapshot = useCallback(() => {
|
|
49
|
+
if (typeof window === "undefined") return false;
|
|
50
|
+
return window.matchMedia(mediaQuery).matches;
|
|
51
|
+
}, [mediaQuery]);
|
|
52
|
+
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
53
|
+
}
|
|
54
|
+
function useIsMobile() {
|
|
55
|
+
return useMediaQuery("max-md");
|
|
56
|
+
}
|
|
57
|
+
export { useIsMobile, useMediaQuery };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area";
|
|
3
|
+
export declare function ScrollArea({ className, children, scrollFade, scrollbarGutter, fill, clampContentMinWidth, overscrollContain, ...props }: ScrollAreaPrimitive.Root.Props & {
|
|
4
|
+
scrollFade?: boolean;
|
|
5
|
+
scrollbarGutter?: boolean;
|
|
6
|
+
fill?: boolean;
|
|
7
|
+
clampContentMinWidth?: boolean;
|
|
8
|
+
overscrollContain?: boolean;
|
|
9
|
+
}): React.ReactElement;
|
|
10
|
+
export { ScrollAreaPrimitive };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../shadcn/lib/utils.mjs";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area";
|
|
5
|
+
// src/vendor/coss/scroll-area.tsx
|
|
6
|
+
function ScrollArea({ className, children, scrollFade = false, scrollbarGutter = false, fill = false, clampContentMinWidth = true, overscrollContain = false, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsxs(ScrollAreaPrimitive.Root, {
|
|
8
|
+
className: cn("size-full min-h-0", className),
|
|
9
|
+
...props,
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Viewport, {
|
|
12
|
+
className: cn("h-full rounded-[inherit] outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background", overscrollContain && "data-has-overflow-y:overscroll-y-contain data-has-overflow-x:overscroll-x-contain", scrollFade && "mask-t-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-start)))] mask-b-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-end)))] mask-l-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-start)))] mask-r-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-end)))] [--fade-size:1.5rem]", scrollbarGutter && "data-has-overflow-y:pe-2.5 data-has-overflow-x:pb-2.5"),
|
|
13
|
+
"data-slot": "scroll-area-viewport",
|
|
14
|
+
children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.Content, {
|
|
15
|
+
className: cn(fill && "size-full"),
|
|
16
|
+
"data-slot": "scroll-area-content",
|
|
17
|
+
style: clampContentMinWidth ? { minWidth: 0 } : void 0,
|
|
18
|
+
children
|
|
19
|
+
})
|
|
20
|
+
}),
|
|
21
|
+
/* @__PURE__ */ jsx(ScrollBar, { orientation: "vertical" }),
|
|
22
|
+
/* @__PURE__ */ jsx(ScrollBar, { orientation: "horizontal" }),
|
|
23
|
+
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, { "data-slot": "scroll-area-corner" })
|
|
24
|
+
]
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function ScrollBar({ className, orientation = "vertical", ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsx(ScrollAreaPrimitive.Scrollbar, {
|
|
29
|
+
className: cn("m-1 flex opacity-0 transition-opacity delay-300 data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:w-1.5 data-[orientation=horizontal]:flex-col data-hovering:opacity-100 data-scrolling:opacity-100 data-hovering:delay-0 data-scrolling:delay-0 data-hovering:duration-100 data-scrolling:duration-100", className),
|
|
30
|
+
"data-slot": "scroll-area-scrollbar",
|
|
31
|
+
orientation,
|
|
32
|
+
...props,
|
|
33
|
+
children: /* @__PURE__ */ jsx(ScrollAreaPrimitive.Thumb, {
|
|
34
|
+
className: "relative flex-1 rounded-full bg-foreground/20",
|
|
35
|
+
"data-slot": "scroll-area-thumb"
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
export { ScrollArea, ScrollAreaPrimitive, ScrollBar };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Button } from "./button.mjs";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
|
|
4
|
+
declare function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props): React$1.JSX.Element;
|
|
5
|
+
declare function AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props): React$1.JSX.Element;
|
|
6
|
+
declare function AlertDialogContent({ className, size, ...props }: AlertDialogPrimitive.Popup.Props & {
|
|
7
|
+
size?: "default" | "sm";
|
|
8
|
+
}): React$1.JSX.Element;
|
|
9
|
+
declare function AlertDialogHeader({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
10
|
+
declare function AlertDialogFooter({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
11
|
+
declare function AlertDialogTitle({ className, ...props }: React$1.ComponentProps<typeof AlertDialogPrimitive.Title>): React$1.JSX.Element;
|
|
12
|
+
declare function AlertDialogDescription({ className, ...props }: React$1.ComponentProps<typeof AlertDialogPrimitive.Description>): React$1.JSX.Element;
|
|
13
|
+
declare function AlertDialogCancel({ className, variant, size, ...props }: AlertDialogPrimitive.Close.Props & Pick<React$1.ComponentProps<typeof Button>, "variant" | "size">): React$1.JSX.Element;
|
|
14
|
+
export { AlertDialog, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPrimitive, AlertDialogTitle, AlertDialogTrigger };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Button } from "./button.mjs";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import "react";
|
|
5
|
+
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
// src/vendor/shadcn/alert-dialog.tsx
|
|
8
|
+
function AlertDialog({ ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Root, {
|
|
10
|
+
"data-slot": "alert-dialog",
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function AlertDialogTrigger({ ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Trigger, {
|
|
16
|
+
"data-slot": "alert-dialog-trigger",
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function AlertDialogPortal({ ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Portal, {
|
|
22
|
+
"data-slot": "alert-dialog-portal",
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function AlertDialogOverlay({ className, ...props }) {
|
|
27
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Backdrop, {
|
|
28
|
+
"data-slot": "alert-dialog-overlay",
|
|
29
|
+
className: cn("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className),
|
|
30
|
+
...props
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function AlertDialogContent({ className, size = "default", ...props }) {
|
|
34
|
+
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [/* @__PURE__ */ jsx(AlertDialogOverlay, {}), /* @__PURE__ */ jsx(AlertDialogPrimitive.Popup, {
|
|
35
|
+
"data-slot": "alert-dialog-content",
|
|
36
|
+
"data-size": size,
|
|
37
|
+
className: cn("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
38
|
+
...props
|
|
39
|
+
})] });
|
|
40
|
+
}
|
|
41
|
+
function AlertDialogHeader({ className, ...props }) {
|
|
42
|
+
return /* @__PURE__ */ jsx("div", {
|
|
43
|
+
"data-slot": "alert-dialog-header",
|
|
44
|
+
className: cn("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", className),
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function AlertDialogFooter({ className, ...props }) {
|
|
49
|
+
return /* @__PURE__ */ jsx("div", {
|
|
50
|
+
"data-slot": "alert-dialog-footer",
|
|
51
|
+
className: cn("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end", className),
|
|
52
|
+
...props
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function AlertDialogTitle({ className, ...props }) {
|
|
56
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Title, {
|
|
57
|
+
"data-slot": "alert-dialog-title",
|
|
58
|
+
className: cn("text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", className),
|
|
59
|
+
...props
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function AlertDialogDescription({ className, ...props }) {
|
|
63
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Description, {
|
|
64
|
+
"data-slot": "alert-dialog-description",
|
|
65
|
+
className: cn("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className),
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function AlertDialogCancel({ className, variant = "outline", size = "default", ...props }) {
|
|
70
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Close, {
|
|
71
|
+
"data-slot": "alert-dialog-cancel",
|
|
72
|
+
className: cn(className),
|
|
73
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
74
|
+
variant,
|
|
75
|
+
size
|
|
76
|
+
}),
|
|
77
|
+
...props
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
export { AlertDialog, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogPrimitive, AlertDialogTitle, AlertDialogTrigger };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | "ghost" | "link" | "outline" | "secondary" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function Badge({ className, variant, render, ...props }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
7
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cn } from "cn";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
4
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
+
// src/vendor/shadcn/badge.tsx
|
|
6
|
+
const badgeVariants = cva("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!", {
|
|
7
|
+
variants: { variant: {
|
|
8
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
9
|
+
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
10
|
+
destructive: "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
|
|
11
|
+
outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
|
|
12
|
+
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
13
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
14
|
+
} },
|
|
15
|
+
defaultVariants: { variant: "default" }
|
|
16
|
+
});
|
|
17
|
+
function Badge({ className, variant = "default", render, ...props }) {
|
|
18
|
+
return useRender({
|
|
19
|
+
defaultTagName: "span",
|
|
20
|
+
props: mergeProps({ className: cn(badgeVariants({ variant }), className) }, props),
|
|
21
|
+
render,
|
|
22
|
+
state: {
|
|
23
|
+
slot: "badge",
|
|
24
|
+
variant
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
declare function Breadcrumb({ className, ...props }: React$1.ComponentProps<"nav">): React$1.JSX.Element;
|
|
4
|
+
declare function BreadcrumbList({ className, ...props }: React$1.ComponentProps<"ol">): React$1.JSX.Element;
|
|
5
|
+
declare function BreadcrumbItem({ className, ...props }: React$1.ComponentProps<"li">): React$1.JSX.Element;
|
|
6
|
+
declare function BreadcrumbLink({ className, render, ...props }: useRender.ComponentProps<"a">): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
7
|
+
declare function BreadcrumbPage({ className, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
|
|
8
|
+
declare function BreadcrumbSeparator({ children, className, ...props }: React$1.ComponentProps<"li">): React$1.JSX.Element;
|
|
9
|
+
declare function BreadcrumbEllipsis({ className, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
|
|
10
|
+
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { cn } from "cn";
|
|
2
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
|
|
6
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
7
|
+
// src/vendor/shadcn/breadcrumb.tsx
|
|
8
|
+
function Breadcrumb({ className, ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
10
|
+
"aria-label": "breadcrumb",
|
|
11
|
+
"data-slot": "breadcrumb",
|
|
12
|
+
className: cn(className),
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function BreadcrumbList({ className, ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsx("ol", {
|
|
18
|
+
"data-slot": "breadcrumb-list",
|
|
19
|
+
className: cn("flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground sm:gap-2.5", className),
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function BreadcrumbItem({ className, ...props }) {
|
|
24
|
+
return /* @__PURE__ */ jsx("li", {
|
|
25
|
+
"data-slot": "breadcrumb-item",
|
|
26
|
+
className: cn("inline-flex items-center gap-1.5", className),
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function BreadcrumbLink({ className, render, ...props }) {
|
|
31
|
+
return useRender({
|
|
32
|
+
defaultTagName: "a",
|
|
33
|
+
props: mergeProps({ className: cn("transition-colors hover:text-foreground", className) }, props),
|
|
34
|
+
render,
|
|
35
|
+
state: { slot: "breadcrumb-link" }
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function BreadcrumbPage({ className, ...props }) {
|
|
39
|
+
return /* @__PURE__ */ jsx("span", {
|
|
40
|
+
"data-slot": "breadcrumb-page",
|
|
41
|
+
role: "link",
|
|
42
|
+
"aria-disabled": "true",
|
|
43
|
+
"aria-current": "page",
|
|
44
|
+
className: cn("font-normal text-foreground", className),
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
49
|
+
return /* @__PURE__ */ jsx("li", {
|
|
50
|
+
"data-slot": "breadcrumb-separator",
|
|
51
|
+
role: "presentation",
|
|
52
|
+
"aria-hidden": "true",
|
|
53
|
+
className: cn("[&>svg]:size-3.5", className),
|
|
54
|
+
...props,
|
|
55
|
+
children: children ?? /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function BreadcrumbEllipsis({ className, ...props }) {
|
|
59
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
60
|
+
"data-slot": "breadcrumb-ellipsis",
|
|
61
|
+
role: "presentation",
|
|
62
|
+
"aria-hidden": "true",
|
|
63
|
+
className: cn("flex size-5 items-center justify-center [&>svg]:size-4", className),
|
|
64
|
+
...props,
|
|
65
|
+
children: [/* @__PURE__ */ jsx(MoreHorizontalIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
66
|
+
className: "sr-only",
|
|
67
|
+
children: "More"
|
|
68
|
+
})]
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { Button } from "@base-ui/react/button";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | "ghost" | "link" | "outline" | "secondary" | null | undefined;
|
|
5
|
+
size?: "default" | "icon" | "icon-lg" | "icon-sm" | "icon-xs" | "lg" | "sm" | "xs" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Button$1({ className, variant, size, ...props }: Button.Props & VariantProps<typeof buttonVariants>): import("react").JSX.Element;
|
|
8
|
+
export { Button$1 as Button, buttonVariants };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { cn } from "cn";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { Button } from "@base-ui/react/button";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
// src/vendor/shadcn/button.tsx
|
|
6
|
+
const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
10
|
+
outline: "border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
11
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
12
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
13
|
+
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
14
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
default: "h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
18
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
19
|
+
sm: "h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
|
|
20
|
+
lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
21
|
+
icon: "size-9",
|
|
22
|
+
"icon-xs": "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
23
|
+
"icon-sm": "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
|
|
24
|
+
"icon-lg": "size-10"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
variant: "default",
|
|
29
|
+
size: "default"
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
function Button$1({ className, variant = "default", size = "default", ...props }) {
|
|
33
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
34
|
+
"data-slot": "button",
|
|
35
|
+
className: cn(buttonVariants({
|
|
36
|
+
variant,
|
|
37
|
+
size,
|
|
38
|
+
className
|
|
39
|
+
})),
|
|
40
|
+
...props
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
export { Button$1 as Button, buttonVariants };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Button } from "./button.mjs";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { DayPicker } from "@daypicker/react";
|
|
4
|
+
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, locale, formatters, components, ...props }: React$1.ComponentProps<typeof DayPicker> & {
|
|
5
|
+
buttonVariant?: React$1.ComponentProps<typeof Button>["variant"];
|
|
6
|
+
}): React$1.JSX.Element;
|
|
7
|
+
export { Calendar };
|