@luxalgo/vela 0.8.1 → 0.8.2
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/README.md +1 -1
- package/dist/{DataProvider-BrlxntPN.d.cts → DataProvider-COGDs9Xg.d.cts} +1 -1
- package/dist/{DataProvider-DwFIoV4r.d.ts → DataProvider-DpOWZD8F.d.ts} +1 -1
- package/dist/{chunk-LMBYEGUR.js → chunk-27UTYE7T.js} +25 -2
- package/dist/{chunk-EZ5FWVLA.js → chunk-DPAA3SRT.js} +94 -13
- package/dist/{chunk-BZQM2XO7.js → chunk-HKNO24GD.js} +13 -1
- package/dist/{chunk-NELQJCGK.js → chunk-NLDTVFOI.js} +41 -3
- package/dist/{chunk-DBDXKZUF.js → chunk-R2JMNIHY.js} +53 -13
- package/dist/{chunk-ATGTCWHJ.js → chunk-T3DZIR5Y.js} +171 -32
- package/dist/{contributions-tjNExo1o.d.ts → contributions-Cgm9RJYP.d.cts} +38 -11
- package/dist/{contributions-CtlptxR8.d.cts → contributions-bWgwyiVi.d.ts} +38 -11
- package/dist/index.cjs +239 -37
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +4 -4
- package/dist/{options-BnEPUuVV.d.ts → options-NAUHiQEC.d.cts} +3 -3
- package/dist/{options-BnEPUuVV.d.cts → options-NAUHiQEC.d.ts} +3 -3
- package/dist/{plugin-BWxJRKzS.d.cts → plugin-CjjzZX2F.d.cts} +4 -4
- package/dist/{plugin-e2WUEtiI.d.ts → plugin-CqxWoDKS.d.ts} +4 -4
- package/dist/plugin.cjs +20 -6
- package/dist/plugin.d.cts +5 -5
- package/dist/plugin.d.ts +5 -5
- 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/{side-panel-HF0IAzwf.d.cts → side-panel-wMNfgyZb.d.cts} +13 -0
- package/dist/{side-panel-HF0IAzwf.d.ts → side-panel-wMNfgyZb.d.ts} +13 -0
- package/dist/{statusline-model-zKXtGIjj.d.ts → statusline-model-Dih6FGWP.d.ts} +3 -3
- package/dist/{statusline-model-DFY7tuHj.d.cts → statusline-model-Dpfpq54A.d.cts} +3 -3
- package/dist/ui.cjs +77 -2
- package/dist/ui.d.cts +28 -2
- package/dist/ui.d.ts +28 -2
- package/dist/ui.js +3 -3
- package/dist/vela.global.js +239 -37
- package/dist/vela.global.min.js +52 -52
- package/dist/widget.cjs +383 -50
- package/dist/widget.d.cts +20 -10
- package/dist/widget.d.ts +20 -10
- package/dist/widget.js +7 -7
- package/dist/workspace.cjs +383 -50
- package/dist/workspace.d.cts +5 -5
- package/dist/workspace.d.ts +5 -5
- package/dist/workspace.js +6 -6
- package/package.json +2 -2
package/dist/ui.cjs
CHANGED
|
@@ -335,6 +335,7 @@ registerIcon("expand", S('<rect x="2.2" y="2.2" width="11.6" height="11.6" rx="1
|
|
|
335
335
|
registerIcon("plus", S('<path d="M8 2.8v10.4M2.8 8h10.4"/>'));
|
|
336
336
|
registerIcon("minus", S('<path d="M2.8 8h10.4"/>'));
|
|
337
337
|
registerIcon("maximize", S('<path d="M2.5 6V3a.5.5 0 0 1 .5-.5h3M10 2.5h3a.5.5 0 0 1 .5.5v3M13.5 10v3a.5.5 0 0 1-.5.5h-3M6 13.5H3a.5.5 0 0 1-.5-.5v-3"/>'));
|
|
338
|
+
registerIcon("restore", S('<path d="M6 2.5v3a.5.5 0 0 1-.5.5h-3M13.5 6h-3a.5.5 0 0 1-.5-.5v-3M10 13.5v-3a.5.5 0 0 1 .5-.5h3M2.5 10h3a.5.5 0 0 1 .5.5v3"/>'));
|
|
338
339
|
registerIcon("restore", S('<path d="M6.2 2.5v3.7H2.5M9.8 13.5V9.8h3.7M13.5 6.2H9.8V2.5M2.5 9.8h3.7v3.7"/>'));
|
|
339
340
|
registerIcon("star", S('<path d="M8 2.2l1.75 3.55 3.9.55-2.8 2.75.65 3.9L8 11.1l-3.5 1.85.65-3.9-2.8-2.75 3.9-.55z"/>'));
|
|
340
341
|
registerIcon("star-filled", S('<path d="M8 2.2l1.75 3.55 3.9.55-2.8 2.75.65 3.9L8 11.1l-3.5 1.85.65-3.9-2.8-2.75 3.9-.55z"/>', 'fill="currentColor"'));
|
|
@@ -416,6 +417,17 @@ function nextUid(prefix) {
|
|
|
416
417
|
return `${prefix}-${++uid}`;
|
|
417
418
|
}
|
|
418
419
|
|
|
420
|
+
// src/ui/surface-events.ts
|
|
421
|
+
var SURFACE_OPEN_EVENT = "vela:surface-open";
|
|
422
|
+
var SURFACE_CLOSE_EVENT = "vela:surface-close";
|
|
423
|
+
function announceSurface(el, open2, kind, trigger = null) {
|
|
424
|
+
const View = el.ownerDocument.defaultView;
|
|
425
|
+
if (!View) return;
|
|
426
|
+
el.dispatchEvent(
|
|
427
|
+
new View.CustomEvent(open2 ? SURFACE_OPEN_EVENT : SURFACE_CLOSE_EVENT, { bubbles: true, composed: true, detail: { kind, trigger } })
|
|
428
|
+
);
|
|
429
|
+
}
|
|
430
|
+
|
|
419
431
|
// src/ui/keymap.ts
|
|
420
432
|
var KEY_ALIASES = {
|
|
421
433
|
esc: "escape",
|
|
@@ -777,6 +789,8 @@ var Surface = class _Surface {
|
|
|
777
789
|
/** Trigger rect captured when this level opened — the list stays put if the
|
|
778
790
|
* trigger then moves (favorite chips shifting the caret). */
|
|
779
791
|
this.pinnedAnchor = null;
|
|
792
|
+
/** The open state last announced — see {@link announce}. */
|
|
793
|
+
this.shown = false;
|
|
780
794
|
this.doc = doc;
|
|
781
795
|
this.host = opts.host;
|
|
782
796
|
this.onSelect = opts.onSelect;
|
|
@@ -790,6 +804,7 @@ var Surface = class _Surface {
|
|
|
790
804
|
this.positioner.appendChild(this.list);
|
|
791
805
|
this.host.appendChild(this.positioner);
|
|
792
806
|
const trigger = opts.trigger;
|
|
807
|
+
this.opener = trigger ?? opts.opener ?? null;
|
|
793
808
|
this.ctrl = menuController({
|
|
794
809
|
items: [],
|
|
795
810
|
id: opts.id,
|
|
@@ -811,15 +826,21 @@ var Surface = class _Surface {
|
|
|
811
826
|
if (opts.triggerId && trigger) trigger.id = opts.triggerId;
|
|
812
827
|
this.handle = runMachine(this.ctrl.machine, this.ctrl.props, (service) => {
|
|
813
828
|
const api = this.ctrl.connect(service);
|
|
829
|
+
if (this.shown && !api.open) this.announce(false);
|
|
814
830
|
if (trigger) vanilla.spreadProps(trigger, api.getTriggerProps(), this.mid);
|
|
815
831
|
vanilla.spreadProps(this.positioner, api.getPositionerProps(), this.mid);
|
|
816
832
|
vanilla.spreadProps(this.list, api.getContentProps(), this.mid);
|
|
817
833
|
this.project(api);
|
|
834
|
+
if (api.open && !this.shown) this.announce(true);
|
|
818
835
|
});
|
|
819
836
|
}
|
|
820
837
|
get api() {
|
|
821
838
|
return this.ctrl.connect(this.handle.service);
|
|
822
839
|
}
|
|
840
|
+
announce(open2) {
|
|
841
|
+
this.shown = open2;
|
|
842
|
+
announceSurface(this.list, open2, "menu", this.opener);
|
|
843
|
+
}
|
|
823
844
|
setItems(items) {
|
|
824
845
|
this.items = items;
|
|
825
846
|
for (const sub of this.subs.values()) sub.destroy();
|
|
@@ -837,6 +858,7 @@ var Surface = class _Surface {
|
|
|
837
858
|
for (const sub of this.subs.values()) sub.destroy();
|
|
838
859
|
this.subs.clear();
|
|
839
860
|
this.handle.stop();
|
|
861
|
+
if (this.shown) this.announce(false);
|
|
840
862
|
this.positioner.remove();
|
|
841
863
|
}
|
|
842
864
|
byId(id) {
|
|
@@ -930,6 +952,7 @@ var Surface = class _Surface {
|
|
|
930
952
|
const sub = new _Surface(doc, {
|
|
931
953
|
host: this.host,
|
|
932
954
|
placement: "right-start",
|
|
955
|
+
opener: li,
|
|
933
956
|
onSelect: this.onSelect,
|
|
934
957
|
onFavorite: this.onFavorite,
|
|
935
958
|
checkmarks: this.checkmarks,
|
|
@@ -1149,16 +1172,21 @@ var Popover = class {
|
|
|
1149
1172
|
this.hide();
|
|
1150
1173
|
};
|
|
1151
1174
|
const onReflow = () => this.place();
|
|
1152
|
-
setTimeout(() =>
|
|
1175
|
+
setTimeout(() => {
|
|
1176
|
+
if (this.onOutside === onOutside) document.addEventListener("pointerdown", onOutside, true);
|
|
1177
|
+
}, 0);
|
|
1153
1178
|
document.addEventListener("keydown", onKey, true);
|
|
1154
1179
|
window.addEventListener("resize", onReflow, true);
|
|
1155
1180
|
document.addEventListener("scroll", onReflow, true);
|
|
1156
1181
|
this.onOutside = onOutside;
|
|
1157
1182
|
this.onKey = onKey;
|
|
1158
1183
|
this.onReflow = onReflow;
|
|
1184
|
+
announceSurface(this.el, true, "popover", this.trigger);
|
|
1159
1185
|
}
|
|
1160
1186
|
hide() {
|
|
1161
1187
|
if (!this.shown) return;
|
|
1188
|
+
this.shown = false;
|
|
1189
|
+
announceSurface(this.el, false, "popover", this.trigger);
|
|
1162
1190
|
if (this.onOutside) document.removeEventListener("pointerdown", this.onOutside, true);
|
|
1163
1191
|
if (this.onKey) document.removeEventListener("keydown", this.onKey, true);
|
|
1164
1192
|
if (this.onReflow) {
|
|
@@ -1178,7 +1206,6 @@ var Popover = class {
|
|
|
1178
1206
|
} else {
|
|
1179
1207
|
this.el.remove();
|
|
1180
1208
|
}
|
|
1181
|
-
this.shown = false;
|
|
1182
1209
|
if (open === this) open = null;
|
|
1183
1210
|
this.ctrl.onClose?.();
|
|
1184
1211
|
}
|
|
@@ -1384,6 +1411,8 @@ ${overlayScrollbarCss(".vela-dialog *")}
|
|
|
1384
1411
|
`;
|
|
1385
1412
|
var Dialog = class {
|
|
1386
1413
|
constructor(opts = {}) {
|
|
1414
|
+
this.opener = null;
|
|
1415
|
+
this.wasOpen = false;
|
|
1387
1416
|
const doc = (opts.host ?? document.body).ownerDocument;
|
|
1388
1417
|
injectStyles(DIALOG_STYLE_ID, DIALOG_CSS, doc);
|
|
1389
1418
|
const host = opts.host ?? doc.body;
|
|
@@ -1480,6 +1509,7 @@ var Dialog = class {
|
|
|
1480
1509
|
const mid = String(this.ctrl.props.id);
|
|
1481
1510
|
this.handle = runMachine(this.ctrl.machine, this.ctrl.props, (service) => {
|
|
1482
1511
|
const api = this.ctrl.connect(service);
|
|
1512
|
+
if (this.wasOpen && !api.open) this.announce(false);
|
|
1483
1513
|
vanilla.spreadProps(this.backdrop, api.getBackdropProps(), mid);
|
|
1484
1514
|
vanilla.spreadProps(this.positioner, api.getPositionerProps(), mid);
|
|
1485
1515
|
vanilla.spreadProps(this.panel, api.getContentProps(), mid);
|
|
@@ -1487,12 +1517,27 @@ var Dialog = class {
|
|
|
1487
1517
|
vanilla.spreadProps(close, api.getCloseTriggerProps(), mid);
|
|
1488
1518
|
this.backdrop.style.display = api.open ? "" : "none";
|
|
1489
1519
|
this.positioner.style.display = api.open ? "" : "none";
|
|
1520
|
+
if (api.open && !this.wasOpen) this.announce(true);
|
|
1521
|
+
if (this.wasOpen && !api.open) this.restoreOpener();
|
|
1522
|
+
this.wasOpen = api.open;
|
|
1490
1523
|
});
|
|
1491
1524
|
}
|
|
1525
|
+
/** Closing hands focus back to whatever opened it (Escape, the ✕, hide(), or a
|
|
1526
|
+
* teardown that outruns the machine's close notification). */
|
|
1527
|
+
restoreOpener() {
|
|
1528
|
+
const opener = this.opener;
|
|
1529
|
+
this.opener = null;
|
|
1530
|
+
if (opener?.isConnected) opener.focus({ preventScroll: true });
|
|
1531
|
+
}
|
|
1532
|
+
announce(open2) {
|
|
1533
|
+
const opener = this.opener === this.panel.ownerDocument.body ? null : this.opener;
|
|
1534
|
+
announceSurface(this.panel, open2, "dialog", opener);
|
|
1535
|
+
}
|
|
1492
1536
|
get open() {
|
|
1493
1537
|
return this.ctrl.connect(this.handle.service).open;
|
|
1494
1538
|
}
|
|
1495
1539
|
show() {
|
|
1540
|
+
this.opener = this.panel.ownerDocument.activeElement;
|
|
1496
1541
|
this.ctrl.connect(this.handle.service).setOpen(true);
|
|
1497
1542
|
}
|
|
1498
1543
|
hide() {
|
|
@@ -1507,6 +1552,11 @@ var Dialog = class {
|
|
|
1507
1552
|
destroy() {
|
|
1508
1553
|
if (this.open) this.hide();
|
|
1509
1554
|
this.handle.stop();
|
|
1555
|
+
if (this.wasOpen) {
|
|
1556
|
+
this.wasOpen = false;
|
|
1557
|
+
this.announce(false);
|
|
1558
|
+
}
|
|
1559
|
+
this.restoreOpener();
|
|
1510
1560
|
this.backdrop.remove();
|
|
1511
1561
|
this.positioner.remove();
|
|
1512
1562
|
}
|
|
@@ -1635,6 +1685,8 @@ function swipeDirection(dx, dy) {
|
|
|
1635
1685
|
}
|
|
1636
1686
|
var Drawer = class {
|
|
1637
1687
|
constructor(opts = {}) {
|
|
1688
|
+
this.opener = null;
|
|
1689
|
+
this.wasOpen = false;
|
|
1638
1690
|
const doc = (opts.host ?? document.body).ownerDocument;
|
|
1639
1691
|
injectStyles(DRAWER_STYLE_ID, DRAWER_CSS, doc);
|
|
1640
1692
|
const host = opts.host ?? doc.body;
|
|
@@ -1662,12 +1714,16 @@ var Drawer = class {
|
|
|
1662
1714
|
const mid = String(this.ctrl.props.id);
|
|
1663
1715
|
this.handle = runMachine(this.ctrl.machine, this.ctrl.props, (service) => {
|
|
1664
1716
|
const api = this.ctrl.connect(service);
|
|
1717
|
+
if (this.wasOpen && !api.open) this.announce(false);
|
|
1665
1718
|
vanilla.spreadProps(this.backdrop, api.getBackdropProps(), mid);
|
|
1666
1719
|
vanilla.spreadProps(this.positioner, api.getPositionerProps(), mid);
|
|
1667
1720
|
vanilla.spreadProps(this.panel, api.getContentProps(), mid);
|
|
1668
1721
|
vanilla.spreadProps(this.titleEl, api.getTitleProps(), mid);
|
|
1669
1722
|
this.backdrop.style.display = api.open ? "" : "none";
|
|
1670
1723
|
this.positioner.style.display = api.open ? "" : "none";
|
|
1724
|
+
if (api.open && !this.wasOpen) this.announce(true);
|
|
1725
|
+
if (this.wasOpen && !api.open) this.restoreOpener();
|
|
1726
|
+
this.wasOpen = api.open;
|
|
1671
1727
|
});
|
|
1672
1728
|
}
|
|
1673
1729
|
/** Any element between `from` and the panel that has already been scrolled down —
|
|
@@ -1776,10 +1832,22 @@ var Drawer = class {
|
|
|
1776
1832
|
setTitle(title) {
|
|
1777
1833
|
this.titleEl.textContent = title;
|
|
1778
1834
|
}
|
|
1835
|
+
/** Closing hands focus back to whatever opened it (Escape, the ✕, hide(), or a
|
|
1836
|
+
* teardown that outruns the machine's close notification). */
|
|
1837
|
+
restoreOpener() {
|
|
1838
|
+
const opener = this.opener;
|
|
1839
|
+
this.opener = null;
|
|
1840
|
+
if (opener?.isConnected) opener.focus({ preventScroll: true });
|
|
1841
|
+
}
|
|
1842
|
+
announce(open2) {
|
|
1843
|
+
const opener = this.opener === this.panel.ownerDocument.body ? null : this.opener;
|
|
1844
|
+
announceSurface(this.panel, open2, "drawer", opener);
|
|
1845
|
+
}
|
|
1779
1846
|
get open() {
|
|
1780
1847
|
return this.ctrl.connect(this.handle.service).open;
|
|
1781
1848
|
}
|
|
1782
1849
|
show() {
|
|
1850
|
+
this.opener = this.panel.ownerDocument.activeElement;
|
|
1783
1851
|
this.ctrl.connect(this.handle.service).setOpen(true);
|
|
1784
1852
|
}
|
|
1785
1853
|
hide() {
|
|
@@ -1787,6 +1855,11 @@ var Drawer = class {
|
|
|
1787
1855
|
}
|
|
1788
1856
|
destroy() {
|
|
1789
1857
|
this.handle.stop();
|
|
1858
|
+
if (this.wasOpen) {
|
|
1859
|
+
this.wasOpen = false;
|
|
1860
|
+
this.announce(false);
|
|
1861
|
+
}
|
|
1862
|
+
this.restoreOpener();
|
|
1790
1863
|
this.backdrop.remove();
|
|
1791
1864
|
this.positioner.remove();
|
|
1792
1865
|
}
|
|
@@ -3971,6 +4044,8 @@ exports.KeymapManager = KeymapManager;
|
|
|
3971
4044
|
exports.Menu = Menu;
|
|
3972
4045
|
exports.NumberInput = NumberInput;
|
|
3973
4046
|
exports.Popover = Popover;
|
|
4047
|
+
exports.SURFACE_CLOSE_EVENT = SURFACE_CLOSE_EVENT;
|
|
4048
|
+
exports.SURFACE_OPEN_EVENT = SURFACE_OPEN_EVENT;
|
|
3974
4049
|
exports.Select = Select;
|
|
3975
4050
|
exports.Switch = Switch;
|
|
3976
4051
|
exports.TextArea = TextArea;
|
package/dist/ui.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as VelaTheme } from './options-
|
|
1
|
+
import { c as VelaTheme } from './options-NAUHiQEC.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';
|
|
@@ -48,6 +48,20 @@ declare function runMachine<T extends MachineSchema>(machine: Machine<T>, props:
|
|
|
48
48
|
/** Unique ids for machine instances (Zag keys its DOM lookups on them). */
|
|
49
49
|
declare function nextUid(prefix: string): string;
|
|
50
50
|
|
|
51
|
+
/** Dispatched on a surface's element once it is shown. */
|
|
52
|
+
declare const SURFACE_OPEN_EVENT = "vela:surface-open";
|
|
53
|
+
/** Dispatched on a surface's element as it starts to close, before it hides or leaves the DOM. */
|
|
54
|
+
declare const SURFACE_CLOSE_EVENT = "vela:surface-close";
|
|
55
|
+
/** What opened or closed: a menu (submenus included), a popover (select lists, color
|
|
56
|
+
* pickers, mark cards, the layout picker), a dialog, a drawer, or a side panel. */
|
|
57
|
+
type SurfaceKind = 'menu' | 'popover' | 'dialog' | 'drawer' | 'panel';
|
|
58
|
+
/** The `detail` of a {@link SURFACE_OPEN_EVENT} / {@link SURFACE_CLOSE_EVENT} event. */
|
|
59
|
+
interface SurfaceEventDetail {
|
|
60
|
+
kind: SurfaceKind;
|
|
61
|
+
/** The element that opened it, when there is one (a menu's button, a popover's trigger). */
|
|
62
|
+
trigger: HTMLElement | null;
|
|
63
|
+
}
|
|
64
|
+
|
|
51
65
|
interface TooltipControllerOptions {
|
|
52
66
|
placement?: tooltip.Placement;
|
|
53
67
|
/** ms before opening on hover (default 0 — the reference tooltips are instant). */
|
|
@@ -229,6 +243,12 @@ declare class Dialog {
|
|
|
229
243
|
private readonly handle;
|
|
230
244
|
private readonly ctrl;
|
|
231
245
|
constructor(opts?: DialogOptions);
|
|
246
|
+
private opener;
|
|
247
|
+
private wasOpen;
|
|
248
|
+
/** Closing hands focus back to whatever opened it (Escape, the ✕, hide(), or a
|
|
249
|
+
* teardown that outruns the machine's close notification). */
|
|
250
|
+
private restoreOpener;
|
|
251
|
+
private announce;
|
|
232
252
|
get open(): boolean;
|
|
233
253
|
show(): void;
|
|
234
254
|
hide(): void;
|
|
@@ -290,6 +310,12 @@ declare class Drawer {
|
|
|
290
310
|
*/
|
|
291
311
|
private wireGestures;
|
|
292
312
|
setTitle(title: string): void;
|
|
313
|
+
private opener;
|
|
314
|
+
private wasOpen;
|
|
315
|
+
/** Closing hands focus back to whatever opened it (Escape, the ✕, hide(), or a
|
|
316
|
+
* teardown that outruns the machine's close notification). */
|
|
317
|
+
private restoreOpener;
|
|
318
|
+
private announce;
|
|
293
319
|
get open(): boolean;
|
|
294
320
|
show(): void;
|
|
295
321
|
hide(): void;
|
|
@@ -1071,4 +1097,4 @@ declare class DatePicker {
|
|
|
1071
1097
|
private cellEl;
|
|
1072
1098
|
}
|
|
1073
1099
|
|
|
1074
|
-
export { CALLOUT_CSS, CALLOUT_STYLE_ID, CalloutBubble, type CalloutBubbleOptions, type CalloutBubbleSpec, type CalloutPanel, type CalloutPanelItem, type CalloutPanelRow, type ColorCommit, ColorField, type ColorFieldOpts, type ColorFieldShape, type ColorPickerController, type ColorPickerControllerOptions, type ColorPickerOptions, DatePicker, type DatePickerCell, type DatePickerController, type DatePickerControllerOptions, type DatePickerOptions, type DatePickerPanel, 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, datePickerController, decorateSelectScroll, dialogController, drawerController, ensureUIHost, eventDismissedPopover, fieldGrid, fieldGridColumns, fieldRow, fieldSection, fieldSeparator, fillSelectList, glyphSelectController, hslHex, iconEl, injectStyles, insetRect, intersectRects, isPopoverOpen, isoDate, lineWidthGlyph, menuController, nextUid, normalizeDateInput, numberInputController, openPopoverTrigger, openSelectList, overlayScrollbarCss, placePopover, popoverController, runMachine, selectController, snapToStep, splitColor, switchController, textAreaController, textFieldController, toggleSelectList, tooltipController, transparencyChecker, viewportRect, widthField, widthFieldOptions, withAlpha };
|
|
1100
|
+
export { CALLOUT_CSS, CALLOUT_STYLE_ID, CalloutBubble, type CalloutBubbleOptions, type CalloutBubbleSpec, type CalloutPanel, type CalloutPanelItem, type CalloutPanelRow, type ColorCommit, ColorField, type ColorFieldOpts, type ColorFieldShape, type ColorPickerController, type ColorPickerControllerOptions, type ColorPickerOptions, DatePicker, type DatePickerCell, type DatePickerController, type DatePickerControllerOptions, type DatePickerOptions, type DatePickerPanel, 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, SURFACE_CLOSE_EVENT, SURFACE_OPEN_EVENT, Select, type SelectController, type SelectControllerOptions, type SelectListPopoverOpts, type SelectOption, type SelectOptions, type SelectSize, type SurfaceEventDetail, type SurfaceKind, 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, datePickerController, decorateSelectScroll, dialogController, drawerController, ensureUIHost, eventDismissedPopover, fieldGrid, fieldGridColumns, fieldRow, fieldSection, fieldSeparator, fillSelectList, glyphSelectController, hslHex, iconEl, injectStyles, insetRect, intersectRects, isPopoverOpen, isoDate, lineWidthGlyph, menuController, nextUid, normalizeDateInput, 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-NAUHiQEC.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';
|
|
@@ -48,6 +48,20 @@ declare function runMachine<T extends MachineSchema>(machine: Machine<T>, props:
|
|
|
48
48
|
/** Unique ids for machine instances (Zag keys its DOM lookups on them). */
|
|
49
49
|
declare function nextUid(prefix: string): string;
|
|
50
50
|
|
|
51
|
+
/** Dispatched on a surface's element once it is shown. */
|
|
52
|
+
declare const SURFACE_OPEN_EVENT = "vela:surface-open";
|
|
53
|
+
/** Dispatched on a surface's element as it starts to close, before it hides or leaves the DOM. */
|
|
54
|
+
declare const SURFACE_CLOSE_EVENT = "vela:surface-close";
|
|
55
|
+
/** What opened or closed: a menu (submenus included), a popover (select lists, color
|
|
56
|
+
* pickers, mark cards, the layout picker), a dialog, a drawer, or a side panel. */
|
|
57
|
+
type SurfaceKind = 'menu' | 'popover' | 'dialog' | 'drawer' | 'panel';
|
|
58
|
+
/** The `detail` of a {@link SURFACE_OPEN_EVENT} / {@link SURFACE_CLOSE_EVENT} event. */
|
|
59
|
+
interface SurfaceEventDetail {
|
|
60
|
+
kind: SurfaceKind;
|
|
61
|
+
/** The element that opened it, when there is one (a menu's button, a popover's trigger). */
|
|
62
|
+
trigger: HTMLElement | null;
|
|
63
|
+
}
|
|
64
|
+
|
|
51
65
|
interface TooltipControllerOptions {
|
|
52
66
|
placement?: tooltip.Placement;
|
|
53
67
|
/** ms before opening on hover (default 0 — the reference tooltips are instant). */
|
|
@@ -229,6 +243,12 @@ declare class Dialog {
|
|
|
229
243
|
private readonly handle;
|
|
230
244
|
private readonly ctrl;
|
|
231
245
|
constructor(opts?: DialogOptions);
|
|
246
|
+
private opener;
|
|
247
|
+
private wasOpen;
|
|
248
|
+
/** Closing hands focus back to whatever opened it (Escape, the ✕, hide(), or a
|
|
249
|
+
* teardown that outruns the machine's close notification). */
|
|
250
|
+
private restoreOpener;
|
|
251
|
+
private announce;
|
|
232
252
|
get open(): boolean;
|
|
233
253
|
show(): void;
|
|
234
254
|
hide(): void;
|
|
@@ -290,6 +310,12 @@ declare class Drawer {
|
|
|
290
310
|
*/
|
|
291
311
|
private wireGestures;
|
|
292
312
|
setTitle(title: string): void;
|
|
313
|
+
private opener;
|
|
314
|
+
private wasOpen;
|
|
315
|
+
/** Closing hands focus back to whatever opened it (Escape, the ✕, hide(), or a
|
|
316
|
+
* teardown that outruns the machine's close notification). */
|
|
317
|
+
private restoreOpener;
|
|
318
|
+
private announce;
|
|
293
319
|
get open(): boolean;
|
|
294
320
|
show(): void;
|
|
295
321
|
hide(): void;
|
|
@@ -1071,4 +1097,4 @@ declare class DatePicker {
|
|
|
1071
1097
|
private cellEl;
|
|
1072
1098
|
}
|
|
1073
1099
|
|
|
1074
|
-
export { CALLOUT_CSS, CALLOUT_STYLE_ID, CalloutBubble, type CalloutBubbleOptions, type CalloutBubbleSpec, type CalloutPanel, type CalloutPanelItem, type CalloutPanelRow, type ColorCommit, ColorField, type ColorFieldOpts, type ColorFieldShape, type ColorPickerController, type ColorPickerControllerOptions, type ColorPickerOptions, DatePicker, type DatePickerCell, type DatePickerController, type DatePickerControllerOptions, type DatePickerOptions, type DatePickerPanel, 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, datePickerController, decorateSelectScroll, dialogController, drawerController, ensureUIHost, eventDismissedPopover, fieldGrid, fieldGridColumns, fieldRow, fieldSection, fieldSeparator, fillSelectList, glyphSelectController, hslHex, iconEl, injectStyles, insetRect, intersectRects, isPopoverOpen, isoDate, lineWidthGlyph, menuController, nextUid, normalizeDateInput, numberInputController, openPopoverTrigger, openSelectList, overlayScrollbarCss, placePopover, popoverController, runMachine, selectController, snapToStep, splitColor, switchController, textAreaController, textFieldController, toggleSelectList, tooltipController, transparencyChecker, viewportRect, widthField, widthFieldOptions, withAlpha };
|
|
1100
|
+
export { CALLOUT_CSS, CALLOUT_STYLE_ID, CalloutBubble, type CalloutBubbleOptions, type CalloutBubbleSpec, type CalloutPanel, type CalloutPanelItem, type CalloutPanelRow, type ColorCommit, ColorField, type ColorFieldOpts, type ColorFieldShape, type ColorPickerController, type ColorPickerControllerOptions, type ColorPickerOptions, DatePicker, type DatePickerCell, type DatePickerController, type DatePickerControllerOptions, type DatePickerOptions, type DatePickerPanel, 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, SURFACE_CLOSE_EVENT, SURFACE_OPEN_EVENT, Select, type SelectController, type SelectControllerOptions, type SelectListPopoverOpts, type SelectOption, type SelectOptions, type SelectSize, type SurfaceEventDetail, type SurfaceKind, 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, datePickerController, decorateSelectScroll, dialogController, drawerController, ensureUIHost, eventDismissedPopover, fieldGrid, fieldGridColumns, fieldRow, fieldSection, fieldSeparator, fillSelectList, glyphSelectController, hslHex, iconEl, injectStyles, insetRect, intersectRects, isPopoverOpen, isoDate, lineWidthGlyph, menuController, nextUid, normalizeDateInput, 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 { CALLOUT_CSS, CALLOUT_STYLE_ID, CalloutBubble, ColorField, DatePicker, 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, datePickerController, decorateSelectScroll, dialogController, ensureUIHost, eventDismissedPopover, fieldGrid, fieldGridColumns, fieldRow, fieldSection, fieldSeparator, fillSelectList, glyphSelectController, hslHex, insetRect, intersectRects, isPopoverOpen, isoDate, lineWidthGlyph, menuController, nextUid, normalizeDateInput, 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-27UTYE7T.js';
|
|
2
|
+
export { CALLOUT_CSS, CALLOUT_STYLE_ID, CalloutBubble, ColorField, DatePicker, 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, datePickerController, decorateSelectScroll, dialogController, ensureUIHost, eventDismissedPopover, fieldGrid, fieldGridColumns, fieldRow, fieldSection, fieldSeparator, fillSelectList, glyphSelectController, hslHex, insetRect, intersectRects, isPopoverOpen, isoDate, lineWidthGlyph, menuController, nextUid, normalizeDateInput, normalizeProps, numberInputController, openPopoverTrigger, openSelectList, placePopover, popoverController, runMachine, selectController, snapToStep, splitColor, spreadProps, switchController, textAreaController, textFieldController, toggleSelectList, transparencyChecker, viewportRect, widthField, widthFieldOptions } from './chunk-NLDTVFOI.js';
|
|
3
|
+
export { FIELD_FOCUS_CSS, FIELD_FOCUS_RING, SURFACE_CLOSE_EVENT, SURFACE_OPEN_EVENT, iconEl, iconMarkup, injectStyles, overlayScrollbarCss, registerIcon, svg16, svg24, withAlpha } from './chunk-HKNO24GD.js';
|