@vc-shell/vc-app-skill 2.11.0 → 2.12.0-pr417.8c07e1b
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/package.json +1 -1
- package/runtime/VERSION +1 -1
- package/runtime/knowledge/components.json +6396 -0
- package/runtime/knowledge/docs/_BUILD_HASH.md +1 -1
- package/runtime/knowledge/docs/core/blade-navigation/table-query-state/useTableQueryState.docs.md +1 -1
- package/runtime/knowledge/docs/core/plugins/i18n/i18n.docs.md +34 -8
- package/runtime/knowledge/docs/modules/assets/assets-details.docs.md +107 -40
- package/runtime/knowledge/docs/modules/assets-manager/assets-manager.docs.md +1 -0
- package/runtime/knowledge/docs/ui/components/atoms/vc-badge/vc-badge.docs.md +16 -14
- package/runtime/knowledge/docs/ui/components/atoms/vc-button/vc-button.docs.md +24 -11
- package/runtime/knowledge/docs/ui/components/molecules/vc-accordion/vc-accordion.docs.md +18 -4
- package/runtime/knowledge/docs/ui/components/molecules/vc-dropdown/vc-dropdown.docs.md +71 -43
- package/runtime/knowledge/docs/ui/components/molecules/vc-input/vc-input.docs.md +56 -46
- package/runtime/knowledge/docs/ui/components/molecules/vc-popover/vc-popover.docs.md +2 -0
- package/runtime/knowledge/docs/ui/components/molecules/vc-switch/vc-switch.docs.md +4 -3
- package/runtime/knowledge/docs/ui/components/organisms/vc-data-table/vc-data-table.docs.md +140 -26
- package/runtime/knowledge/docs/ui/components/organisms/vc-sidebar/vc-sidebar.docs.md +46 -28
- package/runtime/knowledge/index.md +14 -0
- package/runtime/knowledge/docs/core/composables/useKeyboardShortcuts/useKeyboardShortcuts.docs.md +0 -219
- package/runtime/knowledge/docs/core/composables/useLatestRequest/useLatestRequest.docs.md +0 -151
- package/runtime/knowledge/docs/core/utilities/focus.docs.md +0 -48
|
@@ -1 +1 @@
|
|
|
1
|
-
Synced from framework at commit
|
|
1
|
+
Synced from framework at commit c534d0013 on 2026-11-17T15:19:30.236Z
|
package/runtime/knowledge/docs/core/blade-navigation/table-query-state/useTableQueryState.docs.md
CHANGED
|
@@ -74,7 +74,7 @@ watch([sortExpression, searchValue, currentPage], debounce(load, 300));
|
|
|
74
74
|
| -------- | ----------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
75
75
|
| `read` | `() => TableQueryPatch` | Reads the restored `{ sort?, search?, page? }` from the URL. Returns `{}` when no service is available |
|
|
76
76
|
|
|
77
|
-
`TableQueryPatch`: `{ sort?: string; search?: string; page?: number }` — `sort` is a `"field:ASC"` / `"field:DESC"` expression, `page` is 1-based.
|
|
77
|
+
`TableQueryPatch`: `{ sort?: string; search?: string; page?: number; filters?: string; view?: string }` — `sort` is a `"field:ASC"` / `"field:DESC"` expression, `page` is 1-based. `filters` (`<stateKey>_filters`) is written and read by the table's search bar in its own compact format; a page does not need to seed anything from it, because the table emits `@filter` with the restored filters after mount. `view` (`<stateKey>_view`) is the id of the bar's current view, also written by the bar.
|
|
78
78
|
|
|
79
79
|
## Details
|
|
80
80
|
|
|
@@ -193,6 +193,32 @@ const message = i18n.global.t("MY_MODULE.SOME_KEY");
|
|
|
193
193
|
|
|
194
194
|
The framework exports its locale files as typed ES modules. App developers can import them to create full translations or override specific keys.
|
|
195
195
|
|
|
196
|
+
### Shipped Languages
|
|
197
|
+
|
|
198
|
+
The framework's own texts come in 15 languages. All of them are merged at startup, so an app whose locale is one of these codes gets the framework's texts without supplying them. The language menu offers a language only when the app's own messages for it have a `language_name`.
|
|
199
|
+
|
|
200
|
+
| Language | Code |
|
|
201
|
+
| ---------- | ---- |
|
|
202
|
+
| Arabic | `ar` |
|
|
203
|
+
| Chinese | `zh` |
|
|
204
|
+
| English | `en` |
|
|
205
|
+
| Finnish | `fi` |
|
|
206
|
+
| French | `fr` |
|
|
207
|
+
| German | `de` |
|
|
208
|
+
| Hebrew | `he` |
|
|
209
|
+
| Italian | `it` |
|
|
210
|
+
| Japanese | `ja` |
|
|
211
|
+
| Norwegian | `no` |
|
|
212
|
+
| Polish | `pl` |
|
|
213
|
+
| Portuguese | `pt` |
|
|
214
|
+
| Russian | `ru` |
|
|
215
|
+
| Spanish | `es` |
|
|
216
|
+
| Swedish | `sv` |
|
|
217
|
+
|
|
218
|
+
Plural messages (`"{count} filter | {count} filters"`) use the forms of each language: three in Russian and Polish (one, few, many), six in Arabic (zero, one, two, few, many, other), one in Japanese and Chinese, and two everywhere else (in French the first form also covers 0). A message written with another number of forms keeps vue-i18n's default choice.
|
|
219
|
+
|
|
220
|
+
Arabic and Hebrew are right to left: `useLanguages().setLocale()` sets `<html dir="rtl">` for them.
|
|
221
|
+
|
|
196
222
|
### Importing Framework Locales
|
|
197
223
|
|
|
198
224
|
```typescript
|
|
@@ -211,16 +237,16 @@ Spread the English locale as a base and override all sections:
|
|
|
211
237
|
import en from "@vc-shell/framework/locales/en";
|
|
212
238
|
import type { VcShellLocale } from "@vc-shell/framework/locales/types";
|
|
213
239
|
|
|
214
|
-
const
|
|
240
|
+
const nl: VcShellLocale = {
|
|
215
241
|
...en,
|
|
216
|
-
CORE: { THEMES: { LIGHT: "
|
|
242
|
+
CORE: { THEMES: { LIGHT: "Licht", DARK: "Donker" } },
|
|
217
243
|
SHELL: {
|
|
218
244
|
...en.SHELL,
|
|
219
245
|
ACCOUNT: {
|
|
220
|
-
SETTINGS: "
|
|
221
|
-
CHANGE_PASSWORD: "
|
|
222
|
-
PROFILE: "
|
|
223
|
-
LOGOUT: "
|
|
246
|
+
SETTINGS: "Instellingen",
|
|
247
|
+
CHANGE_PASSWORD: "Wachtwoord wijzigen",
|
|
248
|
+
PROFILE: "Profiel",
|
|
249
|
+
LOGOUT: "Afmelden",
|
|
224
250
|
},
|
|
225
251
|
},
|
|
226
252
|
COMPONENTS: {
|
|
@@ -230,7 +256,7 @@ const fr: VcShellLocale = {
|
|
|
230
256
|
};
|
|
231
257
|
|
|
232
258
|
// Register in your app's main.ts or plugin setup:
|
|
233
|
-
app.config.globalProperties.$mergeLocaleMessage("
|
|
259
|
+
app.config.globalProperties.$mergeLocaleMessage("nl", nl);
|
|
234
260
|
```
|
|
235
261
|
|
|
236
262
|
### Overriding Specific Keys
|
|
@@ -252,7 +278,7 @@ app.config.globalProperties.$mergeLocaleMessage("en", overrides);
|
|
|
252
278
|
Run the CLI tool to check for missing or extra keys:
|
|
253
279
|
|
|
254
280
|
```bash
|
|
255
|
-
npx vc-check-locales ./src/locales/
|
|
281
|
+
npx vc-check-locales ./src/locales/nl.json
|
|
256
282
|
```
|
|
257
283
|
|
|
258
284
|
In development mode, the framework also logs console warnings when a translation key is accessed but has no value for the current locale.
|
|
@@ -7,13 +7,18 @@ slug: assets
|
|
|
7
7
|
|
|
8
8
|
# Assets Details Module
|
|
9
9
|
|
|
10
|
-
A built-in child blade
|
|
10
|
+
A built-in child blade that shows one asset. It has two modes:
|
|
11
|
+
|
|
12
|
+
- **Flat mode** (`asset`): an asset stored on an entity, such as a product image or a task attachment. The user edits the name, alt text (images only) and description, then saves or deletes.
|
|
13
|
+
- **Storage mode** (`assetSource`): a file in a storage folder. The blade is read-only and offers Download, Copy link and Delete.
|
|
14
|
+
|
|
15
|
+
`AssetsManager` opens it in flat mode when the user clicks a row, `AssetsFolderManager` in storage mode when the user clicks a file. Any parent blade can open it the same way.
|
|
11
16
|
|
|
12
17
|
## Overview
|
|
13
18
|
|
|
14
|
-
The blade
|
|
19
|
+
The blade never talks to the network. Saving and deleting go back to the caller through `assetEditHandler` and `assetRemoveHandler`; the caller decides what they mean.
|
|
15
20
|
|
|
16
|
-
The module is registered as `AssetsDetailsModule` and exposes the
|
|
21
|
+
The module is registered as `AssetsDetailsModule` and exposes the blade under the name `"AssetsDetails"`.
|
|
17
22
|
|
|
18
23
|
## Module Registration
|
|
19
24
|
|
|
@@ -26,19 +31,32 @@ import { AssetsDetailsModule } from "@vc-shell/framework";
|
|
|
26
31
|
|
|
27
32
|
## Options (via `useBlade`)
|
|
28
33
|
|
|
29
|
-
The blade reads its configuration from `options` via `useBlade<AssetsDetailsOptions>()
|
|
34
|
+
The blade reads its configuration from `options` via `useBlade<AssetsDetailsOptions>()`, not props. Every option is optional.
|
|
35
|
+
|
|
36
|
+
| Option | Type | Description |
|
|
37
|
+
| -------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
38
|
+
| `asset` | `AssetLike` | Flat mode. The asset to edit. The blade works on a copy; the source object is not touched until `assetEditHandler` gets the copy. |
|
|
39
|
+
| `assetSource` | `ComputedRef<AssetLike \| undefined>` | Storage mode. The live entry. The blade follows its changes and closes when it becomes `undefined`. Wins over `asset`. |
|
|
40
|
+
| `disabled` | `boolean` | Disables Save and Delete, and makes the form fields read-only. Download and Copy link stay available. |
|
|
41
|
+
| `hiddenFields` | `string[]` | Form fields to hide: `"name"`, `"altText"`, `"description"`. The header and the File section are always shown. |
|
|
42
|
+
| `assetEditHandler` | `(asset: AssetLike) => void` | Flat mode. Called by Save with the edited copy. The blade closes after it resolves. |
|
|
43
|
+
| `assetRemoveHandler` | `(asset: AssetLike) => Promise<void \| boolean>` | Called by Delete. The blade closes after it resolves, unless it resolves `false`. A rejection also keeps the blade open. |
|
|
44
|
+
| `extraInfo` | `(asset: AssetLike) => IAssetInfoItem[] \| Promise<IAssetInfoItem[]>` | Extra rows under the File section, in both modes. See [Extra rows](#extra-rows). |
|
|
45
|
+
|
|
46
|
+
The exported types:
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import type { AssetsDetailsOptions, IAssetInfoItem } from "@vc-shell/framework";
|
|
30
50
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
| `assetEditHandler` | `((asset: AssetLike) => void)?` | Called by the toolbar Save button with the edited copy. The blade closes itself after the handler resolves. If omitted, the Save button performs no action and the blade does not close. |
|
|
37
|
-
| `assetRemoveHandler` | `((asset: AssetLike) => Promise<void>)?` | Called by the toolbar Delete button. The blade closes itself after the handler resolves. If omitted, the Delete button performs no action and the blade does not close. |
|
|
51
|
+
interface IAssetInfoItem {
|
|
52
|
+
label: string;
|
|
53
|
+
value: string;
|
|
54
|
+
}
|
|
55
|
+
```
|
|
38
56
|
|
|
39
57
|
## Usage
|
|
40
58
|
|
|
41
|
-
###
|
|
59
|
+
### Flat mode
|
|
42
60
|
|
|
43
61
|
```typescript
|
|
44
62
|
import { useBlade } from "@vc-shell/framework";
|
|
@@ -61,9 +79,30 @@ openBlade({
|
|
|
61
79
|
});
|
|
62
80
|
```
|
|
63
81
|
|
|
64
|
-
###
|
|
82
|
+
### Storage mode
|
|
83
|
+
|
|
84
|
+
Pass the entry as a computed, so the blade shows fresh data after a reload and closes when the file is gone.
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
import { computed } from "vue";
|
|
88
|
+
import { useBlade } from "@vc-shell/framework";
|
|
89
|
+
|
|
90
|
+
const { openBlade } = useBlade();
|
|
91
|
+
|
|
92
|
+
openBlade({
|
|
93
|
+
name: "AssetsDetails",
|
|
94
|
+
options: {
|
|
95
|
+
assetSource: computed(() => entries.value.find((entry) => entry.url === openUrl.value)),
|
|
96
|
+
assetRemoveHandler: async (asset) => {
|
|
97
|
+
const confirmed = await confirmDelete(asset.name);
|
|
98
|
+
if (!confirmed) return false; // keeps the blade open
|
|
99
|
+
await api.deleteBlobs([asset.url]);
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
```
|
|
65
104
|
|
|
66
|
-
|
|
105
|
+
### Used by AssetsManager
|
|
67
106
|
|
|
68
107
|
```typescript
|
|
69
108
|
// inside AssetsManager
|
|
@@ -79,45 +118,73 @@ openBlade({
|
|
|
79
118
|
});
|
|
80
119
|
```
|
|
81
120
|
|
|
82
|
-
##
|
|
121
|
+
## Layout
|
|
83
122
|
|
|
84
|
-
|
|
123
|
+
| Part | Content |
|
|
124
|
+
| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
125
|
+
| Header | A 96 px preview for images (click opens the file in a new tab), or a tile with the extension label (`FILE` without an extension). The name and chips: extension, size, image dimensions. |
|
|
126
|
+
| URL row | The absolute URL (a relative URL is resolved against the page origin) on one line, with a copy button. Only when the asset has a `url`. |
|
|
127
|
+
| Metadata | Flat mode only. Name, alt text, description. Hidden when `hiddenFields` hides all of them. |
|
|
128
|
+
| File | Type (`contentType` or the extension), size, dimensions (images, once loaded), created date. Storage mode adds the modified date. |
|
|
129
|
+
| Extra | Rows from `extraInfo`, under a separator. |
|
|
85
130
|
|
|
86
|
-
|
|
87
|
-
| ------------ | -------------------------------------------------------------------------------------------------- |
|
|
88
|
-
| Preview | `VcImage` thumbnail for image extensions (png/jpg/jpeg/svg/gif), colored extension badge otherwise |
|
|
89
|
-
| Size | `readableSize(asset.size)` — formatted as `KB`/`MB`/`GB` |
|
|
90
|
-
| Created date | `asset.createdDate` rendered with `type="date-ago"` |
|
|
91
|
-
| URL | `asset.url` displayed as a copyable link with `asset.name` as the visible label |
|
|
131
|
+
An image is detected by the file extension (`isImage(name)`). An image that has no `url` or fails to load shows the tile and no dimensions.
|
|
92
132
|
|
|
93
133
|
## Form fields
|
|
94
134
|
|
|
95
|
-
|
|
135
|
+
Flat mode only. The fields edit the copy of `asset`.
|
|
96
136
|
|
|
97
|
-
| Field | Visibility
|
|
98
|
-
| ------------- |
|
|
99
|
-
| `name` |
|
|
100
|
-
| `altText` |
|
|
101
|
-
| `description` |
|
|
137
|
+
| Field | Visibility | Notes |
|
|
138
|
+
| ------------- | ------------------------------------ | ---------------------------------------------------------------------------------------------- |
|
|
139
|
+
| `name` | Hide with `"name"` | Required. Edits the base name only; the extension is shown as a suffix and reattached on save. |
|
|
140
|
+
| `altText` | Only when `asset.typeId === "Image"` | Hide with `"altText"`. |
|
|
141
|
+
| `description` | Hide with `"description"` | Multiline. |
|
|
102
142
|
|
|
103
143
|
## Toolbar
|
|
104
144
|
|
|
105
|
-
| Button | Disabled
|
|
106
|
-
|
|
|
107
|
-
| Save
|
|
108
|
-
|
|
|
145
|
+
| Button | Mode | Shown when | Disabled when | Action |
|
|
146
|
+
| --------- | ------- | ------------------------------------------ | --------------------------------------------------- | ------------------------------------------------------------------------ |
|
|
147
|
+
| Save | Flat | Always | `disabled`, the form is invalid, or nothing changed | `await assetEditHandler(copy)`, then close |
|
|
148
|
+
| Download | Both | The asset has a `url` | Never | Downloads the file under its name |
|
|
149
|
+
| Copy link | Storage | The asset has a `url` | Never | Copies the absolute URL and shows a toast |
|
|
150
|
+
| Delete | Both | Storage mode needs `platform:asset:delete` | `disabled` | `await assetRemoveHandler(asset)`, then close unless it resolved `false` |
|
|
151
|
+
|
|
152
|
+
Flat-mode Delete has no permission check; the caller decides who may delete.
|
|
153
|
+
|
|
154
|
+
## Extra rows
|
|
155
|
+
|
|
156
|
+
`extraInfo` runs each time the blade shows a file, and again when the file's `url` or `modifiedDate` changes. A skeleton shows while it loads. If it throws or rejects, one muted line says the information could not be loaded and the rest of the blade works. When several calls overlap, the last one wins.
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
159
|
+
openBlade({
|
|
160
|
+
name: "AssetsDetails",
|
|
161
|
+
options: {
|
|
162
|
+
assetSource,
|
|
163
|
+
extraInfo: async (asset) => {
|
|
164
|
+
const pages = await api.pagesUsing(asset.url);
|
|
165
|
+
return [{ label: "Used on", value: `${pages.length} pages` }];
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Closing
|
|
172
|
+
|
|
173
|
+
- Save closes the blade after `assetEditHandler` resolves.
|
|
174
|
+
- Delete closes it after `assetRemoveHandler` resolves, unless the result is `false`. A rejection keeps it open.
|
|
175
|
+
- In storage mode, the blade closes when `assetSource` becomes `undefined`.
|
|
176
|
+
- Options carry functions and a live ref, so a page reload or a deep link mounts the blade without `asset` or `assetSource`. It then closes itself.
|
|
109
177
|
|
|
110
178
|
## Tips
|
|
111
179
|
|
|
112
|
-
- **Extension is locked.**
|
|
113
|
-
- **
|
|
114
|
-
-
|
|
115
|
-
- **`
|
|
116
|
-
- **`hiddenFields` does not enforce required-ness.** Hiding `"name"` skips the validated `<Field>`, so the Save button only depends on form dirtiness.
|
|
180
|
+
- **Extension is locked.** Renaming `photo.png` to `cover` saves `cover.png`. A name without an extension, such as `README`, is saved as typed.
|
|
181
|
+
- **Only the last extension is locked.** `my.photo.v2.jpg` edits as `my.photo.v2` with `.jpg` locked.
|
|
182
|
+
- **The source asset is never mutated.** `assetEditHandler` gets the edited copy; treat it as the new state.
|
|
183
|
+
- **`hiddenFields` does not enforce required fields.** Hiding `"name"` drops its validation, so Save depends on dirtiness only.
|
|
117
184
|
|
|
118
185
|
## Related
|
|
119
186
|
|
|
120
|
-
-
|
|
187
|
+
- [Assets Manager](../assets-manager/assets-manager.docs.md) -- opens `AssetsDetails` in flat mode for an entity's assets
|
|
188
|
+
- [Assets Folder Manager](../assets-manager/assets-folder-manager.docs.md) -- opens `AssetsDetails` in storage mode for files in a folder
|
|
121
189
|
- `framework/core/composables/useAssetsManager/` -- `AssetLike` type definition
|
|
122
|
-
- `framework/core/utilities/assets.ts` -- `isImage`, `readableSize`, `
|
|
123
|
-
- `framework/ui/components/molecules/vc-field/` -- `VcField` used by the header for size/date/url
|
|
190
|
+
- `framework/core/utilities/assets.ts` -- `isImage`, `readableSize`, `absoluteUrl`, `downloadFile`, `getExtensionColor`
|
|
@@ -163,6 +163,7 @@ Key points:
|
|
|
163
163
|
|
|
164
164
|
## Related
|
|
165
165
|
|
|
166
|
+
- [Assets Folder Manager](./assets-folder-manager.docs.md) -- browses a storage folder tree instead of a flat asset list
|
|
166
167
|
- `framework/core/composables/useAssetsManager/` -- `useAssetsManager`, `AssetLike`, `UseAssetsManagerReturn`
|
|
167
168
|
- `framework/core/utilities/assets.ts` -- `isImage`, `readableSize`, `getExtensionColor`, `getExtensionLabel`
|
|
168
169
|
- `framework/modules/assets/components/assets-details/` -- `AssetsDetails` child blade opened on row click
|
|
@@ -30,20 +30,22 @@ A small indicator component for displaying counts, status dots, or short text la
|
|
|
30
30
|
|
|
31
31
|
## Key Props
|
|
32
32
|
|
|
33
|
-
| Prop | Type | Default | Description
|
|
34
|
-
| ---------------- | -------------------------------------------------------------------------- | ----------- |
|
|
35
|
-
| `content` | `string \| number` | -- | Text or number displayed inside the badge
|
|
36
|
-
| `variant` | `"primary" \| "success" \| "warning" \| "danger" \| "info" \| "secondary"` | `"primary"` | Color variant
|
|
37
|
-
| `size` | `"s" \| "m"` | `"m"` | Badge size
|
|
38
|
-
| `isDot` | `boolean` | `false` | Renders as a small dot without text
|
|
39
|
-
| `inline` | `boolean` | `false` | Renders as an inline element without absolute positioning
|
|
40
|
-
| `clickable` | `boolean` | `false` | Makes the badge respond to click events
|
|
41
|
-
| `disabled` | `boolean` | `false` | Disables interaction on clickable badges
|
|
42
|
-
| `active` | `boolean` | `false` | Applies the active-state color tokens to the badge
|
|
43
|
-
| `customPosition` | `boolean` | `false` | Enables custom `top`/`right` positioning
|
|
44
|
-
| `top` | `string` | -- | Custom top offset (requires `customPosition`)
|
|
45
|
-
| `right` | `string` | -- |
|
|
46
|
-
| `ariaLabel` | `string` | -- | Custom accessible label for the badge
|
|
33
|
+
| Prop | Type | Default | Description |
|
|
34
|
+
| ---------------- | -------------------------------------------------------------------------- | ----------- | --------------------------------------------------------------------------- |
|
|
35
|
+
| `content` | `string \| number` | -- | Text or number displayed inside the badge |
|
|
36
|
+
| `variant` | `"primary" \| "success" \| "warning" \| "danger" \| "info" \| "secondary"` | `"primary"` | Color variant |
|
|
37
|
+
| `size` | `"s" \| "m"` | `"m"` | Badge size |
|
|
38
|
+
| `isDot` | `boolean` | `false` | Renders as a small dot without text |
|
|
39
|
+
| `inline` | `boolean` | `false` | Renders as an inline element without absolute positioning |
|
|
40
|
+
| `clickable` | `boolean` | `false` | Makes the badge respond to click events |
|
|
41
|
+
| `disabled` | `boolean` | `false` | Disables interaction on clickable badges |
|
|
42
|
+
| `active` | `boolean` | `false` | Applies the active-state color tokens to the badge |
|
|
43
|
+
| `customPosition` | `boolean` | `false` | Enables custom `top`/`right` positioning |
|
|
44
|
+
| `top` | `string` | -- | Custom top offset (requires `customPosition`) |
|
|
45
|
+
| `right` | `string` | -- | Offset from the end edge: right, or left in RTL (requires `customPosition`) |
|
|
46
|
+
| `ariaLabel` | `string` | -- | Custom accessible label for the badge |
|
|
47
|
+
| `solid` | `boolean` | `false` | Inline mode: filled colours with white text (a count) |
|
|
48
|
+
| `label` | `boolean` | `false` | Inline mode: a word label, not truncated, rounded corners |
|
|
47
49
|
|
|
48
50
|
::storybook id="data-display-vcbadge--use-cases" height="350"
|
|
49
51
|
|
|
@@ -91,6 +91,14 @@ No border or background, used for inline or de-emphasized actions.
|
|
|
91
91
|
| `ghost` | Toolbar icons, inline actions | Light background tint |
|
|
92
92
|
| `link` | Text-like navigation, inline links | Underline on text |
|
|
93
93
|
|
|
94
|
+
### Tonal Variant
|
|
95
|
+
|
|
96
|
+
A soft primary tint with a light border, for applied state: filter chips, an active filters button, tags. `selected` takes the hover tint.
|
|
97
|
+
|
|
98
|
+
```vue
|
|
99
|
+
<VcButton variant="tonal" size="2xs">Status: New</VcButton>
|
|
100
|
+
```
|
|
101
|
+
|
|
94
102
|
## Sizes
|
|
95
103
|
|
|
96
104
|
Five size options cover all common use cases from toolbar icons to prominent CTAs.
|
|
@@ -98,6 +106,7 @@ Five size options cover all common use cases from toolbar icons to prominent CTA
|
|
|
98
106
|
::storybook id="action-vcbutton--all-sizes"
|
|
99
107
|
|
|
100
108
|
```vue
|
|
109
|
+
<VcButton size="2xs">Extra small</VcButton>
|
|
101
110
|
<VcButton size="sm">Small</VcButton>
|
|
102
111
|
<VcButton size="default">Default</VcButton>
|
|
103
112
|
<VcButton size="lg">Large</VcButton>
|
|
@@ -107,12 +116,15 @@ Five size options cover all common use cases from toolbar icons to prominent CTA
|
|
|
107
116
|
|
|
108
117
|
| Size | Height | Padding | Typical Use |
|
|
109
118
|
| --------- | ------- | ----------------------------- | ----------------------------------- |
|
|
119
|
+
| `2xs` | 28px | 8px horizontal | Filter chips, tags, dense toolbars |
|
|
110
120
|
| `sm` | 32px | 12px horizontal | Compact form actions, table footers |
|
|
111
121
|
| `default` | 36px | 16px horizontal, 8px vertical | Standard blade actions |
|
|
112
122
|
| `lg` | 40px | 24px horizontal | Prominent CTAs, dialog actions |
|
|
113
123
|
| `icon` | 36x36px | 0 (square) | Toolbar icon buttons |
|
|
114
124
|
| `icon-sm` | 24x24px | 0 (square) | Table cell actions, inline controls |
|
|
115
125
|
|
|
126
|
+
`2xs` is the 28px size; with only an icon it is a 28px square. It is not the legacy `xs`, which still renders as `sm`.
|
|
127
|
+
|
|
116
128
|
!!! note "Legacy size aliases"
|
|
117
129
|
`xs` (maps to `sm`) and `base` (maps to `default`) are supported for backward compatibility but should not be used in new code.
|
|
118
130
|
|
|
@@ -295,17 +307,18 @@ Use the `loading` prop, not `disabled`. A disabled button gives no progress feed
|
|
|
295
307
|
|
|
296
308
|
All visual properties are customizable through CSS custom properties. Each variant has three property sets (normal, hover, disabled) for background, text, and border colors.
|
|
297
309
|
|
|
298
|
-
| Pattern | Example | Description
|
|
299
|
-
| ------------------------------------------- | ----------------------------------------- |
|
|
300
|
-
| `--button-{variant}-background-color` | `--button-primary-background-color` | Normal background
|
|
301
|
-
| `--button-{variant}-background-color-hover` | `--button-primary-background-color-hover` | Hover background
|
|
302
|
-
| `--button-{variant}-text-color` | `--button-primary-text-color` | Normal text color
|
|
303
|
-
| `--button-{variant}-border-color` | `--button-primary-border-color` | Normal border color
|
|
304
|
-
| `--button-border-radius` | `6px` | Corner radius for all buttons
|
|
305
|
-
| `--button-focus-ring-color` | `var(--primary-300)` | Focus ring color
|
|
306
|
-
| `--button-focus-ring-width` | `2px` | Focus ring thickness
|
|
307
|
-
| `--button-focus-ring-offset` | `2px` | Focus ring offset
|
|
308
|
-
| `--button-{size}-height` | `--button-default-height: 36px` | Height per size
|
|
310
|
+
| Pattern | Example | Description |
|
|
311
|
+
| ------------------------------------------- | ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
312
|
+
| `--button-{variant}-background-color` | `--button-primary-background-color` | Normal background |
|
|
313
|
+
| `--button-{variant}-background-color-hover` | `--button-primary-background-color-hover` | Hover background |
|
|
314
|
+
| `--button-{variant}-text-color` | `--button-primary-text-color` | Normal text color |
|
|
315
|
+
| `--button-{variant}-border-color` | `--button-primary-border-color` | Normal border color |
|
|
316
|
+
| `--button-border-radius` | `6px` | Corner radius for all buttons |
|
|
317
|
+
| `--button-focus-ring-color` | `var(--primary-300)` | Focus ring color |
|
|
318
|
+
| `--button-focus-ring-width` | `2px` | Focus ring thickness |
|
|
319
|
+
| `--button-focus-ring-offset` | `2px` | Focus ring offset |
|
|
320
|
+
| `--button-{size}-height` | `--button-default-height: 36px` | Height per size |
|
|
321
|
+
| `--button-hit-area-size` | `44px` | Minimum size of the `::after` hit area around the button. Set `0px` on a container whose buttons sit edge to edge (an attached group, stacked menu rows), so one does not take its neighbour's clicks |
|
|
309
322
|
|
|
310
323
|
## Accessibility
|
|
311
324
|
|
|
@@ -240,12 +240,25 @@ interface AccordionItem {
|
|
|
240
240
|
| --------- | ---------------------------------------------------------------- |
|
|
241
241
|
| `default` | Place `VcAccordionItem` components directly for custom rendering |
|
|
242
242
|
|
|
243
|
+
### VcAccordionItem Props
|
|
244
|
+
|
|
245
|
+
| Prop | Type | Default | Description |
|
|
246
|
+
| ------------------- | ------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
247
|
+
| `title` | `string` | -- | Header text |
|
|
248
|
+
| `isExpanded` | `boolean` | `false` | Open state; the item also emits `toggle` and `update:isExpanded` |
|
|
249
|
+
| `collapsedHeight` | `number` | `0` | Height in px shown while closed |
|
|
250
|
+
| `maxExpandedHeight` | `number` | -- | Maximum open height in px; taller content scrolls |
|
|
251
|
+
| `disabled` | `boolean` | `false` | Disables the header |
|
|
252
|
+
| `lazy` | `boolean` | `false` | Mounts the content only while open: on open, and until the close animation ends. The item stays expandable with nothing mounted to measure, and the closed panel is inert |
|
|
253
|
+
| `iconPosition` | `"start" \| "end"` | `"end"` | Chevron after the title, or before it (pointing to the text while closed, down while open) |
|
|
254
|
+
|
|
243
255
|
### VcAccordionItem Slots
|
|
244
256
|
|
|
245
|
-
| Slot | Description
|
|
246
|
-
| --------- |
|
|
247
|
-
| `title` | Custom title rendering (replaces the `title` prop text)
|
|
248
|
-
| `default` | Content body of the accordion item
|
|
257
|
+
| Slot | Description |
|
|
258
|
+
| --------- | -------------------------------------------------------------------------------------------------------------- |
|
|
259
|
+
| `title` | Custom title rendering (replaces the `title` prop text) |
|
|
260
|
+
| `default` | Content body of the accordion item |
|
|
261
|
+
| `actions` | Controls next to the header button, outside it (e.g. a remove button). Without it the header renders as before |
|
|
249
262
|
|
|
250
263
|
## CSS Variables
|
|
251
264
|
|
|
@@ -269,6 +282,7 @@ interface AccordionItem {
|
|
|
269
282
|
| `--accordion-item-header-gap` | `0` | Gap between header label and icon |
|
|
270
283
|
| `--accordion-item-icon-margin-left` | `12px` | Left margin of the chevron icon |
|
|
271
284
|
| `--accordion-item-icon-size` | `20px` | Chevron icon size |
|
|
285
|
+
| `--accordion-item-icon-color` | `currentColor` | Chevron color |
|
|
272
286
|
| `--accordion-item-content-color` | `var(--secondary-950)` | Content body text color |
|
|
273
287
|
| `--accordion-item-content-font-size` | `14px` | Content body font size |
|
|
274
288
|
| `--accordion-item-content-line-height` | `20px` | Content body line height |
|