@luxalgo/vela-ui 0.4.0 → 0.4.1
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/CHANGELOG.md +12 -0
- package/dist/button.js +2 -2
- package/dist/callout-bubble.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/{chunk-YT2BSP7O.js → chunk-5A54GODF.js} +1 -1
- package/dist/{chunk-VC7SVSDK.js → chunk-7LYWI32I.js} +1 -1
- package/dist/{chunk-SKFAYTDK.js → chunk-BIU66EHS.js} +1 -1
- package/dist/{chunk-DXDCKZ2M.js → chunk-CZRHHVSB.js} +1 -1
- package/dist/{chunk-C3PXY2SW.js → chunk-EDYD5XKJ.js} +9 -0
- package/dist/{chunk-QGWAN3EP.js → chunk-JEGB72M4.js} +6 -6
- package/dist/{chunk-KUWTI2PE.js → chunk-ODPGOUQT.js} +2 -1
- package/dist/collapsible.js +1 -1
- package/dist/context-menu.js +2 -2
- package/dist/date-picker.js +1 -1
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu.d.ts +2 -0
- package/dist/dropdown-menu.js +2 -2
- package/dist/empty.js +1 -1
- package/dist/field.js +5 -5
- package/dist/glyph-select.js +2 -2
- package/dist/hover-card.js +1 -1
- package/dist/icons.js +1 -1
- package/dist/input-group.js +2 -2
- package/dist/item.js +1 -1
- package/dist/manifest.json +2 -1
- package/dist/number-input.js +2 -2
- package/dist/select.d.ts +4 -0
- package/dist/select.js +2 -2
- package/dist/sort-button.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/theme.schema.json +1 -1
- package/dist/toast.js +1 -1
- package/dist/toggle-group.js +1 -1
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/registry/dropdown-menu.ts +3 -0
- package/registry/select.ts +13 -4
- package/skills/using-vela-ui-components/SKILL.md +4 -2
- package/src/components/dropdown-menu.ts +3 -0
- package/src/components/select.ts +13 -4
- package/src/lib/icons.ts +9 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to `@luxalgo/vela-ui`, newest first. Vela's own changes, including how it
|
|
4
4
|
uses the kit, are in [Vela's changelog](../../CHANGELOG.md).
|
|
5
5
|
|
|
6
|
+
## [0.4.1]
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- **Unavailable choices can say why.** A dropdown menu row takes a `title`, shown as its
|
|
11
|
+
tooltip, so a disabled row can explain what makes it unavailable. A select's options take
|
|
12
|
+
`disabled` and `title` too: a disabled option stays in the list, dimmed, cannot be picked
|
|
13
|
+
with the pointer or the keyboard, and shows its tooltip on hover.
|
|
14
|
+
- **Icons for three more chart styles.** The icon set draws `style-linemarkers`,
|
|
15
|
+
`style-stepline` and `style-columns` beside the other chart-style icons, in the same
|
|
16
|
+
16-pixel chrome tier.
|
|
17
|
+
|
|
6
18
|
## [0.4.0]
|
|
7
19
|
|
|
8
20
|
### Changed
|
package/dist/button.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { BUTTON_CSS, BUTTON_STYLE_ID, buttonDef, buttonVariants, createButton } from './chunk-
|
|
1
|
+
export { BUTTON_CSS, BUTTON_STYLE_ID, buttonDef, buttonVariants, createButton } from './chunk-CZRHHVSB.js';
|
|
2
2
|
import './chunk-FYVQO5TN.js';
|
|
3
|
-
import './chunk-
|
|
3
|
+
import './chunk-EDYD5XKJ.js';
|
|
4
4
|
import './chunk-LZWZV2ZS.js';
|
|
5
5
|
import './chunk-Q6WTDVH6.js';
|
|
6
6
|
import './chunk-6QCILIT2.js';
|
package/dist/callout-bubble.js
CHANGED
|
@@ -6,7 +6,7 @@ import './chunk-TAKSIV57.js';
|
|
|
6
6
|
import './chunk-MMTMOV6R.js';
|
|
7
7
|
import './chunk-3Q32K4PE.js';
|
|
8
8
|
import './chunk-A72NWYNP.js';
|
|
9
|
-
import { iconAt } from './chunk-
|
|
9
|
+
import { iconAt } from './chunk-EDYD5XKJ.js';
|
|
10
10
|
import { addSlot } from './chunk-Q6WTDVH6.js';
|
|
11
11
|
import { t } from './chunk-6QCILIT2.js';
|
|
12
12
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
package/dist/checkbox.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { Checkbox, checkboxController, checkboxDef, checkboxVariants, createCheckbox } from './chunk-
|
|
1
|
+
export { Checkbox, checkboxController, checkboxDef, checkboxVariants, createCheckbox } from './chunk-BIU66EHS.js';
|
|
2
2
|
import './chunk-A72NWYNP.js';
|
|
3
3
|
import './chunk-GUIYFQ27.js';
|
|
4
|
-
import './chunk-
|
|
4
|
+
import './chunk-EDYD5XKJ.js';
|
|
5
5
|
import './chunk-LZWZV2ZS.js';
|
|
6
6
|
import './chunk-Q6WTDVH6.js';
|
|
7
7
|
import './chunk-6QCILIT2.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { openPopoverTrigger, closeOpenPopovers, Popover } from './chunk-BWSOMG3G.js';
|
|
2
|
-
import { iconEl } from './chunk-
|
|
2
|
+
import { iconEl } from './chunk-EDYD5XKJ.js';
|
|
3
3
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
4
4
|
import { t } from './chunk-6QCILIT2.js';
|
|
5
5
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
@@ -2,7 +2,7 @@ import { kitTranslator } from './chunk-FVH6L7FM.js';
|
|
|
2
2
|
import { msg, textOf } from './chunk-FN2BUFNM.js';
|
|
3
3
|
import { ownTeardown } from './chunk-A72NWYNP.js';
|
|
4
4
|
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-GUIYFQ27.js';
|
|
5
|
-
import { iconEl } from './chunk-
|
|
5
|
+
import { iconEl } from './chunk-EDYD5XKJ.js';
|
|
6
6
|
import { variants } from './chunk-LZWZV2ZS.js';
|
|
7
7
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
8
8
|
import { t } from './chunk-6QCILIT2.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ownTeardown } from './chunk-A72NWYNP.js';
|
|
2
2
|
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-GUIYFQ27.js';
|
|
3
|
-
import { iconEl } from './chunk-
|
|
3
|
+
import { iconEl } from './chunk-EDYD5XKJ.js';
|
|
4
4
|
import { variants } from './chunk-LZWZV2ZS.js';
|
|
5
5
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
6
6
|
import { t } from './chunk-6QCILIT2.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createKbd } from './chunk-FYVQO5TN.js';
|
|
2
|
-
import { iconEl } from './chunk-
|
|
2
|
+
import { iconEl } from './chunk-EDYD5XKJ.js';
|
|
3
3
|
import { variants } from './chunk-LZWZV2ZS.js';
|
|
4
4
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
5
5
|
import { t } from './chunk-6QCILIT2.js';
|
|
@@ -33,6 +33,11 @@ registerIcon(
|
|
|
33
33
|
S('<path d="M4.5 2.5v11M2.5 5h2M4.5 11h2"/><path d="M11.5 2.5v11M9.5 4.5h2M11.5 10.5h2"/>')
|
|
34
34
|
);
|
|
35
35
|
registerIcon("style-line", S('<path d="M1.5 11.5 5.5 7l3 2.5 5-6"/>'));
|
|
36
|
+
registerIcon(
|
|
37
|
+
"style-linemarkers",
|
|
38
|
+
S('<path d="M1.5 11.5 5.5 7l3 2.5 5-6"/><g fill="currentColor" stroke="none"><circle cx="1.5" cy="11.5" r="1.4"/><circle cx="5.5" cy="7" r="1.4"/><circle cx="8.5" cy="9.5" r="1.4"/><circle cx="13.5" cy="3.5" r="1.4"/></g>')
|
|
39
|
+
);
|
|
40
|
+
registerIcon("style-stepline", S('<path d="M1.5 11.5H5V7.5h3.5V10H12V4h2.5"/>'));
|
|
36
41
|
registerIcon(
|
|
37
42
|
"style-area",
|
|
38
43
|
S('<path d="M1.5 11.5 5.5 7l3 2.5 5-6"/><path d="M1.5 11.5 5.5 7l3 2.5 5-6V13.5h-12z" fill="currentColor" fill-opacity="0.25" stroke="none"/>')
|
|
@@ -41,6 +46,10 @@ registerIcon(
|
|
|
41
46
|
"style-baseline",
|
|
42
47
|
S('<path d="M1.5 8h13" stroke-dasharray="2 2"/><path d="M2.5 8 5.25 4.5 8 8h-5.5z" fill="currentColor" fill-opacity="0.25" stroke="none"/><path d="M2.5 8 5.25 4.5 8 8"/><path d="M8 8l2.75 3.5L13.5 8h-5.5z" fill="currentColor" fill-opacity="0.25" stroke="none"/><path d="M8 8l2.75 3.5L13.5 8"/>')
|
|
43
48
|
);
|
|
49
|
+
registerIcon(
|
|
50
|
+
"style-columns",
|
|
51
|
+
S('<rect x="2" y="8" width="3" height="5.5" rx="0.6" fill="currentColor" fill-opacity="0.25"/><rect x="6.5" y="4" width="3" height="9.5" rx="0.6" fill="currentColor"/><rect x="11" y="6.5" width="3" height="7" rx="0.6" fill="currentColor" fill-opacity="0.25"/>')
|
|
52
|
+
);
|
|
44
53
|
registerIcon(
|
|
45
54
|
"style-heikinashi",
|
|
46
55
|
S('<path d="M4.5 12v2M11.5 2v2"/><rect x="2.8" y="5" width="3.4" height="7" rx="0.6" fill="currentColor" fill-opacity="0.25"/><rect x="9.8" y="4" width="3.4" height="7" rx="0.6" fill="currentColor"/>')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { openPopoverTrigger, closeOpenPopovers, Popover } from './chunk-BWSOMG3G.js';
|
|
2
2
|
import { ownTeardown } from './chunk-A72NWYNP.js';
|
|
3
3
|
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-GUIYFQ27.js';
|
|
4
|
-
import { iconEl } from './chunk-
|
|
4
|
+
import { iconEl } from './chunk-EDYD5XKJ.js';
|
|
5
5
|
import { variants } from './chunk-LZWZV2ZS.js';
|
|
6
6
|
import { addSlot, h } from './chunk-Q6WTDVH6.js';
|
|
7
7
|
import { t } from './chunk-6QCILIT2.js';
|
|
@@ -43,7 +43,7 @@ var selectDef = defineComponent({
|
|
|
43
43
|
});
|
|
44
44
|
var selectVariants = variants({ size: ["md", "sm"] });
|
|
45
45
|
var SELECT_STYLE_ID = "vela-ui-select-3";
|
|
46
|
-
var SELECT_CSS = css`@layer vela.ui{[data-slot=select-trigger]{box-sizing:border-box;border:1px solid ${t.border.strong};border-radius:${selectDef.vars.radius};width:100%;min-width:0;height:34px;color:${t.fg.bright};cursor:pointer;text-align:start;transition:border-color ${t.dur.fast} ease, box-shadow ${t.dur.fast} ease;background:0 0;outline:2px solid #0000;align-items:center;padding-block:0;padding-inline:8px 26px;font-family:inherit;font-size:14px;display:flex}[data-slot=select-trigger]:hover{border-color:${t.fg.muted}}[data-slot=select-trigger]:focus{border-color:${t.focus};box-shadow:${selectDef.vars["focus-ring"]}}[data-slot=select-value]{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}[data-slot=select-icon]{inset-inline-end:8px;pointer-events:none;opacity:.55;color:inherit;line-height:0;display:flex;position:absolute;top:50%;transform:translateY(-50%)}[data-slot=select-icon]>span,[data-slot=select-icon] svg{width:12px;height:12px;display:block}[data-slot=select-sizer]{visibility:hidden;height:0;font-size:13px;overflow:hidden}[data-slot=select-sizer] span{white-space:nowrap;border-inline:1px solid #0000;height:0;padding-block:0;padding-inline:8px 26px;display:block}[data-slot=select-viewport]{width:max-content;min-width:100%;max-height:none;overflow:hidden}[data-slot=select-rail]{pointer-events:none;flex:none;width:3px;margin-block:2px;margin-inline:0 1px;position:relative}[data-slot=select-thumb]{border-radius:${selectDef.vars["thumb-radius"]};background:${t.scroll};width:3px}[data-slot=select-item]{white-space:nowrap;text-align:start;border-radius:${t.radius.sm};width:auto;min-width:100%;color:inherit;cursor:pointer;font:inherit;background:0 0;border:none;padding:7px 10px;font-weight:400;display:block}[data-slot=select-item]:hover,[data-slot=select-item][data-highlighted]{background:${t.hover}}[data-slot=select-item][data-checked]{background:${t.hover.strong};color:${t.fg.bright}}[data-slot=select-item][data-checked]:hover,[data-slot=select-item][data-checked][data-highlighted]{background:${t.hover.strong}}[data-slot=select-viewport]:focus{outline:2px solid #0000}[data-slot=select-value][data-placeholder]{color:${t.fg.muted}}[data-slot=select-native]{clip-path:inset(50%);white-space:nowrap;pointer-events:none;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}[data-slot=select]{min-width:0;position:relative}[data-slot=select]:where(:not([hidden])){display:inline-block}[data-slot=select][data-fill]{width:100%}[data-slot=select]:not([data-fill]){flex:none;justify-self:start;width:100px}[data-slot=select][data-size=sm] [data-slot=select-trigger]{background:${t.surface.elev};border-radius:${t.radius.sm};height:28px;color:${t.fg};box-shadow:none;font-size:13px}[data-slot=select][data-size=sm] [data-slot=select-trigger]:focus{box-shadow:none;border-color:${t.fg.muted}}[data-slot=select][data-size=sm]:not([data-fill]){width:auto;max-width:200px}[data-slot~=select-content]{background:${t.bg};width:max-content;color:${t.fg};border-radius:${selectDef.vars["content-radius"]};box-shadow:${t.shadow};font:14px ${t.font};border:none;padding:4px;overflow:hidden}[data-slot~=select-content][data-size=sm]{background:${t.surface.overlay};font-size:13px}[data-slot~=select-content][data-scroll]{align-items:stretch;gap:2px;display:flex}[data-slot~=select-content][data-scroll] [data-slot=select-viewport]{scrollbar-width:none;flex:auto;min-width:min-content;max-height:240px;overflow-y:auto}[data-slot~=select-content][data-scroll] [data-slot=select-viewport]::-webkit-scrollbar{width:0;height:0;display:none}}`;
|
|
46
|
+
var SELECT_CSS = css`@layer vela.ui{[data-slot=select-trigger]{box-sizing:border-box;border:1px solid ${t.border.strong};border-radius:${selectDef.vars.radius};width:100%;min-width:0;height:34px;color:${t.fg.bright};cursor:pointer;text-align:start;transition:border-color ${t.dur.fast} ease, box-shadow ${t.dur.fast} ease;background:0 0;outline:2px solid #0000;align-items:center;padding-block:0;padding-inline:8px 26px;font-family:inherit;font-size:14px;display:flex}[data-slot=select-trigger]:hover{border-color:${t.fg.muted}}[data-slot=select-trigger]:focus{border-color:${t.focus};box-shadow:${selectDef.vars["focus-ring"]}}[data-slot=select-value]{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}[data-slot=select-icon]{inset-inline-end:8px;pointer-events:none;opacity:.55;color:inherit;line-height:0;display:flex;position:absolute;top:50%;transform:translateY(-50%)}[data-slot=select-icon]>span,[data-slot=select-icon] svg{width:12px;height:12px;display:block}[data-slot=select-sizer]{visibility:hidden;height:0;font-size:13px;overflow:hidden}[data-slot=select-sizer] span{white-space:nowrap;border-inline:1px solid #0000;height:0;padding-block:0;padding-inline:8px 26px;display:block}[data-slot=select-viewport]{width:max-content;min-width:100%;max-height:none;overflow:hidden}[data-slot=select-rail]{pointer-events:none;flex:none;width:3px;margin-block:2px;margin-inline:0 1px;position:relative}[data-slot=select-thumb]{border-radius:${selectDef.vars["thumb-radius"]};background:${t.scroll};width:3px}[data-slot=select-item]{white-space:nowrap;text-align:start;border-radius:${t.radius.sm};width:auto;min-width:100%;color:inherit;cursor:pointer;font:inherit;background:0 0;border:none;padding:7px 10px;font-weight:400;display:block}[data-slot=select-item]:hover,[data-slot=select-item][data-highlighted]{background:${t.hover}}[data-slot=select-item][data-checked]{background:${t.hover.strong};color:${t.fg.bright}}[data-slot=select-item][data-checked]:hover,[data-slot=select-item][data-checked][data-highlighted]{background:${t.hover.strong}}[data-slot=select-item][data-disabled]{opacity:.4;cursor:default;background:0 0}[data-slot=select-viewport]:focus{outline:2px solid #0000}[data-slot=select-value][data-placeholder]{color:${t.fg.muted}}[data-slot=select-native]{clip-path:inset(50%);white-space:nowrap;pointer-events:none;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}[data-slot=select]{min-width:0;position:relative}[data-slot=select]:where(:not([hidden])){display:inline-block}[data-slot=select][data-fill]{width:100%}[data-slot=select]:not([data-fill]){flex:none;justify-self:start;width:100px}[data-slot=select][data-size=sm] [data-slot=select-trigger]{background:${t.surface.elev};border-radius:${t.radius.sm};height:28px;color:${t.fg};box-shadow:none;font-size:13px}[data-slot=select][data-size=sm] [data-slot=select-trigger]:focus{box-shadow:none;border-color:${t.fg.muted}}[data-slot=select][data-size=sm]:not([data-fill]){width:auto;max-width:200px}[data-slot~=select-content]{background:${t.bg};width:max-content;color:${t.fg};border-radius:${selectDef.vars["content-radius"]};box-shadow:${t.shadow};font:14px ${t.font};border:none;padding:4px;overflow:hidden}[data-slot~=select-content][data-size=sm]{background:${t.surface.overlay};font-size:13px}[data-slot~=select-content][data-scroll]{align-items:stretch;gap:2px;display:flex}[data-slot~=select-content][data-scroll] [data-slot=select-viewport]{scrollbar-width:none;flex:auto;min-width:min-content;max-height:240px;overflow-y:auto}[data-slot~=select-content][data-scroll] [data-slot=select-viewport]::-webkit-scrollbar{width:0;height:0;display:none}}`;
|
|
47
47
|
var injectStyles = defineStyles(SELECT_STYLE_ID, SELECT_CSS);
|
|
48
48
|
function syncThumb(list, thumb) {
|
|
49
49
|
const view = list.clientHeight;
|
|
@@ -63,7 +63,7 @@ function fillSelectList(menu, options, current, onPick) {
|
|
|
63
63
|
let picked = false;
|
|
64
64
|
const choose = (value) => {
|
|
65
65
|
const option = options.find((o) => o.value === value);
|
|
66
|
-
if (picked || !option) return;
|
|
66
|
+
if (picked || !option || option.disabled) return;
|
|
67
67
|
picked = true;
|
|
68
68
|
onPick(option.value, option.label);
|
|
69
69
|
};
|
|
@@ -71,7 +71,7 @@ function fillSelectList(menu, options, current, onPick) {
|
|
|
71
71
|
(p) => h("button", {
|
|
72
72
|
className: "vela-select-item",
|
|
73
73
|
slot: selectDef.slot("item"),
|
|
74
|
-
attrs: { type: "button", tabindex: -1 },
|
|
74
|
+
attrs: { type: "button", tabindex: -1, title: p.title },
|
|
75
75
|
data: { checked: p.value === current ? "1" : null },
|
|
76
76
|
text: p.label,
|
|
77
77
|
on: {
|
|
@@ -90,7 +90,7 @@ function fillSelectList(menu, options, current, onPick) {
|
|
|
90
90
|
zagListbox.machine,
|
|
91
91
|
{
|
|
92
92
|
id: mid,
|
|
93
|
-
collection: zagListbox.collection({ items: options, itemToValue: (o) => o.value, itemToString: (o) => o.label }),
|
|
93
|
+
collection: zagListbox.collection({ items: options, itemToValue: (o) => o.value, itemToString: (o) => o.label, isItemDisabled: (o) => o.disabled === true }),
|
|
94
94
|
selectionMode: "single",
|
|
95
95
|
defaultValue: known ? [current] : [],
|
|
96
96
|
defaultHighlightedValue: known ? current : null,
|
|
@@ -203,7 +203,7 @@ var Select = class {
|
|
|
203
203
|
"select",
|
|
204
204
|
{ slot: selectDef.slot("native"), attrs: { name: opts.name, "aria-hidden": "true", tabindex: -1 } },
|
|
205
205
|
opts.placeholder !== void 0 ? h("option", { attrs: { value: "" } }) : null,
|
|
206
|
-
this.ctrl.options.map((o) => h("option", { attrs: { value: o.value }, text: o.label }))
|
|
206
|
+
this.ctrl.options.map((o) => h("option", { attrs: { value: o.value, disabled: o.disabled }, text: o.label }))
|
|
207
207
|
) : null;
|
|
208
208
|
if (this.native) {
|
|
209
209
|
this.native.required = opts.required === true;
|
|
@@ -5,7 +5,7 @@ import { holdForExit } from './chunk-S7USVSYP.js';
|
|
|
5
5
|
import { floatingLayerHost } from './chunk-RH53NQGE.js';
|
|
6
6
|
import { zagPositioning, splitPlacement } from './chunk-3Q32K4PE.js';
|
|
7
7
|
import { normalizeProps, nextUid, runMachine, spreadProps } from './chunk-GUIYFQ27.js';
|
|
8
|
-
import { iconEl } from './chunk-
|
|
8
|
+
import { iconEl } from './chunk-EDYD5XKJ.js';
|
|
9
9
|
import { addSlot } from './chunk-Q6WTDVH6.js';
|
|
10
10
|
import { t } from './chunk-6QCILIT2.js';
|
|
11
11
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
@@ -196,6 +196,7 @@ var Surface = class _Surface {
|
|
|
196
196
|
li.className = "vela-menu-item";
|
|
197
197
|
li.dataset.slot = dropdownMenuDef.slot("item");
|
|
198
198
|
li.dataset.veiId = item.id;
|
|
199
|
+
if (item.title) li.title = item.title;
|
|
199
200
|
if (item.toggle) {
|
|
200
201
|
li.dataset.toggle = "1";
|
|
201
202
|
}
|
package/dist/collapsible.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { nextUid } from './chunk-GUIYFQ27.js';
|
|
2
|
-
import { iconEl } from './chunk-
|
|
2
|
+
import { iconEl } from './chunk-EDYD5XKJ.js';
|
|
3
3
|
import { variants } from './chunk-LZWZV2ZS.js';
|
|
4
4
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
5
5
|
import { t } from './chunk-6QCILIT2.js';
|
package/dist/context-menu.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DropdownMenu } from './chunk-
|
|
1
|
+
import { DropdownMenu } from './chunk-ODPGOUQT.js';
|
|
2
2
|
import { kitTranslator } from './chunk-FVH6L7FM.js';
|
|
3
3
|
import './chunk-FN2BUFNM.js';
|
|
4
4
|
import './chunk-J2QJATCD.js';
|
|
@@ -9,7 +9,7 @@ import './chunk-MMTMOV6R.js';
|
|
|
9
9
|
import './chunk-3Q32K4PE.js';
|
|
10
10
|
import { ownTeardown } from './chunk-A72NWYNP.js';
|
|
11
11
|
import './chunk-GUIYFQ27.js';
|
|
12
|
-
import './chunk-
|
|
12
|
+
import './chunk-EDYD5XKJ.js';
|
|
13
13
|
import './chunk-Q6WTDVH6.js';
|
|
14
14
|
import './chunk-6QCILIT2.js';
|
|
15
15
|
import './chunk-VMCR3S2A.js';
|
package/dist/date-picker.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { calendarSettings, monthNames, yearLabel, weekdayNames, yearBeforeMonth, plainInteger } from './chunk-GVRX3UAV.js';
|
|
2
2
|
import { msg, textOf } from './chunk-FN2BUFNM.js';
|
|
3
|
-
import { iconEl } from './chunk-
|
|
3
|
+
import { iconEl } from './chunk-EDYD5XKJ.js';
|
|
4
4
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
5
5
|
import { t } from './chunk-6QCILIT2.js';
|
|
6
6
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
package/dist/dialog.js
CHANGED
|
@@ -9,7 +9,7 @@ import './chunk-MMTMOV6R.js';
|
|
|
9
9
|
import './chunk-3Q32K4PE.js';
|
|
10
10
|
import { disposeWithin } from './chunk-A72NWYNP.js';
|
|
11
11
|
import { normalizeProps, nextUid, runMachine, spreadProps } from './chunk-GUIYFQ27.js';
|
|
12
|
-
import { iconEl } from './chunk-
|
|
12
|
+
import { iconEl } from './chunk-EDYD5XKJ.js';
|
|
13
13
|
import './chunk-Q6WTDVH6.js';
|
|
14
14
|
import { t } from './chunk-6QCILIT2.js';
|
|
15
15
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
package/dist/dropdown-menu.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ interface MenuItemDescriptor {
|
|
|
9
9
|
id: string;
|
|
10
10
|
label: string;
|
|
11
11
|
disabled?: boolean;
|
|
12
|
+
/** The row's tooltip, e.g. why a disabled row is unavailable. */
|
|
13
|
+
title?: string;
|
|
12
14
|
/** Draw a separator line above this item. */
|
|
13
15
|
separatorBefore?: boolean;
|
|
14
16
|
/** Right-aligned hint (e.g. a shortcut display from KeymapManager). */
|
package/dist/dropdown-menu.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DropdownMenu, createDropdownMenu, dropdownMenuController, dropdownMenuDef } from './chunk-
|
|
1
|
+
export { DropdownMenu, createDropdownMenu, dropdownMenuController, dropdownMenuDef } from './chunk-ODPGOUQT.js';
|
|
2
2
|
import './chunk-FVH6L7FM.js';
|
|
3
3
|
import './chunk-FN2BUFNM.js';
|
|
4
4
|
import './chunk-J2QJATCD.js';
|
|
@@ -8,7 +8,7 @@ import './chunk-TAKSIV57.js';
|
|
|
8
8
|
import './chunk-MMTMOV6R.js';
|
|
9
9
|
import './chunk-3Q32K4PE.js';
|
|
10
10
|
import './chunk-GUIYFQ27.js';
|
|
11
|
-
import './chunk-
|
|
11
|
+
import './chunk-EDYD5XKJ.js';
|
|
12
12
|
import './chunk-Q6WTDVH6.js';
|
|
13
13
|
import './chunk-6QCILIT2.js';
|
|
14
14
|
import './chunk-VMCR3S2A.js';
|
package/dist/empty.js
CHANGED
package/dist/field.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TextArea } from './chunk-ALAHGSLC.js';
|
|
2
|
-
import { NumberInput } from './chunk-
|
|
3
|
-
import { Select } from './chunk-
|
|
4
|
-
import { widthField } from './chunk-
|
|
2
|
+
import { NumberInput } from './chunk-7LYWI32I.js';
|
|
3
|
+
import { Select } from './chunk-JEGB72M4.js';
|
|
4
|
+
import { widthField } from './chunk-5A54GODF.js';
|
|
5
5
|
import { Input } from './chunk-5BJV5FY5.js';
|
|
6
6
|
import { ColorField } from './chunk-TGJNHUYV.js';
|
|
7
7
|
import './chunk-FVH6L7FM.js';
|
|
@@ -13,10 +13,10 @@ import './chunk-RH53NQGE.js';
|
|
|
13
13
|
import './chunk-TAKSIV57.js';
|
|
14
14
|
import './chunk-MMTMOV6R.js';
|
|
15
15
|
import './chunk-3Q32K4PE.js';
|
|
16
|
-
import { Checkbox } from './chunk-
|
|
16
|
+
import { Checkbox } from './chunk-BIU66EHS.js';
|
|
17
17
|
import { disposeWithin } from './chunk-A72NWYNP.js';
|
|
18
18
|
import './chunk-GUIYFQ27.js';
|
|
19
|
-
import './chunk-
|
|
19
|
+
import './chunk-EDYD5XKJ.js';
|
|
20
20
|
import './chunk-LZWZV2ZS.js';
|
|
21
21
|
import './chunk-Q6WTDVH6.js';
|
|
22
22
|
import { t } from './chunk-6QCILIT2.js';
|
package/dist/glyph-select.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { GlyphSelect, WIDTH_FIELD_OPTIONS, closeWidthPopover, createGlyphSelect, glyphSelectController, glyphSelectDef, lineWidthGlyph, widthField, widthFieldOptions } from './chunk-
|
|
1
|
+
export { GlyphSelect, WIDTH_FIELD_OPTIONS, closeWidthPopover, createGlyphSelect, glyphSelectController, glyphSelectDef, lineWidthGlyph, widthField, widthFieldOptions } from './chunk-5A54GODF.js';
|
|
2
2
|
import './chunk-BWSOMG3G.js';
|
|
3
3
|
import './chunk-J2QJATCD.js';
|
|
4
4
|
import './chunk-S7USVSYP.js';
|
|
@@ -7,7 +7,7 @@ import './chunk-TAKSIV57.js';
|
|
|
7
7
|
import './chunk-MMTMOV6R.js';
|
|
8
8
|
import './chunk-3Q32K4PE.js';
|
|
9
9
|
import './chunk-A72NWYNP.js';
|
|
10
|
-
import './chunk-
|
|
10
|
+
import './chunk-EDYD5XKJ.js';
|
|
11
11
|
import './chunk-Q6WTDVH6.js';
|
|
12
12
|
import './chunk-6QCILIT2.js';
|
|
13
13
|
import './chunk-VMCR3S2A.js';
|
package/dist/hover-card.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { shortcutKeys } from './chunk-FYVQO5TN.js';
|
|
2
2
|
import { viewportRect, placePopover, intersectRects } from './chunk-3Q32K4PE.js';
|
|
3
|
-
import { iconEl } from './chunk-
|
|
3
|
+
import { iconEl } from './chunk-EDYD5XKJ.js';
|
|
4
4
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
5
5
|
import { t } from './chunk-6QCILIT2.js';
|
|
6
6
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
package/dist/icons.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { icon, iconAt, iconEl, iconMarkup, registerIcon, svg16, svg24, svg24Solid } from './chunk-
|
|
1
|
+
export { icon, iconAt, iconEl, iconMarkup, registerIcon, svg16, svg24, svg24Solid } from './chunk-EDYD5XKJ.js';
|
|
2
2
|
import './chunk-X66RJAIS.js';
|
package/dist/input-group.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createButton } from './chunk-
|
|
1
|
+
import { createButton } from './chunk-CZRHHVSB.js';
|
|
2
2
|
import './chunk-FYVQO5TN.js';
|
|
3
|
-
import { iconEl } from './chunk-
|
|
3
|
+
import { iconEl } from './chunk-EDYD5XKJ.js';
|
|
4
4
|
import { variants } from './chunk-LZWZV2ZS.js';
|
|
5
5
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
6
6
|
import { t } from './chunk-6QCILIT2.js';
|
package/dist/item.js
CHANGED
package/dist/manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "@luxalgo/vela-ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"tokens": [
|
|
5
5
|
"space-1",
|
|
6
6
|
"space-2",
|
|
@@ -3719,6 +3719,7 @@
|
|
|
3719
3719
|
],
|
|
3720
3720
|
"attributes": [
|
|
3721
3721
|
"data-checked",
|
|
3722
|
+
"data-disabled",
|
|
3722
3723
|
"data-fill",
|
|
3723
3724
|
"data-highlighted",
|
|
3724
3725
|
"data-placeholder",
|
package/dist/number-input.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { NUMBER_CSS, NUMBER_STYLE_ID, NumberInput, clampNumber, createNumberInput, numberInputController, numberInputDef, numberInputVariants, snapToStep } from './chunk-
|
|
1
|
+
export { NUMBER_CSS, NUMBER_STYLE_ID, NumberInput, clampNumber, createNumberInput, numberInputController, numberInputDef, numberInputVariants, snapToStep } from './chunk-7LYWI32I.js';
|
|
2
2
|
import './chunk-FVH6L7FM.js';
|
|
3
3
|
import './chunk-FN2BUFNM.js';
|
|
4
4
|
import './chunk-A72NWYNP.js';
|
|
5
5
|
import './chunk-GUIYFQ27.js';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-EDYD5XKJ.js';
|
|
7
7
|
import './chunk-LZWZV2ZS.js';
|
|
8
8
|
import './chunk-Q6WTDVH6.js';
|
|
9
9
|
import './chunk-6QCILIT2.js';
|
package/dist/select.d.ts
CHANGED
|
@@ -9,6 +9,10 @@ type SelectSize = 'sm' | 'md';
|
|
|
9
9
|
interface SelectOption {
|
|
10
10
|
value: string;
|
|
11
11
|
label: string;
|
|
12
|
+
/** Shown in the list but not selectable (dimmed, skipped by the keyboard). */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/** The option's tooltip, e.g. why it is disabled. */
|
|
15
|
+
title?: string;
|
|
12
16
|
}
|
|
13
17
|
interface SelectControllerOptions {
|
|
14
18
|
options: readonly SelectOption[];
|
package/dist/select.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { SELECT_CSS, SELECT_STYLE_ID, Select, createSelect, decorateSelectScroll, fillSelectList, openSelectList, selectController, selectDef, selectVariants, toggleSelectList } from './chunk-
|
|
1
|
+
export { SELECT_CSS, SELECT_STYLE_ID, Select, createSelect, decorateSelectScroll, fillSelectList, openSelectList, selectController, selectDef, selectVariants, toggleSelectList } from './chunk-JEGB72M4.js';
|
|
2
2
|
import './chunk-BWSOMG3G.js';
|
|
3
3
|
import './chunk-J2QJATCD.js';
|
|
4
4
|
import './chunk-S7USVSYP.js';
|
|
@@ -8,7 +8,7 @@ import './chunk-MMTMOV6R.js';
|
|
|
8
8
|
import './chunk-3Q32K4PE.js';
|
|
9
9
|
import './chunk-A72NWYNP.js';
|
|
10
10
|
import './chunk-GUIYFQ27.js';
|
|
11
|
-
import './chunk-
|
|
11
|
+
import './chunk-EDYD5XKJ.js';
|
|
12
12
|
import './chunk-LZWZV2ZS.js';
|
|
13
13
|
import './chunk-Q6WTDVH6.js';
|
|
14
14
|
import './chunk-6QCILIT2.js';
|
package/dist/sort-button.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { kitTranslator } from './chunk-FVH6L7FM.js';
|
|
2
2
|
import { msg, textOf } from './chunk-FN2BUFNM.js';
|
|
3
3
|
import { nextUid } from './chunk-GUIYFQ27.js';
|
|
4
|
-
import { iconEl } from './chunk-
|
|
4
|
+
import { iconEl } from './chunk-EDYD5XKJ.js';
|
|
5
5
|
import { variants } from './chunk-LZWZV2ZS.js';
|
|
6
6
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
7
7
|
import { t } from './chunk-6QCILIT2.js';
|
package/dist/tabs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ownTeardown } from './chunk-A72NWYNP.js';
|
|
2
2
|
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-GUIYFQ27.js';
|
|
3
|
-
import { iconEl } from './chunk-
|
|
3
|
+
import { iconEl } from './chunk-EDYD5XKJ.js';
|
|
4
4
|
import { variants } from './chunk-LZWZV2ZS.js';
|
|
5
5
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
6
6
|
import { t } from './chunk-6QCILIT2.js';
|
package/dist/theme.schema.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"title": "@luxalgo/vela-ui 0.4.
|
|
3
|
+
"title": "@luxalgo/vela-ui 0.4.1 theme",
|
|
4
4
|
"description": "The input of createTheme. Every field is optional: an empty theme is the dark theme.",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"additionalProperties": false,
|
package/dist/toast.js
CHANGED
|
@@ -3,7 +3,7 @@ import { msg, textOf } from './chunk-FN2BUFNM.js';
|
|
|
3
3
|
import { ensureUIHost } from './chunk-RH53NQGE.js';
|
|
4
4
|
import './chunk-TAKSIV57.js';
|
|
5
5
|
import './chunk-MMTMOV6R.js';
|
|
6
|
-
import { iconEl } from './chunk-
|
|
6
|
+
import { iconEl } from './chunk-EDYD5XKJ.js';
|
|
7
7
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
8
8
|
import { t } from './chunk-6QCILIT2.js';
|
|
9
9
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
package/dist/toggle-group.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ownTeardown } from './chunk-A72NWYNP.js';
|
|
2
2
|
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-GUIYFQ27.js';
|
|
3
|
-
import { iconEl } from './chunk-
|
|
3
|
+
import { iconEl } from './chunk-EDYD5XKJ.js';
|
|
4
4
|
import { variants } from './chunk-LZWZV2ZS.js';
|
|
5
5
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
6
6
|
import { t } from './chunk-6QCILIT2.js';
|
package/llms.txt
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luxalgo/vela-ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "The component kit of Vela: one file per component, Zag state machines for behavior, CSS in cascade layers over design tokens.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "LuxAlgo",
|
|
@@ -24,6 +24,8 @@ export interface MenuItemDescriptor {
|
|
|
24
24
|
id: string;
|
|
25
25
|
label: string;
|
|
26
26
|
disabled?: boolean;
|
|
27
|
+
/** The row's tooltip, e.g. why a disabled row is unavailable. */
|
|
28
|
+
title?: string;
|
|
27
29
|
/** Draw a separator line above this item. */
|
|
28
30
|
separatorBefore?: boolean;
|
|
29
31
|
/** Right-aligned hint (e.g. a shortcut display from KeymapManager). */
|
|
@@ -590,6 +592,7 @@ class Surface {
|
|
|
590
592
|
li.className = 'vela-menu-item';
|
|
591
593
|
li.dataset.slot = dropdownMenuDef.slot('item');
|
|
592
594
|
li.dataset.veiId = item.id;
|
|
595
|
+
if (item.title) li.title = item.title;
|
|
593
596
|
if (item.toggle) {
|
|
594
597
|
// Switch row: the pill carries the state.
|
|
595
598
|
// (Zag owns the item's ARIA props; the pill below is decorative.)
|
package/registry/select.ts
CHANGED
|
@@ -18,6 +18,10 @@ export type SelectSize = 'sm' | 'md';
|
|
|
18
18
|
export interface SelectOption {
|
|
19
19
|
value: string;
|
|
20
20
|
label: string;
|
|
21
|
+
/** Shown in the list but not selectable (dimmed, skipped by the keyboard). */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** The option's tooltip, e.g. why it is disabled. */
|
|
24
|
+
title?: string;
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
export interface SelectControllerOptions {
|
|
@@ -240,6 +244,11 @@ export const SELECT_CSS = css`
|
|
|
240
244
|
&[data-checked][data-highlighted] {
|
|
241
245
|
background: ${t.hover.strong};
|
|
242
246
|
}
|
|
247
|
+
&[data-disabled] {
|
|
248
|
+
opacity: 0.4;
|
|
249
|
+
cursor: default;
|
|
250
|
+
background: transparent;
|
|
251
|
+
}
|
|
243
252
|
}
|
|
244
253
|
/* The highlighted option shows where the keyboard is; the list itself draws no ring. */
|
|
245
254
|
[data-slot='select-viewport']:focus {
|
|
@@ -357,7 +366,7 @@ export function fillSelectList(menu: HTMLElement, options: readonly SelectOption
|
|
|
357
366
|
let picked = false;
|
|
358
367
|
const choose = (value: string): void => {
|
|
359
368
|
const option = options.find((o) => o.value === value);
|
|
360
|
-
if (picked || !option) return;
|
|
369
|
+
if (picked || !option || option.disabled) return;
|
|
361
370
|
picked = true;
|
|
362
371
|
onPick(option.value, option.label);
|
|
363
372
|
};
|
|
@@ -365,7 +374,7 @@ export function fillSelectList(menu: HTMLElement, options: readonly SelectOption
|
|
|
365
374
|
h('button', {
|
|
366
375
|
className: 'vela-select-item',
|
|
367
376
|
slot: selectDef.slot('item'),
|
|
368
|
-
attrs: { type: 'button', tabindex: -1 },
|
|
377
|
+
attrs: { type: 'button', tabindex: -1, title: p.title },
|
|
369
378
|
data: { checked: p.value === current ? '1' : null },
|
|
370
379
|
text: p.label,
|
|
371
380
|
on: {
|
|
@@ -384,7 +393,7 @@ export function fillSelectList(menu: HTMLElement, options: readonly SelectOption
|
|
|
384
393
|
zagListbox.machine,
|
|
385
394
|
{
|
|
386
395
|
id: mid,
|
|
387
|
-
collection: zagListbox.collection({ items: options, itemToValue: (o) => o.value, itemToString: (o) => o.label }),
|
|
396
|
+
collection: zagListbox.collection({ items: options, itemToValue: (o) => o.value, itemToString: (o) => o.label, isItemDisabled: (o) => o.disabled === true }),
|
|
388
397
|
selectionMode: 'single',
|
|
389
398
|
defaultValue: known ? [current] : [],
|
|
390
399
|
defaultHighlightedValue: known ? current : null,
|
|
@@ -534,7 +543,7 @@ export class Select {
|
|
|
534
543
|
'select',
|
|
535
544
|
{ slot: selectDef.slot('native'), attrs: { name: opts.name, 'aria-hidden': 'true', tabindex: -1 } },
|
|
536
545
|
opts.placeholder !== undefined ? h('option', { attrs: { value: '' } }) : null,
|
|
537
|
-
this.ctrl.options.map((o) => h('option', { attrs: { value: o.value }, text: o.label })),
|
|
546
|
+
this.ctrl.options.map((o) => h('option', { attrs: { value: o.value, disabled: o.disabled }, text: o.label })),
|
|
538
547
|
)
|
|
539
548
|
: null;
|
|
540
549
|
if (this.native) {
|
|
@@ -72,8 +72,10 @@ To find a component, its props, parts and an example, search
|
|
|
72
72
|
subtree, or `destroy()` on the handles. A destroyed dialog, drawer or popover releases its
|
|
73
73
|
content.
|
|
74
74
|
5. **Menus take rows as data:** `items: [{ id, label, icon?, hint?, checked?, toggle?, disabled?,
|
|
75
|
-
separatorBefore?, submenu? }]` and `onSelect(id)
|
|
76
|
-
|
|
75
|
+
title?, separatorBefore?, submenu? }]` and `onSelect(id)`; `title` is the row's tooltip (why
|
|
76
|
+
a disabled row is unavailable). A select's options take `disabled` and `title` the same way.
|
|
77
|
+
`checkmarks: true` shows checked rows with a leading check; `iconBadges: true` puts icons in
|
|
78
|
+
tiles.
|
|
77
79
|
6. **Icons are ids from the registry** (`icon: 'kebab'`). Add your own with
|
|
78
80
|
`registerIcon(id, svg)` from `@luxalgo/vela-ui/icons`, drawn with `currentColor`.
|
|
79
81
|
7. **Restyle through the theme or the parts' `data-slot` attributes, never class names.**
|
|
@@ -24,6 +24,8 @@ export interface MenuItemDescriptor {
|
|
|
24
24
|
id: string;
|
|
25
25
|
label: string;
|
|
26
26
|
disabled?: boolean;
|
|
27
|
+
/** The row's tooltip, e.g. why a disabled row is unavailable. */
|
|
28
|
+
title?: string;
|
|
27
29
|
/** Draw a separator line above this item. */
|
|
28
30
|
separatorBefore?: boolean;
|
|
29
31
|
/** Right-aligned hint (e.g. a shortcut display from KeymapManager). */
|
|
@@ -590,6 +592,7 @@ class Surface {
|
|
|
590
592
|
li.className = 'vela-menu-item';
|
|
591
593
|
li.dataset.slot = dropdownMenuDef.slot('item');
|
|
592
594
|
li.dataset.veiId = item.id;
|
|
595
|
+
if (item.title) li.title = item.title;
|
|
593
596
|
if (item.toggle) {
|
|
594
597
|
// Switch row: the pill carries the state.
|
|
595
598
|
// (Zag owns the item's ARIA props; the pill below is decorative.)
|
package/src/components/select.ts
CHANGED
|
@@ -18,6 +18,10 @@ export type SelectSize = 'sm' | 'md';
|
|
|
18
18
|
export interface SelectOption {
|
|
19
19
|
value: string;
|
|
20
20
|
label: string;
|
|
21
|
+
/** Shown in the list but not selectable (dimmed, skipped by the keyboard). */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** The option's tooltip, e.g. why it is disabled. */
|
|
24
|
+
title?: string;
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
export interface SelectControllerOptions {
|
|
@@ -240,6 +244,11 @@ export const SELECT_CSS = css`
|
|
|
240
244
|
&[data-checked][data-highlighted] {
|
|
241
245
|
background: ${t.hover.strong};
|
|
242
246
|
}
|
|
247
|
+
&[data-disabled] {
|
|
248
|
+
opacity: 0.4;
|
|
249
|
+
cursor: default;
|
|
250
|
+
background: transparent;
|
|
251
|
+
}
|
|
243
252
|
}
|
|
244
253
|
/* The highlighted option shows where the keyboard is; the list itself draws no ring. */
|
|
245
254
|
[data-slot='select-viewport']:focus {
|
|
@@ -357,7 +366,7 @@ export function fillSelectList(menu: HTMLElement, options: readonly SelectOption
|
|
|
357
366
|
let picked = false;
|
|
358
367
|
const choose = (value: string): void => {
|
|
359
368
|
const option = options.find((o) => o.value === value);
|
|
360
|
-
if (picked || !option) return;
|
|
369
|
+
if (picked || !option || option.disabled) return;
|
|
361
370
|
picked = true;
|
|
362
371
|
onPick(option.value, option.label);
|
|
363
372
|
};
|
|
@@ -365,7 +374,7 @@ export function fillSelectList(menu: HTMLElement, options: readonly SelectOption
|
|
|
365
374
|
h('button', {
|
|
366
375
|
className: 'vela-select-item',
|
|
367
376
|
slot: selectDef.slot('item'),
|
|
368
|
-
attrs: { type: 'button', tabindex: -1 },
|
|
377
|
+
attrs: { type: 'button', tabindex: -1, title: p.title },
|
|
369
378
|
data: { checked: p.value === current ? '1' : null },
|
|
370
379
|
text: p.label,
|
|
371
380
|
on: {
|
|
@@ -384,7 +393,7 @@ export function fillSelectList(menu: HTMLElement, options: readonly SelectOption
|
|
|
384
393
|
zagListbox.machine,
|
|
385
394
|
{
|
|
386
395
|
id: mid,
|
|
387
|
-
collection: zagListbox.collection({ items: options, itemToValue: (o) => o.value, itemToString: (o) => o.label }),
|
|
396
|
+
collection: zagListbox.collection({ items: options, itemToValue: (o) => o.value, itemToString: (o) => o.label, isItemDisabled: (o) => o.disabled === true }),
|
|
388
397
|
selectionMode: 'single',
|
|
389
398
|
defaultValue: known ? [current] : [],
|
|
390
399
|
defaultHighlightedValue: known ? current : null,
|
|
@@ -534,7 +543,7 @@ export class Select {
|
|
|
534
543
|
'select',
|
|
535
544
|
{ slot: selectDef.slot('native'), attrs: { name: opts.name, 'aria-hidden': 'true', tabindex: -1 } },
|
|
536
545
|
opts.placeholder !== undefined ? h('option', { attrs: { value: '' } }) : null,
|
|
537
|
-
this.ctrl.options.map((o) => h('option', { attrs: { value: o.value }, text: o.label })),
|
|
546
|
+
this.ctrl.options.map((o) => h('option', { attrs: { value: o.value, disabled: o.disabled }, text: o.label })),
|
|
538
547
|
)
|
|
539
548
|
: null;
|
|
540
549
|
if (this.native) {
|
package/src/lib/icons.ts
CHANGED
|
@@ -70,6 +70,11 @@ registerIcon(
|
|
|
70
70
|
S('<path d="M4.5 2.5v11M2.5 5h2M4.5 11h2"/><path d="M11.5 2.5v11M9.5 4.5h2M11.5 10.5h2"/>'),
|
|
71
71
|
);
|
|
72
72
|
registerIcon('style-line', S('<path d="M1.5 11.5 5.5 7l3 2.5 5-6"/>'));
|
|
73
|
+
registerIcon(
|
|
74
|
+
'style-linemarkers',
|
|
75
|
+
S('<path d="M1.5 11.5 5.5 7l3 2.5 5-6"/><g fill="currentColor" stroke="none"><circle cx="1.5" cy="11.5" r="1.4"/><circle cx="5.5" cy="7" r="1.4"/><circle cx="8.5" cy="9.5" r="1.4"/><circle cx="13.5" cy="3.5" r="1.4"/></g>'),
|
|
76
|
+
);
|
|
77
|
+
registerIcon('style-stepline', S('<path d="M1.5 11.5H5V7.5h3.5V10H12V4h2.5"/>'));
|
|
73
78
|
registerIcon(
|
|
74
79
|
'style-area',
|
|
75
80
|
S('<path d="M1.5 11.5 5.5 7l3 2.5 5-6"/><path d="M1.5 11.5 5.5 7l3 2.5 5-6V13.5h-12z" fill="currentColor" fill-opacity="0.25" stroke="none"/>'),
|
|
@@ -78,6 +83,10 @@ registerIcon(
|
|
|
78
83
|
'style-baseline',
|
|
79
84
|
S('<path d="M1.5 8h13" stroke-dasharray="2 2"/><path d="M2.5 8 5.25 4.5 8 8h-5.5z" fill="currentColor" fill-opacity="0.25" stroke="none"/><path d="M2.5 8 5.25 4.5 8 8"/><path d="M8 8l2.75 3.5L13.5 8h-5.5z" fill="currentColor" fill-opacity="0.25" stroke="none"/><path d="M8 8l2.75 3.5L13.5 8"/>'),
|
|
80
85
|
);
|
|
86
|
+
registerIcon(
|
|
87
|
+
'style-columns',
|
|
88
|
+
S('<rect x="2" y="8" width="3" height="5.5" rx="0.6" fill="currentColor" fill-opacity="0.25"/><rect x="6.5" y="4" width="3" height="9.5" rx="0.6" fill="currentColor"/><rect x="11" y="6.5" width="3" height="7" rx="0.6" fill="currentColor" fill-opacity="0.25"/>'),
|
|
89
|
+
);
|
|
81
90
|
registerIcon(
|
|
82
91
|
'style-heikinashi',
|
|
83
92
|
S('<path d="M4.5 12v2M11.5 2v2"/><rect x="2.8" y="5" width="3.4" height="7" rx="0.6" fill="currentColor" fill-opacity="0.25"/><rect x="9.8" y="4" width="3.4" height="7" rx="0.6" fill="currentColor"/>'),
|