@xleddyl/443-components-vue 0.16.9 → 0.16.11
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/CATALOG.md +40 -34
- package/README.md +28 -9
- package/dist/components/feedback/SkeletonForm.vue +29 -0
- package/dist/components/feedback/SkeletonForm.vue.d.ts +402 -0
- package/dist/components/feedback/SkeletonList.vue +30 -0
- package/dist/components/feedback/SkeletonList.vue.d.ts +406 -0
- package/dist/components/feedback/index.d.ts +2 -0
- package/dist/components/feedback/index.mjs +2 -0
- package/dist/components/layout/Tabs.vue +5 -3
- package/dist/components/layout/Tabs.vue.d.ts +2 -0
- package/dist/components/overlays/ConfirmDialog.vue.d.ts +12 -0
- package/dist/components/overlays/ConfirmHost.vue.d.ts +12 -0
- package/dist/components/overlays/Drawer.vue +11 -2
- package/dist/components/overlays/Drawer.vue.d.ts +13 -0
- package/dist/components/overlays/Modal.vue +10 -1
- package/dist/components/overlays/Modal.vue.d.ts +13 -0
- package/dist/components/templates/FormDrawer.vue +161 -0
- package/dist/components/templates/FormDrawer.vue.d.ts +297 -0
- package/dist/components/templates/SettingsModal.vue.d.ts +10 -0
- package/dist/components/templates/index.d.ts +1 -0
- package/dist/components/templates/index.mjs +1 -0
- package/dist/internal/overlays/DialogFrame.vue +65 -11
- package/dist/internal/overlays/DialogFrame.vue.d.ts +14 -0
- package/dist/internal/overlays/DialogTrail.vue +20 -0
- package/dist/internal/overlays/DialogTrail.vue.d.ts +22 -0
- package/dist/internal/overlays/OverlayView.vue.d.ts +12 -0
- package/dist/locale/de.mjs +6 -1
- package/dist/locale/en.mjs +6 -1
- package/dist/locale/it.mjs +6 -1
- package/dist/locale/types.d.ts +5 -0
- package/dist/styles/feedback/skeleton.css +46 -0
- package/dist/styles/overlays/modal.css +71 -0
- package/dist/styles/tailwind.css +46 -0
- package/dist/styles/templates/form-drawer.css +6 -0
- package/dist/styles/templates.css +1 -0
- package/package.json +3 -2
package/CATALOG.md
CHANGED
|
@@ -34,6 +34,7 @@ Playground paths in this file are relative to `playground/nuxt/app/pages/compone
|
|
|
34
34
|
| One labelled field with error, hint and required marker | `FormField` |
|
|
35
35
|
| Map a server error (409, 422) to fields | `useForm` option `submitError`, `form.setErrors`, `form.setIssues` |
|
|
36
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`) |
|
|
37
38
|
| Warn before the user leaves with unsaved changes | `useDirtyGuard` (or `FormPage`, it has `guard`) |
|
|
38
39
|
| Floating "unsaved changes" bar | `SaveBar` |
|
|
39
40
|
| Single line text | `Input` |
|
|
@@ -65,6 +66,7 @@ Playground paths in this file are relative to `playground/nuxt/app/pages/compone
|
|
|
65
66
|
| Toast after saving in an open Drawer | `toast` (the stack moves beside the drawer or above its footer) |
|
|
66
67
|
| Detail or edit panel from the side | `Drawer` (or `useDrawer().open`) |
|
|
67
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` |
|
|
68
70
|
| Buttons in a Modal or Drawer header | `#actions` slot of `Modal` / `Drawer` (right side, before the close button) |
|
|
69
71
|
| Deep link to a drawer or modal (`?family=fam_1`, `#family/fam_1`) | `useRouteState('family')` + `:open="!!familyId"`, `location: 'hash'`; settings: `route`, `settingsRoute` |
|
|
70
72
|
| Menu opened by a button | `DropdownMenu` |
|
|
@@ -112,6 +114,7 @@ Playground paths in this file are relative to `playground/nuxt/app/pages/compone
|
|
|
112
114
|
| Error page, 404 page | `ErrorPage`, `NotFoundPage` |
|
|
113
115
|
| Empty state inside a card or list | `EmptyState` |
|
|
114
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`) |
|
|
115
118
|
| Spinner; spinner that fills its container | `Spinner`; `Spinner block` |
|
|
116
119
|
| Cover an area while it loads | `LoadingOverlay` |
|
|
117
120
|
| Global loading bar or blocking screen | `useLoading` / `withLoading` (needs `OverlayHost`) |
|
|
@@ -177,20 +180,20 @@ All field components work inside `FormField` and take `invalid`, `disabled`, `re
|
|
|
177
180
|
|
|
178
181
|
Mount `OverlayHost` once for the imperative hooks (see [Composables](#composables)).
|
|
179
182
|
|
|
180
|
-
| Component | Purpose and when to use it | Main props, models, slots, events
|
|
181
|
-
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
182
|
-
| `Modal` | Centered dialog for forms and content. Use `Drawer` for a side panel, `useConfirm` for a yes or no question. |
|
|
183
|
-
| `Drawer` | Panel from the side or bottom for details and edit forms. Use `Modal` for short focused dialogs. |
|
|
184
|
-
| `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`.
|
|
185
|
-
| `ConfirmHost` | Renders the dialogs of `useConfirm`, `useAlert`, `usePrompt`. `OverlayHost` includes it. Do not mount it alone. | None.
|
|
186
|
-
| `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 }`).
|
|
187
|
-
| `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`.
|
|
188
|
-
| `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`.
|
|
189
|
-
| `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`.
|
|
190
|
-
| `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`.
|
|
191
|
-
| `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`.
|
|
192
|
-
| `Tooltip` | Short text on hover or focus. Optional shortcut. | Props: `text`, `placement`, `openDelay`, `closeDelay`, `arrow`, `shortcut`, `disabled`. Slots: default (trigger), `content`.
|
|
193
|
-
| `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`.
|
|
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` |
|
|
194
197
|
|
|
195
198
|
## Data
|
|
196
199
|
|
|
@@ -219,7 +222,7 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
|
|
|
219
222
|
| `PageHeader` | Page title with description, breadcrumbs, badge and actions. The page templates include it. | Props: `title`, `description`, `icon`, `breadcrumbs`, `level`, `bordered`, `align`, `truncate`. Slots: `actions`, `badge`, `description`, `title`, `icon`, `breadcrumbs`. | `layout/page-header.vue` |
|
|
220
223
|
| `Breadcrumbs` | Path navigation. | Props: `items` (`label`, `to`, `href`, `icon`), `separator`, `linkLast`, `ancestors`. Slot: `item`. | `layout/breadcrumbs.vue` |
|
|
221
224
|
| `Stepper` | Step indicator for wizards and multi step flows (import, checkout). Horizontal or vertical, compact on narrow widths. | Model: `v-model` (current step value). Props: `steps` (`value`, `label`, `description`, `icon`, `disabled`, `state`: `complete` or `error`), `label`, `orientation`, `size`, `linear` (only completed and current steps clickable), `readonly`, `compact` (`'auto'` by default, `true`, `false`), `summary` (false hides the compact "Step 2 of 4" line), `positionLabel`, `completeLabel`, `errorLabel`. Event: `select`. | `layout/stepper.vue` |
|
|
222
|
-
| `Tabs` | Tabs with panels, badges and dots. Segmented or underline. | Model: `v-model` (active value). Props: `items` (`value`, `label`, `icon`, `badge`, `badgeTone`, `dot`, `disabled`), `variant`, `size`, `lazy`, `fill`, `stretch`, `inset
|
|
225
|
+
| `Tabs` | Tabs with panels, badges and dots. Segmented or underline. | Model: `v-model` (active value). Props: `items` (`value`, `label`, `icon`, `badge`, `badgeTone`, `dot`, `disabled`), `variant`, `size`, `lazy`, `fill`, `stretch`, `inset`, `controls` (id of a panel outside the component: only the tab list renders). Slots: `panel-<value>`, `panel`. | `layout/tabs.vue` |
|
|
223
226
|
| `Accordion` | Collapsible sections. | Model: `v-model` (open value or values). Props: `items` (`value`, `title`, `description`, `content`, `icon`), `multiple`, `collapsible`, `variant`. Slots: default, `title`. | `layout/accordion.vue` |
|
|
224
227
|
| `Separator` | Divider, labelled divider, or section heading with description and actions. | Props: `orientation`, `variant` (label, heading), `label`, `description`, `align`, `level`. Slots: default, `description`, `actions`. | `layout/separator.vue` |
|
|
225
228
|
| `Stack` | Flex row or column with gap. | Props: `direction`, `gap` (none to xl), `align`, `justify`, `wrap`, `responsive`, `as`. | `layout/stack.vue` |
|
|
@@ -240,6 +243,8 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
|
|
|
240
243
|
| `Alert` | Inline message with tone, title, description and actions. Use `toast` for short lived messages. | Model: `v-model:open`. Props: `tone`, `variant`, `title`, `description`, `icon` (or false), `dismissible`, `role`. Slots: default, `title`, `icon`, `actions`. Event: `dismiss`. | `feedback/alert.vue` |
|
|
241
244
|
| `EmptyState` | "Nothing here" block with icon, text and actions. For a full first run screen use `EmptyPage`. | Props: `title`, `description`, `icon`, `size`, `variant` (card, plain), `fill`. Slots: default, `title`, `description`, `icon`, `actions`. | `feedback/empty-state.vue` |
|
|
242
245
|
| `Skeleton` | Placeholder shape while content loads. | Props: `shape`, `width`, `height`, `lines`, `lastLineWidth`, `radius`, `animation`. | `feedback/skeleton.vue` |
|
|
246
|
+
| `SkeletonForm` | Rough placeholder of a form: a label and a control for each field. | Props: `fields` (4), `columns` (1, one column on narrow screens), `label`, `animation`. | `feedback/skeleton.vue` |
|
|
247
|
+
| `SkeletonList` | Rough placeholder of a list: one or two text lines per row, optional avatar and action. | Props: `rows` (4), `lines` (1 or 2), `avatar`, `action`, `label`, `animation`. | `feedback/skeleton.vue` |
|
|
243
248
|
| `LoadingOverlay` | Cover its content with a spinner while `loading`. | Props: `loading`, `label`, `showLabel`, `blur`, `spinnerSize`. Slot: default. | `feedback/loading-overlay.vue` |
|
|
244
249
|
| `Progress` | Linear progress, determinate or indeterminate (`value` null). | Props: `value`, `max`, `label`, `showLabel`, `showValue`, `valueText`, `tone`, `size`. Slot: `label`. | `feedback/progress.vue` |
|
|
245
250
|
| `ProgressRing` | Circular progress with optional center content. | Props: `value`, `max`, `label`, `size`, `thickness`, `showValue`, `tone`. Slot: default. | `feedback/progress.vue` |
|
|
@@ -249,25 +254,26 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
|
|
|
249
254
|
|
|
250
255
|
Templates combine core parts into whole pages and layouts. Start from them for new pages.
|
|
251
256
|
|
|
252
|
-
| Component | Purpose and when to use it
|
|
253
|
-
| -------------------- |
|
|
254
|
-
| `DashboardLayout` | Ready app frame: brand, navigation, command search, account menu, settings modal, breadcrumbs, theme switch. Put it in `layouts/default.vue`.
|
|
255
|
-
| `AuthLayout` | Login, sign up and reset password frame. Centered card or split with aside.
|
|
256
|
-
| `ListPage` | Whole list page: header, search, filters, table, pagination, bulk actions, loading, empty, no results and error states. Client or server mode (`total`).
|
|
257
|
-
| `DetailPage` | Record page: back link, title, status, actions, tabs, main column and aside with description lists.
|
|
258
|
-
| `
|
|
259
|
-
| `
|
|
260
|
-
| `
|
|
261
|
-
| `
|
|
262
|
-
| `
|
|
263
|
-
| `
|
|
264
|
-
| `
|
|
265
|
-
| `
|
|
266
|
-
| `
|
|
267
|
-
| `
|
|
268
|
-
| `
|
|
269
|
-
| `
|
|
270
|
-
| `
|
|
257
|
+
| Component | Purpose and when to use it | Main props, models, slots, events | Playground |
|
|
258
|
+
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
|
|
259
|
+
| `DashboardLayout` | Ready app frame: brand, navigation, command search, account menu, settings modal, breadcrumbs, theme switch. Put it in `layouts/default.vue`. | Models: `v-model:collapsed`, `v-model:open`, `v-model:settingsOpen`, `v-model:settingsSection`. Props: `navigation` (`NavItem[]` or `NavSection[]`), `account` (`name`, `email`, `avatar`, `role`, `menu`), `brandName`, `brandIcon`, `brandLogo`, `breadcrumbs`, `search` (true, groups or function), `settingsSections`, `settingsRoute`, `settingsRouteLocation`, `settingsAccountSection`, `settingsResolvePage`, `settingsHideSession`, `variant`, `content` (`page`, `fill`, `centered`, `bleed`; per page with `definePageMeta({ content })` in `k-dashboard`), `fluid`, `fill`, `onSignOut`. Slots: default, `actions`, `brand`, `sidebar`, `sidebar-footer`, `account`, `topbar`, `search-item`, `settings-account-fields`, `settings-section-<id>`, `settings-actions-<id>`. Event: `accountSelect`. | `templates/dashboard-layout.vue` |
|
|
260
|
+
| `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
|
+
| `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
|
+
| `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` |
|
|
264
|
+
| `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
|
+
| `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
|
+
| `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` |
|
|
267
|
+
| `SettingsSection` | Card of one settings section with a save footer. | Props: `title`, `description`, `icon`, `hint`, `saveable`, `saving`, `saveDisabled`, `saveLabel`, `form`. Slots: default, `actions`, `footer`, `hint`. Event: `save`. | `templates/settings-page.vue` |
|
|
268
|
+
| `SettingsGroup` | Block with label, description and actions inside a settings section. | Props: `label`, `description`, `level`, `row`. Slots: default, `label`, `description`, `actions`. | `templates/settings-modal.vue` |
|
|
269
|
+
| `SettingsModal` | Settings dialog with nav, built-in account and appearance sections, your own sections and subpages. | Models: `v-model:open`, `v-model:section`, `v-model:pages`. Props: `sections` (`id`, `label`, `icon`, `group`, `badge`, `to`), `account`, `presets`, `title`, `onSignOut`, `hideSession`, `beforeClose`, `route` (sync with `?settings=<section>/<page>`), `routeLocation` (`'hash'`: `#settings/<section>/<page>`), `accountSection` (id with the built-in account content, default `account`), `resolvePage(section, id, parents)`. Slots: `section-<id>`, `actions-<id>` (right of the header row, also on a subpage), `account-fields`. | `templates/settings-modal.vue` |
|
|
270
|
+
| `AppearanceSettings` | Theme (light, dark, system) and preset cards. Used by `SettingsModal`. Use alone in a settings page. | Props: `presets` (list or false), `themes`, `level`. | `presets.vue` (pages root) |
|
|
271
|
+
| `SaveBar` | Floating bar with save and discard for unsaved changes. | Props: `visible`, `saving`, `message`, `saveLabel`, `discardLabel`, `form`. Slots: default, `actions`. Events: `save`, `discard`. | `templates/settings-page.vue` |
|
|
272
|
+
| `EmptyPage` | First run screen with illustration, actions and onboarding steps. | Props: `title`, `description`, `icon`, `actionLabel`, `actionTo`, `onAction`, `secondaryLabel`, `steps` (`title`, `description`, `done`, `to`), `fill`. Slots: default, `illustration`, `title`, `description`, `actions`. | `templates/empty-page.vue` |
|
|
273
|
+
| `ErrorPage` | Error screen. Reads a Nuxt `error`. Use it in `app/error.vue`. | Props: `error`, `statusCode`, `title`, `message`, `homeTo`, `homeLabel`, `retryLabel`, `brandName`, `fill`, `onHome`, `onRetry`. Slots: default, `title`, `message`, `actions`, `brand`. | `templates/error-page.vue` |
|
|
274
|
+
| `NotFoundPage` | 404 screen. | Props: `title`, `message`, `homeTo`, `homeLabel`, `backLabel`, `brandName`, `fill`, `onHome`. Slots: default, `actions`, `brand`. | `templates/error-page.vue` |
|
|
275
|
+
| `Brand` | Logo and name block (image URL, inline SVG or component). | Props: `name`, `subtitle`, `icon`, `logo`, `to`, `size`, `accent`, `hideText`, `showName`. Slots: default, `logo`, `mark`, `subtitle`. | `templates/dashboard-layout.vue` |
|
|
276
|
+
| `AccountMenu` | Account button with avatar, name and a dropdown menu. Used by `DashboardLayout`. | Props: `name`, `email`, `avatar`, `menu` (menu items), `placement`, `icon`. Event: `select`. | `templates/dashboard-layout.vue` |
|
|
271
277
|
|
|
272
278
|
Nuxt ready layouts: with `k: { layouts: true }` the module registers the layouts `k-dashboard` and `k-auth`. They read brand, navigation, account and settings from `app.config.ts` (`k` key). `useDashboard()` gives the runtime account, breadcrumbs and badges for `k-dashboard`. See README, section "Nuxt: ready layouts".
|
|
273
279
|
|
package/README.md
CHANGED
|
@@ -105,6 +105,8 @@ Vite 8 minifies CSS with Lightning CSS. Set `build.cssTarget` to browsers that s
|
|
|
105
105
|
|
|
106
106
|
Tokens live on `.k-root`, never on `:root`. Override them on a root element: host CSS, Root props or inline style.
|
|
107
107
|
|
|
108
|
+
With Tailwind CSS 4, import the theme bridge after Tailwind: `@import '@xleddyl/443-components-vue/tailwind.css';`. It maps the tokens to Tailwind theme values, so host code writes `border-line`, `bg-subtle`, `text-text-muted`, `text-danger-text`, `rounded-md` or `shadow-raised` instead of `border-(--k-line)`. A token `--k-<name>` is the color `<name>`; radii, shadows and fonts keep their names. The values stay live, so presets, dark mode and custom themes apply.
|
|
109
|
+
|
|
108
110
|
The brand of an app is a custom theme: a class on the outermost root, with the token overrides in host CSS. Keep the brand values in this one place, not in Root props.
|
|
109
111
|
|
|
110
112
|
```vue
|
|
@@ -553,6 +555,22 @@ const confirmDiscard = () => !dirty.value || confirm({ title: 'Discard changes?'
|
|
|
553
555
|
|
|
554
556
|
- `#title-trailing` puts badges or a status next to the title without replacing `#header`.
|
|
555
557
|
- `#actions` (`{ close }`) puts buttons in the header, on the right before the close button (an edit or a more menu), without replacing `#header`.
|
|
558
|
+
- `tabs` (`TabItem[]`) with `v-model:tab` puts an underline tab list at the bottom of the header. The body becomes the tab panel and the default slot gets `{ tab }` (the active value), so the content shows one part at a time (`v-show` keeps the form fields mounted). The body scrolls to the top when the tab changes.
|
|
559
|
+
- `trail` (the labels of the previous levels) turns the title into a breadcrumb that ends with `title`, and adds a back button (`backLabel`, default "Back") before `#actions`. A click on a crumb emits `navigate(index)`, the back button emits `navigate(trail.length - 1)`. Use it for a subpage inside the same panel (an item of the record in the drawer), as in `SettingsModal`.
|
|
560
|
+
|
|
561
|
+
```vue
|
|
562
|
+
<KDrawer
|
|
563
|
+
v-model:open="open"
|
|
564
|
+
v-model:tab="tab"
|
|
565
|
+
:title="variant ? variant.code : family.name"
|
|
566
|
+
:trail="variant ? [family.name] : undefined"
|
|
567
|
+
:tabs="variant ? variantTabs : familyTabs"
|
|
568
|
+
@navigate="variant = null"
|
|
569
|
+
>
|
|
570
|
+
<template #default="{ tab: active }">...</template>
|
|
571
|
+
</KDrawer>
|
|
572
|
+
```
|
|
573
|
+
|
|
556
574
|
- `size="fullscreen"` on a Modal fills the viewport edge to edge (no radius, no outer padding, safe area insets inside the panel) and never turns into a bottom sheet.
|
|
557
575
|
- Overlays reset the field context: controls inside a Modal, Drawer, CommandPalette, menu, Popover or HoverCard panel do not inherit the id, description or invalid state of a `FormField` that contains the trigger. Call `provideFieldBoundary()` in your own overlay components to do the same.
|
|
558
576
|
|
|
@@ -694,15 +712,16 @@ Centered card on the canvas (`variant="centered"`) or form plus an accent aside
|
|
|
694
712
|
|
|
695
713
|
### Page templates
|
|
696
714
|
|
|
697
|
-
| Component | What it gives you
|
|
698
|
-
| -------------------------------------------- |
|
|
699
|
-
| `DashboardPage` | PageHeader (`title`, `eyebrow`, `description`, `#actions`), a Stat grid from `stats` (or `#stats`), a content grid (`columns`, default 1 then 3 columns).
|
|
700
|
-
| `ListPage` | Header, toolbar (search with `searchable`, FilterPills from `filters`, `#toolbar`, `#bulk` when rows are selected), Table from `columns`/`rows`, Pagination. Client mode filters (`searchKeys`, `filterKey`), sorts and paginates; pass `total` for server mode. States: `loading` skeleton rows, first run `#empty`, no results with a clear button, `error` with retry. `cell-*` and `header-*` slots go to the Table.
|
|
701
|
-
| `DetailPage` | Back link (`backTo`), title, `status` badge, `#actions`, optional `tabs` (`#panel-<value>`), main column plus an aside with DescriptionList cards from `sections` (or `#aside`). `loading` and `error` states.
|
|
702
|
-
| `
|
|
703
|
-
| `
|
|
704
|
-
| `
|
|
705
|
-
| `
|
|
715
|
+
| Component | What it gives you |
|
|
716
|
+
| -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
717
|
+
| `DashboardPage` | PageHeader (`title`, `eyebrow`, `description`, `#actions`), a Stat grid from `stats` (or `#stats`), a content grid (`columns`, default 1 then 3 columns). |
|
|
718
|
+
| `ListPage` | Header, toolbar (search with `searchable`, FilterPills from `filters`, `#toolbar`, `#bulk` when rows are selected), Table from `columns`/`rows`, Pagination. Client mode filters (`searchKeys`, `filterKey`), sorts and paginates; pass `total` for server mode. States: `loading` skeleton rows, first run `#empty`, no results with a clear button, `error` with retry. `cell-*` and `header-*` slots go to the Table. |
|
|
719
|
+
| `DetailPage` | Back link (`backTo`), title, `status` badge, `#actions`, optional `tabs` (`#panel-<value>`), main column plus an aside with DescriptionList cards from `sections` (or `#aside`). `loading` and `error` states. |
|
|
720
|
+
| `FormDrawer` | A `Drawer` with a `Form` (`form` from `useForm`) around the body and a footer: delete on the left (`deletable`, `@delete`, `deleteDisabled`, `deleteHint`), cancel and submit on the right. `creating` changes the submit text to Create and enables it without changes; otherwise it needs a dirty form (`requireDirty`). `readonly` keeps only a Close button. Every close asks before discarding a dirty form (`guard`), then runs `beforeClose`. `onCancel` replaces the close of the cancel button (back to a parent view), after the same question. `loading` shows a `SkeletonForm` (or `#skeleton`) and keeps the header, the tabs and the footer in place. Pass another `form` to switch the body to a subpage (with `trail`). |
|
|
721
|
+
| `FormPage` | Header, your cards inside `Form` (`form` from `useForm`, or a plain `form` emitting `submit`), sticky footer with cancel and submit, unsaved state, dirty guard (`guard`, on by default) through `useDirtyGuard`. |
|
|
722
|
+
| `SettingsPage`, `SettingsSection`, `SaveBar` | Section nav (sticky on the left, a scrolling row on narrow screens; items with `to` become route links), `#section-<value>` panels, section cards with a save footer, and a floating save bar while `dirty`. |
|
|
723
|
+
| `ErrorPage`, `NotFoundPage` | Status code, title, message (defaults per status code, reads a Nuxt `error`), home, retry (`@retry`) and back actions. `@home` replaces the home link, handy for `clearError`. |
|
|
724
|
+
| `EmptyPage` | First run screen: illustration, title, description, primary and secondary actions, onboarding `steps`. |
|
|
706
725
|
|
|
707
726
|
`useDirtyGuard(dirty, options?)` asks before leaving (router navigation through `ConfirmHost`, or the native confirm) and on tab close. Returns `confirmLeave()` and `allowNext()`.
|
|
708
727
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="k-skeleton-form"
|
|
4
|
+
role="status"
|
|
5
|
+
:aria-label="label ?? t('common.loading')"
|
|
6
|
+
:style="{ '--k-skeleton-form-columns': columns }"
|
|
7
|
+
>
|
|
8
|
+
<div v-for="field in fields" :key="field" class="k-skeleton-form-field">
|
|
9
|
+
<Skeleton :width="labelWidth(field)" :animation="animation" />
|
|
10
|
+
<Skeleton shape="rect" class="k-skeleton-form-control" :animation="animation" />
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script setup>
|
|
16
|
+
import { useLocale } from "../../composables/useLocale";
|
|
17
|
+
import Skeleton from "./Skeleton.vue";
|
|
18
|
+
defineProps({
|
|
19
|
+
fields: { type: Number, required: false, default: 4 },
|
|
20
|
+
columns: { type: Number, required: false, default: 1 },
|
|
21
|
+
label: { type: String, required: false },
|
|
22
|
+
animation: { type: String, required: false, default: "shimmer" }
|
|
23
|
+
});
|
|
24
|
+
const { t } = useLocale();
|
|
25
|
+
const LABEL_WIDTHS = ["30%", "45%", "25%", "38%"];
|
|
26
|
+
function labelWidth(field) {
|
|
27
|
+
return LABEL_WIDTHS[(field - 1) % LABEL_WIDTHS.length];
|
|
28
|
+
}
|
|
29
|
+
</script>
|