create-next-imagicma 0.0.1

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 (86) hide show
  1. package/README.md +42 -0
  2. package/bin/create-next-imagicma.mjs +220 -0
  3. package/package.json +19 -0
  4. package/template/.env.example +10 -0
  5. package/template/AGENTS.md +146 -0
  6. package/template/README.md +36 -0
  7. package/template/app/_components/DevPreviewShield.tsx +638 -0
  8. package/template/app/api/greeting/route.ts +27 -0
  9. package/template/app/error.tsx +93 -0
  10. package/template/app/favicon.ico +0 -0
  11. package/template/app/globals.css +145 -0
  12. package/template/app/hello/_components/HelloClient.tsx +94 -0
  13. package/template/app/hello/page.tsx +23 -0
  14. package/template/app/layout.tsx +29 -0
  15. package/template/app/page.tsx +49 -0
  16. package/template/app/providers.tsx +25 -0
  17. package/template/components/ui/accordion.tsx +58 -0
  18. package/template/components/ui/alert-dialog.tsx +141 -0
  19. package/template/components/ui/alert.tsx +61 -0
  20. package/template/components/ui/aspect-ratio.tsx +7 -0
  21. package/template/components/ui/avatar.tsx +51 -0
  22. package/template/components/ui/badge.tsx +40 -0
  23. package/template/components/ui/breadcrumb.tsx +117 -0
  24. package/template/components/ui/button.tsx +64 -0
  25. package/template/components/ui/calendar.tsx +72 -0
  26. package/template/components/ui/card.tsx +87 -0
  27. package/template/components/ui/carousel.tsx +262 -0
  28. package/template/components/ui/chart.tsx +365 -0
  29. package/template/components/ui/checkbox.tsx +30 -0
  30. package/template/components/ui/collapsible.tsx +11 -0
  31. package/template/components/ui/command.tsx +153 -0
  32. package/template/components/ui/context-menu.tsx +200 -0
  33. package/template/components/ui/dialog.tsx +122 -0
  34. package/template/components/ui/drawer.tsx +118 -0
  35. package/template/components/ui/dropdown-menu.tsx +200 -0
  36. package/template/components/ui/form.tsx +178 -0
  37. package/template/components/ui/hover-card.tsx +29 -0
  38. package/template/components/ui/input-otp.tsx +71 -0
  39. package/template/components/ui/input.tsx +25 -0
  40. package/template/components/ui/label.tsx +26 -0
  41. package/template/components/ui/menubar.tsx +256 -0
  42. package/template/components/ui/navigation-menu.tsx +130 -0
  43. package/template/components/ui/pagination.tsx +119 -0
  44. package/template/components/ui/popover.tsx +31 -0
  45. package/template/components/ui/progress.tsx +28 -0
  46. package/template/components/ui/radio-group.tsx +44 -0
  47. package/template/components/ui/resizable.tsx +45 -0
  48. package/template/components/ui/scroll-area.tsx +48 -0
  49. package/template/components/ui/select.tsx +160 -0
  50. package/template/components/ui/separator.tsx +31 -0
  51. package/template/components/ui/sheet.tsx +140 -0
  52. package/template/components/ui/sidebar.tsx +732 -0
  53. package/template/components/ui/skeleton.tsx +17 -0
  54. package/template/components/ui/slider.tsx +28 -0
  55. package/template/components/ui/switch.tsx +29 -0
  56. package/template/components/ui/table.tsx +119 -0
  57. package/template/components/ui/tabs.tsx +55 -0
  58. package/template/components/ui/textarea.tsx +24 -0
  59. package/template/components/ui/toast.tsx +129 -0
  60. package/template/components/ui/toaster.tsx +35 -0
  61. package/template/components/ui/toggle-group.tsx +61 -0
  62. package/template/components/ui/toggle.tsx +45 -0
  63. package/template/components/ui/tooltip.tsx +30 -0
  64. package/template/drizzle.config.ts +50 -0
  65. package/template/eslint.config.mjs +18 -0
  66. package/template/hooks/use-greeting.ts +15 -0
  67. package/template/hooks/use-mobile.ts +21 -0
  68. package/template/hooks/use-toast.ts +194 -0
  69. package/template/lib/queryClient.ts +59 -0
  70. package/template/lib/utils.ts +6 -0
  71. package/template/next.config.ts +8 -0
  72. package/template/package.json +81 -0
  73. package/template/pnpm-lock.yaml +6937 -0
  74. package/template/postcss.config.mjs +7 -0
  75. package/template/public/file.svg +1 -0
  76. package/template/public/globe.svg +1 -0
  77. package/template/public/next.svg +1 -0
  78. package/template/public/vercel.svg +1 -0
  79. package/template/public/window.svg +1 -0
  80. package/template/server/db.ts +24 -0
  81. package/template/server/storage.ts +41 -0
  82. package/template/shared/routes.ts +13 -0
  83. package/template/shared/schema.ts +17 -0
  84. package/template/tailwind.config.mjs +96 -0
  85. package/template/tsconfig.json +35 -0
  86. package/template/types/pg.d.ts +19 -0
@@ -0,0 +1,61 @@
1
+ "use client";
2
+
3
+ import * as React from "react"
4
+ import { cva, type VariantProps } from "class-variance-authority"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ const alertVariants = cva(
9
+ "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
10
+ {
11
+ variants: {
12
+ variant: {
13
+ default: "bg-background text-foreground",
14
+ destructive:
15
+ "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
16
+ },
17
+ },
18
+ defaultVariants: {
19
+ variant: "default",
20
+ },
21
+ }
22
+ )
23
+
24
+ const Alert = React.forwardRef<
25
+ HTMLDivElement,
26
+ React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
27
+ >(({ className, variant, ...props }, ref) => (
28
+ <div
29
+ ref={ref}
30
+ role="alert"
31
+ className={cn(alertVariants({ variant }), className)}
32
+ {...props}
33
+ />
34
+ ))
35
+ Alert.displayName = "Alert"
36
+
37
+ const AlertTitle = React.forwardRef<
38
+ HTMLParagraphElement,
39
+ React.HTMLAttributes<HTMLHeadingElement>
40
+ >(({ className, ...props }, ref) => (
41
+ <h5
42
+ ref={ref}
43
+ className={cn("mb-1 font-medium leading-none tracking-tight", className)}
44
+ {...props}
45
+ />
46
+ ))
47
+ AlertTitle.displayName = "AlertTitle"
48
+
49
+ const AlertDescription = React.forwardRef<
50
+ HTMLParagraphElement,
51
+ React.HTMLAttributes<HTMLParagraphElement>
52
+ >(({ className, ...props }, ref) => (
53
+ <div
54
+ ref={ref}
55
+ className={cn("text-sm [&_p]:leading-relaxed", className)}
56
+ {...props}
57
+ />
58
+ ))
59
+ AlertDescription.displayName = "AlertDescription"
60
+
61
+ export { Alert, AlertTitle, AlertDescription }
@@ -0,0 +1,7 @@
1
+ "use client";
2
+
3
+ import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"
4
+
5
+ const AspectRatio = AspectRatioPrimitive.Root
6
+
7
+ export { AspectRatio }
@@ -0,0 +1,51 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as AvatarPrimitive from "@radix-ui/react-avatar"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ const Avatar = React.forwardRef<
9
+ React.ElementRef<typeof AvatarPrimitive.Root>,
10
+ React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
11
+ >(({ className, ...props }, ref) => (
12
+ <AvatarPrimitive.Root
13
+ ref={ref}
14
+ className={cn(`
15
+ after:content-[''] after:block after:absolute after:inset-0 after:rounded-full after:pointer-events-none after:border after:border-black/10 dark:after:border-white/10
16
+ relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full`,
17
+ className
18
+ )}
19
+ {...props}
20
+ />
21
+ ))
22
+ Avatar.displayName = AvatarPrimitive.Root.displayName
23
+
24
+ const AvatarImage = React.forwardRef<
25
+ React.ElementRef<typeof AvatarPrimitive.Image>,
26
+ React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
27
+ >(({ className, ...props }, ref) => (
28
+ <AvatarPrimitive.Image
29
+ ref={ref}
30
+ className={cn("aspect-square h-full w-full", className)}
31
+ {...props}
32
+ />
33
+ ))
34
+ AvatarImage.displayName = AvatarPrimitive.Image.displayName
35
+
36
+ const AvatarFallback = React.forwardRef<
37
+ React.ElementRef<typeof AvatarPrimitive.Fallback>,
38
+ React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
39
+ >(({ className, ...props }, ref) => (
40
+ <AvatarPrimitive.Fallback
41
+ ref={ref}
42
+ className={cn(
43
+ "flex h-full w-full items-center justify-center rounded-full bg-muted",
44
+ className
45
+ )}
46
+ {...props}
47
+ />
48
+ ))
49
+ AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
50
+
51
+ export { Avatar, AvatarImage, AvatarFallback }
@@ -0,0 +1,40 @@
1
+ "use client";
2
+
3
+ import * as React from "react"
4
+ import { cva, type VariantProps } from "class-variance-authority"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ const badgeVariants = cva(
9
+ // Whitespace-nowrap: Badges should never wrap.
10
+ "whitespace-nowrap inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2" +
11
+ " hover-elevate " ,
12
+ {
13
+ variants: {
14
+ variant: {
15
+ default:
16
+ "border-transparent bg-primary text-primary-foreground shadow-xs",
17
+ secondary: "border-transparent bg-secondary text-secondary-foreground",
18
+ destructive:
19
+ "border-transparent bg-destructive text-destructive-foreground shadow-xs",
20
+
21
+ outline: " border [border-color:var(--badge-outline)] shadow-xs",
22
+ },
23
+ },
24
+ defaultVariants: {
25
+ variant: "default",
26
+ },
27
+ },
28
+ )
29
+
30
+ export interface BadgeProps
31
+ extends React.HTMLAttributes<HTMLDivElement>,
32
+ VariantProps<typeof badgeVariants> {}
33
+
34
+ function Badge({ className, variant, ...props }: BadgeProps) {
35
+ return (
36
+ <div className={cn(badgeVariants({ variant }), className)} {...props} />
37
+ );
38
+ }
39
+
40
+ export { Badge, badgeVariants }
@@ -0,0 +1,117 @@
1
+ "use client";
2
+
3
+ import * as React from "react"
4
+ import { Slot } from "@radix-ui/react-slot"
5
+ import { ChevronRight, MoreHorizontal } from "lucide-react"
6
+
7
+ import { cn } from "@/lib/utils"
8
+
9
+ const Breadcrumb = React.forwardRef<
10
+ HTMLElement,
11
+ React.ComponentPropsWithoutRef<"nav"> & {
12
+ separator?: React.ReactNode
13
+ }
14
+ >(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />)
15
+ Breadcrumb.displayName = "Breadcrumb"
16
+
17
+ const BreadcrumbList = React.forwardRef<
18
+ HTMLOListElement,
19
+ React.ComponentPropsWithoutRef<"ol">
20
+ >(({ className, ...props }, ref) => (
21
+ <ol
22
+ ref={ref}
23
+ className={cn(
24
+ "flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
25
+ className
26
+ )}
27
+ {...props}
28
+ />
29
+ ))
30
+ BreadcrumbList.displayName = "BreadcrumbList"
31
+
32
+ const BreadcrumbItem = React.forwardRef<
33
+ HTMLLIElement,
34
+ React.ComponentPropsWithoutRef<"li">
35
+ >(({ className, ...props }, ref) => (
36
+ <li
37
+ ref={ref}
38
+ className={cn("inline-flex items-center gap-1.5", className)}
39
+ {...props}
40
+ />
41
+ ))
42
+ BreadcrumbItem.displayName = "BreadcrumbItem"
43
+
44
+ const BreadcrumbLink = React.forwardRef<
45
+ HTMLAnchorElement,
46
+ React.ComponentPropsWithoutRef<"a"> & {
47
+ asChild?: boolean
48
+ }
49
+ >(({ asChild, className, ...props }, ref) => {
50
+ const Comp = asChild ? Slot : "a"
51
+
52
+ return (
53
+ <Comp
54
+ ref={ref}
55
+ className={cn("transition-colors hover:text-foreground", className)}
56
+ {...props}
57
+ />
58
+ )
59
+ })
60
+ BreadcrumbLink.displayName = "BreadcrumbLink"
61
+
62
+ const BreadcrumbPage = React.forwardRef<
63
+ HTMLSpanElement,
64
+ React.ComponentPropsWithoutRef<"span">
65
+ >(({ className, ...props }, ref) => (
66
+ <span
67
+ ref={ref}
68
+ role="link"
69
+ aria-disabled="true"
70
+ aria-current="page"
71
+ className={cn("font-normal text-foreground", className)}
72
+ {...props}
73
+ />
74
+ ))
75
+ BreadcrumbPage.displayName = "BreadcrumbPage"
76
+
77
+ const BreadcrumbSeparator = ({
78
+ children,
79
+ className,
80
+ ...props
81
+ }: React.ComponentProps<"li">) => (
82
+ <li
83
+ role="presentation"
84
+ aria-hidden="true"
85
+ className={cn("[&>svg]:w-3.5 [&>svg]:h-3.5", className)}
86
+ {...props}
87
+ >
88
+ {children ?? <ChevronRight />}
89
+ </li>
90
+ )
91
+ BreadcrumbSeparator.displayName = "BreadcrumbSeparator"
92
+
93
+ const BreadcrumbEllipsis = ({
94
+ className,
95
+ ...props
96
+ }: React.ComponentProps<"span">) => (
97
+ <span
98
+ role="presentation"
99
+ aria-hidden="true"
100
+ className={cn("flex h-9 w-9 items-center justify-center", className)}
101
+ {...props}
102
+ >
103
+ <MoreHorizontal className="h-4 w-4" />
104
+ <span className="sr-only">More</span>
105
+ </span>
106
+ )
107
+ BreadcrumbEllipsis.displayName = "BreadcrumbElipssis"
108
+
109
+ export {
110
+ Breadcrumb,
111
+ BreadcrumbList,
112
+ BreadcrumbItem,
113
+ BreadcrumbLink,
114
+ BreadcrumbPage,
115
+ BreadcrumbSeparator,
116
+ BreadcrumbEllipsis,
117
+ }
@@ -0,0 +1,64 @@
1
+ "use client";
2
+
3
+ import * as React from "react"
4
+ import { Slot } from "@radix-ui/react-slot"
5
+ import { cva, type VariantProps } from "class-variance-authority"
6
+
7
+ import { cn } from "@/lib/utils"
8
+
9
+ const buttonVariants = cva(
10
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0" +
11
+ " hover-elevate active-elevate-2",
12
+ {
13
+ variants: {
14
+ variant: {
15
+ default:
16
+ "bg-primary text-primary-foreground border border-primary-border",
17
+ destructive:
18
+ "bg-destructive text-destructive-foreground border border-destructive-border",
19
+ outline:
20
+ // Shows the background color of whatever card / sidebar / accent background it is inside of.
21
+ // Inherits the current text color.
22
+ " border [border-color:var(--button-outline)] shadow-xs active:shadow-none ",
23
+ secondary: "border bg-secondary text-secondary-foreground border border-secondary-border ",
24
+ // Add a transparent border so that when someone toggles a border on later, it doesn't shift layout/size.
25
+ ghost: "border border-transparent",
26
+ },
27
+ // Heights are set as "min" heights, because sometimes Ai will place large amount of content
28
+ // inside buttons. With a min-height they will look appropriate with small amounts of content,
29
+ // but will expand to fit large amounts of content.
30
+ size: {
31
+ default: "min-h-9 px-4 py-2",
32
+ sm: "min-h-8 rounded-md px-3 text-xs",
33
+ lg: "min-h-10 rounded-md px-8",
34
+ icon: "h-9 w-9",
35
+ },
36
+ },
37
+ defaultVariants: {
38
+ variant: "default",
39
+ size: "default",
40
+ },
41
+ },
42
+ )
43
+
44
+ export interface ButtonProps
45
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
46
+ VariantProps<typeof buttonVariants> {
47
+ asChild?: boolean
48
+ }
49
+
50
+ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
51
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
52
+ const Comp = asChild ? Slot : "button"
53
+ return (
54
+ <Comp
55
+ className={cn(buttonVariants({ variant, size, className }))}
56
+ ref={ref}
57
+ {...props}
58
+ />
59
+ )
60
+ },
61
+ )
62
+ Button.displayName = "Button"
63
+
64
+ export { Button, buttonVariants }
@@ -0,0 +1,72 @@
1
+ "use client";
2
+
3
+ import * as React from "react"
4
+ import { ChevronLeft, ChevronRight } from "lucide-react"
5
+ import { DayPicker } from "react-day-picker"
6
+
7
+ import { cn } from "@/lib/utils"
8
+ import { buttonVariants } from "@/components/ui/button"
9
+
10
+ export type CalendarProps = React.ComponentProps<typeof DayPicker>
11
+
12
+ function Calendar({
13
+ className,
14
+ classNames,
15
+ showOutsideDays = true,
16
+ ...props
17
+ }: CalendarProps) {
18
+ return (
19
+ <DayPicker
20
+ showOutsideDays={showOutsideDays}
21
+ className={cn("p-3", className)}
22
+ classNames={{
23
+ months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
24
+ month: "space-y-4",
25
+ month_caption: "flex justify-center pt-1 relative items-center",
26
+ caption_label: "text-sm font-medium",
27
+ nav: "space-x-1 flex items-center",
28
+ button_previous: cn(
29
+ buttonVariants({ variant: "outline" }),
30
+ "absolute left-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
31
+ ),
32
+ button_next: cn(
33
+ buttonVariants({ variant: "outline" }),
34
+ "absolute right-1 h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
35
+ ),
36
+ month_grid: "w-full border-collapse space-y-1",
37
+ weekdays: "flex",
38
+ weekday:
39
+ "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
40
+ week: "flex w-full mt-2",
41
+ day: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].range-end)]:rounded-r-md [&:has([aria-selected].outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
42
+ day_button: cn(
43
+ buttonVariants({ variant: "ghost" }),
44
+ "h-9 w-9 p-0 font-normal aria-selected:opacity-100"
45
+ ),
46
+ range_end: "day-range-end",
47
+ selected:
48
+ "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
49
+ today: "bg-accent text-accent-foreground",
50
+ outside:
51
+ "day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",
52
+ disabled: "text-muted-foreground opacity-50",
53
+ range_middle:
54
+ "aria-selected:bg-accent aria-selected:text-accent-foreground",
55
+ hidden: "invisible",
56
+ ...classNames,
57
+ }}
58
+ components={{
59
+ Chevron: ({ orientation, className, ...props }) =>
60
+ orientation === "left" ? (
61
+ <ChevronLeft className={cn("h-4 w-4", className)} {...props} />
62
+ ) : (
63
+ <ChevronRight className={cn("h-4 w-4", className)} {...props} />
64
+ ),
65
+ }}
66
+ {...props}
67
+ />
68
+ )
69
+ }
70
+ Calendar.displayName = "Calendar"
71
+
72
+ export { Calendar }
@@ -0,0 +1,87 @@
1
+ "use client";
2
+
3
+ import * as React from "react"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ const Card = React.forwardRef<
8
+ HTMLDivElement,
9
+ React.HTMLAttributes<HTMLDivElement>
10
+ >(({ className, ...props }, ref) => (
11
+ <div
12
+ ref={ref}
13
+ className={cn(
14
+ "shadcn-card rounded-xl border bg-card border-card-border text-card-foreground shadow-sm",
15
+ className
16
+ )}
17
+ {...props}
18
+ />
19
+ ));
20
+ Card.displayName = "Card"
21
+
22
+ const CardHeader = React.forwardRef<
23
+ HTMLDivElement,
24
+ React.HTMLAttributes<HTMLDivElement>
25
+ >(({ className, ...props }, ref) => (
26
+ <div
27
+ ref={ref}
28
+ className={cn("flex flex-col space-y-1.5 p-6", className)}
29
+ {...props}
30
+ />
31
+ ));
32
+ CardHeader.displayName = "CardHeader"
33
+
34
+ const CardTitle = React.forwardRef<
35
+ HTMLDivElement,
36
+ React.HTMLAttributes<HTMLDivElement>
37
+ >(({ className, ...props }, ref) => (
38
+ <div
39
+ ref={ref}
40
+ className={cn(
41
+ "text-2xl font-semibold leading-none tracking-tight",
42
+ className
43
+ )}
44
+ {...props}
45
+ />
46
+ ))
47
+ CardTitle.displayName = "CardTitle"
48
+
49
+ const CardDescription = React.forwardRef<
50
+ HTMLDivElement,
51
+ React.HTMLAttributes<HTMLDivElement>
52
+ >(({ className, ...props }, ref) => (
53
+ <div
54
+ ref={ref}
55
+ className={cn("text-sm text-muted-foreground", className)}
56
+ {...props}
57
+ />
58
+ ));
59
+ CardDescription.displayName = "CardDescription"
60
+
61
+ const CardContent = React.forwardRef<
62
+ HTMLDivElement,
63
+ React.HTMLAttributes<HTMLDivElement>
64
+ >(({ className, ...props }, ref) => (
65
+ <div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
66
+ ))
67
+ CardContent.displayName = "CardContent"
68
+
69
+ const CardFooter = React.forwardRef<
70
+ HTMLDivElement,
71
+ React.HTMLAttributes<HTMLDivElement>
72
+ >(({ className, ...props }, ref) => (
73
+ <div
74
+ ref={ref}
75
+ className={cn("flex items-center p-6 pt-0", className)}
76
+ {...props}
77
+ />
78
+ ))
79
+ CardFooter.displayName = "CardFooter"
80
+ export {
81
+ Card,
82
+ CardHeader,
83
+ CardFooter,
84
+ CardTitle,
85
+ CardDescription,
86
+ CardContent,
87
+ }