@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,7 @@
1
+ function t(n, l) {
2
+ return n != null && l != null && (n === l || n.startsWith(`${l}/`));
3
+ }
4
+ export {
5
+ t as isActivePath
6
+ };
7
+ //# sourceMappingURL=is-active-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-active-path.js","sources":["../../src/lib/is-active-path.ts"],"sourcesContent":["/**\n * Is `href` the active route, given the current path?\n *\n * A prefix match, but not `startsWith`: `/settings` is active on `/settings/cloud` and is **not**\n * active on `/settings-archive`. That boundary is the whole reason this is a function rather than\n * an expression written at each call site — it is four lines and it was wrong in two of them.\n *\n * The library ships no navigation component to apply it for you: a nav is a layout tree, so it is\n * hand-composed from `SidebarMenu*` and a router link through `asChild`. This is the one part of\n * that arrangement that is logic rather than markup, so it is the one part that is exported.\n */\nexport function isActivePath(activePath: string | undefined, href: string | undefined): boolean {\n return (\n activePath != null &&\n href != null &&\n (activePath === href || activePath.startsWith(`${href}/`))\n );\n}\n"],"names":["isActivePath","activePath","href"],"mappings":"AAWO,SAASA,EAAaC,GAAgCC,GAAmC;AAC9F,SACED,KAAc,QACdC,KAAQ,SACPD,MAAeC,KAAQD,EAAW,WAAW,GAAGC,CAAI,GAAG;AAE5D;"}
@@ -0,0 +1,37 @@
1
+ import { RefObject } from 'react';
2
+ /**
3
+ * Re-render the caller when the colours change, whichever way they changed.
4
+ *
5
+ * **Two sources, because there are two, and missing the second was a real regression.** Most of the
6
+ * theme reaches the page as `data-*` attributes and `.dark` on `document.documentElement`, so
7
+ * observing its attributes catches a mode flip, a density change and a brand swap. A **palette**
8
+ * changes none of them: a document is a stylesheet, so switching one replaces a `<style>` in
9
+ * `<head>` and every token underneath changes value with nothing on `<html>` moving at all. A
10
+ * MutationObserver on the root cannot see that, so a WebGL graph holding colours in buffers kept
11
+ * painting the palette it was mounted with.
12
+ *
13
+ * So there are three observations, and the third is the one that is easy to leave out. The provider
14
+ * reports the palette *preference*, which moves the moment the user clicks — but the stylesheet it
15
+ * selects usually arrives later, over the network. Ticking only then would re-resolve every token
16
+ * against the document still on the page and never look again. **`<head>` is therefore watched too**,
17
+ * for children and for character data, because that is where a document actually lands however a
18
+ * host chooses to apply it — a swapped `<style>`, a replaced `<link>`, an injected sheet.
19
+ *
20
+ * The early tick costs one wasted re-resolve and the late one is what makes the answer right. A
21
+ * `<head>` mutation is also how a router inserting route CSS looks, so this ticks a little more often
22
+ * than colour strictly changes; that is the trade, and it is the correct way round, because a false
23
+ * tick costs a rebuild and a missed one costs a graph painting a brand nobody selected.
24
+ *
25
+ * The provider half is optional, so a chart still works without one.
26
+ *
27
+ * Returns a counter to feed into an effect's dependency list.
28
+ */
29
+ export declare function useThemeTick(): number;
30
+ /**
31
+ * `categoricalCapacity` as a hook, re-read whenever the theme moves.
32
+ *
33
+ * `CHART_SLOTS` on the first render so the server and the client agree, then the measured value —
34
+ * the same shape {@link useThemeTick} already imposes on anything reading the cascade.
35
+ */
36
+ export declare function useChartCapacity(host?: RefObject<Element | null>): number;
37
+ //# sourceMappingURL=theme-tick.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-tick.d.ts","sourceRoot":"","sources":["../../src/lib/theme-tick.ts"],"names":[],"mappings":"AAMA,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAK5D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAwBrC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,MAAM,CAQzE"}
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ import { useState as a, useEffect as m } from "react";
3
+ import { CHART_SLOTS as s } from "@kanzo-tech/theme";
4
+ import { useKanzoThemeOptional as d } from "../theme/theme-context.js";
5
+ import { categoricalCapacity as f } from "./token-color.js";
6
+ function p() {
7
+ var r;
8
+ const e = ((r = d()) == null ? void 0 : r.resolvedTheme) ?? "", [n, c] = a({ tick: 0, palette: e });
9
+ return n.palette !== e && c((t) => ({ tick: t.tick + 1, palette: e })), m(() => {
10
+ if (typeof MutationObserver > "u") return;
11
+ const t = () => c((u) => ({ ...u, tick: u.tick + 1 })), o = new MutationObserver(t);
12
+ o.observe(document.documentElement, { attributes: !0 });
13
+ const i = new MutationObserver(t);
14
+ return i.observe(document.head, { childList: !0, subtree: !0, characterData: !0 }), () => {
15
+ o.disconnect(), i.disconnect();
16
+ };
17
+ }, []), n.tick;
18
+ }
19
+ function y(e) {
20
+ const n = p(), [c, r] = a(s);
21
+ return m(() => {
22
+ const t = (e == null ? void 0 : e.current) ?? (typeof document > "u" ? null : document.documentElement);
23
+ t && r(f(t));
24
+ }, [e, n]), c;
25
+ }
26
+ export {
27
+ y as useChartCapacity,
28
+ p as useThemeTick
29
+ };
30
+ //# sourceMappingURL=theme-tick.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-tick.js","sources":["../../src/lib/theme-tick.ts"],"sourcesContent":["\"use client\";\n\n// The client half of `./token-color.js`: the two hooks that re-read the live cascade. They are\n// here rather than beside the pure functions because a hook forces `\"use client\"` onto its whole\n// module, and that directive is what made `categoricalColor` unreachable from a Server Component.\n\nimport { useEffect, useState, type RefObject } from \"react\";\nimport { CHART_SLOTS } from \"@kanzo-tech/theme\";\nimport { useKanzoThemeOptional } from \"../theme/theme-context.js\";\nimport { categoricalCapacity } from \"./token-color.js\";\n\n/**\n * Re-render the caller when the colours change, whichever way they changed.\n *\n * **Two sources, because there are two, and missing the second was a real regression.** Most of the\n * theme reaches the page as `data-*` attributes and `.dark` on `document.documentElement`, so\n * observing its attributes catches a mode flip, a density change and a brand swap. A **palette**\n * changes none of them: a document is a stylesheet, so switching one replaces a `<style>` in\n * `<head>` and every token underneath changes value with nothing on `<html>` moving at all. A\n * MutationObserver on the root cannot see that, so a WebGL graph holding colours in buffers kept\n * painting the palette it was mounted with.\n *\n * So there are three observations, and the third is the one that is easy to leave out. The provider\n * reports the palette *preference*, which moves the moment the user clicks — but the stylesheet it\n * selects usually arrives later, over the network. Ticking only then would re-resolve every token\n * against the document still on the page and never look again. **`<head>` is therefore watched too**,\n * for children and for character data, because that is where a document actually lands however a\n * host chooses to apply it — a swapped `<style>`, a replaced `<link>`, an injected sheet.\n *\n * The early tick costs one wasted re-resolve and the late one is what makes the answer right. A\n * `<head>` mutation is also how a router inserting route CSS looks, so this ticks a little more often\n * than colour strictly changes; that is the trade, and it is the correct way round, because a false\n * tick costs a rebuild and a missed one costs a graph painting a brand nobody selected.\n *\n * The provider half is optional, so a chart still works without one.\n *\n * Returns a counter to feed into an effect's dependency list.\n */\nexport function useThemeTick(): number {\n const palette = useKanzoThemeOptional()?.resolvedTheme ?? \"\";\n const [state, setState] = useState({ tick: 0, palette });\n\n // Adjusted during render rather than in an effect: React re-runs this component before anything\n // commits, so a consumer never reads a tick that is one palette behind. An effect would let one\n // frame paint with the old colours first, which on a graph is a visible flash of the wrong brand.\n if (state.palette !== palette) setState((s) => ({ tick: s.tick + 1, palette }));\n\n useEffect(() => {\n if (typeof MutationObserver === \"undefined\") return;\n const bump = () => setState((s) => ({ ...s, tick: s.tick + 1 }));\n const root = new MutationObserver(bump);\n root.observe(document.documentElement, { attributes: true });\n // Not `subtree` on the root: that would fire for every DOM change in the app.\n const head = new MutationObserver(bump);\n head.observe(document.head, { childList: true, subtree: true, characterData: true });\n return () => {\n root.disconnect();\n head.disconnect();\n };\n }, []);\n\n return state.tick;\n}\n\n/**\n * `categoricalCapacity` as a hook, re-read whenever the theme moves.\n *\n * `CHART_SLOTS` on the first render so the server and the client agree, then the measured value —\n * the same shape {@link useThemeTick} already imposes on anything reading the cascade.\n */\nexport function useChartCapacity(host?: RefObject<Element | null>): number {\n const tick = useThemeTick();\n const [capacity, setCapacity] = useState(CHART_SLOTS);\n useEffect(() => {\n const element = host?.current ?? (typeof document === \"undefined\" ? null : document.documentElement);\n if (element) setCapacity(categoricalCapacity(element));\n }, [host, tick]);\n return capacity;\n}\n"],"names":[],"mappings":";;;;;AAsCO;;AACL;AAMA;AAGE;AACA;AAEA;AAEA;AACA;AAEE;AACK;AACP;AAIJ;AAQO;AACL;AAEA;AACE;AACA;AAAqD;AAGzD;;;;;"}
@@ -0,0 +1,74 @@
1
+ import { CHART_SLOTS } from '@kanzo-tech/theme';
2
+ /**
3
+ * Resolve a Kanzo colour token to a concrete, Plot-safe `rgb(...)` string.
4
+ *
5
+ * vgplot delegates every fill to Observable Plot, whose `isColor` (0.6.x) accepts named colours,
6
+ * hex and `rgb()`/`hsl()` — but **not** `var(--token)`, `color-mix()`, `oklch()` or `color(srgb …)`,
7
+ * which is exactly how Tailwind v4's default palette (and therefore our tokens) is authored/served.
8
+ * Hand Plot any of those and it treats the string as a data column, so the query fails.
9
+ *
10
+ * So we read the token off the live DOM through an `in srgb` `color-mix` (which pins it to sRGB)
11
+ * and normalise the result to `rgb(...)` via {@link toPlotColor}. The probe is appended to `host`
12
+ * so a scoped theme override (a `data-*` attribute on an ancestor) resolves against the same
13
+ * cascade the chart sits in. Read at mount and re-read on every theme change (see `useThemeTick`),
14
+ * so a re-theme re-colours the marks — the vgplot analogue of the way CodeEditor's `var()`-backed
15
+ * theme re-skins CodeMirror.
16
+ */
17
+ export declare function resolveTokenColor(host: Element, token: string): string;
18
+ /**
19
+ * How many categorical slots the stylesheet declares. A 9th series folds into "Other" — never
20
+ * cycle, or identity stops meaning anything.
21
+ *
22
+ * This file used to export the scheme's literal values too, first as eight hand-written hexes and
23
+ * then as the default entry of `theme-data.json`. Both were a *second* source of truth beside
24
+ * `--chart-*`, and that is the defect this whole colour layer exists to end: the same series was
25
+ * one colour through `ChartConfig` and another through a token. It is gone, not relocated. The
26
+ * tenant palette document owns the categorical set, `compile()` projects it onto these tokens, and
27
+ * a chart reads the token — one answer, which follows the mode and follows the client.
28
+ *
29
+ * The count stays a compile-time constant because a stylesheet cannot have a variable number of
30
+ * custom properties. How many of the slots carry a *real* category is the document's `capacity`,
31
+ * which can be lower: past it, `compile` writes `var(--muted-foreground)`, and a set that carries
32
+ * fewer categories than it has slots is saying so rather than inventing colours.
33
+ */
34
+ export { CHART_SLOTS };
35
+ /**
36
+ * The custom property carrying the document's `categorical.capacity`.
37
+ *
38
+ * `compile()` emits it at the head of both blocks — the one declaration in the sheet that is not a
39
+ * colour, because it is the one fact about the set that the colours cannot carry. A custom property
40
+ * and not a JS constant: the cascade is the only channel a scoped palette override travels down,
41
+ * and it is the same channel `--chart-*` itself arrives on. A stylesheet that declares nothing
42
+ * (anything older than the document, or a test fixture) falls back to `CHART_SLOTS`.
43
+ *
44
+ * Module-level only: `categoricalCapacity` is the way to read it, and an export whose whole use is
45
+ * to be passed straight back into the function beside it is a second way to do one thing.
46
+ */
47
+ export declare const CHART_CAPACITY_PROPERTY = "--chart-capacity";
48
+ /**
49
+ * How many slots name a real category, read off the live cascade.
50
+ *
51
+ * `compile()` writes `var(--muted-foreground)` into every slot past capacity, so the *colour* of a
52
+ * ninth series is already right without anyone knowing the number. What is not right is the
53
+ * **count**: a legend that draws a row per slot claims eight distinguishable kinds where a set may
54
+ * carry six, and any "group the tail into Other" logic folds at the wrong index. Measured over 24
55
+ * brand hues one every 15° at L 0.62 / C 0.15, capacity came back 6–8 (mean 7.50) with 11 of the 24
56
+ * under 8 — so this is the common case, not an edge one.
57
+ *
58
+ * Read against `host` rather than `<html>` for the same reason `resolveTokenColor` is: a scoped
59
+ * palette override on an ancestor has to win.
60
+ */
61
+ export declare function categoricalCapacity(host: Element): number;
62
+ /**
63
+ * The categorical colour for series index `i`, as a **token**.
64
+ *
65
+ * A token and not a literal so one answer covers both jobs: it follows the light/dark flip, and it
66
+ * follows whichever scheme the product selected — neither of which a baked hex can do. The chart
67
+ * pipeline already resolves `var(--…)` against the live element, and the DOM resolves it natively
68
+ * for legends and swatches.
69
+ *
70
+ * `capacity` is where the Other boundary sits. It defaults to `CHART_SLOTS` because that is the
71
+ * only honest answer without a DOM to read — a caller with one passes `categoricalCapacity(host)`.
72
+ */
73
+ export declare function categoricalColor(i: number, other?: string, capacity?: number): string;
74
+ //# sourceMappingURL=token-color.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-color.d.ts","sourceRoot":"","sources":["../../src/lib/token-color.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA0BhD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAStE;AAED;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAE1D;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAazD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC9B,CAAC,EAAE,MAAM,EACT,KAAK,SAA4B,EACjC,QAAQ,SAAc,GACrB,MAAM,CAER"}
@@ -0,0 +1,35 @@
1
+ import { CHART_SLOTS as o } from "@kanzo-tech/theme";
2
+ import { CHART_SLOTS as h } from "@kanzo-tech/theme";
3
+ function l(e) {
4
+ const t = e.match(
5
+ /^color\(srgb\s+([-+\d.eE]+)\s+([-+\d.eE]+)\s+([-+\d.eE]+)(?:\s*\/\s*([-+\d.eE]+))?\s*\)$/i
6
+ );
7
+ if (!t) return e;
8
+ const r = (a) => Math.min(255, Math.max(0, Math.round(Number(a) * 255))), [n, c, s] = [t[1], t[2], t[3]].map((a) => r(a)), i = t[4] != null ? Math.min(1, Math.max(0, Number(t[4]))) : 1;
9
+ return i < 1 ? `rgba(${n}, ${c}, ${s}, ${i})` : `rgb(${n}, ${c}, ${s})`;
10
+ }
11
+ function d(e, t) {
12
+ const r = document.createElement("span");
13
+ r.style.color = `color-mix(in srgb, var(${t}) 100%, transparent)`, r.style.display = "none", e.appendChild(r);
14
+ const n = getComputedStyle(r).color;
15
+ return r.remove(), n ? l(n) : t;
16
+ }
17
+ const u = "--chart-capacity";
18
+ function p(e) {
19
+ if (typeof getComputedStyle > "u") return o;
20
+ const t = getComputedStyle(e).getPropertyValue(u).trim();
21
+ if (t === "") return o;
22
+ const r = Number.parseInt(t, 10);
23
+ return !Number.isFinite(r) || r < 0 ? o : Math.min(r, o);
24
+ }
25
+ function f(e, t = "var(--muted-foreground)", r = o) {
26
+ return e >= 0 && e < Math.min(r, o) ? `var(--chart-${e + 1})` : t;
27
+ }
28
+ export {
29
+ u as CHART_CAPACITY_PROPERTY,
30
+ h as CHART_SLOTS,
31
+ p as categoricalCapacity,
32
+ f as categoricalColor,
33
+ d as resolveTokenColor
34
+ };
35
+ //# sourceMappingURL=token-color.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-color.js","sources":["../../src/lib/token-color.ts"],"sourcesContent":["// Token colour resolution — no engine, no hook, no directive.\n//\n// This half used to live in `charts/theme.ts`, which mixed it with two hooks and therefore carried\n// `\"use client\"`. Two things broke as a result. `chart-config.ts` *calls* `categoricalColor`, so in\n// an RSC graph a public `/analytics` export resolved to a client reference and a Server Component\n// threw. And the placement rule (a part belongs on a subpath only if it imports that subpath's\n// engine) put a twelve-line token resolver behind the DuckDB/Mosaic peer set — a WebGL graph and a\n// docs helper both paid for the whole analytics stack to reach it.\n//\n// So the split is on the client boundary, not on the topic: everything here is pure, and the two\n// hooks that read the live cascade live in `./theme-tick.js`. Both are on the root barrel.\n\nimport { CHART_SLOTS } from \"@kanzo-tech/theme\";\n\n/**\n * Convert a browser-computed colour into the plain `rgb(...)` form Observable Plot accepts.\n *\n * Forcing a token through `color-mix(in srgb, …)` pins it to sRGB, but a modern browser then\n * *serialises* that as `color(srgb 0.61 0.61 0.61)` — and Plot's `isColor` (0.6.x) rejects the\n * `color()` function, so it mistakes the fill for a data column and the query dies with a binder\n * error. Canvas normalisation preserves `color(srgb …)` too, so we parse the sRGB components\n * ourselves. `rgb(...)` / `rgba(...)` / hex / named inputs (older browsers) pass straight through.\n */\nfunction toPlotColor(computed: string): string {\n // The components may be negative or above 1: a wide-gamut token pinned to sRGB serialises\n // out of gamut (`color(srgb 0.96 0.28 -0.15)` for `--chart-1` in Chrome). Missing those was a\n // real failure, not a rounding detail — the unparsed string reached Plot, which read it as a\n // *column name* and killed the query with a binder error. Parse them, then clamp.\n const m = computed.match(\n /^color\\(srgb\\s+([-+\\d.eE]+)\\s+([-+\\d.eE]+)\\s+([-+\\d.eE]+)(?:\\s*\\/\\s*([-+\\d.eE]+))?\\s*\\)$/i,\n );\n if (!m) return computed;\n const channel = (v: string) => Math.min(255, Math.max(0, Math.round(Number(v) * 255)));\n const [r, g, b] = [m[1], m[2], m[3]].map((v) => channel(v as string));\n const a = m[4] != null ? Math.min(1, Math.max(0, Number(m[4]))) : 1;\n return a < 1 ? `rgba(${r}, ${g}, ${b}, ${a})` : `rgb(${r}, ${g}, ${b})`;\n}\n\n/**\n * Resolve a Kanzo colour token to a concrete, Plot-safe `rgb(...)` string.\n *\n * vgplot delegates every fill to Observable Plot, whose `isColor` (0.6.x) accepts named colours,\n * hex and `rgb()`/`hsl()` — but **not** `var(--token)`, `color-mix()`, `oklch()` or `color(srgb …)`,\n * which is exactly how Tailwind v4's default palette (and therefore our tokens) is authored/served.\n * Hand Plot any of those and it treats the string as a data column, so the query fails.\n *\n * So we read the token off the live DOM through an `in srgb` `color-mix` (which pins it to sRGB)\n * and normalise the result to `rgb(...)` via {@link toPlotColor}. The probe is appended to `host`\n * so a scoped theme override (a `data-*` attribute on an ancestor) resolves against the same\n * cascade the chart sits in. Read at mount and re-read on every theme change (see `useThemeTick`),\n * so a re-theme re-colours the marks — the vgplot analogue of the way CodeEditor's `var()`-backed\n * theme re-skins CodeMirror.\n */\nexport function resolveTokenColor(host: Element, token: string): string {\n const probe = document.createElement(\"span\");\n // The 0%-transparent second colour just keeps the first at full opacity; `in srgb` pins it.\n probe.style.color = `color-mix(in srgb, var(${token}) 100%, transparent)`;\n probe.style.display = \"none\";\n host.appendChild(probe);\n const resolved = getComputedStyle(probe).color;\n probe.remove();\n return resolved ? toPlotColor(resolved) : token;\n}\n\n/**\n * How many categorical slots the stylesheet declares. A 9th series folds into \"Other\" — never\n * cycle, or identity stops meaning anything.\n *\n * This file used to export the scheme's literal values too, first as eight hand-written hexes and\n * then as the default entry of `theme-data.json`. Both were a *second* source of truth beside\n * `--chart-*`, and that is the defect this whole colour layer exists to end: the same series was\n * one colour through `ChartConfig` and another through a token. It is gone, not relocated. The\n * tenant palette document owns the categorical set, `compile()` projects it onto these tokens, and\n * a chart reads the token — one answer, which follows the mode and follows the client.\n *\n * The count stays a compile-time constant because a stylesheet cannot have a variable number of\n * custom properties. How many of the slots carry a *real* category is the document's `capacity`,\n * which can be lower: past it, `compile` writes `var(--muted-foreground)`, and a set that carries\n * fewer categories than it has slots is saying so rather than inventing colours.\n */\nexport { CHART_SLOTS };\n\n/**\n * The custom property carrying the document's `categorical.capacity`.\n *\n * `compile()` emits it at the head of both blocks — the one declaration in the sheet that is not a\n * colour, because it is the one fact about the set that the colours cannot carry. A custom property\n * and not a JS constant: the cascade is the only channel a scoped palette override travels down,\n * and it is the same channel `--chart-*` itself arrives on. A stylesheet that declares nothing\n * (anything older than the document, or a test fixture) falls back to `CHART_SLOTS`.\n *\n * Module-level only: `categoricalCapacity` is the way to read it, and an export whose whole use is\n * to be passed straight back into the function beside it is a second way to do one thing.\n */\nexport const CHART_CAPACITY_PROPERTY = \"--chart-capacity\";\n\n/**\n * How many slots name a real category, read off the live cascade.\n *\n * `compile()` writes `var(--muted-foreground)` into every slot past capacity, so the *colour* of a\n * ninth series is already right without anyone knowing the number. What is not right is the\n * **count**: a legend that draws a row per slot claims eight distinguishable kinds where a set may\n * carry six, and any \"group the tail into Other\" logic folds at the wrong index. Measured over 24\n * brand hues one every 15° at L 0.62 / C 0.15, capacity came back 6–8 (mean 7.50) with 11 of the 24\n * under 8 — so this is the common case, not an edge one.\n *\n * Read against `host` rather than `<html>` for the same reason `resolveTokenColor` is: a scoped\n * palette override on an ancestor has to win.\n */\nexport function categoricalCapacity(host: Element): number {\n if (typeof getComputedStyle === \"undefined\") return CHART_SLOTS;\n const raw = getComputedStyle(host).getPropertyValue(CHART_CAPACITY_PROPERTY).trim();\n // **A declared zero is an answer; an absent property is not.** They used to be one branch, and\n // that was right while zero could only arrive by accident. A document may now decline the\n // categorical channel outright — one ink, no category carried by colour — and it says so with\n // this number, so folding zero back up to the full slot count would paint eight distinguishable\n // colours on the one document that published none. The cascade tells the two apart already:\n // `getPropertyValue` returns an empty string for a property nobody declared.\n if (raw === \"\") return CHART_SLOTS;\n const declared = Number.parseInt(raw, 10);\n if (!Number.isFinite(declared) || declared < 0) return CHART_SLOTS;\n return Math.min(declared, CHART_SLOTS);\n}\n\n/**\n * The categorical colour for series index `i`, as a **token**.\n *\n * A token and not a literal so one answer covers both jobs: it follows the light/dark flip, and it\n * follows whichever scheme the product selected — neither of which a baked hex can do. The chart\n * pipeline already resolves `var(--…)` against the live element, and the DOM resolves it natively\n * for legends and swatches.\n *\n * `capacity` is where the Other boundary sits. It defaults to `CHART_SLOTS` because that is the\n * only honest answer without a DOM to read — a caller with one passes `categoricalCapacity(host)`.\n */\nexport function categoricalColor(\n i: number,\n other = \"var(--muted-foreground)\",\n capacity = CHART_SLOTS,\n): string {\n return i >= 0 && i < Math.min(capacity, CHART_SLOTS) ? `var(--chart-${i + 1})` : other;\n}\n"],"names":["toPlotColor","computed","m","channel","v","r","g","b","a","resolveTokenColor","host","token","probe","resolved","CHART_CAPACITY_PROPERTY","categoricalCapacity","CHART_SLOTS","raw","declared","categoricalColor","i","other","capacity"],"mappings":";;AAuBA,SAASA,EAAYC,GAA0B;AAK7C,QAAMC,IAAID,EAAS;AAAA,IACjB;AAAA,EAAA;AAEF,MAAI,CAACC,EAAG,QAAOD;AACf,QAAME,IAAU,CAACC,MAAc,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,KAAK,MAAM,OAAOA,CAAC,IAAI,GAAG,CAAC,CAAC,GAC/E,CAACC,GAAGC,GAAGC,CAAC,IAAI,CAACL,EAAE,CAAC,GAAGA,EAAE,CAAC,GAAGA,EAAE,CAAC,CAAC,EAAE,IAAI,CAACE,MAAMD,EAAQC,CAAW,CAAC,GAC9DI,IAAIN,EAAE,CAAC,KAAK,OAAO,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,OAAOA,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI;AAClE,SAAOM,IAAI,IAAI,QAAQH,CAAC,KAAKC,CAAC,KAAKC,CAAC,KAAKC,CAAC,MAAM,OAAOH,CAAC,KAAKC,CAAC,KAAKC,CAAC;AACtE;AAiBO,SAASE,EAAkBC,GAAeC,GAAuB;AACtE,QAAMC,IAAQ,SAAS,cAAc,MAAM;AAE3C,EAAAA,EAAM,MAAM,QAAQ,0BAA0BD,CAAK,wBACnDC,EAAM,MAAM,UAAU,QACtBF,EAAK,YAAYE,CAAK;AACtB,QAAMC,IAAW,iBAAiBD,CAAK,EAAE;AACzC,SAAAA,EAAM,OAAA,GACCC,IAAWb,EAAYa,CAAQ,IAAIF;AAC5C;AAgCO,MAAMG,IAA0B;AAehC,SAASC,EAAoBL,GAAuB;AACzD,MAAI,OAAO,mBAAqB,IAAa,QAAOM;AACpD,QAAMC,IAAM,iBAAiBP,CAAI,EAAE,iBAAiBI,CAAuB,EAAE,KAAA;AAO7E,MAAIG,MAAQ,GAAI,QAAOD;AACvB,QAAME,IAAW,OAAO,SAASD,GAAK,EAAE;AACxC,SAAI,CAAC,OAAO,SAASC,CAAQ,KAAKA,IAAW,IAAUF,IAChD,KAAK,IAAIE,GAAUF,CAAW;AACvC;AAaO,SAASG,EACdC,GACAC,IAAQ,2BACRC,IAAWN,GACH;AACR,SAAOI,KAAK,KAAKA,IAAI,KAAK,IAAIE,GAAUN,CAAW,IAAI,eAAeI,IAAI,CAAC,MAAMC;AACnF;"}
@@ -0,0 +1,2 @@
1
+ export declare const useIsMobile: () => boolean;
2
+ //# sourceMappingURL=use-is-mobile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-is-mobile.d.ts","sourceRoot":"","sources":["../../src/lib/use-is-mobile.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,WAAW,eAoBvB,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import o from "react";
3
+ const e = 768, d = () => {
4
+ const [s, t] = o.useState(
5
+ void 0
6
+ );
7
+ return o.useEffect(() => {
8
+ const n = window.matchMedia(`(max-width: ${e - 1}px)`), i = () => {
9
+ t(window.innerWidth < e);
10
+ };
11
+ return n.addEventListener("change", i), t(window.innerWidth < e), () => n.removeEventListener("change", i);
12
+ }, []), !!s;
13
+ };
14
+ export {
15
+ d as useIsMobile
16
+ };
17
+ //# sourceMappingURL=use-is-mobile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-is-mobile.js","sources":["../../src/lib/use-is-mobile.ts"],"sourcesContent":["\"use client\";\n\n// The directive is not optional here even though the hook is internal: it calls `useState` /\n// `useEffect` and registers a `matchMedia` listener. It was contained only by the accident that its\n// single importer is a client module, which is one import away from a break.\n\nimport React from \"react\";\n\nconst MOBILE_BREAKPOINT = 768;\n\nexport const useIsMobile = () => {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(\n undefined\n );\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);\n\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n };\n\n mql.addEventListener(\"change\", onChange);\n\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n\n return () => mql.removeEventListener(\"change\", onChange);\n }, []);\n\n return !!isMobile;\n};\n"],"names":["React"],"mappings":";;AAQA;AAGE;AAAsC;AACpC;AAGFA;AACE;AAGE;AAAiD;AAGnD;AAIuD;AAI3D;;;;"}
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Every way this library's export surface differs from Shark UI's, with the reason for each.
3
+ *
4
+ * `shark-parity.test.ts` computes the difference against the checked-in snapshot of Shark's
5
+ * registry and requires that every entry it finds is declared here — and that every entry declared
6
+ * here is still a real difference. Both halves matter. The first is what would have caught 31
7
+ * context aliases being deleted on a house rule while Shark shipped 38 of the 43 names involved
8
+ *; the second is what stops this file rotting into an
9
+ * allowlist that only ever grows.
10
+ *
11
+ * **A reason is not a note.** The reference governs the surface, a measurement overrules the
12
+ * reference, and a house principle overrules neither. So where this library made a CHOICE against
13
+ * Shark, the reason is one of four
14
+ * things, and saying which is the point:
15
+ *
16
+ * 1. a measurement — a number, what it was measured against, a threshold it crosses;
17
+ * 2. a rule on `/docs/design`, cited by path, which carries its own evidence and what would
18
+ * reverse it;
19
+ * 3. an assertion in another guard, cited by file and test name;
20
+ * 4. `Undecided — …`, where nothing above applies. That is a legitimate state
21
+ * (`/docs/design/references`: *where none of that decides, the owner does, and the case is recorded as undecided rather than argued into one of the branches*),
22
+ * and the test pins the exact list, so one cannot be added or quietly resolved without an edit
23
+ * somebody reviews.
24
+ *
25
+ * **And two more, because most entries here are not a choice at all** — this paragraph exists
26
+ * because the list above said "one of four things" while the file had used six for months, and a
27
+ * queue item was filed against the guard for not enforcing the four. Counted 2026-08-24 over all 87
28
+ * declarations: 53 cite a decision record, 8 cite a guard, 2 measure, **0** are `Undecided` (that
29
+ * went 21 → 0 and the test pins the empty list), and the remaining 24 are:
30
+ *
31
+ * 5. `Not built. …` — 19 of them. Shark ships a component and we have not written one. There is no
32
+ * divergence to justify, only an absence to record, and what the entry owes is what stands in
33
+ * its place or that nothing does.
34
+ * 6. `Ours…` — 3, plus one cross-reference to a sibling entry and one prose entry in
35
+ * `BEYOND_THE_SURFACE` for a difference that is not a name at all. A name we ship and Shark does
36
+ * not is the mirror of 5 and owes the same thing.
37
+ *
38
+ * Anything cited by path is checked to exist. A reason pointing at a file somebody deleted is not
39
+ * a reason. The shape itself is NOT checked — see the guard's own "what it cannot prove".
40
+ */
41
+ /** Shark's registry filename → our module, relative to `src/`, where the two do not match. */
42
+ export declare const MODULE_MAP: Readonly<Record<string, string>>;
43
+ /**
44
+ * A Shark component we do not ship, keyed by its registry filename.
45
+ *
46
+ * Most of these are the ordinary shape of adopting a reference incrementally rather than a
47
+ * disagreement with it: `/docs/design/admission` says a family nobody renders does not get
48
+ * built, and an export needs a second call site. Where we solve the same problem differently, the entry names what we solve it
49
+ * with, because that is the thing a reader is looking for.
50
+ */
51
+ export declare const UNADOPTED: Readonly<Record<string, string>>;
52
+ /**
53
+ * A module of ours Shark has no file for, keyed by our filename in `simples/` (or the key it takes
54
+ * in `MODULE_MAP`). These are additions to the reference, and each answers to the house rules
55
+ * instead — admission, and a second call site.
56
+ */
57
+ export declare const OURS_ALONE: Readonly<Record<string, string>>;
58
+ /**
59
+ * The same Ark part under a different exported name. Declaring these as a pair rather than as one
60
+ * absence plus one addition is the honest shape: nothing is missing and nothing is extra, the two
61
+ * references simply disagree about spelling, and the naming rule picks Ark's part name.
62
+ *
63
+ * Keyed `"<shark file>:<Shark's name>"`.
64
+ */
65
+ export declare const RENAMED: Readonly<Record<string, {
66
+ readonly ours: string;
67
+ readonly reason: string;
68
+ }>>;
69
+ /**
70
+ * A name Shark exports that we do not, keyed `"<shark file>:<Name>"`.
71
+ *
72
+ * This map used to be dominated by the parts sweep — thirty-four names withheld because our own
73
+ * root renders the part, plus four recipes withheld because a class list is not API. Both were
74
+ * house principles, and parity restored all thirty-eight against the reference order —
75
+ * `/docs/design/references`. What is left is the shape a
76
+ * withheld name is supposed to have: a decision with its own record, or an open question with
77
+ * nobody's name on it yet.
78
+ */
79
+ export declare const WITHHELD: Readonly<Record<string, string>>;
80
+ /**
81
+ * A name we export that Shark's matching component does not, keyed `"<shark file>:<Name>"`.
82
+ *
83
+ * `/docs/design/references` reads, as written, in both directions: *a `useX` or a
84
+ * part Shark's registry exports, we export under that name; one it does not export, we do not.*
85
+ * Thirteen of the entries below are Ark parts Shark's file does not export, so under the widest
86
+ * reading of that sentence they should not exist. They do exist for one reason, and it is a real
87
+ * one: **our root is thin where Shark's pre-arranges.** `Rating` is the clean example — Shark's
88
+ * root lays out label, control and hidden input itself and exports two names; ours exports the
89
+ * anatomy and lets the caller compose it. Withdrawing the parts would not match Shark, it would
90
+ * leave a component that cannot be labelled. See BEYOND_THE_SURFACE.
91
+ */
92
+ export declare const ADDED: Readonly<Record<string, string>>;
93
+ /**
94
+ * Divergences this guard cannot express as a name, recorded here because they are the ones a
95
+ * reader arrives looking for — and because each is checkable somewhere, which is what a divergence
96
+ * has to be. `held` is a list of paths relative to the repository root; the test asserts every one
97
+ * of them exists, so a citation cannot outlive the file it points at.
98
+ */
99
+ export declare const BEYOND_THE_SURFACE: readonly {
100
+ readonly what: string;
101
+ readonly why: string;
102
+ readonly held: readonly string[];
103
+ }[];
104
+ //# sourceMappingURL=shark-parity.divergences.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shark-parity.divergences.d.ts","sourceRoot":"","sources":["../src/shark-parity.divergences.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,8FAA8F;AAC9F,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAIvD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA8BtD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUvD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAUhG,CAAC;AA+DF;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAmCrD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA2BlD,CAAC;AAaF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC,EAsHA,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { default as React } from 'react';
2
+ import { Button } from './button';
3
+ export interface FacetFilterItem {
4
+ value: string;
5
+ label?: React.ReactNode;
6
+ icon?: React.ComponentType<{
7
+ className?: string;
8
+ }>;
9
+ /** Rows behind this value, drawn at the row's end. */
10
+ count?: number;
11
+ }
12
+ export interface FacetFilterProps extends Omit<React.ComponentProps<typeof Button>, "children" | "onSelect"> {
13
+ /** Trigger label. */
14
+ label?: React.ReactNode;
15
+ /** The values on offer. */
16
+ items: readonly FacetFilterItem[];
17
+ /** The values currently filtered on. */
18
+ value: readonly string[];
19
+ onValueChange: (next: string[]) => void;
20
+ /** Tick any number of values. `false` keeps at most one ticked. */
21
+ multiple?: boolean;
22
+ /**
23
+ * Draw a filter field above the list, narrowing the rows on offer.
24
+ *
25
+ * Deliberately a prop and never a count threshold: the caller knows whether the column is
26
+ * `provider` or `subject_uri`, and a control that grows a search field once the crossfilter
27
+ * pushes it past *n* values reshapes itself under the cursor.
28
+ *
29
+ * @default false
30
+ */
31
+ searchable?: boolean;
32
+ /** Placeholder for the `searchable` field. */
33
+ searchPlaceholder?: string;
34
+ /** Accessible name for the `searchable` field. */
35
+ searchLabel?: string;
36
+ /** Shown when the `searchable` query excludes every row. Not the same state as `empty`. */
37
+ searchEmpty?: React.ReactNode;
38
+ /** Shown when there is nothing to offer. */
39
+ empty?: React.ReactNode;
40
+ /** A footnote under the list — a truncation notice, a hint. */
41
+ note?: React.ReactNode;
42
+ /** Class for the popover surface; `className` styles the trigger. */
43
+ contentClassName?: string;
44
+ }
45
+ /**
46
+ * The surface behind every facet filter: a trigger that reports its own count, a listbox of
47
+ * values, and a way out.
48
+ *
49
+ * A filter is **a value**, not a command, so this is a listbox and not a menu of checkbox items.
50
+ * Where the values come from and
51
+ * where the choice goes are the caller's: TanStack facets on one side of this library, a Mosaic
52
+ * clause on the other. What is *not* the caller's are the two rules below, which both adapters
53
+ * had independently rediscovered, and which are invisible until they bite — and which both have to
54
+ * survive `searchable`, because a query that hides a ticked row takes the untick with it.
55
+ */
56
+ export declare const FacetFilter: (props: FacetFilterProps) => React.JSX.Element;
57
+ //# sourceMappingURL=FacetFilter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FacetFilter.d.ts","sourceRoot":"","sources":["../../src/simples/FacetFilter.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAalC,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnD,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAC1E,qBAAqB;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,2BAA2B;IAC3B,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;IAClC,wCAAwC;IACxC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACxC,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8CAA8C;IAC9C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2FAA2F;IAC3F,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,4CAA4C;IAC5C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,+DAA+D;IAC/D,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,sBAmMlD,CAAC"}
@@ -0,0 +1,167 @@
1
+ "use client";
2
+ import { jsxs as o, jsx as l, Fragment as k } from "react/jsx-runtime";
3
+ import { createListCollection as q } from "@ark-ui/react/collection";
4
+ import { useFilter as B } from "@ark-ui/react/locale";
5
+ import { ListFilterIcon as A } from "lucide-react";
6
+ import { useState as H, useRef as O, useMemo as h } from "react";
7
+ import { cn as Q } from "../lib/cn.js";
8
+ import { Badge as Y } from "./badge.js";
9
+ import { Button as y } from "./button.js";
10
+ import { Listbox as _, ListboxInput as D, ListboxContent as G, ListboxItem as J, ListboxItemText as K, ListboxItemIndicator as U, ListboxEmpty as W } from "./listbox.js";
11
+ import { Popover as X, PopoverTrigger as Z, PopoverContent as $ } from "./popover.js";
12
+ import { Separator as ee } from "./separator.js";
13
+ const fe = (r) => {
14
+ const {
15
+ label: C,
16
+ items: f,
17
+ value: a,
18
+ onValueChange: d,
19
+ multiple: L = !0,
20
+ searchable: u = !1,
21
+ searchPlaceholder: I = "Filter values…",
22
+ searchLabel: N = "Filter values",
23
+ searchEmpty: F = "No matching values.",
24
+ empty: T = "No values.",
25
+ note: p,
26
+ className: E,
27
+ contentClassName: S,
28
+ size: w = "sm",
29
+ variant: z = "outline",
30
+ slot: P,
31
+ ...V
32
+ } = r, [v, g] = H(""), x = O(null), { contains: b } = B(te), s = h(() => {
33
+ const e = new Map(f.map((t) => [t.value, t]));
34
+ for (const t of a)
35
+ e.has(t) || e.set(t, { value: t });
36
+ return [...e.values()].sort(
37
+ (t, R) => c(t).localeCompare(c(R))
38
+ );
39
+ }, [f, a]), m = u ? v.trim() : "", n = h(() => {
40
+ if (!m) return s;
41
+ const e = new Set(a);
42
+ return s.filter(
43
+ (t) => e.has(t.value) || b(c(t), m)
44
+ );
45
+ }, [b, s, m, a]), j = h(
46
+ () => q({
47
+ items: n,
48
+ itemToValue: (e) => e.value,
49
+ itemToString: c
50
+ }),
51
+ [n]
52
+ ), i = [...a], M = n.length === 0 && s.length > 0;
53
+ return (
54
+ // Not modal, unlike our `Popover` default. A filter is judged by what changes behind it, and a
55
+ // modal popover marks the rest of the page `aria-hidden` — so the table you are filtering
56
+ // becomes unreadable to a screen reader at the exact moment it is being filtered.
57
+ //
58
+ // The query resets with the surface, because `Popover` unmounts its content on exit: the
59
+ // input's DOM value goes with it while this state would not, leaving a reopened filter showing
60
+ // every row from a query it still believes in.
61
+ //
62
+ // `initialFocusEl` aims the popover's opening focus at the field when there is one. Zag's
63
+ // default lands on the content itself, and it lands *late* — so a first keystroke typed
64
+ // straight after opening goes to the list as typeahead, and the focus then moves out from
65
+ // under the caret. Pointing it at the field makes "open it and start typing" work, which is
66
+ // the only reason a filter field is there.
67
+ /* @__PURE__ */ o(
68
+ X,
69
+ {
70
+ initialFocusEl: u ? () => x.current : void 0,
71
+ modal: !1,
72
+ onOpenChange: () => g(""),
73
+ children: [
74
+ /* @__PURE__ */ l(Z, { asChild: !0, children: /* @__PURE__ */ o(
75
+ y,
76
+ {
77
+ className: E,
78
+ size: w,
79
+ variant: z,
80
+ ...V,
81
+ slot: P ?? "facet-filter",
82
+ children: [
83
+ /* @__PURE__ */ l(A, {}),
84
+ C,
85
+ i.length > 0 && /* @__PURE__ */ l(Y, { size: "xs", variant: "secondary", children: i.length })
86
+ ]
87
+ }
88
+ ) }),
89
+ /* @__PURE__ */ o(
90
+ $,
91
+ {
92
+ className: Q("w-56 p-1", S),
93
+ slot: "facet-filter-content",
94
+ children: [
95
+ /* @__PURE__ */ o(
96
+ _,
97
+ {
98
+ collection: j,
99
+ onValueChange: (e) => d(e.value),
100
+ selectionMode: L ? "multiple" : "single",
101
+ value: i,
102
+ children: [
103
+ u && // `autoHighlight` is Ark's, off by default and worth turning on here: it re-highlights
104
+ // the first row of the collection every time the collection changes, so typing leaves
105
+ // the top match under Enter instead of requiring an ArrowDown first. `keyboardPriority`
106
+ // stays "caret" — Home/End belong to the text you are editing.
107
+ /* @__PURE__ */ l(
108
+ D,
109
+ {
110
+ "aria-label": N,
111
+ autoHighlight: !0,
112
+ onChange: (e) => g(e.target.value),
113
+ placeholder: I,
114
+ ref: x,
115
+ size: "sm",
116
+ value: v
117
+ }
118
+ ),
119
+ /* @__PURE__ */ o(G, { className: "max-h-72 overflow-y-auto", children: [
120
+ n.map((e) => {
121
+ const t = e.icon;
122
+ return /* @__PURE__ */ o(J, { item: e, children: [
123
+ t && /* @__PURE__ */ l(t, {}),
124
+ /* @__PURE__ */ l(K, { children: e.label ?? e.value }),
125
+ e.count !== void 0 && /* @__PURE__ */ l("span", { className: "text-muted-foreground text-xs tabular-nums", children: e.count }),
126
+ /* @__PURE__ */ l(U, {})
127
+ ] }, e.value);
128
+ }),
129
+ /* @__PURE__ */ l(W, { children: M ? F : T })
130
+ ] })
131
+ ]
132
+ }
133
+ ),
134
+ p && /* @__PURE__ */ l(
135
+ "p",
136
+ {
137
+ className: "px-2 py-1.5 text-muted-foreground text-xs",
138
+ "data-slot": "facet-filter-note",
139
+ children: p
140
+ }
141
+ ),
142
+ i.length > 0 && /* @__PURE__ */ o(k, { children: [
143
+ /* @__PURE__ */ l(ee, { className: "my-1" }),
144
+ /* @__PURE__ */ l(
145
+ y,
146
+ {
147
+ className: "w-full justify-center",
148
+ slot: "facet-filter-clear",
149
+ onClick: () => d([]),
150
+ size: "sm",
151
+ variant: "ghost",
152
+ children: "Clear filter"
153
+ }
154
+ )
155
+ ] })
156
+ ]
157
+ }
158
+ )
159
+ ]
160
+ }
161
+ )
162
+ );
163
+ }, te = { sensitivity: "base" }, c = (r) => typeof r.label == "string" ? r.label : r.value;
164
+ export {
165
+ fe as FacetFilter
166
+ };
167
+ //# sourceMappingURL=FacetFilter.js.map