@squadbase/vantage 0.0.1 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/README.md +24 -4
  2. package/dist/{chunk-ZGDU5YLH.js → chunk-5L2MH2NG.js} +16 -7
  3. package/dist/chunk-5L2MH2NG.js.map +1 -0
  4. package/dist/chunk-7IPAXPPY.js +51 -0
  5. package/dist/chunk-7IPAXPPY.js.map +1 -0
  6. package/dist/chunk-A2UUGASH.js +12 -0
  7. package/dist/chunk-A2UUGASH.js.map +1 -0
  8. package/dist/chunk-DTDVSFRY.js +29 -0
  9. package/dist/chunk-DTDVSFRY.js.map +1 -0
  10. package/dist/chunk-WQZYXXQW.js +2249 -0
  11. package/dist/chunk-WQZYXXQW.js.map +1 -0
  12. package/dist/{chunk-73J5ZD4C.js → chunk-YLAB6UQS.js} +17 -3
  13. package/dist/chunk-YLAB6UQS.js.map +1 -0
  14. package/dist/cli.js +607 -36
  15. package/dist/cli.js.map +1 -1
  16. package/dist/client/index.d.ts +2 -1
  17. package/dist/client/index.js +3 -1
  18. package/dist/client/index.js.map +1 -1
  19. package/dist/components/index.d.ts +575 -0
  20. package/dist/components/index.js +2097 -0
  21. package/dist/components/index.js.map +1 -0
  22. package/dist/{define-page-B6y9TOfZ.d.ts → define-page-BfhrK99G.d.ts} +5 -0
  23. package/dist/index.d.ts +2 -2
  24. package/dist/index.js +1 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/markdown/index.d.ts +9 -0
  27. package/dist/markdown/index.js +26 -0
  28. package/dist/markdown/index.js.map +1 -0
  29. package/dist/query/index.d.ts +95 -2
  30. package/dist/query/index.js +102 -1
  31. package/dist/query/index.js.map +1 -1
  32. package/dist/router/index.d.ts +86 -1
  33. package/dist/router/index.js +71 -7
  34. package/dist/router/index.js.map +1 -1
  35. package/dist/server/node.js +6 -1
  36. package/dist/server/node.js.map +1 -1
  37. package/dist/ui/index.d.ts +316 -200
  38. package/dist/ui/index.js +566 -511
  39. package/dist/ui/index.js.map +1 -1
  40. package/dist/vite/index.js +2 -2
  41. package/docs/en/agent-skills.md +89 -0
  42. package/docs/en/api-and-server.md +84 -0
  43. package/docs/en/build-and-deploy.md +280 -0
  44. package/docs/en/cli-reference.md +311 -0
  45. package/docs/en/components.md +235 -0
  46. package/docs/en/data-fetching.md +142 -0
  47. package/docs/en/environment-variables.md +69 -0
  48. package/docs/en/getting-started.md +95 -0
  49. package/docs/en/index.md +65 -0
  50. package/docs/en/markdown/markdown-renderer.md +44 -0
  51. package/docs/en/pages-and-metadata.md +59 -0
  52. package/docs/en/parts/app-shell.md +54 -0
  53. package/docs/en/parts/dashboard-card.md +64 -0
  54. package/docs/en/parts/data-table.md +86 -0
  55. package/docs/en/parts/date-range-picker.md +41 -0
  56. package/docs/en/parts/echart.md +53 -0
  57. package/docs/en/parts/filter-bar.md +66 -0
  58. package/docs/en/parts/funnel-steps.md +33 -0
  59. package/docs/en/parts/metric-value.md +23 -0
  60. package/docs/en/parts/multi-select.md +27 -0
  61. package/docs/en/parts/page-shell.md +45 -0
  62. package/docs/en/parts/placeholder.md +38 -0
  63. package/docs/en/parts/searchable-select.md +47 -0
  64. package/docs/en/parts/section-header.md +20 -0
  65. package/docs/en/parts/segmented-control.md +25 -0
  66. package/docs/en/parts/sparkline.md +47 -0
  67. package/docs/en/parts/status-badge.md +44 -0
  68. package/docs/en/parts/trend-indicator.md +26 -0
  69. package/docs/en/routing.md +177 -0
  70. package/docs/en/ui/accordion.md +36 -0
  71. package/docs/en/ui/alert.md +31 -0
  72. package/docs/en/ui/badge.md +23 -0
  73. package/docs/en/ui/breadcrumb.md +38 -0
  74. package/docs/en/ui/button.md +39 -0
  75. package/docs/en/ui/calendar.md +28 -0
  76. package/docs/en/ui/card.md +35 -0
  77. package/docs/en/ui/checkbox.md +34 -0
  78. package/docs/en/ui/cn.md +34 -0
  79. package/docs/en/ui/collapsible.md +21 -0
  80. package/docs/en/ui/command.md +37 -0
  81. package/docs/en/ui/dialog.md +52 -0
  82. package/docs/en/ui/dropdown-menu.md +50 -0
  83. package/docs/en/ui/empty.md +22 -0
  84. package/docs/en/ui/error-state.md +50 -0
  85. package/docs/en/ui/input-group.md +30 -0
  86. package/docs/en/ui/input.md +28 -0
  87. package/docs/en/ui/label.md +19 -0
  88. package/docs/en/ui/loading.md +19 -0
  89. package/docs/en/ui/popover.md +34 -0
  90. package/docs/en/ui/progress.md +28 -0
  91. package/docs/en/ui/scroll-area.md +23 -0
  92. package/docs/en/ui/select.md +63 -0
  93. package/docs/en/ui/separator.md +15 -0
  94. package/docs/en/ui/sheet.md +28 -0
  95. package/docs/en/ui/sidebar.md +92 -0
  96. package/docs/en/ui/skeleton.md +16 -0
  97. package/docs/en/ui/slider.md +21 -0
  98. package/docs/en/ui/spinner.md +14 -0
  99. package/docs/en/ui/switch.md +19 -0
  100. package/docs/en/ui/table.md +24 -0
  101. package/docs/en/ui/tabs.md +23 -0
  102. package/docs/en/ui/textarea.md +15 -0
  103. package/docs/en/ui/toggle-group.md +26 -0
  104. package/docs/en/ui/toggle.md +19 -0
  105. package/docs/en/ui/tooltip.md +22 -0
  106. package/docs/en/ui/use-is-mobile.md +18 -0
  107. package/docs/en/ui-and-theming.md +95 -0
  108. package/docs/index.json +1346 -0
  109. package/docs/ja/agent-skills.md +87 -0
  110. package/docs/ja/api-and-server.md +84 -0
  111. package/docs/ja/build-and-deploy.md +279 -0
  112. package/docs/ja/cli-reference.md +305 -0
  113. package/docs/ja/components.md +231 -0
  114. package/docs/ja/data-fetching.md +142 -0
  115. package/docs/ja/environment-variables.md +68 -0
  116. package/docs/ja/getting-started.md +95 -0
  117. package/docs/ja/index.md +65 -0
  118. package/docs/ja/markdown/markdown-renderer.md +43 -0
  119. package/docs/ja/pages-and-metadata.md +59 -0
  120. package/docs/ja/parts/app-shell.md +54 -0
  121. package/docs/ja/parts/dashboard-card.md +64 -0
  122. package/docs/ja/parts/data-table.md +85 -0
  123. package/docs/ja/parts/date-range-picker.md +41 -0
  124. package/docs/ja/parts/echart.md +52 -0
  125. package/docs/ja/parts/filter-bar.md +64 -0
  126. package/docs/ja/parts/funnel-steps.md +33 -0
  127. package/docs/ja/parts/metric-value.md +25 -0
  128. package/docs/ja/parts/multi-select.md +27 -0
  129. package/docs/ja/parts/page-shell.md +45 -0
  130. package/docs/ja/parts/placeholder.md +37 -0
  131. package/docs/ja/parts/searchable-select.md +47 -0
  132. package/docs/ja/parts/section-header.md +20 -0
  133. package/docs/ja/parts/segmented-control.md +26 -0
  134. package/docs/ja/parts/sparkline.md +47 -0
  135. package/docs/ja/parts/status-badge.md +44 -0
  136. package/docs/ja/parts/trend-indicator.md +26 -0
  137. package/docs/ja/routing.md +175 -0
  138. package/docs/ja/ui/accordion.md +37 -0
  139. package/docs/ja/ui/alert.md +31 -0
  140. package/docs/ja/ui/badge.md +23 -0
  141. package/docs/ja/ui/breadcrumb.md +38 -0
  142. package/docs/ja/ui/button.md +39 -0
  143. package/docs/ja/ui/calendar.md +28 -0
  144. package/docs/ja/ui/card.md +35 -0
  145. package/docs/ja/ui/checkbox.md +34 -0
  146. package/docs/ja/ui/cn.md +34 -0
  147. package/docs/ja/ui/collapsible.md +21 -0
  148. package/docs/ja/ui/command.md +36 -0
  149. package/docs/ja/ui/dialog.md +51 -0
  150. package/docs/ja/ui/dropdown-menu.md +50 -0
  151. package/docs/ja/ui/empty.md +22 -0
  152. package/docs/ja/ui/error-state.md +50 -0
  153. package/docs/ja/ui/input-group.md +30 -0
  154. package/docs/ja/ui/input.md +28 -0
  155. package/docs/ja/ui/label.md +19 -0
  156. package/docs/ja/ui/loading.md +19 -0
  157. package/docs/ja/ui/popover.md +34 -0
  158. package/docs/ja/ui/progress.md +28 -0
  159. package/docs/ja/ui/scroll-area.md +24 -0
  160. package/docs/ja/ui/select.md +64 -0
  161. package/docs/ja/ui/separator.md +15 -0
  162. package/docs/ja/ui/sheet.md +28 -0
  163. package/docs/ja/ui/sidebar.md +92 -0
  164. package/docs/ja/ui/skeleton.md +16 -0
  165. package/docs/ja/ui/slider.md +21 -0
  166. package/docs/ja/ui/spinner.md +14 -0
  167. package/docs/ja/ui/switch.md +19 -0
  168. package/docs/ja/ui/table.md +24 -0
  169. package/docs/ja/ui/tabs.md +24 -0
  170. package/docs/ja/ui/textarea.md +15 -0
  171. package/docs/ja/ui/toggle-group.md +27 -0
  172. package/docs/ja/ui/toggle.md +19 -0
  173. package/docs/ja/ui/tooltip.md +22 -0
  174. package/docs/ja/ui/use-is-mobile.md +18 -0
  175. package/docs/ja/ui-and-theming.md +95 -0
  176. package/package.json +29 -4
  177. package/registry/blocks/sales-overview.tsx +43 -19
  178. package/registry/ui/data-table.tsx +702 -102
  179. package/skills/vantage-add-feature/SKILL.md +153 -0
  180. package/skills/vantage-app/SKILL.md +291 -0
  181. package/skills/vantage-pitfalls/SKILL.md +139 -0
  182. package/templates/AGENTS.md +313 -0
  183. package/theme.css +178 -40
  184. package/dist/chunk-73J5ZD4C.js.map +0 -1
  185. package/dist/chunk-ATYZ45XL.js +0 -19
  186. package/dist/chunk-ATYZ45XL.js.map +0 -1
  187. package/dist/chunk-ZGDU5YLH.js.map +0 -1
@@ -0,0 +1,24 @@
1
+ # Table
2
+
3
+ > The bare table primitives. For sorting and search, use DataTable.
4
+
5
+ The `<table>` family with the theme's rules and spacing, nothing more. If you need sorting, search
6
+ or pagination, use [`DataTable`](parts/data-table).
7
+
8
+ ```tsx
9
+ import {
10
+ Table,
11
+ TableHeader,
12
+ TableBody,
13
+ TableFooter,
14
+ TableRow,
15
+ TableHead,
16
+ TableCell,
17
+ TableCaption,
18
+ } from "@squadbase/vantage/ui";
19
+ ```
20
+
21
+ The mapping is the plain HTML one — `Table` is `<table>`, `TableHeader` is `<thead>`, `TableHead` is
22
+ `<th>`, `TableCell` is `<td>` — and the native props pass through.
23
+
24
+ Add `text-right tabular-nums` to numeric columns so the digits line up.
@@ -0,0 +1,23 @@
1
+ # Tabs
2
+
3
+ > Tabs that switch between views.
4
+
5
+ Show one of several views in the same place. For a two-to-four-way toggle,
6
+ [`SegmentedControl`](parts/segmented-control) takes less room.
7
+
8
+ ```tsx
9
+ import { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants } from "@squadbase/vantage/ui";
10
+ ```
11
+
12
+ ## Parts
13
+
14
+ | Part | Role |
15
+ | --- | --- |
16
+ | `Tabs` | The state: `value` / `defaultValue` / `onValueChange`, plus `orientation` |
17
+ | `TabsList` | The strip. `variant`: `default` (filled) \| `line` (underline) |
18
+ | `TabsTrigger` | One tab; `value` is required |
19
+ | `TabsContent` | The matching panel |
20
+
21
+ To keep the active tab in the URL, wire `value` to a search param — see [Routing](routing).
22
+
23
+ `orientation="vertical"` stacks them.
@@ -0,0 +1,15 @@
1
+ # Textarea
2
+
3
+ > The multi-line text input.
4
+
5
+ Multi-line input. The props are the native `<textarea>` ones.
6
+
7
+ ```tsx
8
+ import { Textarea } from "@squadbase/vantage/ui";
9
+ ```
10
+
11
+ Set the height with `rows` or `className` (`min-h-32` and friends). `aria-invalid` turns it the
12
+ error colour, exactly as with [`Input`](ui/input).
13
+
14
+ For a toolbar above or below, pair [`InputGroup`](ui/input-group)'s
15
+ `InputGroupTextarea` with `align="block-end"`.
@@ -0,0 +1,26 @@
1
+ # ToggleGroup
2
+
3
+ > A band of toggles. value is always an array.
4
+
5
+ Groups toggles into one band. Under Base UI **`value` is an array even for single choice** — if
6
+ single choice is all you want, [`SegmentedControl`](parts/segmented-control) already
7
+ handles that for you.
8
+
9
+ ```tsx
10
+ import { ToggleGroup, ToggleGroupItem } from "@squadbase/vantage/ui";
11
+ ```
12
+
13
+ | Prop | Type | Default | Description |
14
+ | --- | --- | --- | --- |
15
+ | `value` | `string[]` | | The selected values — **an array even for single choice**. |
16
+ | `onValueChange` | `(value: string[]) => void` | | Fired on change, with an array. |
17
+ | `toggleMultiple` | `boolean` | | Allow more than one selection. |
18
+ | `variant` | `"default" \| "outline"` | `"default"` | |
19
+ | `size` | `"default" \| "sm" \| "lg"` | `"default"` | |
20
+ | `spacing` | `number` | `2` | Gap between items; `0` welds them into one band. |
21
+ | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | |
22
+
23
+ > [!WARNING]
24
+ > There is no Radix-style `type="single"` / `type="multiple"`. Single choice means keeping the array's
25
+ > length at one yourself. [`SegmentedControl`](parts/segmented-control) already does
26
+ > that, so prefer it when you want single choice.
@@ -0,0 +1,19 @@
1
+ # Toggle
2
+
3
+ > A button that stays pressed.
4
+
5
+ A button that keeps its pressed state. To group several, use
6
+ [`ToggleGroup`](ui/toggle-group).
7
+
8
+ ```tsx
9
+ import { Toggle, toggleVariants } from "@squadbase/vantage/ui";
10
+ ```
11
+
12
+ | Prop | Type | Default | Description |
13
+ | --- | --- | --- | --- |
14
+ | `pressed` | `boolean` | | The pressed state. |
15
+ | `onPressedChange` | `(pressed: boolean) => void` | | Fired on change. |
16
+ | `variant` | `"default" \| "outline"` | `"default"` | Look. |
17
+ | `size` | `"default" \| "sm" \| "lg"` | `"default"` | Scale. |
18
+
19
+ Icon-only toggles need an `aria-label`.
@@ -0,0 +1,22 @@
1
+ # Tooltip
2
+
3
+ > A short caption on hover.
4
+
5
+ A short caption shown on hover or focus. The moment you want something interactive inside it, reach
6
+ for [`Popover`](ui/popover).
7
+
8
+ ```tsx
9
+ import { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from "@squadbase/vantage/ui";
10
+ ```
11
+
12
+ ## Parts
13
+
14
+ | Part | Role |
15
+ | --- | --- |
16
+ | `TooltipProvider` | Shared timing. `delay` (default `0`, ms) |
17
+ | `Tooltip` | One tooltip's state |
18
+ | `TooltipTrigger` | What triggers it; `render` makes it any element |
19
+ | `TooltipContent` | The bubble. `side` (default `top`) / `align` / `sideOffset` |
20
+
21
+ > [!NOTE]
22
+ > Tooltips never appear on touch devices. **Don't put information there that a reader needs.**
@@ -0,0 +1,18 @@
1
+ # useIsMobile()
2
+
3
+ > A hook that reports whether the viewport is narrow.
4
+
5
+ Returns whether the viewport is narrow (under 768px). It is the same check
6
+ [`Sidebar`](ui/sidebar) uses to switch to a sheet on mobile.
7
+
8
+ ```tsx
9
+ import { useIsMobile } from "@squadbase/vantage/ui";
10
+
11
+ export default function Overview() {
12
+ const isMobile = useIsMobile();
13
+ return <EChart option={option} height={isMobile ? 200 : 360} />;
14
+ }
15
+ ```
16
+
17
+ It subscribes to `matchMedia`, so resizing re-renders. Note that the first render starts at `false`
18
+ — where you can, express layout branches as CSS breakpoints instead.
@@ -0,0 +1,95 @@
1
+ # UI & theming
2
+
3
+ > Import the built-in UI kit. Override theme tokens in styles.css. Copy sources with add.
4
+
5
+ Vantage ships **shadcn/ui** (the Base UI variant) and a Tailwind v4 theme. No setup — use them
6
+ immediately.
7
+
8
+ ## Use the UI kit
9
+
10
+ There are two entry points: the shadcn/ui primitives live in `@squadbase/vantage/ui`, and the
11
+ dashboard parts composed from them live in `@squadbase/vantage/components`.
12
+
13
+ ```tsx
14
+ import { Button } from "@squadbase/vantage/ui";
15
+ import { DashboardCardPreset, MetricValue } from "@squadbase/vantage/components";
16
+
17
+ export default function Overview() {
18
+ return (
19
+ <div className="grid gap-4 p-6 md:grid-cols-3">
20
+ <DashboardCardPreset title="Revenue">
21
+ <MetricValue className="my-0">$12,400</MetricValue>
22
+ </DashboardCardPreset>
23
+ <DashboardCardPreset title="New customers">
24
+ <MetricValue className="my-0">128</MetricValue>
25
+ </DashboardCardPreset>
26
+ <DashboardCardPreset title="Churn">
27
+ <MetricValue className="my-0">2.1%</MetricValue>
28
+ </DashboardCardPreset>
29
+ </div>
30
+ );
31
+ }
32
+ ```
33
+
34
+ In `/ui` (a selection): `Button`, `Card`, the `Table` primitives, `Tabs`, `Input` / `Select` /
35
+ `Checkbox` / `Switch` / `Slider`, `Calendar`, `Dialog` / `Sheet` / `Popover` / `Tooltip` /
36
+ `DropdownMenu`, `Sidebar`, `Alert` / `Skeleton` / `Spinner`, `Loading` / `Empty` / `ErrorState`.
37
+
38
+ In `/components` (a selection): `PageShell`, `AppShell`, `DashboardCard`, `DataTable`, `EChart`,
39
+ `FunnelSteps`, `FilterBar`, `DateRangePicker`, `MetricValue`, `TrendIndicator`.
40
+
41
+ Props and usage for every component live in the [Components](components) tab.
42
+
43
+ ## Tailwind just works
44
+
45
+ Write Tailwind utilities in `className` and they apply. You never write `tailwind.config` or
46
+ `postcss.config` (they're forbidden files and would error). Use `cn()` to combine classes.
47
+
48
+ ```tsx
49
+ import { cn } from "@squadbase/vantage/ui";
50
+
51
+ <div className={cn("p-4", isActive && "bg-accent")} />;
52
+ ```
53
+
54
+ ## Override theme tokens
55
+
56
+ Design tokens like colors and radii are CSS variables. To override them, place a `styles.css` at the
57
+ project root and override **only CSS variables**. The file is auto-imported after the theme.
58
+
59
+ ```css
60
+ /* styles.css — CSS variable overrides only */
61
+ :root {
62
+ --primary: oklch(0.55 0.22 265);
63
+ }
64
+ .dark,
65
+ [data-theme="dark"] {
66
+ --primary: oklch(0.72 0.19 265);
67
+ }
68
+ ```
69
+
70
+ > [!WARNING]
71
+ > `styles.css` may only **override CSS variables (theme tokens)**. You cannot bring a `tailwind.config`
72
+ > (it's a forbidden file).
73
+
74
+ The tokens are shadcn/ui's neutral palette (oklch), plus `--chart-1` through `--chart-5` for charts
75
+ and `--sidebar-*` for the sidebar. Changing `--chart-*` also changes
76
+ [`EChart`](parts/echart)'s palette — charts build their theme by reading those CSS
77
+ variables directly.
78
+
79
+ ## When you want to edit the source: `vantage add`
80
+
81
+ To make a component's internals your own, copy an editable source into `components/`.
82
+
83
+ ```bash
84
+ vantage add ui data-table # copy an editable DataTable
85
+ vantage add block sales-overview
86
+ ```
87
+
88
+ > [!NOTE]
89
+ > In the current prototype, `vantage add` can copy only `data-table` (ui) and `sales-overview` (block).
90
+ > All other UI components are import-only.
91
+
92
+ ## What to read next
93
+
94
+ - [Components](components) — the props reference for every component
95
+ - [CLI reference](cli-reference) — every command