@xleddyl/443-components-vue 0.16.85 → 0.16.87

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
@@ -194,21 +194,21 @@ All field components work inside `FormField` and take `invalid`, `disabled`, `re
194
194
 
195
195
  Mount `OverlayHost` once for the imperative hooks (see [Composables](#composables)).
196
196
 
197
- | Component | Purpose and when to use it | Main props, models, slots, events | Playground |
198
- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
199
- | `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`, `height` (fixed, capped at the viewport), `dismissible`, `hideClose`, `sheet`, `flush`, `fill`, `loading`, `beforeClose(reason)`, `tabs` (tabs in the header), `trail` (breadcrumb title and back button; a long trail stays on one line, the middle crumbs collapse into a "..." menu and the current title truncates), `backLabel`, `guard` (default `true`: closing, or a trail navigation, with a dirty `Form` inside asks to discard first; `beforeClose` runs after), `guardTitle`, `guardMessage`. Slots: default (`{ tab }`), `header`, `actions` (header, before the close button), `footer`, `title-trailing`. Events: `open`, `close`, `afterLeave`, `navigate(index)`. Exposes `close()`, `confirmLeave()`, `dirty`. | `overlays/modal.vue` |
200
- | `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`, `fill` (the body content takes the full height, for a table or a grid), `loading`, `beforeClose(reason)`, `tabs`, `trail`, `backLabel`, `guard`, `guardTitle`, `guardMessage` (as `Modal`). Slots like `Modal`. Events: `open`, `close`, `afterLeave`, `navigate(index)`. Exposes `close()`, `confirmLeave()`, `dirty`. | `overlays/drawer.vue` |
201
- | `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` |
202
- | `ConfirmHost` | Renders the dialogs of `useConfirm`, `useAlert`, `usePrompt`. `OverlayHost` includes it. Do not mount it alone. | None. | - |
203
- | `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` |
204
- | `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` |
205
- | `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`, `color` (palette name or hex dot, or `muted` for a grey dot of an empty state), `to`, `href`, `tone: danger`, `shortcut`, `disabled`, `disabledReason` (with `disabled`: a tooltip on hover and keyboard focus, linked with `aria-describedby`; the item stays reachable but not selectable), `children`, `onSelect`; also `type`: checkbox, radio, label, separator), `placement`, `offset`, `matchTriggerWidth`, `minWidth`. Slot: default (the trigger). Event: `select`. | `overlays/dropdown-menu.vue` |
206
- | `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` |
207
- | `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` |
208
- | `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` |
209
- | `Tooltip` | Short text on hover or focus. Optional shortcut. `Button` already shows one for icon-only buttons, `tooltip` and `disabledReason`. | Props: `text`, `placement`, `openDelay`, `closeDelay`, `arrow`, `shortcut`, `disabled`. Slots: default (trigger), `content`. | `overlays/tooltip.vue` |
210
- | `CommandPalette` | Search and command dialog (Cmd+K) with groups, recent items, async search and typed item data. Groups take `icon` (default item icon) and `more` (a last "show all" item). Matching (`matchesSearch`, exported) finds every word in any order, without case or accents. | Models: `v-model:open`, `v-model:query`. Props: `groups` (items with `id`, `label`, `description`, `icon`, `badge`, `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` |
211
- | `CommandButton` | A `Button` made from a `CommandItem`: label, icon, `to`, `href`, `disabled`, `disabledReason` (tooltip on the disabled button) and `onSelect` come from the command. | Props: `command`, `label`, `icon`, `iconOnly` (a square button with the icon only, the label as `aria-label` and tooltip), and every `Button` prop (size, variant, tone). | `overlays/command-palette.vue` |
197
+ | Component | Purpose and when to use it | Main props, models, slots, events | Playground |
198
+ | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
199
+ | `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`, `height` (fixed, capped at the viewport), `dismissible`, `hideClose`, `sheet`, `flush`, `fill`, `loading`, `beforeClose(reason)`, `tabs` (tabs in the header), `trail` (breadcrumb title and back button; a long trail stays on one line, the middle crumbs collapse into a "..." menu and the current title truncates), `backLabel`, `guard` (default `true`: closing, or a trail navigation, with a dirty `Form` inside asks to discard first; `beforeClose` runs after), `guardTitle`, `guardMessage`. Slots: default (`{ tab }`), `header`, `actions` (header, before the close button), `toolbar` (a full width row of controls under the title and the description, such as filters), `footer`, `title-trailing`. Events: `open`, `close`, `afterLeave`, `navigate(index)`. Exposes `close()`, `confirmLeave()`, `dirty`. | `overlays/modal.vue` |
200
+ | `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`, `fill` (the body content takes the full height, for a table or a grid), `loading`, `beforeClose(reason)`, `tabs`, `trail`, `backLabel`, `guard`, `guardTitle`, `guardMessage` (as `Modal`). Slots like `Modal`. Events: `open`, `close`, `afterLeave`, `navigate(index)`. Exposes `close()`, `confirmLeave()`, `dirty`. | `overlays/drawer.vue` |
201
+ | `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` |
202
+ | `ConfirmHost` | Renders the dialogs of `useConfirm`, `useAlert`, `usePrompt`. `OverlayHost` includes it. Do not mount it alone. | None. | - |
203
+ | `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` |
204
+ | `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` |
205
+ | `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`, `color` (palette name or hex dot, or `muted` for a grey dot of an empty state), `to`, `href`, `tone: danger`, `shortcut`, `disabled`, `disabledReason` (with `disabled`: a tooltip on hover and keyboard focus, linked with `aria-describedby`; the item stays reachable but not selectable), `children`, `onSelect`; also `type`: checkbox, radio, label, separator), `placement`, `offset`, `matchTriggerWidth`, `minWidth`. Slot: default (the trigger). Event: `select`. | `overlays/dropdown-menu.vue` |
206
+ | `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` |
207
+ | `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` |
208
+ | `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` |
209
+ | `Tooltip` | Short text on hover or focus. Optional shortcut. `Button` already shows one for icon-only buttons, `tooltip` and `disabledReason`. | Props: `text`, `placement`, `openDelay`, `closeDelay`, `arrow`, `shortcut`, `disabled`. Slots: default (trigger), `content`. | `overlays/tooltip.vue` |
210
+ | `CommandPalette` | Search and command dialog (Cmd+K) with groups, recent items, async search and typed item data. Groups take `icon` (default item icon) and `more` (a last "show all" item). Matching (`matchesSearch`, exported) finds every word in any order, without case or accents. | Models: `v-model:open`, `v-model:query`. Props: `groups` (items with `id`, `label`, `description`, `icon`, `badge`, `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` |
211
+ | `CommandButton` | A `Button` made from a `CommandItem`: label, icon, `to`, `href`, `disabled`, `disabledReason` (tooltip on the disabled button) and `onSelect` come from the command. | Props: `command`, `label`, `icon`, `iconOnly` (a square button with the icon only, the label as `aria-label` and tooltip), and every `Button` prop (size, variant, tone). | `overlays/command-palette.vue` |
212
212
 
213
213
  ## Data
214
214
 
package/README.md CHANGED
@@ -520,7 +520,7 @@ On your own elements, `paletteClass(color)` gives the class of a palette name an
520
520
  - `FilterPills` can list active filters: options with `removable: true` render as active pills with a remove button (`removeLabel`, a `'Remove {label}'` template). Clicking the pill emits `select(value)`, the button emits `remove(value)` (and drops the value from the model when it is selected); focus moves to the next pill when the removed one disappears.
521
521
  - `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.
522
522
  - `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.
523
- - `Modal` takes `width` (any CSS length, overrides `size`), `minHeight` (keeps the height steady while tabs or steps change) and `height` (a fixed height, capped at the viewport: every tab or step has the same size and the body scrolls). 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).
523
+ - `Modal` takes `width` (any CSS length, overrides `size`), `minHeight` (keeps the height steady while tabs or steps change) and `height` (a fixed height, capped at the viewport: every tab or step has the same size and the body scrolls). The `#toolbar` slot of `Modal` and `Drawer` renders a full width row of controls in the header, under the title and the description (search, filters, a preset select): it stays fixed while the body scrolls. 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).
524
524
  - `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.
525
525
 
526
526
  ```vue
@@ -12,7 +12,10 @@
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`, { 'has-tabs': hasTabs }]">
15
+ <header
16
+ v-if="hasHeader"
17
+ :class="[`${prefix}-header`, { 'has-tabs': hasTabs, 'has-toolbar': !!slots.toolbar }]"
18
+ >
16
19
  <div v-if="slots.header" :id="headerId" class="k-dialog-header-slot">
17
20
  <slot
18
21
  name="header"
@@ -66,6 +69,9 @@
66
69
  @click="requestClose('close-button')"
67
70
  />
68
71
  </div>
72
+ <div v-if="slots.toolbar" :class="`${prefix}-toolbar`">
73
+ <slot name="toolbar" />
74
+ </div>
69
75
  <Tabs
70
76
  v-if="hasTabs"
71
77
  v-model="tab"
@@ -202,7 +208,7 @@ watch(open, (value) => {
202
208
  const showClose = computed(() => props.dismissible && !props.hideClose);
203
209
  const hasHeader = computed(
204
210
  () => Boolean(
205
- hasTitle.value || hasDescription.value || slots["title-trailing"] || slots.header || slots.actions || showClose.value || hasTrail.value || hasTabs.value
211
+ hasTitle.value || hasDescription.value || slots["title-trailing"] || slots.header || slots.actions || slots.toolbar || showClose.value || hasTrail.value || hasTabs.value
206
212
  )
207
213
  );
208
214
  const { present, requestClose, onCancel, onClose, onPointerDown, onClick } = useModalDialog({
@@ -18,6 +18,7 @@ export interface DialogFrameSlots {
18
18
  actions?: (props: {
19
19
  close: () => void;
20
20
  }) => unknown;
21
+ toolbar?: () => unknown;
21
22
  footer?: (props: {
22
23
  close: () => void;
23
24
  }) => unknown;
@@ -147,3 +147,7 @@
147
147
  .k-segmented-item.is-muted:not([aria-checked='true']) > .k-icon {
148
148
  opacity: 0.7;
149
149
  }
150
+
151
+ .k-form-field > .k-segmented:not(.is-block) {
152
+ align-self: flex-start;
153
+ }
@@ -243,6 +243,22 @@
243
243
  color: var(--k-text-dimmed);
244
244
  }
245
245
 
246
+ .k-modal-header.has-toolbar,
247
+ .k-drawer-header.has-toolbar {
248
+ flex-wrap: wrap;
249
+ row-gap: 0.75rem;
250
+ }
251
+
252
+ .k-modal-toolbar,
253
+ .k-drawer-toolbar {
254
+ display: flex;
255
+ flex: 1 0 100%;
256
+ flex-wrap: wrap;
257
+ align-items: center;
258
+ gap: 0.75rem;
259
+ min-width: 0;
260
+ }
261
+
246
262
  .k-modal-header.has-tabs,
247
263
  .k-drawer-header.has-tabs {
248
264
  flex-wrap: wrap;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xleddyl/443-components-vue",
3
- "version": "0.16.85",
3
+ "version": "0.16.87",
4
4
  "description": "Compact, scoped dashboard components for Vue and Nuxt",
5
5
  "license": "MIT",
6
6
  "author": "Edoardo Alberti (https://github.com/xleddyl)",