@luxalgo/vela-ui 0.0.0-stage → 0.1.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 (248) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE +28 -0
  4. package/README.md +83 -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 +41 -0
  12. package/dist/button.js +10 -0
  13. package/dist/calendar.d.ts +22 -0
  14. package/dist/calendar.js +1 -0
  15. package/dist/callout-bubble.d.ts +98 -0
  16. package/dist/callout-bubble.js +173 -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-2Q4JRINP.js +403 -0
  23. package/dist/chunk-3Q32K4PE.js +85 -0
  24. package/dist/chunk-5QHXOAZA.js +351 -0
  25. package/dist/chunk-6NXY62JS.js +25 -0
  26. package/dist/chunk-6QCILIT2.js +52 -0
  27. package/dist/chunk-A2FJ7Y7D.js +55 -0
  28. package/dist/chunk-A72NWYNP.js +26 -0
  29. package/dist/chunk-AJ2IYSOI.js +553 -0
  30. package/dist/chunk-BXMWQIBO.js +66 -0
  31. package/dist/chunk-CH3DV6FD.js +280 -0
  32. package/dist/chunk-EZQXTO6K.js +89 -0
  33. package/dist/chunk-FCO3YZLT.js +81 -0
  34. package/dist/chunk-FN2BUFNM.js +10 -0
  35. package/dist/chunk-FVH6L7FM.js +18 -0
  36. package/dist/chunk-G7IQLY3A.js +183 -0
  37. package/dist/chunk-IDA2BT7D.js +29 -0
  38. package/dist/chunk-J2QJATCD.js +12 -0
  39. package/dist/chunk-LZWZV2ZS.js +18 -0
  40. package/dist/chunk-MMTMOV6R.js +31 -0
  41. package/dist/chunk-OBLIX3VN.js +227 -0
  42. package/dist/chunk-P4MTEMT7.js +23 -0
  43. package/dist/chunk-Q6WTDVH6.js +31 -0
  44. package/dist/chunk-S7USVSYP.js +50 -0
  45. package/dist/chunk-SAPURP46.js +133 -0
  46. package/dist/chunk-TAKSIV57.js +90 -0
  47. package/dist/chunk-V6TTTMTE.js +79 -0
  48. package/dist/chunk-VMCR3S2A.js +22 -0
  49. package/dist/chunk-X4YPSIW6.js +72 -0
  50. package/dist/chunk-X66RJAIS.js +14 -0
  51. package/dist/chunk-XJAPCCOJ.js +101 -0
  52. package/dist/chunk-ZB3BZHSN.js +219 -0
  53. package/dist/color-picker.d.ts +103 -0
  54. package/dist/color-picker.js +19 -0
  55. package/dist/color.d.ts +24 -0
  56. package/dist/color.js +1 -0
  57. package/dist/context-menu.d.ts +72 -0
  58. package/dist/context-menu.js +161 -0
  59. package/dist/css.d.ts +15 -0
  60. package/dist/css.js +4 -0
  61. package/dist/data-table-DtU3FX9j.d.ts +61 -0
  62. package/dist/data-table.d.ts +3 -0
  63. package/dist/data-table.js +88 -0
  64. package/dist/date-picker.d.ts +90 -0
  65. package/dist/date-picker.js +257 -0
  66. package/dist/define-D5u3F5Dj.d.ts +21 -0
  67. package/dist/dialog.d.ts +89 -0
  68. package/dist/dialog.js +258 -0
  69. package/dist/dispose.d.ts +9 -0
  70. package/dist/dispose.js +2 -0
  71. package/dist/donut.d.ts +27 -0
  72. package/dist/donut.js +67 -0
  73. package/dist/drawer.d.ts +119 -0
  74. package/dist/drawer.js +326 -0
  75. package/dist/dropdown-menu.d.ts +114 -0
  76. package/dist/dropdown-menu.js +18 -0
  77. package/dist/empty.d.ts +21 -0
  78. package/dist/empty.js +38 -0
  79. package/dist/field.d.ts +147 -0
  80. package/dist/field.js +328 -0
  81. package/dist/glyph-select.d.ts +57 -0
  82. package/dist/glyph-select.js +17 -0
  83. package/dist/headless.d.ts +6 -0
  84. package/dist/headless.js +9 -0
  85. package/dist/hover-card.d.ts +43 -0
  86. package/dist/hover-card.js +97 -0
  87. package/dist/i18n.d.ts +20 -0
  88. package/dist/i18n.js +1 -0
  89. package/dist/icons.d.ts +20 -0
  90. package/dist/icons.js +2 -0
  91. package/dist/index.d.ts +45 -0
  92. package/dist/index.js +13 -0
  93. package/dist/input-group.d.ts +57 -0
  94. package/dist/input-group.js +86 -0
  95. package/dist/input.d.ts +54 -0
  96. package/dist/input.js +9 -0
  97. package/dist/kbd.d.ts +19 -0
  98. package/dist/kbd.js +8 -0
  99. package/dist/kit-text.d.ts +8 -0
  100. package/dist/kit-text.js +2 -0
  101. package/dist/line-chart.d.ts +32 -0
  102. package/dist/line-chart.js +120 -0
  103. package/dist/manifest.json +3854 -0
  104. package/dist/number-input.d.ts +99 -0
  105. package/dist/number-input.js +14 -0
  106. package/dist/page.d.ts +7 -0
  107. package/dist/page.js +1 -0
  108. package/dist/palette.d.ts +55 -0
  109. package/dist/palette.js +1 -0
  110. package/dist/placement.d.ts +98 -0
  111. package/dist/placement.js +1 -0
  112. package/dist/popover.d.ts +107 -0
  113. package/dist/popover.js +15 -0
  114. package/dist/scatter-chart.d.ts +32 -0
  115. package/dist/scatter-chart.js +121 -0
  116. package/dist/select.d.ts +112 -0
  117. package/dist/select.js +19 -0
  118. package/dist/sparkline.d.ts +22 -0
  119. package/dist/sparkline.js +72 -0
  120. package/dist/stat.d.ts +29 -0
  121. package/dist/stat.js +41 -0
  122. package/dist/styles.d.ts +22 -0
  123. package/dist/styles.js +2 -0
  124. package/dist/surface-events.d.ts +17 -0
  125. package/dist/surface-events.js +1 -0
  126. package/dist/surface-exit.d.ts +25 -0
  127. package/dist/surface-exit.js +1 -0
  128. package/dist/switch.d.ts +54 -0
  129. package/dist/switch.js +92 -0
  130. package/dist/t.d.ts +89 -0
  131. package/dist/t.js +1 -0
  132. package/dist/tabs.d.ts +63 -0
  133. package/dist/tabs.js +150 -0
  134. package/dist/text-area.d.ts +54 -0
  135. package/dist/text-area.js +9 -0
  136. package/dist/theme.d.ts +188 -0
  137. package/dist/theme.js +8 -0
  138. package/dist/theme.schema.json +1745 -0
  139. package/dist/themes/dark.css +3 -0
  140. package/dist/themes/light.css +3 -0
  141. package/dist/toggle-group.d.ts +56 -0
  142. package/dist/toggle-group.js +130 -0
  143. package/dist/tokens.d.ts +16 -0
  144. package/dist/tokens.js +3 -0
  145. package/dist/tooltip.d.ts +47 -0
  146. package/dist/tooltip.js +74 -0
  147. package/dist/variants-B4stUBnY.d.ts +16 -0
  148. package/dist/zag.d.ts +19 -0
  149. package/dist/zag.js +2 -0
  150. package/docs/theming.md +211 -0
  151. package/docs/what-to-change.md +20 -0
  152. package/docs/writing-a-component.md +247 -0
  153. package/llms.txt +66 -0
  154. package/package.json +90 -6
  155. package/registry/badge.ts +119 -0
  156. package/registry/bar-chart.ts +215 -0
  157. package/registry/button.ts +303 -0
  158. package/registry/callout-bubble.ts +336 -0
  159. package/registry/checkbox.ts +234 -0
  160. package/registry/color-picker.ts +582 -0
  161. package/registry/context-menu.ts +208 -0
  162. package/registry/data-table.ts +215 -0
  163. package/registry/date-picker.ts +483 -0
  164. package/registry/dialog.ts +535 -0
  165. package/registry/donut.ts +145 -0
  166. package/registry/drawer.ts +636 -0
  167. package/registry/dropdown-menu.ts +762 -0
  168. package/registry/empty.ts +91 -0
  169. package/registry/field.ts +585 -0
  170. package/registry/glyph-select.ts +268 -0
  171. package/registry/hover-card.ts +222 -0
  172. package/registry/input-group.ts +229 -0
  173. package/registry/input.ts +181 -0
  174. package/registry/kbd.ts +64 -0
  175. package/registry/line-chart.ts +218 -0
  176. package/registry/number-input.ts +443 -0
  177. package/registry/popover.ts +368 -0
  178. package/registry/scatter-chart.ts +221 -0
  179. package/registry/select.ts +620 -0
  180. package/registry/sparkline.ts +114 -0
  181. package/registry/stat.ts +96 -0
  182. package/registry/switch.ts +205 -0
  183. package/registry/tabs.ts +392 -0
  184. package/registry/text-area.ts +186 -0
  185. package/registry/toggle-group.ts +295 -0
  186. package/registry/tooltip.ts +156 -0
  187. package/skills/theming-vela-ui/SKILL.md +137 -0
  188. package/skills/using-vela-ui-components/SKILL.md +134 -0
  189. package/skills/writing-vela-ui-components/SKILL.md +163 -0
  190. package/src/components/badge.ts +119 -0
  191. package/src/components/bar-chart.ts +215 -0
  192. package/src/components/button.ts +303 -0
  193. package/src/components/callout-bubble.ts +336 -0
  194. package/src/components/checkbox.ts +234 -0
  195. package/src/components/color-picker.ts +582 -0
  196. package/src/components/context-menu.ts +208 -0
  197. package/src/components/data-table.ts +215 -0
  198. package/src/components/date-picker.ts +483 -0
  199. package/src/components/dialog.ts +535 -0
  200. package/src/components/donut.ts +145 -0
  201. package/src/components/drawer.ts +636 -0
  202. package/src/components/dropdown-menu.ts +762 -0
  203. package/src/components/empty.ts +91 -0
  204. package/src/components/field.ts +585 -0
  205. package/src/components/glyph-select.ts +268 -0
  206. package/src/components/hover-card.ts +222 -0
  207. package/src/components/input-group.ts +229 -0
  208. package/src/components/input.ts +181 -0
  209. package/src/components/kbd.ts +64 -0
  210. package/src/components/line-chart.ts +218 -0
  211. package/src/components/number-input.ts +443 -0
  212. package/src/components/popover.ts +368 -0
  213. package/src/components/scatter-chart.ts +221 -0
  214. package/src/components/select.ts +620 -0
  215. package/src/components/sparkline.ts +114 -0
  216. package/src/components/stat.ts +96 -0
  217. package/src/components/switch.ts +205 -0
  218. package/src/components/tabs.ts +392 -0
  219. package/src/components/text-area.ts +186 -0
  220. package/src/components/toggle-group.ts +295 -0
  221. package/src/components/tooltip.ts +156 -0
  222. package/src/index.ts +24 -0
  223. package/src/lib/calendar.ts +112 -0
  224. package/src/lib/chart.ts +72 -0
  225. package/src/lib/color.ts +89 -0
  226. package/src/lib/component-index.ts +131 -0
  227. package/src/lib/css.ts +44 -0
  228. package/src/lib/define.ts +45 -0
  229. package/src/lib/dispose.ts +36 -0
  230. package/src/lib/h.ts +55 -0
  231. package/src/lib/headless.ts +16 -0
  232. package/src/lib/i18n.ts +30 -0
  233. package/src/lib/icons.ts +237 -0
  234. package/src/lib/kit-text.ts +26 -0
  235. package/src/lib/page.ts +24 -0
  236. package/src/lib/palette.ts +81 -0
  237. package/src/lib/placement.ts +188 -0
  238. package/src/lib/styles.ts +53 -0
  239. package/src/lib/surface-events.ts +31 -0
  240. package/src/lib/surface-exit.ts +87 -0
  241. package/src/lib/t.ts +68 -0
  242. package/src/lib/theme.ts +654 -0
  243. package/src/lib/tokens.ts +111 -0
  244. package/src/lib/variants.ts +32 -0
  245. package/src/lib/zag.ts +46 -0
  246. package/stylelint/index.mjs +60 -0
  247. package/stylelint/lint.mjs +81 -0
  248. package/stylelint/plugin.mjs +115 -0
package/dist/drawer.js ADDED
@@ -0,0 +1,326 @@
1
+ import { announceSurface } from './chunk-J2QJATCD.js';
2
+ import { holdForExit } from './chunk-S7USVSYP.js';
3
+ import { normalizeProps, nextUid, runMachine, spreadProps } from './chunk-P4MTEMT7.js';
4
+ import { disposeWithin } from './chunk-A72NWYNP.js';
5
+ import { t } from './chunk-6QCILIT2.js';
6
+ import { defineComponent } from './chunk-VMCR3S2A.js';
7
+ import { defineStyles, css } from './chunk-IDA2BT7D.js';
8
+ import './chunk-2GQIZM5Z.js';
9
+ import './chunk-BXMWQIBO.js';
10
+ import './chunk-X66RJAIS.js';
11
+ import * as dialog from '@zag-js/dialog';
12
+
13
+ function drawerController(opts = {}) {
14
+ return {
15
+ machine: dialog.machine,
16
+ props: {
17
+ id: nextUid("vela-drawer"),
18
+ modal: true,
19
+ closeOnEscape: opts.closeOnEscape ?? true,
20
+ closeOnInteractOutside: opts.closeOnInteractOutside ?? true,
21
+ initialFocusEl: opts.initialFocusEl,
22
+ onOpenChange: (d) => opts.onOpenChange?.(d.open)
23
+ },
24
+ connect: (service) => dialog.connect(service, normalizeProps)
25
+ };
26
+ }
27
+ var drawerDef = defineComponent({
28
+ name: "drawer",
29
+ parts: ["backdrop", "positioner", "content", "grab", "title", "body"],
30
+ settings: { radius: "14px 14px 0 0", "edge-radius": "14px", "side-width": "min(75%, 360px)", "grab-radius": "2px" }
31
+ });
32
+ var injectStyles = defineStyles(
33
+ "vela-ui-drawer",
34
+ css`@layer vela.ui{[data-slot=drawer-backdrop]{background:${t.backdrop};z-index:${t.z.dialog};position:fixed;inset:0}[data-slot=drawer-backdrop]:is([data-layout] *){position:absolute}[data-slot=drawer-positioner]{z-index:${t.z.dialog};justify-content:center;align-items:flex-end;display:flex;position:fixed;inset:0}[data-slot=drawer-positioner]:is([data-layout] *){position:absolute}[data-slot=drawer-content]{background:${t.surface};color:${t.fg};border:1px solid ${t.border.strong};border-radius:${drawerDef.vars.radius};box-shadow:${t.shadow.dialog};border-bottom:none;outline:2px solid #0000;flex-direction:column;width:100%;max-height:85%;font-size:13px;display:flex;overflow:hidden}[data-slot=drawer-content][data-state=open]{animation:vela-drawer-in ${t.dur.med} ${t.ease}}[data-slot=drawer-content][data-direction=top]{border:1px solid ${t.border.strong};border-radius:0;border-top:none;border-end-end-radius:${drawerDef.vars["edge-radius"]};border-end-start-radius:${drawerDef.vars["edge-radius"]}}[data-slot=drawer-content][data-direction=left],[data-slot=drawer-content][data-direction=right]{border:1px solid ${t.border.strong};width:${drawerDef.vars["side-width"]};border-radius:0;height:100%;max-height:none}[data-slot=drawer-content][data-direction=right]{border-inline-end:none;border-start-start-radius:${drawerDef.vars["edge-radius"]};border-end-start-radius:${drawerDef.vars["edge-radius"]}}[data-slot=drawer-content][data-direction=left]{border-inline-start:none;border-start-end-radius:${drawerDef.vars["edge-radius"]};border-end-end-radius:${drawerDef.vars["edge-radius"]}}[data-slot=drawer-content][data-direction=top][data-state=open]{animation-name:vela-drawer-in-top}[data-slot=drawer-content][data-direction=right][data-state=open]{animation-name:vela-drawer-in-right}[data-slot=drawer-content][data-direction=left][data-state=open],[data-slot=drawer-content][data-direction=right][data-state=open]:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){animation-name:vela-drawer-in-left}[data-slot=drawer-content][data-direction=left][data-state=open]:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){animation-name:vela-drawer-in-right}[data-slot=drawer-positioner][data-direction=top]{align-items:flex-start}[data-slot=drawer-positioner][data-direction=right]{justify-content:flex-end;align-items:stretch}[data-slot=drawer-positioner][data-direction=left]{justify-content:flex-start;align-items:stretch}@keyframes vela-drawer-in{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes vela-drawer-in-top{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes vela-drawer-in-right{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes vela-drawer-in-left{0%{transform:translate(-100%)}to{transform:translate(0)}}[data-slot=drawer-grab]{cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;flex:none;justify-content:center;align-items:center;padding:10px 0 6px;display:flex}[data-slot=drawer-grab]:before{content:"";border-radius:${drawerDef.vars["grab-radius"]};background:${t.border.strong};width:36px;height:4px}[data-slot=drawer-content][data-direction=top] [data-slot=drawer-grab]{order:1;padding:6px 0 10px}[data-slot=drawer-content]:is([data-direction=left],[data-direction=right]) [data-slot=drawer-grab]{display:none}[data-slot=drawer-title]{letter-spacing:.2px;color:${t.fg.bright};-webkit-user-select:none;user-select:none;flex:none;padding:0 16px 10px;font-size:15px;font-weight:600}[data-slot=drawer-title]:empty{display:none}[data-slot=drawer-body]{overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y;min-height:0;padding:0 ${t.space[3]} calc(${t.space[3]} + env(safe-area-inset-bottom,0px));flex:auto;overflow-y:auto}}`
35
+ );
36
+ var DISMISS_FRACTION = 0.33;
37
+ var DISMISS_PX = 96;
38
+ var SLOP_PX = 8;
39
+ var HSWIPE_MIN_PX = 48;
40
+ function dismissAxis(dx, dy, direction, mirrored = false) {
41
+ if (direction === "bottom") return { toward: dy, across: dx };
42
+ if (direction === "top") return { toward: -dy, across: dx };
43
+ const x = mirrored ? -dx : dx;
44
+ return { toward: direction === "right" ? x : -x, across: dy };
45
+ }
46
+ function classifyGesture(dx, dy, ctx, direction = "bottom", mirrored = false) {
47
+ if (Math.max(Math.abs(dx), Math.abs(dy)) < SLOP_PX) return "pending";
48
+ const { toward, across } = dismissAxis(dx, dy, direction, mirrored);
49
+ if (Math.abs(toward) > Math.abs(across)) return toward > 0 && !ctx.scrolled ? "drag" : "scroll";
50
+ const vertical = direction === "top" || direction === "bottom";
51
+ return vertical && ctx.canSwipe && !ctx.hScrollable ? "hswipe" : "scroll";
52
+ }
53
+ function dragDismisses(d, panelSizePx) {
54
+ return d >= Math.min(DISMISS_PX, panelSizePx * DISMISS_FRACTION);
55
+ }
56
+ function swipeDirection(dx, dy) {
57
+ if (Math.abs(dx) < HSWIPE_MIN_PX || Math.abs(dx) <= Math.abs(dy)) return null;
58
+ return dx < 0 ? "left" : "right";
59
+ }
60
+ var Drawer = class {
61
+ constructor(opts = {}) {
62
+ this.opener = null;
63
+ this.wasOpen = false;
64
+ /** The sheet and scrim's exit animation after a close; a reopen cancels it. */
65
+ this.exit = null;
66
+ this.destroyed = false;
67
+ const doc = (opts.host ?? document.body).ownerDocument;
68
+ injectStyles(doc);
69
+ const host = opts.host ?? doc.body;
70
+ this.backdrop = doc.createElement("div");
71
+ this.backdrop.className = "vela-drawer-backdrop vela-ui-layer";
72
+ this.backdrop.dataset.slot = drawerDef.slot("backdrop");
73
+ this.positioner = doc.createElement("div");
74
+ this.positioner.className = "vela-drawer-positioner vela-ui-layer";
75
+ this.positioner.dataset.slot = drawerDef.slot("positioner");
76
+ this.panel = doc.createElement("div");
77
+ this.panel.className = "vela-drawer";
78
+ this.panel.dataset.slot = drawerDef.slot("content");
79
+ this.panel.tabIndex = -1;
80
+ const grab = doc.createElement("div");
81
+ grab.className = "vela-drawer-grab";
82
+ grab.dataset.slot = drawerDef.slot("grab");
83
+ this.titleEl = doc.createElement("div");
84
+ this.titleEl.className = "vela-drawer-title";
85
+ this.titleEl.dataset.slot = drawerDef.slot("title");
86
+ this.titleEl.textContent = opts.title ?? "";
87
+ this.body = doc.createElement("div");
88
+ this.body.className = "vela-drawer-body";
89
+ this.body.dataset.slot = drawerDef.slot("body");
90
+ if (opts.content instanceof Node) this.body.appendChild(opts.content);
91
+ else if (typeof opts.content === "function") opts.content(this.body);
92
+ this.direction = opts.direction ?? "bottom";
93
+ if (this.direction !== "bottom") {
94
+ this.positioner.dataset.direction = this.direction;
95
+ this.panel.dataset.direction = this.direction;
96
+ }
97
+ this.panel.append(grab, this.titleEl, this.body);
98
+ this.positioner.appendChild(this.panel);
99
+ host.append(this.backdrop, this.positioner);
100
+ this.wireGestures(grab, opts.onSwipe);
101
+ this.ctrl = drawerController({ ...opts, initialFocusEl: () => this.panel });
102
+ const mid = String(this.ctrl.props.id);
103
+ this.handle = runMachine(this.ctrl.machine, this.ctrl.props, (service) => {
104
+ const api = this.ctrl.connect(service);
105
+ const closing = this.wasOpen && !api.open;
106
+ if (closing) this.announce(false);
107
+ spreadProps(this.backdrop, api.getBackdropProps(), mid);
108
+ spreadProps(this.positioner, api.getPositionerProps(), mid);
109
+ spreadProps(this.panel, api.getContentProps(), mid);
110
+ spreadProps(this.titleEl, api.getTitleProps(), mid);
111
+ if (api.open) {
112
+ this.exit?.cancel();
113
+ this.exit = null;
114
+ this.setShown(true);
115
+ } else if (closing) {
116
+ this.holdExit();
117
+ } else if (!this.exit) {
118
+ this.setShown(false);
119
+ }
120
+ if (api.open && !this.wasOpen) this.announce(true);
121
+ if (this.wasOpen && !api.open) this.restoreOpener();
122
+ this.wasOpen = api.open;
123
+ });
124
+ }
125
+ /** Any element between `from` and the panel that has already been scrolled down —
126
+ * a downward pull there must scroll it back up, never drag the sheet. */
127
+ scrolledAncestor(from) {
128
+ let el = from instanceof Element ? from : null;
129
+ while (el && el !== this.panel) {
130
+ if (el.scrollTop > 0) return true;
131
+ el = el.parentElement;
132
+ }
133
+ return false;
134
+ }
135
+ /** Any element between `from` and the panel that a pull toward this drawer's edge would
136
+ * scroll instead: scrolled down (bottom sheet), not at its end (top sheet), or scrolling
137
+ * sideways (side drawers). */
138
+ scrollsTowardEdge(from) {
139
+ if (this.direction === "bottom") return this.scrolledAncestor(from);
140
+ if (this.direction !== "top") return this.hScrollableAncestor(from);
141
+ let el = from instanceof Element ? from : null;
142
+ while (el && el !== this.panel) {
143
+ if (el.scrollTop + el.clientHeight < el.scrollHeight - 1) return true;
144
+ el = el.parentElement;
145
+ }
146
+ return false;
147
+ }
148
+ /** Any element between `from` and the panel that scrolls horizontally on its own
149
+ * (the tab strip, chip rows) — a sideways move there is ITS scroll, not a swipe. */
150
+ hScrollableAncestor(from) {
151
+ let el = from instanceof Element ? from : null;
152
+ while (el && el !== this.panel) {
153
+ if (el.scrollWidth > el.clientWidth + 1) return true;
154
+ el = el.parentElement;
155
+ }
156
+ return false;
157
+ }
158
+ /**
159
+ * One gesture recognizer for the whole sheet. A downward pull dismisses from
160
+ * anywhere — the grab handle immediately, the content once it is decidedly vertical
161
+ * and its scroller is at rest (a scrolled list keeps native scrolling). A decidedly
162
+ * horizontal move becomes an `onSwipe` (tabbed drawers flip pages with it). The
163
+ * non-passive touchmove hook is what keeps the browser from claiming the pull as a
164
+ * scroll once the sheet is (or may become) the drag target.
165
+ */
166
+ wireGestures(grab, onSwipe) {
167
+ let startX = 0;
168
+ let startY = 0;
169
+ let dx = 0;
170
+ let dy = 0;
171
+ let d = 0;
172
+ let mirrored = false;
173
+ let mode = "idle";
174
+ const dir = this.direction;
175
+ const vertical = dir === "top" || dir === "bottom";
176
+ const beginDrag = (e) => {
177
+ mode = "drag";
178
+ startX = e.clientX;
179
+ startY = e.clientY;
180
+ this.panel.style.transition = "none";
181
+ try {
182
+ this.panel.setPointerCapture(e.pointerId);
183
+ } catch {
184
+ }
185
+ };
186
+ this.panel.addEventListener("pointerdown", (e) => {
187
+ if (e.isPrimary === false) return;
188
+ startX = e.clientX;
189
+ startY = e.clientY;
190
+ dx = 0;
191
+ dy = 0;
192
+ d = 0;
193
+ mirrored = !vertical && getComputedStyle(this.panel).direction === "rtl";
194
+ if (grab.contains(e.target)) beginDrag(e);
195
+ else mode = "pending";
196
+ });
197
+ this.panel.addEventListener("pointermove", (e) => {
198
+ if (mode === "idle" || mode === "scroll") return;
199
+ dx = e.clientX - startX;
200
+ dy = e.clientY - startY;
201
+ if (mode === "pending") {
202
+ const intent = classifyGesture(
203
+ dx,
204
+ dy,
205
+ {
206
+ canSwipe: !!onSwipe,
207
+ scrolled: this.scrollsTowardEdge(e.target),
208
+ hScrollable: this.hScrollableAncestor(e.target)
209
+ },
210
+ dir,
211
+ mirrored
212
+ );
213
+ if (intent === "pending") return;
214
+ if (intent === "drag") beginDrag(e);
215
+ else mode = intent;
216
+ }
217
+ if (mode === "drag") {
218
+ d = Math.max(0, dismissAxis(e.clientX - startX, e.clientY - startY, dir, mirrored).toward);
219
+ const shift = dir === "bottom" ? d : dir === "top" ? -d : dir === "right" !== mirrored ? d : -d;
220
+ this.panel.style.transform = d > 0 ? vertical ? `translateY(${shift}px)` : `translateX(${shift}px)` : "";
221
+ }
222
+ });
223
+ this.panel.addEventListener(
224
+ "touchmove",
225
+ (e) => {
226
+ if (mode === "drag" || mode === "hswipe") {
227
+ e.preventDefault();
228
+ return;
229
+ }
230
+ if (mode !== "pending") return;
231
+ const t2 = e.touches[0];
232
+ if (!t2) return;
233
+ const { toward, across } = dismissAxis(t2.clientX - startX, t2.clientY - startY, dir, mirrored);
234
+ if (toward > Math.abs(across) && !this.scrollsTowardEdge(e.target)) e.preventDefault();
235
+ },
236
+ { passive: false }
237
+ );
238
+ const settle = () => {
239
+ if (mode === "idle") return;
240
+ const finished = mode;
241
+ mode = "idle";
242
+ if (finished === "drag") {
243
+ this.panel.style.transition = "";
244
+ this.panel.style.transform = "";
245
+ const box = this.panel.getBoundingClientRect();
246
+ if (dragDismisses(d, vertical ? box.height : box.width)) this.hide();
247
+ } else if (finished === "hswipe") {
248
+ const dir2 = swipeDirection(dx, dy);
249
+ if (dir2) onSwipe?.(dir2);
250
+ }
251
+ };
252
+ this.panel.addEventListener("pointerup", settle);
253
+ this.panel.addEventListener("pointercancel", settle);
254
+ }
255
+ setTitle(title) {
256
+ this.titleEl.textContent = title;
257
+ }
258
+ setShown(shown) {
259
+ this.backdrop.style.display = shown ? "" : "none";
260
+ this.positioner.style.display = shown ? "" : "none";
261
+ }
262
+ /** Keep the just-closed sheet up through its exit animation, then hide it — or
263
+ * remove it, when it was destroyed meanwhile. `spreadProps` re-applies the close
264
+ * props' `hidden` only when its value changes, so lifting it keeps the sheet and
265
+ * scrim up until the exit ends. The positioner spans the host: inert, it lets
266
+ * clicks through to the page while the sheet animates out. */
267
+ holdExit() {
268
+ const held = [this.panel, this.backdrop];
269
+ for (const el of held) el.hidden = false;
270
+ this.exit = holdForExit(
271
+ held,
272
+ () => {
273
+ this.exit = null;
274
+ if (this.destroyed) {
275
+ this.detach();
276
+ } else if (!this.open) {
277
+ for (const el of held) el.hidden = true;
278
+ this.setShown(false);
279
+ }
280
+ },
281
+ { inert: [this.positioner] }
282
+ );
283
+ }
284
+ detach() {
285
+ this.backdrop.remove();
286
+ this.positioner.remove();
287
+ }
288
+ /** Closing hands focus back to whatever opened it (Escape, the ✕, hide(), or a
289
+ * teardown that outruns the machine's close notification). */
290
+ restoreOpener() {
291
+ const opener = this.opener;
292
+ this.opener = null;
293
+ if (opener?.isConnected) opener.focus({ preventScroll: true });
294
+ }
295
+ announce(open) {
296
+ const opener = this.opener === this.panel.ownerDocument.body ? null : this.opener;
297
+ announceSurface(this.panel, open, "drawer", opener);
298
+ }
299
+ get open() {
300
+ return this.ctrl.connect(this.handle.service).open;
301
+ }
302
+ show() {
303
+ this.opener = this.panel.ownerDocument.activeElement;
304
+ this.ctrl.connect(this.handle.service).setOpen(true);
305
+ }
306
+ hide() {
307
+ this.ctrl.connect(this.handle.service).setOpen(false);
308
+ }
309
+ destroy() {
310
+ if (this.wasOpen && !this.open) this.handle.flush();
311
+ this.handle.stop();
312
+ this.destroyed = true;
313
+ if (this.wasOpen) {
314
+ this.wasOpen = false;
315
+ this.announce(false);
316
+ }
317
+ this.restoreOpener();
318
+ disposeWithin(this.panel);
319
+ if (!this.exit) this.detach();
320
+ }
321
+ };
322
+ function createDrawer(props = {}) {
323
+ return new Drawer(props);
324
+ }
325
+
326
+ export { Drawer, classifyGesture, createDrawer, dismissAxis, dragDismisses, drawerController, drawerDef, swipeDirection };
@@ -0,0 +1,114 @@
1
+ import { C as ComponentDef } from './define-D5u3F5Dj.js';
2
+ import { PlacementProps } from './placement.js';
3
+ import { Translator } from './i18n.js';
4
+ import * as zagMenu from '@zag-js/menu';
5
+ import './t.js';
6
+
7
+ /** One menu entry. `id` is the selection value reported to `onSelect`. */
8
+ interface MenuItemDescriptor {
9
+ id: string;
10
+ label: string;
11
+ disabled?: boolean;
12
+ /** Draw a separator line above this item. */
13
+ separatorBefore?: boolean;
14
+ /** Right-aligned hint (e.g. a shortcut display from KeymapManager). */
15
+ hint?: string;
16
+ /** Selected state (undefined = plain item). A plain checked item renders as a
17
+ * highlighted row (brighter surface + bright ink) — or, in a menu built with
18
+ * `checkmarks`, as a leading ✓ with the row surface left free for hover. */
19
+ checked?: boolean;
20
+ /** Render as a SWITCH row (a right-aligned toggle pill reflecting `checked`)
21
+ * instead of the selected-row highlight, and keep the menu OPEN on selection —
22
+ * the shape for boolean settings living inside a dropdown. */
23
+ toggle?: boolean;
24
+ /** Icon id (see the `vela/ui` icon registry) rendered before the label. A level where
25
+ * any row has one gives its iconless rows an empty slot, so the labels align. */
26
+ icon?: string;
27
+ /** Favorite-star affordance at the row's right edge: `false` renders an outline
28
+ * star revealed on row hover, `true` a filled star that stays visible. Clicking
29
+ * it reports through the menu's `onFavorite` WITHOUT selecting (or closing) the
30
+ * row — undefined rows carry no star at all. */
31
+ favorite?: boolean;
32
+ /** Nested entries — the row becomes a submenu trigger opening its own list to the side.
33
+ * A branch is not selectable itself: `onSelect` only ever reports leaf ids. */
34
+ submenu?: readonly MenuItemDescriptor[];
35
+ }
36
+ interface DropdownMenuControllerOptions extends PlacementProps {
37
+ items: readonly MenuItemDescriptor[];
38
+ onSelect?: (id: string) => void;
39
+ /** @deprecated Use `side` and `align`. */
40
+ placement?: zagMenu.Props['positioning'] extends infer P | undefined ? (P extends {
41
+ placement?: infer PL;
42
+ } ? PL : never) : never;
43
+ onOpenChange?: (open: boolean) => void;
44
+ /** Pin the floating list to this rect (viewport coords). Used to keep an open
45
+ * menu still when its trigger moves — starring a timeframe adds a chip and
46
+ * would otherwise drag the list with the caret. `null` falls through to the
47
+ * live trigger. */
48
+ getAnchorRect?: () => {
49
+ x: number;
50
+ y: number;
51
+ width: number;
52
+ height: number;
53
+ } | null;
54
+ /** Share the trigger's DOM id with other machines composed on the same element. */
55
+ triggerId?: string;
56
+ /** Pin the machine's own id instead of taking a fresh one. A parent registers its
57
+ * submenus under this key, so rebuilding a branch replaces its entry rather than
58
+ * piling a new one on top. */
59
+ id?: string;
60
+ }
61
+ type DropdownMenuService = zagMenu.Service;
62
+ type DropdownMenuApi = zagMenu.Api;
63
+ interface DropdownMenuController {
64
+ machine: typeof zagMenu.machine;
65
+ props: Partial<zagMenu.Props>;
66
+ connect(service: DropdownMenuService): DropdownMenuApi;
67
+ }
68
+ /** Zag's menu machine with the options mapped onto it, for any view layer. */
69
+ declare function dropdownMenuController(opts: DropdownMenuControllerOptions): DropdownMenuController;
70
+ declare const dropdownMenuDef: ComponentDef<"dropdown-menu", "label" | "mark" | "switch" | "badge" | "star" | "icon" | "content" | "item" | "hint" | "arrow" | "separator", "radius" | "switch-radius">;
71
+ type DropdownMenuProps = DropdownMenuOptions;
72
+ interface DropdownMenuOptions extends DropdownMenuControllerOptions {
73
+ /** Element that opens the menu on click (gets the machine's trigger props). */
74
+ trigger?: HTMLElement;
75
+ host?: HTMLElement;
76
+ /** Override the root list's min-width (the stylesheet default suits full-word labels;
77
+ * compact lists like the timeframe dropdown pass something snug). Submenus keep the
78
+ * default. */
79
+ minWidth?: string;
80
+ /** Star-toggle reports from items carrying `favorite` (the menu stays open — starring
81
+ * is a side action on a row, never a selection). */
82
+ onFavorite?: (id: string, on: boolean) => void;
83
+ /** Mark checked items with a leading ✓ instead of the selected-row background wash —
84
+ * the shape for pointer-anchored action menus (right-click context menus), where a
85
+ * washed row reads as hover state. A level holding checkable rows reserves the mark
86
+ * column on all its rows so labels align; an all-action level keeps its natural left
87
+ * edge. Submenus inherit the mode. Dropdown menus (a trigger button opening a
88
+ * picker) keep the default wash. */
89
+ checkmarks?: boolean;
90
+ /** Sit each row's icon in a squared badge (a 24px rounded tile with a faint fill and a soft
91
+ * border) instead of a bare glyph: its glyph brightens on a hovered row, and the tile
92
+ * inverts on the selected one. A
93
+ * level where some rows carry an icon reserves the badge column on all its rows so
94
+ * labels align; a level with no icon keeps its natural left edge. With `checkmarks`,
95
+ * the mark column leads and the badge follows. Submenus inherit the mode. */
96
+ iconBadges?: boolean;
97
+ /** The translator of the menu's own words (a star's name). Default: the kit build's, else English. */
98
+ i18n?: Translator | null;
99
+ }
100
+ declare class DropdownMenu {
101
+ private readonly root;
102
+ constructor(opts: DropdownMenuOptions);
103
+ get api(): zagMenu.Api;
104
+ open(): void;
105
+ /** Open anchored to a viewport point (context menus). */
106
+ openAt(clientX: number, clientY: number): void;
107
+ close(): void;
108
+ /** Swap the item descriptors (e.g. checked states) and re-project. */
109
+ setItems(items: readonly MenuItemDescriptor[]): void;
110
+ destroy(): void;
111
+ }
112
+ declare function createDropdownMenu(props: DropdownMenuProps): DropdownMenu;
113
+
114
+ export { DropdownMenu, type DropdownMenuApi, type DropdownMenuController, type DropdownMenuControllerOptions, type DropdownMenuOptions, type DropdownMenuProps, type DropdownMenuService, type MenuItemDescriptor, createDropdownMenu, dropdownMenuController, dropdownMenuDef };
@@ -0,0 +1,18 @@
1
+ export { DropdownMenu, createDropdownMenu, dropdownMenuController, dropdownMenuDef } from './chunk-5QHXOAZA.js';
2
+ import './chunk-G7IQLY3A.js';
3
+ import './chunk-FVH6L7FM.js';
4
+ import './chunk-FN2BUFNM.js';
5
+ import './chunk-J2QJATCD.js';
6
+ import './chunk-S7USVSYP.js';
7
+ import './chunk-AJ2IYSOI.js';
8
+ import './chunk-TAKSIV57.js';
9
+ import './chunk-MMTMOV6R.js';
10
+ import './chunk-3Q32K4PE.js';
11
+ import './chunk-P4MTEMT7.js';
12
+ import './chunk-Q6WTDVH6.js';
13
+ import './chunk-6QCILIT2.js';
14
+ import './chunk-VMCR3S2A.js';
15
+ import './chunk-IDA2BT7D.js';
16
+ import './chunk-2GQIZM5Z.js';
17
+ import './chunk-BXMWQIBO.js';
18
+ import './chunk-X66RJAIS.js';
@@ -0,0 +1,21 @@
1
+ import { C as ComponentDef } from './define-D5u3F5Dj.js';
2
+ import './t.js';
3
+
4
+ declare const emptyDef: ComponentDef<"empty", "title" | "root" | "icon" | "description", "icon-radius">;
5
+ interface EmptyProps {
6
+ /** Icon id from the kit's registry, shown in a tile above the title. */
7
+ icon?: string;
8
+ title: string;
9
+ description?: string;
10
+ /** A control under the text (a button that adds the first item). */
11
+ action?: HTMLElement;
12
+ /** Extra class names (layout hooks). */
13
+ className?: string;
14
+ }
15
+ interface EmptyHandle {
16
+ readonly el: HTMLElement;
17
+ destroy(): void;
18
+ }
19
+ declare function createEmpty(props: EmptyProps): EmptyHandle;
20
+
21
+ export { type EmptyHandle, type EmptyProps, createEmpty, emptyDef };
package/dist/empty.js ADDED
@@ -0,0 +1,38 @@
1
+ import { iconEl } from './chunk-G7IQLY3A.js';
2
+ import { h } from './chunk-Q6WTDVH6.js';
3
+ import { t } from './chunk-6QCILIT2.js';
4
+ import { defineComponent } from './chunk-VMCR3S2A.js';
5
+ import { defineStyles, css } from './chunk-IDA2BT7D.js';
6
+ import './chunk-2GQIZM5Z.js';
7
+ import './chunk-BXMWQIBO.js';
8
+ import './chunk-X66RJAIS.js';
9
+
10
+ // src/components/empty.ts
11
+ var emptyDef = defineComponent({
12
+ name: "empty",
13
+ parts: ["root", "icon", "title", "description"],
14
+ settings: { "icon-radius": "9px" }
15
+ });
16
+ var injectStyles = defineStyles(
17
+ "vela-ui-empty-state",
18
+ css`@layer vela.ui{[data-slot=empty]{text-align:center;color:${t.fg.muted};padding:28px 16px}[data-slot=empty]:where(:not([hidden])){flex-direction:column;justify-content:center;align-items:center;gap:8px;display:flex}[data-slot=empty-icon]{border-radius:${emptyDef.vars["icon-radius"]};background:${t.hover};width:32px;height:32px;color:${t.fg};padding:7px}[data-slot=empty-icon]>svg{width:18px;height:18px}[data-slot=empty-title]{color:${t.fg.bright};font-size:12.5px;font-weight:600}[data-slot=empty-description]{max-width:260px;font-size:11.5px;line-height:1.45}}`
19
+ );
20
+ function createEmpty(props) {
21
+ injectStyles(document);
22
+ let icon = null;
23
+ if (props.icon) {
24
+ icon = iconEl(props.icon, document);
25
+ icon.dataset.slot = emptyDef.slot("icon");
26
+ }
27
+ const el = h(
28
+ "div",
29
+ { className: props.className, slot: emptyDef.slot("root") },
30
+ icon,
31
+ h("div", { slot: emptyDef.slot("title"), text: props.title }),
32
+ props.description ? h("div", { slot: emptyDef.slot("description"), text: props.description }) : null,
33
+ props.action ?? null
34
+ );
35
+ return { el, destroy: () => el.remove() };
36
+ }
37
+
38
+ export { createEmpty, emptyDef };
@@ -0,0 +1,147 @@
1
+ import { C as ComponentDef } from './define-D5u3F5Dj.js';
2
+ import { ChartTheme } from './tokens.js';
3
+ import { ColorFieldOpts } from './color-picker.js';
4
+ import { SelectOption, SelectListPopoverOpts } from './select.js';
5
+ import './t.js';
6
+ import './placement.js';
7
+ import './popover.js';
8
+ import './i18n.js';
9
+ import './variants-B4stUBnY.js';
10
+
11
+ type FieldGridVariant = 'settings' | 'inputs';
12
+ type FieldLabelSize = 'sm' | 'md';
13
+ /** Label↔control and between-row rhythm shared by the settings surfaces. */
14
+ declare const FIELD_GAP_PX = 16;
15
+ /** Grid tracks for a field grid. Settings hugs both columns; inputs give leftover
16
+ * space to the control column. Mobile flips the label to a flexible track. */
17
+ declare function fieldGridColumns(variant: FieldGridVariant, mobile: boolean): string;
18
+ declare const fieldDef: ComponentDef<"field", "label" | "section" | "span" | "grid" | "row" | "cell" | "bool" | "stacked" | "stacked-head" | "inline" | "inline-item" | "toggle-label" | "sep", never>;
19
+ interface FieldGridOptions {
20
+ variant?: FieldGridVariant;
21
+ mobile?: boolean;
22
+ }
23
+ /** Shared label/control grid. Rows with `display:contents` participate in these tracks. */
24
+ declare function fieldGrid(opts?: FieldGridOptions): HTMLElement;
25
+ interface FieldSectionOptions {
26
+ variant?: FieldGridVariant;
27
+ first?: boolean;
28
+ }
29
+ /** Uppercase group heading that spans the field grid. */
30
+ declare function fieldSection(title: string, opts?: FieldSectionOptions): HTMLElement;
31
+ /** Vertical breathing space between row clusters. */
32
+ declare function fieldSeparator(): HTMLElement;
33
+ interface FieldToggleOpts {
34
+ checked: boolean;
35
+ onChange: (v: boolean) => void;
36
+ get?: () => boolean;
37
+ id?: string;
38
+ }
39
+ interface FieldInlineItem {
40
+ label?: string;
41
+ id?: string;
42
+ control: HTMLElement;
43
+ /** Toggle sits left of its label (bool companion on an inline row). */
44
+ toggleFirst?: boolean;
45
+ fit?: boolean;
46
+ }
47
+ interface FieldRowOptions {
48
+ label: string;
49
+ id?: string;
50
+ control?: HTMLElement | HTMLElement[];
51
+ info?: HTMLElement;
52
+ toggle?: FieldToggleOpts;
53
+ /** Full-width toggle + label (no control column). */
54
+ bool?: boolean;
55
+ /** Full-width stacked: centered label above a full-width control (textarea). */
56
+ stacked?: boolean;
57
+ /** Full-width wrap of several labeled controls. */
58
+ inline?: FieldInlineItem[];
59
+ /** Skip the 100px control wrap (color / session / time). */
60
+ fit?: boolean;
61
+ /** Wrap a single control at this width (indicator dialog number/select column). */
62
+ controlWidth?: number;
63
+ labelSize?: FieldLabelSize;
64
+ className?: string;
65
+ }
66
+ /** Label + control slot, optional master toggle, optional ⓘ. Grid-aware. */
67
+ declare function fieldRow(opts: FieldRowOptions): HTMLElement;
68
+ interface FieldControlHandle {
69
+ el: HTMLElement;
70
+ setValue?: (v: unknown) => void;
71
+ /** Release the control. Discarding a subtree with {@link disposeWithin} does it too. */
72
+ destroy(): void;
73
+ }
74
+ type FieldControlDesc = {
75
+ kind: 'number';
76
+ id?: string;
77
+ value: number;
78
+ min?: number;
79
+ max?: number;
80
+ step?: number;
81
+ integer?: boolean;
82
+ commit?: 'blur' | 'live';
83
+ steppers?: boolean;
84
+ fill?: boolean;
85
+ compact?: boolean;
86
+ clamp?: boolean;
87
+ placeholder?: string;
88
+ emptyValue?: number;
89
+ title?: string;
90
+ onChange: (v: number) => void;
91
+ sync?: () => number;
92
+ } | {
93
+ kind: 'select';
94
+ id?: string;
95
+ options: readonly SelectOption[];
96
+ value: string;
97
+ fill?: boolean;
98
+ theme?: ChartTheme;
99
+ list?: SelectListPopoverOpts;
100
+ title?: string;
101
+ onChange: (v: string) => void;
102
+ sync?: () => string;
103
+ } | {
104
+ kind: 'switch';
105
+ id?: string;
106
+ checked: boolean;
107
+ onChange: (v: boolean) => void;
108
+ sync?: () => boolean;
109
+ } | {
110
+ kind: 'color';
111
+ id?: string;
112
+ theme: ChartTheme;
113
+ get: () => string;
114
+ onChange: (v: string) => void;
115
+ popover?: ColorFieldOpts['popover'];
116
+ /** Opacity-drag commit policy (default `'live'`): `'release'` when `onChange` recomputes rather than repaints. */
117
+ commit?: ColorFieldOpts['commit'];
118
+ title?: string;
119
+ } | {
120
+ kind: 'text';
121
+ id?: string;
122
+ value: string;
123
+ fill?: boolean;
124
+ placeholder?: string;
125
+ onChange: (v: string) => void;
126
+ sync?: () => string;
127
+ } | {
128
+ kind: 'textarea';
129
+ id?: string;
130
+ value: string;
131
+ rows?: number;
132
+ autoGrow?: boolean;
133
+ maxLines?: number;
134
+ placeholder?: string;
135
+ onChange: (v: string) => void;
136
+ sync?: () => string;
137
+ } | {
138
+ kind: 'width';
139
+ theme: ChartTheme;
140
+ get: () => number;
141
+ onChange: (v: number) => void;
142
+ title?: string;
143
+ };
144
+ /** One kit control from a neutral descriptor. `sync` re-reads on `vela-sync`. */
145
+ declare function buildFieldControl(desc: FieldControlDesc): FieldControlHandle;
146
+
147
+ export { FIELD_GAP_PX, type FieldControlDesc, type FieldControlHandle, type FieldGridOptions, type FieldGridVariant, type FieldInlineItem, type FieldLabelSize, type FieldRowOptions, type FieldSectionOptions, type FieldToggleOpts, buildFieldControl, fieldDef, fieldGrid, fieldGridColumns, fieldRow, fieldSection, fieldSeparator };