create-nextjs-cms 0.9.16 → 0.9.17
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/package.json +3 -3
- package/templates/default/components/form/helpers/_section-hot-reload.js +1 -1
- package/templates/default/components/ui/alert-dialog.tsx +84 -128
- package/templates/default/components/ui/alert.tsx +1 -1
- package/templates/default/components/ui/button.tsx +64 -62
- package/templates/default/components/ui/calendar.tsx +220 -166
- package/templates/default/components/ui/checkbox.tsx +29 -29
- package/templates/default/components/ui/command.tsx +1 -1
- package/templates/default/components/ui/custom-alert-dialog.tsx +2 -2
- package/templates/default/components/ui/custom-dialog.tsx +3 -3
- package/templates/default/components/ui/dialog.tsx +3 -3
- package/templates/default/components/ui/dropdown-menu.tsx +9 -9
- package/templates/default/components/ui/input-group.tsx +1 -1
- package/templates/default/components/ui/scroll-area.tsx +1 -1
- package/templates/default/components/ui/select.tsx +3 -3
- package/templates/default/components/ui/sheet.tsx +3 -3
- package/templates/default/components/ui/switch.tsx +1 -1
- package/templates/default/components/ui/table.tsx +2 -2
- package/templates/default/components/ui/toast.tsx +3 -3
- package/templates/default/components/ui/use-toast.ts +0 -1
- package/templates/default/components.json +25 -21
- package/templates/default/dynamic-schemas/schema.ts +1 -1
- package/templates/default/package.json +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-nextjs-cms",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.17",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"tsx": "^4.20.6",
|
|
30
30
|
"typescript": "^5.9.2",
|
|
31
31
|
"@lzcms/eslint-config": "0.3.0",
|
|
32
|
-
"@lzcms/
|
|
33
|
-
"@lzcms/
|
|
32
|
+
"@lzcms/prettier-config": "0.1.0",
|
|
33
|
+
"@lzcms/tsconfig": "0.1.0"
|
|
34
34
|
},
|
|
35
35
|
"prettier": "@lzcms/prettier-config",
|
|
36
36
|
"scripts": {
|
|
@@ -1,157 +1,113 @@
|
|
|
1
|
-
|
|
1
|
+
'use client'
|
|
2
2
|
|
|
3
|
-
import * as React from
|
|
4
|
-
import * as AlertDialogPrimitive from
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog'
|
|
5
5
|
|
|
6
|
-
import { cn } from
|
|
7
|
-
import { buttonVariants } from
|
|
6
|
+
import { cn } from '@/lib/utils'
|
|
7
|
+
import { buttonVariants } from '@/components/ui/button'
|
|
8
8
|
|
|
9
|
-
function AlertDialog({
|
|
10
|
-
|
|
11
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
|
|
12
|
-
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
|
|
9
|
+
function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
|
|
10
|
+
return <AlertDialogPrimitive.Root data-slot='alert-dialog' {...props} />
|
|
13
11
|
}
|
|
14
12
|
|
|
15
|
-
function AlertDialogTrigger({
|
|
16
|
-
|
|
17
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
|
|
18
|
-
return (
|
|
19
|
-
<AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
|
|
20
|
-
)
|
|
13
|
+
function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
|
|
14
|
+
return <AlertDialogPrimitive.Trigger data-slot='alert-dialog-trigger' {...props} />
|
|
21
15
|
}
|
|
22
16
|
|
|
23
|
-
function AlertDialogPortal({
|
|
24
|
-
|
|
25
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
|
|
26
|
-
return (
|
|
27
|
-
<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
|
|
28
|
-
)
|
|
17
|
+
function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
|
|
18
|
+
return <AlertDialogPrimitive.Portal data-slot='alert-dialog-portal' {...props} />
|
|
29
19
|
}
|
|
30
20
|
|
|
31
|
-
function AlertDialogOverlay({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
44
|
-
)
|
|
21
|
+
function AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {
|
|
22
|
+
return (
|
|
23
|
+
<AlertDialogPrimitive.Overlay
|
|
24
|
+
data-slot='alert-dialog-overlay'
|
|
25
|
+
className={cn(
|
|
26
|
+
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',
|
|
27
|
+
className,
|
|
28
|
+
)}
|
|
29
|
+
{...props}
|
|
30
|
+
/>
|
|
31
|
+
)
|
|
45
32
|
}
|
|
46
33
|
|
|
47
|
-
function AlertDialogContent({
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
/>
|
|
62
|
-
</AlertDialogPortal>
|
|
63
|
-
)
|
|
34
|
+
function AlertDialogContent({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {
|
|
35
|
+
return (
|
|
36
|
+
<AlertDialogPortal>
|
|
37
|
+
<AlertDialogOverlay />
|
|
38
|
+
<AlertDialogPrimitive.Content
|
|
39
|
+
data-slot='alert-dialog-content'
|
|
40
|
+
className={cn(
|
|
41
|
+
'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed start-[50%] top-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg rtl:-translate-x-[-50%]',
|
|
42
|
+
className,
|
|
43
|
+
)}
|
|
44
|
+
{...props}
|
|
45
|
+
/>
|
|
46
|
+
</AlertDialogPortal>
|
|
47
|
+
)
|
|
64
48
|
}
|
|
65
49
|
|
|
66
|
-
function AlertDialogHeader({
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
{...props}
|
|
75
|
-
/>
|
|
76
|
-
)
|
|
50
|
+
function AlertDialogHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
51
|
+
return (
|
|
52
|
+
<div
|
|
53
|
+
data-slot='alert-dialog-header'
|
|
54
|
+
className={cn('flex flex-col gap-2 text-center sm:text-start', className)}
|
|
55
|
+
{...props}
|
|
56
|
+
/>
|
|
57
|
+
)
|
|
77
58
|
}
|
|
78
59
|
|
|
79
|
-
function AlertDialogFooter({
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
88
|
-
className
|
|
89
|
-
)}
|
|
90
|
-
{...props}
|
|
91
|
-
/>
|
|
92
|
-
)
|
|
60
|
+
function AlertDialogFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
61
|
+
return (
|
|
62
|
+
<div
|
|
63
|
+
data-slot='alert-dialog-footer'
|
|
64
|
+
className={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className)}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
)
|
|
93
68
|
}
|
|
94
69
|
|
|
95
|
-
function AlertDialogTitle({
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
{...props}
|
|
104
|
-
/>
|
|
105
|
-
)
|
|
70
|
+
function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
|
|
71
|
+
return (
|
|
72
|
+
<AlertDialogPrimitive.Title
|
|
73
|
+
data-slot='alert-dialog-title'
|
|
74
|
+
className={cn('text-lg font-semibold', className)}
|
|
75
|
+
{...props}
|
|
76
|
+
/>
|
|
77
|
+
)
|
|
106
78
|
}
|
|
107
79
|
|
|
108
80
|
function AlertDialogDescription({
|
|
109
|
-
|
|
110
|
-
|
|
81
|
+
className,
|
|
82
|
+
...props
|
|
111
83
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
84
|
+
return (
|
|
85
|
+
<AlertDialogPrimitive.Description
|
|
86
|
+
data-slot='alert-dialog-description'
|
|
87
|
+
className={cn('text-muted-foreground text-sm', className)}
|
|
88
|
+
{...props}
|
|
89
|
+
/>
|
|
90
|
+
)
|
|
119
91
|
}
|
|
120
92
|
|
|
121
|
-
function AlertDialogAction({
|
|
122
|
-
|
|
123
|
-
...props
|
|
124
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {
|
|
125
|
-
return (
|
|
126
|
-
<AlertDialogPrimitive.Action
|
|
127
|
-
className={cn(buttonVariants(), className)}
|
|
128
|
-
{...props}
|
|
129
|
-
/>
|
|
130
|
-
)
|
|
93
|
+
function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {
|
|
94
|
+
return <AlertDialogPrimitive.Action className={cn(buttonVariants(), className)} {...props} />
|
|
131
95
|
}
|
|
132
96
|
|
|
133
|
-
function AlertDialogCancel({
|
|
134
|
-
|
|
135
|
-
...props
|
|
136
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {
|
|
137
|
-
return (
|
|
138
|
-
<AlertDialogPrimitive.Cancel
|
|
139
|
-
className={cn(buttonVariants({ variant: "outline" }), className)}
|
|
140
|
-
{...props}
|
|
141
|
-
/>
|
|
142
|
-
)
|
|
97
|
+
function AlertDialogCancel({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {
|
|
98
|
+
return <AlertDialogPrimitive.Cancel className={cn(buttonVariants({ variant: 'outline' }), className)} {...props} />
|
|
143
99
|
}
|
|
144
100
|
|
|
145
101
|
export {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
102
|
+
AlertDialog,
|
|
103
|
+
AlertDialogPortal,
|
|
104
|
+
AlertDialogOverlay,
|
|
105
|
+
AlertDialogTrigger,
|
|
106
|
+
AlertDialogContent,
|
|
107
|
+
AlertDialogHeader,
|
|
108
|
+
AlertDialogFooter,
|
|
109
|
+
AlertDialogTitle,
|
|
110
|
+
AlertDialogDescription,
|
|
111
|
+
AlertDialogAction,
|
|
112
|
+
AlertDialogCancel,
|
|
157
113
|
}
|
|
@@ -4,7 +4,7 @@ import { cva, type VariantProps } from 'class-variance-authority'
|
|
|
4
4
|
import { cn } from '@/lib/utils'
|
|
5
5
|
|
|
6
6
|
const alertVariants = cva(
|
|
7
|
-
'relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:
|
|
7
|
+
'relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:start-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:ps-7',
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
@@ -1,62 +1,64 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { cn } from "@/lib/utils"
|
|
6
|
-
|
|
7
|
-
const buttonVariants = cva(
|
|
8
|
-
"inline-flex items-center justify-center gap-2
|
|
9
|
-
{
|
|
10
|
-
variants: {
|
|
11
|
-
variant: {
|
|
12
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
13
|
-
destructive:
|
|
14
|
-
"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40
|
|
15
|
-
outline:
|
|
16
|
-
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:
|
|
17
|
-
secondary:
|
|
18
|
-
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
19
|
-
ghost:
|
|
20
|
-
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
21
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
22
|
-
},
|
|
23
|
-
size: {
|
|
24
|
-
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"icon-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
data-
|
|
56
|
-
|
|
57
|
-
{
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
+
import { Slot } from "radix-ui"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
|
|
7
|
+
const buttonVariants = cva(
|
|
8
|
+
"inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
13
|
+
destructive:
|
|
14
|
+
"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
|
|
15
|
+
outline:
|
|
16
|
+
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
17
|
+
secondary:
|
|
18
|
+
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
19
|
+
ghost:
|
|
20
|
+
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
21
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
22
|
+
},
|
|
23
|
+
size: {
|
|
24
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
25
|
+
xs: "h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
26
|
+
sm: "h-8 gap-1.5 rounded-md 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-xs": "size-6 rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
30
|
+
"icon-sm": "size-8",
|
|
31
|
+
"icon-lg": "size-10",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
variant: "default",
|
|
36
|
+
size: "default",
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
function Button({
|
|
42
|
+
className,
|
|
43
|
+
variant = "default",
|
|
44
|
+
size = "default",
|
|
45
|
+
asChild = false,
|
|
46
|
+
...props
|
|
47
|
+
}: React.ComponentProps<"button"> &
|
|
48
|
+
VariantProps<typeof buttonVariants> & {
|
|
49
|
+
asChild?: boolean
|
|
50
|
+
}) {
|
|
51
|
+
const Comp = asChild ? Slot.Root : "button"
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<Comp
|
|
55
|
+
data-slot="button"
|
|
56
|
+
data-variant={variant}
|
|
57
|
+
data-size={size}
|
|
58
|
+
className={cn(buttonVariants({ variant, size, className }))}
|
|
59
|
+
{...props}
|
|
60
|
+
/>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export { Button, buttonVariants }
|
|
@@ -1,166 +1,220 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import * as React from
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import {
|
|
5
|
+
ChevronDownIcon,
|
|
6
|
+
ChevronLeftIcon,
|
|
7
|
+
ChevronRightIcon,
|
|
8
|
+
} from "lucide-react"
|
|
9
|
+
import {
|
|
10
|
+
DayPicker,
|
|
11
|
+
getDefaultClassNames,
|
|
12
|
+
type DayButton,
|
|
13
|
+
} from "react-day-picker"
|
|
14
|
+
|
|
15
|
+
import { cn } from "@/lib/utils"
|
|
16
|
+
import { Button, buttonVariants } from "@/components/ui/button"
|
|
17
|
+
|
|
18
|
+
function Calendar({
|
|
19
|
+
className,
|
|
20
|
+
classNames,
|
|
21
|
+
showOutsideDays = true,
|
|
22
|
+
captionLayout = "label",
|
|
23
|
+
buttonVariant = "ghost",
|
|
24
|
+
formatters,
|
|
25
|
+
components,
|
|
26
|
+
...props
|
|
27
|
+
}: React.ComponentProps<typeof DayPicker> & {
|
|
28
|
+
buttonVariant?: React.ComponentProps<typeof Button>["variant"]
|
|
29
|
+
}) {
|
|
30
|
+
const defaultClassNames = getDefaultClassNames()
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<DayPicker
|
|
34
|
+
showOutsideDays={showOutsideDays}
|
|
35
|
+
className={cn(
|
|
36
|
+
"group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
37
|
+
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
38
|
+
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
39
|
+
className
|
|
40
|
+
)}
|
|
41
|
+
captionLayout={captionLayout}
|
|
42
|
+
formatters={{
|
|
43
|
+
formatMonthDropdown: (date) =>
|
|
44
|
+
date.toLocaleString("default", { month: "short" }),
|
|
45
|
+
...formatters,
|
|
46
|
+
}}
|
|
47
|
+
classNames={{
|
|
48
|
+
root: cn("w-fit", defaultClassNames.root),
|
|
49
|
+
months: cn(
|
|
50
|
+
"relative flex flex-col gap-4 md:flex-row",
|
|
51
|
+
defaultClassNames.months
|
|
52
|
+
),
|
|
53
|
+
month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
54
|
+
nav: cn(
|
|
55
|
+
"absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
|
|
56
|
+
defaultClassNames.nav
|
|
57
|
+
),
|
|
58
|
+
button_previous: cn(
|
|
59
|
+
buttonVariants({ variant: buttonVariant }),
|
|
60
|
+
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
61
|
+
defaultClassNames.button_previous
|
|
62
|
+
),
|
|
63
|
+
button_next: cn(
|
|
64
|
+
buttonVariants({ variant: buttonVariant }),
|
|
65
|
+
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
66
|
+
defaultClassNames.button_next
|
|
67
|
+
),
|
|
68
|
+
month_caption: cn(
|
|
69
|
+
"flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
|
|
70
|
+
defaultClassNames.month_caption
|
|
71
|
+
),
|
|
72
|
+
dropdowns: cn(
|
|
73
|
+
"flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium",
|
|
74
|
+
defaultClassNames.dropdowns
|
|
75
|
+
),
|
|
76
|
+
dropdown_root: cn(
|
|
77
|
+
"relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50",
|
|
78
|
+
defaultClassNames.dropdown_root
|
|
79
|
+
),
|
|
80
|
+
dropdown: cn(
|
|
81
|
+
"absolute inset-0 bg-popover opacity-0",
|
|
82
|
+
defaultClassNames.dropdown
|
|
83
|
+
),
|
|
84
|
+
caption_label: cn(
|
|
85
|
+
"font-medium select-none",
|
|
86
|
+
captionLayout === "label"
|
|
87
|
+
? "text-sm"
|
|
88
|
+
: "flex h-8 items-center gap-1 rounded-md pe-1 ps-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground",
|
|
89
|
+
defaultClassNames.caption_label
|
|
90
|
+
),
|
|
91
|
+
table: "w-full border-collapse",
|
|
92
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
93
|
+
weekday: cn(
|
|
94
|
+
"flex-1 rounded-md text-[0.8rem] font-normal text-muted-foreground select-none",
|
|
95
|
+
defaultClassNames.weekday
|
|
96
|
+
),
|
|
97
|
+
week: cn("mt-2 flex w-full", defaultClassNames.week),
|
|
98
|
+
week_number_header: cn(
|
|
99
|
+
"w-(--cell-size) select-none",
|
|
100
|
+
defaultClassNames.week_number_header
|
|
101
|
+
),
|
|
102
|
+
week_number: cn(
|
|
103
|
+
"text-[0.8rem] text-muted-foreground select-none",
|
|
104
|
+
defaultClassNames.week_number
|
|
105
|
+
),
|
|
106
|
+
day: cn(
|
|
107
|
+
"group/day relative aspect-square h-full w-full p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-e-md",
|
|
108
|
+
props.showWeekNumber
|
|
109
|
+
? "[&:nth-child(2)[data-selected=true]_button]:rounded-s-md"
|
|
110
|
+
: "[&:first-child[data-selected=true]_button]:rounded-s-md",
|
|
111
|
+
defaultClassNames.day
|
|
112
|
+
),
|
|
113
|
+
range_start: cn(
|
|
114
|
+
"rounded-s-md bg-accent",
|
|
115
|
+
defaultClassNames.range_start
|
|
116
|
+
),
|
|
117
|
+
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
118
|
+
range_end: cn("rounded-e-md bg-accent", defaultClassNames.range_end),
|
|
119
|
+
today: cn(
|
|
120
|
+
"rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none",
|
|
121
|
+
defaultClassNames.today
|
|
122
|
+
),
|
|
123
|
+
outside: cn(
|
|
124
|
+
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
125
|
+
defaultClassNames.outside
|
|
126
|
+
),
|
|
127
|
+
disabled: cn(
|
|
128
|
+
"text-muted-foreground opacity-50",
|
|
129
|
+
defaultClassNames.disabled
|
|
130
|
+
),
|
|
131
|
+
hidden: cn("invisible", defaultClassNames.hidden),
|
|
132
|
+
...classNames,
|
|
133
|
+
}}
|
|
134
|
+
components={{
|
|
135
|
+
Root: ({ className, rootRef, ...props }) => {
|
|
136
|
+
return (
|
|
137
|
+
<div
|
|
138
|
+
data-slot="calendar"
|
|
139
|
+
ref={rootRef}
|
|
140
|
+
className={cn(className)}
|
|
141
|
+
{...props}
|
|
142
|
+
/>
|
|
143
|
+
)
|
|
144
|
+
},
|
|
145
|
+
Chevron: ({ className, orientation, ...props }) => {
|
|
146
|
+
if (orientation === "left") {
|
|
147
|
+
return (
|
|
148
|
+
<ChevronLeftIcon className={cn("size-4", className)} {...props} />
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (orientation === "right") {
|
|
153
|
+
return (
|
|
154
|
+
<ChevronRightIcon
|
|
155
|
+
className={cn("size-4", className)}
|
|
156
|
+
{...props}
|
|
157
|
+
/>
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return (
|
|
162
|
+
<ChevronDownIcon className={cn("size-4", className)} {...props} />
|
|
163
|
+
)
|
|
164
|
+
},
|
|
165
|
+
DayButton: CalendarDayButton,
|
|
166
|
+
WeekNumber: ({ children, ...props }) => {
|
|
167
|
+
return (
|
|
168
|
+
<td {...props}>
|
|
169
|
+
<div className="flex size-(--cell-size) items-center justify-center text-center">
|
|
170
|
+
{children}
|
|
171
|
+
</div>
|
|
172
|
+
</td>
|
|
173
|
+
)
|
|
174
|
+
},
|
|
175
|
+
...components,
|
|
176
|
+
}}
|
|
177
|
+
{...props}
|
|
178
|
+
/>
|
|
179
|
+
)
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function CalendarDayButton({
|
|
183
|
+
className,
|
|
184
|
+
day,
|
|
185
|
+
modifiers,
|
|
186
|
+
...props
|
|
187
|
+
}: React.ComponentProps<typeof DayButton>) {
|
|
188
|
+
const defaultClassNames = getDefaultClassNames()
|
|
189
|
+
|
|
190
|
+
const ref = React.useRef<HTMLButtonElement>(null)
|
|
191
|
+
React.useEffect(() => {
|
|
192
|
+
if (modifiers.focused) ref.current?.focus()
|
|
193
|
+
}, [modifiers.focused])
|
|
194
|
+
|
|
195
|
+
return (
|
|
196
|
+
<Button
|
|
197
|
+
ref={ref}
|
|
198
|
+
variant="ghost"
|
|
199
|
+
size="icon"
|
|
200
|
+
data-day={day.date.toLocaleDateString()}
|
|
201
|
+
data-selected-single={
|
|
202
|
+
modifiers.selected &&
|
|
203
|
+
!modifiers.range_start &&
|
|
204
|
+
!modifiers.range_end &&
|
|
205
|
+
!modifiers.range_middle
|
|
206
|
+
}
|
|
207
|
+
data-range-start={modifiers.range_start}
|
|
208
|
+
data-range-end={modifiers.range_end}
|
|
209
|
+
data-range-middle={modifiers.range_middle}
|
|
210
|
+
className={cn(
|
|
211
|
+
"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:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-e-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-s-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70",
|
|
212
|
+
defaultClassNames.day,
|
|
213
|
+
className
|
|
214
|
+
)}
|
|
215
|
+
{...props}
|
|
216
|
+
/>
|
|
217
|
+
)
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export { Calendar, CalendarDayButton }
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import * as React from 'react'
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { cn } from '@/lib/utils'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export { Checkbox }
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { CheckIcon } from 'lucide-react'
|
|
5
|
+
import { Checkbox as CheckboxPrimitive } from 'radix-ui'
|
|
6
|
+
|
|
7
|
+
import { cn } from '@/lib/utils'
|
|
8
|
+
|
|
9
|
+
function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
|
|
10
|
+
return (
|
|
11
|
+
<CheckboxPrimitive.Root
|
|
12
|
+
data-slot='checkbox'
|
|
13
|
+
className={cn(
|
|
14
|
+
'peer border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',
|
|
15
|
+
className,
|
|
16
|
+
)}
|
|
17
|
+
{...props}
|
|
18
|
+
>
|
|
19
|
+
<CheckboxPrimitive.Indicator
|
|
20
|
+
data-slot='checkbox-indicator'
|
|
21
|
+
className='grid place-content-center text-current transition-none'
|
|
22
|
+
>
|
|
23
|
+
<CheckIcon className='size-3.5' />
|
|
24
|
+
</CheckboxPrimitive.Indicator>
|
|
25
|
+
</CheckboxPrimitive.Root>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { Checkbox }
|
|
@@ -118,7 +118,7 @@ function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>)
|
|
|
118
118
|
return (
|
|
119
119
|
<span
|
|
120
120
|
data-slot='command-shortcut'
|
|
121
|
-
className={cn('text-muted-foreground
|
|
121
|
+
className={cn('text-muted-foreground ms-auto text-xs tracking-widest', className)}
|
|
122
122
|
{...props}
|
|
123
123
|
/>
|
|
124
124
|
)
|
|
@@ -38,7 +38,7 @@ function AlertDialogContent({ className, ...props }: React.ComponentProps<typeof
|
|
|
38
38
|
<AlertDialogPrimitive.Content
|
|
39
39
|
data-slot='alert-dialog-content'
|
|
40
40
|
className={cn(
|
|
41
|
-
'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed
|
|
41
|
+
'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed start-[50%] top-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 rtl:-translate-x-[-50%]',
|
|
42
42
|
className,
|
|
43
43
|
)}
|
|
44
44
|
{...props}
|
|
@@ -51,7 +51,7 @@ function AlertDialogHeader({ className, ...props }: React.ComponentProps<'div'>)
|
|
|
51
51
|
return (
|
|
52
52
|
<div
|
|
53
53
|
data-slot='alert-dialog-header'
|
|
54
|
-
className={cn('flex flex-col gap-2 text-center sm:text-
|
|
54
|
+
className={cn('flex flex-col gap-2 text-center sm:text-start', className)}
|
|
55
55
|
{...props}
|
|
56
56
|
/>
|
|
57
57
|
)
|
|
@@ -49,7 +49,7 @@ function DialogContent({
|
|
|
49
49
|
<DialogPrimitive.Content
|
|
50
50
|
data-slot='dialog-content'
|
|
51
51
|
className={cn(
|
|
52
|
-
'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed
|
|
52
|
+
'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed start-[50%] top-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] border p-6 shadow-lg duration-200 outline-none rtl:-translate-x-[-50%]',
|
|
53
53
|
className,
|
|
54
54
|
)}
|
|
55
55
|
{...props}
|
|
@@ -58,7 +58,7 @@ function DialogContent({
|
|
|
58
58
|
{showCloseButton && (
|
|
59
59
|
<DialogPrimitive.Close
|
|
60
60
|
data-slot='dialog-close'
|
|
61
|
-
className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute
|
|
61
|
+
className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute end-4 top-4 opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
62
62
|
>
|
|
63
63
|
<XIcon />
|
|
64
64
|
<span className='sr-only'>Close</span>
|
|
@@ -73,7 +73,7 @@ function DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
73
73
|
return (
|
|
74
74
|
<div
|
|
75
75
|
data-slot='dialog-header'
|
|
76
|
-
className={cn('flex flex-col gap-2 text-center sm:text-
|
|
76
|
+
className={cn('flex flex-col gap-2 text-center sm:text-start', className)}
|
|
77
77
|
{...props}
|
|
78
78
|
/>
|
|
79
79
|
)
|
|
@@ -49,7 +49,7 @@ function DialogContent({
|
|
|
49
49
|
<DialogPrimitive.Content
|
|
50
50
|
data-slot='dialog-content'
|
|
51
51
|
className={cn(
|
|
52
|
-
'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed
|
|
52
|
+
'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed start-[50%] top-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg rtl:-translate-x-[-50%]',
|
|
53
53
|
className,
|
|
54
54
|
)}
|
|
55
55
|
{...props}
|
|
@@ -58,7 +58,7 @@ function DialogContent({
|
|
|
58
58
|
{showCloseButton && (
|
|
59
59
|
<DialogPrimitive.Close
|
|
60
60
|
data-slot='dialog-close'
|
|
61
|
-
className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute
|
|
61
|
+
className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
62
62
|
>
|
|
63
63
|
<XIcon />
|
|
64
64
|
<span className='sr-only'>Close</span>
|
|
@@ -73,7 +73,7 @@ function DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
73
73
|
return (
|
|
74
74
|
<div
|
|
75
75
|
data-slot='dialog-header'
|
|
76
|
-
className={cn('flex flex-col gap-2 text-center sm:text-
|
|
76
|
+
className={cn('flex flex-col gap-2 text-center sm:text-start', className)}
|
|
77
77
|
{...props}
|
|
78
78
|
/>
|
|
79
79
|
)
|
|
@@ -28,13 +28,13 @@ const DropdownMenuSubTrigger = React.forwardRef<
|
|
|
28
28
|
ref={ref}
|
|
29
29
|
className={cn(
|
|
30
30
|
'focus:bg-accent data-[state=open]:bg-accent flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none',
|
|
31
|
-
inset && '
|
|
31
|
+
inset && 'ps-8',
|
|
32
32
|
className,
|
|
33
33
|
)}
|
|
34
34
|
{...props}
|
|
35
35
|
>
|
|
36
36
|
{children}
|
|
37
|
-
<ChevronRightIcon className='
|
|
37
|
+
<ChevronRightIcon className='ms-auto h-4 w-4' />
|
|
38
38
|
</DropdownMenuPrimitive.SubTrigger>
|
|
39
39
|
))
|
|
40
40
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName
|
|
@@ -83,7 +83,7 @@ const DropdownMenuItem = React.forwardRef<
|
|
|
83
83
|
ref={ref}
|
|
84
84
|
className={cn(
|
|
85
85
|
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors select-none data-disabled:pointer-events-none data-disabled:opacity-50',
|
|
86
|
-
inset && '
|
|
86
|
+
inset && 'ps-8',
|
|
87
87
|
className,
|
|
88
88
|
)}
|
|
89
89
|
{...props}
|
|
@@ -98,13 +98,13 @@ const DropdownMenuCheckboxItem = React.forwardRef<
|
|
|
98
98
|
<DropdownMenuPrimitive.CheckboxItem
|
|
99
99
|
ref={ref}
|
|
100
100
|
className={cn(
|
|
101
|
-
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5
|
|
101
|
+
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 ps-8 pe-2 text-sm outline-hidden transition-colors select-none data-disabled:pointer-events-none data-disabled:opacity-50',
|
|
102
102
|
className,
|
|
103
103
|
)}
|
|
104
104
|
checked={checked}
|
|
105
105
|
{...props}
|
|
106
106
|
>
|
|
107
|
-
<span className='absolute
|
|
107
|
+
<span className='absolute start-2 flex h-3.5 w-3.5 items-center justify-center'>
|
|
108
108
|
<DropdownMenuPrimitive.ItemIndicator>
|
|
109
109
|
<CheckIcon className='h-4 w-4' />
|
|
110
110
|
</DropdownMenuPrimitive.ItemIndicator>
|
|
@@ -121,12 +121,12 @@ const DropdownMenuRadioItem = React.forwardRef<
|
|
|
121
121
|
<DropdownMenuPrimitive.RadioItem
|
|
122
122
|
ref={ref}
|
|
123
123
|
className={cn(
|
|
124
|
-
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5
|
|
124
|
+
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 ps-8 pe-2 text-sm outline-hidden transition-colors select-none data-disabled:pointer-events-none data-disabled:opacity-50',
|
|
125
125
|
className,
|
|
126
126
|
)}
|
|
127
127
|
{...props}
|
|
128
128
|
>
|
|
129
|
-
<span className='absolute
|
|
129
|
+
<span className='absolute start-2 flex h-3.5 w-3.5 items-center justify-center'>
|
|
130
130
|
<DropdownMenuPrimitive.ItemIndicator>
|
|
131
131
|
<DotFilledIcon className='h-4 w-4 fill-current' />
|
|
132
132
|
</DropdownMenuPrimitive.ItemIndicator>
|
|
@@ -144,7 +144,7 @@ const DropdownMenuLabel = React.forwardRef<
|
|
|
144
144
|
>(({ className, inset, ...props }, ref) => (
|
|
145
145
|
<DropdownMenuPrimitive.Label
|
|
146
146
|
ref={ref}
|
|
147
|
-
className={cn('px-2 py-1.5 text-sm font-semibold', inset && '
|
|
147
|
+
className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'ps-8', className)}
|
|
148
148
|
{...props}
|
|
149
149
|
/>
|
|
150
150
|
))
|
|
@@ -159,7 +159,7 @@ const DropdownMenuSeparator = React.forwardRef<
|
|
|
159
159
|
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
|
|
160
160
|
|
|
161
161
|
const DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
162
|
-
return <span className={cn('
|
|
162
|
+
return <span className={cn('ms-auto text-xs tracking-widest opacity-60', className)} {...props} />
|
|
163
163
|
}
|
|
164
164
|
DropdownMenuShortcut.displayName = 'DropdownMenuShortcut'
|
|
165
165
|
|
|
@@ -8,7 +8,7 @@ const InputGroup = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDiv
|
|
|
8
8
|
<div
|
|
9
9
|
ref={ref}
|
|
10
10
|
className={cn(
|
|
11
|
-
'flex items-stretch overflow-hidden rounded shadow-xs ring-2 ring-gray-300 outline-0
|
|
11
|
+
'flex items-stretch overflow-hidden rounded shadow-xs ring-2 ring-gray-300 outline-0 focus-within:ring-blue-500 hover:ring-gray-400 hover:focus-within:ring-blue-500',
|
|
12
12
|
className,
|
|
13
13
|
)}
|
|
14
14
|
{...props}
|
|
@@ -28,7 +28,7 @@ const ScrollBar = React.forwardRef<
|
|
|
28
28
|
orientation={orientation}
|
|
29
29
|
className={cn(
|
|
30
30
|
'flex touch-none transition-colors select-none',
|
|
31
|
-
orientation === 'vertical' && 'h-full w-2.5 border-
|
|
31
|
+
orientation === 'vertical' && 'h-full w-2.5 border-s border-s-transparent p-px',
|
|
32
32
|
orientation === 'horizontal' && 'h-2.5 flex-col border-t border-t-transparent p-px',
|
|
33
33
|
className,
|
|
34
34
|
)}
|
|
@@ -58,7 +58,7 @@ function SelectContent({
|
|
|
58
58
|
className={cn(
|
|
59
59
|
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md',
|
|
60
60
|
position === 'popper' &&
|
|
61
|
-
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
|
|
61
|
+
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1 rtl:data-[side=left]:translate-x-1 rtl:data-[side=right]:-translate-x-1',
|
|
62
62
|
className,
|
|
63
63
|
)}
|
|
64
64
|
position={position}
|
|
@@ -96,14 +96,14 @@ function SelectItem({ className, children, ...props }: React.ComponentProps<type
|
|
|
96
96
|
<SelectPrimitive.Item
|
|
97
97
|
data-slot='select-item'
|
|
98
98
|
className={cn(
|
|
99
|
-
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5
|
|
99
|
+
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 ps-2 pe-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
100
100
|
className,
|
|
101
101
|
)}
|
|
102
102
|
{...props}
|
|
103
103
|
>
|
|
104
104
|
<span
|
|
105
105
|
data-slot='select-item-indicator'
|
|
106
|
-
className='absolute
|
|
106
|
+
className='absolute end-2 flex size-3.5 items-center justify-center'
|
|
107
107
|
>
|
|
108
108
|
<SelectPrimitive.ItemIndicator>
|
|
109
109
|
<CheckIcon className='size-4' />
|
|
@@ -51,9 +51,9 @@ function SheetContent({
|
|
|
51
51
|
className={cn(
|
|
52
52
|
'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
|
|
53
53
|
side === 'right' &&
|
|
54
|
-
'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0
|
|
54
|
+
'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 end-0 h-full w-3/4 border-s sm:max-w-sm',
|
|
55
55
|
side === 'left' &&
|
|
56
|
-
'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0
|
|
56
|
+
'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 start-0 h-full w-3/4 border-e sm:max-w-sm',
|
|
57
57
|
side === 'top' &&
|
|
58
58
|
'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',
|
|
59
59
|
side === 'bottom' &&
|
|
@@ -63,7 +63,7 @@ function SheetContent({
|
|
|
63
63
|
{...props}
|
|
64
64
|
>
|
|
65
65
|
{children}
|
|
66
|
-
<SheetPrimitive.Close className='ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute
|
|
66
|
+
<SheetPrimitive.Close className='ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none'>
|
|
67
67
|
<XIcon className='size-4' />
|
|
68
68
|
<span className='sr-only'>Close</span>
|
|
69
69
|
</SheetPrimitive.Close>
|
|
@@ -19,7 +19,7 @@ const Switch = React.forwardRef<
|
|
|
19
19
|
>
|
|
20
20
|
<SwitchPrimitives.Thumb
|
|
21
21
|
className={cn(
|
|
22
|
-
'bg-background pointer-events-none block h-4 w-4 rounded-full shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0',
|
|
22
|
+
'bg-background pointer-events-none block h-4 w-4 rounded-full shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0 rtl:data-[state=checked]:-translate-x-4 rtl:data-[state=unchecked]:-translate-x-0',
|
|
23
23
|
)}
|
|
24
24
|
/>
|
|
25
25
|
</SwitchPrimitives.Root>
|
|
@@ -50,7 +50,7 @@ const TableHead = React.forwardRef<HTMLTableCellElement, React.ThHTMLAttributes<
|
|
|
50
50
|
<th
|
|
51
51
|
ref={ref}
|
|
52
52
|
className={cn(
|
|
53
|
-
'text-muted-foreground h-10 px-2 text-
|
|
53
|
+
'text-muted-foreground h-10 px-2 text-start align-middle font-medium [&:has([role=checkbox])]:pe-0 *:[[role=checkbox]]:translate-y-[2px]',
|
|
54
54
|
className,
|
|
55
55
|
)}
|
|
56
56
|
{...props}
|
|
@@ -64,7 +64,7 @@ const TableCell = React.forwardRef<HTMLTableCellElement, React.TdHTMLAttributes<
|
|
|
64
64
|
<td
|
|
65
65
|
ref={ref}
|
|
66
66
|
className={cn(
|
|
67
|
-
'p-2 align-middle [&:has([role=checkbox])]:
|
|
67
|
+
'p-2 align-middle [&:has([role=checkbox])]:pe-0 *:[[role=checkbox]]:translate-y-[2px]',
|
|
68
68
|
className,
|
|
69
69
|
)}
|
|
70
70
|
{...props}
|
|
@@ -14,7 +14,7 @@ const ToastViewport = React.forwardRef<
|
|
|
14
14
|
<ToastPrimitives.Viewport
|
|
15
15
|
ref={ref}
|
|
16
16
|
className={cn(
|
|
17
|
-
'fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:
|
|
17
|
+
'fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:end-0 sm:top-auto sm:bottom-0 sm:flex-col md:max-w-[420px]',
|
|
18
18
|
className,
|
|
19
19
|
)}
|
|
20
20
|
{...props}
|
|
@@ -23,7 +23,7 @@ const ToastViewport = React.forwardRef<
|
|
|
23
23
|
ToastViewport.displayName = ToastPrimitives.Viewport.displayName
|
|
24
24
|
|
|
25
25
|
const toastVariants = cva(
|
|
26
|
-
'group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4
|
|
26
|
+
'group pointer-events-auto relative flex w-full items-center justify-between space-x-2 rtl:space-x-reverse overflow-hidden rounded-md border p-4 pe-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 rtl:data-[swipe=cancel]:-translate-x-0 data-[swipe=end]:translate-x-(--radix-toast-swipe-end-x) rtl:data-[swipe=end]:-translate-x-(--radix-toast-swipe-end-x) data-[swipe=move]:translate-x-(--radix-toast-swipe-move-x) rtl:data-[swipe=move]:-translate-x-(--radix-toast-swipe-move-x) data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full',
|
|
27
27
|
{
|
|
28
28
|
variants: {
|
|
29
29
|
variant: {
|
|
@@ -69,7 +69,7 @@ const ToastClose = React.forwardRef<
|
|
|
69
69
|
<ToastPrimitives.Close
|
|
70
70
|
ref={ref}
|
|
71
71
|
className={cn(
|
|
72
|
-
'text-foreground/50 hover:text-foreground absolute
|
|
72
|
+
'text-foreground/50 hover:text-foreground absolute end-1 top-1 rounded-md p-1 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:group-[.destructive]:text-red-50 focus:opacity-100 focus:ring-1 focus:outline-hidden focus:group-[.destructive]:ring-red-400 focus:group-[.destructive]:ring-offset-red-600',
|
|
73
73
|
className,
|
|
74
74
|
)}
|
|
75
75
|
toast-close=''
|
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "new-york",
|
|
4
|
+
"rsc": true,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"rtl": true,
|
|
7
|
+
"tailwind": {
|
|
8
|
+
"config": "",
|
|
9
|
+
"prefix": "",
|
|
10
|
+
"css": "styles/globals.css",
|
|
11
|
+
"baseColor": "slate",
|
|
12
|
+
"cssVariables": true
|
|
13
|
+
},
|
|
14
|
+
"aliases": {
|
|
15
|
+
"components": "@/components",
|
|
16
|
+
"utils": "@/lib/utils",
|
|
17
|
+
"ui": "@/components/ui",
|
|
18
|
+
"lib": "@/lib",
|
|
19
|
+
"hooks": "@/hooks"
|
|
20
|
+
},
|
|
21
|
+
"menuColor": "default",
|
|
22
|
+
"menuAccent": "subtle",
|
|
23
|
+
"iconLibrary": "lucide",
|
|
24
|
+
"registries": {}
|
|
25
|
+
}
|
|
@@ -47,7 +47,7 @@ export const TestSectionTable = mysqlTable('test_section', {
|
|
|
47
47
|
export const TestTagsTable = mysqlTable('test_tags', {
|
|
48
48
|
testId: varchar('test_id', { length: 255 }).notNull(),
|
|
49
49
|
tagName: varchar('tag_name', { length: 255 }).notNull(),
|
|
50
|
-
locale: varchar('locale', { length: 255 })
|
|
50
|
+
locale: varchar('locale', { length: 255 }).notNull()
|
|
51
51
|
}, (table) => [
|
|
52
52
|
primaryKey({ columns: [table.testId, table.tagName, table.locale] })
|
|
53
53
|
]);
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"classnames": "^2.5.1",
|
|
58
58
|
"clsx": "^2.1.1",
|
|
59
59
|
"cmdk": "^1.1.1",
|
|
60
|
+
"date-fns": "^4.1.0",
|
|
60
61
|
"dayjs": "^1.11.19",
|
|
61
62
|
"dompurify": "^3.3.3",
|
|
62
63
|
"dotenv": "^17.2.3",
|
|
@@ -69,13 +70,13 @@
|
|
|
69
70
|
"nanoid": "^5.1.2",
|
|
70
71
|
"next": "16.1.1",
|
|
71
72
|
"next-themes": "^0.4.6",
|
|
72
|
-
"nextjs-cms": "0.9.
|
|
73
|
+
"nextjs-cms": "0.9.17",
|
|
73
74
|
"plaiceholder": "^3.0.0",
|
|
74
75
|
"prettier-plugin-tailwindcss": "^0.7.2",
|
|
75
76
|
"qrcode": "^1.5.4",
|
|
76
77
|
"radix-ui": "^1.4.3",
|
|
77
78
|
"react": "19.2.3",
|
|
78
|
-
"react-day-picker": "9.
|
|
79
|
+
"react-day-picker": "9.14.0",
|
|
79
80
|
"react-dom": "19.2.3",
|
|
80
81
|
"react-dropzone": "^14.3.5",
|
|
81
82
|
"react-hook-form": "^7.66.1",
|