@squadbase/vantage 0.6.2-dev1.a7c4a3e → 0.6.2-dev1.ac99e02
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-4GHF2TX2.js +6 -0
- package/dist/add-4GHF2TX2.js.map +1 -0
- package/dist/{build-JB4VOMUI.js → build-MFWRPYKW.js} +9 -9
- package/dist/{build-JB4VOMUI.js.map → build-MFWRPYKW.js.map} +1 -1
- package/dist/{check-ZJYK6RLG.js → check-ZBIH422T.js} +7 -7
- package/dist/{check-ZJYK6RLG.js.map → check-ZBIH422T.js.map} +1 -1
- package/dist/{chunk-BCE22JSM.js → chunk-7DZGJQ3P.js} +33 -14
- package/dist/chunk-7DZGJQ3P.js.map +1 -0
- package/dist/{chunk-U2M6HGKQ.js → chunk-AABMKHEU.js} +4 -4
- package/dist/{chunk-U2M6HGKQ.js.map → chunk-AABMKHEU.js.map} +1 -1
- package/dist/{chunk-MP3QSOXL.js → chunk-AG6RZ2RR.js} +992 -16
- package/dist/chunk-AG6RZ2RR.js.map +1 -0
- package/dist/{chunk-KLEIVDUV.js → chunk-CEXAQQ5W.js} +150 -11
- package/dist/chunk-CEXAQQ5W.js.map +1 -0
- package/dist/{chunk-QI3XQKHS.js → chunk-GNXCX4WE.js} +10 -3
- package/dist/chunk-GNXCX4WE.js.map +1 -0
- package/dist/chunk-IBGOCWJB.js +1716 -0
- package/dist/chunk-IBGOCWJB.js.map +1 -0
- package/dist/{chunk-JGRMRXXZ.js → chunk-JKLLFVEU.js} +3 -3
- package/dist/{chunk-JGRMRXXZ.js.map → chunk-JKLLFVEU.js.map} +1 -1
- package/dist/{chunk-RPZAALCX.js → chunk-OB6UBJXF.js} +153 -153
- package/dist/{chunk-RPZAALCX.js.map → chunk-OB6UBJXF.js.map} +1 -1
- package/dist/{chunk-EP6JHXSR.js → chunk-QEWCYW3I.js} +44 -9
- package/dist/chunk-QEWCYW3I.js.map +1 -0
- package/dist/{chunk-ZVANIULZ.js → chunk-RNTDBX6S.js} +4 -4
- package/dist/{chunk-ZVANIULZ.js.map → chunk-RNTDBX6S.js.map} +1 -1
- package/dist/{chunk-PVTHHV7X.js → chunk-V3LF7BE7.js} +27 -5
- package/dist/chunk-V3LF7BE7.js.map +1 -0
- package/dist/{chunk-DTDVSFRY.js → chunk-XQUSGIDG.js} +17 -3
- package/dist/chunk-XQUSGIDG.js.map +1 -0
- package/dist/cli.js +12 -11
- package/dist/cli.js.map +1 -1
- package/dist/client/index.d.ts +32 -3
- package/dist/client/index.js +205 -12
- package/dist/client/index.js.map +1 -1
- package/dist/components/index.d.ts +216 -1
- package/dist/components/index.js +2 -2
- package/dist/{dev-FCEC3UKQ.js → dev-DCTOHQ6W.js} +10 -10
- package/dist/dev-DCTOHQ6W.js.map +1 -0
- package/dist/{docs-EJJ3BECT.js → docs-JVP4RPKT.js} +3 -3
- package/dist/{docs-EJJ3BECT.js.map → docs-JVP4RPKT.js.map} +1 -1
- package/dist/{doctor-WHZXPERA.js → doctor-5E2VEZPK.js} +7 -7
- package/dist/{doctor-WHZXPERA.js.map → doctor-5E2VEZPK.js.map} +1 -1
- package/dist/{preview-OGMCNQUO.js → preview-T6CLSQVX.js} +3 -3
- package/dist/{preview-OGMCNQUO.js.map → preview-T6CLSQVX.js.map} +1 -1
- package/dist/query/index.d.ts +0 -11
- package/dist/query/index.js +2 -2
- package/dist/{routes-GTFO5PUF.js → routes-3SGAFDMC.js} +6 -6
- package/dist/{routes-GTFO5PUF.js.map → routes-3SGAFDMC.js.map} +1 -1
- package/dist/{search-6Y422SV6.js → search-5LC4XPB5.js} +3 -3
- package/dist/{search-6Y422SV6.js.map → search-5LC4XPB5.js.map} +1 -1
- package/dist/slide/index.js +47 -10
- package/dist/slide/index.js.map +1 -1
- package/dist/table/index.js +8 -7
- package/dist/table/index.js.map +1 -1
- package/dist/ui/index.d.ts +140 -10
- package/dist/ui/index.js +1405 -63
- package/dist/ui/index.js.map +1 -1
- package/dist/{upgrade-AL4KZZR4.js → upgrade-DBBE6GIR.js} +7 -7
- package/dist/{upgrade-AL4KZZR4.js.map → upgrade-DBBE6GIR.js.map} +1 -1
- package/dist/vite/index.d.ts +10 -0
- package/dist/vite/index.js +4 -4
- package/docs/index.json +291 -61
- package/docs/ja/changelog.md +26 -0
- package/docs/ja/components.md +33 -89
- package/docs/ja/page-types/csv.md +83 -0
- package/docs/ja/page-types/doc.md +83 -0
- package/docs/ja/page-types/excel.md +82 -0
- package/docs/ja/page-types/slide.md +132 -0
- package/docs/ja/page-types.md +47 -0
- package/docs/ja/parts/area-chart.md +61 -0
- package/docs/ja/parts/bar-chart.md +69 -0
- package/docs/ja/parts/bar-list.md +35 -0
- package/docs/ja/parts/category-bar.md +36 -0
- package/docs/ja/parts/donut-chart.md +47 -0
- package/docs/ja/parts/echart.md +3 -0
- package/docs/ja/parts/line-chart.md +58 -0
- package/docs/ja/parts/progress-circle.md +34 -0
- package/docs/ja/parts/sparkline.md +1 -1
- package/docs/ja/parts/tracker.md +32 -0
- package/docs/ja/routing.md +8 -86
- package/docs/ja/ui/alert-dialog.md +41 -0
- package/docs/ja/ui/avatar.md +31 -0
- package/docs/ja/ui/combobox.md +74 -0
- package/docs/ja/ui/drawer.md +41 -0
- package/docs/ja/ui/field.md +42 -0
- package/docs/ja/ui/hover-card.md +21 -0
- package/docs/ja/ui/kbd.md +16 -0
- package/docs/ja/ui/pagination.md +36 -0
- package/docs/ja/ui/radio-group.md +21 -0
- package/docs/ja/ui/toast.md +46 -0
- package/docs/ja/ui-and-theming.md +14 -7
- package/package.json +25 -13
- package/registry/ui/accordion.tsx +74 -0
- package/registry/ui/alert-dialog.tsx +189 -0
- package/registry/ui/alert.tsx +78 -0
- package/registry/ui/app-shell.tsx +281 -0
- package/registry/ui/area-chart.tsx +1015 -0
- package/registry/ui/avatar.tsx +110 -0
- package/registry/ui/badge.tsx +54 -0
- package/registry/ui/bar-chart.tsx +1013 -0
- package/registry/ui/bar-list.tsx +302 -0
- package/registry/ui/breadcrumb.tsx +126 -0
- package/registry/ui/button.tsx +60 -0
- package/registry/ui/calendar.tsx +221 -0
- package/registry/ui/card.tsx +105 -0
- package/registry/ui/category-bar.tsx +281 -0
- package/registry/ui/checkbox.tsx +28 -0
- package/registry/ui/collapsible.tsx +21 -0
- package/registry/ui/combobox.tsx +310 -0
- package/registry/ui/command.tsx +196 -0
- package/registry/ui/dashboard-card.tsx +174 -0
- package/registry/ui/data-table.tsx +16 -91
- package/registry/ui/date-range-picker.tsx +209 -0
- package/registry/ui/dialog.tsx +159 -0
- package/registry/ui/donut-chart.tsx +1004 -0
- package/registry/ui/drawer.tsx +229 -0
- package/registry/ui/dropdown-menu.tsx +272 -0
- package/registry/ui/echart.tsx +486 -0
- package/registry/ui/field.tsx +240 -0
- package/registry/ui/filter-bar.tsx +365 -0
- package/registry/ui/funnel-steps.tsx +274 -0
- package/registry/ui/hover-card.tsx +52 -0
- package/registry/ui/input-group.tsx +158 -0
- package/registry/ui/input.tsx +22 -0
- package/registry/ui/kbd.tsx +28 -0
- package/registry/ui/label.tsx +20 -0
- package/registry/ui/line-chart.tsx +1007 -0
- package/registry/ui/metric-value.tsx +54 -0
- package/registry/ui/multi-select.tsx +226 -0
- package/registry/ui/page-shell.tsx +227 -0
- package/registry/ui/pagination.tsx +138 -0
- package/registry/ui/placeholder.tsx +30 -0
- package/registry/ui/popover.tsx +90 -0
- package/registry/ui/progress-circle.tsx +272 -0
- package/registry/ui/progress.tsx +83 -0
- package/registry/ui/radio-group.tsx +39 -0
- package/registry/ui/scroll-area.tsx +55 -0
- package/registry/ui/searchable-select.tsx +209 -0
- package/registry/ui/section-header.tsx +41 -0
- package/registry/ui/segmented-control.tsx +71 -0
- package/registry/ui/select.tsx +253 -0
- package/registry/ui/separator.tsx +25 -0
- package/registry/ui/sheet.tsx +137 -0
- package/registry/ui/sidebar.tsx +723 -0
- package/registry/ui/skeleton.tsx +15 -0
- package/registry/ui/slider.tsx +54 -0
- package/registry/ui/sparkline.tsx +155 -0
- package/registry/ui/spinner.tsx +12 -0
- package/registry/ui/states.tsx +61 -0
- package/registry/ui/status-badge.tsx +79 -0
- package/registry/ui/switch.tsx +32 -0
- package/registry/ui/table.tsx +116 -0
- package/registry/ui/tabs.tsx +82 -0
- package/registry/ui/textarea.tsx +20 -0
- package/registry/ui/toast.tsx +250 -0
- package/registry/ui/toggle-group.tsx +89 -0
- package/registry/ui/toggle.tsx +45 -0
- package/registry/ui/tooltip.tsx +66 -0
- package/registry/ui/tracker.tsx +236 -0
- package/registry/ui/trend-indicator.tsx +62 -0
- package/skills/vantage-add-feature/SKILL.md +9 -7
- package/skills/vantage-design/SKILL.md +3 -1
- package/skills/vantage-design/references/format.md +1 -1
- package/skills/vantage-pitfalls/SKILL.md +5 -1
- package/skills/vantage-slide/SKILL.md +17 -0
- package/templates/AGENTS.md +10 -1
- package/templates/agents/api.md +29 -0
- package/templates/agents/csv.md +2 -1
- package/templates/agents/doc.md +4 -3
- package/templates/agents/page.md +22 -8
- package/templates/agents/slide.md +13 -1
- package/templates/agents/xlsx.md +2 -1
- package/theme.css +7 -1
- package/dist/add-DY4AXANK.js +0 -6
- package/dist/add-DY4AXANK.js.map +0 -1
- package/dist/chunk-BCE22JSM.js.map +0 -1
- package/dist/chunk-DTDVSFRY.js.map +0 -1
- package/dist/chunk-EP6JHXSR.js.map +0 -1
- package/dist/chunk-KLEIVDUV.js.map +0 -1
- package/dist/chunk-MP3QSOXL.js.map +0 -1
- package/dist/chunk-PVTHHV7X.js.map +0 -1
- package/dist/chunk-QI3XQKHS.js.map +0 -1
- package/dist/chunk-T3FLAGI6.js +0 -316
- package/dist/chunk-T3FLAGI6.js.map +0 -1
- package/dist/dev-FCEC3UKQ.js.map +0 -1
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
// Copied by `vantage add ui combobox`. This file is yours to edit.
|
|
2
|
+
// Generated from @squadbase/vantage src/ui/combobox.tsx by `npm run registry` (in Vantage, edit src/, not registry/).
|
|
3
|
+
"use client"
|
|
4
|
+
|
|
5
|
+
import * as React from "react"
|
|
6
|
+
import { Combobox as ComboboxPrimitive } from "@base-ui/react/combobox"
|
|
7
|
+
import { cn } from "@squadbase/vantage/ui"
|
|
8
|
+
|
|
9
|
+
import { Button } from "@squadbase/vantage/ui"
|
|
10
|
+
import {
|
|
11
|
+
InputGroup,
|
|
12
|
+
InputGroupAddon,
|
|
13
|
+
InputGroupButton,
|
|
14
|
+
InputGroupInput,
|
|
15
|
+
} from "@squadbase/vantage/ui"
|
|
16
|
+
import { CheckIcon, ChevronDownIcon, XIcon } from "lucide-react"
|
|
17
|
+
|
|
18
|
+
const Combobox = ComboboxPrimitive.Root
|
|
19
|
+
|
|
20
|
+
function ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props) {
|
|
21
|
+
return <ComboboxPrimitive.Value data-slot="combobox-value" {...props} />
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function ComboboxTrigger({
|
|
25
|
+
className,
|
|
26
|
+
children,
|
|
27
|
+
...props
|
|
28
|
+
}: ComboboxPrimitive.Trigger.Props) {
|
|
29
|
+
return (
|
|
30
|
+
<ComboboxPrimitive.Trigger
|
|
31
|
+
data-slot="combobox-trigger"
|
|
32
|
+
className={cn("[&_svg:not([class*='size-'])]:size-4", className)}
|
|
33
|
+
{...props}
|
|
34
|
+
>
|
|
35
|
+
{children}
|
|
36
|
+
<ChevronDownIcon
|
|
37
|
+
className="pointer-events-none size-4 text-muted-foreground"
|
|
38
|
+
/>
|
|
39
|
+
</ComboboxPrimitive.Trigger>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function ComboboxClear({ className, ...props }: ComboboxPrimitive.Clear.Props) {
|
|
44
|
+
return (
|
|
45
|
+
<ComboboxPrimitive.Clear
|
|
46
|
+
data-slot="combobox-clear"
|
|
47
|
+
render={<InputGroupButton variant="ghost" size="icon-xs" />}
|
|
48
|
+
className={cn(className)}
|
|
49
|
+
{...props}
|
|
50
|
+
>
|
|
51
|
+
<XIcon
|
|
52
|
+
className="pointer-events-none"
|
|
53
|
+
/>
|
|
54
|
+
</ComboboxPrimitive.Clear>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function ComboboxInput({
|
|
59
|
+
className,
|
|
60
|
+
children,
|
|
61
|
+
disabled = false,
|
|
62
|
+
showTrigger = true,
|
|
63
|
+
showClear = false,
|
|
64
|
+
...props
|
|
65
|
+
}: ComboboxPrimitive.Input.Props & {
|
|
66
|
+
showTrigger?: boolean
|
|
67
|
+
showClear?: boolean
|
|
68
|
+
}) {
|
|
69
|
+
return (
|
|
70
|
+
<InputGroup className={cn("w-auto", className)}>
|
|
71
|
+
<ComboboxPrimitive.Input
|
|
72
|
+
render={<InputGroupInput disabled={disabled} />}
|
|
73
|
+
{...props}
|
|
74
|
+
/>
|
|
75
|
+
<InputGroupAddon align="inline-end">
|
|
76
|
+
{showTrigger && (
|
|
77
|
+
<InputGroupButton
|
|
78
|
+
size="icon-xs"
|
|
79
|
+
variant="ghost"
|
|
80
|
+
render={<ComboboxTrigger />}
|
|
81
|
+
data-slot="input-group-button"
|
|
82
|
+
className="group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent"
|
|
83
|
+
disabled={disabled}
|
|
84
|
+
/>
|
|
85
|
+
)}
|
|
86
|
+
{showClear && <ComboboxClear disabled={disabled} />}
|
|
87
|
+
</InputGroupAddon>
|
|
88
|
+
{children}
|
|
89
|
+
</InputGroup>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function ComboboxContent({
|
|
94
|
+
className,
|
|
95
|
+
side = "bottom",
|
|
96
|
+
sideOffset = 6,
|
|
97
|
+
align = "start",
|
|
98
|
+
alignOffset = 0,
|
|
99
|
+
anchor,
|
|
100
|
+
...props
|
|
101
|
+
}: ComboboxPrimitive.Popup.Props &
|
|
102
|
+
Pick<
|
|
103
|
+
ComboboxPrimitive.Positioner.Props,
|
|
104
|
+
"side" | "align" | "sideOffset" | "alignOffset" | "anchor"
|
|
105
|
+
>) {
|
|
106
|
+
return (
|
|
107
|
+
<ComboboxPrimitive.Portal>
|
|
108
|
+
<ComboboxPrimitive.Positioner
|
|
109
|
+
side={side}
|
|
110
|
+
sideOffset={sideOffset}
|
|
111
|
+
align={align}
|
|
112
|
+
alignOffset={alignOffset}
|
|
113
|
+
anchor={anchor}
|
|
114
|
+
className="isolate z-50"
|
|
115
|
+
>
|
|
116
|
+
<ComboboxPrimitive.Popup
|
|
117
|
+
data-slot="combobox-content"
|
|
118
|
+
data-chips={!!anchor}
|
|
119
|
+
className={cn(
|
|
120
|
+
"cn-menu-target cn-menu-translucent group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none 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",
|
|
121
|
+
className
|
|
122
|
+
)}
|
|
123
|
+
{...props}
|
|
124
|
+
/>
|
|
125
|
+
</ComboboxPrimitive.Positioner>
|
|
126
|
+
</ComboboxPrimitive.Portal>
|
|
127
|
+
)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {
|
|
131
|
+
return (
|
|
132
|
+
<ComboboxPrimitive.List
|
|
133
|
+
data-slot="combobox-list"
|
|
134
|
+
className={cn(
|
|
135
|
+
"no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0",
|
|
136
|
+
className
|
|
137
|
+
)}
|
|
138
|
+
{...props}
|
|
139
|
+
/>
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function ComboboxItem({
|
|
144
|
+
className,
|
|
145
|
+
children,
|
|
146
|
+
...props
|
|
147
|
+
}: ComboboxPrimitive.Item.Props) {
|
|
148
|
+
return (
|
|
149
|
+
<ComboboxPrimitive.Item
|
|
150
|
+
data-slot="combobox-item"
|
|
151
|
+
className={cn(
|
|
152
|
+
"relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**: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",
|
|
153
|
+
className
|
|
154
|
+
)}
|
|
155
|
+
{...props}
|
|
156
|
+
>
|
|
157
|
+
{children}
|
|
158
|
+
<ComboboxPrimitive.ItemIndicator
|
|
159
|
+
render={
|
|
160
|
+
<span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center" />
|
|
161
|
+
}
|
|
162
|
+
>
|
|
163
|
+
<CheckIcon
|
|
164
|
+
className="pointer-events-none"
|
|
165
|
+
/>
|
|
166
|
+
</ComboboxPrimitive.ItemIndicator>
|
|
167
|
+
</ComboboxPrimitive.Item>
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group.Props) {
|
|
172
|
+
return (
|
|
173
|
+
<ComboboxPrimitive.Group
|
|
174
|
+
data-slot="combobox-group"
|
|
175
|
+
className={cn(className)}
|
|
176
|
+
{...props}
|
|
177
|
+
/>
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function ComboboxLabel({
|
|
182
|
+
className,
|
|
183
|
+
...props
|
|
184
|
+
}: ComboboxPrimitive.GroupLabel.Props) {
|
|
185
|
+
return (
|
|
186
|
+
<ComboboxPrimitive.GroupLabel
|
|
187
|
+
data-slot="combobox-label"
|
|
188
|
+
className={cn("px-2 py-1.5 text-xs text-muted-foreground", className)}
|
|
189
|
+
{...props}
|
|
190
|
+
/>
|
|
191
|
+
)
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props) {
|
|
195
|
+
return (
|
|
196
|
+
<ComboboxPrimitive.Collection data-slot="combobox-collection" {...props} />
|
|
197
|
+
)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props) {
|
|
201
|
+
return (
|
|
202
|
+
<ComboboxPrimitive.Empty
|
|
203
|
+
data-slot="combobox-empty"
|
|
204
|
+
className={cn(
|
|
205
|
+
"hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex",
|
|
206
|
+
className
|
|
207
|
+
)}
|
|
208
|
+
{...props}
|
|
209
|
+
/>
|
|
210
|
+
)
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function ComboboxSeparator({
|
|
214
|
+
className,
|
|
215
|
+
...props
|
|
216
|
+
}: ComboboxPrimitive.Separator.Props) {
|
|
217
|
+
return (
|
|
218
|
+
<ComboboxPrimitive.Separator
|
|
219
|
+
data-slot="combobox-separator"
|
|
220
|
+
className={cn("-mx-1 my-1 h-px bg-border", className)}
|
|
221
|
+
{...props}
|
|
222
|
+
/>
|
|
223
|
+
)
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function ComboboxChips({
|
|
227
|
+
className,
|
|
228
|
+
...props
|
|
229
|
+
}: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> &
|
|
230
|
+
ComboboxPrimitive.Chips.Props) {
|
|
231
|
+
return (
|
|
232
|
+
<ComboboxPrimitive.Chips
|
|
233
|
+
data-slot="combobox-chips"
|
|
234
|
+
className={cn(
|
|
235
|
+
"flex min-h-8 flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40",
|
|
236
|
+
className
|
|
237
|
+
)}
|
|
238
|
+
{...props}
|
|
239
|
+
/>
|
|
240
|
+
)
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function ComboboxChip({
|
|
244
|
+
className,
|
|
245
|
+
children,
|
|
246
|
+
showRemove = true,
|
|
247
|
+
...props
|
|
248
|
+
}: ComboboxPrimitive.Chip.Props & {
|
|
249
|
+
showRemove?: boolean
|
|
250
|
+
}) {
|
|
251
|
+
return (
|
|
252
|
+
<ComboboxPrimitive.Chip
|
|
253
|
+
data-slot="combobox-chip"
|
|
254
|
+
className={cn(
|
|
255
|
+
"flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0",
|
|
256
|
+
className
|
|
257
|
+
)}
|
|
258
|
+
{...props}
|
|
259
|
+
>
|
|
260
|
+
{children}
|
|
261
|
+
{showRemove && (
|
|
262
|
+
<ComboboxPrimitive.ChipRemove
|
|
263
|
+
render={<Button variant="ghost" size="icon-xs" />}
|
|
264
|
+
className="-ml-1 opacity-50 hover:opacity-100"
|
|
265
|
+
data-slot="combobox-chip-remove"
|
|
266
|
+
>
|
|
267
|
+
<XIcon
|
|
268
|
+
className="pointer-events-none"
|
|
269
|
+
/>
|
|
270
|
+
</ComboboxPrimitive.ChipRemove>
|
|
271
|
+
)}
|
|
272
|
+
</ComboboxPrimitive.Chip>
|
|
273
|
+
)
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function ComboboxChipsInput({
|
|
277
|
+
className,
|
|
278
|
+
...props
|
|
279
|
+
}: ComboboxPrimitive.Input.Props) {
|
|
280
|
+
return (
|
|
281
|
+
<ComboboxPrimitive.Input
|
|
282
|
+
data-slot="combobox-chip-input"
|
|
283
|
+
className={cn("min-w-16 flex-1 outline-none", className)}
|
|
284
|
+
{...props}
|
|
285
|
+
/>
|
|
286
|
+
)
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function useComboboxAnchor() {
|
|
290
|
+
return React.useRef<HTMLDivElement | null>(null)
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export {
|
|
294
|
+
Combobox,
|
|
295
|
+
ComboboxInput,
|
|
296
|
+
ComboboxContent,
|
|
297
|
+
ComboboxList,
|
|
298
|
+
ComboboxItem,
|
|
299
|
+
ComboboxGroup,
|
|
300
|
+
ComboboxLabel,
|
|
301
|
+
ComboboxCollection,
|
|
302
|
+
ComboboxEmpty,
|
|
303
|
+
ComboboxSeparator,
|
|
304
|
+
ComboboxChips,
|
|
305
|
+
ComboboxChip,
|
|
306
|
+
ComboboxChipsInput,
|
|
307
|
+
ComboboxTrigger,
|
|
308
|
+
ComboboxValue,
|
|
309
|
+
useComboboxAnchor,
|
|
310
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
// Copied by `vantage add ui command`. This file is yours to edit.
|
|
2
|
+
// Generated from @squadbase/vantage src/ui/command.tsx by `npm run registry` (in Vantage, edit src/, not registry/).
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Command as CommandPrimitive } from "cmdk"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@squadbase/vantage/ui"
|
|
7
|
+
import {
|
|
8
|
+
Dialog,
|
|
9
|
+
DialogContent,
|
|
10
|
+
DialogDescription,
|
|
11
|
+
DialogHeader,
|
|
12
|
+
DialogTitle,
|
|
13
|
+
} from "@squadbase/vantage/ui"
|
|
14
|
+
import {
|
|
15
|
+
InputGroup,
|
|
16
|
+
InputGroupAddon,
|
|
17
|
+
} from "@squadbase/vantage/ui"
|
|
18
|
+
import { CheckIcon, SearchIcon } from "lucide-react"
|
|
19
|
+
|
|
20
|
+
function Command({
|
|
21
|
+
className,
|
|
22
|
+
...props
|
|
23
|
+
}: React.ComponentProps<typeof CommandPrimitive>) {
|
|
24
|
+
return (
|
|
25
|
+
<CommandPrimitive
|
|
26
|
+
data-slot="command"
|
|
27
|
+
className={cn(
|
|
28
|
+
"flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",
|
|
29
|
+
className
|
|
30
|
+
)}
|
|
31
|
+
{...props}
|
|
32
|
+
/>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function CommandDialog({
|
|
37
|
+
title = "Command Palette",
|
|
38
|
+
description = "Search for a command to run...",
|
|
39
|
+
children,
|
|
40
|
+
className,
|
|
41
|
+
showCloseButton = false,
|
|
42
|
+
...props
|
|
43
|
+
}: Omit<React.ComponentProps<typeof Dialog>, "children"> & {
|
|
44
|
+
title?: string
|
|
45
|
+
description?: string
|
|
46
|
+
className?: string
|
|
47
|
+
showCloseButton?: boolean
|
|
48
|
+
children: React.ReactNode
|
|
49
|
+
}) {
|
|
50
|
+
return (
|
|
51
|
+
<Dialog {...props}>
|
|
52
|
+
<DialogHeader className="sr-only">
|
|
53
|
+
<DialogTitle>{title}</DialogTitle>
|
|
54
|
+
<DialogDescription>{description}</DialogDescription>
|
|
55
|
+
</DialogHeader>
|
|
56
|
+
<DialogContent
|
|
57
|
+
className={cn(
|
|
58
|
+
"top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0",
|
|
59
|
+
className
|
|
60
|
+
)}
|
|
61
|
+
showCloseButton={showCloseButton}
|
|
62
|
+
>
|
|
63
|
+
{children}
|
|
64
|
+
</DialogContent>
|
|
65
|
+
</Dialog>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function CommandInput({
|
|
70
|
+
className,
|
|
71
|
+
...props
|
|
72
|
+
}: React.ComponentProps<typeof CommandPrimitive.Input>) {
|
|
73
|
+
return (
|
|
74
|
+
<div data-slot="command-input-wrapper" className="p-1 pb-0">
|
|
75
|
+
<InputGroup className="h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!">
|
|
76
|
+
<CommandPrimitive.Input
|
|
77
|
+
data-slot="command-input"
|
|
78
|
+
className={cn(
|
|
79
|
+
"w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
|
|
80
|
+
className
|
|
81
|
+
)}
|
|
82
|
+
{...props}
|
|
83
|
+
/>
|
|
84
|
+
<InputGroupAddon>
|
|
85
|
+
<SearchIcon className="size-4 shrink-0 opacity-50" />
|
|
86
|
+
</InputGroupAddon>
|
|
87
|
+
</InputGroup>
|
|
88
|
+
</div>
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function CommandList({
|
|
93
|
+
className,
|
|
94
|
+
...props
|
|
95
|
+
}: React.ComponentProps<typeof CommandPrimitive.List>) {
|
|
96
|
+
return (
|
|
97
|
+
<CommandPrimitive.List
|
|
98
|
+
data-slot="command-list"
|
|
99
|
+
className={cn(
|
|
100
|
+
"no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",
|
|
101
|
+
className
|
|
102
|
+
)}
|
|
103
|
+
{...props}
|
|
104
|
+
/>
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function CommandEmpty({
|
|
109
|
+
className,
|
|
110
|
+
...props
|
|
111
|
+
}: React.ComponentProps<typeof CommandPrimitive.Empty>) {
|
|
112
|
+
return (
|
|
113
|
+
<CommandPrimitive.Empty
|
|
114
|
+
data-slot="command-empty"
|
|
115
|
+
className={cn("py-6 text-center text-sm", className)}
|
|
116
|
+
{...props}
|
|
117
|
+
/>
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function CommandGroup({
|
|
122
|
+
className,
|
|
123
|
+
...props
|
|
124
|
+
}: React.ComponentProps<typeof CommandPrimitive.Group>) {
|
|
125
|
+
return (
|
|
126
|
+
<CommandPrimitive.Group
|
|
127
|
+
data-slot="command-group"
|
|
128
|
+
className={cn(
|
|
129
|
+
"overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",
|
|
130
|
+
className
|
|
131
|
+
)}
|
|
132
|
+
{...props}
|
|
133
|
+
/>
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function CommandSeparator({
|
|
138
|
+
className,
|
|
139
|
+
...props
|
|
140
|
+
}: React.ComponentProps<typeof CommandPrimitive.Separator>) {
|
|
141
|
+
return (
|
|
142
|
+
<CommandPrimitive.Separator
|
|
143
|
+
data-slot="command-separator"
|
|
144
|
+
className={cn("-mx-1 h-px bg-border", className)}
|
|
145
|
+
{...props}
|
|
146
|
+
/>
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function CommandItem({
|
|
151
|
+
className,
|
|
152
|
+
children,
|
|
153
|
+
...props
|
|
154
|
+
}: React.ComponentProps<typeof CommandPrimitive.Item>) {
|
|
155
|
+
return (
|
|
156
|
+
<CommandPrimitive.Item
|
|
157
|
+
data-slot="command-item"
|
|
158
|
+
className={cn(
|
|
159
|
+
"group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",
|
|
160
|
+
className
|
|
161
|
+
)}
|
|
162
|
+
{...props}
|
|
163
|
+
>
|
|
164
|
+
{children}
|
|
165
|
+
<CheckIcon className="ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" />
|
|
166
|
+
</CommandPrimitive.Item>
|
|
167
|
+
)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function CommandShortcut({
|
|
171
|
+
className,
|
|
172
|
+
...props
|
|
173
|
+
}: React.ComponentProps<"span">) {
|
|
174
|
+
return (
|
|
175
|
+
<span
|
|
176
|
+
data-slot="command-shortcut"
|
|
177
|
+
className={cn(
|
|
178
|
+
"ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground",
|
|
179
|
+
className
|
|
180
|
+
)}
|
|
181
|
+
{...props}
|
|
182
|
+
/>
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export {
|
|
187
|
+
Command,
|
|
188
|
+
CommandDialog,
|
|
189
|
+
CommandInput,
|
|
190
|
+
CommandList,
|
|
191
|
+
CommandEmpty,
|
|
192
|
+
CommandGroup,
|
|
193
|
+
CommandItem,
|
|
194
|
+
CommandShortcut,
|
|
195
|
+
CommandSeparator,
|
|
196
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
// Copied by `vantage add ui dashboard-card`. This file is yours to edit.
|
|
2
|
+
// Generated from @squadbase/vantage src/components/dashboard-card.tsx by `npm run registry` (in Vantage, edit src/, not registry/).
|
|
3
|
+
/**
|
|
4
|
+
* DashboardCard — the tighter card used for dashboard tiles: smaller padding
|
|
5
|
+
* than the plain `Card`, a title/description/action header, and a matching
|
|
6
|
+
* skeleton for the loading state. `DashboardCardPreset` wires the common
|
|
7
|
+
* arrangement in one prop-driven component.
|
|
8
|
+
*/
|
|
9
|
+
import { forwardRef, type HTMLAttributes, type ReactNode } from "react"
|
|
10
|
+
|
|
11
|
+
import { cn } from "@squadbase/vantage/ui"
|
|
12
|
+
import { Skeleton } from "@squadbase/vantage/ui"
|
|
13
|
+
|
|
14
|
+
export interface DashboardCardProps extends HTMLAttributes<HTMLDivElement> {}
|
|
15
|
+
|
|
16
|
+
export const DashboardCard = forwardRef<HTMLDivElement, DashboardCardProps>(
|
|
17
|
+
({ className, ...props }, ref) => (
|
|
18
|
+
<div
|
|
19
|
+
ref={ref}
|
|
20
|
+
data-slot="dashboard-card"
|
|
21
|
+
className={cn(
|
|
22
|
+
"group rounded-lg border bg-card px-1 py-1 text-card-foreground",
|
|
23
|
+
className,
|
|
24
|
+
)}
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
),
|
|
28
|
+
)
|
|
29
|
+
DashboardCard.displayName = "DashboardCard"
|
|
30
|
+
|
|
31
|
+
export interface DashboardCardHeaderProps extends HTMLAttributes<HTMLDivElement> {}
|
|
32
|
+
|
|
33
|
+
export const DashboardCardHeader = forwardRef<HTMLDivElement, DashboardCardHeaderProps>(
|
|
34
|
+
({ className, ...props }, ref) => (
|
|
35
|
+
<div
|
|
36
|
+
ref={ref}
|
|
37
|
+
data-slot="dashboard-card-header"
|
|
38
|
+
className={cn("flex flex-row items-start justify-between gap-4 px-3 py-3", className)}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
),
|
|
42
|
+
)
|
|
43
|
+
DashboardCardHeader.displayName = "DashboardCardHeader"
|
|
44
|
+
|
|
45
|
+
export interface DashboardCardTitleProps extends HTMLAttributes<HTMLHeadingElement> {}
|
|
46
|
+
|
|
47
|
+
export const DashboardCardTitle = forwardRef<HTMLHeadingElement, DashboardCardTitleProps>(
|
|
48
|
+
({ className, ...props }, ref) => (
|
|
49
|
+
<h3
|
|
50
|
+
ref={ref}
|
|
51
|
+
data-slot="dashboard-card-title"
|
|
52
|
+
className={cn("text-sm leading-none font-semibold tracking-tight", className)}
|
|
53
|
+
{...props}
|
|
54
|
+
/>
|
|
55
|
+
),
|
|
56
|
+
)
|
|
57
|
+
DashboardCardTitle.displayName = "DashboardCardTitle"
|
|
58
|
+
|
|
59
|
+
export interface DashboardCardDescriptionProps extends HTMLAttributes<HTMLParagraphElement> {}
|
|
60
|
+
|
|
61
|
+
export const DashboardCardDescription = forwardRef<
|
|
62
|
+
HTMLParagraphElement,
|
|
63
|
+
DashboardCardDescriptionProps
|
|
64
|
+
>(({ className, ...props }, ref) => (
|
|
65
|
+
<p
|
|
66
|
+
ref={ref}
|
|
67
|
+
data-slot="dashboard-card-description"
|
|
68
|
+
className={cn("text-xs text-muted-foreground", className)}
|
|
69
|
+
{...props}
|
|
70
|
+
/>
|
|
71
|
+
))
|
|
72
|
+
DashboardCardDescription.displayName = "DashboardCardDescription"
|
|
73
|
+
|
|
74
|
+
export interface DashboardCardActionProps extends HTMLAttributes<HTMLDivElement> {}
|
|
75
|
+
|
|
76
|
+
export const DashboardCardAction = forwardRef<HTMLDivElement, DashboardCardActionProps>(
|
|
77
|
+
({ className, ...props }, ref) => (
|
|
78
|
+
<div
|
|
79
|
+
ref={ref}
|
|
80
|
+
data-slot="dashboard-card-action"
|
|
81
|
+
className={cn("ml-auto shrink-0", className)}
|
|
82
|
+
{...props}
|
|
83
|
+
/>
|
|
84
|
+
),
|
|
85
|
+
)
|
|
86
|
+
DashboardCardAction.displayName = "DashboardCardAction"
|
|
87
|
+
|
|
88
|
+
export interface DashboardCardContentProps extends HTMLAttributes<HTMLDivElement> {}
|
|
89
|
+
|
|
90
|
+
export const DashboardCardContent = forwardRef<HTMLDivElement, DashboardCardContentProps>(
|
|
91
|
+
({ className, ...props }, ref) => (
|
|
92
|
+
<div ref={ref} data-slot="dashboard-card-content" className={cn("p-3", className)} {...props} />
|
|
93
|
+
),
|
|
94
|
+
)
|
|
95
|
+
DashboardCardContent.displayName = "DashboardCardContent"
|
|
96
|
+
|
|
97
|
+
export interface DashboardCardFooterProps extends HTMLAttributes<HTMLDivElement> {}
|
|
98
|
+
|
|
99
|
+
export const DashboardCardFooter = forwardRef<HTMLDivElement, DashboardCardFooterProps>(
|
|
100
|
+
({ className, ...props }, ref) => (
|
|
101
|
+
<div
|
|
102
|
+
ref={ref}
|
|
103
|
+
data-slot="dashboard-card-footer"
|
|
104
|
+
className={cn("flex items-center px-3 py-1.5", className)}
|
|
105
|
+
{...props}
|
|
106
|
+
/>
|
|
107
|
+
),
|
|
108
|
+
)
|
|
109
|
+
DashboardCardFooter.displayName = "DashboardCardFooter"
|
|
110
|
+
|
|
111
|
+
export interface DashboardCardSkeletonProps {
|
|
112
|
+
className?: string
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function DashboardCardSkeleton({ className }: DashboardCardSkeletonProps) {
|
|
116
|
+
return (
|
|
117
|
+
<div
|
|
118
|
+
data-slot="dashboard-card-skeleton"
|
|
119
|
+
className={cn("rounded-lg border bg-card p-6 shadow-sm", className)}
|
|
120
|
+
>
|
|
121
|
+
<div className="flex items-start justify-between gap-4 pb-4">
|
|
122
|
+
<Skeleton className="h-5 w-32" />
|
|
123
|
+
<Skeleton className="h-8 w-8 rounded-md" />
|
|
124
|
+
</div>
|
|
125
|
+
<Skeleton className="h-4 w-full" />
|
|
126
|
+
<Skeleton className="mt-2 h-4 w-3/4" />
|
|
127
|
+
</div>
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface DashboardCardPresetProps
|
|
132
|
+
extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
133
|
+
title?: ReactNode
|
|
134
|
+
description?: ReactNode
|
|
135
|
+
actions?: ReactNode
|
|
136
|
+
footer?: ReactNode
|
|
137
|
+
headerClassName?: string
|
|
138
|
+
contentClassName?: string
|
|
139
|
+
footerClassName?: string
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export function DashboardCardPreset({
|
|
143
|
+
title,
|
|
144
|
+
description,
|
|
145
|
+
actions,
|
|
146
|
+
footer,
|
|
147
|
+
children,
|
|
148
|
+
headerClassName,
|
|
149
|
+
contentClassName,
|
|
150
|
+
footerClassName,
|
|
151
|
+
className,
|
|
152
|
+
...props
|
|
153
|
+
}: DashboardCardPresetProps) {
|
|
154
|
+
const hasHeader = title || description || actions
|
|
155
|
+
return (
|
|
156
|
+
<DashboardCard className={className} {...props}>
|
|
157
|
+
{hasHeader && (
|
|
158
|
+
<DashboardCardHeader className={headerClassName}>
|
|
159
|
+
{(title || description) && (
|
|
160
|
+
<div>
|
|
161
|
+
{title && <DashboardCardTitle>{title}</DashboardCardTitle>}
|
|
162
|
+
{description && <DashboardCardDescription>{description}</DashboardCardDescription>}
|
|
163
|
+
</div>
|
|
164
|
+
)}
|
|
165
|
+
{actions && <DashboardCardAction>{actions}</DashboardCardAction>}
|
|
166
|
+
</DashboardCardHeader>
|
|
167
|
+
)}
|
|
168
|
+
{children && (
|
|
169
|
+
<DashboardCardContent className={contentClassName}>{children}</DashboardCardContent>
|
|
170
|
+
)}
|
|
171
|
+
{footer && <DashboardCardFooter className={footerClassName}>{footer}</DashboardCardFooter>}
|
|
172
|
+
</DashboardCard>
|
|
173
|
+
)
|
|
174
|
+
}
|