@xleddyl/443-components-vue 0.16.8 → 0.16.10

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 CHANGED
@@ -65,6 +65,7 @@ Playground paths in this file are relative to `playground/nuxt/app/pages/compone
65
65
  | Toast after saving in an open Drawer | `toast` (the stack moves beside the drawer or above its footer) |
66
66
  | Detail or edit panel from the side | `Drawer` (or `useDrawer().open`) |
67
67
  | Dialog with a form or content | `Modal` (or `useModal().open` to get the result as a promise) |
68
+ | Tabs or subpages (breadcrumb and back) in a Modal or Drawer | `tabs` + `v-model:tab`; `trail` + `@navigate` on `Modal` / `Drawer` |
68
69
  | Buttons in a Modal or Drawer header | `#actions` slot of `Modal` / `Drawer` (right side, before the close button) |
69
70
  | Deep link to a drawer or modal (`?family=fam_1`, `#family/fam_1`) | `useRouteState('family')` + `:open="!!familyId"`, `location: 'hash'`; settings: `route`, `settingsRoute` |
70
71
  | Menu opened by a button | `DropdownMenu` |
@@ -177,20 +178,20 @@ All field components work inside `FormField` and take `invalid`, `disabled`, `re
177
178
 
178
179
  Mount `OverlayHost` once for the imperative hooks (see [Composables](#composables)).
179
180
 
180
- | Component | Purpose and when to use it | Main props, models, slots, events | Playground |
181
- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
182
- | `Modal` | Centered dialog for forms and content. Use `Drawer` for a side panel, `useConfirm` for a yes or no question. | Model: `v-model:open`. Props: `title`, `description`, `size` (sm to xl, full, fit, fullscreen), `width`, `minHeight`, `dismissible`, `hideClose`, `sheet`, `flush`, `loading`, `beforeClose(reason)`. Slots: default, `header`, `actions` (header, before the close button), `footer`, `title-trailing`. Events: `open`, `close`, `afterLeave`. | `overlays/modal.vue` |
183
- | `Drawer` | Panel from the side or bottom for details and edit forms. Use `Modal` for short focused dialogs. | Model: `v-model:open`. Props: `title`, `description`, `side` (left, right, bottom), `size` (sm to xl, full), `dismissible`, `hideClose`, `flush`, `loading`, `beforeClose(reason)`. Slots like `Modal`. Events: `open`, `close`, `afterLeave`. | `overlays/drawer.vue` |
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`. | `overlays/confirm-dialog.vue` |
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 }`). | `overlays/hooks.vue` |
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`. | `overlays/toast.vue` |
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`. | `overlays/dropdown-menu.vue` |
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`. | `overlays/context-menu.vue` |
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`. | `overlays/popover.vue` |
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`. | `overlays/hover-card.vue` |
192
- | `Tooltip` | Short text on hover or focus. Optional shortcut. | Props: `text`, `placement`, `openDelay`, `closeDelay`, `arrow`, `shortcut`, `disabled`. Slots: default (trigger), `content`. | `overlays/tooltip.vue` |
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`. | `overlays/command-palette.vue` |
181
+ | Component | Purpose and when to use it | Main props, models, slots, events | Playground |
182
+ | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------ |
183
+ | `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` |
184
+ | `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` |
185
+ | `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` |
186
+ | `ConfirmHost` | Renders the dialogs of `useConfirm`, `useAlert`, `usePrompt`. `OverlayHost` includes it. Do not mount it alone. | None. | - |
187
+ | `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` |
188
+ | `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` |
189
+ | `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` |
190
+ | `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` |
191
+ | `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` |
192
+ | `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` |
193
+ | `Tooltip` | Short text on hover or focus. Optional shortcut. | Props: `text`, `placement`, `openDelay`, `closeDelay`, `arrow`, `shortcut`, `disabled`. Slots: default (trigger), `content`. | `overlays/tooltip.vue` |
194
+ | `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
195
 
195
196
  ## Data
196
197
 
@@ -213,25 +214,25 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
213
214
 
214
215
  ## Layout
215
216
 
216
- | Component | Purpose and when to use it | Main props, models, slots, events | Playground |
217
- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------- |
218
- | `Card` | Container with optional title, description, icon, actions and footer. Can be a link or a selectable button. | Props: `title`, `description`, `icon`, `variant` (raised, outline, subtle), `padding`, `as`, `to`, `href`, `selected`, `disabled`, `animated`. Slots: default, `header`, `title`, `description`, `icon`, `actions`, `footer`. | `layout/card.vue` |
219
- | `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
- | `Breadcrumbs` | Path navigation. | Props: `items` (`label`, `to`, `href`, `icon`), `separator`, `linkLast`, `ancestors`. Slot: `item`. | `layout/breadcrumbs.vue` |
221
- | `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`), `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`. Slots: `panel-<value>`, `panel`. | `layout/tabs.vue` |
223
- | `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
- | `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
- | `Stack` | Flex row or column with gap. | Props: `direction`, `gap` (none to xl), `align`, `justify`, `wrap`, `responsive`, `as`. | `layout/stack.vue` |
226
- | `Grid` | Responsive CSS grid. | Props: `columns` (number or breakpoints), `minItemWidth` (auto fit), `gap`, `as`. | `layout/grid.vue` |
227
- | `Toolbar` | Group of controls with arrow key navigation (ARIA toolbar). | Props: `label`, `orientation`, `roving`, `bordered`. | `layout/toolbar.vue` |
228
- | `CopyButton` | Button that copies a value and shows "copied". | Props: `value`, `label`, `copiedLabel`, `showLabel`, `size`, `variant`, `tone`, `resetAfter`. Event: `copy(success)`. | `layout/copy-button.vue` |
229
- | `ThemeSwitch` | Light, dark and system switch. | Props: `variant` (segmented, icon), `size`, `showLabels`. | `layout/theme-switch.vue` |
230
- | `NavLink` | One navigation link with icon, badge and active state. | Props: `label`, `to`, `href`, `icon`, `badge`, `active`, `match` (exact, prefix), `external`, `disabled`. Slots: default, `icon`. | `layout/nav-link.vue` |
231
- | `AppShell` | App frame: sidebar, topbar, mobile menu, collapse, skip link. Use it for a custom frame. Use `DashboardLayout` for the ready one. | Models: `v-model:collapsed`, `v-model:open`. Props: `variant` (inset, sidebar, floating), `content` (`page`, `fill`, `centered`, `bleed`), `fluid`, `fill`, `topbar`, `storageKey` (collapsed state in the preferences store), `shortcut`. Slots: default, `sidebar`, `topbar`, `overlays`. | `layout/app-shell.vue` |
232
- | `Sidebar` | Sidebar content with header, collapse button and footer. Goes in the `sidebar` slot of `AppShell`. | Props: `label`, `collapsible`, `collapseLabel`, `brandAlign` (`start`, `center`). Icons `sidebar-collapse` and `sidebar-expand` for the collapse button. Slots: default, `header`, `top`, `footer`. | `layout/app-shell.vue` |
233
- | `SidebarNav` | Navigation list from data, with groups and children. | Props: `items` (`NavItem[]` or `NavSection[]`: `label`, `to`, `icon`, `badge`, `children`), `currentPath`. | `layout/app-shell.vue` |
234
- | `SidebarSection` | Labelled block inside a sidebar for hand written links. | Prop: `label`. Slot: default. | `layout/app-shell.vue` |
217
+ | Component | Purpose and when to use it | Main props, models, slots, events | Playground |
218
+ | ---------------- | --------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- |
219
+ | `Card` | Container with optional title, description, icon, actions and footer. Can be a link or a selectable button. | Props: `title`, `description`, `icon`, `variant` (raised, outline, subtle), `padding`, `as`, `to`, `href`, `selected`, `disabled`, `animated`. Slots: default, `header`, `title`, `description`, `icon`, `actions`, `footer`. | `layout/card.vue` |
220
+ | `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` |
221
+ | `Breadcrumbs` | Path navigation. | Props: `items` (`label`, `to`, `href`, `icon`), `separator`, `linkLast`, `ancestors`. Slot: `item`. | `layout/breadcrumbs.vue` |
222
+ | `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` |
223
+ | `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` |
224
+ | `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` |
225
+ | `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` |
226
+ | `Stack` | Flex row or column with gap. | Props: `direction`, `gap` (none to xl), `align`, `justify`, `wrap`, `responsive`, `as`. | `layout/stack.vue` |
227
+ | `Grid` | Responsive CSS grid. | Props: `columns` (number or breakpoints), `minItemWidth` (auto fit), `gap`, `as`. | `layout/grid.vue` |
228
+ | `Toolbar` | Group of controls with arrow key navigation (ARIA toolbar). | Props: `label`, `orientation`, `roving`, `bordered`. | `layout/toolbar.vue` |
229
+ | `CopyButton` | Button that copies a value and shows "copied". | Props: `value`, `label`, `copiedLabel`, `showLabel`, `size`, `variant`, `tone`, `resetAfter`. Event: `copy(success)`. | `layout/copy-button.vue` |
230
+ | `ThemeSwitch` | Light, dark and system switch. | Props: `variant` (segmented, icon), `size`, `showLabels`. | `layout/theme-switch.vue` |
231
+ | `NavLink` | One navigation link with icon, badge and active state. | Props: `label`, `to`, `href`, `icon`, `badge`, `active`, `match` (exact, prefix), `external`, `disabled`. Slots: default, `icon`. | `layout/nav-link.vue` |
232
+ | `AppShell` | App frame: sidebar, topbar, mobile menu, collapse, skip link. Use it for a custom frame. Use `DashboardLayout` for the ready one. | Models: `v-model:collapsed`, `v-model:open`. Props: `variant` (inset, sidebar, floating), `content` (`page`, `fill`, `centered`, `bleed`), `fluid`, `fill`, `topbar`, `storageKey` (collapsed state in the preferences store), `shortcut`. Slots: default, `sidebar`, `topbar`, `overlays`. | `layout/app-shell.vue` |
233
+ | `Sidebar` | Sidebar content with header, collapse button and footer. Goes in the `sidebar` slot of `AppShell`. | Props: `label`, `collapsible`, `collapseLabel`, `brandAlign` (`start`, `center`). Icons `sidebar-collapse` and `sidebar-expand` for the collapse button. Slots: default, `header`, `top`, `footer`. | `layout/app-shell.vue` |
234
+ | `SidebarNav` | Navigation list from data, with groups and children. | Props: `items` (`NavItem[]` or `NavSection[]`: `label`, `to`, `icon`, `badge`, `children`), `currentPath`. | `layout/app-shell.vue` |
235
+ | `SidebarSection` | Labelled block inside a sidebar for hand written links. | Prop: `label`. Slot: default. | `layout/app-shell.vue` |
235
236
 
236
237
  ## Feedback
237
238
 
package/README.md CHANGED
@@ -452,7 +452,7 @@ Composables: `useTheme`, `usePreset`, `useForm`, `useField`, `useFieldControl`,
452
452
  - `Calendar` takes `dayText: (iso) => string | undefined`, a short line under each day number that is also added to the day's accessible name (availability, prices). The `#day` slot (`{ date, number, text, selected, unavailable, outOfRange, inMonth }`) replaces the cell content; it is decorative, so announced text still comes from `dayText`. Days before `min` or after `max` get the `is-out-of-range` class (and `is-unavailable`, like days rejected by `isDateDisabled`), so the `--k-calendar-out-of-range-*` tokens style them apart from disabled days.
453
453
  - `Separator` takes `description` (or `#description`) under its label, and an `#actions` slot rendered next to them (a small add or edit button). `variant="heading"` (`SeparatorVariant`, `'label' | 'heading'`, default `'label'`) shows the label as a section title on its own (an `h3`, `level` changes it) with the description below and the actions at the end, under one line above instead of the small muted label between two lines. `:lines="false"` (default `true`) hides the lines of either variant. `align` (`SeparatorAlign`, `'start' | 'center'`, default `'start'`) centers the heading title and description. `--k-separator-heading-font-size` (0.9375rem) sizes the heading, `--k-separator-heading-color` (default `--k-text`) colors it, and `--k-separator-label-font-size` (0.75rem) sizes the small label of `variant="label"`, with or without lines.
454
454
  - `Modal` takes `width` (any CSS length, overrides `size`) and `minHeight` (keeps the height steady while tabs or steps change). The size widths are tokens: `--k-modal-width-sm` (26rem), `--k-modal-width-md` (32rem), `--k-modal-width-lg` (50rem), `--k-modal-width-xl` (64rem).
455
- - `Stepper` shows the steps of a wizard: `steps` (`StepperStep[]`: `value`, `label`, `description`, `icon`, `disabled`, `state` `'complete' | 'error'`) and `v-model` for the current value. It renders a `nav` (named by `label`, default "Progress") around an ordered list; the current step has `aria-current="step"`, every step carries a hidden "Step 2 of 4" (`stepper.position`, `positionLabel` overrides it) and its state ("completed", "has errors"). Clickable steps are buttons with one tab stop and arrow keys, Home and End between them. `linear` makes only completed steps (`state: 'complete'` or before the current one) and the current step clickable; `readonly` renders no buttons. `orientation="vertical"` stacks the steps; `size="sm"` is denser. `compact` is `'auto'` by default: below 36rem of container width the labels are visually hidden (still read) and a "Step 2 of 4 Columns" line shows the current step; `true` forces it, `false` turns it off. `select(step)` fires on a click before the model changes.
455
+ - `Stepper` shows the steps of a wizard: `steps` (`StepperStep[]`: `value`, `label`, `description`, `icon`, `disabled`, `state` `'complete' | 'error'`) and `v-model` for the current value. It renders a `nav` (named by `label`, default "Progress") around an ordered list; the current step has `aria-current="step"`, every step carries a hidden "Step 2 of 4" (`stepper.position`, `positionLabel` overrides it) and its state ("completed", "has errors"). Clickable steps are buttons with one tab stop and arrow keys, Home and End between them. `linear` makes only completed steps (`state: 'complete'` or before the current one) and the current step clickable; `readonly` renders no buttons. `orientation="vertical"` stacks the steps; `size="sm"` is denser. `compact` is `'auto'` by default: below 36rem of container width the labels are visually hidden (still read) and a "Step 2 of 4 Columns" line shows the current step; `true` forces it, `false` turns it off. `:summary="false"` keeps only the numbers in compact mode, without that line (a stepper in a modal header). `select(step)` fires on a click before the model changes.
456
456
 
457
457
  ```vue
458
458
  <KStepper v-model="step" :steps="steps" linear label="Import" />
@@ -553,6 +553,22 @@ const confirmDiscard = () => !dirty.value || confirm({ title: 'Discard changes?'
553
553
 
554
554
  - `#title-trailing` puts badges or a status next to the title without replacing `#header`.
555
555
  - `#actions` (`{ close }`) puts buttons in the header, on the right before the close button (an edit or a more menu), without replacing `#header`.
556
+ - `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.
557
+ - `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`.
558
+
559
+ ```vue
560
+ <KDrawer
561
+ v-model:open="open"
562
+ v-model:tab="tab"
563
+ :title="variant ? variant.code : family.name"
564
+ :trail="variant ? [family.name] : undefined"
565
+ :tabs="variant ? variantTabs : familyTabs"
566
+ @navigate="variant = null"
567
+ >
568
+ <template #default="{ tab: active }">...</template>
569
+ </KDrawer>
570
+ ```
571
+
556
572
  - `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
573
  - 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
574
 
@@ -61,7 +61,11 @@
61
61
  />
62
62
  </li>
63
63
  </ol>
64
- <p v-if="compact !== false && currentEntry" class="k-stepper-summary" aria-hidden="true">
64
+ <p
65
+ v-if="compact !== false && summary && currentEntry"
66
+ class="k-stepper-summary"
67
+ aria-hidden="true"
68
+ >
65
69
  <span class="k-stepper-summary-position">{{ positionText(currentIndex) }}</span>
66
70
  <span class="k-stepper-summary-label">{{ currentEntry.step.label }}</span>
67
71
  </p>
@@ -82,6 +86,7 @@ const props = defineProps({
82
86
  linear: { type: Boolean, required: false },
83
87
  readonly: { type: Boolean, required: false },
84
88
  compact: { type: [Boolean, String], required: false, default: "auto" },
89
+ summary: { type: Boolean, required: false, default: true },
85
90
  positionLabel: { type: String, required: false },
86
91
  completeLabel: { type: String, required: false },
87
92
  errorLabel: { type: String, required: false }
@@ -7,6 +7,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
7
7
  linear?: boolean;
8
8
  readonly?: boolean;
9
9
  compact?: boolean | "auto";
10
+ summary?: boolean;
10
11
  positionLabel?: string;
11
12
  completeLabel?: string;
12
13
  errorLabel?: string;
@@ -213,6 +214,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
213
214
  linear?: boolean;
214
215
  readonly?: boolean;
215
216
  compact?: boolean | "auto";
217
+ summary?: boolean;
216
218
  positionLabel?: string;
217
219
  completeLabel?: string;
218
220
  errorLabel?: string;
@@ -413,6 +415,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
413
415
  "onUpdate:modelValue"?: ((value: string | number | undefined) => any) | undefined;
414
416
  }>, {
415
417
  size: "sm" | "md";
418
+ summary: boolean;
416
419
  orientation: StepperOrientation;
417
420
  compact: boolean | "auto";
418
421
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -53,7 +53,7 @@
53
53
  <span class="k-tabs-indicator" aria-hidden="true" />
54
54
  </div>
55
55
  <div
56
- v-if="singlePanel && activeItem"
56
+ v-if="singlePanel && activeItem && !controls"
57
57
  :id="singlePanelId"
58
58
  class="k-tabs-panel"
59
59
  role="tabpanel"
@@ -62,7 +62,7 @@
62
62
  >
63
63
  <slot name="panel" :item="activeItem" />
64
64
  </div>
65
- <template v-for="(item, index) in singlePanel ? [] : items" :key="item.value">
65
+ <template v-for="(item, index) in singlePanel || controls ? [] : items" :key="item.value">
66
66
  <div
67
67
  v-if="!lazy || visited.has(item.value)"
68
68
  v-show="isSelected(item)"
@@ -96,7 +96,8 @@ const props = defineProps({
96
96
  fill: { type: Boolean, required: false },
97
97
  stretch: { type: Boolean, required: false },
98
98
  inset: { type: Boolean, required: false },
99
- panelFocusable: { type: Boolean, required: false, default: true }
99
+ panelFocusable: { type: Boolean, required: false, default: true },
100
+ controls: { type: String, required: false }
100
101
  });
101
102
  const { t } = useLocale();
102
103
  const slots = defineSlots();
@@ -141,6 +142,7 @@ function panelId(index) {
141
142
  return `${baseId}-panel-${index}`;
142
143
  }
143
144
  function controlsId(item, index) {
145
+ if (props.controls) return isSelected(item) ? props.controls : void 0;
144
146
  if (singlePanel.value) return isSelected(item) ? singlePanelId : void 0;
145
147
  return !props.lazy || visited.value.has(item.value) ? panelId(index) : void 0;
146
148
  }
@@ -22,6 +22,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
22
22
  stretch?: boolean;
23
23
  inset?: boolean;
24
24
  panelFocusable?: boolean;
25
+ controls?: string;
25
26
  modelValue?: TabItem["value"];
26
27
  key?: PropertyKey | undefined;
27
28
  prefix?: string | undefined | undefined;
@@ -228,6 +229,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
228
229
  stretch?: boolean;
229
230
  inset?: boolean;
230
231
  panelFocusable?: boolean;
232
+ controls?: string;
231
233
  modelValue?: TabItem["value"];
232
234
  key?: PropertyKey | undefined;
233
235
  prefix?: string | undefined | undefined;
@@ -22,6 +22,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
22
22
  loading?: boolean;
23
23
  prefix?: "k-modal" | "k-drawer" | undefined;
24
24
  size?: import("./types.ts").ModalSize;
25
+ tabs?: import("../layout/types.ts").TabItem[];
25
26
  label?: string;
26
27
  style?: import("vue").StyleValue;
27
28
  results?: (string | number) | undefined;
@@ -222,12 +223,17 @@ declare const __VLS_base: import("vue").DefineComponent<{
222
223
  onVnodeBeforeUnmount?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
223
224
  onVnodeUnmounted?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
224
225
  sheet?: boolean;
226
+ tab?: import("../layout/types.ts").TabItem["value"];
225
227
  onClose?: (() => any) | undefined;
226
228
  onOpen?: (() => any) | undefined;
227
229
  closeLabel?: string;
230
+ trail?: string[];
231
+ onNavigate?: ((index: number) => any) | undefined;
228
232
  rootClass?: unknown;
229
233
  hideClose?: boolean;
230
234
  beforeClose?: import("./types.ts").DialogBeforeClose;
235
+ backLabel?: string;
236
+ "onUpdate:tab"?: ((value: string | number | undefined) => any) | undefined;
231
237
  closedby?: import("../../index.ts").DialogClosedBy;
232
238
  minHeight?: string;
233
239
  }, {
@@ -252,6 +258,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
252
258
  loading?: boolean;
253
259
  prefix?: "k-modal" | "k-drawer" | undefined;
254
260
  size?: import("./types.ts").ModalSize;
261
+ tabs?: import("../layout/types.ts").TabItem[];
255
262
  label?: string;
256
263
  style?: import("vue").StyleValue;
257
264
  results?: (string | number) | undefined;
@@ -452,12 +459,17 @@ declare const __VLS_base: import("vue").DefineComponent<{
452
459
  onVnodeBeforeUnmount?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
453
460
  onVnodeUnmounted?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
454
461
  sheet?: boolean;
462
+ tab?: import("../layout/types.ts").TabItem["value"];
455
463
  onClose?: (() => any) | undefined;
456
464
  onOpen?: (() => any) | undefined;
457
465
  closeLabel?: string;
466
+ trail?: string[];
467
+ onNavigate?: ((index: number) => any) | undefined;
458
468
  rootClass?: unknown;
459
469
  hideClose?: boolean;
460
470
  beforeClose?: import("./types.ts").DialogBeforeClose;
471
+ backLabel?: string;
472
+ "onUpdate:tab"?: ((value: string | number | undefined) => any) | undefined;
461
473
  closedby?: import("../../index.ts").DialogClosedBy;
462
474
  minHeight?: string;
463
475
  }> & Readonly<{
@@ -12,6 +12,7 @@ declare const __VLS_export: import("vue").DefineComponent<Partial<NonNullable<{
12
12
  readonly loading?: boolean | undefined;
13
13
  readonly prefix?: "k-modal" | "k-drawer" | undefined;
14
14
  readonly size?: import("./types.ts").ModalSize | undefined;
15
+ readonly tabs?: import("../layout/types.ts").TabItem[] | undefined;
15
16
  readonly label?: string | undefined;
16
17
  readonly style?: import("vue").StyleValue;
17
18
  readonly results?: (string | number) | undefined;
@@ -212,12 +213,17 @@ declare const __VLS_export: import("vue").DefineComponent<Partial<NonNullable<{
212
213
  readonly onVnodeBeforeUnmount?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
213
214
  readonly onVnodeUnmounted?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
214
215
  readonly sheet?: boolean | undefined;
216
+ readonly tab?: import("../layout/types.ts").TabItem["value"] | undefined;
215
217
  readonly onClose?: (() => any) | undefined;
216
218
  readonly onOpen?: (() => any) | undefined;
217
219
  readonly closeLabel?: string | undefined;
220
+ readonly trail?: string[] | undefined;
221
+ readonly onNavigate?: ((index: number) => any) | undefined;
218
222
  readonly rootClass?: unknown;
219
223
  readonly hideClose?: boolean | undefined;
220
224
  readonly beforeClose?: import("./types.ts").DialogBeforeClose | undefined;
225
+ readonly backLabel?: string | undefined;
226
+ readonly "onUpdate:tab"?: ((value: string | number | undefined) => any) | undefined;
221
227
  readonly closedby?: import("../../index.ts").DialogClosedBy | undefined;
222
228
  readonly minHeight?: string | undefined;
223
229
  readonly onCancel?: (() => any) | undefined;
@@ -238,6 +244,7 @@ declare const __VLS_export: import("vue").DefineComponent<Partial<NonNullable<{
238
244
  readonly loading?: boolean | undefined;
239
245
  readonly prefix?: "k-modal" | "k-drawer" | undefined;
240
246
  readonly size?: import("./types.ts").ModalSize | undefined;
247
+ readonly tabs?: import("../layout/types.ts").TabItem[] | undefined;
241
248
  readonly label?: string | undefined;
242
249
  readonly style?: import("vue").StyleValue;
243
250
  readonly results?: (string | number) | undefined;
@@ -438,12 +445,17 @@ declare const __VLS_export: import("vue").DefineComponent<Partial<NonNullable<{
438
445
  readonly onVnodeBeforeUnmount?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
439
446
  readonly onVnodeUnmounted?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
440
447
  readonly sheet?: boolean | undefined;
448
+ readonly tab?: import("../layout/types.ts").TabItem["value"] | undefined;
441
449
  readonly onClose?: (() => any) | undefined;
442
450
  readonly onOpen?: (() => any) | undefined;
443
451
  readonly closeLabel?: string | undefined;
452
+ readonly trail?: string[] | undefined;
453
+ readonly onNavigate?: ((index: number) => any) | undefined;
444
454
  readonly rootClass?: unknown;
445
455
  readonly hideClose?: boolean | undefined;
446
456
  readonly beforeClose?: import("./types.ts").DialogBeforeClose | undefined;
457
+ readonly backLabel?: string | undefined;
458
+ readonly "onUpdate:tab"?: ((value: string | number | undefined) => any) | undefined;
447
459
  readonly closedby?: import("../../index.ts").DialogClosedBy | undefined;
448
460
  readonly minHeight?: string | undefined;
449
461
  readonly onCancel?: (() => any) | undefined;
@@ -13,6 +13,11 @@
13
13
  :flush="flush"
14
14
  :loading="loading"
15
15
  :before-close="beforeClose"
16
+ :tabs="tabs"
17
+ :trail="trail"
18
+ :back-label="backLabel"
19
+ v-model:tab="tab"
20
+ @navigate="(index) => emit('navigate', index)"
16
21
  @open="emit('open')"
17
22
  @close="emit('close')"
18
23
  @after-leave="emit('afterLeave')"
@@ -37,12 +42,16 @@ defineProps({
37
42
  closeLabel: { type: String, required: false },
38
43
  flush: { type: Boolean, required: false },
39
44
  loading: { type: Boolean, required: false },
40
- beforeClose: { type: Function, required: false }
45
+ beforeClose: { type: Function, required: false },
46
+ tabs: { type: Array, required: false },
47
+ trail: { type: Array, required: false },
48
+ backLabel: { type: String, required: false }
41
49
  });
42
50
  const slots = defineSlots();
43
51
  const slotNames = computed(() => Object.keys(slots));
44
- const emit = defineEmits(["open", "close", "afterLeave"]);
52
+ const emit = defineEmits(["open", "close", "afterLeave", "navigate"]);
45
53
  const open = defineModel("open", { type: Boolean, ...{ default: false } });
54
+ const tab = defineModel("tab", { type: [String, Number] });
46
55
  const frame = useTemplateRef("frame");
47
56
  defineExpose({
48
57
  close: () => frame.value?.close() ?? Promise.resolve(false),
@@ -1,4 +1,5 @@
1
1
  import type { DialogFrameSlots } from '../../internal/overlays/DialogFrame.vue';
2
+ import type { TabItem } from '../layout/types';
2
3
  import type { DialogBeforeClose, DrawerSide, DrawerSize } from './types';
3
4
  type __VLS_Slots = DialogFrameSlots;
4
5
  declare const __VLS_base: import("vue").DefineComponent<{
@@ -13,7 +14,11 @@ declare const __VLS_base: import("vue").DefineComponent<{
13
14
  flush?: boolean;
14
15
  loading?: boolean;
15
16
  beforeClose?: DialogBeforeClose;
17
+ tabs?: TabItem[];
18
+ trail?: string[];
19
+ backLabel?: string;
16
20
  open?: boolean | undefined;
21
+ tab?: TabItem["value"];
17
22
  key?: PropertyKey | undefined;
18
23
  prefix?: "k-modal" | "k-drawer" | undefined;
19
24
  style?: import("vue").StyleValue;
@@ -221,7 +226,9 @@ declare const __VLS_base: import("vue").DefineComponent<{
221
226
  close: () => any;
222
227
  open: () => any;
223
228
  "update:open": (value: boolean) => any;
229
+ navigate: (index: number) => any;
224
230
  afterLeave: () => any;
231
+ "update:tab": (value: string | number | undefined) => any;
225
232
  }, string, import("vue").PublicProps, Readonly<{
226
233
  title?: string | undefined;
227
234
  description?: string;
@@ -234,7 +241,11 @@ declare const __VLS_base: import("vue").DefineComponent<{
234
241
  flush?: boolean;
235
242
  loading?: boolean;
236
243
  beforeClose?: DialogBeforeClose;
244
+ tabs?: TabItem[];
245
+ trail?: string[];
246
+ backLabel?: string;
237
247
  open?: boolean | undefined;
248
+ tab?: TabItem["value"];
238
249
  key?: PropertyKey | undefined;
239
250
  prefix?: "k-modal" | "k-drawer" | undefined;
240
251
  style?: import("vue").StyleValue;
@@ -439,7 +450,9 @@ declare const __VLS_base: import("vue").DefineComponent<{
439
450
  onClose?: (() => any) | undefined;
440
451
  onOpen?: (() => any) | undefined;
441
452
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
453
+ onNavigate?: ((index: number) => any) | undefined;
442
454
  onAfterLeave?: (() => any) | undefined;
455
+ "onUpdate:tab"?: ((value: string | number | undefined) => any) | undefined;
443
456
  }>, {
444
457
  size: DrawerSize;
445
458
  dismissible: boolean;
@@ -14,6 +14,11 @@
14
14
  :flush="flush"
15
15
  :loading="loading"
16
16
  :before-close="beforeClose"
17
+ :tabs="tabs"
18
+ :trail="trail"
19
+ :back-label="backLabel"
20
+ v-model:tab="tab"
21
+ @navigate="(index) => emit('navigate', index)"
17
22
  @open="emit('open')"
18
23
  @close="emit('close')"
19
24
  @after-leave="emit('afterLeave')"
@@ -39,6 +44,9 @@ const props = defineProps({
39
44
  flush: { type: Boolean, required: false },
40
45
  loading: { type: Boolean, required: false },
41
46
  beforeClose: { type: Function, required: false },
47
+ tabs: { type: Array, required: false },
48
+ trail: { type: Array, required: false },
49
+ backLabel: { type: String, required: false },
42
50
  width: { type: String, required: false },
43
51
  minHeight: { type: String, required: false }
44
52
  });
@@ -48,8 +56,9 @@ const sizeStyle = computed(() => ({
48
56
  }));
49
57
  const slots = defineSlots();
50
58
  const slotNames = computed(() => Object.keys(slots));
51
- const emit = defineEmits(["open", "close", "afterLeave"]);
59
+ const emit = defineEmits(["open", "close", "afterLeave", "navigate"]);
52
60
  const open = defineModel("open", { type: Boolean, ...{ default: false } });
61
+ const tab = defineModel("tab", { type: [String, Number] });
53
62
  const frame = useTemplateRef("frame");
54
63
  defineExpose({
55
64
  close: () => frame.value?.close() ?? Promise.resolve(false),
@@ -1,4 +1,5 @@
1
1
  import type { DialogFrameSlots } from '../../internal/overlays/DialogFrame.vue';
2
+ import type { TabItem } from '../layout/types';
2
3
  import type { DialogBeforeClose, ModalSize } from './types';
3
4
  type __VLS_Slots = DialogFrameSlots;
4
5
  declare const __VLS_base: import("vue").DefineComponent<{
@@ -13,9 +14,13 @@ declare const __VLS_base: import("vue").DefineComponent<{
13
14
  flush?: boolean;
14
15
  loading?: boolean;
15
16
  beforeClose?: DialogBeforeClose;
17
+ tabs?: TabItem[];
18
+ trail?: string[];
19
+ backLabel?: string;
16
20
  width?: string;
17
21
  minHeight?: string;
18
22
  open?: boolean | undefined;
23
+ tab?: TabItem["value"];
19
24
  key?: PropertyKey | undefined;
20
25
  prefix?: "k-modal" | "k-drawer" | undefined;
21
26
  style?: import("vue").StyleValue;
@@ -223,7 +228,9 @@ declare const __VLS_base: import("vue").DefineComponent<{
223
228
  close: () => any;
224
229
  open: () => any;
225
230
  "update:open": (value: boolean) => any;
231
+ navigate: (index: number) => any;
226
232
  afterLeave: () => any;
233
+ "update:tab": (value: string | number | undefined) => any;
227
234
  }, string, import("vue").PublicProps, Readonly<{
228
235
  title?: string | undefined;
229
236
  description?: string;
@@ -236,9 +243,13 @@ declare const __VLS_base: import("vue").DefineComponent<{
236
243
  flush?: boolean;
237
244
  loading?: boolean;
238
245
  beforeClose?: DialogBeforeClose;
246
+ tabs?: TabItem[];
247
+ trail?: string[];
248
+ backLabel?: string;
239
249
  width?: string;
240
250
  minHeight?: string;
241
251
  open?: boolean | undefined;
252
+ tab?: TabItem["value"];
242
253
  key?: PropertyKey | undefined;
243
254
  prefix?: "k-modal" | "k-drawer" | undefined;
244
255
  style?: import("vue").StyleValue;
@@ -443,7 +454,9 @@ declare const __VLS_base: import("vue").DefineComponent<{
443
454
  onClose?: (() => any) | undefined;
444
455
  onOpen?: (() => any) | undefined;
445
456
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
457
+ onNavigate?: ((index: number) => any) | undefined;
446
458
  onAfterLeave?: (() => any) | undefined;
459
+ "onUpdate:tab"?: ((value: string | number | undefined) => any) | undefined;
447
460
  }>, {
448
461
  size: ModalSize;
449
462
  dismissible: boolean;
@@ -44,6 +44,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
44
44
  loading?: boolean;
45
45
  prefix?: "k-modal" | "k-drawer" | undefined;
46
46
  size?: import("../overlays/types").ModalSize;
47
+ tabs?: import("../layout/types.ts").TabItem[];
47
48
  label?: string;
48
49
  style?: import("vue").StyleValue;
49
50
  results?: (string | number) | undefined;
@@ -245,9 +246,13 @@ declare const __VLS_base: import("vue").DefineComponent<{
245
246
  onVnodeBeforeUnmount?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
246
247
  onVnodeUnmounted?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
247
248
  sheet?: boolean;
249
+ tab?: import("../layout/types.ts").TabItem["value"];
248
250
  onCancel?: ((payload: Event) => void) | undefined;
251
+ trail?: string[];
252
+ onNavigate?: ((index: number) => any) | undefined;
249
253
  rootClass?: unknown;
250
254
  hideClose?: boolean;
255
+ "onUpdate:tab"?: ((value: string | number | undefined) => any) | undefined;
251
256
  closedby?: import("../../index.ts").DialogClosedBy;
252
257
  minHeight?: string;
253
258
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -290,6 +295,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
290
295
  loading?: boolean;
291
296
  prefix?: "k-modal" | "k-drawer" | undefined;
292
297
  size?: import("../overlays/types").ModalSize;
298
+ tabs?: import("../layout/types.ts").TabItem[];
293
299
  label?: string;
294
300
  style?: import("vue").StyleValue;
295
301
  results?: (string | number) | undefined;
@@ -491,9 +497,13 @@ declare const __VLS_base: import("vue").DefineComponent<{
491
497
  onVnodeBeforeUnmount?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
492
498
  onVnodeUnmounted?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
493
499
  sheet?: boolean;
500
+ tab?: import("../layout/types.ts").TabItem["value"];
494
501
  onCancel?: ((payload: Event) => void) | undefined;
502
+ trail?: string[];
503
+ onNavigate?: ((index: number) => any) | undefined;
495
504
  rootClass?: unknown;
496
505
  hideClose?: boolean;
506
+ "onUpdate:tab"?: ((value: string | number | undefined) => any) | undefined;
497
507
  closedby?: import("../../index.ts").DialogClosedBy;
498
508
  minHeight?: string;
499
509
  }> & Readonly<{
@@ -12,7 +12,7 @@
12
12
  @click="onClick"
13
13
  >
14
14
  <div v-if="present" ref="panelRef" :class="`${prefix}-panel`" tabindex="-1">
15
- <header v-if="hasHeader" :class="`${prefix}-header`">
15
+ <header v-if="hasHeader" :class="[`${prefix}-header`, { 'has-tabs': hasTabs }]">
16
16
  <div v-if="slots.header" :id="headerId" class="k-dialog-header-slot">
17
17
  <slot
18
18
  name="header"
@@ -24,20 +24,35 @@
24
24
  <template v-else>
25
25
  <div :class="`${prefix}-heading`">
26
26
  <div v-if="slots['title-trailing']" :class="`${prefix}-title-row`">
27
- <h2 v-if="hasTitle" :id="titleId" :class="`${prefix}-title`">
28
- <slot name="title">{{ title }}</slot>
27
+ <h2 v-if="hasTitle" :id="titleId" :class="titleClass">
28
+ <DialogTrail :trail="trail" @navigate="navigate">
29
+ <slot name="title">{{ title }}</slot>
30
+ </DialogTrail>
29
31
  </h2>
30
32
  <slot name="title-trailing" />
31
33
  </div>
32
- <h2 v-else-if="hasTitle" :id="titleId" :class="`${prefix}-title`">
33
- <slot name="title">{{ title }}</slot>
34
+ <h2 v-else-if="hasTitle" :id="titleId" :class="titleClass">
35
+ <DialogTrail :trail="trail" @navigate="navigate">
36
+ <slot name="title">{{ title }}</slot>
37
+ </DialogTrail>
34
38
  </h2>
35
39
  <p v-if="hasDescription" :id="descriptionId" :class="`${prefix}-description`">
36
40
  <slot name="description">{{ description }}</slot>
37
41
  </p>
38
42
  </div>
39
43
  </template>
40
- <div v-if="$slots.actions || showClose" :class="`${prefix}-actions`">
44
+ <div v-if="$slots.actions || showClose || hasTrail" :class="`${prefix}-actions`">
45
+ <Button
46
+ v-if="hasTrail"
47
+ variant="ghost"
48
+ tone="neutral"
49
+ size="sm"
50
+ icon="arrow-left"
51
+ :disabled="loading"
52
+ @click="navigate(trail.length - 1)"
53
+ >
54
+ {{ backText }}
55
+ </Button>
41
56
  <slot name="actions" :close="close" />
42
57
  <Button
43
58
  v-if="showClose"
@@ -51,9 +66,22 @@
51
66
  @click="requestClose('close-button')"
52
67
  />
53
68
  </div>
69
+ <Tabs
70
+ v-if="hasTabs"
71
+ v-model="tab"
72
+ :items="tabs"
73
+ :controls="panelId"
74
+ :label="label ?? title"
75
+ variant="underline"
76
+ size="sm"
77
+ :class="`${prefix}-tabs`"
78
+ />
54
79
  </header>
55
80
  <div
81
+ :id="hasTabs ? panelId : void 0"
56
82
  ref="bodyRef"
83
+ :role="hasTabs ? 'tabpanel' : void 0"
84
+ :aria-label="hasTabs ? activeTabItem?.label : void 0"
57
85
  :class="[
58
86
  `${prefix}-body`,
59
87
  {
@@ -63,7 +91,7 @@
63
91
  }
64
92
  ]"
65
93
  >
66
- <slot :close="close" :title-id="labelledBy ?? titleId" />
94
+ <slot :close="close" :title-id="labelledBy ?? titleId" :tab="activeTab" />
67
95
  </div>
68
96
  <footer v-if="$slots.footer" :class="`${prefix}-footer`">
69
97
  <slot name="footer" :close="close" />
@@ -75,6 +103,8 @@
75
103
  <script setup>
76
104
  import { computed, nextTick, ref, useAttrs, useId, useTemplateRef, warn, watch } from "vue";
77
105
  import Button from "../../components/core/Button.vue";
106
+ import Tabs from "../../components/layout/Tabs.vue";
107
+ import DialogTrail from "./DialogTrail.vue";
78
108
  import { useLocale } from "../../composables/useLocale";
79
109
  import { provideFieldBoundary } from "../../composables/useFieldBoundary";
80
110
  import { useScrollEdges } from "../core/scroll-edges";
@@ -91,23 +121,37 @@ const props = defineProps({
91
121
  closeLabel: { type: String, required: false },
92
122
  flush: { type: Boolean, required: false },
93
123
  loading: { type: Boolean, required: false },
94
- beforeClose: { type: Function, required: false }
124
+ beforeClose: { type: Function, required: false },
125
+ tabs: { type: Array, required: false },
126
+ trail: { type: Array, required: false },
127
+ backLabel: { type: String, required: false }
95
128
  });
96
129
  provideFieldBoundary();
97
130
  const { t } = useLocale();
98
131
  const closeText = computed(() => props.closeLabel ?? t("common.close"));
132
+ const backText = computed(() => props.backLabel ?? t("common.back"));
99
133
  const slots = defineSlots();
100
- const emit = defineEmits(["open", "close", "afterLeave"]);
134
+ const emit = defineEmits(["open", "close", "afterLeave", "navigate"]);
101
135
  const open = defineModel("open", { type: Boolean, ...{ required: true } });
136
+ const tab = defineModel("tab", { type: [String, Number] });
102
137
  const baseId = useId();
103
138
  const titleId = `${baseId}-title`;
104
139
  const descriptionId = `${baseId}-description`;
105
140
  const headerId = `${baseId}-header`;
141
+ const panelId = `${baseId}-panel`;
106
142
  const dialogRef = useTemplateRef("dialogRef");
107
143
  const panelRef = useTemplateRef("panelRef");
108
144
  const bodyRef = useTemplateRef("bodyRef");
109
145
  const { overflowTop, overflowBottom } = useScrollEdges(() => bodyRef.value);
110
- const hasTitle = computed(() => Boolean(props.title || slots.title));
146
+ const hasTrail = computed(() => Boolean(props.trail?.length));
147
+ const hasTabs = computed(() => Boolean(props.tabs?.length));
148
+ const hasTitle = computed(() => Boolean(props.title || slots.title || hasTrail.value));
149
+ const titleClass = computed(() => [`${props.prefix}-title`, { "has-trail": hasTrail.value }]);
150
+ const activeTabItem = computed(() => {
151
+ const items = props.tabs ?? [];
152
+ return items.find((item) => item.value === tab.value) ?? items.find((item) => !item.disabled);
153
+ });
154
+ const activeTab = computed(() => activeTabItem.value?.value);
111
155
  const hasDescription = computed(() => Boolean(props.description || slots.description));
112
156
  const headerTitled = ref(false);
113
157
  const labelledBy = computed(() => {
@@ -125,7 +169,7 @@ watch(open, (value) => {
125
169
  const showClose = computed(() => props.dismissible && !props.hideClose);
126
170
  const hasHeader = computed(
127
171
  () => Boolean(
128
- hasTitle.value || hasDescription.value || slots["title-trailing"] || slots.header || slots.actions || showClose.value
172
+ hasTitle.value || hasDescription.value || slots["title-trailing"] || slots.header || slots.actions || showClose.value || hasTrail.value || hasTabs.value
129
173
  )
130
174
  );
131
175
  const { present, requestClose, onCancel, onClose, onPointerDown, onClick } = useModalDialog({
@@ -138,6 +182,16 @@ const { present, requestClose, onCancel, onClose, onPointerDown, onClick } = use
138
182
  onClose: () => emit("close"),
139
183
  onAfterLeave: () => emit("afterLeave")
140
184
  });
185
+ function navigate(index) {
186
+ if (props.loading) return;
187
+ emit("navigate", index);
188
+ }
189
+ watch(
190
+ () => [activeTab.value, props.trail?.length],
191
+ () => {
192
+ if (bodyRef.value) bodyRef.value.scrollTop = 0;
193
+ }
194
+ );
141
195
  function close() {
142
196
  if (props.loading) return Promise.resolve(false);
143
197
  return requestClose("action");
@@ -1,3 +1,4 @@
1
+ import type { TabItem } from '../../components/layout/types';
1
2
  import type { DialogBeforeClose } from '../../components/overlays/types';
2
3
  export interface DialogSlotScope {
3
4
  close: () => void;
@@ -8,6 +9,7 @@ export interface DialogFrameSlots {
8
9
  default?: (props: {
9
10
  close: () => void;
10
11
  titleId: string;
12
+ tab?: TabItem['value'];
11
13
  }) => unknown;
12
14
  header?: (props: DialogSlotScope) => unknown;
13
15
  title?: () => unknown;
@@ -34,7 +36,11 @@ declare const __VLS_base: import("vue").DefineComponent<{
34
36
  flush?: boolean;
35
37
  loading?: boolean;
36
38
  beforeClose?: DialogBeforeClose;
39
+ tabs?: TabItem[];
40
+ trail?: string[];
41
+ backLabel?: string;
37
42
  open: boolean;
43
+ tab?: TabItem["value"];
38
44
  key?: PropertyKey | undefined;
39
45
  style?: import("vue").StyleValue;
40
46
  results?: (string | number) | undefined;
@@ -234,7 +240,9 @@ declare const __VLS_base: import("vue").DefineComponent<{
234
240
  close: () => any;
235
241
  open: () => any;
236
242
  "update:open": (value: boolean) => any;
243
+ navigate: (index: number) => any;
237
244
  afterLeave: () => any;
245
+ "update:tab": (value: string | number | undefined) => any;
238
246
  }, string, import("vue").PublicProps, Readonly<{
239
247
  prefix: "k-modal" | "k-drawer";
240
248
  rootClass: unknown;
@@ -247,7 +255,11 @@ declare const __VLS_base: import("vue").DefineComponent<{
247
255
  flush?: boolean;
248
256
  loading?: boolean;
249
257
  beforeClose?: DialogBeforeClose;
258
+ tabs?: TabItem[];
259
+ trail?: string[];
260
+ backLabel?: string;
250
261
  open: boolean;
262
+ tab?: TabItem["value"];
251
263
  key?: PropertyKey | undefined;
252
264
  style?: import("vue").StyleValue;
253
265
  results?: (string | number) | undefined;
@@ -444,7 +456,9 @@ declare const __VLS_base: import("vue").DefineComponent<{
444
456
  onClose?: (() => any) | undefined;
445
457
  onOpen?: (() => any) | undefined;
446
458
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
459
+ onNavigate?: ((index: number) => any) | undefined;
447
460
  onAfterLeave?: (() => any) | undefined;
461
+ "onUpdate:tab"?: ((value: string | number | undefined) => any) | undefined;
448
462
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
449
463
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
450
464
  declare const _default: typeof __VLS_export;
@@ -0,0 +1,20 @@
1
+ <template>
2
+ <template v-if="trail?.length">
3
+ <template v-for="(crumb, index) in trail" :key="index">
4
+ <button type="button" class="k-dialog-crumb" @click="emit('navigate', index)">
5
+ {{ crumb }}
6
+ </button>
7
+ <Icon name="chevron-right" class="k-dialog-crumb-separator" />
8
+ </template>
9
+ <span class="k-dialog-crumb is-current"><slot /></span>
10
+ </template>
11
+ <slot v-else />
12
+ </template>
13
+
14
+ <script setup>
15
+ import Icon from "../../components/core/Icon.vue";
16
+ defineProps({
17
+ trail: { type: Array, required: false }
18
+ });
19
+ const emit = defineEmits(["navigate"]);
20
+ </script>
@@ -0,0 +1,22 @@
1
+ type __VLS_Props = {
2
+ trail?: string[];
3
+ };
4
+ declare var __VLS_7: {}, __VLS_9: {};
5
+ type __VLS_Slots = {} & {
6
+ default?: (props: typeof __VLS_7) => any;
7
+ } & {
8
+ default?: (props: typeof __VLS_9) => any;
9
+ };
10
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
+ navigate: (index: number) => any;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
13
+ onNavigate?: ((index: number) => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
18
+ type __VLS_WithSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -5,6 +5,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
5
5
  loading?: boolean;
6
6
  prefix?: "k-modal" | "k-drawer" | undefined;
7
7
  size?: "sm" | "md" | "lg" | "xl" | "full" | undefined;
8
+ tabs?: import("../../index.ts").TabItem[];
8
9
  label?: string;
9
10
  title?: string | undefined;
10
11
  style?: import("vue").StyleValue;
@@ -209,13 +210,18 @@ declare const __VLS_export: import("vue").DefineComponent<{
209
210
  onVnodeBeforeUnmount?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
210
211
  onVnodeUnmounted?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
211
212
  sheet?: boolean;
213
+ tab?: import("../../index.ts").TabItem["value"];
212
214
  onCancel?: ((payload: Event) => void) | undefined;
213
215
  side?: import("../../index.ts").DrawerSide;
214
216
  onOpen?: ((() => any) & (() => any)) | undefined;
215
217
  closeLabel?: string;
218
+ trail?: string[];
219
+ onNavigate?: (((index: number) => any) & ((index: number) => any)) | undefined;
216
220
  rootClass?: unknown;
217
221
  hideClose?: boolean;
218
222
  beforeClose?: import("../../index.ts").DialogBeforeClose;
223
+ backLabel?: string;
224
+ "onUpdate:tab"?: (((value: string | number | undefined) => any) & ((value: string | number | undefined) => any)) | undefined;
219
225
  closedby?: import("../../index.ts").DialogClosedBy;
220
226
  minHeight?: string;
221
227
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -228,6 +234,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
228
234
  loading?: boolean;
229
235
  prefix?: "k-modal" | "k-drawer" | undefined;
230
236
  size?: "sm" | "md" | "lg" | "xl" | "full" | undefined;
237
+ tabs?: import("../../index.ts").TabItem[];
231
238
  label?: string;
232
239
  title?: string | undefined;
233
240
  style?: import("vue").StyleValue;
@@ -432,13 +439,18 @@ declare const __VLS_export: import("vue").DefineComponent<{
432
439
  onVnodeBeforeUnmount?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
433
440
  onVnodeUnmounted?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
434
441
  sheet?: boolean;
442
+ tab?: import("../../index.ts").TabItem["value"];
435
443
  onCancel?: ((payload: Event) => void) | undefined;
436
444
  side?: import("../../index.ts").DrawerSide;
437
445
  onOpen?: ((() => any) & (() => any)) | undefined;
438
446
  closeLabel?: string;
447
+ trail?: string[];
448
+ onNavigate?: (((index: number) => any) & ((index: number) => any)) | undefined;
439
449
  rootClass?: unknown;
440
450
  hideClose?: boolean;
441
451
  beforeClose?: import("../../index.ts").DialogBeforeClose;
452
+ backLabel?: string;
453
+ "onUpdate:tab"?: (((value: string | number | undefined) => any) & ((value: string | number | undefined) => any)) | undefined;
442
454
  closedby?: import("../../index.ts").DialogClosedBy;
443
455
  minHeight?: string;
444
456
  }> & Readonly<{
@@ -191,6 +191,77 @@
191
191
  letter-spacing: -0.015em;
192
192
  }
193
193
 
194
+ .k-modal-title.has-trail,
195
+ .k-drawer-title.has-trail {
196
+ display: flex;
197
+ flex-wrap: wrap;
198
+ align-items: center;
199
+ gap: 0.25rem;
200
+ }
201
+
202
+ .k-dialog-crumb {
203
+ padding: 0;
204
+ font: inherit;
205
+ letter-spacing: inherit;
206
+ color: var(--k-text-muted);
207
+ background: none;
208
+ border: 0;
209
+ border-radius: var(--k-radius-xs);
210
+ cursor: pointer;
211
+ transition: color var(--k-duration) var(--k-ease);
212
+ }
213
+
214
+ .k-dialog-crumb:hover {
215
+ color: var(--k-text);
216
+ }
217
+
218
+ .k-dialog-crumb:focus-visible {
219
+ outline: 2px solid var(--k-ring);
220
+ outline-offset: 2px;
221
+ }
222
+
223
+ .k-dialog-crumb.is-current {
224
+ color: var(--k-text);
225
+ cursor: default;
226
+ }
227
+
228
+ .k-dialog-crumb-separator {
229
+ --k-icon-size: 0.875rem;
230
+ color: var(--k-text-dimmed);
231
+ }
232
+
233
+ .k-modal-header.has-tabs,
234
+ .k-drawer-header.has-tabs {
235
+ flex-wrap: wrap;
236
+ row-gap: 0.5rem;
237
+ padding-bottom: 0;
238
+ }
239
+
240
+ .k-modal-tabs,
241
+ .k-drawer-tabs {
242
+ flex: 1 0 100%;
243
+ margin-inline: calc(-1 * var(--k-dialog-header-start)) calc(-1 * var(--k-dialog-header-end));
244
+ }
245
+
246
+ :is(.k-modal-tabs, .k-drawer-tabs) > .k-tabs-list {
247
+ padding-inline: calc(var(--k-dialog-header-start) - 0.5rem) var(--k-dialog-header-end);
248
+ }
249
+
250
+ .k-modal-header {
251
+ --k-dialog-header-start: 1.25rem;
252
+ --k-dialog-header-end: 1rem;
253
+ }
254
+
255
+ .k-drawer-header {
256
+ --k-dialog-header-start: 1.5rem;
257
+ --k-dialog-header-end: 0.75rem;
258
+ }
259
+
260
+ .k-modal-header.has-tabs + .k-modal-body,
261
+ .k-drawer-header.has-tabs + .k-drawer-body {
262
+ border-top: 0;
263
+ }
264
+
194
265
  .k-modal-description,
195
266
  .k-drawer-description {
196
267
  font-size: 0.8125rem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xleddyl/443-components-vue",
3
- "version": "0.16.8",
3
+ "version": "0.16.10",
4
4
  "description": "Compact, scoped dashboard components for Vue and Nuxt",
5
5
  "license": "MIT",
6
6
  "author": "Edoardo Alberti (https://github.com/xleddyl)",