@betterstart/cli 0.1.69 → 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.
Files changed (77) hide show
  1. package/dist/chunk-E4HZYXQ2.js +36 -0
  2. package/dist/chunk-E4HZYXQ2.js.map +1 -0
  3. package/dist/cli.js +580 -4444
  4. package/dist/cli.js.map +1 -1
  5. package/dist/reader-2T45D7JZ.js +7 -0
  6. package/package.json +1 -1
  7. package/templates/init/api/auth-route.ts +3 -0
  8. package/templates/init/api/upload-route.ts +74 -0
  9. package/templates/init/cms-globals.css +200 -0
  10. package/templates/init/components/data-table/data-table-pagination.tsx +90 -0
  11. package/templates/init/components/data-table/data-table-toolbar.tsx +93 -0
  12. package/templates/init/components/data-table/data-table.tsx +188 -0
  13. package/templates/init/components/layout/cms-header.tsx +32 -0
  14. package/templates/init/components/layout/cms-nav-link.tsx +25 -0
  15. package/templates/init/components/layout/cms-providers.tsx +33 -0
  16. package/templates/init/components/layout/cms-search.tsx +25 -0
  17. package/templates/init/components/layout/cms-sidebar.tsx +192 -0
  18. package/templates/init/components/layout/cms-sign-out.tsx +30 -0
  19. package/templates/init/components/shared/delete-dialog.tsx +75 -0
  20. package/templates/init/components/shared/page-header.tsx +23 -0
  21. package/templates/init/components/shared/status-badge.tsx +43 -0
  22. package/templates/init/data/navigation.ts +39 -0
  23. package/templates/init/db/client.ts +8 -0
  24. package/templates/init/db/schema.ts +88 -0
  25. package/{dist/chunk-6JCWMKSY.js → templates/init/drizzle.config.ts} +2 -11
  26. package/templates/init/hooks/use-cms-theme.tsx +78 -0
  27. package/templates/init/hooks/use-editor-image-upload.ts +82 -0
  28. package/templates/init/hooks/use-local-storage.ts +46 -0
  29. package/templates/init/hooks/use-mobile.ts +19 -0
  30. package/templates/init/hooks/use-upload.ts +177 -0
  31. package/templates/init/hooks/use-users.ts +13 -0
  32. package/templates/init/lib/actions/form-settings.ts +126 -0
  33. package/templates/init/lib/actions/profile.ts +62 -0
  34. package/templates/init/lib/actions/upload.ts +153 -0
  35. package/templates/init/lib/actions/users.ts +145 -0
  36. package/templates/init/lib/auth/auth-client.ts +12 -0
  37. package/templates/init/lib/auth/auth.ts +43 -0
  38. package/templates/init/lib/auth/middleware.ts +44 -0
  39. package/templates/init/lib/markdown/cached.ts +7 -0
  40. package/templates/init/lib/markdown/format.ts +55 -0
  41. package/templates/init/lib/markdown/render.ts +182 -0
  42. package/templates/init/lib/r2.ts +55 -0
  43. package/templates/init/pages/account-layout.tsx +63 -0
  44. package/templates/init/pages/authenticated-layout.tsx +26 -0
  45. package/templates/init/pages/cms-layout.tsx +16 -0
  46. package/templates/init/pages/dashboard-page.tsx +91 -0
  47. package/templates/init/pages/login-form.tsx +117 -0
  48. package/templates/init/pages/login-page.tsx +17 -0
  49. package/templates/init/pages/profile/profile-form.tsx +361 -0
  50. package/templates/init/pages/profile/profile-page.tsx +34 -0
  51. package/templates/init/pages/users/columns.tsx +241 -0
  52. package/templates/init/pages/users/create-user-dialog.tsx +116 -0
  53. package/templates/init/pages/users/edit-role-dialog.tsx +92 -0
  54. package/templates/init/pages/users/users-page-content.tsx +29 -0
  55. package/templates/init/pages/users/users-page.tsx +19 -0
  56. package/templates/init/pages/users/users-table.tsx +219 -0
  57. package/templates/init/types/auth.ts +78 -0
  58. package/templates/init/types/index.ts +79 -0
  59. package/templates/init/types/table-meta.ts +16 -0
  60. package/templates/init/utils/cn.ts +6 -0
  61. package/templates/init/utils/mailchimp.ts +39 -0
  62. package/templates/init/utils/seo.ts +90 -0
  63. package/templates/init/utils/validation.ts +105 -0
  64. package/templates/init/utils/webhook.ts +28 -0
  65. package/templates/ui/alert-dialog.tsx +46 -28
  66. package/templates/ui/avatar.tsx +37 -20
  67. package/templates/ui/button.tsx +3 -3
  68. package/templates/ui/card.tsx +30 -18
  69. package/templates/ui/dialog.tsx +46 -22
  70. package/templates/ui/dropdown-menu.tsx +1 -1
  71. package/templates/ui/input.tsx +1 -1
  72. package/templates/ui/select.tsx +42 -34
  73. package/templates/ui/sidebar.tsx +13 -13
  74. package/templates/ui/table.tsx +2 -2
  75. package/dist/chunk-6JCWMKSY.js.map +0 -1
  76. package/dist/drizzle-config-EDKOEZ6G.js +0 -7
  77. /package/dist/{drizzle-config-EDKOEZ6G.js.map → reader-2T45D7JZ.js.map} +0 -0
@@ -1,22 +1,31 @@
1
- 'use client'
1
+ "use client"
2
2
 
3
- import { Button } from '@cms/components/ui/button'
4
- import { cn } from '@cms/utils/cn'
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
- function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
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 <AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
18
+ return (
19
+ <AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
20
+ )
16
21
  }
17
22
 
18
- function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
19
- return <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
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
- 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs',
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 = 'default',
49
+ size = "default",
41
50
  ...props
42
51
  }: React.ComponentProps<typeof AlertDialogPrimitive.Content> & {
43
- size?: 'default' | 'sm'
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
- '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 bg-background ring-foreground/10 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 p-4 ring-1 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm',
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({ className, ...props }: React.ComponentProps<'div'>) {
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
- '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]',
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({ className, ...props }: React.ComponentProps<'div'>) {
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
- 'bg-muted/50 -mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t 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',
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({ className, ...props }: React.ComponentProps<'div'>) {
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
- "bg-muted mb-2 inline-flex size-10 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6",
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
- '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',
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
- 'text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3',
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 = 'default',
135
- size = 'default',
152
+ variant = "default",
153
+ size = "default",
136
154
  ...props
137
155
  }: React.ComponentProps<typeof AlertDialogPrimitive.Action> &
138
- Pick<React.ComponentProps<typeof Button>, 'variant' | 'size'>) {
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 = 'outline',
153
- size = 'default',
170
+ variant = "outline",
171
+ size = "default",
154
172
  ...props
155
173
  }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel> &
156
- Pick<React.ComponentProps<typeof Button>, 'variant' | 'size'>) {
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
  }
@@ -1,22 +1,23 @@
1
- 'use client'
1
+ "use client"
2
2
 
3
- import { cn } from '@cms/utils/cn'
4
- import { Avatar as AvatarPrimitive } from 'radix-ui'
5
- import type * as React from 'react'
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 = 'default',
10
+ size = "default",
10
11
  ...props
11
12
  }: React.ComponentProps<typeof AvatarPrimitive.Root> & {
12
- size?: 'default' | 'sm' | 'lg'
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
- 'after:border-border group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten',
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({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>) {
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('aspect-square size-full rounded-full object-cover', className)}
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
- 'bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs',
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<'span'>) {
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
- 'bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-blend-color ring-2 select-none',
59
- 'group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden',
60
- 'group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2',
61
- 'group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2',
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<'div'>) {
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
- '*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2',
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({ className, ...props }: React.ComponentProps<'div'>) {
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
- 'bg-muted text-muted-foreground ring-background relative flex size-8 shrink-0 items-center justify-center rounded-full text-sm ring-2 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',
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 { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge }
105
+ export {
106
+ Avatar,
107
+ AvatarImage,
108
+ AvatarFallback,
109
+ AvatarGroup,
110
+ AvatarGroupCount,
111
+ AvatarBadge,
112
+ }
@@ -21,10 +21,10 @@ const buttonVariants = cva(
21
21
  },
22
22
  size: {
23
23
  default:
24
- 'h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
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-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 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-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3',
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",
@@ -1,17 +1,18 @@
1
- import { cn } from '@cms/utils/cn'
2
- import type * as React from 'react'
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 = 'default',
7
+ size = "default",
7
8
  ...props
8
- }: React.ComponentProps<'div'> & { size?: 'default' | 'sm' }) {
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
- 'ring-foreground/10 bg-card text-card-foreground group/card flex flex-col gap-4 overflow-hidden rounded-xl py-4 text-sm ring-1 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',
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<'div'>) {
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
- 'group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 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
+ "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<'div'>) {
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
- 'text-base leading-snug font-medium group-data-[size=sm]/card:text-sm',
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<'div'>) {
49
+ function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
49
50
  return (
50
51
  <div
51
52
  data-slot="card-description"
52
- className={cn('text-muted-foreground text-sm', className)}
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<'div'>) {
59
+ function CardAction({ className, ...props }: React.ComponentProps<"div">) {
59
60
  return (
60
61
  <div
61
62
  data-slot="card-action"
62
- className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}
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<'div'>) {
72
+ function CardContent({ className, ...props }: React.ComponentProps<"div">) {
69
73
  return (
70
74
  <div
71
75
  data-slot="card-content"
72
- className={cn('px-4 group-data-[size=sm]/card:px-3', className)}
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<'div'>) {
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
- 'bg-muted/50 flex items-center rounded-b-xl border-t p-4 group-data-[size=sm]/card:p-3',
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 { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent }
95
+ export {
96
+ Card,
97
+ CardHeader,
98
+ CardFooter,
99
+ CardTitle,
100
+ CardAction,
101
+ CardDescription,
102
+ CardContent,
103
+ }
@@ -1,24 +1,33 @@
1
- 'use client'
1
+ "use client"
2
2
 
3
- import { Button } from '@cms/components/ui/button'
4
- import { cn } from '@cms/utils/cn'
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
- function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {
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({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
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({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>) {
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({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>) {
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
- 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs',
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
- 'bg-background 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 ring-foreground/10 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 p-4 text-sm ring-1 duration-100 outline-none sm:max-w-sm',
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 variant="ghost" className="absolute top-2 right-2" size="icon-sm">
64
- <X />
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<'div'>) {
88
+ function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
75
89
  return (
76
- <div data-slot="dialog-header" className={cn('flex flex-col gap-2', className)} {...props} />
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<'div'> & {
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
- 'bg-muted/50 -mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t p-4 sm:flex-row sm:justify-end',
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({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {
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('text-base leading-none font-medium', className)}
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
- 'text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3',
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-1 shadow-md ring-1 duration-100 data-[state=closed]:overflow-hidden',
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}
@@ -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-8 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',
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}