@create-lft-app/nextjs 3.2.0 → 3.3.0

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 (133) hide show
  1. package/README.md +549 -549
  2. package/package.json +48 -48
  3. package/template/.claude/skills/anti-patterns.md +150 -0
  4. package/template/.claude/skills/drizzle-schema.md +178 -0
  5. package/template/.claude/skills/formatting.md +56 -0
  6. package/template/.claude/skills/module-architecture.md +143 -0
  7. package/template/.claude/skills/supabase-server-actions.md +199 -0
  8. package/template/.claude/skills/ui-patterns.md +161 -0
  9. package/template/CLAUDE.md +114 -1239
  10. package/template/drizzle.config.ts +12 -12
  11. package/template/eslint.config.mjs +16 -16
  12. package/template/gitignore +36 -36
  13. package/template/next.config.ts +7 -7
  14. package/template/package.json +86 -86
  15. package/template/postcss.config.mjs +7 -7
  16. package/template/proxy.ts +12 -12
  17. package/template/public/logolft.svg +11 -11
  18. package/template/src/app/(auth)/dashboard/dashboard-content.tsx +124 -124
  19. package/template/src/app/(auth)/dashboard/page.tsx +9 -9
  20. package/template/src/app/(auth)/layout.tsx +7 -7
  21. package/template/src/app/(auth)/users/page.tsx +9 -9
  22. package/template/src/app/(auth)/users/users-content.tsx +26 -26
  23. package/template/src/app/(public)/layout.tsx +7 -7
  24. package/template/src/app/(public)/login/page.tsx +17 -17
  25. package/template/src/app/api/webhooks/route.ts +20 -20
  26. package/template/src/app/globals.css +249 -249
  27. package/template/src/app/layout.tsx +37 -37
  28. package/template/src/app/page.tsx +5 -5
  29. package/template/src/app/providers.tsx +27 -27
  30. package/template/src/components/layout/main-content.tsx +28 -28
  31. package/template/src/components/layout/sidebar-context.tsx +33 -33
  32. package/template/src/components/layout/sidebar.tsx +141 -141
  33. package/template/src/components/tables/data-table-column-header.tsx +68 -68
  34. package/template/src/components/tables/data-table-date-filter.tsx +203 -203
  35. package/template/src/components/tables/data-table-faceted-filter.tsx +185 -185
  36. package/template/src/components/tables/data-table-filters-dropdown.tsx +130 -130
  37. package/template/src/components/tables/data-table-number-filter.tsx +295 -295
  38. package/template/src/components/tables/data-table-pagination.tsx +99 -99
  39. package/template/src/components/tables/data-table-toolbar.tsx +140 -140
  40. package/template/src/components/tables/data-table-view-options.tsx +63 -63
  41. package/template/src/components/tables/data-table.tsx +148 -148
  42. package/template/src/components/tables/index.ts +9 -9
  43. package/template/src/components/ui/accordion.tsx +58 -58
  44. package/template/src/components/ui/alert-dialog.tsx +165 -165
  45. package/template/src/components/ui/alert.tsx +66 -66
  46. package/template/src/components/ui/animations/index.ts +44 -44
  47. package/template/src/components/ui/avatar.tsx +55 -55
  48. package/template/src/components/ui/badge.tsx +50 -50
  49. package/template/src/components/ui/button.tsx +118 -118
  50. package/template/src/components/ui/calendar.tsx +220 -220
  51. package/template/src/components/ui/card.tsx +113 -113
  52. package/template/src/components/ui/checkbox.tsx +38 -38
  53. package/template/src/components/ui/collapsible.tsx +33 -33
  54. package/template/src/components/ui/command.tsx +196 -196
  55. package/template/src/components/ui/dialog.tsx +156 -156
  56. package/template/src/components/ui/dropdown-menu.tsx +280 -280
  57. package/template/src/components/ui/form.tsx +171 -171
  58. package/template/src/components/ui/icons.tsx +167 -167
  59. package/template/src/components/ui/input.tsx +28 -28
  60. package/template/src/components/ui/label.tsx +25 -25
  61. package/template/src/components/ui/motion.tsx +197 -197
  62. package/template/src/components/ui/page-transition.tsx +166 -166
  63. package/template/src/components/ui/popover.tsx +59 -59
  64. package/template/src/components/ui/progress.tsx +32 -32
  65. package/template/src/components/ui/radio-group.tsx +45 -45
  66. package/template/src/components/ui/scroll-area.tsx +63 -63
  67. package/template/src/components/ui/select.tsx +208 -208
  68. package/template/src/components/ui/separator.tsx +28 -28
  69. package/template/src/components/ui/sheet.tsx +170 -170
  70. package/template/src/components/ui/sidebar.tsx +726 -726
  71. package/template/src/components/ui/skeleton.tsx +15 -15
  72. package/template/src/components/ui/slider.tsx +58 -58
  73. package/template/src/components/ui/sonner.tsx +47 -47
  74. package/template/src/components/ui/spinner.tsx +27 -27
  75. package/template/src/components/ui/submit-button.tsx +47 -47
  76. package/template/src/components/ui/switch.tsx +31 -31
  77. package/template/src/components/ui/table.tsx +120 -120
  78. package/template/src/components/ui/tabs.tsx +75 -75
  79. package/template/src/components/ui/textarea.tsx +26 -26
  80. package/template/src/components/ui/tooltip.tsx +70 -70
  81. package/template/src/config/navigation.ts +59 -59
  82. package/template/src/config/roles.ts +27 -27
  83. package/template/src/config/site.ts +12 -12
  84. package/template/src/db/index.ts +12 -12
  85. package/template/src/db/schema/index.ts +1 -1
  86. package/template/src/db/schema/users.ts +16 -16
  87. package/template/src/db/seed.ts +39 -39
  88. package/template/src/hooks/index.ts +3 -3
  89. package/template/src/hooks/use-mobile.ts +21 -21
  90. package/template/src/hooks/useDataTable.ts +82 -82
  91. package/template/src/hooks/useDebounce.ts +49 -49
  92. package/template/src/hooks/useMediaQuery.ts +36 -36
  93. package/template/src/lib/date/config.ts +36 -36
  94. package/template/src/lib/date/formatters.ts +127 -127
  95. package/template/src/lib/date/index.ts +26 -26
  96. package/template/src/lib/excel/exporter.ts +89 -89
  97. package/template/src/lib/excel/index.ts +14 -14
  98. package/template/src/lib/excel/parser.ts +96 -96
  99. package/template/src/lib/query-client.ts +35 -35
  100. package/template/src/lib/supabase/admin.ts +23 -23
  101. package/template/src/lib/supabase/client.ts +11 -11
  102. package/template/src/lib/supabase/proxy.ts +67 -67
  103. package/template/src/lib/supabase/server.ts +38 -38
  104. package/template/src/lib/supabase/types.ts +53 -53
  105. package/template/src/lib/utils.ts +6 -6
  106. package/template/src/lib/validations/common.ts +75 -75
  107. package/template/src/lib/validations/index.ts +20 -20
  108. package/template/src/modules/auth/actions/auth-actions.ts +59 -59
  109. package/template/src/modules/auth/components/login-form.tsx +68 -68
  110. package/template/src/modules/auth/hooks/useAuth.ts +38 -38
  111. package/template/src/modules/auth/hooks/useAuthMutations.ts +43 -43
  112. package/template/src/modules/auth/hooks/useAuthQueries.ts +43 -43
  113. package/template/src/modules/auth/index.ts +12 -12
  114. package/template/src/modules/auth/schemas/auth.schema.ts +32 -32
  115. package/template/src/modules/auth/stores/useAuthStore.ts +37 -37
  116. package/template/src/modules/users/actions/users-actions.ts +166 -166
  117. package/template/src/modules/users/columns.tsx +106 -106
  118. package/template/src/modules/users/components/users-list.tsx +48 -48
  119. package/template/src/modules/users/hooks/useUsers.ts +39 -39
  120. package/template/src/modules/users/hooks/useUsersMutations.ts +55 -55
  121. package/template/src/modules/users/hooks/useUsersQueries.ts +35 -35
  122. package/template/src/modules/users/index.ts +30 -30
  123. package/template/src/modules/users/schemas/users.schema.ts +51 -51
  124. package/template/src/modules/users/stores/useUsersStore.ts +60 -60
  125. package/template/src/modules/users/types/auth-user.types.ts +42 -42
  126. package/template/src/modules/users/utils/user-mapper.ts +32 -32
  127. package/template/src/stores/index.ts +1 -1
  128. package/template/src/stores/useUiStore.ts +55 -55
  129. package/template/src/types/api.ts +28 -28
  130. package/template/src/types/index.ts +2 -2
  131. package/template/src/types/table.ts +34 -34
  132. package/template/supabase/config.toml +94 -94
  133. package/template/tsconfig.json +42 -42
@@ -1,166 +1,166 @@
1
- 'use client'
2
-
3
- import { motion, type HTMLMotionProps } from 'framer-motion'
4
- import { cn } from '@/lib/utils'
5
-
6
- const pageVariants = {
7
- initial: {
8
- opacity: 0,
9
- y: 20,
10
- },
11
- enter: {
12
- opacity: 1,
13
- y: 0,
14
- transition: {
15
- duration: 0.4,
16
- ease: [0.25, 0.1, 0.25, 1],
17
- when: 'beforeChildren',
18
- staggerChildren: 0.1,
19
- },
20
- },
21
- exit: {
22
- opacity: 0,
23
- y: -20,
24
- transition: {
25
- duration: 0.3,
26
- },
27
- },
28
- }
29
-
30
- const childVariants = {
31
- initial: {
32
- opacity: 0,
33
- y: 20,
34
- },
35
- enter: {
36
- opacity: 1,
37
- y: 0,
38
- },
39
- exit: {
40
- opacity: 0,
41
- y: -20,
42
- },
43
- }
44
-
45
- interface PageTransitionProps extends HTMLMotionProps<'div'> {
46
- children: React.ReactNode
47
- }
48
-
49
- export function PageTransition({
50
- children,
51
- className,
52
- ...props
53
- }: PageTransitionProps) {
54
- return (
55
- <motion.div
56
- initial="initial"
57
- animate="enter"
58
- exit="exit"
59
- variants={pageVariants}
60
- className={cn('w-full', className)}
61
- {...props}
62
- >
63
- {children}
64
- </motion.div>
65
- )
66
- }
67
-
68
- interface PageSectionProps extends HTMLMotionProps<'section'> {
69
- children: React.ReactNode
70
- delay?: number
71
- }
72
-
73
- export function PageSection({
74
- children,
75
- className,
76
- delay = 0,
77
- ...props
78
- }: PageSectionProps) {
79
- return (
80
- <motion.section
81
- variants={childVariants}
82
- transition={{
83
- duration: 0.4,
84
- delay,
85
- ease: [0.25, 0.1, 0.25, 1],
86
- }}
87
- className={className}
88
- {...props}
89
- >
90
- {children}
91
- </motion.section>
92
- )
93
- }
94
-
95
- interface PageHeaderProps extends HTMLMotionProps<'header'> {
96
- children: React.ReactNode
97
- }
98
-
99
- export function PageHeader({
100
- children,
101
- className,
102
- ...props
103
- }: PageHeaderProps) {
104
- return (
105
- <motion.header
106
- initial={{ opacity: 0, y: -20 }}
107
- animate={{ opacity: 1, y: 0 }}
108
- transition={{
109
- duration: 0.4,
110
- ease: [0.25, 0.1, 0.25, 1],
111
- }}
112
- className={cn('mb-6', className)}
113
- {...props}
114
- >
115
- {children}
116
- </motion.header>
117
- )
118
- }
119
-
120
- interface PageTitleProps extends HTMLMotionProps<'h1'> {
121
- children: React.ReactNode
122
- }
123
-
124
- export function PageTitle({ children, className, ...props }: PageTitleProps) {
125
- return (
126
- <motion.h1
127
- initial={{ opacity: 0, x: -20 }}
128
- animate={{ opacity: 1, x: 0 }}
129
- transition={{
130
- duration: 0.4,
131
- delay: 0.1,
132
- ease: [0.25, 0.1, 0.25, 1],
133
- }}
134
- className={cn('text-2xl font-bold tracking-tight', className)}
135
- {...props}
136
- >
137
- {children}
138
- </motion.h1>
139
- )
140
- }
141
-
142
- interface PageDescriptionProps extends HTMLMotionProps<'p'> {
143
- children: React.ReactNode
144
- }
145
-
146
- export function PageDescription({
147
- children,
148
- className,
149
- ...props
150
- }: PageDescriptionProps) {
151
- return (
152
- <motion.p
153
- initial={{ opacity: 0 }}
154
- animate={{ opacity: 1 }}
155
- transition={{
156
- duration: 0.4,
157
- delay: 0.2,
158
- ease: [0.25, 0.1, 0.25, 1],
159
- }}
160
- className={cn('text-muted-foreground', className)}
161
- {...props}
162
- >
163
- {children}
164
- </motion.p>
165
- )
166
- }
1
+ 'use client'
2
+
3
+ import { motion, type HTMLMotionProps } from 'framer-motion'
4
+ import { cn } from '@/lib/utils'
5
+
6
+ const pageVariants = {
7
+ initial: {
8
+ opacity: 0,
9
+ y: 20,
10
+ },
11
+ enter: {
12
+ opacity: 1,
13
+ y: 0,
14
+ transition: {
15
+ duration: 0.4,
16
+ ease: [0.25, 0.1, 0.25, 1],
17
+ when: 'beforeChildren',
18
+ staggerChildren: 0.1,
19
+ },
20
+ },
21
+ exit: {
22
+ opacity: 0,
23
+ y: -20,
24
+ transition: {
25
+ duration: 0.3,
26
+ },
27
+ },
28
+ }
29
+
30
+ const childVariants = {
31
+ initial: {
32
+ opacity: 0,
33
+ y: 20,
34
+ },
35
+ enter: {
36
+ opacity: 1,
37
+ y: 0,
38
+ },
39
+ exit: {
40
+ opacity: 0,
41
+ y: -20,
42
+ },
43
+ }
44
+
45
+ interface PageTransitionProps extends HTMLMotionProps<'div'> {
46
+ children: React.ReactNode
47
+ }
48
+
49
+ export function PageTransition({
50
+ children,
51
+ className,
52
+ ...props
53
+ }: PageTransitionProps) {
54
+ return (
55
+ <motion.div
56
+ initial="initial"
57
+ animate="enter"
58
+ exit="exit"
59
+ variants={pageVariants}
60
+ className={cn('w-full', className)}
61
+ {...props}
62
+ >
63
+ {children}
64
+ </motion.div>
65
+ )
66
+ }
67
+
68
+ interface PageSectionProps extends HTMLMotionProps<'section'> {
69
+ children: React.ReactNode
70
+ delay?: number
71
+ }
72
+
73
+ export function PageSection({
74
+ children,
75
+ className,
76
+ delay = 0,
77
+ ...props
78
+ }: PageSectionProps) {
79
+ return (
80
+ <motion.section
81
+ variants={childVariants}
82
+ transition={{
83
+ duration: 0.4,
84
+ delay,
85
+ ease: [0.25, 0.1, 0.25, 1],
86
+ }}
87
+ className={className}
88
+ {...props}
89
+ >
90
+ {children}
91
+ </motion.section>
92
+ )
93
+ }
94
+
95
+ interface PageHeaderProps extends HTMLMotionProps<'header'> {
96
+ children: React.ReactNode
97
+ }
98
+
99
+ export function PageHeader({
100
+ children,
101
+ className,
102
+ ...props
103
+ }: PageHeaderProps) {
104
+ return (
105
+ <motion.header
106
+ initial={{ opacity: 0, y: -20 }}
107
+ animate={{ opacity: 1, y: 0 }}
108
+ transition={{
109
+ duration: 0.4,
110
+ ease: [0.25, 0.1, 0.25, 1],
111
+ }}
112
+ className={cn('mb-6', className)}
113
+ {...props}
114
+ >
115
+ {children}
116
+ </motion.header>
117
+ )
118
+ }
119
+
120
+ interface PageTitleProps extends HTMLMotionProps<'h1'> {
121
+ children: React.ReactNode
122
+ }
123
+
124
+ export function PageTitle({ children, className, ...props }: PageTitleProps) {
125
+ return (
126
+ <motion.h1
127
+ initial={{ opacity: 0, x: -20 }}
128
+ animate={{ opacity: 1, x: 0 }}
129
+ transition={{
130
+ duration: 0.4,
131
+ delay: 0.1,
132
+ ease: [0.25, 0.1, 0.25, 1],
133
+ }}
134
+ className={cn('text-2xl font-bold tracking-tight', className)}
135
+ {...props}
136
+ >
137
+ {children}
138
+ </motion.h1>
139
+ )
140
+ }
141
+
142
+ interface PageDescriptionProps extends HTMLMotionProps<'p'> {
143
+ children: React.ReactNode
144
+ }
145
+
146
+ export function PageDescription({
147
+ children,
148
+ className,
149
+ ...props
150
+ }: PageDescriptionProps) {
151
+ return (
152
+ <motion.p
153
+ initial={{ opacity: 0 }}
154
+ animate={{ opacity: 1 }}
155
+ transition={{
156
+ duration: 0.4,
157
+ delay: 0.2,
158
+ ease: [0.25, 0.1, 0.25, 1],
159
+ }}
160
+ className={cn('text-muted-foreground', className)}
161
+ {...props}
162
+ >
163
+ {children}
164
+ </motion.p>
165
+ )
166
+ }
@@ -1,59 +1,59 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as PopoverPrimitive from "@radix-ui/react-popover"
5
-
6
- import { cn } from "@/lib/utils"
7
-
8
- function Popover({
9
- ...props
10
- }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
11
- return <PopoverPrimitive.Root data-slot="popover" {...props} />
12
- }
13
-
14
- function PopoverTrigger({
15
- ...props
16
- }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
17
- return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
18
- }
19
-
20
- function PopoverContent({
21
- className,
22
- align = "center",
23
- sideOffset = 4,
24
- ...props
25
- }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
26
- return (
27
- <PopoverPrimitive.Portal>
28
- <PopoverPrimitive.Content
29
- data-slot="popover-content"
30
- align={align}
31
- sideOffset={sideOffset}
32
- className={cn(
33
- "z-50 w-72 rounded-md p-4",
34
- "border border-border",
35
- "bg-popover",
36
- "text-popover-foreground",
37
- "outline-none",
38
- "data-[state=open]:animate-in data-[state=closed]:animate-out",
39
- "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
40
- "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
41
- "data-[side=bottom]:slide-in-from-top-2",
42
- "data-[side=left]:slide-in-from-right-2",
43
- "data-[side=right]:slide-in-from-left-2",
44
- "data-[side=top]:slide-in-from-bottom-2",
45
- className
46
- )}
47
- {...props}
48
- />
49
- </PopoverPrimitive.Portal>
50
- )
51
- }
52
-
53
- function PopoverAnchor({
54
- ...props
55
- }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
56
- return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
57
- }
58
-
59
- export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as PopoverPrimitive from "@radix-ui/react-popover"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ function Popover({
9
+ ...props
10
+ }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
11
+ return <PopoverPrimitive.Root data-slot="popover" {...props} />
12
+ }
13
+
14
+ function PopoverTrigger({
15
+ ...props
16
+ }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
17
+ return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
18
+ }
19
+
20
+ function PopoverContent({
21
+ className,
22
+ align = "center",
23
+ sideOffset = 4,
24
+ ...props
25
+ }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
26
+ return (
27
+ <PopoverPrimitive.Portal>
28
+ <PopoverPrimitive.Content
29
+ data-slot="popover-content"
30
+ align={align}
31
+ sideOffset={sideOffset}
32
+ className={cn(
33
+ "z-50 w-72 rounded-md p-4",
34
+ "border border-border",
35
+ "bg-popover",
36
+ "text-popover-foreground",
37
+ "outline-none",
38
+ "data-[state=open]:animate-in data-[state=closed]:animate-out",
39
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
40
+ "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
41
+ "data-[side=bottom]:slide-in-from-top-2",
42
+ "data-[side=left]:slide-in-from-right-2",
43
+ "data-[side=right]:slide-in-from-left-2",
44
+ "data-[side=top]:slide-in-from-bottom-2",
45
+ className
46
+ )}
47
+ {...props}
48
+ />
49
+ </PopoverPrimitive.Portal>
50
+ )
51
+ }
52
+
53
+ function PopoverAnchor({
54
+ ...props
55
+ }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
56
+ return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
57
+ }
58
+
59
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }
@@ -1,32 +1,32 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as ProgressPrimitive from "@radix-ui/react-progress"
5
-
6
- import { cn } from "@/lib/utils"
7
-
8
- function Progress({
9
- className,
10
- value,
11
- ...props
12
- }: React.ComponentProps<typeof ProgressPrimitive.Root>) {
13
- return (
14
- <ProgressPrimitive.Root
15
- data-slot="progress"
16
- className={cn(
17
- "relative h-1.5 w-full overflow-hidden rounded-full",
18
- "bg-muted",
19
- className
20
- )}
21
- {...props}
22
- >
23
- <ProgressPrimitive.Indicator
24
- data-slot="progress-indicator"
25
- className="h-full w-full flex-1 bg-primary transition-all duration-300 ease-out"
26
- style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
27
- />
28
- </ProgressPrimitive.Root>
29
- )
30
- }
31
-
32
- export { Progress }
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as ProgressPrimitive from "@radix-ui/react-progress"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ function Progress({
9
+ className,
10
+ value,
11
+ ...props
12
+ }: React.ComponentProps<typeof ProgressPrimitive.Root>) {
13
+ return (
14
+ <ProgressPrimitive.Root
15
+ data-slot="progress"
16
+ className={cn(
17
+ "relative h-1.5 w-full overflow-hidden rounded-full",
18
+ "bg-muted",
19
+ className
20
+ )}
21
+ {...props}
22
+ >
23
+ <ProgressPrimitive.Indicator
24
+ data-slot="progress-indicator"
25
+ className="h-full w-full flex-1 bg-primary transition-all duration-300 ease-out"
26
+ style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
27
+ />
28
+ </ProgressPrimitive.Root>
29
+ )
30
+ }
31
+
32
+ export { Progress }
@@ -1,45 +1,45 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
5
- import { CircleIcon } from "lucide-react"
6
-
7
- import { cn } from "@/lib/utils"
8
-
9
- function RadioGroup({
10
- className,
11
- ...props
12
- }: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
13
- return (
14
- <RadioGroupPrimitive.Root
15
- data-slot="radio-group"
16
- className={cn("grid gap-3", className)}
17
- {...props}
18
- />
19
- )
20
- }
21
-
22
- function RadioGroupItem({
23
- className,
24
- ...props
25
- }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
26
- return (
27
- <RadioGroupPrimitive.Item
28
- data-slot="radio-group-item"
29
- className={cn(
30
- "border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
31
- className
32
- )}
33
- {...props}
34
- >
35
- <RadioGroupPrimitive.Indicator
36
- data-slot="radio-group-indicator"
37
- className="relative flex items-center justify-center"
38
- >
39
- <CircleIcon className="fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" />
40
- </RadioGroupPrimitive.Indicator>
41
- </RadioGroupPrimitive.Item>
42
- )
43
- }
44
-
45
- export { RadioGroup, RadioGroupItem }
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
5
+ import { CircleIcon } from "lucide-react"
6
+
7
+ import { cn } from "@/lib/utils"
8
+
9
+ function RadioGroup({
10
+ className,
11
+ ...props
12
+ }: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
13
+ return (
14
+ <RadioGroupPrimitive.Root
15
+ data-slot="radio-group"
16
+ className={cn("grid gap-3", className)}
17
+ {...props}
18
+ />
19
+ )
20
+ }
21
+
22
+ function RadioGroupItem({
23
+ className,
24
+ ...props
25
+ }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
26
+ return (
27
+ <RadioGroupPrimitive.Item
28
+ data-slot="radio-group-item"
29
+ className={cn(
30
+ "border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
31
+ className
32
+ )}
33
+ {...props}
34
+ >
35
+ <RadioGroupPrimitive.Indicator
36
+ data-slot="radio-group-indicator"
37
+ className="relative flex items-center justify-center"
38
+ >
39
+ <CircleIcon className="fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" />
40
+ </RadioGroupPrimitive.Indicator>
41
+ </RadioGroupPrimitive.Item>
42
+ )
43
+ }
44
+
45
+ export { RadioGroup, RadioGroupItem }