@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
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/layout/collapsible-panel/collapsible-panel.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAkDA,IAAM,gBAAA,GAAmB,CAAC,OAAA,MAA4C;AAAA,EACpE,yBAAA,EAA2B,OAAA;AAAA;AAAA;AAAA,EAG3B,UAAA,EAAY,GAAG,OAAO,CAAA,OAAA;AACxB,CAAA,CAAA;AAqBA,IAAM,kCAAA,uBAAyC,GAAA,CAAI;AAAA,EACjD,aAAA;AAAA,EACA,sBAAA;AAAA,EACA,gBAAA;AAAA,EACA,wBAAA;AAAA,EACA,yBAAA;AAAA,EACA,gBAAA;AAAA,EACA,uBAAA;AAAA,EACA,eAAA;AAAA,EACA,oBAAA;AAAA,EACA,eAAA;AAAA,EACA,mBAAA;AAAA,EACA,gBAAA;AAAA,EACA;AACF,CAAC,CAAA;AASM,SAAS,sBAAA,CAAuB;AAAA,EACrC,IAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA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';\n\nimport {\n collapsiblePanelToggleIcon,\n composedPanelBody,\n groupSizeFor,\n type PanelBottomToolbar,\n type PanelChromePlacement,\n type PanelSide,\n type PanelToggle,\n type PanelToggleAttributes,\n type PanelToolbar,\n relocatedPanelGroups,\n} from '../../../composition/panels/panel-toolbar.js';\nimport type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport {\n filterDataAttributes,\n type RootDataAttributes,\n} from '../../../shared/dom/extension-attributes.js';\nimport type { ToolbarConfig } from '../../actions/toolbar/toolbar.js';\nimport type { ListConfig } from '../../collections/list/list.js';\nimport { LucideIcon } from '../../media/lucide-icon/lucide-icon.js';\nimport type { PaneConfig } from '../pane/pane.js';\nimport type {\n ResizableRegionCollapseMotion,\n ResizableRegionContentOverflow,\n ResizableRegionPresentation,\n ResizableRegionRestorePosition,\n ResizableRegionSeparator,\n} from '../resizable-region/resizable-region.js';\n\nexport { collapsiblePanelToggleIcon } from '../../../composition/panels/panel-toolbar.js';\n\n/** Which edge a {@link CollapsiblePanel} docks to. */\nexport type CollapsiblePanelSide = PanelSide;\n\n/** The standard toggle a panel toolbar renders (see {@link CollapsiblePanelToolbar}). */\nexport type CollapsiblePanelToolbarToggle = PanelToggle;\n\n/**\n * A panel's composed top toolbar. Its groups occupy `leading`, `center`, and\n * `trailing` while open; groups marked `relocateOnCollapse` and the standard\n * toggle move to the work-area toolbar through\n * {@link CollapsiblePanelRelocated} while it is collapsed.\n */\nexport type CollapsiblePanelToolbar = PanelToolbar;\nexport type CollapsiblePanelBottomToolbar = PanelBottomToolbar;\nexport type CollapsiblePanelChromePlacement = PanelChromePlacement;\n\n/** A CollapsiblePanel toggle's `wireSidebar` hook. */\nconst toggleAttributes = (panelId: string): PanelToggleAttributes => ({\n 'data-collapsible-target': panelId,\n // Keyed, so the morph never reuses a (possibly focused) toggle's button for\n // another control as the toggle moves between toolbars.\n 'data-key': `${panelId}-toggle`,\n});\n\nexport interface CollapsiblePanelToggleProps {\n /** The panel this toggle controls. */\n side: CollapsiblePanelSide;\n /** The panel's current collapsed state (drives the icon direction). */\n collapsed: boolean;\n /** `data-action` the button carries so `wireSidebar` can delegate its click. */\n action: string;\n /** The panel id the button targets (`data-tab-panel`-style: `data-collapsible-panel`). */\n panelId?: string;\n /** Accessible label; defaults to \"Collapse\"/\"Expand\". */\n label?: string;\n className?: string;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n /** Application `data-*` metadata on the root, such as a row key or an\n * editor node marker; the component's own markers stay protected. */\n rootAttributes?: RootDataAttributes;\n}\n\nconst COLLAPSIBLE_PANEL_TOGGLE_PROTECTED = new Set([\n 'data-action',\n 'data-collapse-motion',\n 'data-collapsed',\n 'data-collapsible-panel',\n 'data-collapsible-target',\n 'data-component',\n 'data-content-overflow',\n 'data-outlined',\n 'data-panel-restore',\n 'data-position',\n 'data-presentation',\n 'data-separator',\n 'data-side',\n]);\n\n/**\n * A standard collapse/expand toggle button for a {@link CollapsiblePanel}: the\n * recognizable per-side icon (see {@link collapsiblePanelToggleIcon}) plus the\n * `data-action` / `aria-expanded` `wireSidebar` reads. Placement is the app's —\n * put it in the panel's own header (to collapse) and somewhere always-visible\n * (to expand while collapsed).\n */\nexport function CollapsiblePanelToggle({\n side,\n collapsed,\n action,\n panelId,\n label,\n className = '',\n slot,\n rootAttributes = {},\n}: CollapsiblePanelToggleProps) {\n const glyph = collapsiblePanelToggleIcon(side, collapsed);\n const accessible = label ?? (collapsed ? 'Expand' : 'Collapse');\n return (\n <button\n {...filterDataAttributes(\n rootAttributes,\n COLLAPSIBLE_PANEL_TOGGLE_PROTECTED,\n )}\n type=\"button\"\n class={`kui-collapsible-panel__toggle ${className}`.trim()}\n data-action={action}\n data-collapsible-target={panelId}\n aria-expanded={String(!collapsed)}\n aria-label={accessible}\n slot={slot}\n >\n <LucideIcon icon={glyph.icon} name={glyph.name} />\n </button>\n );\n}\n\nexport interface CollapsiblePanelProps {\n /** A stable id for the panel — `wireSidebar` targets it and toggles reference it. */\n id: string;\n /** Which edge the panel docks to: a left/right rail or a bottom drawer. */\n side: CollapsiblePanelSide;\n /** Whether the panel is currently collapsed (the app owns this signal). */\n collapsed?: boolean;\n /** Rail width or drawer height in px. Overrides the CSS default. */\n size?: number;\n /** Accessible label for the panel region. */\n label?: string;\n /** Opt into keyboard (`0`) or programmatic (`-1`) focus on the panel region. */\n tabIndex?: 0 | -1;\n /** Keep the standard focus outline visible while the panel is expanded. */\n outlined?: boolean;\n /** Panel content. */\n children?: KerfUiContent;\n /**\n * The panel's top toolbar, composed so its groups follow the panel's open\n * state. With it, `children` renders in a `Pane` below the toolbar; render\n * {@link CollapsiblePanelRelocated} in the app's work-area toolbar so the\n * marked groups and toggle stay reachable while the panel is collapsed.\n */\n toolbar?: CollapsiblePanelToolbar;\n /** Fixed content below a toolbar panel's top toolbar. */\n header?: KerfUiContent;\n headerList?: ListConfig;\n headerPlacement?: CollapsiblePanelChromePlacement;\n /** Fixed content above a toolbar panel's bottom toolbar. */\n footer?: KerfUiContent;\n footerList?: ListConfig;\n bottomToolbar?: CollapsiblePanelBottomToolbar;\n footerPlacement?: CollapsiblePanelChromePlacement;\n /**\n * Configuration for a `toolbar` panel's `Pane` (`contentElement`,\n * `contentLabel`, `separators`, `safeAreaEdges`, `chromeDividers`) — for example\n * `{ contentElement: 'nav', contentLabel: 'Sections' }` for a navigation\n * rail. Omitted or `undefined` fields keep the `Pane` defaults. Ignored\n * without a `toolbar`, where `children` renders as given.\n */\n pane?: PaneConfig;\n separator?: ResizableRegionSeparator;\n collapseMotion?: ResizableRegionCollapseMotion;\n contentOverflow?: ResizableRegionContentOverflow;\n presentation?: ResizableRegionPresentation;\n /** Control shown while collapsed, in a safe-area-aware corner of the panel's container (not the viewport). */\n restoreControl?: SafeHtml;\n restorePosition?: ResizableRegionRestorePosition;\n className?: string;\n /** Application `data-*` metadata on the root, such as a row key or an\n * editor node marker; the component's own markers stay protected. */\n rootAttributes?: RootDataAttributes;\n}\n\nconst COLLAPSIBLE_PANEL_PROTECTED = new Set([\n 'data-action',\n 'data-collapse-motion',\n 'data-collapsed',\n 'data-collapsible-panel',\n 'data-collapsible-target',\n 'data-component',\n 'data-content-overflow',\n 'data-outlined',\n 'data-panel-restore',\n 'data-position',\n 'data-presentation',\n 'data-separator',\n 'data-side',\n]);\n\n/**\n * A standalone collapsible side rail or bottom drawer, outside the full\n * {@link Workbench} shell. It owns only the presentation: a fixed-size content\n * area that stays laid out while the panel's track snaps to zero and the content\n * slides out via `transform` (one reflow, composited — the same technique\n * `Workbench` and the catalog sidebar use). Bottom-drawer content stays anchored\n * to the panel's fixed bottom edge, so the track cannot move its layout origin\n * underneath the transform transition. A collapsed panel renders `inert` (with\n * `aria-hidden`), so neither Tab, pointer, nor assistive technology reaches\n * content that has slid out of view; its `restoreControl` renders outside the\n * panel and stays reachable.\n * The app owns the `collapsed` signal;\n * pair it with `wireSidebar` for the toggle, focus, compact-overlay, keyboard,\n * and persistence semantics, and with `CollapsiblePanelToggle` for the standard\n * affordance. See `ui/docs/collapsible-panel.md` and `docs/23-app-layouts.md`.\n */\nexport function CollapsiblePanel({\n id,\n side,\n collapsed = false,\n size,\n label,\n tabIndex,\n outlined = false,\n children,\n toolbar,\n header,\n headerList,\n headerPlacement,\n footer,\n footerList,\n bottomToolbar,\n footerPlacement,\n pane,\n separator = 'auto',\n collapseMotion = 'slide',\n contentOverflow = 'clip',\n presentation = 'inline',\n restoreControl,\n restorePosition = side === 'left' ? 'bottom-start' : 'bottom-end',\n className = '',\n rootAttributes = {},\n}: CollapsiblePanelProps) {\n const sizeVar =\n side === 'bottom'\n ? '--kui-collapsible-panel-height'\n : '--kui-collapsible-panel-width';\n return (\n <>\n <aside\n {...filterDataAttributes(rootAttributes, COLLAPSIBLE_PANEL_PROTECTED)}\n class={`kui-collapsible-panel kui-collapsible-panel--${side} ${className}`.trim()}\n data-component=\"collapsible-panel\"\n data-collapsible-panel={id}\n data-side={side}\n data-collapsed={String(collapsed)}\n data-outlined={\n !collapsed && presentation !== 'hidden' && outlined\n ? 'true'\n : undefined\n }\n data-separator={separator}\n data-collapse-motion={collapseMotion}\n data-content-overflow={contentOverflow}\n data-presentation={presentation}\n aria-label={label || undefined}\n aria-hidden={\n collapsed || presentation === 'hidden' ? 'true' : undefined\n }\n tabindex={\n collapsed || presentation === 'hidden'\n ? tabIndex === undefined\n ? undefined\n : -1\n : tabIndex\n }\n inert={collapsed}\n style={size ? `${sizeVar}: ${size}px` : undefined}\n >\n <div class=\"kui-collapsible-panel__content\">\n {toolbar\n ? composedPanelBody({\n toolbar,\n side,\n collapsed,\n attributes: toggleAttributes(id),\n pane,\n header,\n headerList,\n headerPlacement,\n footer,\n footerList,\n bottomToolbar,\n footerPlacement,\n content: children,\n })\n : children}\n </div>\n </aside>\n {collapsed && restoreControl && presentation !== 'hidden' && (\n <div\n class=\"kui-collapsible-panel__restore\"\n data-panel-restore={id}\n data-position={restorePosition}\n >\n {restoreControl}\n </div>\n )}\n </>\n );\n}\n\nexport interface CollapsiblePanelRelocatedProps {\n /** The panel's `id`. */\n panelId: string;\n side: CollapsiblePanelSide;\n /** The panel's current collapsed state. */\n collapsed: boolean;\n /** The same `toolbar` the panel receives. */\n toolbar: CollapsiblePanelToolbar;\n /**\n * Density of the toolbar the groups are placed in, so the standard toggle\n * fits it (`compact` in a `density=\"compact\"` toolbar). Defaults to\n * `default`.\n */\n density?: ToolbarConfig['density'];\n}\n\n/**\n * A collapsed {@link CollapsiblePanel}'s marked groups and standard\n * toggle, for the app's work-area toolbar — nothing while the panel is open.\n * Put it first in the leading zone for a left rail, last in the trailing zone\n * for a right rail, and last in a bottom toolbar (or a `FloatingToolbar`\n * `restoreControl`) for a bottom drawer. `wireSidebar` hands focus to it when\n * the panel closes from its own toggle.\n */\nexport function CollapsiblePanelRelocated({\n panelId,\n side,\n collapsed,\n toolbar,\n density,\n}: CollapsiblePanelRelocatedProps) {\n return (\n <>\n {relocatedPanelGroups(\n toolbar,\n side,\n collapsed,\n toggleAttributes(panelId),\n groupSizeFor(density),\n )}\n </>\n );\n}\n"]}
1
+ {"version":3,"sources":["../src/components/layout/collapsible-panel/collapsible-panel.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAkDA,IAAM,gBAAA,GAAmB,CAAC,OAAA,MAA4C;AAAA,EACpE,yBAAA,EAA2B,OAAA;AAAA;AAAA;AAAA,EAG3B,UAAA,EAAY,GAAG,OAAO,CAAA,OAAA;AACxB,CAAA,CAAA;AAqBA,IAAM,kCAAA,uBAAyC,GAAA,CAAI;AAAA,EACjD,aAAA;AAAA,EACA,sBAAA;AAAA,EACA,gBAAA;AAAA,EACA,wBAAA;AAAA,EACA,yBAAA;AAAA,EACA,gBAAA;AAAA,EACA,uBAAA;AAAA,EACA,eAAA;AAAA,EACA,oBAAA;AAAA,EACA,eAAA;AAAA,EACA,mBAAA;AAAA,EACA,gBAAA;AAAA,EACA;AACF,CAAC,CAAA;AASM,SAAS,sBAAA,CAAuB;AAAA,EACrC,IAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA,GAAY,EAAA;AAAA,EACZ,IAAA;AAAA,EACA,iBAAiB;AACnB,CAAA,EAAgC;AAC9B,EAAA,MAAM,KAAA,GAAQ,0BAAA,CAA2B,IAAA,EAAM,SAAS,CAAA;AACxD,EAAA,MAAM,UAAA,GAAa,KAAA,KAAU,SAAA,GAAY,QAAA,GAAW,UAAA,CAAA;AACpD,EAAA,uBACE,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACE,GAAG,oBAAA;AAAA,QACF,cAAA;AAAA,QACA;AAAA,OACF;AAAA,MACA,IAAA,EAAK,QAAA;AAAA,MACL,KAAA,EAAO,CAAA,8BAAA,EAAiC,SAAS,CAAA,CAAA,CAAG,IAAA,EAAK;AAAA,MACzD,aAAA,EAAa,MAAA;AAAA,MACb,yBAAA,EAAyB,OAAA;AAAA,MACzB,eAAA,EAAe,MAAA,CAAO,CAAC,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V,IACD,QAAA,EACN;AAAA;AAAA,KACF;AAAA,IACC,SAAA,IAAa,cAAA,IAAkB,YAAA,KAAiB,QAAA,oBAC/C,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAM,gCAAA;AAAA,QACN,oBAAA,EAAoB,EAAA;AAAA,QACpB,eAAA,EAAe,eAAA;AAAA,QAEd,QAAA,EAAA;AAAA;AAAA;AACH,GAAA,EAEJ,CAAA;AAEJ;AA0BO,SAAS,yBAAA,CAA0B;AAAA,EACxC,OAAA;AAAA,EACA,IAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAA,EAAmC;AACjC,EAAA,uBACE,GAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA,oBAAA;AAAA,IACC,OAAA;AAAA,IACA,IAAA;AAAA,IACA,SAAA;AAAA,IACA,iBAAiB,OAAO,CAAA;AAAA,IACxB,aAAa,OAAO;AAAA,GACtB,EACF,CAAA;AAEJ","file":"collapsible-panel.js","sourcesContent":["import type { SafeHtml } from 'kerfjs';\n\nimport {\n collapsiblePanelToggleIcon,\n composedPanelBody,\n groupSizeFor,\n type PanelBottomToolbar,\n type PanelChromePlacement,\n type PanelSide,\n type PanelToggle,\n type PanelToggleAttributes,\n type PanelToolbar,\n relocatedPanelGroups,\n} from '../../../composition/panels/panel-toolbar.js';\nimport type { KerfUiContent } from '../../../shared/content/semantic-content.js';\nimport {\n filterDataAttributes,\n type RootDataAttributes,\n} from '../../../shared/dom/extension-attributes.js';\nimport type { ToolbarConfig } from '../../actions/toolbar/toolbar.js';\nimport type { ListConfig } from '../../collections/list/list.js';\nimport { LucideIcon } from '../../media/lucide-icon/lucide-icon.js';\nimport type { PaneConfig } from '../pane/pane.js';\nimport type {\n ResizableRegionCollapseMotion,\n ResizableRegionContentOverflow,\n ResizableRegionPresentation,\n ResizableRegionRestorePosition,\n ResizableRegionSeparator,\n} from '../resizable-region/resizable-region.js';\n\nexport { collapsiblePanelToggleIcon } from '../../../composition/panels/panel-toolbar.js';\n\n/** Which edge a {@link CollapsiblePanel} docks to. */\nexport type CollapsiblePanelSide = PanelSide;\n\n/** The standard toggle a panel toolbar renders (see {@link CollapsiblePanelToolbar}). */\nexport type CollapsiblePanelToolbarToggle = PanelToggle;\n\n/**\n * A panel's composed top toolbar. Its groups occupy `leading`, `center`, and\n * `trailing` while open; groups marked `relocateOnCollapse` and the standard\n * toggle move to the work-area toolbar through\n * {@link CollapsiblePanelRelocated} while it is collapsed.\n */\nexport type CollapsiblePanelToolbar = PanelToolbar;\nexport type CollapsiblePanelBottomToolbar = PanelBottomToolbar;\nexport type CollapsiblePanelChromePlacement = PanelChromePlacement;\n\n/** A CollapsiblePanel toggle's `wireSidebar` hook. */\nconst toggleAttributes = (panelId: string): PanelToggleAttributes => ({\n 'data-collapsible-target': panelId,\n // Keyed, so the morph never reuses a (possibly focused) toggle's button for\n // another control as the toggle moves between toolbars.\n 'data-key': `${panelId}-toggle`,\n});\n\nexport interface CollapsiblePanelToggleProps {\n /** The panel this toggle controls. */\n side: CollapsiblePanelSide;\n /** The panel's current collapsed state (drives the icon direction). */\n collapsed: boolean;\n /** `data-action` the button carries so `wireSidebar` can delegate its click. */\n action: string;\n /** The panel id the button targets (`data-tab-panel`-style: `data-collapsible-panel`). */\n panelId?: string;\n /** Accessible label; defaults to \"Collapse\"/\"Expand\". */\n label?: string;\n className?: string;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n /** Application `data-*` metadata on the root, such as a row key or a\n * test hook; the component's own markers stay protected. */\n rootAttributes?: RootDataAttributes;\n}\n\nconst COLLAPSIBLE_PANEL_TOGGLE_PROTECTED = new Set([\n 'data-action',\n 'data-collapse-motion',\n 'data-collapsed',\n 'data-collapsible-panel',\n 'data-collapsible-target',\n 'data-component',\n 'data-content-overflow',\n 'data-outlined',\n 'data-panel-restore',\n 'data-position',\n 'data-presentation',\n 'data-separator',\n 'data-side',\n]);\n\n/**\n * A standard collapse/expand toggle button for a {@link CollapsiblePanel}: the\n * recognizable per-side icon (see {@link collapsiblePanelToggleIcon}) plus the\n * `data-action` / `aria-expanded` `wireSidebar` reads. Placement is the app's —\n * put it in the panel's own header (to collapse) and somewhere always-visible\n * (to expand while collapsed).\n */\nexport function CollapsiblePanelToggle({\n side,\n collapsed,\n action,\n panelId,\n label,\n className = '',\n slot,\n rootAttributes = {},\n}: CollapsiblePanelToggleProps) {\n const glyph = collapsiblePanelToggleIcon(side, collapsed);\n const accessible = label ?? (collapsed ? 'Expand' : 'Collapse');\n return (\n <button\n {...filterDataAttributes(\n rootAttributes,\n COLLAPSIBLE_PANEL_TOGGLE_PROTECTED,\n )}\n type=\"button\"\n class={`kui-collapsible-panel__toggle ${className}`.trim()}\n data-action={action}\n data-collapsible-target={panelId}\n aria-expanded={String(!collapsed)}\n aria-label={accessible}\n slot={slot}\n >\n <LucideIcon icon={glyph.icon} name={glyph.name} />\n </button>\n );\n}\n\nexport interface CollapsiblePanelProps {\n /** A stable id for the panel — `wireSidebar` targets it and toggles reference it. */\n id: string;\n /** Which edge the panel docks to: a left/right rail or a bottom drawer. */\n side: CollapsiblePanelSide;\n /** Whether the panel is currently collapsed (the app owns this signal). */\n collapsed?: boolean;\n /** Rail width or drawer height in px. Overrides the CSS default. */\n size?: number;\n /** Accessible label for the panel region. */\n label?: string;\n /** Opt into keyboard (`0`) or programmatic (`-1`) focus on the panel region. */\n tabIndex?: 0 | -1;\n /** Keep the standard focus outline visible while the panel is expanded. */\n outlined?: boolean;\n /** Panel content. */\n children?: KerfUiContent;\n /**\n * The panel's top toolbar, composed so its groups follow the panel's open\n * state. With it, `children` renders in a `Pane` below the toolbar; render\n * {@link CollapsiblePanelRelocated} in the app's work-area toolbar so the\n * marked groups and toggle stay reachable while the panel is collapsed.\n */\n toolbar?: CollapsiblePanelToolbar;\n /** Fixed content below a toolbar panel's top toolbar. */\n header?: KerfUiContent;\n headerList?: ListConfig;\n headerPlacement?: CollapsiblePanelChromePlacement;\n /** Fixed content above a toolbar panel's bottom toolbar. */\n footer?: KerfUiContent;\n footerList?: ListConfig;\n bottomToolbar?: CollapsiblePanelBottomToolbar;\n footerPlacement?: CollapsiblePanelChromePlacement;\n /**\n * Configuration for a `toolbar` panel's `Pane` (`contentElement`,\n * `contentLabel`, `separators`, `safeAreaEdges`, `chromeDividers`) — for example\n * `{ contentElement: 'nav', contentLabel: 'Sections' }` for a navigation\n * rail. Omitted or `undefined` fields keep the `Pane` defaults. Ignored\n * without a `toolbar`, where `children` renders as given.\n */\n pane?: PaneConfig;\n separator?: ResizableRegionSeparator;\n collapseMotion?: ResizableRegionCollapseMotion;\n contentOverflow?: ResizableRegionContentOverflow;\n presentation?: ResizableRegionPresentation;\n /** Control shown while collapsed, in a safe-area-aware corner of the panel's container (not the viewport). */\n restoreControl?: SafeHtml;\n restorePosition?: ResizableRegionRestorePosition;\n className?: string;\n /** Application `data-*` metadata on the root, such as a row key or a\n * test hook; the component's own markers stay protected. */\n rootAttributes?: RootDataAttributes;\n}\n\nconst COLLAPSIBLE_PANEL_PROTECTED = new Set([\n 'data-action',\n 'data-collapse-motion',\n 'data-collapsed',\n 'data-collapsible-panel',\n 'data-collapsible-target',\n 'data-component',\n 'data-content-overflow',\n 'data-outlined',\n 'data-panel-restore',\n 'data-position',\n 'data-presentation',\n 'data-separator',\n 'data-side',\n]);\n\n/**\n * A standalone collapsible side rail or bottom drawer, outside the full\n * {@link Workbench} shell. It owns only the presentation: a fixed-size content\n * area that stays laid out while the panel's track snaps to zero and the content\n * slides out via `transform` (one reflow, composited — the same technique\n * `Workbench` and the catalog sidebar use). Bottom-drawer content stays anchored\n * to the panel's fixed bottom edge, so the track cannot move its layout origin\n * underneath the transform transition. A collapsed panel renders `inert` (with\n * `aria-hidden`), so neither Tab, pointer, nor assistive technology reaches\n * content that has slid out of view; its `restoreControl` renders outside the\n * panel and stays reachable.\n * The app owns the `collapsed` signal;\n * pair it with `wireSidebar` for the toggle, focus, compact-overlay, keyboard,\n * and persistence semantics, and with `CollapsiblePanelToggle` for the standard\n * affordance. See `ui/docs/collapsible-panel.md` and `docs/23-app-layouts.md`.\n */\nexport function CollapsiblePanel({\n id,\n side,\n collapsed = false,\n size,\n label,\n tabIndex,\n outlined = false,\n children,\n toolbar,\n header,\n headerList,\n headerPlacement,\n footer,\n footerList,\n bottomToolbar,\n footerPlacement,\n pane,\n separator = 'auto',\n collapseMotion = 'slide',\n contentOverflow = 'clip',\n presentation = 'inline',\n restoreControl,\n restorePosition = side === 'left' ? 'bottom-start' : 'bottom-end',\n className = '',\n rootAttributes = {},\n}: CollapsiblePanelProps) {\n const sizeVar =\n side === 'bottom'\n ? '--kui-collapsible-panel-height'\n : '--kui-collapsible-panel-width';\n return (\n <>\n <aside\n {...filterDataAttributes(rootAttributes, COLLAPSIBLE_PANEL_PROTECTED)}\n class={`kui-collapsible-panel kui-collapsible-panel--${side} ${className}`.trim()}\n data-component=\"collapsible-panel\"\n data-collapsible-panel={id}\n data-side={side}\n data-collapsed={String(collapsed)}\n data-outlined={\n !collapsed && presentation !== 'hidden' && outlined\n ? 'true'\n : undefined\n }\n data-separator={separator}\n data-collapse-motion={collapseMotion}\n data-content-overflow={contentOverflow}\n data-presentation={presentation}\n aria-label={label || undefined}\n aria-hidden={\n collapsed || presentation === 'hidden' ? 'true' : undefined\n }\n tabindex={\n collapsed || presentation === 'hidden'\n ? tabIndex === undefined\n ? undefined\n : -1\n : tabIndex\n }\n inert={collapsed}\n style={size ? `${sizeVar}: ${size}px` : undefined}\n >\n <div class=\"kui-collapsible-panel__content\">\n {toolbar\n ? composedPanelBody({\n toolbar,\n side,\n collapsed,\n attributes: toggleAttributes(id),\n pane,\n header,\n headerList,\n headerPlacement,\n footer,\n footerList,\n bottomToolbar,\n footerPlacement,\n content: children,\n })\n : children}\n </div>\n </aside>\n {collapsed && restoreControl && presentation !== 'hidden' && (\n <div\n class=\"kui-collapsible-panel__restore\"\n data-panel-restore={id}\n data-position={restorePosition}\n >\n {restoreControl}\n </div>\n )}\n </>\n );\n}\n\nexport interface CollapsiblePanelRelocatedProps {\n /** The panel's `id`. */\n panelId: string;\n side: CollapsiblePanelSide;\n /** The panel's current collapsed state. */\n collapsed: boolean;\n /** The same `toolbar` the panel receives. */\n toolbar: CollapsiblePanelToolbar;\n /**\n * Density of the toolbar the groups are placed in, so the standard toggle\n * fits it (`compact` in a `density=\"compact\"` toolbar). Defaults to\n * `default`.\n */\n density?: ToolbarConfig['density'];\n}\n\n/**\n * A collapsed {@link CollapsiblePanel}'s marked groups and standard\n * toggle, for the app's work-area toolbar — nothing while the panel is open.\n * Put it first in the leading zone for a left rail, last in the trailing zone\n * for a right rail, and last in a bottom toolbar (or a `FloatingToolbar`\n * `restoreControl`) for a bottom drawer. `wireSidebar` hands focus to it when\n * the panel closes from its own toggle.\n */\nexport function CollapsiblePanelRelocated({\n panelId,\n side,\n collapsed,\n toolbar,\n density,\n}: CollapsiblePanelRelocatedProps) {\n return (\n <>\n {relocatedPanelGroups(\n toolbar,\n side,\n collapsed,\n toggleAttributes(panelId),\n groupSizeFor(density),\n )}\n </>\n );\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import { parseColor, formatHex } from './chunk-TNJLNLVE.js';
2
- import { LucideIcon } from './chunk-CMG4OZPV.js';
2
+ import { LucideIcon } from './chunk-LWWIBUDK.js';
3
3
 
4
- import { filterDataAttributes } from './chunk-COQI4OMZ.js';
4
+ import { filterDataAttributes } from './chunk-BRDTP3RT.js';
5
5
  import { ChevronDown } from 'lucide';
6
6
  import { jsxs, jsx } from 'kerfjs/jsx-runtime';
7
7
 
@@ -1,4 +1,4 @@
1
- export { COLOR_PICKER_CHANNELS, COLOR_PICKER_SWATCH_ACTION, ColorPicker, colorPickerAreaText, colorPickerChannels, colorPickerSlider, colorPickerStyle } from './chunk-3XSY5LAB.js';
1
+ export { COLOR_PICKER_CHANNELS, COLOR_PICKER_SWATCH_ACTION, ColorPicker, colorPickerAreaText, colorPickerChannels, colorPickerSlider, colorPickerStyle } from './chunk-SXZTDJMG.js';
2
2
 
3
3
 
4
4
 
@@ -1,4 +1,4 @@
1
- export { ColorSwatches } from './chunk-76VCWWUA.js';
1
+ export { ColorSwatches } from './chunk-HSMSTCNZ.js';
2
2
 
3
3
 
4
4
  //# sourceMappingURL=color-swatches.js.map
@@ -1,7 +1,7 @@
1
1
  import { SafeHtml } from 'kerfjs';
2
- import { R as RootDataAttributes } from './extension-attributes-IJ4decoa.js';
2
+ import { R as RootDataAttributes } from './extension-attributes-CnqvBmj3.js';
3
3
  import { CssLength } from './css-values.js';
4
- import { T as TreeListNode } from './tree-rows-Bms5QJvG.js';
4
+ import { T as TreeListNode } from './tree-rows-BXChApji.js';
5
5
  import './semantic-content-BbzjvSu9.js';
6
6
 
7
7
  /** One column: the children of the node chosen in the column before it. */
@@ -1,23 +1,168 @@
1
- export { ColumnExplorer, explorerChosen, explorerColumns } from './chunk-YA6OAJY6.js';
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
1
+ import { isExpandable } from './chunk-7U65KLDL.js';
2
+ import { ColumnTrack } from './chunk-F25UMYDX.js';
3
+ import { ListItem } from './chunk-UWLJ7UEK.js';
4
+
5
+
6
+
7
+
8
+ import { ListHeader } from './chunk-42NLFCIN.js';
9
+
10
+
11
+
12
+
13
+ import { List } from './chunk-KKMZP3YL.js';
14
+
15
+
16
+
17
+
18
+ import { LucideIcon } from './chunk-LWWIBUDK.js';
19
+
20
+ import { filterDataAttributes } from './chunk-BRDTP3RT.js';
21
+ import { ChevronRight } from 'lucide';
22
+ import { jsx, jsxs, Fragment } from 'kerfjs/jsx-runtime';
23
+
24
+ // src/components/collections/column-explorer/model/columns.ts
25
+ function explorerColumns(nodes, path) {
26
+ const columns = [];
27
+ let siblings = nodes;
28
+ let parent;
29
+ for (let level = 0; ; level += 1) {
30
+ const chosen = siblings.find((node) => node.id === path[level]);
31
+ columns.push({
32
+ level,
33
+ ...parent ? { parent } : {},
34
+ nodes: siblings,
35
+ ...chosen ? { chosen: chosen.id } : {}
36
+ });
37
+ if (!chosen || !isExpandable(chosen)) return columns;
38
+ parent = chosen;
39
+ siblings = chosen.children ?? [];
40
+ }
41
+ }
42
+ function explorerChosen(nodes, path) {
43
+ let siblings = nodes;
44
+ let node;
45
+ for (const id of path) {
46
+ node = siblings.find((candidate) => candidate.id === id);
47
+ if (!node) return void 0;
48
+ siblings = node.children ?? [];
49
+ }
50
+ return node;
51
+ }
52
+ var COLUMN_EXPLORER_PROTECTED = /* @__PURE__ */ new Set([
53
+ "data-component",
54
+ "data-column-explorer-id"
55
+ ]);
56
+ var chevron = LucideIcon({ icon: ChevronRight, name: "chevron-right" });
57
+ function ColumnExplorer({
58
+ id,
59
+ label,
60
+ nodes,
61
+ path,
62
+ action,
63
+ preview,
64
+ layout,
65
+ inset,
66
+ minColumnWidth,
67
+ peek,
68
+ rootHeading,
69
+ density = "default",
70
+ className = "",
71
+ rootAttributes = {},
72
+ slot
73
+ }) {
74
+ const columns = explorerColumns(nodes, path);
75
+ const chosen = explorerChosen(nodes, path);
76
+ const showPreview = preview !== void 0 && chosen !== void 0 && !isExpandable(chosen);
77
+ return /* @__PURE__ */ jsx(
78
+ "div",
79
+ {
80
+ ...filterDataAttributes(rootAttributes, COLUMN_EXPLORER_PROTECTED),
81
+ id,
82
+ role: "region",
83
+ class: `kui-column-explorer ${className}`.trim(),
84
+ "aria-label": label,
85
+ "data-component": "column-explorer",
86
+ "data-column-explorer-id": id,
87
+ slot,
88
+ children: /* @__PURE__ */ jsxs(
89
+ ColumnTrack,
90
+ {
91
+ layout,
92
+ inset,
93
+ minColumnWidth,
94
+ peek,
95
+ children: [
96
+ columns.map((column) => {
97
+ const stop = column.chosen ?? column.nodes[0]?.id;
98
+ return /* @__PURE__ */ jsxs(
99
+ List,
100
+ {
101
+ scrollable: true,
102
+ fill: true,
103
+ rootAttributes: {
104
+ role: "group",
105
+ "aria-label": column.parent ? String(column.parent.label) : label,
106
+ "data-column-explorer-level": String(column.level)
107
+ },
108
+ children: [
109
+ rootHeading !== void 0 ? /* @__PURE__ */ jsx(
110
+ ListHeader,
111
+ {
112
+ label: column.parent ? String(column.parent.label) : rootHeading,
113
+ size: "xs",
114
+ density: "compact"
115
+ }
116
+ ) : null,
117
+ column.nodes.map((node) => /* @__PURE__ */ jsx(
118
+ ListItem,
119
+ {
120
+ action,
121
+ itemId: node.id,
122
+ label: node.label,
123
+ description: node.description,
124
+ icon: node.icon,
125
+ trailing: isExpandable(node) ? /* @__PURE__ */ jsxs(Fragment, { children: [
126
+ node.trailing,
127
+ chevron
128
+ ] }) : node.trailing,
129
+ selected: node.id === column.chosen,
130
+ disabled: node.disabled,
131
+ draggable: node.draggable,
132
+ density,
133
+ tabIndex: node.id === stop ? 0 : -1,
134
+ rootAttributes: {
135
+ ...node.rootAttributes,
136
+ "data-key": node.id,
137
+ "data-column-explorer-level": String(column.level),
138
+ "data-expandable": isExpandable(node) ? "true" : void 0
139
+ }
140
+ }
141
+ ))
142
+ ]
143
+ }
144
+ );
145
+ }),
146
+ showPreview ? /* @__PURE__ */ jsx(
147
+ List,
148
+ {
149
+ scrollable: true,
150
+ fill: true,
151
+ rootAttributes: {
152
+ role: "group",
153
+ "aria-label": `${String(chosen.label)} preview`,
154
+ "data-column-explorer-preview": "true"
155
+ },
156
+ children: preview
157
+ }
158
+ ) : null
159
+ ]
160
+ }
161
+ )
162
+ }
163
+ );
164
+ }
165
+
166
+ export { ColumnExplorer, explorerChosen, explorerColumns };
22
167
 
23
168
  //# sourceMappingURL=column-explorer.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"column-explorer.js"}
1
+ {"version":3,"sources":["../src/components/collections/column-explorer/model/columns.ts","../src/components/collections/column-explorer/column-explorer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuBO,SAAS,eAAA,CACd,OACA,IAAA,EACkB;AAClB,EAAA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O,IAAA,GAAO,CAAA,GAAI,EAAA;AAAA,wBACjC,cAAA,EAAgB;AAAA,0BACd,GAAG,IAAA,CAAK,cAAA;AAAA,0BACR,YAAY,IAAA,CAAK,EAAA;AAAA,0BACjB,4BAAA,EAA8B,MAAA,CAAO,MAAA,CAAO,KAAK,CAAA;AAAA,0BACjD,iBAAA,EAAmB,YAAA,CAAa,IAAI,CAAA,GAAI,MAAA,GAAS;AAAA;AACnD;AAAA,qBAEH;AAAA;AAAA;AAAA,eACH;AAAA,YAEJ,CAAC,CAAA;AAAA,YACA,WAAA,mBACC,GAAA;AAAA,cAAC,IAAA;AAAA,cAAA;AAAA,gBACC,UAAA,EAAU,IAAA;AAAA,gBACV,IAAA,EAAI,IAAA;AAAA,gBACJ,cAAA,EAAgB;AAAA,kBACd,IAAA,EAAM,OAAA;AAAA,kBACN,YAAA,EAAc,CAAA,EAAG,MAAA,CAAO,MAAA,CAAO,KAAK,CAAC,CAAA,QAAA,CAAA;AAAA,kBACrC,8BAAA,EAAgC;AAAA,iBAClC;AAAA,gBAEC,QAAA,EAAA;AAAA;AAAA,aACH,GACE;AAAA;AAAA;AAAA;AACN;AAAA,GACF;AAEJ","file":"column-explorer.js","sourcesContent":["// KF-JY68DQ: the columns a column explorer shows for a chosen path through a\n// hierarchy. It walks the same TreeListNode model as TreeList, DOM-free.\nimport {\n isExpandable,\n type TreeListNode,\n} from '../../tree-list/model/tree-rows.js';\n\n/** One column: the children of the node chosen in the column before it. */\nexport interface ExplorerColumn {\n /** 0 for the top level. */\n readonly level: number;\n /** The node whose children this column lists, or undefined at the top. */\n readonly parent?: TreeListNode;\n readonly nodes: readonly TreeListNode[];\n /** The id chosen in this column, when the path reaches it. */\n readonly chosen?: string;\n}\n\n/**\n * The columns for `path` (ids from the top level down): the top level, then\n * the children of each chosen node that can expand. A path id that is not a\n * child of the column before it ends the walk there.\n */\nexport function explorerColumns(\n nodes: readonly TreeListNode[],\n path: readonly string[],\n): ExplorerColumn[] {\n const columns: ExplorerColumn[] = [];\n let siblings: readonly TreeListNode[] = nodes;\n let parent: TreeListNode | undefined;\n for (let level = 0; ; level += 1) {\n const chosen = siblings.find((node) => node.id === path[level]);\n columns.push({\n level,\n ...(parent ? { parent } : {}),\n nodes: siblings,\n ...(chosen ? { chosen: chosen.id } : {}),\n });\n if (!chosen || !isExpandable(chosen)) return columns;\n parent = chosen;\n siblings = chosen.children ?? [];\n }\n}\n\n/** The node at the end of `path`, when the whole path resolves. */\nexport function explorerChosen(\n nodes: readonly TreeListNode[],\n path: readonly string[],\n): TreeListNode | undefined {\n let siblings: readonly TreeListNode[] = nodes;\n let node: TreeListNode | undefined;\n for (const id of path) {\n node = siblings.find((candidate) => candidate.id === id);\n if (!node) return undefined;\n siblings = node.children ?? [];\n }\n return node;\n}\n","import type { SafeHtml } from 'kerfjs';\nimport { ChevronRight } from 'lucide';\n\nimport {\n filterDataAttributes,\n type RootDataAttributes,\n} from '../../../shared/dom/extension-attributes.js';\nimport type { CssLength } from '../../../shared/styles/css-values.js';\nimport { ColumnTrack } from '../../layout/column-track/column-track.js';\nimport { LucideIcon } from '../../media/lucide-icon/lucide-icon.js';\nimport { List } from '../list/list.js';\nimport { ListHeader } from '../list-header/list-header.js';\nimport { ListItem } from '../list-item/list-item.js';\nimport {\n isExpandable,\n type TreeListNode,\n} from '../tree-list/model/tree-rows.js';\nimport { explorerChosen, explorerColumns } from './model/columns.js';\n\nexport {\n explorerChosen,\n type ExplorerColumn,\n explorerColumns,\n} from './model/columns.js';\n\nconst COLUMN_EXPLORER_PROTECTED = new Set([\n 'data-component',\n 'data-column-explorer-id',\n]);\n\nexport interface ColumnExplorerProps {\n /** Identifies the explorer for `wireColumnExplorer` and in tests. */\n id: string;\n /** The explorer's accessible name, such as \"Files\". */\n label: string;\n /** The hierarchy, as TreeList's nodes. The application owns it. */\n nodes: readonly TreeListNode[];\n /**\n * The chosen ids from the top level down, one per column. The application\n * owns it: set it to `treeListPath(nodes, id)` when `action` reports a row.\n */\n path: readonly string[];\n /** Delegated action for choosing a row; the row's `data-item-id` names it. */\n action: string;\n /**\n * Content for a last column when the chosen node is a leaf, such as a\n * file's details.\n */\n preview?: SafeHtml;\n /** ColumnTrack's layout: `scroll` (default) or `paged` for a phone. */\n layout?: 'scroll' | 'paged';\n /** ColumnTrack inline clearance; none clips columns at the explorer edges. */\n inset?: 'default' | 'none';\n /** Each column's minimum width (ColumnTrack's default 250px). */\n minColumnWidth?: CssLength;\n /** How much of the next column a paged layout shows. */\n peek?: CssLength;\n /** Show a quiet parent heading in every column, starting with this root name. */\n rootHeading?: string;\n /** Row density: `default` or `compact`. */\n density?: 'default' | 'compact' | /** @deprecated Use default. */ 'standard';\n className?: string;\n /** Safe `data-*` metadata for the explorer element. */\n rootAttributes?: RootDataAttributes;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n}\n\nconst chevron = LucideIcon({ icon: ChevronRight, name: 'chevron-right' });\n\n/**\n * A macOS-style column explorer for a hierarchy: one column per level in a\n * ColumnTrack, where choosing a row with children opens the next column of\n * its children. The application owns the nodes and the chosen path and\n * handles `action`; wire the keyboard with `wireColumnExplorer`.\n */\nexport function ColumnExplorer({\n id,\n label,\n nodes,\n path,\n action,\n preview,\n layout,\n inset,\n minColumnWidth,\n peek,\n rootHeading,\n density = 'default',\n className = '',\n rootAttributes = {},\n slot,\n}: ColumnExplorerProps) {\n const columns = explorerColumns(nodes, path);\n const chosen = explorerChosen(nodes, path);\n const showPreview =\n preview !== undefined && chosen !== undefined && !isExpandable(chosen);\n return (\n <div\n {...filterDataAttributes(rootAttributes, COLUMN_EXPLORER_PROTECTED)}\n id={id}\n role=\"region\"\n class={`kui-column-explorer ${className}`.trim()}\n aria-label={label}\n data-component=\"column-explorer\"\n data-column-explorer-id={id}\n slot={slot}\n >\n <ColumnTrack\n layout={layout}\n inset={inset}\n minColumnWidth={minColumnWidth}\n peek={peek}\n >\n {columns.map((column) => {\n // One Tab stop per column: its chosen row, else its first.\n const stop = column.chosen ?? column.nodes[0]?.id;\n return (\n <List\n scrollable\n fill\n rootAttributes={{\n role: 'group',\n 'aria-label': column.parent\n ? String(column.parent.label)\n : label,\n 'data-column-explorer-level': String(column.level),\n }}\n >\n {rootHeading !== undefined ? (\n <ListHeader\n label={\n column.parent ? String(column.parent.label) : rootHeading\n }\n size=\"xs\"\n density=\"compact\"\n />\n ) : null}\n {column.nodes.map((node) => (\n <ListItem\n action={action}\n itemId={node.id}\n label={node.label}\n description={node.description}\n icon={node.icon}\n trailing={\n isExpandable(node) ? (\n <>\n {node.trailing}\n {chevron}\n </>\n ) : (\n node.trailing\n )\n }\n selected={node.id === column.chosen}\n disabled={node.disabled}\n draggable={node.draggable}\n density={density}\n tabIndex={node.id === stop ? 0 : -1}\n rootAttributes={{\n ...node.rootAttributes,\n 'data-key': node.id,\n 'data-column-explorer-level': String(column.level),\n 'data-expandable': isExpandable(node) ? 'true' : undefined,\n }}\n />\n ))}\n </List>\n );\n })}\n {showPreview ? (\n <List\n scrollable\n fill\n rootAttributes={{\n role: 'group',\n 'aria-label': `${String(chosen.label)} preview`,\n 'data-column-explorer-preview': 'true',\n }}\n >\n {preview}\n </List>\n ) : null}\n </ColumnTrack>\n </div>\n );\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import * as kerfjs from 'kerfjs';
2
2
  import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
3
- import { S as StructuralRootAttributes } from './extension-attributes-IJ4decoa.js';
3
+ import { S as StructuralRootAttributes } from './extension-attributes-CnqvBmj3.js';
4
4
  import { CssLength } from './css-values.js';
5
5
 
6
6
  /** `scroll` keeps equal min-width columns; `paged` shows one near-full-width column per page. */
@@ -1,4 +1,4 @@
1
- export { ColumnTrack } from './chunk-4OH6JSGU.js';
1
+ export { ColumnTrack } from './chunk-F25UMYDX.js';
2
2
 
3
3
 
4
4
  //# sourceMappingURL=column-track.js.map
@@ -1,5 +1,5 @@
1
1
  import * as kerfjs from 'kerfjs';
2
- import { R as RootDataAttributes } from './extension-attributes-IJ4decoa.js';
2
+ import { R as RootDataAttributes } from './extension-attributes-CnqvBmj3.js';
3
3
 
4
4
  /** A suggestion: a plain string, or a value with a distinct visible label. */
5
5
  type ComboboxSuggestion = string | {
@@ -13,7 +13,11 @@ interface ComboboxProps {
13
13
  label: string;
14
14
  /** Suggestions to filter as the person types. */
15
15
  suggestions: readonly ComboboxSuggestion[];
16
- /** Initial text; the field owns its text while the person types. */
16
+ /**
17
+ * Text on first render and native form reset. Keep this value stable while the
18
+ * user edits. Changing it while focused updates the reset value; changing it
19
+ * after blur also replaces the displayed text.
20
+ */
17
21
  value?: string;
18
22
  placeholder?: string;
19
23
  /** Optional hint below the field, such as "Press Enter to add". */
@@ -28,8 +32,8 @@ interface ComboboxProps {
28
32
  createLabel?: string | false;
29
33
  disabled?: boolean;
30
34
  className?: string;
31
- /** Application `data-*` metadata on the root, such as a row key or an
32
- * editor node marker; the component's own markers stay protected. */
35
+ /** Application `data-*` metadata on the root, such as a row key or a
36
+ * test hook; the component's own markers stay protected. */
33
37
  rootAttributes?: RootDataAttributes;
34
38
  }
35
39
  /**
package/dist/combobox.js CHANGED
@@ -1,4 +1,4 @@
1
- export { Combobox } from './chunk-LET362AM.js';
1
+ export { Combobox } from './chunk-PBXTHYB4.js';
2
2
 
3
3
 
4
4
  //# sourceMappingURL=combobox.js.map
@@ -0,0 +1,36 @@
1
+ import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
2
+ import { a as CatalogEntry, b as CatalogSecondaryGroup } from './types-CuKf5G87.js';
3
+
4
+ /** Local ids refer to the declaring package. Use an explicit package for an external relationship. */
5
+ type CatalogReference = string | {
6
+ package: string;
7
+ id: string;
8
+ };
9
+ type CatalogPreview = () => KerfUiContent;
10
+ interface CatalogPackageEntry extends Omit<CatalogEntry, 'related'> {
11
+ category: string;
12
+ uses?: readonly CatalogReference[];
13
+ loadPreview?: () => Promise<CatalogPreview>;
14
+ }
15
+ interface CatalogPackage {
16
+ package: string;
17
+ label: string;
18
+ entries: readonly CatalogPackageEntry[];
19
+ imports?: readonly CatalogPackage[];
20
+ }
21
+ /** Stable, shareable route id, independent of import order, display labels and categories. */
22
+ declare function catalogEntryId(packageName: string, id: string): string;
23
+ interface ComposedCatalog {
24
+ groups: readonly (CatalogSecondaryGroup & {
25
+ id: string;
26
+ })[];
27
+ entries: ReadonlyMap<string, CatalogEntry & {
28
+ package: string;
29
+ }>;
30
+ /** Loads only the requested preview, sharing in-flight work and retrying failed loads. */
31
+ loadPreview(id: string): Promise<CatalogPreview | undefined>;
32
+ }
33
+ /** Compose metadata eagerly and leave preview implementations behind explicit loaders. */
34
+ declare function composeCatalog(root: CatalogPackage): ComposedCatalog;
35
+
36
+ export { type CatalogPackage as C, type CatalogPackageEntry as a, type CatalogPreview as b, type CatalogReference as c, type ComposedCatalog as d, catalogEntryId as e, composeCatalog as f };
@@ -4,7 +4,7 @@ import { CssColor } from './css-values.js';
4
4
  import { S as SemanticTone } from './semantic-tone-CdW013KF.js';
5
5
  import { S as SurfaceTint, a as SurfaceTintScheme } from './surface-tint-DQgYCaP9.js';
6
6
  import { BackdropImagePosition, BackdropImageParallax, BackdropImageBlur, BackdropImageScrim } from './backdrop-image.js';
7
- import './extension-attributes-IJ4decoa.js';
7
+ import './extension-attributes-CnqvBmj3.js';
8
8
 
9
9
  /**
10
10
  * Base surface treatment, semantic status colors, or `brand-loud`: the solid
@@ -1,4 +1,4 @@
1
- export { ContentItem } from './chunk-DBP3N6E5.js';
1
+ export { ContentItem } from './chunk-JBL6SCNN.js';
2
2
 
3
3
 
4
4
 
@@ -1,6 +1,6 @@
1
1
  import * as kerfjs from 'kerfjs';
2
2
  import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
3
- import { R as RootDataAttributes } from './extension-attributes-IJ4decoa.js';
3
+ import { R as RootDataAttributes } from './extension-attributes-CnqvBmj3.js';
4
4
 
5
5
  type ContentSwapSide = 'a' | 'b';
6
6
  type ContentSwapTransition = 'none' | 'crossfade' | 'push';
@@ -22,8 +22,8 @@ interface ContentSwapProps {
22
22
  className?: string;
23
23
  /** Native named-slot assignment, such as a dialog's `label` or `footer`. */
24
24
  slot?: string;
25
- /** Application `data-*` metadata on the root, such as a row key or an
26
- * editor node marker; the component's own markers stay protected. */
25
+ /** Application `data-*` metadata on the root, such as a row key or a
26
+ * test hook; the component's own markers stay protected. */
27
27
  rootAttributes?: RootDataAttributes;
28
28
  }
29
29
  /**
@@ -1,4 +1,4 @@
1
- export { ContentSwap } from './chunk-EHR7R7YP.js';
1
+ export { ContentSwap } from './chunk-3DPHCZQB.js';
2
2
 
3
3
 
4
4
  //# sourceMappingURL=content-swap.js.map
@@ -1,6 +1,6 @@
1
1
  import * as kerfjs from 'kerfjs';
2
2
  import { K as KerfUiContent } from './semantic-content-BbzjvSu9.js';
3
- import { R as RootDataAttributes } from './extension-attributes-IJ4decoa.js';
3
+ import { R as RootDataAttributes } from './extension-attributes-CnqvBmj3.js';
4
4
 
5
5
  /** The viewport corner a CornerStatus occupies, in logical (RTL-aware) terms. */
6
6
  type CornerStatusPlacement = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
@@ -23,8 +23,8 @@ interface CornerStatusProps {
23
23
  className?: string;
24
24
  /** Native named-slot assignment when composed inside a web component. */
25
25
  slot?: string;
26
- /** Application `data-*` metadata on the root, such as a row key or an
27
- * editor node marker; the component's own markers stay protected. */
26
+ /** Application `data-*` metadata on the root, such as a row key or a
27
+ * test hook; the component's own markers stay protected. */
28
28
  rootAttributes?: RootDataAttributes;
29
29
  }
30
30
  /**
@@ -1,4 +1,4 @@
1
- export { CornerStatus } from './chunk-CPTQABDQ.js';
1
+ export { CornerStatus } from './chunk-JNSPYECP.js';
2
2
 
3
3
 
4
4
  //# sourceMappingURL=corner-status.js.map
@@ -1,3 +1,103 @@
1
- export { DEFAULT_BREAKPOINTS, classifyViewport, deviceClass } from './chunk-WCMGPAY2.js';
1
+ import { computed, signal } from 'kerfjs';
2
+
3
+ // src/shared/environment/device-class.ts
4
+ var DEFAULT_BREAKPOINTS = {
5
+ mobile: 360,
6
+ tablet: 720,
7
+ desktop: 1024,
8
+ "xl-desktop": 1440
9
+ };
10
+ var SIZE_ORDER = [
11
+ "xs-mobile",
12
+ "mobile",
13
+ "tablet",
14
+ "desktop",
15
+ "xl-desktop"
16
+ ];
17
+ var SSR_VIEWPORT = {
18
+ width: 1024,
19
+ height: 768,
20
+ segments: 1,
21
+ verticalSegments: 1
22
+ };
23
+ function classifyViewport(width, orientation, segments = 1, verticalSegments = 1, breakpoints = DEFAULT_BREAKPOINTS) {
24
+ const size = width >= breakpoints["xl-desktop"] ? "xl-desktop" : width >= breakpoints.desktop ? "desktop" : width >= breakpoints.tablet ? "tablet" : width >= breakpoints.mobile ? "mobile" : "xs-mobile";
25
+ const rank = SIZE_ORDER.indexOf(size);
26
+ return {
27
+ size,
28
+ orientation,
29
+ segments,
30
+ verticalSegments,
31
+ handset: rank <= 1,
32
+ compact: rank <= 1 || size === "tablet" && orientation === "portrait",
33
+ atLeast: (target) => rank >= SIZE_ORDER.indexOf(target)
34
+ };
35
+ }
36
+ function countSegments(axis, view) {
37
+ const mq = view.matchMedia;
38
+ if (typeof mq !== "function") return 1;
39
+ for (let n = 4; n >= 2; n--) {
40
+ if (mq.call(view, `(${axis}-viewport-segments: ${n})`).matches) return n;
41
+ }
42
+ return 1;
43
+ }
44
+ function readViewport(view) {
45
+ return {
46
+ width: view.innerWidth,
47
+ height: view.innerHeight,
48
+ segments: countSegments("horizontal", view),
49
+ verticalSegments: countSegments("vertical", view)
50
+ };
51
+ }
52
+ function browserWindow() {
53
+ return typeof window === "undefined" ? void 0 : window;
54
+ }
55
+ var sharedSource;
56
+ function viewportSource(view) {
57
+ if (sharedSource) return sharedSource;
58
+ const source = signal(readViewport(view));
59
+ sharedSource = source;
60
+ const update = () => {
61
+ source.value = readViewport(view);
62
+ };
63
+ view.addEventListener("resize", update);
64
+ view.addEventListener("orientationchange", update);
65
+ return source;
66
+ }
67
+ function orientationOf(view) {
68
+ return view.height > view.width ? "portrait" : "landscape";
69
+ }
70
+ function deviceClass(options = {}) {
71
+ const breakpoints = {
72
+ ...DEFAULT_BREAKPOINTS,
73
+ ...options.breakpoints
74
+ };
75
+ const view = browserWindow();
76
+ if (!view) {
77
+ const snapshot = { ...SSR_VIEWPORT, ...options.ssr };
78
+ return computed(
79
+ () => classifyViewport(
80
+ snapshot.width,
81
+ orientationOf(snapshot),
82
+ snapshot.segments,
83
+ snapshot.verticalSegments,
84
+ breakpoints
85
+ )
86
+ );
87
+ }
88
+ const source = viewportSource(view);
89
+ return computed(() => {
90
+ const v = source.value;
91
+ return classifyViewport(
92
+ v.width,
93
+ orientationOf(v),
94
+ v.segments,
95
+ v.verticalSegments,
96
+ breakpoints
97
+ );
98
+ });
99
+ }
100
+
101
+ export { DEFAULT_BREAKPOINTS, classifyViewport, deviceClass };
2
102
 
3
103
  //# sourceMappingURL=device-class.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"device-class.js"}
1
+ {"version":3,"sources":["../src/shared/environment/device-class.ts"],"names":[],"mappings":";;;AAsDO,IAAM,mBAAA,GAAyC;AAAA,EACpD,MAAA,EAAQ,GAAA;AAAA,EACR,MAAA,EAAQ,GAAA;AAAA,EACR,OAAA,EAAS,IAAA;AAAA,EACT,YAAA,EAAc;AAChB;AAEA,IAAM,UAAA,GAAoC;AAAA,EACxC,WAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAA;AAEA,IAAM,YAAA,GAAyB;AAAA,EAC7B,KAAA,EAAO,IAAA;AAAA,EACP,MAAA,EAAQ,GAAA;AAAA,EACR,QAAA,EAAU,CAAA;AAAA,EACV,gBAAA,EAAkB;AACpB,CAAA;AAMO,SAAS,gBAAA,CACd,OACA,WAAA,EACA,QAAA,GAAW,GACX,gBAAA,GAAmB,CAAA,EACnB,cAAiC,mBAAA,EACpB;AACb,EAAA,MAAM,OACJ,K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AAA,MAAM,IAAI,MAAA,CAAO,KAAA;AACjB,IAAA,OAAO,gBAAA;AAAA,MACL,CAAA,CAAE,KAAA;AAAA,MACF,cAAc,CAAC,CAAA;AAAA,MACf,CAAA,CAAE,QAAA;AAAA,MACF,CAAA,CAAE,gBAAA;AAAA,MACF;AAAA,KACF;AAAA,EACF,CAAC,CAAA;AACH","file":"device-class.js","sourcesContent":["import { computed, type ReadonlySignal, signal } from 'kerfjs';\n\n/**\n * Reactive device-class detection for `@kerfjs/ui` (see `docs/23-app-layouts.md`\n * §2). `deviceClass()` returns a `ReadonlySignal<DeviceClass>` describing the\n * current viewport as a size bucket × orientation × viewport-segment count, so a\n * layout can pick its presentation reactively instead of hand-wiring `matchMedia`.\n *\n * One shared viewport source backs every reader; the pure `classifyViewport`\n * core is DOM-free and directly unit-tested.\n */\n\nexport type DeviceSize =\n 'xs-mobile' | 'mobile' | 'tablet' | 'desktop' | 'xl-desktop';\nexport type DeviceOrientation = 'portrait' | 'landscape';\n\n/** Minimum widths (px) at which each larger bucket begins. `xs-mobile` is 0. */\nexport interface DeviceBreakpoints {\n mobile: number;\n tablet: number;\n desktop: number;\n 'xl-desktop': number;\n}\n\nexport interface DeviceClass {\n size: DeviceSize;\n orientation: DeviceOrientation;\n /** Horizontal viewport segments (foldables / dual-screen); 1 on ordinary devices. */\n segments: number;\n /** Vertical viewport segments; 1 on ordinary devices. */\n verticalSegments: number;\n /** Small phones — `xs-mobile` or `mobile`. */\n handset: boolean;\n /** \"One pane at a time\" — a handset or a portrait tablet. */\n compact: boolean;\n /** True when the current size is `size` or larger, e.g. `atLeast('tablet')`. */\n atLeast(size: DeviceSize): boolean;\n}\n\n/** A raw viewport snapshot, before breakpoints are applied. */\nexport interface Viewport {\n width: number;\n height: number;\n segments: number;\n verticalSegments: number;\n}\n\nexport interface DeviceClassOptions {\n /** Override any of the default bucket thresholds. */\n breakpoints?: Partial<DeviceBreakpoints>;\n /** The viewport assumed when there is no DOM (SSR). Defaults to 1024×768, one segment. */\n ssr?: Partial<Viewport>;\n}\n\nexport const DEFAULT_BREAKPOINTS: DeviceBreakpoints = {\n mobile: 360,\n tablet: 720,\n desktop: 1024,\n 'xl-desktop': 1440,\n};\n\nconst SIZE_ORDER: readonly DeviceSize[] = [\n 'xs-mobile',\n 'mobile',\n 'tablet',\n 'desktop',\n 'xl-desktop',\n];\n\nconst SSR_VIEWPORT: Viewport = {\n width: 1024,\n height: 768,\n segments: 1,\n verticalSegments: 1,\n};\n\n/**\n * Classify a raw viewport into a {@link DeviceClass}. Pure and DOM-free — the\n * single source of truth for the bucketing rules.\n */\nexport function classifyViewport(\n width: number,\n orientation: DeviceOrientation,\n segments = 1,\n verticalSegments = 1,\n breakpoints: DeviceBreakpoints = DEFAULT_BREAKPOINTS,\n): DeviceClass {\n const size: DeviceSize =\n width >= breakpoints['xl-desktop']\n ? 'xl-desktop'\n : width >= breakpoints.desktop\n ? 'desktop'\n : width >= breakpoints.tablet\n ? 'tablet'\n : width >= breakpoints.mobile\n ? 'mobile'\n : 'xs-mobile';\n const rank = SIZE_ORDER.indexOf(size);\n return {\n size,\n orientation,\n segments,\n verticalSegments,\n handset: rank <= 1,\n compact: rank <= 1 || (size === 'tablet' && orientation === 'portrait'),\n atLeast: (target) => rank >= SIZE_ORDER.indexOf(target),\n };\n}\n\n/** Count viewport segments along one axis, feature-detecting the media query. */\nfunction countSegments(axis: 'horizontal' | 'vertical', view: Window): number {\n const mq = view.matchMedia;\n if (typeof mq !== 'function') return 1;\n for (let n = 4; n >= 2; n--) {\n if (mq.call(view, `(${axis}-viewport-segments: ${n})`).matches) return n;\n }\n return 1;\n}\n\n/** Read the current viewport from a browser window. */\nfunction readViewport(view: Window): Viewport {\n return {\n width: view.innerWidth,\n height: view.innerHeight,\n segments: countSegments('horizontal', view),\n verticalSegments: countSegments('vertical', view),\n };\n}\n\n/** The browser window, or `undefined` when running without a DOM (SSR). */\nfunction browserWindow(): Window | undefined {\n return typeof window === 'undefined' ? undefined : window;\n}\n\nlet sharedSource: ReturnType<typeof signal<Viewport>> | undefined;\n\n/**\n * The shared reactive viewport source. Installed lazily on first read and kept\n * for the life of the page — there is only ever one viewport, so a single\n * listener set backs every `deviceClass()` reader.\n */\nfunction viewportSource(view: Window): ReturnType<typeof signal<Viewport>> {\n if (sharedSource) return sharedSource;\n const source = signal(readViewport(view));\n sharedSource = source;\n const update = (): void => {\n source.value = readViewport(view);\n };\n view.addEventListener('resize', update);\n view.addEventListener('orientationchange', update);\n return source;\n}\n\nfunction orientationOf(view: Viewport): DeviceOrientation {\n return view.height > view.width ? 'portrait' : 'landscape';\n}\n\n/**\n * A reactive signal of the current {@link DeviceClass}. Reading it inside an\n * `effect`/`computed` re-runs when the viewport crosses a breakpoint, rotates,\n * or changes its segment count. Without a DOM it resolves to `options.ssr`\n * (default 1024×768, landscape, one segment).\n */\nexport function deviceClass(\n options: DeviceClassOptions = {},\n): ReadonlySignal<DeviceClass> {\n const breakpoints: DeviceBreakpoints = {\n ...DEFAULT_BREAKPOINTS,\n ...options.breakpoints,\n };\n const view = browserWindow();\n if (!view) {\n const snapshot: Viewport = { ...SSR_VIEWPORT, ...options.ssr };\n return computed(() =>\n classifyViewport(\n snapshot.width,\n orientationOf(snapshot),\n snapshot.segments,\n snapshot.verticalSegments,\n breakpoints,\n ),\n );\n }\n const source = viewportSource(view);\n return computed(() => {\n const v = source.value;\n return classifyViewport(\n v.width,\n orientationOf(v),\n v.segments,\n v.verticalSegments,\n breakpoints,\n );\n });\n}\n"]}