@zabuti/components-mcp 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +42 -2
- package/dist/index.js +527 -0
- package/dist/project-setup.js +424 -0
- package/dist/registry.js +73 -0
- package/dist/source.js +19 -0
- package/package.json +41 -4
- package/payload/registry.json +801 -0
- package/payload/src/components/ui/accordion.tsx +75 -0
- package/payload/src/components/ui/alert-dialog.tsx +151 -0
- package/payload/src/components/ui/alert.tsx +69 -0
- package/payload/src/components/ui/avatar.tsx +59 -0
- package/payload/src/components/ui/badge.tsx +57 -0
- package/payload/src/components/ui/breadcrumb.tsx +109 -0
- package/payload/src/components/ui/button.tsx +76 -0
- package/payload/src/components/ui/calendar.tsx +117 -0
- package/payload/src/components/ui/card.tsx +120 -0
- package/payload/src/components/ui/chart.tsx +249 -0
- package/payload/src/components/ui/checkbox.tsx +38 -0
- package/payload/src/components/ui/collapsible.tsx +30 -0
- package/payload/src/components/ui/combobox.tsx +127 -0
- package/payload/src/components/ui/command.tsx +186 -0
- package/payload/src/components/ui/context-menu.tsx +261 -0
- package/payload/src/components/ui/date-picker.tsx +140 -0
- package/payload/src/components/ui/dialog.tsx +176 -0
- package/payload/src/components/ui/dropdown-menu.tsx +277 -0
- package/payload/src/components/ui/form.tsx +151 -0
- package/payload/src/components/ui/hover-card.tsx +46 -0
- package/payload/src/components/ui/input-group.tsx +127 -0
- package/payload/src/components/ui/input.tsx +25 -0
- package/payload/src/components/ui/label.tsx +28 -0
- package/payload/src/components/ui/pagination.tsx +130 -0
- package/payload/src/components/ui/popover.tsx +97 -0
- package/payload/src/components/ui/progress.tsx +35 -0
- package/payload/src/components/ui/radio-group.tsx +49 -0
- package/payload/src/components/ui/scroll-area.tsx +67 -0
- package/payload/src/components/ui/select.tsx +199 -0
- package/payload/src/components/ui/separator.tsx +32 -0
- package/payload/src/components/ui/sheet.tsx +155 -0
- package/payload/src/components/ui/skeleton.tsx +21 -0
- package/payload/src/components/ui/slider.tsx +61 -0
- package/payload/src/components/ui/sonner.tsx +31 -0
- package/payload/src/components/ui/switch.tsx +40 -0
- package/payload/src/components/ui/table.tsx +108 -0
- package/payload/src/components/ui/tabs.tsx +98 -0
- package/payload/src/components/ui/textarea.tsx +24 -0
- package/payload/src/components/ui/toggle-group.tsx +72 -0
- package/payload/src/components/ui/toggle.tsx +54 -0
- package/payload/src/components/ui/tooltip.tsx +65 -0
- package/payload/src/lib/utils.ts +1 -0
- package/payload/src/themes/manifest.json +12 -0
- package/payload/src/themes/zabuti-ui-sky.css +14 -0
- package/payload/src/themes/zabuti-ui-teal.css +14 -0
- package/payload/src/zabuti-ui.css +272 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Select — Zabuti UI primitive.
|
|
5
|
+
*
|
|
6
|
+
* Radix Select + Tailwind over the `zabuti-ui.css` token layer, lucide
|
|
7
|
+
* chevron/check glyphs. Zabuti-owned, no shadcn dependency; Radix is the
|
|
8
|
+
* behavioural base only.
|
|
9
|
+
*
|
|
10
|
+
* Local surface: `size="sm"` trigger; `position` passthrough with an
|
|
11
|
+
* `item-aligned` default.
|
|
12
|
+
*/
|
|
13
|
+
import * as React from "react"
|
|
14
|
+
import { cn } from "cn"
|
|
15
|
+
import { Select as SelectPrimitive } from "radix-ui"
|
|
16
|
+
import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-react"
|
|
17
|
+
|
|
18
|
+
function Select({
|
|
19
|
+
...props
|
|
20
|
+
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
21
|
+
return <SelectPrimitive.Root data-slot="select" {...props} />
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function SelectGroup({
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
28
|
+
return (
|
|
29
|
+
<SelectPrimitive.Group
|
|
30
|
+
data-slot="select-group"
|
|
31
|
+
className={cn("scroll-my-1 p-1", className)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function SelectValue({
|
|
38
|
+
...props
|
|
39
|
+
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
40
|
+
return <SelectPrimitive.Value data-slot="select-value" {...props} />
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function SelectTrigger({
|
|
44
|
+
className,
|
|
45
|
+
size = "default",
|
|
46
|
+
children,
|
|
47
|
+
...props
|
|
48
|
+
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
49
|
+
size?: "sm" | "default"
|
|
50
|
+
}) {
|
|
51
|
+
return (
|
|
52
|
+
<SelectPrimitive.Trigger
|
|
53
|
+
data-slot="select-trigger"
|
|
54
|
+
data-size={size}
|
|
55
|
+
className={cn(
|
|
56
|
+
"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",
|
|
57
|
+
className
|
|
58
|
+
)}
|
|
59
|
+
{...props}
|
|
60
|
+
>
|
|
61
|
+
{children}
|
|
62
|
+
<SelectPrimitive.Icon asChild>
|
|
63
|
+
<ChevronDownIcon className="pointer-events-none size-4 text-muted-foreground" />
|
|
64
|
+
</SelectPrimitive.Icon>
|
|
65
|
+
</SelectPrimitive.Trigger>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function SelectContent({
|
|
70
|
+
className,
|
|
71
|
+
children,
|
|
72
|
+
position = "item-aligned",
|
|
73
|
+
align = "center",
|
|
74
|
+
...props
|
|
75
|
+
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
76
|
+
return (
|
|
77
|
+
<SelectPrimitive.Portal>
|
|
78
|
+
<SelectPrimitive.Content
|
|
79
|
+
data-slot="select-content"
|
|
80
|
+
data-align-trigger={position === "item-aligned"}
|
|
81
|
+
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 )}
|
|
82
|
+
position={position}
|
|
83
|
+
align={align}
|
|
84
|
+
{...props}
|
|
85
|
+
>
|
|
86
|
+
<SelectScrollUpButton />
|
|
87
|
+
<SelectPrimitive.Viewport
|
|
88
|
+
data-position={position}
|
|
89
|
+
className={cn(
|
|
90
|
+
"data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)",
|
|
91
|
+
position === "popper" && ""
|
|
92
|
+
)}
|
|
93
|
+
>
|
|
94
|
+
{children}
|
|
95
|
+
</SelectPrimitive.Viewport>
|
|
96
|
+
<SelectScrollDownButton />
|
|
97
|
+
</SelectPrimitive.Content>
|
|
98
|
+
</SelectPrimitive.Portal>
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function SelectLabel({
|
|
103
|
+
className,
|
|
104
|
+
...props
|
|
105
|
+
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
106
|
+
return (
|
|
107
|
+
<SelectPrimitive.Label
|
|
108
|
+
data-slot="select-label"
|
|
109
|
+
className={cn("px-1.5 py-1 text-xs text-muted-foreground", className)}
|
|
110
|
+
{...props}
|
|
111
|
+
/>
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function SelectItem({
|
|
116
|
+
className,
|
|
117
|
+
children,
|
|
118
|
+
...props
|
|
119
|
+
}: React.ComponentProps<typeof SelectPrimitive.Item>) {
|
|
120
|
+
return (
|
|
121
|
+
<SelectPrimitive.Item
|
|
122
|
+
data-slot="select-item"
|
|
123
|
+
className={cn(
|
|
124
|
+
"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",
|
|
125
|
+
className
|
|
126
|
+
)}
|
|
127
|
+
{...props}
|
|
128
|
+
>
|
|
129
|
+
<span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center">
|
|
130
|
+
<SelectPrimitive.ItemIndicator>
|
|
131
|
+
<CheckIcon className="pointer-events-none" />
|
|
132
|
+
</SelectPrimitive.ItemIndicator>
|
|
133
|
+
</span>
|
|
134
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
135
|
+
</SelectPrimitive.Item>
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function SelectSeparator({
|
|
140
|
+
className,
|
|
141
|
+
...props
|
|
142
|
+
}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
|
|
143
|
+
return (
|
|
144
|
+
<SelectPrimitive.Separator
|
|
145
|
+
data-slot="select-separator"
|
|
146
|
+
className={cn("pointer-events-none -mx-1 my-1 h-px bg-border", className)}
|
|
147
|
+
{...props}
|
|
148
|
+
/>
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function SelectScrollUpButton({
|
|
153
|
+
className,
|
|
154
|
+
...props
|
|
155
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
|
|
156
|
+
return (
|
|
157
|
+
<SelectPrimitive.ScrollUpButton
|
|
158
|
+
data-slot="select-scroll-up-button"
|
|
159
|
+
className={cn(
|
|
160
|
+
"z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
|
|
161
|
+
className
|
|
162
|
+
)}
|
|
163
|
+
{...props}
|
|
164
|
+
>
|
|
165
|
+
<ChevronUpIcon />
|
|
166
|
+
</SelectPrimitive.ScrollUpButton>
|
|
167
|
+
)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function SelectScrollDownButton({
|
|
171
|
+
className,
|
|
172
|
+
...props
|
|
173
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
|
|
174
|
+
return (
|
|
175
|
+
<SelectPrimitive.ScrollDownButton
|
|
176
|
+
data-slot="select-scroll-down-button"
|
|
177
|
+
className={cn(
|
|
178
|
+
"z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
|
|
179
|
+
className
|
|
180
|
+
)}
|
|
181
|
+
{...props}
|
|
182
|
+
>
|
|
183
|
+
<ChevronDownIcon />
|
|
184
|
+
</SelectPrimitive.ScrollDownButton>
|
|
185
|
+
)
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export {
|
|
189
|
+
Select,
|
|
190
|
+
SelectContent,
|
|
191
|
+
SelectGroup,
|
|
192
|
+
SelectItem,
|
|
193
|
+
SelectLabel,
|
|
194
|
+
SelectScrollDownButton,
|
|
195
|
+
SelectScrollUpButton,
|
|
196
|
+
SelectSeparator,
|
|
197
|
+
SelectTrigger,
|
|
198
|
+
SelectValue,
|
|
199
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Separator — Zabuti UI primitive.
|
|
3
|
+
*
|
|
4
|
+
* Radix Separator + Tailwind over the `zabuti-ui.css` token layer. Zabuti-owned,
|
|
5
|
+
* no shadcn dependency. Server-safe. `decorative` defaults true (hidden from the
|
|
6
|
+
* a11y tree); pass `decorative={false}` for a semantic divider.
|
|
7
|
+
*/
|
|
8
|
+
import * as React from "react"
|
|
9
|
+
import { cn } from "cn"
|
|
10
|
+
import { Separator as SeparatorPrimitive } from "radix-ui"
|
|
11
|
+
|
|
12
|
+
function Separator({
|
|
13
|
+
className,
|
|
14
|
+
orientation = "horizontal",
|
|
15
|
+
decorative = true,
|
|
16
|
+
...props
|
|
17
|
+
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
|
|
18
|
+
return (
|
|
19
|
+
<SeparatorPrimitive.Root
|
|
20
|
+
data-slot="separator"
|
|
21
|
+
decorative={decorative}
|
|
22
|
+
orientation={orientation}
|
|
23
|
+
className={cn(
|
|
24
|
+
"shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",
|
|
25
|
+
className
|
|
26
|
+
)}
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { Separator }
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Sheet — Zabuti UI primitive.
|
|
5
|
+
*
|
|
6
|
+
* Radix Dialog aliased as an edge-anchored drawer + Tailwind over the
|
|
7
|
+
* `zabuti-ui.css` token layer. Zabuti-owned, no shadcn dependency; Radix is the
|
|
8
|
+
* behavioural base only. Composes the Button primitive for the close affordance.
|
|
9
|
+
*
|
|
10
|
+
* Local surface: `side` (top / right / bottom / left), `showCloseButton`.
|
|
11
|
+
*/
|
|
12
|
+
import * as React from "react"
|
|
13
|
+
import { cn } from "cn"
|
|
14
|
+
import { Dialog as SheetPrimitive } from "radix-ui"
|
|
15
|
+
|
|
16
|
+
import { Button } from "@/components/ui/button"
|
|
17
|
+
import { XIcon } from "lucide-react"
|
|
18
|
+
|
|
19
|
+
function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
20
|
+
return <SheetPrimitive.Root data-slot="sheet" {...props} />
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function SheetTrigger({
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
|
|
26
|
+
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function SheetClose({
|
|
30
|
+
...props
|
|
31
|
+
}: React.ComponentProps<typeof SheetPrimitive.Close>) {
|
|
32
|
+
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function SheetPortal({
|
|
36
|
+
...props
|
|
37
|
+
}: React.ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
38
|
+
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function SheetOverlay({
|
|
42
|
+
className,
|
|
43
|
+
...props
|
|
44
|
+
}: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
|
|
45
|
+
return (
|
|
46
|
+
<SheetPrimitive.Overlay
|
|
47
|
+
data-slot="sheet-overlay"
|
|
48
|
+
className={cn(
|
|
49
|
+
"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",
|
|
50
|
+
className
|
|
51
|
+
)}
|
|
52
|
+
{...props}
|
|
53
|
+
/>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function SheetContent({
|
|
58
|
+
className,
|
|
59
|
+
children,
|
|
60
|
+
side = "right",
|
|
61
|
+
showCloseButton = true,
|
|
62
|
+
...props
|
|
63
|
+
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
64
|
+
side?: "top" | "right" | "bottom" | "left"
|
|
65
|
+
showCloseButton?: boolean
|
|
66
|
+
}) {
|
|
67
|
+
return (
|
|
68
|
+
<SheetPortal>
|
|
69
|
+
<SheetOverlay />
|
|
70
|
+
<SheetPrimitive.Content
|
|
71
|
+
data-slot="sheet-content"
|
|
72
|
+
data-side={side}
|
|
73
|
+
className={cn(
|
|
74
|
+
"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",
|
|
75
|
+
className
|
|
76
|
+
)}
|
|
77
|
+
{...props}
|
|
78
|
+
>
|
|
79
|
+
{children}
|
|
80
|
+
{showCloseButton && (
|
|
81
|
+
<SheetPrimitive.Close data-slot="sheet-close" asChild>
|
|
82
|
+
<Button
|
|
83
|
+
variant="ghost"
|
|
84
|
+
className="absolute top-3 right-3"
|
|
85
|
+
size="icon-sm"
|
|
86
|
+
>
|
|
87
|
+
<XIcon />
|
|
88
|
+
<span className="sr-only">Close</span>
|
|
89
|
+
</Button>
|
|
90
|
+
</SheetPrimitive.Close>
|
|
91
|
+
)}
|
|
92
|
+
</SheetPrimitive.Content>
|
|
93
|
+
</SheetPortal>
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
98
|
+
return (
|
|
99
|
+
<div
|
|
100
|
+
data-slot="sheet-header"
|
|
101
|
+
className={cn("flex flex-col gap-0.5 p-4", className)}
|
|
102
|
+
{...props}
|
|
103
|
+
/>
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
108
|
+
return (
|
|
109
|
+
<div
|
|
110
|
+
data-slot="sheet-footer"
|
|
111
|
+
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
112
|
+
{...props}
|
|
113
|
+
/>
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function SheetTitle({
|
|
118
|
+
className,
|
|
119
|
+
...props
|
|
120
|
+
}: React.ComponentProps<typeof SheetPrimitive.Title>) {
|
|
121
|
+
return (
|
|
122
|
+
<SheetPrimitive.Title
|
|
123
|
+
data-slot="sheet-title"
|
|
124
|
+
className={cn(
|
|
125
|
+
"font-heading text-base font-medium text-foreground",
|
|
126
|
+
className
|
|
127
|
+
)}
|
|
128
|
+
{...props}
|
|
129
|
+
/>
|
|
130
|
+
)
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function SheetDescription({
|
|
134
|
+
className,
|
|
135
|
+
...props
|
|
136
|
+
}: React.ComponentProps<typeof SheetPrimitive.Description>) {
|
|
137
|
+
return (
|
|
138
|
+
<SheetPrimitive.Description
|
|
139
|
+
data-slot="sheet-description"
|
|
140
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
141
|
+
{...props}
|
|
142
|
+
/>
|
|
143
|
+
)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export {
|
|
147
|
+
Sheet,
|
|
148
|
+
SheetTrigger,
|
|
149
|
+
SheetClose,
|
|
150
|
+
SheetContent,
|
|
151
|
+
SheetHeader,
|
|
152
|
+
SheetFooter,
|
|
153
|
+
SheetTitle,
|
|
154
|
+
SheetDescription,
|
|
155
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skeleton — Zabuti UI primitive.
|
|
3
|
+
*
|
|
4
|
+
* Presentational `<div>` with `animate-pulse` + Tailwind over the
|
|
5
|
+
* `zabuti-ui.css` token layer. No Radix, server-safe. Zabuti-owned, no shadcn
|
|
6
|
+
* dependency.
|
|
7
|
+
*/
|
|
8
|
+
import * as React from "react"
|
|
9
|
+
import { cn } from "cn"
|
|
10
|
+
|
|
11
|
+
function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
|
|
12
|
+
return (
|
|
13
|
+
<div
|
|
14
|
+
data-slot="skeleton"
|
|
15
|
+
className={cn("animate-pulse rounded-md bg-muted", className)}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { Skeleton }
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Slider — Zabuti UI primitive.
|
|
5
|
+
*
|
|
6
|
+
* Radix Slider + Tailwind over the `zabuti-ui.css` token layer. Zabuti-owned, no
|
|
7
|
+
* shadcn dependency; Radix is the behavioural base only. Supports a single value
|
|
8
|
+
* or a range (multiple thumbs), horizontal or vertical.
|
|
9
|
+
*/
|
|
10
|
+
import * as React from "react"
|
|
11
|
+
import { cn } from "cn"
|
|
12
|
+
import { Slider as SliderPrimitive } from "radix-ui"
|
|
13
|
+
|
|
14
|
+
function Slider({
|
|
15
|
+
className,
|
|
16
|
+
defaultValue,
|
|
17
|
+
value,
|
|
18
|
+
min = 0,
|
|
19
|
+
max = 100,
|
|
20
|
+
...props
|
|
21
|
+
}: React.ComponentProps<typeof SliderPrimitive.Root>) {
|
|
22
|
+
const thumbCount = React.useMemo(() => {
|
|
23
|
+
if (Array.isArray(value)) return value.length
|
|
24
|
+
if (Array.isArray(defaultValue)) return defaultValue.length
|
|
25
|
+
return 1
|
|
26
|
+
}, [value, defaultValue])
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<SliderPrimitive.Root
|
|
30
|
+
data-slot="slider"
|
|
31
|
+
defaultValue={defaultValue}
|
|
32
|
+
value={value}
|
|
33
|
+
min={min}
|
|
34
|
+
max={max}
|
|
35
|
+
className={cn(
|
|
36
|
+
"relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
|
|
37
|
+
className
|
|
38
|
+
)}
|
|
39
|
+
{...props}
|
|
40
|
+
>
|
|
41
|
+
<SliderPrimitive.Track
|
|
42
|
+
data-slot="slider-track"
|
|
43
|
+
className="relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
|
|
44
|
+
>
|
|
45
|
+
<SliderPrimitive.Range
|
|
46
|
+
data-slot="slider-range"
|
|
47
|
+
className="absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
|
48
|
+
/>
|
|
49
|
+
</SliderPrimitive.Track>
|
|
50
|
+
{Array.from({ length: thumbCount }, (_, i) => (
|
|
51
|
+
<SliderPrimitive.Thumb
|
|
52
|
+
key={i}
|
|
53
|
+
data-slot="slider-thumb"
|
|
54
|
+
className="block size-4 shrink-0 rounded-full border border-primary bg-background shadow-sm transition-[color,box-shadow] outline-none hover:ring-4 hover:ring-ring/20 focus-visible:ring-4 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50"
|
|
55
|
+
/>
|
|
56
|
+
))}
|
|
57
|
+
</SliderPrimitive.Root>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { Slider }
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Sonner (Toaster) — Zabuti UI primitive.
|
|
5
|
+
*
|
|
6
|
+
* The `sonner` toast renderer, themed through the `zabuti-ui.css` token layer
|
|
7
|
+
* via CSS custom properties — so toasts follow the app's `.dark` class with no
|
|
8
|
+
* `next-themes` dependency. Mount `<Toaster />` once near the app root and call
|
|
9
|
+
* `toast(...)` from `sonner` anywhere. Zabuti-owned, no shadcn dependency.
|
|
10
|
+
*/
|
|
11
|
+
import * as React from "react"
|
|
12
|
+
import { Toaster as SonnerPrimitive, type ToasterProps } from "sonner"
|
|
13
|
+
|
|
14
|
+
function Toaster(props: ToasterProps) {
|
|
15
|
+
return (
|
|
16
|
+
<SonnerPrimitive
|
|
17
|
+
className="toaster group"
|
|
18
|
+
style={
|
|
19
|
+
{
|
|
20
|
+
"--normal-bg": "var(--popover)",
|
|
21
|
+
"--normal-text": "var(--popover-foreground)",
|
|
22
|
+
"--normal-border": "var(--border)",
|
|
23
|
+
"--border-radius": "var(--radius)",
|
|
24
|
+
} as React.CSSProperties
|
|
25
|
+
}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { Toaster }
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Switch — Zabuti UI primitive.
|
|
5
|
+
*
|
|
6
|
+
* Radix Switch + Tailwind over the `zabuti-ui.css` token layer. Zabuti-owned, no
|
|
7
|
+
* shadcn dependency; Radix is the behavioural base only.
|
|
8
|
+
*
|
|
9
|
+
* Local surface: `size="sm"`.
|
|
10
|
+
*/
|
|
11
|
+
import * as React from "react"
|
|
12
|
+
import { cn } from "cn"
|
|
13
|
+
import { Switch as SwitchPrimitive } from "radix-ui"
|
|
14
|
+
|
|
15
|
+
function Switch({
|
|
16
|
+
className,
|
|
17
|
+
size = "default",
|
|
18
|
+
...props
|
|
19
|
+
}: React.ComponentProps<typeof SwitchPrimitive.Root> & {
|
|
20
|
+
size?: "sm" | "default"
|
|
21
|
+
}) {
|
|
22
|
+
return (
|
|
23
|
+
<SwitchPrimitive.Root
|
|
24
|
+
data-slot="switch"
|
|
25
|
+
data-size={size}
|
|
26
|
+
className={cn(
|
|
27
|
+
"peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",
|
|
28
|
+
className
|
|
29
|
+
)}
|
|
30
|
+
{...props}
|
|
31
|
+
>
|
|
32
|
+
<SwitchPrimitive.Thumb
|
|
33
|
+
data-slot="switch-thumb"
|
|
34
|
+
className="pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"
|
|
35
|
+
/>
|
|
36
|
+
</SwitchPrimitive.Root>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { Switch }
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Table — Zabuti UI primitive.
|
|
3
|
+
*
|
|
4
|
+
* Semantic `<table>` elements + Tailwind over the `zabuti-ui.css` token layer,
|
|
5
|
+
* wrapped in a horizontal-scroll container. No Radix, server-safe. Zabuti-owned,
|
|
6
|
+
* no shadcn dependency. For a full data grid (sort / filter / freeze / views)
|
|
7
|
+
* use the Grid Reports feature component instead.
|
|
8
|
+
*/
|
|
9
|
+
import * as React from "react"
|
|
10
|
+
import { cn } from "cn"
|
|
11
|
+
|
|
12
|
+
function Table({ className, ...props }: React.ComponentProps<"table">) {
|
|
13
|
+
return (
|
|
14
|
+
<div data-slot="table-container" className="relative w-full overflow-x-auto">
|
|
15
|
+
<table
|
|
16
|
+
data-slot="table"
|
|
17
|
+
className={cn("w-full caption-bottom text-sm", className)}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
|
|
25
|
+
return (
|
|
26
|
+
<thead data-slot="table-header" className={cn("[&_tr]:border-b", className)} {...props} />
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
|
|
31
|
+
return (
|
|
32
|
+
<tbody
|
|
33
|
+
data-slot="table-body"
|
|
34
|
+
className={cn("[&_tr:last-child]:border-0", className)}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
|
|
41
|
+
return (
|
|
42
|
+
<tfoot
|
|
43
|
+
data-slot="table-footer"
|
|
44
|
+
className={cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className)}
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
|
|
51
|
+
return (
|
|
52
|
+
<tr
|
|
53
|
+
data-slot="table-row"
|
|
54
|
+
className={cn(
|
|
55
|
+
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
|
|
56
|
+
className
|
|
57
|
+
)}
|
|
58
|
+
{...props}
|
|
59
|
+
/>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function TableHead({ className, ...props }: React.ComponentProps<"th">) {
|
|
64
|
+
return (
|
|
65
|
+
<th
|
|
66
|
+
data-slot="table-head"
|
|
67
|
+
className={cn(
|
|
68
|
+
"h-9 px-2.5 text-left align-middle font-medium text-muted-foreground whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
69
|
+
className
|
|
70
|
+
)}
|
|
71
|
+
{...props}
|
|
72
|
+
/>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function TableCell({ className, ...props }: React.ComponentProps<"td">) {
|
|
77
|
+
return (
|
|
78
|
+
<td
|
|
79
|
+
data-slot="table-cell"
|
|
80
|
+
className={cn(
|
|
81
|
+
"p-2.5 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
82
|
+
className
|
|
83
|
+
)}
|
|
84
|
+
{...props}
|
|
85
|
+
/>
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function TableCaption({ className, ...props }: React.ComponentProps<"caption">) {
|
|
90
|
+
return (
|
|
91
|
+
<caption
|
|
92
|
+
data-slot="table-caption"
|
|
93
|
+
className={cn("mt-4 text-sm text-muted-foreground", className)}
|
|
94
|
+
{...props}
|
|
95
|
+
/>
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export {
|
|
100
|
+
Table,
|
|
101
|
+
TableHeader,
|
|
102
|
+
TableBody,
|
|
103
|
+
TableFooter,
|
|
104
|
+
TableHead,
|
|
105
|
+
TableRow,
|
|
106
|
+
TableCell,
|
|
107
|
+
TableCaption,
|
|
108
|
+
}
|