ucode-agent 1.5.0 → 1.7.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.
- package/README.md +399 -327
- package/package.json +6 -1
- package/skills/ui-ux/SKILL.md +2 -2
- package/src/core/doctor.js +122 -0
- package/src/core/livelog.js +113 -0
- package/src/core/loop.js +2105 -1659
- package/src/core/provider.js +93 -10
- package/src/core/stuck.js +269 -0
- package/src/core/tests.js +86 -0
- package/src/tools/blocks.js +117 -0
- package/src/tools/browser.js +121 -59
- package/src/tools/cache.js +105 -0
- package/src/tools/deploy.js +283 -0
- package/src/tools/files.js +91 -8
- package/src/tools/index.js +634 -495
- package/src/tools/rename.js +157 -0
- package/src/tools/scaffold.js +85 -6
- package/src/tools/shell.js +799 -701
- package/src/tools/symbols.js +218 -0
- package/src/tools/types.js +179 -0
- package/src/ui/activity.js +203 -0
- package/src/ui/plain.js +22 -3
- package/src/ui/screen.js +65 -19
- package/src/ui/theme.js +5 -1
- package/templates/blocks/app-shell.tsx +81 -0
- package/templates/blocks/data-table.tsx +117 -0
- package/templates/blocks/empty-state.tsx +41 -0
- package/templates/blocks/page-header.tsx +27 -0
- package/templates/blocks/stat-cards.tsx +46 -0
- package/templates/next-shadcn/TEMPLATE.md +53 -9
- package/templates/next-shadcn/_package-lock.json +1335 -148
- package/templates/next-shadcn/components.json +1 -1
- package/templates/next-shadcn/next.config.ts +2 -1
- package/templates/next-shadcn/package.json +4 -2
- package/templates/next-shadcn/presets/citrus.json +77 -0
- package/templates/next-shadcn/presets/graphite.json +77 -0
- package/templates/next-shadcn/presets/grove.json +77 -0
- package/templates/next-shadcn/presets/ocean.json +78 -0
- package/templates/next-shadcn/presets/sunset.json +77 -0
- package/templates/next-shadcn/presets/violet.json +77 -0
- package/templates/next-shadcn/src/components/ui/accordion.tsx +80 -0
- package/templates/next-shadcn/src/components/ui/alert-dialog.tsx +34 -22
- package/templates/next-shadcn/src/components/ui/avatar.tsx +7 -4
- package/templates/next-shadcn/src/components/ui/badge.tsx +15 -18
- package/templates/next-shadcn/src/components/ui/button.tsx +12 -3
- package/templates/next-shadcn/src/components/ui/calendar.tsx +1 -0
- package/templates/next-shadcn/src/components/ui/checkbox.tsx +6 -2
- package/templates/next-shadcn/src/components/ui/collapsible.tsx +33 -0
- package/templates/next-shadcn/src/components/ui/command.tsx +1 -2
- package/templates/next-shadcn/src/components/ui/dialog.tsx +34 -26
- package/templates/next-shadcn/src/components/ui/dropdown-menu.tsx +115 -114
- package/templates/next-shadcn/src/components/ui/hover-card.tsx +43 -0
- package/templates/next-shadcn/src/components/ui/input-group.tsx +2 -4
- package/templates/next-shadcn/src/components/ui/input.tsx +1 -2
- package/templates/next-shadcn/src/components/ui/label.tsx +6 -2
- package/templates/next-shadcn/src/components/ui/popover.tsx +27 -28
- package/templates/next-shadcn/src/components/ui/progress.tsx +11 -63
- package/templates/next-shadcn/src/components/ui/radio-group.tsx +43 -0
- package/templates/next-shadcn/src/components/ui/scroll-area.tsx +6 -6
- package/templates/next-shadcn/src/components/ui/select.tsx +55 -64
- package/templates/next-shadcn/src/components/ui/separator.tsx +6 -3
- package/templates/next-shadcn/src/components/ui/sheet.tsx +35 -26
- package/templates/next-shadcn/src/components/ui/slider.tsx +58 -0
- package/templates/next-shadcn/src/components/ui/switch.tsx +3 -2
- package/templates/next-shadcn/src/components/ui/table.tsx +115 -0
- package/templates/next-shadcn/src/components/ui/tabs.tsx +16 -8
- package/templates/next-shadcn/src/components/ui/toggle-group.tsx +89 -0
- package/templates/next-shadcn/src/components/ui/toggle.tsx +46 -0
- package/templates/next-shadcn/src/components/ui/tooltip.tsx +24 -33
- package/templates/next-shadcn/src/lib/utils.ts +6 -1
- package/ucode.js +8 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
|
-
import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area"
|
|
5
4
|
import { cn } from "cn"
|
|
5
|
+
import { ScrollArea as ScrollAreaPrimitive } from "radix-ui"
|
|
6
6
|
|
|
7
7
|
function ScrollArea({
|
|
8
8
|
className,
|
|
9
9
|
children,
|
|
10
10
|
...props
|
|
11
|
-
}: ScrollAreaPrimitive.Root
|
|
11
|
+
}: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
|
|
12
12
|
return (
|
|
13
13
|
<ScrollAreaPrimitive.Root
|
|
14
14
|
data-slot="scroll-area"
|
|
@@ -31,9 +31,9 @@ function ScrollBar({
|
|
|
31
31
|
className,
|
|
32
32
|
orientation = "vertical",
|
|
33
33
|
...props
|
|
34
|
-
}: ScrollAreaPrimitive.
|
|
34
|
+
}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
|
|
35
35
|
return (
|
|
36
|
-
<ScrollAreaPrimitive.
|
|
36
|
+
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
37
37
|
data-slot="scroll-area-scrollbar"
|
|
38
38
|
data-orientation={orientation}
|
|
39
39
|
orientation={orientation}
|
|
@@ -43,11 +43,11 @@ function ScrollBar({
|
|
|
43
43
|
)}
|
|
44
44
|
{...props}
|
|
45
45
|
>
|
|
46
|
-
<ScrollAreaPrimitive.
|
|
46
|
+
<ScrollAreaPrimitive.ScrollAreaThumb
|
|
47
47
|
data-slot="scroll-area-thumb"
|
|
48
48
|
className="relative flex-1 rounded-full bg-border"
|
|
49
49
|
/>
|
|
50
|
-
</ScrollAreaPrimitive.
|
|
50
|
+
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
51
51
|
)
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
|
-
import { Select as SelectPrimitive } from "@base-ui/react/select"
|
|
5
4
|
import { cn } from "cn"
|
|
5
|
+
import { Select as SelectPrimitive } from "radix-ui"
|
|
6
6
|
import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-react"
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
function Select({
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
11
|
+
return <SelectPrimitive.Root data-slot="select" {...props} />
|
|
12
|
+
}
|
|
9
13
|
|
|
10
|
-
function SelectGroup({
|
|
14
|
+
function SelectGroup({
|
|
15
|
+
className,
|
|
16
|
+
...props
|
|
17
|
+
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
11
18
|
return (
|
|
12
19
|
<SelectPrimitive.Group
|
|
13
20
|
data-slot="select-group"
|
|
@@ -17,14 +24,10 @@ function SelectGroup({ className, ...props }: SelectPrimitive.Group.Props) {
|
|
|
17
24
|
)
|
|
18
25
|
}
|
|
19
26
|
|
|
20
|
-
function SelectValue({
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
className={cn("flex flex-1 text-left", className)}
|
|
25
|
-
{...props}
|
|
26
|
-
/>
|
|
27
|
-
)
|
|
27
|
+
function SelectValue({
|
|
28
|
+
...props
|
|
29
|
+
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
30
|
+
return <SelectPrimitive.Value data-slot="select-value" {...props} />
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
function SelectTrigger({
|
|
@@ -32,7 +35,7 @@ function SelectTrigger({
|
|
|
32
35
|
size = "default",
|
|
33
36
|
children,
|
|
34
37
|
...props
|
|
35
|
-
}: SelectPrimitive.Trigger
|
|
38
|
+
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
36
39
|
size?: "sm" | "default"
|
|
37
40
|
}) {
|
|
38
41
|
return (
|
|
@@ -46,11 +49,9 @@ function SelectTrigger({
|
|
|
46
49
|
{...props}
|
|
47
50
|
>
|
|
48
51
|
{children}
|
|
49
|
-
<SelectPrimitive.Icon
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
/>
|
|
52
|
+
<SelectPrimitive.Icon asChild>
|
|
53
|
+
<ChevronDownIcon className="pointer-events-none size-4 text-muted-foreground" />
|
|
54
|
+
</SelectPrimitive.Icon>
|
|
54
55
|
</SelectPrimitive.Trigger>
|
|
55
56
|
)
|
|
56
57
|
}
|
|
@@ -58,38 +59,32 @@ function SelectTrigger({
|
|
|
58
59
|
function SelectContent({
|
|
59
60
|
className,
|
|
60
61
|
children,
|
|
61
|
-
|
|
62
|
-
sideOffset = 4,
|
|
62
|
+
position = "item-aligned",
|
|
63
63
|
align = "center",
|
|
64
|
-
alignOffset = 0,
|
|
65
|
-
alignItemWithTrigger = true,
|
|
66
64
|
...props
|
|
67
|
-
}: SelectPrimitive.
|
|
68
|
-
Pick<
|
|
69
|
-
SelectPrimitive.Positioner.Props,
|
|
70
|
-
"align" | "alignOffset" | "side" | "sideOffset" | "alignItemWithTrigger"
|
|
71
|
-
>) {
|
|
65
|
+
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
72
66
|
return (
|
|
73
67
|
<SelectPrimitive.Portal>
|
|
74
|
-
<SelectPrimitive.
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
<SelectPrimitive.Content
|
|
69
|
+
data-slot="select-content"
|
|
70
|
+
data-align-trigger={position === "item-aligned"}
|
|
71
|
+
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 )}
|
|
72
|
+
position={position}
|
|
77
73
|
align={align}
|
|
78
|
-
|
|
79
|
-
alignItemWithTrigger={alignItemWithTrigger}
|
|
80
|
-
className="isolate z-50"
|
|
74
|
+
{...props}
|
|
81
75
|
>
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
data-
|
|
85
|
-
className={cn(
|
|
86
|
-
|
|
76
|
+
<SelectScrollUpButton />
|
|
77
|
+
<SelectPrimitive.Viewport
|
|
78
|
+
data-position={position}
|
|
79
|
+
className={cn(
|
|
80
|
+
"data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)",
|
|
81
|
+
position === "popper" && ""
|
|
82
|
+
)}
|
|
87
83
|
>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
</SelectPrimitive.Positioner>
|
|
84
|
+
{children}
|
|
85
|
+
</SelectPrimitive.Viewport>
|
|
86
|
+
<SelectScrollDownButton />
|
|
87
|
+
</SelectPrimitive.Content>
|
|
93
88
|
</SelectPrimitive.Portal>
|
|
94
89
|
)
|
|
95
90
|
}
|
|
@@ -97,9 +92,9 @@ function SelectContent({
|
|
|
97
92
|
function SelectLabel({
|
|
98
93
|
className,
|
|
99
94
|
...props
|
|
100
|
-
}: SelectPrimitive.
|
|
95
|
+
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
101
96
|
return (
|
|
102
|
-
<SelectPrimitive.
|
|
97
|
+
<SelectPrimitive.Label
|
|
103
98
|
data-slot="select-label"
|
|
104
99
|
className={cn("px-1.5 py-1 text-xs text-muted-foreground", className)}
|
|
105
100
|
{...props}
|
|
@@ -111,7 +106,7 @@ function SelectItem({
|
|
|
111
106
|
className,
|
|
112
107
|
children,
|
|
113
108
|
...props
|
|
114
|
-
}: SelectPrimitive.Item
|
|
109
|
+
}: React.ComponentProps<typeof SelectPrimitive.Item>) {
|
|
115
110
|
return (
|
|
116
111
|
<SelectPrimitive.Item
|
|
117
112
|
data-slot="select-item"
|
|
@@ -121,16 +116,12 @@ function SelectItem({
|
|
|
121
116
|
)}
|
|
122
117
|
{...props}
|
|
123
118
|
>
|
|
124
|
-
<
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
>
|
|
132
|
-
<CheckIcon className="pointer-events-none" />
|
|
133
|
-
</SelectPrimitive.ItemIndicator>
|
|
119
|
+
<span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center">
|
|
120
|
+
<SelectPrimitive.ItemIndicator>
|
|
121
|
+
<CheckIcon className="pointer-events-none" />
|
|
122
|
+
</SelectPrimitive.ItemIndicator>
|
|
123
|
+
</span>
|
|
124
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
134
125
|
</SelectPrimitive.Item>
|
|
135
126
|
)
|
|
136
127
|
}
|
|
@@ -138,7 +129,7 @@ function SelectItem({
|
|
|
138
129
|
function SelectSeparator({
|
|
139
130
|
className,
|
|
140
131
|
...props
|
|
141
|
-
}: SelectPrimitive.Separator
|
|
132
|
+
}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
|
|
142
133
|
return (
|
|
143
134
|
<SelectPrimitive.Separator
|
|
144
135
|
data-slot="select-separator"
|
|
@@ -151,38 +142,38 @@ function SelectSeparator({
|
|
|
151
142
|
function SelectScrollUpButton({
|
|
152
143
|
className,
|
|
153
144
|
...props
|
|
154
|
-
}: React.ComponentProps<typeof SelectPrimitive.
|
|
145
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
|
|
155
146
|
return (
|
|
156
|
-
<SelectPrimitive.
|
|
147
|
+
<SelectPrimitive.ScrollUpButton
|
|
157
148
|
data-slot="select-scroll-up-button"
|
|
158
149
|
className={cn(
|
|
159
|
-
"
|
|
150
|
+
"z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
|
|
160
151
|
className
|
|
161
152
|
)}
|
|
162
153
|
{...props}
|
|
163
154
|
>
|
|
164
155
|
<ChevronUpIcon
|
|
165
156
|
/>
|
|
166
|
-
</SelectPrimitive.
|
|
157
|
+
</SelectPrimitive.ScrollUpButton>
|
|
167
158
|
)
|
|
168
159
|
}
|
|
169
160
|
|
|
170
161
|
function SelectScrollDownButton({
|
|
171
162
|
className,
|
|
172
163
|
...props
|
|
173
|
-
}: React.ComponentProps<typeof SelectPrimitive.
|
|
164
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
|
|
174
165
|
return (
|
|
175
|
-
<SelectPrimitive.
|
|
166
|
+
<SelectPrimitive.ScrollDownButton
|
|
176
167
|
data-slot="select-scroll-down-button"
|
|
177
168
|
className={cn(
|
|
178
|
-
"
|
|
169
|
+
"z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
|
|
179
170
|
className
|
|
180
171
|
)}
|
|
181
172
|
{...props}
|
|
182
173
|
>
|
|
183
174
|
<ChevronDownIcon
|
|
184
175
|
/>
|
|
185
|
-
</SelectPrimitive.
|
|
176
|
+
</SelectPrimitive.ScrollDownButton>
|
|
186
177
|
)
|
|
187
178
|
}
|
|
188
179
|
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import * as React from "react"
|
|
4
4
|
import { cn } from "cn"
|
|
5
|
+
import { Separator as SeparatorPrimitive } from "radix-ui"
|
|
5
6
|
|
|
6
7
|
function Separator({
|
|
7
8
|
className,
|
|
8
9
|
orientation = "horizontal",
|
|
10
|
+
decorative = true,
|
|
9
11
|
...props
|
|
10
|
-
}: SeparatorPrimitive.
|
|
12
|
+
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
|
|
11
13
|
return (
|
|
12
|
-
<SeparatorPrimitive
|
|
14
|
+
<SeparatorPrimitive.Root
|
|
13
15
|
data-slot="separator"
|
|
16
|
+
decorative={decorative}
|
|
14
17
|
orientation={orientation}
|
|
15
18
|
className={cn(
|
|
16
19
|
"shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",
|
|
@@ -1,34 +1,43 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
|
-
import { Dialog as SheetPrimitive } from "@base-ui/react/dialog"
|
|
5
4
|
import { cn } from "cn"
|
|
5
|
+
import { Dialog as SheetPrimitive } from "radix-ui"
|
|
6
6
|
|
|
7
7
|
import { Button } from "@/components/ui/button"
|
|
8
8
|
import { XIcon } from "lucide-react"
|
|
9
9
|
|
|
10
|
-
function Sheet({ ...props }: SheetPrimitive.Root
|
|
10
|
+
function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
11
11
|
return <SheetPrimitive.Root data-slot="sheet" {...props} />
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
function SheetTrigger({
|
|
14
|
+
function SheetTrigger({
|
|
15
|
+
...props
|
|
16
|
+
}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
|
|
15
17
|
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
function SheetClose({
|
|
20
|
+
function SheetClose({
|
|
21
|
+
...props
|
|
22
|
+
}: React.ComponentProps<typeof SheetPrimitive.Close>) {
|
|
19
23
|
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
|
|
20
24
|
}
|
|
21
25
|
|
|
22
|
-
function SheetPortal({
|
|
26
|
+
function SheetPortal({
|
|
27
|
+
...props
|
|
28
|
+
}: React.ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
23
29
|
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
|
|
24
30
|
}
|
|
25
31
|
|
|
26
|
-
function SheetOverlay({
|
|
32
|
+
function SheetOverlay({
|
|
33
|
+
className,
|
|
34
|
+
...props
|
|
35
|
+
}: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
|
|
27
36
|
return (
|
|
28
|
-
<SheetPrimitive.
|
|
37
|
+
<SheetPrimitive.Overlay
|
|
29
38
|
data-slot="sheet-overlay"
|
|
30
39
|
className={cn(
|
|
31
|
-
"fixed inset-0 z-50 bg-black/10
|
|
40
|
+
"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",
|
|
32
41
|
className
|
|
33
42
|
)}
|
|
34
43
|
{...props}
|
|
@@ -42,40 +51,37 @@ function SheetContent({
|
|
|
42
51
|
side = "right",
|
|
43
52
|
showCloseButton = true,
|
|
44
53
|
...props
|
|
45
|
-
}: SheetPrimitive.
|
|
54
|
+
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
46
55
|
side?: "top" | "right" | "bottom" | "left"
|
|
47
56
|
showCloseButton?: boolean
|
|
48
57
|
}) {
|
|
49
58
|
return (
|
|
50
59
|
<SheetPortal>
|
|
51
60
|
<SheetOverlay />
|
|
52
|
-
<SheetPrimitive.
|
|
61
|
+
<SheetPrimitive.Content
|
|
53
62
|
data-slot="sheet-content"
|
|
54
63
|
data-side={side}
|
|
55
64
|
className={cn(
|
|
56
|
-
"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-
|
|
65
|
+
"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",
|
|
57
66
|
className
|
|
58
67
|
)}
|
|
59
68
|
{...props}
|
|
60
69
|
>
|
|
61
70
|
{children}
|
|
62
71
|
{showCloseButton && (
|
|
63
|
-
<SheetPrimitive.Close
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
<SheetPrimitive.Close data-slot="sheet-close" asChild>
|
|
73
|
+
<Button
|
|
74
|
+
variant="ghost"
|
|
75
|
+
className="absolute top-3 right-3"
|
|
76
|
+
size="icon-sm"
|
|
77
|
+
>
|
|
78
|
+
<XIcon
|
|
70
79
|
/>
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
<XIcon
|
|
74
|
-
/>
|
|
75
|
-
<span className="sr-only">Close</span>
|
|
80
|
+
<span className="sr-only">Close</span>
|
|
81
|
+
</Button>
|
|
76
82
|
</SheetPrimitive.Close>
|
|
77
83
|
)}
|
|
78
|
-
</SheetPrimitive.
|
|
84
|
+
</SheetPrimitive.Content>
|
|
79
85
|
</SheetPortal>
|
|
80
86
|
)
|
|
81
87
|
}
|
|
@@ -100,7 +106,10 @@ function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
100
106
|
)
|
|
101
107
|
}
|
|
102
108
|
|
|
103
|
-
function SheetTitle({
|
|
109
|
+
function SheetTitle({
|
|
110
|
+
className,
|
|
111
|
+
...props
|
|
112
|
+
}: React.ComponentProps<typeof SheetPrimitive.Title>) {
|
|
104
113
|
return (
|
|
105
114
|
<SheetPrimitive.Title
|
|
106
115
|
data-slot="sheet-title"
|
|
@@ -116,7 +125,7 @@ function SheetTitle({ className, ...props }: SheetPrimitive.Title.Props) {
|
|
|
116
125
|
function SheetDescription({
|
|
117
126
|
className,
|
|
118
127
|
...props
|
|
119
|
-
}: SheetPrimitive.Description
|
|
128
|
+
}: React.ComponentProps<typeof SheetPrimitive.Description>) {
|
|
120
129
|
return (
|
|
121
130
|
<SheetPrimitive.Description
|
|
122
131
|
data-slot="sheet-description"
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { cn } from "cn"
|
|
5
|
+
import { Slider as SliderPrimitive } from "radix-ui"
|
|
6
|
+
|
|
7
|
+
function Slider({
|
|
8
|
+
className,
|
|
9
|
+
defaultValue,
|
|
10
|
+
value,
|
|
11
|
+
min = 0,
|
|
12
|
+
max = 100,
|
|
13
|
+
...props
|
|
14
|
+
}: React.ComponentProps<typeof SliderPrimitive.Root>) {
|
|
15
|
+
const _values = React.useMemo(
|
|
16
|
+
() =>
|
|
17
|
+
Array.isArray(value)
|
|
18
|
+
? value
|
|
19
|
+
: Array.isArray(defaultValue)
|
|
20
|
+
? defaultValue
|
|
21
|
+
: [min, max],
|
|
22
|
+
[value, defaultValue, min, max]
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<SliderPrimitive.Root
|
|
27
|
+
data-slot="slider"
|
|
28
|
+
defaultValue={defaultValue}
|
|
29
|
+
value={value}
|
|
30
|
+
min={min}
|
|
31
|
+
max={max}
|
|
32
|
+
className={cn(
|
|
33
|
+
"relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col",
|
|
34
|
+
className
|
|
35
|
+
)}
|
|
36
|
+
{...props}
|
|
37
|
+
>
|
|
38
|
+
<SliderPrimitive.Track
|
|
39
|
+
data-slot="slider-track"
|
|
40
|
+
className="relative grow overflow-hidden rounded-full bg-muted data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1"
|
|
41
|
+
>
|
|
42
|
+
<SliderPrimitive.Range
|
|
43
|
+
data-slot="slider-range"
|
|
44
|
+
className="absolute bg-primary select-none data-horizontal:h-full data-vertical:w-full"
|
|
45
|
+
/>
|
|
46
|
+
</SliderPrimitive.Track>
|
|
47
|
+
{Array.from({ length: _values.length }, (_, index) => (
|
|
48
|
+
<SliderPrimitive.Thumb
|
|
49
|
+
data-slot="slider-thumb"
|
|
50
|
+
key={index}
|
|
51
|
+
className="relative block size-3 shrink-0 rounded-full border border-ring bg-white ring-ring/50 transition-[color,box-shadow] select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50"
|
|
52
|
+
/>
|
|
53
|
+
))}
|
|
54
|
+
</SliderPrimitive.Root>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { Slider }
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import * as React from "react"
|
|
4
4
|
import { cn } from "cn"
|
|
5
|
+
import { Switch as SwitchPrimitive } from "radix-ui"
|
|
5
6
|
|
|
6
7
|
function Switch({
|
|
7
8
|
className,
|
|
8
9
|
size = "default",
|
|
9
10
|
...props
|
|
10
|
-
}: SwitchPrimitive.Root
|
|
11
|
+
}: React.ComponentProps<typeof SwitchPrimitive.Root> & {
|
|
11
12
|
size?: "sm" | "default"
|
|
12
13
|
}) {
|
|
13
14
|
return (
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { cn } from "cn"
|
|
5
|
+
|
|
6
|
+
function Table({ className, ...props }: React.ComponentProps<"table">) {
|
|
7
|
+
return (
|
|
8
|
+
<div
|
|
9
|
+
data-slot="table-container"
|
|
10
|
+
className="relative w-full overflow-x-auto"
|
|
11
|
+
>
|
|
12
|
+
<table
|
|
13
|
+
data-slot="table"
|
|
14
|
+
className={cn("w-full caption-bottom text-sm", className)}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
|
|
22
|
+
return (
|
|
23
|
+
<thead
|
|
24
|
+
data-slot="table-header"
|
|
25
|
+
className={cn("[&_tr]:border-b", className)}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
|
|
32
|
+
return (
|
|
33
|
+
<tbody
|
|
34
|
+
data-slot="table-body"
|
|
35
|
+
className={cn("[&_tr:last-child]:border-0", className)}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
|
|
42
|
+
return (
|
|
43
|
+
<tfoot
|
|
44
|
+
data-slot="table-footer"
|
|
45
|
+
className={cn(
|
|
46
|
+
"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
|
|
47
|
+
className
|
|
48
|
+
)}
|
|
49
|
+
{...props}
|
|
50
|
+
/>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
|
|
55
|
+
return (
|
|
56
|
+
<tr
|
|
57
|
+
data-slot="table-row"
|
|
58
|
+
className={cn(
|
|
59
|
+
"border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",
|
|
60
|
+
className
|
|
61
|
+
)}
|
|
62
|
+
{...props}
|
|
63
|
+
/>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function TableHead({ className, ...props }: React.ComponentProps<"th">) {
|
|
68
|
+
return (
|
|
69
|
+
<th
|
|
70
|
+
data-slot="table-head"
|
|
71
|
+
className={cn(
|
|
72
|
+
"h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",
|
|
73
|
+
className
|
|
74
|
+
)}
|
|
75
|
+
{...props}
|
|
76
|
+
/>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function TableCell({ className, ...props }: React.ComponentProps<"td">) {
|
|
81
|
+
return (
|
|
82
|
+
<td
|
|
83
|
+
data-slot="table-cell"
|
|
84
|
+
className={cn(
|
|
85
|
+
"p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",
|
|
86
|
+
className
|
|
87
|
+
)}
|
|
88
|
+
{...props}
|
|
89
|
+
/>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function TableCaption({
|
|
94
|
+
className,
|
|
95
|
+
...props
|
|
96
|
+
}: React.ComponentProps<"caption">) {
|
|
97
|
+
return (
|
|
98
|
+
<caption
|
|
99
|
+
data-slot="table-caption"
|
|
100
|
+
className={cn("mt-4 text-sm text-muted-foreground", className)}
|
|
101
|
+
{...props}
|
|
102
|
+
/>
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export {
|
|
107
|
+
Table,
|
|
108
|
+
TableHeader,
|
|
109
|
+
TableBody,
|
|
110
|
+
TableFooter,
|
|
111
|
+
TableHead,
|
|
112
|
+
TableRow,
|
|
113
|
+
TableCell,
|
|
114
|
+
TableCaption,
|
|
115
|
+
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import * as React from "react"
|
|
4
4
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
5
5
|
import { cn } from "cn"
|
|
6
|
+
import { Tabs as TabsPrimitive } from "radix-ui"
|
|
6
7
|
|
|
7
8
|
function Tabs({
|
|
8
9
|
className,
|
|
9
10
|
orientation = "horizontal",
|
|
10
11
|
...props
|
|
11
|
-
}: TabsPrimitive.Root
|
|
12
|
+
}: React.ComponentProps<typeof TabsPrimitive.Root>) {
|
|
12
13
|
return (
|
|
13
14
|
<TabsPrimitive.Root
|
|
14
15
|
data-slot="tabs"
|
|
@@ -41,7 +42,8 @@ function TabsList({
|
|
|
41
42
|
className,
|
|
42
43
|
variant = "default",
|
|
43
44
|
...props
|
|
44
|
-
}:
|
|
45
|
+
}: React.ComponentProps<typeof TabsPrimitive.List> &
|
|
46
|
+
VariantProps<typeof tabsListVariants>) {
|
|
45
47
|
return (
|
|
46
48
|
<TabsPrimitive.List
|
|
47
49
|
data-slot="tabs-list"
|
|
@@ -52,12 +54,15 @@ function TabsList({
|
|
|
52
54
|
)
|
|
53
55
|
}
|
|
54
56
|
|
|
55
|
-
function TabsTrigger({
|
|
57
|
+
function TabsTrigger({
|
|
58
|
+
className,
|
|
59
|
+
...props
|
|
60
|
+
}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
|
|
56
61
|
return (
|
|
57
|
-
<TabsPrimitive.
|
|
62
|
+
<TabsPrimitive.Trigger
|
|
58
63
|
data-slot="tabs-trigger"
|
|
59
64
|
className={cn(
|
|
60
|
-
"relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1
|
|
65
|
+
"relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
61
66
|
"group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent",
|
|
62
67
|
"data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground",
|
|
63
68
|
"after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
|
|
@@ -68,9 +73,12 @@ function TabsTrigger({ className, ...props }: TabsPrimitive.Tab.Props) {
|
|
|
68
73
|
)
|
|
69
74
|
}
|
|
70
75
|
|
|
71
|
-
function TabsContent({
|
|
76
|
+
function TabsContent({
|
|
77
|
+
className,
|
|
78
|
+
...props
|
|
79
|
+
}: React.ComponentProps<typeof TabsPrimitive.Content>) {
|
|
72
80
|
return (
|
|
73
|
-
<TabsPrimitive.
|
|
81
|
+
<TabsPrimitive.Content
|
|
74
82
|
data-slot="tabs-content"
|
|
75
83
|
className={cn("flex-1 text-sm outline-none", className)}
|
|
76
84
|
{...props}
|