@luxalgo/vela 0.5.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/LICENSE +201 -0
- package/NOTICE +28 -0
- package/README.md +135 -0
- package/dist/DataProvider-DKNDHpNv.d.cts +134 -0
- package/dist/DataProvider-Dzd-Erlk.d.ts +134 -0
- package/dist/chunk-7UFX5ZIG.js +5976 -0
- package/dist/chunk-GYD2THPV.js +252 -0
- package/dist/chunk-KCCZNKH7.js +19137 -0
- package/dist/chunk-KM6LHB3Y.js +76 -0
- package/dist/chunk-OVQKKXLZ.js +3978 -0
- package/dist/chunk-Q3XQHLIH.js +7 -0
- package/dist/chunk-RHIDOUFL.js +698 -0
- package/dist/contributions-hX3EUyjG.d.ts +1528 -0
- package/dist/contributions-o1GRKPI_.d.cts +1528 -0
- package/dist/history-Dzxz-MQj.d.ts +298 -0
- package/dist/history-LJkz4-sS.d.cts +298 -0
- package/dist/icons-BZYbJXSV.d.cts +10 -0
- package/dist/icons-BZYbJXSV.d.ts +10 -0
- package/dist/index.cjs +25294 -0
- package/dist/index.d.cts +1189 -0
- package/dist/index.d.ts +1189 -0
- package/dist/index.js +5 -0
- package/dist/keymap-CGOz5F5f.d.cts +64 -0
- package/dist/keymap-CGOz5F5f.d.ts +64 -0
- package/dist/options-Q-576hIi.d.cts +1545 -0
- package/dist/options-Q-576hIi.d.ts +1545 -0
- package/dist/plugin-D94muTV-.d.cts +405 -0
- package/dist/plugin-aGUD1epn.d.ts +405 -0
- package/dist/plugin.cjs +5967 -0
- package/dist/plugin.d.cts +7 -0
- package/dist/plugin.d.ts +7 -0
- package/dist/plugin.js +3 -0
- package/dist/providers/binance.cjs +390 -0
- package/dist/providers/binance.d.cts +62 -0
- package/dist/providers/binance.d.ts +62 -0
- package/dist/providers/binance.js +388 -0
- package/dist/providers/coinbase.cjs +462 -0
- package/dist/providers/coinbase.d.cts +59 -0
- package/dist/providers/coinbase.d.ts +59 -0
- package/dist/providers/coinbase.js +460 -0
- package/dist/providers/hyperliquid.cjs +361 -0
- package/dist/providers/hyperliquid.d.cts +54 -0
- package/dist/providers/hyperliquid.d.ts +54 -0
- package/dist/providers/hyperliquid.js +359 -0
- package/dist/side-panel-CT9ZwIGz.d.cts +63 -0
- package/dist/side-panel-CT9ZwIGz.d.ts +63 -0
- package/dist/ui.cjs +1030 -0
- package/dist/ui.d.cts +188 -0
- package/dist/ui.d.ts +188 -0
- package/dist/ui.js +3 -0
- package/dist/vela.global.js +26509 -0
- package/dist/vela.global.min.js +230 -0
- package/dist/widget.cjs +31178 -0
- package/dist/widget.d.cts +799 -0
- package/dist/widget.d.ts +799 -0
- package/dist/widget.js +1060 -0
- package/dist/workspace.cjs +31692 -0
- package/dist/workspace.d.cts +579 -0
- package/dist/workspace.d.ts +579 -0
- package/dist/workspace.js +1694 -0
- package/package.json +95 -0
package/dist/ui.d.cts
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { c as VelaTheme } from './options-Q-576hIi.cjs';
|
|
2
|
+
import { MachineSchema, Service, Machine } from '@zag-js/core';
|
|
3
|
+
export { a as KeyBindingDescriptor, K as KeymapManager, b as KeymapOptions, R as ResolvedBinding } from './keymap-CGOz5F5f.cjs';
|
|
4
|
+
import * as tooltip from '@zag-js/tooltip';
|
|
5
|
+
import * as menu from '@zag-js/menu';
|
|
6
|
+
import * as dialog from '@zag-js/dialog';
|
|
7
|
+
export { i as iconMarkup, r as registerIcon, s as svg16, a as svg24 } from './icons-BZYbJXSV.cjs';
|
|
8
|
+
export { normalizeProps, spreadProps } from '@zag-js/vanilla';
|
|
9
|
+
|
|
10
|
+
/** Apply an alpha to any parseable color → an `rgba(...)` string. Unparseable input is
|
|
11
|
+
* returned unchanged so callers can pass through `transparent`, `currentColor`, etc. */
|
|
12
|
+
declare function withAlpha(color: string, alpha: number): string;
|
|
13
|
+
|
|
14
|
+
/** A ready-to-insert element rendering the icon (empty span when unknown). */
|
|
15
|
+
declare function iconEl(id: string, doc?: Document): HTMLElement;
|
|
16
|
+
|
|
17
|
+
/** Inject a stylesheet once per root (document or shadow root). Idempotent by id. */
|
|
18
|
+
declare function injectStyles(id: string, css: string, root?: Document | ShadowRoot): void;
|
|
19
|
+
|
|
20
|
+
/** Write the theme-derived custom properties onto a host element (the widget root and
|
|
21
|
+
* every floating layer — menus/tooltips portal outside the root, so layers re-apply). */
|
|
22
|
+
declare function applyThemeTokens(el: HTMLElement, t: VelaTheme): void;
|
|
23
|
+
/** Re-token a chart-overlay host (statusline, watermark, toast, context menu — chrome
|
|
24
|
+
* floating OVER the plot) from the LIVE plot surface: a config edit can recolor the
|
|
25
|
+
* plot background independently of the app theme (a white plot typed into settings on
|
|
26
|
+
* the dark theme), and the overlay ink must stay readable either way. `config` is the
|
|
27
|
+
* renderer's `getConfig()` snapshot; a missing/shapeless one falls back to the base
|
|
28
|
+
* app theme. */
|
|
29
|
+
declare function applyPlotOverlayTokens(host: HTMLElement, base: VelaTheme, config: unknown): void;
|
|
30
|
+
/** Mark an element as a kit host: static token sheet + the `.vela-ui` class. */
|
|
31
|
+
declare function ensureUIHost(el: HTMLElement, theme?: VelaTheme): void;
|
|
32
|
+
|
|
33
|
+
interface MachineHandle<T extends MachineSchema> {
|
|
34
|
+
service: Service<T>;
|
|
35
|
+
/** Re-run the view projection now (e.g. after external DOM swaps). */
|
|
36
|
+
flush(): void;
|
|
37
|
+
stop(): void;
|
|
38
|
+
}
|
|
39
|
+
/** Start a machine and keep `render(service)` in sync with every transition.
|
|
40
|
+
* `render` runs once immediately (initial projection) and on each machine notification. */
|
|
41
|
+
declare function runMachine<T extends MachineSchema>(machine: Machine<T>, props: Partial<T['props']> | (() => Partial<T['props']>), render: (service: Service<T>) => void): MachineHandle<T>;
|
|
42
|
+
/** Unique ids for machine instances (Zag keys its DOM lookups on them). */
|
|
43
|
+
declare function nextUid(prefix: string): string;
|
|
44
|
+
|
|
45
|
+
interface TooltipControllerOptions {
|
|
46
|
+
placement?: tooltip.Placement;
|
|
47
|
+
/** ms before opening on hover (default 0 — the reference tooltips are instant). */
|
|
48
|
+
openDelay?: number;
|
|
49
|
+
closeDelay?: number;
|
|
50
|
+
/** Keep open while the pointer is over the content (rich tooltips). */
|
|
51
|
+
interactive?: boolean;
|
|
52
|
+
/** Share the trigger's DOM id with other machines composed on the SAME element
|
|
53
|
+
* (each Zag machine otherwise stamps its own id — last one wins and breaks the rest). */
|
|
54
|
+
triggerId?: string;
|
|
55
|
+
}
|
|
56
|
+
type TooltipService = tooltip.Service;
|
|
57
|
+
type TooltipApi = tooltip.Api;
|
|
58
|
+
interface TooltipController {
|
|
59
|
+
machine: typeof tooltip.machine;
|
|
60
|
+
props: Partial<tooltip.Props>;
|
|
61
|
+
connect(service: TooltipService): TooltipApi;
|
|
62
|
+
}
|
|
63
|
+
declare function tooltipController(opts?: TooltipControllerOptions): TooltipController;
|
|
64
|
+
|
|
65
|
+
interface TooltipOptions extends TooltipControllerOptions {
|
|
66
|
+
content: string | Node | (() => Node);
|
|
67
|
+
host?: HTMLElement;
|
|
68
|
+
}
|
|
69
|
+
declare class Tooltip {
|
|
70
|
+
private readonly positioner;
|
|
71
|
+
private readonly content;
|
|
72
|
+
private readonly handle;
|
|
73
|
+
private readonly trigger;
|
|
74
|
+
constructor(trigger: HTMLElement, opts: TooltipOptions);
|
|
75
|
+
setContent(content: string | Node | (() => Node)): void;
|
|
76
|
+
destroy(): void;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** One menu entry. `id` is the selection value reported to `onSelect`. */
|
|
80
|
+
interface MenuItemDescriptor {
|
|
81
|
+
id: string;
|
|
82
|
+
label: string;
|
|
83
|
+
disabled?: boolean;
|
|
84
|
+
/** Draw a separator line above this item. */
|
|
85
|
+
separatorBefore?: boolean;
|
|
86
|
+
/** Right-aligned hint (e.g. a shortcut display from KeymapManager). */
|
|
87
|
+
hint?: string;
|
|
88
|
+
/** Selected state (undefined = plain item). A plain checked item renders as a
|
|
89
|
+
* highlighted row (brighter surface + bright ink). */
|
|
90
|
+
checked?: boolean;
|
|
91
|
+
/** Render as a SWITCH row (a right-aligned toggle pill reflecting `checked`)
|
|
92
|
+
* instead of the selected-row highlight, and keep the menu OPEN on selection —
|
|
93
|
+
* the shape for boolean settings living inside a dropdown. */
|
|
94
|
+
toggle?: boolean;
|
|
95
|
+
/** Icon id (see the `vela/ui` icon registry) rendered before the label. */
|
|
96
|
+
icon?: string;
|
|
97
|
+
/** Nested entries — the row becomes a submenu trigger opening its own list to the side.
|
|
98
|
+
* A branch is not selectable itself: `onSelect` only ever reports leaf ids. */
|
|
99
|
+
submenu?: readonly MenuItemDescriptor[];
|
|
100
|
+
}
|
|
101
|
+
interface MenuControllerOptions {
|
|
102
|
+
items: readonly MenuItemDescriptor[];
|
|
103
|
+
onSelect?: (id: string) => void;
|
|
104
|
+
placement?: menu.Props['positioning'] extends infer P | undefined ? P extends {
|
|
105
|
+
placement?: infer PL;
|
|
106
|
+
} ? PL : never : never;
|
|
107
|
+
onOpenChange?: (open: boolean) => void;
|
|
108
|
+
/** Share the trigger's DOM id with other machines composed on the same element. */
|
|
109
|
+
triggerId?: string;
|
|
110
|
+
/** Pin the machine's own id instead of taking a fresh one. A parent registers its
|
|
111
|
+
* submenus under this key, so rebuilding a branch replaces its entry rather than
|
|
112
|
+
* piling a new one on top. */
|
|
113
|
+
id?: string;
|
|
114
|
+
}
|
|
115
|
+
type MenuService = menu.Service;
|
|
116
|
+
type MenuApi = menu.Api;
|
|
117
|
+
interface MenuController {
|
|
118
|
+
machine: typeof menu.machine;
|
|
119
|
+
props: Partial<menu.Props>;
|
|
120
|
+
connect(service: MenuService): MenuApi;
|
|
121
|
+
}
|
|
122
|
+
declare function menuController(opts: MenuControllerOptions): MenuController;
|
|
123
|
+
|
|
124
|
+
interface MenuOptions extends MenuControllerOptions {
|
|
125
|
+
/** Element that opens the menu on click (gets the machine's trigger props). */
|
|
126
|
+
trigger?: HTMLElement;
|
|
127
|
+
host?: HTMLElement;
|
|
128
|
+
/** Override the root list's min-width (the stylesheet default suits full-word labels;
|
|
129
|
+
* compact lists like the timeframe dropdown pass something snug). Submenus keep the
|
|
130
|
+
* default. */
|
|
131
|
+
minWidth?: string;
|
|
132
|
+
}
|
|
133
|
+
declare class Menu {
|
|
134
|
+
private readonly root;
|
|
135
|
+
constructor(opts: MenuOptions);
|
|
136
|
+
get api(): menu.Api;
|
|
137
|
+
open(): void;
|
|
138
|
+
/** Open anchored to a viewport point (context menus). */
|
|
139
|
+
openAt(clientX: number, clientY: number): void;
|
|
140
|
+
close(): void;
|
|
141
|
+
/** Swap the item descriptors (e.g. checked states) and re-project. */
|
|
142
|
+
setItems(items: readonly MenuItemDescriptor[]): void;
|
|
143
|
+
destroy(): void;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
interface DialogControllerOptions {
|
|
147
|
+
/** Trap focus + backdrop (default true). Non-modal = floating panel. */
|
|
148
|
+
modal?: boolean;
|
|
149
|
+
closeOnEscape?: boolean;
|
|
150
|
+
closeOnInteractOutside?: boolean;
|
|
151
|
+
onOpenChange?: (open: boolean) => void;
|
|
152
|
+
}
|
|
153
|
+
type DialogService = dialog.Service;
|
|
154
|
+
type DialogApi = dialog.Api;
|
|
155
|
+
interface DialogController {
|
|
156
|
+
machine: typeof dialog.machine;
|
|
157
|
+
props: Partial<dialog.Props>;
|
|
158
|
+
connect(service: DialogService): DialogApi;
|
|
159
|
+
}
|
|
160
|
+
declare function dialogController(opts?: DialogControllerOptions): DialogController;
|
|
161
|
+
|
|
162
|
+
interface DialogOptions extends DialogControllerOptions {
|
|
163
|
+
title?: string;
|
|
164
|
+
content?: Node | ((body: HTMLElement) => void);
|
|
165
|
+
host?: HTMLElement;
|
|
166
|
+
/** Drag the dialog by its header (the reference dialogs move; search stays fixed). */
|
|
167
|
+
draggable?: boolean;
|
|
168
|
+
/** Darken the page behind the dialog (default false — the chart stays readable while
|
|
169
|
+
* dialogs edit live content). Pass true for a dimming scrim; the backdrop still
|
|
170
|
+
* catches interact-outside dismissal either way. */
|
|
171
|
+
dimBackdrop?: boolean;
|
|
172
|
+
}
|
|
173
|
+
declare class Dialog {
|
|
174
|
+
/** Caller-owned content area — append your form/panel here. */
|
|
175
|
+
readonly body: HTMLElement;
|
|
176
|
+
private readonly backdrop;
|
|
177
|
+
private readonly positioner;
|
|
178
|
+
private readonly panel;
|
|
179
|
+
private readonly handle;
|
|
180
|
+
private readonly ctrl;
|
|
181
|
+
constructor(opts?: DialogOptions);
|
|
182
|
+
get open(): boolean;
|
|
183
|
+
show(): void;
|
|
184
|
+
hide(): void;
|
|
185
|
+
destroy(): void;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export { Dialog, type DialogApi, type DialogControllerOptions, type DialogOptions, type DialogService, type MachineHandle, Menu, type MenuApi, type MenuControllerOptions, type MenuItemDescriptor, type MenuOptions, type MenuService, Tooltip, type TooltipApi, type TooltipControllerOptions, type TooltipOptions, type TooltipService, applyPlotOverlayTokens, applyThemeTokens, dialogController, ensureUIHost, iconEl, injectStyles, menuController, nextUid, runMachine, tooltipController, withAlpha };
|
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { c as VelaTheme } from './options-Q-576hIi.js';
|
|
2
|
+
import { MachineSchema, Service, Machine } from '@zag-js/core';
|
|
3
|
+
export { a as KeyBindingDescriptor, K as KeymapManager, b as KeymapOptions, R as ResolvedBinding } from './keymap-CGOz5F5f.js';
|
|
4
|
+
import * as tooltip from '@zag-js/tooltip';
|
|
5
|
+
import * as menu from '@zag-js/menu';
|
|
6
|
+
import * as dialog from '@zag-js/dialog';
|
|
7
|
+
export { i as iconMarkup, r as registerIcon, s as svg16, a as svg24 } from './icons-BZYbJXSV.js';
|
|
8
|
+
export { normalizeProps, spreadProps } from '@zag-js/vanilla';
|
|
9
|
+
|
|
10
|
+
/** Apply an alpha to any parseable color → an `rgba(...)` string. Unparseable input is
|
|
11
|
+
* returned unchanged so callers can pass through `transparent`, `currentColor`, etc. */
|
|
12
|
+
declare function withAlpha(color: string, alpha: number): string;
|
|
13
|
+
|
|
14
|
+
/** A ready-to-insert element rendering the icon (empty span when unknown). */
|
|
15
|
+
declare function iconEl(id: string, doc?: Document): HTMLElement;
|
|
16
|
+
|
|
17
|
+
/** Inject a stylesheet once per root (document or shadow root). Idempotent by id. */
|
|
18
|
+
declare function injectStyles(id: string, css: string, root?: Document | ShadowRoot): void;
|
|
19
|
+
|
|
20
|
+
/** Write the theme-derived custom properties onto a host element (the widget root and
|
|
21
|
+
* every floating layer — menus/tooltips portal outside the root, so layers re-apply). */
|
|
22
|
+
declare function applyThemeTokens(el: HTMLElement, t: VelaTheme): void;
|
|
23
|
+
/** Re-token a chart-overlay host (statusline, watermark, toast, context menu — chrome
|
|
24
|
+
* floating OVER the plot) from the LIVE plot surface: a config edit can recolor the
|
|
25
|
+
* plot background independently of the app theme (a white plot typed into settings on
|
|
26
|
+
* the dark theme), and the overlay ink must stay readable either way. `config` is the
|
|
27
|
+
* renderer's `getConfig()` snapshot; a missing/shapeless one falls back to the base
|
|
28
|
+
* app theme. */
|
|
29
|
+
declare function applyPlotOverlayTokens(host: HTMLElement, base: VelaTheme, config: unknown): void;
|
|
30
|
+
/** Mark an element as a kit host: static token sheet + the `.vela-ui` class. */
|
|
31
|
+
declare function ensureUIHost(el: HTMLElement, theme?: VelaTheme): void;
|
|
32
|
+
|
|
33
|
+
interface MachineHandle<T extends MachineSchema> {
|
|
34
|
+
service: Service<T>;
|
|
35
|
+
/** Re-run the view projection now (e.g. after external DOM swaps). */
|
|
36
|
+
flush(): void;
|
|
37
|
+
stop(): void;
|
|
38
|
+
}
|
|
39
|
+
/** Start a machine and keep `render(service)` in sync with every transition.
|
|
40
|
+
* `render` runs once immediately (initial projection) and on each machine notification. */
|
|
41
|
+
declare function runMachine<T extends MachineSchema>(machine: Machine<T>, props: Partial<T['props']> | (() => Partial<T['props']>), render: (service: Service<T>) => void): MachineHandle<T>;
|
|
42
|
+
/** Unique ids for machine instances (Zag keys its DOM lookups on them). */
|
|
43
|
+
declare function nextUid(prefix: string): string;
|
|
44
|
+
|
|
45
|
+
interface TooltipControllerOptions {
|
|
46
|
+
placement?: tooltip.Placement;
|
|
47
|
+
/** ms before opening on hover (default 0 — the reference tooltips are instant). */
|
|
48
|
+
openDelay?: number;
|
|
49
|
+
closeDelay?: number;
|
|
50
|
+
/** Keep open while the pointer is over the content (rich tooltips). */
|
|
51
|
+
interactive?: boolean;
|
|
52
|
+
/** Share the trigger's DOM id with other machines composed on the SAME element
|
|
53
|
+
* (each Zag machine otherwise stamps its own id — last one wins and breaks the rest). */
|
|
54
|
+
triggerId?: string;
|
|
55
|
+
}
|
|
56
|
+
type TooltipService = tooltip.Service;
|
|
57
|
+
type TooltipApi = tooltip.Api;
|
|
58
|
+
interface TooltipController {
|
|
59
|
+
machine: typeof tooltip.machine;
|
|
60
|
+
props: Partial<tooltip.Props>;
|
|
61
|
+
connect(service: TooltipService): TooltipApi;
|
|
62
|
+
}
|
|
63
|
+
declare function tooltipController(opts?: TooltipControllerOptions): TooltipController;
|
|
64
|
+
|
|
65
|
+
interface TooltipOptions extends TooltipControllerOptions {
|
|
66
|
+
content: string | Node | (() => Node);
|
|
67
|
+
host?: HTMLElement;
|
|
68
|
+
}
|
|
69
|
+
declare class Tooltip {
|
|
70
|
+
private readonly positioner;
|
|
71
|
+
private readonly content;
|
|
72
|
+
private readonly handle;
|
|
73
|
+
private readonly trigger;
|
|
74
|
+
constructor(trigger: HTMLElement, opts: TooltipOptions);
|
|
75
|
+
setContent(content: string | Node | (() => Node)): void;
|
|
76
|
+
destroy(): void;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** One menu entry. `id` is the selection value reported to `onSelect`. */
|
|
80
|
+
interface MenuItemDescriptor {
|
|
81
|
+
id: string;
|
|
82
|
+
label: string;
|
|
83
|
+
disabled?: boolean;
|
|
84
|
+
/** Draw a separator line above this item. */
|
|
85
|
+
separatorBefore?: boolean;
|
|
86
|
+
/** Right-aligned hint (e.g. a shortcut display from KeymapManager). */
|
|
87
|
+
hint?: string;
|
|
88
|
+
/** Selected state (undefined = plain item). A plain checked item renders as a
|
|
89
|
+
* highlighted row (brighter surface + bright ink). */
|
|
90
|
+
checked?: boolean;
|
|
91
|
+
/** Render as a SWITCH row (a right-aligned toggle pill reflecting `checked`)
|
|
92
|
+
* instead of the selected-row highlight, and keep the menu OPEN on selection —
|
|
93
|
+
* the shape for boolean settings living inside a dropdown. */
|
|
94
|
+
toggle?: boolean;
|
|
95
|
+
/** Icon id (see the `vela/ui` icon registry) rendered before the label. */
|
|
96
|
+
icon?: string;
|
|
97
|
+
/** Nested entries — the row becomes a submenu trigger opening its own list to the side.
|
|
98
|
+
* A branch is not selectable itself: `onSelect` only ever reports leaf ids. */
|
|
99
|
+
submenu?: readonly MenuItemDescriptor[];
|
|
100
|
+
}
|
|
101
|
+
interface MenuControllerOptions {
|
|
102
|
+
items: readonly MenuItemDescriptor[];
|
|
103
|
+
onSelect?: (id: string) => void;
|
|
104
|
+
placement?: menu.Props['positioning'] extends infer P | undefined ? P extends {
|
|
105
|
+
placement?: infer PL;
|
|
106
|
+
} ? PL : never : never;
|
|
107
|
+
onOpenChange?: (open: boolean) => void;
|
|
108
|
+
/** Share the trigger's DOM id with other machines composed on the same element. */
|
|
109
|
+
triggerId?: string;
|
|
110
|
+
/** Pin the machine's own id instead of taking a fresh one. A parent registers its
|
|
111
|
+
* submenus under this key, so rebuilding a branch replaces its entry rather than
|
|
112
|
+
* piling a new one on top. */
|
|
113
|
+
id?: string;
|
|
114
|
+
}
|
|
115
|
+
type MenuService = menu.Service;
|
|
116
|
+
type MenuApi = menu.Api;
|
|
117
|
+
interface MenuController {
|
|
118
|
+
machine: typeof menu.machine;
|
|
119
|
+
props: Partial<menu.Props>;
|
|
120
|
+
connect(service: MenuService): MenuApi;
|
|
121
|
+
}
|
|
122
|
+
declare function menuController(opts: MenuControllerOptions): MenuController;
|
|
123
|
+
|
|
124
|
+
interface MenuOptions extends MenuControllerOptions {
|
|
125
|
+
/** Element that opens the menu on click (gets the machine's trigger props). */
|
|
126
|
+
trigger?: HTMLElement;
|
|
127
|
+
host?: HTMLElement;
|
|
128
|
+
/** Override the root list's min-width (the stylesheet default suits full-word labels;
|
|
129
|
+
* compact lists like the timeframe dropdown pass something snug). Submenus keep the
|
|
130
|
+
* default. */
|
|
131
|
+
minWidth?: string;
|
|
132
|
+
}
|
|
133
|
+
declare class Menu {
|
|
134
|
+
private readonly root;
|
|
135
|
+
constructor(opts: MenuOptions);
|
|
136
|
+
get api(): menu.Api;
|
|
137
|
+
open(): void;
|
|
138
|
+
/** Open anchored to a viewport point (context menus). */
|
|
139
|
+
openAt(clientX: number, clientY: number): void;
|
|
140
|
+
close(): void;
|
|
141
|
+
/** Swap the item descriptors (e.g. checked states) and re-project. */
|
|
142
|
+
setItems(items: readonly MenuItemDescriptor[]): void;
|
|
143
|
+
destroy(): void;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
interface DialogControllerOptions {
|
|
147
|
+
/** Trap focus + backdrop (default true). Non-modal = floating panel. */
|
|
148
|
+
modal?: boolean;
|
|
149
|
+
closeOnEscape?: boolean;
|
|
150
|
+
closeOnInteractOutside?: boolean;
|
|
151
|
+
onOpenChange?: (open: boolean) => void;
|
|
152
|
+
}
|
|
153
|
+
type DialogService = dialog.Service;
|
|
154
|
+
type DialogApi = dialog.Api;
|
|
155
|
+
interface DialogController {
|
|
156
|
+
machine: typeof dialog.machine;
|
|
157
|
+
props: Partial<dialog.Props>;
|
|
158
|
+
connect(service: DialogService): DialogApi;
|
|
159
|
+
}
|
|
160
|
+
declare function dialogController(opts?: DialogControllerOptions): DialogController;
|
|
161
|
+
|
|
162
|
+
interface DialogOptions extends DialogControllerOptions {
|
|
163
|
+
title?: string;
|
|
164
|
+
content?: Node | ((body: HTMLElement) => void);
|
|
165
|
+
host?: HTMLElement;
|
|
166
|
+
/** Drag the dialog by its header (the reference dialogs move; search stays fixed). */
|
|
167
|
+
draggable?: boolean;
|
|
168
|
+
/** Darken the page behind the dialog (default false — the chart stays readable while
|
|
169
|
+
* dialogs edit live content). Pass true for a dimming scrim; the backdrop still
|
|
170
|
+
* catches interact-outside dismissal either way. */
|
|
171
|
+
dimBackdrop?: boolean;
|
|
172
|
+
}
|
|
173
|
+
declare class Dialog {
|
|
174
|
+
/** Caller-owned content area — append your form/panel here. */
|
|
175
|
+
readonly body: HTMLElement;
|
|
176
|
+
private readonly backdrop;
|
|
177
|
+
private readonly positioner;
|
|
178
|
+
private readonly panel;
|
|
179
|
+
private readonly handle;
|
|
180
|
+
private readonly ctrl;
|
|
181
|
+
constructor(opts?: DialogOptions);
|
|
182
|
+
get open(): boolean;
|
|
183
|
+
show(): void;
|
|
184
|
+
hide(): void;
|
|
185
|
+
destroy(): void;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export { Dialog, type DialogApi, type DialogControllerOptions, type DialogOptions, type DialogService, type MachineHandle, Menu, type MenuApi, type MenuControllerOptions, type MenuItemDescriptor, type MenuOptions, type MenuService, Tooltip, type TooltipApi, type TooltipControllerOptions, type TooltipOptions, type TooltipService, applyPlotOverlayTokens, applyThemeTokens, dialogController, ensureUIHost, iconEl, injectStyles, menuController, nextUid, runMachine, tooltipController, withAlpha };
|
package/dist/ui.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { Dialog, KeymapManager, Menu, Tooltip, applyPlotOverlayTokens, applyThemeTokens, dialogController, ensureUIHost, menuController, nextUid, normalizeProps, runMachine, spreadProps, tooltipController } from './chunk-RHIDOUFL.js';
|
|
2
|
+
import './chunk-KM6LHB3Y.js';
|
|
3
|
+
export { iconEl, iconMarkup, injectStyles, registerIcon, svg16, svg24, withAlpha } from './chunk-GYD2THPV.js';
|