@voltui/agent 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -21
- package/content.js +16 -538
- package/installer.js +210 -18
- package/package.json +7 -4
- package/skills/volt-ui/SKILL.md +48 -0
- package/skills/volt-ui-adoption/SKILL.md +71 -0
- package/skills/volt-ui-component-selection/SKILL.md +225 -0
- package/skills/volt-ui-distribution/SKILL.md +83 -0
- package/skills/volt-ui-forms/SKILL.md +77 -0
- package/skills/volt-ui-overlays/SKILL.md +72 -0
- package/skills/volt-ui-styling/SKILL.md +68 -0
- package/skills.js +74 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: volt-ui-component-selection
|
|
3
|
+
description: >
|
|
4
|
+
Choose the right Volt UI component for a responsibility: Button vs link, NativeSelect vs Select
|
|
5
|
+
vs Combobox, Checkbox vs Switch vs Toggle, Tabs vs route navigation, Dialog vs Drawer vs
|
|
6
|
+
Popover, Alert vs Toast, Spinner vs Skeleton, Sidebar vs NavigationMenu. Use when two or more
|
|
7
|
+
components could fit.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Choosing a Volt component
|
|
11
|
+
|
|
12
|
+
This is a responsibility map, not an API reference. For exact selectors and inputs ask the MCP
|
|
13
|
+
server (`find_components`, then `get_component`).
|
|
14
|
+
|
|
15
|
+
## The distinctions that matter
|
|
16
|
+
|
|
17
|
+
**Actions**
|
|
18
|
+
|
|
19
|
+
- **Button vs link.** An action that changes state is a `<button voltButton>`. Navigation is
|
|
20
|
+
`<a voltButton routerLink>` — styled like a button, still a link. Never a button in a link.
|
|
21
|
+
|
|
22
|
+
**Forms and selection**
|
|
23
|
+
|
|
24
|
+
- **NativeSelect vs Select vs Combobox.** Fixed short list and a native control is fine →
|
|
25
|
+
`NativeSelect` (an attribute on a real `<select>`). Custom-rendered options, groups, multiple →
|
|
26
|
+
`Select`. The user searches by typing, or the list is long or remote → `Combobox`; remote data
|
|
27
|
+
uses `filterMode="manual"` and the app owns the request.
|
|
28
|
+
- **Checkbox vs Switch vs Toggle.** A value submitted with a form, or "I agree" → `Checkbox`. An
|
|
29
|
+
immediate on/off setting that takes effect now → `Switch`. A pressed state of a tool (bold) →
|
|
30
|
+
`Toggle`; one of several tools → `ToggleGroup`.
|
|
31
|
+
- **Radio vs Select.** Few options that should all be visible → `Radio`; many → `Select`.
|
|
32
|
+
- **Slider vs RangeSlider.** One number vs a low–high pair.
|
|
33
|
+
|
|
34
|
+
**Navigation**
|
|
35
|
+
|
|
36
|
+
- **Tabs vs route navigation.** Tabs switch panels of one view and own the selection. When the URL
|
|
37
|
+
owns the selection (deep links, middle-click), use real anchors, not `Tabs`.
|
|
38
|
+
- **Sidebar vs NavigationMenu.** `Sidebar` is application chrome (a persistent region).
|
|
39
|
+
`NavigationMenu` is a top-level menu with flyout content.
|
|
40
|
+
- **Pagination vs infinite scroll.** `Pagination` for page-addressable lists.
|
|
41
|
+
|
|
42
|
+
**Feedback**
|
|
43
|
+
|
|
44
|
+
- **Alert vs Toast.** `Alert` is part of the page and stays until the condition clears. `Toast` is
|
|
45
|
+
transient confirmation of something that already happened.
|
|
46
|
+
- **Spinner vs Skeleton.** Unknown duration, no shape → `Spinner`. Content with a known layout →
|
|
47
|
+
`Skeleton`.
|
|
48
|
+
- **Badge vs status text.** A short label or count → `Badge`; a sentence → text.
|
|
49
|
+
|
|
50
|
+
**Overlays**
|
|
51
|
+
|
|
52
|
+
- **Dialog vs Drawer vs Popover.** Needs a decision, blocks the page → `Dialog`. Secondary panel or
|
|
53
|
+
navigation on a small screen → `Drawer`. Small contextual content anchored to a control →
|
|
54
|
+
`Popover`. A hint that names a control → `Tooltip` (never the only way to learn something).
|
|
55
|
+
- **Dropdown Menu vs Select.** Commands vs choosing a value.
|
|
56
|
+
|
|
57
|
+
**Display**
|
|
58
|
+
|
|
59
|
+
- **Table vs an application data table.** Volt's `Table` is styled markup. Sorting, filtering,
|
|
60
|
+
paging and selection logic belongs to the application (see the data-table recipe).
|
|
61
|
+
|
|
62
|
+
## Do not use when
|
|
63
|
+
|
|
64
|
+
- **Combobox**: the app only needs a native fixed list (`NativeSelect`).
|
|
65
|
+
- **Dialog**: the content is not a decision — a Popover or inline content is lighter.
|
|
66
|
+
- **Tooltip**: the text is essential; put it on the page.
|
|
67
|
+
- **Toast**: the user must act on it or it carries an error they must read; use `Alert` or a Dialog.
|
|
68
|
+
- **Tabs**: the panels are separate pages.
|
|
69
|
+
|
|
70
|
+
## Catalog
|
|
71
|
+
|
|
72
|
+
The list below is generated from the project's component metadata; the MCP `find_components` tool
|
|
73
|
+
returns the same fields live.
|
|
74
|
+
|
|
75
|
+
<!-- volt:catalog:start -->
|
|
76
|
+
|
|
77
|
+
### Forms & Inputs
|
|
78
|
+
|
|
79
|
+
- **Button** (`button`, stable) — Triggers an action or navigates. Use the `voltButton` attribute on a native `<button>` or `<a>`, or the `<volt-button>` element.
|
|
80
|
+
- Not for: A link to another page that is not styled as an action: use a plain anchor.
|
|
81
|
+
- See also: `toggle`, `dropdown-menu`
|
|
82
|
+
- **Input** (`input`, stable) — A single-line text field styled for Volt, with size and validation-state variants. Works with Angular forms.
|
|
83
|
+
- Not for: A choice from a list: use Select, Combobox or Radio.
|
|
84
|
+
- See also: `textarea`, `form-field`, `search`
|
|
85
|
+
- **Search** (`search`, stable) — A search field wrapper with an icon slot and a clear button around a native input.
|
|
86
|
+
- Not for: Searching a server-backed list for a value: use Combobox with manual filtering.
|
|
87
|
+
- See also: `input`, `combobox`
|
|
88
|
+
- **Autofill** (`autofill`, stable) — A directive that reports when the browser autofills an input, so styles and state can react.
|
|
89
|
+
- **Textarea** (`textarea`, stable) — A multi-line text field with variant, size, state and resize options.
|
|
90
|
+
- **Checkbox** (`checkbox`, stable) — A checked, unchecked or indeterminate toggle that works with Angular forms.
|
|
91
|
+
- Not for: A setting that takes effect immediately: use Switch.
|
|
92
|
+
- See also: `switch`, `toggle`, `radio`
|
|
93
|
+
- **Radio** (`radio`, stable) — A group of mutually exclusive options.
|
|
94
|
+
- Not for: More than a handful of options: use Select.
|
|
95
|
+
- See also: `select`, `checkbox`, `toggle-group`
|
|
96
|
+
- **Switch** (`switch`, stable) — An on/off control for a setting that takes effect immediately.
|
|
97
|
+
- Not for: A choice submitted with a form or an "I agree": use Checkbox.
|
|
98
|
+
- See also: `checkbox`, `toggle`
|
|
99
|
+
- **Form Field** (`form-field`, stable) — Groups a control with its label, hint and error message and wires them together without hand-written ids.
|
|
100
|
+
- Not for: Anything that is not a labelled form control.
|
|
101
|
+
- See also: `input`, `textarea`, `select`
|
|
102
|
+
- **Select** (`select`, stable) — A custom listbox-based select with single and multiple selection, plus a styled native `<select>` directive.
|
|
103
|
+
- Not for: A short fixed list where a native control is enough: use the native select directive.
|
|
104
|
+
- Not for: A list the user searches by typing or that comes from a server: use Combobox.
|
|
105
|
+
- See also: `combobox`, `listbox`, `radio`
|
|
106
|
+
- **Slider** (`slider`, stable) — Selects a single number in a range.
|
|
107
|
+
- Not for: A low–high pair: use Range Slider.
|
|
108
|
+
- See also: `range-slider`, `progress`
|
|
109
|
+
- **Range Slider** (`range-slider`, stable) — Selects a low and a high value in a range.
|
|
110
|
+
- Not for: A single number: use Slider.
|
|
111
|
+
- See also: `slider`
|
|
112
|
+
- **Input OTP** (`input-otp`, stable) — A segmented one-time-password field with paste support and a completion event.
|
|
113
|
+
- **File Upload** (`file-upload`, stable) — A file picker directive and a drag-and-drop dropzone that report selected and rejected files.
|
|
114
|
+
- **Combobox** (`combobox`, stable) — A text input with a filterable popup list. Supports local filtering, manual (server-side) filtering, loading state and multiple selection.
|
|
115
|
+
- Not for: A fixed list the application only needs a native select for.
|
|
116
|
+
- Not for: Choosing a command: use Dropdown Menu.
|
|
117
|
+
- See also: `select`, `listbox`, `search`
|
|
118
|
+
|
|
119
|
+
### Display
|
|
120
|
+
|
|
121
|
+
- **Badge** (`badge`, stable) — A small label for status, counts or categories.
|
|
122
|
+
- Not for: A full sentence of status: use text or Alert.
|
|
123
|
+
- See also: `alert`, `avatar`
|
|
124
|
+
- **Card** (`card`, stable) — A surface that groups related content with optional header, content and footer parts.
|
|
125
|
+
- **Avatar** (`avatar`, stable) — A user image with a fallback (usually initials).
|
|
126
|
+
- **Separator** (`separator`, stable) — A horizontal or vertical divider.
|
|
127
|
+
- **Accordion** (`accordion`, stable) — Vertically stacked sections that expand and collapse.
|
|
128
|
+
- Not for: Switching between mutually exclusive views: use Tabs.
|
|
129
|
+
- See also: `tabs`
|
|
130
|
+
- **Progress** (`progress`, stable) — Shows how far a task has advanced, or that one is running when the value is unknown.
|
|
131
|
+
- Not for: A measured quantity within a known range (disk usage): use Meter.
|
|
132
|
+
- See also: `meter`, `spinner`
|
|
133
|
+
- **Meter** (`meter`, stable) — A gauge for a value within a known range, such as disk usage.
|
|
134
|
+
- Not for: Progress toward completion: use Progress.
|
|
135
|
+
- See also: `progress`
|
|
136
|
+
- **Skeleton** (`skeleton`, stable) — A placeholder that mimics content while it loads.
|
|
137
|
+
- Not for: An unknown-duration wait with no shape: use Spinner.
|
|
138
|
+
- See also: `spinner`
|
|
139
|
+
- **Table** (`table`, stable) — Styled table parts for tabular data: header, body, footer, rows, cells and caption.
|
|
140
|
+
- Not for: Sorting, filtering, paging and selection logic: that belongs to the application.
|
|
141
|
+
- See also: `pagination`
|
|
142
|
+
- **Alert** (`alert`, stable) — A callout for information, success, warnings or errors that sits in the page flow.
|
|
143
|
+
- Not for: A transient "saved" confirmation: use Toast.
|
|
144
|
+
- See also: `toast`, `empty-state`, `dialog`
|
|
145
|
+
- **Spinner** (`spinner`, beta) — An indeterminate loading indicator in three sizes.
|
|
146
|
+
- Not for: Content with a known layout: use Skeleton.
|
|
147
|
+
- See also: `skeleton`, `progress`
|
|
148
|
+
- **Empty State** (`empty-state`, beta) — A placeholder for an empty collection or a search with no results, with room for an action.
|
|
149
|
+
- Not for: An error or warning about the page: use Alert.
|
|
150
|
+
- See also: `alert`, `skeleton`
|
|
151
|
+
|
|
152
|
+
### Controls
|
|
153
|
+
|
|
154
|
+
- **Toggle** (`toggle`, stable) — A two-state button that stays pressed, such as bold in a text editor.
|
|
155
|
+
- Not for: An on/off setting: use Switch. A value in a form: use Checkbox.
|
|
156
|
+
- See also: `toggle-group`, `switch`, `checkbox`
|
|
157
|
+
- **Toggle Group** (`toggle-group`, stable) — A set of toggles with single or multiple selection.
|
|
158
|
+
- Not for: Switching between views of a page: use Tabs.
|
|
159
|
+
- See also: `toggle`, `radio`, `toolbar`, `tabs`
|
|
160
|
+
- **Pagination** (`pagination`, stable) — Page navigation with first/previous/next/last controls and numbered pages.
|
|
161
|
+
- Not for: Endless lists that load as you scroll.
|
|
162
|
+
- See also: `table`
|
|
163
|
+
- **Date Picker** (`date-picker`, stable) — A calendar for choosing a single date or a date range, with min/max and disabled-date rules.
|
|
164
|
+
- **Listbox** (`listbox`, stable) — An always-visible list of options with single or multiple selection.
|
|
165
|
+
- Not for: A value inside a form that collapses after choosing: use Select.
|
|
166
|
+
- See also: `select`, `combobox`
|
|
167
|
+
- **Toolbar** (`toolbar`, stable) — A container that groups related controls into one tab stop with arrow-key navigation.
|
|
168
|
+
|
|
169
|
+
### Overlays
|
|
170
|
+
|
|
171
|
+
- **Tooltip** (`tooltip`, stable) — A short hint shown on hover or keyboard focus.
|
|
172
|
+
- Not for: Essential information, or anything interactive: put it on the page or use Popover.
|
|
173
|
+
- See also: `popover`
|
|
174
|
+
- **Dialog** (`dialog`, stable) — A modal window. Open it from a trigger, control it with `[(open)]`, or open it from code and await the result with `VoltDialogService`.
|
|
175
|
+
- Not for: Content that does not need a decision: use a Popover or inline content.
|
|
176
|
+
- Not for: A secondary panel or small-screen navigation: use Drawer.
|
|
177
|
+
- See also: `drawer`, `popover`, `alert`
|
|
178
|
+
- **Drawer** (`drawer`, stable) — A modal panel that slides in from an edge of the screen.
|
|
179
|
+
- Not for: A decision that must block the page: use Dialog.
|
|
180
|
+
- See also: `dialog`, `sidebar`
|
|
181
|
+
- **Popover** (`popover`, stable) — A floating panel anchored to a trigger, for rich, non-modal content.
|
|
182
|
+
- Not for: A hint that only names a control: use Tooltip.
|
|
183
|
+
- Not for: A command list: use Dropdown Menu.
|
|
184
|
+
- See also: `tooltip`, `dropdown-menu`, `dialog`
|
|
185
|
+
- **Dropdown Menu** (`dropdown-menu`, stable) — A menu of actions opened from a trigger, with labels, separators and submenus.
|
|
186
|
+
- Not for: Choosing a value for a field: use Select.
|
|
187
|
+
- See also: `select`, `popover`
|
|
188
|
+
- **Toast** (`toast`, stable) — Short, transient notifications raised from code with `VoltToastService`.
|
|
189
|
+
- Not for: An error the user must read or act on: use Alert or a Dialog.
|
|
190
|
+
- See also: `alert`
|
|
191
|
+
|
|
192
|
+
### Navigation
|
|
193
|
+
|
|
194
|
+
- **Tabs** (`tabs`, stable) — Switches between related panels, one visible at a time.
|
|
195
|
+
- Not for: Navigation where the URL owns the selection (deep links, middle-click): use real anchors.
|
|
196
|
+
- Not for: Panels that are really separate pages.
|
|
197
|
+
- See also: `navigation-menu`, `toggle-group`, `accordion`
|
|
198
|
+
- **Navigation Menu** (`navigation-menu`, stable) — A site navigation bar whose items can open rich submenu panels.
|
|
199
|
+
- Not for: Persistent application chrome with sections: use Sidebar.
|
|
200
|
+
- See also: `sidebar`, `tabs`, `breadcrumbs`
|
|
201
|
+
- **Breadcrumbs** (`breadcrumbs`, stable) — Shows the path to the current page.
|
|
202
|
+
|
|
203
|
+
### Layout
|
|
204
|
+
|
|
205
|
+
- **Resizable** (`resizable`, stable) — Panels separated by draggable, keyboard-operable handles.
|
|
206
|
+
- **Sidebar** (`sidebar`, stable) — A collapsible application sidebar with header, groups, items and footer.
|
|
207
|
+
- Not for: A top-level menu with flyout content: use Navigation Menu.
|
|
208
|
+
- See also: `navigation-menu`, `drawer`
|
|
209
|
+
|
|
210
|
+
### Foundations
|
|
211
|
+
|
|
212
|
+
- **Theme** (`theme`, stable) — Colour and style presets and the functions that apply them: provideVoltTheme at bootstrap, applyVoltTheme at runtime.
|
|
213
|
+
- Not for: Restyling one component: use its variants or `class`.
|
|
214
|
+
|
|
215
|
+
<!-- volt:catalog:end -->
|
|
216
|
+
|
|
217
|
+
<!-- volt:digest:start -->
|
|
218
|
+
|
|
219
|
+
- Action that changes state → Button; navigation → `<a voltButton routerLink>`; never a button inside a link.
|
|
220
|
+
- Fixed short list → NativeSelect; custom options/groups → Select; searchable or remote → Combobox (`filterMode="manual"`, the app owns the request).
|
|
221
|
+
- Form value / consent → Checkbox; immediate setting → Switch; tool pressed state → Toggle/ToggleGroup.
|
|
222
|
+
- Decision that blocks → Dialog; secondary panel → Drawer; anchored contextual content → Popover; hint → Tooltip (never the only copy).
|
|
223
|
+
- Persistent page feedback → Alert; transient confirmation → Toast; unknown wait → Spinner; known layout → Skeleton.
|
|
224
|
+
|
|
225
|
+
<!-- volt:digest:end -->
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: volt-ui-distribution
|
|
3
|
+
description: >
|
|
4
|
+
Install, use and update Volt UI correctly in either distribution mode: the @voltui/components
|
|
5
|
+
package (Volt* classes, volt-* selectors) or copy-and-own via @voltui/cli (Ui* classes, ui-*
|
|
6
|
+
selectors under ./ui). Use to detect the project's mode, add components, fix wrong imports or
|
|
7
|
+
prefixes, or set up the agent.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Package vs copy-and-own
|
|
11
|
+
|
|
12
|
+
Both modes are first-class for the whole 1.x line. Never mix them by accident.
|
|
13
|
+
|
|
14
|
+
## Detect the mode first
|
|
15
|
+
|
|
16
|
+
| Evidence | Mode |
|
|
17
|
+
| ------------------------------------------------------------------------------------ | ------- |
|
|
18
|
+
| `@voltui/components` in `package.json`; `import { VoltX } from '@voltui/components'` | package |
|
|
19
|
+
| a `src/app/ui/` folder (or the CLI's configured dir); `import { UiX } from './ui/x'` | copy |
|
|
20
|
+
|
|
21
|
+
If unclear, ask — do not guess. A project in package mode must not get a copied `ui/` folder, and a
|
|
22
|
+
copy-mode project must not import `@voltui/components`.
|
|
23
|
+
|
|
24
|
+
## What changes between modes
|
|
25
|
+
|
|
26
|
+
| Context | Selector | Class | Import |
|
|
27
|
+
| ------- | ----------------------------------------- | --------- | ---------------------- |
|
|
28
|
+
| package | `volt-*` / `[voltXxx]` | `VoltXxx` | `'@voltui/components'` |
|
|
29
|
+
| copy | `ui-*` / `[uiXxx]` (the CLI renames them) | `UiXxx` | `'./ui/<component>'` |
|
|
30
|
+
|
|
31
|
+
`'volt'` is only a path alias inside the Volt monorepo; it never exists in a consumer project. The
|
|
32
|
+
MCP server's `get_component` / `get_usage_example` accept `mode: "package" | "copy"`; pass the
|
|
33
|
+
project's mode and you get matching selectors and imports.
|
|
34
|
+
|
|
35
|
+
## Package mode
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install @voltui/components @angular/cdk
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Peer dependencies (`@angular/core`, `common`, `forms`, `router`, `cdk`) are declared by the package; install `@angular/cdk` yourself at the same major as `@angular/core`. Import the theme CSS and, optionally,
|
|
42
|
+
`provideVoltTheme` (see `volt-ui-styling`). Updating is a version bump; read the changelog's
|
|
43
|
+
migration notes for a major.
|
|
44
|
+
|
|
45
|
+
## Copy mode
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx @voltui/cli init # scaffold the ui folder
|
|
49
|
+
npx @voltui/cli list # what exists, with status
|
|
50
|
+
npx @voltui/cli add button card # copies source; dependencies between components are detected
|
|
51
|
+
npx @voltui/cli add dialog ./src/app/shared/ui --dry-run
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The CLI copies source from the library, applies the `volt-` → `ui-` transform, and you own the
|
|
55
|
+
result: edit it freely, but a later `add` of the same component can overwrite your edits — review the
|
|
56
|
+
diff. Install the runtime dependencies once (`ng-primitives class-variance-authority clsx
|
|
57
|
+
tailwind-merge`). Blocks, Layouts and Recipes from the docs site are copied the same way and import
|
|
58
|
+
the atoms from the project's mode.
|
|
59
|
+
|
|
60
|
+
## Agent setup
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npx @voltui/agent <claude|codex|gemini|opencode|cursor|windsurf|copilot|vscode>
|
|
64
|
+
npx @voltui/agent doctor # checks the files it wrote and the endpoint
|
|
65
|
+
npx @voltui/agent --uninstall <agent>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
It writes the MCP server entry and, where the agent supports skills, these skills; for agents that
|
|
69
|
+
only read a rules file it writes a short routing block.
|
|
70
|
+
|
|
71
|
+
## Do not
|
|
72
|
+
|
|
73
|
+
- Write `volt-*` selectors in a copy-mode project or `ui-*` in package mode.
|
|
74
|
+
- Import from `'volt'` or from a path inside `node_modules/@voltui/components`.
|
|
75
|
+
- Add `ng-primitives` imports to application code.
|
|
76
|
+
|
|
77
|
+
<!-- volt:digest:start -->
|
|
78
|
+
|
|
79
|
+
- Detect the mode first: `@voltui/components` (package: `Volt*`, `volt-*`) or a copied `ui/` folder (copy: `Ui*`, `ui-*`). Never mix them; `'volt'` is not importable in a consumer.
|
|
80
|
+
- Copy mode: `npx @voltui/cli add <name>`; package mode: `npm install @voltui/components`.
|
|
81
|
+
- Pass the project's mode (`package` | `copy`) to the MCP tools to get matching selectors and imports.
|
|
82
|
+
|
|
83
|
+
<!-- volt:digest:end -->
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: volt-ui-forms
|
|
3
|
+
description: >
|
|
4
|
+
Compose forms and validation with Volt UI in Angular: FormField with Label/Hint/Error, Input,
|
|
5
|
+
Textarea, NativeSelect, Select, Combobox, Checkbox, Radio, Switch, Reactive Forms and
|
|
6
|
+
ControlValueAccessor behaviour, disabled vs aria-disabled, server-backed Combobox, async save.
|
|
7
|
+
Use when building or fixing a form.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Volt forms
|
|
11
|
+
|
|
12
|
+
Exact selectors and inputs: MCP `get_component` / `get_usage_example`. This skill is about how the
|
|
13
|
+
pieces compose.
|
|
14
|
+
|
|
15
|
+
## Form field
|
|
16
|
+
|
|
17
|
+
Wrap a control in `FormField` and give it a label, an optional hint and an error. The field wires
|
|
18
|
+
the label, `aria-describedby` and `aria-invalid` to the control; do not do it by hand.
|
|
19
|
+
|
|
20
|
+
- Show the error only after the user could have seen the problem: `touched && invalid`.
|
|
21
|
+
- An error message is visible text. Colour alone is not an error.
|
|
22
|
+
- Outside a field, a label needs `htmlFor` pointing at the control's `id` (Volt moves a static `id`
|
|
23
|
+
from the host to the native control so `<label for>` resolves).
|
|
24
|
+
|
|
25
|
+
## Reactive and template-driven forms
|
|
26
|
+
|
|
27
|
+
Volt controls implement `ControlValueAccessor`: use `[formControl]`, `formControlName` or
|
|
28
|
+
`[(ngModel)]` directly. They honour the full contract — value in, value out, `touched` on blur,
|
|
29
|
+
`disabled` / `enabled`, `invalid` reflected as `aria-invalid`. Do not mirror the value into a signal
|
|
30
|
+
to "sync" it.
|
|
31
|
+
|
|
32
|
+
- A literal value (`value="a"`) is an initial value; the control stays interactive. Use
|
|
33
|
+
`[(value)]` or a form control when the app needs to read it.
|
|
34
|
+
- `ToggleGroup` and `Listbox` hold `string[]` / `T[]` even in single mode.
|
|
35
|
+
- Number and boolean inputs coerce (`disabled`, `multiple`): `disabled` without a value is `true`.
|
|
36
|
+
|
|
37
|
+
## Choosing the control
|
|
38
|
+
|
|
39
|
+
Use `volt-ui-component-selection` for NativeSelect vs Select vs Combobox, Checkbox vs Switch.
|
|
40
|
+
|
|
41
|
+
## Disabled vs aria-disabled
|
|
42
|
+
|
|
43
|
+
- `disabled`: removes the control from the tab order and from the form's value. Use when the field
|
|
44
|
+
is not applicable.
|
|
45
|
+
- `aria-disabled="true"` on a `voltButton`: dims it, keeps focus, lets you explain why with
|
|
46
|
+
`aria-describedby`. Volt does not block the click — guard the handler (`if (blocked()) return;`).
|
|
47
|
+
Use it for "Save" while a request is pending or a precondition is unmet.
|
|
48
|
+
|
|
49
|
+
## Server-backed Combobox
|
|
50
|
+
|
|
51
|
+
Local list → default. A server decides what matches → `filterMode="manual"`:
|
|
52
|
+
|
|
53
|
+
- `(queryChange)` is what the user typed — not the value, not the label written back after a pick.
|
|
54
|
+
- The app owns the request: debounce, **latest response wins**, handle errors. Volt never fetches.
|
|
55
|
+
- Pass results as `[items]` exactly as returned; set `[loading]` while in flight; `emptyText` for an
|
|
56
|
+
empty answer. Never feed server results to the local filter.
|
|
57
|
+
- Objects as values need `[itemLabel]`, `[compareWith]` and `[trackByFn]` keyed on a stable id.
|
|
58
|
+
|
|
59
|
+
## Async save
|
|
60
|
+
|
|
61
|
+
Keep the submit button enabled-looking but guarded (`aria-disabled` + `aria-busy`) while pending,
|
|
62
|
+
show failure in an `Alert`, success in a `Toast`. Do not unmount the form on failure.
|
|
63
|
+
|
|
64
|
+
## Do not
|
|
65
|
+
|
|
66
|
+
- Build the field chrome (label + hint + error) from raw elements.
|
|
67
|
+
- Use `[value]` and a `[formControl]` on the same control.
|
|
68
|
+
- Disable the submit button forever on an invalid form with no message saying why.
|
|
69
|
+
|
|
70
|
+
<!-- volt:digest:start -->
|
|
71
|
+
|
|
72
|
+
- Wrap controls in FormField (label, hint, error); show errors after `touched && invalid`, as visible text.
|
|
73
|
+
- Volt controls are ControlValueAccessors: use `[formControl]`/`ngModel` directly; a literal `value="a"` is an initial value, not a lock.
|
|
74
|
+
- `disabled` leaves the tab order; `aria-disabled` on a `voltButton` keeps focus but you must guard the handler.
|
|
75
|
+
- Server search: Combobox `filterMode="manual"`, `(queryChange)` is what was typed, debounce and let the latest response win, pass results as returned, set `[loading]`.
|
|
76
|
+
|
|
77
|
+
<!-- volt:digest:end -->
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: volt-ui-overlays
|
|
3
|
+
description: >
|
|
4
|
+
Compose Volt UI overlays correctly: Dialog (trigger vs controlled vs service), Drawer, Popover,
|
|
5
|
+
Tooltip, Dropdown Menu and Toast. Covers dismissible while pending, initial focus, focus return,
|
|
6
|
+
nested overlays, Dialog vs Drawer, Popover vs Tooltip, Toast vs Alert. Use when opening anything
|
|
7
|
+
above the page.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Volt overlays
|
|
11
|
+
|
|
12
|
+
Dialog, Drawer, Popover, Tooltip and Dropdown Menu share one pattern: an attribute directive on the
|
|
13
|
+
trigger, and the overlay declared in an `<ng-template>` the trigger references. Exact markup:
|
|
14
|
+
MCP `get_usage_example`. Never import `Ngp*` — Volt exports everything a consumer needs.
|
|
15
|
+
|
|
16
|
+
## Dialog
|
|
17
|
+
|
|
18
|
+
Three ways to open one; pick by who owns the state.
|
|
19
|
+
|
|
20
|
+
- **Trigger-driven**: `<button [voltDialog]="tpl">`. The simplest; the dialog owns open state.
|
|
21
|
+
- **Controlled**: `<ng-template voltDialogRoot [(open)]="editing">`. Application state decides —
|
|
22
|
+
CRUD forms, anything you open from code paths with no trigger element.
|
|
23
|
+
- **Service**: `VoltDialogService.open(tpl, { role: 'alertdialog' }).closed` — an imperative
|
|
24
|
+
confirm that returns a promise-like result.
|
|
25
|
+
|
|
26
|
+
Rules:
|
|
27
|
+
|
|
28
|
+
- Always give it a title (`voltDialogTitle`) and a description (`voltDialogDescription`): they name
|
|
29
|
+
the dialog for assistive technology.
|
|
30
|
+
- A destructive confirm is `role="alertdialog"`, with focus on the **safe** action
|
|
31
|
+
(`initialFocus="[data-cancel]"`).
|
|
32
|
+
- **While a request is pending, set `[dismissible]="false"`** so Escape and overlay clicks do
|
|
33
|
+
nothing; `close()` always works. `[dismissible]` is live; `closeOnEscape` / `closeOnClick` are only
|
|
34
|
+
read when it opens.
|
|
35
|
+
- Focus moves in on open, is trapped, and returns to the trigger on close. Do not move it yourself
|
|
36
|
+
except to choose the initial target.
|
|
37
|
+
- Nested dialogs are fine; close the inner first. Do not open a dialog from a tooltip.
|
|
38
|
+
|
|
39
|
+
## Dialog vs Drawer vs Popover
|
|
40
|
+
|
|
41
|
+
| Use | When |
|
|
42
|
+
| -------- | --------------------------------------------------------------------- |
|
|
43
|
+
| Dialog | the user must decide before continuing |
|
|
44
|
+
| Drawer | a secondary panel or small-screen navigation; keeps context beside it |
|
|
45
|
+
| Popover | small contextual content anchored to a control; may contain controls |
|
|
46
|
+
| Tooltip | a short name or hint for a control; **never** the only copy of it |
|
|
47
|
+
| Dropdown | a list of commands; for choosing a value use Select |
|
|
48
|
+
|
|
49
|
+
A Popover can hold a form control; a Tooltip cannot hold anything interactive.
|
|
50
|
+
|
|
51
|
+
## Toast vs Alert
|
|
52
|
+
|
|
53
|
+
- `Toast` (via the toast service): a transient confirmation of something that already happened
|
|
54
|
+
("Saved"). It disappears; never rely on it for an error the user must read.
|
|
55
|
+
- `Alert`: part of the page, persistent until the condition clears. Errors and blocking states.
|
|
56
|
+
|
|
57
|
+
## Triggers and focus
|
|
58
|
+
|
|
59
|
+
- The trigger must be a real `<button>` (or `<a>` for navigation). Style it with `voltButton`.
|
|
60
|
+
- Escape closes, outside click dismisses (unless the overlay is not dismissible), focus returns to
|
|
61
|
+
the trigger. If you see any of these not happening, the overlay was built wrong — check against
|
|
62
|
+
the usage example before patching.
|
|
63
|
+
- Portals escape their container: do not rely on a parent's `overflow` or `z-index`.
|
|
64
|
+
|
|
65
|
+
<!-- volt:digest:start -->
|
|
66
|
+
|
|
67
|
+
- Dialog: trigger-driven `[voltDialog]`, controlled `voltDialogRoot [(open)]`, or `VoltDialogService`; always title + description; `[dismissible]="false"` while a request is pending.
|
|
68
|
+
- Destructive confirm → `role="alertdialog"` with initial focus on the safe action. Focus is trapped and returns to the trigger; do not manage it by hand.
|
|
69
|
+
- Overlays are an attribute directive on a real `<button>` plus an `<ng-template>`. Never import `Ngp*`.
|
|
70
|
+
- Toast is transient confirmation; Alert is persistent page feedback.
|
|
71
|
+
|
|
72
|
+
<!-- volt:digest:end -->
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: volt-ui-styling
|
|
3
|
+
description: >
|
|
4
|
+
Customise Volt UI without rebuilding it: semantic tokens, colour and style presets, light/dark,
|
|
5
|
+
the class merge contract, variants and sizes, native directives, layout wrappers, accessible
|
|
6
|
+
status colours. Use when changing how Volt components look or fit into a layout.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Styling Volt
|
|
10
|
+
|
|
11
|
+
**Customise Volt; do not rewrite it by accident.**
|
|
12
|
+
|
|
13
|
+
## Order of preference
|
|
14
|
+
|
|
15
|
+
1. **Variants and sizes** (`variant`, `size`, `state`) — the component's own design range. Ask the
|
|
16
|
+
MCP server which exist (`get_component`).
|
|
17
|
+
2. **The theme** — change tokens or presets, and every component follows.
|
|
18
|
+
3. **`class` on the component** — adjusts the one instance.
|
|
19
|
+
4. **A wrapper in your layout** — for placement.
|
|
20
|
+
|
|
21
|
+
Only then consider copying the component (copy mode) and editing it.
|
|
22
|
+
|
|
23
|
+
## Tokens and presets
|
|
24
|
+
|
|
25
|
+
- Use **semantic utilities**: `bg-primary`, `text-foreground`, `border-border`, `bg-muted`,
|
|
26
|
+
`text-muted-foreground`, `rounded-md`. Not `bg-[var(--primary)]`, not hard-coded hex.
|
|
27
|
+
- Colour presets: `volt`, `ember`, `sage`, `dusk`, `glacier`. Style presets: `sharp`, `soft`,
|
|
28
|
+
`brutal`, `ghost`, `retro`. Dark mode is a class on `<html>`. `provideVoltTheme({ color, style,
|
|
29
|
+
dark })` sets them at bootstrap; `applyVoltTheme` changes them at runtime.
|
|
30
|
+
- Import the theme CSS once: `@import '@voltui/components/themes.css';` after Tailwind.
|
|
31
|
+
- A custom palette overrides the `--volt-*` source variables, not the Tailwind utilities.
|
|
32
|
+
|
|
33
|
+
## The `class` contract
|
|
34
|
+
|
|
35
|
+
`class` on a Volt component is merged over the defaults with `tailwind-merge`, on the element that
|
|
36
|
+
paints. So `class="p-3"` **replaces** the default padding instead of fighting it, and
|
|
37
|
+
`class="w-24 font-mono"` on an input styles the native `<input>`. You do not need `!important`,
|
|
38
|
+
`[&&]` hacks or `::ng-deep`.
|
|
39
|
+
|
|
40
|
+
Wrappers around one native control move a static `class`, `id` and `aria-label` from the host to that
|
|
41
|
+
control — set them on the Volt tag as usual.
|
|
42
|
+
|
|
43
|
+
## Layout belongs to you
|
|
44
|
+
|
|
45
|
+
Grid, flex, gap, width and margin that place a component in the page go on a **wrapper element** in
|
|
46
|
+
your layout (or on `class` for a one-off), not into a copy of the component.
|
|
47
|
+
|
|
48
|
+
## Status colours
|
|
49
|
+
|
|
50
|
+
Use the semantic variants (`success`, `warning`, `info`, `destructive`) and pair colour with text or
|
|
51
|
+
an icon — colour alone does not carry meaning, and the presets are contrast-checked only for those
|
|
52
|
+
pairs. In a custom palette check the pairs you change.
|
|
53
|
+
|
|
54
|
+
## Do not
|
|
55
|
+
|
|
56
|
+
- Duplicate a component's internal classes in your own markup.
|
|
57
|
+
- Use arbitrary values (`bg-[#3b82f6]`) where a token exists.
|
|
58
|
+
- Style a state with `:hover`-only changes — pressed, selected and checked states must be visibly
|
|
59
|
+
different too (and have enough contrast).
|
|
60
|
+
|
|
61
|
+
<!-- volt:digest:start -->
|
|
62
|
+
|
|
63
|
+
- Prefer variants/sizes, then the theme, then `class` on the component (merged with tailwind-merge, so it replaces defaults), then a layout wrapper. Do not rewrite a component.
|
|
64
|
+
- Use semantic utilities (`bg-primary`, `text-foreground`, `border-border`), never hard-coded colours or `bg-[var(--x)]`.
|
|
65
|
+
- Presets: colour `volt|ember|sage|dusk|glacier`, style `sharp|soft|brutal|ghost|retro`; dark mode is a class on `<html>`.
|
|
66
|
+
- Pressed/selected/checked states must be visibly distinct and contrast-checked; colour alone is not meaning.
|
|
67
|
+
|
|
68
|
+
<!-- volt:digest:end -->
|
package/skills.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The Volt UI agent skills, read from `cli/agent/skills/<name>/SKILL.md` — the one copy. The
|
|
5
|
+
* installer writes them for agents that load skills (Claude Code, Codex, OpenCode); for agents that
|
|
6
|
+
* only read a rules file it writes `routingBlock()`, built from the same files, so a rules file and
|
|
7
|
+
* a skill cannot say different things.
|
|
8
|
+
*
|
|
9
|
+
* Each SKILL.md carries a `<!-- volt:digest:start/end -->` section: the few rules an agent needs when
|
|
10
|
+
* it cannot load the skill itself.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const fs = require('fs');
|
|
14
|
+
const path = require('path');
|
|
15
|
+
|
|
16
|
+
const SKILLS_DIR = path.join(__dirname, 'skills');
|
|
17
|
+
const DIGEST = /<!-- volt:digest:start -->\n([\s\S]*?)\n<!-- volt:digest:end -->/;
|
|
18
|
+
|
|
19
|
+
/** `volt-ui` first (the router), then the rest alphabetically. */
|
|
20
|
+
function skillNames() {
|
|
21
|
+
return fs
|
|
22
|
+
.readdirSync(SKILLS_DIR, { withFileTypes: true })
|
|
23
|
+
.filter(d => d.isDirectory() && fs.existsSync(path.join(SKILLS_DIR, d.name, 'SKILL.md')))
|
|
24
|
+
.map(d => d.name)
|
|
25
|
+
.sort((a, b) => (a === 'volt-ui' ? -1 : b === 'volt-ui' ? 1 : a.localeCompare(b)));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** @returns {Record<string, string>} skill name → full SKILL.md text */
|
|
29
|
+
function loadSkills() {
|
|
30
|
+
return Object.fromEntries(
|
|
31
|
+
skillNames().map(n => [n, fs.readFileSync(path.join(SKILLS_DIR, n, 'SKILL.md'), 'utf8')])
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Name and (folded) description from the YAML frontmatter. */
|
|
36
|
+
function describe(text) {
|
|
37
|
+
const front = text.match(/^---\n([\s\S]*?)\n---/)?.[1] ?? '';
|
|
38
|
+
const name = front.match(/^name:\s*(.+)$/m)?.[1]?.trim() ?? '';
|
|
39
|
+
const desc = front.match(/^description:\s*>?\s*\n?([\s\S]*)$/m)?.[1] ?? '';
|
|
40
|
+
const description = desc
|
|
41
|
+
.split('\n')
|
|
42
|
+
.map(l => l.trim())
|
|
43
|
+
.filter(Boolean)
|
|
44
|
+
.join(' ');
|
|
45
|
+
return { name, description };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function digestOf(text) {
|
|
49
|
+
return text.match(DIGEST)?.[1]?.trim() ?? '';
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The block for agents that read a rules file but do not load skills. Short on purpose: the
|
|
54
|
+
* facts live in the MCP server, the decisions in the digests below.
|
|
55
|
+
*/
|
|
56
|
+
function routingBlock(mcpUrl) {
|
|
57
|
+
const skills = loadSkills();
|
|
58
|
+
const sections = Object.entries(skills)
|
|
59
|
+
.filter(([name]) => name !== 'volt-ui')
|
|
60
|
+
.map(([name, text]) => `### ${name.replace('volt-ui-', '')}\n${digestOf(text)}`)
|
|
61
|
+
.join('\n\n');
|
|
62
|
+
return `# Volt UI (Angular)
|
|
63
|
+
|
|
64
|
+
${digestOf(skills['volt-ui'])}
|
|
65
|
+
|
|
66
|
+
MCP server \`volt-ui\` (${mcpUrl}): \`list_components\`, \`find_components\`, \`get_component\`, \`get_usage_example\`, \`get_theme_info\`, \`generate_cli_command\`.
|
|
67
|
+
|
|
68
|
+
## Playbooks
|
|
69
|
+
|
|
70
|
+
${sections}
|
|
71
|
+
`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
module.exports = { SKILLS_DIR, skillNames, loadSkills, describe, digestOf, routingBlock };
|