@ichaingo/ui 1.1.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 (141) hide show
  1. package/.babelrc +12 -0
  2. package/README.md +103 -0
  3. package/components.json +21 -0
  4. package/dist/accordion.d.ts +13 -0
  5. package/dist/accordion.mjs +64 -0
  6. package/dist/alert-dialog.d.ts +27 -0
  7. package/dist/alert-dialog.mjs +146 -0
  8. package/dist/alert.d.ts +16 -0
  9. package/dist/alert.mjs +66 -0
  10. package/dist/aspect-ratio.d.ts +6 -0
  11. package/dist/aspect-ratio.mjs +10 -0
  12. package/dist/avatar.d.ts +11 -0
  13. package/dist/avatar.mjs +53 -0
  14. package/dist/badge.d.ts +14 -0
  15. package/dist/badge.mjs +39 -0
  16. package/dist/breadcrumb.d.ts +20 -0
  17. package/dist/breadcrumb.mjs +102 -0
  18. package/dist/button.d.ts +15 -0
  19. package/dist/button.mjs +49 -0
  20. package/dist/calendar.d.ts +23 -0
  21. package/dist/calendar.mjs +173 -0
  22. package/dist/card.d.ts +18 -0
  23. package/dist/card.mjs +90 -0
  24. package/dist/carousel.d.ts +42 -0
  25. package/dist/carousel.mjs +177 -0
  26. package/dist/checkbox.d.ts +7 -0
  27. package/dist/checkbox.mjs +31 -0
  28. package/dist/collapsible.d.ts +10 -0
  29. package/dist/collapsible.mjs +34 -0
  30. package/dist/command.d.ts +31 -0
  31. package/dist/command.mjs +170 -0
  32. package/dist/context-menu.d.ts +42 -0
  33. package/dist/context-menu.mjs +223 -0
  34. package/dist/dialog.d.ts +27 -0
  35. package/dist/dialog.mjs +136 -0
  36. package/dist/dropdown-menu.d.ts +42 -0
  37. package/dist/dropdown-menu.mjs +231 -0
  38. package/dist/form.d.ts +38 -0
  39. package/dist/form.mjs +101 -0
  40. package/dist/hover-card.d.ts +11 -0
  41. package/dist/hover-card.mjs +38 -0
  42. package/dist/input.d.ts +6 -0
  43. package/dist/input.mjs +21 -0
  44. package/dist/label.d.ts +7 -0
  45. package/dist/label.mjs +23 -0
  46. package/dist/menubar.d.ts +44 -0
  47. package/dist/menubar.mjs +251 -0
  48. package/dist/navigation-menu.d.ts +26 -0
  49. package/dist/navigation-menu.mjs +170 -0
  50. package/dist/pagination.d.ts +33 -0
  51. package/dist/pagination.mjs +116 -0
  52. package/dist/popover.d.ts +13 -0
  53. package/dist/popover.mjs +44 -0
  54. package/dist/progress.d.ts +7 -0
  55. package/dist/progress.mjs +31 -0
  56. package/dist/radio-group.d.ts +9 -0
  57. package/dist/radio-group.mjs +45 -0
  58. package/dist/resizable.d.ts +13 -0
  59. package/dist/resizable.mjs +48 -0
  60. package/dist/scroll-area.d.ts +9 -0
  61. package/dist/scroll-area.mjs +60 -0
  62. package/dist/select.d.ts +27 -0
  63. package/dist/select.mjs +169 -0
  64. package/dist/separator.d.ts +7 -0
  65. package/dist/separator.mjs +26 -0
  66. package/dist/sheet.d.ts +23 -0
  67. package/dist/sheet.mjs +126 -0
  68. package/dist/skeleton.d.ts +5 -0
  69. package/dist/skeleton.mjs +15 -0
  70. package/dist/slider.d.ts +7 -0
  71. package/dist/slider.mjs +63 -0
  72. package/dist/sonner.d.ts +6 -0
  73. package/dist/sonner.mjs +22 -0
  74. package/dist/switch.d.ts +7 -0
  75. package/dist/switch.mjs +31 -0
  76. package/dist/table.d.ts +20 -0
  77. package/dist/table.mjs +114 -0
  78. package/dist/tabs.d.ts +13 -0
  79. package/dist/tabs.mjs +67 -0
  80. package/dist/textarea.d.ts +6 -0
  81. package/dist/textarea.mjs +18 -0
  82. package/dist/toggle-group.d.ts +16 -0
  83. package/dist/toggle-group.mjs +62 -0
  84. package/dist/toggle.d.ts +14 -0
  85. package/dist/toggle.mjs +43 -0
  86. package/dist/tooltip.d.ts +13 -0
  87. package/dist/tooltip.mjs +55 -0
  88. package/dist/utils-B7J70Nno.js +8 -0
  89. package/eslint.config.mjs +12 -0
  90. package/package.json +273 -0
  91. package/postcss.config.js +6 -0
  92. package/src/components/ui/accordion.tsx +64 -0
  93. package/src/components/ui/alert-dialog.tsx +155 -0
  94. package/src/components/ui/alert.tsx +66 -0
  95. package/src/components/ui/aspect-ratio.tsx +9 -0
  96. package/src/components/ui/avatar.tsx +51 -0
  97. package/src/components/ui/badge.tsx +46 -0
  98. package/src/components/ui/breadcrumb.tsx +109 -0
  99. package/src/components/ui/button.tsx +59 -0
  100. package/src/components/ui/calendar.tsx +211 -0
  101. package/src/components/ui/card.tsx +92 -0
  102. package/src/components/ui/carousel.tsx +239 -0
  103. package/src/components/ui/checkbox.tsx +30 -0
  104. package/src/components/ui/collapsible.tsx +31 -0
  105. package/src/components/ui/command.tsx +182 -0
  106. package/src/components/ui/context-menu.tsx +250 -0
  107. package/src/components/ui/dialog.tsx +141 -0
  108. package/src/components/ui/dropdown-menu.tsx +255 -0
  109. package/src/components/ui/form.tsx +165 -0
  110. package/src/components/ui/hover-card.tsx +42 -0
  111. package/src/components/ui/input.tsx +21 -0
  112. package/src/components/ui/label.tsx +24 -0
  113. package/src/components/ui/menubar.tsx +274 -0
  114. package/src/components/ui/navigation-menu.tsx +168 -0
  115. package/src/components/ui/pagination.tsx +125 -0
  116. package/src/components/ui/popover.tsx +46 -0
  117. package/src/components/ui/progress.tsx +29 -0
  118. package/src/components/ui/radio-group.tsx +43 -0
  119. package/src/components/ui/resizable.tsx +54 -0
  120. package/src/components/ui/scroll-area.tsx +56 -0
  121. package/src/components/ui/select.tsx +183 -0
  122. package/src/components/ui/separator.tsx +26 -0
  123. package/src/components/ui/sheet.tsx +137 -0
  124. package/src/components/ui/skeleton.tsx +13 -0
  125. package/src/components/ui/slider.tsx +61 -0
  126. package/src/components/ui/sonner.tsx +23 -0
  127. package/src/components/ui/switch.tsx +29 -0
  128. package/src/components/ui/table.tsx +114 -0
  129. package/src/components/ui/tabs.tsx +64 -0
  130. package/src/components/ui/textarea.tsx +18 -0
  131. package/src/components/ui/toggle-group.tsx +71 -0
  132. package/src/components/ui/toggle.tsx +45 -0
  133. package/src/components/ui/tooltip.tsx +59 -0
  134. package/src/index.ts +46 -0
  135. package/src/lib/utils.ts +6 -0
  136. package/src/style.css +0 -0
  137. package/tailwind.config.js +52 -0
  138. package/tsconfig.json +19 -0
  139. package/tsconfig.lib.json +54 -0
  140. package/tsconfig.spec.json +32 -0
  141. package/vite.config.ts +136 -0
@@ -0,0 +1,255 @@
1
+ import * as React from "react"
2
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
3
+ import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ function DropdownMenu({
8
+ ...props
9
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
10
+ return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />
11
+ }
12
+
13
+ function DropdownMenuPortal({
14
+ ...props
15
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
16
+ return (
17
+ <DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
18
+ )
19
+ }
20
+
21
+ function DropdownMenuTrigger({
22
+ ...props
23
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
24
+ return (
25
+ <DropdownMenuPrimitive.Trigger
26
+ data-slot="dropdown-menu-trigger"
27
+ {...props}
28
+ />
29
+ )
30
+ }
31
+
32
+ function DropdownMenuContent({
33
+ className,
34
+ sideOffset = 4,
35
+ ...props
36
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
37
+ return (
38
+ <DropdownMenuPrimitive.Portal>
39
+ <DropdownMenuPrimitive.Content
40
+ data-slot="dropdown-menu-content"
41
+ sideOffset={sideOffset}
42
+ className={cn(
43
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
44
+ className
45
+ )}
46
+ {...props}
47
+ />
48
+ </DropdownMenuPrimitive.Portal>
49
+ )
50
+ }
51
+
52
+ function DropdownMenuGroup({
53
+ ...props
54
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
55
+ return (
56
+ <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
57
+ )
58
+ }
59
+
60
+ function DropdownMenuItem({
61
+ className,
62
+ inset,
63
+ variant = "default",
64
+ ...props
65
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
66
+ inset?: boolean
67
+ variant?: "default" | "destructive"
68
+ }) {
69
+ return (
70
+ <DropdownMenuPrimitive.Item
71
+ data-slot="dropdown-menu-item"
72
+ data-inset={inset}
73
+ data-variant={variant}
74
+ className={cn(
75
+ "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
76
+ className
77
+ )}
78
+ {...props}
79
+ />
80
+ )
81
+ }
82
+
83
+ function DropdownMenuCheckboxItem({
84
+ className,
85
+ children,
86
+ checked,
87
+ ...props
88
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
89
+ return (
90
+ <DropdownMenuPrimitive.CheckboxItem
91
+ data-slot="dropdown-menu-checkbox-item"
92
+ className={cn(
93
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
94
+ className
95
+ )}
96
+ checked={checked}
97
+ {...props}
98
+ >
99
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
100
+ <DropdownMenuPrimitive.ItemIndicator>
101
+ <CheckIcon className="size-4" />
102
+ </DropdownMenuPrimitive.ItemIndicator>
103
+ </span>
104
+ {children}
105
+ </DropdownMenuPrimitive.CheckboxItem>
106
+ )
107
+ }
108
+
109
+ function DropdownMenuRadioGroup({
110
+ ...props
111
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
112
+ return (
113
+ <DropdownMenuPrimitive.RadioGroup
114
+ data-slot="dropdown-menu-radio-group"
115
+ {...props}
116
+ />
117
+ )
118
+ }
119
+
120
+ function DropdownMenuRadioItem({
121
+ className,
122
+ children,
123
+ ...props
124
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
125
+ return (
126
+ <DropdownMenuPrimitive.RadioItem
127
+ data-slot="dropdown-menu-radio-item"
128
+ className={cn(
129
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
130
+ className
131
+ )}
132
+ {...props}
133
+ >
134
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
135
+ <DropdownMenuPrimitive.ItemIndicator>
136
+ <CircleIcon className="size-2 fill-current" />
137
+ </DropdownMenuPrimitive.ItemIndicator>
138
+ </span>
139
+ {children}
140
+ </DropdownMenuPrimitive.RadioItem>
141
+ )
142
+ }
143
+
144
+ function DropdownMenuLabel({
145
+ className,
146
+ inset,
147
+ ...props
148
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
149
+ inset?: boolean
150
+ }) {
151
+ return (
152
+ <DropdownMenuPrimitive.Label
153
+ data-slot="dropdown-menu-label"
154
+ data-inset={inset}
155
+ className={cn(
156
+ "px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
157
+ className
158
+ )}
159
+ {...props}
160
+ />
161
+ )
162
+ }
163
+
164
+ function DropdownMenuSeparator({
165
+ className,
166
+ ...props
167
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
168
+ return (
169
+ <DropdownMenuPrimitive.Separator
170
+ data-slot="dropdown-menu-separator"
171
+ className={cn("bg-border -mx-1 my-1 h-px", className)}
172
+ {...props}
173
+ />
174
+ )
175
+ }
176
+
177
+ function DropdownMenuShortcut({
178
+ className,
179
+ ...props
180
+ }: React.ComponentProps<"span">) {
181
+ return (
182
+ <span
183
+ data-slot="dropdown-menu-shortcut"
184
+ className={cn(
185
+ "text-muted-foreground ml-auto text-xs tracking-widest",
186
+ className
187
+ )}
188
+ {...props}
189
+ />
190
+ )
191
+ }
192
+
193
+ function DropdownMenuSub({
194
+ ...props
195
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
196
+ return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />
197
+ }
198
+
199
+ function DropdownMenuSubTrigger({
200
+ className,
201
+ inset,
202
+ children,
203
+ ...props
204
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
205
+ inset?: boolean
206
+ }) {
207
+ return (
208
+ <DropdownMenuPrimitive.SubTrigger
209
+ data-slot="dropdown-menu-sub-trigger"
210
+ data-inset={inset}
211
+ className={cn(
212
+ "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",
213
+ className
214
+ )}
215
+ {...props}
216
+ >
217
+ {children}
218
+ <ChevronRightIcon className="ml-auto size-4" />
219
+ </DropdownMenuPrimitive.SubTrigger>
220
+ )
221
+ }
222
+
223
+ function DropdownMenuSubContent({
224
+ className,
225
+ ...props
226
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
227
+ return (
228
+ <DropdownMenuPrimitive.SubContent
229
+ data-slot="dropdown-menu-sub-content"
230
+ className={cn(
231
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
232
+ className
233
+ )}
234
+ {...props}
235
+ />
236
+ )
237
+ }
238
+
239
+ export {
240
+ DropdownMenu,
241
+ DropdownMenuPortal,
242
+ DropdownMenuTrigger,
243
+ DropdownMenuContent,
244
+ DropdownMenuGroup,
245
+ DropdownMenuLabel,
246
+ DropdownMenuItem,
247
+ DropdownMenuCheckboxItem,
248
+ DropdownMenuRadioGroup,
249
+ DropdownMenuRadioItem,
250
+ DropdownMenuSeparator,
251
+ DropdownMenuShortcut,
252
+ DropdownMenuSub,
253
+ DropdownMenuSubTrigger,
254
+ DropdownMenuSubContent,
255
+ }
@@ -0,0 +1,165 @@
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
+ useFormState,
9
+ type ControllerProps,
10
+ type FieldPath,
11
+ type FieldValues,
12
+ } from "react-hook-form"
13
+
14
+ import { cn } from "@/lib/utils"
15
+ import { Label } from "@/components/ui/label"
16
+
17
+ const Form = FormProvider
18
+
19
+ type FormFieldContextValue<
20
+ TFieldValues extends FieldValues = FieldValues,
21
+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
22
+ > = {
23
+ name: TName
24
+ }
25
+
26
+ const FormFieldContext = React.createContext<FormFieldContextValue>(
27
+ {} as FormFieldContextValue
28
+ )
29
+
30
+ const FormField = <
31
+ TFieldValues extends FieldValues = FieldValues,
32
+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
33
+ >({
34
+ ...props
35
+ }: ControllerProps<TFieldValues, TName>) => {
36
+ return (
37
+ <FormFieldContext.Provider value={{ name: props.name }}>
38
+ <Controller {...props} />
39
+ </FormFieldContext.Provider>
40
+ )
41
+ }
42
+
43
+ const useFormField = () => {
44
+ const fieldContext = React.useContext(FormFieldContext)
45
+ const itemContext = React.useContext(FormItemContext)
46
+ const { getFieldState } = useFormContext()
47
+ const formState = useFormState({ name: fieldContext.name })
48
+ const fieldState = getFieldState(fieldContext.name, formState)
49
+
50
+ if (!fieldContext) {
51
+ throw new Error("useFormField should be used within <FormField>")
52
+ }
53
+
54
+ const { id } = itemContext
55
+
56
+ return {
57
+ id,
58
+ name: fieldContext.name,
59
+ formItemId: `${id}-form-item`,
60
+ formDescriptionId: `${id}-form-item-description`,
61
+ formMessageId: `${id}-form-item-message`,
62
+ ...fieldState,
63
+ }
64
+ }
65
+
66
+ type FormItemContextValue = {
67
+ id: string
68
+ }
69
+
70
+ const FormItemContext = React.createContext<FormItemContextValue>(
71
+ {} as FormItemContextValue
72
+ )
73
+
74
+ function FormItem({ className, ...props }: React.ComponentProps<"div">) {
75
+ const id = React.useId()
76
+
77
+ return (
78
+ <FormItemContext.Provider value={{ id }}>
79
+ <div
80
+ data-slot="form-item"
81
+ className={cn("grid gap-2", className)}
82
+ {...props}
83
+ />
84
+ </FormItemContext.Provider>
85
+ )
86
+ }
87
+
88
+ function FormLabel({
89
+ className,
90
+ ...props
91
+ }: React.ComponentProps<typeof LabelPrimitive.Root>) {
92
+ const { error, formItemId } = useFormField()
93
+
94
+ return (
95
+ <Label
96
+ data-slot="form-label"
97
+ data-error={!!error}
98
+ className={cn("data-[error=true]:text-destructive", className)}
99
+ htmlFor={formItemId}
100
+ {...props}
101
+ />
102
+ )
103
+ }
104
+
105
+ function FormControl({ ...props }: React.ComponentProps<typeof Slot>) {
106
+ const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
107
+
108
+ return (
109
+ <Slot
110
+ data-slot="form-control"
111
+ id={formItemId}
112
+ aria-describedby={
113
+ !error
114
+ ? `${formDescriptionId}`
115
+ : `${formDescriptionId} ${formMessageId}`
116
+ }
117
+ aria-invalid={!!error}
118
+ {...props}
119
+ />
120
+ )
121
+ }
122
+
123
+ function FormDescription({ className, ...props }: React.ComponentProps<"p">) {
124
+ const { formDescriptionId } = useFormField()
125
+
126
+ return (
127
+ <p
128
+ data-slot="form-description"
129
+ id={formDescriptionId}
130
+ className={cn("text-muted-foreground text-sm", className)}
131
+ {...props}
132
+ />
133
+ )
134
+ }
135
+
136
+ function FormMessage({ className, ...props }: React.ComponentProps<"p">) {
137
+ const { error, formMessageId } = useFormField()
138
+ const body = error ? String(error?.message ?? "") : props.children
139
+
140
+ if (!body) {
141
+ return null
142
+ }
143
+
144
+ return (
145
+ <p
146
+ data-slot="form-message"
147
+ id={formMessageId}
148
+ className={cn("text-destructive text-sm", className)}
149
+ {...props}
150
+ >
151
+ {body}
152
+ </p>
153
+ )
154
+ }
155
+
156
+ export {
157
+ useFormField,
158
+ Form,
159
+ FormItem,
160
+ FormLabel,
161
+ FormControl,
162
+ FormDescription,
163
+ FormMessage,
164
+ FormField,
165
+ }
@@ -0,0 +1,42 @@
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
+ function HoverCard({
7
+ ...props
8
+ }: React.ComponentProps<typeof HoverCardPrimitive.Root>) {
9
+ return <HoverCardPrimitive.Root data-slot="hover-card" {...props} />
10
+ }
11
+
12
+ function HoverCardTrigger({
13
+ ...props
14
+ }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {
15
+ return (
16
+ <HoverCardPrimitive.Trigger data-slot="hover-card-trigger" {...props} />
17
+ )
18
+ }
19
+
20
+ function HoverCardContent({
21
+ className,
22
+ align = "center",
23
+ sideOffset = 4,
24
+ ...props
25
+ }: React.ComponentProps<typeof HoverCardPrimitive.Content>) {
26
+ return (
27
+ <HoverCardPrimitive.Portal data-slot="hover-card-portal">
28
+ <HoverCardPrimitive.Content
29
+ data-slot="hover-card-content"
30
+ align={align}
31
+ sideOffset={sideOffset}
32
+ className={cn(
33
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
34
+ className
35
+ )}
36
+ {...props}
37
+ />
38
+ </HoverCardPrimitive.Portal>
39
+ )
40
+ }
41
+
42
+ export { HoverCard, HoverCardTrigger, HoverCardContent }
@@ -0,0 +1,21 @@
1
+ import * as React from "react"
2
+
3
+ import { cn } from "@/lib/utils"
4
+
5
+ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
6
+ return (
7
+ <input
8
+ type={type}
9
+ data-slot="input"
10
+ className={cn(
11
+ "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
12
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
13
+ "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
14
+ className
15
+ )}
16
+ {...props}
17
+ />
18
+ )
19
+ }
20
+
21
+ export { Input }
@@ -0,0 +1,24 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as LabelPrimitive from "@radix-ui/react-label"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ function Label({
9
+ className,
10
+ ...props
11
+ }: React.ComponentProps<typeof LabelPrimitive.Root>) {
12
+ return (
13
+ <LabelPrimitive.Root
14
+ data-slot="label"
15
+ className={cn(
16
+ "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
17
+ className
18
+ )}
19
+ {...props}
20
+ />
21
+ )
22
+ }
23
+
24
+ export { Label }