@xleddyl/443-components-vue 0.16.14 → 0.16.15

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 (35) hide show
  1. package/CATALOG.md +124 -118
  2. package/README.md +4 -0
  3. package/dist/components/data/RecordList.vue +55 -0
  4. package/dist/components/data/RecordList.vue.d.ts +237 -0
  5. package/dist/components/data/index.d.ts +1 -0
  6. package/dist/components/data/index.mjs +1 -0
  7. package/dist/components/data/types.d.ts +9 -0
  8. package/dist/components/overlays/CommandButton.vue +21 -0
  9. package/dist/components/overlays/CommandButton.vue.d.ts +249 -0
  10. package/dist/components/overlays/CommandPalette.vue +13 -2
  11. package/dist/components/overlays/index.d.ts +2 -0
  12. package/dist/components/overlays/index.mjs +2 -0
  13. package/dist/components/overlays/types.d.ts +4 -0
  14. package/dist/components/templates/DashboardLayout.vue +22 -6
  15. package/dist/components/templates/DashboardLayout.vue.d.ts +1 -0
  16. package/dist/components/templates/FormDrawer.vue +59 -9
  17. package/dist/components/templates/FormDrawer.vue.d.ts +3 -1
  18. package/dist/components/templates/types.d.ts +4 -0
  19. package/dist/composables/layout.d.ts +1 -0
  20. package/dist/composables/layout.mjs +1 -0
  21. package/dist/composables/templates.d.ts +1 -0
  22. package/dist/composables/templates.mjs +1 -0
  23. package/dist/composables/useConfirm.d.ts +4 -1
  24. package/dist/composables/useConfirm.mjs +16 -2
  25. package/dist/composables/usePageCommands.d.ts +6 -0
  26. package/dist/composables/usePageCommands.mjs +9 -0
  27. package/dist/composables/useRouteRecord.d.ts +24 -0
  28. package/dist/composables/useRouteRecord.mjs +55 -0
  29. package/dist/locale/de.mjs +1 -0
  30. package/dist/locale/en.mjs +1 -0
  31. package/dist/locale/it.mjs +1 -0
  32. package/dist/locale/types.d.ts +1 -0
  33. package/dist/styles/data/record-list.css +57 -0
  34. package/dist/styles/data.css +1 -0
  35. package/package.json +1 -1
package/CATALOG.md CHANGED
@@ -28,108 +28,112 @@ Playground paths in this file are relative to `playground/nuxt/app/pages/compone
28
28
 
29
29
  ## Which component for which task
30
30
 
31
- | Task | Use |
32
- | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
33
- | Form with validation, dirty state and server errors | `useForm` + `Form` + `FormField` + field components |
34
- | One labelled field with error, hint and required marker | `FormField` |
35
- | Map a server error (409, 422) to fields | `useForm` option `submitError`, `form.setErrors`, `form.setIssues` |
36
- | Form as a full page with sticky save footer | `FormPage` |
37
- | Create or edit form in a side panel (cancel, save, delete, guard) | `FormDrawer` (`form`, `creating`, `readonly`, `deletable`, `loading`) |
38
- | Warn before the user leaves with unsaved changes | `useDirtyGuard` (or `FormPage`, it has `guard`) |
39
- | Floating "unsaved changes" bar | `SaveBar` |
40
- | Single line text | `Input` |
41
- | Multi line text | `Textarea` |
42
- | Rich text (bold, lists, links) | `RichTextEditor` (group `editor`) |
43
- | Password with strength meter and generator | `PasswordInput` |
44
- | Number with stepper, locale format | `NumberInput` |
45
- | Money or unit prefix and suffix around an input | `InputGroup` + `InputAddon` |
46
- | One choice from a short list (5 or fewer) | `RadioGroup` or `SegmentedControl` |
47
- | One choice from a longer list, no search | `Select` |
48
- | Searchable select, async search, multi select, create option | `Combobox` |
49
- | Create new values with a format or rule (tags, codes) | `Combobox` with `creatable`, `createTransform`, `createValidate` |
50
- | Several choices as checkboxes | `CheckboxGroup` |
51
- | One yes or no | `Switch` (instant setting) or `Checkbox` (part of a form) |
52
- | Date, date and time, month | `DateInput` (native) or `DatePicker` (popover calendar, ranges) |
53
- | Inline calendar | `Calendar` |
54
- | Time of day | `TimeInput` |
55
- | Color | `ColorInput` |
56
- | Number in a range | `Slider` |
57
- | One time code, OTP | `PinInput` |
58
- | File or folder upload with drop zone | `FileInput` |
59
- | Drop files on any element | `useFileDrop` |
60
- | `useSortable` | Reorder any small list by pointer drag (live, Escape cancels) and Alt with the arrow keys, with an announcement. `TagList` uses it. | `useSortable(containerRef, { items, onMove(items, move), orientation, disabled, handle, canMove, label, movedText })` returns `{ itemProps(index), move(from, to), canMove, dragging, announcement }`. Bind `itemProps(index)` on each item and render `announcement` in a live region. | `data/tag-list.vue` |
61
- | Confirm a destructive action | `useConfirm` |
62
- | Show a message the user must acknowledge | `useAlert` |
63
- | Ask for one text value | `usePrompt` |
64
- | Short message after an action | `toast` |
65
- | Toast for a promise (loading, success, error) | `toast.promise` |
66
- | Toast after saving in an open Drawer | `toast` (the stack moves beside the drawer or above its footer) |
67
- | Detail or edit panel from the side | `Drawer` (or `useDrawer().open`) |
68
- | Dialog with a form or content | `Modal` (or `useModal().open` to get the result as a promise) |
69
- | Tabs or subpages (breadcrumb and back) in a Modal or Drawer | `tabs` + `v-model:tab`; `trail` + `@navigate` on `Modal` / `Drawer` |
70
- | Buttons in a Modal or Drawer header | `#actions` slot of `Modal` / `Drawer` (right side, before the close button) |
71
- | Deep link to a drawer or modal (`?family=fam_1`, `#family/fam_1`) | `useRouteState('family')` + `:open="!!familyId"`, `location: 'hash'`; settings: `route`, `settingsRoute` |
72
- | Menu opened by a button | `DropdownMenu` |
73
- | Right click menu | `ContextMenu` |
74
- | Small floating panel with content or a form | `Popover` |
75
- | Preview on hover (user card) | `HoverCard` |
76
- | Short label on hover or focus | `Tooltip` |
77
- | Global search, command menu (Cmd+K) | `CommandPalette` (the `DashboardLayout` has it with `search`) |
78
- | Small table, simple sort | `Table` (+ `useTableSort` for client sort) |
79
- | Big table, many rows, editing, Excel-like | `DataGrid` (+ `spreadsheet` prop for Excel-like editing) |
80
- | Filters for a grid (selects, dates in a modal from the toolbar) | `DataGrid` `#filters` slot with `filterCount` and `@filters-reset` |
81
- | Several tags or statuses in one grid cell | `BadgeCell` with an array value (`max` adds a `+N` badge) |
82
- | Whole list page: search, filters, table, pagination | `ListPage` |
83
- | Page numbers and page size | `Pagination` |
84
- | Bulk actions bar for selected rows | `SelectionBar` |
85
- | Filter chips, active filters | `FilterPills` |
86
- | Tags, chips, removable labels | `Tag` |
87
- | Reorder chips by drag and keyboard, drop items from another panel | `TagList` (`sortable`, `removable`, `accept` + `@item-drop`) |
88
- | Reorder any list by drag and keyboard | `useSortable` |
89
- | Status label, counter, dot | `Badge` |
90
- | User picture or initials; stack of users | `Avatar`; `AvatarGroup` |
91
- | Key figure with delta and trend (KPI) | `Stat` |
92
- | Label and value pairs (details) | `DescriptionList` |
93
- | Event history, activity feed | `Timeline` |
94
- | Hierarchy, folders, drag to reorder | `Tree` |
95
- | Charts (line, bar, doughnut) | `ChartPanel` + `LineChart` / `BarChart` / `DoughnutChart` (group `chart`) |
96
- | Tabs | `Tabs` |
97
- | Wizard steps, step indicator (Step 2 of 4) | `Stepper` |
98
- | Collapsible sections, FAQ | `Accordion` |
99
- | Container with title and actions | `Card` |
100
- | Page title, description, breadcrumbs, actions | `PageHeader` (or a page template) |
101
- | Breadcrumbs only | `Breadcrumbs` |
102
- | Dashboard layout with sidebar, search, account and settings | `DashboardLayout` (or the Nuxt layout `k-dashboard`) |
103
- | Actions in a settings section header ("Add user") | `#actions-<id>` on `SettingsModal`, `#settings-actions-<id>` on `DashboardLayout` (gets `page`, `openPage`, `back`) |
104
- | Page that fills the panel height (a full height grid) | `content="fill"` or `"centered"` on `DashboardLayout` / `AppShell`, `definePageMeta({ content: 'fill' })` |
105
- | Custom app frame with your own sidebar | `AppShell` + `Sidebar` + `SidebarNav` |
106
- | Login, sign up, reset password page | `AuthLayout` (or the Nuxt layout `k-auth`) |
107
- | Settings in a modal (account, appearance, your sections) | `SettingsModal` (the `DashboardLayout` embeds it) |
108
- | Settings as a page with sections | `SettingsPage` + `SettingsSection` + `SettingsGroup` |
109
- | Theme and preset choice | `AppearanceSettings`, `ThemeSwitch`, `useTheme`, `usePreset` |
110
- | Remember UI choices per user (theme, sidebar, grid columns, page size) | `createPreferences` with your store (`createRemotePreferenceStore` for an API), `usePreference` for your own keys |
111
- | Detail page of one record with tabs and aside | `DetailPage` |
112
- | Overview page with stats | `DashboardPage` |
113
- | First run screen with steps | `EmptyPage` |
114
- | Error page, 404 page | `ErrorPage`, `NotFoundPage` |
115
- | Empty state inside a card or list | `EmptyState` |
116
- | Loading placeholder for content | `Skeleton` |
117
- | Loading placeholder for a form or a list (rough, not 1:1 with the UI) | `SkeletonForm` (`fields`, `columns`), `SkeletonList` (`rows`, `lines`, `avatar`, `action`) |
118
- | Spinner; spinner that fills its container | `Spinner`; `Spinner block` |
119
- | Cover an area while it loads | `LoadingOverlay` |
120
- | Global loading bar or blocking screen | `useLoading` / `withLoading` (needs `OverlayHost`) |
121
- | Loading flag for one button or form | `useLoadingState`, or `loading` prop of `Button` |
122
- | Progress of a task | `Progress` (bar) or `ProgressRing` |
123
- | Value in a known range (quota, score) | `Meter` |
124
- | Inline message (info, warning, error) | `Alert` |
125
- | Copy text to the clipboard | `CopyButton` or `useCopy` |
126
- | Keyboard shortcut handler; show a shortcut | `useHotkey`; `Kbd` |
127
- | Row or column layout with gap; responsive grid | `Stack`; `Grid` |
128
- | Line or labelled divider; section heading with actions | `Separator` |
129
- | Group of buttons or tools with arrow key navigation | `Toolbar` |
130
- | Text for screen readers only | `VisuallyHidden` |
131
- | Translations of the component texts | `useLocale` (languages: en, it, de) |
132
- | Custom icons | `createIcons`, `provideIcons`, Nuxt option `k.icons` |
31
+ | Task | Use |
32
+ | --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
33
+ | Form with validation, dirty state and server errors | `useForm` + `Form` + `FormField` + field components |
34
+ | One labelled field with error, hint and required marker | `FormField` |
35
+ | Map a server error (409, 422) to fields | `useForm` option `submitError`, `form.setErrors`, `form.setIssues` |
36
+ | Form as a full page with sticky save footer | `FormPage` |
37
+ | Create or edit form in a side panel (cancel, save, delete, guard) | `FormDrawer` (`form`, `creating`, `readonly`, `deletable`, `loading`) |
38
+ | Warn before the user leaves with unsaved changes | `useDirtyGuard` (or `FormPage`, it has `guard`) |
39
+ | Floating "unsaved changes" bar | `SaveBar` |
40
+ | Single line text | `Input` |
41
+ | Multi line text | `Textarea` |
42
+ | Rich text (bold, lists, links) | `RichTextEditor` (group `editor`) |
43
+ | Password with strength meter and generator | `PasswordInput` |
44
+ | Number with stepper, locale format | `NumberInput` |
45
+ | Money or unit prefix and suffix around an input | `InputGroup` + `InputAddon` |
46
+ | One choice from a short list (5 or fewer) | `RadioGroup` or `SegmentedControl` |
47
+ | One choice from a longer list, no search | `Select` |
48
+ | Searchable select, async search, multi select, create option | `Combobox` |
49
+ | Create new values with a format or rule (tags, codes) | `Combobox` with `creatable`, `createTransform`, `createValidate` |
50
+ | Several choices as checkboxes | `CheckboxGroup` |
51
+ | One yes or no | `Switch` (instant setting) or `Checkbox` (part of a form) |
52
+ | Date, date and time, month | `DateInput` (native) or `DatePicker` (popover calendar, ranges) |
53
+ | Inline calendar | `Calendar` |
54
+ | Time of day | `TimeInput` |
55
+ | Color | `ColorInput` |
56
+ | Number in a range | `Slider` |
57
+ | One time code, OTP | `PinInput` |
58
+ | File or folder upload with drop zone | `FileInput` |
59
+ | Drop files on any element | `useFileDrop` |
60
+ | `useSortable` | Reorder any small list by pointer drag (live, Escape cancels) and Alt with the arrow keys, with an announcement. `TagList` uses it. | `useSortable(containerRef, { items, onMove(items, move), orientation, disabled, handle, canMove, label, movedText })` returns `{ itemProps(index), move(from, to), canMove, dragging, announcement }`. Bind `itemProps(index)` on each item and render `announcement` in a live region. | `data/tag-list.vue` |
61
+ | Confirm a destructive action | `useConfirm` |
62
+ | Show a message the user must acknowledge | `useAlert` |
63
+ | Ask for one text value | `usePrompt` |
64
+ | Short message after an action | `toast` |
65
+ | Toast for a promise (loading, success, error) | `toast.promise` |
66
+ | Toast after saving in an open Drawer | `toast` (the stack moves beside the drawer or above its footer) |
67
+ | Detail or edit panel from the side | `Drawer` (or `useDrawer().open`) |
68
+ | Dialog with a form or content | `Modal` (or `useModal().open` to get the result as a promise) |
69
+ | Tabs or subpages (breadcrumb and back) in a Modal or Drawer | `tabs` + `v-model:tab`; `trail` + `@navigate` on `Modal` / `Drawer` |
70
+ | Buttons in a Modal or Drawer header | `#actions` slot of `Modal` / `Drawer` (right side, before the close button) |
71
+ | Deep link to a drawer or modal (`?family=fam_1`, `#family/fam_1`) | `useRouteState('family')` + `:open="!!familyId"`, `location: 'hash'`; settings: `route`, `settingsRoute` |
72
+ | One record in the URL (`#family/fam_1`, `#family/new`), with linked entries | `useRouteRecord(key, { find, loaded, canCreate, linkedKeys })`: `open`, `current`, `loading`, `openRecord`, `close`, `replaceId` |
73
+ | Commands of the open page in the command search | `usePageCommands(() => CommandItem[])` (DashboardLayout adds the group "This page") |
74
+ | A button made from a command (same label, icon and action as the palette) | `CommandButton` (`command`) |
75
+ | Short list of records with title, badge, action, skeleton and empty state | `RecordList` |
76
+ | Menu opened by a button | `DropdownMenu` |
77
+ | Right click menu | `ContextMenu` |
78
+ | Small floating panel with content or a form | `Popover` |
79
+ | Preview on hover (user card) | `HoverCard` |
80
+ | Short label on hover or focus | `Tooltip` |
81
+ | Global search, command menu (Cmd+K) | `CommandPalette` (the `DashboardLayout` has it with `search`) |
82
+ | Small table, simple sort | `Table` (+ `useTableSort` for client sort) |
83
+ | Big table, many rows, editing, Excel-like | `DataGrid` (+ `spreadsheet` prop for Excel-like editing) |
84
+ | Filters for a grid (selects, dates in a modal from the toolbar) | `DataGrid` `#filters` slot with `filterCount` and `@filters-reset` |
85
+ | Several tags or statuses in one grid cell | `BadgeCell` with an array value (`max` adds a `+N` badge) |
86
+ | Whole list page: search, filters, table, pagination | `ListPage` |
87
+ | Page numbers and page size | `Pagination` |
88
+ | Bulk actions bar for selected rows | `SelectionBar` |
89
+ | Filter chips, active filters | `FilterPills` |
90
+ | Tags, chips, removable labels | `Tag` |
91
+ | Reorder chips by drag and keyboard, drop items from another panel | `TagList` (`sortable`, `removable`, `accept` + `@item-drop`) |
92
+ | Reorder any list by drag and keyboard | `useSortable` |
93
+ | Status label, counter, dot | `Badge` |
94
+ | User picture or initials; stack of users | `Avatar`; `AvatarGroup` |
95
+ | Key figure with delta and trend (KPI) | `Stat` |
96
+ | Label and value pairs (details) | `DescriptionList` |
97
+ | Event history, activity feed | `Timeline` |
98
+ | Hierarchy, folders, drag to reorder | `Tree` |
99
+ | Charts (line, bar, doughnut) | `ChartPanel` + `LineChart` / `BarChart` / `DoughnutChart` (group `chart`) |
100
+ | Tabs | `Tabs` |
101
+ | Wizard steps, step indicator (Step 2 of 4) | `Stepper` |
102
+ | Collapsible sections, FAQ | `Accordion` |
103
+ | Container with title and actions | `Card` |
104
+ | Page title, description, breadcrumbs, actions | `PageHeader` (or a page template) |
105
+ | Breadcrumbs only | `Breadcrumbs` |
106
+ | Dashboard layout with sidebar, search, account and settings | `DashboardLayout` (or the Nuxt layout `k-dashboard`) |
107
+ | Actions in a settings section header ("Add user") | `#actions-<id>` on `SettingsModal`, `#settings-actions-<id>` on `DashboardLayout` (gets `page`, `openPage`, `back`) |
108
+ | Page that fills the panel height (a full height grid) | `content="fill"` or `"centered"` on `DashboardLayout` / `AppShell`, `definePageMeta({ content: 'fill' })` |
109
+ | Custom app frame with your own sidebar | `AppShell` + `Sidebar` + `SidebarNav` |
110
+ | Login, sign up, reset password page | `AuthLayout` (or the Nuxt layout `k-auth`) |
111
+ | Settings in a modal (account, appearance, your sections) | `SettingsModal` (the `DashboardLayout` embeds it) |
112
+ | Settings as a page with sections | `SettingsPage` + `SettingsSection` + `SettingsGroup` |
113
+ | Theme and preset choice | `AppearanceSettings`, `ThemeSwitch`, `useTheme`, `usePreset` |
114
+ | Remember UI choices per user (theme, sidebar, grid columns, page size) | `createPreferences` with your store (`createRemotePreferenceStore` for an API), `usePreference` for your own keys |
115
+ | Detail page of one record with tabs and aside | `DetailPage` |
116
+ | Overview page with stats | `DashboardPage` |
117
+ | First run screen with steps | `EmptyPage` |
118
+ | Error page, 404 page | `ErrorPage`, `NotFoundPage` |
119
+ | Empty state inside a card or list | `EmptyState` |
120
+ | Loading placeholder for content | `Skeleton` |
121
+ | Loading placeholder for a form or a list (rough, not 1:1 with the UI) | `SkeletonForm` (`fields`, `columns`), `SkeletonList` (`rows`, `lines`, `avatar`, `action`) |
122
+ | Spinner; spinner that fills its container | `Spinner`; `Spinner block` |
123
+ | Cover an area while it loads | `LoadingOverlay` |
124
+ | Global loading bar or blocking screen | `useLoading` / `withLoading` (needs `OverlayHost`) |
125
+ | Loading flag for one button or form | `useLoadingState`, or `loading` prop of `Button` |
126
+ | Progress of a task | `Progress` (bar) or `ProgressRing` |
127
+ | Value in a known range (quota, score) | `Meter` |
128
+ | Inline message (info, warning, error) | `Alert` |
129
+ | Copy text to the clipboard | `CopyButton` or `useCopy` |
130
+ | Keyboard shortcut handler; show a shortcut | `useHotkey`; `Kbd` |
131
+ | Row or column layout with gap; responsive grid | `Stack`; `Grid` |
132
+ | Line or labelled divider; section heading with actions | `Separator` |
133
+ | Group of buttons or tools with arrow key navigation | `Toolbar` |
134
+ | Text for screen readers only | `VisuallyHidden` |
135
+ | Translations of the component texts | `useLocale` (languages: en, it, de) |
136
+ | Custom icons | `createIcons`, `provideIcons`, Nuxt option `k.icons` |
133
137
 
134
138
  ## Core
135
139
 
@@ -180,20 +184,21 @@ All field components work inside `FormField` and take `invalid`, `disabled`, `re
180
184
 
181
185
  Mount `OverlayHost` once for the imperative hooks (see [Composables](#composables)).
182
186
 
183
- | Component | Purpose and when to use it | Main props, models, slots, events | Playground |
184
- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------ |
185
- | `Modal` | Centered dialog for forms and content. Use `Drawer` for a side panel, `useConfirm` for a yes or no question. | Models: `v-model:open`, `v-model:tab`. Props: `title`, `description`, `size` (sm to xl, full, fit, fullscreen), `width`, `minHeight`, `dismissible`, `hideClose`, `sheet`, `flush`, `loading`, `beforeClose(reason)`, `tabs` (tabs in the header), `trail` (breadcrumb title and back button), `backLabel`. Slots: default (`{ tab }`), `header`, `actions` (header, before the close button), `footer`, `title-trailing`. Events: `open`, `close`, `afterLeave`, `navigate(index)`. | `overlays/modal.vue` |
186
- | `Drawer` | Panel from the side or bottom for details and edit forms. Use `Modal` for short focused dialogs. | Models: `v-model:open`, `v-model:tab`. Props: `title`, `description`, `side` (left, right, bottom), `size` (sm to xl, full), `dismissible`, `hideClose`, `flush`, `loading`, `beforeClose(reason)`, `tabs`, `trail`, `backLabel`. Slots like `Modal`. Events: `open`, `close`, `afterLeave`, `navigate(index)`. | `overlays/drawer.vue` |
187
- | `ConfirmDialog` | Declarative confirm dialog. Prefer `useConfirm()`. Use this one only when the dialog state lives in the template. | Model: `v-model:open`. Props: `title`, `description`, `confirmLabel`, `cancelLabel`, `tone`, `icon`, `hideCancel`, `onConfirm`. Events: `resolve(confirmed)`, `cancel`, `afterLeave`. | `overlays/confirm-dialog.vue` |
188
- | `ConfirmHost` | Renders the dialogs of `useConfirm`, `useAlert`, `usePrompt`. `OverlayHost` includes it. Do not mount it alone. | None. | - |
189
- | `OverlayHost` | One mount point for toasts, confirm dialogs, programmatic modals and loading indicators. | Props: `toaster` (true or options), `confirm`, `modals`, `loading` (true or `{ bar, delay, label }`). | `overlays/hooks.vue` |
190
- | `Toaster` | Renders toasts. `OverlayHost` includes it. Use it directly only for custom options. The stack moves out of the way of an open side Drawer (beside it, or above its footer). | Props: `position`, `max`, `duration`, `gap`, `expand`, `progress`, `hotkey`. | `overlays/toast.vue` |
191
- | `DropdownMenu` | Menu opened by its trigger. Items can have icons, shortcuts, checkboxes, radios, sub menus and links. | Model: `v-model:open`. Props: `items` (`label`, `icon`, `to`, `href`, `tone: danger`, `shortcut`, `disabled`, `children`, `onSelect`; also `type`: checkbox, radio, label, separator), `placement`, `offset`, `matchTriggerWidth`, `minWidth`. Slot: default (the trigger). Event: `select`. | `overlays/dropdown-menu.vue` |
192
- | `ContextMenu` | Menu on right click of the wrapped area. | Model: `v-model:open`. Props: `items` (same as `DropdownMenu`), `disabled`. Slot: default (the area). Event: `select`. | `overlays/context-menu.vue` |
193
- | `Popover` | Floating panel with any content (a form, filters) opened by its trigger. Use `DropdownMenu` for a list of actions. | Model: `v-model:open`. Props: `placement`, `offset`, `arrow`, `label`, `initialFocus`. Slots: default (the trigger), `content`. | `overlays/popover.vue` |
194
- | `HoverCard` | Rich preview on hover or focus (user card, link preview). Use `Tooltip` for plain text. | Model: `v-model:open`. Props: `placement`, `openDelay`, `closeDelay`, `arrow`, `disabled`. Slots: default (trigger), `content`. | `overlays/hover-card.vue` |
195
- | `Tooltip` | Short text on hover or focus. Optional shortcut. | Props: `text`, `placement`, `openDelay`, `closeDelay`, `arrow`, `shortcut`, `disabled`. Slots: default (trigger), `content`. | `overlays/tooltip.vue` |
196
- | `CommandPalette` | Search and command dialog (Cmd+K) with groups, recent items, async search and typed item data. | Models: `v-model:open`, `v-model:query`. Props: `groups` (items with `id`, `label`, `description`, `icon`, `shortcut`, `keywords`, `to`, `data`, `onSelect`), `search(query, signal)`, `shortcut`, `trigger`, `recentKey`, `emptyText`, `notice`. Slots: `item`, `empty`, `group-label`, `after-results`. Events: `select`, `open`, `close`. | `overlays/command-palette.vue` |
187
+ | Component | Purpose and when to use it | Main props, models, slots, events | Playground |
188
+ | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------ |
189
+ | `Modal` | Centered dialog for forms and content. Use `Drawer` for a side panel, `useConfirm` for a yes or no question. | Models: `v-model:open`, `v-model:tab`. Props: `title`, `description`, `size` (sm to xl, full, fit, fullscreen), `width`, `minHeight`, `dismissible`, `hideClose`, `sheet`, `flush`, `loading`, `beforeClose(reason)`, `tabs` (tabs in the header), `trail` (breadcrumb title and back button), `backLabel`. Slots: default (`{ tab }`), `header`, `actions` (header, before the close button), `footer`, `title-trailing`. Events: `open`, `close`, `afterLeave`, `navigate(index)`. | `overlays/modal.vue` |
190
+ | `Drawer` | Panel from the side or bottom for details and edit forms. Use `Modal` for short focused dialogs. | Models: `v-model:open`, `v-model:tab`. Props: `title`, `description`, `side` (left, right, bottom), `size` (sm to xl, full), `dismissible`, `hideClose`, `flush`, `loading`, `beforeClose(reason)`, `tabs`, `trail`, `backLabel`. Slots like `Modal`. Events: `open`, `close`, `afterLeave`, `navigate(index)`. | `overlays/drawer.vue` |
191
+ | `ConfirmDialog` | Declarative confirm dialog. Prefer `useConfirm()`. Use this one only when the dialog state lives in the template. | Model: `v-model:open`. Props: `title`, `description`, `confirmLabel`, `cancelLabel`, `tone`, `icon`, `hideCancel`, `onConfirm`. Events: `resolve(confirmed)`, `cancel`, `afterLeave`. | `overlays/confirm-dialog.vue` |
192
+ | `ConfirmHost` | Renders the dialogs of `useConfirm`, `useAlert`, `usePrompt`. `OverlayHost` includes it. Do not mount it alone. | None. | - |
193
+ | `OverlayHost` | One mount point for toasts, confirm dialogs, programmatic modals and loading indicators. | Props: `toaster` (true or options), `confirm`, `modals`, `loading` (true or `{ bar, delay, label }`). | `overlays/hooks.vue` |
194
+ | `Toaster` | Renders toasts. `OverlayHost` includes it. Use it directly only for custom options. The stack moves out of the way of an open side Drawer (beside it, or above its footer). | Props: `position`, `max`, `duration`, `gap`, `expand`, `progress`, `hotkey`. | `overlays/toast.vue` |
195
+ | `DropdownMenu` | Menu opened by its trigger. Items can have icons, shortcuts, checkboxes, radios, sub menus and links. | Model: `v-model:open`. Props: `items` (`label`, `icon`, `to`, `href`, `tone: danger`, `shortcut`, `disabled`, `children`, `onSelect`; also `type`: checkbox, radio, label, separator), `placement`, `offset`, `matchTriggerWidth`, `minWidth`. Slot: default (the trigger). Event: `select`. | `overlays/dropdown-menu.vue` |
196
+ | `ContextMenu` | Menu on right click of the wrapped area. | Model: `v-model:open`. Props: `items` (same as `DropdownMenu`), `disabled`. Slot: default (the area). Event: `select`. | `overlays/context-menu.vue` |
197
+ | `Popover` | Floating panel with any content (a form, filters) opened by its trigger. Use `DropdownMenu` for a list of actions. | Model: `v-model:open`. Props: `placement`, `offset`, `arrow`, `label`, `initialFocus`. Slots: default (the trigger), `content`. | `overlays/popover.vue` |
198
+ | `HoverCard` | Rich preview on hover or focus (user card, link preview). Use `Tooltip` for plain text. | Model: `v-model:open`. Props: `placement`, `openDelay`, `closeDelay`, `arrow`, `disabled`. Slots: default (trigger), `content`. | `overlays/hover-card.vue` |
199
+ | `Tooltip` | Short text on hover or focus. Optional shortcut. | Props: `text`, `placement`, `openDelay`, `closeDelay`, `arrow`, `shortcut`, `disabled`. Slots: default (trigger), `content`. | `overlays/tooltip.vue` |
200
+ | `CommandPalette` | Search and command dialog (Cmd+K) with groups, recent items, async search and typed item data. Groups take `icon` (default item icon) and `more` (a last "show all" item). Matching (`matchesSearch`, exported) finds every word in any order, without case or accents. | Models: `v-model:open`, `v-model:query`. Props: `groups` (items with `id`, `label`, `description`, `icon`, `shortcut`, `keywords`, `to`, `data`, `onSelect`), `search(query, signal)`, `shortcut`, `trigger`, `recentKey`, `emptyText`, `notice`. Slots: `item`, `empty`, `group-label`, `after-results`. Events: `select`, `open`, `close`. | `overlays/command-palette.vue` |
201
+ | `CommandButton` | A `Button` made from a `CommandItem`: label, icon, `to`, `href`, `disabled` and `onSelect` come from the command. | Props: `command`, `label`, `icon`, and every `Button` prop (size, variant, tone). | `overlays/command-palette.vue` |
197
202
 
198
203
  ## Data
199
204
 
@@ -210,6 +215,7 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
210
215
  | `Avatar` | User picture with initials fallback and status dot. | Props: `src`, `name`, `alt`, `size` (xs to xl), `shape` (circle, square), `status` (online, away, busy, offline), `decorative`. Slot: `fallback`. | `data/avatar.vue` |
211
216
  | `AvatarGroup` | Overlapping stack of avatars with "+N". | Props: `items` (`src`, `name`, `alt`), `max`, `size`, `shape`, `moreLabel`. | `data/avatar.vue` |
212
217
  | `Stat` | Key figure (KPI) with unit, delta, trend, hint and optional sparkline. Can be a link. | Props: `label`, `value`, `unit`, `delta`, `trend` (up, down, flat), `invert` (down is good), `hint`, `icon`, `loading`, `to`, `href`, `plain`. Slots: `label`, `value`, `icon`, `sparkline`, `footer`. | `data/stat.vue` |
218
+ | `RecordList` | Short list of records (settings, users, tokens): title, badge, description, leading and action slots, `SkeletonList` while `loading`, empty state. | Props: `items` (`RecordListItem`: `id`, `title`, `description`, `badge` `{ label, tone }`), `loading`, `avatar`, `action`, `label`, `skeletonRows`, `emptyText`, `emptyDescription`, `emptyIcon`. Slots: `leading`, `action` (`{ item }`), `empty`. | `data/record-list.vue` |
213
219
  | `DescriptionList` | Label and value pairs for a record. Use it on detail views. | Props: `items` (`key`, `label`, `value`, `hint`), `layout` (stacked, inline, grid), `columns`, `divided`, `emptyText`. Slots: `term`, `value`, `value-<key>`. | `data/description-list.vue` |
214
220
  | `Timeline` | Vertical list of events or activity. | Props: `items` (`title`, `description`, `time`, `datetime`, `icon`, `tone`), `compact`. Slot: `item`. | `data/timeline.vue` |
215
221
  | `Tree` | Expandable hierarchy with selection, drag to reorder and nesting. | Models: `v-model:expanded`, `v-model:selected`. Props: `nodes` (`id`, `label`, `description`, `meta`, `icon`, `children`, `disabled`), `selectable`, `reorderable`, `nestable`, `moveButtons` (default `true`; `false` hides the row arrows, drag and Alt+arrow keys still work), `canDrop`, `size`, `checkmark`, `emptyText`. Slots: `label`, `meta`, `empty`. Events: `select`, `move`. | `data/tree.vue` |
@@ -260,7 +266,7 @@ Templates combine core parts into whole pages and layouts. Start from them for n
260
266
  | `AuthLayout` | Login, sign up and reset password frame. Centered card or split with aside. | Props: `variant` (centered, split), `title`, `description`, `footer`, `brandName`, `brandIcon`, `brandLogo`, `asideTitle`, `asideDescription`, `themeSwitch`. Slots: default, `links`, `footer`, `brand`, `aside`, `corner`. | `templates/auth-layout.vue` |
261
267
  | `ListPage` | Whole list page: header, search, filters, table, pagination, bulk actions, loading, empty, no results and error states. Client or server mode (`total`). | Models: `page`, `pageSize`, `search`, `filter`, `sort`, `selected`. Props: `title`, `rows`, `columns`, `rowKey`, `rowTo`, `selectable`, `loading`, `error`, `total`, `paginate`, `searchable`, `searchKeys`, `filters`, `filterKey`, `filterMultiple`, `emptyTitle`. Slots: `actions`, `toolbar`, `toolbar-end`, `bulk`, `empty`, `empty-actions`, `no-results`, `error`, `cell-<key>`, `table`. Events: `retry`, `clear`, `rowClick`. | `templates/list-page.vue` |
262
268
  | `DetailPage` | Record page: back link, title, status, actions, tabs, main column and aside with description lists. | Model: `v-model:tab`. Props: `title`, `backTo`, `backLabel`, `status` (`label`, `tone`, `dot`), `tabs`, `sections` (`title`, `items`), `loading`, `error`. Slots: default, `actions`, `badge`, `meta`, `aside`, `aside-before`, `panel-<value>`. | `templates/detail-page.vue` |
263
- | `FormDrawer` | Drawer with a form: `Form` around the body, footer with delete (left), cancel and submit, a discard confirmation on close when the form is dirty, `SkeletonForm` while `loading`. | Models: `v-model:open`, `v-model:tab`. Props: `title`, `description`, `side`, `size`, `tabs`, `trail`, `backLabel`, `form`, `loading`, `readonly`, `creating` (submit says Create, no dirty needed), `requireDirty`, `deletable`, `deleteDisabled`, `deleteHint`, `submitLabel`, `cancelLabel`, `deleteLabel`, `guard`, `guardTitle`, `guardMessage`, `beforeClose`, `onCancel`. Slots: default (`{ tab }`), `actions`, `title-trailing`, `skeleton`, `footer`. Events: `delete`, `navigate`, `afterLeave`. Exposes `confirmDiscard()`, `close()`. | `templates/form-drawer.vue` |
269
+ | `FormDrawer` | Drawer with a form: `Form` around the body, footer with delete (left), cancel and submit, a discard confirmation on close when the form is dirty, `SkeletonForm` while `loading`. | Models: `v-model:open`, `v-model:tab`. Props: `title`, `description`, `side`, `size`, `tabs` (`FormDrawerTab`: `fields` gives the error dot and opens the tab on a failed submit), `tabRoute` (keeps the tab in the hash under this key), `trail`, `backLabel`, `form`, `loading`, `readonly`, `creating` (submit says Create, no dirty needed), `requireDirty`, `deletable`, `deleteDisabled`, `deleteHint`, `submitLabel`, `cancelLabel`, `deleteLabel`, `guard`, `guardTitle`, `guardMessage`, `beforeClose`, `onCancel`. Slots: default (`{ tab }`), `actions`, `title-trailing`, `skeleton`, `footer`. Events: `delete`, `navigate`, `afterLeave`. Exposes `confirmDiscard()`, `close()`. | `templates/form-drawer.vue` |
264
270
  | `FormPage` | Form page: header, cards in a `Form`, sticky submit and cancel footer, dirty guard. | Props: `title`, `backTo`, `form` (from `useForm`), `dirty`, `saving`, `guard`, `requireDirty`, `submitLabel`, `cancelLabel`, `cancelTo`, `width`, `sticky`. Slots: default, `actions`, `footer`, `status`. Events: `submit`, `submitted`, `invalid`, `reset`, `cancel`. | `templates/form-page.vue` |
265
271
  | `DashboardPage` | Overview page: header, stat grid, content grid. | Props: `title`, `eyebrow`, `description`, `stats` (`PageStat[]`), `statsColumns`, `columns`, `loading`. Slots: default, `actions`, `stats`, `sparkline`, `before`, `after`, `eyebrow`. | `templates/dashboard-page.vue` |
266
272
  | `SettingsPage` | Settings as a page: section nav, panels, floating save bar when `dirty`. | Model: `v-model:section`. Props: `title`, `sections` (`value`, `label`, `icon`, `to`), `dirty`, `saving`, `saveBar`, `form`. Slots: `section-<value>`, `actions`, `nav-footer`. Events: `save`, `discard`. | `templates/settings-page.vue` |
@@ -320,7 +326,7 @@ All are exported from `@xleddyl/443-components-vue` and auto-imported in Nuxt.
320
326
  | `useField`, `useFieldControl` | Build your own field control that reads the surrounding `FormField` (id, invalid, described by). | `useFieldControl({ role: 'auxiliary' })` for a secondary control. `control.setControlError(message)` reports a control level error. | `core/form-field.vue` |
321
327
  | `provideFieldBoundary`, `provideAuxiliaryControls` | In your own overlay component, stop controls from inheriting the field context of the trigger. | Call in `setup`. | - |
322
328
  | `toast` / `useToast` | Toasts. | `toast(title, opts)`, `toast.success`, `.error`, `.warning`, `.info`, `.loading`, `.promise(promise, { loading, success, error })`, `.update(id, opts)`, `.dismiss(id)`. Options: `description` (string or list), `action` (`label`, `onClick`), `duration`, `dismissible`. | `overlays/toast.vue` |
323
- | `useConfirm` | Ask yes or no. Returns a promise of `true` or `false`. | `await useConfirm()({ title, description, tone, confirmLabel, cancelLabel, body })`. | `overlays/hooks.vue` |
329
+ | `useConfirm` | Ask yes or no. Returns a promise of `true` or `false`. | `await useConfirm()({ title, description, tone, confirmLabel, cancelLabel, body })`. Presets: `confirm.delete(title, options?)` (danger, Delete) and `confirm.discard(options?)` (unsaved changes). | `overlays/hooks.vue` |
324
330
  | `useAlert` | Show a message and wait until the user closes it. | `await useAlert()({ title, description, tone })`. | `overlays/hooks.vue` |
325
331
  | `usePrompt` | Ask for one text value. Returns the string or `null`. | `await usePrompt()({ title, label, value, placeholder, type, required, validate(value), onConfirm(value) })`. | `overlays/hooks.vue` |
326
332
  | `useModal`, `useDrawer`, `useOverlay` | Open a component as a modal or drawer and await its result. Use it when the content is a component with its own logic. | `const result = await useModal().open(Component, props, { title, size, beforeClose })`. The handle has `id`, `close(result)`, `update(props)`. `useModal().close(id?)`, `closeAll()`. `useOverlay` is the base (option `as`). | `overlays/hooks.vue` |
package/README.md CHANGED
@@ -576,6 +576,10 @@ const confirmDiscard = () => !dirty.value || confirm({ title: 'Discard changes?'
576
576
 
577
577
  ### Deep links
578
578
 
579
+ `useRouteRecord(key, options?)` is the record version of `useRouteState`. `#family/fam_1` opens a record and `#family/new` the create form (`newId`). Options: `find(id)` (gives `current`), `loaded` (while false, `loading` is true, so the drawer opens at once with its skeleton; when true and `find` gives nothing, the entry is removed), `canCreate`, `linkedKeys` (entries removed together with the record, such as a tab or a sub record). It returns `param`, `id`, `isNew`, `current`, `loading`, `open` (for `v-model:open`), `openRecord(id | null, linked?)`, `close()` and `replaceId(id, linked?)` (after a create). All the entries change in one navigation.
580
+
581
+ `usePageCommands(() => CommandItem[])` adds commands while the component is mounted. `DashboardLayout` shows the matching ones first, in the group "This page" (`searchPageLabel`), with every `search` mode. Return an empty list when a command does not apply. `CommandButton` renders a command as a `Button`, so a page header button and the palette share one definition.
582
+
579
583
  `useRouteState(key, options?)` binds a ref to one query parameter (or one hash entry) of the current URL, so any Drawer or Modal can be opened from a link, survives a reload and closes with the browser back button. It reads the router through `$router` (vue-router or Nuxt, no import of either); without a router it is a plain ref.
580
584
 
581
585
  ```ts
@@ -0,0 +1,55 @@
1
+ <template>
2
+ <SkeletonList v-if="loading" :rows="skeletonRows" :lines="2" :avatar="avatar" :action="action" />
3
+
4
+ <ul v-else-if="items.length" class="k-record-list" :aria-label="label">
5
+ <li v-for="item in items" :key="item.id" class="k-record-list-item">
6
+ <slot name="leading" :item="item" />
7
+ <div class="k-record-list-text">
8
+ <span class="k-record-list-title-row">
9
+ <span class="k-record-list-title">{{ item.title }}</span>
10
+ <Badge
11
+ v-if="item.badge"
12
+ :label="item.badge.label"
13
+ :tone="item.badge.tone ?? 'neutral'"
14
+ size="sm"
15
+ />
16
+ </span>
17
+ <span v-if="item.description" class="k-record-list-description">
18
+ {{ item.description }}
19
+ </span>
20
+ </div>
21
+ <slot name="action" :item="item" />
22
+ </li>
23
+ </ul>
24
+
25
+ <slot v-else name="empty">
26
+ <EmptyState
27
+ :icon="emptyIcon"
28
+ :title="emptyText ?? t('common.empty')"
29
+ :description="emptyDescription"
30
+ size="sm"
31
+ variant="plain"
32
+ :level="3"
33
+ />
34
+ </slot>
35
+ </template>
36
+
37
+ <script setup>
38
+ import { useLocale } from "../../composables/useLocale";
39
+ import EmptyState from "../feedback/EmptyState.vue";
40
+ import SkeletonList from "../feedback/SkeletonList.vue";
41
+ import Badge from "./Badge.vue";
42
+ defineProps({
43
+ items: { type: Array, required: true },
44
+ loading: { type: Boolean, required: false },
45
+ avatar: { type: Boolean, required: false },
46
+ action: { type: Boolean, required: false, default: true },
47
+ label: { type: String, required: false },
48
+ skeletonRows: { type: Number, required: false, default: 3 },
49
+ emptyText: { type: String, required: false },
50
+ emptyDescription: { type: String, required: false },
51
+ emptyIcon: { type: null, required: false }
52
+ });
53
+ defineSlots();
54
+ const { t } = useLocale();
55
+ </script>