lovable-stack 1.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 (76) hide show
  1. package/README.md +0 -0
  2. package/bin/index.js +13 -0
  3. package/package.json +15 -0
  4. package/template/bun.lock +1040 -0
  5. package/template/components.json +22 -0
  6. package/template/eslint.config.js +23 -0
  7. package/template/index.html +20 -0
  8. package/template/package.json +82 -0
  9. package/template/postcss.config.js +6 -0
  10. package/template/public/favicon.svg +1 -0
  11. package/template/public/robots copy.txt +38 -0
  12. package/template/public/robots.txt +38 -0
  13. package/template/public/site.webmanifest +12 -0
  14. package/template/public/sitemap.xml +9 -0
  15. package/template/src/App.css +0 -0
  16. package/template/src/App.tsx +16 -0
  17. package/template/src/assets/react.svg +1 -0
  18. package/template/src/components/ui/accordion.tsx +55 -0
  19. package/template/src/components/ui/alert-dialog.tsx +139 -0
  20. package/template/src/components/ui/alert.tsx +59 -0
  21. package/template/src/components/ui/aspect-ratio.tsx +5 -0
  22. package/template/src/components/ui/avatar.tsx +50 -0
  23. package/template/src/components/ui/badge.tsx +36 -0
  24. package/template/src/components/ui/breadcrumb.tsx +115 -0
  25. package/template/src/components/ui/button.tsx +57 -0
  26. package/template/src/components/ui/calendar.tsx +213 -0
  27. package/template/src/components/ui/card.tsx +76 -0
  28. package/template/src/components/ui/carousel.tsx +260 -0
  29. package/template/src/components/ui/chart.tsx +367 -0
  30. package/template/src/components/ui/checkbox.tsx +28 -0
  31. package/template/src/components/ui/collapsible.tsx +11 -0
  32. package/template/src/components/ui/command.tsx +153 -0
  33. package/template/src/components/ui/context-menu.tsx +198 -0
  34. package/template/src/components/ui/dialog.tsx +122 -0
  35. package/template/src/components/ui/drawer.tsx +118 -0
  36. package/template/src/components/ui/dropdown-menu.tsx +199 -0
  37. package/template/src/components/ui/form.tsx +178 -0
  38. package/template/src/components/ui/hover-card.tsx +29 -0
  39. package/template/src/components/ui/input-otp.tsx +69 -0
  40. package/template/src/components/ui/input.tsx +22 -0
  41. package/template/src/components/ui/label.tsx +24 -0
  42. package/template/src/components/ui/menubar.tsx +256 -0
  43. package/template/src/components/ui/navigation-menu.tsx +128 -0
  44. package/template/src/components/ui/pagination.tsx +118 -0
  45. package/template/src/components/ui/popover.tsx +31 -0
  46. package/template/src/components/ui/progress.tsx +28 -0
  47. package/template/src/components/ui/radio-group.tsx +42 -0
  48. package/template/src/components/ui/resizable.tsx +45 -0
  49. package/template/src/components/ui/scroll-area.tsx +46 -0
  50. package/template/src/components/ui/select.tsx +159 -0
  51. package/template/src/components/ui/separator.tsx +29 -0
  52. package/template/src/components/ui/sheet.tsx +140 -0
  53. package/template/src/components/ui/sidebar.tsx +771 -0
  54. package/template/src/components/ui/skeleton.tsx +15 -0
  55. package/template/src/components/ui/slider.tsx +26 -0
  56. package/template/src/components/ui/sonner.tsx +31 -0
  57. package/template/src/components/ui/switch.tsx +27 -0
  58. package/template/src/components/ui/table.tsx +120 -0
  59. package/template/src/components/ui/tabs.tsx +53 -0
  60. package/template/src/components/ui/textarea.tsx +22 -0
  61. package/template/src/components/ui/toast.tsx +127 -0
  62. package/template/src/components/ui/toaster.tsx +33 -0
  63. package/template/src/components/ui/toggle-group.tsx +59 -0
  64. package/template/src/components/ui/toggle.tsx +45 -0
  65. package/template/src/components/ui/tooltip.tsx +30 -0
  66. package/template/src/hooks/use-mobile.tsx +19 -0
  67. package/template/src/hooks/use-toast.ts +186 -0
  68. package/template/src/index.css +43 -0
  69. package/template/src/lib/utils.ts +6 -0
  70. package/template/src/main.tsx +5 -0
  71. package/template/tailwind.config.ts +0 -0
  72. package/template/tsconfig.app.json +42 -0
  73. package/template/tsconfig.json +27 -0
  74. package/template/tsconfig.node.json +27 -0
  75. package/template/vercel.json +5 -0
  76. package/template/vite.config.ts +12 -0
@@ -0,0 +1,199 @@
1
+ import * as React from "react"
2
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
3
+ import { Check, ChevronRight, Circle } from "lucide-react"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ const DropdownMenu = DropdownMenuPrimitive.Root
8
+
9
+ const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger
10
+
11
+ const DropdownMenuGroup = DropdownMenuPrimitive.Group
12
+
13
+ const DropdownMenuPortal = DropdownMenuPrimitive.Portal
14
+
15
+ const DropdownMenuSub = DropdownMenuPrimitive.Sub
16
+
17
+ const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
18
+
19
+ const DropdownMenuSubTrigger = React.forwardRef<
20
+ React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
21
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
22
+ inset?: boolean
23
+ }
24
+ >(({ className, inset, children, ...props }, ref) => (
25
+ <DropdownMenuPrimitive.SubTrigger
26
+ ref={ref}
27
+ className={cn(
28
+ "flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
29
+ inset && "pl-8",
30
+ className
31
+ )}
32
+ {...props}
33
+ >
34
+ {children}
35
+ <ChevronRight className="ml-auto" />
36
+ </DropdownMenuPrimitive.SubTrigger>
37
+ ))
38
+ DropdownMenuSubTrigger.displayName =
39
+ DropdownMenuPrimitive.SubTrigger.displayName
40
+
41
+ const DropdownMenuSubContent = React.forwardRef<
42
+ React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
43
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
44
+ >(({ className, ...props }, ref) => (
45
+ <DropdownMenuPrimitive.SubContent
46
+ ref={ref}
47
+ className={cn(
48
+ "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-dropdown-menu-content-transform-origin]",
49
+ className
50
+ )}
51
+ {...props}
52
+ />
53
+ ))
54
+ DropdownMenuSubContent.displayName =
55
+ DropdownMenuPrimitive.SubContent.displayName
56
+
57
+ const DropdownMenuContent = React.forwardRef<
58
+ React.ElementRef<typeof DropdownMenuPrimitive.Content>,
59
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
60
+ >(({ className, sideOffset = 4, ...props }, ref) => (
61
+ <DropdownMenuPrimitive.Portal>
62
+ <DropdownMenuPrimitive.Content
63
+ ref={ref}
64
+ sideOffset={sideOffset}
65
+ className={cn(
66
+ "z-50 max-h-[var(--radix-dropdown-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",
67
+ "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-dropdown-menu-content-transform-origin]",
68
+ className
69
+ )}
70
+ {...props}
71
+ />
72
+ </DropdownMenuPrimitive.Portal>
73
+ ))
74
+ DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
75
+
76
+ const DropdownMenuItem = React.forwardRef<
77
+ React.ElementRef<typeof DropdownMenuPrimitive.Item>,
78
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
79
+ inset?: boolean
80
+ }
81
+ >(({ className, inset, ...props }, ref) => (
82
+ <DropdownMenuPrimitive.Item
83
+ ref={ref}
84
+ className={cn(
85
+ "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
86
+ inset && "pl-8",
87
+ className
88
+ )}
89
+ {...props}
90
+ />
91
+ ))
92
+ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName
93
+
94
+ const DropdownMenuCheckboxItem = React.forwardRef<
95
+ React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
96
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
97
+ >(({ className, children, checked, ...props }, ref) => (
98
+ <DropdownMenuPrimitive.CheckboxItem
99
+ ref={ref}
100
+ className={cn(
101
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
102
+ className
103
+ )}
104
+ checked={checked}
105
+ {...props}
106
+ >
107
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
108
+ <DropdownMenuPrimitive.ItemIndicator>
109
+ <Check className="h-4 w-4" />
110
+ </DropdownMenuPrimitive.ItemIndicator>
111
+ </span>
112
+ {children}
113
+ </DropdownMenuPrimitive.CheckboxItem>
114
+ ))
115
+ DropdownMenuCheckboxItem.displayName =
116
+ DropdownMenuPrimitive.CheckboxItem.displayName
117
+
118
+ const DropdownMenuRadioItem = React.forwardRef<
119
+ React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
120
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
121
+ >(({ className, children, ...props }, ref) => (
122
+ <DropdownMenuPrimitive.RadioItem
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 transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
126
+ className
127
+ )}
128
+ {...props}
129
+ >
130
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
131
+ <DropdownMenuPrimitive.ItemIndicator>
132
+ <Circle className="h-2 w-2 fill-current" />
133
+ </DropdownMenuPrimitive.ItemIndicator>
134
+ </span>
135
+ {children}
136
+ </DropdownMenuPrimitive.RadioItem>
137
+ ))
138
+ DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName
139
+
140
+ const DropdownMenuLabel = React.forwardRef<
141
+ React.ElementRef<typeof DropdownMenuPrimitive.Label>,
142
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
143
+ inset?: boolean
144
+ }
145
+ >(({ className, inset, ...props }, ref) => (
146
+ <DropdownMenuPrimitive.Label
147
+ ref={ref}
148
+ className={cn(
149
+ "px-2 py-1.5 text-sm font-semibold",
150
+ inset && "pl-8",
151
+ className
152
+ )}
153
+ {...props}
154
+ />
155
+ ))
156
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName
157
+
158
+ const DropdownMenuSeparator = React.forwardRef<
159
+ React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
160
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
161
+ >(({ className, ...props }, ref) => (
162
+ <DropdownMenuPrimitive.Separator
163
+ ref={ref}
164
+ className={cn("-mx-1 my-1 h-px bg-muted", className)}
165
+ {...props}
166
+ />
167
+ ))
168
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
169
+
170
+ const DropdownMenuShortcut = ({
171
+ className,
172
+ ...props
173
+ }: React.HTMLAttributes<HTMLSpanElement>) => {
174
+ return (
175
+ <span
176
+ className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
177
+ {...props}
178
+ />
179
+ )
180
+ }
181
+ DropdownMenuShortcut.displayName = "DropdownMenuShortcut"
182
+
183
+ export {
184
+ DropdownMenu,
185
+ DropdownMenuTrigger,
186
+ DropdownMenuContent,
187
+ DropdownMenuItem,
188
+ DropdownMenuCheckboxItem,
189
+ DropdownMenuRadioItem,
190
+ DropdownMenuLabel,
191
+ DropdownMenuSeparator,
192
+ DropdownMenuShortcut,
193
+ DropdownMenuGroup,
194
+ DropdownMenuPortal,
195
+ DropdownMenuSub,
196
+ DropdownMenuSubContent,
197
+ DropdownMenuSubTrigger,
198
+ DropdownMenuRadioGroup,
199
+ }
@@ -0,0 +1,178 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as LabelPrimitive from "@radix-ui/react-label"
5
+ import { Slot } from "@radix-ui/react-slot"
6
+ import {
7
+ Controller,
8
+ FormProvider,
9
+ useFormContext,
10
+ type ControllerProps,
11
+ type FieldPath,
12
+ type FieldValues,
13
+ } from "react-hook-form"
14
+
15
+ import { cn } from "@/lib/utils"
16
+ import { Label } from "@/components/ui/label"
17
+
18
+ const Form = FormProvider
19
+
20
+ type FormFieldContextValue<
21
+ TFieldValues extends FieldValues = FieldValues,
22
+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
23
+ > = {
24
+ name: TName
25
+ }
26
+
27
+ const FormFieldContext = React.createContext<FormFieldContextValue | null>(null)
28
+
29
+ const FormField = <
30
+ TFieldValues extends FieldValues = FieldValues,
31
+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
32
+ >({
33
+ ...props
34
+ }: ControllerProps<TFieldValues, TName>) => {
35
+ return (
36
+ <FormFieldContext.Provider value={{ name: props.name }}>
37
+ <Controller {...props} />
38
+ </FormFieldContext.Provider>
39
+ )
40
+ }
41
+
42
+ const useFormField = () => {
43
+ const fieldContext = React.useContext(FormFieldContext)
44
+ const itemContext = React.useContext(FormItemContext)
45
+ const { getFieldState, formState } = useFormContext()
46
+
47
+ if (!fieldContext) {
48
+ throw new Error("useFormField should be used within <FormField>")
49
+ }
50
+
51
+ if (!itemContext) {
52
+ throw new Error("useFormField should be used within <FormItem>")
53
+ }
54
+
55
+ const fieldState = getFieldState(fieldContext.name, formState)
56
+
57
+ const { id } = itemContext
58
+
59
+ return {
60
+ id,
61
+ name: fieldContext.name,
62
+ formItemId: `${id}-form-item`,
63
+ formDescriptionId: `${id}-form-item-description`,
64
+ formMessageId: `${id}-form-item-message`,
65
+ ...fieldState,
66
+ }
67
+ }
68
+
69
+ type FormItemContextValue = {
70
+ id: string
71
+ }
72
+
73
+ const FormItemContext = React.createContext<FormItemContextValue | null>(null)
74
+
75
+ const FormItem = React.forwardRef<
76
+ HTMLDivElement,
77
+ React.HTMLAttributes<HTMLDivElement>
78
+ >(({ className, ...props }, ref) => {
79
+ const id = React.useId()
80
+
81
+ return (
82
+ <FormItemContext.Provider value={{ id }}>
83
+ <div ref={ref} className={cn("space-y-2", className)} {...props} />
84
+ </FormItemContext.Provider>
85
+ )
86
+ })
87
+ FormItem.displayName = "FormItem"
88
+
89
+ const FormLabel = React.forwardRef<
90
+ React.ElementRef<typeof LabelPrimitive.Root>,
91
+ React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
92
+ >(({ className, ...props }, ref) => {
93
+ const { error, formItemId } = useFormField()
94
+
95
+ return (
96
+ <Label
97
+ ref={ref}
98
+ className={cn(error && "text-destructive", className)}
99
+ htmlFor={formItemId}
100
+ {...props}
101
+ />
102
+ )
103
+ })
104
+ FormLabel.displayName = "FormLabel"
105
+
106
+ const FormControl = React.forwardRef<
107
+ React.ElementRef<typeof Slot>,
108
+ React.ComponentPropsWithoutRef<typeof Slot>
109
+ >(({ ...props }, ref) => {
110
+ const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
111
+
112
+ return (
113
+ <Slot
114
+ ref={ref}
115
+ id={formItemId}
116
+ aria-describedby={
117
+ !error
118
+ ? `${formDescriptionId}`
119
+ : `${formDescriptionId} ${formMessageId}`
120
+ }
121
+ aria-invalid={!!error}
122
+ {...props}
123
+ />
124
+ )
125
+ })
126
+ FormControl.displayName = "FormControl"
127
+
128
+ const FormDescription = React.forwardRef<
129
+ HTMLParagraphElement,
130
+ React.HTMLAttributes<HTMLParagraphElement>
131
+ >(({ className, ...props }, ref) => {
132
+ const { formDescriptionId } = useFormField()
133
+
134
+ return (
135
+ <p
136
+ ref={ref}
137
+ id={formDescriptionId}
138
+ className={cn("text-[0.8rem] text-muted-foreground", className)}
139
+ {...props}
140
+ />
141
+ )
142
+ })
143
+ FormDescription.displayName = "FormDescription"
144
+
145
+ const FormMessage = React.forwardRef<
146
+ HTMLParagraphElement,
147
+ React.HTMLAttributes<HTMLParagraphElement>
148
+ >(({ className, children, ...props }, ref) => {
149
+ const { error, formMessageId } = useFormField()
150
+ const body = error ? String(error?.message ?? "") : children
151
+
152
+ if (!body) {
153
+ return null
154
+ }
155
+
156
+ return (
157
+ <p
158
+ ref={ref}
159
+ id={formMessageId}
160
+ className={cn("text-[0.8rem] font-medium text-destructive", className)}
161
+ {...props}
162
+ >
163
+ {body}
164
+ </p>
165
+ )
166
+ })
167
+ FormMessage.displayName = "FormMessage"
168
+
169
+ export {
170
+ useFormField,
171
+ Form,
172
+ FormItem,
173
+ FormLabel,
174
+ FormControl,
175
+ FormDescription,
176
+ FormMessage,
177
+ FormField,
178
+ }
@@ -0,0 +1,29 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as HoverCardPrimitive from "@radix-ui/react-hover-card"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ const HoverCard = HoverCardPrimitive.Root
9
+
10
+ const HoverCardTrigger = HoverCardPrimitive.Trigger
11
+
12
+ const HoverCardContent = React.forwardRef<
13
+ React.ElementRef<typeof HoverCardPrimitive.Content>,
14
+ React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>
15
+ >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
16
+ <HoverCardPrimitive.Content
17
+ ref={ref}
18
+ align={align}
19
+ sideOffset={sideOffset}
20
+ className={cn(
21
+ "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]",
22
+ className
23
+ )}
24
+ {...props}
25
+ />
26
+ ))
27
+ HoverCardContent.displayName = HoverCardPrimitive.Content.displayName
28
+
29
+ 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,24 @@
1
+ import * as React from "react"
2
+ import * as LabelPrimitive from "@radix-ui/react-label"
3
+ import { cva, type VariantProps } from "class-variance-authority"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ const labelVariants = cva(
8
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
9
+ )
10
+
11
+ const Label = React.forwardRef<
12
+ React.ElementRef<typeof LabelPrimitive.Root>,
13
+ React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
14
+ VariantProps<typeof labelVariants>
15
+ >(({ className, ...props }, ref) => (
16
+ <LabelPrimitive.Root
17
+ ref={ref}
18
+ className={cn(labelVariants(), className)}
19
+ {...props}
20
+ />
21
+ ))
22
+ Label.displayName = LabelPrimitive.Root.displayName
23
+
24
+ export { Label }