howone 0.0.3 → 0.0.6
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/package.json +1 -1
- package/templates/nextjs/.prettierignore +7 -0
- package/templates/nextjs/.prettierrc +11 -0
- package/templates/nextjs/README.md +12 -27
- package/templates/nextjs/app/globals.css +123 -40
- package/templates/nextjs/app/layout.tsx +19 -19
- package/templates/nextjs/app/page.tsx +13 -60
- package/templates/nextjs/bun.lock +925 -53
- package/templates/nextjs/components/.gitkeep +0 -0
- package/templates/nextjs/components/theme-provider.tsx +71 -0
- package/templates/nextjs/components/ui/accordion.tsx +81 -0
- package/templates/nextjs/components/ui/alert-dialog.tsx +199 -0
- package/templates/nextjs/components/ui/alert.tsx +76 -0
- package/templates/nextjs/components/ui/aspect-ratio.tsx +11 -0
- package/templates/nextjs/components/ui/avatar.tsx +112 -0
- package/templates/nextjs/components/ui/badge.tsx +49 -0
- package/templates/nextjs/components/ui/breadcrumb.tsx +122 -0
- package/templates/nextjs/components/ui/button-group.tsx +83 -0
- package/templates/nextjs/components/ui/button.tsx +67 -0
- package/templates/nextjs/components/ui/calendar.tsx +222 -0
- package/templates/nextjs/components/ui/card.tsx +103 -0
- package/templates/nextjs/components/ui/carousel.tsx +242 -0
- package/templates/nextjs/components/ui/chart.tsx +373 -0
- package/templates/nextjs/components/ui/checkbox.tsx +33 -0
- package/templates/nextjs/components/ui/collapsible.tsx +33 -0
- package/templates/nextjs/components/ui/combobox.tsx +299 -0
- package/templates/nextjs/components/ui/command.tsx +195 -0
- package/templates/nextjs/components/ui/context-menu.tsx +263 -0
- package/templates/nextjs/components/ui/dialog.tsx +168 -0
- package/templates/nextjs/components/ui/direction.tsx +22 -0
- package/templates/nextjs/components/ui/drawer.tsx +134 -0
- package/templates/nextjs/components/ui/dropdown-menu.tsx +269 -0
- package/templates/nextjs/components/ui/empty.tsx +104 -0
- package/templates/nextjs/components/ui/field.tsx +238 -0
- package/templates/nextjs/components/ui/hover-card.tsx +44 -0
- package/templates/nextjs/components/ui/input-group.tsx +156 -0
- package/templates/nextjs/components/ui/input-otp.tsx +87 -0
- package/templates/nextjs/components/ui/input.tsx +19 -0
- package/templates/nextjs/components/ui/item.tsx +196 -0
- package/templates/nextjs/components/ui/kbd.tsx +26 -0
- package/templates/nextjs/components/ui/label.tsx +24 -0
- package/templates/nextjs/components/ui/menubar.tsx +280 -0
- package/templates/nextjs/components/ui/native-select.tsx +61 -0
- package/templates/nextjs/components/ui/navigation-menu.tsx +164 -0
- package/templates/nextjs/components/ui/pagination.tsx +129 -0
- package/templates/nextjs/components/ui/popover.tsx +89 -0
- package/templates/nextjs/components/ui/progress.tsx +31 -0
- package/templates/nextjs/components/ui/radio-group.tsx +44 -0
- package/templates/nextjs/components/ui/resizable.tsx +50 -0
- package/templates/nextjs/components/ui/scroll-area.tsx +55 -0
- package/templates/nextjs/components/ui/select.tsx +192 -0
- package/templates/nextjs/components/ui/separator.tsx +28 -0
- package/templates/nextjs/components/ui/sheet.tsx +147 -0
- package/templates/nextjs/components/ui/sidebar.tsx +702 -0
- package/templates/nextjs/components/ui/skeleton.tsx +13 -0
- package/templates/nextjs/components/ui/slider.tsx +59 -0
- package/templates/nextjs/components/ui/sonner.tsx +49 -0
- package/templates/nextjs/components/ui/spinner.tsx +10 -0
- package/templates/nextjs/components/ui/switch.tsx +33 -0
- package/templates/nextjs/components/ui/table.tsx +116 -0
- package/templates/nextjs/components/ui/tabs.tsx +90 -0
- package/templates/nextjs/components/ui/textarea.tsx +18 -0
- package/templates/nextjs/components/ui/toggle-group.tsx +89 -0
- package/templates/nextjs/components/ui/toggle.tsx +47 -0
- package/templates/nextjs/components/ui/tooltip.tsx +57 -0
- package/templates/nextjs/components.json +25 -0
- package/templates/nextjs/hooks/.gitkeep +0 -0
- package/templates/nextjs/hooks/use-mobile.ts +19 -0
- package/templates/nextjs/lib/.gitkeep +0 -0
- package/templates/nextjs/lib/sdk.ts +7 -0
- package/templates/nextjs/lib/utils.ts +6 -0
- package/templates/nextjs/next.config.mjs +4 -0
- package/templates/vite/.prettierignore +7 -0
- package/templates/vite/.prettierrc +11 -0
- package/templates/vite/AGENTS.md +0 -0
- package/templates/vite/README.md +12 -64
- package/templates/vite/bun.lock +1478 -0
- package/templates/vite/components.json +25 -0
- package/templates/vite/eslint.config.js +1 -0
- package/templates/vite/index.html +2 -2
- package/templates/vite/package.json +39 -13
- package/templates/vite/public/vite.svg +1 -0
- package/templates/vite/src/App.tsx +6 -115
- package/templates/vite/src/components/theme-provider.tsx +230 -0
- package/templates/vite/src/components/ui/accordion.tsx +79 -0
- package/templates/vite/src/components/ui/alert-dialog.tsx +197 -0
- package/templates/vite/src/components/ui/alert.tsx +76 -0
- package/templates/vite/src/components/ui/aspect-ratio.tsx +11 -0
- package/templates/vite/src/components/ui/avatar.tsx +110 -0
- package/templates/vite/src/components/ui/badge.tsx +49 -0
- package/templates/vite/src/components/ui/breadcrumb.tsx +122 -0
- package/templates/vite/src/components/ui/button-group.tsx +83 -0
- package/templates/vite/src/components/ui/button.tsx +67 -0
- package/templates/vite/src/components/ui/calendar.tsx +222 -0
- package/templates/vite/src/components/ui/card.tsx +103 -0
- package/templates/vite/src/components/ui/carousel.tsx +240 -0
- package/templates/vite/src/components/ui/chart.tsx +373 -0
- package/templates/vite/src/components/ui/checkbox.tsx +31 -0
- package/templates/vite/src/components/ui/collapsible.tsx +33 -0
- package/templates/vite/src/components/ui/combobox.tsx +299 -0
- package/templates/vite/src/components/ui/command.tsx +193 -0
- package/templates/vite/src/components/ui/context-menu.tsx +261 -0
- package/templates/vite/src/components/ui/dialog.tsx +168 -0
- package/templates/vite/src/components/ui/direction.tsx +22 -0
- package/templates/vite/src/components/ui/drawer.tsx +132 -0
- package/templates/vite/src/components/ui/dropdown-menu.tsx +269 -0
- package/templates/vite/src/components/ui/empty.tsx +104 -0
- package/templates/vite/src/components/ui/field.tsx +238 -0
- package/templates/vite/src/components/ui/hover-card.tsx +42 -0
- package/templates/vite/src/components/ui/input-group.tsx +154 -0
- package/templates/vite/src/components/ui/input-otp.tsx +87 -0
- package/templates/vite/src/components/ui/input.tsx +19 -0
- package/templates/vite/src/components/ui/item.tsx +196 -0
- package/templates/vite/src/components/ui/kbd.tsx +26 -0
- package/templates/vite/src/components/ui/label.tsx +22 -0
- package/templates/vite/src/components/ui/menubar.tsx +280 -0
- package/templates/vite/src/components/ui/native-select.tsx +61 -0
- package/templates/vite/src/components/ui/navigation-menu.tsx +164 -0
- package/templates/vite/src/components/ui/pagination.tsx +129 -0
- package/templates/vite/src/components/ui/popover.tsx +87 -0
- package/templates/vite/src/components/ui/progress.tsx +31 -0
- package/templates/vite/src/components/ui/radio-group.tsx +42 -0
- package/templates/vite/src/components/ui/resizable.tsx +50 -0
- package/templates/vite/src/components/ui/scroll-area.tsx +53 -0
- package/templates/vite/src/components/ui/select.tsx +192 -0
- package/templates/vite/src/components/ui/separator.tsx +26 -0
- package/templates/vite/src/components/ui/sheet.tsx +145 -0
- package/templates/vite/src/components/ui/sidebar.tsx +700 -0
- package/templates/vite/src/components/ui/skeleton.tsx +13 -0
- package/templates/vite/src/components/ui/slider.tsx +59 -0
- package/templates/vite/src/components/ui/sonner.tsx +47 -0
- package/templates/vite/src/components/ui/spinner.tsx +10 -0
- package/templates/vite/src/components/ui/switch.tsx +33 -0
- package/templates/vite/src/components/ui/table.tsx +114 -0
- package/templates/vite/src/components/ui/tabs.tsx +90 -0
- package/templates/vite/src/components/ui/textarea.tsx +18 -0
- package/templates/vite/src/components/ui/toggle-group.tsx +89 -0
- package/templates/vite/src/components/ui/toggle.tsx +45 -0
- package/templates/vite/src/components/ui/tooltip.tsx +57 -0
- package/templates/vite/src/hooks/use-mobile.ts +19 -0
- package/templates/vite/src/index.css +125 -103
- package/templates/vite/src/lib/sdk.ts +7 -0
- package/templates/vite/src/lib/utils.ts +6 -0
- package/templates/vite/src/main.tsx +11 -7
- package/templates/vite/tsconfig.app.json +11 -4
- package/templates/vite/tsconfig.json +7 -1
- package/templates/vite/tsconfig.node.json +5 -3
- package/templates/vite/vite.config.ts +10 -3
- package/templates/nextjs/AGENTS.md +0 -5
- package/templates/nextjs/CLAUDE.md +0 -1
- package/templates/nextjs/app/page.module.css +0 -142
- package/templates/nextjs/gitignore +0 -41
- package/templates/nextjs/next-env.d.ts +0 -6
- package/templates/nextjs/next.config.ts +0 -7
- package/templates/nextjs/package.json +0 -32
- package/templates/nextjs/public/file.svg +0 -1
- package/templates/nextjs/public/globe.svg +0 -1
- package/templates/nextjs/public/next.svg +0 -1
- package/templates/nextjs/public/vercel.svg +0 -1
- package/templates/nextjs/public/window.svg +0 -1
- package/templates/nextjs/tsconfig.json +0 -34
- package/templates/vite/gitignore +0 -24
- package/templates/vite/public/favicon.svg +0 -1
- package/templates/vite/public/icons.svg +0 -24
- package/templates/vite/src/App.css +0 -184
- package/templates/vite/src/assets/hero.png +0 -0
- package/templates/vite/src/assets/vite.svg +0 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Popover as PopoverPrimitive } from "radix-ui"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
|
|
6
|
+
function Popover({
|
|
7
|
+
...props
|
|
8
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Root>) {
|
|
9
|
+
return <PopoverPrimitive.Root data-slot="popover" {...props} />
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function PopoverTrigger({
|
|
13
|
+
...props
|
|
14
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
|
|
15
|
+
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function PopoverContent({
|
|
19
|
+
className,
|
|
20
|
+
align = "center",
|
|
21
|
+
sideOffset = 4,
|
|
22
|
+
...props
|
|
23
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
|
|
24
|
+
return (
|
|
25
|
+
<PopoverPrimitive.Portal>
|
|
26
|
+
<PopoverPrimitive.Content
|
|
27
|
+
data-slot="popover-content"
|
|
28
|
+
align={align}
|
|
29
|
+
sideOffset={sideOffset}
|
|
30
|
+
className={cn(
|
|
31
|
+
"z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
32
|
+
className
|
|
33
|
+
)}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
</PopoverPrimitive.Portal>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function PopoverAnchor({
|
|
41
|
+
...props
|
|
42
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
|
|
43
|
+
return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
47
|
+
return (
|
|
48
|
+
<div
|
|
49
|
+
data-slot="popover-header"
|
|
50
|
+
className={cn("flex flex-col gap-0.5 text-sm", className)}
|
|
51
|
+
{...props}
|
|
52
|
+
/>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">) {
|
|
57
|
+
return (
|
|
58
|
+
<div
|
|
59
|
+
data-slot="popover-title"
|
|
60
|
+
className={cn("font-medium", className)}
|
|
61
|
+
{...props}
|
|
62
|
+
/>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function PopoverDescription({
|
|
67
|
+
className,
|
|
68
|
+
...props
|
|
69
|
+
}: React.ComponentProps<"p">) {
|
|
70
|
+
return (
|
|
71
|
+
<p
|
|
72
|
+
data-slot="popover-description"
|
|
73
|
+
className={cn("text-muted-foreground", className)}
|
|
74
|
+
{...props}
|
|
75
|
+
/>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export {
|
|
80
|
+
Popover,
|
|
81
|
+
PopoverAnchor,
|
|
82
|
+
PopoverContent,
|
|
83
|
+
PopoverDescription,
|
|
84
|
+
PopoverHeader,
|
|
85
|
+
PopoverTitle,
|
|
86
|
+
PopoverTrigger,
|
|
87
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Progress as ProgressPrimitive } from "radix-ui"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
function Progress({
|
|
9
|
+
className,
|
|
10
|
+
value,
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof ProgressPrimitive.Root>) {
|
|
13
|
+
return (
|
|
14
|
+
<ProgressPrimitive.Root
|
|
15
|
+
data-slot="progress"
|
|
16
|
+
className={cn(
|
|
17
|
+
"relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...props}
|
|
21
|
+
>
|
|
22
|
+
<ProgressPrimitive.Indicator
|
|
23
|
+
data-slot="progress-indicator"
|
|
24
|
+
className="size-full flex-1 bg-primary transition-all"
|
|
25
|
+
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
|
|
26
|
+
/>
|
|
27
|
+
</ProgressPrimitive.Root>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { Progress }
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { RadioGroup as RadioGroupPrimitive } from "radix-ui"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
|
|
6
|
+
function RadioGroup({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
|
|
10
|
+
return (
|
|
11
|
+
<RadioGroupPrimitive.Root
|
|
12
|
+
data-slot="radio-group"
|
|
13
|
+
className={cn("grid w-full gap-2", className)}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function RadioGroupItem({
|
|
20
|
+
className,
|
|
21
|
+
...props
|
|
22
|
+
}: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
|
|
23
|
+
return (
|
|
24
|
+
<RadioGroupPrimitive.Item
|
|
25
|
+
data-slot="radio-group-item"
|
|
26
|
+
className={cn(
|
|
27
|
+
"group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",
|
|
28
|
+
className
|
|
29
|
+
)}
|
|
30
|
+
{...props}
|
|
31
|
+
>
|
|
32
|
+
<RadioGroupPrimitive.Indicator
|
|
33
|
+
data-slot="radio-group-indicator"
|
|
34
|
+
className="flex size-4 items-center justify-center"
|
|
35
|
+
>
|
|
36
|
+
<span className="absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground" />
|
|
37
|
+
</RadioGroupPrimitive.Indicator>
|
|
38
|
+
</RadioGroupPrimitive.Item>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { RadioGroup, RadioGroupItem }
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as ResizablePrimitive from "react-resizable-panels"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
|
|
7
|
+
function ResizablePanelGroup({
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}: ResizablePrimitive.GroupProps) {
|
|
11
|
+
return (
|
|
12
|
+
<ResizablePrimitive.Group
|
|
13
|
+
data-slot="resizable-panel-group"
|
|
14
|
+
className={cn(
|
|
15
|
+
"flex h-full w-full aria-[orientation=vertical]:flex-col",
|
|
16
|
+
className
|
|
17
|
+
)}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function ResizablePanel({ ...props }: ResizablePrimitive.PanelProps) {
|
|
24
|
+
return <ResizablePrimitive.Panel data-slot="resizable-panel" {...props} />
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function ResizableHandle({
|
|
28
|
+
withHandle,
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}: ResizablePrimitive.SeparatorProps & {
|
|
32
|
+
withHandle?: boolean
|
|
33
|
+
}) {
|
|
34
|
+
return (
|
|
35
|
+
<ResizablePrimitive.Separator
|
|
36
|
+
data-slot="resizable-handle"
|
|
37
|
+
className={cn(
|
|
38
|
+
"relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90",
|
|
39
|
+
className
|
|
40
|
+
)}
|
|
41
|
+
{...props}
|
|
42
|
+
>
|
|
43
|
+
{withHandle && (
|
|
44
|
+
<div className="z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border" />
|
|
45
|
+
)}
|
|
46
|
+
</ResizablePrimitive.Separator>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { ResizableHandle, ResizablePanel, ResizablePanelGroup }
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { ScrollArea as ScrollAreaPrimitive } from "radix-ui"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
|
|
6
|
+
function ScrollArea({
|
|
7
|
+
className,
|
|
8
|
+
children,
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
|
|
11
|
+
return (
|
|
12
|
+
<ScrollAreaPrimitive.Root
|
|
13
|
+
data-slot="scroll-area"
|
|
14
|
+
className={cn("relative", className)}
|
|
15
|
+
{...props}
|
|
16
|
+
>
|
|
17
|
+
<ScrollAreaPrimitive.Viewport
|
|
18
|
+
data-slot="scroll-area-viewport"
|
|
19
|
+
className="size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1"
|
|
20
|
+
>
|
|
21
|
+
{children}
|
|
22
|
+
</ScrollAreaPrimitive.Viewport>
|
|
23
|
+
<ScrollBar />
|
|
24
|
+
<ScrollAreaPrimitive.Corner />
|
|
25
|
+
</ScrollAreaPrimitive.Root>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function ScrollBar({
|
|
30
|
+
className,
|
|
31
|
+
orientation = "vertical",
|
|
32
|
+
...props
|
|
33
|
+
}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
|
|
34
|
+
return (
|
|
35
|
+
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
36
|
+
data-slot="scroll-area-scrollbar"
|
|
37
|
+
data-orientation={orientation}
|
|
38
|
+
orientation={orientation}
|
|
39
|
+
className={cn(
|
|
40
|
+
"flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent",
|
|
41
|
+
className
|
|
42
|
+
)}
|
|
43
|
+
{...props}
|
|
44
|
+
>
|
|
45
|
+
<ScrollAreaPrimitive.ScrollAreaThumb
|
|
46
|
+
data-slot="scroll-area-thumb"
|
|
47
|
+
className="relative flex-1 rounded-full bg-border"
|
|
48
|
+
/>
|
|
49
|
+
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { ScrollArea, ScrollBar }
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Select as SelectPrimitive } from "radix-ui"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-react"
|
|
8
|
+
|
|
9
|
+
function Select({
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
12
|
+
return <SelectPrimitive.Root data-slot="select" {...props} />
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function SelectGroup({
|
|
16
|
+
className,
|
|
17
|
+
...props
|
|
18
|
+
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
19
|
+
return (
|
|
20
|
+
<SelectPrimitive.Group
|
|
21
|
+
data-slot="select-group"
|
|
22
|
+
className={cn("scroll-my-1 p-1", className)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function SelectValue({
|
|
29
|
+
...props
|
|
30
|
+
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
31
|
+
return <SelectPrimitive.Value data-slot="select-value" {...props} />
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function SelectTrigger({
|
|
35
|
+
className,
|
|
36
|
+
size = "default",
|
|
37
|
+
children,
|
|
38
|
+
...props
|
|
39
|
+
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
40
|
+
size?: "sm" | "default"
|
|
41
|
+
}) {
|
|
42
|
+
return (
|
|
43
|
+
<SelectPrimitive.Trigger
|
|
44
|
+
data-slot="select-trigger"
|
|
45
|
+
data-size={size}
|
|
46
|
+
className={cn(
|
|
47
|
+
"flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
48
|
+
className
|
|
49
|
+
)}
|
|
50
|
+
{...props}
|
|
51
|
+
>
|
|
52
|
+
{children}
|
|
53
|
+
<SelectPrimitive.Icon asChild>
|
|
54
|
+
<ChevronDownIcon className="pointer-events-none size-4 text-muted-foreground" />
|
|
55
|
+
</SelectPrimitive.Icon>
|
|
56
|
+
</SelectPrimitive.Trigger>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function SelectContent({
|
|
61
|
+
className,
|
|
62
|
+
children,
|
|
63
|
+
position = "item-aligned",
|
|
64
|
+
align = "center",
|
|
65
|
+
...props
|
|
66
|
+
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
67
|
+
return (
|
|
68
|
+
<SelectPrimitive.Portal>
|
|
69
|
+
<SelectPrimitive.Content
|
|
70
|
+
data-slot="select-content"
|
|
71
|
+
data-align-trigger={position === "item-aligned"}
|
|
72
|
+
className={cn("relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", position ==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className )}
|
|
73
|
+
position={position}
|
|
74
|
+
align={align}
|
|
75
|
+
{...props}
|
|
76
|
+
>
|
|
77
|
+
<SelectScrollUpButton />
|
|
78
|
+
<SelectPrimitive.Viewport
|
|
79
|
+
data-position={position}
|
|
80
|
+
className={cn(
|
|
81
|
+
"data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)",
|
|
82
|
+
position === "popper" && ""
|
|
83
|
+
)}
|
|
84
|
+
>
|
|
85
|
+
{children}
|
|
86
|
+
</SelectPrimitive.Viewport>
|
|
87
|
+
<SelectScrollDownButton />
|
|
88
|
+
</SelectPrimitive.Content>
|
|
89
|
+
</SelectPrimitive.Portal>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function SelectLabel({
|
|
94
|
+
className,
|
|
95
|
+
...props
|
|
96
|
+
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
97
|
+
return (
|
|
98
|
+
<SelectPrimitive.Label
|
|
99
|
+
data-slot="select-label"
|
|
100
|
+
className={cn("px-1.5 py-1 text-xs text-muted-foreground", className)}
|
|
101
|
+
{...props}
|
|
102
|
+
/>
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function SelectItem({
|
|
107
|
+
className,
|
|
108
|
+
children,
|
|
109
|
+
...props
|
|
110
|
+
}: React.ComponentProps<typeof SelectPrimitive.Item>) {
|
|
111
|
+
return (
|
|
112
|
+
<SelectPrimitive.Item
|
|
113
|
+
data-slot="select-item"
|
|
114
|
+
className={cn(
|
|
115
|
+
"relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
116
|
+
className
|
|
117
|
+
)}
|
|
118
|
+
{...props}
|
|
119
|
+
>
|
|
120
|
+
<span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center">
|
|
121
|
+
<SelectPrimitive.ItemIndicator>
|
|
122
|
+
<CheckIcon className="pointer-events-none" />
|
|
123
|
+
</SelectPrimitive.ItemIndicator>
|
|
124
|
+
</span>
|
|
125
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
126
|
+
</SelectPrimitive.Item>
|
|
127
|
+
)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function SelectSeparator({
|
|
131
|
+
className,
|
|
132
|
+
...props
|
|
133
|
+
}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
|
|
134
|
+
return (
|
|
135
|
+
<SelectPrimitive.Separator
|
|
136
|
+
data-slot="select-separator"
|
|
137
|
+
className={cn("pointer-events-none -mx-1 my-1 h-px bg-border", className)}
|
|
138
|
+
{...props}
|
|
139
|
+
/>
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function SelectScrollUpButton({
|
|
144
|
+
className,
|
|
145
|
+
...props
|
|
146
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
|
|
147
|
+
return (
|
|
148
|
+
<SelectPrimitive.ScrollUpButton
|
|
149
|
+
data-slot="select-scroll-up-button"
|
|
150
|
+
className={cn(
|
|
151
|
+
"z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
|
|
152
|
+
className
|
|
153
|
+
)}
|
|
154
|
+
{...props}
|
|
155
|
+
>
|
|
156
|
+
<ChevronUpIcon
|
|
157
|
+
/>
|
|
158
|
+
</SelectPrimitive.ScrollUpButton>
|
|
159
|
+
)
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function SelectScrollDownButton({
|
|
163
|
+
className,
|
|
164
|
+
...props
|
|
165
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
|
|
166
|
+
return (
|
|
167
|
+
<SelectPrimitive.ScrollDownButton
|
|
168
|
+
data-slot="select-scroll-down-button"
|
|
169
|
+
className={cn(
|
|
170
|
+
"z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
|
|
171
|
+
className
|
|
172
|
+
)}
|
|
173
|
+
{...props}
|
|
174
|
+
>
|
|
175
|
+
<ChevronDownIcon
|
|
176
|
+
/>
|
|
177
|
+
</SelectPrimitive.ScrollDownButton>
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export {
|
|
182
|
+
Select,
|
|
183
|
+
SelectContent,
|
|
184
|
+
SelectGroup,
|
|
185
|
+
SelectItem,
|
|
186
|
+
SelectLabel,
|
|
187
|
+
SelectScrollDownButton,
|
|
188
|
+
SelectScrollUpButton,
|
|
189
|
+
SelectSeparator,
|
|
190
|
+
SelectTrigger,
|
|
191
|
+
SelectValue,
|
|
192
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Separator as SeparatorPrimitive } from "radix-ui"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
|
|
6
|
+
function Separator({
|
|
7
|
+
className,
|
|
8
|
+
orientation = "horizontal",
|
|
9
|
+
decorative = true,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
|
|
12
|
+
return (
|
|
13
|
+
<SeparatorPrimitive.Root
|
|
14
|
+
data-slot="separator"
|
|
15
|
+
decorative={decorative}
|
|
16
|
+
orientation={orientation}
|
|
17
|
+
className={cn(
|
|
18
|
+
"shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",
|
|
19
|
+
className
|
|
20
|
+
)}
|
|
21
|
+
{...props}
|
|
22
|
+
/>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { Separator }
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Dialog as SheetPrimitive } from "radix-ui"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
import { Button } from "@/components/ui/button"
|
|
6
|
+
import { XIcon } from "lucide-react"
|
|
7
|
+
|
|
8
|
+
function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
9
|
+
return <SheetPrimitive.Root data-slot="sheet" {...props} />
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function SheetTrigger({
|
|
13
|
+
...props
|
|
14
|
+
}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
|
|
15
|
+
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function SheetClose({
|
|
19
|
+
...props
|
|
20
|
+
}: React.ComponentProps<typeof SheetPrimitive.Close>) {
|
|
21
|
+
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function SheetPortal({
|
|
25
|
+
...props
|
|
26
|
+
}: React.ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
27
|
+
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function SheetOverlay({
|
|
31
|
+
className,
|
|
32
|
+
...props
|
|
33
|
+
}: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
|
|
34
|
+
return (
|
|
35
|
+
<SheetPrimitive.Overlay
|
|
36
|
+
data-slot="sheet-overlay"
|
|
37
|
+
className={cn(
|
|
38
|
+
"fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
39
|
+
className
|
|
40
|
+
)}
|
|
41
|
+
{...props}
|
|
42
|
+
/>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function SheetContent({
|
|
47
|
+
className,
|
|
48
|
+
children,
|
|
49
|
+
side = "right",
|
|
50
|
+
showCloseButton = true,
|
|
51
|
+
...props
|
|
52
|
+
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
53
|
+
side?: "top" | "right" | "bottom" | "left"
|
|
54
|
+
showCloseButton?: boolean
|
|
55
|
+
}) {
|
|
56
|
+
return (
|
|
57
|
+
<SheetPortal>
|
|
58
|
+
<SheetOverlay />
|
|
59
|
+
<SheetPrimitive.Content
|
|
60
|
+
data-slot="sheet-content"
|
|
61
|
+
data-side={side}
|
|
62
|
+
className={cn(
|
|
63
|
+
"fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10",
|
|
64
|
+
className
|
|
65
|
+
)}
|
|
66
|
+
{...props}
|
|
67
|
+
>
|
|
68
|
+
{children}
|
|
69
|
+
{showCloseButton && (
|
|
70
|
+
<SheetPrimitive.Close data-slot="sheet-close" asChild>
|
|
71
|
+
<Button
|
|
72
|
+
variant="ghost"
|
|
73
|
+
className="absolute top-3 right-3"
|
|
74
|
+
size="icon-sm"
|
|
75
|
+
>
|
|
76
|
+
<XIcon
|
|
77
|
+
/>
|
|
78
|
+
<span className="sr-only">Close</span>
|
|
79
|
+
</Button>
|
|
80
|
+
</SheetPrimitive.Close>
|
|
81
|
+
)}
|
|
82
|
+
</SheetPrimitive.Content>
|
|
83
|
+
</SheetPortal>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
88
|
+
return (
|
|
89
|
+
<div
|
|
90
|
+
data-slot="sheet-header"
|
|
91
|
+
className={cn("flex flex-col gap-0.5 p-4", className)}
|
|
92
|
+
{...props}
|
|
93
|
+
/>
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
98
|
+
return (
|
|
99
|
+
<div
|
|
100
|
+
data-slot="sheet-footer"
|
|
101
|
+
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
102
|
+
{...props}
|
|
103
|
+
/>
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function SheetTitle({
|
|
108
|
+
className,
|
|
109
|
+
...props
|
|
110
|
+
}: React.ComponentProps<typeof SheetPrimitive.Title>) {
|
|
111
|
+
return (
|
|
112
|
+
<SheetPrimitive.Title
|
|
113
|
+
data-slot="sheet-title"
|
|
114
|
+
className={cn(
|
|
115
|
+
"font-heading text-base font-medium text-foreground",
|
|
116
|
+
className
|
|
117
|
+
)}
|
|
118
|
+
{...props}
|
|
119
|
+
/>
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function SheetDescription({
|
|
124
|
+
className,
|
|
125
|
+
...props
|
|
126
|
+
}: React.ComponentProps<typeof SheetPrimitive.Description>) {
|
|
127
|
+
return (
|
|
128
|
+
<SheetPrimitive.Description
|
|
129
|
+
data-slot="sheet-description"
|
|
130
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
131
|
+
{...props}
|
|
132
|
+
/>
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export {
|
|
137
|
+
Sheet,
|
|
138
|
+
SheetTrigger,
|
|
139
|
+
SheetClose,
|
|
140
|
+
SheetContent,
|
|
141
|
+
SheetHeader,
|
|
142
|
+
SheetFooter,
|
|
143
|
+
SheetTitle,
|
|
144
|
+
SheetDescription,
|
|
145
|
+
}
|