@xleddyl/443-components-vue 0.16.22 → 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
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` |
|
|
@@ -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
|
|
|
@@ -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