@helloleo/plugins 0.2.12 → 0.2.14

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 (145) hide show
  1. package/dist/index.js +3 -2
  2. package/dist/templates/tanstack-start-2026-07-30/components.json +22 -0
  3. package/dist/templates/tanstack-start-2026-07-30/drizzle/0000_tidy_kang.sql +5 -0
  4. package/dist/templates/tanstack-start-2026-07-30/drizzle/meta/0000_snapshot.json +50 -0
  5. package/dist/templates/tanstack-start-2026-07-30/drizzle/meta/_journal.json +13 -0
  6. package/dist/templates/tanstack-start-2026-07-30/drizzle.config.ts +18 -0
  7. package/dist/templates/tanstack-start-2026-07-30/package.json +103 -0
  8. package/dist/templates/tanstack-start-2026-07-30/src/components/error-component.tsx +47 -0
  9. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/accordion.tsx +51 -0
  10. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/alert-dialog.tsx +115 -0
  11. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/alert.tsx +49 -0
  12. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/aspect-ratio.tsx +5 -0
  13. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/avatar.tsx +47 -0
  14. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/badge.tsx +32 -0
  15. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/breadcrumb.tsx +101 -0
  16. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/button.tsx +49 -0
  17. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/calendar.tsx +177 -0
  18. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/card.tsx +55 -0
  19. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/carousel.tsx +240 -0
  20. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/chart.tsx +371 -0
  21. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/checkbox.tsx +26 -0
  22. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/collapsible.tsx +11 -0
  23. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/command.tsx +143 -0
  24. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/context-menu.tsx +187 -0
  25. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/dialog.tsx +104 -0
  26. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/drawer.tsx +98 -0
  27. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/dropdown-menu.tsx +188 -0
  28. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/form.tsx +171 -0
  29. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/hover-card.tsx +27 -0
  30. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/input-otp.tsx +69 -0
  31. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/input.tsx +22 -0
  32. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/label.tsx +21 -0
  33. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/menubar.tsx +229 -0
  34. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/navigation-menu.tsx +120 -0
  35. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/pagination.tsx +98 -0
  36. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/popover.tsx +31 -0
  37. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/progress.tsx +25 -0
  38. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/radio-group.tsx +36 -0
  39. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/resizable.tsx +37 -0
  40. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/scroll-area.tsx +44 -0
  41. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/select.tsx +152 -0
  42. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/separator.tsx +24 -0
  43. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/sheet.tsx +122 -0
  44. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/sidebar.tsx +744 -0
  45. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/skeleton.tsx +7 -0
  46. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/slider.tsx +23 -0
  47. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/sonner.tsx +23 -0
  48. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/switch.tsx +27 -0
  49. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/table.tsx +94 -0
  50. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/tabs.tsx +53 -0
  51. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/textarea.tsx +21 -0
  52. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/toggle-group.tsx +57 -0
  53. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/toggle.tsx +42 -0
  54. package/dist/templates/tanstack-start-2026-07-30/src/components/ui/tooltip.tsx +32 -0
  55. package/dist/templates/tanstack-start-2026-07-30/src/db/index.ts +9 -0
  56. package/dist/templates/tanstack-start-2026-07-30/src/db/schema.ts +18 -0
  57. package/dist/templates/tanstack-start-2026-07-30/src/global.d.ts +3 -0
  58. package/dist/templates/tanstack-start-2026-07-30/src/hooks/use-mobile.tsx +19 -0
  59. package/dist/templates/tanstack-start-2026-07-30/src/lib/kv.ts +37 -0
  60. package/dist/templates/tanstack-start-2026-07-30/src/lib/proxy.ts +82 -0
  61. package/dist/templates/tanstack-start-2026-07-30/src/lib/storage.ts +44 -0
  62. package/dist/templates/tanstack-start-2026-07-30/src/lib/utils.ts +6 -0
  63. package/dist/templates/tanstack-start-2026-07-30/src/routeTree.gen.ts +86 -0
  64. package/dist/templates/tanstack-start-2026-07-30/src/router.tsx +37 -0
  65. package/dist/templates/tanstack-start-2026-07-30/src/routes/README.md +94 -0
  66. package/dist/templates/tanstack-start-2026-07-30/src/routes/__root.tsx +65 -0
  67. package/dist/templates/tanstack-start-2026-07-30/src/routes/api/health.ts +81 -0
  68. package/dist/templates/tanstack-start-2026-07-30/src/routes/index.tsx +33 -0
  69. package/dist/templates/tanstack-start-2026-07-30/src/server.ts +32 -0
  70. package/dist/templates/tanstack-start-2026-07-30/src/styles.css +214 -0
  71. package/dist/templates/tanstack-start-2026-07-30/tsconfig.json +27 -0
  72. package/dist/templates/tanstack-start-2026-07-30/vite.config.ts +17 -0
  73. package/package.json +1 -1
  74. package/src/templates/tanstack-start-2026-07-30/components.json +22 -0
  75. package/src/templates/tanstack-start-2026-07-30/drizzle/0000_tidy_kang.sql +5 -0
  76. package/src/templates/tanstack-start-2026-07-30/drizzle/meta/0000_snapshot.json +50 -0
  77. package/src/templates/tanstack-start-2026-07-30/drizzle/meta/_journal.json +13 -0
  78. package/src/templates/tanstack-start-2026-07-30/drizzle.config.ts +18 -0
  79. package/src/templates/tanstack-start-2026-07-30/package.json +103 -0
  80. package/src/templates/tanstack-start-2026-07-30/src/components/error-component.tsx +47 -0
  81. package/src/templates/tanstack-start-2026-07-30/src/components/ui/accordion.tsx +51 -0
  82. package/src/templates/tanstack-start-2026-07-30/src/components/ui/alert-dialog.tsx +115 -0
  83. package/src/templates/tanstack-start-2026-07-30/src/components/ui/alert.tsx +49 -0
  84. package/src/templates/tanstack-start-2026-07-30/src/components/ui/aspect-ratio.tsx +5 -0
  85. package/src/templates/tanstack-start-2026-07-30/src/components/ui/avatar.tsx +47 -0
  86. package/src/templates/tanstack-start-2026-07-30/src/components/ui/badge.tsx +32 -0
  87. package/src/templates/tanstack-start-2026-07-30/src/components/ui/breadcrumb.tsx +101 -0
  88. package/src/templates/tanstack-start-2026-07-30/src/components/ui/button.tsx +49 -0
  89. package/src/templates/tanstack-start-2026-07-30/src/components/ui/calendar.tsx +177 -0
  90. package/src/templates/tanstack-start-2026-07-30/src/components/ui/card.tsx +55 -0
  91. package/src/templates/tanstack-start-2026-07-30/src/components/ui/carousel.tsx +240 -0
  92. package/src/templates/tanstack-start-2026-07-30/src/components/ui/chart.tsx +371 -0
  93. package/src/templates/tanstack-start-2026-07-30/src/components/ui/checkbox.tsx +26 -0
  94. package/src/templates/tanstack-start-2026-07-30/src/components/ui/collapsible.tsx +11 -0
  95. package/src/templates/tanstack-start-2026-07-30/src/components/ui/command.tsx +143 -0
  96. package/src/templates/tanstack-start-2026-07-30/src/components/ui/context-menu.tsx +187 -0
  97. package/src/templates/tanstack-start-2026-07-30/src/components/ui/dialog.tsx +104 -0
  98. package/src/templates/tanstack-start-2026-07-30/src/components/ui/drawer.tsx +98 -0
  99. package/src/templates/tanstack-start-2026-07-30/src/components/ui/dropdown-menu.tsx +188 -0
  100. package/src/templates/tanstack-start-2026-07-30/src/components/ui/form.tsx +171 -0
  101. package/src/templates/tanstack-start-2026-07-30/src/components/ui/hover-card.tsx +27 -0
  102. package/src/templates/tanstack-start-2026-07-30/src/components/ui/input-otp.tsx +69 -0
  103. package/src/templates/tanstack-start-2026-07-30/src/components/ui/input.tsx +22 -0
  104. package/src/templates/tanstack-start-2026-07-30/src/components/ui/label.tsx +21 -0
  105. package/src/templates/tanstack-start-2026-07-30/src/components/ui/menubar.tsx +229 -0
  106. package/src/templates/tanstack-start-2026-07-30/src/components/ui/navigation-menu.tsx +120 -0
  107. package/src/templates/tanstack-start-2026-07-30/src/components/ui/pagination.tsx +98 -0
  108. package/src/templates/tanstack-start-2026-07-30/src/components/ui/popover.tsx +31 -0
  109. package/src/templates/tanstack-start-2026-07-30/src/components/ui/progress.tsx +25 -0
  110. package/src/templates/tanstack-start-2026-07-30/src/components/ui/radio-group.tsx +36 -0
  111. package/src/templates/tanstack-start-2026-07-30/src/components/ui/resizable.tsx +37 -0
  112. package/src/templates/tanstack-start-2026-07-30/src/components/ui/scroll-area.tsx +44 -0
  113. package/src/templates/tanstack-start-2026-07-30/src/components/ui/select.tsx +152 -0
  114. package/src/templates/tanstack-start-2026-07-30/src/components/ui/separator.tsx +24 -0
  115. package/src/templates/tanstack-start-2026-07-30/src/components/ui/sheet.tsx +122 -0
  116. package/src/templates/tanstack-start-2026-07-30/src/components/ui/sidebar.tsx +744 -0
  117. package/src/templates/tanstack-start-2026-07-30/src/components/ui/skeleton.tsx +7 -0
  118. package/src/templates/tanstack-start-2026-07-30/src/components/ui/slider.tsx +23 -0
  119. package/src/templates/tanstack-start-2026-07-30/src/components/ui/sonner.tsx +23 -0
  120. package/src/templates/tanstack-start-2026-07-30/src/components/ui/switch.tsx +27 -0
  121. package/src/templates/tanstack-start-2026-07-30/src/components/ui/table.tsx +94 -0
  122. package/src/templates/tanstack-start-2026-07-30/src/components/ui/tabs.tsx +53 -0
  123. package/src/templates/tanstack-start-2026-07-30/src/components/ui/textarea.tsx +21 -0
  124. package/src/templates/tanstack-start-2026-07-30/src/components/ui/toggle-group.tsx +57 -0
  125. package/src/templates/tanstack-start-2026-07-30/src/components/ui/toggle.tsx +42 -0
  126. package/src/templates/tanstack-start-2026-07-30/src/components/ui/tooltip.tsx +32 -0
  127. package/src/templates/tanstack-start-2026-07-30/src/db/index.ts +9 -0
  128. package/src/templates/tanstack-start-2026-07-30/src/db/schema.ts +18 -0
  129. package/src/templates/tanstack-start-2026-07-30/src/global.d.ts +3 -0
  130. package/src/templates/tanstack-start-2026-07-30/src/hooks/use-mobile.tsx +19 -0
  131. package/src/templates/tanstack-start-2026-07-30/src/lib/kv.ts +37 -0
  132. package/src/templates/tanstack-start-2026-07-30/src/lib/proxy.ts +82 -0
  133. package/src/templates/tanstack-start-2026-07-30/src/lib/storage.ts +44 -0
  134. package/src/templates/tanstack-start-2026-07-30/src/lib/utils.ts +6 -0
  135. package/src/templates/tanstack-start-2026-07-30/src/routeTree.gen.ts +86 -0
  136. package/src/templates/tanstack-start-2026-07-30/src/router.tsx +37 -0
  137. package/src/templates/tanstack-start-2026-07-30/src/routes/README.md +94 -0
  138. package/src/templates/tanstack-start-2026-07-30/src/routes/__root.tsx +65 -0
  139. package/src/templates/tanstack-start-2026-07-30/src/routes/api/health.ts +81 -0
  140. package/src/templates/tanstack-start-2026-07-30/src/routes/index.tsx +33 -0
  141. package/src/templates/tanstack-start-2026-07-30/src/server.ts +32 -0
  142. package/src/templates/tanstack-start-2026-07-30/src/styles.css +214 -0
  143. package/src/templates/tanstack-start-2026-07-30/tsconfig.json +27 -0
  144. package/src/templates/tanstack-start-2026-07-30/vite.config.ts +17 -0
  145. package/src/tools/scaffold.ts +3 -2
@@ -0,0 +1,171 @@
1
+ import * as React from "react";
2
+ import * as LabelPrimitive from "@radix-ui/react-label";
3
+ import { Slot } from "@radix-ui/react-slot";
4
+ import {
5
+ Controller,
6
+ FormProvider,
7
+ useFormContext,
8
+ type ControllerProps,
9
+ type FieldPath,
10
+ type FieldValues,
11
+ } from "react-hook-form";
12
+
13
+ import { cn } from "@/lib/utils";
14
+ import { Label } from "@/components/ui/label";
15
+
16
+ const Form = FormProvider;
17
+
18
+ type FormFieldContextValue<
19
+ TFieldValues extends FieldValues = FieldValues,
20
+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
21
+ > = {
22
+ name: TName;
23
+ };
24
+
25
+ const FormFieldContext = React.createContext<FormFieldContextValue | null>(null);
26
+
27
+ const FormField = <
28
+ TFieldValues extends FieldValues = FieldValues,
29
+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
30
+ >({
31
+ ...props
32
+ }: ControllerProps<TFieldValues, TName>) => {
33
+ return (
34
+ <FormFieldContext.Provider value={{ name: props.name }}>
35
+ <Controller {...props} />
36
+ </FormFieldContext.Provider>
37
+ );
38
+ };
39
+
40
+ const useFormField = () => {
41
+ const fieldContext = React.useContext(FormFieldContext);
42
+ const itemContext = React.useContext(FormItemContext);
43
+ const { getFieldState, formState } = useFormContext();
44
+
45
+ if (!fieldContext) {
46
+ throw new Error("useFormField should be used within <FormField>");
47
+ }
48
+
49
+ if (!itemContext) {
50
+ throw new Error("useFormField should be used within <FormItem>");
51
+ }
52
+
53
+ const fieldState = getFieldState(fieldContext.name, formState);
54
+
55
+ const { id } = itemContext;
56
+
57
+ return {
58
+ id,
59
+ name: fieldContext.name,
60
+ formItemId: `${id}-form-item`,
61
+ formDescriptionId: `${id}-form-item-description`,
62
+ formMessageId: `${id}-form-item-message`,
63
+ ...fieldState,
64
+ };
65
+ };
66
+
67
+ type FormItemContextValue = {
68
+ id: string;
69
+ };
70
+
71
+ const FormItemContext = React.createContext<FormItemContextValue | null>(null);
72
+
73
+ const FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
74
+ ({ className, ...props }, ref) => {
75
+ const id = React.useId();
76
+
77
+ return (
78
+ <FormItemContext.Provider value={{ id }}>
79
+ <div ref={ref} className={cn("space-y-2", className)} {...props} />
80
+ </FormItemContext.Provider>
81
+ );
82
+ },
83
+ );
84
+ FormItem.displayName = "FormItem";
85
+
86
+ const FormLabel = React.forwardRef<
87
+ React.ElementRef<typeof LabelPrimitive.Root>,
88
+ React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
89
+ >(({ className, ...props }, ref) => {
90
+ const { error, formItemId } = useFormField();
91
+
92
+ return (
93
+ <Label
94
+ ref={ref}
95
+ className={cn(error && "text-destructive", className)}
96
+ htmlFor={formItemId}
97
+ {...props}
98
+ />
99
+ );
100
+ });
101
+ FormLabel.displayName = "FormLabel";
102
+
103
+ const FormControl = React.forwardRef<
104
+ React.ElementRef<typeof Slot>,
105
+ React.ComponentPropsWithoutRef<typeof Slot>
106
+ >(({ ...props }, ref) => {
107
+ const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
108
+
109
+ return (
110
+ <Slot
111
+ ref={ref}
112
+ id={formItemId}
113
+ aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}
114
+ aria-invalid={!!error}
115
+ {...props}
116
+ />
117
+ );
118
+ });
119
+ FormControl.displayName = "FormControl";
120
+
121
+ const FormDescription = React.forwardRef<
122
+ HTMLParagraphElement,
123
+ React.HTMLAttributes<HTMLParagraphElement>
124
+ >(({ className, ...props }, ref) => {
125
+ const { formDescriptionId } = useFormField();
126
+
127
+ return (
128
+ <p
129
+ ref={ref}
130
+ id={formDescriptionId}
131
+ className={cn("text-[0.8rem] text-muted-foreground", className)}
132
+ {...props}
133
+ />
134
+ );
135
+ });
136
+ FormDescription.displayName = "FormDescription";
137
+
138
+ const FormMessage = React.forwardRef<
139
+ HTMLParagraphElement,
140
+ React.HTMLAttributes<HTMLParagraphElement>
141
+ >(({ className, children, ...props }, ref) => {
142
+ const { error, formMessageId } = useFormField();
143
+ const body = error ? String(error?.message ?? "") : children;
144
+
145
+ if (!body) {
146
+ return null;
147
+ }
148
+
149
+ return (
150
+ <p
151
+ ref={ref}
152
+ id={formMessageId}
153
+ className={cn("text-[0.8rem] font-medium text-destructive", className)}
154
+ {...props}
155
+ >
156
+ {body}
157
+ </p>
158
+ );
159
+ });
160
+ FormMessage.displayName = "FormMessage";
161
+
162
+ export {
163
+ useFormField,
164
+ Form,
165
+ FormItem,
166
+ FormLabel,
167
+ FormControl,
168
+ FormDescription,
169
+ FormMessage,
170
+ FormField,
171
+ };
@@ -0,0 +1,27 @@
1
+ import * as React from "react";
2
+ import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
3
+
4
+ import { cn } from "@/lib/utils";
5
+
6
+ const HoverCard = HoverCardPrimitive.Root;
7
+
8
+ const HoverCardTrigger = HoverCardPrimitive.Trigger;
9
+
10
+ const HoverCardContent = React.forwardRef<
11
+ React.ElementRef<typeof HoverCardPrimitive.Content>,
12
+ React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>
13
+ >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
14
+ <HoverCardPrimitive.Content
15
+ ref={ref}
16
+ align={align}
17
+ sideOffset={sideOffset}
18
+ className={cn(
19
+ "z-50 w-64 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 origin-(--radix-hover-card-content-transform-origin)",
20
+ className,
21
+ )}
22
+ {...props}
23
+ />
24
+ ));
25
+ HoverCardContent.displayName = HoverCardPrimitive.Content.displayName;
26
+
27
+ export { HoverCard, HoverCardTrigger, HoverCardContent };
@@ -0,0 +1,69 @@
1
+ import * as React from "react";
2
+ import { OTPInput, OTPInputContext } from "input-otp";
3
+ import { Minus } from "lucide-react";
4
+
5
+ import { cn } from "@/lib/utils";
6
+
7
+ const InputOTP = React.forwardRef<
8
+ React.ElementRef<typeof OTPInput>,
9
+ React.ComponentPropsWithoutRef<typeof OTPInput>
10
+ >(({ className, containerClassName, ...props }, ref) => (
11
+ <OTPInput
12
+ ref={ref}
13
+ containerClassName={cn(
14
+ "flex items-center gap-2 has-[:disabled]:opacity-50",
15
+ containerClassName,
16
+ )}
17
+ className={cn("disabled:cursor-not-allowed", className)}
18
+ {...props}
19
+ />
20
+ ));
21
+ InputOTP.displayName = "InputOTP";
22
+
23
+ const InputOTPGroup = React.forwardRef<
24
+ React.ElementRef<"div">,
25
+ React.ComponentPropsWithoutRef<"div">
26
+ >(({ className, ...props }, ref) => (
27
+ <div ref={ref} className={cn("flex items-center", className)} {...props} />
28
+ ));
29
+ InputOTPGroup.displayName = "InputOTPGroup";
30
+
31
+ const InputOTPSlot = React.forwardRef<
32
+ React.ElementRef<"div">,
33
+ React.ComponentPropsWithoutRef<"div"> & { index: number }
34
+ >(({ index, className, ...props }, ref) => {
35
+ const inputOTPContext = React.useContext(OTPInputContext);
36
+ const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
37
+
38
+ return (
39
+ <div
40
+ ref={ref}
41
+ className={cn(
42
+ "relative flex h-9 w-9 items-center justify-center border-y border-r border-input text-sm shadow-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",
43
+ isActive && "z-10 ring-1 ring-ring",
44
+ className,
45
+ )}
46
+ {...props}
47
+ >
48
+ {char}
49
+ {hasFakeCaret && (
50
+ <div className="pointer-events-none absolute inset-0 flex items-center justify-center">
51
+ <div className="h-4 w-px animate-caret-blink bg-foreground duration-1000" />
52
+ </div>
53
+ )}
54
+ </div>
55
+ );
56
+ });
57
+ InputOTPSlot.displayName = "InputOTPSlot";
58
+
59
+ const InputOTPSeparator = React.forwardRef<
60
+ React.ElementRef<"div">,
61
+ React.ComponentPropsWithoutRef<"div">
62
+ >(({ ...props }, ref) => (
63
+ <div ref={ref} role="separator" {...props}>
64
+ <Minus />
65
+ </div>
66
+ ));
67
+ InputOTPSeparator.displayName = "InputOTPSeparator";
68
+
69
+ export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+
3
+ import { cn } from "@/lib/utils";
4
+
5
+ const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
6
+ ({ className, type, ...props }, ref) => {
7
+ return (
8
+ <input
9
+ type={type}
10
+ className={cn(
11
+ "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
12
+ className,
13
+ )}
14
+ ref={ref}
15
+ {...props}
16
+ />
17
+ );
18
+ },
19
+ );
20
+ Input.displayName = "Input";
21
+
22
+ export { Input };
@@ -0,0 +1,21 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as LabelPrimitive from "@radix-ui/react-label";
5
+ import { cva, type VariantProps } from "class-variance-authority";
6
+
7
+ import { cn } from "@/lib/utils";
8
+
9
+ const labelVariants = cva(
10
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
11
+ );
12
+
13
+ const Label = React.forwardRef<
14
+ React.ElementRef<typeof LabelPrimitive.Root>,
15
+ React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>
16
+ >(({ className, ...props }, ref) => (
17
+ <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />
18
+ ));
19
+ Label.displayName = LabelPrimitive.Root.displayName;
20
+
21
+ export { Label };
@@ -0,0 +1,229 @@
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
+ function MenubarMenu({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Menu>) {
8
+ return <MenubarPrimitive.Menu {...props} />;
9
+ }
10
+
11
+ function MenubarGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Group>) {
12
+ return <MenubarPrimitive.Group {...props} />;
13
+ }
14
+
15
+ function MenubarPortal({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Portal>) {
16
+ return <MenubarPrimitive.Portal {...props} />;
17
+ }
18
+
19
+ function MenubarRadioGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {
20
+ return <MenubarPrimitive.RadioGroup {...props} />;
21
+ }
22
+
23
+ function MenubarSub({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Sub>) {
24
+ return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props} />;
25
+ }
26
+
27
+ const Menubar = React.forwardRef<
28
+ React.ElementRef<typeof MenubarPrimitive.Root>,
29
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>
30
+ >(({ className, ...props }, ref) => (
31
+ <MenubarPrimitive.Root
32
+ ref={ref}
33
+ className={cn(
34
+ "flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm",
35
+ className,
36
+ )}
37
+ {...props}
38
+ />
39
+ ));
40
+ Menubar.displayName = MenubarPrimitive.Root.displayName;
41
+
42
+ const MenubarTrigger = React.forwardRef<
43
+ React.ElementRef<typeof MenubarPrimitive.Trigger>,
44
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>
45
+ >(({ className, ...props }, ref) => (
46
+ <MenubarPrimitive.Trigger
47
+ ref={ref}
48
+ className={cn(
49
+ "flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
50
+ className,
51
+ )}
52
+ {...props}
53
+ />
54
+ ));
55
+ MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;
56
+
57
+ const MenubarSubTrigger = React.forwardRef<
58
+ React.ElementRef<typeof MenubarPrimitive.SubTrigger>,
59
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {
60
+ inset?: boolean;
61
+ }
62
+ >(({ className, inset, children, ...props }, ref) => (
63
+ <MenubarPrimitive.SubTrigger
64
+ ref={ref}
65
+ className={cn(
66
+ "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",
67
+ inset && "pl-8",
68
+ className,
69
+ )}
70
+ {...props}
71
+ >
72
+ {children}
73
+ <ChevronRight className="ml-auto h-4 w-4" />
74
+ </MenubarPrimitive.SubTrigger>
75
+ ));
76
+ MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;
77
+
78
+ const MenubarSubContent = React.forwardRef<
79
+ React.ElementRef<typeof MenubarPrimitive.SubContent>,
80
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>
81
+ >(({ className, ...props }, ref) => (
82
+ <MenubarPrimitive.SubContent
83
+ ref={ref}
84
+ className={cn(
85
+ "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-menubar-content-transform-origin)",
86
+ className,
87
+ )}
88
+ {...props}
89
+ />
90
+ ));
91
+ MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;
92
+
93
+ const MenubarContent = React.forwardRef<
94
+ React.ElementRef<typeof MenubarPrimitive.Content>,
95
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>
96
+ >(({ className, align = "start", alignOffset = -4, sideOffset = 8, ...props }, ref) => (
97
+ <MenubarPrimitive.Portal>
98
+ <MenubarPrimitive.Content
99
+ ref={ref}
100
+ align={align}
101
+ alignOffset={alignOffset}
102
+ sideOffset={sideOffset}
103
+ className={cn(
104
+ "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 origin-(--radix-menubar-content-transform-origin)",
105
+ className,
106
+ )}
107
+ {...props}
108
+ />
109
+ </MenubarPrimitive.Portal>
110
+ ));
111
+ MenubarContent.displayName = MenubarPrimitive.Content.displayName;
112
+
113
+ const MenubarItem = React.forwardRef<
114
+ React.ElementRef<typeof MenubarPrimitive.Item>,
115
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {
116
+ inset?: boolean;
117
+ }
118
+ >(({ className, inset, ...props }, ref) => (
119
+ <MenubarPrimitive.Item
120
+ ref={ref}
121
+ className={cn(
122
+ "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",
123
+ inset && "pl-8",
124
+ className,
125
+ )}
126
+ {...props}
127
+ />
128
+ ));
129
+ MenubarItem.displayName = MenubarPrimitive.Item.displayName;
130
+
131
+ const MenubarCheckboxItem = React.forwardRef<
132
+ React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,
133
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>
134
+ >(({ className, children, checked, ...props }, ref) => (
135
+ <MenubarPrimitive.CheckboxItem
136
+ ref={ref}
137
+ className={cn(
138
+ "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",
139
+ className,
140
+ )}
141
+ checked={checked}
142
+ {...props}
143
+ >
144
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
145
+ <MenubarPrimitive.ItemIndicator>
146
+ <Check className="h-4 w-4" />
147
+ </MenubarPrimitive.ItemIndicator>
148
+ </span>
149
+ {children}
150
+ </MenubarPrimitive.CheckboxItem>
151
+ ));
152
+ MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;
153
+
154
+ const MenubarRadioItem = React.forwardRef<
155
+ React.ElementRef<typeof MenubarPrimitive.RadioItem>,
156
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>
157
+ >(({ className, children, ...props }, ref) => (
158
+ <MenubarPrimitive.RadioItem
159
+ ref={ref}
160
+ className={cn(
161
+ "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",
162
+ className,
163
+ )}
164
+ {...props}
165
+ >
166
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
167
+ <MenubarPrimitive.ItemIndicator>
168
+ <Circle className="h-4 w-4 fill-current" />
169
+ </MenubarPrimitive.ItemIndicator>
170
+ </span>
171
+ {children}
172
+ </MenubarPrimitive.RadioItem>
173
+ ));
174
+ MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;
175
+
176
+ const MenubarLabel = React.forwardRef<
177
+ React.ElementRef<typeof MenubarPrimitive.Label>,
178
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {
179
+ inset?: boolean;
180
+ }
181
+ >(({ className, inset, ...props }, ref) => (
182
+ <MenubarPrimitive.Label
183
+ ref={ref}
184
+ className={cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className)}
185
+ {...props}
186
+ />
187
+ ));
188
+ MenubarLabel.displayName = MenubarPrimitive.Label.displayName;
189
+
190
+ const MenubarSeparator = React.forwardRef<
191
+ React.ElementRef<typeof MenubarPrimitive.Separator>,
192
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>
193
+ >(({ className, ...props }, ref) => (
194
+ <MenubarPrimitive.Separator
195
+ ref={ref}
196
+ className={cn("-mx-1 my-1 h-px bg-muted", className)}
197
+ {...props}
198
+ />
199
+ ));
200
+ MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;
201
+
202
+ const MenubarShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {
203
+ return (
204
+ <span
205
+ className={cn("ml-auto text-xs tracking-widest text-muted-foreground", className)}
206
+ {...props}
207
+ />
208
+ );
209
+ };
210
+ MenubarShortcut.displayname = "MenubarShortcut";
211
+
212
+ export {
213
+ Menubar,
214
+ MenubarMenu,
215
+ MenubarTrigger,
216
+ MenubarContent,
217
+ MenubarItem,
218
+ MenubarSeparator,
219
+ MenubarLabel,
220
+ MenubarCheckboxItem,
221
+ MenubarRadioGroup,
222
+ MenubarRadioItem,
223
+ MenubarPortal,
224
+ MenubarSubContent,
225
+ MenubarSubTrigger,
226
+ MenubarGroup,
227
+ MenubarSub,
228
+ MenubarShortcut,
229
+ };
@@ -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-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium cursor-pointer 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 disabled:cursor-not-allowed data-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent",
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-300 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 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
+ };