@create-lft-app/cli 1.0.14 → 1.1.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 (61) hide show
  1. package/dist/bin/cli.js +13 -146
  2. package/dist/bin/cli.js.map +1 -1
  3. package/dist/src/index.js +11 -144
  4. package/dist/src/index.js.map +1 -1
  5. package/package.json +1 -1
  6. package/templates/app/auth/login/page.tsx +0 -153
  7. package/templates/app/dashboard/page.tsx +0 -102
  8. package/templates/app/globals.css +0 -249
  9. package/templates/app/layout.tsx +0 -40
  10. package/templates/app/page.tsx +0 -5
  11. package/templates/components/dashboard/widget.tsx +0 -113
  12. package/templates/components/layout/admin-midday-sidebar.tsx +0 -247
  13. package/templates/components/layout/admin-sidebar.tsx +0 -146
  14. package/templates/components/layout/header.tsx +0 -71
  15. package/templates/components/layout/main-content.tsx +0 -28
  16. package/templates/components/layout/midday-sidebar.tsx +0 -381
  17. package/templates/components/layout/nav-user.tsx +0 -108
  18. package/templates/components/layout/page-header.tsx +0 -95
  19. package/templates/components/layout/sidebar-context.tsx +0 -33
  20. package/templates/components/layout/sidebar.tsx +0 -194
  21. package/templates/components/layout/suspension-banner.tsx +0 -21
  22. package/templates/components/ui/accordion.tsx +0 -58
  23. package/templates/components/ui/alert-dialog.tsx +0 -165
  24. package/templates/components/ui/alert.tsx +0 -66
  25. package/templates/components/ui/avatar.tsx +0 -55
  26. package/templates/components/ui/badge.tsx +0 -50
  27. package/templates/components/ui/button.tsx +0 -89
  28. package/templates/components/ui/calendar.tsx +0 -220
  29. package/templates/components/ui/card.tsx +0 -89
  30. package/templates/components/ui/checkbox.tsx +0 -38
  31. package/templates/components/ui/collapsible.tsx +0 -33
  32. package/templates/components/ui/command.tsx +0 -196
  33. package/templates/components/ui/dialog.tsx +0 -153
  34. package/templates/components/ui/dropdown-menu.tsx +0 -280
  35. package/templates/components/ui/form.tsx +0 -171
  36. package/templates/components/ui/icons.tsx +0 -167
  37. package/templates/components/ui/input.tsx +0 -28
  38. package/templates/components/ui/label.tsx +0 -25
  39. package/templates/components/ui/popover.tsx +0 -59
  40. package/templates/components/ui/progress.tsx +0 -32
  41. package/templates/components/ui/radio-group.tsx +0 -45
  42. package/templates/components/ui/scroll-area.tsx +0 -63
  43. package/templates/components/ui/select.tsx +0 -208
  44. package/templates/components/ui/separator.tsx +0 -28
  45. package/templates/components/ui/sheet.tsx +0 -146
  46. package/templates/components/ui/sidebar.tsx +0 -726
  47. package/templates/components/ui/skeleton.tsx +0 -15
  48. package/templates/components/ui/slider.tsx +0 -58
  49. package/templates/components/ui/sonner.tsx +0 -47
  50. package/templates/components/ui/spinner.tsx +0 -27
  51. package/templates/components/ui/submit-button.tsx +0 -47
  52. package/templates/components/ui/switch.tsx +0 -31
  53. package/templates/components/ui/table.tsx +0 -120
  54. package/templates/components/ui/tabs.tsx +0 -75
  55. package/templates/components/ui/textarea.tsx +0 -26
  56. package/templates/components/ui/tooltip.tsx +0 -70
  57. package/templates/hooks/use-mobile.ts +0 -21
  58. package/templates/lib/supabase/client.ts +0 -8
  59. package/templates/lib/supabase/server.ts +0 -29
  60. package/templates/lib/utils.ts +0 -6
  61. package/templates/modules/auth/actions/auth-actions.ts +0 -12
@@ -1,247 +0,0 @@
1
- 'use client'
2
-
3
- import Link from 'next/link'
4
- import { usePathname } from 'next/navigation'
5
- import { useState, useRef, useEffect } from 'react'
6
- import { cn } from '@/lib/utils'
7
- import {
8
- LayoutDashboard,
9
- Building2,
10
- Users,
11
- CreditCard,
12
- Settings,
13
- Shield,
14
- Clock,
15
- ChevronLeft,
16
- LogOut,
17
- } from 'lucide-react'
18
- import {
19
- DropdownMenu,
20
- DropdownMenuContent,
21
- DropdownMenuItem,
22
- DropdownMenuSeparator,
23
- DropdownMenuTrigger,
24
- } from '@/components/ui/dropdown-menu'
25
- import { logout } from '@/modules/auth/actions/auth-actions'
26
-
27
- type NavItem = {
28
- path: string
29
- name: string
30
- icon: React.ComponentType<{ className?: string }>
31
- }
32
-
33
- const adminNavItems: NavItem[] = [
34
- { path: '/admin', name: 'Dashboard', icon: LayoutDashboard },
35
- { path: '/admin/organizations', name: 'Organizaciones', icon: Building2 },
36
- { path: '/admin/users', name: 'Usuarios', icon: Users },
37
- { path: '/admin/subscriptions', name: 'Suscripciones', icon: CreditCard },
38
- ]
39
-
40
- const systemNavItems: NavItem[] = [
41
- { path: '/admin/jobs', name: 'Jobs', icon: Clock },
42
- { path: '/admin/settings', name: 'Configuración', icon: Settings },
43
- ]
44
-
45
- interface AdminMiddaySidebarProps {
46
- user: {
47
- email: string
48
- full_name: string | null
49
- role: string
50
- } | null
51
- }
52
-
53
- export function AdminMiddaySidebar({ user }: AdminMiddaySidebarProps) {
54
- const pathname = usePathname()
55
- const [isExpanded, setIsExpanded] = useState(false)
56
- const sidebarRef = useRef<HTMLElement>(null)
57
- const timeoutRef = useRef<NodeJS.Timeout | null>(null)
58
-
59
- const handleMouseEnter = () => {
60
- if (timeoutRef.current) clearTimeout(timeoutRef.current)
61
- setIsExpanded(true)
62
- }
63
-
64
- const handleMouseLeave = () => {
65
- timeoutRef.current = setTimeout(() => setIsExpanded(false), 100)
66
- }
67
-
68
- useEffect(() => {
69
- return () => {
70
- if (timeoutRef.current) clearTimeout(timeoutRef.current)
71
- }
72
- }, [])
73
-
74
- const isActive = (path: string) => {
75
- if (path === '/admin') return pathname === '/admin'
76
- return pathname.startsWith(path)
77
- }
78
-
79
- const initials = user?.full_name
80
- ?.split(' ')
81
- .map((n) => n[0])
82
- .join('')
83
- .toUpperCase()
84
- .slice(0, 2) || 'SA'
85
-
86
- return (
87
- <aside
88
- ref={sidebarRef}
89
- className={cn(
90
- 'h-screen flex-shrink-0 flex-col justify-between fixed top-0 left-0 hidden md:flex z-50',
91
- 'bg-background border-r border-border',
92
- 'transition-[width] duration-200 ease-[cubic-bezier(0.4,0,0.2,1)]',
93
- isExpanded ? 'w-[240px]' : 'w-[70px]'
94
- )}
95
- onMouseEnter={handleMouseEnter}
96
- onMouseLeave={handleMouseLeave}
97
- >
98
- {/* Logo */}
99
- <div className="h-[70px] flex items-center border-b border-border px-4">
100
- <Link href="/admin" className="flex items-center gap-3">
101
- <div className="flex h-8 w-8 items-center justify-center rounded-md bg-red-500 text-white flex-shrink-0">
102
- <Shield className="h-4 w-4" />
103
- </div>
104
- <span
105
- className={cn(
106
- 'font-semibold text-sm whitespace-nowrap transition-opacity duration-200',
107
- isExpanded ? 'opacity-100' : 'opacity-0 w-0'
108
- )}
109
- >
110
- Super Admin
111
- </span>
112
- </Link>
113
- </div>
114
-
115
- {/* Navigation */}
116
- <nav className="flex-1 overflow-y-auto py-4">
117
- {/* Main Nav */}
118
- <div className="mb-6">
119
- {isExpanded && (
120
- <p className="px-4 mb-2 text-[10px] font-medium text-[#878787] uppercase tracking-wider">
121
- Gestión
122
- </p>
123
- )}
124
- <ul className="space-y-1 px-2">
125
- {adminNavItems.map((item) => {
126
- const Icon = item.icon
127
- const active = isActive(item.path)
128
-
129
- return (
130
- <li key={item.path}>
131
- <Link
132
- href={item.path}
133
- className={cn(
134
- 'flex items-center gap-3 rounded-md px-3 py-2 text-sm transition-colors',
135
- active
136
- ? 'bg-accent text-foreground'
137
- : 'text-[#878787] hover:bg-accent/50 hover:text-foreground'
138
- )}
139
- >
140
- <Icon className="h-4 w-4 flex-shrink-0" />
141
- {isExpanded && (
142
- <span className="whitespace-nowrap">
143
- {item.name}
144
- </span>
145
- )}
146
- </Link>
147
- </li>
148
- )
149
- })}
150
- </ul>
151
- </div>
152
-
153
- {/* System Nav */}
154
- <div>
155
- {isExpanded && (
156
- <p className="px-4 mb-2 text-[10px] font-medium text-[#878787] uppercase tracking-wider">
157
- Sistema
158
- </p>
159
- )}
160
- <ul className="space-y-1 px-2">
161
- {systemNavItems.map((item) => {
162
- const Icon = item.icon
163
- const active = isActive(item.path)
164
-
165
- return (
166
- <li key={item.path}>
167
- <Link
168
- href={item.path}
169
- className={cn(
170
- 'flex items-center gap-3 rounded-md px-3 py-2 text-sm transition-colors',
171
- active
172
- ? 'bg-accent text-foreground'
173
- : 'text-[#878787] hover:bg-accent/50 hover:text-foreground'
174
- )}
175
- >
176
- <Icon className="h-4 w-4 flex-shrink-0" />
177
- {isExpanded && (
178
- <span className="whitespace-nowrap">
179
- {item.name}
180
- </span>
181
- )}
182
- </Link>
183
- </li>
184
- )
185
- })}
186
- </ul>
187
- </div>
188
- </nav>
189
-
190
- {/* Back to Dashboard & User */}
191
- <div className="border-t border-border">
192
- {/* Back Link */}
193
- <Link
194
- href="/"
195
- className="flex items-center gap-3 px-4 py-3 text-sm text-[#878787] hover:text-foreground hover:bg-accent/50 transition-colors"
196
- >
197
- <ChevronLeft className="h-4 w-4 flex-shrink-0" />
198
- <span
199
- className={cn(
200
- 'whitespace-nowrap transition-opacity duration-200',
201
- isExpanded ? 'opacity-100' : 'opacity-0 w-0'
202
- )}
203
- >
204
- Volver al Dashboard
205
- </span>
206
- </Link>
207
-
208
- {/* User Menu */}
209
- <DropdownMenu>
210
- <DropdownMenuTrigger asChild>
211
- <button className="flex items-center gap-3 w-full px-4 py-3 hover:bg-accent/50 transition-colors">
212
- <div className="flex h-8 w-8 items-center justify-center rounded-full bg-red-500/10 text-red-500 text-xs font-medium flex-shrink-0">
213
- {initials}
214
- </div>
215
- <div
216
- className={cn(
217
- 'flex flex-col items-start text-left transition-opacity duration-200',
218
- isExpanded ? 'opacity-100' : 'opacity-0 w-0'
219
- )}
220
- >
221
- <span className="text-sm font-medium truncate max-w-[160px]">
222
- {user?.full_name || 'Super Admin'}
223
- </span>
224
- <span className="text-xs text-[#878787] truncate max-w-[160px]">
225
- {user?.email}
226
- </span>
227
- </div>
228
- </button>
229
- </DropdownMenuTrigger>
230
- <DropdownMenuContent align="end" className="w-56">
231
- <div className="px-2 py-1.5">
232
- <p className="text-sm font-medium">{user?.full_name}</p>
233
- <p className="text-xs text-[#878787]">{user?.email}</p>
234
- </div>
235
- <DropdownMenuSeparator />
236
- <DropdownMenuItem asChild>
237
- <button onClick={() => logout()} className="w-full cursor-pointer">
238
- <LogOut className="h-4 w-4 mr-2" />
239
- Cerrar sesión
240
- </button>
241
- </DropdownMenuItem>
242
- </DropdownMenuContent>
243
- </DropdownMenu>
244
- </div>
245
- </aside>
246
- )
247
- }
@@ -1,146 +0,0 @@
1
- 'use client'
2
-
3
- import Link from 'next/link'
4
- import { usePathname } from 'next/navigation'
5
- import {
6
- LayoutDashboard,
7
- Building2,
8
- Users,
9
- CreditCard,
10
- Settings,
11
- Shield,
12
- Clock,
13
- } from 'lucide-react'
14
- import {
15
- Sidebar,
16
- SidebarContent,
17
- SidebarGroup,
18
- SidebarGroupContent,
19
- SidebarGroupLabel,
20
- SidebarMenu,
21
- SidebarMenuButton,
22
- SidebarMenuItem,
23
- SidebarHeader,
24
- SidebarFooter,
25
- } from '@/components/ui/sidebar'
26
- import { NavUser } from './nav-user'
27
-
28
- const adminNavItems = [
29
- {
30
- title: 'Dashboard',
31
- url: '/admin',
32
- icon: LayoutDashboard,
33
- },
34
- {
35
- title: 'Organizaciones',
36
- url: '/admin/organizations',
37
- icon: Building2,
38
- },
39
- {
40
- title: 'Usuarios',
41
- url: '/admin/users',
42
- icon: Users,
43
- },
44
- {
45
- title: 'Suscripciones',
46
- url: '/admin/subscriptions',
47
- icon: CreditCard,
48
- },
49
- ]
50
-
51
- const systemNavItems = [
52
- {
53
- title: 'Jobs',
54
- url: '/admin/jobs',
55
- icon: Clock,
56
- },
57
- {
58
- title: 'Configuración',
59
- url: '/admin/settings',
60
- icon: Settings,
61
- },
62
- ]
63
-
64
- interface AdminSidebarProps {
65
- user: {
66
- email: string
67
- full_name: string | null
68
- role: string
69
- } | null
70
- }
71
-
72
- export function AdminSidebar({ user }: AdminSidebarProps) {
73
- const pathname = usePathname()
74
-
75
- return (
76
- <Sidebar>
77
- <SidebarHeader className="border-b border-sidebar-border">
78
- <div className="flex items-center gap-2 px-4 py-3">
79
- <div className="flex h-8 w-8 items-center justify-center rounded-lg bg-destructive text-destructive-foreground font-bold">
80
- <Shield className="h-4 w-4" />
81
- </div>
82
- <div className="flex flex-col">
83
- <span className="text-sm font-semibold">
84
- {user?.full_name?.split(' ')[0] || 'Admin'}
85
- </span>
86
- <span className="text-xs text-muted-foreground">
87
- Super Admin
88
- </span>
89
- </div>
90
- </div>
91
- </SidebarHeader>
92
-
93
- <SidebarContent>
94
- <SidebarGroup>
95
- <SidebarGroupLabel>Gestión</SidebarGroupLabel>
96
- <SidebarGroupContent>
97
- <SidebarMenu>
98
- {adminNavItems.map((item) => (
99
- <SidebarMenuItem key={item.title}>
100
- <SidebarMenuButton
101
- asChild
102
- isActive={
103
- item.url === '/admin'
104
- ? pathname === '/admin'
105
- : pathname.startsWith(item.url)
106
- }
107
- >
108
- <Link href={item.url}>
109
- <item.icon className="h-4 w-4" />
110
- <span>{item.title}</span>
111
- </Link>
112
- </SidebarMenuButton>
113
- </SidebarMenuItem>
114
- ))}
115
- </SidebarMenu>
116
- </SidebarGroupContent>
117
- </SidebarGroup>
118
-
119
- <SidebarGroup>
120
- <SidebarGroupLabel>Sistema</SidebarGroupLabel>
121
- <SidebarGroupContent>
122
- <SidebarMenu>
123
- {systemNavItems.map((item) => (
124
- <SidebarMenuItem key={item.title}>
125
- <SidebarMenuButton
126
- asChild
127
- isActive={pathname.startsWith(item.url)}
128
- >
129
- <Link href={item.url}>
130
- <item.icon className="h-4 w-4" />
131
- <span>{item.title}</span>
132
- </Link>
133
- </SidebarMenuButton>
134
- </SidebarMenuItem>
135
- ))}
136
- </SidebarMenu>
137
- </SidebarGroupContent>
138
- </SidebarGroup>
139
- </SidebarContent>
140
-
141
- <SidebarFooter className="border-t border-sidebar-border">
142
- <NavUser user={user} />
143
- </SidebarFooter>
144
- </Sidebar>
145
- )
146
- }
@@ -1,71 +0,0 @@
1
- 'use client'
2
-
3
- import { Bell } from 'lucide-react'
4
- import { Button } from '@/components/ui/button'
5
- import { SidebarTrigger } from '@/components/ui/sidebar'
6
- import { Separator } from '@/components/ui/separator'
7
- import {
8
- DropdownMenu,
9
- DropdownMenuContent,
10
- DropdownMenuItem,
11
- DropdownMenuLabel,
12
- DropdownMenuSeparator,
13
- DropdownMenuTrigger,
14
- } from '@/components/ui/dropdown-menu'
15
- import { Badge } from '@/components/ui/badge'
16
-
17
- interface HeaderProps {
18
- title?: string
19
- }
20
-
21
- export function Header({ title }: HeaderProps) {
22
- return (
23
- <header className="flex h-14 shrink-0 items-center gap-2 border-b px-4">
24
- <SidebarTrigger className="-ml-1" />
25
- <Separator orientation="vertical" className="mr-2 h-4" />
26
- {title && <h1 className="text-lg font-semibold">{title}</h1>}
27
-
28
- <div className="ml-auto flex items-center gap-2">
29
- <DropdownMenu>
30
- <DropdownMenuTrigger asChild>
31
- <Button variant="ghost" size="icon" className="relative">
32
- <Bell className="h-5 w-5" />
33
- <Badge
34
- variant="destructive"
35
- className="absolute -right-1 -top-1 h-5 w-5 rounded-full p-0 text-xs flex items-center justify-center"
36
- >
37
- 3
38
- </Badge>
39
- </Button>
40
- </DropdownMenuTrigger>
41
- <DropdownMenuContent align="end" className="w-80">
42
- <DropdownMenuLabel>Notificaciones</DropdownMenuLabel>
43
- <DropdownMenuSeparator />
44
- <DropdownMenuItem className="flex flex-col items-start gap-1 cursor-pointer">
45
- <span className="font-medium">Documento por vencer</span>
46
- <span className="text-xs text-muted-foreground">
47
- Balance de Empresa ABC S.A. vence en 7 días
48
- </span>
49
- </DropdownMenuItem>
50
- <DropdownMenuItem className="flex flex-col items-start gap-1 cursor-pointer">
51
- <span className="font-medium">Nueva alerta BCRA</span>
52
- <span className="text-xs text-muted-foreground">
53
- Se detectó deuda en situación 3 para cliente
54
- </span>
55
- </DropdownMenuItem>
56
- <DropdownMenuItem className="flex flex-col items-start gap-1 cursor-pointer">
57
- <span className="font-medium">Cliente pendiente</span>
58
- <span className="text-xs text-muted-foreground">
59
- Juan Pérez está esperando aprobación
60
- </span>
61
- </DropdownMenuItem>
62
- <DropdownMenuSeparator />
63
- <DropdownMenuItem className="text-center cursor-pointer">
64
- <span className="text-sm text-primary">Ver todas</span>
65
- </DropdownMenuItem>
66
- </DropdownMenuContent>
67
- </DropdownMenu>
68
- </div>
69
- </header>
70
- )
71
- }
@@ -1,28 +0,0 @@
1
- 'use client'
2
-
3
- import { cn } from '@/lib/utils'
4
- import { useSidebar } from './sidebar-context'
5
- import { ReactNode } from 'react'
6
-
7
- interface MainContentProps {
8
- children: ReactNode
9
- className?: string
10
- }
11
-
12
- export function MainContent({ children, className }: MainContentProps) {
13
- const { isExpanded } = useSidebar()
14
-
15
- return (
16
- <main
17
- className={cn(
18
- 'min-h-screen bg-background',
19
- 'transition-all duration-200 ease-[cubic-bezier(0.4,0,0.2,1)]',
20
- isExpanded ? 'md:ml-[240px] md:w-[calc(100%-240px)]' : 'md:ml-[70px] md:w-[calc(100%-70px)]',
21
- 'w-full',
22
- className
23
- )}
24
- >
25
- {children}
26
- </main>
27
- )
28
- }