@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.
- package/README.md +549 -549
- package/package.json +48 -48
- package/template/.claude/skills/anti-patterns.md +150 -0
- package/template/.claude/skills/drizzle-schema.md +178 -0
- package/template/.claude/skills/formatting.md +56 -0
- package/template/.claude/skills/module-architecture.md +143 -0
- package/template/.claude/skills/supabase-server-actions.md +199 -0
- package/template/.claude/skills/ui-patterns.md +161 -0
- package/template/CLAUDE.md +114 -1239
- package/template/drizzle.config.ts +12 -12
- package/template/eslint.config.mjs +16 -16
- package/template/gitignore +36 -36
- package/template/next.config.ts +7 -7
- package/template/package.json +86 -86
- package/template/postcss.config.mjs +7 -7
- package/template/proxy.ts +12 -12
- package/template/public/logolft.svg +11 -11
- package/template/src/app/(auth)/dashboard/dashboard-content.tsx +124 -124
- package/template/src/app/(auth)/dashboard/page.tsx +9 -9
- package/template/src/app/(auth)/layout.tsx +7 -7
- package/template/src/app/(auth)/users/page.tsx +9 -9
- package/template/src/app/(auth)/users/users-content.tsx +26 -26
- package/template/src/app/(public)/layout.tsx +7 -7
- package/template/src/app/(public)/login/page.tsx +17 -17
- package/template/src/app/api/webhooks/route.ts +20 -20
- package/template/src/app/globals.css +249 -249
- package/template/src/app/layout.tsx +37 -37
- package/template/src/app/page.tsx +5 -5
- package/template/src/app/providers.tsx +27 -27
- package/template/src/components/layout/main-content.tsx +28 -28
- package/template/src/components/layout/sidebar-context.tsx +33 -33
- package/template/src/components/layout/sidebar.tsx +141 -141
- package/template/src/components/tables/data-table-column-header.tsx +68 -68
- package/template/src/components/tables/data-table-date-filter.tsx +203 -203
- package/template/src/components/tables/data-table-faceted-filter.tsx +185 -185
- package/template/src/components/tables/data-table-filters-dropdown.tsx +130 -130
- package/template/src/components/tables/data-table-number-filter.tsx +295 -295
- package/template/src/components/tables/data-table-pagination.tsx +99 -99
- package/template/src/components/tables/data-table-toolbar.tsx +140 -140
- package/template/src/components/tables/data-table-view-options.tsx +63 -63
- package/template/src/components/tables/data-table.tsx +148 -148
- package/template/src/components/tables/index.ts +9 -9
- package/template/src/components/ui/accordion.tsx +58 -58
- package/template/src/components/ui/alert-dialog.tsx +165 -165
- package/template/src/components/ui/alert.tsx +66 -66
- package/template/src/components/ui/animations/index.ts +44 -44
- package/template/src/components/ui/avatar.tsx +55 -55
- package/template/src/components/ui/badge.tsx +50 -50
- package/template/src/components/ui/button.tsx +118 -118
- package/template/src/components/ui/calendar.tsx +220 -220
- package/template/src/components/ui/card.tsx +113 -113
- package/template/src/components/ui/checkbox.tsx +38 -38
- package/template/src/components/ui/collapsible.tsx +33 -33
- package/template/src/components/ui/command.tsx +196 -196
- package/template/src/components/ui/dialog.tsx +156 -156
- package/template/src/components/ui/dropdown-menu.tsx +280 -280
- package/template/src/components/ui/form.tsx +171 -171
- package/template/src/components/ui/icons.tsx +167 -167
- package/template/src/components/ui/input.tsx +28 -28
- package/template/src/components/ui/label.tsx +25 -25
- package/template/src/components/ui/motion.tsx +197 -197
- package/template/src/components/ui/page-transition.tsx +166 -166
- package/template/src/components/ui/popover.tsx +59 -59
- package/template/src/components/ui/progress.tsx +32 -32
- package/template/src/components/ui/radio-group.tsx +45 -45
- package/template/src/components/ui/scroll-area.tsx +63 -63
- package/template/src/components/ui/select.tsx +208 -208
- package/template/src/components/ui/separator.tsx +28 -28
- package/template/src/components/ui/sheet.tsx +170 -170
- package/template/src/components/ui/sidebar.tsx +726 -726
- package/template/src/components/ui/skeleton.tsx +15 -15
- package/template/src/components/ui/slider.tsx +58 -58
- package/template/src/components/ui/sonner.tsx +47 -47
- package/template/src/components/ui/spinner.tsx +27 -27
- package/template/src/components/ui/submit-button.tsx +47 -47
- package/template/src/components/ui/switch.tsx +31 -31
- package/template/src/components/ui/table.tsx +120 -120
- package/template/src/components/ui/tabs.tsx +75 -75
- package/template/src/components/ui/textarea.tsx +26 -26
- package/template/src/components/ui/tooltip.tsx +70 -70
- package/template/src/config/navigation.ts +59 -59
- package/template/src/config/roles.ts +27 -27
- package/template/src/config/site.ts +12 -12
- package/template/src/db/index.ts +12 -12
- package/template/src/db/schema/index.ts +1 -1
- package/template/src/db/schema/users.ts +16 -16
- package/template/src/db/seed.ts +39 -39
- package/template/src/hooks/index.ts +3 -3
- package/template/src/hooks/use-mobile.ts +21 -21
- package/template/src/hooks/useDataTable.ts +82 -82
- package/template/src/hooks/useDebounce.ts +49 -49
- package/template/src/hooks/useMediaQuery.ts +36 -36
- package/template/src/lib/date/config.ts +36 -36
- package/template/src/lib/date/formatters.ts +127 -127
- package/template/src/lib/date/index.ts +26 -26
- package/template/src/lib/excel/exporter.ts +89 -89
- package/template/src/lib/excel/index.ts +14 -14
- package/template/src/lib/excel/parser.ts +96 -96
- package/template/src/lib/query-client.ts +35 -35
- package/template/src/lib/supabase/admin.ts +23 -23
- package/template/src/lib/supabase/client.ts +11 -11
- package/template/src/lib/supabase/proxy.ts +67 -67
- package/template/src/lib/supabase/server.ts +38 -38
- package/template/src/lib/supabase/types.ts +53 -53
- package/template/src/lib/utils.ts +6 -6
- package/template/src/lib/validations/common.ts +75 -75
- package/template/src/lib/validations/index.ts +20 -20
- package/template/src/modules/auth/actions/auth-actions.ts +59 -59
- package/template/src/modules/auth/components/login-form.tsx +68 -68
- package/template/src/modules/auth/hooks/useAuth.ts +38 -38
- package/template/src/modules/auth/hooks/useAuthMutations.ts +43 -43
- package/template/src/modules/auth/hooks/useAuthQueries.ts +43 -43
- package/template/src/modules/auth/index.ts +12 -12
- package/template/src/modules/auth/schemas/auth.schema.ts +32 -32
- package/template/src/modules/auth/stores/useAuthStore.ts +37 -37
- package/template/src/modules/users/actions/users-actions.ts +166 -166
- package/template/src/modules/users/columns.tsx +106 -106
- package/template/src/modules/users/components/users-list.tsx +48 -48
- package/template/src/modules/users/hooks/useUsers.ts +39 -39
- package/template/src/modules/users/hooks/useUsersMutations.ts +55 -55
- package/template/src/modules/users/hooks/useUsersQueries.ts +35 -35
- package/template/src/modules/users/index.ts +30 -30
- package/template/src/modules/users/schemas/users.schema.ts +51 -51
- package/template/src/modules/users/stores/useUsersStore.ts +60 -60
- package/template/src/modules/users/types/auth-user.types.ts +42 -42
- package/template/src/modules/users/utils/user-mapper.ts +32 -32
- package/template/src/stores/index.ts +1 -1
- package/template/src/stores/useUiStore.ts +55 -55
- package/template/src/types/api.ts +28 -28
- package/template/src/types/index.ts +2 -2
- package/template/src/types/table.ts +34 -34
- package/template/supabase/config.toml +94 -94
- package/template/tsconfig.json +42 -42
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { Slot } from "@radix-ui/react-slot"
|
|
3
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
4
|
-
|
|
5
|
-
import { cn } from "@/lib/utils"
|
|
6
|
-
|
|
7
|
-
const badgeVariants = cva(
|
|
8
|
-
"inline-flex items-center justify-center border px-2.5 py-0.5 text-xs font-medium transition-colors",
|
|
9
|
-
{
|
|
10
|
-
variants: {
|
|
11
|
-
variant: {
|
|
12
|
-
default:
|
|
13
|
-
"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
14
|
-
secondary:
|
|
15
|
-
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
16
|
-
destructive:
|
|
17
|
-
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
18
|
-
outline:
|
|
19
|
-
"text-foreground border-border",
|
|
20
|
-
tag:
|
|
21
|
-
"rounded-none border-0 bg-muted text-muted-foreground text-[10px] px-2 py-1",
|
|
22
|
-
"tag-rounded":
|
|
23
|
-
"rounded-full border-0 bg-muted text-muted-foreground text-[12px] px-3 py-1",
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
defaultVariants: {
|
|
27
|
-
variant: "default",
|
|
28
|
-
},
|
|
29
|
-
}
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
function Badge({
|
|
33
|
-
className,
|
|
34
|
-
variant,
|
|
35
|
-
asChild = false,
|
|
36
|
-
...props
|
|
37
|
-
}: React.ComponentProps<"span"> &
|
|
38
|
-
VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
|
|
39
|
-
const Comp = asChild ? Slot : "span"
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<Comp
|
|
43
|
-
data-slot="badge"
|
|
44
|
-
className={cn(badgeVariants({ variant }), className)}
|
|
45
|
-
{...props}
|
|
46
|
-
/>
|
|
47
|
-
)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export { Badge, badgeVariants }
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot"
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
|
|
7
|
+
const badgeVariants = cva(
|
|
8
|
+
"inline-flex items-center justify-center border px-2.5 py-0.5 text-xs font-medium transition-colors",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default:
|
|
13
|
+
"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
14
|
+
secondary:
|
|
15
|
+
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
16
|
+
destructive:
|
|
17
|
+
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
18
|
+
outline:
|
|
19
|
+
"text-foreground border-border",
|
|
20
|
+
tag:
|
|
21
|
+
"rounded-none border-0 bg-muted text-muted-foreground text-[10px] px-2 py-1",
|
|
22
|
+
"tag-rounded":
|
|
23
|
+
"rounded-full border-0 bg-muted text-muted-foreground text-[12px] px-3 py-1",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: "default",
|
|
28
|
+
},
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
function Badge({
|
|
33
|
+
className,
|
|
34
|
+
variant,
|
|
35
|
+
asChild = false,
|
|
36
|
+
...props
|
|
37
|
+
}: React.ComponentProps<"span"> &
|
|
38
|
+
VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
|
|
39
|
+
const Comp = asChild ? Slot : "span"
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<Comp
|
|
43
|
+
data-slot="badge"
|
|
44
|
+
className={cn(badgeVariants({ variant }), className)}
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { Badge, badgeVariants }
|
|
@@ -1,118 +1,118 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { Slot } from "@radix-ui/react-slot"
|
|
5
|
-
import { motion } from "framer-motion"
|
|
6
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
7
|
-
import { cn } from "@/lib/utils"
|
|
8
|
-
|
|
9
|
-
const buttonVariants = cva(
|
|
10
|
-
[
|
|
11
|
-
"inline-flex items-center justify-center gap-2",
|
|
12
|
-
"whitespace-nowrap text-sm font-medium",
|
|
13
|
-
"transition-colors duration-150",
|
|
14
|
-
"disabled:pointer-events-none disabled:opacity-50",
|
|
15
|
-
"[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
16
|
-
"outline-none focus-visible:outline-none",
|
|
17
|
-
].join(" "),
|
|
18
|
-
{
|
|
19
|
-
variants: {
|
|
20
|
-
variant: {
|
|
21
|
-
default: [
|
|
22
|
-
"bg-primary text-primary-foreground",
|
|
23
|
-
"hover:bg-primary/90",
|
|
24
|
-
].join(" "),
|
|
25
|
-
destructive: [
|
|
26
|
-
"bg-destructive text-destructive-foreground",
|
|
27
|
-
"hover:bg-destructive/90",
|
|
28
|
-
].join(" "),
|
|
29
|
-
outline: [
|
|
30
|
-
"border border-border bg-transparent",
|
|
31
|
-
"hover:bg-accent hover:text-accent-foreground",
|
|
32
|
-
].join(" "),
|
|
33
|
-
secondary: [
|
|
34
|
-
"bg-secondary text-secondary-foreground",
|
|
35
|
-
"hover:bg-secondary/80",
|
|
36
|
-
].join(" "),
|
|
37
|
-
ghost: [
|
|
38
|
-
"hover:bg-accent hover:text-accent-foreground",
|
|
39
|
-
].join(" "),
|
|
40
|
-
link: [
|
|
41
|
-
"text-primary underline-offset-4",
|
|
42
|
-
"hover:underline",
|
|
43
|
-
].join(" "),
|
|
44
|
-
icon: [
|
|
45
|
-
"text-muted-foreground",
|
|
46
|
-
"hover:bg-accent hover:text-accent-foreground",
|
|
47
|
-
"rounded-full",
|
|
48
|
-
].join(" "),
|
|
49
|
-
},
|
|
50
|
-
size: {
|
|
51
|
-
default: "h-10 px-4 py-2 rounded-md",
|
|
52
|
-
sm: "h-8 px-3 text-xs rounded-md",
|
|
53
|
-
lg: "h-11 px-8 rounded-md",
|
|
54
|
-
xl: "h-12 px-10 rounded-md",
|
|
55
|
-
icon: "h-8 w-8",
|
|
56
|
-
"icon-sm": "h-6 w-6",
|
|
57
|
-
"icon-lg": "h-10 w-10",
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
defaultVariants: {
|
|
61
|
-
variant: "default",
|
|
62
|
-
size: "default",
|
|
63
|
-
},
|
|
64
|
-
}
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
type ButtonProps = React.ComponentProps<"button"> &
|
|
68
|
-
VariantProps<typeof buttonVariants> & {
|
|
69
|
-
asChild?: boolean
|
|
70
|
-
animate?: boolean
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
74
|
-
({ className, variant = "default", size = "default", asChild = false, animate = true, ...props }, ref) => {
|
|
75
|
-
if (asChild) {
|
|
76
|
-
return (
|
|
77
|
-
<Slot
|
|
78
|
-
ref={ref as React.Ref<HTMLElement>}
|
|
79
|
-
data-slot="button"
|
|
80
|
-
data-variant={variant}
|
|
81
|
-
data-size={size}
|
|
82
|
-
className={cn(buttonVariants({ variant, size, className }))}
|
|
83
|
-
{...props}
|
|
84
|
-
/>
|
|
85
|
-
)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (!animate) {
|
|
89
|
-
return (
|
|
90
|
-
<button
|
|
91
|
-
ref={ref}
|
|
92
|
-
data-slot="button"
|
|
93
|
-
data-variant={variant}
|
|
94
|
-
data-size={size}
|
|
95
|
-
className={cn(buttonVariants({ variant, size, className }))}
|
|
96
|
-
{...props}
|
|
97
|
-
/>
|
|
98
|
-
)
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return (
|
|
102
|
-
<motion.button
|
|
103
|
-
ref={ref}
|
|
104
|
-
data-slot="button"
|
|
105
|
-
data-variant={variant}
|
|
106
|
-
data-size={size}
|
|
107
|
-
whileHover={{ scale: 1.02 }}
|
|
108
|
-
whileTap={{ scale: 0.98 }}
|
|
109
|
-
transition={{ duration: 0.1 }}
|
|
110
|
-
className={cn(buttonVariants({ variant, size, className }))}
|
|
111
|
-
{...(props as React.ComponentPropsWithoutRef<typeof motion.button>)}
|
|
112
|
-
/>
|
|
113
|
-
)
|
|
114
|
-
}
|
|
115
|
-
)
|
|
116
|
-
Button.displayName = "Button"
|
|
117
|
-
|
|
118
|
-
export { Button, buttonVariants }
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Slot } from "@radix-ui/react-slot"
|
|
5
|
+
import { motion } from "framer-motion"
|
|
6
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
7
|
+
import { cn } from "@/lib/utils"
|
|
8
|
+
|
|
9
|
+
const buttonVariants = cva(
|
|
10
|
+
[
|
|
11
|
+
"inline-flex items-center justify-center gap-2",
|
|
12
|
+
"whitespace-nowrap text-sm font-medium",
|
|
13
|
+
"transition-colors duration-150",
|
|
14
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
15
|
+
"[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
16
|
+
"outline-none focus-visible:outline-none",
|
|
17
|
+
].join(" "),
|
|
18
|
+
{
|
|
19
|
+
variants: {
|
|
20
|
+
variant: {
|
|
21
|
+
default: [
|
|
22
|
+
"bg-primary text-primary-foreground",
|
|
23
|
+
"hover:bg-primary/90",
|
|
24
|
+
].join(" "),
|
|
25
|
+
destructive: [
|
|
26
|
+
"bg-destructive text-destructive-foreground",
|
|
27
|
+
"hover:bg-destructive/90",
|
|
28
|
+
].join(" "),
|
|
29
|
+
outline: [
|
|
30
|
+
"border border-border bg-transparent",
|
|
31
|
+
"hover:bg-accent hover:text-accent-foreground",
|
|
32
|
+
].join(" "),
|
|
33
|
+
secondary: [
|
|
34
|
+
"bg-secondary text-secondary-foreground",
|
|
35
|
+
"hover:bg-secondary/80",
|
|
36
|
+
].join(" "),
|
|
37
|
+
ghost: [
|
|
38
|
+
"hover:bg-accent hover:text-accent-foreground",
|
|
39
|
+
].join(" "),
|
|
40
|
+
link: [
|
|
41
|
+
"text-primary underline-offset-4",
|
|
42
|
+
"hover:underline",
|
|
43
|
+
].join(" "),
|
|
44
|
+
icon: [
|
|
45
|
+
"text-muted-foreground",
|
|
46
|
+
"hover:bg-accent hover:text-accent-foreground",
|
|
47
|
+
"rounded-full",
|
|
48
|
+
].join(" "),
|
|
49
|
+
},
|
|
50
|
+
size: {
|
|
51
|
+
default: "h-10 px-4 py-2 rounded-md",
|
|
52
|
+
sm: "h-8 px-3 text-xs rounded-md",
|
|
53
|
+
lg: "h-11 px-8 rounded-md",
|
|
54
|
+
xl: "h-12 px-10 rounded-md",
|
|
55
|
+
icon: "h-8 w-8",
|
|
56
|
+
"icon-sm": "h-6 w-6",
|
|
57
|
+
"icon-lg": "h-10 w-10",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
defaultVariants: {
|
|
61
|
+
variant: "default",
|
|
62
|
+
size: "default",
|
|
63
|
+
},
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
type ButtonProps = React.ComponentProps<"button"> &
|
|
68
|
+
VariantProps<typeof buttonVariants> & {
|
|
69
|
+
asChild?: boolean
|
|
70
|
+
animate?: boolean
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
74
|
+
({ className, variant = "default", size = "default", asChild = false, animate = true, ...props }, ref) => {
|
|
75
|
+
if (asChild) {
|
|
76
|
+
return (
|
|
77
|
+
<Slot
|
|
78
|
+
ref={ref as React.Ref<HTMLElement>}
|
|
79
|
+
data-slot="button"
|
|
80
|
+
data-variant={variant}
|
|
81
|
+
data-size={size}
|
|
82
|
+
className={cn(buttonVariants({ variant, size, className }))}
|
|
83
|
+
{...props}
|
|
84
|
+
/>
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (!animate) {
|
|
89
|
+
return (
|
|
90
|
+
<button
|
|
91
|
+
ref={ref}
|
|
92
|
+
data-slot="button"
|
|
93
|
+
data-variant={variant}
|
|
94
|
+
data-size={size}
|
|
95
|
+
className={cn(buttonVariants({ variant, size, className }))}
|
|
96
|
+
{...props}
|
|
97
|
+
/>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<motion.button
|
|
103
|
+
ref={ref}
|
|
104
|
+
data-slot="button"
|
|
105
|
+
data-variant={variant}
|
|
106
|
+
data-size={size}
|
|
107
|
+
whileHover={{ scale: 1.02 }}
|
|
108
|
+
whileTap={{ scale: 0.98 }}
|
|
109
|
+
transition={{ duration: 0.1 }}
|
|
110
|
+
className={cn(buttonVariants({ variant, size, className }))}
|
|
111
|
+
{...(props as React.ComponentPropsWithoutRef<typeof motion.button>)}
|
|
112
|
+
/>
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
Button.displayName = "Button"
|
|
117
|
+
|
|
118
|
+
export { Button, buttonVariants }
|