@kerfjs/ui 5.0.0-beta.131 → 5.0.0-beta.133

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 (484) hide show
  1. package/README.md +26 -14
  2. package/ai/application-ui-profile-sync.cjs +5 -14
  3. package/ai/application-ui-profile.d.ts +0 -2
  4. package/ai/application-ui-profile.defaults.json +0 -4
  5. package/ai/application-ui-profile.mjs +5 -14
  6. package/ai/application-ui-profile.schema.json +0 -4
  7. package/ai/choice-wiring-mode.cjs +68 -0
  8. package/ai/component-catalog.json +13 -9
  9. package/ai/component-composition-rules.json +2 -10
  10. package/ai/component-composition.d.ts +0 -17
  11. package/ai/component-composition.json +9 -12
  12. package/ai/component-composition.schema.json +0 -59
  13. package/ai/components/combobox.md +1 -1
  14. package/ai/components/disclosure.md +2 -0
  15. package/ai/components/form.md +1 -2
  16. package/ai/components/popup-menu.md +1 -0
  17. package/ai/components/switch.md +1 -1
  18. package/ai/components/tab-panel.md +0 -1
  19. package/ai/components/toolbar-control-group.md +2 -2
  20. package/ai/public-api-signatures-v1.md +218 -205
  21. package/ai/skill.md +3 -20
  22. package/ai/webawesome-jsx-signatures-v1.md +1 -1
  23. package/dist/backdrop-image.d.ts +1 -1
  24. package/dist/backdrop-image.js +1 -1
  25. package/dist/badge.js +1 -1
  26. package/dist/button.js +1 -1
  27. package/dist/catalog-library.d.ts +26 -0
  28. package/dist/catalog-library.js +2484 -0
  29. package/dist/catalog-library.js.map +1 -0
  30. package/dist/catalog-resources.d.ts +3 -3
  31. package/dist/catalog-resources.js +1 -20
  32. package/dist/catalog-resources.js.map +1 -1
  33. package/dist/catalog.d.ts +5 -4
  34. package/dist/catalog.js +151 -24
  35. package/dist/catalog.js.map +1 -1
  36. package/dist/checkbox-group.js +1 -1
  37. package/dist/checkbox.js +1 -1
  38. package/dist/chip.js +1 -1
  39. package/dist/choice-chips.d.ts +3 -3
  40. package/dist/choice-chips.js +1 -1
  41. package/dist/{chunk-Q5BPZPCO.js → chunk-22T7FFCL.js} +2 -2
  42. package/dist/{chunk-Q5BPZPCO.js.map → chunk-22T7FFCL.js.map} +1 -1
  43. package/dist/{chunk-BCHK33XL.js → chunk-27NEAPV7.js} +2 -2
  44. package/dist/{chunk-BCHK33XL.js.map → chunk-27NEAPV7.js.map} +1 -1
  45. package/dist/{chunk-76BLSFEA.js → chunk-2OYMXGW2.js} +6 -5
  46. package/dist/chunk-2OYMXGW2.js.map +1 -0
  47. package/dist/{chunk-EHR7R7YP.js → chunk-3DPHCZQB.js} +2 -2
  48. package/dist/{chunk-EHR7R7YP.js.map → chunk-3DPHCZQB.js.map} +1 -1
  49. package/dist/{chunk-RPJOLDSR.js → chunk-3UIZ36BP.js} +3 -3
  50. package/dist/{chunk-RPJOLDSR.js.map → chunk-3UIZ36BP.js.map} +1 -1
  51. package/dist/{chunk-QZA75NOK.js → chunk-42NLFCIN.js} +6 -6
  52. package/dist/{chunk-QZA75NOK.js.map → chunk-42NLFCIN.js.map} +1 -1
  53. package/dist/{chunk-UPHPFKAD.js → chunk-4GGIML4E.js} +2 -2
  54. package/dist/{chunk-UPHPFKAD.js.map → chunk-4GGIML4E.js.map} +1 -1
  55. package/dist/{chunk-5KWXM5O7.js → chunk-5C34PAUY.js} +2 -2
  56. package/dist/{chunk-5KWXM5O7.js.map → chunk-5C34PAUY.js.map} +1 -1
  57. package/dist/{chunk-6PHG2DMG.js → chunk-6OH734CG.js} +2 -2
  58. package/dist/{chunk-6PHG2DMG.js.map → chunk-6OH734CG.js.map} +1 -1
  59. package/dist/{chunk-E7ZRBMVQ.js → chunk-7XIY7G4K.js} +3 -3
  60. package/dist/{chunk-E7ZRBMVQ.js.map → chunk-7XIY7G4K.js.map} +1 -1
  61. package/dist/{chunk-OKZTLRGG.js → chunk-B5Q3KE4Z.js} +2 -2
  62. package/dist/{chunk-OKZTLRGG.js.map → chunk-B5Q3KE4Z.js.map} +1 -1
  63. package/dist/{chunk-SGYBIKQA.js → chunk-BADEZQ3V.js} +4 -4
  64. package/dist/chunk-BADEZQ3V.js.map +1 -0
  65. package/dist/{chunk-CJAKN2KZ.js → chunk-BLBMUD2W.js} +2 -2
  66. package/dist/{chunk-CJAKN2KZ.js.map → chunk-BLBMUD2W.js.map} +1 -1
  67. package/dist/{chunk-TRJS7M2H.js → chunk-BNRH7XG5.js} +2 -2
  68. package/dist/{chunk-TRJS7M2H.js.map → chunk-BNRH7XG5.js.map} +1 -1
  69. package/dist/{chunk-NA4LKVPX.js → chunk-BNXJQB2Y.js} +2 -2
  70. package/dist/{chunk-NA4LKVPX.js.map → chunk-BNXJQB2Y.js.map} +1 -1
  71. package/dist/{chunk-CCPWJDRW.js → chunk-BQHGXQVA.js} +2 -2
  72. package/dist/{chunk-CCPWJDRW.js.map → chunk-BQHGXQVA.js.map} +1 -1
  73. package/dist/{chunk-COQI4OMZ.js → chunk-BRDTP3RT.js} +1 -1
  74. package/dist/chunk-BRDTP3RT.js.map +1 -0
  75. package/dist/{chunk-RGB4DPMN.js → chunk-DGYGRMES.js} +3 -3
  76. package/dist/chunk-DGYGRMES.js.map +1 -0
  77. package/dist/{chunk-V3IXAI4L.js → chunk-DNNHT7RB.js} +2 -2
  78. package/dist/{chunk-V3IXAI4L.js.map → chunk-DNNHT7RB.js.map} +1 -1
  79. package/dist/{chunk-UU37OR3D.js → chunk-DT7KOBQJ.js} +1 -1
  80. package/dist/chunk-DT7KOBQJ.js.map +1 -0
  81. package/dist/{chunk-CUUW57WB.js → chunk-DXZA7OC6.js} +58 -14
  82. package/dist/chunk-DXZA7OC6.js.map +1 -0
  83. package/dist/{chunk-4OH6JSGU.js → chunk-F25UMYDX.js} +2 -2
  84. package/dist/{chunk-4OH6JSGU.js.map → chunk-F25UMYDX.js.map} +1 -1
  85. package/dist/{chunk-76VCWWUA.js → chunk-HSMSTCNZ.js} +2 -2
  86. package/dist/{chunk-76VCWWUA.js.map → chunk-HSMSTCNZ.js.map} +1 -1
  87. package/dist/{chunk-ECVTRAXN.js → chunk-IQOO3ZQK.js} +2 -2
  88. package/dist/{chunk-ECVTRAXN.js.map → chunk-IQOO3ZQK.js.map} +1 -1
  89. package/dist/{chunk-2FA3SX57.js → chunk-IXT2ARIM.js} +4 -4
  90. package/dist/{chunk-2FA3SX57.js.map → chunk-IXT2ARIM.js.map} +1 -1
  91. package/dist/{chunk-DBP3N6E5.js → chunk-JBL6SCNN.js} +3 -3
  92. package/dist/{chunk-DBP3N6E5.js.map → chunk-JBL6SCNN.js.map} +1 -1
  93. package/dist/{chunk-7KN5OQVN.js → chunk-JNQBPRAA.js} +2 -2
  94. package/dist/{chunk-7KN5OQVN.js.map → chunk-JNQBPRAA.js.map} +1 -1
  95. package/dist/{chunk-CPTQABDQ.js → chunk-JNSPYECP.js} +2 -2
  96. package/dist/{chunk-CPTQABDQ.js.map → chunk-JNSPYECP.js.map} +1 -1
  97. package/dist/{chunk-E7Q6UNCB.js → chunk-KBDYXGYT.js} +2 -2
  98. package/dist/{chunk-E7Q6UNCB.js.map → chunk-KBDYXGYT.js.map} +1 -1
  99. package/dist/{chunk-WVQDIOD7.js → chunk-KKMZP3YL.js} +2 -2
  100. package/dist/{chunk-WVQDIOD7.js.map → chunk-KKMZP3YL.js.map} +1 -1
  101. package/dist/{chunk-WSPXSWFG.js → chunk-KZEHTRPC.js} +3 -3
  102. package/dist/chunk-KZEHTRPC.js.map +1 -0
  103. package/dist/{chunk-KACJOE2N.js → chunk-LH5V6XGH.js} +2 -2
  104. package/dist/{chunk-KACJOE2N.js.map → chunk-LH5V6XGH.js.map} +1 -1
  105. package/dist/{chunk-VBXKYT4O.js → chunk-LH7YRRY7.js} +2 -2
  106. package/dist/{chunk-VBXKYT4O.js.map → chunk-LH7YRRY7.js.map} +1 -1
  107. package/dist/{chunk-QXXLDY6I.js → chunk-LI7AQ5NQ.js} +4 -4
  108. package/dist/{chunk-QXXLDY6I.js.map → chunk-LI7AQ5NQ.js.map} +1 -1
  109. package/dist/{chunk-CAB5IWV7.js → chunk-LSFPZR52.js} +4 -4
  110. package/dist/{chunk-CAB5IWV7.js.map → chunk-LSFPZR52.js.map} +1 -1
  111. package/dist/{chunk-CRHKWHTA.js → chunk-LUWZ7UZQ.js} +4 -4
  112. package/dist/{chunk-CRHKWHTA.js.map → chunk-LUWZ7UZQ.js.map} +1 -1
  113. package/dist/{chunk-CMG4OZPV.js → chunk-LWWIBUDK.js} +2 -2
  114. package/dist/{chunk-CMG4OZPV.js.map → chunk-LWWIBUDK.js.map} +1 -1
  115. package/dist/{chunk-LOW7J7SE.js → chunk-MHF2NK7F.js} +4 -4
  116. package/dist/{chunk-LOW7J7SE.js.map → chunk-MHF2NK7F.js.map} +1 -1
  117. package/dist/{chunk-JHUEYWWI.js → chunk-MPM6YBOM.js} +2 -2
  118. package/dist/{chunk-JHUEYWWI.js.map → chunk-MPM6YBOM.js.map} +1 -1
  119. package/dist/{chunk-3UEMBHBK.js → chunk-MPT6Y7Z2.js} +2 -2
  120. package/dist/{chunk-3UEMBHBK.js.map → chunk-MPT6Y7Z2.js.map} +1 -1
  121. package/dist/{chunk-OZKBIPXU.js → chunk-NO2XO7S6.js} +3 -3
  122. package/dist/{chunk-OZKBIPXU.js.map → chunk-NO2XO7S6.js.map} +1 -1
  123. package/dist/{chunk-FQETQ7CM.js → chunk-NSNQWDJ4.js} +2 -2
  124. package/dist/{chunk-FQETQ7CM.js.map → chunk-NSNQWDJ4.js.map} +1 -1
  125. package/dist/{chunk-UOBC36FL.js → chunk-OW2ODKHN.js} +2 -2
  126. package/dist/{chunk-UOBC36FL.js.map → chunk-OW2ODKHN.js.map} +1 -1
  127. package/dist/{chunk-PVKAIVKE.js → chunk-P427MACE.js} +63 -74
  128. package/dist/chunk-P427MACE.js.map +1 -0
  129. package/dist/{chunk-LET362AM.js → chunk-PBXTHYB4.js} +2 -2
  130. package/dist/chunk-PBXTHYB4.js.map +1 -0
  131. package/dist/{chunk-C4FBYP2D.js → chunk-PIYFVFPL.js} +9 -3
  132. package/dist/chunk-PIYFVFPL.js.map +1 -0
  133. package/dist/{chunk-FR5G77K5.js → chunk-PJKH2GZ3.js} +2 -2
  134. package/dist/{chunk-FR5G77K5.js.map → chunk-PJKH2GZ3.js.map} +1 -1
  135. package/dist/{chunk-FNJA4S6J.js → chunk-QNA27ABY.js} +3 -3
  136. package/dist/{chunk-FNJA4S6J.js.map → chunk-QNA27ABY.js.map} +1 -1
  137. package/dist/{chunk-RHMY45DK.js → chunk-QNB5DKKP.js} +5 -5
  138. package/dist/{chunk-RHMY45DK.js.map → chunk-QNB5DKKP.js.map} +1 -1
  139. package/dist/{chunk-XO5IOPM5.js → chunk-QWAAR5JX.js} +8 -8
  140. package/dist/{chunk-XO5IOPM5.js.map → chunk-QWAAR5JX.js.map} +1 -1
  141. package/dist/{chunk-6BXPN5SC.js → chunk-RO3TSZ5W.js} +3 -3
  142. package/dist/{chunk-6BXPN5SC.js.map → chunk-RO3TSZ5W.js.map} +1 -1
  143. package/dist/{chunk-4IXG6XCT.js → chunk-RUCUU7Z7.js} +2 -2
  144. package/dist/{chunk-4IXG6XCT.js.map → chunk-RUCUU7Z7.js.map} +1 -1
  145. package/dist/{chunk-QSJAIXLM.js → chunk-SDQZYSCA.js} +3 -3
  146. package/dist/{chunk-QSJAIXLM.js.map → chunk-SDQZYSCA.js.map} +1 -1
  147. package/dist/{chunk-3XSY5LAB.js → chunk-SXZTDJMG.js} +4 -4
  148. package/dist/{chunk-3XSY5LAB.js.map → chunk-SXZTDJMG.js.map} +1 -1
  149. package/dist/{chunk-LJV2FNOC.js → chunk-T7M5FKCE.js} +3 -3
  150. package/dist/{chunk-LJV2FNOC.js.map → chunk-T7M5FKCE.js.map} +1 -1
  151. package/dist/{chunk-KS7EXW4P.js → chunk-TIRBSPP2.js} +2 -2
  152. package/dist/{chunk-KS7EXW4P.js.map → chunk-TIRBSPP2.js.map} +1 -1
  153. package/dist/{chunk-2GEGIPDR.js → chunk-U5SQOZNK.js} +4 -4
  154. package/dist/{chunk-2GEGIPDR.js.map → chunk-U5SQOZNK.js.map} +1 -1
  155. package/dist/{chunk-Y4VR6VNM.js → chunk-UPOS666Q.js} +2 -2
  156. package/dist/{chunk-Y4VR6VNM.js.map → chunk-UPOS666Q.js.map} +1 -1
  157. package/dist/{chunk-YE6KCAIN.js → chunk-USSGJ3MD.js} +2 -2
  158. package/dist/{chunk-YE6KCAIN.js.map → chunk-USSGJ3MD.js.map} +1 -1
  159. package/dist/{chunk-4UWLHKNU.js → chunk-UWLJ7UEK.js} +3 -3
  160. package/dist/{chunk-4UWLHKNU.js.map → chunk-UWLJ7UEK.js.map} +1 -1
  161. package/dist/{chunk-SNUDT6AX.js → chunk-VHAYQGWR.js} +2 -2
  162. package/dist/{chunk-SNUDT6AX.js.map → chunk-VHAYQGWR.js.map} +1 -1
  163. package/dist/{chunk-DV6GE57V.js → chunk-VWGRAE2Q.js} +2 -2
  164. package/dist/chunk-VWGRAE2Q.js.map +1 -0
  165. package/dist/{chunk-4L5ZIKDZ.js → chunk-W7J3MQNV.js} +2 -2
  166. package/dist/{chunk-4L5ZIKDZ.js.map → chunk-W7J3MQNV.js.map} +1 -1
  167. package/dist/{chunk-MVWR5WRX.js → chunk-WWDDKUDW.js} +3 -3
  168. package/dist/{chunk-MVWR5WRX.js.map → chunk-WWDDKUDW.js.map} +1 -1
  169. package/dist/{chunk-4CYCJ3NY.js → chunk-XNSYDA6G.js} +10 -10
  170. package/dist/{chunk-4CYCJ3NY.js.map → chunk-XNSYDA6G.js.map} +1 -1
  171. package/dist/{chunk-WEQNPYVA.js → chunk-XXKRHKFH.js} +2 -2
  172. package/dist/{chunk-WEQNPYVA.js.map → chunk-XXKRHKFH.js.map} +1 -1
  173. package/dist/{chunk-OQFWF7Q7.js → chunk-XZ253TGP.js} +3 -3
  174. package/dist/{chunk-OQFWF7Q7.js.map → chunk-XZ253TGP.js.map} +1 -1
  175. package/dist/{chunk-3TBMGGTA.js → chunk-Y672Z7QY.js} +2 -2
  176. package/dist/{chunk-3TBMGGTA.js.map → chunk-Y672Z7QY.js.map} +1 -1
  177. package/dist/chunk-YM7VF5SY.js +22 -0
  178. package/dist/chunk-YM7VF5SY.js.map +1 -0
  179. package/dist/{chunk-S7QB5KMM.js → chunk-YRQ4KKLG.js} +29 -56
  180. package/dist/chunk-YRQ4KKLG.js.map +1 -0
  181. package/dist/{chunk-MMOQR426.js → chunk-YS3H6DEQ.js} +2 -2
  182. package/dist/{chunk-MMOQR426.js.map → chunk-YS3H6DEQ.js.map} +1 -1
  183. package/dist/{chunk-QR7MGGOM.js → chunk-YVGHWCMY.js} +3 -3
  184. package/dist/{chunk-QR7MGGOM.js.map → chunk-YVGHWCMY.js.map} +1 -1
  185. package/dist/{chunk-IPYQYLSX.js → chunk-ZDI5I2HT.js} +6 -6
  186. package/dist/{chunk-IPYQYLSX.js.map → chunk-ZDI5I2HT.js.map} +1 -1
  187. package/dist/{chunk-JAC6AVZN.js → chunk-ZIZXXYXM.js} +3 -3
  188. package/dist/{chunk-JAC6AVZN.js.map → chunk-ZIZXXYXM.js.map} +1 -1
  189. package/dist/collapsible-panel.d.ts +5 -5
  190. package/dist/collapsible-panel.js +4 -4
  191. package/dist/collapsible-panel.js.map +1 -1
  192. package/dist/color-field.js +2 -2
  193. package/dist/color-picker.js +1 -1
  194. package/dist/color-swatches.js +1 -1
  195. package/dist/column-explorer.d.ts +2 -2
  196. package/dist/column-explorer.js +166 -21
  197. package/dist/column-explorer.js.map +1 -1
  198. package/dist/column-track.d.ts +1 -1
  199. package/dist/column-track.js +1 -1
  200. package/dist/combobox.d.ts +8 -4
  201. package/dist/combobox.js +1 -1
  202. package/dist/compose-B_GFfFhm.d.ts +36 -0
  203. package/dist/content-item.d.ts +1 -1
  204. package/dist/content-item.js +1 -1
  205. package/dist/content-swap.d.ts +3 -3
  206. package/dist/content-swap.js +1 -1
  207. package/dist/corner-status.d.ts +3 -3
  208. package/dist/corner-status.js +1 -1
  209. package/dist/device-class.js +101 -1
  210. package/dist/device-class.js.map +1 -1
  211. package/dist/disclosure-arrow.d.ts +3 -3
  212. package/dist/disclosure-arrow.js +1 -1
  213. package/dist/disclosure.d.ts +14 -2
  214. package/dist/disclosure.js +13 -4
  215. package/dist/disclosure.js.map +1 -1
  216. package/dist/edge-activity-indicator.d.ts +3 -3
  217. package/dist/edge-activity-indicator.js +1 -1
  218. package/dist/empty-state.d.ts +3 -3
  219. package/dist/empty-state.js +1 -1
  220. package/dist/{extension-attributes-IJ4decoa.d.ts → extension-attributes-CnqvBmj3.d.ts} +1 -1
  221. package/dist/file-picker.d.ts +3 -3
  222. package/dist/file-picker.js +1 -1
  223. package/dist/floating-toolbar.d.ts +3 -3
  224. package/dist/floating-toolbar.js +1 -1
  225. package/dist/form.d.ts +3 -3
  226. package/dist/form.js +1 -1
  227. package/dist/framed-list.js +1 -1
  228. package/dist/gauge.js +1 -1
  229. package/dist/grid.js +1 -1
  230. package/dist/index.d.ts +2 -2
  231. package/dist/index.js +66 -66
  232. package/dist/list-action-row.js +1 -1
  233. package/dist/list-detail-dialog.d.ts +3 -3
  234. package/dist/list-detail-dialog.js +7 -7
  235. package/dist/list-detail-dialog.js.map +1 -1
  236. package/dist/list-header.d.ts +1 -1
  237. package/dist/list-header.js +1 -1
  238. package/dist/list-inset-control.d.ts +3 -3
  239. package/dist/list-inset-control.js +1 -1
  240. package/dist/list-inset-text.js +1 -1
  241. package/dist/list-item.js +1 -1
  242. package/dist/list.d.ts +1 -1
  243. package/dist/list.js +1 -1
  244. package/dist/loading-spinner.d.ts +3 -3
  245. package/dist/loading-spinner.js +1 -1
  246. package/dist/lucide-icon.d.ts +3 -3
  247. package/dist/lucide-icon.js +1 -1
  248. package/dist/message-composer.js +1 -1
  249. package/dist/{nav-stack-DKrvqFjA.d.ts → nav-stack-IKSMxo2A.d.ts} +3 -3
  250. package/dist/nav-stack.d.ts +2 -2
  251. package/dist/nav-stack.js +1 -1
  252. package/dist/paged-view.d.ts +3 -3
  253. package/dist/paged-view.js +1 -1
  254. package/dist/paged-view.js.map +1 -1
  255. package/dist/pane.js +1 -1
  256. package/dist/popup-menu-register.js +7 -1
  257. package/dist/popup-menu-register.js.map +1 -1
  258. package/dist/popup-menu.d.ts +3 -20
  259. package/dist/popup-menu.js +1 -1
  260. package/dist/progress-bar.js +1 -1
  261. package/dist/progress-ring.js +1 -1
  262. package/dist/radio-group.js +1 -1
  263. package/dist/resizable-region.d.ts +3 -3
  264. package/dist/resizable-region.js +1 -1
  265. package/dist/row.d.ts +1 -1
  266. package/dist/row.js +1 -1
  267. package/dist/scroll-effect.d.ts +1 -1
  268. package/dist/scroll-effect.js +1 -1
  269. package/dist/{search-field-7wLt3Bd5.d.ts → search-field-BA48RaJY.d.ts} +3 -3
  270. package/dist/search-field-model.d.ts +2 -2
  271. package/dist/search-field.d.ts +2 -2
  272. package/dist/search-field.js +1 -1
  273. package/dist/segmented-control.d.ts +3 -3
  274. package/dist/segmented-control.js +1 -1
  275. package/dist/select-register.js +3 -2
  276. package/dist/select-register.js.map +1 -1
  277. package/dist/select.d.ts +3 -13
  278. package/dist/select.js +1 -1
  279. package/dist/sized-region.d.ts +3 -3
  280. package/dist/sized-region.js +1 -1
  281. package/dist/skeleton.d.ts +3 -3
  282. package/dist/skeleton.js +1 -1
  283. package/dist/slider.js +1 -1
  284. package/dist/spacer.d.ts +3 -3
  285. package/dist/spacer.js +1 -1
  286. package/dist/split-button.js +1 -1
  287. package/dist/split-view.d.ts +4 -4
  288. package/dist/split-view.js +1 -1
  289. package/dist/state-banner.js +1 -1
  290. package/dist/styles/components/actions/popup-menu/popup-menu.css +12 -125
  291. package/dist/styles/components/actions/toolbar/toolbar.css +0 -7
  292. package/dist/styles/components/data-display/value-table/value-table.css +3 -1
  293. package/dist/styles/components/forms/select/select.css +0 -60
  294. package/dist/styles/components/forms/switch/switch.css +9 -0
  295. package/dist/styles/components/forms/text-field/text-field.css +1 -1
  296. package/dist/styles/components/surfaces/disclosure/disclosure.css +24 -4
  297. package/dist/styles/components/surfaces/surface-scaffold/surface-scaffold.css +1 -1
  298. package/dist/styles/disclosure.css +24 -4
  299. package/dist/styles/popup-menu.css +12 -125
  300. package/dist/styles/select.css +0 -60
  301. package/dist/styles/surface-scaffold.css +1 -1
  302. package/dist/styles/switch.css +9 -0
  303. package/dist/styles/text-field.css +1 -1
  304. package/dist/styles/toolbar.css +0 -7
  305. package/dist/styles/value-table.css +3 -1
  306. package/dist/styles/webawesome.css +7 -0
  307. package/dist/summary-row.js +1 -1
  308. package/dist/sunken-panel.d.ts +3 -3
  309. package/dist/sunken-panel.js +1 -1
  310. package/dist/surface-scaffold.d.ts +9 -5
  311. package/dist/surface-scaffold.js +1 -1
  312. package/dist/switch.d.ts +3 -1
  313. package/dist/switch.js +1 -1
  314. package/dist/tab-bar-item.js +1 -1
  315. package/dist/tab-bar.d.ts +3 -3
  316. package/dist/tab-bar.js +1 -1
  317. package/dist/tab-navigator.d.ts +3 -3
  318. package/dist/tab-navigator.js +2 -2
  319. package/dist/tab-navigator.js.map +1 -1
  320. package/dist/tab-panel.d.ts +3 -3
  321. package/dist/tab-panel.js +1 -1
  322. package/dist/tag-field.d.ts +3 -3
  323. package/dist/tag-field.js +1 -1
  324. package/dist/text-field.d.ts +2 -2
  325. package/dist/text-field.js +1 -1
  326. package/dist/text.d.ts +1 -1
  327. package/dist/text.js +1 -1
  328. package/dist/toolbar-control-group.d.ts +7 -7
  329. package/dist/toolbar-control-group.js +1 -1
  330. package/dist/toolbar-text.d.ts +3 -3
  331. package/dist/toolbar-text.js +1 -1
  332. package/dist/toolbar.d.ts +3 -3
  333. package/dist/toolbar.js +1 -1
  334. package/dist/tree-list.d.ts +3 -3
  335. package/dist/tree-list.js +151 -3
  336. package/dist/tree-list.js.map +1 -1
  337. package/dist/{tree-rows-Bms5QJvG.d.ts → tree-rows-BXChApji.d.ts} +1 -1
  338. package/dist/{types-DmHWkSd6.d.ts → types-CuKf5G87.d.ts} +6 -2
  339. package/dist/value-preview.d.ts +3 -3
  340. package/dist/value-preview.js +1 -1
  341. package/dist/value-table.d.ts +5 -5
  342. package/dist/value-table.js +1 -1
  343. package/dist/wire-catalog.d.ts +5 -5
  344. package/dist/wire-catalog.js +13 -4
  345. package/dist/wire-catalog.js.map +1 -1
  346. package/dist/wire-color-fields.js +73 -2
  347. package/dist/wire-color-fields.js.map +1 -1
  348. package/dist/wire-color-pickers.js +1 -1
  349. package/dist/wire-column-explorer.js +92 -1
  350. package/dist/wire-column-explorer.js.map +1 -1
  351. package/dist/wire-content-items.js +204 -1
  352. package/dist/wire-content-items.js.map +1 -1
  353. package/dist/wire-nav-stack.js +423 -1
  354. package/dist/wire-nav-stack.js.map +1 -1
  355. package/dist/wire-resizable-regions.js +1 -1
  356. package/dist/wire-search-fields.d.ts +2 -2
  357. package/dist/wire-search-fields.js +1 -1
  358. package/dist/wire-sidebar.js +228 -1
  359. package/dist/wire-sidebar.js.map +1 -1
  360. package/dist/wire-sliders.js +29 -1
  361. package/dist/wire-sliders.js.map +1 -1
  362. package/dist/wire-tab-bars.d.ts +1 -1
  363. package/dist/wire-tab-navigator.js +150 -1
  364. package/dist/wire-tab-navigator.js.map +1 -1
  365. package/dist/wire-tag-fields.js +252 -2
  366. package/dist/wire-tag-fields.js.map +1 -1
  367. package/dist/wire-tree-list.js +186 -1
  368. package/dist/wire-tree-list.js.map +1 -1
  369. package/dist/wire-workbench.js +1 -1
  370. package/dist/workbench-dialog.d.ts +3 -3
  371. package/dist/workbench-dialog.js +5 -5
  372. package/dist/workbench-dialog.js.map +1 -1
  373. package/dist/workbench.d.ts +4 -4
  374. package/dist/workbench.js +1 -1
  375. package/docs/accessibility.md +1 -1
  376. package/docs/catalog.md +59 -0
  377. package/docs/component-contract.md +4 -3
  378. package/docs/component-selection.md +7 -2
  379. package/docs/disclosure.md +22 -0
  380. package/docs/examples/composed-catalog.tsx +113 -0
  381. package/docs/examples/scoped-combobox.ts +99 -0
  382. package/docs/examples/typed-action-table.tsx +34 -0
  383. package/docs/forms-and-validation.md +2 -0
  384. package/docs/investigations/combobox-seed-ownership.md +49 -0
  385. package/docs/investigations/measure-scoped-combobox.mjs +87 -0
  386. package/docs/investigations/scoped-combobox.md +98 -0
  387. package/docs/list-detail-dialog.md +2 -3
  388. package/docs/scroll-effect.md +2 -2
  389. package/docs/surface-scaffold.md +5 -6
  390. package/docs/switch.md +21 -0
  391. package/docs/ui-doctor.md +16 -0
  392. package/docs/workbench-dialog.md +2 -3
  393. package/doctor/cli.mjs +38 -25
  394. package/doctor/explain-use.mjs +320 -0
  395. package/llms.txt +3 -44
  396. package/package.json +6 -33
  397. package/ux-demo/recipes/app-shell.tsx +141 -48
  398. package/ux-demo/recipes/collapsible-sidebar.tsx +169 -43
  399. package/ux-demo/recipes/compact-toolbar.tsx +114 -22
  400. package/ux-demo/recipes/composer-form.tsx +104 -14
  401. package/ux-demo/recipes/list-detail-dialog.tsx +84 -38
  402. package/ux-demo/recipes/list-workspace-states.tsx +152 -29
  403. package/ux-demo/recipes/loading-inspector.tsx +174 -30
  404. package/ux-demo/recipes/media-detail.tsx +146 -29
  405. package/ux-demo/recipes/navigation-sidebar.tsx +113 -24
  406. package/ux-demo/recipes/navigation-stack.tsx +43 -7
  407. package/ux-demo/recipes/workspace-header.tsx +66 -2
  408. package/ai/component-props-overlay.json +0 -8910
  409. package/ai/component-props-overlay.schema.json +0 -82
  410. package/ai/component-props.json +0 -34289
  411. package/ai/component-props.schema.json +0 -408
  412. package/ai/view-document.schema.json +0 -467
  413. package/dist/browser/editor.js +0 -50
  414. package/dist/chunk-3K5V3ZSD.js +0 -77
  415. package/dist/chunk-3K5V3ZSD.js.map +0 -1
  416. package/dist/chunk-63TJH2RF.js +0 -231
  417. package/dist/chunk-63TJH2RF.js.map +0 -1
  418. package/dist/chunk-6V6UHPJD.js +0 -153
  419. package/dist/chunk-6V6UHPJD.js.map +0 -1
  420. package/dist/chunk-76BLSFEA.js.map +0 -1
  421. package/dist/chunk-C4FBYP2D.js.map +0 -1
  422. package/dist/chunk-COQI4OMZ.js.map +0 -1
  423. package/dist/chunk-CUUW57WB.js.map +0 -1
  424. package/dist/chunk-D2KHQNJ6.js +0 -155
  425. package/dist/chunk-D2KHQNJ6.js.map +0 -1
  426. package/dist/chunk-DV6GE57V.js.map +0 -1
  427. package/dist/chunk-FCO7BT4P.js +0 -256
  428. package/dist/chunk-FCO7BT4P.js.map +0 -1
  429. package/dist/chunk-GHV36C6I.js +0 -94
  430. package/dist/chunk-GHV36C6I.js.map +0 -1
  431. package/dist/chunk-HPOXLOVC.js +0 -184
  432. package/dist/chunk-HPOXLOVC.js.map +0 -1
  433. package/dist/chunk-I2K4OQKB.js +0 -426
  434. package/dist/chunk-I2K4OQKB.js.map +0 -1
  435. package/dist/chunk-LET362AM.js.map +0 -1
  436. package/dist/chunk-PVKAIVKE.js.map +0 -1
  437. package/dist/chunk-RGB4DPMN.js.map +0 -1
  438. package/dist/chunk-S7QB5KMM.js.map +0 -1
  439. package/dist/chunk-SGYBIKQA.js.map +0 -1
  440. package/dist/chunk-TXBNPEIJ.js +0 -31
  441. package/dist/chunk-TXBNPEIJ.js.map +0 -1
  442. package/dist/chunk-UU37OR3D.js.map +0 -1
  443. package/dist/chunk-WCMGPAY2.js +0 -103
  444. package/dist/chunk-WCMGPAY2.js.map +0 -1
  445. package/dist/chunk-WSPXSWFG.js.map +0 -1
  446. package/dist/chunk-X43QQWVC.js +0 -208
  447. package/dist/chunk-X43QQWVC.js.map +0 -1
  448. package/dist/chunk-YA6OAJY6.js +0 -155
  449. package/dist/chunk-YA6OAJY6.js.map +0 -1
  450. package/dist/editor.d.ts +0 -447
  451. package/dist/editor.js +0 -15608
  452. package/dist/editor.js.map +0 -1
  453. package/dist/styles/editor/editor.css +0 -585
  454. package/dist/styles/editor.css +0 -4
  455. package/dist/view-runtime.d.ts +0 -9
  456. package/dist/view-runtime.js +0 -8
  457. package/dist/view-runtime.js.map +0 -1
  458. package/docs/editor-host.md +0 -397
  459. package/docs/view.md +0 -314
  460. package/props/cli.d.mts +0 -1
  461. package/props/cli.mjs +0 -142
  462. package/props/component-props.d.mts +0 -180
  463. package/props/component-props.mjs +0 -1208
  464. package/view/catalog.mjs +0 -229
  465. package/view/child-kind.mjs +0 -22
  466. package/view/cli.d.mts +0 -18
  467. package/view/cli.mjs +0 -316
  468. package/view/contract.mjs +0 -418
  469. package/view/css-grammar.mjs +0 -93
  470. package/view/generate.d.mts +0 -16
  471. package/view/generate.mjs +0 -739
  472. package/view/index.d.mts +0 -491
  473. package/view/index.mjs +0 -36
  474. package/view/interpret.mjs +0 -339
  475. package/view/project-types-worker.mjs +0 -55
  476. package/view/project-types.d.mts +0 -43
  477. package/view/project-types.mjs +0 -618
  478. package/view/type-expression.d.mts +0 -15
  479. package/view/type-expression.mjs +0 -162
  480. package/view/types.mjs +0 -165
  481. package/view/validate-move.mjs +0 -353
  482. package/view/validate.mjs +0 -1649
  483. package/vite-editor.d.mts +0 -173
  484. package/vite-editor.mjs +0 -548
package/docs/view.md DELETED
@@ -1,314 +0,0 @@
1
- # View documents
2
-
3
- A view document (`*.kui.json`, format `kerf-ui-document/v1`) describes one
4
- screen or component built from Kerf UI and your own components: which
5
- components, how they nest, their prop values, and the inputs, actions, slots,
6
- and named nodes your application code works with. The Kerf UI editor writes
7
- these documents; tools and AI agents may write them too.
8
-
9
- You never ship the document's markup by hand. Either generate a read-only
10
- TypeScript module from it with `kerf-ui-view`, or render it at runtime with
11
- `interpretView`. Both come from `@kerfjs/ui`, and both behave the same.
12
-
13
- The full design, with every rule and diagnostic, is
14
- [`docs/26-ui-editor.md`](../../docs/26-ui-editor.md). This guide covers what an
15
- application needs.
16
-
17
- ## Files
18
-
19
- ```
20
- inbox.kui.json the document (the editor's source of truth)
21
- inbox.view.ts generated, read-only; never edit it
22
- inbox.ts yours: state, handlers, slot content, wiring
23
- ```
24
-
25
- The generated module sits beside its document. Add `**/*.view.ts` (and
26
- `*.view.js` / `*.view.d.ts`) to `.prettierignore`: reformatting a generated
27
- module changes its body digest, and the checks below then report it as edited.
28
-
29
- ## The document format
30
-
31
- ```json
32
- {
33
- "$schema": "https://raw.githubusercontent.com/brianwestphal/kerf/main/ui/ai/view-document.schema.json",
34
- "schema": "kerf-ui-document/v1",
35
- "name": "Inbox",
36
- "catalogs": ["@kerfjs/ui"],
37
- "params": {
38
- "title": { "type": { "kind": "string" }, "default": "Inbox" }
39
- },
40
- "root": {
41
- "id": "01JB8Z1M6Q8E1X9V4S7K2R3T5A",
42
- "type": "@kerfjs/ui:pane",
43
- "zones": {
44
- "header": [
45
- {
46
- "id": "01JB8Z1M6Q8E1X9V4S7K2R3T5B",
47
- "type": "@kerfjs/ui:toolbar-text",
48
- "props": { "label": { "$param": "title" }, "size": "xl" }
49
- }
50
- ]
51
- }
52
- }
53
- }
54
- ```
55
-
56
- - **`name`** is the PascalCase component name. Every generated identifier
57
- derives from it (`renderInbox`, `InboxInputs`, `inboxContract`).
58
- - **`catalogs`** lists the packages or catalog files whose components the
59
- document uses.
60
- - **`params`** are the document's typed inputs. A param with a `default` is an
61
- optional input; one with `"optional": true` may be omitted.
62
- - **`root`** is one node.
63
-
64
- A **node** is `{ id, type, name?, props?, zones? }`. `type` is the component's
65
- catalog key (`@kerfjs/ui:button`, or `package:id#Export` for an entry's second
66
- export), or one of the built-ins `#text` and `#view` (another document). `id` is
67
- an immutable ULID. A `name` (camelCase) makes the node a ref your code can
68
- reach. `zones` maps each zone or content prop to its ordered children.
69
-
70
- Prop values are JSON literals or one of these forms. There are no expressions:
71
- a value that needs computing becomes a param.
72
-
73
- | Form | Meaning |
74
- | -------------------------- | --------------------------------------------------------------- |
75
- | `{ "$param": "title" }` | A document param |
76
- | `{ "$bind": "item.x" }` | A path into an enclosing `$each` item, or into a param |
77
- | `{ "$action": "save" }` | An action name, on action props only; becomes a typed handler |
78
- | `{ "$css": "space('m')" }` | One `@kerfjs/ui/css-values` builder call with literal arguments |
79
- | `{ "$icon": "inbox" }` | A Lucide icon by its kebab-case name |
80
- | `{ "$slot": "detail" }` | Content your application renders, inside a list or object value |
81
-
82
- Zone children are nodes, `#text` runs, and three control-flow forms:
83
-
84
- - **`$each`**: `{ "$each": <array>, "as": "item", "key": "item.id", "template": <node> }`
85
- renders one keyed row per item. `template` may also be an `$if` chain that
86
- picks a row design per item, or use `"templates"` plus `"kind"` to pick one
87
- per item kind (a `default` entry is required).
88
- - **`$if`**: `{ "$if": <boolean>, "then": <child>, "else"?: <child> }`.
89
- - **`$slot`**: `{ "$slot": "detail" }`, a hole your application fills with
90
- `SafeHtml`.
91
-
92
- Editors and IDEs validate the shape with
93
- [`view-document.schema.json`](../ai/view-document.schema.json); `validateView`
94
- checks everything the schema cannot (below).
95
-
96
- ## The generated module
97
-
98
- `kerf-ui-view generate inbox.kui.json` writes `inbox.view.ts`:
99
-
100
- ```ts
101
- export interface InboxInputs { readonly title?: string; … }
102
- export type InboxAction = 'compose' | 'open-item';
103
- export interface InboxHandlers { compose(context): void; 'open-item'(context): void }
104
- export interface InboxSlots { detail(): SafeHtml }
105
- export interface InboxRefs { readonly composeButton: HTMLElement; … }
106
- export const inboxContract = 'kui1:5f0c2a9e7d41b3c8';
107
- export function renderInbox(inputs: InboxInputs, slots: InboxSlots, rowKey?: string): SafeHtml;
108
- export function wireInbox(root: HTMLElement, handlers: InboxHandlers): () => void;
109
- export function inboxRefs(root: ParentNode): InboxRefs;
110
- ```
111
-
112
- Use it from your own file; never edit it:
113
-
114
- ```ts
115
- import { mount } from 'kerfjs';
116
- import { renderInbox, wireInbox } from './inbox.view.js';
117
-
118
- mount(root, () =>
119
- renderInbox(
120
- { title: 'Inbox', items: items.value },
121
- { detail: () => MessageDetail({ id: selectedId.value }) },
122
- ),
123
- );
124
- const dispose = wireInbox(root, {
125
- compose: () => openComposer(),
126
- 'open-item': ({ key }) => (selectedId.value = key),
127
- });
128
- ```
129
-
130
- - **Inputs** are the params. A missing required input is a compile error.
131
- - **Handlers** need exactly one function per action, so adding an action in the
132
- document fails your build until you handle it, and removing one turns the
133
- leftover handler into an error. An action inside an `$each` row gets the
134
- row's `key` in its context.
135
- - **Slots** return `SafeHtml`, so escaping stays enforced.
136
- - **Refs** resolve named nodes by their `data-kerf-node` marker. A named node
137
- inside a row becomes a `(key) => Element | null` lookup.
138
-
139
- ### The contract
140
-
141
- The **contract** is the module's public surface: its inputs, actions and their
142
- scope, slots, refs, and row kinds. `<name>Contract` is its digest (`kui1:` plus
143
- 16 hex digits). Layout, literal prop values, text, and unnamed nodes are not
144
- part of it, so a purely visual edit leaves the digest, and your code,
145
- unchanged.
146
-
147
- The module's three-line header records the generator version, the contract and
148
- source digests, a digest of the module body, and the contract itself, so tools
149
- can compare contracts without the old document.
150
-
151
- ## The `kerf-ui-view` CLI
152
-
153
- ```sh
154
- npx kerf-ui-view generate src/**/*.kui.json # write each module beside its document
155
- npx kerf-ui-view check src/**/*.kui.json # fail on a missing, stale, or hand-edited module
156
- npx kerf-ui-view diff src/**/*.kui.json # print the contract changes regenerating would make
157
- ```
158
-
159
- | Option | Effect |
160
- | ---------------------- | ------------------------------------------------------------------ |
161
- | `--target ts\|js` | `.view.ts` (default), or `.view.js` plus `.view.d.ts` for no-build |
162
- | `--declarations-only` | Omit `render<Name>`, for documents rendered with `interpretView` |
163
- | `--props <file>` | Add a `component-props.json` catalog (repeatable) |
164
- | `--composition <file>` | Add a `component-composition.json` catalog (repeatable) |
165
- | `--no-profile` | Skip the catalogs `.kerf-ui-profile.json` files declare |
166
-
167
- The CLI loads Kerf UI's catalogs plus every package catalog the
168
- `.kerf-ui-profile.json` files above a document declare. Run `check` in CI.
169
-
170
- `diff` lists breaking changes first: a required input added, an input removed
171
- or narrowed, an action added or removed, a slot changed, a ref removed or
172
- retyped. Optional inputs, widened types, and new refs are non-breaking. Your
173
- compiler then reports exactly the call sites a breaking change affects.
174
-
175
- ### Catalog-owned views
176
-
177
- The UX catalog uses this same path for compositions and recipes. Their editable sources live in
178
- `ux-demo/views/`; the checked `*.view.ts` files beside them render the
179
- component trees imported by the catalog hosts. The `headers.tsx` host keeps
180
- `CatalogExample` framing, and the workspace recipe host keeps presentation and
181
- command handling. The catalog's existing delegated actions handle the button
182
- names and `data-recipe-command` values in the documents.
183
-
184
- After editing a catalog document in the editor, run this command from `ui/` and
185
- commit the document and generated module together:
186
-
187
- ```sh
188
- npm run catalog:views:generate
189
- ```
190
-
191
- `npm run check:catalog-views` fails when any module is missing, stale, or
192
- hand-edited. Both `npm run check:change` and `npm run check` include that check.
193
-
194
- ## Rendering documents at runtime
195
-
196
- A server-driven application loads documents at runtime instead of generating
197
- `render<Name>`. Generate with `--declarations-only` to keep the typed inputs,
198
- handlers, refs, and contract, then render with `interpretView`:
199
-
200
- ```ts
201
- import { mount } from 'kerfjs';
202
- import { createViewCatalog, interpretView } from '@kerfjs/ui/view';
203
- import { Pane } from '@kerfjs/ui/pane';
204
- import { ToolbarText } from '@kerfjs/ui/toolbar-text';
205
- import props from '@kerfjs/ui/ai/component-props.json';
206
- import composition from '@kerfjs/ui/ai/component-composition.json';
207
- import { inboxContract } from './inbox.view.js';
208
-
209
- const catalog = createViewCatalog({ props: [props], composition: [composition] });
210
-
211
- mount(root, () =>
212
- interpretView(served, {
213
- catalog,
214
- components: {
215
- '@kerfjs/ui:pane': Pane,
216
- '@kerfjs/ui:toolbar-text': ToolbarText,
217
- },
218
- inputs: { title: 'Inbox' },
219
- contract: inboxContract,
220
- // Render an app-owned notice instead of throwing (log `error.contract`).
221
- onMismatch: (error) => updateRequiredNotice(error),
222
- }),
223
- );
224
- ```
225
-
226
- `interpretView` validates the document and compares its contract digest with
227
- the one your code compiled against. On a mismatch it throws a
228
- `KuiContractMismatch` (with `expected`, `actual`, and the served `contract`), or
229
- renders `onMismatch`'s fallback, so a server-side edit never silently breaks a
230
- deployed client. Pass every component the document uses explicitly, so the
231
- bundle stays static; pass `icons` (Lucide name to icon data) for `$icon`
232
- values and `resolveView` for `#view` nodes. Its output matches the generated
233
- module byte for byte.
234
-
235
- ## Validating documents
236
-
237
- ```ts
238
- import { createViewCatalog, validateView } from '@kerfjs/ui/view';
239
-
240
- const catalog = createViewCatalog({ props: [props], composition: [composition] });
241
- const { valid, diagnostics, hints, actions } = validateView(document, catalog, {
242
- resolveView: (src, path) => readDocument(path),
243
- });
244
- ```
245
-
246
- Each diagnostic is `{ code, path, message }` with a stable code (`KUI-V001` to
247
- `KUI-V017` for the document, `KUI-L2##` for composition rules); `hints` are
248
- non-blocking advice (`KUI-H###`). `validateView` is pure and has no Node APIs,
249
- so it runs in the browser. Add your own component package's catalogs to
250
- `props` and `composition` (write `component-props.json` with `kerf-ui-props`).
251
-
252
- ## Never edit a generated module
253
-
254
- `eslint-plugin-kerfjs`'s `kerfjs/no-generated-view-edits` rule reports a
255
- `*.view.ts` / `*.view.js` file whose body no longer matches the digest in its
256
- header. It needs no access to the document. The fix is always to regenerate;
257
- to change the view, edit the document (in the editor, or as JSON) and run
258
- `kerf-ui-view generate`.
259
-
260
- ## The `@kerfjs/ui/view` API
261
-
262
- **Documents and rendering**
263
-
264
- | Export | Use |
265
- | ------------------------------------------- | ---------------------------------------------------------------------- |
266
- | `createViewCatalog({ props, composition })` | Index component catalogs for the functions below |
267
- | `validateView(document, catalog, options?)` | Diagnostics, hints, and the action scopes |
268
- | `interpretView(document, options)` | Render a served document after its contract check |
269
- | `KuiContractMismatch` | The error `interpretView` throws on a contract mismatch |
270
- | `previewView(document, options)` | An editor's lenient preview: no validation, placeholders for bad nodes |
271
- | `generateView(document, catalog, options?)` | The module source, declarations, contract, and digest |
272
- | `GENERATOR_VERSION` | The generator version a header records |
273
- | `readViewHeader(code)` | Parse a module header; `intact` is false after a hand edit |
274
- | `viewModulePath(path, target?)` | `x.kui.json` to `x.view.ts` (or `.view.js`) |
275
- | `composedViewPath(from, src)` | Where a `#view` `src` points, as `resolveView` receives it |
276
- | `VIEW_DOCUMENT_SCHEMA_ID` | `'kerf-ui-document/v1'` |
277
-
278
- **Contracts**
279
-
280
- | Export | Use |
281
- | ------------------------------- | ----------------------------------------------------------- |
282
- | `contractOf(document, catalog)` | The contract of a valid document |
283
- | `contractDigest(contract)` | Its `kui1:` digest |
284
- | `diffContracts(before, after)` | Every change, each marked breaking or not |
285
- | `serializeContract(contract)` | The contract line a header records |
286
- | `canonicalJson(value)` | JSON with sorted keys and no whitespace, as digests hash it |
287
- | `viewDigest(text)` | The `kui1:` hash of any text |
288
- | `typeText(type)` | The TypeScript spelling of a param or slot-input type |
289
-
290
- **Building tools on the format.** These serve editors and other tools that
291
- read or change documents; `@kerfjs/ui/editor` uses each of them.
292
-
293
- | Export | Use |
294
- | ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
295
- | `walkView(document, visit)` | Visit every node (with whether it is inside a row); returns slot names |
296
- | `childKind(child)` / `classifyChild(child)` | A zone child's kind (`each`, `if`, `slot`, `view`, `node`); `classifyChild` pairs it with the child so a TypeScript `switch` narrows it |
297
- | `createMoveCheck(document, catalog, id)` | Whether moving a node adds a problem, without a full validation |
298
- | `isAssignable(from, to)` / `isLiteralOf(value, type)` | Type checks in the catalog's type grammar |
299
- | `fieldZoneOf(component, definitions, key)` | Which prop field a field-zone key (`leftRail.content`) fills |
300
- | `channelOf(component)` | How a component carries `data-*` attributes |
301
- | `dataAttributeProblem(key)` | Why a `rootAttributes` key is not allowed, or undefined |
302
- | `parseCssCall(source)` / `parseCssTree(source)` | Parse a `$css` value: its helper names, or its call tree |
303
- | `lucideExportName(name)` | Lucide's export name for an icon (`a-arrow-down` to `AArrowDown`) |
304
-
305
- The types (`ViewDocument`, `ViewNode`, `ViewChild`, `ViewEachChild`,
306
- `ViewIfChild`, `ViewSlotChild`, `ViewType`, `ViewValue`, `ViewCatalog`,
307
- `ViewDiagnostic`, `ViewValidation`, `ViewContract`, `ViewContractChange`,
308
- `GeneratedView`) are exported alongside.
309
-
310
- ## See also
311
-
312
- - [Editor host](./editor-host.md): run the editor in your app's dev server.
313
- - [`view-document.schema.json`](../ai/view-document.schema.json): the shape
314
- schema for editors and IDEs.
package/props/cli.d.mts DELETED
@@ -1 +0,0 @@
1
- export function run(argv: readonly string[]): { code: number; output: string };
package/props/cli.mjs DELETED
@@ -1,142 +0,0 @@
1
- #!/usr/bin/env node
2
- // kerf-ui-props: writes or checks a component package's component-props.json
3
- // (KF-B8TGP4: component packages ship the same prop schema as @kerfjs/ui), so
4
- // the Kerf UI editor, view validator, and generator can use its components.
5
- // Reads package.json#kerfComponentCatalog: `output` (the composition catalog
6
- // create-kerf-component writes), `propsOutput` (where to write), and an
7
- // optional `propsOverlay` of inspector hints. Run after the package's build.
8
- import { existsSync, readFileSync, writeFileSync } from 'node:fs';
9
- import { resolve } from 'node:path';
10
- import process from 'node:process';
11
- import { fileURLToPath } from 'node:url';
12
-
13
- import {
14
- CLI_USAGE_EXIT,
15
- isMainModule,
16
- parseCliArguments,
17
- readJsonFile,
18
- wantsHelp,
19
- } from '../scripts/lib/cli-args.mjs';
20
- import { validateJsonSchemaSubset } from '../scripts/lib/json-schema-subset.mjs';
21
- import { buildPackageComponentProps } from './component-props.mjs';
22
-
23
- const USAGE = `Usage: kerf-ui-props (--write | --check) [--root <package directory>]
24
-
25
- Reads package.json#kerfComponentCatalog.output (composition catalog),
26
- .propsOutput (destination), and optional .propsOverlay (inspector hints).
27
- Run it after building the package: it reads the built declarations.
28
-
29
- Options:
30
- --write write the props catalog
31
- --check fail when the props catalog is missing or stale
32
- --root <path> package directory (default: current directory)
33
- -h, --help show this help
34
-
35
- Exit codes: 0 success, 1 stale catalog or schema problems, 2 usage or
36
- input error.
37
- `;
38
-
39
- // Every read names its file on failure (missing, unreadable, invalid JSON).
40
- const readJson = (path) => readJsonFile(path);
41
- const schemaPath = fileURLToPath(
42
- new URL('../ai/component-props.schema.json', import.meta.url),
43
- );
44
-
45
- /** Runs one invocation; returns `{ code, output }` instead of exiting, for tests. */
46
- export function run(argv) {
47
- if (wantsHelp(argv)) return { code: 0, output: USAGE };
48
- let options;
49
- try {
50
- ({ options } = parseCliArguments(argv, {
51
- values: { '--root': 'root' },
52
- flags: { '--write': 'write', '--check': 'check' },
53
- }));
54
- if (options.write === options.check)
55
- throw new Error('choose exactly one of --write or --check');
56
- } catch (error) {
57
- return { code: 2, output: `kerf-ui-props: ${error.message}\n\n${USAGE}` };
58
- }
59
- const write = options.write === true;
60
- const root = resolve(options.root ?? process.cwd());
61
- try {
62
- return runIn(root, write);
63
- } catch (error) {
64
- return {
65
- code: CLI_USAGE_EXIT,
66
- output: `kerf-ui-props: ${error.message}\n`,
67
- };
68
- }
69
- }
70
-
71
- /** Writes or checks the props catalog of the package at `root`. */
72
- function runIn(root, write) {
73
- const packagePath = resolve(root, 'package.json');
74
- if (!existsSync(packagePath)) {
75
- return { code: 2, output: `kerf-ui-props: no package.json in ${root}\n` };
76
- }
77
- const packageJson = readJson(packagePath);
78
- const config = packageJson.kerfComponentCatalog ?? {};
79
- const missing = ['output', 'propsOutput'].filter((key) => !config[key]);
80
- if (missing.length) {
81
- return {
82
- code: 2,
83
- output: `kerf-ui-props: package.json#kerfComponentCatalog needs ${missing.join(' and ')}\n`,
84
- };
85
- }
86
- const compositionPath = resolve(root, config.output);
87
- if (!existsSync(compositionPath)) {
88
- return {
89
- code: 1,
90
- output: `kerf-ui-props: ${config.output} is missing; run your catalog:generate script first\n`,
91
- };
92
- }
93
- const { document, problems } = buildPackageComponentProps({
94
- root,
95
- packageJson,
96
- composition: readJson(compositionPath),
97
- overlay: config.propsOverlay
98
- ? readJson(resolve(root, config.propsOverlay))
99
- : undefined,
100
- });
101
- problems.push(
102
- ...validateJsonSchemaSubset(readJson(schemaPath), document).map(
103
- (error) => `${config.propsOutput} ${error}`,
104
- ),
105
- );
106
- if (problems.length) {
107
- return {
108
- code: 1,
109
- output: `${problems.map((problem) => `kerf-ui-props: ${problem}`).join('\n')}\n`,
110
- };
111
- }
112
- const text = `${JSON.stringify(document, null, 2)}\n`;
113
- const outputPath = resolve(root, config.propsOutput);
114
- if (write) {
115
- writeFileSync(outputPath, text);
116
- return {
117
- code: 0,
118
- output: `kerf-ui-props: wrote ${document.components.length} components to ${config.propsOutput}\n`,
119
- };
120
- }
121
- const current = existsSync(outputPath)
122
- ? readFileSync(outputPath, 'utf8')
123
- : undefined;
124
- if (current !== text) {
125
- return {
126
- code: 1,
127
- output: `kerf-ui-props: ${config.propsOutput} is ${current === undefined ? 'missing' : 'stale'}; run kerf-ui-props --write after building\n`,
128
- };
129
- }
130
- return {
131
- code: 0,
132
- output: `kerf-ui-props: ${config.propsOutput} is up to date (${document.components.length} components)\n`,
133
- };
134
- }
135
-
136
- // npm runs bins through symlinks (node_modules/.bin); isMainModule compares
137
- // real paths.
138
- if (isMainModule(import.meta.url)) {
139
- const result = run(process.argv.slice(2));
140
- (result.code === 0 ? process.stdout : process.stderr).write(result.output);
141
- process.exitCode = result.code;
142
- }
@@ -1,180 +0,0 @@
1
- import type ts from 'typescript';
2
-
3
- export const COMPONENT_PROPS_SCHEMA_ID: 'kerf-ui-component-props/v1';
4
-
5
- export type PropTypeKind =
6
- | 'string'
7
- | 'number'
8
- | 'boolean'
9
- | 'literal'
10
- | 'enum'
11
- | 'content'
12
- | 'css-value'
13
- | 'function'
14
- | 'signal'
15
- | 'element'
16
- | 'array'
17
- | 'record'
18
- | 'object'
19
- | 'union'
20
- | 'ref'
21
- | 'never'
22
- | 'unknown';
23
-
24
- export interface PropType {
25
- kind: PropTypeKind;
26
- text?: string;
27
- nullable?: true;
28
- acceptsText?: true;
29
- typeParameter?: string;
30
- value?: string | number | boolean;
31
- values?: (string | number | boolean)[];
32
- suggestions?: string[];
33
- grammar?: string;
34
- items?: PropType;
35
- props?: PropDescriptor[];
36
- members?: PropType[];
37
- index?: { keyPrefix: string; value: PropType };
38
- discriminant?: string[];
39
- ref?: string;
40
- }
41
-
42
- export interface PropDescriptor {
43
- name: string;
44
- property?: string;
45
- type: PropType;
46
- required: boolean;
47
- default?: string | number | boolean;
48
- description?: string;
49
- deprecated?: true;
50
- variantOnly?: true;
51
- zone?: string;
52
- slot?: true;
53
- iconSource?: 'lucide';
54
- cssValue?: { grammar: string; helpers?: string[]; rawPolicy?: string };
55
- control?: string;
56
- group?: string;
57
- /** The task-facing name the Inspector shows (Button text). */
58
- label?: string;
59
- subgroup?: string;
60
- order?: number;
61
- }
62
-
63
- export interface PropsVariant {
64
- when?: Record<string, string | number | boolean | undefined>;
65
- required: string[];
66
- forbidden: string[];
67
- }
68
-
69
- export interface PropsShape {
70
- props: PropDescriptor[];
71
- nativeAttributes: string[];
72
- variants?: PropsVariant[];
73
- discriminant?: string[];
74
- }
75
-
76
- export interface ComponentProps extends Partial<PropsShape> {
77
- key: string;
78
- id: string;
79
- source: 'kerf' | 'webawesome' | 'package';
80
- import?: string;
81
- export?: string;
82
- tagName?: string;
83
- description?: string;
84
- typeParameters?: { name: string; constraint?: string }[];
85
- groups?: string[];
86
- props: PropDescriptor[];
87
- slots?: { name: string; description?: string }[];
88
- dataChannel?: 'rootAttributes' | 'native' | 'none';
89
- }
90
-
91
- export interface ComponentPropsDocument {
92
- $schema: string;
93
- schema: typeof COMPONENT_PROPS_SCHEMA_ID;
94
- package: string;
95
- description: string;
96
- components: ComponentProps[];
97
- definitions: Record<string, PropType>;
98
- }
99
-
100
- export interface PropsContext {
101
- checker: ts.TypeChecker;
102
- ownDirectory: string;
103
- definitions: Map<string, PropType>;
104
- definitionNames: Map<ts.Type, string>;
105
- }
106
-
107
- export function createDeclarationProgram(
108
- files: string[],
109
- options?: ts.CompilerOptions,
110
- ): ts.Program;
111
- export function createPropsContext(
112
- checker: ts.TypeChecker,
113
- ownDirectory: string,
114
- ): PropsContext;
115
- export function describeType(
116
- ctx: PropsContext,
117
- type: ts.Type,
118
- depth?: number,
119
- ): PropType;
120
- export function describePropsType(ctx: PropsContext, type: ts.Type): PropsShape;
121
- export function readComponentExport(
122
- ctx: PropsContext,
123
- sourceFile: ts.SourceFile,
124
- name: string,
125
- ): (PropsShape & { export: string; description?: string }) | undefined;
126
- export function parseDocumentedDefault(
127
- text: string | undefined,
128
- tagValue?: string,
129
- ): string | undefined;
130
- export function coerceDefault(
131
- raw: string | undefined,
132
- descriptor: PropType,
133
- ): string | number | boolean | undefined;
134
- export function describeCustomElement(declaration: unknown): {
135
- props: PropDescriptor[];
136
- slots: { name: string; description?: string }[];
137
- };
138
- export function applyCrossReferences(
139
- component: { props: PropDescriptor[] },
140
- references: {
141
- zones?: { id: string; jsx?: { prop?: string } }[];
142
- cssValueProps?: {
143
- path: string;
144
- grammar: string;
145
- helpers?: string[];
146
- rawPolicy?: string;
147
- }[];
148
- },
149
- ): void;
150
- /** Generated inspector defaults: plumbing props get `control: 'hidden'`. */
151
- export function applyControlDefaults(component: {
152
- props: PropDescriptor[];
153
- }): void;
154
- export function applyOverlay(
155
- component: ComponentProps,
156
- overlay: unknown,
157
- problems: string[],
158
- ): void;
159
- export function buildComponentProps(inputs: {
160
- root: string;
161
- catalog: unknown;
162
- composition: unknown;
163
- overlay: unknown;
164
- customElements: unknown;
165
- }): { document: ComponentPropsDocument; problems: string[] };
166
- export function readComponentPropsInputs(root: string): {
167
- root: string;
168
- catalog: unknown;
169
- composition: unknown;
170
- overlay: unknown;
171
- customElements: unknown;
172
- };
173
-
174
- /** Builds a component package's component-props.json from its composition catalog and built declarations. */
175
- export function buildPackageComponentProps(inputs: {
176
- root: string;
177
- packageJson: { name: string; exports?: unknown };
178
- composition: unknown;
179
- overlay?: unknown;
180
- }): { document: ComponentPropsDocument; problems: string[] };