ucode-agent 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +64 -4
  2. package/package.json +5 -2
  3. package/skills/build-app/SKILL.md +19 -1
  4. package/skills/ui-ux/SKILL.md +2 -2
  5. package/src/core/doctor.js +122 -0
  6. package/src/core/loop.js +303 -12
  7. package/src/core/provider.js +93 -10
  8. package/src/core/stuck.js +269 -0
  9. package/src/tools/browser.js +121 -59
  10. package/src/tools/deploy.js +283 -0
  11. package/src/tools/files.js +91 -8
  12. package/src/tools/index.js +65 -8
  13. package/src/tools/scaffold.js +190 -0
  14. package/src/tools/shell.js +89 -1
  15. package/src/ui/activity.js +203 -0
  16. package/src/ui/plain.js +22 -3
  17. package/src/ui/screen.js +65 -19
  18. package/templates/next-shadcn/AGENTS.md +9 -0
  19. package/templates/next-shadcn/README.md +9 -0
  20. package/templates/next-shadcn/TEMPLATE.md +83 -0
  21. package/templates/next-shadcn/_gitignore +41 -0
  22. package/templates/next-shadcn/_package-lock.json +11465 -0
  23. package/templates/next-shadcn/components.json +25 -0
  24. package/templates/next-shadcn/eslint.config.mjs +18 -0
  25. package/templates/next-shadcn/next-env.d.ts +5 -0
  26. package/templates/next-shadcn/next.config.ts +8 -0
  27. package/templates/next-shadcn/package.json +39 -0
  28. package/templates/next-shadcn/postcss.config.mjs +7 -0
  29. package/templates/next-shadcn/presets/citrus.json +77 -0
  30. package/templates/next-shadcn/presets/graphite.json +77 -0
  31. package/templates/next-shadcn/presets/grove.json +77 -0
  32. package/templates/next-shadcn/presets/ocean.json +78 -0
  33. package/templates/next-shadcn/presets/sunset.json +77 -0
  34. package/templates/next-shadcn/presets/violet.json +77 -0
  35. package/templates/next-shadcn/src/app/favicon.ico +0 -0
  36. package/templates/next-shadcn/src/app/globals.css +155 -0
  37. package/templates/next-shadcn/src/app/layout.tsx +42 -0
  38. package/templates/next-shadcn/src/app/page.tsx +14 -0
  39. package/templates/next-shadcn/src/components/theme-provider.tsx +7 -0
  40. package/templates/next-shadcn/src/components/theme-toggle.tsx +27 -0
  41. package/templates/next-shadcn/src/components/ui/accordion.tsx +80 -0
  42. package/templates/next-shadcn/src/components/ui/alert-dialog.tsx +199 -0
  43. package/templates/next-shadcn/src/components/ui/avatar.tsx +111 -0
  44. package/templates/next-shadcn/src/components/ui/badge.tsx +48 -0
  45. package/templates/next-shadcn/src/components/ui/button.tsx +66 -0
  46. package/templates/next-shadcn/src/components/ui/calendar.tsx +222 -0
  47. package/templates/next-shadcn/src/components/ui/card.tsx +102 -0
  48. package/templates/next-shadcn/src/components/ui/checkbox.tsx +32 -0
  49. package/templates/next-shadcn/src/components/ui/collapsible.tsx +33 -0
  50. package/templates/next-shadcn/src/components/ui/command.tsx +195 -0
  51. package/templates/next-shadcn/src/components/ui/dialog.tsx +168 -0
  52. package/templates/next-shadcn/src/components/ui/dropdown-menu.tsx +268 -0
  53. package/templates/next-shadcn/src/components/ui/hover-card.tsx +43 -0
  54. package/templates/next-shadcn/src/components/ui/input-group.tsx +156 -0
  55. package/templates/next-shadcn/src/components/ui/input.tsx +18 -0
  56. package/templates/next-shadcn/src/components/ui/label.tsx +23 -0
  57. package/templates/next-shadcn/src/components/ui/popover.tsx +88 -0
  58. package/templates/next-shadcn/src/components/ui/progress.tsx +30 -0
  59. package/templates/next-shadcn/src/components/ui/radio-group.tsx +43 -0
  60. package/templates/next-shadcn/src/components/ui/scroll-area.tsx +54 -0
  61. package/templates/next-shadcn/src/components/ui/select.tsx +191 -0
  62. package/templates/next-shadcn/src/components/ui/separator.tsx +27 -0
  63. package/templates/next-shadcn/src/components/ui/sheet.tsx +147 -0
  64. package/templates/next-shadcn/src/components/ui/skeleton.tsx +13 -0
  65. package/templates/next-shadcn/src/components/ui/slider.tsx +58 -0
  66. package/templates/next-shadcn/src/components/ui/sonner.tsx +49 -0
  67. package/templates/next-shadcn/src/components/ui/switch.tsx +32 -0
  68. package/templates/next-shadcn/src/components/ui/table.tsx +115 -0
  69. package/templates/next-shadcn/src/components/ui/tabs.tsx +89 -0
  70. package/templates/next-shadcn/src/components/ui/textarea.tsx +17 -0
  71. package/templates/next-shadcn/src/components/ui/toggle-group.tsx +89 -0
  72. package/templates/next-shadcn/src/components/ui/toggle.tsx +46 -0
  73. package/templates/next-shadcn/src/components/ui/tooltip.tsx +56 -0
  74. package/templates/next-shadcn/src/lib/utils.ts +6 -0
  75. package/templates/next-shadcn/tsconfig.json +34 -0
  76. package/ucode.js +8 -1
@@ -0,0 +1,88 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { cn } from "cn"
5
+ import { Popover as PopoverPrimitive } from "radix-ui"
6
+
7
+ function Popover({
8
+ ...props
9
+ }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
10
+ return <PopoverPrimitive.Root data-slot="popover" {...props} />
11
+ }
12
+
13
+ function PopoverTrigger({
14
+ ...props
15
+ }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
16
+ return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
17
+ }
18
+
19
+ function PopoverContent({
20
+ className,
21
+ align = "center",
22
+ sideOffset = 4,
23
+ ...props
24
+ }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
25
+ return (
26
+ <PopoverPrimitive.Portal>
27
+ <PopoverPrimitive.Content
28
+ data-slot="popover-content"
29
+ align={align}
30
+ sideOffset={sideOffset}
31
+ className={cn(
32
+ "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",
33
+ className
34
+ )}
35
+ {...props}
36
+ />
37
+ </PopoverPrimitive.Portal>
38
+ )
39
+ }
40
+
41
+ function PopoverAnchor({
42
+ ...props
43
+ }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
44
+ return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
45
+ }
46
+
47
+ function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
48
+ return (
49
+ <div
50
+ data-slot="popover-header"
51
+ className={cn("flex flex-col gap-0.5 text-sm", className)}
52
+ {...props}
53
+ />
54
+ )
55
+ }
56
+
57
+ function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">) {
58
+ return (
59
+ <div
60
+ data-slot="popover-title"
61
+ className={cn("font-medium", className)}
62
+ {...props}
63
+ />
64
+ )
65
+ }
66
+
67
+ function PopoverDescription({
68
+ className,
69
+ ...props
70
+ }: React.ComponentProps<"p">) {
71
+ return (
72
+ <p
73
+ data-slot="popover-description"
74
+ className={cn("text-muted-foreground", className)}
75
+ {...props}
76
+ />
77
+ )
78
+ }
79
+
80
+ export {
81
+ Popover,
82
+ PopoverAnchor,
83
+ PopoverContent,
84
+ PopoverDescription,
85
+ PopoverHeader,
86
+ PopoverTitle,
87
+ PopoverTrigger,
88
+ }
@@ -0,0 +1,30 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { cn } from "cn"
5
+ import { Progress as ProgressPrimitive } from "radix-ui"
6
+
7
+ function Progress({
8
+ className,
9
+ value,
10
+ ...props
11
+ }: React.ComponentProps<typeof ProgressPrimitive.Root>) {
12
+ return (
13
+ <ProgressPrimitive.Root
14
+ data-slot="progress"
15
+ className={cn(
16
+ "relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted",
17
+ className
18
+ )}
19
+ {...props}
20
+ >
21
+ <ProgressPrimitive.Indicator
22
+ data-slot="progress-indicator"
23
+ className="size-full flex-1 bg-primary transition-all"
24
+ style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
25
+ />
26
+ </ProgressPrimitive.Root>
27
+ )
28
+ }
29
+
30
+ export { Progress }
@@ -0,0 +1,43 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { cn } from "cn"
5
+ import { RadioGroup as RadioGroupPrimitive } from "radix-ui"
6
+
7
+ function RadioGroup({
8
+ className,
9
+ ...props
10
+ }: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
11
+ return (
12
+ <RadioGroupPrimitive.Root
13
+ data-slot="radio-group"
14
+ className={cn("grid w-full gap-2", className)}
15
+ {...props}
16
+ />
17
+ )
18
+ }
19
+
20
+ function RadioGroupItem({
21
+ className,
22
+ ...props
23
+ }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
24
+ return (
25
+ <RadioGroupPrimitive.Item
26
+ data-slot="radio-group-item"
27
+ className={cn(
28
+ "group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input 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 group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary",
29
+ className
30
+ )}
31
+ {...props}
32
+ >
33
+ <RadioGroupPrimitive.Indicator
34
+ data-slot="radio-group-indicator"
35
+ className="flex size-4 items-center justify-center"
36
+ >
37
+ <span className="absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground" />
38
+ </RadioGroupPrimitive.Indicator>
39
+ </RadioGroupPrimitive.Item>
40
+ )
41
+ }
42
+
43
+ export { RadioGroup, RadioGroupItem }
@@ -0,0 +1,54 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { cn } from "cn"
5
+ import { ScrollArea as ScrollAreaPrimitive } from "radix-ui"
6
+
7
+ function ScrollArea({
8
+ className,
9
+ children,
10
+ ...props
11
+ }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
12
+ return (
13
+ <ScrollAreaPrimitive.Root
14
+ data-slot="scroll-area"
15
+ className={cn("relative", className)}
16
+ {...props}
17
+ >
18
+ <ScrollAreaPrimitive.Viewport
19
+ data-slot="scroll-area-viewport"
20
+ className="size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1"
21
+ >
22
+ {children}
23
+ </ScrollAreaPrimitive.Viewport>
24
+ <ScrollBar />
25
+ <ScrollAreaPrimitive.Corner />
26
+ </ScrollAreaPrimitive.Root>
27
+ )
28
+ }
29
+
30
+ function ScrollBar({
31
+ className,
32
+ orientation = "vertical",
33
+ ...props
34
+ }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
35
+ return (
36
+ <ScrollAreaPrimitive.ScrollAreaScrollbar
37
+ data-slot="scroll-area-scrollbar"
38
+ data-orientation={orientation}
39
+ orientation={orientation}
40
+ className={cn(
41
+ "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",
42
+ className
43
+ )}
44
+ {...props}
45
+ >
46
+ <ScrollAreaPrimitive.ScrollAreaThumb
47
+ data-slot="scroll-area-thumb"
48
+ className="relative flex-1 rounded-full bg-border"
49
+ />
50
+ </ScrollAreaPrimitive.ScrollAreaScrollbar>
51
+ )
52
+ }
53
+
54
+ export { ScrollArea, ScrollBar }
@@ -0,0 +1,191 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { cn } from "cn"
5
+ import { Select as SelectPrimitive } from "radix-ui"
6
+ import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-react"
7
+
8
+ function Select({
9
+ ...props
10
+ }: React.ComponentProps<typeof SelectPrimitive.Root>) {
11
+ return <SelectPrimitive.Root data-slot="select" {...props} />
12
+ }
13
+
14
+ function SelectGroup({
15
+ className,
16
+ ...props
17
+ }: React.ComponentProps<typeof SelectPrimitive.Group>) {
18
+ return (
19
+ <SelectPrimitive.Group
20
+ data-slot="select-group"
21
+ className={cn("scroll-my-1 p-1", className)}
22
+ {...props}
23
+ />
24
+ )
25
+ }
26
+
27
+ function SelectValue({
28
+ ...props
29
+ }: React.ComponentProps<typeof SelectPrimitive.Value>) {
30
+ return <SelectPrimitive.Value data-slot="select-value" {...props} />
31
+ }
32
+
33
+ function SelectTrigger({
34
+ className,
35
+ size = "default",
36
+ children,
37
+ ...props
38
+ }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
39
+ size?: "sm" | "default"
40
+ }) {
41
+ return (
42
+ <SelectPrimitive.Trigger
43
+ data-slot="select-trigger"
44
+ data-size={size}
45
+ className={cn(
46
+ "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",
47
+ className
48
+ )}
49
+ {...props}
50
+ >
51
+ {children}
52
+ <SelectPrimitive.Icon asChild>
53
+ <ChevronDownIcon className="pointer-events-none size-4 text-muted-foreground" />
54
+ </SelectPrimitive.Icon>
55
+ </SelectPrimitive.Trigger>
56
+ )
57
+ }
58
+
59
+ function SelectContent({
60
+ className,
61
+ children,
62
+ position = "item-aligned",
63
+ align = "center",
64
+ ...props
65
+ }: React.ComponentProps<typeof SelectPrimitive.Content>) {
66
+ return (
67
+ <SelectPrimitive.Portal>
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}
73
+ align={align}
74
+ {...props}
75
+ >
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
+ )}
83
+ >
84
+ {children}
85
+ </SelectPrimitive.Viewport>
86
+ <SelectScrollDownButton />
87
+ </SelectPrimitive.Content>
88
+ </SelectPrimitive.Portal>
89
+ )
90
+ }
91
+
92
+ function SelectLabel({
93
+ className,
94
+ ...props
95
+ }: React.ComponentProps<typeof SelectPrimitive.Label>) {
96
+ return (
97
+ <SelectPrimitive.Label
98
+ data-slot="select-label"
99
+ className={cn("px-1.5 py-1 text-xs text-muted-foreground", className)}
100
+ {...props}
101
+ />
102
+ )
103
+ }
104
+
105
+ function SelectItem({
106
+ className,
107
+ children,
108
+ ...props
109
+ }: React.ComponentProps<typeof SelectPrimitive.Item>) {
110
+ return (
111
+ <SelectPrimitive.Item
112
+ data-slot="select-item"
113
+ className={cn(
114
+ "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",
115
+ className
116
+ )}
117
+ {...props}
118
+ >
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>
125
+ </SelectPrimitive.Item>
126
+ )
127
+ }
128
+
129
+ function SelectSeparator({
130
+ className,
131
+ ...props
132
+ }: React.ComponentProps<typeof SelectPrimitive.Separator>) {
133
+ return (
134
+ <SelectPrimitive.Separator
135
+ data-slot="select-separator"
136
+ className={cn("pointer-events-none -mx-1 my-1 h-px bg-border", className)}
137
+ {...props}
138
+ />
139
+ )
140
+ }
141
+
142
+ function SelectScrollUpButton({
143
+ className,
144
+ ...props
145
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
146
+ return (
147
+ <SelectPrimitive.ScrollUpButton
148
+ data-slot="select-scroll-up-button"
149
+ className={cn(
150
+ "z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
151
+ className
152
+ )}
153
+ {...props}
154
+ >
155
+ <ChevronUpIcon
156
+ />
157
+ </SelectPrimitive.ScrollUpButton>
158
+ )
159
+ }
160
+
161
+ function SelectScrollDownButton({
162
+ className,
163
+ ...props
164
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
165
+ return (
166
+ <SelectPrimitive.ScrollDownButton
167
+ data-slot="select-scroll-down-button"
168
+ className={cn(
169
+ "z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
170
+ className
171
+ )}
172
+ {...props}
173
+ >
174
+ <ChevronDownIcon
175
+ />
176
+ </SelectPrimitive.ScrollDownButton>
177
+ )
178
+ }
179
+
180
+ export {
181
+ Select,
182
+ SelectContent,
183
+ SelectGroup,
184
+ SelectItem,
185
+ SelectLabel,
186
+ SelectScrollDownButton,
187
+ SelectScrollUpButton,
188
+ SelectSeparator,
189
+ SelectTrigger,
190
+ SelectValue,
191
+ }
@@ -0,0 +1,27 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { cn } from "cn"
5
+ import { Separator as SeparatorPrimitive } from "radix-ui"
6
+
7
+ function Separator({
8
+ className,
9
+ orientation = "horizontal",
10
+ decorative = true,
11
+ ...props
12
+ }: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
13
+ return (
14
+ <SeparatorPrimitive.Root
15
+ data-slot="separator"
16
+ decorative={decorative}
17
+ orientation={orientation}
18
+ className={cn(
19
+ "shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",
20
+ className
21
+ )}
22
+ {...props}
23
+ />
24
+ )
25
+ }
26
+
27
+ export { Separator }
@@ -0,0 +1,147 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { cn } from "cn"
5
+ import { Dialog as SheetPrimitive } from "radix-ui"
6
+
7
+ import { Button } from "@/components/ui/button"
8
+ import { XIcon } from "lucide-react"
9
+
10
+ function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
11
+ return <SheetPrimitive.Root data-slot="sheet" {...props} />
12
+ }
13
+
14
+ function SheetTrigger({
15
+ ...props
16
+ }: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
17
+ return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
18
+ }
19
+
20
+ function SheetClose({
21
+ ...props
22
+ }: React.ComponentProps<typeof SheetPrimitive.Close>) {
23
+ return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
24
+ }
25
+
26
+ function SheetPortal({
27
+ ...props
28
+ }: React.ComponentProps<typeof SheetPrimitive.Portal>) {
29
+ return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
30
+ }
31
+
32
+ function SheetOverlay({
33
+ className,
34
+ ...props
35
+ }: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
36
+ return (
37
+ <SheetPrimitive.Overlay
38
+ data-slot="sheet-overlay"
39
+ className={cn(
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",
41
+ className
42
+ )}
43
+ {...props}
44
+ />
45
+ )
46
+ }
47
+
48
+ function SheetContent({
49
+ className,
50
+ children,
51
+ side = "right",
52
+ showCloseButton = true,
53
+ ...props
54
+ }: React.ComponentProps<typeof SheetPrimitive.Content> & {
55
+ side?: "top" | "right" | "bottom" | "left"
56
+ showCloseButton?: boolean
57
+ }) {
58
+ return (
59
+ <SheetPortal>
60
+ <SheetOverlay />
61
+ <SheetPrimitive.Content
62
+ data-slot="sheet-content"
63
+ data-side={side}
64
+ className={cn(
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",
66
+ className
67
+ )}
68
+ {...props}
69
+ >
70
+ {children}
71
+ {showCloseButton && (
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
79
+ />
80
+ <span className="sr-only">Close</span>
81
+ </Button>
82
+ </SheetPrimitive.Close>
83
+ )}
84
+ </SheetPrimitive.Content>
85
+ </SheetPortal>
86
+ )
87
+ }
88
+
89
+ function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
90
+ return (
91
+ <div
92
+ data-slot="sheet-header"
93
+ className={cn("flex flex-col gap-0.5 p-4", className)}
94
+ {...props}
95
+ />
96
+ )
97
+ }
98
+
99
+ function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
100
+ return (
101
+ <div
102
+ data-slot="sheet-footer"
103
+ className={cn("mt-auto flex flex-col gap-2 p-4", className)}
104
+ {...props}
105
+ />
106
+ )
107
+ }
108
+
109
+ function SheetTitle({
110
+ className,
111
+ ...props
112
+ }: React.ComponentProps<typeof SheetPrimitive.Title>) {
113
+ return (
114
+ <SheetPrimitive.Title
115
+ data-slot="sheet-title"
116
+ className={cn(
117
+ "font-heading text-base font-medium text-foreground",
118
+ className
119
+ )}
120
+ {...props}
121
+ />
122
+ )
123
+ }
124
+
125
+ function SheetDescription({
126
+ className,
127
+ ...props
128
+ }: React.ComponentProps<typeof SheetPrimitive.Description>) {
129
+ return (
130
+ <SheetPrimitive.Description
131
+ data-slot="sheet-description"
132
+ className={cn("text-sm text-muted-foreground", className)}
133
+ {...props}
134
+ />
135
+ )
136
+ }
137
+
138
+ export {
139
+ Sheet,
140
+ SheetTrigger,
141
+ SheetClose,
142
+ SheetContent,
143
+ SheetHeader,
144
+ SheetFooter,
145
+ SheetTitle,
146
+ SheetDescription,
147
+ }
@@ -0,0 +1,13 @@
1
+ import { cn } from "cn"
2
+
3
+ function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
4
+ return (
5
+ <div
6
+ data-slot="skeleton"
7
+ className={cn("animate-pulse rounded-md bg-muted", className)}
8
+ {...props}
9
+ />
10
+ )
11
+ }
12
+
13
+ export { Skeleton }
@@ -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 }