@helloleo/plugins 0.1.20 → 0.2.0-beta.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 (133) hide show
  1. package/dist/index.js +12361 -58
  2. package/dist/templates/tanstack-start-2026-06-18/components.json +22 -0
  3. package/dist/templates/tanstack-start-2026-06-18/drizzle.config.ts +15 -0
  4. package/dist/templates/tanstack-start-2026-06-18/package.json +103 -0
  5. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/accordion.tsx +51 -0
  6. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/alert-dialog.tsx +115 -0
  7. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/alert.tsx +49 -0
  8. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/aspect-ratio.tsx +5 -0
  9. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/avatar.tsx +47 -0
  10. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/badge.tsx +32 -0
  11. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/breadcrumb.tsx +101 -0
  12. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/button.tsx +49 -0
  13. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/calendar.tsx +177 -0
  14. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/card.tsx +55 -0
  15. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/carousel.tsx +240 -0
  16. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/chart.tsx +331 -0
  17. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/checkbox.tsx +26 -0
  18. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/collapsible.tsx +11 -0
  19. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/command.tsx +143 -0
  20. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/context-menu.tsx +187 -0
  21. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/dialog.tsx +104 -0
  22. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/drawer.tsx +98 -0
  23. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/dropdown-menu.tsx +188 -0
  24. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/form.tsx +171 -0
  25. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/hover-card.tsx +27 -0
  26. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/input-otp.tsx +69 -0
  27. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/input.tsx +22 -0
  28. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/label.tsx +21 -0
  29. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/menubar.tsx +229 -0
  30. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/navigation-menu.tsx +120 -0
  31. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/pagination.tsx +98 -0
  32. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/popover.tsx +31 -0
  33. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/progress.tsx +25 -0
  34. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/radio-group.tsx +36 -0
  35. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/resizable.tsx +37 -0
  36. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/scroll-area.tsx +44 -0
  37. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/select.tsx +152 -0
  38. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/separator.tsx +24 -0
  39. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/sheet.tsx +122 -0
  40. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/sidebar.tsx +744 -0
  41. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/skeleton.tsx +7 -0
  42. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/slider.tsx +23 -0
  43. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/sonner.tsx +23 -0
  44. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/switch.tsx +27 -0
  45. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/table.tsx +94 -0
  46. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/tabs.tsx +53 -0
  47. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/textarea.tsx +21 -0
  48. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/toggle-group.tsx +57 -0
  49. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/toggle.tsx +42 -0
  50. package/dist/templates/tanstack-start-2026-06-18/src/components/ui/tooltip.tsx +32 -0
  51. package/dist/templates/tanstack-start-2026-06-18/src/db/index.ts +9 -0
  52. package/dist/templates/tanstack-start-2026-06-18/src/db/schema.ts +18 -0
  53. package/dist/templates/tanstack-start-2026-06-18/src/global.d.ts +3 -0
  54. package/dist/templates/tanstack-start-2026-06-18/src/hooks/use-mobile.tsx +19 -0
  55. package/dist/templates/tanstack-start-2026-06-18/src/lib/proxy.ts +83 -0
  56. package/dist/templates/tanstack-start-2026-06-18/src/lib/utils.ts +6 -0
  57. package/dist/templates/tanstack-start-2026-06-18/src/routeTree.gen.ts +59 -0
  58. package/dist/templates/tanstack-start-2026-06-18/src/router.tsx +33 -0
  59. package/dist/templates/tanstack-start-2026-06-18/src/routes/__root.tsx +60 -0
  60. package/dist/templates/tanstack-start-2026-06-18/src/routes/api/health.ts +81 -0
  61. package/dist/templates/tanstack-start-2026-06-18/src/routes/index.tsx +33 -0
  62. package/dist/templates/tanstack-start-2026-06-18/src/server.ts +32 -0
  63. package/dist/templates/tanstack-start-2026-06-18/src/styles.css +214 -0
  64. package/dist/templates/tanstack-start-2026-06-18/tsconfig.json +27 -0
  65. package/dist/templates/tanstack-start-2026-06-18/vite.config.ts +17 -0
  66. package/package.json +1 -1
  67. package/src/template-render.ts +5 -0
  68. package/src/templates/tanstack-start-2026-06-18/components.json +22 -0
  69. package/src/templates/tanstack-start-2026-06-18/drizzle.config.ts +15 -0
  70. package/src/templates/tanstack-start-2026-06-18/package.json +103 -0
  71. package/src/templates/tanstack-start-2026-06-18/src/components/ui/accordion.tsx +51 -0
  72. package/src/templates/tanstack-start-2026-06-18/src/components/ui/alert-dialog.tsx +115 -0
  73. package/src/templates/tanstack-start-2026-06-18/src/components/ui/alert.tsx +49 -0
  74. package/src/templates/tanstack-start-2026-06-18/src/components/ui/aspect-ratio.tsx +5 -0
  75. package/src/templates/tanstack-start-2026-06-18/src/components/ui/avatar.tsx +47 -0
  76. package/src/templates/tanstack-start-2026-06-18/src/components/ui/badge.tsx +32 -0
  77. package/src/templates/tanstack-start-2026-06-18/src/components/ui/breadcrumb.tsx +101 -0
  78. package/src/templates/tanstack-start-2026-06-18/src/components/ui/button.tsx +49 -0
  79. package/src/templates/tanstack-start-2026-06-18/src/components/ui/calendar.tsx +177 -0
  80. package/src/templates/tanstack-start-2026-06-18/src/components/ui/card.tsx +55 -0
  81. package/src/templates/tanstack-start-2026-06-18/src/components/ui/carousel.tsx +240 -0
  82. package/src/templates/tanstack-start-2026-06-18/src/components/ui/chart.tsx +331 -0
  83. package/src/templates/tanstack-start-2026-06-18/src/components/ui/checkbox.tsx +26 -0
  84. package/src/templates/tanstack-start-2026-06-18/src/components/ui/collapsible.tsx +11 -0
  85. package/src/templates/tanstack-start-2026-06-18/src/components/ui/command.tsx +143 -0
  86. package/src/templates/tanstack-start-2026-06-18/src/components/ui/context-menu.tsx +187 -0
  87. package/src/templates/tanstack-start-2026-06-18/src/components/ui/dialog.tsx +104 -0
  88. package/src/templates/tanstack-start-2026-06-18/src/components/ui/drawer.tsx +98 -0
  89. package/src/templates/tanstack-start-2026-06-18/src/components/ui/dropdown-menu.tsx +188 -0
  90. package/src/templates/tanstack-start-2026-06-18/src/components/ui/form.tsx +171 -0
  91. package/src/templates/tanstack-start-2026-06-18/src/components/ui/hover-card.tsx +27 -0
  92. package/src/templates/tanstack-start-2026-06-18/src/components/ui/input-otp.tsx +69 -0
  93. package/src/templates/tanstack-start-2026-06-18/src/components/ui/input.tsx +22 -0
  94. package/src/templates/tanstack-start-2026-06-18/src/components/ui/label.tsx +21 -0
  95. package/src/templates/tanstack-start-2026-06-18/src/components/ui/menubar.tsx +229 -0
  96. package/src/templates/tanstack-start-2026-06-18/src/components/ui/navigation-menu.tsx +120 -0
  97. package/src/templates/tanstack-start-2026-06-18/src/components/ui/pagination.tsx +98 -0
  98. package/src/templates/tanstack-start-2026-06-18/src/components/ui/popover.tsx +31 -0
  99. package/src/templates/tanstack-start-2026-06-18/src/components/ui/progress.tsx +25 -0
  100. package/src/templates/tanstack-start-2026-06-18/src/components/ui/radio-group.tsx +36 -0
  101. package/src/templates/tanstack-start-2026-06-18/src/components/ui/resizable.tsx +37 -0
  102. package/src/templates/tanstack-start-2026-06-18/src/components/ui/scroll-area.tsx +44 -0
  103. package/src/templates/tanstack-start-2026-06-18/src/components/ui/select.tsx +152 -0
  104. package/src/templates/tanstack-start-2026-06-18/src/components/ui/separator.tsx +24 -0
  105. package/src/templates/tanstack-start-2026-06-18/src/components/ui/sheet.tsx +122 -0
  106. package/src/templates/tanstack-start-2026-06-18/src/components/ui/sidebar.tsx +744 -0
  107. package/src/templates/tanstack-start-2026-06-18/src/components/ui/skeleton.tsx +7 -0
  108. package/src/templates/tanstack-start-2026-06-18/src/components/ui/slider.tsx +23 -0
  109. package/src/templates/tanstack-start-2026-06-18/src/components/ui/sonner.tsx +23 -0
  110. package/src/templates/tanstack-start-2026-06-18/src/components/ui/switch.tsx +27 -0
  111. package/src/templates/tanstack-start-2026-06-18/src/components/ui/table.tsx +94 -0
  112. package/src/templates/tanstack-start-2026-06-18/src/components/ui/tabs.tsx +53 -0
  113. package/src/templates/tanstack-start-2026-06-18/src/components/ui/textarea.tsx +21 -0
  114. package/src/templates/tanstack-start-2026-06-18/src/components/ui/toggle-group.tsx +57 -0
  115. package/src/templates/tanstack-start-2026-06-18/src/components/ui/toggle.tsx +42 -0
  116. package/src/templates/tanstack-start-2026-06-18/src/components/ui/tooltip.tsx +32 -0
  117. package/src/templates/tanstack-start-2026-06-18/src/db/index.ts +9 -0
  118. package/src/templates/tanstack-start-2026-06-18/src/db/schema.ts +18 -0
  119. package/src/templates/tanstack-start-2026-06-18/src/global.d.ts +3 -0
  120. package/src/templates/tanstack-start-2026-06-18/src/hooks/use-mobile.tsx +19 -0
  121. package/src/templates/tanstack-start-2026-06-18/src/lib/proxy.ts +83 -0
  122. package/src/templates/tanstack-start-2026-06-18/src/lib/utils.ts +6 -0
  123. package/src/templates/tanstack-start-2026-06-18/src/routeTree.gen.ts +59 -0
  124. package/src/templates/tanstack-start-2026-06-18/src/router.tsx +33 -0
  125. package/src/templates/tanstack-start-2026-06-18/src/routes/__root.tsx +60 -0
  126. package/src/templates/tanstack-start-2026-06-18/src/routes/api/health.ts +81 -0
  127. package/src/templates/tanstack-start-2026-06-18/src/routes/index.tsx +33 -0
  128. package/src/templates/tanstack-start-2026-06-18/src/server.ts +32 -0
  129. package/src/templates/tanstack-start-2026-06-18/src/styles.css +214 -0
  130. package/src/templates/tanstack-start-2026-06-18/tsconfig.json +27 -0
  131. package/src/templates/tanstack-start-2026-06-18/vite.config.ts +17 -0
  132. package/src/tools/scaffold.ts +42 -43
  133. package/src/tools/setup-netsuite.ts +28 -58
@@ -0,0 +1,143 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import { type DialogProps } from "@radix-ui/react-dialog";
5
+ import { Command as CommandPrimitive } from "cmdk";
6
+ import { Search } from "lucide-react";
7
+
8
+ import { cn } from "@/lib/utils";
9
+ import { Dialog, DialogContent } from "@/components/ui/dialog";
10
+
11
+ const Command = React.forwardRef<
12
+ React.ElementRef<typeof CommandPrimitive>,
13
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive>
14
+ >(({ className, ...props }, ref) => (
15
+ <CommandPrimitive
16
+ ref={ref}
17
+ className={cn(
18
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
19
+ className,
20
+ )}
21
+ {...props}
22
+ />
23
+ ));
24
+ Command.displayName = CommandPrimitive.displayName;
25
+
26
+ const CommandDialog = ({ children, ...props }: DialogProps) => {
27
+ return (
28
+ <Dialog {...props}>
29
+ <DialogContent className="overflow-hidden p-0">
30
+ <Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
31
+ {children}
32
+ </Command>
33
+ </DialogContent>
34
+ </Dialog>
35
+ );
36
+ };
37
+
38
+ const CommandInput = React.forwardRef<
39
+ React.ElementRef<typeof CommandPrimitive.Input>,
40
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
41
+ >(({ className, ...props }, ref) => (
42
+ <div className="flex items-center border-b px-3" cmdk-input-wrapper="">
43
+ <Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />
44
+ <CommandPrimitive.Input
45
+ ref={ref}
46
+ className={cn(
47
+ "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
48
+ className,
49
+ )}
50
+ {...props}
51
+ />
52
+ </div>
53
+ ));
54
+
55
+ CommandInput.displayName = CommandPrimitive.Input.displayName;
56
+
57
+ const CommandList = React.forwardRef<
58
+ React.ElementRef<typeof CommandPrimitive.List>,
59
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
60
+ >(({ className, ...props }, ref) => (
61
+ <CommandPrimitive.List
62
+ ref={ref}
63
+ className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}
64
+ {...props}
65
+ />
66
+ ));
67
+
68
+ CommandList.displayName = CommandPrimitive.List.displayName;
69
+
70
+ const CommandEmpty = React.forwardRef<
71
+ React.ElementRef<typeof CommandPrimitive.Empty>,
72
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
73
+ >((props, ref) => (
74
+ <CommandPrimitive.Empty ref={ref} className="py-6 text-center text-sm" {...props} />
75
+ ));
76
+
77
+ CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
78
+
79
+ const CommandGroup = React.forwardRef<
80
+ React.ElementRef<typeof CommandPrimitive.Group>,
81
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
82
+ >(({ className, ...props }, ref) => (
83
+ <CommandPrimitive.Group
84
+ ref={ref}
85
+ className={cn(
86
+ "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
87
+ className,
88
+ )}
89
+ {...props}
90
+ />
91
+ ));
92
+
93
+ CommandGroup.displayName = CommandPrimitive.Group.displayName;
94
+
95
+ const CommandSeparator = React.forwardRef<
96
+ React.ElementRef<typeof CommandPrimitive.Separator>,
97
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
98
+ >(({ className, ...props }, ref) => (
99
+ <CommandPrimitive.Separator
100
+ ref={ref}
101
+ className={cn("-mx-1 h-px bg-border", className)}
102
+ {...props}
103
+ />
104
+ ));
105
+ CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
106
+
107
+ const CommandItem = React.forwardRef<
108
+ React.ElementRef<typeof CommandPrimitive.Item>,
109
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
110
+ >(({ className, ...props }, ref) => (
111
+ <CommandPrimitive.Item
112
+ ref={ref}
113
+ className={cn(
114
+ "relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
115
+ className,
116
+ )}
117
+ {...props}
118
+ />
119
+ ));
120
+
121
+ CommandItem.displayName = CommandPrimitive.Item.displayName;
122
+
123
+ const CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {
124
+ return (
125
+ <span
126
+ className={cn("ml-auto text-xs tracking-widest text-muted-foreground", className)}
127
+ {...props}
128
+ />
129
+ );
130
+ };
131
+ CommandShortcut.displayName = "CommandShortcut";
132
+
133
+ export {
134
+ Command,
135
+ CommandDialog,
136
+ CommandInput,
137
+ CommandList,
138
+ CommandEmpty,
139
+ CommandGroup,
140
+ CommandItem,
141
+ CommandShortcut,
142
+ CommandSeparator,
143
+ };
@@ -0,0 +1,187 @@
1
+ import * as React from "react";
2
+ import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
3
+ import { Check, ChevronRight, Circle } from "lucide-react";
4
+
5
+ import { cn } from "@/lib/utils";
6
+
7
+ const ContextMenu = ContextMenuPrimitive.Root;
8
+
9
+ const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
10
+
11
+ const ContextMenuGroup = ContextMenuPrimitive.Group;
12
+
13
+ const ContextMenuPortal = ContextMenuPrimitive.Portal;
14
+
15
+ const ContextMenuSub = ContextMenuPrimitive.Sub;
16
+
17
+ const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
18
+
19
+ const ContextMenuSubTrigger = React.forwardRef<
20
+ React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,
21
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {
22
+ inset?: boolean;
23
+ }
24
+ >(({ className, inset, children, ...props }, ref) => (
25
+ <ContextMenuPrimitive.SubTrigger
26
+ ref={ref}
27
+ className={cn(
28
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
29
+ inset && "pl-8",
30
+ className,
31
+ )}
32
+ {...props}
33
+ >
34
+ {children}
35
+ <ChevronRight className="ml-auto h-4 w-4" />
36
+ </ContextMenuPrimitive.SubTrigger>
37
+ ));
38
+ ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
39
+
40
+ const ContextMenuSubContent = React.forwardRef<
41
+ React.ElementRef<typeof ContextMenuPrimitive.SubContent>,
42
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>
43
+ >(({ className, ...props }, ref) => (
44
+ <ContextMenuPrimitive.SubContent
45
+ ref={ref}
46
+ className={cn(
47
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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 origin-(--radix-context-menu-content-transform-origin)",
48
+ className,
49
+ )}
50
+ {...props}
51
+ />
52
+ ));
53
+ ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
54
+
55
+ const ContextMenuContent = React.forwardRef<
56
+ React.ElementRef<typeof ContextMenuPrimitive.Content>,
57
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>
58
+ >(({ className, ...props }, ref) => (
59
+ <ContextMenuPrimitive.Portal>
60
+ <ContextMenuPrimitive.Content
61
+ ref={ref}
62
+ className={cn(
63
+ "z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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 origin-(--radix-context-menu-content-transform-origin)",
64
+ className,
65
+ )}
66
+ {...props}
67
+ />
68
+ </ContextMenuPrimitive.Portal>
69
+ ));
70
+ ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
71
+
72
+ const ContextMenuItem = React.forwardRef<
73
+ React.ElementRef<typeof ContextMenuPrimitive.Item>,
74
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {
75
+ inset?: boolean;
76
+ }
77
+ >(({ className, inset, ...props }, ref) => (
78
+ <ContextMenuPrimitive.Item
79
+ ref={ref}
80
+ className={cn(
81
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
82
+ inset && "pl-8",
83
+ className,
84
+ )}
85
+ {...props}
86
+ />
87
+ ));
88
+ ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
89
+
90
+ const ContextMenuCheckboxItem = React.forwardRef<
91
+ React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,
92
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>
93
+ >(({ className, children, checked, ...props }, ref) => (
94
+ <ContextMenuPrimitive.CheckboxItem
95
+ ref={ref}
96
+ className={cn(
97
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
98
+ className,
99
+ )}
100
+ checked={checked}
101
+ {...props}
102
+ >
103
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
104
+ <ContextMenuPrimitive.ItemIndicator>
105
+ <Check className="h-4 w-4" />
106
+ </ContextMenuPrimitive.ItemIndicator>
107
+ </span>
108
+ {children}
109
+ </ContextMenuPrimitive.CheckboxItem>
110
+ ));
111
+ ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
112
+
113
+ const ContextMenuRadioItem = React.forwardRef<
114
+ React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,
115
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>
116
+ >(({ className, children, ...props }, ref) => (
117
+ <ContextMenuPrimitive.RadioItem
118
+ ref={ref}
119
+ className={cn(
120
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
121
+ className,
122
+ )}
123
+ {...props}
124
+ >
125
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
126
+ <ContextMenuPrimitive.ItemIndicator>
127
+ <Circle className="h-4 w-4 fill-current" />
128
+ </ContextMenuPrimitive.ItemIndicator>
129
+ </span>
130
+ {children}
131
+ </ContextMenuPrimitive.RadioItem>
132
+ ));
133
+ ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
134
+
135
+ const ContextMenuLabel = React.forwardRef<
136
+ React.ElementRef<typeof ContextMenuPrimitive.Label>,
137
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {
138
+ inset?: boolean;
139
+ }
140
+ >(({ className, inset, ...props }, ref) => (
141
+ <ContextMenuPrimitive.Label
142
+ ref={ref}
143
+ className={cn("px-2 py-1.5 text-sm font-semibold text-foreground", inset && "pl-8", className)}
144
+ {...props}
145
+ />
146
+ ));
147
+ ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
148
+
149
+ const ContextMenuSeparator = React.forwardRef<
150
+ React.ElementRef<typeof ContextMenuPrimitive.Separator>,
151
+ React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>
152
+ >(({ className, ...props }, ref) => (
153
+ <ContextMenuPrimitive.Separator
154
+ ref={ref}
155
+ className={cn("-mx-1 my-1 h-px bg-border", className)}
156
+ {...props}
157
+ />
158
+ ));
159
+ ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
160
+
161
+ const ContextMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {
162
+ return (
163
+ <span
164
+ className={cn("ml-auto text-xs tracking-widest text-muted-foreground", className)}
165
+ {...props}
166
+ />
167
+ );
168
+ };
169
+ ContextMenuShortcut.displayName = "ContextMenuShortcut";
170
+
171
+ export {
172
+ ContextMenu,
173
+ ContextMenuTrigger,
174
+ ContextMenuContent,
175
+ ContextMenuItem,
176
+ ContextMenuCheckboxItem,
177
+ ContextMenuRadioItem,
178
+ ContextMenuLabel,
179
+ ContextMenuSeparator,
180
+ ContextMenuShortcut,
181
+ ContextMenuGroup,
182
+ ContextMenuPortal,
183
+ ContextMenuSub,
184
+ ContextMenuSubContent,
185
+ ContextMenuSubTrigger,
186
+ ContextMenuRadioGroup,
187
+ };
@@ -0,0 +1,104 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
5
+ import { X } from "lucide-react";
6
+
7
+ import { cn } from "@/lib/utils";
8
+
9
+ const Dialog = DialogPrimitive.Root;
10
+
11
+ const DialogTrigger = DialogPrimitive.Trigger;
12
+
13
+ const DialogPortal = DialogPrimitive.Portal;
14
+
15
+ const DialogClose = DialogPrimitive.Close;
16
+
17
+ const DialogOverlay = React.forwardRef<
18
+ React.ElementRef<typeof DialogPrimitive.Overlay>,
19
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
20
+ >(({ className, ...props }, ref) => (
21
+ <DialogPrimitive.Overlay
22
+ ref={ref}
23
+ className={cn(
24
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
25
+ className,
26
+ )}
27
+ {...props}
28
+ />
29
+ ));
30
+ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
31
+
32
+ const DialogContent = React.forwardRef<
33
+ React.ElementRef<typeof DialogPrimitive.Content>,
34
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
35
+ >(({ className, children, ...props }, ref) => (
36
+ <DialogPortal>
37
+ <DialogOverlay />
38
+ <DialogPrimitive.Content
39
+ ref={ref}
40
+ className={cn(
41
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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 sm:rounded-lg",
42
+ className,
43
+ )}
44
+ {...props}
45
+ >
46
+ {children}
47
+ <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background cursor-pointer transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
48
+ <X className="h-4 w-4" />
49
+ <span className="sr-only">Close</span>
50
+ </DialogPrimitive.Close>
51
+ </DialogPrimitive.Content>
52
+ </DialogPortal>
53
+ ));
54
+ DialogContent.displayName = DialogPrimitive.Content.displayName;
55
+
56
+ const DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
57
+ <div className={cn("flex flex-col space-y-1.5 text-center sm:text-left", className)} {...props} />
58
+ );
59
+ DialogHeader.displayName = "DialogHeader";
60
+
61
+ const DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
62
+ <div
63
+ className={cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className)}
64
+ {...props}
65
+ />
66
+ );
67
+ DialogFooter.displayName = "DialogFooter";
68
+
69
+ const DialogTitle = React.forwardRef<
70
+ React.ElementRef<typeof DialogPrimitive.Title>,
71
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
72
+ >(({ className, ...props }, ref) => (
73
+ <DialogPrimitive.Title
74
+ ref={ref}
75
+ className={cn("text-lg font-semibold leading-none tracking-tight", className)}
76
+ {...props}
77
+ />
78
+ ));
79
+ DialogTitle.displayName = DialogPrimitive.Title.displayName;
80
+
81
+ const DialogDescription = React.forwardRef<
82
+ React.ElementRef<typeof DialogPrimitive.Description>,
83
+ React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
84
+ >(({ className, ...props }, ref) => (
85
+ <DialogPrimitive.Description
86
+ ref={ref}
87
+ className={cn("text-sm text-muted-foreground", className)}
88
+ {...props}
89
+ />
90
+ ));
91
+ DialogDescription.displayName = DialogPrimitive.Description.displayName;
92
+
93
+ export {
94
+ Dialog,
95
+ DialogPortal,
96
+ DialogOverlay,
97
+ DialogTrigger,
98
+ DialogClose,
99
+ DialogContent,
100
+ DialogHeader,
101
+ DialogFooter,
102
+ DialogTitle,
103
+ DialogDescription,
104
+ };
@@ -0,0 +1,98 @@
1
+ import * as React from "react";
2
+ import { Drawer as DrawerPrimitive } from "vaul";
3
+
4
+ import { cn } from "@/lib/utils";
5
+
6
+ const Drawer = ({
7
+ shouldScaleBackground = true,
8
+ ...props
9
+ }: React.ComponentProps<typeof DrawerPrimitive.Root>) => (
10
+ <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />
11
+ );
12
+ Drawer.displayName = "Drawer";
13
+
14
+ const DrawerTrigger = DrawerPrimitive.Trigger;
15
+
16
+ const DrawerPortal = DrawerPrimitive.Portal;
17
+
18
+ const DrawerClose = DrawerPrimitive.Close;
19
+
20
+ const DrawerOverlay = React.forwardRef<
21
+ React.ElementRef<typeof DrawerPrimitive.Overlay>,
22
+ React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>
23
+ >(({ className, ...props }, ref) => (
24
+ <DrawerPrimitive.Overlay
25
+ ref={ref}
26
+ className={cn("fixed inset-0 z-50 bg-black/80", className)}
27
+ {...props}
28
+ />
29
+ ));
30
+ DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
31
+
32
+ const DrawerContent = React.forwardRef<
33
+ React.ElementRef<typeof DrawerPrimitive.Content>,
34
+ React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
35
+ >(({ className, children, ...props }, ref) => (
36
+ <DrawerPortal>
37
+ <DrawerOverlay />
38
+ <DrawerPrimitive.Content
39
+ ref={ref}
40
+ className={cn(
41
+ "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
42
+ className,
43
+ )}
44
+ {...props}
45
+ >
46
+ <div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" />
47
+ {children}
48
+ </DrawerPrimitive.Content>
49
+ </DrawerPortal>
50
+ ));
51
+ DrawerContent.displayName = "DrawerContent";
52
+
53
+ const DrawerHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
54
+ <div className={cn("grid gap-1.5 p-4 text-center sm:text-left", className)} {...props} />
55
+ );
56
+ DrawerHeader.displayName = "DrawerHeader";
57
+
58
+ const DrawerFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
59
+ <div className={cn("mt-auto flex flex-col gap-2 p-4", className)} {...props} />
60
+ );
61
+ DrawerFooter.displayName = "DrawerFooter";
62
+
63
+ const DrawerTitle = React.forwardRef<
64
+ React.ElementRef<typeof DrawerPrimitive.Title>,
65
+ React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>
66
+ >(({ className, ...props }, ref) => (
67
+ <DrawerPrimitive.Title
68
+ ref={ref}
69
+ className={cn("text-lg font-semibold leading-none tracking-tight", className)}
70
+ {...props}
71
+ />
72
+ ));
73
+ DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
74
+
75
+ const DrawerDescription = React.forwardRef<
76
+ React.ElementRef<typeof DrawerPrimitive.Description>,
77
+ React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>
78
+ >(({ className, ...props }, ref) => (
79
+ <DrawerPrimitive.Description
80
+ ref={ref}
81
+ className={cn("text-sm text-muted-foreground", className)}
82
+ {...props}
83
+ />
84
+ ));
85
+ DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
86
+
87
+ export {
88
+ Drawer,
89
+ DrawerPortal,
90
+ DrawerOverlay,
91
+ DrawerTrigger,
92
+ DrawerClose,
93
+ DrawerContent,
94
+ DrawerHeader,
95
+ DrawerFooter,
96
+ DrawerTitle,
97
+ DrawerDescription,
98
+ };