@squadbase/vantage 0.6.2-dev1.b332e5a → 0.6.2-dev1.d7c0911
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-TVKFIVFQ.js → build-X5NVCQKT.js} +7 -7
- package/dist/{build-TVKFIVFQ.js.map → build-X5NVCQKT.js.map} +1 -1
- package/dist/{check-3KHZXZMQ.js → check-ZBIH422T.js} +5 -5
- package/dist/{check-3KHZXZMQ.js.map → check-ZBIH422T.js.map} +1 -1
- package/dist/chunk-2ICNHUG6.js +1820 -0
- package/dist/chunk-2ICNHUG6.js.map +1 -0
- package/dist/{chunk-5ZOP4SQR.js → chunk-2N72FKLB.js} +12 -7
- package/dist/chunk-2N72FKLB.js.map +1 -0
- package/dist/{chunk-P7W4LR3Z.js → chunk-7DZGJQ3P.js} +3 -3
- package/dist/{chunk-P7W4LR3Z.js.map → chunk-7DZGJQ3P.js.map} +1 -1
- 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-QI3XQKHS.js → chunk-GNXCX4WE.js} +10 -3
- package/dist/chunk-GNXCX4WE.js.map +1 -0
- package/dist/{chunk-PXRX5PEC.js → chunk-PDOBHMUQ.js} +3 -3
- package/dist/chunk-PDOBHMUQ.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-A2UUGASH.js → chunk-U736PVHY.js} +2 -2
- package/dist/chunk-U736PVHY.js.map +1 -0
- package/dist/{chunk-PVTHHV7X.js → chunk-V3LF7BE7.js} +27 -5
- package/dist/chunk-V3LF7BE7.js.map +1 -0
- package/dist/{chunk-LMUACBMA.js → chunk-WAMZWZJB.js} +53 -8
- package/dist/chunk-WAMZWZJB.js.map +1 -0
- package/dist/chunk-WRSX2MDK.js +7866 -0
- package/dist/chunk-WRSX2MDK.js.map +1 -0
- package/dist/{chunk-RPZAALCX.js → chunk-XPQSTZUU.js} +254 -164
- package/dist/chunk-XPQSTZUU.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 +1975 -28
- package/dist/components/index.js +4 -4
- package/dist/{dev-GDKATCC7.js → dev-4XEDTELV.js} +8 -8
- package/dist/dev-4XEDTELV.js.map +1 -0
- package/dist/doc/index.js +2 -2
- package/dist/doc/index.js.map +1 -1
- 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-WQXPXP6K.js → doctor-5E2VEZPK.js} +5 -5
- package/dist/{doctor-WQXPXP6K.js.map → doctor-5E2VEZPK.js.map} +1 -1
- package/dist/markdown/index.js +1 -1
- package/dist/markdown/index.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-MWBWWOJ2.js → routes-3SGAFDMC.js} +4 -4
- package/dist/{routes-MWBWWOJ2.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/table/index.js +10 -9
- package/dist/table/index.js.map +1 -1
- package/dist/ui/index.d.ts +144 -11
- package/dist/ui/index.js +1339 -87
- package/dist/ui/index.js.map +1 -1
- package/dist/{upgrade-HCANX4GQ.js → upgrade-JHXZBGQS.js} +6 -6
- package/dist/{upgrade-HCANX4GQ.js.map → upgrade-JHXZBGQS.js.map} +1 -1
- package/dist/vite/index.d.ts +10 -0
- package/dist/vite/index.js +3 -3
- package/docs/en/components.md +29 -15
- package/docs/en/parts/data-table.md +22 -0
- package/docs/en/parts/delta.md +50 -0
- package/docs/en/parts/format.md +43 -0
- package/docs/en/parts/kpi-card.md +57 -0
- package/docs/en/parts/metric-value.md +3 -2
- package/docs/en/parts/sparkline.md +1 -1
- package/docs/en/parts/trend-indicator.md +17 -1
- package/docs/en/ui-and-theming.md +1 -1
- package/docs/index.json +366 -76
- package/docs/ja/changelog.md +31 -0
- package/docs/ja/components.md +57 -101
- 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/data-table.md +22 -0
- package/docs/ja/parts/delta.md +50 -0
- package/docs/ja/parts/donut-chart.md +47 -0
- package/docs/ja/parts/echart.md +3 -0
- package/docs/ja/parts/format.md +44 -0
- package/docs/ja/parts/kpi-card.md +55 -0
- package/docs/ja/parts/line-chart.md +58 -0
- package/docs/ja/parts/metric-value.md +3 -2
- package/docs/ja/parts/progress-circle.md +34 -0
- package/docs/ja/parts/sparkline.md +2 -2
- package/docs/ja/parts/tracker.md +32 -0
- package/docs/ja/parts/trend-indicator.md +17 -1
- 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 +13 -4
- package/registry/ui/accordion.tsx +76 -0
- package/registry/ui/alert-dialog.tsx +189 -0
- package/registry/ui/alert.tsx +80 -0
- package/registry/ui/app-shell.tsx +287 -0
- package/registry/ui/area-chart.tsx +3639 -0
- package/registry/ui/avatar.tsx +110 -0
- package/registry/ui/badge.tsx +56 -0
- package/registry/ui/bar-chart.tsx +3636 -0
- package/registry/ui/bar-list.tsx +3680 -0
- package/registry/ui/breadcrumb.tsx +128 -0
- package/registry/ui/button.tsx +62 -0
- package/registry/ui/calendar.tsx +223 -0
- package/registry/ui/card.tsx +107 -0
- package/registry/ui/category-bar.tsx +1255 -0
- package/registry/ui/chart-frame.tsx +1358 -0
- package/registry/ui/checkbox.tsx +30 -0
- package/registry/ui/collapsible.tsx +23 -0
- package/registry/ui/combobox.tsx +310 -0
- package/registry/ui/command.tsx +198 -0
- package/registry/ui/dashboard-card.tsx +217 -0
- package/registry/ui/data-table.tsx +693 -146
- package/registry/ui/date-range-picker.tsx +390 -0
- package/registry/ui/delta.tsx +188 -0
- package/registry/ui/dialog.tsx +161 -0
- package/registry/ui/donut-chart.tsx +3688 -0
- package/registry/ui/drawer.tsx +229 -0
- package/registry/ui/dropdown-menu.tsx +274 -0
- package/registry/ui/echart.tsx +890 -0
- package/registry/ui/field.tsx +240 -0
- package/registry/ui/filter-bar.tsx +392 -0
- package/registry/ui/funnel-steps.tsx +3541 -0
- package/registry/ui/heatmap.tsx +1752 -0
- package/registry/ui/hover-card.tsx +52 -0
- package/registry/ui/input-group.tsx +160 -0
- package/registry/ui/input.tsx +24 -0
- package/registry/ui/kbd.tsx +30 -0
- package/registry/ui/kpi-card.tsx +677 -0
- package/registry/ui/label.tsx +22 -0
- package/registry/ui/legend.tsx +3500 -0
- package/registry/ui/line-chart.tsx +3637 -0
- package/registry/ui/metric-value.tsx +62 -0
- package/registry/ui/multi-select.tsx +232 -0
- package/registry/ui/page-shell.tsx +282 -0
- package/registry/ui/pagination.tsx +140 -0
- package/registry/ui/placeholder.tsx +36 -0
- package/registry/ui/popover.tsx +92 -0
- package/registry/ui/progress-circle.tsx +867 -0
- package/registry/ui/progress.tsx +85 -0
- package/registry/ui/radio-group.tsx +39 -0
- package/registry/ui/sample-data.tsx +86 -0
- package/registry/ui/scatter-chart.tsx +4150 -0
- package/registry/ui/scroll-area.tsx +56 -0
- package/registry/ui/searchable-select.tsx +214 -0
- package/registry/ui/section-header.tsx +43 -0
- package/registry/ui/segmented-control.tsx +76 -0
- package/registry/ui/select.tsx +255 -0
- package/registry/ui/separator.tsx +27 -0
- package/registry/ui/sheet.tsx +139 -0
- package/registry/ui/sidebar.tsx +725 -0
- package/registry/ui/skeleton.tsx +17 -0
- package/registry/ui/slider.tsx +56 -0
- package/registry/ui/sparkline.tsx +230 -0
- package/registry/ui/spinner.tsx +14 -0
- package/registry/ui/states.tsx +90 -0
- package/registry/ui/status-badge.tsx +121 -0
- package/registry/ui/switch.tsx +34 -0
- package/registry/ui/table.tsx +118 -0
- package/registry/ui/tabs.tsx +84 -0
- package/registry/ui/textarea.tsx +22 -0
- package/registry/ui/toast.tsx +250 -0
- package/registry/ui/toggle-group.tsx +91 -0
- package/registry/ui/toggle.tsx +47 -0
- package/registry/ui/tooltip.tsx +68 -0
- package/registry/ui/tracker.tsx +843 -0
- package/registry/ui/trend-indicator.tsx +74 -0
- package/registry/ui/updated-at.tsx +122 -0
- package/registry/ui/waterfall-chart.tsx +4186 -0
- package/skills/vantage-add-feature/SKILL.md +9 -7
- package/skills/vantage-pitfalls/SKILL.md +5 -1
- package/templates/AGENTS.md +22 -1
- package/templates/agents/csv.md +2 -1
- package/templates/agents/doc.md +4 -3
- package/templates/agents/page.md +20 -6
- package/templates/agents/xlsx.md +2 -1
- package/theme.css +237 -136
- package/dist/add-DY4AXANK.js +0 -6
- package/dist/add-DY4AXANK.js.map +0 -1
- package/dist/chunk-5ZOP4SQR.js.map +0 -1
- package/dist/chunk-A2UUGASH.js.map +0 -1
- package/dist/chunk-DTDVSFRY.js.map +0 -1
- package/dist/chunk-LMUACBMA.js.map +0 -1
- package/dist/chunk-NKFBFDRZ.js +0 -2241
- package/dist/chunk-NKFBFDRZ.js.map +0 -1
- package/dist/chunk-PVTHHV7X.js.map +0 -1
- package/dist/chunk-PXRX5PEC.js.map +0 -1
- package/dist/chunk-QI3XQKHS.js.map +0 -1
- package/dist/chunk-RPZAALCX.js.map +0 -1
- package/dist/chunk-VA776YE5.js +0 -316
- package/dist/chunk-VA776YE5.js.map +0 -1
- package/dist/dev-GDKATCC7.js.map +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copied by `vantage add ui checkbox`. This file is yours to edit.
|
|
2
|
+
// Generated from @squadbase/squadkit registry/ui/checkbox.tsx by `npm run registry` (in Vantage, edit packages/squadkit, not registry/).
|
|
3
|
+
"use client"
|
|
4
|
+
|
|
5
|
+
import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox"
|
|
6
|
+
|
|
7
|
+
import { cn } from "@squadbase/vantage/ui"
|
|
8
|
+
import { CheckIcon } from "lucide-react"
|
|
9
|
+
|
|
10
|
+
function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {
|
|
11
|
+
return (
|
|
12
|
+
<CheckboxPrimitive.Root
|
|
13
|
+
data-slot="checkbox"
|
|
14
|
+
className={cn(
|
|
15
|
+
"peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",
|
|
16
|
+
className
|
|
17
|
+
)}
|
|
18
|
+
{...props}
|
|
19
|
+
>
|
|
20
|
+
<CheckboxPrimitive.Indicator
|
|
21
|
+
data-slot="checkbox-indicator"
|
|
22
|
+
className="grid place-content-center text-current transition-none [&>svg]:size-3.5"
|
|
23
|
+
>
|
|
24
|
+
<CheckIcon />
|
|
25
|
+
</CheckboxPrimitive.Indicator>
|
|
26
|
+
</CheckboxPrimitive.Root>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { Checkbox }
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copied by `vantage add ui collapsible`. This file is yours to edit.
|
|
2
|
+
// Generated from @squadbase/squadkit registry/ui/collapsible.tsx by `npm run registry` (in Vantage, edit packages/squadkit, not registry/).
|
|
3
|
+
"use client"
|
|
4
|
+
|
|
5
|
+
import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible"
|
|
6
|
+
|
|
7
|
+
function Collapsible({ ...props }: CollapsiblePrimitive.Root.Props) {
|
|
8
|
+
return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.Props) {
|
|
12
|
+
return (
|
|
13
|
+
<CollapsiblePrimitive.Trigger data-slot="collapsible-trigger" {...props} />
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function CollapsibleContent({ ...props }: CollapsiblePrimitive.Panel.Props) {
|
|
18
|
+
return (
|
|
19
|
+
<CollapsiblePrimitive.Panel data-slot="collapsible-content" {...props} />
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent }
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
// Copied by `vantage add ui combobox`. This file is yours to edit.
|
|
2
|
+
// Generated from @squadbase/squadkit registry/ui/combobox.tsx by `npm run registry` (in Vantage, edit packages/squadkit, 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 motion-reduce:animate-none! 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,198 @@
|
|
|
1
|
+
// Copied by `vantage add ui command`. This file is yours to edit.
|
|
2
|
+
// Generated from @squadbase/squadkit registry/ui/command.tsx by `npm run registry` (in Vantage, edit packages/squadkit, not registry/).
|
|
3
|
+
"use client"
|
|
4
|
+
|
|
5
|
+
import * as React from "react"
|
|
6
|
+
import { Command as CommandPrimitive } from "cmdk"
|
|
7
|
+
|
|
8
|
+
import { cn } from "@squadbase/vantage/ui"
|
|
9
|
+
import {
|
|
10
|
+
Dialog,
|
|
11
|
+
DialogContent,
|
|
12
|
+
DialogDescription,
|
|
13
|
+
DialogHeader,
|
|
14
|
+
DialogTitle,
|
|
15
|
+
} from "@squadbase/vantage/ui"
|
|
16
|
+
import {
|
|
17
|
+
InputGroup,
|
|
18
|
+
InputGroupAddon,
|
|
19
|
+
} from "@squadbase/vantage/ui"
|
|
20
|
+
import { CheckIcon, SearchIcon } from "lucide-react"
|
|
21
|
+
|
|
22
|
+
function Command({
|
|
23
|
+
className,
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<typeof CommandPrimitive>) {
|
|
26
|
+
return (
|
|
27
|
+
<CommandPrimitive
|
|
28
|
+
data-slot="command"
|
|
29
|
+
className={cn(
|
|
30
|
+
"flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",
|
|
31
|
+
className
|
|
32
|
+
)}
|
|
33
|
+
{...props}
|
|
34
|
+
/>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function CommandDialog({
|
|
39
|
+
title = "Command Palette",
|
|
40
|
+
description = "Search for a command to run...",
|
|
41
|
+
children,
|
|
42
|
+
className,
|
|
43
|
+
showCloseButton = false,
|
|
44
|
+
...props
|
|
45
|
+
}: Omit<React.ComponentProps<typeof Dialog>, "children"> & {
|
|
46
|
+
title?: string
|
|
47
|
+
description?: string
|
|
48
|
+
className?: string
|
|
49
|
+
showCloseButton?: boolean
|
|
50
|
+
children: React.ReactNode
|
|
51
|
+
}) {
|
|
52
|
+
return (
|
|
53
|
+
<Dialog {...props}>
|
|
54
|
+
<DialogHeader className="sr-only">
|
|
55
|
+
<DialogTitle>{title}</DialogTitle>
|
|
56
|
+
<DialogDescription>{description}</DialogDescription>
|
|
57
|
+
</DialogHeader>
|
|
58
|
+
<DialogContent
|
|
59
|
+
className={cn(
|
|
60
|
+
"top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0",
|
|
61
|
+
className
|
|
62
|
+
)}
|
|
63
|
+
showCloseButton={showCloseButton}
|
|
64
|
+
>
|
|
65
|
+
{children}
|
|
66
|
+
</DialogContent>
|
|
67
|
+
</Dialog>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function CommandInput({
|
|
72
|
+
className,
|
|
73
|
+
...props
|
|
74
|
+
}: React.ComponentProps<typeof CommandPrimitive.Input>) {
|
|
75
|
+
return (
|
|
76
|
+
<div data-slot="command-input-wrapper" className="p-1 pb-0">
|
|
77
|
+
<InputGroup className="h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!">
|
|
78
|
+
<CommandPrimitive.Input
|
|
79
|
+
data-slot="command-input"
|
|
80
|
+
className={cn(
|
|
81
|
+
"w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
|
|
82
|
+
className
|
|
83
|
+
)}
|
|
84
|
+
{...props}
|
|
85
|
+
/>
|
|
86
|
+
<InputGroupAddon>
|
|
87
|
+
<SearchIcon className="size-4 shrink-0 opacity-50" />
|
|
88
|
+
</InputGroupAddon>
|
|
89
|
+
</InputGroup>
|
|
90
|
+
</div>
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function CommandList({
|
|
95
|
+
className,
|
|
96
|
+
...props
|
|
97
|
+
}: React.ComponentProps<typeof CommandPrimitive.List>) {
|
|
98
|
+
return (
|
|
99
|
+
<CommandPrimitive.List
|
|
100
|
+
data-slot="command-list"
|
|
101
|
+
className={cn(
|
|
102
|
+
"no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",
|
|
103
|
+
className
|
|
104
|
+
)}
|
|
105
|
+
{...props}
|
|
106
|
+
/>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function CommandEmpty({
|
|
111
|
+
className,
|
|
112
|
+
...props
|
|
113
|
+
}: React.ComponentProps<typeof CommandPrimitive.Empty>) {
|
|
114
|
+
return (
|
|
115
|
+
<CommandPrimitive.Empty
|
|
116
|
+
data-slot="command-empty"
|
|
117
|
+
className={cn("py-6 text-center text-sm", className)}
|
|
118
|
+
{...props}
|
|
119
|
+
/>
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function CommandGroup({
|
|
124
|
+
className,
|
|
125
|
+
...props
|
|
126
|
+
}: React.ComponentProps<typeof CommandPrimitive.Group>) {
|
|
127
|
+
return (
|
|
128
|
+
<CommandPrimitive.Group
|
|
129
|
+
data-slot="command-group"
|
|
130
|
+
className={cn(
|
|
131
|
+
"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",
|
|
132
|
+
className
|
|
133
|
+
)}
|
|
134
|
+
{...props}
|
|
135
|
+
/>
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function CommandSeparator({
|
|
140
|
+
className,
|
|
141
|
+
...props
|
|
142
|
+
}: React.ComponentProps<typeof CommandPrimitive.Separator>) {
|
|
143
|
+
return (
|
|
144
|
+
<CommandPrimitive.Separator
|
|
145
|
+
data-slot="command-separator"
|
|
146
|
+
className={cn("-mx-1 h-px bg-border", className)}
|
|
147
|
+
{...props}
|
|
148
|
+
/>
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function CommandItem({
|
|
153
|
+
className,
|
|
154
|
+
children,
|
|
155
|
+
...props
|
|
156
|
+
}: React.ComponentProps<typeof CommandPrimitive.Item>) {
|
|
157
|
+
return (
|
|
158
|
+
<CommandPrimitive.Item
|
|
159
|
+
data-slot="command-item"
|
|
160
|
+
className={cn(
|
|
161
|
+
"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",
|
|
162
|
+
className
|
|
163
|
+
)}
|
|
164
|
+
{...props}
|
|
165
|
+
>
|
|
166
|
+
{children}
|
|
167
|
+
<CheckIcon className="ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" />
|
|
168
|
+
</CommandPrimitive.Item>
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function CommandShortcut({
|
|
173
|
+
className,
|
|
174
|
+
...props
|
|
175
|
+
}: React.ComponentProps<"span">) {
|
|
176
|
+
return (
|
|
177
|
+
<span
|
|
178
|
+
data-slot="command-shortcut"
|
|
179
|
+
className={cn(
|
|
180
|
+
"ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground",
|
|
181
|
+
className
|
|
182
|
+
)}
|
|
183
|
+
{...props}
|
|
184
|
+
/>
|
|
185
|
+
)
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export {
|
|
189
|
+
Command,
|
|
190
|
+
CommandDialog,
|
|
191
|
+
CommandInput,
|
|
192
|
+
CommandList,
|
|
193
|
+
CommandEmpty,
|
|
194
|
+
CommandGroup,
|
|
195
|
+
CommandItem,
|
|
196
|
+
CommandShortcut,
|
|
197
|
+
CommandSeparator,
|
|
198
|
+
}
|