@betterstart/cli 0.1.68 → 0.1.70
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-E4HZYXQ2.js +36 -0
- package/dist/chunk-E4HZYXQ2.js.map +1 -0
- package/dist/cli.js +580 -4443
- package/dist/cli.js.map +1 -1
- package/dist/reader-2T45D7JZ.js +7 -0
- package/package.json +3 -2
- package/templates/init/api/auth-route.ts +3 -0
- package/templates/init/api/upload-route.ts +74 -0
- package/templates/init/cms-globals.css +200 -0
- package/templates/init/components/data-table/data-table-pagination.tsx +90 -0
- package/templates/init/components/data-table/data-table-toolbar.tsx +93 -0
- package/templates/init/components/data-table/data-table.tsx +188 -0
- package/templates/init/components/layout/cms-header.tsx +32 -0
- package/templates/init/components/layout/cms-nav-link.tsx +25 -0
- package/templates/init/components/layout/cms-providers.tsx +33 -0
- package/templates/init/components/layout/cms-search.tsx +25 -0
- package/templates/init/components/layout/cms-sidebar.tsx +192 -0
- package/templates/init/components/layout/cms-sign-out.tsx +30 -0
- package/templates/init/components/shared/delete-dialog.tsx +75 -0
- package/templates/init/components/shared/page-header.tsx +23 -0
- package/templates/init/components/shared/status-badge.tsx +43 -0
- package/templates/init/data/navigation.ts +39 -0
- package/templates/init/db/client.ts +8 -0
- package/templates/init/db/schema.ts +88 -0
- package/{dist/chunk-6JCWMKSY.js → templates/init/drizzle.config.ts} +2 -11
- package/templates/init/hooks/use-cms-theme.tsx +78 -0
- package/templates/init/hooks/use-editor-image-upload.ts +82 -0
- package/templates/init/hooks/use-local-storage.ts +46 -0
- package/templates/init/hooks/use-mobile.ts +19 -0
- package/templates/init/hooks/use-upload.ts +177 -0
- package/templates/init/hooks/use-users.ts +13 -0
- package/templates/init/lib/actions/form-settings.ts +126 -0
- package/templates/init/lib/actions/profile.ts +62 -0
- package/templates/init/lib/actions/upload.ts +153 -0
- package/templates/init/lib/actions/users.ts +145 -0
- package/templates/init/lib/auth/auth-client.ts +12 -0
- package/templates/init/lib/auth/auth.ts +43 -0
- package/templates/init/lib/auth/middleware.ts +44 -0
- package/templates/init/lib/markdown/cached.ts +7 -0
- package/templates/init/lib/markdown/format.ts +55 -0
- package/templates/init/lib/markdown/render.ts +182 -0
- package/templates/init/lib/r2.ts +55 -0
- package/templates/init/pages/account-layout.tsx +63 -0
- package/templates/init/pages/authenticated-layout.tsx +26 -0
- package/templates/init/pages/cms-layout.tsx +16 -0
- package/templates/init/pages/dashboard-page.tsx +91 -0
- package/templates/init/pages/login-form.tsx +117 -0
- package/templates/init/pages/login-page.tsx +17 -0
- package/templates/init/pages/profile/profile-form.tsx +361 -0
- package/templates/init/pages/profile/profile-page.tsx +34 -0
- package/templates/init/pages/users/columns.tsx +241 -0
- package/templates/init/pages/users/create-user-dialog.tsx +116 -0
- package/templates/init/pages/users/edit-role-dialog.tsx +92 -0
- package/templates/init/pages/users/users-page-content.tsx +29 -0
- package/templates/init/pages/users/users-page.tsx +19 -0
- package/templates/init/pages/users/users-table.tsx +219 -0
- package/templates/init/types/auth.ts +78 -0
- package/templates/init/types/index.ts +79 -0
- package/templates/init/types/table-meta.ts +16 -0
- package/templates/init/utils/cn.ts +6 -0
- package/templates/init/utils/mailchimp.ts +39 -0
- package/templates/init/utils/seo.ts +90 -0
- package/templates/init/utils/validation.ts +105 -0
- package/templates/init/utils/webhook.ts +28 -0
- package/templates/ui/alert-dialog.tsx +46 -28
- package/templates/ui/avatar.tsx +37 -20
- package/templates/ui/button.tsx +3 -3
- package/templates/ui/card.tsx +30 -18
- package/templates/ui/dialog.tsx +46 -22
- package/templates/ui/dropdown-menu.tsx +1 -1
- package/templates/ui/input.tsx +1 -1
- package/templates/ui/select.tsx +42 -34
- package/templates/ui/sidebar.tsx +13 -13
- package/templates/ui/table.tsx +2 -2
- package/dist/chunk-6JCWMKSY.js.map +0 -1
- package/dist/drizzle-config-EDKOEZ6G.js +0 -7
- /package/dist/{drizzle-config-EDKOEZ6G.js.map → reader-2T45D7JZ.js.map} +0 -0
|
@@ -1,22 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
"use client"
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { AlertDialog as AlertDialogPrimitive } from 'radix-ui'
|
|
6
|
-
import type * as React from 'react'
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { AlertDialog as AlertDialogPrimitive } from "radix-ui"
|
|
7
5
|
|
|
8
|
-
|
|
6
|
+
import { cn } from "@cms/utils/cn"
|
|
7
|
+
import { Button } from "@cms/components/ui/button"
|
|
8
|
+
|
|
9
|
+
function AlertDialog({
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
|
|
9
12
|
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
|
|
10
13
|
}
|
|
11
14
|
|
|
12
15
|
function AlertDialogTrigger({
|
|
13
16
|
...props
|
|
14
17
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
|
|
15
|
-
return
|
|
18
|
+
return (
|
|
19
|
+
<AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
|
|
20
|
+
)
|
|
16
21
|
}
|
|
17
22
|
|
|
18
|
-
function AlertDialogPortal({
|
|
19
|
-
|
|
23
|
+
function AlertDialogPortal({
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
|
|
26
|
+
return (
|
|
27
|
+
<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
|
|
28
|
+
)
|
|
20
29
|
}
|
|
21
30
|
|
|
22
31
|
function AlertDialogOverlay({
|
|
@@ -27,7 +36,7 @@ function AlertDialogOverlay({
|
|
|
27
36
|
<AlertDialogPrimitive.Overlay
|
|
28
37
|
data-slot="alert-dialog-overlay"
|
|
29
38
|
className={cn(
|
|
30
|
-
|
|
39
|
+
"fixed inset-0 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",
|
|
31
40
|
className
|
|
32
41
|
)}
|
|
33
42
|
{...props}
|
|
@@ -37,10 +46,10 @@ function AlertDialogOverlay({
|
|
|
37
46
|
|
|
38
47
|
function AlertDialogContent({
|
|
39
48
|
className,
|
|
40
|
-
size =
|
|
49
|
+
size = "default",
|
|
41
50
|
...props
|
|
42
51
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Content> & {
|
|
43
|
-
size?:
|
|
52
|
+
size?: "default" | "sm"
|
|
44
53
|
}) {
|
|
45
54
|
return (
|
|
46
55
|
<AlertDialogPortal>
|
|
@@ -49,7 +58,7 @@ function AlertDialogContent({
|
|
|
49
58
|
data-slot="alert-dialog-content"
|
|
50
59
|
data-size={size}
|
|
51
60
|
className={cn(
|
|
52
|
-
|
|
61
|
+
"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-4 rounded-xl bg-background p-4 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-sm 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",
|
|
53
62
|
className
|
|
54
63
|
)}
|
|
55
64
|
{...props}
|
|
@@ -58,12 +67,15 @@ function AlertDialogContent({
|
|
|
58
67
|
)
|
|
59
68
|
}
|
|
60
69
|
|
|
61
|
-
function AlertDialogHeader({
|
|
70
|
+
function AlertDialogHeader({
|
|
71
|
+
className,
|
|
72
|
+
...props
|
|
73
|
+
}: React.ComponentProps<"div">) {
|
|
62
74
|
return (
|
|
63
75
|
<div
|
|
64
76
|
data-slot="alert-dialog-header"
|
|
65
77
|
className={cn(
|
|
66
|
-
|
|
78
|
+
"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-4 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]",
|
|
67
79
|
className
|
|
68
80
|
)}
|
|
69
81
|
{...props}
|
|
@@ -71,12 +83,15 @@ function AlertDialogHeader({ className, ...props }: React.ComponentProps<'div'>)
|
|
|
71
83
|
)
|
|
72
84
|
}
|
|
73
85
|
|
|
74
|
-
function AlertDialogFooter({
|
|
86
|
+
function AlertDialogFooter({
|
|
87
|
+
className,
|
|
88
|
+
...props
|
|
89
|
+
}: React.ComponentProps<"div">) {
|
|
75
90
|
return (
|
|
76
91
|
<div
|
|
77
92
|
data-slot="alert-dialog-footer"
|
|
78
93
|
className={cn(
|
|
79
|
-
|
|
94
|
+
"-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",
|
|
80
95
|
className
|
|
81
96
|
)}
|
|
82
97
|
{...props}
|
|
@@ -84,12 +99,15 @@ function AlertDialogFooter({ className, ...props }: React.ComponentProps<'div'>)
|
|
|
84
99
|
)
|
|
85
100
|
}
|
|
86
101
|
|
|
87
|
-
function AlertDialogMedia({
|
|
102
|
+
function AlertDialogMedia({
|
|
103
|
+
className,
|
|
104
|
+
...props
|
|
105
|
+
}: React.ComponentProps<"div">) {
|
|
88
106
|
return (
|
|
89
107
|
<div
|
|
90
108
|
data-slot="alert-dialog-media"
|
|
91
109
|
className={cn(
|
|
92
|
-
"
|
|
110
|
+
"mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6",
|
|
93
111
|
className
|
|
94
112
|
)}
|
|
95
113
|
{...props}
|
|
@@ -105,7 +123,7 @@ function AlertDialogTitle({
|
|
|
105
123
|
<AlertDialogPrimitive.Title
|
|
106
124
|
data-slot="alert-dialog-title"
|
|
107
125
|
className={cn(
|
|
108
|
-
|
|
126
|
+
"font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",
|
|
109
127
|
className
|
|
110
128
|
)}
|
|
111
129
|
{...props}
|
|
@@ -121,7 +139,7 @@ function AlertDialogDescription({
|
|
|
121
139
|
<AlertDialogPrimitive.Description
|
|
122
140
|
data-slot="alert-dialog-description"
|
|
123
141
|
className={cn(
|
|
124
|
-
|
|
142
|
+
"text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
125
143
|
className
|
|
126
144
|
)}
|
|
127
145
|
{...props}
|
|
@@ -131,11 +149,11 @@ function AlertDialogDescription({
|
|
|
131
149
|
|
|
132
150
|
function AlertDialogAction({
|
|
133
151
|
className,
|
|
134
|
-
variant =
|
|
135
|
-
size =
|
|
152
|
+
variant = "default",
|
|
153
|
+
size = "default",
|
|
136
154
|
...props
|
|
137
155
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Action> &
|
|
138
|
-
Pick<React.ComponentProps<typeof Button>,
|
|
156
|
+
Pick<React.ComponentProps<typeof Button>, "variant" | "size">) {
|
|
139
157
|
return (
|
|
140
158
|
<Button variant={variant} size={size} asChild>
|
|
141
159
|
<AlertDialogPrimitive.Action
|
|
@@ -149,11 +167,11 @@ function AlertDialogAction({
|
|
|
149
167
|
|
|
150
168
|
function AlertDialogCancel({
|
|
151
169
|
className,
|
|
152
|
-
variant =
|
|
153
|
-
size =
|
|
170
|
+
variant = "outline",
|
|
171
|
+
size = "default",
|
|
154
172
|
...props
|
|
155
173
|
}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel> &
|
|
156
|
-
Pick<React.ComponentProps<typeof Button>,
|
|
174
|
+
Pick<React.ComponentProps<typeof Button>, "variant" | "size">) {
|
|
157
175
|
return (
|
|
158
176
|
<Button variant={variant} size={size} asChild>
|
|
159
177
|
<AlertDialogPrimitive.Cancel
|
|
@@ -177,5 +195,5 @@ export {
|
|
|
177
195
|
AlertDialogOverlay,
|
|
178
196
|
AlertDialogPortal,
|
|
179
197
|
AlertDialogTitle,
|
|
180
|
-
AlertDialogTrigger
|
|
198
|
+
AlertDialogTrigger,
|
|
181
199
|
}
|
package/templates/ui/avatar.tsx
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
"use client"
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import { Avatar as AvatarPrimitive } from
|
|
5
|
-
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Avatar as AvatarPrimitive } from "radix-ui"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@cms/utils/cn"
|
|
6
7
|
|
|
7
8
|
function Avatar({
|
|
8
9
|
className,
|
|
9
|
-
size =
|
|
10
|
+
size = "default",
|
|
10
11
|
...props
|
|
11
12
|
}: React.ComponentProps<typeof AvatarPrimitive.Root> & {
|
|
12
|
-
size?:
|
|
13
|
+
size?: "default" | "sm" | "lg"
|
|
13
14
|
}) {
|
|
14
15
|
return (
|
|
15
16
|
<AvatarPrimitive.Root
|
|
16
17
|
data-slot="avatar"
|
|
17
18
|
data-size={size}
|
|
18
19
|
className={cn(
|
|
19
|
-
|
|
20
|
+
"group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",
|
|
20
21
|
className
|
|
21
22
|
)}
|
|
22
23
|
{...props}
|
|
@@ -24,11 +25,17 @@ function Avatar({
|
|
|
24
25
|
)
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
function AvatarImage({
|
|
28
|
+
function AvatarImage({
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}: React.ComponentProps<typeof AvatarPrimitive.Image>) {
|
|
28
32
|
return (
|
|
29
33
|
<AvatarPrimitive.Image
|
|
30
34
|
data-slot="avatar-image"
|
|
31
|
-
className={cn(
|
|
35
|
+
className={cn(
|
|
36
|
+
"aspect-square size-full rounded-full object-cover",
|
|
37
|
+
className
|
|
38
|
+
)}
|
|
32
39
|
{...props}
|
|
33
40
|
/>
|
|
34
41
|
)
|
|
@@ -42,7 +49,7 @@ function AvatarFallback({
|
|
|
42
49
|
<AvatarPrimitive.Fallback
|
|
43
50
|
data-slot="avatar-fallback"
|
|
44
51
|
className={cn(
|
|
45
|
-
|
|
52
|
+
"flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",
|
|
46
53
|
className
|
|
47
54
|
)}
|
|
48
55
|
{...props}
|
|
@@ -50,15 +57,15 @@ function AvatarFallback({
|
|
|
50
57
|
)
|
|
51
58
|
}
|
|
52
59
|
|
|
53
|
-
function AvatarBadge({ className, ...props }: React.ComponentProps<
|
|
60
|
+
function AvatarBadge({ className, ...props }: React.ComponentProps<"span">) {
|
|
54
61
|
return (
|
|
55
62
|
<span
|
|
56
63
|
data-slot="avatar-badge"
|
|
57
64
|
className={cn(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
65
|
+
"absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none",
|
|
66
|
+
"group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden",
|
|
67
|
+
"group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2",
|
|
68
|
+
"group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",
|
|
62
69
|
className
|
|
63
70
|
)}
|
|
64
71
|
{...props}
|
|
@@ -66,12 +73,12 @@ function AvatarBadge({ className, ...props }: React.ComponentProps<'span'>) {
|
|
|
66
73
|
)
|
|
67
74
|
}
|
|
68
75
|
|
|
69
|
-
function AvatarGroup({ className, ...props }: React.ComponentProps<
|
|
76
|
+
function AvatarGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
70
77
|
return (
|
|
71
78
|
<div
|
|
72
79
|
data-slot="avatar-group"
|
|
73
80
|
className={cn(
|
|
74
|
-
|
|
81
|
+
"group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background",
|
|
75
82
|
className
|
|
76
83
|
)}
|
|
77
84
|
{...props}
|
|
@@ -79,12 +86,15 @@ function AvatarGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
79
86
|
)
|
|
80
87
|
}
|
|
81
88
|
|
|
82
|
-
function AvatarGroupCount({
|
|
89
|
+
function AvatarGroupCount({
|
|
90
|
+
className,
|
|
91
|
+
...props
|
|
92
|
+
}: React.ComponentProps<"div">) {
|
|
83
93
|
return (
|
|
84
94
|
<div
|
|
85
95
|
data-slot="avatar-group-count"
|
|
86
96
|
className={cn(
|
|
87
|
-
|
|
97
|
+
"relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",
|
|
88
98
|
className
|
|
89
99
|
)}
|
|
90
100
|
{...props}
|
|
@@ -92,4 +102,11 @@ function AvatarGroupCount({ className, ...props }: React.ComponentProps<'div'>)
|
|
|
92
102
|
)
|
|
93
103
|
}
|
|
94
104
|
|
|
95
|
-
export {
|
|
105
|
+
export {
|
|
106
|
+
Avatar,
|
|
107
|
+
AvatarImage,
|
|
108
|
+
AvatarFallback,
|
|
109
|
+
AvatarGroup,
|
|
110
|
+
AvatarGroupCount,
|
|
111
|
+
AvatarBadge,
|
|
112
|
+
}
|
package/templates/ui/button.tsx
CHANGED
|
@@ -21,10 +21,10 @@ const buttonVariants = cva(
|
|
|
21
21
|
},
|
|
22
22
|
size: {
|
|
23
23
|
default:
|
|
24
|
-
'h-
|
|
24
|
+
'h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
25
25
|
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
26
|
-
sm: "h-
|
|
27
|
-
lg: 'h-
|
|
26
|
+
sm: "h-9 gap-1 rounded-[min(var(--radius-md),12px)] px-3 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
27
|
+
lg: 'h-12 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3',
|
|
28
28
|
icon: 'size-8',
|
|
29
29
|
'icon-xs':
|
|
30
30
|
"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
package/templates/ui/card.tsx
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
|
|
3
|
+
import { cn } from "@cms/utils/cn"
|
|
3
4
|
|
|
4
5
|
function Card({
|
|
5
6
|
className,
|
|
6
|
-
size =
|
|
7
|
+
size = "default",
|
|
7
8
|
...props
|
|
8
|
-
}: React.ComponentProps<
|
|
9
|
+
}: React.ComponentProps<"div"> & { size?: "default" | "sm" }) {
|
|
9
10
|
return (
|
|
10
11
|
<div
|
|
11
12
|
data-slot="card"
|
|
12
13
|
data-size={size}
|
|
13
14
|
className={cn(
|
|
14
|
-
|
|
15
|
+
"group/card flex flex-col gap-6 overflow-hidden rounded-xl bg-card py-6 text-sm text-card-foreground has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl material-medium",
|
|
15
16
|
className
|
|
16
17
|
)}
|
|
17
18
|
{...props}
|
|
@@ -19,12 +20,12 @@ function Card({
|
|
|
19
20
|
)
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
function CardHeader({ className, ...props }: React.ComponentProps<
|
|
23
|
+
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
23
24
|
return (
|
|
24
25
|
<div
|
|
25
26
|
data-slot="card-header"
|
|
26
27
|
className={cn(
|
|
27
|
-
|
|
28
|
+
"group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-6 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",
|
|
28
29
|
className
|
|
29
30
|
)}
|
|
30
31
|
{...props}
|
|
@@ -32,12 +33,12 @@ function CardHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
32
33
|
)
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
function CardTitle({ className, ...props }: React.ComponentProps<
|
|
36
|
+
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
36
37
|
return (
|
|
37
38
|
<div
|
|
38
39
|
data-slot="card-title"
|
|
39
40
|
className={cn(
|
|
40
|
-
|
|
41
|
+
"font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",
|
|
41
42
|
className
|
|
42
43
|
)}
|
|
43
44
|
{...props}
|
|
@@ -45,42 +46,45 @@ function CardTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
45
46
|
)
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
function CardDescription({ className, ...props }: React.ComponentProps<
|
|
49
|
+
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
49
50
|
return (
|
|
50
51
|
<div
|
|
51
52
|
data-slot="card-description"
|
|
52
|
-
className={cn(
|
|
53
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
53
54
|
{...props}
|
|
54
55
|
/>
|
|
55
56
|
)
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
function CardAction({ className, ...props }: React.ComponentProps<
|
|
59
|
+
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
|
|
59
60
|
return (
|
|
60
61
|
<div
|
|
61
62
|
data-slot="card-action"
|
|
62
|
-
className={cn(
|
|
63
|
+
className={cn(
|
|
64
|
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
65
|
+
className
|
|
66
|
+
)}
|
|
63
67
|
{...props}
|
|
64
68
|
/>
|
|
65
69
|
)
|
|
66
70
|
}
|
|
67
71
|
|
|
68
|
-
function CardContent({ className, ...props }: React.ComponentProps<
|
|
72
|
+
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
69
73
|
return (
|
|
70
74
|
<div
|
|
71
75
|
data-slot="card-content"
|
|
72
|
-
className={cn(
|
|
76
|
+
className={cn("px-6 group-data-[size=sm]/card:px-3", className)}
|
|
73
77
|
{...props}
|
|
74
78
|
/>
|
|
75
79
|
)
|
|
76
80
|
}
|
|
77
81
|
|
|
78
|
-
function CardFooter({ className, ...props }: React.ComponentProps<
|
|
82
|
+
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
79
83
|
return (
|
|
80
84
|
<div
|
|
81
85
|
data-slot="card-footer"
|
|
82
86
|
className={cn(
|
|
83
|
-
|
|
87
|
+
"flex items-center border-t bg-muted/50 px-6 py-4 group-data-[size=sm]/card:p-3",
|
|
84
88
|
className
|
|
85
89
|
)}
|
|
86
90
|
{...props}
|
|
@@ -88,4 +92,12 @@ function CardFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
88
92
|
)
|
|
89
93
|
}
|
|
90
94
|
|
|
91
|
-
export {
|
|
95
|
+
export {
|
|
96
|
+
Card,
|
|
97
|
+
CardHeader,
|
|
98
|
+
CardFooter,
|
|
99
|
+
CardTitle,
|
|
100
|
+
CardAction,
|
|
101
|
+
CardDescription,
|
|
102
|
+
CardContent,
|
|
103
|
+
}
|
package/templates/ui/dialog.tsx
CHANGED
|
@@ -1,24 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
"use client"
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { X } from 'lucide-react'
|
|
6
|
-
import { Dialog as DialogPrimitive } from 'radix-ui'
|
|
7
|
-
import type * as React from 'react'
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Dialog as DialogPrimitive } from "radix-ui"
|
|
8
5
|
|
|
9
|
-
|
|
6
|
+
import { cn } from "@cms/utils/cn"
|
|
7
|
+
import { Button } from "@cms/components/ui/button"
|
|
8
|
+
import { XIcon } from "lucide-react"
|
|
9
|
+
|
|
10
|
+
function Dialog({
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof DialogPrimitive.Root>) {
|
|
10
13
|
return <DialogPrimitive.Root data-slot="dialog" {...props} />
|
|
11
14
|
}
|
|
12
15
|
|
|
13
|
-
function DialogTrigger({
|
|
16
|
+
function DialogTrigger({
|
|
17
|
+
...props
|
|
18
|
+
}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
|
|
14
19
|
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
|
|
15
20
|
}
|
|
16
21
|
|
|
17
|
-
function DialogPortal({
|
|
22
|
+
function DialogPortal({
|
|
23
|
+
...props
|
|
24
|
+
}: React.ComponentProps<typeof DialogPrimitive.Portal>) {
|
|
18
25
|
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
|
|
19
26
|
}
|
|
20
27
|
|
|
21
|
-
function DialogClose({
|
|
28
|
+
function DialogClose({
|
|
29
|
+
...props
|
|
30
|
+
}: React.ComponentProps<typeof DialogPrimitive.Close>) {
|
|
22
31
|
return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
|
|
23
32
|
}
|
|
24
33
|
|
|
@@ -30,7 +39,7 @@ function DialogOverlay({
|
|
|
30
39
|
<DialogPrimitive.Overlay
|
|
31
40
|
data-slot="dialog-overlay"
|
|
32
41
|
className={cn(
|
|
33
|
-
|
|
42
|
+
"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",
|
|
34
43
|
className
|
|
35
44
|
)}
|
|
36
45
|
{...props}
|
|
@@ -52,7 +61,7 @@ function DialogContent({
|
|
|
52
61
|
<DialogPrimitive.Content
|
|
53
62
|
data-slot="dialog-content"
|
|
54
63
|
className={cn(
|
|
55
|
-
|
|
64
|
+
"fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-card p-4 text-sm ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm 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",
|
|
56
65
|
className
|
|
57
66
|
)}
|
|
58
67
|
{...props}
|
|
@@ -60,8 +69,13 @@ function DialogContent({
|
|
|
60
69
|
{children}
|
|
61
70
|
{showCloseButton && (
|
|
62
71
|
<DialogPrimitive.Close data-slot="dialog-close" asChild>
|
|
63
|
-
<Button
|
|
64
|
-
|
|
72
|
+
<Button
|
|
73
|
+
variant="ghost"
|
|
74
|
+
className="absolute top-2 right-2"
|
|
75
|
+
size="icon-sm"
|
|
76
|
+
>
|
|
77
|
+
<XIcon
|
|
78
|
+
/>
|
|
65
79
|
<span className="sr-only">Close</span>
|
|
66
80
|
</Button>
|
|
67
81
|
</DialogPrimitive.Close>
|
|
@@ -71,9 +85,13 @@ function DialogContent({
|
|
|
71
85
|
)
|
|
72
86
|
}
|
|
73
87
|
|
|
74
|
-
function DialogHeader({ className, ...props }: React.ComponentProps<
|
|
88
|
+
function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
75
89
|
return (
|
|
76
|
-
<div
|
|
90
|
+
<div
|
|
91
|
+
data-slot="dialog-header"
|
|
92
|
+
className={cn("flex flex-col gap-1 px-2 pt-2", className)}
|
|
93
|
+
{...props}
|
|
94
|
+
/>
|
|
77
95
|
)
|
|
78
96
|
}
|
|
79
97
|
|
|
@@ -82,14 +100,14 @@ function DialogFooter({
|
|
|
82
100
|
showCloseButton = false,
|
|
83
101
|
children,
|
|
84
102
|
...props
|
|
85
|
-
}: React.ComponentProps<
|
|
103
|
+
}: React.ComponentProps<"div"> & {
|
|
86
104
|
showCloseButton?: boolean
|
|
87
105
|
}) {
|
|
88
106
|
return (
|
|
89
107
|
<div
|
|
90
108
|
data-slot="dialog-footer"
|
|
91
109
|
className={cn(
|
|
92
|
-
|
|
110
|
+
"-mx-4 -mb-4 flex flex-col-reverse gap-1 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",
|
|
93
111
|
className
|
|
94
112
|
)}
|
|
95
113
|
{...props}
|
|
@@ -104,11 +122,17 @@ function DialogFooter({
|
|
|
104
122
|
)
|
|
105
123
|
}
|
|
106
124
|
|
|
107
|
-
function DialogTitle({
|
|
125
|
+
function DialogTitle({
|
|
126
|
+
className,
|
|
127
|
+
...props
|
|
128
|
+
}: React.ComponentProps<typeof DialogPrimitive.Title>) {
|
|
108
129
|
return (
|
|
109
130
|
<DialogPrimitive.Title
|
|
110
131
|
data-slot="dialog-title"
|
|
111
|
-
className={cn(
|
|
132
|
+
className={cn(
|
|
133
|
+
"font-heading text-base leading-none font-medium",
|
|
134
|
+
className
|
|
135
|
+
)}
|
|
112
136
|
{...props}
|
|
113
137
|
/>
|
|
114
138
|
)
|
|
@@ -122,7 +146,7 @@ function DialogDescription({
|
|
|
122
146
|
<DialogPrimitive.Description
|
|
123
147
|
data-slot="dialog-description"
|
|
124
148
|
className={cn(
|
|
125
|
-
|
|
149
|
+
"text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
126
150
|
className
|
|
127
151
|
)}
|
|
128
152
|
{...props}
|
|
@@ -140,5 +164,5 @@ export {
|
|
|
140
164
|
DialogOverlay,
|
|
141
165
|
DialogPortal,
|
|
142
166
|
DialogTitle,
|
|
143
|
-
DialogTrigger
|
|
167
|
+
DialogTrigger,
|
|
144
168
|
}
|
|
@@ -34,7 +34,7 @@ function DropdownMenuContent({
|
|
|
34
34
|
sideOffset={sideOffset}
|
|
35
35
|
align={align}
|
|
36
36
|
className={cn(
|
|
37
|
-
'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 bg-popover text-popover-foreground z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-
|
|
37
|
+
'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 bg-popover text-popover-foreground z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-2 shadow-md ring-1 duration-100 data-[state=closed]:overflow-hidden',
|
|
38
38
|
className
|
|
39
39
|
)}
|
|
40
40
|
{...props}
|
package/templates/ui/input.tsx
CHANGED
|
@@ -7,7 +7,7 @@ function Input({ className, type, ...props }: React.ComponentProps<'input'>) {
|
|
|
7
7
|
type={type}
|
|
8
8
|
data-slot="input"
|
|
9
9
|
className={cn(
|
|
10
|
-
'dark:bg-input/30 border-input 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:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 file:text-foreground placeholder:text-muted-foreground h-
|
|
10
|
+
'dark:bg-input/30 border-input 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:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 file:text-foreground placeholder:text-muted-foreground h-10 w-full min-w-0 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-3 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 md:text-sm',
|
|
11
11
|
className
|
|
12
12
|
)}
|
|
13
13
|
{...props}
|