@create-lft-app/nextjs 3.1.0 → 3.2.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 (128) hide show
  1. package/README.md +549 -549
  2. package/package.json +48 -48
  3. package/template/CLAUDE.md +1239 -279
  4. package/template/drizzle.config.ts +12 -12
  5. package/template/eslint.config.mjs +16 -16
  6. package/template/gitignore +36 -36
  7. package/template/next.config.ts +7 -7
  8. package/template/package.json +86 -86
  9. package/template/postcss.config.mjs +7 -7
  10. package/template/proxy.ts +12 -12
  11. package/template/public/logolft.svg +11 -11
  12. package/template/src/app/(auth)/dashboard/dashboard-content.tsx +124 -124
  13. package/template/src/app/(auth)/dashboard/page.tsx +9 -9
  14. package/template/src/app/(auth)/layout.tsx +7 -7
  15. package/template/src/app/(auth)/users/page.tsx +9 -9
  16. package/template/src/app/(auth)/users/users-content.tsx +26 -26
  17. package/template/src/app/(public)/layout.tsx +7 -7
  18. package/template/src/app/(public)/login/page.tsx +17 -17
  19. package/template/src/app/api/webhooks/route.ts +20 -20
  20. package/template/src/app/globals.css +249 -249
  21. package/template/src/app/layout.tsx +37 -37
  22. package/template/src/app/page.tsx +5 -5
  23. package/template/src/app/providers.tsx +27 -27
  24. package/template/src/components/layout/main-content.tsx +28 -28
  25. package/template/src/components/layout/sidebar-context.tsx +33 -33
  26. package/template/src/components/layout/sidebar.tsx +141 -146
  27. package/template/src/components/tables/data-table-column-header.tsx +68 -68
  28. package/template/src/components/tables/data-table-date-filter.tsx +203 -0
  29. package/template/src/components/tables/data-table-faceted-filter.tsx +185 -0
  30. package/template/src/components/tables/data-table-filters-dropdown.tsx +130 -0
  31. package/template/src/components/tables/data-table-number-filter.tsx +295 -0
  32. package/template/src/components/tables/data-table-pagination.tsx +99 -99
  33. package/template/src/components/tables/data-table-toolbar.tsx +140 -50
  34. package/template/src/components/tables/data-table-view-options.tsx +63 -59
  35. package/template/src/components/tables/data-table.tsx +148 -128
  36. package/template/src/components/tables/index.ts +9 -5
  37. package/template/src/components/ui/accordion.tsx +58 -58
  38. package/template/src/components/ui/alert-dialog.tsx +165 -165
  39. package/template/src/components/ui/alert.tsx +66 -66
  40. package/template/src/components/ui/animations/index.ts +44 -44
  41. package/template/src/components/ui/avatar.tsx +55 -55
  42. package/template/src/components/ui/badge.tsx +50 -50
  43. package/template/src/components/ui/button.tsx +118 -118
  44. package/template/src/components/ui/calendar.tsx +220 -220
  45. package/template/src/components/ui/card.tsx +113 -113
  46. package/template/src/components/ui/checkbox.tsx +38 -38
  47. package/template/src/components/ui/collapsible.tsx +33 -33
  48. package/template/src/components/ui/command.tsx +196 -196
  49. package/template/src/components/ui/dialog.tsx +156 -156
  50. package/template/src/components/ui/dropdown-menu.tsx +280 -280
  51. package/template/src/components/ui/form.tsx +171 -171
  52. package/template/src/components/ui/icons.tsx +167 -167
  53. package/template/src/components/ui/input.tsx +28 -28
  54. package/template/src/components/ui/label.tsx +25 -25
  55. package/template/src/components/ui/motion.tsx +197 -197
  56. package/template/src/components/ui/page-transition.tsx +166 -166
  57. package/template/src/components/ui/popover.tsx +59 -59
  58. package/template/src/components/ui/progress.tsx +32 -32
  59. package/template/src/components/ui/radio-group.tsx +45 -45
  60. package/template/src/components/ui/scroll-area.tsx +63 -63
  61. package/template/src/components/ui/select.tsx +208 -208
  62. package/template/src/components/ui/separator.tsx +28 -28
  63. package/template/src/components/ui/sheet.tsx +170 -170
  64. package/template/src/components/ui/sidebar.tsx +726 -726
  65. package/template/src/components/ui/skeleton.tsx +15 -15
  66. package/template/src/components/ui/slider.tsx +58 -58
  67. package/template/src/components/ui/sonner.tsx +47 -47
  68. package/template/src/components/ui/spinner.tsx +27 -27
  69. package/template/src/components/ui/submit-button.tsx +47 -47
  70. package/template/src/components/ui/switch.tsx +31 -31
  71. package/template/src/components/ui/table.tsx +120 -120
  72. package/template/src/components/ui/tabs.tsx +75 -75
  73. package/template/src/components/ui/textarea.tsx +26 -26
  74. package/template/src/components/ui/tooltip.tsx +70 -70
  75. package/template/src/config/navigation.ts +59 -69
  76. package/template/src/config/roles.ts +27 -0
  77. package/template/src/config/site.ts +12 -12
  78. package/template/src/db/index.ts +12 -12
  79. package/template/src/db/schema/index.ts +1 -1
  80. package/template/src/db/schema/users.ts +16 -16
  81. package/template/src/db/seed.ts +39 -39
  82. package/template/src/hooks/index.ts +3 -3
  83. package/template/src/hooks/use-mobile.ts +21 -21
  84. package/template/src/hooks/useDataTable.ts +82 -82
  85. package/template/src/hooks/useDebounce.ts +49 -49
  86. package/template/src/hooks/useMediaQuery.ts +36 -36
  87. package/template/src/lib/date/config.ts +36 -34
  88. package/template/src/lib/date/formatters.ts +127 -120
  89. package/template/src/lib/date/index.ts +26 -19
  90. package/template/src/lib/excel/exporter.ts +89 -89
  91. package/template/src/lib/excel/index.ts +14 -14
  92. package/template/src/lib/excel/parser.ts +96 -96
  93. package/template/src/lib/query-client.ts +35 -35
  94. package/template/src/lib/supabase/admin.ts +23 -0
  95. package/template/src/lib/supabase/client.ts +11 -11
  96. package/template/src/lib/supabase/proxy.ts +67 -67
  97. package/template/src/lib/supabase/server.ts +38 -38
  98. package/template/src/lib/supabase/types.ts +53 -53
  99. package/template/src/lib/utils.ts +6 -6
  100. package/template/src/lib/validations/common.ts +75 -75
  101. package/template/src/lib/validations/index.ts +20 -20
  102. package/template/src/modules/auth/actions/auth-actions.ts +59 -59
  103. package/template/src/modules/auth/components/login-form.tsx +68 -68
  104. package/template/src/modules/auth/hooks/useAuth.ts +38 -38
  105. package/template/src/modules/auth/hooks/useAuthMutations.ts +43 -43
  106. package/template/src/modules/auth/hooks/useAuthQueries.ts +43 -43
  107. package/template/src/modules/auth/index.ts +12 -12
  108. package/template/src/modules/auth/schemas/auth.schema.ts +32 -32
  109. package/template/src/modules/auth/stores/useAuthStore.ts +37 -37
  110. package/template/src/modules/users/actions/users-actions.ts +166 -94
  111. package/template/src/modules/users/columns.tsx +106 -86
  112. package/template/src/modules/users/components/users-list.tsx +48 -22
  113. package/template/src/modules/users/hooks/useUsers.ts +39 -39
  114. package/template/src/modules/users/hooks/useUsersMutations.ts +55 -55
  115. package/template/src/modules/users/hooks/useUsersQueries.ts +35 -35
  116. package/template/src/modules/users/index.ts +30 -12
  117. package/template/src/modules/users/schemas/users.schema.ts +51 -23
  118. package/template/src/modules/users/stores/useUsersStore.ts +60 -60
  119. package/template/src/modules/users/types/auth-user.types.ts +42 -0
  120. package/template/src/modules/users/utils/user-mapper.ts +32 -0
  121. package/template/src/stores/index.ts +1 -1
  122. package/template/src/stores/useUiStore.ts +55 -55
  123. package/template/src/types/api.ts +28 -28
  124. package/template/src/types/index.ts +2 -2
  125. package/template/src/types/table.ts +34 -34
  126. package/template/supabase/config.toml +94 -94
  127. package/template/tsconfig.json +42 -42
  128. package/template/tsconfig.tsbuildinfo +1 -1
@@ -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-background dark:bg-[#1c1c1c]",
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-[#e6e6e6] dark:bg-[#2c2c2c]",
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 }