@luxalgo/vela-ui 0.3.0 → 0.4.0
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 +153 -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/callout-bubble.js +2 -2
- package/dist/checkbox.js +2 -2
- package/dist/{chunk-KKS6NEGI.js → chunk-BWSOMG3G.js} +1 -1
- package/dist/chunk-GUIYFQ27.js +30 -0
- package/dist/{chunk-B2EZB5ZG.js → chunk-KUWTI2PE.js} +2 -2
- package/dist/{chunk-WWHNUKSZ.js → chunk-QGWAN3EP.js} +2 -2
- package/dist/{chunk-TBXUF5YX.js → chunk-RH53NQGE.js} +18 -4
- package/dist/{chunk-IOOYDSSK.js → chunk-SKFAYTDK.js} +1 -1
- package/dist/{chunk-OQXFQMZM.js → chunk-TGJNHUYV.js} +2 -2
- package/dist/{chunk-UEO6W37Z.js → chunk-VC7SVSDK.js} +1 -1
- package/dist/{chunk-OJ2SEMN6.js → chunk-YT2BSP7O.js} +1 -1
- package/dist/collapsible.js +1 -1
- package/dist/color-picker.js +4 -4
- package/dist/context-menu.js +3 -3
- package/dist/dialog.js +3 -3
- package/dist/donut.d.ts +1 -1
- package/dist/drawer.js +1 -1
- package/dist/dropdown-menu.js +3 -3
- package/dist/field.js +8 -8
- package/dist/{stat.d.ts → figure.d.ts} +9 -9
- package/dist/figure.js +41 -0
- package/dist/glyph-select.js +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/manifest.json +74 -74
- package/dist/number-input.js +2 -2
- package/dist/popover.js +2 -2
- package/dist/select.d.ts +1 -1
- package/dist/select.js +4 -4
- package/dist/slider.js +1 -1
- package/dist/sort-button.js +1 -1
- package/dist/switch.js +1 -1
- package/dist/tabs.js +1 -1
- 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 +1 -1
- package/dist/toggle-group.js +1 -1
- 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 +762 -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 +620 -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 +139 -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 +762 -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 +620 -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 +244 -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/callout-bubble.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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';
|
package/dist/checkbox.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { Checkbox, checkboxController, checkboxDef, checkboxVariants, createCheckbox } from './chunk-
|
|
1
|
+
export { Checkbox, checkboxController, checkboxDef, checkboxVariants, createCheckbox } from './chunk-SKFAYTDK.js';
|
|
2
2
|
import './chunk-A72NWYNP.js';
|
|
3
|
-
import './chunk-
|
|
3
|
+
import './chunk-GUIYFQ27.js';
|
|
4
4
|
import './chunk-C3PXY2SW.js';
|
|
5
5
|
import './chunk-LZWZV2ZS.js';
|
|
6
6
|
import './chunk-Q6WTDVH6.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';
|
|
@@ -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 };
|
|
@@ -2,9 +2,9 @@ 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-
|
|
7
|
+
import { normalizeProps, nextUid, runMachine, spreadProps } from './chunk-GUIYFQ27.js';
|
|
8
8
|
import { iconEl } from './chunk-C3PXY2SW.js';
|
|
9
9
|
import { addSlot } from './chunk-Q6WTDVH6.js';
|
|
10
10
|
import { t } from './chunk-6QCILIT2.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
3
|
+
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-GUIYFQ27.js';
|
|
4
4
|
import { iconEl } from './chunk-C3PXY2SW.js';
|
|
5
5
|
import { variants } from './chunk-LZWZV2ZS.js';
|
|
6
6
|
import { addSlot, h } from './chunk-Q6WTDVH6.js';
|
|
@@ -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,5 +1,5 @@
|
|
|
1
1
|
import { ownTeardown } from './chunk-A72NWYNP.js';
|
|
2
|
-
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-
|
|
2
|
+
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-GUIYFQ27.js';
|
|
3
3
|
import { iconEl } from './chunk-C3PXY2SW.js';
|
|
4
4
|
import { variants } from './chunk-LZWZV2ZS.js';
|
|
5
5
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
@@ -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';
|
|
@@ -1,7 +1,7 @@
|
|
|
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-
|
|
4
|
+
import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-GUIYFQ27.js';
|
|
5
5
|
import { iconEl } from './chunk-C3PXY2SW.js';
|
|
6
6
|
import { variants } from './chunk-LZWZV2ZS.js';
|
|
7
7
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { openPopoverTrigger, closeOpenPopovers, Popover } from './chunk-
|
|
1
|
+
import { openPopoverTrigger, closeOpenPopovers, Popover } from './chunk-BWSOMG3G.js';
|
|
2
2
|
import { iconEl } from './chunk-C3PXY2SW.js';
|
|
3
3
|
import { h } from './chunk-Q6WTDVH6.js';
|
|
4
4
|
import { t } from './chunk-6QCILIT2.js';
|
package/dist/collapsible.js
CHANGED
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';
|
package/dist/context-menu.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { DropdownMenu } from './chunk-
|
|
1
|
+
import { DropdownMenu } from './chunk-KUWTI2PE.js';
|
|
2
2
|
import { kitTranslator } from './chunk-FVH6L7FM.js';
|
|
3
3
|
import './chunk-FN2BUFNM.js';
|
|
4
4
|
import './chunk-J2QJATCD.js';
|
|
5
5
|
import './chunk-S7USVSYP.js';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-RH53NQGE.js';
|
|
7
7
|
import './chunk-TAKSIV57.js';
|
|
8
8
|
import './chunk-MMTMOV6R.js';
|
|
9
9
|
import './chunk-3Q32K4PE.js';
|
|
10
10
|
import { ownTeardown } from './chunk-A72NWYNP.js';
|
|
11
|
-
import './chunk-
|
|
11
|
+
import './chunk-GUIYFQ27.js';
|
|
12
12
|
import './chunk-C3PXY2SW.js';
|
|
13
13
|
import './chunk-Q6WTDVH6.js';
|
|
14
14
|
import './chunk-6QCILIT2.js';
|
package/dist/dialog.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { kitTranslator } from './chunk-FVH6L7FM.js';
|
|
2
2
|
import { msg, textOf } from './chunk-FN2BUFNM.js';
|
|
3
|
-
import { isPopoverOpen, eventDismissedPopover, closeOpenPopovers } from './chunk-
|
|
3
|
+
import { isPopoverOpen, eventDismissedPopover, closeOpenPopovers } from './chunk-BWSOMG3G.js';
|
|
4
4
|
import { announceSurface } from './chunk-J2QJATCD.js';
|
|
5
5
|
import { holdForExit } from './chunk-S7USVSYP.js';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-RH53NQGE.js';
|
|
7
7
|
import './chunk-TAKSIV57.js';
|
|
8
8
|
import './chunk-MMTMOV6R.js';
|
|
9
9
|
import './chunk-3Q32K4PE.js';
|
|
10
10
|
import { disposeWithin } from './chunk-A72NWYNP.js';
|
|
11
|
-
import { normalizeProps, nextUid, runMachine, spreadProps } from './chunk-
|
|
11
|
+
import { normalizeProps, nextUid, runMachine, spreadProps } from './chunk-GUIYFQ27.js';
|
|
12
12
|
import { iconEl } from './chunk-C3PXY2SW.js';
|
|
13
13
|
import './chunk-Q6WTDVH6.js';
|
|
14
14
|
import { t } from './chunk-6QCILIT2.js';
|
package/dist/donut.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as ComponentDef } from './define-D5u3F5Dj.js';
|
|
2
2
|
import './t.js';
|
|
3
3
|
|
|
4
|
-
declare const donutDef: ComponentDef<"donut", "caption" | "figure" | "label" | "legend" | "track" | "root" | "
|
|
4
|
+
declare const donutDef: ComponentDef<"donut", "caption" | "figure" | "label" | "legend" | "track" | "root" | "value" | "swatch" | "ring" | "segment" | "item", "swatch-radius">;
|
|
5
5
|
interface DonutSegment {
|
|
6
6
|
value: number;
|
|
7
7
|
label: string;
|
package/dist/drawer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { announceSurface } from './chunk-J2QJATCD.js';
|
|
2
2
|
import { holdForExit } from './chunk-S7USVSYP.js';
|
|
3
3
|
import { disposeWithin } from './chunk-A72NWYNP.js';
|
|
4
|
-
import { normalizeProps, nextUid, runMachine, spreadProps } from './chunk-
|
|
4
|
+
import { normalizeProps, nextUid, runMachine, spreadProps } from './chunk-GUIYFQ27.js';
|
|
5
5
|
import { t } from './chunk-6QCILIT2.js';
|
|
6
6
|
import { defineComponent } from './chunk-VMCR3S2A.js';
|
|
7
7
|
import { defineStyles, css } from './chunk-XBEL4K33.js';
|
package/dist/dropdown-menu.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { DropdownMenu, createDropdownMenu, dropdownMenuController, dropdownMenuDef } from './chunk-
|
|
1
|
+
export { DropdownMenu, createDropdownMenu, dropdownMenuController, dropdownMenuDef } from './chunk-KUWTI2PE.js';
|
|
2
2
|
import './chunk-FVH6L7FM.js';
|
|
3
3
|
import './chunk-FN2BUFNM.js';
|
|
4
4
|
import './chunk-J2QJATCD.js';
|
|
5
5
|
import './chunk-S7USVSYP.js';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-RH53NQGE.js';
|
|
7
7
|
import './chunk-TAKSIV57.js';
|
|
8
8
|
import './chunk-MMTMOV6R.js';
|
|
9
9
|
import './chunk-3Q32K4PE.js';
|
|
10
|
-
import './chunk-
|
|
10
|
+
import './chunk-GUIYFQ27.js';
|
|
11
11
|
import './chunk-C3PXY2SW.js';
|
|
12
12
|
import './chunk-Q6WTDVH6.js';
|
|
13
13
|
import './chunk-6QCILIT2.js';
|
package/dist/field.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
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-VC7SVSDK.js';
|
|
3
|
+
import { Select } from './chunk-QGWAN3EP.js';
|
|
4
|
+
import { widthField } from './chunk-YT2BSP7O.js';
|
|
5
5
|
import { Input } from './chunk-5BJV5FY5.js';
|
|
6
|
-
import { ColorField } from './chunk-
|
|
6
|
+
import { ColorField } from './chunk-TGJNHUYV.js';
|
|
7
7
|
import './chunk-FVH6L7FM.js';
|
|
8
8
|
import './chunk-FN2BUFNM.js';
|
|
9
|
-
import './chunk-
|
|
9
|
+
import './chunk-BWSOMG3G.js';
|
|
10
10
|
import './chunk-J2QJATCD.js';
|
|
11
11
|
import './chunk-S7USVSYP.js';
|
|
12
|
-
import './chunk-
|
|
12
|
+
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-SKFAYTDK.js';
|
|
17
17
|
import { disposeWithin } from './chunk-A72NWYNP.js';
|
|
18
|
-
import './chunk-
|
|
18
|
+
import './chunk-GUIYFQ27.js';
|
|
19
19
|
import './chunk-C3PXY2SW.js';
|
|
20
20
|
import './chunk-LZWZV2ZS.js';
|
|
21
21
|
import './chunk-Q6WTDVH6.js';
|