@luxalgo/vela-ui 0.2.0 → 0.4.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 (217) hide show
  1. package/CHANGELOG.md +153 -91
  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/badge.js +1 -1
  8. package/dist/bar-chart.d.ts +1 -1
  9. package/dist/bar-chart.js +1 -1
  10. package/dist/button.d.ts +1 -1
  11. package/dist/button.js +4 -4
  12. package/dist/callout-bubble.d.ts +1 -1
  13. package/dist/callout-bubble.js +4 -4
  14. package/dist/card.d.ts +52 -0
  15. package/dist/card.js +179 -0
  16. package/dist/checkbox.js +5 -5
  17. package/dist/{chunk-B5ZSRUDQ.js → chunk-BWSOMG3G.js} +2 -2
  18. package/dist/{chunk-G7IQLY3A.js → chunk-C3PXY2SW.js} +5 -0
  19. package/dist/{chunk-CC3DDNFC.js → chunk-DXDCKZ2M.js} +4 -4
  20. package/dist/chunk-GUIYFQ27.js +30 -0
  21. package/dist/{chunk-WGULXRWD.js → chunk-KUWTI2PE.js} +4 -4
  22. package/dist/{chunk-Z5PINFQO.js → chunk-QGWAN3EP.js} +5 -5
  23. package/dist/{chunk-V2Q4MRMS.js → chunk-RH53NQGE.js} +30 -4
  24. package/dist/{chunk-WBGSYCV2.js → chunk-SKFAYTDK.js} +4 -4
  25. package/dist/{chunk-MJ4RUGX7.js → chunk-TGJNHUYV.js} +3 -3
  26. package/dist/{chunk-WXH3EFV5.js → chunk-VC7SVSDK.js} +4 -4
  27. package/dist/{chunk-7VMN7NKJ.js → chunk-YT2BSP7O.js} +3 -3
  28. package/dist/collapsible.d.ts +1 -1
  29. package/dist/collapsible.js +3 -3
  30. package/dist/color-picker.js +5 -5
  31. package/dist/context-menu.js +5 -5
  32. package/dist/data-table.d.ts +1 -1
  33. package/dist/data-table.js +1 -1
  34. package/dist/date-picker.d.ts +1 -1
  35. package/dist/date-picker.js +2 -2
  36. package/dist/dialog.d.ts +9 -1
  37. package/dist/dialog.js +15 -5
  38. package/dist/donut.d.ts +1 -1
  39. package/dist/donut.js +1 -1
  40. package/dist/drawer.d.ts +1 -1
  41. package/dist/drawer.js +2 -2
  42. package/dist/dropdown-menu.d.ts +1 -1
  43. package/dist/dropdown-menu.js +5 -5
  44. package/dist/empty.d.ts +1 -1
  45. package/dist/empty.js +2 -2
  46. package/dist/field.js +13 -13
  47. package/dist/{stat.d.ts → figure.d.ts} +9 -9
  48. package/dist/figure.js +41 -0
  49. package/dist/glyph-select.js +5 -5
  50. package/dist/hover-card.d.ts +1 -1
  51. package/dist/hover-card.js +3 -3
  52. package/dist/icons.js +1 -1
  53. package/dist/index.d.ts +4 -2
  54. package/dist/index.js +3 -3
  55. package/dist/input-group.d.ts +1 -1
  56. package/dist/input-group.js +4 -4
  57. package/dist/input.js +2 -2
  58. package/dist/item.d.ts +1 -1
  59. package/dist/item.js +2 -2
  60. package/dist/kbd.d.ts +1 -1
  61. package/dist/kbd.js +2 -2
  62. package/dist/line-chart.d.ts +1 -1
  63. package/dist/line-chart.js +1 -1
  64. package/dist/manifest.json +691 -74
  65. package/dist/month-grid.js +1 -1
  66. package/dist/number-input.d.ts +1 -1
  67. package/dist/number-input.js +5 -5
  68. package/dist/popover.js +3 -3
  69. package/dist/scatter-chart.d.ts +1 -1
  70. package/dist/scatter-chart.js +1 -1
  71. package/dist/select.d.ts +1 -1
  72. package/dist/select.js +7 -7
  73. package/dist/slider.d.ts +1 -1
  74. package/dist/slider.js +2 -2
  75. package/dist/sort-button.js +4 -4
  76. package/dist/sparkline.d.ts +1 -1
  77. package/dist/sparkline.js +1 -1
  78. package/dist/switch.d.ts +1 -1
  79. package/dist/switch.js +3 -3
  80. package/dist/tabs.d.ts +1 -1
  81. package/dist/tabs.js +4 -4
  82. package/dist/text-area.d.ts +1 -1
  83. package/dist/text-area.js +2 -2
  84. package/dist/theme-TefB8vtl.d.ts +341 -0
  85. package/dist/theme.d.ts +42 -192
  86. package/dist/theme.js +1 -1
  87. package/dist/theme.schema.json +321 -30
  88. package/dist/toast.d.ts +49 -0
  89. package/dist/toast.js +463 -0
  90. package/dist/toggle-group.d.ts +1 -1
  91. package/dist/toggle-group.js +4 -4
  92. package/dist/tooltip.js +2 -2
  93. package/dist/treemap.d.ts +80 -0
  94. package/dist/treemap.js +470 -0
  95. package/dist/zag.d.ts +11 -2
  96. package/dist/zag.js +1 -1
  97. package/docs/theming.md +217 -217
  98. package/docs/what-to-change.md +20 -20
  99. package/docs/writing-a-component.md +250 -250
  100. package/llms.txt +6 -3
  101. package/package.json +90 -90
  102. package/registry/badge.ts +119 -119
  103. package/registry/bar-chart.ts +215 -215
  104. package/registry/button.ts +387 -379
  105. package/registry/callout-bubble.ts +347 -347
  106. package/registry/card.ts +379 -0
  107. package/registry/checkbox.ts +234 -234
  108. package/registry/collapsible.ts +271 -271
  109. package/registry/color-picker.ts +582 -582
  110. package/registry/context-menu.ts +208 -208
  111. package/registry/data-table.ts +215 -215
  112. package/registry/date-picker.ts +483 -483
  113. package/registry/dialog.ts +551 -535
  114. package/registry/donut.ts +145 -145
  115. package/registry/drawer.ts +636 -636
  116. package/registry/dropdown-menu.ts +762 -762
  117. package/registry/empty.ts +91 -91
  118. package/registry/field.ts +584 -584
  119. package/registry/{stat.ts → figure.ts} +96 -96
  120. package/registry/glyph-select.ts +268 -268
  121. package/registry/hover-card.ts +222 -222
  122. package/registry/input-group.ts +229 -229
  123. package/registry/input.ts +181 -181
  124. package/registry/item.ts +376 -376
  125. package/registry/kbd.ts +64 -64
  126. package/registry/line-chart.ts +218 -218
  127. package/registry/month-grid.ts +328 -328
  128. package/registry/number-input.ts +443 -443
  129. package/registry/popover.ts +368 -368
  130. package/registry/scatter-chart.ts +221 -221
  131. package/registry/select.ts +620 -620
  132. package/registry/slider.ts +259 -259
  133. package/registry/sort-button.ts +189 -189
  134. package/registry/sparkline.ts +114 -114
  135. package/registry/switch.ts +205 -205
  136. package/registry/tabs.ts +426 -426
  137. package/registry/text-area.ts +186 -186
  138. package/registry/toast.ts +965 -0
  139. package/registry/toggle-group.ts +295 -295
  140. package/registry/tooltip.ts +156 -156
  141. package/registry/treemap.ts +847 -0
  142. package/skills/theming-vela-ui/SKILL.md +137 -137
  143. package/skills/using-vela-ui-components/SKILL.md +139 -137
  144. package/skills/writing-vela-ui-components/SKILL.md +163 -163
  145. package/src/components/badge.ts +119 -119
  146. package/src/components/bar-chart.ts +215 -215
  147. package/src/components/button.ts +387 -379
  148. package/src/components/callout-bubble.ts +347 -347
  149. package/src/components/card.ts +379 -0
  150. package/src/components/checkbox.ts +234 -234
  151. package/src/components/collapsible.ts +271 -271
  152. package/src/components/color-picker.ts +582 -582
  153. package/src/components/context-menu.ts +208 -208
  154. package/src/components/data-table.ts +215 -215
  155. package/src/components/date-picker.ts +483 -483
  156. package/src/components/dialog.ts +551 -535
  157. package/src/components/donut.ts +145 -145
  158. package/src/components/drawer.ts +636 -636
  159. package/src/components/dropdown-menu.ts +762 -762
  160. package/src/components/empty.ts +91 -91
  161. package/src/components/field.ts +584 -584
  162. package/src/components/{stat.ts → figure.ts} +96 -96
  163. package/src/components/glyph-select.ts +268 -268
  164. package/src/components/hover-card.ts +222 -222
  165. package/src/components/input-group.ts +229 -229
  166. package/src/components/input.ts +181 -181
  167. package/src/components/item.ts +376 -376
  168. package/src/components/kbd.ts +64 -64
  169. package/src/components/line-chart.ts +218 -218
  170. package/src/components/month-grid.ts +328 -328
  171. package/src/components/number-input.ts +443 -443
  172. package/src/components/popover.ts +368 -368
  173. package/src/components/scatter-chart.ts +221 -221
  174. package/src/components/select.ts +620 -620
  175. package/src/components/slider.ts +259 -259
  176. package/src/components/sort-button.ts +189 -189
  177. package/src/components/sparkline.ts +114 -114
  178. package/src/components/switch.ts +205 -205
  179. package/src/components/tabs.ts +426 -426
  180. package/src/components/text-area.ts +186 -186
  181. package/src/components/toast.ts +965 -0
  182. package/src/components/toggle-group.ts +295 -295
  183. package/src/components/tooltip.ts +156 -156
  184. package/src/components/treemap.ts +847 -0
  185. package/src/index.ts +24 -24
  186. package/src/lib/calendar.ts +117 -117
  187. package/src/lib/chart.ts +72 -72
  188. package/src/lib/color.ts +89 -89
  189. package/src/lib/component-index.ts +163 -151
  190. package/src/lib/css.ts +48 -48
  191. package/src/lib/define.ts +45 -45
  192. package/src/lib/dispose.ts +36 -36
  193. package/src/lib/h.ts +55 -55
  194. package/src/lib/headless.ts +16 -16
  195. package/src/lib/i18n.ts +30 -30
  196. package/src/lib/icons.ts +244 -237
  197. package/src/lib/kit-text.ts +26 -26
  198. package/src/lib/page.ts +24 -24
  199. package/src/lib/palette.ts +81 -81
  200. package/src/lib/placement.ts +188 -188
  201. package/src/lib/scope.ts +135 -135
  202. package/src/lib/styles.ts +53 -53
  203. package/src/lib/surface-events.ts +31 -31
  204. package/src/lib/surface-exit.ts +87 -87
  205. package/src/lib/t.ts +68 -68
  206. package/src/lib/theme.ts +684 -664
  207. package/src/lib/tokens.ts +110 -110
  208. package/src/lib/variants.ts +32 -32
  209. package/src/lib/zag.ts +61 -46
  210. package/stylelint/index.mjs +60 -60
  211. package/stylelint/lint.mjs +81 -81
  212. package/stylelint/plugin.mjs +115 -115
  213. package/dist/chunk-P4MTEMT7.js +0 -23
  214. package/dist/stat.js +0 -41
  215. package/dist/{chunk-U3EH42YY.js → chunk-5BJV5FY5.js} +1 -1
  216. package/dist/{chunk-E2FE6V2N.js → chunk-ALAHGSLC.js} +1 -1
  217. package/dist/{chunk-C3ICYMI3.js → chunk-FYVQO5TN.js} +1 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@luxalgo/vela-ui",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "tokens": [
5
5
  "space-1",
6
6
  "space-2",
@@ -598,6 +598,171 @@
598
598
  ],
599
599
  "example": "import { createCalloutBubble } from '@luxalgo/vela-ui/callout-bubble';\n\nconst calloutBubble = createCalloutBubble({ icon: /* string */, background: /* string */, label: /* string */ });\nhost.append(calloutBubble.el);"
600
600
  },
601
+ {
602
+ "name": "card",
603
+ "import": "@luxalgo/vela-ui/card",
604
+ "description": "Card: a surface for one subject (a panel of figures, a chart, a summary): a header with an eyebrow over the title and a description under it, an action at its end (buttons, a toggle group), then the content and a footer past a line. `default` is a bordered surface, `inset` a sunken tile for figures inside another card; `sm` is tighter. The title is a heading, so a screen reader can move from card to card. With `onSelect` the whole card is clickable while a press on a control inside it stays that control's: to the keyboard and screen readers its title is the button (the card itself when it has no title), as a card often holds buttons of its own and a button cannot hold other buttons.",
605
+ "component": "card",
606
+ "declaration": "cardDef",
607
+ "parts": {
608
+ "root": "card",
609
+ "header": "card-header",
610
+ "heading": "card-heading",
611
+ "eyebrow": "card-eyebrow",
612
+ "title": "card-title",
613
+ "trigger": "card-trigger",
614
+ "description": "card-description",
615
+ "action": "card-action",
616
+ "content": "card-content",
617
+ "footer": "card-footer"
618
+ },
619
+ "settings": {
620
+ "radius": {
621
+ "default": "var(--vela-radius-lg)",
622
+ "token": "radius-lg"
623
+ },
624
+ "padding": {
625
+ "default": "16px"
626
+ },
627
+ "padding-sm": {
628
+ "default": "10px 12px"
629
+ },
630
+ "gap": {
631
+ "default": "12px"
632
+ },
633
+ "gap-sm": {
634
+ "default": "8px"
635
+ },
636
+ "background": {
637
+ "default": "var(--vela-surface)",
638
+ "token": "surface"
639
+ },
640
+ "border": {
641
+ "default": "var(--vela-border)",
642
+ "token": "border"
643
+ },
644
+ "inset-background": {
645
+ "default": "`color-mix(in srgb, ${t.fg.bright} 2.5%, ${t.surface})`"
646
+ }
647
+ },
648
+ "variants": {
649
+ "variant": [
650
+ "default",
651
+ "inset"
652
+ ],
653
+ "size": [
654
+ "default",
655
+ "sm"
656
+ ]
657
+ },
658
+ "factory": "createCard",
659
+ "returns": "CardHandle",
660
+ "propsType": "CardProps",
661
+ "props": [
662
+ {
663
+ "name": "eyebrow",
664
+ "type": "string | Node",
665
+ "required": false,
666
+ "doc": "Small capitals over the title: what kind of card it is (\"Market pulse\")."
667
+ },
668
+ {
669
+ "name": "title",
670
+ "type": "string | Node",
671
+ "required": false,
672
+ "doc": "The heading: text, or an element (a name with a badge after it)."
673
+ },
674
+ {
675
+ "name": "description",
676
+ "type": "string | Node",
677
+ "required": false,
678
+ "doc": "The muted line under the title."
679
+ },
680
+ {
681
+ "name": "action",
682
+ "type": "string | number | false | Node | readonly Child[]",
683
+ "required": false,
684
+ "doc": "At the header's end: its buttons, a toggle group."
685
+ },
686
+ {
687
+ "name": "content",
688
+ "type": "string | number | false | Node | readonly Child[]",
689
+ "required": false,
690
+ "doc": "The body. More can be appended to the handle's `content` later."
691
+ },
692
+ {
693
+ "name": "footer",
694
+ "type": "string | number | false | Node | readonly Child[]",
695
+ "required": false,
696
+ "doc": "Under the body, past a line: notes, a source, a time."
697
+ },
698
+ {
699
+ "name": "headingLevel",
700
+ "type": "6 | 2 | 3 | 4 | 5",
701
+ "required": false,
702
+ "doc": "The title's heading level (default 3)."
703
+ },
704
+ {
705
+ "name": "selected",
706
+ "type": "boolean",
707
+ "required": false,
708
+ "doc": "The current card (the one a detail view shows)."
709
+ },
710
+ {
711
+ "name": "disabled",
712
+ "type": "boolean",
713
+ "required": false
714
+ },
715
+ {
716
+ "name": "onSelect",
717
+ "type": "(e: MouseEvent | KeyboardEvent) => void",
718
+ "required": false,
719
+ "doc": "Makes the card clickable: a click on it, or Enter or Space on its title, runs it."
720
+ },
721
+ {
722
+ "name": "className",
723
+ "type": "string",
724
+ "required": false,
725
+ "doc": "Extra class names (layout hooks)."
726
+ },
727
+ {
728
+ "name": "variant",
729
+ "type": "\"default\" | \"inset\"",
730
+ "required": false
731
+ },
732
+ {
733
+ "name": "size",
734
+ "type": "\"default\" | \"sm\"",
735
+ "required": false
736
+ }
737
+ ],
738
+ "exports": [
739
+ "cardDef",
740
+ "cardVariants",
741
+ "CardVariant",
742
+ "CardSize",
743
+ "CardProps",
744
+ "CardHandle",
745
+ "createCard"
746
+ ],
747
+ "tokens": [
748
+ "border",
749
+ "border-strong",
750
+ "dur-fast",
751
+ "fg",
752
+ "fg-bright",
753
+ "fg-muted",
754
+ "focus",
755
+ "radius-lg",
756
+ "radius-sm",
757
+ "surface"
758
+ ],
759
+ "attributes": [
760
+ "data-clickable",
761
+ "data-disabled",
762
+ "data-selected"
763
+ ],
764
+ "example": "import { createCard } from '@luxalgo/vela-ui/card';\n\nconst card = createCard();\nhost.append(card.el);"
765
+ },
601
766
  {
602
767
  "name": "checkbox",
603
768
  "import": "@luxalgo/vela-ui/checkbox",
@@ -1357,6 +1522,12 @@
1357
1522
  "required": false,
1358
1523
  "doc": "Close when the backdrop itself is pressed (not when a portaled popover is)."
1359
1524
  },
1525
+ {
1526
+ "name": "i18n",
1527
+ "type": "Translator",
1528
+ "required": false,
1529
+ "doc": "The translator of the close button's name (\"Close\"). Default: the kit build's, else English."
1530
+ },
1360
1531
  {
1361
1532
  "name": "modal",
1362
1533
  "type": "boolean",
@@ -1930,6 +2101,79 @@
1930
2101
  "data-mobile"
1931
2102
  ]
1932
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
+ },
1933
2177
  {
1934
2178
  "name": "glyph-select",
1935
2179
  "import": "@luxalgo/vela-ui/glyph-select",
@@ -3789,79 +4033,6 @@
3789
4033
  ],
3790
4034
  "example": "import { createSparkline } from '@luxalgo/vela-ui/sparkline';\n\nconst sparkline = createSparkline({ values: /* readonly number[] */ });\nhost.append(sparkline.el);"
3791
4035
  },
3792
- {
3793
- "name": "stat",
3794
- "import": "@luxalgo/vela-ui/stat",
3795
- "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.",
3796
- "component": "stat",
3797
- "declaration": "statDef",
3798
- "parts": {
3799
- "root": "stat",
3800
- "label": "stat-label",
3801
- "value": "stat-value",
3802
- "sub": "stat-sub"
3803
- },
3804
- "settings": {},
3805
- "variants": {
3806
- "tone": [
3807
- "neutral",
3808
- "profit",
3809
- "loss"
3810
- ]
3811
- },
3812
- "factory": "createStat",
3813
- "returns": "StatHandle",
3814
- "propsType": "StatProps",
3815
- "props": [
3816
- {
3817
- "name": "label",
3818
- "type": "string",
3819
- "required": true
3820
- },
3821
- {
3822
- "name": "value",
3823
- "type": "string",
3824
- "required": false,
3825
- "doc": "The figure (default `—`)."
3826
- },
3827
- {
3828
- "name": "sub",
3829
- "type": "string",
3830
- "required": false,
3831
- "doc": "A line under the figure (a count, a percentage)."
3832
- },
3833
- {
3834
- "name": "className",
3835
- "type": "string",
3836
- "required": false,
3837
- "doc": "Extra class names (layout hooks)."
3838
- },
3839
- {
3840
- "name": "tone",
3841
- "type": "\"neutral\" | \"profit\" | \"loss\"",
3842
- "required": false
3843
- }
3844
- ],
3845
- "exports": [
3846
- "statDef",
3847
- "statVariants",
3848
- "StatTone",
3849
- "StatProps",
3850
- "StatHandle",
3851
- "toneOf",
3852
- "createStat"
3853
- ],
3854
- "tokens": [
3855
- "fg-bright",
3856
- "fg-muted",
3857
- "loss",
3858
- "profit"
3859
- ],
3860
- "attributes": [
3861
- "data-tone"
3862
- ],
3863
- "example": "import { createStat } from '@luxalgo/vela-ui/stat';\n\nconst stat = createStat({ label: /* string */ });\nhost.append(stat.el);"
3864
- },
3865
4036
  {
3866
4037
  "name": "switch",
3867
4038
  "import": "@luxalgo/vela-ui/switch",
@@ -4246,6 +4417,256 @@
4246
4417
  ],
4247
4418
  "example": "import { createTextArea } from '@luxalgo/vela-ui/text-area';\n\nconst textArea = createTextArea();\nhost.append(textArea.el);"
4248
4419
  },
4420
+ {
4421
+ "name": "toast",
4422
+ "import": "@luxalgo/vela-ui/toast",
4423
+ "description": "Toast: short notices that stack in a corner and leave on their own, shaped after shadcn's toast (Sonner). `toast()` raises one from anywhere on the page, with `toast.success`, `.info`, `.warning`, `.error` and `.loading` for its kinds, `toast.promise` for a task's three states and `toast.dismiss` to take one or all away; calling it again with the same `id` updates the toast in place. A toaster shows them: `createToaster` mounts one where the notices belong, over the viewport or contained in a host. The newest toast is in front and the older ones fold behind it; hovering the stack (or Alt+T) spreads it out and pauses the timers, and a toast swipes away towards its edge. Positions name the corner on the writing direction's terms: `bottom-right` sits at the end side, mirrored right to left. The queue is page-wide, so a toast raised by another copy of the kit reaches this toaster.",
4424
+ "component": "toast",
4425
+ "declaration": "toastDef",
4426
+ "parts": {
4427
+ "root": "toast",
4428
+ "list": "toast-list",
4429
+ "item": "toast-item",
4430
+ "close": "toast-close",
4431
+ "icon": "toast-icon",
4432
+ "content": "toast-content",
4433
+ "title": "toast-title",
4434
+ "description": "toast-description",
4435
+ "cancel": "toast-cancel",
4436
+ "action": "toast-action"
4437
+ },
4438
+ "settings": {
4439
+ "width": {
4440
+ "default": "356px"
4441
+ },
4442
+ "radius": {
4443
+ "default": "var(--vela-radius-lg)",
4444
+ "token": "radius-lg"
4445
+ },
4446
+ "background": {
4447
+ "default": "var(--vela-surface-elev)",
4448
+ "token": "surface-elev"
4449
+ },
4450
+ "border": {
4451
+ "default": "var(--vela-border)",
4452
+ "token": "border"
4453
+ },
4454
+ "foreground": {
4455
+ "default": "var(--vela-fg-bright)",
4456
+ "token": "fg-bright"
4457
+ },
4458
+ "description-color": {
4459
+ "default": "var(--vela-fg-muted)",
4460
+ "token": "fg-muted"
4461
+ },
4462
+ "shadow": {
4463
+ "default": "var(--vela-shadow)",
4464
+ "token": "shadow"
4465
+ },
4466
+ "success": {
4467
+ "default": "var(--vela-profit)",
4468
+ "token": "profit"
4469
+ },
4470
+ "info": {
4471
+ "default": "var(--vela-accent)",
4472
+ "token": "accent"
4473
+ },
4474
+ "warning": {
4475
+ "default": "var(--vela-highlight)",
4476
+ "token": "highlight"
4477
+ },
4478
+ "error": {
4479
+ "default": "var(--vela-danger)",
4480
+ "token": "danger"
4481
+ }
4482
+ },
4483
+ "factory": "createToaster",
4484
+ "returns": "ToasterHandle",
4485
+ "propsType": "ToasterProps",
4486
+ "props": [
4487
+ {
4488
+ "name": "host",
4489
+ "type": "HTMLElement",
4490
+ "required": false,
4491
+ "doc": "Where the toaster mounts (default the document's body)."
4492
+ },
4493
+ {
4494
+ "name": "contained",
4495
+ "type": "boolean",
4496
+ "required": false,
4497
+ "doc": "Stack in the host's corners instead of the viewport's; the host must be positioned."
4498
+ },
4499
+ {
4500
+ "name": "position",
4501
+ "type": "ToasterPosition",
4502
+ "required": false,
4503
+ "doc": "The corner the toasts stack in (default `bottom-right`)."
4504
+ },
4505
+ {
4506
+ "name": "expand",
4507
+ "type": "boolean",
4508
+ "required": false,
4509
+ "doc": "Keep the stack spread out instead of folding the older toasts behind the newest."
4510
+ },
4511
+ {
4512
+ "name": "richColors",
4513
+ "type": "boolean",
4514
+ "required": false,
4515
+ "doc": "Tint each toast with its kind's color."
4516
+ },
4517
+ {
4518
+ "name": "closeButton",
4519
+ "type": "boolean",
4520
+ "required": false,
4521
+ "doc": "A close button on every toast."
4522
+ },
4523
+ {
4524
+ "name": "invert",
4525
+ "type": "boolean",
4526
+ "required": false,
4527
+ "doc": "Swap the toasts' background and text colors."
4528
+ },
4529
+ {
4530
+ "name": "duration",
4531
+ "type": "number",
4532
+ "required": false,
4533
+ "doc": "How long a toast stays, in milliseconds (default 4000)."
4534
+ },
4535
+ {
4536
+ "name": "gap",
4537
+ "type": "number",
4538
+ "required": false,
4539
+ "doc": "Space between spread toasts, in pixels (default 14)."
4540
+ },
4541
+ {
4542
+ "name": "visibleToasts",
4543
+ "type": "number",
4544
+ "required": false,
4545
+ "doc": "How many toasts show at once (default 3)."
4546
+ },
4547
+ {
4548
+ "name": "offset",
4549
+ "type": "ToastOffset",
4550
+ "required": false,
4551
+ "doc": "Distance from the edges: one value, or one per side (default 24px, 16px contained)."
4552
+ },
4553
+ {
4554
+ "name": "hotkey",
4555
+ "type": "string[]",
4556
+ "required": false,
4557
+ "doc": "The keys that spread the stack and focus it: event flags and codes (default `['altKey', 'KeyT']`)."
4558
+ },
4559
+ {
4560
+ "name": "dir",
4561
+ "type": "\"ltr\" | \"rtl\" | \"auto\"",
4562
+ "required": false,
4563
+ "doc": "The writing direction of the toasts (default the page's)."
4564
+ },
4565
+ {
4566
+ "name": "swipeDirections",
4567
+ "type": "SwipeDirection[]",
4568
+ "required": false,
4569
+ "doc": "Swipe directions that close a toast (default its corner's edges)."
4570
+ },
4571
+ {
4572
+ "name": "icons",
4573
+ "type": "Partial<Record<\"success\" | \"info\" | \"warning\" | \"error\" | \"loading\" | \"close\", string | Node>>",
4574
+ "required": false,
4575
+ "doc": "Icons in place of the kinds' own: registry ids or elements."
4576
+ },
4577
+ {
4578
+ "name": "toastOptions",
4579
+ "type": "Pick<ExternalToast, \"className\" | \"duration\" | \"closeButton\" | \"richColors\" | \"invert\" | \"dismissible\">",
4580
+ "required": false,
4581
+ "doc": "Defaults for every toast of this toaster."
4582
+ },
4583
+ {
4584
+ "name": "containerAriaLabel",
4585
+ "type": "string",
4586
+ "required": false,
4587
+ "doc": "The region's accessible name (default \"Notifications\")."
4588
+ },
4589
+ {
4590
+ "name": "id",
4591
+ "type": "string",
4592
+ "required": false,
4593
+ "doc": "Name the toaster, to show only the toasts raised with this `toasterId`."
4594
+ },
4595
+ {
4596
+ "name": "theme",
4597
+ "type": "UiTheme | ThemedChart",
4598
+ "required": false,
4599
+ "doc": "A kit theme, for a toaster mounted outside a themed host."
4600
+ },
4601
+ {
4602
+ "name": "i18n",
4603
+ "type": "Translator",
4604
+ "required": false,
4605
+ "doc": "Translates the close button's and the region's names (default the kit's)."
4606
+ },
4607
+ {
4608
+ "name": "className",
4609
+ "type": "string",
4610
+ "required": false,
4611
+ "doc": "Extra class names on the region (layout hooks)."
4612
+ }
4613
+ ],
4614
+ "exports": [
4615
+ "toastDef",
4616
+ "ToastType",
4617
+ "ToasterPosition",
4618
+ "SwipeDirection",
4619
+ "ToastId",
4620
+ "ToastContent",
4621
+ "ToastAction",
4622
+ "ExternalToast",
4623
+ "ToastT",
4624
+ "PromiseSource",
4625
+ "PromiseData",
4626
+ "ToastPromise",
4627
+ "ToastFunction",
4628
+ "toast",
4629
+ "ToastOffset",
4630
+ "ToasterProps",
4631
+ "ToasterHandle",
4632
+ "createToaster"
4633
+ ],
4634
+ "tokens": [
4635
+ "accent",
4636
+ "border",
4637
+ "danger",
4638
+ "dur-fast",
4639
+ "dur-med",
4640
+ "ease",
4641
+ "fg-bright",
4642
+ "fg-muted",
4643
+ "focus",
4644
+ "font",
4645
+ "highlight",
4646
+ "profit",
4647
+ "radius-lg",
4648
+ "radius-sm",
4649
+ "shadow",
4650
+ "surface-elev",
4651
+ "surface-overlay",
4652
+ "z-popover"
4653
+ ],
4654
+ "attributes": [
4655
+ "data-contained",
4656
+ "data-expanded",
4657
+ "data-front",
4658
+ "data-invert",
4659
+ "data-mounted",
4660
+ "data-removed",
4661
+ "data-rich-colors",
4662
+ "data-swiping",
4663
+ "data-type",
4664
+ "data-visible",
4665
+ "data-x",
4666
+ "data-y"
4667
+ ],
4668
+ "example": "import { createToaster } from '@luxalgo/vela-ui/toast';\n\nconst toast = createToaster();\nhost.append(toast.el);"
4669
+ },
4249
4670
  {
4250
4671
  "name": "toggle-group",
4251
4672
  "import": "@luxalgo/vela-ui/toggle-group",
@@ -4503,6 +4924,202 @@
4503
4924
  "data-state"
4504
4925
  ],
4505
4926
  "example": "import { createTooltip } from '@luxalgo/vela-ui/tooltip';\n\nconst tooltip = createTooltip({ trigger: /* HTMLElement */, content: /* string | Node | (() => Node) */ });\nhost.append(tooltip.el);"
4927
+ },
4928
+ {
4929
+ "name": "treemap",
4930
+ "import": "@luxalgo/vela-ui/treemap",
4931
+ "description": "Treemap: weighted items laid into a rectangle as tiles close to square, each tinted by its value on a diverging scale (up above zero, down below, stronger as the value grows) and labeled when it has room. Items with children are groups: their tiles share a block headed by the group's name and a figure of its values. With `drill`, a group's header zooms into it and a breadcrumb leads back. Values repaint without a new layout, and a tile keeps its element across layouts, so a resize or a zoom moves it instead of redrawing it.",
4932
+ "component": "treemap",
4933
+ "declaration": "treemapDef",
4934
+ "parts": {
4935
+ "root": "treemap",
4936
+ "crumbs": "treemap-crumbs",
4937
+ "crumb": "treemap-crumb",
4938
+ "map": "treemap-map",
4939
+ "group": "treemap-group",
4940
+ "group-name": "treemap-group-name",
4941
+ "group-value": "treemap-group-value",
4942
+ "tile": "treemap-tile",
4943
+ "tile-label": "treemap-tile-label",
4944
+ "tile-value": "treemap-tile-value",
4945
+ "legend": "treemap-legend",
4946
+ "legend-bar": "treemap-legend-bar",
4947
+ "tip": "treemap-tip"
4948
+ },
4949
+ "settings": {
4950
+ "radius": {
4951
+ "default": "var(--vela-radius-sm)",
4952
+ "token": "radius-sm"
4953
+ },
4954
+ "up": {
4955
+ "default": "var(--vela-up)",
4956
+ "token": "up"
4957
+ },
4958
+ "down": {
4959
+ "default": "var(--vela-down)",
4960
+ "token": "down"
4961
+ },
4962
+ "tile-bg": {
4963
+ "default": "`color-mix(in srgb, ${t.fg.bright} 2.5%, ${t.surface})`"
4964
+ },
4965
+ "tint-min": {
4966
+ "default": "3%"
4967
+ },
4968
+ "tint-max": {
4969
+ "default": "25%"
4970
+ },
4971
+ "hover-z": {
4972
+ "default": "1"
4973
+ },
4974
+ "tip-radius": {
4975
+ "default": "var(--vela-radius-md)",
4976
+ "token": "radius-md"
4977
+ },
4978
+ "tip-bg": {
4979
+ "default": "var(--vela-surface-elev)",
4980
+ "token": "surface-elev"
4981
+ },
4982
+ "tip-shadow": {
4983
+ "default": "var(--vela-shadow)",
4984
+ "token": "shadow"
4985
+ },
4986
+ "tip-z": {
4987
+ "default": "2"
4988
+ }
4989
+ },
4990
+ "factory": "createTreemap",
4991
+ "returns": "TreemapHandle",
4992
+ "propsType": "TreemapProps",
4993
+ "props": [
4994
+ {
4995
+ "name": "items",
4996
+ "type": "readonly TreemapItem[]",
4997
+ "required": false
4998
+ },
4999
+ {
5000
+ "name": "domain",
5001
+ "type": "number",
5002
+ "required": false,
5003
+ "doc": "The size of a value whose tint is full. Default: the largest one on the map."
5004
+ },
5005
+ {
5006
+ "name": "format",
5007
+ "type": "(value: number) => string",
5008
+ "required": false,
5009
+ "doc": "A value as the tiles, the headers, the readout and the legend write it. Default: signed, two decimals."
5010
+ },
5011
+ {
5012
+ "name": "groupValue",
5013
+ "type": "TreemapGroupValue",
5014
+ "required": false,
5015
+ "doc": "A group header's figure (default the median of its items' values)."
5016
+ },
5017
+ {
5018
+ "name": "tip",
5019
+ "type": "false | ((item: TreemapItem, path: readonly TreemapItem[]) => string | Node)",
5020
+ "required": false,
5021
+ "doc": "The readout beside a hovered or focused tile, or `false` for none. Default: its label, value and groups."
5022
+ },
5023
+ {
5024
+ "name": "onSelect",
5025
+ "type": "(item: TreemapItem, path: readonly TreemapItem[]) => void",
5026
+ "required": false,
5027
+ "doc": "A tile's click, Enter or Space. `path` lists its groups, outermost first."
5028
+ },
5029
+ {
5030
+ "name": "selected",
5031
+ "type": "string",
5032
+ "required": false,
5033
+ "doc": "The id of the tile drawn as selected."
5034
+ },
5035
+ {
5036
+ "name": "drill",
5037
+ "type": "boolean",
5038
+ "required": false,
5039
+ "doc": "Group headers zoom into their group, and a breadcrumb above the map leads back."
5040
+ },
5041
+ {
5042
+ "name": "onDrill",
5043
+ "type": "(path: readonly TreemapItem[]) => void",
5044
+ "required": false,
5045
+ "doc": "A zoom changed: `path` is the zoomed group's path (empty at the top)."
5046
+ },
5047
+ {
5048
+ "name": "rootLabel",
5049
+ "type": "string",
5050
+ "required": false,
5051
+ "doc": "The breadcrumb's first entry (default \"All\")."
5052
+ },
5053
+ {
5054
+ "name": "legend",
5055
+ "type": "boolean",
5056
+ "required": false,
5057
+ "doc": "A scale under the map, from the negative to the positive domain."
5058
+ },
5059
+ {
5060
+ "name": "gap",
5061
+ "type": "number",
5062
+ "required": false,
5063
+ "doc": "Space between tiles, in pixels (default 3)."
5064
+ },
5065
+ {
5066
+ "name": "label",
5067
+ "type": "string",
5068
+ "required": false,
5069
+ "doc": "The map's accessible name."
5070
+ },
5071
+ {
5072
+ "name": "i18n",
5073
+ "type": "Translator",
5074
+ "required": false,
5075
+ "doc": "The translator of the treemap's own words. Default: the kit build's, else English."
5076
+ },
5077
+ {
5078
+ "name": "className",
5079
+ "type": "string",
5080
+ "required": false,
5081
+ "doc": "Extra class names (layout hooks)."
5082
+ }
5083
+ ],
5084
+ "exports": [
5085
+ "treemapDef",
5086
+ "TreemapItem",
5087
+ "TreemapGroupValue",
5088
+ "TreemapProps",
5089
+ "TreemapHandle",
5090
+ "TreemapRect",
5091
+ "squarify",
5092
+ "createTreemap"
5093
+ ],
5094
+ "tokens": [
5095
+ "accent",
5096
+ "border",
5097
+ "down",
5098
+ "dur-fast",
5099
+ "dur-med",
5100
+ "ease",
5101
+ "fg",
5102
+ "fg-bright",
5103
+ "fg-faint",
5104
+ "fg-muted",
5105
+ "focus",
5106
+ "font-size-sm",
5107
+ "hover",
5108
+ "radius-md",
5109
+ "radius-sm",
5110
+ "shadow",
5111
+ "surface",
5112
+ "surface-elev",
5113
+ "up"
5114
+ ],
5115
+ "attributes": [
5116
+ "aria-current",
5117
+ "data-drill",
5118
+ "data-instant",
5119
+ "data-selected",
5120
+ "data-tone"
5121
+ ],
5122
+ "example": "import { createTreemap } from '@luxalgo/vela-ui/treemap';\n\nconst treemap = createTreemap();\nhost.append(treemap.el);"
4506
5123
  }
4507
5124
  ]
4508
5125
  }