@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,43 @@
1
+ var o = (t) => {
2
+ throw TypeError(t);
3
+ };
4
+ var n = (t, r, e) => r.has(t) || o("Cannot " + e);
5
+ var i = (t, r, e) => (n(t, r, "read from private field"), e ? e.call(t) : r.get(t)), l = (t, r, e) => r.has(t) ? o("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(t) : r.set(t, e), u = (t, r, e, c) => (n(t, r, "write to private field"), c ? c.call(t, e) : r.set(t, e), e);
6
+ import { MosaicClient as d, clausePoints as f } from "@uwdata/mosaic-core";
7
+ import { Query as p } from "@uwdata/mosaic-sql";
8
+ import { column as y } from "./arrow.js";
9
+ var h, s, m, a;
10
+ class w extends d {
11
+ constructor(e) {
12
+ super(e.filterBy);
13
+ l(this, h);
14
+ l(this, s);
15
+ l(this, m);
16
+ l(this, a);
17
+ u(this, h, e.table), u(this, s, e.idField), u(this, m, e.as), u(this, a, e.onSurvivors);
18
+ }
19
+ query(e = []) {
20
+ return p.from(i(this, h)).select({ id: i(this, s) }).where(e);
21
+ }
22
+ queryResult(e) {
23
+ return i(this, a).call(this, y(e, "id")), this;
24
+ }
25
+ /** `null` retracts the selection: an empty clause has a null predicate, which the resolver drops. */
26
+ publish(e) {
27
+ i(this, m).update(
28
+ f([i(this, s)], e == null ? void 0 : e.map((c) => [c]), {
29
+ source: this,
30
+ // A crossfilter normally exempts a client from its own clause, so a brush can be widened
31
+ // after it has collapsed the chart under it. A view that FADES an excluded row instead of
32
+ // removing it does not need the exemption: the row is still on screen and still
33
+ // selectable. Declining it is what makes the selection visible — the fade is the brush.
34
+ clients: /* @__PURE__ */ new Set()
35
+ })
36
+ );
37
+ }
38
+ }
39
+ h = new WeakMap(), s = new WeakMap(), m = new WeakMap(), a = new WeakMap();
40
+ export {
41
+ w as IdSetClient
42
+ };
43
+ //# sourceMappingURL=id-set-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id-set-client.js","sources":["../../src/charts/id-set-client.ts"],"sourcesContent":["import { MosaicClient, clausePoints, type Selection } from \"@uwdata/mosaic-core\";\nimport { Query, type FilterExpr } from \"@uwdata/mosaic-sql\";\nimport { column } from \"./arrow.js\";\n\n/**\n * The crossfilter adapter for a view whose positions are not in the database.\n *\n * A `MosaicClient` asks for two things, and this is both:\n *\n * `query(filter)` — which rows survive the page's filters? The coordinator answers with a column\n * of ids, and the view fades everything else. The **observable** half.\n * `publish(ids)` — the user selected these. A points clause, `id IN (…)`, which every other chart\n * on the page filters by. The **controllable** half.\n *\n * The id list is not a shortcut, it is the only thing such a view can say. A Plot brush publishes\n * `weight BETWEEN …`, an interval in data space, because Plot's `x` IS a column. A GPU simulation's\n * `x` exists nowhere in the database, so no predicate over columns can describe the loop the user\n * drew. Enumerating what was hit is the honest translation — and its cost is the length of the `IN`\n * list, which is the real ceiling on the whole approach.\n *\n * Nothing here knows what draws. It is named for what it exchanges rather than for the renderer it\n * was first written against, because a canvas, a map and an imperative widget all reach the\n * crossfilter through exactly this shape.\n */\n\nexport interface IdSetClientOptions {\n /** The relation. Its `idField` column is what gets published and matched. */\n table: string;\n idField: string;\n /** What the view fades by. */\n filterBy: Selection;\n /** Where the selection publishes. */\n as: Selection;\n /** The surviving ids, in relation order, on every filter change. */\n onSurvivors: (ids: readonly unknown[]) => void;\n}\n\nexport class IdSetClient extends MosaicClient {\n #table: string;\n #idField: string;\n #as: Selection;\n #emit: (ids: readonly unknown[]) => void;\n\n constructor(options: IdSetClientOptions) {\n super(options.filterBy);\n this.#table = options.table;\n this.#idField = options.idField;\n this.#as = options.as;\n this.#emit = options.onSurvivors;\n }\n\n override query(filter: FilterExpr = []) {\n return Query.from(this.#table).select({ id: this.#idField }).where(filter);\n }\n\n override queryResult(data: unknown): this {\n this.#emit(column(data, \"id\"));\n return this;\n }\n\n /** `null` retracts the selection: an empty clause has a null predicate, which the resolver drops. */\n publish(ids: readonly unknown[] | null): void {\n this.#as.update(\n clausePoints([this.#idField], ids?.map((id) => [id]), {\n source: this,\n // A crossfilter normally exempts a client from its own clause, so a brush can be widened\n // after it has collapsed the chart under it. A view that FADES an excluded row instead of\n // removing it does not need the exemption: the row is still on screen and still\n // selectable. Declining it is what makes the selection visible — the fade is the brush.\n clients: new Set<MosaicClient>(),\n }),\n );\n }\n}\n"],"names":["IdSetClient","MosaicClient","options","__privateAdd","_table","_idField","_as","_emit","__privateSet","filter","Query","__privateGet","data","column","ids","clausePoints","id"],"mappings":";;;;;;;;;AAqCO,MAAMA,UAAoBC,EAAa;AAAA,EAM5C,YAAYC,GAA6B;AACvC,UAAMA,EAAQ,QAAQ;AANxB,IAAAC,EAAA,MAAAC;AACA,IAAAD,EAAA,MAAAE;AACA,IAAAF,EAAA,MAAAG;AACA,IAAAH,EAAA,MAAAI;AAIE,IAAAC,EAAA,MAAKJ,GAASF,EAAQ,QACtBM,EAAA,MAAKH,GAAWH,EAAQ,UACxBM,EAAA,MAAKF,GAAMJ,EAAQ,KACnBM,EAAA,MAAKD,GAAQL,EAAQ;AAAA,EACvB;AAAA,EAES,MAAMO,IAAqB,IAAI;AACtC,WAAOC,EAAM,KAAKC,EAAA,MAAKP,EAAM,EAAE,OAAO,EAAE,IAAIO,EAAA,MAAKN,GAAA,CAAU,EAAE,MAAMI,CAAM;AAAA,EAC3E;AAAA,EAES,YAAYG,GAAqB;AACxC,WAAAD,EAAA,MAAKJ,GAAL,WAAWM,EAAOD,GAAM,IAAI,IACrB;AAAA,EACT;AAAA;AAAA,EAGA,QAAQE,GAAsC;AAC5C,IAAAH,EAAA,MAAKL,GAAI;AAAA,MACPS,EAAa,CAACJ,EAAA,MAAKN,EAAQ,GAAGS,KAAA,gBAAAA,EAAK,IAAI,CAACE,MAAO,CAACA,CAAE,IAAI;AAAA,QACpD,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,QAKR,6BAAa,IAAA;AAAA,MAAkB,CAChC;AAAA,IAAA;AAAA,EAEL;AACF;AAnCEZ,IAAA,eACAC,IAAA,eACAC,IAAA,eACAC,IAAA;"}
@@ -0,0 +1,70 @@
1
+ import { ReactNode } from 'react';
2
+ import { Selection, Coordinator } from '@uwdata/mosaic-core';
3
+ /**
4
+ * MosaicProvider — the crossfilter context every chart on this subpath reads from.
5
+ *
6
+ * **Bring-your-own coordinator**, the way CodeEditor is bring-your-own-language. The package
7
+ * never instantiates a `Coordinator` and never imports DuckDB-WASM: the consumer builds the
8
+ * coordinator over their own backend (`wasmConnector()` + `new Coordinator(connector)`, a
9
+ * socket/REST connector, a shared worker…) and passes it in. That single decision is what keeps
10
+ * DuckDB-WASM out of the library bundle and out of any React Server Component — the whole boot
11
+ * lives in the consumer's `"use client"` island.
12
+ *
13
+ * The provider does two things: it registers the caller's coordinator as vgplot's active one, so
14
+ * `vg.plot(...)` marks resolve their queries through it, and it hands every descendant chart a
15
+ * shared `Selection.crossfilter()` so brushing one chart filters the others.
16
+ */
17
+ export interface MosaicContextValue {
18
+ /** The caller-supplied coordinator. Also registered as vgplot's active coordinator. */
19
+ coordinator: Coordinator;
20
+ /** The shared crossfilter selection every chart **filters by**. */
21
+ crossfilter: Selection;
22
+ /**
23
+ * Every clause published by any chart on the page, flattened into one plain union — the page-wide
24
+ * read model, for a filter-chip row or a readout. Relayed into `crossfilter`.
25
+ *
26
+ * It is **not** what a chart highlights by: a page-wide selection names columns other charts
27
+ * group by, and that is a binder error waiting to happen (see `chart-root`). Charts publish into
28
+ * a selection of their own, which converges here.
29
+ */
30
+ selected: Selection;
31
+ /**
32
+ * Enrols a selection in `reset()`. With `relay` (what `ChartRoot` does for the selection it owns)
33
+ * the selection's clauses are also forwarded into `selected`, and from there into `crossfilter`.
34
+ * Returns the unregister.
35
+ */
36
+ registerSelection: (selection: Selection, options?: {
37
+ relay?: boolean;
38
+ }) => () => void;
39
+ /**
40
+ * Clears every clause on the page — the shared selections **and** every registered chart
41
+ * selection. `Selection.reset()` travels downstream only, so resetting `crossfilter` alone leaves
42
+ * each chart holding its own pick; this is the call a "Clear filters" button wants.
43
+ */
44
+ reset: () => void;
45
+ }
46
+ export interface MosaicProviderProps {
47
+ /**
48
+ * The Mosaic `Coordinator`, constructed by the caller over their own DuckDB / connector.
49
+ * The package never builds one — see the module note.
50
+ */
51
+ coordinator: Coordinator;
52
+ /**
53
+ * The crossfilter `Selection` every descendant chart filters by. Defaults to a fresh
54
+ * `Selection.crossfilter()`. Pass one to share a selection across trees or to seed a predicate;
55
+ * everything below still works, because the provider relays into it rather than constructing it.
56
+ */
57
+ crossfilter?: Selection;
58
+ children: ReactNode;
59
+ }
60
+ export declare function MosaicProvider({ coordinator, crossfilter, children }: MosaicProviderProps): import("react").JSX.Element;
61
+ /** The Mosaic context — coordinator, shared selections, `registerSelection` and `reset`. */
62
+ export declare function useMosaic(): MosaicContextValue;
63
+ /** The shared crossfilter `Selection` — what a chart's marks filter by. */
64
+ export declare function useCrossfilter(): Selection;
65
+ /**
66
+ * Every chart clause on the page in one plain union — a read model, not a publish target. To clear
67
+ * the page use `useMosaic().reset()`: a reset here never reaches the per-chart selections upstream.
68
+ */
69
+ export declare function useSelected(): Selection;
70
+ //# sourceMappingURL=mosaic-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mosaic-provider.d.ts","sourceRoot":"","sources":["../../src/charts/mosaic-provider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA8C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACnF,OAAO,EAAE,SAAS,EAAuC,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvG;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,kBAAkB;IACjC,uFAAuF;IACvF,WAAW,EAAE,WAAW,CAAC;IACzB,mEAAmE;IACnE,WAAW,EAAE,SAAS,CAAC;IACvB;;;;;;;OAOG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,iBAAiB,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,MAAM,IAAI,CAAC;IACvF;;;;OAIG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAID,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;;;OAIG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC;CACrB;AA4BD,wBAAgB,cAAc,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,mBAAmB,+BA4CzF;AAED,4FAA4F;AAC5F,wBAAgB,SAAS,IAAI,kBAAkB,CAI9C;AAED,2EAA2E;AAC3E,wBAAgB,cAAc,IAAI,SAAS,CAE1C;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,SAAS,CAEvC"}
@@ -0,0 +1,53 @@
1
+ "use client";
2
+ import { jsx as M } from "react/jsx-runtime";
3
+ import { createContext as v, useRef as w, useMemo as C, useContext as S } from "react";
4
+ import { coordinator as h, Selection as i } from "@uwdata/mosaic-core";
5
+ const l = v(null);
6
+ function d(e, t) {
7
+ return e._relay.add(t), () => {
8
+ e._relay.delete(t);
9
+ };
10
+ }
11
+ function b({ coordinator: e, crossfilter: t, children: f }) {
12
+ const n = w(null);
13
+ n.current ?? (n.current = /* @__PURE__ */ new Set());
14
+ const m = C(() => {
15
+ h(e);
16
+ const o = n.current, s = i.union(), c = t ?? i.crossfilter();
17
+ return d(s, c), {
18
+ coordinator: e,
19
+ crossfilter: c,
20
+ selected: s,
21
+ registerSelection(r, u) {
22
+ if (o.add(r), !(u != null && u.relay)) return () => void o.delete(r);
23
+ const x = d(r, s);
24
+ return () => {
25
+ o.delete(r), r.reset(), x();
26
+ };
27
+ },
28
+ reset() {
29
+ for (const r of o) r.reset();
30
+ s.reset(), c.reset();
31
+ }
32
+ };
33
+ }, [e, t]);
34
+ return /* @__PURE__ */ M(l.Provider, { value: m, children: f });
35
+ }
36
+ function a() {
37
+ const e = S(l);
38
+ if (!e) throw new Error("useMosaic must be used within a <MosaicProvider>.");
39
+ return e;
40
+ }
41
+ function j() {
42
+ return a().crossfilter;
43
+ }
44
+ function p() {
45
+ return a().selected;
46
+ }
47
+ export {
48
+ b as MosaicProvider,
49
+ j as useCrossfilter,
50
+ a as useMosaic,
51
+ p as useSelected
52
+ };
53
+ //# sourceMappingURL=mosaic-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mosaic-provider.js","sources":["../../src/charts/mosaic-provider.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext, useMemo, useRef, type ReactNode } from \"react\";\nimport { Selection, coordinator as setActiveCoordinator, type Coordinator } from \"@uwdata/mosaic-core\";\n\n/**\n * MosaicProvider — the crossfilter context every chart on this subpath reads from.\n *\n * **Bring-your-own coordinator**, the way CodeEditor is bring-your-own-language. The package\n * never instantiates a `Coordinator` and never imports DuckDB-WASM: the consumer builds the\n * coordinator over their own backend (`wasmConnector()` + `new Coordinator(connector)`, a\n * socket/REST connector, a shared worker…) and passes it in. That single decision is what keeps\n * DuckDB-WASM out of the library bundle and out of any React Server Component — the whole boot\n * lives in the consumer's `\"use client\"` island.\n *\n * The provider does two things: it registers the caller's coordinator as vgplot's active one, so\n * `vg.plot(...)` marks resolve their queries through it, and it hands every descendant chart a\n * shared `Selection.crossfilter()` so brushing one chart filters the others.\n */\n\nexport interface MosaicContextValue {\n /** The caller-supplied coordinator. Also registered as vgplot's active coordinator. */\n coordinator: Coordinator;\n /** The shared crossfilter selection every chart **filters by**. */\n crossfilter: Selection;\n /**\n * Every clause published by any chart on the page, flattened into one plain union — the page-wide\n * read model, for a filter-chip row or a readout. Relayed into `crossfilter`.\n *\n * It is **not** what a chart highlights by: a page-wide selection names columns other charts\n * group by, and that is a binder error waiting to happen (see `chart-root`). Charts publish into\n * a selection of their own, which converges here.\n */\n selected: Selection;\n /**\n * Enrols a selection in `reset()`. With `relay` (what `ChartRoot` does for the selection it owns)\n * the selection's clauses are also forwarded into `selected`, and from there into `crossfilter`.\n * Returns the unregister.\n */\n registerSelection: (selection: Selection, options?: { relay?: boolean }) => () => void;\n /**\n * Clears every clause on the page — the shared selections **and** every registered chart\n * selection. `Selection.reset()` travels downstream only, so resetting `crossfilter` alone leaves\n * each chart holding its own pick; this is the call a \"Clear filters\" button wants.\n */\n reset: () => void;\n}\n\nconst MosaicContext = createContext<MosaicContextValue | null>(null);\n\nexport interface MosaicProviderProps {\n /**\n * The Mosaic `Coordinator`, constructed by the caller over their own DuckDB / connector.\n * The package never builds one — see the module note.\n */\n coordinator: Coordinator;\n /**\n * The crossfilter `Selection` every descendant chart filters by. Defaults to a fresh\n * `Selection.crossfilter()`. Pass one to share a selection across trees or to seed a predicate;\n * everything below still works, because the provider relays into it rather than constructing it.\n */\n crossfilter?: Selection;\n children: ReactNode;\n}\n\n/**\n * Relay `from`'s clauses into `to`, **after** both already exist.\n *\n * Mosaic exposes relaying only through the constructor's `include` option, and all `include` does\n * is `upstream._relay.add(downstream)`. That is useless to us: a `ChartRoot`'s selection is born\n * when the chart mounts, long after the provider built the crossfilter it has to feed, and a\n * selection handed in as a prop was built by the caller. So we do the `add` ourselves.\n *\n * `_relay` is underscore-prefixed but genuinely public — `Set<Selection>`, no `private` modifier,\n * present in mosaic-core 0.29's emitted `.d.ts` — and it is the single channel every relayed path\n * in `Selection` uses: `update`, `activate` and `reset` all end in `_relay.forEach(...)`. Which is\n * exactly why the obvious alternative is worse: subscribing to `from` and re-publishing into `to`\n * arrives an async tick late, can lose a clause when the dispatch queue coalesces two updates, and\n * cannot forward `reset()` at all — `reset` is a method, it emits no event.\n *\n * Relaying passes the **clause object itself**, so `source` and `clients` survive. That matters:\n * the crossfilter exempts a chart from its own clause by looking at `clause.clients`, and a copy\n * would make every chart filter itself away.\n */\nfunction relay(from: Selection, to: Selection): () => void {\n from._relay.add(to);\n return () => {\n from._relay.delete(to);\n };\n}\n\nexport function MosaicProvider({ coordinator, crossfilter, children }: MosaicProviderProps) {\n // Survives the memo below, so a coordinator swap does not lose the charts already mounted.\n const registry = useRef<Set<Selection> | null>(null);\n registry.current ??= new Set<Selection>();\n\n const value = useMemo<MosaicContextValue>(() => {\n // Register the caller's coordinator as vgplot's active one. `coordinator(instance)` is\n // mosaic-core's global setter — the same call keasy's boot makes, except the instance\n // arrives as a prop here instead of being built in the library.\n setActiveCoordinator(coordinator);\n const owned = registry.current as Set<Selection>;\n const selected = Selection.union();\n const shared = crossfilter ?? Selection.crossfilter();\n relay(selected, shared);\n\n return {\n coordinator,\n crossfilter: shared,\n selected,\n registerSelection(selection, options) {\n owned.add(selection);\n if (!options?.relay) return () => void owned.delete(selection);\n const stop = relay(selection, selected);\n return () => {\n owned.delete(selection);\n // Withdraw before unwiring, or a chart that unmounts (a tab, a conditional) leaves its\n // clause filtering the page with nothing left on screen to clear it. Only for selections\n // the root minted — a caller's `as` may well outlive this chart.\n selection.reset();\n stop();\n };\n },\n reset() {\n // Children first: each relays its own removal downstream into `selected` and the\n // crossfilter. The two shared resets then take whatever was published straight into them —\n // a `ChartFilter`, a `ChartSearch`, a clause the caller seeded.\n for (const selection of owned) selection.reset();\n selected.reset();\n shared.reset();\n },\n };\n }, [coordinator, crossfilter]);\n\n return <MosaicContext.Provider value={value}>{children}</MosaicContext.Provider>;\n}\n\n/** The Mosaic context — coordinator, shared selections, `registerSelection` and `reset`. */\nexport function useMosaic(): MosaicContextValue {\n const ctx = useContext(MosaicContext);\n if (!ctx) throw new Error(\"useMosaic must be used within a <MosaicProvider>.\");\n return ctx;\n}\n\n/** The shared crossfilter `Selection` — what a chart's marks filter by. */\nexport function useCrossfilter(): Selection {\n return useMosaic().crossfilter;\n}\n\n/**\n * Every chart clause on the page in one plain union — a read model, not a publish target. To clear\n * the page use `useMosaic().reset()`: a reset here never reaches the per-chart selections upstream.\n */\nexport function useSelected(): Selection {\n return useMosaic().selected;\n}\n"],"names":["setActiveCoordinator","coordinator"],"mappings":";;;;AAgDA;AAoCA;AACE;AAEE;AAAqB;AAEzB;AAEO;AAEL;AACA;AAEA;AAIEA;AACA;AAGA;AAEO;AACLC;AACa;AACb;AAGE;AACA;AACA;AACE;AAKA;AACF;AACF;AAKE;AACA;AACO;AACT;AAAA;AAIJ;AACF;AAGO;AACL;AACA;AACA;AACF;AAGO;AACL;AACF;AAMO;AACL;AACF;;;;;;;"}
@@ -0,0 +1,22 @@
1
+ import { MosaicClient, Selection } from '@uwdata/mosaic-core';
2
+ import { Query, FilterExpr } from '@uwdata/mosaic-sql';
3
+ export type ChartQueryRow = Record<string, unknown>;
4
+ /**
5
+ * Bridges React state to the Mosaic client life-cycle: one query in, one row array out.
6
+ *
7
+ * `useChartQuery` and `useMosaicInput` had a copy of this each — same two private fields, same
8
+ * `super(filterBy)`, same `query()`, same `queryResult()`, differing only in the name of the row
9
+ * alias. Two copies is two places a Mosaic life-cycle bug can hide, and the crossfilter is the one
10
+ * layer where a bug shows up as a *plausible wrong number* rather than a crash.
11
+ *
12
+ * Module-level and not on `/analytics`: subclassing `MosaicClient` yourself is the documented
13
+ * protocol, and this class adds nothing to it a consumer would want — it is the plumbing under two
14
+ * hooks, both of which are exported.
15
+ */
16
+ export declare class ChartQueryClient extends MosaicClient {
17
+ #private;
18
+ constructor(filterBy: Selection | undefined, build: (filter: FilterExpr) => Query | null, emit: (rows: readonly ChartQueryRow[]) => void);
19
+ query(filter?: FilterExpr | null): Query | null;
20
+ queryResult(data: unknown): this;
21
+ }
22
+ //# sourceMappingURL=query-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-client.d.ts","sourceRoot":"","sources":["../../src/charts/query-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEpD;;;;;;;;;;;GAWG;AACH,qBAAa,gBAAiB,SAAQ,YAAY;;gBAK9C,QAAQ,EAAE,SAAS,GAAG,SAAS,EAC/B,KAAK,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,KAAK,GAAG,IAAI,EAC3C,IAAI,EAAE,CAAC,IAAI,EAAE,SAAS,aAAa,EAAE,KAAK,IAAI;IAOvC,KAAK,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI;IAI/C,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;CAI1C"}
@@ -0,0 +1,26 @@
1
+ var l = (r) => {
2
+ throw TypeError(r);
3
+ };
4
+ var a = (r, e, t) => e.has(r) || l("Cannot " + t);
5
+ var o = (r, e, t) => (a(r, e, "read from private field"), t ? t.call(r) : e.get(r)), h = (r, e, t) => e.has(r) ? l("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), n = (r, e, t, u) => (a(r, e, "write to private field"), u ? u.call(r, t) : e.set(r, t), t);
6
+ import { MosaicClient as m } from "@uwdata/mosaic-core";
7
+ var s, i;
8
+ class C extends m {
9
+ constructor(t, u, c) {
10
+ super(t);
11
+ h(this, s);
12
+ h(this, i);
13
+ n(this, s, u), n(this, i, c);
14
+ }
15
+ query(t) {
16
+ return o(this, s).call(this, t ?? []);
17
+ }
18
+ queryResult(t) {
19
+ return o(this, i).call(this, Array.from(t)), this;
20
+ }
21
+ }
22
+ s = new WeakMap(), i = new WeakMap();
23
+ export {
24
+ C as ChartQueryClient
25
+ };
26
+ //# sourceMappingURL=query-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-client.js","sources":["../../src/charts/query-client.ts"],"sourcesContent":["import { MosaicClient, type Selection } from \"@uwdata/mosaic-core\";\nimport type { Query, FilterExpr } from \"@uwdata/mosaic-sql\";\n\nexport type ChartQueryRow = Record<string, unknown>;\n\n/**\n * Bridges React state to the Mosaic client life-cycle: one query in, one row array out.\n *\n * `useChartQuery` and `useMosaicInput` had a copy of this each — same two private fields, same\n * `super(filterBy)`, same `query()`, same `queryResult()`, differing only in the name of the row\n * alias. Two copies is two places a Mosaic life-cycle bug can hide, and the crossfilter is the one\n * layer where a bug shows up as a *plausible wrong number* rather than a crash.\n *\n * Module-level and not on `/analytics`: subclassing `MosaicClient` yourself is the documented\n * protocol, and this class adds nothing to it a consumer would want — it is the plumbing under two\n * hooks, both of which are exported.\n */\nexport class ChartQueryClient extends MosaicClient {\n #build: (filter: FilterExpr) => Query | null;\n #emit: (rows: readonly ChartQueryRow[]) => void;\n\n constructor(\n filterBy: Selection | undefined,\n build: (filter: FilterExpr) => Query | null,\n emit: (rows: readonly ChartQueryRow[]) => void,\n ) {\n super(filterBy);\n this.#build = build;\n this.#emit = emit;\n }\n\n override query(filter?: FilterExpr | null): Query | null {\n return this.#build(filter ?? []);\n }\n\n override queryResult(data: unknown): this {\n this.#emit(Array.from(data as Iterable<ChartQueryRow>));\n return this;\n }\n}\n"],"names":["ChartQueryClient","MosaicClient","filterBy","build","emit","__privateAdd","_build","_emit","__privateSet","filter","__privateGet","data"],"mappings":";;;;;;;AAiBO,MAAMA,UAAyBC,EAAa;AAAA,EAIjD,YACEC,GACAC,GACAC,GACA;AACA,UAAMF,CAAQ;AARhB,IAAAG,EAAA,MAAAC;AACA,IAAAD,EAAA,MAAAE;AAQE,IAAAC,EAAA,MAAKF,GAASH,IACdK,EAAA,MAAKD,GAAQH;AAAA,EACf;AAAA,EAES,MAAMK,GAA0C;AACvD,WAAOC,EAAA,MAAKJ,GAAL,WAAYG,KAAU;EAC/B;AAAA,EAES,YAAYE,GAAqB;AACxC,WAAAD,EAAA,MAAKH,GAAL,WAAW,MAAM,KAAKI,CAA+B,IAC9C;AAAA,EACT;AACF;AArBEL,IAAA,eACAC,IAAA;"}
@@ -0,0 +1,26 @@
1
+ export interface TokenizedPlotProps {
2
+ /**
3
+ * Builds the vgplot element from the measured container width; return
4
+ * `vg.plot(..., vg.width(width))`. Re-invoked whenever a `deps` entry, the width or the theme
5
+ * changes, and the result is mounted via `container.replaceChildren(...)` — the same imperative
6
+ * mount vgplot needs (it renders an SVG/HTML node, not React).
7
+ *
8
+ * `host` is for resolving tokens against the cascade the chart actually sits in —
9
+ * `resolveTokenColor(host, "--chart-1")`. It is the only colour channel this frame offers,
10
+ * because a fixed pair of colours is a guess about what the plot paints with.
11
+ */
12
+ render: (width: number, host: HTMLDivElement) => Node;
13
+ /** Inputs that rebuild the plot when they change (table, column, selection, height…). */
14
+ deps: unknown[];
15
+ className?: string;
16
+ }
17
+ /**
18
+ * The frame under `ChartRoot`: measure the container, build the vgplot node, and mount it
19
+ * imperatively into a token-coloured container.
20
+ *
21
+ * `text-foreground` on the host is load-bearing — Observable Plot draws axis ticks and labels
22
+ * with `currentColor`, so inheriting the foreground token is what keeps the axes legible in both
23
+ * light and dark without resolving a third colour.
24
+ */
25
+ export declare function TokenizedPlot({ render, deps, className }: TokenizedPlotProps): import("react").JSX.Element;
26
+ //# sourceMappingURL=tokenized-plot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokenized-plot.d.ts","sourceRoot":"","sources":["../../src/charts/tokenized-plot.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;;OASG;IACH,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IACtD,yFAAyF;IACzF,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAKD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,kBAAkB,+BAyD5E"}
@@ -0,0 +1,41 @@
1
+ "use client";
2
+ import { jsx as R } from "react/jsx-runtime";
3
+ import { useRef as d, useState as w, useEffect as a } from "react";
4
+ import { cn as E } from "../lib/cn.js";
5
+ import { useThemeTick as v } from "../lib/theme-tick.js";
6
+ const S = 140;
7
+ function C({ render: c, deps: m, className: h }) {
8
+ const r = d(null), s = d(c);
9
+ s.current = c;
10
+ const p = v(), [n, o] = w(0);
11
+ return a(() => {
12
+ const e = r.current;
13
+ if (!e || typeof ResizeObserver > "u") {
14
+ e && o(e.clientWidth);
15
+ return;
16
+ }
17
+ let t = null, u = !0;
18
+ const f = new ResizeObserver((T) => {
19
+ var l;
20
+ const i = Math.round(((l = T[0]) == null ? void 0 : l.contentRect.width) ?? 0);
21
+ if (!(i <= 0)) {
22
+ if (u) {
23
+ u = !1, o(i);
24
+ return;
25
+ }
26
+ t && clearTimeout(t), t = setTimeout(() => o(i), S);
27
+ }
28
+ });
29
+ return f.observe(e), () => {
30
+ t && clearTimeout(t), f.disconnect();
31
+ };
32
+ }, []), a(() => {
33
+ const e = r.current;
34
+ if (!(!e || n === 0))
35
+ return e.replaceChildren(s.current(n, e)), () => e.replaceChildren();
36
+ }, [p, n, ...m]), /* @__PURE__ */ R("div", { ref: r, "data-slot": "chart", className: E("w-full text-foreground", h) });
37
+ }
38
+ export {
39
+ C as TokenizedPlot
40
+ };
41
+ //# sourceMappingURL=tokenized-plot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokenized-plot.js","sources":["../../src/charts/tokenized-plot.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport { cn } from \"../lib/cn.js\";\nimport { useThemeTick } from \"../lib/theme-tick.js\";\n\nexport interface TokenizedPlotProps {\n /**\n * Builds the vgplot element from the measured container width; return\n * `vg.plot(..., vg.width(width))`. Re-invoked whenever a `deps` entry, the width or the theme\n * changes, and the result is mounted via `container.replaceChildren(...)` — the same imperative\n * mount vgplot needs (it renders an SVG/HTML node, not React).\n *\n * `host` is for resolving tokens against the cascade the chart actually sits in —\n * `resolveTokenColor(host, \"--chart-1\")`. It is the only colour channel this frame offers,\n * because a fixed pair of colours is a guess about what the plot paints with.\n */\n render: (width: number, host: HTMLDivElement) => Node;\n /** Inputs that rebuild the plot when they change (table, column, selection, height…). */\n deps: unknown[];\n className?: string;\n}\n\n/** How long a resize has to be quiet before the plot is rebuilt at the new width. */\nconst RESIZE_SETTLE_MS = 140;\n\n/**\n * The frame under `ChartRoot`: measure the container, build the vgplot node, and mount it\n * imperatively into a token-coloured container.\n *\n * `text-foreground` on the host is load-bearing — Observable Plot draws axis ticks and labels\n * with `currentColor`, so inheriting the foreground token is what keeps the axes legible in both\n * light and dark without resolving a third colour.\n */\nexport function TokenizedPlot({ render, deps, className }: TokenizedPlotProps) {\n const container = useRef<HTMLDivElement>(null);\n // Long-lived across rebuilds: read the latest builder without making it a dependency.\n const renderRef = useRef(render);\n renderRef.current = render;\n const tick = useThemeTick();\n const [width, setWidth] = useState(0);\n\n // Charts do not mount in a background tab. The cause is `requestAnimationFrame` in\n // `@uwdata/mosaic-plot/src/plot.js` (`requestAnimationFrame(() => this.render())`), which a\n // hidden tab never services — not the ResizeObserver below, which is the obvious suspect and\n // the wrong one. Verified while benchmarking a 20k-node plot.\n // Size the plot to its container: vgplot needs an explicit width (it defaults to 640), so a\n // bare mount overflows a narrow column. Re-measure on resize and rebuild at the new width.\n useEffect(() => {\n const host = container.current;\n if (!host || typeof ResizeObserver === \"undefined\") {\n if (host) setWidth(host.clientWidth);\n return;\n }\n // The width is a plot option, so every value it takes rebuilds the plot — and a rebuilt plot\n // builds new Mosaic clients, which re-query the database. Committing every ResizeObserver tick\n // therefore turns one drag of a splitter or window edge into a query per pixel. The first\n // measurement lands at once (nothing is on screen yet to keep steady); after that the width\n // waits for the drag to stop.\n let settle: ReturnType<typeof setTimeout> | null = null;\n // A local flag, not the `width` state: the observer is created once, so a closure over `width`\n // would read 0 forever and every tick would commit immediately.\n let first = true;\n const ro = new ResizeObserver((entries) => {\n const w = Math.round(entries[0]?.contentRect.width ?? 0);\n if (w <= 0) return;\n if (first) {\n first = false;\n setWidth(w);\n return;\n }\n if (settle) clearTimeout(settle);\n settle = setTimeout(() => setWidth(w), RESIZE_SETTLE_MS);\n });\n ro.observe(host);\n return () => {\n if (settle) clearTimeout(settle);\n ro.disconnect();\n };\n }, []);\n\n useEffect(() => {\n const host = container.current;\n if (!host || width === 0) return;\n host.replaceChildren(renderRef.current(width, host));\n return () => host.replaceChildren();\n // `render` is read through a ref; `tick` re-runs on theme change, `width`/`deps` on resize/input.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [tick, width, ...deps]);\n\n return <div ref={container} data-slot=\"chart\" className={cn(\"w-full text-foreground\", className)} />;\n}\n"],"names":[],"mappings":";;;;;AAwBA;AAUO;AACL;AAGA;AACA;AASA;AACE;AACA;AACE;AACA;AAAA;AAOF;AAIA;;AACE;AACA;AACA;AACE;AAEA;AAAA;AAEF;AACuD;AAAA;AAEzD;AAEE;AACG;AACL;AAIA;AACA;AACA;AACkB;AAMtB;;;;"}
@@ -0,0 +1,30 @@
1
+ import { Selection } from '@uwdata/mosaic-core';
2
+ import { Query, FilterExpr } from '@uwdata/mosaic-sql';
3
+ import { ChartQueryRow } from './query-client.js';
4
+ /**
5
+ * Read a relation from the same coordinator the charts use, and follow the same crossfilter.
6
+ *
7
+ * A dashboard always has something that is not a plot — a KPI, a readout, a table — and it has to
8
+ * move with the brush like everything else. Doing that by hand means connecting a `MosaicClient`,
9
+ * and a widget that instead runs a plain `coordinator.query()` in an effect reports **unfiltered**
10
+ * totals sitting next to filtered charts, which reads as a bug in the crossfilter.
11
+ */
12
+ export type { ChartQueryRow };
13
+ export interface ChartQueryOptions {
14
+ /** Builds the query from the crossfilter predicate; return `null` to ask for nothing. */
15
+ query: (filter: FilterExpr) => Query | null;
16
+ /** What to filter by. Defaults to the provider's crossfilter; `null` reads the full relation. */
17
+ filterBy?: Selection | null;
18
+ /** Rebuilds the client — and re-runs the query — when an entry changes. */
19
+ deps?: readonly unknown[];
20
+ }
21
+ export interface ChartQueryResult {
22
+ /** The rows, or `null` while the first query is in flight. */
23
+ rows: readonly ChartQueryRow[] | null;
24
+ /** The first row, for the common single-aggregate case. */
25
+ row: ChartQueryRow | undefined;
26
+ }
27
+ export declare function useChartQuery(options: ChartQueryOptions): ChartQueryResult;
28
+ /** Re-exported so a caller builds a query without a direct `@uwdata/mosaic-sql` import. */
29
+ export { Query };
30
+ //# sourceMappingURL=use-chart-query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-chart-query.d.ts","sourceRoot":"","sources":["../../src/charts/use-chart-query.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAG5D,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEzE;;;;;;;GAOG;AAEH,YAAY,EAAE,aAAa,EAAE,CAAC;AAE9B,MAAM,WAAW,iBAAiB;IAChC,yFAAyF;IACzF,KAAK,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,KAAK,GAAG,IAAI,CAAC;IAC5C,iGAAiG;IACjG,QAAQ,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B,2EAA2E;IAC3E,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,IAAI,EAAE,SAAS,aAAa,EAAE,GAAG,IAAI,CAAC;IACtC,2DAA2D;IAC3D,GAAG,EAAE,aAAa,GAAG,SAAS,CAAC;CAChC;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,CAmB1E;AAED,2FAA2F;AAC3F,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ import { Query as x } from "@uwdata/mosaic-sql";
3
+ import { useRef as m, useState as a, useEffect as y } from "react";
4
+ import { useMosaic as d } from "./mosaic-provider.js";
5
+ import { ChartQueryClient as p } from "./query-client.js";
6
+ function q(r) {
7
+ const { filterBy: o, deps: i = [] } = r, { coordinator: t, crossfilter: f } = d(), n = o === void 0 ? f : o, c = m(r.query);
8
+ c.current = r.query;
9
+ const [e, u] = a(null);
10
+ return y(() => {
11
+ const s = new p(n ?? void 0, (l) => c.current(l), u);
12
+ return u(null), t.connect(s), () => t.disconnect(s);
13
+ }, [t, n, ...i]), { rows: e, row: e == null ? void 0 : e[0] };
14
+ }
15
+ export {
16
+ x as Query,
17
+ q as useChartQuery
18
+ };
19
+ //# sourceMappingURL=use-chart-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-chart-query.js","sources":["../../src/charts/use-chart-query.ts"],"sourcesContent":["\"use client\";\n\nimport type { Selection } from \"@uwdata/mosaic-core\";\nimport { Query, type FilterExpr } from \"@uwdata/mosaic-sql\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { useMosaic } from \"./mosaic-provider.js\";\nimport { ChartQueryClient, type ChartQueryRow } from \"./query-client.js\";\n\n/**\n * Read a relation from the same coordinator the charts use, and follow the same crossfilter.\n *\n * A dashboard always has something that is not a plot — a KPI, a readout, a table — and it has to\n * move with the brush like everything else. Doing that by hand means connecting a `MosaicClient`,\n * and a widget that instead runs a plain `coordinator.query()` in an effect reports **unfiltered**\n * totals sitting next to filtered charts, which reads as a bug in the crossfilter.\n */\n\nexport type { ChartQueryRow };\n\nexport interface ChartQueryOptions {\n /** Builds the query from the crossfilter predicate; return `null` to ask for nothing. */\n query: (filter: FilterExpr) => Query | null;\n /** What to filter by. Defaults to the provider's crossfilter; `null` reads the full relation. */\n filterBy?: Selection | null;\n /** Rebuilds the client — and re-runs the query — when an entry changes. */\n deps?: readonly unknown[];\n}\n\nexport interface ChartQueryResult {\n /** The rows, or `null` while the first query is in flight. */\n rows: readonly ChartQueryRow[] | null;\n /** The first row, for the common single-aggregate case. */\n row: ChartQueryRow | undefined;\n}\n\nexport function useChartQuery(options: ChartQueryOptions): ChartQueryResult {\n const { filterBy, deps = [] } = options;\n const { coordinator, crossfilter } = useMosaic();\n const source = filterBy === undefined ? crossfilter : filterBy;\n // Read the latest builder without making it a dependency: an inline arrow would reconnect the\n // client on every render, and reconnecting re-runs the query.\n const latest = useRef(options.query);\n latest.current = options.query;\n const [rows, setRows] = useState<readonly ChartQueryRow[] | null>(null);\n\n useEffect(() => {\n const client = new ChartQueryClient(source ?? undefined, (filter) => latest.current(filter), setRows);\n setRows(null);\n coordinator.connect(client);\n return () => coordinator.disconnect(client);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [coordinator, source, ...deps]);\n\n return { rows, row: rows?.[0] };\n}\n\n/** Re-exported so a caller builds a query without a direct `@uwdata/mosaic-sql` import. */\nexport { Query };\n"],"names":[],"mappings":";;;;;AAmCO;AACL;AAMA;AACA;AAEA;AACE;AACA;AAE0C;AAK9C;;;;;"}
@@ -0,0 +1,64 @@
1
+ import { Extension } from '@codemirror/state';
2
+ import { EditorView } from '@codemirror/view';
3
+ import { HighlightStyle } from '@codemirror/language';
4
+ /**
5
+ * Kanzo syntax theme — maps Lezer highlight tags to the design tokens, so a consumer's language
6
+ * extension is coloured by whichever palette document is on the page. Exported so a
7
+ * bring-your-own editor can wire the same palette. Inert until the caller injects a language
8
+ * (there is no tree to tag).
9
+ *
10
+ * **Seven of these are `--syntax-*` and the rest are tokens that already existed**, which is the
11
+ * shape the palette layer settled on: `comment` is `--faint` (the quietest legible ink — a gutter
12
+ * number, a field's placeholder and a code comment are one decision), `punctuation` is
13
+ * `--muted-foreground`, `operator` is `--foreground`, and `invalid` is the destructive family.
14
+ * There were thirteen `--syntax-*` tokens; six of them were duplicating a tint the ramp
15
+ * already publishes.
16
+ *
17
+ * The seven that remain are derived per tenant and graded against `--editor-active-line`, so a
18
+ * palette finally repaints keywords: Dracula's pink, Nord's purple, Catppuccin's mauve. Every
19
+ * document used to declare Kanzo's.
20
+ */
21
+ export declare const kanzoHighlightStyle: HighlightStyle;
22
+ /** The Kanzo highlight style as a ready-to-drop extension. */
23
+ export declare const kanzoHighlighting: Extension;
24
+ export interface CodeEditorProps {
25
+ value: string;
26
+ onChange?: (value: string) => void;
27
+ /** The language brain — CodeMirror extensions injected by the consumer (LSP,
28
+ * StreamParser, autocomplete, linting…). Reconfigured live when it changes. */
29
+ extensions?: Extension;
30
+ readOnly?: boolean;
31
+ lineNumbers?: boolean;
32
+ invalid?: boolean;
33
+ placeholder?: string;
34
+ minHeight?: string;
35
+ maxHeight?: string;
36
+ /** Include the built-in batteries (history + default keymap + line wrapping +
37
+ * the Kanzo token theme). Default true. Set false when the caller's `extensions`
38
+ * own all behaviour and theming. */
39
+ basics?: boolean;
40
+ /**
41
+ * Wrap long lines, or scroll sideways. Default true, which is what `basics` always did.
42
+ *
43
+ * Wrapping is right where the editor is a reading surface in a narrow pane; it is wrong where
44
+ * the document has structure a reader tracks by column — a Turtle predicate list read against
45
+ * its indentation stops being a list once every third line reflows. There is no third option:
46
+ * `EditorView.lineWrapping` is on or it is not.
47
+ *
48
+ * Read once, when the view is built — like `basics`, and for the same reason. Changing it after
49
+ * mount does nothing.
50
+ */
51
+ wrap?: boolean;
52
+ /**
53
+ * Wrap the editor in the styled focus-ring chrome (Box + inset ring + surface background).
54
+ * Default true. Set false for a bare surface.
55
+ */
56
+ chrome?: boolean;
57
+ /** Class applied to the editor host (only meaningful when `chrome={false}`). */
58
+ className?: string;
59
+ /** Receives the `EditorView` on mount and `null` on unmount — for side-wiring
60
+ * (e.g. pushing LSP notifications). */
61
+ onView?: (view: EditorView | null) => void;
62
+ }
63
+ export declare function CodeEditor(p: CodeEditorProps): import("react").JSX.Element;
64
+ //# sourceMappingURL=CodeEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../src/composites/CodeEditor.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAwC,KAAK,SAAS,EAAY,MAAM,mBAAmB,CAAC;AACnG,OAAO,EAGL,UAAU,EAaX,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,cAAc,EAMf,MAAM,sBAAsB,CAAC;AAuB9B;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB,gBAiC9B,CAAC;AAEH,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,EAAE,SAAuE,CAAC;AAyXxG,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;oFACgF;IAChF,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;yCAEqC;IACrC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gFAAgF;IAChF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;4CACwC;IACxC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;CAC5C;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,eAAe,+BAiN5C"}