@yimingliao/cms 0.0.106 → 0.0.107
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/{chunk-XWXG67I4.js → chunk-4BSB3AZG.js} +1 -1
- package/dist/chunk-Q654SMCX.js +1511 -0
- package/dist/{chunk-OAENV763.js → chunk-VSV6SQWC.js} +8 -1
- package/dist/client/index.d.ts +41 -5
- package/dist/client/index.js +353 -79
- package/dist/client/shadcn/index.d.ts +53 -8
- package/dist/client/shadcn/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/server/index.js +1 -1
- package/dist/sidebar-Dei7UxR1.d.ts +94 -0
- package/dist/storage/r2/index.js +2 -2
- package/dist/storage/sftp/index.js +2 -2
- package/package.json +7 -1
- package/dist/chunk-FLKUBNE4.js +0 -421
- package/dist/label-BF4qxS03.d.ts +0 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Label, Separator, Spinner, Textarea } from '../../chunk-
|
|
1
|
+
export { Avatar, AvatarFallback, AvatarImage, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Collapsible, CollapsibleContent, CollapsibleTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Label, SIDEBAR_COOKIE_NAME, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Spinner, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, useSidebar } from '../../chunk-Q654SMCX.js';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { ADMIN_ROLES, POST_TYPES, ROOT_FOLDER, ROOT_FOLDER_ID, ROOT_FOLDER_NAME, SIMPLE_UPLOAD_FOLDER_KEY, SIMPLE_UPLOAD_FOLDER_NAME, isFileLocked, isFolderLocked } from './chunk-FUAJWL2N.js';
|
|
2
|
-
export { FILE_TYPES, OG_TYPE_ARRAY, SIZE, TWITTER_CARD_ARRAY, classifyFileType, createBuildArticleMetadata, createBuildTranslations, createBuildWebsiteMetadata, datetimeToDb, datetimeToUi, ensureArray, findTranslation, formatDateTime, formatFileSize, getMediaInfo, jsonArrayToDb, jsonArrayToUi, mimeToExtension, result, serializeJsonLd } from './chunk-
|
|
2
|
+
export { FILE_TYPES, OG_TYPE_ARRAY, SIZE, TWITTER_CARD_ARRAY, classifyFileType, createBuildArticleMetadata, createBuildTranslations, createBuildWebsiteMetadata, datetimeToDb, datetimeToUi, ensureArray, findTranslation, formatDateTime, formatFileSize, getMediaInfo, jsonArrayToDb, jsonArrayToUi, mimeToExtension, result, serializeJsonLd } from './chunk-VSV6SQWC.js';
|
package/dist/server/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ADMIN_ROLES, isFileLocked, isFolderLocked, ROOT_FOLDER_ID, ROOT_FOLDER } from '../chunk-FUAJWL2N.js';
|
|
2
|
-
import { SIZE, result, datetimeToDb, jsonArrayToDb, mimeToExtension, classifyFileType, TWITTER_CARD_ARRAY, OG_TYPE_ARRAY } from '../chunk-
|
|
2
|
+
import { SIZE, result, datetimeToDb, jsonArrayToDb, mimeToExtension, classifyFileType, TWITTER_CARD_ARRAY, OG_TYPE_ARRAY } from '../chunk-VSV6SQWC.js';
|
|
3
3
|
import jwt from 'jsonwebtoken';
|
|
4
4
|
import argon2 from 'argon2';
|
|
5
5
|
import crypto, { timingSafeEqual } from 'crypto';
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
|
+
import { VariantProps } from 'class-variance-authority';
|
|
6
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
7
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
8
|
+
|
|
9
|
+
declare const buttonVariants: (props?: ({
|
|
10
|
+
variant?: "link" | "default" | "success" | "destructive" | "outline" | "secondary" | "ghost" | "warning" | null | undefined;
|
|
11
|
+
size?: "lg" | "sm" | "default" | "icon" | "icon-sm" | "icon-lg" | "xs" | null | undefined;
|
|
12
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
13
|
+
type ButtonProps = React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
14
|
+
asChild?: boolean;
|
|
15
|
+
};
|
|
16
|
+
declare function Button({ className, variant, size, asChild, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
declare function Input({ className, type, ...props }: React.ComponentProps<"input">): react_jsx_runtime.JSX.Element;
|
|
19
|
+
|
|
20
|
+
type LabelProps = React.ComponentProps<typeof LabelPrimitive.Root>;
|
|
21
|
+
declare function Label({ className, ...props }: LabelProps): react_jsx_runtime.JSX.Element;
|
|
22
|
+
|
|
23
|
+
declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
24
|
+
|
|
25
|
+
declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): react_jsx_runtime.JSX.Element;
|
|
26
|
+
declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
27
|
+
declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
28
|
+
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): react_jsx_runtime.JSX.Element;
|
|
29
|
+
|
|
30
|
+
declare const SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
31
|
+
type SidebarContextProps = {
|
|
32
|
+
state: "expanded" | "collapsed";
|
|
33
|
+
open: boolean;
|
|
34
|
+
setOpen: (open: boolean) => void;
|
|
35
|
+
openMobile: boolean;
|
|
36
|
+
setOpenMobile: (open: boolean) => void;
|
|
37
|
+
isMobile: boolean;
|
|
38
|
+
toggleSidebar: () => void;
|
|
39
|
+
};
|
|
40
|
+
declare function useSidebar(): SidebarContextProps;
|
|
41
|
+
declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }: React.ComponentProps<"div"> & {
|
|
42
|
+
defaultOpen?: boolean;
|
|
43
|
+
open?: boolean;
|
|
44
|
+
onOpenChange?: (open: boolean) => void;
|
|
45
|
+
}): react_jsx_runtime.JSX.Element;
|
|
46
|
+
declare function Sidebar({ side, variant, collapsible, className, children, ...props }: React.ComponentProps<"div"> & {
|
|
47
|
+
side?: "left" | "right";
|
|
48
|
+
variant?: "sidebar" | "floating" | "inset";
|
|
49
|
+
collapsible?: "offcanvas" | "icon" | "none";
|
|
50
|
+
}): react_jsx_runtime.JSX.Element;
|
|
51
|
+
declare function SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<typeof Button>): react_jsx_runtime.JSX.Element;
|
|
52
|
+
declare function SidebarRail({ className, ...props }: React.ComponentProps<"button">): react_jsx_runtime.JSX.Element;
|
|
53
|
+
declare function SidebarInset({ className, ...props }: React.ComponentProps<"main">): react_jsx_runtime.JSX.Element;
|
|
54
|
+
declare function SidebarInput({ className, ...props }: React.ComponentProps<typeof Input>): react_jsx_runtime.JSX.Element;
|
|
55
|
+
declare function SidebarHeader({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
56
|
+
declare function SidebarFooter({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
57
|
+
declare function SidebarSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): react_jsx_runtime.JSX.Element;
|
|
58
|
+
declare function SidebarContent({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
59
|
+
declare function SidebarGroup({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
60
|
+
declare function SidebarGroupLabel({ className, asChild, ...props }: React.ComponentProps<"div"> & {
|
|
61
|
+
asChild?: boolean;
|
|
62
|
+
}): react_jsx_runtime.JSX.Element;
|
|
63
|
+
declare function SidebarGroupAction({ className, asChild, ...props }: React.ComponentProps<"button"> & {
|
|
64
|
+
asChild?: boolean;
|
|
65
|
+
}): react_jsx_runtime.JSX.Element;
|
|
66
|
+
declare function SidebarGroupContent({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
67
|
+
declare function SidebarMenu({ className, ...props }: React.ComponentProps<"ul">): react_jsx_runtime.JSX.Element;
|
|
68
|
+
declare function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">): react_jsx_runtime.JSX.Element;
|
|
69
|
+
declare const sidebarMenuButtonVariants: (props?: ({
|
|
70
|
+
variant?: "default" | "outline" | null | undefined;
|
|
71
|
+
size?: "lg" | "sm" | "default" | "md" | null | undefined;
|
|
72
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
73
|
+
declare function SidebarMenuButton({ asChild, isActive, variant, size, tooltip, className, ...props }: React.ComponentProps<"button"> & {
|
|
74
|
+
asChild?: boolean;
|
|
75
|
+
isActive?: boolean;
|
|
76
|
+
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
77
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>): react_jsx_runtime.JSX.Element;
|
|
78
|
+
declare function SidebarMenuAction({ className, asChild, showOnHover, ...props }: React.ComponentProps<"button"> & {
|
|
79
|
+
asChild?: boolean;
|
|
80
|
+
showOnHover?: boolean;
|
|
81
|
+
}): react_jsx_runtime.JSX.Element;
|
|
82
|
+
declare function SidebarMenuBadge({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
83
|
+
declare function SidebarMenuSkeleton({ className, showIcon, ...props }: React.ComponentProps<"div"> & {
|
|
84
|
+
showIcon?: boolean;
|
|
85
|
+
}): react_jsx_runtime.JSX.Element;
|
|
86
|
+
declare function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">): react_jsx_runtime.JSX.Element;
|
|
87
|
+
declare function SidebarMenuSubItem({ className, ...props }: React.ComponentProps<"li">): react_jsx_runtime.JSX.Element;
|
|
88
|
+
declare function SidebarMenuSubButton({ asChild, size, isActive, className, ...props }: React.ComponentProps<"a"> & {
|
|
89
|
+
asChild?: boolean;
|
|
90
|
+
size?: "sm" | "md" | "lg";
|
|
91
|
+
isActive?: boolean;
|
|
92
|
+
}): react_jsx_runtime.JSX.Element;
|
|
93
|
+
|
|
94
|
+
export { TooltipContent as A, type ButtonProps as B, TooltipProvider as C, TooltipTrigger as D, useSidebar as E, Input as I, type LabelProps as L, Sidebar as S, Tooltip as T, Button as a, Label as b, SIDEBAR_COOKIE_NAME as c, Separator as d, SidebarContent as e, SidebarFooter as f, SidebarGroup as g, SidebarGroupAction as h, SidebarGroupContent as i, SidebarGroupLabel as j, SidebarHeader as k, SidebarInput as l, SidebarInset as m, SidebarMenu as n, SidebarMenuAction as o, SidebarMenuBadge as p, SidebarMenuButton as q, SidebarMenuItem as r, SidebarMenuSkeleton as s, SidebarMenuSub as t, SidebarMenuSubButton as u, SidebarMenuSubItem as v, SidebarProvider as w, SidebarRail as x, SidebarSeparator as y, SidebarTrigger as z };
|
package/dist/storage/r2/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createObjectKey } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
import { createObjectKey } from '../../chunk-4BSB3AZG.js';
|
|
2
|
+
import '../../chunk-VSV6SQWC.js';
|
|
3
3
|
import { PutObjectCommand, DeleteObjectCommand, CopyObjectCommand } from '@aws-sdk/client-s3';
|
|
4
4
|
|
|
5
5
|
function createR2Service({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createObjectKey } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
import { createObjectKey } from '../../chunk-4BSB3AZG.js';
|
|
2
|
+
import '../../chunk-VSV6SQWC.js';
|
|
3
3
|
import path from 'path/posix';
|
|
4
4
|
import { createPool } from 'generic-pool';
|
|
5
5
|
import SFTPClient from 'ssh2-sftp-client';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yimingliao/cms",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.107",
|
|
4
4
|
"author": "Yiming Liao",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -49,9 +49,14 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@keyv/redis": "^5.1.6",
|
|
52
|
+
"@radix-ui/react-avatar": "^1.1.11",
|
|
53
|
+
"@radix-ui/react-collapsible": "^1.1.12",
|
|
54
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
55
|
+
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
52
56
|
"@radix-ui/react-label": "^2.1.8",
|
|
53
57
|
"@radix-ui/react-separator": "^1.1.8",
|
|
54
58
|
"@radix-ui/react-slot": "^1.2.4",
|
|
59
|
+
"@radix-ui/react-tooltip": "^1.2.8",
|
|
55
60
|
"argon2": "^0.44.0",
|
|
56
61
|
"class-variance-authority": "^0.7.1",
|
|
57
62
|
"jsonwebtoken": "^9.0.3",
|
|
@@ -59,6 +64,7 @@
|
|
|
59
64
|
"logry": "^2.1.6",
|
|
60
65
|
"lucide-react": "^0.577.0",
|
|
61
66
|
"mime-types": "^3.0.2",
|
|
67
|
+
"next-themes": "^0.4.6",
|
|
62
68
|
"nodemailer": "^8.0.1",
|
|
63
69
|
"sonner": "^2.0.7",
|
|
64
70
|
"ua-parser-js": "^2.0.9",
|
package/dist/chunk-FLKUBNE4.js
DELETED
|
@@ -1,421 +0,0 @@
|
|
|
1
|
-
import { clsx } from 'clsx';
|
|
2
|
-
import { twMerge } from 'tailwind-merge';
|
|
3
|
-
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
4
|
-
import { usePathname } from 'next/navigation';
|
|
5
|
-
import { UAParser } from 'ua-parser-js';
|
|
6
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
7
|
-
import { cva } from 'class-variance-authority';
|
|
8
|
-
import { jsx } from 'react/jsx-runtime';
|
|
9
|
-
import { Loader2Icon } from 'lucide-react';
|
|
10
|
-
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
11
|
-
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
12
|
-
|
|
13
|
-
// src/client/applications/ui/utils.ts
|
|
14
|
-
var cn = (...inputs) => {
|
|
15
|
-
return twMerge(clsx(inputs));
|
|
16
|
-
};
|
|
17
|
-
var useCountdown = (initialTime) => {
|
|
18
|
-
const [timeLeft, setTimeLeft] = useState(initialTime);
|
|
19
|
-
const [isCounting, setIsCounting] = useState(false);
|
|
20
|
-
const intervalRef = useRef(null);
|
|
21
|
-
const startCountdown = useCallback(() => {
|
|
22
|
-
setTimeLeft(initialTime);
|
|
23
|
-
setIsCounting(true);
|
|
24
|
-
}, [initialTime]);
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
if (!isCounting) return;
|
|
27
|
-
intervalRef.current = setInterval(() => {
|
|
28
|
-
setTimeLeft((prev) => {
|
|
29
|
-
if (prev <= 1) {
|
|
30
|
-
clearInterval(intervalRef.current);
|
|
31
|
-
intervalRef.current = null;
|
|
32
|
-
setIsCounting(false);
|
|
33
|
-
return 0;
|
|
34
|
-
}
|
|
35
|
-
return prev - 1;
|
|
36
|
-
});
|
|
37
|
-
}, 1e3);
|
|
38
|
-
return () => {
|
|
39
|
-
if (intervalRef.current) {
|
|
40
|
-
clearInterval(intervalRef.current);
|
|
41
|
-
intervalRef.current = null;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
}, [isCounting]);
|
|
45
|
-
return { timeLeft, isCounting, startCountdown };
|
|
46
|
-
};
|
|
47
|
-
var useParentPathname = () => {
|
|
48
|
-
const pathname = usePathname();
|
|
49
|
-
if (pathname === "/") return "/";
|
|
50
|
-
const index = pathname.lastIndexOf("/");
|
|
51
|
-
return index <= 0 ? "/" : pathname.slice(0, index);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
// src/client/applications/ui/is-confirm.ts
|
|
55
|
-
var isConfirm = (t, key = "ui.dialog.confirm.text") => {
|
|
56
|
-
return confirm(t(key));
|
|
57
|
-
};
|
|
58
|
-
function useDeviceInfo() {
|
|
59
|
-
const [deviceInfo, setDeviceInfo] = useState(null);
|
|
60
|
-
useEffect(() => {
|
|
61
|
-
const parser = new UAParser(navigator.userAgent);
|
|
62
|
-
const result = parser.getResult();
|
|
63
|
-
setDeviceInfo({
|
|
64
|
-
deviceType: result.device.type || "desktop",
|
|
65
|
-
platform: result.os.name || "Unknown",
|
|
66
|
-
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
67
|
-
language: navigator.language,
|
|
68
|
-
screenResolution: {
|
|
69
|
-
width: window.screen.width,
|
|
70
|
-
height: window.screen.height
|
|
71
|
-
},
|
|
72
|
-
browser: result.browser.name || "Unknown",
|
|
73
|
-
browserVersion: result.browser.version || "",
|
|
74
|
-
userAgent: navigator.userAgent
|
|
75
|
-
});
|
|
76
|
-
}, []);
|
|
77
|
-
return deviceInfo;
|
|
78
|
-
}
|
|
79
|
-
var buttonVariants = cva(
|
|
80
|
-
"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",
|
|
81
|
-
{
|
|
82
|
-
variants: {
|
|
83
|
-
variant: {
|
|
84
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
85
|
-
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
86
|
-
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",
|
|
87
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
88
|
-
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
89
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
90
|
-
success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40 dark:bg-success/60",
|
|
91
|
-
warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40 dark:bg-warning/60"
|
|
92
|
-
},
|
|
93
|
-
size: {
|
|
94
|
-
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
95
|
-
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
96
|
-
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
97
|
-
icon: "size-9",
|
|
98
|
-
"icon-sm": "size-8",
|
|
99
|
-
"icon-lg": "size-10",
|
|
100
|
-
xs: "h-7 rounded-md px-2 text-xs has-[>svg]:px-2 gap-1"
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
defaultVariants: {
|
|
104
|
-
variant: "default",
|
|
105
|
-
size: "default"
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
);
|
|
109
|
-
function Button({
|
|
110
|
-
className,
|
|
111
|
-
variant,
|
|
112
|
-
size,
|
|
113
|
-
asChild = false,
|
|
114
|
-
...props
|
|
115
|
-
}) {
|
|
116
|
-
const Comp = asChild ? Slot : "button";
|
|
117
|
-
return /* @__PURE__ */ jsx(
|
|
118
|
-
Comp,
|
|
119
|
-
{
|
|
120
|
-
"data-slot": "button",
|
|
121
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
122
|
-
...props
|
|
123
|
-
}
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
function Card({ className, ...props }) {
|
|
127
|
-
return /* @__PURE__ */ jsx(
|
|
128
|
-
"div",
|
|
129
|
-
{
|
|
130
|
-
"data-slot": "card",
|
|
131
|
-
className: cn(
|
|
132
|
-
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
|
|
133
|
-
className
|
|
134
|
-
),
|
|
135
|
-
...props
|
|
136
|
-
}
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
function CardHeader({ className, ...props }) {
|
|
140
|
-
return /* @__PURE__ */ jsx(
|
|
141
|
-
"div",
|
|
142
|
-
{
|
|
143
|
-
"data-slot": "card-header",
|
|
144
|
-
className: cn(
|
|
145
|
-
"@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",
|
|
146
|
-
className
|
|
147
|
-
),
|
|
148
|
-
...props
|
|
149
|
-
}
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
function CardTitle({ className, ...props }) {
|
|
153
|
-
return /* @__PURE__ */ jsx(
|
|
154
|
-
"div",
|
|
155
|
-
{
|
|
156
|
-
"data-slot": "card-title",
|
|
157
|
-
className: cn("leading-none font-semibold", className),
|
|
158
|
-
...props
|
|
159
|
-
}
|
|
160
|
-
);
|
|
161
|
-
}
|
|
162
|
-
function CardDescription({ className, ...props }) {
|
|
163
|
-
return /* @__PURE__ */ jsx(
|
|
164
|
-
"div",
|
|
165
|
-
{
|
|
166
|
-
"data-slot": "card-description",
|
|
167
|
-
className: cn("text-muted-foreground text-sm", className),
|
|
168
|
-
...props
|
|
169
|
-
}
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
function CardAction({ className, ...props }) {
|
|
173
|
-
return /* @__PURE__ */ jsx(
|
|
174
|
-
"div",
|
|
175
|
-
{
|
|
176
|
-
"data-slot": "card-action",
|
|
177
|
-
className: cn(
|
|
178
|
-
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
179
|
-
className
|
|
180
|
-
),
|
|
181
|
-
...props
|
|
182
|
-
}
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
function CardContent({ className, ...props }) {
|
|
186
|
-
return /* @__PURE__ */ jsx(
|
|
187
|
-
"div",
|
|
188
|
-
{
|
|
189
|
-
"data-slot": "card-content",
|
|
190
|
-
className: cn("px-6", className),
|
|
191
|
-
...props
|
|
192
|
-
}
|
|
193
|
-
);
|
|
194
|
-
}
|
|
195
|
-
function CardFooter({ className, ...props }) {
|
|
196
|
-
return /* @__PURE__ */ jsx(
|
|
197
|
-
"div",
|
|
198
|
-
{
|
|
199
|
-
"data-slot": "card-footer",
|
|
200
|
-
className: cn("flex items-center px-6 [.border-t]:pt-6", className),
|
|
201
|
-
...props
|
|
202
|
-
}
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
function Input({ className, type, ...props }) {
|
|
206
|
-
return /* @__PURE__ */ jsx(
|
|
207
|
-
"input",
|
|
208
|
-
{
|
|
209
|
-
type,
|
|
210
|
-
"data-slot": "input",
|
|
211
|
-
className: cn(
|
|
212
|
-
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
213
|
-
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
214
|
-
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
215
|
-
className
|
|
216
|
-
),
|
|
217
|
-
...props
|
|
218
|
-
}
|
|
219
|
-
);
|
|
220
|
-
}
|
|
221
|
-
function Textarea({ className, ...props }) {
|
|
222
|
-
return /* @__PURE__ */ jsx(
|
|
223
|
-
"textarea",
|
|
224
|
-
{
|
|
225
|
-
"data-slot": "textarea",
|
|
226
|
-
className: cn(
|
|
227
|
-
// "min-h-16",
|
|
228
|
-
// "field-sizing-content",
|
|
229
|
-
"border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
230
|
-
className
|
|
231
|
-
),
|
|
232
|
-
...props
|
|
233
|
-
}
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
function InputGroup({ className, ...props }) {
|
|
237
|
-
return /* @__PURE__ */ jsx(
|
|
238
|
-
"div",
|
|
239
|
-
{
|
|
240
|
-
"data-slot": "input-group",
|
|
241
|
-
role: "group",
|
|
242
|
-
className: cn(
|
|
243
|
-
"group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none",
|
|
244
|
-
"h-9 min-w-0 has-[>textarea]:h-auto",
|
|
245
|
-
// Variants based on alignment.
|
|
246
|
-
"has-[>[data-align=inline-start]]:[&>input]:pl-2",
|
|
247
|
-
"has-[>[data-align=inline-end]]:[&>input]:pr-2",
|
|
248
|
-
"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
|
|
249
|
-
"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
|
|
250
|
-
// Focus state.
|
|
251
|
-
"has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]",
|
|
252
|
-
// Error state.
|
|
253
|
-
"has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",
|
|
254
|
-
className
|
|
255
|
-
),
|
|
256
|
-
...props
|
|
257
|
-
}
|
|
258
|
-
);
|
|
259
|
-
}
|
|
260
|
-
var inputGroupAddonVariants = cva(
|
|
261
|
-
"text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50",
|
|
262
|
-
{
|
|
263
|
-
variants: {
|
|
264
|
-
align: {
|
|
265
|
-
"inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
|
|
266
|
-
"inline-end": "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
|
|
267
|
-
"block-start": "order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5",
|
|
268
|
-
"block-end": "order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5"
|
|
269
|
-
}
|
|
270
|
-
},
|
|
271
|
-
defaultVariants: {
|
|
272
|
-
align: "inline-start"
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
);
|
|
276
|
-
function InputGroupAddon({
|
|
277
|
-
className,
|
|
278
|
-
align = "inline-start",
|
|
279
|
-
...props
|
|
280
|
-
}) {
|
|
281
|
-
return /* @__PURE__ */ jsx(
|
|
282
|
-
"div",
|
|
283
|
-
{
|
|
284
|
-
role: "group",
|
|
285
|
-
"data-slot": "input-group-addon",
|
|
286
|
-
"data-align": align,
|
|
287
|
-
className: cn(inputGroupAddonVariants({ align }), className),
|
|
288
|
-
onClick: (e) => {
|
|
289
|
-
if (e.target.closest("button")) {
|
|
290
|
-
return;
|
|
291
|
-
}
|
|
292
|
-
e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
293
|
-
},
|
|
294
|
-
...props
|
|
295
|
-
}
|
|
296
|
-
);
|
|
297
|
-
}
|
|
298
|
-
var inputGroupButtonVariants = cva(
|
|
299
|
-
"text-sm shadow-none flex gap-2 items-center",
|
|
300
|
-
{
|
|
301
|
-
variants: {
|
|
302
|
-
size: {
|
|
303
|
-
xs: "h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2",
|
|
304
|
-
sm: "h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5",
|
|
305
|
-
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
306
|
-
"icon-sm": "size-8 p-0 has-[>svg]:p-0"
|
|
307
|
-
}
|
|
308
|
-
},
|
|
309
|
-
defaultVariants: {
|
|
310
|
-
size: "xs"
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
);
|
|
314
|
-
function InputGroupButton({
|
|
315
|
-
className,
|
|
316
|
-
type = "button",
|
|
317
|
-
variant = "ghost",
|
|
318
|
-
size = "xs",
|
|
319
|
-
...props
|
|
320
|
-
}) {
|
|
321
|
-
return /* @__PURE__ */ jsx(
|
|
322
|
-
Button,
|
|
323
|
-
{
|
|
324
|
-
type,
|
|
325
|
-
"data-size": size,
|
|
326
|
-
variant,
|
|
327
|
-
className: cn(inputGroupButtonVariants({ size }), className),
|
|
328
|
-
...props
|
|
329
|
-
}
|
|
330
|
-
);
|
|
331
|
-
}
|
|
332
|
-
function InputGroupText({ className, ...props }) {
|
|
333
|
-
return /* @__PURE__ */ jsx(
|
|
334
|
-
"span",
|
|
335
|
-
{
|
|
336
|
-
className: cn(
|
|
337
|
-
"text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
338
|
-
className
|
|
339
|
-
),
|
|
340
|
-
...props
|
|
341
|
-
}
|
|
342
|
-
);
|
|
343
|
-
}
|
|
344
|
-
function InputGroupInput({
|
|
345
|
-
className,
|
|
346
|
-
...props
|
|
347
|
-
}) {
|
|
348
|
-
return /* @__PURE__ */ jsx(
|
|
349
|
-
Input,
|
|
350
|
-
{
|
|
351
|
-
"data-slot": "input-group-control",
|
|
352
|
-
className: cn(
|
|
353
|
-
"flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",
|
|
354
|
-
className
|
|
355
|
-
),
|
|
356
|
-
...props
|
|
357
|
-
}
|
|
358
|
-
);
|
|
359
|
-
}
|
|
360
|
-
function InputGroupTextarea({
|
|
361
|
-
className,
|
|
362
|
-
...props
|
|
363
|
-
}) {
|
|
364
|
-
return /* @__PURE__ */ jsx(
|
|
365
|
-
Textarea,
|
|
366
|
-
{
|
|
367
|
-
"data-slot": "input-group-control",
|
|
368
|
-
className: cn(
|
|
369
|
-
"flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",
|
|
370
|
-
className
|
|
371
|
-
),
|
|
372
|
-
...props
|
|
373
|
-
}
|
|
374
|
-
);
|
|
375
|
-
}
|
|
376
|
-
function Spinner({ className, ...props }) {
|
|
377
|
-
return /* @__PURE__ */ jsx(
|
|
378
|
-
Loader2Icon,
|
|
379
|
-
{
|
|
380
|
-
role: "status",
|
|
381
|
-
"aria-label": "Loading",
|
|
382
|
-
className: cn("size-4 animate-spin", className),
|
|
383
|
-
...props
|
|
384
|
-
}
|
|
385
|
-
);
|
|
386
|
-
}
|
|
387
|
-
function Label({ className, ...props }) {
|
|
388
|
-
return /* @__PURE__ */ jsx(
|
|
389
|
-
LabelPrimitive.Root,
|
|
390
|
-
{
|
|
391
|
-
"data-slot": "label",
|
|
392
|
-
className: cn(
|
|
393
|
-
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
394
|
-
className
|
|
395
|
-
),
|
|
396
|
-
...props
|
|
397
|
-
}
|
|
398
|
-
);
|
|
399
|
-
}
|
|
400
|
-
function Separator({
|
|
401
|
-
className,
|
|
402
|
-
orientation = "horizontal",
|
|
403
|
-
decorative = true,
|
|
404
|
-
...props
|
|
405
|
-
}) {
|
|
406
|
-
return /* @__PURE__ */ jsx(
|
|
407
|
-
SeparatorPrimitive.Root,
|
|
408
|
-
{
|
|
409
|
-
"data-slot": "separator",
|
|
410
|
-
decorative,
|
|
411
|
-
orientation,
|
|
412
|
-
className: cn(
|
|
413
|
-
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
414
|
-
className
|
|
415
|
-
),
|
|
416
|
-
...props
|
|
417
|
-
}
|
|
418
|
-
);
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
export { Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Label, Separator, Spinner, Textarea, cn, isConfirm, useCountdown, useDeviceInfo, useParentPathname };
|
package/dist/label-BF4qxS03.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
-
import { VariantProps } from 'class-variance-authority';
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
6
|
-
|
|
7
|
-
declare const buttonVariants: (props?: ({
|
|
8
|
-
variant?: "link" | "default" | "success" | "destructive" | "outline" | "secondary" | "ghost" | "warning" | null | undefined;
|
|
9
|
-
size?: "lg" | "sm" | "default" | "icon" | "icon-sm" | "icon-lg" | "xs" | null | undefined;
|
|
10
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
|
-
type ButtonProps = React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
12
|
-
asChild?: boolean;
|
|
13
|
-
};
|
|
14
|
-
declare function Button({ className, variant, size, asChild, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
15
|
-
|
|
16
|
-
type LabelProps = React.ComponentProps<typeof LabelPrimitive.Root>;
|
|
17
|
-
declare function Label({ className, ...props }: LabelProps): react_jsx_runtime.JSX.Element;
|
|
18
|
-
|
|
19
|
-
export { type ButtonProps as B, type LabelProps as L, Button as a, Label as b };
|