@create-lft-app/nextjs 1.0.2 → 3.0.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 (81) hide show
  1. package/package.json +9 -3
  2. package/template/CLAUDE.md +279 -0
  3. package/template/drizzle.config.ts +12 -0
  4. package/template/package.json +31 -6
  5. package/template/proxy.ts +12 -0
  6. package/template/src/app/(auth)/dashboard/dashboard-content.tsx +124 -0
  7. package/template/src/app/(auth)/dashboard/page.tsx +9 -0
  8. package/template/src/app/(auth)/layout.tsx +7 -0
  9. package/template/src/app/(auth)/users/page.tsx +9 -0
  10. package/template/src/app/(auth)/users/users-content.tsx +26 -0
  11. package/template/src/app/(public)/layout.tsx +7 -0
  12. package/template/src/app/(public)/login/page.tsx +17 -0
  13. package/template/src/app/api/webhooks/route.ts +20 -0
  14. package/template/src/app/layout.tsx +13 -12
  15. package/template/src/app/providers.tsx +27 -0
  16. package/template/src/components/layout/{midday-sidebar.tsx → sidebar.tsx} +2 -7
  17. package/template/src/components/tables/data-table-column-header.tsx +68 -0
  18. package/template/src/components/tables/data-table-pagination.tsx +99 -0
  19. package/template/src/components/tables/data-table-toolbar.tsx +50 -0
  20. package/template/src/components/tables/data-table-view-options.tsx +59 -0
  21. package/template/src/components/tables/data-table.tsx +128 -0
  22. package/template/src/components/tables/index.ts +5 -0
  23. package/template/src/components/ui/animations/index.ts +44 -0
  24. package/template/src/components/ui/button.tsx +50 -21
  25. package/template/src/components/ui/card.tsx +27 -3
  26. package/template/src/components/ui/dialog.tsx +38 -35
  27. package/template/src/components/ui/motion.tsx +197 -0
  28. package/template/src/components/ui/page-transition.tsx +166 -0
  29. package/template/src/components/ui/sheet.tsx +65 -41
  30. package/template/src/config/navigation.ts +69 -0
  31. package/template/src/config/site.ts +12 -0
  32. package/template/src/db/index.ts +12 -0
  33. package/template/src/db/schema/index.ts +1 -0
  34. package/template/src/db/schema/users.ts +16 -0
  35. package/template/src/db/seed.ts +39 -0
  36. package/template/src/hooks/index.ts +3 -0
  37. package/template/src/hooks/useDataTable.ts +82 -0
  38. package/template/src/hooks/useDebounce.ts +49 -0
  39. package/template/src/hooks/useMediaQuery.ts +36 -0
  40. package/template/src/lib/date/config.ts +34 -0
  41. package/template/src/lib/date/formatters.ts +120 -0
  42. package/template/src/lib/date/index.ts +19 -0
  43. package/template/src/lib/excel/exporter.ts +89 -0
  44. package/template/src/lib/excel/index.ts +14 -0
  45. package/template/src/lib/excel/parser.ts +96 -0
  46. package/template/src/lib/query-client.ts +35 -0
  47. package/template/src/lib/supabase/client.ts +5 -2
  48. package/template/src/lib/supabase/proxy.ts +67 -0
  49. package/template/src/lib/supabase/server.ts +6 -4
  50. package/template/src/lib/supabase/types.ts +53 -0
  51. package/template/src/lib/validations/common.ts +75 -0
  52. package/template/src/lib/validations/index.ts +20 -0
  53. package/template/src/modules/auth/actions/auth-actions.ts +51 -4
  54. package/template/src/modules/auth/components/login-form.tsx +68 -0
  55. package/template/src/modules/auth/hooks/useAuth.ts +38 -0
  56. package/template/src/modules/auth/hooks/useAuthMutations.ts +43 -0
  57. package/template/src/modules/auth/hooks/useAuthQueries.ts +43 -0
  58. package/template/src/modules/auth/index.ts +12 -0
  59. package/template/src/modules/auth/schemas/auth.schema.ts +32 -0
  60. package/template/src/modules/auth/stores/useAuthStore.ts +37 -0
  61. package/template/src/modules/users/actions/users-actions.ts +94 -0
  62. package/template/src/modules/users/columns.tsx +86 -0
  63. package/template/src/modules/users/components/users-list.tsx +22 -0
  64. package/template/src/modules/users/hooks/useUsers.ts +39 -0
  65. package/template/src/modules/users/hooks/useUsersMutations.ts +55 -0
  66. package/template/src/modules/users/hooks/useUsersQueries.ts +35 -0
  67. package/template/src/modules/users/index.ts +12 -0
  68. package/template/src/modules/users/schemas/users.schema.ts +23 -0
  69. package/template/src/modules/users/stores/useUsersStore.ts +60 -0
  70. package/template/src/stores/index.ts +1 -0
  71. package/template/src/stores/useUiStore.ts +55 -0
  72. package/template/src/types/api.ts +28 -0
  73. package/template/src/types/index.ts +2 -0
  74. package/template/src/types/table.ts +34 -0
  75. package/template/supabase/config.toml +94 -0
  76. package/template/tsconfig.json +2 -1
  77. package/template/tsconfig.tsbuildinfo +1 -0
  78. package/template/next-env.d.ts +0 -6
  79. package/template/package-lock.json +0 -8454
  80. package/template/src/app/dashboard/page.tsx +0 -111
  81. package/template/src/components/dashboard/widget.tsx +0 -113
@@ -1,111 +0,0 @@
1
- import { Widget, WidgetGrid } from "@/components/dashboard/widget"
2
- import {
3
- Users,
4
- DollarSign,
5
- Activity,
6
- TrendingUp,
7
- Building2,
8
- FileText,
9
- AlertCircle,
10
- CheckCircle,
11
- } from "lucide-react"
12
-
13
- function getGreeting(): string {
14
- const hour = new Date().getHours()
15
- if (hour >= 5 && hour < 12) return "Buenos días"
16
- if (hour >= 12 && hour < 19) return "Buenas tardes"
17
- return "Buenas noches"
18
- }
19
-
20
- export default function DashboardPage() {
21
- const greeting = getGreeting()
22
-
23
- return (
24
- <div className="flex flex-col h-screen">
25
- {/* Header */}
26
- <header className="h-[70px] flex items-center border-b border-border px-6">
27
- <div>
28
- <h1 className="text-lg font-medium">Dashboard</h1>
29
- <p className="text-xs text-[#878787]">Resumen de actividad</p>
30
- </div>
31
- </header>
32
-
33
- {/* Content */}
34
- <div className="flex-1 overflow-auto p-6">
35
- {/* Greeting */}
36
- <div className="mb-8">
37
- <h2 className="text-[28px] font-medium leading-tight">
38
- {greeting}{" "}
39
- <span className="text-[#606060]">Usuario,</span>
40
- </h2>
41
- <p className="text-[#878787] text-sm mt-1">
42
- aquí está el resumen de tu actividad.
43
- </p>
44
- </div>
45
-
46
- {/* Widgets Grid */}
47
- <WidgetGrid>
48
- <Widget
49
- title="Usuarios Activos"
50
- icon={<Users className="h-4 w-4" />}
51
- value="1,234"
52
- subValue="usuarios registrados"
53
- trend={{ value: 12.5, positive: true }}
54
- href="/admin/users"
55
- />
56
- <Widget
57
- title="Ingresos"
58
- icon={<DollarSign className="h-4 w-4" />}
59
- value="$45,231"
60
- subValue="este mes"
61
- trend={{ value: 8.2, positive: true }}
62
- variant="success"
63
- />
64
- <Widget
65
- title="Organizaciones"
66
- icon={<Building2 className="h-4 w-4" />}
67
- value="89"
68
- subValue="organizaciones activas"
69
- trend={{ value: 3.1, positive: true }}
70
- href="/admin/organizations"
71
- />
72
- <Widget
73
- title="Actividad"
74
- icon={<Activity className="h-4 w-4" />}
75
- value="2,345"
76
- subValue="eventos hoy"
77
- trend={{ value: 5.4, positive: true }}
78
- />
79
- <Widget
80
- title="Documentos Pendientes"
81
- icon={<FileText className="h-4 w-4" />}
82
- value="23"
83
- subValue="requieren revisión"
84
- variant="warning"
85
- />
86
- <Widget
87
- title="Alertas"
88
- icon={<AlertCircle className="h-4 w-4" />}
89
- value="5"
90
- subValue="alertas activas"
91
- variant="danger"
92
- />
93
- <Widget
94
- title="Tareas Completadas"
95
- icon={<CheckCircle className="h-4 w-4" />}
96
- value="156"
97
- subValue="esta semana"
98
- variant="success"
99
- />
100
- <Widget
101
- title="Crecimiento"
102
- icon={<TrendingUp className="h-4 w-4" />}
103
- value="+24%"
104
- subValue="vs mes anterior"
105
- trend={{ value: 24, positive: true }}
106
- />
107
- </WidgetGrid>
108
- </div>
109
- </div>
110
- )
111
- }
@@ -1,113 +0,0 @@
1
- 'use client'
2
-
3
- import { cn } from '@/lib/utils'
4
- import Link from 'next/link'
5
-
6
- interface WidgetProps {
7
- title: string
8
- icon: React.ReactNode
9
- description?: string
10
- value: string | number
11
- subValue?: string
12
- href?: string
13
- trend?: {
14
- value: number
15
- positive?: boolean
16
- }
17
- variant?: 'default' | 'warning' | 'danger' | 'success'
18
- children?: React.ReactNode
19
- }
20
-
21
- export function Widget({
22
- title,
23
- icon,
24
- description,
25
- value,
26
- subValue,
27
- href,
28
- trend,
29
- variant = 'default',
30
- children,
31
- }: WidgetProps) {
32
- const content = (
33
- <div
34
- className={cn(
35
- 'bg-background border border-border p-4 h-[180px] flex flex-col justify-between transition-all duration-200',
36
- href && 'cursor-pointer hover:bg-accent/50 hover:border-border/80',
37
- )}
38
- >
39
- <div>
40
- <div className="flex items-center gap-2 mb-3">
41
- <span className="text-[#606060]">{icon}</span>
42
- <h3 className="text-xs text-[#606060] font-medium uppercase tracking-wide">{title}</h3>
43
- </div>
44
-
45
- {description && (
46
- <p className="text-sm text-[#878787]">{description}</p>
47
- )}
48
- </div>
49
-
50
- <div>
51
- {children ? (
52
- children
53
- ) : (
54
- <div className="flex flex-col gap-1">
55
- <div className="flex items-baseline gap-2">
56
- <span
57
- className={cn(
58
- 'text-3xl font-medium tabular-nums',
59
- variant === 'danger' && 'text-destructive',
60
- variant === 'warning' && 'text-yellow-500',
61
- variant === 'success' && 'text-green-500',
62
- )}
63
- >
64
- {value}
65
- </span>
66
- {trend && (
67
- <span
68
- className={cn(
69
- 'text-xs',
70
- trend.positive ? 'text-green-500' : 'text-destructive'
71
- )}
72
- >
73
- {trend.positive ? '+' : ''}{trend.value}%
74
- </span>
75
- )}
76
- </div>
77
- {subValue && (
78
- <span className="text-xs text-[#878787]">{subValue}</span>
79
- )}
80
- </div>
81
- )}
82
-
83
- {href && (
84
- <span className="text-xs text-[#878787] group-hover:text-foreground transition-colors mt-2 block">
85
- Ver más →
86
- </span>
87
- )}
88
- </div>
89
- </div>
90
- )
91
-
92
- if (href) {
93
- return (
94
- <Link href={href} className="group">
95
- {content}
96
- </Link>
97
- )
98
- }
99
-
100
- return content
101
- }
102
-
103
- interface WidgetGridProps {
104
- children: React.ReactNode
105
- }
106
-
107
- export function WidgetGrid({ children }: WidgetGridProps) {
108
- return (
109
- <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
110
- {children}
111
- </div>
112
- )
113
- }