@xleddyl/443-components-vue 0.16.21 → 0.16.23
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 +3 -3
- package/dist/components/data/RecordList.vue +4 -3
- package/dist/components/data/RecordList.vue.d.ts +1 -0
- package/dist/components/overlays/types.d.ts +2 -1
- package/dist/internal/overlays/MenuList.vue +7 -0
- package/dist/styles/templates/form-drawer.css +1 -1
- package/dist/styles/utilities.css +9 -0
- package/package.json +1 -1
package/CATALOG.md
CHANGED
|
@@ -195,7 +195,7 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
|
|
|
195
195
|
| `ConfirmHost` | Renders the dialogs of `useConfirm`, `useAlert`, `usePrompt`. `OverlayHost` includes it. Do not mount it alone. | None. | - |
|
|
196
196
|
| `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` |
|
|
197
197
|
| `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` |
|
|
198
|
-
| `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`.
|
|
198
|
+
| `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 dot), `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` |
|
|
199
199
|
| `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` |
|
|
200
200
|
| `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` |
|
|
201
201
|
| `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` |
|
|
@@ -218,7 +218,7 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
|
|
|
218
218
|
| `Avatar` | User picture with initials fallback and status dot. | Props: `src`, `name`, `alt`, `size` (xs to xl), `shape` (circle, square), `status` (online, away, busy, offline), `decorative`. Slot: `fallback`. | `data/avatar.vue` |
|
|
219
219
|
| `AvatarGroup` | Overlapping stack of avatars with "+N". | Props: `items` (`src`, `name`, `alt`), `max`, `size`, `shape`, `moreLabel`. | `data/avatar.vue` |
|
|
220
220
|
| `Stat` | Key figure (KPI) with unit, delta, trend, hint and optional sparkline. Can be a link. | Props: `label`, `value`, `unit`, `delta`, `trend` (up, down, flat), `invert` (down is good), `hint`, `icon`, `loading`, `to`, `href`, `plain`. Slots: `label`, `value`, `icon`, `sparkline`, `footer`. | `data/stat.vue` |
|
|
221
|
-
| `RecordList` | Short list of records (settings, users, tokens): title, badge, description, leading and action slots, `SkeletonList` while `loading`, empty state. | Props: `items` (`RecordListItem`: `id`, `title`, `description`, `badge` `{ label, tone }`), `loading`, `avatar`, `action`, `label`, `skeletonRows`, `emptyText`, `emptyDescription`, `emptyIcon
|
|
221
|
+
| `RecordList` | Short list of records (settings, users, tokens): title, badge, description, leading and action slots, `SkeletonList` while `loading`, empty state. | Props: `items` (`RecordListItem`: `id`, `title`, `description`, `badge` `{ label, tone }`), `loading`, `avatar`, `action`, `label`, `skeletonRows`, `emptyText`, `emptyDescription`, `emptyIcon`, `emptyVariant` (card, the default, or plain). Slots: `leading`, `action` (`{ item }`), `empty`. | `data/record-list.vue` |
|
|
222
222
|
| `DescriptionList` | Label and value pairs for a record. Use it on detail views. | Props: `items` (`key`, `label`, `value`, `hint`), `layout` (stacked, inline, grid), `columns`, `divided`, `emptyText`. Slots: `term`, `value`, `value-<key>`. | `data/description-list.vue` |
|
|
223
223
|
| `Timeline` | Vertical list of events or activity. | Props: `items` (`title`, `description`, `time`, `datetime`, `icon`, `tone`), `compact`. Slot: `item`. | `data/timeline.vue` |
|
|
224
224
|
| `Tree` | Expandable hierarchy with selection, drag to reorder and nesting. | Models: `v-model:expanded`, `v-model:selected`. Props: `nodes` (`id`, `label`, `description`, `meta`, `icon`, `children`, `disabled`), `selectable`, `reorderable`, `nestable`, `moveButtons` (default `true`; `false` hides the row arrows, drag and Alt+arrow keys still work), `canDrop`, `size`, `checkmark`, `emptyText`. Slots: `label`, `meta`, `empty`. Events: `select`, `move`. | `data/tree.vue` |
|
|
@@ -321,7 +321,7 @@ Chart helpers: `useChartColors`, `readChartColors`, `withAlpha`, `registerChartM
|
|
|
321
321
|
|
|
322
322
|
## Palette
|
|
323
323
|
|
|
324
|
-
`PALETTE_COLORS` is a categorical palette of 12 colors (`--k-palette-<name>` tokens, light and dark). `paletteColor(key)` gives a stable color for a string, `paletteClass(color)` the class that sets `--k-palette` and `--k-palette-text` on your own elements.
|
|
324
|
+
`PALETTE_COLORS` is a categorical palette of 12 colors (`--k-palette-<name>` tokens, light and dark). `paletteColor(key)` gives a stable color for a string, `paletteClass(color)` the class that sets `--k-palette` and `--k-palette-text` on your own elements. `k-palette-dot` with that class draws a small dot of the color.
|
|
325
325
|
|
|
326
326
|
## Composables
|
|
327
327
|
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
:icon="emptyIcon"
|
|
28
28
|
:title="emptyText ?? t('common.empty')"
|
|
29
29
|
:description="emptyDescription"
|
|
30
|
-
size="sm"
|
|
31
|
-
variant="
|
|
30
|
+
:size="emptyVariant === 'plain' ? 'sm' : 'md'"
|
|
31
|
+
:variant="emptyVariant"
|
|
32
32
|
:level="3"
|
|
33
33
|
/>
|
|
34
34
|
</slot>
|
|
@@ -48,7 +48,8 @@ defineProps({
|
|
|
48
48
|
skeletonRows: { type: Number, required: false, default: 3 },
|
|
49
49
|
emptyText: { type: String, required: false },
|
|
50
50
|
emptyDescription: { type: String, required: false },
|
|
51
|
-
emptyIcon: { type: null, required: false }
|
|
51
|
+
emptyIcon: { type: null, required: false },
|
|
52
|
+
emptyVariant: { type: String, required: false, default: "card" }
|
|
52
53
|
});
|
|
53
54
|
defineSlots();
|
|
54
55
|
const { t } = useLocale();
|
|
@@ -11,6 +11,7 @@ declare const __VLS_export: <Item extends RecordListItem>(__VLS_props: NonNullab
|
|
|
11
11
|
emptyText?: string;
|
|
12
12
|
emptyDescription?: string;
|
|
13
13
|
emptyIcon?: IconName;
|
|
14
|
+
emptyVariant?: "card" | "plain";
|
|
14
15
|
} & Partial<{
|
|
15
16
|
readonly rows?: number | undefined;
|
|
16
17
|
readonly lines?: 1 | 2 | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LinkTarget } from '../core/types';
|
|
1
|
+
import type { LinkTarget, PaletteColor } from '../core/types';
|
|
2
2
|
import type { IconName } from '../../composables/useIcons';
|
|
3
3
|
import type { AnchorTarget, Placement, Side, VirtualAnchor } from '../../internal/floating/position';
|
|
4
4
|
export type { AnchorTarget as OverlayAnchorTarget, Placement as OverlayPlacement, Side as OverlaySide, VirtualAnchor as OverlayVirtualAnchor, };
|
|
@@ -31,6 +31,7 @@ interface MenuEntryBase {
|
|
|
31
31
|
disabled?: boolean;
|
|
32
32
|
shortcut?: string;
|
|
33
33
|
description?: string;
|
|
34
|
+
color?: PaletteColor;
|
|
34
35
|
}
|
|
35
36
|
export interface MenuActionItem extends MenuEntryBase {
|
|
36
37
|
type?: 'item';
|
|
@@ -96,6 +96,12 @@
|
|
|
96
96
|
{{ entry.description }}
|
|
97
97
|
</span>
|
|
98
98
|
</span>
|
|
99
|
+
<span
|
|
100
|
+
v-if="entry.color"
|
|
101
|
+
class="k-palette-dot k-menu-item-color"
|
|
102
|
+
:class="paletteClass(entry.color)"
|
|
103
|
+
aria-hidden="true"
|
|
104
|
+
/>
|
|
99
105
|
<span v-if="entry.shortcut" class="k-menu-item-shortcut" aria-hidden="true">
|
|
100
106
|
<Kbd
|
|
101
107
|
v-for="(key, keyIndex) in formatHotkey(entry.shortcut, apple)"
|
|
@@ -116,6 +122,7 @@
|
|
|
116
122
|
import { computed, inject, onBeforeUnmount, provide, ref, useId, useTemplateRef, watch } from "vue";
|
|
117
123
|
import Icon from "../../components/core/Icon.vue";
|
|
118
124
|
import Kbd from "../../components/core/Kbd.vue";
|
|
125
|
+
import { paletteClass } from "../../components/core/palette";
|
|
119
126
|
import { ariaKeyShortcuts, formatHotkey } from "../../composables/useHotkey";
|
|
120
127
|
import { useLinkResolver } from "../core/link";
|
|
121
128
|
import { useFloatingLayer } from "../floating/layer";
|
|
@@ -110,3 +110,12 @@
|
|
|
110
110
|
color-mix(in oklab, var(--k-palette) 88%, white)
|
|
111
111
|
);
|
|
112
112
|
}
|
|
113
|
+
|
|
114
|
+
.k-palette-dot {
|
|
115
|
+
display: inline-block;
|
|
116
|
+
width: 0.5rem;
|
|
117
|
+
height: 0.5rem;
|
|
118
|
+
flex: none;
|
|
119
|
+
border-radius: var(--k-radius-full);
|
|
120
|
+
background: var(--k-palette);
|
|
121
|
+
}
|
package/package.json
CHANGED