@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,170 +1,170 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as SheetPrimitive from "@radix-ui/react-dialog"
5
- import { motion } from "framer-motion"
6
- import { XIcon } from "lucide-react"
7
- import { cn } from "@/lib/utils"
8
-
9
- function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
10
- return <SheetPrimitive.Root data-slot="sheet" {...props} />
11
- }
12
-
13
- function SheetTrigger({
14
- ...props
15
- }: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
16
- return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
17
- }
18
-
19
- function SheetClose({
20
- ...props
21
- }: React.ComponentProps<typeof SheetPrimitive.Close>) {
22
- return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
23
- }
24
-
25
- function SheetPortal({
26
- ...props
27
- }: React.ComponentProps<typeof SheetPrimitive.Portal>) {
28
- return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
29
- }
30
-
31
- const SheetOverlay = React.forwardRef<
32
- React.ElementRef<typeof SheetPrimitive.Overlay>,
33
- React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>
34
- >(({ className, ...props }, ref) => (
35
- <SheetPrimitive.Overlay ref={ref} asChild {...props}>
36
- <motion.div
37
- data-slot="sheet-overlay"
38
- initial={{ opacity: 0 }}
39
- animate={{ opacity: 1 }}
40
- exit={{ opacity: 0 }}
41
- transition={{ duration: 0.2 }}
42
- className={cn(
43
- "fixed inset-0 z-50",
44
- "bg-black/60 backdrop-blur-sm",
45
- className
46
- )}
47
- />
48
- </SheetPrimitive.Overlay>
49
- ))
50
- SheetOverlay.displayName = "SheetOverlay"
51
-
52
- const slideVariants = {
53
- right: {
54
- initial: { x: "100%" },
55
- animate: { x: 0 },
56
- exit: { x: "100%" },
57
- },
58
- left: {
59
- initial: { x: "-100%" },
60
- animate: { x: 0 },
61
- exit: { x: "-100%" },
62
- },
63
- top: {
64
- initial: { y: "-100%" },
65
- animate: { y: 0 },
66
- exit: { y: "-100%" },
67
- },
68
- bottom: {
69
- initial: { y: "100%" },
70
- animate: { y: 0 },
71
- exit: { y: "100%" },
72
- },
73
- }
74
-
75
- const SheetContent = React.forwardRef<
76
- React.ElementRef<typeof SheetPrimitive.Content>,
77
- React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content> & {
78
- side?: "top" | "right" | "bottom" | "left"
79
- }
80
- >(({ className, children, side = "right", ...props }, ref) => (
81
- <SheetPortal>
82
- <SheetOverlay />
83
- <SheetPrimitive.Content ref={ref} asChild {...props}>
84
- <motion.div
85
- data-slot="sheet-content"
86
- initial={slideVariants[side].initial}
87
- animate={slideVariants[side].animate}
88
- exit={slideVariants[side].exit}
89
- transition={{
90
- type: "spring",
91
- stiffness: 300,
92
- damping: 30,
93
- }}
94
- className={cn(
95
- "fixed z-50 gap-4 p-6",
96
- "bg-background border",
97
- side === "right" && "inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-[520px]",
98
- side === "left" && "inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-[520px]",
99
- side === "top" && "inset-x-0 top-0 border-b",
100
- side === "bottom" && "inset-x-0 bottom-0 border-t",
101
- className
102
- )}
103
- >
104
- {children}
105
- <SheetPrimitive.Close className="absolute right-6 top-6 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none">
106
- <XIcon className="h-4 w-4" />
107
- <span className="sr-only">Close</span>
108
- </SheetPrimitive.Close>
109
- </motion.div>
110
- </SheetPrimitive.Content>
111
- </SheetPortal>
112
- ))
113
- SheetContent.displayName = "SheetContent"
114
-
115
- function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
116
- return (
117
- <div
118
- data-slot="sheet-header"
119
- className={cn("flex flex-col gap-1.5 p-4", className)}
120
- {...props}
121
- />
122
- )
123
- }
124
-
125
- function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
126
- return (
127
- <div
128
- data-slot="sheet-footer"
129
- className={cn("mt-auto flex flex-col gap-2 p-4", className)}
130
- {...props}
131
- />
132
- )
133
- }
134
-
135
- function SheetTitle({
136
- className,
137
- ...props
138
- }: React.ComponentProps<typeof SheetPrimitive.Title>) {
139
- return (
140
- <SheetPrimitive.Title
141
- data-slot="sheet-title"
142
- className={cn("text-foreground font-semibold", className)}
143
- {...props}
144
- />
145
- )
146
- }
147
-
148
- function SheetDescription({
149
- className,
150
- ...props
151
- }: React.ComponentProps<typeof SheetPrimitive.Description>) {
152
- return (
153
- <SheetPrimitive.Description
154
- data-slot="sheet-description"
155
- className={cn("text-muted-foreground text-sm", className)}
156
- {...props}
157
- />
158
- )
159
- }
160
-
161
- export {
162
- Sheet,
163
- SheetTrigger,
164
- SheetClose,
165
- SheetContent,
166
- SheetHeader,
167
- SheetFooter,
168
- SheetTitle,
169
- SheetDescription,
170
- }
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as SheetPrimitive from "@radix-ui/react-dialog"
5
+ import { motion } from "framer-motion"
6
+ import { XIcon } from "lucide-react"
7
+ import { cn } from "@/lib/utils"
8
+
9
+ function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
10
+ return <SheetPrimitive.Root data-slot="sheet" {...props} />
11
+ }
12
+
13
+ function SheetTrigger({
14
+ ...props
15
+ }: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
16
+ return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
17
+ }
18
+
19
+ function SheetClose({
20
+ ...props
21
+ }: React.ComponentProps<typeof SheetPrimitive.Close>) {
22
+ return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
23
+ }
24
+
25
+ function SheetPortal({
26
+ ...props
27
+ }: React.ComponentProps<typeof SheetPrimitive.Portal>) {
28
+ return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
29
+ }
30
+
31
+ const SheetOverlay = React.forwardRef<
32
+ React.ElementRef<typeof SheetPrimitive.Overlay>,
33
+ React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>
34
+ >(({ className, ...props }, ref) => (
35
+ <SheetPrimitive.Overlay ref={ref} asChild {...props}>
36
+ <motion.div
37
+ data-slot="sheet-overlay"
38
+ initial={{ opacity: 0 }}
39
+ animate={{ opacity: 1 }}
40
+ exit={{ opacity: 0 }}
41
+ transition={{ duration: 0.2 }}
42
+ className={cn(
43
+ "fixed inset-0 z-50",
44
+ "bg-black/60 backdrop-blur-sm",
45
+ className
46
+ )}
47
+ />
48
+ </SheetPrimitive.Overlay>
49
+ ))
50
+ SheetOverlay.displayName = "SheetOverlay"
51
+
52
+ const slideVariants = {
53
+ right: {
54
+ initial: { x: "100%" },
55
+ animate: { x: 0 },
56
+ exit: { x: "100%" },
57
+ },
58
+ left: {
59
+ initial: { x: "-100%" },
60
+ animate: { x: 0 },
61
+ exit: { x: "-100%" },
62
+ },
63
+ top: {
64
+ initial: { y: "-100%" },
65
+ animate: { y: 0 },
66
+ exit: { y: "-100%" },
67
+ },
68
+ bottom: {
69
+ initial: { y: "100%" },
70
+ animate: { y: 0 },
71
+ exit: { y: "100%" },
72
+ },
73
+ }
74
+
75
+ const SheetContent = React.forwardRef<
76
+ React.ElementRef<typeof SheetPrimitive.Content>,
77
+ React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content> & {
78
+ side?: "top" | "right" | "bottom" | "left"
79
+ }
80
+ >(({ className, children, side = "right", ...props }, ref) => (
81
+ <SheetPortal>
82
+ <SheetOverlay />
83
+ <SheetPrimitive.Content ref={ref} asChild {...props}>
84
+ <motion.div
85
+ data-slot="sheet-content"
86
+ initial={slideVariants[side].initial}
87
+ animate={slideVariants[side].animate}
88
+ exit={slideVariants[side].exit}
89
+ transition={{
90
+ type: "spring",
91
+ stiffness: 300,
92
+ damping: 30,
93
+ }}
94
+ className={cn(
95
+ "fixed z-50 gap-4 p-6",
96
+ "bg-background border",
97
+ side === "right" && "inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-[520px]",
98
+ side === "left" && "inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-[520px]",
99
+ side === "top" && "inset-x-0 top-0 border-b",
100
+ side === "bottom" && "inset-x-0 bottom-0 border-t",
101
+ className
102
+ )}
103
+ >
104
+ {children}
105
+ <SheetPrimitive.Close className="absolute right-6 top-6 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none">
106
+ <XIcon className="h-4 w-4" />
107
+ <span className="sr-only">Close</span>
108
+ </SheetPrimitive.Close>
109
+ </motion.div>
110
+ </SheetPrimitive.Content>
111
+ </SheetPortal>
112
+ ))
113
+ SheetContent.displayName = "SheetContent"
114
+
115
+ function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
116
+ return (
117
+ <div
118
+ data-slot="sheet-header"
119
+ className={cn("flex flex-col gap-1.5 p-4", className)}
120
+ {...props}
121
+ />
122
+ )
123
+ }
124
+
125
+ function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
126
+ return (
127
+ <div
128
+ data-slot="sheet-footer"
129
+ className={cn("mt-auto flex flex-col gap-2 p-4", className)}
130
+ {...props}
131
+ />
132
+ )
133
+ }
134
+
135
+ function SheetTitle({
136
+ className,
137
+ ...props
138
+ }: React.ComponentProps<typeof SheetPrimitive.Title>) {
139
+ return (
140
+ <SheetPrimitive.Title
141
+ data-slot="sheet-title"
142
+ className={cn("text-foreground font-semibold", className)}
143
+ {...props}
144
+ />
145
+ )
146
+ }
147
+
148
+ function SheetDescription({
149
+ className,
150
+ ...props
151
+ }: React.ComponentProps<typeof SheetPrimitive.Description>) {
152
+ return (
153
+ <SheetPrimitive.Description
154
+ data-slot="sheet-description"
155
+ className={cn("text-muted-foreground text-sm", className)}
156
+ {...props}
157
+ />
158
+ )
159
+ }
160
+
161
+ export {
162
+ Sheet,
163
+ SheetTrigger,
164
+ SheetClose,
165
+ SheetContent,
166
+ SheetHeader,
167
+ SheetFooter,
168
+ SheetTitle,
169
+ SheetDescription,
170
+ }