@luxalgo/vela-ui 0.3.0 → 0.4.1

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 (177) hide show
  1. package/CHANGELOG.md +165 -132
  2. package/LICENSE +201 -201
  3. package/NOTICE +28 -28
  4. package/README.md +86 -86
  5. package/cli/engine.mjs +282 -282
  6. package/cli/index.mjs +154 -154
  7. package/dist/button.js +2 -2
  8. package/dist/callout-bubble.js +3 -3
  9. package/dist/checkbox.js +3 -3
  10. package/dist/{chunk-OJ2SEMN6.js → chunk-5A54GODF.js} +2 -2
  11. package/dist/{chunk-UEO6W37Z.js → chunk-7LYWI32I.js} +2 -2
  12. package/dist/{chunk-IOOYDSSK.js → chunk-BIU66EHS.js} +2 -2
  13. package/dist/{chunk-KKS6NEGI.js → chunk-BWSOMG3G.js} +1 -1
  14. package/dist/{chunk-DXDCKZ2M.js → chunk-CZRHHVSB.js} +1 -1
  15. package/dist/{chunk-C3PXY2SW.js → chunk-EDYD5XKJ.js} +9 -0
  16. package/dist/chunk-GUIYFQ27.js +30 -0
  17. package/dist/{chunk-WWHNUKSZ.js → chunk-JEGB72M4.js} +8 -8
  18. package/dist/{chunk-B2EZB5ZG.js → chunk-ODPGOUQT.js} +4 -3
  19. package/dist/{chunk-TBXUF5YX.js → chunk-RH53NQGE.js} +18 -4
  20. package/dist/{chunk-OQXFQMZM.js → chunk-TGJNHUYV.js} +2 -2
  21. package/dist/collapsible.js +2 -2
  22. package/dist/color-picker.js +4 -4
  23. package/dist/context-menu.js +4 -4
  24. package/dist/date-picker.js +1 -1
  25. package/dist/dialog.js +4 -4
  26. package/dist/donut.d.ts +1 -1
  27. package/dist/drawer.js +1 -1
  28. package/dist/dropdown-menu.d.ts +2 -0
  29. package/dist/dropdown-menu.js +4 -4
  30. package/dist/empty.js +1 -1
  31. package/dist/field.js +9 -9
  32. package/dist/{stat.d.ts → figure.d.ts} +9 -9
  33. package/dist/figure.js +41 -0
  34. package/dist/glyph-select.js +4 -4
  35. package/dist/hover-card.js +1 -1
  36. package/dist/icons.js +1 -1
  37. package/dist/index.d.ts +2 -2
  38. package/dist/index.js +1 -1
  39. package/dist/input-group.js +2 -2
  40. package/dist/item.js +1 -1
  41. package/dist/manifest.json +75 -74
  42. package/dist/number-input.js +3 -3
  43. package/dist/popover.js +2 -2
  44. package/dist/select.d.ts +5 -1
  45. package/dist/select.js +5 -5
  46. package/dist/slider.js +1 -1
  47. package/dist/sort-button.js +2 -2
  48. package/dist/switch.js +1 -1
  49. package/dist/tabs.js +2 -2
  50. package/dist/{theme-Ct-q58xz.d.ts → theme-TefB8vtl.d.ts} +2 -2
  51. package/dist/theme.d.ts +2 -2
  52. package/dist/theme.js +1 -1
  53. package/dist/theme.schema.json +30 -30
  54. package/dist/toast.d.ts +2 -2
  55. package/dist/toast.js +2 -2
  56. package/dist/toggle-group.js +2 -2
  57. package/dist/tooltip.js +1 -1
  58. package/dist/zag.d.ts +11 -2
  59. package/dist/zag.js +1 -1
  60. package/docs/theming.md +217 -217
  61. package/docs/what-to-change.md +20 -20
  62. package/docs/writing-a-component.md +250 -250
  63. package/llms.txt +3 -3
  64. package/package.json +90 -90
  65. package/registry/badge.ts +119 -119
  66. package/registry/bar-chart.ts +215 -215
  67. package/registry/button.ts +387 -387
  68. package/registry/callout-bubble.ts +347 -347
  69. package/registry/card.ts +379 -379
  70. package/registry/checkbox.ts +234 -234
  71. package/registry/collapsible.ts +271 -271
  72. package/registry/color-picker.ts +582 -582
  73. package/registry/context-menu.ts +208 -208
  74. package/registry/data-table.ts +215 -215
  75. package/registry/date-picker.ts +483 -483
  76. package/registry/dialog.ts +551 -551
  77. package/registry/donut.ts +145 -145
  78. package/registry/drawer.ts +636 -636
  79. package/registry/dropdown-menu.ts +765 -762
  80. package/registry/empty.ts +91 -91
  81. package/registry/field.ts +584 -584
  82. package/registry/{stat.ts → figure.ts} +96 -96
  83. package/registry/glyph-select.ts +268 -268
  84. package/registry/hover-card.ts +222 -222
  85. package/registry/input-group.ts +229 -229
  86. package/registry/input.ts +181 -181
  87. package/registry/item.ts +376 -376
  88. package/registry/kbd.ts +64 -64
  89. package/registry/line-chart.ts +218 -218
  90. package/registry/month-grid.ts +328 -328
  91. package/registry/number-input.ts +443 -443
  92. package/registry/popover.ts +368 -368
  93. package/registry/scatter-chart.ts +221 -221
  94. package/registry/select.ts +629 -620
  95. package/registry/slider.ts +259 -259
  96. package/registry/sort-button.ts +189 -189
  97. package/registry/sparkline.ts +114 -114
  98. package/registry/switch.ts +205 -205
  99. package/registry/tabs.ts +426 -426
  100. package/registry/text-area.ts +186 -186
  101. package/registry/toast.ts +965 -965
  102. package/registry/toggle-group.ts +295 -295
  103. package/registry/tooltip.ts +156 -156
  104. package/registry/treemap.ts +847 -847
  105. package/skills/theming-vela-ui/SKILL.md +137 -137
  106. package/skills/using-vela-ui-components/SKILL.md +141 -139
  107. package/skills/writing-vela-ui-components/SKILL.md +163 -163
  108. package/src/components/badge.ts +119 -119
  109. package/src/components/bar-chart.ts +215 -215
  110. package/src/components/button.ts +387 -387
  111. package/src/components/callout-bubble.ts +347 -347
  112. package/src/components/card.ts +379 -379
  113. package/src/components/checkbox.ts +234 -234
  114. package/src/components/collapsible.ts +271 -271
  115. package/src/components/color-picker.ts +582 -582
  116. package/src/components/context-menu.ts +208 -208
  117. package/src/components/data-table.ts +215 -215
  118. package/src/components/date-picker.ts +483 -483
  119. package/src/components/dialog.ts +551 -551
  120. package/src/components/donut.ts +145 -145
  121. package/src/components/drawer.ts +636 -636
  122. package/src/components/dropdown-menu.ts +765 -762
  123. package/src/components/empty.ts +91 -91
  124. package/src/components/field.ts +584 -584
  125. package/src/components/{stat.ts → figure.ts} +96 -96
  126. package/src/components/glyph-select.ts +268 -268
  127. package/src/components/hover-card.ts +222 -222
  128. package/src/components/input-group.ts +229 -229
  129. package/src/components/input.ts +181 -181
  130. package/src/components/item.ts +376 -376
  131. package/src/components/kbd.ts +64 -64
  132. package/src/components/line-chart.ts +218 -218
  133. package/src/components/month-grid.ts +328 -328
  134. package/src/components/number-input.ts +443 -443
  135. package/src/components/popover.ts +368 -368
  136. package/src/components/scatter-chart.ts +221 -221
  137. package/src/components/select.ts +629 -620
  138. package/src/components/slider.ts +259 -259
  139. package/src/components/sort-button.ts +189 -189
  140. package/src/components/sparkline.ts +114 -114
  141. package/src/components/switch.ts +205 -205
  142. package/src/components/tabs.ts +426 -426
  143. package/src/components/text-area.ts +186 -186
  144. package/src/components/toast.ts +965 -965
  145. package/src/components/toggle-group.ts +295 -295
  146. package/src/components/tooltip.ts +156 -156
  147. package/src/components/treemap.ts +847 -847
  148. package/src/index.ts +24 -24
  149. package/src/lib/calendar.ts +117 -117
  150. package/src/lib/chart.ts +72 -72
  151. package/src/lib/color.ts +89 -89
  152. package/src/lib/component-index.ts +163 -163
  153. package/src/lib/css.ts +48 -48
  154. package/src/lib/define.ts +45 -45
  155. package/src/lib/dispose.ts +36 -36
  156. package/src/lib/h.ts +55 -55
  157. package/src/lib/headless.ts +16 -16
  158. package/src/lib/i18n.ts +30 -30
  159. package/src/lib/icons.ts +253 -244
  160. package/src/lib/kit-text.ts +26 -26
  161. package/src/lib/page.ts +24 -24
  162. package/src/lib/palette.ts +81 -81
  163. package/src/lib/placement.ts +188 -188
  164. package/src/lib/scope.ts +135 -135
  165. package/src/lib/styles.ts +53 -53
  166. package/src/lib/surface-events.ts +31 -31
  167. package/src/lib/surface-exit.ts +87 -87
  168. package/src/lib/t.ts +68 -68
  169. package/src/lib/theme.ts +684 -670
  170. package/src/lib/tokens.ts +110 -110
  171. package/src/lib/variants.ts +32 -32
  172. package/src/lib/zag.ts +61 -46
  173. package/stylelint/index.mjs +60 -60
  174. package/stylelint/lint.mjs +81 -81
  175. package/stylelint/plugin.mjs +115 -115
  176. package/dist/chunk-P4MTEMT7.js +0 -23
  177. package/dist/stat.js +0 -41
@@ -1,15 +1,15 @@
1
- import { DropdownMenu } from './chunk-B2EZB5ZG.js';
1
+ import { DropdownMenu } from './chunk-ODPGOUQT.js';
2
2
  import { kitTranslator } from './chunk-FVH6L7FM.js';
3
3
  import './chunk-FN2BUFNM.js';
4
4
  import './chunk-J2QJATCD.js';
5
5
  import './chunk-S7USVSYP.js';
6
- import './chunk-TBXUF5YX.js';
6
+ import './chunk-RH53NQGE.js';
7
7
  import './chunk-TAKSIV57.js';
8
8
  import './chunk-MMTMOV6R.js';
9
9
  import './chunk-3Q32K4PE.js';
10
10
  import { ownTeardown } from './chunk-A72NWYNP.js';
11
- import './chunk-P4MTEMT7.js';
12
- import './chunk-C3PXY2SW.js';
11
+ import './chunk-GUIYFQ27.js';
12
+ import './chunk-EDYD5XKJ.js';
13
13
  import './chunk-Q6WTDVH6.js';
14
14
  import './chunk-6QCILIT2.js';
15
15
  import './chunk-VMCR3S2A.js';
@@ -1,6 +1,6 @@
1
1
  import { calendarSettings, monthNames, yearLabel, weekdayNames, yearBeforeMonth, plainInteger } from './chunk-GVRX3UAV.js';
2
2
  import { msg, textOf } from './chunk-FN2BUFNM.js';
3
- import { iconEl } from './chunk-C3PXY2SW.js';
3
+ import { iconEl } from './chunk-EDYD5XKJ.js';
4
4
  import { h } from './chunk-Q6WTDVH6.js';
5
5
  import { t } from './chunk-6QCILIT2.js';
6
6
  import { defineComponent } from './chunk-VMCR3S2A.js';
package/dist/dialog.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import { kitTranslator } from './chunk-FVH6L7FM.js';
2
2
  import { msg, textOf } from './chunk-FN2BUFNM.js';
3
- import { isPopoverOpen, eventDismissedPopover, closeOpenPopovers } from './chunk-KKS6NEGI.js';
3
+ import { isPopoverOpen, eventDismissedPopover, closeOpenPopovers } from './chunk-BWSOMG3G.js';
4
4
  import { announceSurface } from './chunk-J2QJATCD.js';
5
5
  import { holdForExit } from './chunk-S7USVSYP.js';
6
- import './chunk-TBXUF5YX.js';
6
+ import './chunk-RH53NQGE.js';
7
7
  import './chunk-TAKSIV57.js';
8
8
  import './chunk-MMTMOV6R.js';
9
9
  import './chunk-3Q32K4PE.js';
10
10
  import { disposeWithin } from './chunk-A72NWYNP.js';
11
- import { normalizeProps, nextUid, runMachine, spreadProps } from './chunk-P4MTEMT7.js';
12
- import { iconEl } from './chunk-C3PXY2SW.js';
11
+ import { normalizeProps, nextUid, runMachine, spreadProps } from './chunk-GUIYFQ27.js';
12
+ import { iconEl } from './chunk-EDYD5XKJ.js';
13
13
  import './chunk-Q6WTDVH6.js';
14
14
  import { t } from './chunk-6QCILIT2.js';
15
15
  import { defineComponent } from './chunk-VMCR3S2A.js';
package/dist/donut.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { C as ComponentDef } from './define-D5u3F5Dj.js';
2
2
  import './t.js';
3
3
 
4
- declare const donutDef: ComponentDef<"donut", "caption" | "figure" | "label" | "legend" | "track" | "root" | "swatch" | "value" | "ring" | "segment" | "item", "swatch-radius">;
4
+ declare const donutDef: ComponentDef<"donut", "caption" | "figure" | "label" | "legend" | "track" | "root" | "value" | "swatch" | "ring" | "segment" | "item", "swatch-radius">;
5
5
  interface DonutSegment {
6
6
  value: number;
7
7
  label: string;
package/dist/drawer.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { announceSurface } from './chunk-J2QJATCD.js';
2
2
  import { holdForExit } from './chunk-S7USVSYP.js';
3
3
  import { disposeWithin } from './chunk-A72NWYNP.js';
4
- import { normalizeProps, nextUid, runMachine, spreadProps } from './chunk-P4MTEMT7.js';
4
+ import { normalizeProps, nextUid, runMachine, spreadProps } from './chunk-GUIYFQ27.js';
5
5
  import { t } from './chunk-6QCILIT2.js';
6
6
  import { defineComponent } from './chunk-VMCR3S2A.js';
7
7
  import { defineStyles, css } from './chunk-XBEL4K33.js';
@@ -9,6 +9,8 @@ interface MenuItemDescriptor {
9
9
  id: string;
10
10
  label: string;
11
11
  disabled?: boolean;
12
+ /** The row's tooltip, e.g. why a disabled row is unavailable. */
13
+ title?: string;
12
14
  /** Draw a separator line above this item. */
13
15
  separatorBefore?: boolean;
14
16
  /** Right-aligned hint (e.g. a shortcut display from KeymapManager). */
@@ -1,14 +1,14 @@
1
- export { DropdownMenu, createDropdownMenu, dropdownMenuController, dropdownMenuDef } from './chunk-B2EZB5ZG.js';
1
+ export { DropdownMenu, createDropdownMenu, dropdownMenuController, dropdownMenuDef } from './chunk-ODPGOUQT.js';
2
2
  import './chunk-FVH6L7FM.js';
3
3
  import './chunk-FN2BUFNM.js';
4
4
  import './chunk-J2QJATCD.js';
5
5
  import './chunk-S7USVSYP.js';
6
- import './chunk-TBXUF5YX.js';
6
+ import './chunk-RH53NQGE.js';
7
7
  import './chunk-TAKSIV57.js';
8
8
  import './chunk-MMTMOV6R.js';
9
9
  import './chunk-3Q32K4PE.js';
10
- import './chunk-P4MTEMT7.js';
11
- import './chunk-C3PXY2SW.js';
10
+ import './chunk-GUIYFQ27.js';
11
+ import './chunk-EDYD5XKJ.js';
12
12
  import './chunk-Q6WTDVH6.js';
13
13
  import './chunk-6QCILIT2.js';
14
14
  import './chunk-VMCR3S2A.js';
package/dist/empty.js CHANGED
@@ -1,4 +1,4 @@
1
- import { iconEl } from './chunk-C3PXY2SW.js';
1
+ import { iconEl } from './chunk-EDYD5XKJ.js';
2
2
  import { h } from './chunk-Q6WTDVH6.js';
3
3
  import { t } from './chunk-6QCILIT2.js';
4
4
  import { defineComponent } from './chunk-VMCR3S2A.js';
package/dist/field.js CHANGED
@@ -1,22 +1,22 @@
1
1
  import { TextArea } from './chunk-ALAHGSLC.js';
2
- import { NumberInput } from './chunk-UEO6W37Z.js';
3
- import { Select } from './chunk-WWHNUKSZ.js';
4
- import { widthField } from './chunk-OJ2SEMN6.js';
2
+ import { NumberInput } from './chunk-7LYWI32I.js';
3
+ import { Select } from './chunk-JEGB72M4.js';
4
+ import { widthField } from './chunk-5A54GODF.js';
5
5
  import { Input } from './chunk-5BJV5FY5.js';
6
- import { ColorField } from './chunk-OQXFQMZM.js';
6
+ import { ColorField } from './chunk-TGJNHUYV.js';
7
7
  import './chunk-FVH6L7FM.js';
8
8
  import './chunk-FN2BUFNM.js';
9
- import './chunk-KKS6NEGI.js';
9
+ import './chunk-BWSOMG3G.js';
10
10
  import './chunk-J2QJATCD.js';
11
11
  import './chunk-S7USVSYP.js';
12
- import './chunk-TBXUF5YX.js';
12
+ import './chunk-RH53NQGE.js';
13
13
  import './chunk-TAKSIV57.js';
14
14
  import './chunk-MMTMOV6R.js';
15
15
  import './chunk-3Q32K4PE.js';
16
- import { Checkbox } from './chunk-IOOYDSSK.js';
16
+ import { Checkbox } from './chunk-BIU66EHS.js';
17
17
  import { disposeWithin } from './chunk-A72NWYNP.js';
18
- import './chunk-P4MTEMT7.js';
19
- import './chunk-C3PXY2SW.js';
18
+ import './chunk-GUIYFQ27.js';
19
+ import './chunk-EDYD5XKJ.js';
20
20
  import './chunk-LZWZV2ZS.js';
21
21
  import './chunk-Q6WTDVH6.js';
22
22
  import { t } from './chunk-6QCILIT2.js';
@@ -2,12 +2,12 @@ import { V as VariantFn, a as VariantProps } from './variants-B4stUBnY.js';
2
2
  import { C as ComponentDef } from './define-D5u3F5Dj.js';
3
3
  import './t.js';
4
4
 
5
- declare const statDef: ComponentDef<"stat", "label" | "sub" | "root" | "value", never>;
6
- declare const statVariants: VariantFn<{
5
+ declare const figureDef: ComponentDef<"figure", "label" | "sub" | "root" | "value", never>;
6
+ declare const figureVariants: VariantFn<{
7
7
  readonly tone: readonly ["neutral", "profit", "loss"];
8
8
  }>;
9
- type StatTone = (typeof statVariants.spec.tone)[number];
10
- interface StatProps extends VariantProps<typeof statVariants> {
9
+ type FigureTone = (typeof figureVariants.spec.tone)[number];
10
+ interface FigureProps extends VariantProps<typeof figureVariants> {
11
11
  label: string;
12
12
  /** The figure (default `—`). */
13
13
  value?: string;
@@ -16,14 +16,14 @@ interface StatProps extends VariantProps<typeof statVariants> {
16
16
  /** Extra class names (layout hooks). */
17
17
  className?: string;
18
18
  }
19
- interface StatHandle {
19
+ interface FigureHandle {
20
20
  readonly el: HTMLElement;
21
21
  /** A new figure, its tone and its line (`null` hides the line). */
22
- set(value: string, tone?: StatTone, sub?: string | null): void;
22
+ set(value: string, tone?: FigureTone, sub?: string | null): void;
23
23
  destroy(): void;
24
24
  }
25
25
  /** The tone of a signed figure: a gain, a loss, or neither. */
26
- declare function toneOf(n: number): StatTone;
27
- declare function createStat(props: StatProps): StatHandle;
26
+ declare function toneOf(n: number): FigureTone;
27
+ declare function createFigure(props: FigureProps): FigureHandle;
28
28
 
29
- export { type StatHandle, type StatProps, type StatTone, createStat, statDef, statVariants, toneOf };
29
+ export { type FigureHandle, type FigureProps, type FigureTone, createFigure, figureDef, figureVariants, toneOf };
package/dist/figure.js ADDED
@@ -0,0 +1,41 @@
1
+ import { variants } from './chunk-LZWZV2ZS.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-XBEL4K33.js';
6
+ import './chunk-2GQIZM5Z.js';
7
+ import './chunk-BXMWQIBO.js';
8
+ import './chunk-X66RJAIS.js';
9
+
10
+ // src/components/figure.ts
11
+ var figureDef = defineComponent({
12
+ name: "figure",
13
+ parts: ["root", "label", "value", "sub"]
14
+ });
15
+ var figureVariants = variants({ tone: ["neutral", "profit", "loss"] });
16
+ function toneOf(n) {
17
+ return n > 0 ? "profit" : n < 0 ? "loss" : "neutral";
18
+ }
19
+ var injectStyles = defineStyles(
20
+ "vela-ui-figure",
21
+ css`@layer vela.ui{[data-slot=figure]:where(:not([hidden])){flex-direction:column;gap:3px;min-width:0;display:flex}[data-slot=figure-label]{color:${t.fg.muted};white-space:nowrap;text-overflow:ellipsis;font-size:11px;overflow:hidden}[data-slot=figure-value]{color:${t.fg.bright};font-variant-numeric:tabular-nums;white-space:nowrap;font-size:14px;font-weight:600}[data-slot=figure-value]:is([data-tone=profit]>*){color:${t.profit}}[data-slot=figure-value]:is([data-tone=loss]>*){color:${t.loss}}[data-slot=figure-sub]{color:${t.fg.muted};font-variant-numeric:tabular-nums;font-size:11px}}`
22
+ );
23
+ function createFigure(props) {
24
+ injectStyles(document);
25
+ const value = h("span", { slot: figureDef.slot("value"), text: props.value ?? "\u2014" });
26
+ const sub = h("span", { slot: figureDef.slot("sub"), text: props.sub ?? "" });
27
+ sub.hidden = !props.sub;
28
+ const el = h("div", { className: props.className, slot: figureDef.slot("root"), attrs: figureVariants(props) }, h("span", { slot: figureDef.slot("label"), text: props.label }), value, sub);
29
+ return {
30
+ el,
31
+ set(next, tone = "neutral", line = null) {
32
+ value.textContent = next;
33
+ el.setAttribute("data-tone", tone);
34
+ sub.textContent = line ?? "";
35
+ sub.hidden = !line;
36
+ },
37
+ destroy: () => el.remove()
38
+ };
39
+ }
40
+
41
+ export { createFigure, figureDef, figureVariants, toneOf };
@@ -1,13 +1,13 @@
1
- export { GlyphSelect, WIDTH_FIELD_OPTIONS, closeWidthPopover, createGlyphSelect, glyphSelectController, glyphSelectDef, lineWidthGlyph, widthField, widthFieldOptions } from './chunk-OJ2SEMN6.js';
2
- import './chunk-KKS6NEGI.js';
1
+ export { GlyphSelect, WIDTH_FIELD_OPTIONS, closeWidthPopover, createGlyphSelect, glyphSelectController, glyphSelectDef, lineWidthGlyph, widthField, widthFieldOptions } from './chunk-5A54GODF.js';
2
+ import './chunk-BWSOMG3G.js';
3
3
  import './chunk-J2QJATCD.js';
4
4
  import './chunk-S7USVSYP.js';
5
- import './chunk-TBXUF5YX.js';
5
+ import './chunk-RH53NQGE.js';
6
6
  import './chunk-TAKSIV57.js';
7
7
  import './chunk-MMTMOV6R.js';
8
8
  import './chunk-3Q32K4PE.js';
9
9
  import './chunk-A72NWYNP.js';
10
- import './chunk-C3PXY2SW.js';
10
+ import './chunk-EDYD5XKJ.js';
11
11
  import './chunk-Q6WTDVH6.js';
12
12
  import './chunk-6QCILIT2.js';
13
13
  import './chunk-VMCR3S2A.js';
@@ -1,6 +1,6 @@
1
1
  import { shortcutKeys } from './chunk-FYVQO5TN.js';
2
2
  import { viewportRect, placePopover, intersectRects } from './chunk-3Q32K4PE.js';
3
- import { iconEl } from './chunk-C3PXY2SW.js';
3
+ import { iconEl } from './chunk-EDYD5XKJ.js';
4
4
  import { h } from './chunk-Q6WTDVH6.js';
5
5
  import { t } from './chunk-6QCILIT2.js';
6
6
  import { defineComponent } from './chunk-VMCR3S2A.js';
package/dist/icons.js CHANGED
@@ -1,2 +1,2 @@
1
- export { icon, iconAt, iconEl, iconMarkup, registerIcon, svg16, svg24, svg24Solid } from './chunk-C3PXY2SW.js';
1
+ export { icon, iconAt, iconEl, iconMarkup, registerIcon, svg16, svg24, svg24Solid } from './chunk-EDYD5XKJ.js';
2
2
  import './chunk-X66RJAIS.js';
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ export { V as VariantFn, a as VariantProps, b as VariantSpec, c as VariantValues
5
5
  export { C as ComponentDef, d as defineComponent } from './define-D5u3F5Dj.js';
6
6
  export { disposeWithin, ownTeardown } from './dispose.js';
7
7
  export { Align, CollisionBoundary, PlacementProps, Side, placePopover, zagPositioning } from './placement.js';
8
- export { C as ComponentDefs, a as ComponentSettings, b as CreateThemeOptions, D as DARK_CHART, L as LIGHT_CHART, T as TOKEN_NAMES, c as ThemeInput, d as ThemeSettings, e as ThemedChart, f as TokenName, U as UiTheme, g as applyTheme, h as checkTheme, i as createTheme } from './theme-Ct-q58xz.js';
8
+ export { C as ComponentDefs, a as ComponentSettings, b as CreateThemeOptions, D as DARK_CHART, L as LIGHT_CHART, T as TOKEN_NAMES, c as ThemeInput, d as ThemeSettings, e as ThemedChart, f as TokenName, U as UiTheme, g as applyTheme, h as checkTheme, i as createTheme } from './theme-TefB8vtl.js';
9
9
  export { ChartTheme } from './tokens.js';
10
10
  export { LAYER_ORDER, injectLayerOrder } from './styles.js';
11
11
  import './badge.js';
@@ -34,7 +34,7 @@ import '@zag-js/menu';
34
34
  import './number-input.js';
35
35
  import './scatter-chart.js';
36
36
  import './sparkline.js';
37
- import './stat.js';
37
+ import './figure.js';
38
38
  import './checkbox.js';
39
39
  import './collapsible.js';
40
40
  import './tabs.js';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { DARK_CHART, LIGHT_CHART, TOKEN_NAMES, applyTheme, checkTheme, createTheme } from './chunk-TBXUF5YX.js';
1
+ export { DARK_CHART, LIGHT_CHART, TOKEN_NAMES, applyTheme, checkTheme, createTheme } from './chunk-RH53NQGE.js';
2
2
  import './chunk-TAKSIV57.js';
3
3
  import './chunk-MMTMOV6R.js';
4
4
  export { placePopover, zagPositioning } from './chunk-3Q32K4PE.js';
@@ -1,6 +1,6 @@
1
- import { createButton } from './chunk-DXDCKZ2M.js';
1
+ import { createButton } from './chunk-CZRHHVSB.js';
2
2
  import './chunk-FYVQO5TN.js';
3
- import { iconEl } from './chunk-C3PXY2SW.js';
3
+ import { iconEl } from './chunk-EDYD5XKJ.js';
4
4
  import { variants } from './chunk-LZWZV2ZS.js';
5
5
  import { h } from './chunk-Q6WTDVH6.js';
6
6
  import { t } from './chunk-6QCILIT2.js';
package/dist/item.js CHANGED
@@ -1,4 +1,4 @@
1
- import { iconEl } from './chunk-C3PXY2SW.js';
1
+ import { iconEl } from './chunk-EDYD5XKJ.js';
2
2
  import { variants } from './chunk-LZWZV2ZS.js';
3
3
  import { h, append } from './chunk-Q6WTDVH6.js';
4
4
  import { t } from './chunk-6QCILIT2.js';
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@luxalgo/vela-ui",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "tokens": [
5
5
  "space-1",
6
6
  "space-2",
@@ -2101,6 +2101,79 @@
2101
2101
  "data-mobile"
2102
2102
  ]
2103
2103
  },
2104
+ {
2105
+ "name": "figure",
2106
+ "import": "@luxalgo/vela-ui/figure",
2107
+ "description": "Figure: a value under its label (Net P&L, Win rate), with an optional line under it. Its tone colors a gain or a loss; `toneOf` reads one from a signed number.",
2108
+ "component": "figure",
2109
+ "declaration": "figureDef",
2110
+ "parts": {
2111
+ "root": "figure",
2112
+ "label": "figure-label",
2113
+ "value": "figure-value",
2114
+ "sub": "figure-sub"
2115
+ },
2116
+ "settings": {},
2117
+ "variants": {
2118
+ "tone": [
2119
+ "neutral",
2120
+ "profit",
2121
+ "loss"
2122
+ ]
2123
+ },
2124
+ "factory": "createFigure",
2125
+ "returns": "FigureHandle",
2126
+ "propsType": "FigureProps",
2127
+ "props": [
2128
+ {
2129
+ "name": "label",
2130
+ "type": "string",
2131
+ "required": true
2132
+ },
2133
+ {
2134
+ "name": "value",
2135
+ "type": "string",
2136
+ "required": false,
2137
+ "doc": "The figure (default `—`)."
2138
+ },
2139
+ {
2140
+ "name": "sub",
2141
+ "type": "string",
2142
+ "required": false,
2143
+ "doc": "A line under the figure (a count, a percentage)."
2144
+ },
2145
+ {
2146
+ "name": "className",
2147
+ "type": "string",
2148
+ "required": false,
2149
+ "doc": "Extra class names (layout hooks)."
2150
+ },
2151
+ {
2152
+ "name": "tone",
2153
+ "type": "\"neutral\" | \"profit\" | \"loss\"",
2154
+ "required": false
2155
+ }
2156
+ ],
2157
+ "exports": [
2158
+ "figureDef",
2159
+ "figureVariants",
2160
+ "FigureTone",
2161
+ "FigureProps",
2162
+ "FigureHandle",
2163
+ "toneOf",
2164
+ "createFigure"
2165
+ ],
2166
+ "tokens": [
2167
+ "fg-bright",
2168
+ "fg-muted",
2169
+ "loss",
2170
+ "profit"
2171
+ ],
2172
+ "attributes": [
2173
+ "data-tone"
2174
+ ],
2175
+ "example": "import { createFigure } from '@luxalgo/vela-ui/figure';\n\nconst figure = createFigure({ label: /* string */ });\nhost.append(figure.el);"
2176
+ },
2104
2177
  {
2105
2178
  "name": "glyph-select",
2106
2179
  "import": "@luxalgo/vela-ui/glyph-select",
@@ -3646,6 +3719,7 @@
3646
3719
  ],
3647
3720
  "attributes": [
3648
3721
  "data-checked",
3722
+ "data-disabled",
3649
3723
  "data-fill",
3650
3724
  "data-highlighted",
3651
3725
  "data-placeholder",
@@ -3960,79 +4034,6 @@
3960
4034
  ],
3961
4035
  "example": "import { createSparkline } from '@luxalgo/vela-ui/sparkline';\n\nconst sparkline = createSparkline({ values: /* readonly number[] */ });\nhost.append(sparkline.el);"
3962
4036
  },
3963
- {
3964
- "name": "stat",
3965
- "import": "@luxalgo/vela-ui/stat",
3966
- "description": "Stat: a figure under its label (Net P&L, Win rate), with an optional line under it. Its tone colors a gain or a loss; `toneOf` reads one from a signed number.",
3967
- "component": "stat",
3968
- "declaration": "statDef",
3969
- "parts": {
3970
- "root": "stat",
3971
- "label": "stat-label",
3972
- "value": "stat-value",
3973
- "sub": "stat-sub"
3974
- },
3975
- "settings": {},
3976
- "variants": {
3977
- "tone": [
3978
- "neutral",
3979
- "profit",
3980
- "loss"
3981
- ]
3982
- },
3983
- "factory": "createStat",
3984
- "returns": "StatHandle",
3985
- "propsType": "StatProps",
3986
- "props": [
3987
- {
3988
- "name": "label",
3989
- "type": "string",
3990
- "required": true
3991
- },
3992
- {
3993
- "name": "value",
3994
- "type": "string",
3995
- "required": false,
3996
- "doc": "The figure (default `—`)."
3997
- },
3998
- {
3999
- "name": "sub",
4000
- "type": "string",
4001
- "required": false,
4002
- "doc": "A line under the figure (a count, a percentage)."
4003
- },
4004
- {
4005
- "name": "className",
4006
- "type": "string",
4007
- "required": false,
4008
- "doc": "Extra class names (layout hooks)."
4009
- },
4010
- {
4011
- "name": "tone",
4012
- "type": "\"neutral\" | \"profit\" | \"loss\"",
4013
- "required": false
4014
- }
4015
- ],
4016
- "exports": [
4017
- "statDef",
4018
- "statVariants",
4019
- "StatTone",
4020
- "StatProps",
4021
- "StatHandle",
4022
- "toneOf",
4023
- "createStat"
4024
- ],
4025
- "tokens": [
4026
- "fg-bright",
4027
- "fg-muted",
4028
- "loss",
4029
- "profit"
4030
- ],
4031
- "attributes": [
4032
- "data-tone"
4033
- ],
4034
- "example": "import { createStat } from '@luxalgo/vela-ui/stat';\n\nconst stat = createStat({ label: /* string */ });\nhost.append(stat.el);"
4035
- },
4036
4037
  {
4037
4038
  "name": "switch",
4038
4039
  "import": "@luxalgo/vela-ui/switch",
@@ -1,9 +1,9 @@
1
- export { NUMBER_CSS, NUMBER_STYLE_ID, NumberInput, clampNumber, createNumberInput, numberInputController, numberInputDef, numberInputVariants, snapToStep } from './chunk-UEO6W37Z.js';
1
+ export { NUMBER_CSS, NUMBER_STYLE_ID, NumberInput, clampNumber, createNumberInput, numberInputController, numberInputDef, numberInputVariants, snapToStep } from './chunk-7LYWI32I.js';
2
2
  import './chunk-FVH6L7FM.js';
3
3
  import './chunk-FN2BUFNM.js';
4
4
  import './chunk-A72NWYNP.js';
5
- import './chunk-P4MTEMT7.js';
6
- import './chunk-C3PXY2SW.js';
5
+ import './chunk-GUIYFQ27.js';
6
+ import './chunk-EDYD5XKJ.js';
7
7
  import './chunk-LZWZV2ZS.js';
8
8
  import './chunk-Q6WTDVH6.js';
9
9
  import './chunk-6QCILIT2.js';
package/dist/popover.js CHANGED
@@ -1,7 +1,7 @@
1
- export { POPOVER_CSS, POPOVER_STYLE_ID, Popover, closeOpenPopovers, createPopover, eventDismissedPopover, isPopoverOpen, openPopoverTrigger, popoverController, popoverDef } from './chunk-KKS6NEGI.js';
1
+ export { POPOVER_CSS, POPOVER_STYLE_ID, Popover, closeOpenPopovers, createPopover, eventDismissedPopover, isPopoverOpen, openPopoverTrigger, popoverController, popoverDef } from './chunk-BWSOMG3G.js';
2
2
  import './chunk-J2QJATCD.js';
3
3
  import './chunk-S7USVSYP.js';
4
- import './chunk-TBXUF5YX.js';
4
+ import './chunk-RH53NQGE.js';
5
5
  import './chunk-TAKSIV57.js';
6
6
  import './chunk-MMTMOV6R.js';
7
7
  export { insetRect, intersectRects, placePopover, viewportRect } from './chunk-3Q32K4PE.js';
package/dist/select.d.ts CHANGED
@@ -9,6 +9,10 @@ type SelectSize = 'sm' | 'md';
9
9
  interface SelectOption {
10
10
  value: string;
11
11
  label: string;
12
+ /** Shown in the list but not selectable (dimmed, skipped by the keyboard). */
13
+ disabled?: boolean;
14
+ /** The option's tooltip, e.g. why it is disabled. */
15
+ title?: string;
12
16
  }
13
17
  interface SelectControllerOptions {
14
18
  options: readonly SelectOption[];
@@ -42,7 +46,7 @@ interface SelectController {
42
46
  }
43
47
  /** The select's options and current value, without DOM. */
44
48
  declare function selectController(opts: SelectControllerOptions): SelectController;
45
- declare const selectDef: ComponentDef<"select", "root" | "viewport" | "icon" | "trigger" | "content" | "value" | "thumb" | "item" | "sizer" | "native" | "rail", "radius" | "content-radius" | "focus-ring" | "thumb-radius">;
49
+ declare const selectDef: ComponentDef<"select", "root" | "viewport" | "icon" | "trigger" | "content" | "value" | "item" | "sizer" | "native" | "rail" | "thumb", "radius" | "content-radius" | "focus-ring" | "thumb-radius">;
46
50
  declare const selectVariants: VariantFn<{
47
51
  readonly size: readonly ["md", "sm"];
48
52
  }>;
package/dist/select.js CHANGED
@@ -1,14 +1,14 @@
1
- export { SELECT_CSS, SELECT_STYLE_ID, Select, createSelect, decorateSelectScroll, fillSelectList, openSelectList, selectController, selectDef, selectVariants, toggleSelectList } from './chunk-WWHNUKSZ.js';
2
- import './chunk-KKS6NEGI.js';
1
+ export { SELECT_CSS, SELECT_STYLE_ID, Select, createSelect, decorateSelectScroll, fillSelectList, openSelectList, selectController, selectDef, selectVariants, toggleSelectList } from './chunk-JEGB72M4.js';
2
+ import './chunk-BWSOMG3G.js';
3
3
  import './chunk-J2QJATCD.js';
4
4
  import './chunk-S7USVSYP.js';
5
- import './chunk-TBXUF5YX.js';
5
+ import './chunk-RH53NQGE.js';
6
6
  import './chunk-TAKSIV57.js';
7
7
  import './chunk-MMTMOV6R.js';
8
8
  import './chunk-3Q32K4PE.js';
9
9
  import './chunk-A72NWYNP.js';
10
- import './chunk-P4MTEMT7.js';
11
- import './chunk-C3PXY2SW.js';
10
+ import './chunk-GUIYFQ27.js';
11
+ import './chunk-EDYD5XKJ.js';
12
12
  import './chunk-LZWZV2ZS.js';
13
13
  import './chunk-Q6WTDVH6.js';
14
14
  import './chunk-6QCILIT2.js';
package/dist/slider.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ownTeardown } from './chunk-A72NWYNP.js';
2
- import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-P4MTEMT7.js';
2
+ import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-GUIYFQ27.js';
3
3
  import { h } from './chunk-Q6WTDVH6.js';
4
4
  import { t } from './chunk-6QCILIT2.js';
5
5
  import { defineComponent } from './chunk-VMCR3S2A.js';
@@ -1,7 +1,7 @@
1
1
  import { kitTranslator } from './chunk-FVH6L7FM.js';
2
2
  import { msg, textOf } from './chunk-FN2BUFNM.js';
3
- import { nextUid } from './chunk-P4MTEMT7.js';
4
- import { iconEl } from './chunk-C3PXY2SW.js';
3
+ import { nextUid } from './chunk-GUIYFQ27.js';
4
+ import { iconEl } from './chunk-EDYD5XKJ.js';
5
5
  import { variants } from './chunk-LZWZV2ZS.js';
6
6
  import { h } from './chunk-Q6WTDVH6.js';
7
7
  import { t } from './chunk-6QCILIT2.js';
package/dist/switch.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ownTeardown } from './chunk-A72NWYNP.js';
2
- import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-P4MTEMT7.js';
2
+ import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-GUIYFQ27.js';
3
3
  import { variants } from './chunk-LZWZV2ZS.js';
4
4
  import { h } from './chunk-Q6WTDVH6.js';
5
5
  import { t } from './chunk-6QCILIT2.js';
package/dist/tabs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ownTeardown } from './chunk-A72NWYNP.js';
2
- import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-P4MTEMT7.js';
3
- import { iconEl } from './chunk-C3PXY2SW.js';
2
+ import { nextUid, runMachine, normalizeProps, spreadProps } from './chunk-GUIYFQ27.js';
3
+ import { iconEl } from './chunk-EDYD5XKJ.js';
4
4
  import { variants } from './chunk-LZWZV2ZS.js';
5
5
  import { h } from './chunk-Q6WTDVH6.js';
6
6
  import { t } from './chunk-6QCILIT2.js';
@@ -21,7 +21,7 @@ import { popoverDef } from './popover.js';
21
21
  import { scatterChartDef } from './scatter-chart.js';
22
22
  import { selectDef } from './select.js';
23
23
  import { sparklineDef } from './sparkline.js';
24
- import { statDef } from './stat.js';
24
+ import { figureDef } from './figure.js';
25
25
  import { checkboxDef } from './checkbox.js';
26
26
  import { collapsibleDef } from './collapsible.js';
27
27
  import { tabsDef } from './tabs.js';
@@ -212,6 +212,7 @@ interface ComponentDefs {
212
212
  'dropdown-menu': typeof dropdownMenuDef;
213
213
  empty: typeof emptyDef;
214
214
  field: typeof fieldDef;
215
+ figure: typeof figureDef;
215
216
  'glyph-select': typeof glyphSelectDef;
216
217
  'hover-card': typeof hoverCardDef;
217
218
  'input-group': typeof inputGroupDef;
@@ -227,7 +228,6 @@ interface ComponentDefs {
227
228
  slider: typeof sliderDef;
228
229
  'sort-button': typeof sortButtonDef;
229
230
  sparkline: typeof sparklineDef;
230
- stat: typeof statDef;
231
231
  switch: typeof switchDef;
232
232
  tabs: typeof tabsDef;
233
233
  'text-area': typeof textAreaDef;
package/dist/theme.d.ts CHANGED
@@ -21,7 +21,7 @@ import './popover.js';
21
21
  import './scatter-chart.js';
22
22
  import './select.js';
23
23
  import './sparkline.js';
24
- import './stat.js';
24
+ import './figure.js';
25
25
  import './checkbox.js';
26
26
  import './collapsible.js';
27
27
  import './tabs.js';
@@ -33,7 +33,7 @@ import './month-grid.js';
33
33
  import './slider.js';
34
34
  import './sort-button.js';
35
35
  import './switch.js';
36
- export { C as ComponentDefs, a as ComponentSettings, b as CreateThemeOptions, D as DARK_CHART, L as LIGHT_CHART, T as TOKEN_NAMES, c as ThemeInput, d as ThemeSettings, e as ThemedChart, f as TokenName, U as UiTheme, y as applyPlotOverlayTokens, g as applyTheme, z as applyThemeTokens, h as checkTheme, i as createTheme, A as ensureUIHost, B as floatingLayerHost, F as themeCss } from './theme-Ct-q58xz.js';
36
+ export { C as ComponentDefs, a as ComponentSettings, b as CreateThemeOptions, D as DARK_CHART, L as LIGHT_CHART, T as TOKEN_NAMES, c as ThemeInput, d as ThemeSettings, e as ThemedChart, f as TokenName, U as UiTheme, y as applyPlotOverlayTokens, g as applyTheme, z as applyThemeTokens, h as checkTheme, i as createTheme, A as ensureUIHost, B as floatingLayerHost, F as themeCss } from './theme-TefB8vtl.js';
37
37
  import './toggle-group.js';
38
38
  import './tooltip.js';
39
39
  import './treemap.js';
package/dist/theme.js CHANGED
@@ -1,4 +1,4 @@
1
- export { DARK_CHART, LIGHT_CHART, TOKEN_NAMES, applyPlotOverlayTokens, applyTheme, applyThemeTokens, checkTheme, createTheme, ensureUIHost, floatingLayerHost, themeCss } from './chunk-TBXUF5YX.js';
1
+ export { DARK_CHART, LIGHT_CHART, TOKEN_NAMES, applyPlotOverlayTokens, applyTheme, applyThemeTokens, checkTheme, createTheme, ensureUIHost, floatingLayerHost, themeCss } from './chunk-RH53NQGE.js';
2
2
  import './chunk-TAKSIV57.js';
3
3
  import './chunk-MMTMOV6R.js';
4
4
  import './chunk-VMCR3S2A.js';