@luxalgo/vela-ui 0.3.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 +165 -132
- package/LICENSE +201 -201
- package/NOTICE +28 -28
- package/README.md +86 -86
- package/cli/engine.mjs +282 -282
- package/cli/index.mjs +154 -154
- package/dist/button.js +2 -2
- package/dist/callout-bubble.js +3 -3
- package/dist/checkbox.js +3 -3
- package/dist/{chunk-OJ2SEMN6.js → chunk-5A54GODF.js} +2 -2
- package/dist/{chunk-UEO6W37Z.js → chunk-7LYWI32I.js} +2 -2
- package/dist/{chunk-IOOYDSSK.js → chunk-BIU66EHS.js} +2 -2
- package/dist/{chunk-KKS6NEGI.js → chunk-BWSOMG3G.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-GUIYFQ27.js +30 -0
- package/dist/{chunk-WWHNUKSZ.js → chunk-JEGB72M4.js} +8 -8
- package/dist/{chunk-B2EZB5ZG.js → chunk-ODPGOUQT.js} +4 -3
- package/dist/{chunk-TBXUF5YX.js → chunk-RH53NQGE.js} +18 -4
- package/dist/{chunk-OQXFQMZM.js → chunk-TGJNHUYV.js} +2 -2
- package/dist/collapsible.js +2 -2
- package/dist/color-picker.js +4 -4
- package/dist/context-menu.js +4 -4
- package/dist/date-picker.js +1 -1
- package/dist/dialog.js +4 -4
- package/dist/donut.d.ts +1 -1
- package/dist/drawer.js +1 -1
- package/dist/dropdown-menu.d.ts +2 -0
- package/dist/dropdown-menu.js +4 -4
- package/dist/empty.js +1 -1
- package/dist/field.js +9 -9
- package/dist/{stat.d.ts → figure.d.ts} +9 -9
- package/dist/figure.js +41 -0
- package/dist/glyph-select.js +4 -4
- package/dist/hover-card.js +1 -1
- package/dist/icons.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/input-group.js +2 -2
- package/dist/item.js +1 -1
- package/dist/manifest.json +75 -74
- package/dist/number-input.js +3 -3
- package/dist/popover.js +2 -2
- package/dist/select.d.ts +5 -1
- package/dist/select.js +5 -5
- package/dist/slider.js +1 -1
- package/dist/sort-button.js +2 -2
- package/dist/switch.js +1 -1
- package/dist/tabs.js +2 -2
- package/dist/{theme-Ct-q58xz.d.ts → theme-TefB8vtl.d.ts} +2 -2
- package/dist/theme.d.ts +2 -2
- package/dist/theme.js +1 -1
- package/dist/theme.schema.json +30 -30
- package/dist/toast.d.ts +2 -2
- package/dist/toast.js +2 -2
- package/dist/toggle-group.js +2 -2
- package/dist/tooltip.js +1 -1
- package/dist/zag.d.ts +11 -2
- package/dist/zag.js +1 -1
- package/docs/theming.md +217 -217
- package/docs/what-to-change.md +20 -20
- package/docs/writing-a-component.md +250 -250
- package/llms.txt +3 -3
- package/package.json +90 -90
- package/registry/badge.ts +119 -119
- package/registry/bar-chart.ts +215 -215
- package/registry/button.ts +387 -387
- package/registry/callout-bubble.ts +347 -347
- package/registry/card.ts +379 -379
- package/registry/checkbox.ts +234 -234
- package/registry/collapsible.ts +271 -271
- package/registry/color-picker.ts +582 -582
- package/registry/context-menu.ts +208 -208
- package/registry/data-table.ts +215 -215
- package/registry/date-picker.ts +483 -483
- package/registry/dialog.ts +551 -551
- package/registry/donut.ts +145 -145
- package/registry/drawer.ts +636 -636
- package/registry/dropdown-menu.ts +765 -762
- package/registry/empty.ts +91 -91
- package/registry/field.ts +584 -584
- package/registry/{stat.ts → figure.ts} +96 -96
- package/registry/glyph-select.ts +268 -268
- package/registry/hover-card.ts +222 -222
- package/registry/input-group.ts +229 -229
- package/registry/input.ts +181 -181
- package/registry/item.ts +376 -376
- package/registry/kbd.ts +64 -64
- package/registry/line-chart.ts +218 -218
- package/registry/month-grid.ts +328 -328
- package/registry/number-input.ts +443 -443
- package/registry/popover.ts +368 -368
- package/registry/scatter-chart.ts +221 -221
- package/registry/select.ts +629 -620
- package/registry/slider.ts +259 -259
- package/registry/sort-button.ts +189 -189
- package/registry/sparkline.ts +114 -114
- package/registry/switch.ts +205 -205
- package/registry/tabs.ts +426 -426
- package/registry/text-area.ts +186 -186
- package/registry/toast.ts +965 -965
- package/registry/toggle-group.ts +295 -295
- package/registry/tooltip.ts +156 -156
- package/registry/treemap.ts +847 -847
- package/skills/theming-vela-ui/SKILL.md +137 -137
- package/skills/using-vela-ui-components/SKILL.md +141 -139
- package/skills/writing-vela-ui-components/SKILL.md +163 -163
- package/src/components/badge.ts +119 -119
- package/src/components/bar-chart.ts +215 -215
- package/src/components/button.ts +387 -387
- package/src/components/callout-bubble.ts +347 -347
- package/src/components/card.ts +379 -379
- package/src/components/checkbox.ts +234 -234
- package/src/components/collapsible.ts +271 -271
- package/src/components/color-picker.ts +582 -582
- package/src/components/context-menu.ts +208 -208
- package/src/components/data-table.ts +215 -215
- package/src/components/date-picker.ts +483 -483
- package/src/components/dialog.ts +551 -551
- package/src/components/donut.ts +145 -145
- package/src/components/drawer.ts +636 -636
- package/src/components/dropdown-menu.ts +765 -762
- package/src/components/empty.ts +91 -91
- package/src/components/field.ts +584 -584
- package/src/components/{stat.ts → figure.ts} +96 -96
- package/src/components/glyph-select.ts +268 -268
- package/src/components/hover-card.ts +222 -222
- package/src/components/input-group.ts +229 -229
- package/src/components/input.ts +181 -181
- package/src/components/item.ts +376 -376
- package/src/components/kbd.ts +64 -64
- package/src/components/line-chart.ts +218 -218
- package/src/components/month-grid.ts +328 -328
- package/src/components/number-input.ts +443 -443
- package/src/components/popover.ts +368 -368
- package/src/components/scatter-chart.ts +221 -221
- package/src/components/select.ts +629 -620
- package/src/components/slider.ts +259 -259
- package/src/components/sort-button.ts +189 -189
- package/src/components/sparkline.ts +114 -114
- package/src/components/switch.ts +205 -205
- package/src/components/tabs.ts +426 -426
- package/src/components/text-area.ts +186 -186
- package/src/components/toast.ts +965 -965
- package/src/components/toggle-group.ts +295 -295
- package/src/components/tooltip.ts +156 -156
- package/src/components/treemap.ts +847 -847
- package/src/index.ts +24 -24
- package/src/lib/calendar.ts +117 -117
- package/src/lib/chart.ts +72 -72
- package/src/lib/color.ts +89 -89
- package/src/lib/component-index.ts +163 -163
- package/src/lib/css.ts +48 -48
- package/src/lib/define.ts +45 -45
- package/src/lib/dispose.ts +36 -36
- package/src/lib/h.ts +55 -55
- package/src/lib/headless.ts +16 -16
- package/src/lib/i18n.ts +30 -30
- package/src/lib/icons.ts +253 -244
- package/src/lib/kit-text.ts +26 -26
- package/src/lib/page.ts +24 -24
- package/src/lib/palette.ts +81 -81
- package/src/lib/placement.ts +188 -188
- package/src/lib/scope.ts +135 -135
- package/src/lib/styles.ts +53 -53
- package/src/lib/surface-events.ts +31 -31
- package/src/lib/surface-exit.ts +87 -87
- package/src/lib/t.ts +68 -68
- package/src/lib/theme.ts +684 -670
- package/src/lib/tokens.ts +110 -110
- package/src/lib/variants.ts +32 -32
- package/src/lib/zag.ts +61 -46
- package/stylelint/index.mjs +60 -60
- package/stylelint/lint.mjs +81 -81
- package/stylelint/plugin.mjs +115 -115
- package/dist/chunk-P4MTEMT7.js +0 -23
- package/dist/stat.js +0 -41
package/cli/index.mjs
CHANGED
|
@@ -1,154 +1,154 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// vela-ui: add a component to a project, copy its source for a variant of your own, see what
|
|
3
|
-
// changed upstream since, and check the project.
|
|
4
|
-
import { spawnSync } from 'node:child_process';
|
|
5
|
-
import { join, relative, resolve } from 'node:path';
|
|
6
|
-
import { createInterface } from 'node:readline/promises';
|
|
7
|
-
import { pathToFileURL } from 'node:url';
|
|
8
|
-
import { parseArgs } from 'node:util';
|
|
9
|
-
import * as engine from './engine.mjs';
|
|
10
|
-
|
|
11
|
-
const USAGE = `Usage: vela-ui <command> [options]
|
|
12
|
-
|
|
13
|
-
list the components
|
|
14
|
-
add <component> make ${engine.PACKAGE} a direct dependency and print the import
|
|
15
|
-
add <component> --source copy the component's source, for a variant of your own
|
|
16
|
-
--as <name> the copy's component name (default: app-<component>)
|
|
17
|
-
--force overwrite an existing copy
|
|
18
|
-
diff <copy> what changed upstream since the copy was made
|
|
19
|
-
--accept record that the copy has taken those changes in
|
|
20
|
-
check one copy of the package, no copy behind it, the theme file valid
|
|
21
|
-
|
|
22
|
-
--cwd <path> the project (default: the current folder)
|
|
23
|
-
--from <path> read the catalog from a checkout instead of this package
|
|
24
|
-
--agents add the note for coding agents to AGENTS.md without asking
|
|
25
|
-
--no-install print the install command instead of running it`;
|
|
26
|
-
|
|
27
|
-
const say = (text = '') => process.stdout.write(`${text}\n`);
|
|
28
|
-
const fail = (text) => {
|
|
29
|
-
process.stderr.write(`vela-ui: ${text}\n`);
|
|
30
|
-
process.exit(1);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
let parsed;
|
|
34
|
-
try {
|
|
35
|
-
parsed = parseArgs({
|
|
36
|
-
allowPositionals: true,
|
|
37
|
-
options: {
|
|
38
|
-
source: { type: 'boolean' },
|
|
39
|
-
as: { type: 'string' },
|
|
40
|
-
force: { type: 'boolean' },
|
|
41
|
-
accept: { type: 'boolean' },
|
|
42
|
-
from: { type: 'string' },
|
|
43
|
-
cwd: { type: 'string' },
|
|
44
|
-
agents: { type: 'boolean' },
|
|
45
|
-
'no-install': { type: 'boolean' },
|
|
46
|
-
help: { type: 'boolean', short: 'h' },
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
} catch (e) {
|
|
50
|
-
fail(`${e.message}\n\n${USAGE}`);
|
|
51
|
-
}
|
|
52
|
-
const { values, positionals } = parsed;
|
|
53
|
-
const [command, name] = positionals;
|
|
54
|
-
if (!command || values.help) {
|
|
55
|
-
say(USAGE);
|
|
56
|
-
process.exit(command || values.help ? 0 : 1);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const cwd = resolve(values.cwd ?? process.cwd());
|
|
60
|
-
let catalog;
|
|
61
|
-
try {
|
|
62
|
-
catalog = engine.readCatalog(values.from);
|
|
63
|
-
} catch (e) {
|
|
64
|
-
fail(e.message);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
async function offerAgentsNote() {
|
|
68
|
-
if (engine.hasAgentsBlock(cwd)) return;
|
|
69
|
-
let yes = values.agents === true;
|
|
70
|
-
if (!yes && process.stdin.isTTY) {
|
|
71
|
-
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
72
|
-
const answer = await rl.question('Add a note to AGENTS.md pointing coding agents at the kit\'s reference? [Y/n] ');
|
|
73
|
-
rl.close();
|
|
74
|
-
yes = !/^n/i.test(answer.trim());
|
|
75
|
-
}
|
|
76
|
-
if (yes) {
|
|
77
|
-
engine.writeAgentsBlock(cwd);
|
|
78
|
-
say('Added the note to AGENTS.md.');
|
|
79
|
-
} else if (!process.stdin.isTTY) say('Tip: `vela-ui add <component> --agents` adds a note to AGENTS.md pointing coding agents at the kit\'s reference.');
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function ensureDependency() {
|
|
83
|
-
if (engine.isDirectDependency(cwd)) return;
|
|
84
|
-
const cmd = engine.installCommand(engine.detectPackageManager(cwd), `${engine.PACKAGE}@^${catalog.version}`);
|
|
85
|
-
if (values['no-install']) {
|
|
86
|
-
say(`${engine.PACKAGE} is not a dependency of this project yet: ${cmd}`);
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
say(`$ ${cmd}`);
|
|
90
|
-
const run = spawnSync(cmd, { cwd, stdio: 'inherit', shell: true });
|
|
91
|
-
if (run.status !== 0) fail(`the install failed (${cmd}).`);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
switch (command) {
|
|
95
|
-
case 'list': {
|
|
96
|
-
for (const c of catalog.manifest.components) say(`${c.name.padEnd(16)} ${c.factory ?? ''}`.trimEnd());
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
case 'add': {
|
|
100
|
-
if (!name) fail('add needs a component: `vela-ui list` shows them.');
|
|
101
|
-
const item = engine.findItem(catalog, name);
|
|
102
|
-
if (!item) fail(`no component "${name}" in ${engine.PACKAGE} ${catalog.version}: \`vela-ui list\` shows them.`);
|
|
103
|
-
ensureDependency();
|
|
104
|
-
const factory = item.factory ?? item.exports[0];
|
|
105
|
-
if (values.source) {
|
|
106
|
-
const as = values.as ?? `app-${item.component ?? item.name}`;
|
|
107
|
-
if (!/^[a-z][a-z0-9-]*$/.test(as)) fail(`--as takes a lowercase name with dashes ("${as}").`);
|
|
108
|
-
let file;
|
|
109
|
-
try {
|
|
110
|
-
({ file } = engine.copyItem({ cwd, catalog, item, as, force: values.force }));
|
|
111
|
-
} catch (e) {
|
|
112
|
-
fail(e.message);
|
|
113
|
-
}
|
|
114
|
-
const alias = engine.readConfig(cwd).aliases?.ui;
|
|
115
|
-
const from = alias?.startsWith('#') ? `${alias}/${as}` : `./${relative(cwd, file).split('\\').join('/').replace(/\.ts$/, '')}`;
|
|
116
|
-
say(`Copied ${item.name} to ${relative(cwd, file)}, as the component "${as}" (its parts are data-slot="${as}…").`);
|
|
117
|
-
say(`Vela and the plugins keep rendering the package's ${item.name}.`);
|
|
118
|
-
say();
|
|
119
|
-
say(`import { ${factory} } from '${from}';`);
|
|
120
|
-
} else {
|
|
121
|
-
say(item.example ?? `import { ${factory} } from '${item.import}';`);
|
|
122
|
-
}
|
|
123
|
-
await offerAgentsNote();
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
case 'diff': {
|
|
127
|
-
if (!name) fail('diff needs a copy: the names are in vela-ui.lock.json.');
|
|
128
|
-
try {
|
|
129
|
-
const { entry, diff } = engine.upstreamDiff({ cwd, catalog, as: name });
|
|
130
|
-
if (!diff) say(`${name}: no change upstream since ${entry.version}.`);
|
|
131
|
-
else {
|
|
132
|
-
say(`${name}: ${entry.item}, ${entry.version} -> ${catalog.version} (- upstream when copied, + upstream now)\n`);
|
|
133
|
-
say(diff);
|
|
134
|
-
}
|
|
135
|
-
if (values.accept) {
|
|
136
|
-
engine.acceptUpstream({ cwd, catalog, as: name });
|
|
137
|
-
say(`\nRecorded ${name} as up to date with ${catalog.version}.`);
|
|
138
|
-
}
|
|
139
|
-
} catch (e) {
|
|
140
|
-
fail(e.message);
|
|
141
|
-
}
|
|
142
|
-
break;
|
|
143
|
-
}
|
|
144
|
-
case 'check': {
|
|
145
|
-
const { checkTheme } = await import(pathToFileURL(join(catalog.root, 'dist/theme.js')).href);
|
|
146
|
-
const findings = engine.checkProject({ cwd, catalog, checkTheme });
|
|
147
|
-
if (!findings.length) say('vela-ui check: all good.');
|
|
148
|
-
for (const f of findings) say(`${f.level === 'error' ? 'error' : 'warn '} ${f.text}`);
|
|
149
|
-
process.exit(findings.some((f) => f.level === 'error') ? 1 : 0);
|
|
150
|
-
break;
|
|
151
|
-
}
|
|
152
|
-
default:
|
|
153
|
-
fail(`unknown command "${command}".\n\n${USAGE}`);
|
|
154
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// vela-ui: add a component to a project, copy its source for a variant of your own, see what
|
|
3
|
+
// changed upstream since, and check the project.
|
|
4
|
+
import { spawnSync } from 'node:child_process';
|
|
5
|
+
import { join, relative, resolve } from 'node:path';
|
|
6
|
+
import { createInterface } from 'node:readline/promises';
|
|
7
|
+
import { pathToFileURL } from 'node:url';
|
|
8
|
+
import { parseArgs } from 'node:util';
|
|
9
|
+
import * as engine from './engine.mjs';
|
|
10
|
+
|
|
11
|
+
const USAGE = `Usage: vela-ui <command> [options]
|
|
12
|
+
|
|
13
|
+
list the components
|
|
14
|
+
add <component> make ${engine.PACKAGE} a direct dependency and print the import
|
|
15
|
+
add <component> --source copy the component's source, for a variant of your own
|
|
16
|
+
--as <name> the copy's component name (default: app-<component>)
|
|
17
|
+
--force overwrite an existing copy
|
|
18
|
+
diff <copy> what changed upstream since the copy was made
|
|
19
|
+
--accept record that the copy has taken those changes in
|
|
20
|
+
check one copy of the package, no copy behind it, the theme file valid
|
|
21
|
+
|
|
22
|
+
--cwd <path> the project (default: the current folder)
|
|
23
|
+
--from <path> read the catalog from a checkout instead of this package
|
|
24
|
+
--agents add the note for coding agents to AGENTS.md without asking
|
|
25
|
+
--no-install print the install command instead of running it`;
|
|
26
|
+
|
|
27
|
+
const say = (text = '') => process.stdout.write(`${text}\n`);
|
|
28
|
+
const fail = (text) => {
|
|
29
|
+
process.stderr.write(`vela-ui: ${text}\n`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
let parsed;
|
|
34
|
+
try {
|
|
35
|
+
parsed = parseArgs({
|
|
36
|
+
allowPositionals: true,
|
|
37
|
+
options: {
|
|
38
|
+
source: { type: 'boolean' },
|
|
39
|
+
as: { type: 'string' },
|
|
40
|
+
force: { type: 'boolean' },
|
|
41
|
+
accept: { type: 'boolean' },
|
|
42
|
+
from: { type: 'string' },
|
|
43
|
+
cwd: { type: 'string' },
|
|
44
|
+
agents: { type: 'boolean' },
|
|
45
|
+
'no-install': { type: 'boolean' },
|
|
46
|
+
help: { type: 'boolean', short: 'h' },
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
} catch (e) {
|
|
50
|
+
fail(`${e.message}\n\n${USAGE}`);
|
|
51
|
+
}
|
|
52
|
+
const { values, positionals } = parsed;
|
|
53
|
+
const [command, name] = positionals;
|
|
54
|
+
if (!command || values.help) {
|
|
55
|
+
say(USAGE);
|
|
56
|
+
process.exit(command || values.help ? 0 : 1);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const cwd = resolve(values.cwd ?? process.cwd());
|
|
60
|
+
let catalog;
|
|
61
|
+
try {
|
|
62
|
+
catalog = engine.readCatalog(values.from);
|
|
63
|
+
} catch (e) {
|
|
64
|
+
fail(e.message);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async function offerAgentsNote() {
|
|
68
|
+
if (engine.hasAgentsBlock(cwd)) return;
|
|
69
|
+
let yes = values.agents === true;
|
|
70
|
+
if (!yes && process.stdin.isTTY) {
|
|
71
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
72
|
+
const answer = await rl.question('Add a note to AGENTS.md pointing coding agents at the kit\'s reference? [Y/n] ');
|
|
73
|
+
rl.close();
|
|
74
|
+
yes = !/^n/i.test(answer.trim());
|
|
75
|
+
}
|
|
76
|
+
if (yes) {
|
|
77
|
+
engine.writeAgentsBlock(cwd);
|
|
78
|
+
say('Added the note to AGENTS.md.');
|
|
79
|
+
} else if (!process.stdin.isTTY) say('Tip: `vela-ui add <component> --agents` adds a note to AGENTS.md pointing coding agents at the kit\'s reference.');
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function ensureDependency() {
|
|
83
|
+
if (engine.isDirectDependency(cwd)) return;
|
|
84
|
+
const cmd = engine.installCommand(engine.detectPackageManager(cwd), `${engine.PACKAGE}@^${catalog.version}`);
|
|
85
|
+
if (values['no-install']) {
|
|
86
|
+
say(`${engine.PACKAGE} is not a dependency of this project yet: ${cmd}`);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
say(`$ ${cmd}`);
|
|
90
|
+
const run = spawnSync(cmd, { cwd, stdio: 'inherit', shell: true });
|
|
91
|
+
if (run.status !== 0) fail(`the install failed (${cmd}).`);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
switch (command) {
|
|
95
|
+
case 'list': {
|
|
96
|
+
for (const c of catalog.manifest.components) say(`${c.name.padEnd(16)} ${c.factory ?? ''}`.trimEnd());
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
case 'add': {
|
|
100
|
+
if (!name) fail('add needs a component: `vela-ui list` shows them.');
|
|
101
|
+
const item = engine.findItem(catalog, name);
|
|
102
|
+
if (!item) fail(`no component "${name}" in ${engine.PACKAGE} ${catalog.version}: \`vela-ui list\` shows them.`);
|
|
103
|
+
ensureDependency();
|
|
104
|
+
const factory = item.factory ?? item.exports[0];
|
|
105
|
+
if (values.source) {
|
|
106
|
+
const as = values.as ?? `app-${item.component ?? item.name}`;
|
|
107
|
+
if (!/^[a-z][a-z0-9-]*$/.test(as)) fail(`--as takes a lowercase name with dashes ("${as}").`);
|
|
108
|
+
let file;
|
|
109
|
+
try {
|
|
110
|
+
({ file } = engine.copyItem({ cwd, catalog, item, as, force: values.force }));
|
|
111
|
+
} catch (e) {
|
|
112
|
+
fail(e.message);
|
|
113
|
+
}
|
|
114
|
+
const alias = engine.readConfig(cwd).aliases?.ui;
|
|
115
|
+
const from = alias?.startsWith('#') ? `${alias}/${as}` : `./${relative(cwd, file).split('\\').join('/').replace(/\.ts$/, '')}`;
|
|
116
|
+
say(`Copied ${item.name} to ${relative(cwd, file)}, as the component "${as}" (its parts are data-slot="${as}…").`);
|
|
117
|
+
say(`Vela and the plugins keep rendering the package's ${item.name}.`);
|
|
118
|
+
say();
|
|
119
|
+
say(`import { ${factory} } from '${from}';`);
|
|
120
|
+
} else {
|
|
121
|
+
say(item.example ?? `import { ${factory} } from '${item.import}';`);
|
|
122
|
+
}
|
|
123
|
+
await offerAgentsNote();
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
case 'diff': {
|
|
127
|
+
if (!name) fail('diff needs a copy: the names are in vela-ui.lock.json.');
|
|
128
|
+
try {
|
|
129
|
+
const { entry, diff } = engine.upstreamDiff({ cwd, catalog, as: name });
|
|
130
|
+
if (!diff) say(`${name}: no change upstream since ${entry.version}.`);
|
|
131
|
+
else {
|
|
132
|
+
say(`${name}: ${entry.item}, ${entry.version} -> ${catalog.version} (- upstream when copied, + upstream now)\n`);
|
|
133
|
+
say(diff);
|
|
134
|
+
}
|
|
135
|
+
if (values.accept) {
|
|
136
|
+
engine.acceptUpstream({ cwd, catalog, as: name });
|
|
137
|
+
say(`\nRecorded ${name} as up to date with ${catalog.version}.`);
|
|
138
|
+
}
|
|
139
|
+
} catch (e) {
|
|
140
|
+
fail(e.message);
|
|
141
|
+
}
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
case 'check': {
|
|
145
|
+
const { checkTheme } = await import(pathToFileURL(join(catalog.root, 'dist/theme.js')).href);
|
|
146
|
+
const findings = engine.checkProject({ cwd, catalog, checkTheme });
|
|
147
|
+
if (!findings.length) say('vela-ui check: all good.');
|
|
148
|
+
for (const f of findings) say(`${f.level === 'error' ? 'error' : 'warn '} ${f.text}`);
|
|
149
|
+
process.exit(findings.some((f) => f.level === 'error') ? 1 : 0);
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
default:
|
|
153
|
+
fail(`unknown command "${command}".\n\n${USAGE}`);
|
|
154
|
+
}
|
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
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Popover } from './chunk-
|
|
1
|
+
import { Popover } from './chunk-BWSOMG3G.js';
|
|
2
2
|
import './chunk-J2QJATCD.js';
|
|
3
3
|
import './chunk-S7USVSYP.js';
|
|
4
|
-
import './chunk-
|
|
4
|
+
import './chunk-RH53NQGE.js';
|
|
5
5
|
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
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
3
|
+
import './chunk-GUIYFQ27.js';
|
|
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
|
-
import { openPopoverTrigger, closeOpenPopovers, Popover } from './chunk-
|
|
2
|
-
import { iconEl } from './chunk-
|
|
1
|
+
import { openPopoverTrigger, closeOpenPopovers, Popover } from './chunk-BWSOMG3G.js';
|
|
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';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { kitTranslator } from './chunk-FVH6L7FM.js';
|
|
2
2
|
import { msg, textOf } from './chunk-FN2BUFNM.js';
|
|
3
3
|
import { ownTeardown } from './chunk-A72NWYNP.js';
|
|
4
|
-
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-
|
|
5
|
-
import { iconEl } from './chunk-
|
|
4
|
+
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-GUIYFQ27.js';
|
|
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
|
-
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-
|
|
3
|
-
import { iconEl } from './chunk-
|
|
2
|
+
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-GUIYFQ27.js';
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import { announceSurface } from './chunk-J2QJATCD.js';
|
|
2
2
|
import { holdForExit } from './chunk-S7USVSYP.js';
|
|
3
|
-
import { floatingLayerHost, ensureUIHost } from './chunk-
|
|
3
|
+
import { floatingLayerHost, ensureUIHost } from './chunk-RH53NQGE.js';
|
|
4
4
|
import { viewportRect, insetRect, intersectRects, placePopover } from './chunk-3Q32K4PE.js';
|
|
5
5
|
import { disposeWithin } from './chunk-A72NWYNP.js';
|
|
6
6
|
import { h } from './chunk-Q6WTDVH6.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"/>')
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { pageUid } from './chunk-X66RJAIS.js';
|
|
2
|
+
import { spreadProps as spreadProps$1, VanillaMachine } from '@zag-js/vanilla';
|
|
3
|
+
export { normalizeProps } from '@zag-js/vanilla';
|
|
4
|
+
|
|
5
|
+
function spreadProps(...[node, attrs, machineId]) {
|
|
6
|
+
const style = attrs["style"];
|
|
7
|
+
if (style === null || typeof style !== "object") return spreadProps$1(node, attrs, machineId);
|
|
8
|
+
const set = {};
|
|
9
|
+
for (const [key, value] of Object.entries(style)) if (value != null) set[key] = value;
|
|
10
|
+
return spreadProps$1(node, { ...attrs, style: set }, machineId);
|
|
11
|
+
}
|
|
12
|
+
function runMachine(machine, props, render) {
|
|
13
|
+
const m = new VanillaMachine(machine, props);
|
|
14
|
+
const unsub = m.subscribe(render);
|
|
15
|
+
m.start();
|
|
16
|
+
render(m.service);
|
|
17
|
+
return {
|
|
18
|
+
service: m.service,
|
|
19
|
+
flush: () => render(m.service),
|
|
20
|
+
stop: () => {
|
|
21
|
+
unsub();
|
|
22
|
+
m.stop();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function nextUid(prefix) {
|
|
27
|
+
return pageUid(prefix);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { nextUid, runMachine, spreadProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { openPopoverTrigger, closeOpenPopovers, Popover } from './chunk-
|
|
1
|
+
import { openPopoverTrigger, closeOpenPopovers, Popover } from './chunk-BWSOMG3G.js';
|
|
2
2
|
import { ownTeardown } from './chunk-A72NWYNP.js';
|
|
3
|
-
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-
|
|
4
|
-
import { iconEl } from './chunk-
|
|
3
|
+
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-GUIYFQ27.js';
|
|
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;
|
|
@@ -2,10 +2,10 @@ import { kitTranslator } from './chunk-FVH6L7FM.js';
|
|
|
2
2
|
import { msg, textOf } from './chunk-FN2BUFNM.js';
|
|
3
3
|
import { announceSurface } from './chunk-J2QJATCD.js';
|
|
4
4
|
import { holdForExit } from './chunk-S7USVSYP.js';
|
|
5
|
-
import { floatingLayerHost } from './chunk-
|
|
5
|
+
import { floatingLayerHost } from './chunk-RH53NQGE.js';
|
|
6
6
|
import { zagPositioning, splitPlacement } from './chunk-3Q32K4PE.js';
|
|
7
|
-
import { normalizeProps, nextUid, runMachine, spreadProps } from './chunk-
|
|
8
|
-
import { iconEl } from './chunk-
|
|
7
|
+
import { normalizeProps, nextUid, runMachine, spreadProps } from './chunk-GUIYFQ27.js';
|
|
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
|
}
|
|
@@ -71,6 +71,10 @@ var KIT_COMPONENTS = {
|
|
|
71
71
|
parts: ["grid", "row", "span", "label", "cell", "bool", "stacked", "stacked-head", "inline", "inline-item", "toggle-label", "section", "sep"],
|
|
72
72
|
settings: []
|
|
73
73
|
},
|
|
74
|
+
figure: {
|
|
75
|
+
parts: ["root", "label", "value", "sub"],
|
|
76
|
+
settings: []
|
|
77
|
+
},
|
|
74
78
|
"glyph-select": {
|
|
75
79
|
parts: ["root", "value", "icon", "content", "item"],
|
|
76
80
|
settings: ["radius", "content-radius", "focus-ring"]
|
|
@@ -131,10 +135,6 @@ var KIT_COMPONENTS = {
|
|
|
131
135
|
parts: ["root", "area", "baseline", "line"],
|
|
132
136
|
settings: ["stroke-width"]
|
|
133
137
|
},
|
|
134
|
-
stat: {
|
|
135
|
-
parts: ["root", "label", "value", "sub"],
|
|
136
|
-
settings: []
|
|
137
|
-
},
|
|
138
138
|
switch: {
|
|
139
139
|
parts: ["root", "control", "thumb"],
|
|
140
140
|
settings: ["width", "height", "thumb-size", "width-sm", "height-sm", "thumb-size-sm"]
|
|
@@ -539,6 +539,20 @@ ${STATIC_DECLS}
|
|
|
539
539
|
@supports not selector(::-webkit-scrollbar) {
|
|
540
540
|
:where(.vela-ui, .vela-ui-layer, .vela-ui *, .vela-ui-layer *) { scrollbar-width: thin; scrollbar-color: var(--vela-scroll) transparent; }
|
|
541
541
|
}
|
|
542
|
+
/* A search field's clear cross in the theme's ink: Chromium and Safari otherwise draw their own,
|
|
543
|
+
blue on some systems. */
|
|
544
|
+
:where(.vela-ui, .vela-ui-layer) :where(input[type='search'])::-webkit-search-cancel-button {
|
|
545
|
+
-webkit-appearance: none;
|
|
546
|
+
appearance: none;
|
|
547
|
+
flex: none;
|
|
548
|
+
width: 12px;
|
|
549
|
+
height: 12px;
|
|
550
|
+
margin-inline-start: 4px;
|
|
551
|
+
cursor: pointer;
|
|
552
|
+
background-color: var(--vela-fg-bright);
|
|
553
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 2.5l7 7m0-7l-7 7' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
|
|
554
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 2.5l7 7m0-7l-7 7' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
|
|
555
|
+
}
|
|
542
556
|
}
|
|
543
557
|
.vela-ui, .vela-ui-layer {
|
|
544
558
|
font-family: var(--vela-font, -apple-system, system-ui, sans-serif);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { kitTranslator } from './chunk-FVH6L7FM.js';
|
|
2
2
|
import { msg, textOf } from './chunk-FN2BUFNM.js';
|
|
3
|
-
import { openPopoverTrigger, closeOpenPopovers, Popover } from './chunk-
|
|
3
|
+
import { openPopoverTrigger, closeOpenPopovers, Popover } from './chunk-BWSOMG3G.js';
|
|
4
4
|
import { ACCENT_BRIGHT, ACCENT, BULLISH, BEARISH, WARNING, NEUTRAL } from './chunk-MMTMOV6R.js';
|
|
5
5
|
import { ownTeardown, disposeWithin } from './chunk-A72NWYNP.js';
|
|
6
|
-
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-
|
|
6
|
+
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-GUIYFQ27.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/collapsible.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { nextUid } from './chunk-
|
|
2
|
-
import { iconEl } from './chunk-
|
|
1
|
+
import { nextUid } from './chunk-GUIYFQ27.js';
|
|
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/color-picker.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export { ColorField, blendOver, buildColorPicker, buildPalette, closeColorPopover, colorField, colorPickerController, colorPickerDef, combineColor, createColorField, hslHex, splitColor, transparencyChecker } from './chunk-
|
|
1
|
+
export { ColorField, blendOver, buildColorPicker, buildPalette, closeColorPopover, colorField, colorPickerController, colorPickerDef, combineColor, createColorField, hslHex, splitColor, transparencyChecker } from './chunk-TGJNHUYV.js';
|
|
2
2
|
import './chunk-FVH6L7FM.js';
|
|
3
3
|
import './chunk-FN2BUFNM.js';
|
|
4
|
-
import './chunk-
|
|
4
|
+
import './chunk-BWSOMG3G.js';
|
|
5
5
|
import './chunk-J2QJATCD.js';
|
|
6
6
|
import './chunk-S7USVSYP.js';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-RH53NQGE.js';
|
|
8
8
|
import './chunk-TAKSIV57.js';
|
|
9
9
|
import './chunk-MMTMOV6R.js';
|
|
10
10
|
import './chunk-3Q32K4PE.js';
|
|
11
11
|
import './chunk-A72NWYNP.js';
|
|
12
|
-
import './chunk-
|
|
12
|
+
import './chunk-GUIYFQ27.js';
|
|
13
13
|
import './chunk-Q6WTDVH6.js';
|
|
14
14
|
import './chunk-6QCILIT2.js';
|
|
15
15
|
import './chunk-VMCR3S2A.js';
|