@luxalgo/vela-ui 0.0.0-stage → 0.2.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.
Files changed (269) hide show
  1. package/CHANGELOG.md +91 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE +28 -0
  4. package/README.md +86 -3
  5. package/cli/engine.mjs +282 -0
  6. package/cli/index.mjs +154 -0
  7. package/dist/badge.d.ts +26 -0
  8. package/dist/badge.js +44 -0
  9. package/dist/bar-chart.d.ts +40 -0
  10. package/dist/bar-chart.js +105 -0
  11. package/dist/button.d.ts +55 -0
  12. package/dist/button.js +11 -0
  13. package/dist/calendar.d.ts +24 -0
  14. package/dist/calendar.js +1 -0
  15. package/dist/callout-bubble.d.ts +103 -0
  16. package/dist/callout-bubble.js +177 -0
  17. package/dist/chart.d.ts +30 -0
  18. package/dist/chart.js +1 -0
  19. package/dist/checkbox.d.ts +60 -0
  20. package/dist/checkbox.js +12 -0
  21. package/dist/chunk-2GQIZM5Z.js +28 -0
  22. package/dist/chunk-3Q32K4PE.js +85 -0
  23. package/dist/chunk-6QCILIT2.js +52 -0
  24. package/dist/chunk-7VMN7NKJ.js +133 -0
  25. package/dist/chunk-A2FJ7Y7D.js +55 -0
  26. package/dist/chunk-A72NWYNP.js +26 -0
  27. package/dist/chunk-B5ZSRUDQ.js +227 -0
  28. package/dist/chunk-BXMWQIBO.js +66 -0
  29. package/dist/chunk-C3ICYMI3.js +25 -0
  30. package/dist/chunk-CC3DDNFC.js +117 -0
  31. package/dist/chunk-E2FE6V2N.js +81 -0
  32. package/dist/chunk-FN2BUFNM.js +10 -0
  33. package/dist/chunk-FVH6L7FM.js +18 -0
  34. package/dist/chunk-G7IQLY3A.js +183 -0
  35. package/dist/chunk-GVRX3UAV.js +82 -0
  36. package/dist/chunk-J2QJATCD.js +12 -0
  37. package/dist/chunk-LZWZV2ZS.js +18 -0
  38. package/dist/chunk-MJ4RUGX7.js +403 -0
  39. package/dist/chunk-MMTMOV6R.js +31 -0
  40. package/dist/chunk-P4MTEMT7.js +23 -0
  41. package/dist/chunk-Q6WTDVH6.js +31 -0
  42. package/dist/chunk-S7USVSYP.js +50 -0
  43. package/dist/chunk-TAKSIV57.js +90 -0
  44. package/dist/chunk-U3EH42YY.js +72 -0
  45. package/dist/chunk-V2Q4MRMS.js +573 -0
  46. package/dist/chunk-VMCR3S2A.js +22 -0
  47. package/dist/chunk-WBGSYCV2.js +101 -0
  48. package/dist/chunk-WGULXRWD.js +351 -0
  49. package/dist/chunk-WXH3EFV5.js +219 -0
  50. package/dist/chunk-X66RJAIS.js +14 -0
  51. package/dist/chunk-XBEL4K33.js +142 -0
  52. package/dist/chunk-Z5PINFQO.js +280 -0
  53. package/dist/collapsible.d.ts +49 -0
  54. package/dist/collapsible.js +106 -0
  55. package/dist/color-picker.d.ts +103 -0
  56. package/dist/color-picker.js +19 -0
  57. package/dist/color.d.ts +24 -0
  58. package/dist/color.js +1 -0
  59. package/dist/context-menu.d.ts +72 -0
  60. package/dist/context-menu.js +161 -0
  61. package/dist/css.d.ts +17 -0
  62. package/dist/css.js +4 -0
  63. package/dist/data-table.d.ts +40 -0
  64. package/dist/data-table.js +88 -0
  65. package/dist/date-picker.d.ts +90 -0
  66. package/dist/date-picker.js +257 -0
  67. package/dist/define-D5u3F5Dj.d.ts +21 -0
  68. package/dist/dialog.d.ts +89 -0
  69. package/dist/dialog.js +258 -0
  70. package/dist/dispose.d.ts +9 -0
  71. package/dist/dispose.js +2 -0
  72. package/dist/donut.d.ts +27 -0
  73. package/dist/donut.js +67 -0
  74. package/dist/drawer.d.ts +119 -0
  75. package/dist/drawer.js +326 -0
  76. package/dist/dropdown-menu.d.ts +114 -0
  77. package/dist/dropdown-menu.js +18 -0
  78. package/dist/empty.d.ts +21 -0
  79. package/dist/empty.js +38 -0
  80. package/dist/field.d.ts +147 -0
  81. package/dist/field.js +328 -0
  82. package/dist/glyph-select.d.ts +57 -0
  83. package/dist/glyph-select.js +17 -0
  84. package/dist/h-Bl37qUis.d.ts +24 -0
  85. package/dist/headless.d.ts +6 -0
  86. package/dist/headless.js +9 -0
  87. package/dist/hover-card.d.ts +43 -0
  88. package/dist/hover-card.js +97 -0
  89. package/dist/i18n.d.ts +20 -0
  90. package/dist/i18n.js +1 -0
  91. package/dist/icons.d.ts +20 -0
  92. package/dist/icons.js +2 -0
  93. package/dist/index.d.ts +51 -0
  94. package/dist/index.js +13 -0
  95. package/dist/input-group.d.ts +57 -0
  96. package/dist/input-group.js +87 -0
  97. package/dist/input.d.ts +54 -0
  98. package/dist/input.js +9 -0
  99. package/dist/item.d.ts +72 -0
  100. package/dist/item.js +131 -0
  101. package/dist/kbd.d.ts +19 -0
  102. package/dist/kbd.js +8 -0
  103. package/dist/kit-text.d.ts +8 -0
  104. package/dist/kit-text.js +2 -0
  105. package/dist/line-chart.d.ts +32 -0
  106. package/dist/line-chart.js +120 -0
  107. package/dist/manifest.json +4508 -0
  108. package/dist/month-grid.d.ts +45 -0
  109. package/dist/month-grid.js +157 -0
  110. package/dist/number-input.d.ts +99 -0
  111. package/dist/number-input.js +14 -0
  112. package/dist/page.d.ts +7 -0
  113. package/dist/page.js +1 -0
  114. package/dist/palette.d.ts +55 -0
  115. package/dist/palette.js +1 -0
  116. package/dist/placement.d.ts +98 -0
  117. package/dist/placement.js +1 -0
  118. package/dist/popover.d.ts +107 -0
  119. package/dist/popover.js +15 -0
  120. package/dist/scatter-chart.d.ts +32 -0
  121. package/dist/scatter-chart.js +121 -0
  122. package/dist/select.d.ts +112 -0
  123. package/dist/select.js +19 -0
  124. package/dist/slider.d.ts +46 -0
  125. package/dist/slider.js +111 -0
  126. package/dist/sort-button.d.ts +41 -0
  127. package/dist/sort-button.js +88 -0
  128. package/dist/sparkline.d.ts +22 -0
  129. package/dist/sparkline.js +72 -0
  130. package/dist/stat.d.ts +29 -0
  131. package/dist/stat.js +41 -0
  132. package/dist/styles.d.ts +22 -0
  133. package/dist/styles.js +2 -0
  134. package/dist/surface-events.d.ts +17 -0
  135. package/dist/surface-events.js +1 -0
  136. package/dist/surface-exit.d.ts +25 -0
  137. package/dist/surface-exit.js +1 -0
  138. package/dist/switch.d.ts +54 -0
  139. package/dist/switch.js +92 -0
  140. package/dist/t.d.ts +89 -0
  141. package/dist/t.js +1 -0
  142. package/dist/tabs.d.ts +65 -0
  143. package/dist/tabs.js +155 -0
  144. package/dist/text-area.d.ts +54 -0
  145. package/dist/text-area.js +9 -0
  146. package/dist/theme.d.ts +199 -0
  147. package/dist/theme.js +8 -0
  148. package/dist/theme.schema.json +1994 -0
  149. package/dist/themes/dark.css +3 -0
  150. package/dist/themes/light.css +3 -0
  151. package/dist/toggle-group.d.ts +56 -0
  152. package/dist/toggle-group.js +130 -0
  153. package/dist/tokens.d.ts +16 -0
  154. package/dist/tokens.js +3 -0
  155. package/dist/tooltip.d.ts +47 -0
  156. package/dist/tooltip.js +74 -0
  157. package/dist/variants-B4stUBnY.d.ts +16 -0
  158. package/dist/zag.d.ts +19 -0
  159. package/dist/zag.js +2 -0
  160. package/docs/theming.md +217 -0
  161. package/docs/what-to-change.md +20 -0
  162. package/docs/writing-a-component.md +250 -0
  163. package/llms.txt +71 -0
  164. package/package.json +90 -6
  165. package/registry/badge.ts +119 -0
  166. package/registry/bar-chart.ts +215 -0
  167. package/registry/button.ts +379 -0
  168. package/registry/callout-bubble.ts +347 -0
  169. package/registry/checkbox.ts +234 -0
  170. package/registry/collapsible.ts +271 -0
  171. package/registry/color-picker.ts +582 -0
  172. package/registry/context-menu.ts +208 -0
  173. package/registry/data-table.ts +215 -0
  174. package/registry/date-picker.ts +483 -0
  175. package/registry/dialog.ts +535 -0
  176. package/registry/donut.ts +145 -0
  177. package/registry/drawer.ts +636 -0
  178. package/registry/dropdown-menu.ts +762 -0
  179. package/registry/empty.ts +91 -0
  180. package/registry/field.ts +585 -0
  181. package/registry/glyph-select.ts +268 -0
  182. package/registry/hover-card.ts +222 -0
  183. package/registry/input-group.ts +229 -0
  184. package/registry/input.ts +181 -0
  185. package/registry/item.ts +376 -0
  186. package/registry/kbd.ts +64 -0
  187. package/registry/line-chart.ts +218 -0
  188. package/registry/month-grid.ts +328 -0
  189. package/registry/number-input.ts +443 -0
  190. package/registry/popover.ts +368 -0
  191. package/registry/scatter-chart.ts +221 -0
  192. package/registry/select.ts +620 -0
  193. package/registry/slider.ts +259 -0
  194. package/registry/sort-button.ts +189 -0
  195. package/registry/sparkline.ts +114 -0
  196. package/registry/stat.ts +96 -0
  197. package/registry/switch.ts +205 -0
  198. package/registry/tabs.ts +426 -0
  199. package/registry/text-area.ts +186 -0
  200. package/registry/toggle-group.ts +295 -0
  201. package/registry/tooltip.ts +156 -0
  202. package/skills/theming-vela-ui/SKILL.md +137 -0
  203. package/skills/using-vela-ui-components/SKILL.md +137 -0
  204. package/skills/writing-vela-ui-components/SKILL.md +163 -0
  205. package/src/components/badge.ts +119 -0
  206. package/src/components/bar-chart.ts +215 -0
  207. package/src/components/button.ts +379 -0
  208. package/src/components/callout-bubble.ts +347 -0
  209. package/src/components/checkbox.ts +234 -0
  210. package/src/components/collapsible.ts +271 -0
  211. package/src/components/color-picker.ts +582 -0
  212. package/src/components/context-menu.ts +208 -0
  213. package/src/components/data-table.ts +215 -0
  214. package/src/components/date-picker.ts +483 -0
  215. package/src/components/dialog.ts +535 -0
  216. package/src/components/donut.ts +145 -0
  217. package/src/components/drawer.ts +636 -0
  218. package/src/components/dropdown-menu.ts +762 -0
  219. package/src/components/empty.ts +91 -0
  220. package/src/components/field.ts +585 -0
  221. package/src/components/glyph-select.ts +268 -0
  222. package/src/components/hover-card.ts +222 -0
  223. package/src/components/input-group.ts +229 -0
  224. package/src/components/input.ts +181 -0
  225. package/src/components/item.ts +376 -0
  226. package/src/components/kbd.ts +64 -0
  227. package/src/components/line-chart.ts +218 -0
  228. package/src/components/month-grid.ts +328 -0
  229. package/src/components/number-input.ts +443 -0
  230. package/src/components/popover.ts +368 -0
  231. package/src/components/scatter-chart.ts +221 -0
  232. package/src/components/select.ts +620 -0
  233. package/src/components/slider.ts +259 -0
  234. package/src/components/sort-button.ts +189 -0
  235. package/src/components/sparkline.ts +114 -0
  236. package/src/components/stat.ts +96 -0
  237. package/src/components/switch.ts +205 -0
  238. package/src/components/tabs.ts +426 -0
  239. package/src/components/text-area.ts +186 -0
  240. package/src/components/toggle-group.ts +295 -0
  241. package/src/components/tooltip.ts +156 -0
  242. package/src/index.ts +24 -0
  243. package/src/lib/calendar.ts +117 -0
  244. package/src/lib/chart.ts +72 -0
  245. package/src/lib/color.ts +89 -0
  246. package/src/lib/component-index.ts +151 -0
  247. package/src/lib/css.ts +48 -0
  248. package/src/lib/define.ts +45 -0
  249. package/src/lib/dispose.ts +36 -0
  250. package/src/lib/h.ts +55 -0
  251. package/src/lib/headless.ts +16 -0
  252. package/src/lib/i18n.ts +30 -0
  253. package/src/lib/icons.ts +237 -0
  254. package/src/lib/kit-text.ts +26 -0
  255. package/src/lib/page.ts +24 -0
  256. package/src/lib/palette.ts +81 -0
  257. package/src/lib/placement.ts +188 -0
  258. package/src/lib/scope.ts +135 -0
  259. package/src/lib/styles.ts +53 -0
  260. package/src/lib/surface-events.ts +31 -0
  261. package/src/lib/surface-exit.ts +87 -0
  262. package/src/lib/t.ts +68 -0
  263. package/src/lib/theme.ts +664 -0
  264. package/src/lib/tokens.ts +111 -0
  265. package/src/lib/variants.ts +32 -0
  266. package/src/lib/zag.ts +46 -0
  267. package/stylelint/index.mjs +60 -0
  268. package/stylelint/lint.mjs +81 -0
  269. package/stylelint/plugin.mjs +115 -0
@@ -0,0 +1,45 @@
1
+ import { C as ComponentDef } from './define-D5u3F5Dj.js';
2
+ import { Translator } from './i18n.js';
3
+ import './t.js';
4
+
5
+ declare const monthGridDef: ComponentDef<"month-grid", "root" | "value" | "day" | "weekday" | "date" | "blank" | "detail", "radius" | "gap" | "day-height" | "selected-ring">;
6
+ type MonthGridTone = 'profit' | 'loss' | 'neutral';
7
+ interface MonthGridDay {
8
+ /** The day's figure (`+1,240.50`). */
9
+ value?: string;
10
+ /** A line under the figure (`3 trades · 67%`). */
11
+ detail?: string;
12
+ /** Tints the cell and colors the figure. */
13
+ tone?: MonthGridTone;
14
+ /** What a screen reader hears for the day (default: the date, the figure and the line). */
15
+ label?: string;
16
+ }
17
+ interface MonthGridProps {
18
+ /** The month shown (`2026-11`). */
19
+ month: string;
20
+ /** The days with something to show, by date (`2026-11-06`). */
21
+ days?: Readonly<Record<string, MonthGridDay>>;
22
+ /** The selected day (`2026-11-06`), ringed. */
23
+ selected?: string | null;
24
+ /** Today (`2026-11-06`), its date bright and bold. */
25
+ today?: string | null;
26
+ /** A day was chosen: a click, Enter or Space. Without it the days are not buttons. */
27
+ onSelect?: (date: string) => void;
28
+ /** The translator whose locale names the weekdays, picks the first day of the week and
29
+ * the digits. Default: the kit build's, else English with weeks starting on Sunday. */
30
+ i18n?: Translator;
31
+ /** Extra class names (layout hooks). */
32
+ className?: string;
33
+ }
34
+ interface MonthGridHandle {
35
+ readonly el: HTMLElement;
36
+ /** The month shown (`2026-11`). */
37
+ readonly month: string;
38
+ setMonth(month: string): void;
39
+ setDays(days: Readonly<Record<string, MonthGridDay>>): void;
40
+ setSelected(date: string | null): void;
41
+ destroy(): void;
42
+ }
43
+ declare function createMonthGrid(props: MonthGridProps): MonthGridHandle;
44
+
45
+ export { type MonthGridDay, type MonthGridHandle, type MonthGridProps, type MonthGridTone, createMonthGrid, monthGridDef };
@@ -0,0 +1,157 @@
1
+ import { calendarSettings, weekdayNames, longDate, plainInteger } from './chunk-GVRX3UAV.js';
2
+ import { kitTranslator } from './chunk-FVH6L7FM.js';
3
+ import { h } from './chunk-Q6WTDVH6.js';
4
+ import { defineComponent } from './chunk-VMCR3S2A.js';
5
+ import { defineStyles, css } from './chunk-XBEL4K33.js';
6
+ import './chunk-2GQIZM5Z.js';
7
+ import './chunk-BXMWQIBO.js';
8
+ import './chunk-X66RJAIS.js';
9
+ import { t } from './chunk-6QCILIT2.js';
10
+
11
+ // src/components/month-grid.ts
12
+ var monthGridDef = defineComponent({
13
+ name: "month-grid",
14
+ parts: ["root", "weekday", "day", "date", "value", "detail", "blank"],
15
+ settings: { radius: "8px", "day-height": "56px", gap: "4px", "selected-ring": `inset 0 0 0 1px ${t.selected.bg}` }
16
+ });
17
+ var injectStyles = defineStyles(
18
+ "vela-ui-month-grid",
19
+ css`@layer vela.ui{[data-slot=month-grid]{min-width:0}[data-slot=month-grid]:where(:not([hidden])){gap:${monthGridDef.vars.gap};grid-template-columns:repeat(7,minmax(0,1fr));display:grid}[data-slot=month-grid-weekday]{color:${t.fg.muted};letter-spacing:.06em;text-align:center;text-transform:uppercase;padding:4px 0;font-size:10px;font-weight:500}[data-slot=month-grid-blank],[data-slot=month-grid-day]{min-width:0;min-height:${monthGridDef.vars["day-height"]};border-radius:${monthGridDef.vars.radius}}[data-slot=month-grid-day]{all:unset;box-sizing:border-box;min-width:0;min-height:${monthGridDef.vars["day-height"]};border:1px solid ${t.border.faint};border-radius:${monthGridDef.vars.radius};background:color-mix(in srgb, ${t.fg.bright} 2%, transparent);text-align:start;font-variant-numeric:tabular-nums;transition:border-color ${t.dur.fast} ease;padding:5px;overflow:hidden}[data-slot=month-grid-day]:where(:not([hidden])){flex-direction:column;gap:1px;display:flex}[data-slot=month-grid-day][data-tone=profit]{border-color:color-mix(in srgb, ${t.profit} 40%, transparent);background:color-mix(in srgb, ${t.profit} 10%, transparent)}[data-slot=month-grid-day][data-tone=loss]{border-color:color-mix(in srgb, ${t.loss} 40%, transparent);background:color-mix(in srgb, ${t.loss} 10%, transparent)}[data-slot=month-grid-day][data-tone=neutral]{border-color:${t.border};background:${t.hover}}[data-slot=month-grid-day][type=button]{cursor:pointer}[data-slot=month-grid-day][data-checked]{border-color:${t.selected.bg};box-shadow:${monthGridDef.vars["selected-ring"]}}[data-slot=month-grid-day]:focus-visible{outline:2px solid ${t.focus};outline-offset:1px}[data-slot=month-grid-day][type=button]:not([data-checked]):hover{border-color:${t.border.strong}}[data-slot=month-grid-date]{color:${t.fg.muted};font-size:10px;line-height:12px}[data-slot=month-grid-date]:is([data-today]>*){color:${t.fg.bright};font-weight:600}[data-slot=month-grid-value],[data-slot=month-grid-detail]{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}[data-slot=month-grid-value]{color:${t.fg.bright};margin-top:auto;font-size:11px;font-weight:500;line-height:14px}[data-slot=month-grid-value]:is([data-tone=profit]>*){color:${t.profit}}[data-slot=month-grid-value]:is([data-tone=loss]>*){color:${t.loss}}[data-slot=month-grid-detail]{color:${t.fg.muted};font-size:9px;line-height:12px}}`
20
+ );
21
+ var MONTH = /^(\d{4})-(\d{2})$/;
22
+ var pad = (n) => String(n).padStart(2, "0");
23
+ var MonthGridImpl = class {
24
+ constructor(props) {
25
+ this.props = props;
26
+ /** The day that takes Tab into the grid, and keeps it while the arrow keys move. */
27
+ this.focusDate = null;
28
+ this.onClick = (e) => {
29
+ const day = this.dayOf(e.target);
30
+ if (day) this.choose(day);
31
+ };
32
+ this.onKey = (e) => {
33
+ const day = this.dayOf(e.target);
34
+ if (!day) return;
35
+ if (e.key === "Enter" || e.key === " ") {
36
+ e.preventDefault();
37
+ this.choose(day);
38
+ return;
39
+ }
40
+ const rtl = getComputedStyle(this.el).direction === "rtl";
41
+ const n = Number(day.dataset.date.slice(8));
42
+ const column = (Array.prototype.indexOf.call(this.el.children, day) - 7) % 7;
43
+ const moves = {
44
+ ArrowLeft: rtl ? 1 : -1,
45
+ ArrowRight: rtl ? -1 : 1,
46
+ ArrowUp: -7,
47
+ ArrowDown: 7,
48
+ Home: -column,
49
+ End: 6 - column
50
+ };
51
+ const move = moves[e.key];
52
+ if (move === void 0) return;
53
+ e.preventDefault();
54
+ const last = this.el.querySelectorAll("[data-date]").length;
55
+ const next = e.key === "Home" || e.key === "End" ? Math.min(last, Math.max(1, n + move)) : n + move;
56
+ const target = this.el.querySelector(`[data-date="${this.shown}-${pad(next)}"]`);
57
+ if (!target) return;
58
+ this.roveTo(target.dataset.date);
59
+ target.focus();
60
+ };
61
+ injectStyles(document);
62
+ const i18n = props.i18n ?? kitTranslator();
63
+ this.settings = calendarSettings(i18n);
64
+ this.weekStart = i18n?.weekStart ?? 0;
65
+ this.shown = MONTH.test(props.month) ? props.month : props.month.slice(0, 7);
66
+ this.days = props.days ?? {};
67
+ this.selected = props.selected ?? null;
68
+ this.today = props.today ?? null;
69
+ this.el = h("div", { className: props.className, slot: monthGridDef.slot("root") });
70
+ if (props.onSelect) {
71
+ this.el.addEventListener("click", this.onClick);
72
+ this.el.addEventListener("keydown", this.onKey);
73
+ }
74
+ this.render();
75
+ }
76
+ get month() {
77
+ return this.shown;
78
+ }
79
+ setMonth(month) {
80
+ this.shown = month;
81
+ this.focusDate = null;
82
+ this.render();
83
+ }
84
+ setDays(days) {
85
+ this.days = days;
86
+ this.render();
87
+ }
88
+ setSelected(date) {
89
+ this.selected = date;
90
+ this.render();
91
+ }
92
+ destroy() {
93
+ this.el.removeEventListener("click", this.onClick);
94
+ this.el.removeEventListener("keydown", this.onKey);
95
+ }
96
+ dayOf(target) {
97
+ const day = target instanceof Element ? target.closest(`[data-slot="${monthGridDef.slot("day")}"]`) : null;
98
+ return day && this.el.contains(day) ? day : null;
99
+ }
100
+ choose(day) {
101
+ const date = day.dataset.date;
102
+ this.roveTo(date);
103
+ this.props.onSelect?.(date);
104
+ }
105
+ roveTo(date) {
106
+ this.focusDate = date;
107
+ for (const el of this.el.querySelectorAll("[data-date]")) el.tabIndex = el.dataset.date === date ? 0 : -1;
108
+ }
109
+ render() {
110
+ const m = MONTH.exec(this.shown);
111
+ if (!m) {
112
+ this.el.replaceChildren();
113
+ return;
114
+ }
115
+ const year = Number(m[1]);
116
+ const month = Number(m[2]) - 1;
117
+ const names = weekdayNames(this.settings);
118
+ const startPad = (new Date(Date.UTC(year, month, 1)).getUTCDay() - this.weekStart + 7) % 7;
119
+ const count = new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
120
+ const endPad = (7 - (startPad + count) % 7) % 7;
121
+ const clickable = !!this.props.onSelect;
122
+ const blank = () => h("div", { slot: monthGridDef.slot("blank"), attrs: { "aria-hidden": "true" } });
123
+ const cells = [];
124
+ for (let i = 0; i < 7; i++) cells.push(h("div", { slot: monthGridDef.slot("weekday"), attrs: { "aria-hidden": "true" }, text: names[(this.weekStart + i) % 7] }));
125
+ for (let i = 0; i < startPad; i++) cells.push(blank());
126
+ const inMonth = (date) => !!date && date.startsWith(`${this.shown}-`);
127
+ const rover = [this.focusDate, this.selected, this.today].find(inMonth) ?? `${this.shown}-01`;
128
+ for (let d = 1; d <= count; d++) {
129
+ const date = `${this.shown}-${pad(d)}`;
130
+ const day = this.days[date];
131
+ const label = day?.label ?? [longDate(this.settings, year, month, d), day?.value, day?.detail].filter(Boolean).join(", ");
132
+ const current = date === this.selected ? "true" : date === this.today ? "date" : null;
133
+ cells.push(
134
+ h(
135
+ clickable ? "button" : "div",
136
+ {
137
+ slot: monthGridDef.slot("day"),
138
+ data: { date, tone: day?.tone ?? null, today: date === this.today, checked: date === this.selected },
139
+ attrs: clickable ? { type: "button", tabindex: date === rover ? "0" : "-1", "aria-label": label, "aria-current": current } : void 0
140
+ },
141
+ h("span", { slot: monthGridDef.slot("date"), text: plainInteger(this.settings, d) }),
142
+ day?.value ? h("span", { slot: monthGridDef.slot("value"), text: day.value }) : null,
143
+ day?.detail ? h("span", { slot: monthGridDef.slot("detail"), text: day.detail }) : null
144
+ )
145
+ );
146
+ }
147
+ for (let i = 0; i < endPad; i++) cells.push(blank());
148
+ const hadFocus = this.el.contains(document.activeElement);
149
+ this.el.replaceChildren(...cells);
150
+ if (hadFocus) this.el.querySelector('[tabindex="0"]')?.focus();
151
+ }
152
+ };
153
+ function createMonthGrid(props) {
154
+ return new MonthGridImpl(props);
155
+ }
156
+
157
+ export { createMonthGrid, monthGridDef };
@@ -0,0 +1,99 @@
1
+ import { V as VariantFn } from './variants-B4stUBnY.js';
2
+ import { C as ComponentDef } from './define-D5u3F5Dj.js';
3
+ import { Translator } from './i18n.js';
4
+ import './t.js';
5
+
6
+ type NumberSize = 'sm' | 'md';
7
+ type NumberCommit = 'blur' | 'live';
8
+ interface NumberInputControllerOptions {
9
+ value: number;
10
+ min?: number;
11
+ max?: number;
12
+ step?: number;
13
+ integer?: boolean;
14
+ size?: NumberSize;
15
+ /** `blur` clamps on commit (indicator dialog). `live` emits on every keystroke
16
+ * (chart settings). Steppers default on for `blur`; pass `steppers: true` to
17
+ * keep them with live commit. */
18
+ commit?: NumberCommit;
19
+ steppers?: boolean;
20
+ clamp?: boolean;
21
+ disabled?: boolean;
22
+ onChange?: (value: number) => void;
23
+ }
24
+ declare function clampNumber(n: number, opts: {
25
+ min?: number;
26
+ max?: number;
27
+ integer?: boolean;
28
+ }): number;
29
+ /** Trim binary-float noise after stepper arithmetic (`1.7 + 0.1` → `1.8`, not
30
+ * `1.7999999999999998`): round to the decimals the base value and step imply. */
31
+ declare function snapToStep(n: number, base: number, step: number): number;
32
+ interface NumberInputController {
33
+ value: number;
34
+ min?: number;
35
+ max?: number;
36
+ step: number;
37
+ integer: boolean;
38
+ size: NumberSize;
39
+ commit: NumberCommit;
40
+ steppers: boolean;
41
+ clamp: boolean;
42
+ disabled: boolean;
43
+ apply(raw: number): number | null;
44
+ /** Write the displayed value without emitting (vela-sync / external refresh). */
45
+ sync(raw: number): number;
46
+ nudge(dir: 1 | -1): number | null;
47
+ }
48
+ /** The field's clamping, rounding and commit rules, without DOM. */
49
+ declare function numberInputController(opts: NumberInputControllerOptions): NumberInputController;
50
+ declare const numberInputDef: ComponentDef<"number-input", "root" | "input" | "step" | "steps", "radius" | "focus-ring" | "step-radius">;
51
+ declare const numberInputVariants: VariantFn<{
52
+ readonly size: readonly ["md", "sm"];
53
+ }>;
54
+ interface NumberInputOptions extends NumberInputControllerOptions {
55
+ id?: string;
56
+ title?: string;
57
+ /** Chart-settings placeholder mode: empty field means `emptyValue` (the default). */
58
+ placeholder?: string;
59
+ emptyValue?: number;
60
+ /** Submitted with its form under this name. */
61
+ name?: string;
62
+ required?: boolean;
63
+ compact?: boolean;
64
+ /** Stretch to the parent. Defaults to on for `md`, off for `sm`. Chart settings
65
+ * passes `false` so the field stays a 100px kit column instead of filling the pane. */
66
+ fill?: boolean;
67
+ /** The translator of the steppers' names (default: the kit build's, else English). */
68
+ i18n?: Translator | null;
69
+ }
70
+ type NumberInputProps = NumberInputOptions;
71
+ declare const NUMBER_STYLE_ID = "vela-ui-number-3";
72
+ declare const NUMBER_CSS: string;
73
+ declare class NumberInput {
74
+ readonly el: HTMLElement;
75
+ readonly input: HTMLInputElement;
76
+ private readonly ctrl;
77
+ private readonly placeholderMode;
78
+ private readonly emptyValue;
79
+ private readonly i18n;
80
+ private readonly machine;
81
+ private readonly mid;
82
+ private readonly release;
83
+ /** The user is typing a value the field commits on blur: the machine's reports of it
84
+ * are not commits. */
85
+ private typing;
86
+ constructor(opts: NumberInputOptions);
87
+ get value(): number;
88
+ setValue(v: number): void;
89
+ destroy(): void;
90
+ /** Show `n` in the field: through the machine, so its next render keeps it. */
91
+ private show;
92
+ private render;
93
+ private up;
94
+ private down;
95
+ private buildSteppers;
96
+ }
97
+ declare function createNumberInput(props: NumberInputProps): NumberInput;
98
+
99
+ export { NUMBER_CSS, NUMBER_STYLE_ID, type NumberCommit, NumberInput, type NumberInputController, type NumberInputControllerOptions, type NumberInputOptions, type NumberInputProps, type NumberSize, clampNumber, createNumberInput, numberInputController, numberInputDef, numberInputVariants, snapToStep };
@@ -0,0 +1,14 @@
1
+ export { NUMBER_CSS, NUMBER_STYLE_ID, NumberInput, clampNumber, createNumberInput, numberInputController, numberInputDef, numberInputVariants, snapToStep } from './chunk-WXH3EFV5.js';
2
+ import './chunk-LZWZV2ZS.js';
3
+ import './chunk-G7IQLY3A.js';
4
+ import './chunk-FVH6L7FM.js';
5
+ import './chunk-FN2BUFNM.js';
6
+ import './chunk-A72NWYNP.js';
7
+ import './chunk-P4MTEMT7.js';
8
+ import './chunk-Q6WTDVH6.js';
9
+ import './chunk-VMCR3S2A.js';
10
+ import './chunk-XBEL4K33.js';
11
+ import './chunk-2GQIZM5Z.js';
12
+ import './chunk-BXMWQIBO.js';
13
+ import './chunk-X66RJAIS.js';
14
+ import './chunk-6QCILIT2.js';
package/dist/page.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ /** The page-wide value under `name`, created by `init` on first use. */
2
+ declare function pageState<T>(name: string, init: () => T): T;
3
+ /** An element id no other copy of the kit hands out (Zag finds its parts by id; SVG
4
+ * gradients are referenced by id). */
5
+ declare function pageUid(prefix: string): string;
6
+
7
+ export { pageState, pageUid };
package/dist/page.js ADDED
@@ -0,0 +1 @@
1
+ export { pageState, pageUid } from './chunk-X66RJAIS.js';
@@ -0,0 +1,55 @@
1
+ /** Selection/menu accent — active entries, "native" badges, selected controls. */
2
+ declare const ACCENT = "#2962ff";
3
+ /** The lighter brand blue: "on" affordances and the default drawing color, brighter than
4
+ * {@link ACCENT} so a switch reads clearly enabled. */
5
+ declare const ACCENT_BRIGHT = "#38c0fd";
6
+ /** Bullish/bearish reference pair — the dark theme's candle colors, reused wherever a
7
+ * fixed directional color is needed outside a theme (volume profiles, baseline defaults). */
8
+ declare const BULLISH = "#089981";
9
+ declare const BEARISH = "#f23645";
10
+ /** Neutral gray for de-emphasized geometry (unstyled level lines, gann 1/1 diagonals). */
11
+ declare const NEUTRAL = "#787b86";
12
+ /** Attention amber — favorited items. */
13
+ declare const HIGHLIGHT = "#e0b400";
14
+ /** Warm accent used by the categorical palette and warning-ish marks. */
15
+ declare const WARNING = "#ff9800";
16
+ /** Soft informational blue — statistical overlays (regression, VWAP) and the blue rung of the
17
+ * drawing level palette, which should read as derived data rather than user-drawn geometry. */
18
+ declare const INFO = "#5b9cf6";
19
+ /** Highlighter ink — a saturated marker orange, always drawn translucent. */
20
+ declare const MARKER = "#ff5d00";
21
+ /** Validity tints — a pattern that satisfies its rules vs one that does not. Brighter and
22
+ * cooler than {@link BULLISH}/{@link BEARISH} so a validity wash never reads as direction. */
23
+ declare const VALID = "#0ecb81";
24
+ declare const INVALID = "#f6465d";
25
+ /** Market-session states beside the theme's up-colored "open": pre-market dawn amber,
26
+ * post-market dusk sky, and the shared closed/holiday gray (statusline badge). */
27
+ declare const SESSION_PRE = "#f97316";
28
+ declare const SESSION_POST = "#0ea5e9";
29
+ declare const SESSION_OFF = "#9ca3af";
30
+ /** Default color of a plain line/area series — a softer blue than {@link ACCENT}, which is
31
+ * reserved for interactive chrome. */
32
+ declare const SERIES_LINE = "#3b82f6";
33
+ /** Crosshair ink: a cool gray that stays legible over both candles and empty surface. */
34
+ declare const CROSSHAIR = "#9aa0ad";
35
+ /** Fixed slate plates for canvas badges that float over chart content of any color (info
36
+ * badges on drawings) — they cannot follow the theme surface and stay readable.
37
+ * `SLATE_DEEP` is the plate, `SLATE` its border. */
38
+ declare const SLATE_DEEP = "#1e293b";
39
+ declare const SLATE = "#475569";
40
+ /** The crosshair's axis chips: a fixed mid gray, brighter than the dark chart surface so the
41
+ * chip stands off the axis on both themes while its white ink stays readable. */
42
+ declare const CHIP_PLATE = "#595959";
43
+ /** Strategy trade markers — entry arrows per position side, and the exits' shared violet.
44
+ * The entry pair deliberately reuses the accent blue / bearish red (the reference palette
45
+ * of order-fill marks); the violet keeps exits apart from both directions. */
46
+ declare const TRADE_LONG = "#2962ff";
47
+ declare const TRADE_SHORT = "#f23645";
48
+ declare const TRADE_EXIT = "#d500f9";
49
+ /** Categorical hues for auto-assigned colors (symbol badges, multi-series defaults).
50
+ * Ordered for adjacent-hue contrast, not by hue family. */
51
+ declare const CATEGORICAL: readonly string[];
52
+ /** Pick a stable categorical color for a string key (same key ⇒ same color). */
53
+ declare function categoricalColor(key: string): string;
54
+
55
+ export { ACCENT, ACCENT_BRIGHT, BEARISH, BULLISH, CATEGORICAL, CHIP_PLATE, CROSSHAIR, HIGHLIGHT, INFO, INVALID, MARKER, NEUTRAL, SERIES_LINE, SESSION_OFF, SESSION_POST, SESSION_PRE, SLATE, SLATE_DEEP, TRADE_EXIT, TRADE_LONG, TRADE_SHORT, VALID, WARNING, categoricalColor };
@@ -0,0 +1 @@
1
+ export { ACCENT, ACCENT_BRIGHT, BEARISH, BULLISH, CATEGORICAL, CHIP_PLATE, CROSSHAIR, HIGHLIGHT, INFO, INVALID, MARKER, NEUTRAL, SERIES_LINE, SESSION_OFF, SESSION_POST, SESSION_PRE, SLATE, SLATE_DEEP, TRADE_EXIT, TRADE_LONG, TRADE_SHORT, VALID, WARNING, categoricalColor } from './chunk-MMTMOV6R.js';
@@ -0,0 +1,98 @@
1
+ type Side = 'top' | 'right' | 'bottom' | 'left';
2
+ type Align = 'start' | 'center' | 'end';
3
+ /** The area a floating part stays inside: the viewport, an element, or a rectangle read at
4
+ * each placement. */
5
+ type CollisionBoundary = 'viewport' | HTMLElement | (() => DOMRect | null);
6
+ interface PlacementProps {
7
+ /** The side of the trigger it opens on. With `avoidCollisions`, it flips to the opposite
8
+ * side when this one lacks room. */
9
+ side?: Side;
10
+ /** Its alignment along that side. */
11
+ align?: Align;
12
+ /** Its distance from the trigger, in px. */
13
+ sideOffset?: number;
14
+ /** A shift along the side, in px, away from the aligned edge (toward the middle for
15
+ * `start` and `end`). */
16
+ alignOffset?: number;
17
+ /** Flip to the opposite side when there is no room, and stay inside the collision area
18
+ * (default true). */
19
+ avoidCollisions?: boolean;
20
+ /** Room kept from the collision area's edges, in px. */
21
+ collisionPadding?: number;
22
+ /** The area it stays inside (default: the viewport). */
23
+ collisionBoundary?: CollisionBoundary;
24
+ }
25
+ /** Axis-aligned rectangle in viewport coordinates. */
26
+ interface Rect {
27
+ left: number;
28
+ top: number;
29
+ right: number;
30
+ bottom: number;
31
+ width: number;
32
+ height: number;
33
+ }
34
+ interface PlaceArgs {
35
+ trigger: Rect;
36
+ pop: {
37
+ width: number;
38
+ height: number;
39
+ };
40
+ /** The distance from the trigger (shadcn's `sideOffset`). */
41
+ gap: number;
42
+ align: Align;
43
+ /** Default `'bottom'`. */
44
+ side?: Side;
45
+ alignOffset?: number;
46
+ /** Flip to the opposite side and stay inside `clamp` (default true). */
47
+ avoidCollisions?: boolean;
48
+ /** Already-inset clamp rectangle in viewport coordinates. */
49
+ clamp: Rect;
50
+ /** Subtracted from left/top when the popover is `position:absolute` inside a host. */
51
+ originX: number;
52
+ originY: number;
53
+ }
54
+ interface PlaceResult {
55
+ left: number;
56
+ top: number;
57
+ /** The side it opened on, after any flip. */
58
+ side: Side;
59
+ }
60
+ /** Inset a rectangle uniformly (positive inset shrinks). */
61
+ declare function insetRect(r: Rect, inset: number): Rect;
62
+ /** Viewport rect with a uniform inset (the 6px air ColorField / glyph-select used). */
63
+ declare function viewportRect(width: number, height: number, inset: number): Rect;
64
+ /** Intersection of two rects. Empty (non-positive size) if they don't overlap. */
65
+ declare function intersectRects(a: Rect, b: Rect): Rect;
66
+ /**
67
+ * Place a popover on `side` of `trigger` (default below), flipping to the opposite side when
68
+ * it would leave `clamp` and preferring the side with more room when neither fully fits,
69
+ * then keeping it inside `clamp`. `align: 'end'` lines it up with the trigger's far edge
70
+ * (swatches and width fields sit at the row's right edge); `'center'` centers it on the
71
+ * trigger (a popup over a small glyph). `avoidCollisions: false` keeps the side and skips
72
+ * the clamp.
73
+ */
74
+ declare function placePopover(a: PlaceArgs): PlaceResult;
75
+ type ZagPlacement = Side | `${Side}-start` | `${Side}-end`;
76
+ /** A Zag placement string (`'bottom-start'`) as a side and an alignment. */
77
+ declare function splitPlacement(placement: string): {
78
+ side: Side;
79
+ align: Align;
80
+ };
81
+ /**
82
+ * Zag's positioning for `props`, over the part's own default side and alignment. Only what
83
+ * the caller set is passed on, so a part given nothing keeps exactly Zag's behavior.
84
+ */
85
+ declare function zagPositioning(props: PlacementProps, defaults: {
86
+ side: Side;
87
+ align: Align;
88
+ }): {
89
+ placement: ZagPlacement;
90
+ gutter?: number;
91
+ shift?: number;
92
+ flip?: boolean;
93
+ slide?: boolean;
94
+ overflowPadding?: number;
95
+ boundary?: () => Element;
96
+ };
97
+
98
+ export { type Align, type CollisionBoundary, type PlaceArgs, type PlaceResult, type PlacementProps, type Rect, type Side, insetRect, intersectRects, placePopover, splitPlacement, viewportRect, zagPositioning };
@@ -0,0 +1 @@
1
+ export { insetRect, intersectRects, placePopover, splitPlacement, viewportRect, zagPositioning } from './chunk-3Q32K4PE.js';
@@ -0,0 +1,107 @@
1
+ import { C as ComponentDef } from './define-D5u3F5Dj.js';
2
+ import { CollisionBoundary, PlacementProps, Align, Side } from './placement.js';
3
+ export { PlaceArgs, PlaceResult, Rect, insetRect, intersectRects, placePopover, viewportRect } from './placement.js';
4
+ import { ChartTheme } from './tokens.js';
5
+ import './t.js';
6
+
7
+ type PopoverAlign = Align;
8
+ type PopoverSide = Side;
9
+ type PopoverPosition = 'fixed' | 'absolute';
10
+
11
+ interface PopoverControllerOptions extends Omit<PlacementProps, 'collisionBoundary'> {
12
+ /** @deprecated Use `sideOffset`. */
13
+ gap?: number;
14
+ matchWidth?: boolean;
15
+ position?: PopoverPosition;
16
+ /** Room kept inside `collisionBoundary` (default 0; `collisionPadding` sets it too). */
17
+ boundaryInset?: number;
18
+ /** Room kept from the viewport's edges (default 6; `collisionPadding` sets it too). */
19
+ viewportInset?: number;
20
+ onClose?: () => void;
21
+ }
22
+ interface PopoverController {
23
+ side: PopoverSide;
24
+ /** The distance from the trigger (`sideOffset`). */
25
+ gap: number;
26
+ align: PopoverAlign;
27
+ alignOffset: number;
28
+ avoidCollisions: boolean;
29
+ matchWidth: boolean;
30
+ position: PopoverPosition;
31
+ boundaryInset: number;
32
+ viewportInset: number;
33
+ onClose?: () => void;
34
+ }
35
+ /** The popover's placement options with their defaults, without DOM. */
36
+ declare function popoverController(opts?: PopoverControllerOptions): PopoverController;
37
+ declare const popoverDef: ComponentDef<"popover", "content", never>;
38
+ type PopoverBoundary = CollisionBoundary;
39
+ interface PopoverOptions extends PopoverControllerOptions {
40
+ trigger: HTMLElement;
41
+ content?: Node | ((body: HTMLElement) => void);
42
+ /** Portal target. Defaults to `document.body`. Drawing chrome passes the chart host. */
43
+ host?: HTMLElement;
44
+ theme?: ChartTheme;
45
+ className?: string;
46
+ /** The part a component built on the popover adds to the shell's slot. */
47
+ slot?: string;
48
+ zIndex?: string | number;
49
+ /** The area it stays inside: `'viewport'` (default), an element (dialog, chart host) or a
50
+ * rectangle read at each placement. */
51
+ collisionBoundary?: PopoverBoundary;
52
+ /** @deprecated Use `collisionBoundary`. */
53
+ boundary?: PopoverBoundary;
54
+ /** Fade the shell in on show and out on hide over this many ms (default 0 — instant). */
55
+ fadeMs?: number;
56
+ }
57
+ type PopoverProps = PopoverOptions;
58
+ declare const POPOVER_STYLE_ID = "vela-ui-popover";
59
+ declare const POPOVER_CSS: string;
60
+ /** Close whichever kit popover is showing (dialog teardown, a second trigger). */
61
+ declare function closeOpenPopovers(): void;
62
+ declare function isPopoverOpen(): boolean;
63
+ declare function openPopoverTrigger(): HTMLElement | null;
64
+ /**
65
+ * True when this event already dismissed a popover on its way down — a dialog's
66
+ * outside-click close must swallow it instead of closing the dialog too (the popover
67
+ * hides itself on document CAPTURE, so by the time a backdrop listener runs,
68
+ * {@link isPopoverOpen} is already false).
69
+ */
70
+ declare function eventDismissedPopover(e: Event): boolean;
71
+ declare class Popover {
72
+ readonly el: HTMLElement;
73
+ readonly trigger: HTMLElement;
74
+ private readonly host;
75
+ private readonly ctrl;
76
+ private readonly boundary;
77
+ private readonly theme?;
78
+ /** Hosted under a `.vela-ui` we resolved ourselves — its tokens win over `theme`. */
79
+ private readonly inheritsTokens;
80
+ private onOutside;
81
+ private onKey;
82
+ private onReflow;
83
+ private shown;
84
+ private readonly fadeMs;
85
+ /** The pending removal of a fading-out shell; a show() that reuses the shell cancels it. */
86
+ private leaveTimer;
87
+ /** The shell's exit animation before it leaves the DOM; a show() that reuses the shell cancels it. */
88
+ private exit;
89
+ constructor(opts: PopoverOptions);
90
+ get open(): boolean;
91
+ get position(): PopoverPosition;
92
+ get align(): PopoverAlign;
93
+ show(): void;
94
+ hide(): void;
95
+ /** Show if closed, hide if this instance is the open popover. */
96
+ toggle(): void;
97
+ /** Hide for good and release the kit controls in the content. A popover built per open
98
+ * is discarded on close instead: its owner releases the content through `onClose`. */
99
+ destroy(): void;
100
+ reposition(): void;
101
+ private clampRect;
102
+ private readBoundary;
103
+ private place;
104
+ }
105
+ declare function createPopover(props: PopoverProps): Popover;
106
+
107
+ export { Align, CollisionBoundary, POPOVER_CSS, POPOVER_STYLE_ID, PlacementProps, Popover, type PopoverAlign, type PopoverBoundary, type PopoverController, type PopoverControllerOptions, type PopoverOptions, type PopoverPosition, type PopoverProps, type PopoverSide, Side, closeOpenPopovers, createPopover, eventDismissedPopover, isPopoverOpen, openPopoverTrigger, popoverController, popoverDef };
@@ -0,0 +1,15 @@
1
+ export { POPOVER_CSS, POPOVER_STYLE_ID, Popover, closeOpenPopovers, createPopover, eventDismissedPopover, isPopoverOpen, openPopoverTrigger, popoverController, popoverDef } from './chunk-B5ZSRUDQ.js';
2
+ import './chunk-J2QJATCD.js';
3
+ import './chunk-S7USVSYP.js';
4
+ import './chunk-V2Q4MRMS.js';
5
+ import './chunk-TAKSIV57.js';
6
+ import './chunk-MMTMOV6R.js';
7
+ export { insetRect, intersectRects, placePopover, viewportRect } from './chunk-3Q32K4PE.js';
8
+ import './chunk-A72NWYNP.js';
9
+ import './chunk-Q6WTDVH6.js';
10
+ import './chunk-VMCR3S2A.js';
11
+ import './chunk-XBEL4K33.js';
12
+ import './chunk-2GQIZM5Z.js';
13
+ import './chunk-BXMWQIBO.js';
14
+ import './chunk-X66RJAIS.js';
15
+ import './chunk-6QCILIT2.js';
@@ -0,0 +1,32 @@
1
+ import { C as ComponentDef } from './define-D5u3F5Dj.js';
2
+ import './t.js';
3
+
4
+ declare const scatterChartDef: ComponentDef<"scatter-chart", "root" | "focus" | "label" | "grid" | "tip" | "point" | "trend", "tip-radius" | "tip-shadow" | "tip-z" | "tip-bg">;
5
+ interface ScatterPoint {
6
+ x: number;
7
+ y: number;
8
+ /** The dot's ink: a token's `var()` (`t.profit.var`) or a color. */
9
+ color: string;
10
+ }
11
+ interface ScatterChartProps {
12
+ /** Written under the x axis. */
13
+ xTitle?: string;
14
+ /** Written up the y axis. */
15
+ yTitle?: string;
16
+ /** The hover readout of a point. */
17
+ format?: (p: ScatterPoint, index: number) => string | Node;
18
+ /** Extra class names (layout hooks). */
19
+ className?: string;
20
+ }
21
+ interface ScatterChartHandle {
22
+ readonly el: HTMLElement;
23
+ /** `trend` is drawn as a dashed line through its points (the ends of a fitted line). */
24
+ setData(points: readonly ScatterPoint[], trend?: ReadonlyArray<{
25
+ x: number;
26
+ y: number;
27
+ }>): void;
28
+ destroy(): void;
29
+ }
30
+ declare function createScatterChart(props?: ScatterChartProps): ScatterChartHandle;
31
+
32
+ export { type ScatterChartHandle, type ScatterChartProps, type ScatterPoint, createScatterChart, scatterChartDef };