@luxalgo/vela 0.6.7 → 0.6.9
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/dist/{DataProvider-BsQM2WNH.d.cts → DataProvider-8Z95Q-RJ.d.cts} +1 -1
- package/dist/{DataProvider-BSLlBpB9.d.ts → DataProvider-DExJrfut.d.ts} +1 -1
- package/dist/{chunk-2R7BANEM.js → chunk-62SVGONC.js} +2 -2
- package/dist/{chunk-6WFKTAT4.js → chunk-6WDDVMBJ.js} +548 -147
- package/dist/{chunk-L3I2CCYO.js → chunk-EQCHJZOT.js} +49 -2
- package/dist/{chunk-OICPLNU7.js → chunk-FCVIG7JG.js} +188 -2
- package/dist/{chunk-WVP4XV5A.js → chunk-STHSKXOR.js} +407 -159
- package/dist/{chunk-PN5KWFZ4.js → chunk-WFSZBX3R.js} +2 -2
- package/dist/{contributions-Z12BrWCy.d.ts → contributions-C1U2Krwg.d.cts} +112 -7
- package/dist/{contributions-Hv4_cOJo.d.cts → contributions-D7PVZO2i.d.ts} +112 -7
- package/dist/index.cjs +755 -152
- package/dist/index.d.cts +12 -7
- package/dist/index.d.ts +12 -7
- package/dist/index.js +4 -4
- package/dist/{options-BaVTMXaO.d.ts → options-FM0peknS.d.cts} +84 -7
- package/dist/{options-BaVTMXaO.d.cts → options-FM0peknS.d.ts} +84 -7
- package/dist/{plugin-9koBjc5H.d.ts → plugin-7bkF32Rk.d.ts} +3 -3
- package/dist/{plugin-BXhDHTYn.d.cts → plugin-DfVqBz9p.d.cts} +3 -3
- package/dist/plugin.cjs +18 -2
- package/dist/plugin.d.cts +4 -4
- package/dist/plugin.d.ts +4 -4
- package/dist/plugin.js +2 -2
- package/dist/providers/binance.d.cts +2 -2
- package/dist/providers/binance.d.ts +2 -2
- package/dist/providers/coinbase.d.cts +2 -2
- package/dist/providers/coinbase.d.ts +2 -2
- package/dist/providers/hyperliquid.d.cts +2 -2
- package/dist/providers/hyperliquid.d.ts +2 -2
- package/dist/{bottombar-Br4rzx_R.d.ts → statusline-DOPiT6I6.d.cts} +91 -6
- package/dist/{bottombar-Div5zibZ.d.cts → statusline-zdF4eZLr.d.ts} +91 -6
- package/dist/ui.cjs +201 -4
- package/dist/ui.d.cts +89 -2
- package/dist/ui.d.ts +89 -2
- package/dist/ui.js +3 -3
- package/dist/vela.global.js +755 -152
- package/dist/vela.global.min.js +93 -44
- package/dist/widget.cjs +1144 -271
- package/dist/widget.d.cts +12 -85
- package/dist/widget.d.ts +12 -85
- package/dist/widget.js +7 -7
- package/dist/workspace.cjs +1144 -271
- package/dist/workspace.d.cts +65 -11
- package/dist/workspace.d.ts +65 -11
- package/dist/workspace.js +6 -6
- package/package.json +1 -1
package/dist/ui.cjs
CHANGED
|
@@ -219,6 +219,12 @@ function registerIcon(id, svg) {
|
|
|
219
219
|
function iconMarkup(id) {
|
|
220
220
|
return registry.get(id) ?? null;
|
|
221
221
|
}
|
|
222
|
+
function icon(id) {
|
|
223
|
+
return registry.get(id) ?? "";
|
|
224
|
+
}
|
|
225
|
+
function iconAt(id, px) {
|
|
226
|
+
return icon(id).replace("<svg ", `<svg width="${px}" height="${px}" `);
|
|
227
|
+
}
|
|
222
228
|
function svg16(body, extra = "") {
|
|
223
229
|
return `<svg viewBox="0 0 16 16" width="1em" height="1em" ${extra ? extra + " " : ""}fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round">${body}</svg>`;
|
|
224
230
|
}
|
|
@@ -273,11 +279,11 @@ registerIcon(
|
|
|
273
279
|
);
|
|
274
280
|
registerIcon(
|
|
275
281
|
"market-pre",
|
|
276
|
-
svg24('<path d="M12 2v8"/><path d="m4.93 10.93 1.41 1.41"/><path d="M2 18h2"/><path d="M20 18h2"/><path d="m19.07 10.93-1.41 1.41"/><path d="M22 22H2"/><path d="
|
|
282
|
+
svg24('<path d="M12 2v8"/><path d="m4.93 10.93 1.41 1.41"/><path d="M2 18h2"/><path d="M20 18h2"/><path d="m19.07 10.93-1.41 1.41"/><path d="M22 22H2"/><path d="m8 6 4-4 4 4"/><path d="M16 18a4 4 0 0 0-8 0"/>')
|
|
277
283
|
);
|
|
278
284
|
registerIcon(
|
|
279
285
|
"market-post",
|
|
280
|
-
svg24('<path d="M12 10V2"/><path d="m4.93 10.93 1.41 1.41"/><path d="M2 18h2"/><path d="M20 18h2"/><path d="m19.07 10.93-1.41 1.41"/><path d="M22 22H2"/><path d="m16
|
|
286
|
+
svg24('<path d="M12 10V2"/><path d="m4.93 10.93 1.41 1.41"/><path d="M2 18h2"/><path d="M20 18h2"/><path d="m19.07 10.93-1.41 1.41"/><path d="M22 22H2"/><path d="m16 14-4 4-4-4"/><path d="M16 6a4 4 0 0 0-8 0"/>')
|
|
281
287
|
);
|
|
282
288
|
registerIcon("market-closed", svg24('<path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/>'));
|
|
283
289
|
registerIcon(
|
|
@@ -2358,12 +2364,12 @@ var NumberInput = class {
|
|
|
2358
2364
|
buildSteppers(doc, applyDir) {
|
|
2359
2365
|
const steps = doc.createElement("div");
|
|
2360
2366
|
steps.className = "vela-num-step";
|
|
2361
|
-
const mk = (dir,
|
|
2367
|
+
const mk = (dir, icon2, label) => {
|
|
2362
2368
|
const b = doc.createElement("button");
|
|
2363
2369
|
b.type = "button";
|
|
2364
2370
|
b.tabIndex = -1;
|
|
2365
2371
|
b.setAttribute("aria-label", label);
|
|
2366
|
-
b.appendChild(iconEl(
|
|
2372
|
+
b.appendChild(iconEl(icon2, doc));
|
|
2367
2373
|
let timer = 0;
|
|
2368
2374
|
const apply = () => applyDir(dir);
|
|
2369
2375
|
const stop = () => {
|
|
@@ -3396,6 +3402,192 @@ function buildFieldControl(desc) {
|
|
|
3396
3402
|
return { el };
|
|
3397
3403
|
}
|
|
3398
3404
|
|
|
3405
|
+
// src/ui/components/callout-bubble/controller.ts
|
|
3406
|
+
function closesPanel(item) {
|
|
3407
|
+
return item.close !== false;
|
|
3408
|
+
}
|
|
3409
|
+
function calloutPanelRows(items) {
|
|
3410
|
+
const rows = [];
|
|
3411
|
+
for (const item of items) {
|
|
3412
|
+
if (item.type === "text") {
|
|
3413
|
+
rows.push({ type: "text", text: item.text });
|
|
3414
|
+
continue;
|
|
3415
|
+
}
|
|
3416
|
+
const last = rows[rows.length - 1];
|
|
3417
|
+
if (last && last.type === "buttons") last.buttons.push(item);
|
|
3418
|
+
else rows.push({ type: "buttons", buttons: [item] });
|
|
3419
|
+
}
|
|
3420
|
+
return rows;
|
|
3421
|
+
}
|
|
3422
|
+
|
|
3423
|
+
// src/ui/components/callout-bubble/styles.ts
|
|
3424
|
+
var CALLOUT_STYLE_ID = "vela-ui-callout-bubble";
|
|
3425
|
+
var CALLOUT_CSS = `
|
|
3426
|
+
.vela-callout {
|
|
3427
|
+
display: inline-grid;
|
|
3428
|
+
place-items: center;
|
|
3429
|
+
border-radius: 50%;
|
|
3430
|
+
flex: none;
|
|
3431
|
+
line-height: 0;
|
|
3432
|
+
box-sizing: border-box;
|
|
3433
|
+
cursor: default;
|
|
3434
|
+
user-select: none;
|
|
3435
|
+
-webkit-user-select: none;
|
|
3436
|
+
}
|
|
3437
|
+
.vela-callout[role='button'] { cursor: pointer; }
|
|
3438
|
+
.vela-callout svg { display: block; }
|
|
3439
|
+
/* The deployed panel \u2014 carries the kit's elevated-card look itself (the popover
|
|
3440
|
+
shell is bare positioning chrome). */
|
|
3441
|
+
.vela-callout-panel {
|
|
3442
|
+
display: flex;
|
|
3443
|
+
flex-direction: column;
|
|
3444
|
+
gap: 8px;
|
|
3445
|
+
padding: 10px 12px;
|
|
3446
|
+
max-width: 280px;
|
|
3447
|
+
box-sizing: border-box;
|
|
3448
|
+
background: var(--vela-surface-elev);
|
|
3449
|
+
border: 1px solid var(--vela-border-strong);
|
|
3450
|
+
border-radius: 6px;
|
|
3451
|
+
box-shadow: var(--vela-shadow);
|
|
3452
|
+
color: var(--vela-fg);
|
|
3453
|
+
font: var(--vela-font-size-md) var(--vela-font);
|
|
3454
|
+
}
|
|
3455
|
+
.vela-callout-title { font-weight: 600; color: var(--vela-fg-bright); }
|
|
3456
|
+
.vela-callout-text { color: var(--vela-fg-muted); line-height: 1.45; white-space: pre-line; }
|
|
3457
|
+
.vela-callout-actions { display: flex; flex-wrap: wrap; gap: 8px; }
|
|
3458
|
+
.vela-callout-btn {
|
|
3459
|
+
cursor: pointer;
|
|
3460
|
+
height: 26px;
|
|
3461
|
+
padding: 0 10px;
|
|
3462
|
+
border-radius: 5px;
|
|
3463
|
+
border: 1px solid var(--vela-border);
|
|
3464
|
+
background: transparent;
|
|
3465
|
+
color: var(--vela-fg);
|
|
3466
|
+
font-size: var(--vela-font-size-md);
|
|
3467
|
+
font-family: inherit;
|
|
3468
|
+
transition: background var(--vela-dur-fast) ease, color var(--vela-dur-fast) ease, opacity var(--vela-dur-fast) ease, border-color var(--vela-dur-fast) ease;
|
|
3469
|
+
}
|
|
3470
|
+
.vela-callout-btn:hover { background: var(--vela-hover); color: var(--vela-fg-bright); border-color: var(--vela-fg-muted); }
|
|
3471
|
+
.vela-callout-btn-primary { border-color: var(--vela-selected-bg); background: var(--vela-selected-bg); color: var(--vela-selected-fg); }
|
|
3472
|
+
.vela-callout-btn-primary:hover { background: var(--vela-selected-bg); color: var(--vela-selected-fg); opacity: 0.85; border-color: var(--vela-selected-bg); }
|
|
3473
|
+
`;
|
|
3474
|
+
|
|
3475
|
+
// src/ui/components/callout-bubble/view.ts
|
|
3476
|
+
var CalloutBubble = class {
|
|
3477
|
+
constructor(opts) {
|
|
3478
|
+
this.pop = null;
|
|
3479
|
+
this.spec = { icon: opts.icon, background: opts.background, label: opts.label };
|
|
3480
|
+
if (opts.color !== void 0) this.spec.color = opts.color;
|
|
3481
|
+
if (opts.panel !== void 0) this.spec.panel = opts.panel;
|
|
3482
|
+
this.size = opts.size ?? 16;
|
|
3483
|
+
this.host = opts.host;
|
|
3484
|
+
this.theme = opts.theme;
|
|
3485
|
+
this.boundary = opts.boundary;
|
|
3486
|
+
const doc = (opts.host ?? document.body).ownerDocument;
|
|
3487
|
+
injectStyles(CALLOUT_STYLE_ID, CALLOUT_CSS, doc);
|
|
3488
|
+
this.el = doc.createElement("span");
|
|
3489
|
+
this.el.className = "vela-callout";
|
|
3490
|
+
this.el.style.width = `${this.size}px`;
|
|
3491
|
+
this.el.style.height = `${this.size}px`;
|
|
3492
|
+
this.el.addEventListener("click", (e) => {
|
|
3493
|
+
if (!this.spec.panel) return;
|
|
3494
|
+
e.stopPropagation();
|
|
3495
|
+
this.toggle();
|
|
3496
|
+
});
|
|
3497
|
+
this.el.addEventListener("dblclick", (e) => {
|
|
3498
|
+
if (this.spec.panel) e.stopPropagation();
|
|
3499
|
+
});
|
|
3500
|
+
this.el.addEventListener("keydown", (e) => {
|
|
3501
|
+
if (!this.spec.panel || e.key !== "Enter" && e.key !== " ") return;
|
|
3502
|
+
e.preventDefault();
|
|
3503
|
+
this.toggle();
|
|
3504
|
+
});
|
|
3505
|
+
this.dress();
|
|
3506
|
+
}
|
|
3507
|
+
/** Re-dress the bubble (a status change: new icon, tint, label, panel). */
|
|
3508
|
+
set(spec) {
|
|
3509
|
+
this.spec = { ...this.spec, ...spec };
|
|
3510
|
+
if ("panel" in spec) this.pop?.hide();
|
|
3511
|
+
this.dress();
|
|
3512
|
+
}
|
|
3513
|
+
/** Whether the deployed panel is currently open. */
|
|
3514
|
+
get open() {
|
|
3515
|
+
return this.pop?.open ?? false;
|
|
3516
|
+
}
|
|
3517
|
+
destroy() {
|
|
3518
|
+
this.pop?.destroy();
|
|
3519
|
+
this.pop = null;
|
|
3520
|
+
this.el.remove();
|
|
3521
|
+
}
|
|
3522
|
+
dress() {
|
|
3523
|
+
const clickable = this.spec.panel !== void 0;
|
|
3524
|
+
this.el.style.background = this.spec.background;
|
|
3525
|
+
this.el.style.color = this.spec.color ?? "";
|
|
3526
|
+
this.el.innerHTML = iconAt(this.spec.icon, this.size - 4);
|
|
3527
|
+
this.el.setAttribute("aria-label", this.spec.label);
|
|
3528
|
+
if (clickable) {
|
|
3529
|
+
this.el.setAttribute("role", "button");
|
|
3530
|
+
this.el.tabIndex = 0;
|
|
3531
|
+
} else {
|
|
3532
|
+
this.el.removeAttribute("role");
|
|
3533
|
+
this.el.removeAttribute("tabindex");
|
|
3534
|
+
}
|
|
3535
|
+
}
|
|
3536
|
+
toggle() {
|
|
3537
|
+
if (this.pop?.open) {
|
|
3538
|
+
this.pop.hide();
|
|
3539
|
+
return;
|
|
3540
|
+
}
|
|
3541
|
+
const panel = this.spec.panel;
|
|
3542
|
+
if (!panel) return;
|
|
3543
|
+
this.pop?.destroy();
|
|
3544
|
+
this.pop = new Popover({
|
|
3545
|
+
trigger: this.el,
|
|
3546
|
+
gap: 6,
|
|
3547
|
+
content: (body) => this.buildPanel(body, panel),
|
|
3548
|
+
...this.host ? { host: this.host } : {},
|
|
3549
|
+
...this.theme ? { theme: this.theme() } : {},
|
|
3550
|
+
...this.boundary ? { boundary: this.boundary } : {}
|
|
3551
|
+
});
|
|
3552
|
+
this.pop.show();
|
|
3553
|
+
}
|
|
3554
|
+
buildPanel(body, panel) {
|
|
3555
|
+
const doc = body.ownerDocument;
|
|
3556
|
+
const root = doc.createElement("div");
|
|
3557
|
+
root.className = "vela-callout-panel";
|
|
3558
|
+
if (panel.title) {
|
|
3559
|
+
const title = doc.createElement("div");
|
|
3560
|
+
title.className = "vela-callout-title";
|
|
3561
|
+
title.textContent = panel.title;
|
|
3562
|
+
root.appendChild(title);
|
|
3563
|
+
}
|
|
3564
|
+
for (const row of calloutPanelRows(panel.items)) {
|
|
3565
|
+
if (row.type === "text") {
|
|
3566
|
+
const text = doc.createElement("div");
|
|
3567
|
+
text.className = "vela-callout-text";
|
|
3568
|
+
text.textContent = row.text;
|
|
3569
|
+
root.appendChild(text);
|
|
3570
|
+
continue;
|
|
3571
|
+
}
|
|
3572
|
+
const actions = doc.createElement("div");
|
|
3573
|
+
actions.className = "vela-callout-actions";
|
|
3574
|
+
for (const item of row.buttons) {
|
|
3575
|
+
const btn = doc.createElement("button");
|
|
3576
|
+
btn.type = "button";
|
|
3577
|
+
btn.className = "vela-callout-btn" + (item.primary ? " vela-callout-btn-primary" : "");
|
|
3578
|
+
btn.textContent = item.label;
|
|
3579
|
+
btn.addEventListener("click", () => {
|
|
3580
|
+
item.run();
|
|
3581
|
+
if (closesPanel(item)) this.pop?.hide();
|
|
3582
|
+
});
|
|
3583
|
+
actions.appendChild(btn);
|
|
3584
|
+
}
|
|
3585
|
+
root.appendChild(actions);
|
|
3586
|
+
}
|
|
3587
|
+
body.appendChild(root);
|
|
3588
|
+
}
|
|
3589
|
+
};
|
|
3590
|
+
|
|
3399
3591
|
Object.defineProperty(exports, "normalizeProps", {
|
|
3400
3592
|
enumerable: true,
|
|
3401
3593
|
get: function () { return vanilla.normalizeProps; }
|
|
@@ -3404,6 +3596,9 @@ Object.defineProperty(exports, "spreadProps", {
|
|
|
3404
3596
|
enumerable: true,
|
|
3405
3597
|
get: function () { return vanilla.spreadProps; }
|
|
3406
3598
|
});
|
|
3599
|
+
exports.CALLOUT_CSS = CALLOUT_CSS;
|
|
3600
|
+
exports.CALLOUT_STYLE_ID = CALLOUT_STYLE_ID;
|
|
3601
|
+
exports.CalloutBubble = CalloutBubble;
|
|
3407
3602
|
exports.ColorField = ColorField;
|
|
3408
3603
|
exports.Dialog = Dialog;
|
|
3409
3604
|
exports.Drawer = Drawer;
|
|
@@ -3427,10 +3622,12 @@ exports.blendOver = blendOver;
|
|
|
3427
3622
|
exports.buildColorPicker = buildColorPicker;
|
|
3428
3623
|
exports.buildFieldControl = buildFieldControl;
|
|
3429
3624
|
exports.buildPalette = buildPalette;
|
|
3625
|
+
exports.calloutPanelRows = calloutPanelRows;
|
|
3430
3626
|
exports.clampNumber = clampNumber;
|
|
3431
3627
|
exports.closeColorPopover = closeColorPopover;
|
|
3432
3628
|
exports.closeOpenPopovers = closeOpenPopovers;
|
|
3433
3629
|
exports.closeWidthPopover = closeWidthPopover;
|
|
3630
|
+
exports.closesPanel = closesPanel;
|
|
3434
3631
|
exports.colorField = colorField;
|
|
3435
3632
|
exports.colorPickerController = colorPickerController;
|
|
3436
3633
|
exports.combineColor = combineColor;
|
package/dist/ui.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as VelaTheme } from './options-
|
|
1
|
+
import { c as VelaTheme } from './options-FM0peknS.cjs';
|
|
2
2
|
import { MachineSchema, Service, Machine } from '@zag-js/core';
|
|
3
3
|
export { a as KeyBindingDescriptor, K as KeymapManager, b as KeymapOptions, R as ResolvedBinding } from './keymap-CGOz5F5f.cjs';
|
|
4
4
|
import * as tooltip from '@zag-js/tooltip';
|
|
@@ -883,4 +883,91 @@ declare class GlyphSelect<T extends string | number = string | number> {
|
|
|
883
883
|
declare function widthField(theme: VelaTheme, getVal: () => number, onVal: (v: number) => void): HTMLElement;
|
|
884
884
|
declare function closeWidthPopover(): void;
|
|
885
885
|
|
|
886
|
-
|
|
886
|
+
/** One block of a deployed callout panel — plain text, or a button running a caller action. */
|
|
887
|
+
type CalloutPanelItem = {
|
|
888
|
+
type: 'text';
|
|
889
|
+
text: string;
|
|
890
|
+
} | {
|
|
891
|
+
type: 'button';
|
|
892
|
+
label: string;
|
|
893
|
+
/** Emphasized (selection-colored) button — the panel's main action. */
|
|
894
|
+
primary?: boolean;
|
|
895
|
+
/** Close the panel after `run` (default true — an action answers the panel). */
|
|
896
|
+
close?: boolean;
|
|
897
|
+
run(): void;
|
|
898
|
+
};
|
|
899
|
+
/** The deployed panel: an optional heading over ordered text/button blocks. */
|
|
900
|
+
interface CalloutPanel {
|
|
901
|
+
title?: string;
|
|
902
|
+
items: CalloutPanelItem[];
|
|
903
|
+
}
|
|
904
|
+
/** What dresses the bubble itself (the panel is what the click deploys). */
|
|
905
|
+
interface CalloutBubbleSpec {
|
|
906
|
+
/** Icon id in the icon registry (`registerIcon`), centered in the bubble. */
|
|
907
|
+
icon: string;
|
|
908
|
+
/** Bubble fill — any CSS color, token expressions included. */
|
|
909
|
+
background: string;
|
|
910
|
+
/** Icon ink (default: `currentColor` inherited from the slot). */
|
|
911
|
+
color?: string;
|
|
912
|
+
/** Accessible name. Callers typically show the same text in their own tooltip. */
|
|
913
|
+
label: string;
|
|
914
|
+
/** Deployed panel — presence makes the bubble clickable. */
|
|
915
|
+
panel?: CalloutPanel;
|
|
916
|
+
}
|
|
917
|
+
/** Whether activating a panel button also closes the panel (defaults to yes). */
|
|
918
|
+
declare function closesPanel(item: Extract<CalloutPanelItem, {
|
|
919
|
+
type: 'button';
|
|
920
|
+
}>): boolean;
|
|
921
|
+
/** A panel row as the view lays it out: one text block, or a run of adjacent buttons. */
|
|
922
|
+
type CalloutPanelRow = {
|
|
923
|
+
type: 'text';
|
|
924
|
+
text: string;
|
|
925
|
+
} | {
|
|
926
|
+
type: 'buttons';
|
|
927
|
+
buttons: Array<Extract<CalloutPanelItem, {
|
|
928
|
+
type: 'button';
|
|
929
|
+
}>>;
|
|
930
|
+
};
|
|
931
|
+
/**
|
|
932
|
+
* Group a panel's ordered items into layout rows: consecutive buttons share one row
|
|
933
|
+
* (the common "text above, actions below" shape falls out naturally), text blocks
|
|
934
|
+
* stand alone. Pure — unit-tested apart from the DOM.
|
|
935
|
+
*/
|
|
936
|
+
declare function calloutPanelRows(items: CalloutPanelItem[]): CalloutPanelRow[];
|
|
937
|
+
|
|
938
|
+
interface CalloutBubbleOptions extends CalloutBubbleSpec {
|
|
939
|
+
/** Bubble diameter in px (default 16; the icon renders 4px smaller). */
|
|
940
|
+
size?: number;
|
|
941
|
+
/** Where the deployed panel portals (default: the document body). Pass the chart
|
|
942
|
+
* or widget root so the panel lives inside the host's DOM. */
|
|
943
|
+
host?: HTMLElement;
|
|
944
|
+
/** Live theme, for a panel deployed OUTSIDE a `.vela-ui` token host (renderer
|
|
945
|
+
* chrome on a bare chart passes its theme getter; widget chrome may omit it). */
|
|
946
|
+
theme?: () => VelaTheme;
|
|
947
|
+
/** Panel clamp — `'viewport'` (default) flips the panel above the bubble when the
|
|
948
|
+
* bottom screen edge is too close for it to deploy below. */
|
|
949
|
+
boundary?: PopoverBoundary;
|
|
950
|
+
}
|
|
951
|
+
declare class CalloutBubble {
|
|
952
|
+
readonly el: HTMLElement;
|
|
953
|
+
private spec;
|
|
954
|
+
private readonly size;
|
|
955
|
+
private readonly host;
|
|
956
|
+
private readonly theme;
|
|
957
|
+
private readonly boundary;
|
|
958
|
+
private pop;
|
|
959
|
+
constructor(opts: CalloutBubbleOptions);
|
|
960
|
+
/** Re-dress the bubble (a status change: new icon, tint, label, panel). */
|
|
961
|
+
set(spec: Partial<CalloutBubbleSpec>): void;
|
|
962
|
+
/** Whether the deployed panel is currently open. */
|
|
963
|
+
get open(): boolean;
|
|
964
|
+
destroy(): void;
|
|
965
|
+
private dress;
|
|
966
|
+
private toggle;
|
|
967
|
+
private buildPanel;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
declare const CALLOUT_STYLE_ID = "vela-ui-callout-bubble";
|
|
971
|
+
declare const CALLOUT_CSS = "\n.vela-callout {\n display: inline-grid;\n place-items: center;\n border-radius: 50%;\n flex: none;\n line-height: 0;\n box-sizing: border-box;\n cursor: default;\n user-select: none;\n -webkit-user-select: none;\n}\n.vela-callout[role='button'] { cursor: pointer; }\n.vela-callout svg { display: block; }\n/* The deployed panel \u2014 carries the kit's elevated-card look itself (the popover\n shell is bare positioning chrome). */\n.vela-callout-panel {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 10px 12px;\n max-width: 280px;\n box-sizing: border-box;\n background: var(--vela-surface-elev);\n border: 1px solid var(--vela-border-strong);\n border-radius: 6px;\n box-shadow: var(--vela-shadow);\n color: var(--vela-fg);\n font: var(--vela-font-size-md) var(--vela-font);\n}\n.vela-callout-title { font-weight: 600; color: var(--vela-fg-bright); }\n.vela-callout-text { color: var(--vela-fg-muted); line-height: 1.45; white-space: pre-line; }\n.vela-callout-actions { display: flex; flex-wrap: wrap; gap: 8px; }\n.vela-callout-btn {\n cursor: pointer;\n height: 26px;\n padding: 0 10px;\n border-radius: 5px;\n border: 1px solid var(--vela-border);\n background: transparent;\n color: var(--vela-fg);\n font-size: var(--vela-font-size-md);\n font-family: inherit;\n transition: background var(--vela-dur-fast) ease, color var(--vela-dur-fast) ease, opacity var(--vela-dur-fast) ease, border-color var(--vela-dur-fast) ease;\n}\n.vela-callout-btn:hover { background: var(--vela-hover); color: var(--vela-fg-bright); border-color: var(--vela-fg-muted); }\n.vela-callout-btn-primary { border-color: var(--vela-selected-bg); background: var(--vela-selected-bg); color: var(--vela-selected-fg); }\n.vela-callout-btn-primary:hover { background: var(--vela-selected-bg); color: var(--vela-selected-fg); opacity: 0.85; border-color: var(--vela-selected-bg); }\n";
|
|
972
|
+
|
|
973
|
+
export { CALLOUT_CSS, CALLOUT_STYLE_ID, CalloutBubble, type CalloutBubbleOptions, type CalloutBubbleSpec, type CalloutPanel, type CalloutPanelItem, type CalloutPanelRow, ColorField, type ColorFieldOpts, type ColorFieldShape, type ColorPickerController, type ColorPickerControllerOptions, Dialog, type DialogApi, type DialogControllerOptions, type DialogOptions, type DialogService, Drawer, type DrawerApi, type DrawerControllerOptions, type DrawerOptions, type DrawerService, FIELD_FOCUS_CSS, FIELD_FOCUS_RING, FIELD_GAP_PX, type FieldControlDesc, type FieldControlHandle, type FieldGridOptions, type FieldGridVariant, type FieldInlineItem, type FieldLabelSize, type FieldRowOptions, type FieldSectionOptions, type FieldToggleOpts, type GlyphOption, GlyphSelect, type GlyphSelectController, type GlyphSelectControllerOptions, type GlyphSelectOptions, type MachineHandle, Menu, type MenuApi, type MenuControllerOptions, type MenuItemDescriptor, type MenuOptions, type MenuService, type NumberCommit, NumberInput, type NumberInputController, type NumberInputControllerOptions, type NumberInputOptions, type NumberSize, type PlaceArgs, type PlaceResult, Popover, type PopoverAlign, type PopoverBoundary, type PopoverController, type PopoverControllerOptions, type PopoverOptions, type PopoverPosition, type Rect, Select, type SelectController, type SelectControllerOptions, type SelectListPopoverOpts, type SelectOption, type SelectOptions, type SelectSize, Switch, type SwitchController, type SwitchControllerOptions, type SwitchOptions, type SwitchSize, type SwitchTone, TextArea, type TextAreaController, type TextAreaControllerOptions, type TextAreaOptions, type TextAreaSize, TextField, type TextFieldController, type TextFieldControllerOptions, type TextFieldOptions, type TextFieldSize, Tooltip, type TooltipApi, type TooltipControllerOptions, type TooltipOptions, type TooltipService, WIDTH_FIELD_OPTIONS, applyPlotOverlayTokens, applyThemeTokens, blendOver, buildColorPicker, buildFieldControl, buildPalette, calloutPanelRows, clampNumber, closeColorPopover, closeOpenPopovers, closeWidthPopover, closesPanel, colorField, colorPickerController, combineColor, decorateSelectScroll, dialogController, drawerController, ensureUIHost, eventDismissedPopover, fieldGrid, fieldGridColumns, fieldRow, fieldSection, fieldSeparator, fillSelectList, glyphSelectController, hslHex, iconEl, injectStyles, insetRect, intersectRects, isPopoverOpen, lineWidthGlyph, menuController, nextUid, numberInputController, openPopoverTrigger, openSelectList, overlayScrollbarCss, placePopover, popoverController, runMachine, selectController, snapToStep, splitColor, switchController, textAreaController, textFieldController, toggleSelectList, tooltipController, transparencyChecker, viewportRect, widthField, widthFieldOptions, withAlpha };
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as VelaTheme } from './options-
|
|
1
|
+
import { c as VelaTheme } from './options-FM0peknS.js';
|
|
2
2
|
import { MachineSchema, Service, Machine } from '@zag-js/core';
|
|
3
3
|
export { a as KeyBindingDescriptor, K as KeymapManager, b as KeymapOptions, R as ResolvedBinding } from './keymap-CGOz5F5f.js';
|
|
4
4
|
import * as tooltip from '@zag-js/tooltip';
|
|
@@ -883,4 +883,91 @@ declare class GlyphSelect<T extends string | number = string | number> {
|
|
|
883
883
|
declare function widthField(theme: VelaTheme, getVal: () => number, onVal: (v: number) => void): HTMLElement;
|
|
884
884
|
declare function closeWidthPopover(): void;
|
|
885
885
|
|
|
886
|
-
|
|
886
|
+
/** One block of a deployed callout panel — plain text, or a button running a caller action. */
|
|
887
|
+
type CalloutPanelItem = {
|
|
888
|
+
type: 'text';
|
|
889
|
+
text: string;
|
|
890
|
+
} | {
|
|
891
|
+
type: 'button';
|
|
892
|
+
label: string;
|
|
893
|
+
/** Emphasized (selection-colored) button — the panel's main action. */
|
|
894
|
+
primary?: boolean;
|
|
895
|
+
/** Close the panel after `run` (default true — an action answers the panel). */
|
|
896
|
+
close?: boolean;
|
|
897
|
+
run(): void;
|
|
898
|
+
};
|
|
899
|
+
/** The deployed panel: an optional heading over ordered text/button blocks. */
|
|
900
|
+
interface CalloutPanel {
|
|
901
|
+
title?: string;
|
|
902
|
+
items: CalloutPanelItem[];
|
|
903
|
+
}
|
|
904
|
+
/** What dresses the bubble itself (the panel is what the click deploys). */
|
|
905
|
+
interface CalloutBubbleSpec {
|
|
906
|
+
/** Icon id in the icon registry (`registerIcon`), centered in the bubble. */
|
|
907
|
+
icon: string;
|
|
908
|
+
/** Bubble fill — any CSS color, token expressions included. */
|
|
909
|
+
background: string;
|
|
910
|
+
/** Icon ink (default: `currentColor` inherited from the slot). */
|
|
911
|
+
color?: string;
|
|
912
|
+
/** Accessible name. Callers typically show the same text in their own tooltip. */
|
|
913
|
+
label: string;
|
|
914
|
+
/** Deployed panel — presence makes the bubble clickable. */
|
|
915
|
+
panel?: CalloutPanel;
|
|
916
|
+
}
|
|
917
|
+
/** Whether activating a panel button also closes the panel (defaults to yes). */
|
|
918
|
+
declare function closesPanel(item: Extract<CalloutPanelItem, {
|
|
919
|
+
type: 'button';
|
|
920
|
+
}>): boolean;
|
|
921
|
+
/** A panel row as the view lays it out: one text block, or a run of adjacent buttons. */
|
|
922
|
+
type CalloutPanelRow = {
|
|
923
|
+
type: 'text';
|
|
924
|
+
text: string;
|
|
925
|
+
} | {
|
|
926
|
+
type: 'buttons';
|
|
927
|
+
buttons: Array<Extract<CalloutPanelItem, {
|
|
928
|
+
type: 'button';
|
|
929
|
+
}>>;
|
|
930
|
+
};
|
|
931
|
+
/**
|
|
932
|
+
* Group a panel's ordered items into layout rows: consecutive buttons share one row
|
|
933
|
+
* (the common "text above, actions below" shape falls out naturally), text blocks
|
|
934
|
+
* stand alone. Pure — unit-tested apart from the DOM.
|
|
935
|
+
*/
|
|
936
|
+
declare function calloutPanelRows(items: CalloutPanelItem[]): CalloutPanelRow[];
|
|
937
|
+
|
|
938
|
+
interface CalloutBubbleOptions extends CalloutBubbleSpec {
|
|
939
|
+
/** Bubble diameter in px (default 16; the icon renders 4px smaller). */
|
|
940
|
+
size?: number;
|
|
941
|
+
/** Where the deployed panel portals (default: the document body). Pass the chart
|
|
942
|
+
* or widget root so the panel lives inside the host's DOM. */
|
|
943
|
+
host?: HTMLElement;
|
|
944
|
+
/** Live theme, for a panel deployed OUTSIDE a `.vela-ui` token host (renderer
|
|
945
|
+
* chrome on a bare chart passes its theme getter; widget chrome may omit it). */
|
|
946
|
+
theme?: () => VelaTheme;
|
|
947
|
+
/** Panel clamp — `'viewport'` (default) flips the panel above the bubble when the
|
|
948
|
+
* bottom screen edge is too close for it to deploy below. */
|
|
949
|
+
boundary?: PopoverBoundary;
|
|
950
|
+
}
|
|
951
|
+
declare class CalloutBubble {
|
|
952
|
+
readonly el: HTMLElement;
|
|
953
|
+
private spec;
|
|
954
|
+
private readonly size;
|
|
955
|
+
private readonly host;
|
|
956
|
+
private readonly theme;
|
|
957
|
+
private readonly boundary;
|
|
958
|
+
private pop;
|
|
959
|
+
constructor(opts: CalloutBubbleOptions);
|
|
960
|
+
/** Re-dress the bubble (a status change: new icon, tint, label, panel). */
|
|
961
|
+
set(spec: Partial<CalloutBubbleSpec>): void;
|
|
962
|
+
/** Whether the deployed panel is currently open. */
|
|
963
|
+
get open(): boolean;
|
|
964
|
+
destroy(): void;
|
|
965
|
+
private dress;
|
|
966
|
+
private toggle;
|
|
967
|
+
private buildPanel;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
declare const CALLOUT_STYLE_ID = "vela-ui-callout-bubble";
|
|
971
|
+
declare const CALLOUT_CSS = "\n.vela-callout {\n display: inline-grid;\n place-items: center;\n border-radius: 50%;\n flex: none;\n line-height: 0;\n box-sizing: border-box;\n cursor: default;\n user-select: none;\n -webkit-user-select: none;\n}\n.vela-callout[role='button'] { cursor: pointer; }\n.vela-callout svg { display: block; }\n/* The deployed panel \u2014 carries the kit's elevated-card look itself (the popover\n shell is bare positioning chrome). */\n.vela-callout-panel {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 10px 12px;\n max-width: 280px;\n box-sizing: border-box;\n background: var(--vela-surface-elev);\n border: 1px solid var(--vela-border-strong);\n border-radius: 6px;\n box-shadow: var(--vela-shadow);\n color: var(--vela-fg);\n font: var(--vela-font-size-md) var(--vela-font);\n}\n.vela-callout-title { font-weight: 600; color: var(--vela-fg-bright); }\n.vela-callout-text { color: var(--vela-fg-muted); line-height: 1.45; white-space: pre-line; }\n.vela-callout-actions { display: flex; flex-wrap: wrap; gap: 8px; }\n.vela-callout-btn {\n cursor: pointer;\n height: 26px;\n padding: 0 10px;\n border-radius: 5px;\n border: 1px solid var(--vela-border);\n background: transparent;\n color: var(--vela-fg);\n font-size: var(--vela-font-size-md);\n font-family: inherit;\n transition: background var(--vela-dur-fast) ease, color var(--vela-dur-fast) ease, opacity var(--vela-dur-fast) ease, border-color var(--vela-dur-fast) ease;\n}\n.vela-callout-btn:hover { background: var(--vela-hover); color: var(--vela-fg-bright); border-color: var(--vela-fg-muted); }\n.vela-callout-btn-primary { border-color: var(--vela-selected-bg); background: var(--vela-selected-bg); color: var(--vela-selected-fg); }\n.vela-callout-btn-primary:hover { background: var(--vela-selected-bg); color: var(--vela-selected-fg); opacity: 0.85; border-color: var(--vela-selected-bg); }\n";
|
|
972
|
+
|
|
973
|
+
export { CALLOUT_CSS, CALLOUT_STYLE_ID, CalloutBubble, type CalloutBubbleOptions, type CalloutBubbleSpec, type CalloutPanel, type CalloutPanelItem, type CalloutPanelRow, ColorField, type ColorFieldOpts, type ColorFieldShape, type ColorPickerController, type ColorPickerControllerOptions, Dialog, type DialogApi, type DialogControllerOptions, type DialogOptions, type DialogService, Drawer, type DrawerApi, type DrawerControllerOptions, type DrawerOptions, type DrawerService, FIELD_FOCUS_CSS, FIELD_FOCUS_RING, FIELD_GAP_PX, type FieldControlDesc, type FieldControlHandle, type FieldGridOptions, type FieldGridVariant, type FieldInlineItem, type FieldLabelSize, type FieldRowOptions, type FieldSectionOptions, type FieldToggleOpts, type GlyphOption, GlyphSelect, type GlyphSelectController, type GlyphSelectControllerOptions, type GlyphSelectOptions, type MachineHandle, Menu, type MenuApi, type MenuControllerOptions, type MenuItemDescriptor, type MenuOptions, type MenuService, type NumberCommit, NumberInput, type NumberInputController, type NumberInputControllerOptions, type NumberInputOptions, type NumberSize, type PlaceArgs, type PlaceResult, Popover, type PopoverAlign, type PopoverBoundary, type PopoverController, type PopoverControllerOptions, type PopoverOptions, type PopoverPosition, type Rect, Select, type SelectController, type SelectControllerOptions, type SelectListPopoverOpts, type SelectOption, type SelectOptions, type SelectSize, Switch, type SwitchController, type SwitchControllerOptions, type SwitchOptions, type SwitchSize, type SwitchTone, TextArea, type TextAreaController, type TextAreaControllerOptions, type TextAreaOptions, type TextAreaSize, TextField, type TextFieldController, type TextFieldControllerOptions, type TextFieldOptions, type TextFieldSize, Tooltip, type TooltipApi, type TooltipControllerOptions, type TooltipOptions, type TooltipService, WIDTH_FIELD_OPTIONS, applyPlotOverlayTokens, applyThemeTokens, blendOver, buildColorPicker, buildFieldControl, buildPalette, calloutPanelRows, clampNumber, closeColorPopover, closeOpenPopovers, closeWidthPopover, closesPanel, colorField, colorPickerController, combineColor, decorateSelectScroll, dialogController, drawerController, ensureUIHost, eventDismissedPopover, fieldGrid, fieldGridColumns, fieldRow, fieldSection, fieldSeparator, fillSelectList, glyphSelectController, hslHex, iconEl, injectStyles, insetRect, intersectRects, isPopoverOpen, lineWidthGlyph, menuController, nextUid, numberInputController, openPopoverTrigger, openSelectList, overlayScrollbarCss, placePopover, popoverController, runMachine, selectController, snapToStep, splitColor, switchController, textAreaController, textFieldController, toggleSelectList, tooltipController, transparencyChecker, viewportRect, widthField, widthFieldOptions, withAlpha };
|
package/dist/ui.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Drawer, KeymapManager, Tooltip, drawerController, tooltipController } from './chunk-
|
|
2
|
-
export { ColorField, Dialog, FIELD_GAP_PX, GlyphSelect, Menu, NumberInput, Popover, Select, Switch, TextArea, TextField, WIDTH_FIELD_OPTIONS, applyPlotOverlayTokens, applyThemeTokens, blendOver, buildColorPicker, buildFieldControl, buildPalette, clampNumber, closeColorPopover, closeOpenPopovers, closeWidthPopover, colorField, colorPickerController, combineColor, decorateSelectScroll, dialogController, ensureUIHost, eventDismissedPopover, fieldGrid, fieldGridColumns, fieldRow, fieldSection, fieldSeparator, fillSelectList, glyphSelectController, hslHex, insetRect, intersectRects, isPopoverOpen, lineWidthGlyph, menuController, nextUid, normalizeProps, numberInputController, openPopoverTrigger, openSelectList, placePopover, popoverController, runMachine, selectController, snapToStep, splitColor, spreadProps, switchController, textAreaController, textFieldController, toggleSelectList, transparencyChecker, viewportRect, widthField, widthFieldOptions } from './chunk-
|
|
3
|
-
export { FIELD_FOCUS_CSS, FIELD_FOCUS_RING, iconEl, iconMarkup, injectStyles, overlayScrollbarCss, registerIcon, svg16, svg24, withAlpha } from './chunk-
|
|
1
|
+
export { Drawer, KeymapManager, Tooltip, drawerController, tooltipController } from './chunk-62SVGONC.js';
|
|
2
|
+
export { CALLOUT_CSS, CALLOUT_STYLE_ID, CalloutBubble, ColorField, Dialog, FIELD_GAP_PX, GlyphSelect, Menu, NumberInput, Popover, Select, Switch, TextArea, TextField, WIDTH_FIELD_OPTIONS, applyPlotOverlayTokens, applyThemeTokens, blendOver, buildColorPicker, buildFieldControl, buildPalette, calloutPanelRows, clampNumber, closeColorPopover, closeOpenPopovers, closeWidthPopover, closesPanel, colorField, colorPickerController, combineColor, decorateSelectScroll, dialogController, ensureUIHost, eventDismissedPopover, fieldGrid, fieldGridColumns, fieldRow, fieldSection, fieldSeparator, fillSelectList, glyphSelectController, hslHex, insetRect, intersectRects, isPopoverOpen, lineWidthGlyph, menuController, nextUid, normalizeProps, numberInputController, openPopoverTrigger, openSelectList, placePopover, popoverController, runMachine, selectController, snapToStep, splitColor, spreadProps, switchController, textAreaController, textFieldController, toggleSelectList, transparencyChecker, viewportRect, widthField, widthFieldOptions } from './chunk-FCVIG7JG.js';
|
|
3
|
+
export { FIELD_FOCUS_CSS, FIELD_FOCUS_RING, iconEl, iconMarkup, injectStyles, overlayScrollbarCss, registerIcon, svg16, svg24, withAlpha } from './chunk-WFSZBX3R.js';
|