forge-admin 0.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 (131) hide show
  1. package/README.md +73 -0
  2. package/app.db +0 -0
  3. package/components.json +20 -0
  4. package/dist/assets/index-BPVmexx_.css +1 -0
  5. package/dist/assets/index-BtNewH3n.js +258 -0
  6. package/dist/favicon.ico +0 -0
  7. package/dist/index.html +27 -0
  8. package/dist/placeholder.svg +1 -0
  9. package/dist/robots.txt +14 -0
  10. package/eslint.config.js +26 -0
  11. package/index.html +26 -0
  12. package/package.json +107 -0
  13. package/postcss.config.js +6 -0
  14. package/public/favicon.ico +0 -0
  15. package/public/placeholder.svg +1 -0
  16. package/public/robots.txt +14 -0
  17. package/src/App.css +42 -0
  18. package/src/App.tsx +32 -0
  19. package/src/admin/convertSchema.ts +83 -0
  20. package/src/admin/factory.ts +12 -0
  21. package/src/admin/introspecter.ts +6 -0
  22. package/src/admin/router.ts +38 -0
  23. package/src/admin/schema.ts +17 -0
  24. package/src/admin/sqlite.ts +73 -0
  25. package/src/admin/types.ts +35 -0
  26. package/src/components/AdminLayout.tsx +19 -0
  27. package/src/components/AdminSidebar.tsx +102 -0
  28. package/src/components/DataTable.tsx +166 -0
  29. package/src/components/ModelForm.tsx +221 -0
  30. package/src/components/NavLink.tsx +28 -0
  31. package/src/components/StatCard.tsx +32 -0
  32. package/src/components/ui/accordion.tsx +52 -0
  33. package/src/components/ui/alert-dialog.tsx +104 -0
  34. package/src/components/ui/alert.tsx +43 -0
  35. package/src/components/ui/aspect-ratio.tsx +5 -0
  36. package/src/components/ui/avatar.tsx +38 -0
  37. package/src/components/ui/badge.tsx +29 -0
  38. package/src/components/ui/breadcrumb.tsx +90 -0
  39. package/src/components/ui/button.tsx +47 -0
  40. package/src/components/ui/calendar.tsx +54 -0
  41. package/src/components/ui/card.tsx +43 -0
  42. package/src/components/ui/carousel.tsx +224 -0
  43. package/src/components/ui/chart.tsx +303 -0
  44. package/src/components/ui/checkbox.tsx +26 -0
  45. package/src/components/ui/collapsible.tsx +9 -0
  46. package/src/components/ui/command.tsx +132 -0
  47. package/src/components/ui/context-menu.tsx +178 -0
  48. package/src/components/ui/dialog.tsx +95 -0
  49. package/src/components/ui/drawer.tsx +87 -0
  50. package/src/components/ui/dropdown-menu.tsx +179 -0
  51. package/src/components/ui/form.tsx +129 -0
  52. package/src/components/ui/hover-card.tsx +27 -0
  53. package/src/components/ui/input-otp.tsx +61 -0
  54. package/src/components/ui/input.tsx +22 -0
  55. package/src/components/ui/label.tsx +17 -0
  56. package/src/components/ui/menubar.tsx +207 -0
  57. package/src/components/ui/navigation-menu.tsx +120 -0
  58. package/src/components/ui/pagination.tsx +81 -0
  59. package/src/components/ui/popover.tsx +29 -0
  60. package/src/components/ui/progress.tsx +23 -0
  61. package/src/components/ui/radio-group.tsx +36 -0
  62. package/src/components/ui/resizable.tsx +37 -0
  63. package/src/components/ui/scroll-area.tsx +38 -0
  64. package/src/components/ui/select.tsx +143 -0
  65. package/src/components/ui/separator.tsx +20 -0
  66. package/src/components/ui/sheet.tsx +107 -0
  67. package/src/components/ui/sidebar.tsx +637 -0
  68. package/src/components/ui/skeleton.tsx +7 -0
  69. package/src/components/ui/slider.tsx +23 -0
  70. package/src/components/ui/sonner.tsx +27 -0
  71. package/src/components/ui/switch.tsx +27 -0
  72. package/src/components/ui/table.tsx +72 -0
  73. package/src/components/ui/tabs.tsx +53 -0
  74. package/src/components/ui/textarea.tsx +21 -0
  75. package/src/components/ui/toast.tsx +111 -0
  76. package/src/components/ui/toaster.tsx +24 -0
  77. package/src/components/ui/toggle-group.tsx +49 -0
  78. package/src/components/ui/toggle.tsx +37 -0
  79. package/src/components/ui/tooltip.tsx +28 -0
  80. package/src/components/ui/use-toast.ts +3 -0
  81. package/src/config/define.ts +6 -0
  82. package/src/config/index.ts +0 -0
  83. package/src/config/load.ts +45 -0
  84. package/src/config/types.ts +5 -0
  85. package/src/hooks/use-mobile.tsx +19 -0
  86. package/src/hooks/use-toast.ts +186 -0
  87. package/src/index.css +142 -0
  88. package/src/lib/models.ts +138 -0
  89. package/src/lib/utils.ts +6 -0
  90. package/src/main.tsx +5 -0
  91. package/src/orm/cli/makemigrations.ts +63 -0
  92. package/src/orm/cli/migrate.ts +127 -0
  93. package/src/orm/cli.ts +30 -0
  94. package/src/orm/core/base-model.ts +6 -0
  95. package/src/orm/core/manager.ts +27 -0
  96. package/src/orm/core/query-builder.ts +74 -0
  97. package/src/orm/db/connection.ts +0 -0
  98. package/src/orm/db/sql-types.ts +72 -0
  99. package/src/orm/db/sqlite.ts +4 -0
  100. package/src/orm/decorators/field.ts +80 -0
  101. package/src/orm/decorators/model.ts +36 -0
  102. package/src/orm/decorators/relations.ts +0 -0
  103. package/src/orm/metadata/field-metadata.ts +0 -0
  104. package/src/orm/metadata/field-types.ts +12 -0
  105. package/src/orm/metadata/get-meta.ts +9 -0
  106. package/src/orm/metadata/index.ts +15 -0
  107. package/src/orm/metadata/keys.ts +2 -0
  108. package/src/orm/metadata/model-registry.ts +53 -0
  109. package/src/orm/metadata/modifiers.ts +26 -0
  110. package/src/orm/metadata/types.ts +45 -0
  111. package/src/orm/migration-engine/diff.ts +243 -0
  112. package/src/orm/migration-engine/operations.ts +186 -0
  113. package/src/orm/schema/build.ts +138 -0
  114. package/src/orm/schema/state.ts +23 -0
  115. package/src/orm/schema/writeMigrations.ts +21 -0
  116. package/src/orm/syncdb.ts +25 -0
  117. package/src/pages/Dashboard.tsx +127 -0
  118. package/src/pages/Index.tsx +18 -0
  119. package/src/pages/ModelPage.tsx +177 -0
  120. package/src/pages/NotFound.tsx +24 -0
  121. package/src/pages/SchemaEditor.tsx +170 -0
  122. package/src/pages/Settings.tsx +166 -0
  123. package/src/server.ts +69 -0
  124. package/src/vite-env.d.ts +1 -0
  125. package/tailwind.config.js +112 -0
  126. package/tailwind.config.ts +114 -0
  127. package/tsconfig.app.json +30 -0
  128. package/tsconfig.json +16 -0
  129. package/tsconfig.node.json +22 -0
  130. package/vite.config.js +23 -0
  131. package/vite.config.ts +18 -0
@@ -0,0 +1,207 @@
1
+ import * as React from "react";
2
+ import * as MenubarPrimitive from "@radix-ui/react-menubar";
3
+ import { Check, ChevronRight, Circle } from "lucide-react";
4
+
5
+ import { cn } from "@/lib/utils";
6
+
7
+ const MenubarMenu = MenubarPrimitive.Menu;
8
+
9
+ const MenubarGroup = MenubarPrimitive.Group;
10
+
11
+ const MenubarPortal = MenubarPrimitive.Portal;
12
+
13
+ const MenubarSub = MenubarPrimitive.Sub;
14
+
15
+ const MenubarRadioGroup = MenubarPrimitive.RadioGroup;
16
+
17
+ const Menubar = React.forwardRef<
18
+ React.ElementRef<typeof MenubarPrimitive.Root>,
19
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>
20
+ >(({ className, ...props }, ref) => (
21
+ <MenubarPrimitive.Root
22
+ ref={ref}
23
+ className={cn("flex h-10 items-center space-x-1 rounded-md border bg-background p-1", className)}
24
+ {...props}
25
+ />
26
+ ));
27
+ Menubar.displayName = MenubarPrimitive.Root.displayName;
28
+
29
+ const MenubarTrigger = React.forwardRef<
30
+ React.ElementRef<typeof MenubarPrimitive.Trigger>,
31
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>
32
+ >(({ className, ...props }, ref) => (
33
+ <MenubarPrimitive.Trigger
34
+ ref={ref}
35
+ className={cn(
36
+ "flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none data-[state=open]:bg-accent data-[state=open]:text-accent-foreground focus:bg-accent focus:text-accent-foreground",
37
+ className,
38
+ )}
39
+ {...props}
40
+ />
41
+ ));
42
+ MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;
43
+
44
+ const MenubarSubTrigger = React.forwardRef<
45
+ React.ElementRef<typeof MenubarPrimitive.SubTrigger>,
46
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {
47
+ inset?: boolean;
48
+ }
49
+ >(({ className, inset, children, ...props }, ref) => (
50
+ <MenubarPrimitive.SubTrigger
51
+ ref={ref}
52
+ className={cn(
53
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent data-[state=open]:text-accent-foreground focus:bg-accent focus:text-accent-foreground",
54
+ inset && "pl-8",
55
+ className,
56
+ )}
57
+ {...props}
58
+ >
59
+ {children}
60
+ <ChevronRight className="ml-auto h-4 w-4" />
61
+ </MenubarPrimitive.SubTrigger>
62
+ ));
63
+ MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;
64
+
65
+ const MenubarSubContent = React.forwardRef<
66
+ React.ElementRef<typeof MenubarPrimitive.SubContent>,
67
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>
68
+ >(({ className, ...props }, ref) => (
69
+ <MenubarPrimitive.SubContent
70
+ ref={ref}
71
+ className={cn(
72
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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",
73
+ className,
74
+ )}
75
+ {...props}
76
+ />
77
+ ));
78
+ MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;
79
+
80
+ const MenubarContent = React.forwardRef<
81
+ React.ElementRef<typeof MenubarPrimitive.Content>,
82
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>
83
+ >(({ className, align = "start", alignOffset = -4, sideOffset = 8, ...props }, ref) => (
84
+ <MenubarPrimitive.Portal>
85
+ <MenubarPrimitive.Content
86
+ ref={ref}
87
+ align={align}
88
+ alignOffset={alignOffset}
89
+ sideOffset={sideOffset}
90
+ className={cn(
91
+ "z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in 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",
92
+ className,
93
+ )}
94
+ {...props}
95
+ />
96
+ </MenubarPrimitive.Portal>
97
+ ));
98
+ MenubarContent.displayName = MenubarPrimitive.Content.displayName;
99
+
100
+ const MenubarItem = React.forwardRef<
101
+ React.ElementRef<typeof MenubarPrimitive.Item>,
102
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {
103
+ inset?: boolean;
104
+ }
105
+ >(({ className, inset, ...props }, ref) => (
106
+ <MenubarPrimitive.Item
107
+ ref={ref}
108
+ className={cn(
109
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",
110
+ inset && "pl-8",
111
+ className,
112
+ )}
113
+ {...props}
114
+ />
115
+ ));
116
+ MenubarItem.displayName = MenubarPrimitive.Item.displayName;
117
+
118
+ const MenubarCheckboxItem = React.forwardRef<
119
+ React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,
120
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>
121
+ >(({ className, children, checked, ...props }, ref) => (
122
+ <MenubarPrimitive.CheckboxItem
123
+ ref={ref}
124
+ className={cn(
125
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",
126
+ className,
127
+ )}
128
+ checked={checked}
129
+ {...props}
130
+ >
131
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
132
+ <MenubarPrimitive.ItemIndicator>
133
+ <Check className="h-4 w-4" />
134
+ </MenubarPrimitive.ItemIndicator>
135
+ </span>
136
+ {children}
137
+ </MenubarPrimitive.CheckboxItem>
138
+ ));
139
+ MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;
140
+
141
+ const MenubarRadioItem = React.forwardRef<
142
+ React.ElementRef<typeof MenubarPrimitive.RadioItem>,
143
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>
144
+ >(({ className, children, ...props }, ref) => (
145
+ <MenubarPrimitive.RadioItem
146
+ ref={ref}
147
+ className={cn(
148
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",
149
+ className,
150
+ )}
151
+ {...props}
152
+ >
153
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
154
+ <MenubarPrimitive.ItemIndicator>
155
+ <Circle className="h-2 w-2 fill-current" />
156
+ </MenubarPrimitive.ItemIndicator>
157
+ </span>
158
+ {children}
159
+ </MenubarPrimitive.RadioItem>
160
+ ));
161
+ MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;
162
+
163
+ const MenubarLabel = React.forwardRef<
164
+ React.ElementRef<typeof MenubarPrimitive.Label>,
165
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {
166
+ inset?: boolean;
167
+ }
168
+ >(({ className, inset, ...props }, ref) => (
169
+ <MenubarPrimitive.Label
170
+ ref={ref}
171
+ className={cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className)}
172
+ {...props}
173
+ />
174
+ ));
175
+ MenubarLabel.displayName = MenubarPrimitive.Label.displayName;
176
+
177
+ const MenubarSeparator = React.forwardRef<
178
+ React.ElementRef<typeof MenubarPrimitive.Separator>,
179
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>
180
+ >(({ className, ...props }, ref) => (
181
+ <MenubarPrimitive.Separator ref={ref} className={cn("-mx-1 my-1 h-px bg-muted", className)} {...props} />
182
+ ));
183
+ MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;
184
+
185
+ const MenubarShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {
186
+ return <span className={cn("ml-auto text-xs tracking-widest text-muted-foreground", className)} {...props} />;
187
+ };
188
+ MenubarShortcut.displayname = "MenubarShortcut";
189
+
190
+ export {
191
+ Menubar,
192
+ MenubarMenu,
193
+ MenubarTrigger,
194
+ MenubarContent,
195
+ MenubarItem,
196
+ MenubarSeparator,
197
+ MenubarLabel,
198
+ MenubarCheckboxItem,
199
+ MenubarRadioGroup,
200
+ MenubarRadioItem,
201
+ MenubarPortal,
202
+ MenubarSubContent,
203
+ MenubarSubTrigger,
204
+ MenubarGroup,
205
+ MenubarSub,
206
+ MenubarShortcut,
207
+ };
@@ -0,0 +1,120 @@
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 { ChevronDown } from "lucide-react";
5
+
6
+ import { cn } from "@/lib/utils";
7
+
8
+ const NavigationMenu = React.forwardRef<
9
+ React.ElementRef<typeof NavigationMenuPrimitive.Root>,
10
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>
11
+ >(({ className, children, ...props }, ref) => (
12
+ <NavigationMenuPrimitive.Root
13
+ ref={ref}
14
+ className={cn("relative z-10 flex max-w-max flex-1 items-center justify-center", className)}
15
+ {...props}
16
+ >
17
+ {children}
18
+ <NavigationMenuViewport />
19
+ </NavigationMenuPrimitive.Root>
20
+ ));
21
+ NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
22
+
23
+ const NavigationMenuList = React.forwardRef<
24
+ React.ElementRef<typeof NavigationMenuPrimitive.List>,
25
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>
26
+ >(({ className, ...props }, ref) => (
27
+ <NavigationMenuPrimitive.List
28
+ ref={ref}
29
+ className={cn("group flex flex-1 list-none items-center justify-center space-x-1", className)}
30
+ {...props}
31
+ />
32
+ ));
33
+ NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;
34
+
35
+ const NavigationMenuItem = NavigationMenuPrimitive.Item;
36
+
37
+ const navigationMenuTriggerStyle = cva(
38
+ "group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50",
39
+ );
40
+
41
+ const NavigationMenuTrigger = React.forwardRef<
42
+ React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,
43
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>
44
+ >(({ className, children, ...props }, ref) => (
45
+ <NavigationMenuPrimitive.Trigger
46
+ ref={ref}
47
+ className={cn(navigationMenuTriggerStyle(), "group", className)}
48
+ {...props}
49
+ >
50
+ {children}{" "}
51
+ <ChevronDown
52
+ className="relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180"
53
+ aria-hidden="true"
54
+ />
55
+ </NavigationMenuPrimitive.Trigger>
56
+ ));
57
+ NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
58
+
59
+ const NavigationMenuContent = React.forwardRef<
60
+ React.ElementRef<typeof NavigationMenuPrimitive.Content>,
61
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>
62
+ >(({ className, ...props }, ref) => (
63
+ <NavigationMenuPrimitive.Content
64
+ ref={ref}
65
+ className={cn(
66
+ "left-0 top-0 w-full 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 md:absolute md:w-auto",
67
+ className,
68
+ )}
69
+ {...props}
70
+ />
71
+ ));
72
+ NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
73
+
74
+ const NavigationMenuLink = NavigationMenuPrimitive.Link;
75
+
76
+ const NavigationMenuViewport = React.forwardRef<
77
+ React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
78
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>
79
+ >(({ className, ...props }, ref) => (
80
+ <div className={cn("absolute left-0 top-full flex justify-center")}>
81
+ <NavigationMenuPrimitive.Viewport
82
+ className={cn(
83
+ "origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
84
+ className,
85
+ )}
86
+ ref={ref}
87
+ {...props}
88
+ />
89
+ </div>
90
+ ));
91
+ NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;
92
+
93
+ const NavigationMenuIndicator = React.forwardRef<
94
+ React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,
95
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>
96
+ >(({ className, ...props }, ref) => (
97
+ <NavigationMenuPrimitive.Indicator
98
+ ref={ref}
99
+ className={cn(
100
+ "top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",
101
+ className,
102
+ )}
103
+ {...props}
104
+ >
105
+ <div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
106
+ </NavigationMenuPrimitive.Indicator>
107
+ ));
108
+ NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;
109
+
110
+ export {
111
+ navigationMenuTriggerStyle,
112
+ NavigationMenu,
113
+ NavigationMenuList,
114
+ NavigationMenuItem,
115
+ NavigationMenuContent,
116
+ NavigationMenuTrigger,
117
+ NavigationMenuLink,
118
+ NavigationMenuIndicator,
119
+ NavigationMenuViewport,
120
+ };
@@ -0,0 +1,81 @@
1
+ import * as React from "react";
2
+ import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react";
3
+
4
+ import { cn } from "@/lib/utils";
5
+ import { ButtonProps, buttonVariants } from "@/components/ui/button";
6
+
7
+ const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
8
+ <nav
9
+ role="navigation"
10
+ aria-label="pagination"
11
+ className={cn("mx-auto flex w-full justify-center", className)}
12
+ {...props}
13
+ />
14
+ );
15
+ Pagination.displayName = "Pagination";
16
+
17
+ const PaginationContent = React.forwardRef<HTMLUListElement, React.ComponentProps<"ul">>(
18
+ ({ className, ...props }, ref) => (
19
+ <ul ref={ref} className={cn("flex flex-row items-center gap-1", className)} {...props} />
20
+ ),
21
+ );
22
+ PaginationContent.displayName = "PaginationContent";
23
+
24
+ const PaginationItem = React.forwardRef<HTMLLIElement, React.ComponentProps<"li">>(({ className, ...props }, ref) => (
25
+ <li ref={ref} className={cn("", className)} {...props} />
26
+ ));
27
+ PaginationItem.displayName = "PaginationItem";
28
+
29
+ type PaginationLinkProps = {
30
+ isActive?: boolean;
31
+ } & Pick<ButtonProps, "size"> &
32
+ React.ComponentProps<"a">;
33
+
34
+ const PaginationLink = ({ className, isActive, size = "icon", ...props }: PaginationLinkProps) => (
35
+ <a
36
+ aria-current={isActive ? "page" : undefined}
37
+ className={cn(
38
+ buttonVariants({
39
+ variant: isActive ? "outline" : "ghost",
40
+ size,
41
+ }),
42
+ className,
43
+ )}
44
+ {...props}
45
+ />
46
+ );
47
+ PaginationLink.displayName = "PaginationLink";
48
+
49
+ const PaginationPrevious = ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => (
50
+ <PaginationLink aria-label="Go to previous page" size="default" className={cn("gap-1 pl-2.5", className)} {...props}>
51
+ <ChevronLeft className="h-4 w-4" />
52
+ <span>Previous</span>
53
+ </PaginationLink>
54
+ );
55
+ PaginationPrevious.displayName = "PaginationPrevious";
56
+
57
+ const PaginationNext = ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => (
58
+ <PaginationLink aria-label="Go to next page" size="default" className={cn("gap-1 pr-2.5", className)} {...props}>
59
+ <span>Next</span>
60
+ <ChevronRight className="h-4 w-4" />
61
+ </PaginationLink>
62
+ );
63
+ PaginationNext.displayName = "PaginationNext";
64
+
65
+ const PaginationEllipsis = ({ className, ...props }: React.ComponentProps<"span">) => (
66
+ <span aria-hidden className={cn("flex h-9 w-9 items-center justify-center", className)} {...props}>
67
+ <MoreHorizontal className="h-4 w-4" />
68
+ <span className="sr-only">More pages</span>
69
+ </span>
70
+ );
71
+ PaginationEllipsis.displayName = "PaginationEllipsis";
72
+
73
+ export {
74
+ Pagination,
75
+ PaginationContent,
76
+ PaginationEllipsis,
77
+ PaginationItem,
78
+ PaginationLink,
79
+ PaginationNext,
80
+ PaginationPrevious,
81
+ };
@@ -0,0 +1,29 @@
1
+ import * as React from "react";
2
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
3
+
4
+ import { cn } from "@/lib/utils";
5
+
6
+ const Popover = PopoverPrimitive.Root;
7
+
8
+ const PopoverTrigger = PopoverPrimitive.Trigger;
9
+
10
+ const PopoverContent = React.forwardRef<
11
+ React.ElementRef<typeof PopoverPrimitive.Content>,
12
+ React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
13
+ >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
14
+ <PopoverPrimitive.Portal>
15
+ <PopoverPrimitive.Content
16
+ ref={ref}
17
+ align={align}
18
+ sideOffset={sideOffset}
19
+ className={cn(
20
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",
21
+ className,
22
+ )}
23
+ {...props}
24
+ />
25
+ </PopoverPrimitive.Portal>
26
+ ));
27
+ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
28
+
29
+ export { Popover, PopoverTrigger, PopoverContent };
@@ -0,0 +1,23 @@
1
+ import * as React from "react";
2
+ import * as ProgressPrimitive from "@radix-ui/react-progress";
3
+
4
+ import { cn } from "@/lib/utils";
5
+
6
+ const Progress = React.forwardRef<
7
+ React.ElementRef<typeof ProgressPrimitive.Root>,
8
+ React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
9
+ >(({ className, value, ...props }, ref) => (
10
+ <ProgressPrimitive.Root
11
+ ref={ref}
12
+ className={cn("relative h-4 w-full overflow-hidden rounded-full bg-secondary", className)}
13
+ {...props}
14
+ >
15
+ <ProgressPrimitive.Indicator
16
+ className="h-full w-full flex-1 bg-primary transition-all"
17
+ style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
18
+ />
19
+ </ProgressPrimitive.Root>
20
+ ));
21
+ Progress.displayName = ProgressPrimitive.Root.displayName;
22
+
23
+ export { Progress };
@@ -0,0 +1,36 @@
1
+ import * as React from "react";
2
+ import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
3
+ import { Circle } from "lucide-react";
4
+
5
+ import { cn } from "@/lib/utils";
6
+
7
+ const RadioGroup = React.forwardRef<
8
+ React.ElementRef<typeof RadioGroupPrimitive.Root>,
9
+ React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
10
+ >(({ className, ...props }, ref) => {
11
+ return <RadioGroupPrimitive.Root className={cn("grid gap-2", className)} {...props} ref={ref} />;
12
+ });
13
+ RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
14
+
15
+ const RadioGroupItem = React.forwardRef<
16
+ React.ElementRef<typeof RadioGroupPrimitive.Item>,
17
+ React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
18
+ >(({ className, ...props }, ref) => {
19
+ return (
20
+ <RadioGroupPrimitive.Item
21
+ ref={ref}
22
+ className={cn(
23
+ "aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
24
+ className,
25
+ )}
26
+ {...props}
27
+ >
28
+ <RadioGroupPrimitive.Indicator className="flex items-center justify-center">
29
+ <Circle className="h-2.5 w-2.5 fill-current text-current" />
30
+ </RadioGroupPrimitive.Indicator>
31
+ </RadioGroupPrimitive.Item>
32
+ );
33
+ });
34
+ RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
35
+
36
+ export { RadioGroup, RadioGroupItem };
@@ -0,0 +1,37 @@
1
+ import { GripVertical } from "lucide-react";
2
+ import * as ResizablePrimitive from "react-resizable-panels";
3
+
4
+ import { cn } from "@/lib/utils";
5
+
6
+ const ResizablePanelGroup = ({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => (
7
+ <ResizablePrimitive.PanelGroup
8
+ className={cn("flex h-full w-full data-[panel-group-direction=vertical]:flex-col", className)}
9
+ {...props}
10
+ />
11
+ );
12
+
13
+ const ResizablePanel = ResizablePrimitive.Panel;
14
+
15
+ const ResizableHandle = ({
16
+ withHandle,
17
+ className,
18
+ ...props
19
+ }: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
20
+ withHandle?: boolean;
21
+ }) => (
22
+ <ResizablePrimitive.PanelResizeHandle
23
+ className={cn(
24
+ "relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 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-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 [&[data-panel-group-direction=vertical]>div]:rotate-90",
25
+ className,
26
+ )}
27
+ {...props}
28
+ >
29
+ {withHandle && (
30
+ <div className="z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border">
31
+ <GripVertical className="h-2.5 w-2.5" />
32
+ </div>
33
+ )}
34
+ </ResizablePrimitive.PanelResizeHandle>
35
+ );
36
+
37
+ export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
@@ -0,0 +1,38 @@
1
+ import * as React from "react";
2
+ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
3
+
4
+ import { cn } from "@/lib/utils";
5
+
6
+ const ScrollArea = React.forwardRef<
7
+ React.ElementRef<typeof ScrollAreaPrimitive.Root>,
8
+ React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
9
+ >(({ className, children, ...props }, ref) => (
10
+ <ScrollAreaPrimitive.Root ref={ref} className={cn("relative overflow-hidden", className)} {...props}>
11
+ <ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">{children}</ScrollAreaPrimitive.Viewport>
12
+ <ScrollBar />
13
+ <ScrollAreaPrimitive.Corner />
14
+ </ScrollAreaPrimitive.Root>
15
+ ));
16
+ ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
17
+
18
+ const ScrollBar = React.forwardRef<
19
+ React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
20
+ React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
21
+ >(({ className, orientation = "vertical", ...props }, ref) => (
22
+ <ScrollAreaPrimitive.ScrollAreaScrollbar
23
+ ref={ref}
24
+ orientation={orientation}
25
+ className={cn(
26
+ "flex touch-none select-none transition-colors",
27
+ orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
28
+ orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
29
+ className,
30
+ )}
31
+ {...props}
32
+ >
33
+ <ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
34
+ </ScrollAreaPrimitive.ScrollAreaScrollbar>
35
+ ));
36
+ ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
37
+
38
+ export { ScrollArea, ScrollBar };