@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,15 +0,0 @@
1
- import { cn } from "@/lib/utils"
2
-
3
- function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
4
- return (
5
- <div
6
- data-slot="skeleton"
7
- className={cn("relative overflow-hidden rounded-md bg-muted", className)}
8
- {...props}
9
- >
10
- <div className="absolute inset-0 -translate-x-full animate-shimmer bg-gradient-to-r from-transparent via-foreground/5 to-transparent" />
11
- </div>
12
- )
13
- }
14
-
15
- export { Skeleton }
@@ -1,58 +0,0 @@
1
- 'use client'
2
-
3
- import * as React from 'react'
4
- import * as SliderPrimitive from '@radix-ui/react-slider'
5
-
6
- import { cn } from '@/lib/utils'
7
-
8
- function Slider({
9
- className,
10
- defaultValue,
11
- value,
12
- min = 0,
13
- max = 100,
14
- ...props
15
- }: React.ComponentProps<typeof SliderPrimitive.Root>) {
16
- const _values = React.useMemo(
17
- () => (value ?? defaultValue ?? [min, max]),
18
- [value, defaultValue, min, max]
19
- )
20
-
21
- return (
22
- <SliderPrimitive.Root
23
- data-slot="slider"
24
- defaultValue={defaultValue}
25
- value={value}
26
- min={min}
27
- max={max}
28
- className={cn(
29
- 'relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col',
30
- className
31
- )}
32
- {...props}
33
- >
34
- <SliderPrimitive.Track
35
- data-slot="slider-track"
36
- className={cn(
37
- 'bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5'
38
- )}
39
- >
40
- <SliderPrimitive.Range
41
- data-slot="slider-range"
42
- className={cn(
43
- 'bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full'
44
- )}
45
- />
46
- </SliderPrimitive.Track>
47
- {Array.from({ length: _values.length }, (_, index) => (
48
- <SliderPrimitive.Thumb
49
- data-slot="slider-thumb"
50
- key={index}
51
- className="border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50"
52
- />
53
- ))}
54
- </SliderPrimitive.Root>
55
- )
56
- }
57
-
58
- export { Slider }
@@ -1,47 +0,0 @@
1
- "use client"
2
-
3
- import {
4
- CircleCheckIcon,
5
- InfoIcon,
6
- Loader2Icon,
7
- OctagonXIcon,
8
- TriangleAlertIcon,
9
- } from "lucide-react"
10
- import { useTheme } from "next-themes"
11
- import { Toaster as Sonner, type ToasterProps } from "sonner"
12
-
13
- const Toaster = ({ ...props }: ToasterProps) => {
14
- const { theme = "system" } = useTheme()
15
-
16
- return (
17
- <Sonner
18
- theme={theme as ToasterProps["theme"]}
19
- className="toaster group"
20
- toastOptions={{
21
- classNames: {
22
- toast:
23
- "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
24
- description: "group-[.toast]:text-muted-foreground",
25
- actionButton:
26
- "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
27
- cancelButton:
28
- "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
29
- error:
30
- "group-[.toaster]:bg-destructive group-[.toaster]:text-destructive-foreground group-[.toaster]:border-destructive",
31
- success:
32
- "group-[.toaster]:bg-[#d3f4e5] dark:group-[.toaster]:bg-[#1a3d2e] group-[.toaster]:text-[#1a3d2e] dark:group-[.toaster]:text-[#d3f4e5] group-[.toaster]:border-[#b0e5cc] dark:group-[.toaster]:border-[#2d5a45]",
33
- },
34
- }}
35
- icons={{
36
- success: <CircleCheckIcon className="size-4" />,
37
- info: <InfoIcon className="size-4" />,
38
- warning: <TriangleAlertIcon className="size-4" />,
39
- error: <OctagonXIcon className="size-4" />,
40
- loading: <Loader2Icon className="size-4 animate-spin" />,
41
- }}
42
- {...props}
43
- />
44
- )
45
- }
46
-
47
- export { Toaster }
@@ -1,27 +0,0 @@
1
- import * as React from "react"
2
- import { cn } from "@/lib/utils"
3
-
4
- interface SpinnerProps extends Omit<React.SVGProps<SVGSVGElement>, "width" | "height"> {
5
- size?: number
6
- }
7
-
8
- function Spinner({ className, size = 20, style, ...props }: SpinnerProps) {
9
- return (
10
- <svg
11
- fill="none"
12
- stroke="currentColor"
13
- strokeWidth="1.5"
14
- viewBox="0 0 24 24"
15
- strokeLinecap="round"
16
- strokeLinejoin="round"
17
- xmlns="http://www.w3.org/2000/svg"
18
- className={cn("animate-spin stroke-[#878787]", className)}
19
- style={{ width: size, height: size, ...style }}
20
- {...props}
21
- >
22
- <path d="M12 3v3m6.366-.366-2.12 2.12M21 12h-3m.366 6.366-2.12-2.12M12 21v-3m-6.366.366 2.12-2.12M3 12h3m-.366-6.366 2.12 2.12" />
23
- </svg>
24
- )
25
- }
26
-
27
- export { Spinner }
@@ -1,47 +0,0 @@
1
- 'use client'
2
-
3
- import * as React from 'react'
4
- import { useFormStatus } from 'react-dom'
5
- import { cn } from '@/lib/utils'
6
- import { Button, type buttonVariants } from './button'
7
- import { Spinner } from './spinner'
8
- import type { VariantProps } from 'class-variance-authority'
9
-
10
- interface SubmitButtonProps
11
- extends React.ComponentProps<'button'>,
12
- VariantProps<typeof buttonVariants> {
13
- isSubmitting?: boolean
14
- }
15
-
16
- function SubmitButton({
17
- children,
18
- className,
19
- disabled,
20
- isSubmitting: isSubmittingProp,
21
- variant = 'default',
22
- size = 'default',
23
- ...props
24
- }: SubmitButtonProps) {
25
- const { pending } = useFormStatus()
26
- const isSubmitting = isSubmittingProp ?? pending
27
-
28
- return (
29
- <Button
30
- type="submit"
31
- variant={variant}
32
- size={size}
33
- disabled={disabled || isSubmitting}
34
- className={cn('relative', className)}
35
- {...props}
36
- >
37
- {isSubmitting && (
38
- <span className="absolute inset-0 flex items-center justify-center">
39
- <Spinner size={16} />
40
- </span>
41
- )}
42
- <span className={cn(isSubmitting && 'invisible')}>{children}</span>
43
- </Button>
44
- )
45
- }
46
-
47
- export { SubmitButton }
@@ -1,31 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as SwitchPrimitive from "@radix-ui/react-switch"
5
-
6
- import { cn } from "@/lib/utils"
7
-
8
- function Switch({
9
- className,
10
- ...props
11
- }: React.ComponentProps<typeof SwitchPrimitive.Root>) {
12
- return (
13
- <SwitchPrimitive.Root
14
- data-slot="switch"
15
- className={cn(
16
- "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
17
- className
18
- )}
19
- {...props}
20
- >
21
- <SwitchPrimitive.Thumb
22
- data-slot="switch-thumb"
23
- className={cn(
24
- "bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
25
- )}
26
- />
27
- </SwitchPrimitive.Root>
28
- )
29
- }
30
-
31
- export { Switch }
@@ -1,120 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- function Table({ className, ...props }: React.ComponentProps<"table">) {
8
- return (
9
- <div
10
- data-slot="table-container"
11
- className="relative w-full overflow-x-auto"
12
- >
13
- <table
14
- data-slot="table"
15
- className={cn("w-full caption-bottom text-sm", className)}
16
- {...props}
17
- />
18
- </div>
19
- )
20
- }
21
-
22
- function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
23
- return (
24
- <thead
25
- data-slot="table-header"
26
- className={cn("[&_tr]:border-b", className)}
27
- {...props}
28
- />
29
- )
30
- }
31
-
32
- function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
33
- return (
34
- <tbody
35
- data-slot="table-body"
36
- className={cn("[&_tr:last-child]:border-0", className)}
37
- {...props}
38
- />
39
- )
40
- }
41
-
42
- function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
43
- return (
44
- <tfoot
45
- data-slot="table-footer"
46
- className={cn(
47
- "bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",
48
- className
49
- )}
50
- {...props}
51
- />
52
- )
53
- }
54
-
55
- function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
56
- return (
57
- <tr
58
- data-slot="table-row"
59
- className={cn(
60
- "border-b border-border transition-colors",
61
- "hover:bg-[#F2F1EF] dark:hover:bg-[#0f0f0f]",
62
- "data-[state=selected]:bg-accent",
63
- className
64
- )}
65
- {...props}
66
- />
67
- )
68
- }
69
-
70
- function TableHead({ className, ...props }: React.ComponentProps<"th">) {
71
- return (
72
- <th
73
- data-slot="table-head"
74
- className={cn(
75
- "h-12 px-4 text-left align-middle font-medium text-[#666666]",
76
- "[&:has([role=checkbox])]:pr-0",
77
- className
78
- )}
79
- {...props}
80
- />
81
- )
82
- }
83
-
84
- function TableCell({ className, ...props }: React.ComponentProps<"td">) {
85
- return (
86
- <td
87
- data-slot="table-cell"
88
- className={cn(
89
- "px-4 py-2 align-middle",
90
- "[&:has([role=checkbox])]:pr-0",
91
- className
92
- )}
93
- {...props}
94
- />
95
- )
96
- }
97
-
98
- function TableCaption({
99
- className,
100
- ...props
101
- }: React.ComponentProps<"caption">) {
102
- return (
103
- <caption
104
- data-slot="table-caption"
105
- className={cn("text-muted-foreground mt-4 text-sm", className)}
106
- {...props}
107
- />
108
- )
109
- }
110
-
111
- export {
112
- Table,
113
- TableHeader,
114
- TableBody,
115
- TableFooter,
116
- TableHead,
117
- TableRow,
118
- TableCell,
119
- TableCaption,
120
- }
@@ -1,75 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as TabsPrimitive from "@radix-ui/react-tabs"
5
-
6
- import { cn } from "@/lib/utils"
7
-
8
- function Tabs({
9
- className,
10
- ...props
11
- }: React.ComponentProps<typeof TabsPrimitive.Root>) {
12
- return (
13
- <TabsPrimitive.Root
14
- data-slot="tabs"
15
- className={cn("flex flex-col gap-2", className)}
16
- {...props}
17
- />
18
- )
19
- }
20
-
21
- function TabsList({
22
- className,
23
- ...props
24
- }: React.ComponentProps<typeof TabsPrimitive.List>) {
25
- return (
26
- <TabsPrimitive.List
27
- data-slot="tabs-list"
28
- className={cn(
29
- "inline-flex h-10 items-center justify-center",
30
- "rounded-md bg-muted p-1",
31
- "text-muted-foreground",
32
- className
33
- )}
34
- {...props}
35
- />
36
- )
37
- }
38
-
39
- function TabsTrigger({
40
- className,
41
- ...props
42
- }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
43
- return (
44
- <TabsPrimitive.Trigger
45
- data-slot="tabs-trigger"
46
- className={cn(
47
- "inline-flex items-center justify-center whitespace-nowrap",
48
- "rounded-sm px-3 py-1.5",
49
- "text-sm font-medium",
50
- "transition-all duration-150",
51
- "ring-offset-background",
52
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
53
- "disabled:pointer-events-none disabled:opacity-50",
54
- "data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
55
- className
56
- )}
57
- {...props}
58
- />
59
- )
60
- }
61
-
62
- function TabsContent({
63
- className,
64
- ...props
65
- }: React.ComponentProps<typeof TabsPrimitive.Content>) {
66
- return (
67
- <TabsPrimitive.Content
68
- data-slot="tabs-content"
69
- className={cn("flex-1 outline-none", className)}
70
- {...props}
71
- />
72
- )
73
- }
74
-
75
- export { Tabs, TabsList, TabsTrigger, TabsContent }
@@ -1,26 +0,0 @@
1
- import * as React from "react"
2
-
3
- import { cn } from "@/lib/utils"
4
-
5
- function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
6
- return (
7
- <textarea
8
- data-slot="textarea"
9
- className={cn(
10
- "flex min-h-[80px] w-full",
11
- "rounded-md border border-input bg-transparent",
12
- "px-3 py-2",
13
- "text-sm",
14
- "transition-colors duration-150",
15
- "placeholder:text-muted-foreground",
16
- "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
17
- "disabled:cursor-not-allowed disabled:opacity-50",
18
- "resize-none",
19
- className
20
- )}
21
- {...props}
22
- />
23
- )
24
- }
25
-
26
- export { Textarea }
@@ -1,70 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as TooltipPrimitive from "@radix-ui/react-tooltip"
5
-
6
- import { cn } from "@/lib/utils"
7
-
8
- function TooltipProvider({
9
- delayDuration = 0,
10
- ...props
11
- }: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
12
- return (
13
- <TooltipPrimitive.Provider
14
- data-slot="tooltip-provider"
15
- delayDuration={delayDuration}
16
- {...props}
17
- />
18
- )
19
- }
20
-
21
- function Tooltip({
22
- ...props
23
- }: React.ComponentProps<typeof TooltipPrimitive.Root>) {
24
- return (
25
- <TooltipProvider>
26
- <TooltipPrimitive.Root data-slot="tooltip" {...props} />
27
- </TooltipProvider>
28
- )
29
- }
30
-
31
- function TooltipTrigger({
32
- ...props
33
- }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
34
- return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
35
- }
36
-
37
- function TooltipContent({
38
- className,
39
- sideOffset = 4,
40
- children,
41
- ...props
42
- }: React.ComponentProps<typeof TooltipPrimitive.Content>) {
43
- return (
44
- <TooltipPrimitive.Portal>
45
- <TooltipPrimitive.Content
46
- data-slot="tooltip-content"
47
- sideOffset={sideOffset}
48
- className={cn(
49
- "z-50 overflow-hidden",
50
- "border border-border/50",
51
- "bg-background backdrop-blur-lg",
52
- "dark:bg-[#1A1A1A]/95 dark:border-[#2C2C2C]",
53
- "px-3 py-1.5 text-xs",
54
- "animate-in fade-in-0 zoom-in-95",
55
- "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
56
- "data-[side=bottom]:slide-in-from-top-2",
57
- "data-[side=left]:slide-in-from-right-2",
58
- "data-[side=right]:slide-in-from-left-2",
59
- "data-[side=top]:slide-in-from-bottom-2",
60
- className
61
- )}
62
- {...props}
63
- >
64
- {children}
65
- </TooltipPrimitive.Content>
66
- </TooltipPrimitive.Portal>
67
- )
68
- }
69
-
70
- export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
@@ -1,21 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
-
5
- const MOBILE_BREAKPOINT = 768
6
-
7
- export function useIsMobile() {
8
- const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
9
-
10
- React.useEffect(() => {
11
- const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
12
- const onChange = () => {
13
- setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
14
- }
15
- mql.addEventListener("change", onChange)
16
- setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
17
- return () => mql.removeEventListener("change", onChange)
18
- }, [])
19
-
20
- return !!isMobile
21
- }
@@ -1,8 +0,0 @@
1
- import { createBrowserClient } from '@supabase/ssr'
2
-
3
- export function createClient() {
4
- return createBrowserClient(
5
- process.env.NEXT_PUBLIC_SUPABASE_URL!,
6
- process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
7
- )
8
- }
@@ -1,29 +0,0 @@
1
- import { createServerClient } from '@supabase/ssr'
2
- import { cookies } from 'next/headers'
3
-
4
- export async function createClient() {
5
- const cookieStore = await cookies()
6
-
7
- return createServerClient(
8
- process.env.NEXT_PUBLIC_SUPABASE_URL!,
9
- process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
10
- {
11
- cookies: {
12
- getAll() {
13
- return cookieStore.getAll()
14
- },
15
- setAll(cookiesToSet) {
16
- try {
17
- cookiesToSet.forEach(({ name, value, options }) =>
18
- cookieStore.set(name, value, options)
19
- )
20
- } catch {
21
- // The `setAll` method was called from a Server Component.
22
- // This can be ignored if you have middleware refreshing
23
- // user sessions.
24
- }
25
- },
26
- },
27
- }
28
- )
29
- }
@@ -1,6 +0,0 @@
1
- import { clsx, type ClassValue } from "clsx"
2
- import { twMerge } from "tailwind-merge"
3
-
4
- export function cn(...inputs: ClassValue[]) {
5
- return twMerge(clsx(inputs))
6
- }
@@ -1,12 +0,0 @@
1
- 'use server'
2
-
3
- import { createClient } from '@/lib/supabase/server'
4
- import { redirect } from 'next/navigation'
5
-
6
- export async function logout() {
7
- const supabase = await createClient()
8
- await supabase.auth.signOut()
9
- redirect('/auth/login')
10
- }
11
-
12
- export const logoutAction = logout