@getjack/jack 0.1.19 → 0.1.22

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 (105) hide show
  1. package/package.json +5 -2
  2. package/src/commands/down.ts +11 -1
  3. package/src/commands/init.ts +19 -6
  4. package/src/commands/new.ts +56 -4
  5. package/src/commands/publish.ts +1 -1
  6. package/src/lib/agents.ts +3 -1
  7. package/src/lib/auth/ensure-auth.test.ts +3 -3
  8. package/src/lib/control-plane.ts +15 -1
  9. package/src/lib/deploy-upload.ts +26 -1
  10. package/src/lib/hooks.ts +232 -1
  11. package/src/lib/managed-deploy.ts +13 -6
  12. package/src/lib/managed-down.ts +66 -45
  13. package/src/lib/progress.ts +76 -5
  14. package/src/lib/project-list.ts +6 -1
  15. package/src/lib/project-operations.ts +21 -31
  16. package/src/lib/project-resolver.ts +1 -1
  17. package/src/lib/zip-packager.ts +36 -7
  18. package/src/templates/index.ts +1 -1
  19. package/src/templates/types.ts +16 -0
  20. package/templates/CLAUDE.md +172 -5
  21. package/templates/miniapp/.jack.json +1 -3
  22. package/templates/saas/.jack.json +154 -0
  23. package/templates/saas/AGENTS.md +333 -0
  24. package/templates/saas/bun.lock +925 -0
  25. package/templates/saas/components.json +21 -0
  26. package/templates/saas/index.html +12 -0
  27. package/templates/saas/package.json +75 -0
  28. package/templates/saas/public/icon.png +0 -0
  29. package/templates/saas/public/og.png +0 -0
  30. package/templates/saas/schema.sql +73 -0
  31. package/templates/saas/src/auth.ts +77 -0
  32. package/templates/saas/src/client/App.tsx +63 -0
  33. package/templates/saas/src/client/components/ProtectedRoute.tsx +29 -0
  34. package/templates/saas/src/client/components/ThemeToggle.tsx +32 -0
  35. package/templates/saas/src/client/components/ui/accordion.tsx +62 -0
  36. package/templates/saas/src/client/components/ui/alert-dialog.tsx +133 -0
  37. package/templates/saas/src/client/components/ui/alert.tsx +60 -0
  38. package/templates/saas/src/client/components/ui/aspect-ratio.tsx +9 -0
  39. package/templates/saas/src/client/components/ui/avatar.tsx +39 -0
  40. package/templates/saas/src/client/components/ui/badge.tsx +39 -0
  41. package/templates/saas/src/client/components/ui/breadcrumb.tsx +102 -0
  42. package/templates/saas/src/client/components/ui/button-group.tsx +78 -0
  43. package/templates/saas/src/client/components/ui/button.tsx +60 -0
  44. package/templates/saas/src/client/components/ui/card.tsx +75 -0
  45. package/templates/saas/src/client/components/ui/carousel.tsx +228 -0
  46. package/templates/saas/src/client/components/ui/chart.tsx +326 -0
  47. package/templates/saas/src/client/components/ui/checkbox.tsx +29 -0
  48. package/templates/saas/src/client/components/ui/collapsible.tsx +19 -0
  49. package/templates/saas/src/client/components/ui/command.tsx +159 -0
  50. package/templates/saas/src/client/components/ui/context-menu.tsx +224 -0
  51. package/templates/saas/src/client/components/ui/dialog.tsx +127 -0
  52. package/templates/saas/src/client/components/ui/drawer.tsx +124 -0
  53. package/templates/saas/src/client/components/ui/dropdown-menu.tsx +226 -0
  54. package/templates/saas/src/client/components/ui/empty.tsx +94 -0
  55. package/templates/saas/src/client/components/ui/field.tsx +232 -0
  56. package/templates/saas/src/client/components/ui/form.tsx +152 -0
  57. package/templates/saas/src/client/components/ui/hover-card.tsx +38 -0
  58. package/templates/saas/src/client/components/ui/input-group.tsx +158 -0
  59. package/templates/saas/src/client/components/ui/input-otp.tsx +68 -0
  60. package/templates/saas/src/client/components/ui/input.tsx +21 -0
  61. package/templates/saas/src/client/components/ui/item.tsx +172 -0
  62. package/templates/saas/src/client/components/ui/kbd.tsx +28 -0
  63. package/templates/saas/src/client/components/ui/label.tsx +21 -0
  64. package/templates/saas/src/client/components/ui/menubar.tsx +250 -0
  65. package/templates/saas/src/client/components/ui/navigation-menu.tsx +161 -0
  66. package/templates/saas/src/client/components/ui/pagination.tsx +106 -0
  67. package/templates/saas/src/client/components/ui/popover.tsx +42 -0
  68. package/templates/saas/src/client/components/ui/progress.tsx +26 -0
  69. package/templates/saas/src/client/components/ui/radio-group.tsx +45 -0
  70. package/templates/saas/src/client/components/ui/resizable.tsx +46 -0
  71. package/templates/saas/src/client/components/ui/scroll-area.tsx +56 -0
  72. package/templates/saas/src/client/components/ui/select.tsx +173 -0
  73. package/templates/saas/src/client/components/ui/separator.tsx +28 -0
  74. package/templates/saas/src/client/components/ui/sheet.tsx +128 -0
  75. package/templates/saas/src/client/components/ui/sidebar.tsx +694 -0
  76. package/templates/saas/src/client/components/ui/skeleton.tsx +13 -0
  77. package/templates/saas/src/client/components/ui/slider.tsx +58 -0
  78. package/templates/saas/src/client/components/ui/sonner.tsx +38 -0
  79. package/templates/saas/src/client/components/ui/spinner.tsx +16 -0
  80. package/templates/saas/src/client/components/ui/switch.tsx +28 -0
  81. package/templates/saas/src/client/components/ui/table.tsx +90 -0
  82. package/templates/saas/src/client/components/ui/tabs.tsx +54 -0
  83. package/templates/saas/src/client/components/ui/textarea.tsx +18 -0
  84. package/templates/saas/src/client/components/ui/toggle-group.tsx +80 -0
  85. package/templates/saas/src/client/components/ui/toggle.tsx +44 -0
  86. package/templates/saas/src/client/components/ui/tooltip.tsx +57 -0
  87. package/templates/saas/src/client/hooks/use-mobile.ts +19 -0
  88. package/templates/saas/src/client/hooks/useAuth.ts +14 -0
  89. package/templates/saas/src/client/hooks/useSubscription.ts +86 -0
  90. package/templates/saas/src/client/index.css +165 -0
  91. package/templates/saas/src/client/lib/auth-client.ts +7 -0
  92. package/templates/saas/src/client/lib/plans.ts +82 -0
  93. package/templates/saas/src/client/lib/utils.ts +6 -0
  94. package/templates/saas/src/client/main.tsx +15 -0
  95. package/templates/saas/src/client/pages/DashboardPage.tsx +394 -0
  96. package/templates/saas/src/client/pages/ForgotPasswordPage.tsx +153 -0
  97. package/templates/saas/src/client/pages/HomePage.tsx +285 -0
  98. package/templates/saas/src/client/pages/LoginPage.tsx +169 -0
  99. package/templates/saas/src/client/pages/PricingPage.tsx +467 -0
  100. package/templates/saas/src/client/pages/ResetPasswordPage.tsx +200 -0
  101. package/templates/saas/src/client/pages/SignupPage.tsx +192 -0
  102. package/templates/saas/src/index.ts +208 -0
  103. package/templates/saas/tsconfig.json +18 -0
  104. package/templates/saas/vite.config.ts +14 -0
  105. package/templates/saas/wrangler.jsonc +20 -0
@@ -0,0 +1,161 @@
1
+ import * as React from "react";
2
+ import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
3
+ import { cva } from "class-variance-authority";
4
+ import { ChevronDownIcon } from "lucide-react";
5
+
6
+ import { cn } from "@/lib/utils";
7
+
8
+ function NavigationMenu({
9
+ className,
10
+ children,
11
+ viewport = true,
12
+ ...props
13
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
14
+ viewport?: boolean;
15
+ }) {
16
+ return (
17
+ <NavigationMenuPrimitive.Root
18
+ data-slot="navigation-menu"
19
+ data-viewport={viewport}
20
+ className={cn(
21
+ "group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
22
+ className,
23
+ )}
24
+ {...props}
25
+ >
26
+ {children}
27
+ {viewport && <NavigationMenuViewport />}
28
+ </NavigationMenuPrimitive.Root>
29
+ );
30
+ }
31
+
32
+ function NavigationMenuList({
33
+ className,
34
+ ...props
35
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {
36
+ return (
37
+ <NavigationMenuPrimitive.List
38
+ data-slot="navigation-menu-list"
39
+ className={cn("group flex flex-1 list-none items-center justify-center gap-1", className)}
40
+ {...props}
41
+ />
42
+ );
43
+ }
44
+
45
+ function NavigationMenuItem({
46
+ className,
47
+ ...props
48
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {
49
+ return (
50
+ <NavigationMenuPrimitive.Item
51
+ data-slot="navigation-menu-item"
52
+ className={cn("relative", className)}
53
+ {...props}
54
+ />
55
+ );
56
+ }
57
+
58
+ const navigationMenuTriggerStyle = cva(
59
+ "group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1",
60
+ );
61
+
62
+ function NavigationMenuTrigger({
63
+ className,
64
+ children,
65
+ ...props
66
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {
67
+ return (
68
+ <NavigationMenuPrimitive.Trigger
69
+ data-slot="navigation-menu-trigger"
70
+ className={cn(navigationMenuTriggerStyle(), "group", className)}
71
+ {...props}
72
+ >
73
+ {children}{" "}
74
+ <ChevronDownIcon
75
+ className="relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180"
76
+ aria-hidden="true"
77
+ />
78
+ </NavigationMenuPrimitive.Trigger>
79
+ );
80
+ }
81
+
82
+ function NavigationMenuContent({
83
+ className,
84
+ ...props
85
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {
86
+ return (
87
+ <NavigationMenuPrimitive.Content
88
+ data-slot="navigation-menu-content"
89
+ className={cn(
90
+ "data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto",
91
+ "group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",
92
+ className,
93
+ )}
94
+ {...props}
95
+ />
96
+ );
97
+ }
98
+
99
+ function NavigationMenuViewport({
100
+ className,
101
+ ...props
102
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {
103
+ return (
104
+ <div className={cn("absolute top-full left-0 isolate z-50 flex justify-center")}>
105
+ <NavigationMenuPrimitive.Viewport
106
+ data-slot="navigation-menu-viewport"
107
+ className={cn(
108
+ "origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",
109
+ className,
110
+ )}
111
+ {...props}
112
+ />
113
+ </div>
114
+ );
115
+ }
116
+
117
+ function NavigationMenuLink({
118
+ className,
119
+ ...props
120
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {
121
+ return (
122
+ <NavigationMenuPrimitive.Link
123
+ data-slot="navigation-menu-link"
124
+ className={cn(
125
+ "data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",
126
+ className,
127
+ )}
128
+ {...props}
129
+ />
130
+ );
131
+ }
132
+
133
+ function NavigationMenuIndicator({
134
+ className,
135
+ ...props
136
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {
137
+ return (
138
+ <NavigationMenuPrimitive.Indicator
139
+ data-slot="navigation-menu-indicator"
140
+ className={cn(
141
+ "data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",
142
+ className,
143
+ )}
144
+ {...props}
145
+ >
146
+ <div className="bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md" />
147
+ </NavigationMenuPrimitive.Indicator>
148
+ );
149
+ }
150
+
151
+ export {
152
+ NavigationMenu,
153
+ NavigationMenuList,
154
+ NavigationMenuItem,
155
+ NavigationMenuContent,
156
+ NavigationMenuTrigger,
157
+ NavigationMenuLink,
158
+ NavigationMenuIndicator,
159
+ NavigationMenuViewport,
160
+ navigationMenuTriggerStyle,
161
+ };
@@ -0,0 +1,106 @@
1
+ import * as React from "react";
2
+ import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
3
+
4
+ import { cn } from "@/lib/utils";
5
+ import { buttonVariants, type Button } from "@/components/ui/button";
6
+
7
+ function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
8
+ return (
9
+ <nav
10
+ role="navigation"
11
+ aria-label="pagination"
12
+ data-slot="pagination"
13
+ className={cn("mx-auto flex w-full justify-center", className)}
14
+ {...props}
15
+ />
16
+ );
17
+ }
18
+
19
+ function PaginationContent({ className, ...props }: React.ComponentProps<"ul">) {
20
+ return (
21
+ <ul
22
+ data-slot="pagination-content"
23
+ className={cn("flex flex-row items-center gap-1", className)}
24
+ {...props}
25
+ />
26
+ );
27
+ }
28
+
29
+ function PaginationItem({ ...props }: React.ComponentProps<"li">) {
30
+ return <li data-slot="pagination-item" {...props} />;
31
+ }
32
+
33
+ type PaginationLinkProps = {
34
+ isActive?: boolean;
35
+ } & Pick<React.ComponentProps<typeof Button>, "size"> &
36
+ React.ComponentProps<"a">;
37
+
38
+ function PaginationLink({ className, isActive, size = "icon", ...props }: PaginationLinkProps) {
39
+ return (
40
+ <a
41
+ aria-current={isActive ? "page" : undefined}
42
+ data-slot="pagination-link"
43
+ data-active={isActive}
44
+ className={cn(
45
+ buttonVariants({
46
+ variant: isActive ? "outline" : "ghost",
47
+ size,
48
+ }),
49
+ className,
50
+ )}
51
+ {...props}
52
+ />
53
+ );
54
+ }
55
+
56
+ function PaginationPrevious({ className, ...props }: React.ComponentProps<typeof PaginationLink>) {
57
+ return (
58
+ <PaginationLink
59
+ aria-label="Go to previous page"
60
+ size="default"
61
+ className={cn("gap-1 px-2.5 sm:pl-2.5", className)}
62
+ {...props}
63
+ >
64
+ <ChevronLeftIcon />
65
+ <span className="hidden sm:block">Previous</span>
66
+ </PaginationLink>
67
+ );
68
+ }
69
+
70
+ function PaginationNext({ className, ...props }: React.ComponentProps<typeof PaginationLink>) {
71
+ return (
72
+ <PaginationLink
73
+ aria-label="Go to next page"
74
+ size="default"
75
+ className={cn("gap-1 px-2.5 sm:pr-2.5", className)}
76
+ {...props}
77
+ >
78
+ <span className="hidden sm:block">Next</span>
79
+ <ChevronRightIcon />
80
+ </PaginationLink>
81
+ );
82
+ }
83
+
84
+ function PaginationEllipsis({ className, ...props }: React.ComponentProps<"span">) {
85
+ return (
86
+ <span
87
+ aria-hidden
88
+ data-slot="pagination-ellipsis"
89
+ className={cn("flex size-9 items-center justify-center", className)}
90
+ {...props}
91
+ >
92
+ <MoreHorizontalIcon className="size-4" />
93
+ <span className="sr-only">More pages</span>
94
+ </span>
95
+ );
96
+ }
97
+
98
+ export {
99
+ Pagination,
100
+ PaginationContent,
101
+ PaginationLink,
102
+ PaginationItem,
103
+ PaginationPrevious,
104
+ PaginationNext,
105
+ PaginationEllipsis,
106
+ };
@@ -0,0 +1,42 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
5
+
6
+ import { cn } from "@/lib/utils";
7
+
8
+ function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
9
+ return <PopoverPrimitive.Root data-slot="popover" {...props} />;
10
+ }
11
+
12
+ function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
13
+ return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />;
14
+ }
15
+
16
+ function PopoverContent({
17
+ className,
18
+ align = "center",
19
+ sideOffset = 4,
20
+ ...props
21
+ }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
22
+ return (
23
+ <PopoverPrimitive.Portal>
24
+ <PopoverPrimitive.Content
25
+ data-slot="popover-content"
26
+ align={align}
27
+ sideOffset={sideOffset}
28
+ className={cn(
29
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
30
+ className,
31
+ )}
32
+ {...props}
33
+ />
34
+ </PopoverPrimitive.Portal>
35
+ );
36
+ }
37
+
38
+ function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
39
+ return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />;
40
+ }
41
+
42
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
@@ -0,0 +1,26 @@
1
+ import * as React from "react";
2
+ import * as ProgressPrimitive from "@radix-ui/react-progress";
3
+
4
+ import { cn } from "@/lib/utils";
5
+
6
+ function Progress({
7
+ className,
8
+ value,
9
+ ...props
10
+ }: React.ComponentProps<typeof ProgressPrimitive.Root>) {
11
+ return (
12
+ <ProgressPrimitive.Root
13
+ data-slot="progress"
14
+ className={cn("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full", className)}
15
+ {...props}
16
+ >
17
+ <ProgressPrimitive.Indicator
18
+ data-slot="progress-indicator"
19
+ className="bg-primary h-full w-full flex-1 transition-all"
20
+ style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
21
+ />
22
+ </ProgressPrimitive.Root>
23
+ );
24
+ }
25
+
26
+ export { Progress };
@@ -0,0 +1,45 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
5
+ import { CircleIcon } from "lucide-react";
6
+
7
+ import { cn } from "@/lib/utils";
8
+
9
+ function RadioGroup({
10
+ className,
11
+ ...props
12
+ }: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
13
+ return (
14
+ <RadioGroupPrimitive.Root
15
+ data-slot="radio-group"
16
+ className={cn("grid gap-3", className)}
17
+ {...props}
18
+ />
19
+ );
20
+ }
21
+
22
+ function RadioGroupItem({
23
+ className,
24
+ ...props
25
+ }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
26
+ return (
27
+ <RadioGroupPrimitive.Item
28
+ data-slot="radio-group-item"
29
+ className={cn(
30
+ "border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
31
+ className,
32
+ )}
33
+ {...props}
34
+ >
35
+ <RadioGroupPrimitive.Indicator
36
+ data-slot="radio-group-indicator"
37
+ className="relative flex items-center justify-center"
38
+ >
39
+ <CircleIcon className="fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" />
40
+ </RadioGroupPrimitive.Indicator>
41
+ </RadioGroupPrimitive.Item>
42
+ );
43
+ }
44
+
45
+ export { RadioGroup, RadioGroupItem };
@@ -0,0 +1,46 @@
1
+ import * as React from "react";
2
+ import { GripVerticalIcon } from "lucide-react";
3
+ import { Group, Panel, Separator } from "react-resizable-panels";
4
+
5
+ import { cn } from "@/lib/utils";
6
+
7
+ function ResizablePanelGroup({ className, ...props }: React.ComponentProps<typeof Group>) {
8
+ return (
9
+ <Group
10
+ data-slot="resizable-panel-group"
11
+ className={cn("flex h-full w-full data-[panel-group-direction=vertical]:flex-col", className)}
12
+ {...props}
13
+ />
14
+ );
15
+ }
16
+
17
+ function ResizablePanel({ ...props }: React.ComponentProps<typeof Panel>) {
18
+ return <Panel data-slot="resizable-panel" {...props} />;
19
+ }
20
+
21
+ function ResizableHandle({
22
+ withHandle,
23
+ className,
24
+ ...props
25
+ }: React.ComponentProps<typeof Separator> & {
26
+ withHandle?: boolean;
27
+ }) {
28
+ return (
29
+ <Separator
30
+ data-slot="resizable-handle"
31
+ className={cn(
32
+ "bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",
33
+ className,
34
+ )}
35
+ {...props}
36
+ >
37
+ {withHandle && (
38
+ <div className="bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border">
39
+ <GripVerticalIcon className="size-2.5" />
40
+ </div>
41
+ )}
42
+ </Separator>
43
+ );
44
+ }
45
+
46
+ export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
@@ -0,0 +1,56 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
5
+
6
+ import { cn } from "@/lib/utils";
7
+
8
+ function ScrollArea({
9
+ className,
10
+ children,
11
+ ...props
12
+ }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
13
+ return (
14
+ <ScrollAreaPrimitive.Root
15
+ data-slot="scroll-area"
16
+ className={cn("relative", className)}
17
+ {...props}
18
+ >
19
+ <ScrollAreaPrimitive.Viewport
20
+ data-slot="scroll-area-viewport"
21
+ className="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"
22
+ >
23
+ {children}
24
+ </ScrollAreaPrimitive.Viewport>
25
+ <ScrollBar />
26
+ <ScrollAreaPrimitive.Corner />
27
+ </ScrollAreaPrimitive.Root>
28
+ );
29
+ }
30
+
31
+ function ScrollBar({
32
+ className,
33
+ orientation = "vertical",
34
+ ...props
35
+ }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
36
+ return (
37
+ <ScrollAreaPrimitive.ScrollAreaScrollbar
38
+ data-slot="scroll-area-scrollbar"
39
+ orientation={orientation}
40
+ className={cn(
41
+ "flex touch-none p-px transition-colors select-none",
42
+ orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
43
+ orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
44
+ className,
45
+ )}
46
+ {...props}
47
+ >
48
+ <ScrollAreaPrimitive.ScrollAreaThumb
49
+ data-slot="scroll-area-thumb"
50
+ className="bg-border relative flex-1 rounded-full"
51
+ />
52
+ </ScrollAreaPrimitive.ScrollAreaScrollbar>
53
+ );
54
+ }
55
+
56
+ export { ScrollArea, ScrollBar };
@@ -0,0 +1,173 @@
1
+ import * as React from "react";
2
+ import * as SelectPrimitive from "@radix-ui/react-select";
3
+ import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
4
+
5
+ import { cn } from "@/lib/utils";
6
+
7
+ function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) {
8
+ return <SelectPrimitive.Root data-slot="select" {...props} />;
9
+ }
10
+
11
+ function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>) {
12
+ return <SelectPrimitive.Group data-slot="select-group" {...props} />;
13
+ }
14
+
15
+ function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>) {
16
+ return <SelectPrimitive.Value data-slot="select-value" {...props} />;
17
+ }
18
+
19
+ function SelectTrigger({
20
+ className,
21
+ size = "default",
22
+ children,
23
+ ...props
24
+ }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
25
+ size?: "sm" | "default";
26
+ }) {
27
+ return (
28
+ <SelectPrimitive.Trigger
29
+ data-slot="select-trigger"
30
+ data-size={size}
31
+ className={cn(
32
+ "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
33
+ className,
34
+ )}
35
+ {...props}
36
+ >
37
+ {children}
38
+ <SelectPrimitive.Icon asChild>
39
+ <ChevronDownIcon className="size-4 opacity-50" />
40
+ </SelectPrimitive.Icon>
41
+ </SelectPrimitive.Trigger>
42
+ );
43
+ }
44
+
45
+ function SelectContent({
46
+ className,
47
+ children,
48
+ position = "item-aligned",
49
+ align = "center",
50
+ ...props
51
+ }: React.ComponentProps<typeof SelectPrimitive.Content>) {
52
+ return (
53
+ <SelectPrimitive.Portal>
54
+ <SelectPrimitive.Content
55
+ data-slot="select-content"
56
+ className={cn(
57
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
58
+ position === "popper" &&
59
+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
60
+ className,
61
+ )}
62
+ position={position}
63
+ align={align}
64
+ {...props}
65
+ >
66
+ <SelectScrollUpButton />
67
+ <SelectPrimitive.Viewport
68
+ className={cn(
69
+ "p-1",
70
+ position === "popper" &&
71
+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1",
72
+ )}
73
+ >
74
+ {children}
75
+ </SelectPrimitive.Viewport>
76
+ <SelectScrollDownButton />
77
+ </SelectPrimitive.Content>
78
+ </SelectPrimitive.Portal>
79
+ );
80
+ }
81
+
82
+ function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>) {
83
+ return (
84
+ <SelectPrimitive.Label
85
+ data-slot="select-label"
86
+ className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
87
+ {...props}
88
+ />
89
+ );
90
+ }
91
+
92
+ function SelectItem({
93
+ className,
94
+ children,
95
+ ...props
96
+ }: React.ComponentProps<typeof SelectPrimitive.Item>) {
97
+ return (
98
+ <SelectPrimitive.Item
99
+ data-slot="select-item"
100
+ className={cn(
101
+ "focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
102
+ className,
103
+ )}
104
+ {...props}
105
+ >
106
+ <span
107
+ data-slot="select-item-indicator"
108
+ className="absolute right-2 flex size-3.5 items-center justify-center"
109
+ >
110
+ <SelectPrimitive.ItemIndicator>
111
+ <CheckIcon className="size-4" />
112
+ </SelectPrimitive.ItemIndicator>
113
+ </span>
114
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
115
+ </SelectPrimitive.Item>
116
+ );
117
+ }
118
+
119
+ function SelectSeparator({
120
+ className,
121
+ ...props
122
+ }: React.ComponentProps<typeof SelectPrimitive.Separator>) {
123
+ return (
124
+ <SelectPrimitive.Separator
125
+ data-slot="select-separator"
126
+ className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
127
+ {...props}
128
+ />
129
+ );
130
+ }
131
+
132
+ function SelectScrollUpButton({
133
+ className,
134
+ ...props
135
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
136
+ return (
137
+ <SelectPrimitive.ScrollUpButton
138
+ data-slot="select-scroll-up-button"
139
+ className={cn("flex cursor-default items-center justify-center py-1", className)}
140
+ {...props}
141
+ >
142
+ <ChevronUpIcon className="size-4" />
143
+ </SelectPrimitive.ScrollUpButton>
144
+ );
145
+ }
146
+
147
+ function SelectScrollDownButton({
148
+ className,
149
+ ...props
150
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
151
+ return (
152
+ <SelectPrimitive.ScrollDownButton
153
+ data-slot="select-scroll-down-button"
154
+ className={cn("flex cursor-default items-center justify-center py-1", className)}
155
+ {...props}
156
+ >
157
+ <ChevronDownIcon className="size-4" />
158
+ </SelectPrimitive.ScrollDownButton>
159
+ );
160
+ }
161
+
162
+ export {
163
+ Select,
164
+ SelectContent,
165
+ SelectGroup,
166
+ SelectItem,
167
+ SelectLabel,
168
+ SelectScrollDownButton,
169
+ SelectScrollUpButton,
170
+ SelectSeparator,
171
+ SelectTrigger,
172
+ SelectValue,
173
+ };
@@ -0,0 +1,28 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
5
+
6
+ import { cn } from "@/lib/utils";
7
+
8
+ function Separator({
9
+ className,
10
+ orientation = "horizontal",
11
+ decorative = true,
12
+ ...props
13
+ }: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
14
+ return (
15
+ <SeparatorPrimitive.Root
16
+ data-slot="separator"
17
+ decorative={decorative}
18
+ orientation={orientation}
19
+ className={cn(
20
+ "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
21
+ className,
22
+ )}
23
+ {...props}
24
+ />
25
+ );
26
+ }
27
+
28
+ export { Separator };