ui-arreya-components 0.0.15 → 0.1.2
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.
- package/dist/index.d.mts +342 -0
- package/dist/index.d.ts +342 -0
- package/dist/index.js +1682 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1495 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +61 -106
- package/.storybook/main.ts +0 -18
- package/.storybook/preview.ts +0 -16
- package/.storybook/vitest.setup.ts +0 -9
- package/README.md +0 -54
- package/components.json +0 -21
- package/dist/styles.css +0 -3
- package/dist/ui.cjs.js +0 -119
- package/dist/ui.es.js +0 -7364
- package/dist/ui.umd.js +0 -119
- package/eslint.config.js +0 -28
- package/postcss.config.js +0 -6
- package/scripts/template.sh +0 -57
- package/src/components/feature/header.stories.tsx +0 -129
- package/src/components/feature/header.tsx +0 -78
- package/src/components/feature/login-form.stories.tsx +0 -35
- package/src/components/feature/login-form.tsx +0 -97
- package/src/components/index.ts +0 -1
- package/src/components/ui/accordion.stories.tsx.disabled +0 -36
- package/src/components/ui/accordion.tsx +0 -55
- package/src/components/ui/alert-dialog.stories.tsx +0 -46
- package/src/components/ui/alert-dialog.tsx +0 -139
- package/src/components/ui/alert.stories.tsx +0 -45
- package/src/components/ui/alert.tsx +0 -59
- package/src/components/ui/aspect-ratio.stories.tsx +0 -24
- package/src/components/ui/aspect-ratio.tsx +0 -5
- package/src/components/ui/avatar.stories.tsx +0 -29
- package/src/components/ui/avatar.tsx +0 -48
- package/src/components/ui/badge.stories.tsx +0 -43
- package/src/components/ui/badge.tsx +0 -36
- package/src/components/ui/breadcrumb.stories.tsx +0 -146
- package/src/components/ui/breadcrumb.tsx +0 -115
- package/src/components/ui/button.stories.tsx +0 -87
- package/src/components/ui/button.tsx +0 -57
- package/src/components/ui/card.stories.tsx +0 -99
- package/src/components/ui/card.tsx +0 -76
- package/src/components/ui/carousel.stories.tsx +0 -47
- package/src/components/ui/carousel.tsx +0 -260
- package/src/components/ui/chart.stories.tsx.disabled +0 -44
- package/src/components/ui/chart.tsx +0 -363
- package/src/components/ui/checkbox.stories.tsx +0 -56
- package/src/components/ui/checkbox.tsx +0 -28
- package/src/components/ui/collapsible.stories.tsx +0 -58
- package/src/components/ui/collapsible.tsx +0 -9
- package/src/components/ui/context-menu.stories.tsx +0 -34
- package/src/components/ui/context-menu.tsx +0 -198
- package/src/components/ui/dialog.stories.tsx +0 -40
- package/src/components/ui/dialog.tsx +0 -120
- package/src/components/ui/drawer.stories.tsx +0 -48
- package/src/components/ui/drawer.tsx +0 -116
- package/src/components/ui/dropdown-menu.stories.tsx +0 -92
- package/src/components/ui/dropdown-menu.tsx +0 -199
- package/src/components/ui/form.tsx +0 -176
- package/src/components/ui/hover-card.stories.tsx +0 -31
- package/src/components/ui/hover-card.tsx +0 -27
- package/src/components/ui/index.ts +0 -1
- package/src/components/ui/input-otp.tsx +0 -69
- package/src/components/ui/input.stories.tsx +0 -63
- package/src/components/ui/input.tsx +0 -22
- package/src/components/ui/label.tsx +0 -24
- package/src/components/ui/menubar.tsx +0 -254
- package/src/components/ui/navigation-menu.tsx +0 -128
- package/src/components/ui/pagination.tsx +0 -117
- package/src/components/ui/popover.tsx +0 -31
- package/src/components/ui/progress.tsx +0 -26
- package/src/components/ui/radio-group.tsx +0 -42
- package/src/components/ui/resizable.tsx +0 -43
- package/src/components/ui/scroll-area.tsx +0 -46
- package/src/components/ui/select.tsx +0 -157
- package/src/components/ui/separator.tsx +0 -29
- package/src/components/ui/sheet.tsx +0 -140
- package/src/components/ui/sidebar.tsx +0 -771
- package/src/components/ui/skeleton.tsx +0 -15
- package/src/components/ui/slider.tsx +0 -26
- package/src/components/ui/sonner.tsx +0 -29
- package/src/components/ui/switch.tsx +0 -27
- package/src/components/ui/table.tsx +0 -120
- package/src/components/ui/tabs.tsx +0 -53
- package/src/components/ui/textarea.tsx +0 -22
- package/src/components/ui/toast.tsx +0 -127
- package/src/components/ui/toaster.tsx +0 -33
- package/src/components/ui/toggle-group.tsx +0 -59
- package/src/components/ui/toggle.tsx +0 -43
- package/src/components/ui/tooltip.tsx +0 -30
- package/src/hooks/use-mobile.tsx +0 -19
- package/src/hooks/use-toast.ts +0 -194
- package/src/index.css +0 -3509
- package/src/index.ts +0 -51
- package/src/lib/types.ts +0 -5
- package/src/lib/utils.ts +0 -6
- package/src/styles/tailwind.css +0 -100
- package/tailwind.config.js +0 -96
- package/tsconfig.app.json +0 -30
- package/tsconfig.json +0 -13
- package/tsconfig.node.json +0 -24
- package/vite.config.ts +0 -33
- package/vitest.workspace.ts +0 -32
|
@@ -1,199 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,176 +0,0 @@
|
|
|
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>(
|
|
26
|
-
{} as FormFieldContextValue
|
|
27
|
-
)
|
|
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
|
-
const fieldState = getFieldState(fieldContext.name, formState)
|
|
48
|
-
|
|
49
|
-
if (!fieldContext) {
|
|
50
|
-
throw new Error("useFormField should be used within <FormField>")
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const { id } = itemContext
|
|
54
|
-
|
|
55
|
-
return {
|
|
56
|
-
id,
|
|
57
|
-
name: fieldContext.name,
|
|
58
|
-
formItemId: `${id}-form-item`,
|
|
59
|
-
formDescriptionId: `${id}-form-item-description`,
|
|
60
|
-
formMessageId: `${id}-form-item-message`,
|
|
61
|
-
...fieldState,
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
type FormItemContextValue = {
|
|
66
|
-
id: string
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const FormItemContext = React.createContext<FormItemContextValue>(
|
|
70
|
-
{} as FormItemContextValue
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
const FormItem = React.forwardRef<
|
|
74
|
-
HTMLDivElement,
|
|
75
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
76
|
-
>(({ className, ...props }, ref) => {
|
|
77
|
-
const id = React.useId()
|
|
78
|
-
|
|
79
|
-
return (
|
|
80
|
-
<FormItemContext.Provider value={{ id }}>
|
|
81
|
-
<div ref={ref} className={cn("space-y-2", className)} {...props} />
|
|
82
|
-
</FormItemContext.Provider>
|
|
83
|
-
)
|
|
84
|
-
})
|
|
85
|
-
FormItem.displayName = "FormItem"
|
|
86
|
-
|
|
87
|
-
const FormLabel = React.forwardRef<
|
|
88
|
-
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
89
|
-
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
|
|
90
|
-
>(({ className, ...props }, ref) => {
|
|
91
|
-
const { error, formItemId } = useFormField()
|
|
92
|
-
|
|
93
|
-
return (
|
|
94
|
-
<Label
|
|
95
|
-
ref={ref}
|
|
96
|
-
className={cn(error && "text-destructive", className)}
|
|
97
|
-
htmlFor={formItemId}
|
|
98
|
-
{...props}
|
|
99
|
-
/>
|
|
100
|
-
)
|
|
101
|
-
})
|
|
102
|
-
FormLabel.displayName = "FormLabel"
|
|
103
|
-
|
|
104
|
-
const FormControl = React.forwardRef<
|
|
105
|
-
React.ElementRef<typeof Slot>,
|
|
106
|
-
React.ComponentPropsWithoutRef<typeof Slot>
|
|
107
|
-
>(({ ...props }, ref) => {
|
|
108
|
-
const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
|
|
109
|
-
|
|
110
|
-
return (
|
|
111
|
-
<Slot
|
|
112
|
-
ref={ref}
|
|
113
|
-
id={formItemId}
|
|
114
|
-
aria-describedby={
|
|
115
|
-
!error
|
|
116
|
-
? `${formDescriptionId}`
|
|
117
|
-
: `${formDescriptionId} ${formMessageId}`
|
|
118
|
-
}
|
|
119
|
-
aria-invalid={!!error}
|
|
120
|
-
{...props}
|
|
121
|
-
/>
|
|
122
|
-
)
|
|
123
|
-
})
|
|
124
|
-
FormControl.displayName = "FormControl"
|
|
125
|
-
|
|
126
|
-
const FormDescription = React.forwardRef<
|
|
127
|
-
HTMLParagraphElement,
|
|
128
|
-
React.HTMLAttributes<HTMLParagraphElement>
|
|
129
|
-
>(({ className, ...props }, ref) => {
|
|
130
|
-
const { formDescriptionId } = useFormField()
|
|
131
|
-
|
|
132
|
-
return (
|
|
133
|
-
<p
|
|
134
|
-
ref={ref}
|
|
135
|
-
id={formDescriptionId}
|
|
136
|
-
className={cn("text-[0.8rem] text-muted-foreground", className)}
|
|
137
|
-
{...props}
|
|
138
|
-
/>
|
|
139
|
-
)
|
|
140
|
-
})
|
|
141
|
-
FormDescription.displayName = "FormDescription"
|
|
142
|
-
|
|
143
|
-
const FormMessage = React.forwardRef<
|
|
144
|
-
HTMLParagraphElement,
|
|
145
|
-
React.HTMLAttributes<HTMLParagraphElement>
|
|
146
|
-
>(({ className, children, ...props }, ref) => {
|
|
147
|
-
const { error, formMessageId } = useFormField()
|
|
148
|
-
const body = error ? String(error?.message ?? "") : children
|
|
149
|
-
|
|
150
|
-
if (!body) {
|
|
151
|
-
return null
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return (
|
|
155
|
-
<p
|
|
156
|
-
ref={ref}
|
|
157
|
-
id={formMessageId}
|
|
158
|
-
className={cn("text-[0.8rem] font-medium text-destructive", className)}
|
|
159
|
-
{...props}
|
|
160
|
-
>
|
|
161
|
-
{body}
|
|
162
|
-
</p>
|
|
163
|
-
)
|
|
164
|
-
})
|
|
165
|
-
FormMessage.displayName = "FormMessage"
|
|
166
|
-
|
|
167
|
-
export {
|
|
168
|
-
useFormField,
|
|
169
|
-
Form,
|
|
170
|
-
FormItem,
|
|
171
|
-
FormLabel,
|
|
172
|
-
FormControl,
|
|
173
|
-
FormDescription,
|
|
174
|
-
FormMessage,
|
|
175
|
-
FormField,
|
|
176
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react"
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
HoverCard,
|
|
5
|
-
HoverCardContent,
|
|
6
|
-
HoverCardTrigger,
|
|
7
|
-
} from "./hover-card"
|
|
8
|
-
|
|
9
|
-
const meta = {
|
|
10
|
-
title: "Components/HoverCard",
|
|
11
|
-
component: HoverCard,
|
|
12
|
-
parameters: {
|
|
13
|
-
layout: "centered",
|
|
14
|
-
},
|
|
15
|
-
tags: ["autodocs"],
|
|
16
|
-
} satisfies Meta<typeof HoverCard>
|
|
17
|
-
|
|
18
|
-
export default meta
|
|
19
|
-
type Story = StoryObj<typeof meta>
|
|
20
|
-
|
|
21
|
-
export const Default: Story = {
|
|
22
|
-
render: () => (
|
|
23
|
-
<HoverCard>
|
|
24
|
-
<HoverCardTrigger>Hover</HoverCardTrigger>
|
|
25
|
-
<HoverCardContent>
|
|
26
|
-
The React Framework – created and maintained by @vercel.
|
|
27
|
-
</HoverCardContent>
|
|
28
|
-
</HoverCard>
|
|
29
|
-
)
|
|
30
|
-
}
|
|
31
|
-
|
|
@@ -1,27 +0,0 @@
|
|
|
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 }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './accordion'
|
|
@@ -1,69 +0,0 @@
|
|
|
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 }
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react"
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
Input
|
|
5
|
-
} from "./input"
|
|
6
|
-
import {
|
|
7
|
-
Button
|
|
8
|
-
} from './button'
|
|
9
|
-
import {
|
|
10
|
-
Label
|
|
11
|
-
} from './label'
|
|
12
|
-
|
|
13
|
-
const meta = {
|
|
14
|
-
title: "Components/Input",
|
|
15
|
-
component: Input,
|
|
16
|
-
parameters: {
|
|
17
|
-
layout: "centered",
|
|
18
|
-
},
|
|
19
|
-
tags: ["autodocs"],
|
|
20
|
-
} satisfies Meta<typeof Input>
|
|
21
|
-
|
|
22
|
-
export default meta
|
|
23
|
-
type Story = StoryObj<typeof meta>
|
|
24
|
-
|
|
25
|
-
export const Default: Story = {
|
|
26
|
-
render: () => (
|
|
27
|
-
<Input type="email" placeholder="Email" />
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export const File: Story = {
|
|
32
|
-
render: () => (
|
|
33
|
-
<div className="grid w-full max-w-sm items-center gap-1.5">
|
|
34
|
-
<Label htmlFor="picture">Picture</Label>
|
|
35
|
-
<Input id="picture" type="file" />
|
|
36
|
-
</div>
|
|
37
|
-
)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export const Disabled: Story = {
|
|
41
|
-
render: () => (
|
|
42
|
-
<Input disabled type="email" placeholder="Email" />
|
|
43
|
-
)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export const WithLabel: Story = {
|
|
47
|
-
render: () => (
|
|
48
|
-
<div className="grid w-full max-w-sm items-center gap-1.5">
|
|
49
|
-
<Label htmlFor="email">Email</Label>
|
|
50
|
-
<Input type="email" id="email" placeholder="Email" />
|
|
51
|
-
</div>
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export const WithButton: Story = {
|
|
56
|
-
render: () => (
|
|
57
|
-
<div className="flex w-full max-w-sm items-center space-x-2">
|
|
58
|
-
<Input type="email" placeholder="Email" />
|
|
59
|
-
<Button type="submit">Subscribe</Button>
|
|
60
|
-
</div>
|
|
61
|
-
)
|
|
62
|
-
}
|
|
63
|
-
|
|
@@ -1,22 +0,0 @@
|
|
|
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 focus:border-[--primary] 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-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 }
|
|
@@ -1,24 +0,0 @@
|
|
|
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 }
|