@kanzo-tech/ui 0.0.1-alpha

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 (499) hide show
  1. package/README.md +60 -0
  2. package/dist/analytics.d.ts +36 -0
  3. package/dist/analytics.d.ts.map +1 -0
  4. package/dist/analytics.js +155 -0
  5. package/dist/analytics.js.map +1 -0
  6. package/dist/charts/arrow.d.ts +37 -0
  7. package/dist/charts/arrow.d.ts.map +1 -0
  8. package/dist/charts/arrow.js +29 -0
  9. package/dist/charts/arrow.js.map +1 -0
  10. package/dist/charts/chart-axes.d.ts +59 -0
  11. package/dist/charts/chart-axes.d.ts.map +1 -0
  12. package/dist/charts/chart-axes.js +39 -0
  13. package/dist/charts/chart-axes.js.map +1 -0
  14. package/dist/charts/chart-config.d.ts +52 -0
  15. package/dist/charts/chart-config.d.ts.map +1 -0
  16. package/dist/charts/chart-config.js +43 -0
  17. package/dist/charts/chart-config.js.map +1 -0
  18. package/dist/charts/chart-inputs.d.ts +174 -0
  19. package/dist/charts/chart-inputs.d.ts.map +1 -0
  20. package/dist/charts/chart-inputs.js +382 -0
  21. package/dist/charts/chart-inputs.js.map +1 -0
  22. package/dist/charts/chart-interactors.d.ts +75 -0
  23. package/dist/charts/chart-interactors.d.ts.map +1 -0
  24. package/dist/charts/chart-interactors.js +35 -0
  25. package/dist/charts/chart-interactors.js.map +1 -0
  26. package/dist/charts/chart-legend.d.ts +38 -0
  27. package/dist/charts/chart-legend.d.ts.map +1 -0
  28. package/dist/charts/chart-legend.js +49 -0
  29. package/dist/charts/chart-legend.js.map +1 -0
  30. package/dist/charts/chart-marks.d.ts +124 -0
  31. package/dist/charts/chart-marks.d.ts.map +1 -0
  32. package/dist/charts/chart-marks.js +109 -0
  33. package/dist/charts/chart-marks.js.map +1 -0
  34. package/dist/charts/chart-root.d.ts +90 -0
  35. package/dist/charts/chart-root.d.ts.map +1 -0
  36. package/dist/charts/chart-root.js +162 -0
  37. package/dist/charts/chart-root.js.map +1 -0
  38. package/dist/charts/chart-spec.d.ts +126 -0
  39. package/dist/charts/chart-spec.d.ts.map +1 -0
  40. package/dist/charts/chart-spec.js +133 -0
  41. package/dist/charts/chart-spec.js.map +1 -0
  42. package/dist/charts/chart-stat.d.ts +23 -0
  43. package/dist/charts/chart-stat.d.ts.map +1 -0
  44. package/dist/charts/chart-stat.js +24 -0
  45. package/dist/charts/chart-stat.js.map +1 -0
  46. package/dist/charts/id-set-client.d.ts +42 -0
  47. package/dist/charts/id-set-client.d.ts.map +1 -0
  48. package/dist/charts/id-set-client.js +43 -0
  49. package/dist/charts/id-set-client.js.map +1 -0
  50. package/dist/charts/mosaic-provider.d.ts +70 -0
  51. package/dist/charts/mosaic-provider.d.ts.map +1 -0
  52. package/dist/charts/mosaic-provider.js +53 -0
  53. package/dist/charts/mosaic-provider.js.map +1 -0
  54. package/dist/charts/query-client.d.ts +22 -0
  55. package/dist/charts/query-client.d.ts.map +1 -0
  56. package/dist/charts/query-client.js +26 -0
  57. package/dist/charts/query-client.js.map +1 -0
  58. package/dist/charts/tokenized-plot.d.ts +26 -0
  59. package/dist/charts/tokenized-plot.d.ts.map +1 -0
  60. package/dist/charts/tokenized-plot.js +41 -0
  61. package/dist/charts/tokenized-plot.js.map +1 -0
  62. package/dist/charts/use-chart-query.d.ts +30 -0
  63. package/dist/charts/use-chart-query.d.ts.map +1 -0
  64. package/dist/charts/use-chart-query.js +19 -0
  65. package/dist/charts/use-chart-query.js.map +1 -0
  66. package/dist/composites/CodeEditor.d.ts +64 -0
  67. package/dist/composites/CodeEditor.d.ts.map +1 -0
  68. package/dist/composites/CodeEditor.js +521 -0
  69. package/dist/composites/CodeEditor.js.map +1 -0
  70. package/dist/composites/MadeWith.d.ts +39 -0
  71. package/dist/composites/MadeWith.d.ts.map +1 -0
  72. package/dist/composites/MadeWith.js +30 -0
  73. package/dist/composites/MadeWith.js.map +1 -0
  74. package/dist/composites/Preferences.d.ts +155 -0
  75. package/dist/composites/Preferences.d.ts.map +1 -0
  76. package/dist/composites/Preferences.js +501 -0
  77. package/dist/composites/Preferences.js.map +1 -0
  78. package/dist/composites/Questionnaire.d.ts +215 -0
  79. package/dist/composites/Questionnaire.d.ts.map +1 -0
  80. package/dist/composites/Questionnaire.js +422 -0
  81. package/dist/composites/Questionnaire.js.map +1 -0
  82. package/dist/composites/SidebarIdentity.d.ts +63 -0
  83. package/dist/composites/SidebarIdentity.d.ts.map +1 -0
  84. package/dist/composites/SidebarIdentity.js +103 -0
  85. package/dist/composites/SidebarIdentity.js.map +1 -0
  86. package/dist/composites/code-editor-search.d.ts +40 -0
  87. package/dist/composites/code-editor-search.d.ts.map +1 -0
  88. package/dist/composites/code-editor-search.js +212 -0
  89. package/dist/composites/code-editor-search.js.map +1 -0
  90. package/dist/composites/sidebar.d.ts +129 -0
  91. package/dist/composites/sidebar.d.ts.map +1 -0
  92. package/dist/composites/sidebar.js +671 -0
  93. package/dist/composites/sidebar.js.map +1 -0
  94. package/dist/composites/theme-notice.d.ts +54 -0
  95. package/dist/composites/theme-notice.d.ts.map +1 -0
  96. package/dist/composites/theme-notice.js +19 -0
  97. package/dist/composites/theme-notice.js.map +1 -0
  98. package/dist/editor.d.ts +3 -0
  99. package/dist/editor.d.ts.map +1 -0
  100. package/dist/editor.js +6 -0
  101. package/dist/editor.js.map +1 -0
  102. package/dist/guard-corpus.d.ts +63 -0
  103. package/dist/guard-corpus.d.ts.map +1 -0
  104. package/dist/index.d.ts +112 -0
  105. package/dist/index.d.ts.map +1 -0
  106. package/dist/index.js +696 -0
  107. package/dist/index.js.map +1 -0
  108. package/dist/layouts/section.d.ts +166 -0
  109. package/dist/layouts/section.d.ts.map +1 -0
  110. package/dist/layouts/section.js +153 -0
  111. package/dist/layouts/section.js.map +1 -0
  112. package/dist/layouts/shell.d.ts +128 -0
  113. package/dist/layouts/shell.d.ts.map +1 -0
  114. package/dist/layouts/shell.js +107 -0
  115. package/dist/layouts/shell.js.map +1 -0
  116. package/dist/lib/cn.d.ts +4 -0
  117. package/dist/lib/cn.d.ts.map +1 -0
  118. package/dist/lib/cn.js +9 -0
  119. package/dist/lib/cn.js.map +1 -0
  120. package/dist/lib/is-active-path.d.ts +13 -0
  121. package/dist/lib/is-active-path.d.ts.map +1 -0
  122. package/dist/lib/is-active-path.js +7 -0
  123. package/dist/lib/is-active-path.js.map +1 -0
  124. package/dist/lib/theme-tick.d.ts +37 -0
  125. package/dist/lib/theme-tick.d.ts.map +1 -0
  126. package/dist/lib/theme-tick.js +30 -0
  127. package/dist/lib/theme-tick.js.map +1 -0
  128. package/dist/lib/token-color.d.ts +74 -0
  129. package/dist/lib/token-color.d.ts.map +1 -0
  130. package/dist/lib/token-color.js +35 -0
  131. package/dist/lib/token-color.js.map +1 -0
  132. package/dist/lib/use-is-mobile.d.ts +2 -0
  133. package/dist/lib/use-is-mobile.d.ts.map +1 -0
  134. package/dist/lib/use-is-mobile.js +17 -0
  135. package/dist/lib/use-is-mobile.js.map +1 -0
  136. package/dist/shark-parity.divergences.d.ts +104 -0
  137. package/dist/shark-parity.divergences.d.ts.map +1 -0
  138. package/dist/simples/FacetFilter.d.ts +57 -0
  139. package/dist/simples/FacetFilter.d.ts.map +1 -0
  140. package/dist/simples/FacetFilter.js +167 -0
  141. package/dist/simples/FacetFilter.js.map +1 -0
  142. package/dist/simples/FieldArray.d.ts +42 -0
  143. package/dist/simples/FieldArray.d.ts.map +1 -0
  144. package/dist/simples/FieldArray.js +76 -0
  145. package/dist/simples/FieldArray.js.map +1 -0
  146. package/dist/simples/Link.d.ts +38 -0
  147. package/dist/simples/Link.d.ts.map +1 -0
  148. package/dist/simples/Link.js +24 -0
  149. package/dist/simples/Link.js.map +1 -0
  150. package/dist/simples/accordion.d.ts +8 -0
  151. package/dist/simples/accordion.d.ts.map +1 -0
  152. package/dist/simples/accordion.js +78 -0
  153. package/dist/simples/accordion.js.map +1 -0
  154. package/dist/simples/action-bar.d.ts +101 -0
  155. package/dist/simples/action-bar.d.ts.map +1 -0
  156. package/dist/simples/action-bar.js +195 -0
  157. package/dist/simples/action-bar.js.map +1 -0
  158. package/dist/simples/alert-dialog.d.ts +24 -0
  159. package/dist/simples/alert-dialog.d.ts.map +1 -0
  160. package/dist/simples/alert-dialog.js +43 -0
  161. package/dist/simples/alert-dialog.js.map +1 -0
  162. package/dist/simples/alert.d.ts +36 -0
  163. package/dist/simples/alert.d.ts.map +1 -0
  164. package/dist/simples/alert.js +123 -0
  165. package/dist/simples/alert.js.map +1 -0
  166. package/dist/simples/avatar.d.ts +37 -0
  167. package/dist/simples/avatar.d.ts.map +1 -0
  168. package/dist/simples/avatar.js +133 -0
  169. package/dist/simples/avatar.js.map +1 -0
  170. package/dist/simples/badge.d.ts +66 -0
  171. package/dist/simples/badge.d.ts.map +1 -0
  172. package/dist/simples/badge.js +138 -0
  173. package/dist/simples/badge.js.map +1 -0
  174. package/dist/simples/breadcrumb.d.ts +19 -0
  175. package/dist/simples/breadcrumb.d.ts.map +1 -0
  176. package/dist/simples/breadcrumb.js +107 -0
  177. package/dist/simples/breadcrumb.js.map +1 -0
  178. package/dist/simples/button-group.d.ts +19 -0
  179. package/dist/simples/button-group.d.ts.map +1 -0
  180. package/dist/simples/button-group.js +69 -0
  181. package/dist/simples/button-group.js.map +1 -0
  182. package/dist/simples/button.d.ts +148 -0
  183. package/dist/simples/button.d.ts.map +1 -0
  184. package/dist/simples/button.js +157 -0
  185. package/dist/simples/button.js.map +1 -0
  186. package/dist/simples/calendar.d.ts +45 -0
  187. package/dist/simples/calendar.d.ts.map +1 -0
  188. package/dist/simples/calendar.js +342 -0
  189. package/dist/simples/calendar.js.map +1 -0
  190. package/dist/simples/card.d.ts +43 -0
  191. package/dist/simples/card.d.ts.map +1 -0
  192. package/dist/simples/card.js +151 -0
  193. package/dist/simples/card.js.map +1 -0
  194. package/dist/simples/checkbox.d.ts +25 -0
  195. package/dist/simples/checkbox.d.ts.map +1 -0
  196. package/dist/simples/checkbox.js +103 -0
  197. package/dist/simples/checkbox.js.map +1 -0
  198. package/dist/simples/client-only.d.ts +3 -0
  199. package/dist/simples/client-only.d.ts.map +1 -0
  200. package/dist/simples/client-only.js +7 -0
  201. package/dist/simples/client-only.js.map +1 -0
  202. package/dist/simples/clipboard.d.ts +11 -0
  203. package/dist/simples/clipboard.d.ts.map +1 -0
  204. package/dist/simples/clipboard.js +99 -0
  205. package/dist/simples/clipboard.js.map +1 -0
  206. package/dist/simples/collapsible.d.ts +8 -0
  207. package/dist/simples/collapsible.d.ts.map +1 -0
  208. package/dist/simples/collapsible.js +79 -0
  209. package/dist/simples/collapsible.js.map +1 -0
  210. package/dist/simples/color-picker.d.ts +62 -0
  211. package/dist/simples/color-picker.d.ts.map +1 -0
  212. package/dist/simples/color-picker.js +391 -0
  213. package/dist/simples/color-picker.js.map +1 -0
  214. package/dist/simples/combobox.d.ts +66 -0
  215. package/dist/simples/combobox.d.ts.map +1 -0
  216. package/dist/simples/combobox.js +230 -0
  217. package/dist/simples/combobox.js.map +1 -0
  218. package/dist/simples/command.d.ts +45 -0
  219. package/dist/simples/command.d.ts.map +1 -0
  220. package/dist/simples/command.js +180 -0
  221. package/dist/simples/command.js.map +1 -0
  222. package/dist/simples/data-list.d.ts +25 -0
  223. package/dist/simples/data-list.d.ts.map +1 -0
  224. package/dist/simples/data-list.js +62 -0
  225. package/dist/simples/data-list.js.map +1 -0
  226. package/dist/simples/date-picker.d.ts +16 -0
  227. package/dist/simples/date-picker.d.ts.map +1 -0
  228. package/dist/simples/date-picker.js +117 -0
  229. package/dist/simples/date-picker.js.map +1 -0
  230. package/dist/simples/diagnostic.d.ts +138 -0
  231. package/dist/simples/diagnostic.d.ts.map +1 -0
  232. package/dist/simples/diagnostic.js +288 -0
  233. package/dist/simples/diagnostic.js.map +1 -0
  234. package/dist/simples/dialog.d.ts +100 -0
  235. package/dist/simples/dialog.d.ts.map +1 -0
  236. package/dist/simples/dialog.js +267 -0
  237. package/dist/simples/dialog.js.map +1 -0
  238. package/dist/simples/download-trigger.d.ts +3 -0
  239. package/dist/simples/download-trigger.d.ts.map +1 -0
  240. package/dist/simples/download-trigger.js +7 -0
  241. package/dist/simples/download-trigger.js.map +1 -0
  242. package/dist/simples/editable.d.ts +23 -0
  243. package/dist/simples/editable.d.ts.map +1 -0
  244. package/dist/simples/editable.js +70 -0
  245. package/dist/simples/editable.js.map +1 -0
  246. package/dist/simples/field.d.ts +58 -0
  247. package/dist/simples/field.d.ts.map +1 -0
  248. package/dist/simples/field.js +285 -0
  249. package/dist/simples/field.js.map +1 -0
  250. package/dist/simples/file-upload.d.ts +19 -0
  251. package/dist/simples/file-upload.d.ts.map +1 -0
  252. package/dist/simples/file-upload.js +192 -0
  253. package/dist/simples/file-upload.js.map +1 -0
  254. package/dist/simples/float.d.ts +45 -0
  255. package/dist/simples/float.d.ts.map +1 -0
  256. package/dist/simples/float.js +40 -0
  257. package/dist/simples/float.js.map +1 -0
  258. package/dist/simples/floating-panel.d.ts +25 -0
  259. package/dist/simples/floating-panel.d.ts.map +1 -0
  260. package/dist/simples/floating-panel.js +95 -0
  261. package/dist/simples/floating-panel.js.map +1 -0
  262. package/dist/simples/highlight.d.ts +6 -0
  263. package/dist/simples/highlight.d.ts.map +1 -0
  264. package/dist/simples/highlight.js +24 -0
  265. package/dist/simples/highlight.js.map +1 -0
  266. package/dist/simples/hover-card.d.ts +11 -0
  267. package/dist/simples/hover-card.d.ts.map +1 -0
  268. package/dist/simples/hover-card.js +83 -0
  269. package/dist/simples/hover-card.js.map +1 -0
  270. package/dist/simples/image-cropper.d.ts +17 -0
  271. package/dist/simples/image-cropper.d.ts.map +1 -0
  272. package/dist/simples/image-cropper.js +139 -0
  273. package/dist/simples/image-cropper.js.map +1 -0
  274. package/dist/simples/input-group.d.ts +116 -0
  275. package/dist/simples/input-group.d.ts.map +1 -0
  276. package/dist/simples/input-group.js +245 -0
  277. package/dist/simples/input-group.js.map +1 -0
  278. package/dist/simples/input.d.ts +26 -0
  279. package/dist/simples/input.d.ts.map +1 -0
  280. package/dist/simples/input.js +60 -0
  281. package/dist/simples/input.js.map +1 -0
  282. package/dist/simples/item.d.ts +72 -0
  283. package/dist/simples/item.d.ts.map +1 -0
  284. package/dist/simples/item.js +180 -0
  285. package/dist/simples/item.js.map +1 -0
  286. package/dist/simples/json-tree-view.d.ts +7 -0
  287. package/dist/simples/json-tree-view.d.ts.map +1 -0
  288. package/dist/simples/json-tree-view.js +71 -0
  289. package/dist/simples/json-tree-view.js.map +1 -0
  290. package/dist/simples/kbd.d.ts +25 -0
  291. package/dist/simples/kbd.d.ts.map +1 -0
  292. package/dist/simples/kbd.js +50 -0
  293. package/dist/simples/kbd.js.map +1 -0
  294. package/dist/simples/listbox.d.ts +46 -0
  295. package/dist/simples/listbox.d.ts.map +1 -0
  296. package/dist/simples/listbox.js +218 -0
  297. package/dist/simples/listbox.js.map +1 -0
  298. package/dist/simples/menu.d.ts +60 -0
  299. package/dist/simples/menu.d.ts.map +1 -0
  300. package/dist/simples/menu.js +294 -0
  301. package/dist/simples/menu.js.map +1 -0
  302. package/dist/simples/native-select.d.ts +36 -0
  303. package/dist/simples/native-select.d.ts.map +1 -0
  304. package/dist/simples/native-select.js +77 -0
  305. package/dist/simples/native-select.js.map +1 -0
  306. package/dist/simples/number-input.d.ts +35 -0
  307. package/dist/simples/number-input.d.ts.map +1 -0
  308. package/dist/simples/number-input.js +142 -0
  309. package/dist/simples/number-input.js.map +1 -0
  310. package/dist/simples/pagination.d.ts +11 -0
  311. package/dist/simples/pagination.d.ts.map +1 -0
  312. package/dist/simples/pagination.js +78 -0
  313. package/dist/simples/pagination.js.map +1 -0
  314. package/dist/simples/password-input.d.ts +23 -0
  315. package/dist/simples/password-input.d.ts.map +1 -0
  316. package/dist/simples/password-input.js +90 -0
  317. package/dist/simples/password-input.js.map +1 -0
  318. package/dist/simples/pin-input.d.ts +30 -0
  319. package/dist/simples/pin-input.d.ts.map +1 -0
  320. package/dist/simples/pin-input.js +71 -0
  321. package/dist/simples/pin-input.js.map +1 -0
  322. package/dist/simples/popover.d.ts +42 -0
  323. package/dist/simples/popover.d.ts.map +1 -0
  324. package/dist/simples/popover.js +188 -0
  325. package/dist/simples/popover.js.map +1 -0
  326. package/dist/simples/progress.d.ts +23 -0
  327. package/dist/simples/progress.d.ts.map +1 -0
  328. package/dist/simples/progress.js +82 -0
  329. package/dist/simples/progress.js.map +1 -0
  330. package/dist/simples/prose.d.ts +17 -0
  331. package/dist/simples/prose.d.ts.map +1 -0
  332. package/dist/simples/prose.js +18 -0
  333. package/dist/simples/prose.js.map +1 -0
  334. package/dist/simples/radio-group.d.ts +23 -0
  335. package/dist/simples/radio-group.d.ts.map +1 -0
  336. package/dist/simples/radio-group.js +149 -0
  337. package/dist/simples/radio-group.js.map +1 -0
  338. package/dist/simples/rating.d.ts +10 -0
  339. package/dist/simples/rating.d.ts.map +1 -0
  340. package/dist/simples/rating.js +81 -0
  341. package/dist/simples/rating.js.map +1 -0
  342. package/dist/simples/resizable.d.ts +16 -0
  343. package/dist/simples/resizable.d.ts.map +1 -0
  344. package/dist/simples/resizable.js +57 -0
  345. package/dist/simples/resizable.js.map +1 -0
  346. package/dist/simples/scroll-area.d.ts +23 -0
  347. package/dist/simples/scroll-area.d.ts.map +1 -0
  348. package/dist/simples/scroll-area.js +88 -0
  349. package/dist/simples/scroll-area.js.map +1 -0
  350. package/dist/simples/segment-group.d.ts +27 -0
  351. package/dist/simples/segment-group.d.ts.map +1 -0
  352. package/dist/simples/segment-group.js +129 -0
  353. package/dist/simples/segment-group.js.map +1 -0
  354. package/dist/simples/select.d.ts +34 -0
  355. package/dist/simples/select.d.ts.map +1 -0
  356. package/dist/simples/select.js +258 -0
  357. package/dist/simples/select.js.map +1 -0
  358. package/dist/simples/separator.d.ts +12 -0
  359. package/dist/simples/separator.d.ts.map +1 -0
  360. package/dist/simples/separator.js +27 -0
  361. package/dist/simples/separator.js.map +1 -0
  362. package/dist/simples/sheet.d.ts +94 -0
  363. package/dist/simples/sheet.d.ts.map +1 -0
  364. package/dist/simples/sheet.js +172 -0
  365. package/dist/simples/sheet.js.map +1 -0
  366. package/dist/simples/show.d.ts +10 -0
  367. package/dist/simples/show.d.ts.map +1 -0
  368. package/dist/simples/show.js +9 -0
  369. package/dist/simples/show.js.map +1 -0
  370. package/dist/simples/skeleton.d.ts +3 -0
  371. package/dist/simples/skeleton.d.ts.map +1 -0
  372. package/dist/simples/skeleton.js +23 -0
  373. package/dist/simples/skeleton.js.map +1 -0
  374. package/dist/simples/skip-nav.d.ts +54 -0
  375. package/dist/simples/skip-nav.d.ts.map +1 -0
  376. package/dist/simples/skip-nav.js +42 -0
  377. package/dist/simples/skip-nav.js.map +1 -0
  378. package/dist/simples/slider.d.ts +29 -0
  379. package/dist/simples/slider.d.ts.map +1 -0
  380. package/dist/simples/slider.js +189 -0
  381. package/dist/simples/slider.js.map +1 -0
  382. package/dist/simples/spinner.d.ts +2 -0
  383. package/dist/simples/spinner.d.ts.map +1 -0
  384. package/dist/simples/spinner.js +20 -0
  385. package/dist/simples/spinner.js.map +1 -0
  386. package/dist/simples/stat-tile.d.ts +31 -0
  387. package/dist/simples/stat-tile.d.ts.map +1 -0
  388. package/dist/simples/stat-tile.js +64 -0
  389. package/dist/simples/stat-tile.js.map +1 -0
  390. package/dist/simples/status.d.ts +48 -0
  391. package/dist/simples/status.d.ts.map +1 -0
  392. package/dist/simples/status.js +57 -0
  393. package/dist/simples/status.js.map +1 -0
  394. package/dist/simples/steps.d.ts +20 -0
  395. package/dist/simples/steps.d.ts.map +1 -0
  396. package/dist/simples/steps.js +171 -0
  397. package/dist/simples/steps.js.map +1 -0
  398. package/dist/simples/suggestions.d.ts +43 -0
  399. package/dist/simples/suggestions.d.ts.map +1 -0
  400. package/dist/simples/suggestions.js +38 -0
  401. package/dist/simples/suggestions.js.map +1 -0
  402. package/dist/simples/swatch.d.ts +73 -0
  403. package/dist/simples/swatch.d.ts.map +1 -0
  404. package/dist/simples/swatch.js +35 -0
  405. package/dist/simples/swatch.js.map +1 -0
  406. package/dist/simples/switch.d.ts +5 -0
  407. package/dist/simples/switch.d.ts.map +1 -0
  408. package/dist/simples/switch.js +71 -0
  409. package/dist/simples/switch.js.map +1 -0
  410. package/dist/simples/table.d.ts +55 -0
  411. package/dist/simples/table.d.ts.map +1 -0
  412. package/dist/simples/table.js +166 -0
  413. package/dist/simples/table.js.map +1 -0
  414. package/dist/simples/tabs.d.ts +55 -0
  415. package/dist/simples/tabs.d.ts.map +1 -0
  416. package/dist/simples/tabs.js +133 -0
  417. package/dist/simples/tabs.js.map +1 -0
  418. package/dist/simples/tags-input.d.ts +64 -0
  419. package/dist/simples/tags-input.d.ts.map +1 -0
  420. package/dist/simples/tags-input.js +228 -0
  421. package/dist/simples/tags-input.js.map +1 -0
  422. package/dist/simples/textarea.d.ts +6 -0
  423. package/dist/simples/textarea.d.ts.map +1 -0
  424. package/dist/simples/textarea.js +34 -0
  425. package/dist/simples/textarea.js.map +1 -0
  426. package/dist/simples/toast.d.ts +20 -0
  427. package/dist/simples/toast.d.ts.map +1 -0
  428. package/dist/simples/toast.js +127 -0
  429. package/dist/simples/toast.js.map +1 -0
  430. package/dist/simples/toggle-group.d.ts +20 -0
  431. package/dist/simples/toggle-group.d.ts.map +1 -0
  432. package/dist/simples/toggle-group.js +82 -0
  433. package/dist/simples/toggle-group.js.map +1 -0
  434. package/dist/simples/toggle.d.ts +35 -0
  435. package/dist/simples/toggle.d.ts.map +1 -0
  436. package/dist/simples/toggle.js +57 -0
  437. package/dist/simples/toggle.js.map +1 -0
  438. package/dist/simples/tooltip.d.ts +8 -0
  439. package/dist/simples/tooltip.d.ts.map +1 -0
  440. package/dist/simples/tooltip.js +80 -0
  441. package/dist/simples/tooltip.js.map +1 -0
  442. package/dist/simples/tour.d.ts +81 -0
  443. package/dist/simples/tour.d.ts.map +1 -0
  444. package/dist/simples/tour.js +253 -0
  445. package/dist/simples/tour.js.map +1 -0
  446. package/dist/simples/tree-view.d.ts +64 -0
  447. package/dist/simples/tree-view.d.ts.map +1 -0
  448. package/dist/simples/tree-view.js +300 -0
  449. package/dist/simples/tree-view.js.map +1 -0
  450. package/dist/styles.css +2 -0
  451. package/dist/table/data-table-content.d.ts +18 -0
  452. package/dist/table/data-table-content.d.ts.map +1 -0
  453. package/dist/table/data-table-content.js +53 -0
  454. package/dist/table/data-table-content.js.map +1 -0
  455. package/dist/table/data-table-pagination.d.ts +8 -0
  456. package/dist/table/data-table-pagination.d.ts.map +1 -0
  457. package/dist/table/data-table-pagination.js +65 -0
  458. package/dist/table/data-table-pagination.js.map +1 -0
  459. package/dist/table/data-table-root.d.ts +10 -0
  460. package/dist/table/data-table-root.d.ts.map +1 -0
  461. package/dist/table/data-table-root.js +21 -0
  462. package/dist/table/data-table-root.js.map +1 -0
  463. package/dist/table/data-table-toolbar.d.ts +44 -0
  464. package/dist/table/data-table-toolbar.d.ts.map +1 -0
  465. package/dist/table/data-table-toolbar.js +87 -0
  466. package/dist/table/data-table-toolbar.js.map +1 -0
  467. package/dist/table/select-column.d.ts +16 -0
  468. package/dist/table/select-column.d.ts.map +1 -0
  469. package/dist/table/select-column.js +39 -0
  470. package/dist/table/select-column.js.map +1 -0
  471. package/dist/table/sortableHeader.d.ts +25 -0
  472. package/dist/table/sortableHeader.d.ts.map +1 -0
  473. package/dist/table/sortableHeader.js +43 -0
  474. package/dist/table/sortableHeader.js.map +1 -0
  475. package/dist/table/use-data-table.d.ts +40 -0
  476. package/dist/table/use-data-table.d.ts.map +1 -0
  477. package/dist/table/use-data-table.js +65 -0
  478. package/dist/table/use-data-table.js.map +1 -0
  479. package/dist/table.d.ts +15 -0
  480. package/dist/table.d.ts.map +1 -0
  481. package/dist/table.js +22 -0
  482. package/dist/table.js.map +1 -0
  483. package/dist/theme/KanzoTheme.d.ts +74 -0
  484. package/dist/theme/KanzoTheme.d.ts.map +1 -0
  485. package/dist/theme/KanzoTheme.js +61 -0
  486. package/dist/theme/KanzoTheme.js.map +1 -0
  487. package/dist/theme/KanzoThemeProvider.d.ts +144 -0
  488. package/dist/theme/KanzoThemeProvider.d.ts.map +1 -0
  489. package/dist/theme/KanzoThemeProvider.js +271 -0
  490. package/dist/theme/KanzoThemeProvider.js.map +1 -0
  491. package/dist/theme/theme-context.d.ts +146 -0
  492. package/dist/theme/theme-context.d.ts.map +1 -0
  493. package/dist/theme/theme-context.js +18 -0
  494. package/dist/theme/theme-context.js.map +1 -0
  495. package/dist/theme/theme-script.d.ts +17 -0
  496. package/dist/theme/theme-script.d.ts.map +1 -0
  497. package/dist/theme/theme-script.js +16 -0
  498. package/dist/theme/theme-script.js.map +1 -0
  499. package/package.json +201 -0
@@ -0,0 +1,75 @@
1
+ import { Selection } from '@uwdata/mosaic-core';
2
+ import { ChartDescriptor } from './chart-spec.js';
3
+ /**
4
+ * The interactor vocabulary. Inert descriptors, like the marks.
5
+ *
6
+ * vgplot binds an interactor to the **last mark added before it**, so order inside `ChartRoot` is
7
+ * semantic: put the interactor after the mark it should drive.
8
+ */
9
+ export interface ChartInteractorProps {
10
+ /** Where the interaction publishes. Defaults to `ChartRoot`'s `as` — the selection that root owns. */
11
+ as?: Selection | null;
12
+ /** Any other vgplot interactor option (`peers`, `brush`, `pixelSize`, `empty`…). */
13
+ [option: string]: unknown;
14
+ }
15
+ export declare const ChartIntervalX: ChartDescriptor<ChartInteractorProps>;
16
+ export declare const ChartIntervalY: ChartDescriptor<ChartInteractorProps>;
17
+ export declare const ChartIntervalXY: ChartDescriptor<ChartInteractorProps>;
18
+ export declare const ChartToggleX: ChartDescriptor<ChartInteractorProps>;
19
+ export declare const ChartToggleY: ChartDescriptor<ChartInteractorProps>;
20
+ export declare const ChartToggleColor: ChartDescriptor<ChartInteractorProps>;
21
+ export declare const ChartNearestX: ChartDescriptor<ChartInteractorProps>;
22
+ export declare const ChartNearestY: ChartDescriptor<ChartInteractorProps>;
23
+ export declare const ChartRegion: ChartDescriptor<ChartInteractorProps>;
24
+ export interface ChartHighlightProps {
25
+ /**
26
+ * The selection to highlight by — vgplot spells this `by`, not `as`. Defaults to `ChartRoot`'s
27
+ * own selection, which is the only value guaranteed to be safe; see below before overriding it.
28
+ */
29
+ by?: Selection | null;
30
+ /** The channels applied to the de-emphasised marks (`opacity`, `fill`, `stroke`…). */
31
+ [channel: string]: unknown;
32
+ }
33
+ /**
34
+ * Dims the marks outside `by` instead of publishing a selection — it reads, it does not write.
35
+ *
36
+ * **`by` is not a filter.** The highlight appends `by`'s predicate to the mark's own query as an
37
+ * extra output column, and on an aggregating mark that query has a `GROUP BY` — so a predicate
38
+ * naming a column the plot does not group by is a DuckDB binder error. Mosaic swallows it and the
39
+ * plot keeps its previous render, silently. Leaving `by` off is what keeps that impossible: the
40
+ * root's own selection can only hold clauses its own interactors published, over its own columns.
41
+ * `ChartRoot` warns in development when an explicit `by` gives that away.
42
+ */
43
+ export declare const ChartHighlight: ChartDescriptor<ChartHighlightProps>;
44
+ /**
45
+ * Clearer aliases for the two ways of selecting, because vgplot's own pair mixes criteria:
46
+ * `toggle` names the gesture, `interval` names the result. Both spellings work, and the vgplot names
47
+ * stay so anyone reading Mosaic's documentation lands on the same component.
48
+ *
49
+ * This block used to claim "the docs teach these". They did not — a measurement found zero mentions
50
+ * of any `Pick`/`Brush` name across every `.mdx`, while both spellings ran side by side in examples
51
+ * and one showcase, sometimes in the same file. The pairing is now a table under
52
+ * "Interactors" in `charts.mdx`. If you add an alias here, teach it there in the same commit.
53
+ *
54
+ * **Pick** is discrete: click a bar, get `region IN (…)`. Needs a categorical/band scale.
55
+ * **Brush** is continuous: drag the axis, get `latency BETWEEN lo AND hi`. Needs a scale with a
56
+ * "between" — brushing a band scale throws inside Mosaic, which `ChartRoot` warns about.
57
+ */
58
+ export declare const ChartPickX: ChartDescriptor<ChartInteractorProps>;
59
+ export declare const ChartPickY: ChartDescriptor<ChartInteractorProps>;
60
+ export declare const ChartPickColor: ChartDescriptor<ChartInteractorProps>;
61
+ export declare const ChartBrushX: ChartDescriptor<ChartInteractorProps>;
62
+ export declare const ChartBrushY: ChartDescriptor<ChartInteractorProps>;
63
+ export declare const ChartBrushXY: ChartDescriptor<ChartInteractorProps>;
64
+ export interface ChartPanZoomProps {
65
+ /** Restrict panning/zooming to an axis, or bind the resulting domain to a `Selection`/`Param`. */
66
+ x?: unknown;
67
+ y?: unknown;
68
+ zoom?: boolean;
69
+ panx?: boolean;
70
+ pany?: boolean;
71
+ [option: string]: unknown;
72
+ }
73
+ /** Pan and zoom the plot's scales. Carries no selection — it rewrites the domains in place. */
74
+ export declare const ChartPanZoom: ChartDescriptor<ChartPanZoomProps>;
75
+ //# sourceMappingURL=chart-interactors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart-interactors.d.ts","sourceRoot":"","sources":["../../src/charts/chart-interactors.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAmB,KAAK,eAAe,EAAiC,MAAM,iBAAiB,CAAC;AAEvG;;;;;GAKG;AAEH,MAAM,WAAW,oBAAoB;IACnC,sGAAsG;IACtG,EAAE,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACtB,oFAAoF;IACpF,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B;AASD,eAAO,MAAM,cAAc,uCAA4C,CAAC;AACxE,eAAO,MAAM,cAAc,uCAA4C,CAAC;AACxE,eAAO,MAAM,eAAe,uCAA8C,CAAC;AAC3E,eAAO,MAAM,YAAY,uCAAwC,CAAC;AAClE,eAAO,MAAM,YAAY,uCAAwC,CAAC;AAClE,eAAO,MAAM,gBAAgB,uCAAgD,CAAC;AAC9E,eAAO,MAAM,aAAa,uCAA0C,CAAC;AACrE,eAAO,MAAM,aAAa,uCAA0C,CAAC;AACrE,eAAO,MAAM,WAAW,uCAAsC,CAAC;AAE/D,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,EAAE,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACtB,sFAAsF;IACtF,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,sCAGzB,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU,uCAAe,CAAC;AACvC,eAAO,MAAM,UAAU,uCAAe,CAAC;AACvC,eAAO,MAAM,cAAc,uCAAmB,CAAC;AAC/C,eAAO,MAAM,WAAW,uCAAiB,CAAC;AAC1C,eAAO,MAAM,WAAW,uCAAiB,CAAC;AAC1C,eAAO,MAAM,YAAY,uCAAkB,CAAC;AAE5C,MAAM,WAAW,iBAAiB;IAChC,kGAAkG;IAClG,CAAC,CAAC,EAAE,OAAO,CAAC;IACZ,CAAC,CAAC,EAAE,OAAO,CAAC;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B;AAED,+FAA+F;AAC/F,eAAO,MAAM,YAAY,oCAItB,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { chartDescriptor as e } from "./chart-spec.js";
2
+ function t(r, a) {
3
+ return e(r, (o, n) => {
4
+ const { as: h, ...s } = o;
5
+ return { kind: "interactor", interactor: a, options: { ...s, as: h === void 0 ? n.as : h } };
6
+ });
7
+ }
8
+ const c = t("ChartIntervalX", "intervalX"), i = t("ChartIntervalY", "intervalY"), C = t("ChartIntervalXY", "intervalXY"), g = t("ChartToggleX", "toggleX"), l = t("ChartToggleY", "toggleY"), X = t("ChartToggleColor", "toggleColor"), v = t("ChartNearestX", "nearestX"), p = t("ChartNearestY", "nearestY"), u = t("ChartRegion", "region"), k = e("ChartHighlight", (r, a) => {
9
+ const { by: o, ...n } = r;
10
+ return { kind: "interactor", interactor: "highlight", options: { ...n, by: o === void 0 ? a.as : o } };
11
+ }), I = g, T = l, d = X, m = c, P = i, N = C, B = e("ChartPanZoom", (r) => ({
12
+ kind: "interactor",
13
+ interactor: "panZoom",
14
+ options: { ...r }
15
+ }));
16
+ export {
17
+ m as ChartBrushX,
18
+ N as ChartBrushXY,
19
+ P as ChartBrushY,
20
+ k as ChartHighlight,
21
+ c as ChartIntervalX,
22
+ C as ChartIntervalXY,
23
+ i as ChartIntervalY,
24
+ v as ChartNearestX,
25
+ p as ChartNearestY,
26
+ B as ChartPanZoom,
27
+ d as ChartPickColor,
28
+ I as ChartPickX,
29
+ T as ChartPickY,
30
+ u as ChartRegion,
31
+ X as ChartToggleColor,
32
+ g as ChartToggleX,
33
+ l as ChartToggleY
34
+ };
35
+ //# sourceMappingURL=chart-interactors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart-interactors.js","sources":["../../src/charts/chart-interactors.tsx"],"sourcesContent":["import type { Selection } from \"@uwdata/mosaic-core\";\nimport { chartDescriptor, type ChartDescriptor, type ChartInteractorDirective } from \"./chart-spec.js\";\n\n/**\n * The interactor vocabulary. Inert descriptors, like the marks.\n *\n * vgplot binds an interactor to the **last mark added before it**, so order inside `ChartRoot` is\n * semantic: put the interactor after the mark it should drive.\n */\n\nexport interface ChartInteractorProps {\n /** Where the interaction publishes. Defaults to `ChartRoot`'s `as` — the selection that root owns. */\n as?: Selection | null;\n /** Any other vgplot interactor option (`peers`, `brush`, `pixelSize`, `empty`…). */\n [option: string]: unknown;\n}\n\nfunction interactor(displayName: string, type: string): ChartDescriptor<ChartInteractorProps> {\n return chartDescriptor<ChartInteractorProps>(displayName, (props, ctx): ChartInteractorDirective => {\n const { as, ...rest } = props;\n return { kind: \"interactor\", interactor: type, options: { ...rest, as: as === undefined ? ctx.as : as } };\n });\n}\n\nexport const ChartIntervalX = interactor(\"ChartIntervalX\", \"intervalX\");\nexport const ChartIntervalY = interactor(\"ChartIntervalY\", \"intervalY\");\nexport const ChartIntervalXY = interactor(\"ChartIntervalXY\", \"intervalXY\");\nexport const ChartToggleX = interactor(\"ChartToggleX\", \"toggleX\");\nexport const ChartToggleY = interactor(\"ChartToggleY\", \"toggleY\");\nexport const ChartToggleColor = interactor(\"ChartToggleColor\", \"toggleColor\");\nexport const ChartNearestX = interactor(\"ChartNearestX\", \"nearestX\");\nexport const ChartNearestY = interactor(\"ChartNearestY\", \"nearestY\");\nexport const ChartRegion = interactor(\"ChartRegion\", \"region\");\n\nexport interface ChartHighlightProps {\n /**\n * The selection to highlight by — vgplot spells this `by`, not `as`. Defaults to `ChartRoot`'s\n * own selection, which is the only value guaranteed to be safe; see below before overriding it.\n */\n by?: Selection | null;\n /** The channels applied to the de-emphasised marks (`opacity`, `fill`, `stroke`…). */\n [channel: string]: unknown;\n}\n\n/**\n * Dims the marks outside `by` instead of publishing a selection — it reads, it does not write.\n *\n * **`by` is not a filter.** The highlight appends `by`'s predicate to the mark's own query as an\n * extra output column, and on an aggregating mark that query has a `GROUP BY` — so a predicate\n * naming a column the plot does not group by is a DuckDB binder error. Mosaic swallows it and the\n * plot keeps its previous render, silently. Leaving `by` off is what keeps that impossible: the\n * root's own selection can only hold clauses its own interactors published, over its own columns.\n * `ChartRoot` warns in development when an explicit `by` gives that away.\n */\nexport const ChartHighlight = chartDescriptor<ChartHighlightProps>(\"ChartHighlight\", (props, ctx) => {\n const { by, ...channels } = props;\n return { kind: \"interactor\", interactor: \"highlight\", options: { ...channels, by: by === undefined ? ctx.as : by } };\n});\n\n/**\n * Clearer aliases for the two ways of selecting, because vgplot's own pair mixes criteria:\n * `toggle` names the gesture, `interval` names the result. Both spellings work, and the vgplot names\n * stay so anyone reading Mosaic's documentation lands on the same component.\n *\n * This block used to claim \"the docs teach these\". They did not — a measurement found zero mentions\n * of any `Pick`/`Brush` name across every `.mdx`, while both spellings ran side by side in examples\n * and one showcase, sometimes in the same file. The pairing is now a table under\n * \"Interactors\" in `charts.mdx`. If you add an alias here, teach it there in the same commit.\n *\n * **Pick** is discrete: click a bar, get `region IN (…)`. Needs a categorical/band scale.\n * **Brush** is continuous: drag the axis, get `latency BETWEEN lo AND hi`. Needs a scale with a\n * \"between\" — brushing a band scale throws inside Mosaic, which `ChartRoot` warns about.\n */\nexport const ChartPickX = ChartToggleX;\nexport const ChartPickY = ChartToggleY;\nexport const ChartPickColor = ChartToggleColor;\nexport const ChartBrushX = ChartIntervalX;\nexport const ChartBrushY = ChartIntervalY;\nexport const ChartBrushXY = ChartIntervalXY;\n\nexport interface ChartPanZoomProps {\n /** Restrict panning/zooming to an axis, or bind the resulting domain to a `Selection`/`Param`. */\n x?: unknown;\n y?: unknown;\n zoom?: boolean;\n panx?: boolean;\n pany?: boolean;\n [option: string]: unknown;\n}\n\n/** Pan and zoom the plot's scales. Carries no selection — it rewrites the domains in place. */\nexport const ChartPanZoom = chartDescriptor<ChartPanZoomProps>(\"ChartPanZoom\", (props) => ({\n kind: \"interactor\",\n interactor: \"panZoom\",\n options: { ...props },\n}));\n"],"names":["interactor","displayName","type","chartDescriptor","props","ctx","as","rest","ChartIntervalX","ChartIntervalY","ChartIntervalXY","ChartToggleX","ChartToggleY","ChartToggleColor","ChartNearestX","ChartNearestY","ChartRegion","ChartHighlight","by","channels","ChartPickX","ChartPickY","ChartPickColor","ChartBrushX","ChartBrushY","ChartBrushXY","ChartPanZoom"],"mappings":";AAiBA,SAASA,EAAWC,GAAqBC,GAAqD;AAC5F,SAAOC,EAAsCF,GAAa,CAACG,GAAOC,MAAkC;AAClG,UAAM,EAAE,IAAAC,GAAI,GAAGC,EAAA,IAASH;AACxB,WAAO,EAAE,MAAM,cAAc,YAAYF,GAAM,SAAS,EAAE,GAAGK,GAAM,IAAID,MAAO,SAAYD,EAAI,KAAKC,IAAG;AAAA,EACxG,CAAC;AACH;AAEO,MAAME,IAAiBR,EAAW,kBAAkB,WAAW,GACzDS,IAAiBT,EAAW,kBAAkB,WAAW,GACzDU,IAAkBV,EAAW,mBAAmB,YAAY,GAC5DW,IAAeX,EAAW,gBAAgB,SAAS,GACnDY,IAAeZ,EAAW,gBAAgB,SAAS,GACnDa,IAAmBb,EAAW,oBAAoB,aAAa,GAC/Dc,IAAgBd,EAAW,iBAAiB,UAAU,GACtDe,IAAgBf,EAAW,iBAAiB,UAAU,GACtDgB,IAAchB,EAAW,eAAe,QAAQ,GAsBhDiB,IAAiBd,EAAqC,kBAAkB,CAACC,GAAOC,MAAQ;AACnG,QAAM,EAAE,IAAAa,GAAI,GAAGC,EAAA,IAAaf;AAC5B,SAAO,EAAE,MAAM,cAAc,YAAY,aAAa,SAAS,EAAE,GAAGe,GAAU,IAAID,MAAO,SAAYb,EAAI,KAAKa,IAAG;AACnH,CAAC,GAgBYE,IAAaT,GACbU,IAAaT,GACbU,IAAiBT,GACjBU,IAAcf,GACdgB,IAAcf,GACdgB,IAAef,GAafgB,IAAevB,EAAmC,gBAAgB,CAACC,OAAW;AAAA,EACzF,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,SAAS,EAAE,GAAGA,EAAA;AAChB,EAAE;"}
@@ -0,0 +1,38 @@
1
+ import { default as React } from 'react';
2
+ import { ark } from '@ark-ui/react/factory';
3
+ import { Selection } from '@uwdata/mosaic-core';
4
+ import { ChartConfig } from './chart-config.js';
5
+ export interface ChartLegendProps extends React.ComponentProps<typeof ark.ul> {
6
+ /** Series config. Defaults to the surrounding `<ChartRoot>`'s. */
7
+ config?: ChartConfig;
8
+ /** Standalone shorthand: labels in slot order, the i-th on its scheme slot. */
9
+ series?: readonly string[];
10
+ }
11
+ /**
12
+ * The identity key for a multi-series chart — our DOM, not vgplot's. Colour is never the only
13
+ * channel (dataviz): the label text carries identity and the swatch is `aria-hidden`.
14
+ */
15
+ export declare function ChartLegend(props: ChartLegendProps): React.JSX.Element;
16
+ export interface ChartColorLegendProps {
17
+ /**
18
+ * Where a swatch click publishes. Defaults to `ChartRoot`'s `as`, which makes the legend a
19
+ * filter; pass `null` for a static key.
20
+ */
21
+ as?: Selection | null;
22
+ /** The column the swatches map to, when it cannot be inferred from the channel. */
23
+ field?: string;
24
+ /**
25
+ * Which scale the swatches read. `color` is the usual one; `opacity` and `symbol` legend a plot
26
+ * that encodes its series on those channels instead — a scatter keyed by shape, say.
27
+ */
28
+ channel?: "color" | "opacity" | "symbol";
29
+ /** Any other vgplot legend option (`label`, `columns`, `tickSize`, `width`…). */
30
+ [option: string]: unknown;
31
+ }
32
+ /**
33
+ * vgplot's own colour legend — a descriptor, drawn inside the plot element and **interactive**:
34
+ * clicking a swatch toggles that series into the selection. Use `ChartLegend` when you want our
35
+ * DOM and the config's labels and icons; use this one when you want click-to-filter.
36
+ */
37
+ export declare const ChartColorLegend: import('./chart-spec.js').ChartDescriptor<ChartColorLegendProps>;
38
+ //# sourceMappingURL=chart-legend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart-legend.d.ts","sourceRoot":"","sources":["../../src/charts/chart-legend.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGrD,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKzE,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,GAAG,CAAC,EAAE,CAAC;IAC3E,kEAAkE;IAClE,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5B;AAMD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,qBA8BlD;AAED,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,EAAE,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACtB,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;IACzC,iFAAiF;IACjF,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,kEAW3B,CAAC"}
@@ -0,0 +1,49 @@
1
+ "use client";
2
+ import { jsx as o, jsxs as g } from "react/jsx-runtime";
3
+ import { ark as m } from "@ark-ui/react/factory";
4
+ import { cn as h } from "../lib/cn.js";
5
+ import { Swatch as u } from "../simples/swatch.js";
6
+ import { chartSeriesEntries as x } from "./chart-config.js";
7
+ import { useChartContextOptional as C } from "./chart-root.js";
8
+ import { chartDescriptor as k } from "./chart-spec.js";
9
+ import { categoricalColor as N } from "../lib/token-color.js";
10
+ function L(r) {
11
+ return Object.fromEntries(r.map((t, e) => [t, { color: N(e) }]));
12
+ }
13
+ function b(r) {
14
+ const { config: t, series: e, className: s, slot: a, ...l } = r, n = C(), p = t ?? (e ? L(e) : n == null ? void 0 : n.config) ?? {};
15
+ return /* @__PURE__ */ o(
16
+ m.ul,
17
+ {
18
+ className: h("flex flex-wrap items-center gap-x-4 gap-y-1", s),
19
+ ...l,
20
+ "data-slot": a ?? "chart-legend",
21
+ children: x(p).map(({ key: d, label: f, color: i, icon: c }) => /* @__PURE__ */ g(
22
+ m.li,
23
+ {
24
+ className: "flex items-center gap-1.5 text-muted-foreground text-xs",
25
+ "data-slot": "chart-legend-item",
26
+ children: [
27
+ c ? /* @__PURE__ */ o("span", { "aria-hidden": !0, className: "shrink-0", style: { color: i }, children: /* @__PURE__ */ o(c, { className: "size-3" }) }) : /* @__PURE__ */ o(u, { color: i, size: "xs" }),
28
+ f
29
+ ]
30
+ },
31
+ d
32
+ ))
33
+ }
34
+ );
35
+ }
36
+ const D = k("ChartColorLegend", (r, t) => {
37
+ const { as: e, channel: s = "color", ...a } = r;
38
+ return {
39
+ kind: "mark",
40
+ mark: `${s}Legend`,
41
+ source: null,
42
+ options: { ...a, as: e === void 0 ? t.as : e }
43
+ };
44
+ });
45
+ export {
46
+ D as ChartColorLegend,
47
+ b as ChartLegend
48
+ };
49
+ //# sourceMappingURL=chart-legend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart-legend.js","sources":["../../src/charts/chart-legend.tsx"],"sourcesContent":["\"use client\";\n\nimport type React from \"react\";\nimport { ark } from \"@ark-ui/react/factory\";\nimport type { Selection } from \"@uwdata/mosaic-core\";\nimport { cn } from \"../lib/cn.js\";\nimport { Swatch } from \"../simples/swatch.js\";\nimport { chartSeriesEntries, type ChartConfig } from \"./chart-config.js\";\nimport { useChartContextOptional } from \"./chart-root.js\";\nimport { chartDescriptor } from \"./chart-spec.js\";\nimport { categoricalColor } from \"../lib/token-color.js\";\n\nexport interface ChartLegendProps extends React.ComponentProps<typeof ark.ul> {\n /** Series config. Defaults to the surrounding `<ChartRoot>`'s. */\n config?: ChartConfig;\n /** Standalone shorthand: labels in slot order, the i-th on its scheme slot. */\n series?: readonly string[];\n}\n\nfunction seriesConfig(series: readonly string[]): ChartConfig {\n return Object.fromEntries(series.map((label, i) => [label, { color: categoricalColor(i) }]));\n}\n\n/**\n * The identity key for a multi-series chart — our DOM, not vgplot's. Colour is never the only\n * channel (dataviz): the label text carries identity and the swatch is `aria-hidden`.\n */\nexport function ChartLegend(props: ChartLegendProps) {\n const { config, series, className, slot, ...rest } = props;\n const chart = useChartContextOptional();\n const resolved = config ?? (series ? seriesConfig(series) : chart?.config) ?? {};\n\n return (\n <ark.ul\n className={cn(\"flex flex-wrap items-center gap-x-4 gap-y-1\", className)}\n {...rest}\n data-slot={slot ?? \"chart-legend\"}\n >\n {chartSeriesEntries(resolved).map(({ key, label, color, icon: Icon }) => (\n <ark.li\n className=\"flex items-center gap-1.5 text-muted-foreground text-xs\"\n data-slot=\"chart-legend-item\"\n key={key}\n >\n {/* The swatch colour is data, not a variant — the sanctioned inline-style case. */}\n {Icon ? (\n <span aria-hidden className=\"shrink-0\" style={{ color }}>\n <Icon className=\"size-3\" />\n </span>\n ) : (\n <Swatch color={color} size=\"xs\" />\n )}\n {label}\n </ark.li>\n ))}\n </ark.ul>\n );\n}\n\nexport interface ChartColorLegendProps {\n /**\n * Where a swatch click publishes. Defaults to `ChartRoot`'s `as`, which makes the legend a\n * filter; pass `null` for a static key.\n */\n as?: Selection | null;\n /** The column the swatches map to, when it cannot be inferred from the channel. */\n field?: string;\n /**\n * Which scale the swatches read. `color` is the usual one; `opacity` and `symbol` legend a plot\n * that encodes its series on those channels instead — a scatter keyed by shape, say.\n */\n channel?: \"color\" | \"opacity\" | \"symbol\";\n /** Any other vgplot legend option (`label`, `columns`, `tickSize`, `width`…). */\n [option: string]: unknown;\n}\n\n/**\n * vgplot's own colour legend — a descriptor, drawn inside the plot element and **interactive**:\n * clicking a swatch toggles that series into the selection. Use `ChartLegend` when you want our\n * DOM and the config's labels and icons; use this one when you want click-to-filter.\n */\nexport const ChartColorLegend = chartDescriptor<ChartColorLegendProps>(\"ChartColorLegend\", (props, ctx) => {\n const { as, channel = \"color\", ...rest } = props;\n // A `mark` with `source: null`, not a directive kind of its own. That is the decorator path the\n // compiler already has for `frame` / `gridX` / `gridY` — options in, no data — and\n // `colorLegend` / `opacityLegend` / `symbolLegend` are vgplot directives like any other.\n return {\n kind: \"mark\",\n mark: `${channel}Legend`,\n source: null,\n options: { ...rest, as: as === undefined ? ctx.as : as },\n };\n});\n"],"names":[],"mappings":";;;;;;;;;AAmBA;AACE;AACF;AAMO;AACL;AAIA;AACE;AAAK;AAAJ;AACuE;AAClE;AACe;AAGjB;AAAK;AAAJ;AACW;AACA;AAIT;AAKiC;AAEjC;AAAA;AAAA;AAVI;AAYR;AAAA;AAGP;AAwBO;AACL;AAIA;AAAO;AACC;AACU;AACR;AAC4C;AAExD;;;;;"}
@@ -0,0 +1,124 @@
1
+ import { Selection } from '@uwdata/mosaic-core';
2
+ import { ChartDescriptor } from './chart-spec.js';
3
+ /**
4
+ * The mark vocabulary. Every component here renders `null` — `ChartRoot` reads the `__chart`
5
+ * static off the element type and compiles it. `"use client"` is load-bearing even though nothing
6
+ * here uses a hook: a server-rendered descriptor would collapse to `null` before `ChartRoot`
7
+ * ever sees it.
8
+ */
9
+ export interface ChartMarkProps {
10
+ /**
11
+ * The selection this mark filters by. Defaults to `ChartRoot`'s; `null` draws the full relation
12
+ * — the dimmed background layer of a crossfilter pair.
13
+ */
14
+ filterBy?: Selection | null;
15
+ /**
16
+ * A different relation for this mark alone. The root's `table` is the default, which is right
17
+ * until a plot needs two — a node-link view draws nodes from one relation and edges from
18
+ * another, and both still filter by the same selection.
19
+ */
20
+ table?: string;
21
+ /** Literal rows instead of the root's table. */
22
+ data?: readonly unknown[];
23
+ /** Positions a rule/tick without a table: `at={0}` is the zero line. */
24
+ at?: unknown;
25
+ /** Observable Plot's per-mark hover tooltip. */
26
+ tip?: boolean;
27
+ x?: unknown;
28
+ y?: unknown;
29
+ z?: unknown;
30
+ r?: unknown;
31
+ /** Facet the plot horizontally by this column — one panel per distinct value. */
32
+ fx?: unknown;
33
+ /** Facet the plot vertically by this column. */
34
+ fy?: unknown;
35
+ /** A column name, or a colour — `var(--chart-1)` / `--primary` tokens are resolved for Plot. */
36
+ fill?: unknown;
37
+ /** A column name, or a colour; tokens are resolved the same way. */
38
+ stroke?: unknown;
39
+ opacity?: unknown;
40
+ fillOpacity?: unknown;
41
+ strokeOpacity?: unknown;
42
+ strokeWidth?: unknown;
43
+ sort?: unknown;
44
+ reverse?: boolean;
45
+ limit?: number;
46
+ inset?: number;
47
+ /** Any other vgplot / Observable Plot mark option. */
48
+ [option: string]: unknown;
49
+ }
50
+ export declare const ChartBarY: ChartDescriptor<ChartMarkProps>;
51
+ export declare const ChartBarX: ChartDescriptor<ChartMarkProps>;
52
+ export declare const ChartWaffleY: ChartDescriptor<ChartMarkProps>;
53
+ export declare const ChartWaffleX: ChartDescriptor<ChartMarkProps>;
54
+ export declare const ChartLine: ChartDescriptor<ChartMarkProps>;
55
+ export declare const ChartLineY: ChartDescriptor<ChartMarkProps>;
56
+ export declare const ChartLineX: ChartDescriptor<ChartMarkProps>;
57
+ export declare const ChartArea: ChartDescriptor<ChartMarkProps>;
58
+ export declare const ChartAreaY: ChartDescriptor<ChartMarkProps>;
59
+ export declare const ChartAreaX: ChartDescriptor<ChartMarkProps>;
60
+ export declare const ChartDot: ChartDescriptor<ChartMarkProps>;
61
+ export declare const ChartDotX: ChartDescriptor<ChartMarkProps>;
62
+ export declare const ChartDotY: ChartDescriptor<ChartMarkProps>;
63
+ export declare const ChartCircle: ChartDescriptor<ChartMarkProps>;
64
+ export declare const ChartHexagon: ChartDescriptor<ChartMarkProps>;
65
+ export declare const ChartImage: ChartDescriptor<ChartMarkProps>;
66
+ export declare const ChartRect: ChartDescriptor<ChartMarkProps>;
67
+ export declare const ChartRectY: ChartDescriptor<ChartMarkProps>;
68
+ export declare const ChartRectX: ChartDescriptor<ChartMarkProps>;
69
+ export declare const ChartCell: ChartDescriptor<ChartMarkProps>;
70
+ export declare const ChartCellX: ChartDescriptor<ChartMarkProps>;
71
+ export declare const ChartCellY: ChartDescriptor<ChartMarkProps>;
72
+ export declare const ChartRuleY: ChartDescriptor<ChartMarkProps>;
73
+ export declare const ChartRuleX: ChartDescriptor<ChartMarkProps>;
74
+ export declare const ChartTickX: ChartDescriptor<ChartMarkProps>;
75
+ export declare const ChartTickY: ChartDescriptor<ChartMarkProps>;
76
+ export declare const ChartText: ChartDescriptor<ChartMarkProps>;
77
+ export declare const ChartTextX: ChartDescriptor<ChartMarkProps>;
78
+ export declare const ChartTextY: ChartDescriptor<ChartMarkProps>;
79
+ export declare const ChartVector: ChartDescriptor<ChartMarkProps>;
80
+ export declare const ChartVectorX: ChartDescriptor<ChartMarkProps>;
81
+ export declare const ChartVectorY: ChartDescriptor<ChartMarkProps>;
82
+ export declare const ChartSpike: ChartDescriptor<ChartMarkProps>;
83
+ export declare const ChartArrow: ChartDescriptor<ChartMarkProps>;
84
+ export declare const ChartLink: ChartDescriptor<ChartMarkProps>;
85
+ export declare const ChartHeatmap: ChartDescriptor<ChartMarkProps>;
86
+ export declare const ChartRaster: ChartDescriptor<ChartMarkProps>;
87
+ export declare const ChartRasterTile: ChartDescriptor<ChartMarkProps>;
88
+ export declare const ChartContour: ChartDescriptor<ChartMarkProps>;
89
+ export declare const ChartDenseLine: ChartDescriptor<ChartMarkProps>;
90
+ export declare const ChartDensity: ChartDescriptor<ChartMarkProps>;
91
+ export declare const ChartDensityY: ChartDescriptor<ChartMarkProps>;
92
+ export declare const ChartDensityX: ChartDescriptor<ChartMarkProps>;
93
+ export declare const ChartHexbin: ChartDescriptor<ChartMarkProps>;
94
+ export declare const ChartRegressionY: ChartDescriptor<ChartMarkProps>;
95
+ export declare const ChartErrorbarY: ChartDescriptor<ChartMarkProps>;
96
+ export declare const ChartErrorbarX: ChartDescriptor<ChartMarkProps>;
97
+ export declare const ChartVoronoi: ChartDescriptor<ChartMarkProps>;
98
+ export declare const ChartVoronoiMesh: ChartDescriptor<ChartMarkProps>;
99
+ export declare const ChartDelaunayLink: ChartDescriptor<ChartMarkProps>;
100
+ export declare const ChartDelaunayMesh: ChartDescriptor<ChartMarkProps>;
101
+ export declare const ChartHull: ChartDescriptor<ChartMarkProps>;
102
+ export declare const ChartGeo: ChartDescriptor<ChartMarkProps>;
103
+ export declare const ChartFrame: ChartDescriptor<ChartMarkProps>;
104
+ export declare const ChartGridX: ChartDescriptor<ChartMarkProps>;
105
+ export declare const ChartGridY: ChartDescriptor<ChartMarkProps>;
106
+ export declare const ChartHexgrid: ChartDescriptor<ChartMarkProps>;
107
+ export declare const ChartSphere: ChartDescriptor<ChartMarkProps>;
108
+ export declare const ChartGraticule: ChartDescriptor<ChartMarkProps>;
109
+ export interface ChartRawProps {
110
+ /** A `vg.*` directive, or several — `vg.axisFx({ anchor: "top" })`. */
111
+ spec: unknown;
112
+ }
113
+ /**
114
+ * The escape hatch. The wrappers above cover vgplot's mark vocabulary, but not its ~250 attributes
115
+ * nor the `axisX`/`axisFy` decorator marks the axis descriptors deliberately compile away from.
116
+ * Anything unwrapped goes in here, in source order, with the same interactor-binding semantics as
117
+ * a wrapped mark:
118
+ *
119
+ * ```tsx
120
+ * <ChartRaw spec={vg.axisFy({ anchor: "right", tickRotate: 45 })} />
121
+ * ```
122
+ */
123
+ export declare const ChartRaw: ChartDescriptor<ChartRawProps>;
124
+ //# sourceMappingURL=chart-marks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart-marks.d.ts","sourceRoot":"","sources":["../../src/charts/chart-marks.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAEL,KAAK,eAAe,EAIrB,MAAM,iBAAiB,CAAC;AAEzB;;;;;GAKG;AAEH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC1B,wEAAwE;IACxE,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,gDAAgD;IAChD,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,CAAC,CAAC,EAAE,OAAO,CAAC;IACZ,CAAC,CAAC,EAAE,OAAO,CAAC;IACZ,CAAC,CAAC,EAAE,OAAO,CAAC;IACZ,CAAC,CAAC,EAAE,OAAO,CAAC;IACZ,iFAAiF;IACjF,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,gDAAgD;IAChD,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,gGAAgG;IAChG,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,oEAAoE;IACpE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,C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O,MAAM,cAAc,iCAA4C,CAAC;AAExE,MAAM,WAAW,aAAa;IAC5B,uEAAuE;IACvE,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,gCAIpB,CAAC"}
@@ -0,0 +1,109 @@
1
+ import { isColorValue as s, isColorToken as i } from "./chart-config.js";
2
+ import { chartDescriptor as c } from "./chart-spec.js";
3
+ const l = ["fill", "stroke"], u = /* @__PURE__ */ new Set([
4
+ "barY",
5
+ "barX",
6
+ "areaY",
7
+ "areaX",
8
+ "area",
9
+ "rectY",
10
+ "rectX",
11
+ "rect",
12
+ "waffleY",
13
+ "waffleX"
14
+ ]);
15
+ function Y(r, e, n) {
16
+ if (n) return null;
17
+ if (r.data !== void 0) return { kind: "values", values: r.data };
18
+ if (r.at !== void 0) return { kind: "values", values: Array.isArray(r.at) ? r.at : [r.at] };
19
+ const o = r.table ?? e.table;
20
+ return o === void 0 ? { kind: "values", values: [{}] } : {
21
+ kind: "table",
22
+ table: o,
23
+ filterBy: r.filterBy === void 0 ? e.filterBy : r.filterBy
24
+ };
25
+ }
26
+ function X(r, e, n, o) {
27
+ const a = { ...e };
28
+ if (delete a.filterBy, delete a.data, delete a.at, delete a.table, u.has(r) && !("z" in a)) {
29
+ const C = [a.fill, a.stroke].find(
30
+ (h) => typeof h == "string" && !s(h)
31
+ );
32
+ C !== void 0 && (a.z = C);
33
+ }
34
+ for (const C of l) {
35
+ const h = a[C];
36
+ typeof h == "string" && i(h) && (a[C] = n.resolveColor(h));
37
+ }
38
+ return { kind: "mark", mark: r, source: Y(e, n, o), options: a };
39
+ }
40
+ function t(r, e, n = !1) {
41
+ return c(r, (o, a) => X(e, o, a, n));
42
+ }
43
+ const k = t("ChartBarY", "barY"), y = t("ChartBarX", "barX"), D = t("ChartWaffleY", "waffleY"), R = t("ChartWaffleX", "waffleX"), v = t("ChartLine", "line"), b = t("ChartLineY", "lineY"), g = t("ChartLineX", "lineX"), m = t("ChartArea", "area"), x = t("ChartAreaY", "areaY"), L = t("ChartAreaX", "areaX"), A = t("ChartDot", "dot"), T = t("ChartDotX", "dotX"), w = t("ChartDotY", "dotY"), H = t("ChartCircle", "circle"), V = t("ChartHexagon", "hexagon"), B = t("ChartImage", "image"), G = t("ChartRect", "rect"), S = t("ChartRectY", "rectY"), M = t("ChartRectX", "rectX"), E = t("ChartCell", "cell"), W = t("ChartCellX", "cellX"), I = t("ChartCellY", "cellY"), N = t("ChartRuleY", "ruleY"), z = t("ChartRuleX", "ruleX"), F = t("ChartTickX", "tickX"), K = t("ChartTickY", "tickY"), O = t("ChartText", "text"), _ = t("ChartTextX", "textX"), j = t("ChartTextY", "textY"), q = t("ChartVector", "vector"), J = t("ChartVectorX", "vectorX"), P = t("ChartVectorY", "vectorY"), Q = t("ChartSpike", "spike"), U = t("ChartArrow", "arrow"), Z = t("ChartLink", "link"), $ = t("ChartHeatmap", "heatmap"), p = t("ChartRaster", "raster"), tt = t("ChartRasterTile", "rasterTile"), rt = t("ChartContour", "contour"), at = t("ChartDenseLine", "denseLine"), et = t("ChartDensity", "density"), nt = t("ChartDensityY", "densityY"), ot = t("ChartDensityX", "densityX"), ht = t("ChartHexbin", "hexbin"), Ct = t("ChartRegressionY", "regressionY"), ct = t("ChartErrorbarY", "errorbarY"), st = t("ChartErrorbarX", "errorbarX"), it = t("ChartVoronoi", "voronoi"), lt = t("ChartVoronoiMesh", "voronoiMesh"), ut = t("ChartDelaunayLink", "delaunayLink"), Yt = t("ChartDelaunayMesh", "delaunayMesh"), Xt = t("ChartHull", "hull"), ft = t("ChartGeo", "geo"), dt = t("ChartFrame", "frame", !0), kt = t("ChartGridX", "gridX", !0), yt = t("ChartGridY", "gridY", !0), Dt = t("ChartHexgrid", "hexgrid", !0), Rt = t("ChartSphere", "sphere", !0), vt = t("ChartGraticule", "graticule", !0), bt = c(
44
+ "ChartRaw",
45
+ (r) => Array.isArray(r.spec) ? r.spec.map((e) => ({ kind: "raw", value: e })) : { kind: "raw", value: r.spec }
46
+ );
47
+ export {
48
+ m as ChartArea,
49
+ L as ChartAreaX,
50
+ x as ChartAreaY,
51
+ U as ChartArrow,
52
+ y as ChartBarX,
53
+ k as ChartBarY,
54
+ E as ChartCell,
55
+ W as ChartCellX,
56
+ I as ChartCellY,
57
+ H as ChartCircle,
58
+ rt as ChartContour,
59
+ ut as ChartDelaunayLink,
60
+ Yt as ChartDelaunayMesh,
61
+ at as ChartDenseLine,
62
+ et as ChartDensity,
63
+ ot as ChartDensityX,
64
+ nt as ChartDensityY,
65
+ A as ChartDot,
66
+ T as ChartDotX,
67
+ w as ChartDotY,
68
+ st as ChartErrorbarX,
69
+ ct as ChartErrorbarY,
70
+ dt as ChartFrame,
71
+ ft as ChartGeo,
72
+ vt as ChartGraticule,
73
+ kt as ChartGridX,
74
+ yt as ChartGridY,
75
+ $ as ChartHeatmap,
76
+ V as ChartHexagon,
77
+ ht as ChartHexbin,
78
+ Dt as ChartHexgrid,
79
+ Xt as ChartHull,
80
+ B as ChartImage,
81
+ v as ChartLine,
82
+ g as ChartLineX,
83
+ b as ChartLineY,
84
+ Z as ChartLink,
85
+ p as ChartRaster,
86
+ tt as ChartRasterTile,
87
+ bt as ChartRaw,
88
+ G as ChartRect,
89
+ M as ChartRectX,
90
+ S as ChartRectY,
91
+ Ct as ChartRegressionY,
92
+ z as ChartRuleX,
93
+ N as ChartRuleY,
94
+ Rt as ChartSphere,
95
+ Q as ChartSpike,
96
+ O as ChartText,
97
+ _ as ChartTextX,
98
+ j as ChartTextY,
99
+ F as ChartTickX,
100
+ K as ChartTickY,
101
+ q as ChartVector,
102
+ J as ChartVectorX,
103
+ P as ChartVectorY,
104
+ it as ChartVoronoi,
105
+ lt as ChartVoronoiMesh,
106
+ R as ChartWaffleX,
107
+ D as ChartWaffleY
108
+ };
109
+ //# sourceMappingURL=chart-marks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart-marks.js","sources":["../../src/charts/chart-marks.tsx"],"sourcesContent":["import type { Selection } from \"@uwdata/mosaic-core\";\nimport { isColorToken, isColorValue } from \"./chart-config.js\";\nimport {\n chartDescriptor,\n type ChartDescriptor,\n type ChartMarkDirective,\n type ChartMarkSource,\n type ChartSpecContext,\n} from \"./chart-spec.js\";\n\n/**\n * The mark vocabulary. Every component here renders `null` — `ChartRoot` reads the `__chart`\n * static off the element type and compiles it. `\"use client\"` is load-bearing even though nothing\n * here uses a hook: a server-rendered descriptor would collapse to `null` before `ChartRoot`\n * ever sees it.\n */\n\nexport interface ChartMarkProps {\n /**\n * The selection this mark filters by. Defaults to `ChartRoot`'s; `null` draws the full relation\n * — the dimmed background layer of a crossfilter pair.\n */\n filterBy?: Selection | null;\n /**\n * A different relation for this mark alone. The root's `table` is the default, which is right\n * until a plot needs two — a node-link view draws nodes from one relation and edges from\n * another, and both still filter by the same selection.\n */\n table?: string;\n /** Literal rows instead of the root's table. */\n data?: readonly unknown[];\n /** Positions a rule/tick without a table: `at={0}` is the zero line. */\n at?: unknown;\n /** Observable Plot's per-mark hover tooltip. */\n tip?: boolean;\n x?: unknown;\n y?: unknown;\n z?: unknown;\n r?: unknown;\n /** Facet the plot horizontally by this column — one panel per distinct value. */\n fx?: unknown;\n /** Facet the plot vertically by this column. */\n fy?: unknown;\n /** A column name, or a colour — `var(--chart-1)` / `--primary` tokens are resolved for Plot. */\n fill?: unknown;\n /** A column name, or a colour; tokens are resolved the same way. */\n stroke?: unknown;\n opacity?: unknown;\n fillOpacity?: unknown;\n strokeOpacity?: unknown;\n strokeWidth?: unknown;\n sort?: unknown;\n reverse?: boolean;\n limit?: number;\n inset?: number;\n /** Any other vgplot / Observable Plot mark option. */\n [option: string]: unknown;\n}\n\n/** Only these two channels can hold a colour; everything else keeps its column name. */\nconst COLOR_CHANNELS = [\"fill\", \"stroke\"] as const;\n\n/**\n * Marks that stack, and therefore need a series key.\n *\n * In Observable Plot `z` defaults to `fill`, so a stacked bar coloured by a column just works.\n * Through Mosaic it does not: the fill arrives as `{ value, scale: \"color\" }`, `maybeZ` cannot\n * pull a series name out of that object, and `stackY` silently stacks every row on the previous\n * one — a chart that renders, looks plausible and is wrong, which is worse than one that throws.\n * So we restore Plot's own default: a column-valued `fill`/`stroke` becomes `z` unless the caller\n * set one. `z={null}` opts out (Plot's own way of saying \"do not group\").\n */\nconst STACKING_MARKS = new Set([\n \"barY\", \"barX\", \"areaY\", \"areaX\", \"area\", \"rectY\", \"rectX\", \"rect\", \"waffleY\", \"waffleX\",\n]);\n\nfunction markSource(props: ChartMarkProps, ctx: ChartSpecContext, decorator: boolean): ChartMarkSource {\n if (decorator) return null;\n if (props.data !== undefined) return { kind: \"values\", values: props.data };\n if (props.at !== undefined) return { kind: \"values\", values: Array.isArray(props.at) ? props.at : [props.at] };\n const table = props.table ?? ctx.table;\n if (table === undefined) return { kind: \"values\", values: [{}] };\n return {\n kind: \"table\",\n table,\n filterBy: props.filterBy === undefined ? ctx.filterBy : props.filterBy,\n };\n}\n\nfunction markDirective(mark: string, props: ChartMarkProps, ctx: ChartSpecContext, decorator: boolean): ChartMarkDirective {\n const channels: Record<string, unknown> = { ...props };\n // `filterBy` / `data` / `at` are our sugar; they choose the source, they are never mark options.\n delete channels.filterBy;\n delete channels.data;\n delete channels.at;\n delete channels.table;\n // Read the series key before the colour channels are resolved to `rgb(...)` strings.\n if (STACKING_MARKS.has(mark) && !(\"z\" in channels)) {\n const series = [channels.fill, channels.stroke].find(\n (v) => typeof v === \"string\" && !isColorValue(v),\n );\n if (series !== undefined) channels.z = series;\n }\n for (const channel of COLOR_CHANNELS) {\n const value = channels[channel];\n // `fill=\"host\"` is the *column* host; only a token reference is a colour we must resolve.\n if (typeof value === \"string\" && isColorToken(value)) channels[channel] = ctx.resolveColor(value);\n }\n return { kind: \"mark\", mark, source: markSource(props, ctx, decorator), options: channels };\n}\n\nfunction mark(displayName: string, type: string, decorator = false): ChartDescriptor<ChartMarkProps> {\n return chartDescriptor<ChartMarkProps>(displayName, (props, ctx) => markDirective(type, props, ctx, decorator));\n}\n\nexport const ChartBarY = mark(\"ChartBarY\", \"barY\");\nexport const ChartBarX = mark(\"ChartBarX\", \"barX\");\nexport const ChartWaffleY = mark(\"ChartWaffleY\", \"waffleY\");\nexport const ChartWaffleX = mark(\"ChartWaffleX\", \"waffleX\");\n\nexport const ChartLine = mark(\"ChartLine\", \"line\");\nexport const ChartLineY = mark(\"ChartLineY\", \"lineY\");\nexport const ChartLineX = mark(\"ChartLineX\", \"lineX\");\nexport const ChartArea = mark(\"ChartArea\", \"area\");\nexport const ChartAreaY = mark(\"ChartAreaY\", \"areaY\");\nexport const ChartAreaX = mark(\"ChartAreaX\", \"areaX\");\n\nexport const ChartDot = mark(\"ChartDot\", \"dot\");\nexport const ChartDotX = mark(\"ChartDotX\", \"dotX\");\nexport const ChartDotY = mark(\"ChartDotY\", \"dotY\");\nexport const ChartCircle = mark(\"ChartCircle\", \"circle\");\nexport const ChartHexagon = mark(\"ChartHexagon\", \"hexagon\");\nexport const ChartImage = mark(\"ChartImage\", \"image\");\n\nexport const ChartRect = mark(\"ChartRect\", \"rect\");\nexport const ChartRectY = mark(\"ChartRectY\", \"rectY\");\nexport const ChartRectX = mark(\"ChartRectX\", \"rectX\");\nexport const ChartCell = mark(\"ChartCell\", \"cell\");\nexport const ChartCellX = mark(\"ChartCellX\", \"cellX\");\nexport const ChartCellY = mark(\"ChartCellY\", \"cellY\");\n\nexport const ChartRuleY = mark(\"ChartRuleY\", \"ruleY\");\nexport const ChartRuleX = mark(\"ChartRuleX\", \"ruleX\");\nexport const ChartTickX = mark(\"ChartTickX\", \"tickX\");\nexport const ChartTickY = mark(\"ChartTickY\", \"tickY\");\nexport const ChartText = mark(\"ChartText\", \"text\");\nexport const ChartTextX = mark(\"ChartTextX\", \"textX\");\nexport const ChartTextY = mark(\"ChartTextY\", \"textY\");\n\nexport const ChartVector = mark(\"ChartVector\", \"vector\");\n// vgplot 0.29.2 builds this one with the mark type `vectoX`, which Observable Plot has no\n// function for. Wrapped for symmetry; use `<ChartVector>` until upstream fixes the typo.\nexport const ChartVectorX = mark(\"ChartVectorX\", \"vectorX\");\nexport const ChartVectorY = mark(\"ChartVectorY\", \"vectorY\");\nexport const ChartSpike = mark(\"ChartSpike\", \"spike\");\nexport const ChartArrow = mark(\"ChartArrow\", \"arrow\");\nexport const ChartLink = mark(\"ChartLink\", \"link\");\n\nexport const ChartHeatmap = mark(\"ChartHeatmap\", \"heatmap\");\nexport const ChartRaster = mark(\"ChartRaster\", \"raster\");\nexport const ChartRasterTile = mark(\"ChartRasterTile\", \"rasterTile\");\nexport const ChartContour = mark(\"ChartContour\", \"contour\");\nexport const ChartDenseLine = mark(\"ChartDenseLine\", \"denseLine\");\nexport const ChartDensity = mark(\"ChartDensity\", \"density\");\nexport const ChartDensityY = mark(\"ChartDensityY\", \"densityY\");\nexport const ChartDensityX = mark(\"ChartDensityX\", \"densityX\");\nexport const ChartHexbin = mark(\"ChartHexbin\", \"hexbin\");\nexport const ChartRegressionY = mark(\"ChartRegressionY\", \"regressionY\");\nexport const ChartErrorbarY = mark(\"ChartErrorbarY\", \"errorbarY\");\nexport const ChartErrorbarX = mark(\"ChartErrorbarX\", \"errorbarX\");\n\nexport const ChartVoronoi = mark(\"ChartVoronoi\", \"voronoi\");\nexport const ChartVoronoiMesh = mark(\"ChartVoronoiMesh\", \"voronoiMesh\");\nexport const ChartDelaunayLink = mark(\"ChartDelaunayLink\", \"delaunayLink\");\nexport const ChartDelaunayMesh = mark(\"ChartDelaunayMesh\", \"delaunayMesh\");\nexport const ChartHull = mark(\"ChartHull\", \"hull\");\nexport const ChartGeo = mark(\"ChartGeo\", \"geo\");\n\n// Decorators: they draw the frame, not the data, so vgplot gives them options and no source.\nexport const ChartFrame = mark(\"ChartFrame\", \"frame\", true);\nexport const ChartGridX = mark(\"ChartGridX\", \"gridX\", true);\nexport const ChartGridY = mark(\"ChartGridY\", \"gridY\", true);\nexport const ChartHexgrid = mark(\"ChartHexgrid\", \"hexgrid\", true);\nexport const ChartSphere = mark(\"ChartSphere\", \"sphere\", true);\nexport const ChartGraticule = mark(\"ChartGraticule\", \"graticule\", true);\n\nexport interface ChartRawProps {\n /** A `vg.*` directive, or several — `vg.axisFx({ anchor: \"top\" })`. */\n spec: unknown;\n}\n\n/**\n * The escape hatch. The wrappers above cover vgplot's mark vocabulary, but not its ~250 attributes\n * nor the `axisX`/`axisFy` decorator marks the axis descriptors deliberately compile away from.\n * Anything unwrapped goes in here, in source order, with the same interactor-binding semantics as\n * a wrapped mark:\n *\n * ```tsx\n * <ChartRaw spec={vg.axisFy({ anchor: \"right\", tickRotate: 45 })} />\n * ```\n */\nexport const ChartRaw = chartDescriptor<ChartRawProps>(\"ChartRaw\", (props) =>\n Array.isArray(props.spec)\n ? props.spec.map((value: unknown) => ({ kind: \"raw\" as const, value }))\n : { kind: \"raw\", value: props.spec },\n);\n"],"names":["COLOR_CHANNELS","STACKING_MARKS","markSource","props","ctx","decorator","table","markDirective","mark","channels","series","v","isColorValue","channel","value","isColorToken","displayName","type","chartDescriptor","ChartBarY","ChartBarX","ChartWaffleY","ChartWaffleX","ChartLine","ChartLineY","ChartLineX","ChartArea","ChartAreaY","ChartAreaX","ChartDot","ChartDotX","ChartDotY","ChartCircle","ChartHexagon","ChartImage","ChartRect","ChartRectY","ChartRectX","ChartCell","ChartCellX","ChartCellY","ChartRuleY","ChartRuleX","ChartTickX","ChartTickY","ChartText","ChartTextX","ChartTextY","ChartVector","ChartVectorX","ChartVectorY","ChartSpike","ChartArrow","ChartLink","ChartHeatmap","ChartRaster","ChartRasterTile","ChartContour","ChartDenseLine","ChartDensity","ChartDensityY","ChartDensityX","ChartHexbin","ChartRegressionY","ChartErrorbarY","ChartErrorbarX","ChartVoronoi","ChartVoronoiMesh","ChartDelaunayLink","ChartDelaunayMesh","ChartHull","ChartGeo","ChartFrame","ChartGridX","ChartGridY","ChartHexgrid","ChartSphere","ChartGraticule","ChartRaw"],"mappings":";;AA4DA,MAAMA,IAAiB,CAAC,QAAQ,QAAQ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f,MAClE,MAAM,QAAQA,EAAM,IAAI,IACpBA,EAAM,KAAK,IAAI,CAACW,OAAoB,EAAE,MAAM,OAAgB,OAAAA,EAAA,EAAQ,IACpE,EAAE,MAAM,OAAO,OAAOX,EAAM,KAAA;AAClC;"}
@@ -0,0 +1,90 @@
1
+ import { ReactNode, default as React } from 'react';
2
+ import { ark } from '@ark-ui/react/factory';
3
+ import { Selection, Coordinator } from '@uwdata/mosaic-core';
4
+ import { ChartConfig } from './chart-config.js';
5
+ import { ChartFacetOptions, ChartMargin } from './chart-spec.js';
6
+ export interface ChartContextValue {
7
+ /** The active Mosaic coordinator, for a consumer that queries alongside the plot. */
8
+ coordinator: Coordinator;
9
+ config: ChartConfig;
10
+ table?: string;
11
+ /** What the marks filter by; `null` = the full relation. */
12
+ filterBy: Selection | null;
13
+ /** Where the interactors publish. */
14
+ as: Selection;
15
+ /**
16
+ * The series colour, normalised to `rgb(...)` so it is safe for both CSS and Plot. `undefined`
17
+ * for a key the config does not name.
18
+ *
19
+ * Normalising is what makes it dual-purpose and is also what makes it a **snapshot**: the answer
20
+ * is read off the DOM when you call it, and nothing re-calls it when the theme or the scheme
21
+ * changes. `ChartLegend` deliberately does not use this — its only sink is a `style`, so it
22
+ * passes `var(--chart-N)` through and lets the browser follow the theme for free. Take the same
23
+ * route for anything that only ends up in CSS; pair this with `useThemeTick` when you need the
24
+ * literal, which is to say when you are handing it to Plot.
25
+ */
26
+ color: (key: string) => string | undefined;
27
+ /** The chart's locale number formatter — one vocabulary for axes, legend and tooltip. */
28
+ formatNumber: (value: number, options?: Intl.NumberFormatOptions) => string;
29
+ }
30
+ /**
31
+ * The chart context — config, selections, coordinator, and the `color` / `formatNumber` helpers
32
+ * that keep a series' identity in one place. Throws outside a `<ChartRoot>`.
33
+ *
34
+ * Available to DOM parts (`ChartLegend`, a custom tooltip, a readout). **Not** to descriptors:
35
+ * `ChartRoot` reads their props off the element before React renders them, so a mark cannot pull
36
+ * anything out of context — pass the value down from the component that owns the `<ChartRoot>`.
37
+ */
38
+ export declare function useChartContext(): ChartContextValue;
39
+ /** The chart context, or `null` — for parts that also work standalone, like `ChartLegend`. */
40
+ export declare function useChartContextOptional(): ChartContextValue | null;
41
+ export interface ChartRootProps extends Omit<React.ComponentProps<typeof ark.div>, "children">, ChartFacetOptions {
42
+ /** The relation registered in the coordinator. Omit it when every mark carries its own `data`. */
43
+ table?: string;
44
+ /** What the marks filter by. Defaults to the `<MosaicProvider>` crossfilter; `null` = unfiltered. */
45
+ filterBy?: Selection | null;
46
+ /**
47
+ * Where the child interactors publish, and what `ChartHighlight` reads back. Defaults to a
48
+ * selection this root owns, relayed into the provider — see the note on `ChartRoot`. Pass one and
49
+ * you own its wiring: nothing is relayed for you, though the provider's `reset()` still clears it.
50
+ */
51
+ as?: Selection;
52
+ /** Series key → `{ label, color, icon }`. A non-empty config pins the plot's colour scale. */
53
+ config?: ChartConfig;
54
+ /** Plot height in px; the width is measured from the container. Default 200. */
55
+ height?: number;
56
+ margin?: number | ChartMargin;
57
+ aspectRatio?: number;
58
+ /**
59
+ * Raw `vg.*` directives for anything the layer does not wrap. Applied last, so they win.
60
+ * Keep the array referentially stable — a new array rebuilds the plot.
61
+ */
62
+ attributes?: readonly unknown[];
63
+ /** BCP-47 tag for `formatNumber`. Defaults to the runtime locale. */
64
+ locale?: string;
65
+ /** Default options for `formatNumber` — the chart's number vocabulary in one place. */
66
+ numberFormat?: Intl.NumberFormatOptions;
67
+ /** Descriptors (marks, interactors, axes) plus real DOM parts such as `ChartLegend`. */
68
+ children?: ReactNode;
69
+ /** Class for the plot host itself, inside the root. */
70
+ plotClassName?: string;
71
+ }
72
+ /**
73
+ * Why every chart owns a selection instead of sharing the page's.
74
+ *
75
+ * `ChartHighlight` does not filter — it asks the mark's **own** query which rows are selected, by
76
+ * appending the predicate as an extra output column: `q._groupby.length ? q.select({__: pred})`.
77
+ * On an aggregating mark that query has a `GROUP BY`, so a predicate naming a column this plot does
78
+ * not group by is `Binder Error: column "provider" must appear in the GROUP BY clause`. The query
79
+ * dies, vgplot swallows it, and **the plot keeps its previous render** — no error, no empty state,
80
+ * nothing but a console line. It costs hours to find, because the symptom looks like a broken
81
+ * crossfilter three components away.
82
+ *
83
+ * A page-wide publish target guarantees that failure the moment a second chart filters by a second
84
+ * column. So each root publishes into a union of its own: those clauses, by construction, name only
85
+ * columns this plot's own interactors could produce — which are the columns its marks group by. The
86
+ * clauses are relayed on into the provider (`selected` → `crossfilter`) with `source` and `clients`
87
+ * intact, so every other chart filters exactly as before and this one still does not filter itself.
88
+ */
89
+ export declare function ChartRoot(props: ChartRootProps): React.JSX.Element;
90
+ //# sourceMappingURL=chart-root.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart-root.d.ts","sourceRoot":"","sources":["../../src/charts/chart-root.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAmE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAClH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlE,OAAO,EAAmE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACtH,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAEjB,MAAM,iBAAiB,CAAC;AA+BzB,MAAM,WAAW,iBAAiB;IAChC,qFAAqF;IACrF,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,QAAQ,EAAE,SAAS,GAAG,IAAI,CAAC;IAC3B,qCAAqC;IACrC,EAAE,EAAE,SAAS,CAAC;IACd;;;;;;;;;;OAUG;IACH,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAC3C,yFAAyF;IACzF,YA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