@kerfjs/ui 4.4.1 → 5.0.0-beta.11

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 (386) hide show
  1. package/README.md +241 -10
  2. package/ai/component-catalog.json +4828 -0
  3. package/ai/component-catalog.schema.json +79 -0
  4. package/ai/public-api-signatures-v1.md +1371 -0
  5. package/ai/skill.md +73 -11
  6. package/ai/webawesome-jsx-signatures-v1.md +106 -0
  7. package/dist/app-tab.d.ts +14 -2
  8. package/dist/app-tab.js +3 -1
  9. package/dist/browser/app-tab.js +3 -2
  10. package/dist/browser/disclosure-arrow.js +4 -0
  11. package/dist/browser/empty-state.js +3 -3
  12. package/dist/browser/floating-toolbar.js +3 -0
  13. package/dist/browser/list-action-row.js +4 -0
  14. package/dist/browser/list-header.js +6 -0
  15. package/dist/browser/list-item.js +4 -0
  16. package/dist/browser/loading-spinner.js +2 -2
  17. package/dist/browser/lucide-icon.js +2 -2
  18. package/dist/browser/panel-header.js +7 -0
  19. package/dist/browser/resizable-region.js +2 -2
  20. package/dist/browser/segmented-control.js +3 -2
  21. package/dist/browser/select.js +4 -3
  22. package/dist/browser/skeleton.js +3 -0
  23. package/dist/browser/state-banner.js +3 -2
  24. package/dist/browser/tab-bar.js +2 -2
  25. package/dist/browser/token-search-field.js +4 -0
  26. package/dist/browser/toolbar-control-group.js +2 -2
  27. package/dist/browser/toolbar-text.js +3 -2
  28. package/dist/browser/toolbar.js +2 -2
  29. package/dist/browser/value-table.js +3 -2
  30. package/dist/catalog.d.ts +119 -0
  31. package/dist/catalog.js +146 -0
  32. package/dist/catalog.js.map +1 -0
  33. package/dist/chunk-2Z5TWHKQ.js +34 -0
  34. package/dist/chunk-2Z5TWHKQ.js.map +1 -0
  35. package/dist/chunk-37T3VNIZ.js +19 -0
  36. package/dist/chunk-37T3VNIZ.js.map +1 -0
  37. package/dist/chunk-56RJXPHG.js +43 -0
  38. package/dist/chunk-56RJXPHG.js.map +1 -0
  39. package/dist/chunk-5ATCDSQS.js +42 -0
  40. package/dist/chunk-5ATCDSQS.js.map +1 -0
  41. package/dist/chunk-5E2HVJ33.js +10 -0
  42. package/dist/chunk-5E2HVJ33.js.map +1 -0
  43. package/dist/chunk-7BR3DO2A.js +31 -0
  44. package/dist/chunk-7BR3DO2A.js.map +1 -0
  45. package/dist/chunk-7JB7VPRI.js +34 -0
  46. package/dist/chunk-7JB7VPRI.js.map +1 -0
  47. package/dist/chunk-7LDCTU7D.js +134 -0
  48. package/dist/chunk-7LDCTU7D.js.map +1 -0
  49. package/dist/{chunk-4HHCYSGT.js → chunk-AQNKJRFH.js} +2 -2
  50. package/dist/{chunk-4HHCYSGT.js.map → chunk-AQNKJRFH.js.map} +1 -1
  51. package/dist/{chunk-MBR3TYNL.js → chunk-AVZHJN6C.js} +3 -3
  52. package/dist/chunk-AVZHJN6C.js.map +1 -0
  53. package/dist/chunk-B24C4A6T.js +22 -0
  54. package/dist/chunk-B24C4A6T.js.map +1 -0
  55. package/dist/chunk-BLK3UEEI.js +23 -0
  56. package/dist/chunk-BLK3UEEI.js.map +1 -0
  57. package/dist/chunk-CH4SQ6H5.js +39 -0
  58. package/dist/chunk-CH4SQ6H5.js.map +1 -0
  59. package/dist/chunk-I7INRJO4.js +17 -0
  60. package/dist/chunk-I7INRJO4.js.map +1 -0
  61. package/dist/chunk-L4OKFDJY.js +24 -0
  62. package/dist/chunk-L4OKFDJY.js.map +1 -0
  63. package/dist/chunk-LCOBDOCC.js +265 -0
  64. package/dist/chunk-LCOBDOCC.js.map +1 -0
  65. package/dist/{chunk-3O7ZEUW2.js → chunk-M5JRI6MN.js} +3 -3
  66. package/dist/chunk-M5JRI6MN.js.map +1 -0
  67. package/dist/{chunk-MFKMHK5W.js → chunk-RNPGFQ33.js} +3 -3
  68. package/dist/chunk-RNPGFQ33.js.map +1 -0
  69. package/dist/chunk-RUNWEPR4.js +10 -0
  70. package/dist/chunk-RUNWEPR4.js.map +1 -0
  71. package/dist/chunk-XE5ZLPCC.js +20 -0
  72. package/dist/chunk-XE5ZLPCC.js.map +1 -0
  73. package/dist/{chunk-MQIZAD4A.js → chunk-XXMOARTH.js} +5 -3
  74. package/dist/chunk-XXMOARTH.js.map +1 -0
  75. package/dist/{chunk-TRNBHPNW.js → chunk-YGN7OMLT.js} +11 -8
  76. package/dist/chunk-YGN7OMLT.js.map +1 -0
  77. package/dist/collapsible-panel.d.ts +66 -0
  78. package/dist/collapsible-panel.js +22 -0
  79. package/dist/collapsible-panel.js.map +1 -0
  80. package/dist/device-class.d.ts +62 -0
  81. package/dist/device-class.js +75 -0
  82. package/dist/device-class.js.map +1 -0
  83. package/dist/disclosure-arrow.d.ts +14 -0
  84. package/dist/disclosure-arrow.js +4 -0
  85. package/dist/disclosure-arrow.js.map +1 -0
  86. package/dist/floating-toolbar.d.ts +28 -0
  87. package/dist/floating-toolbar.js +3 -0
  88. package/dist/floating-toolbar.js.map +1 -0
  89. package/dist/index.d.ts +11 -6
  90. package/dist/index.js +22 -16
  91. package/dist/list-action-row.d.ts +52 -0
  92. package/dist/list-action-row.js +5 -0
  93. package/dist/list-action-row.js.map +1 -0
  94. package/dist/list-header.d.ts +43 -0
  95. package/dist/list-header.js +7 -0
  96. package/dist/list-header.js.map +1 -0
  97. package/dist/list-item.d.ts +33 -0
  98. package/dist/list-item.js +5 -0
  99. package/dist/list-item.js.map +1 -0
  100. package/dist/nav-stack.d.ts +38 -0
  101. package/dist/nav-stack.js +5 -0
  102. package/dist/nav-stack.js.map +1 -0
  103. package/dist/panel-header.d.ts +36 -0
  104. package/dist/panel-header.js +7 -0
  105. package/dist/panel-header.js.map +1 -0
  106. package/dist/resizable-region.d.ts +3 -1
  107. package/dist/resizable-region.js +1 -1
  108. package/dist/segmented-control.d.ts +3 -1
  109. package/dist/segmented-control.js +2 -1
  110. package/dist/select-register.d.ts +5 -1
  111. package/dist/select-register.js +3 -0
  112. package/dist/select-register.js.map +1 -1
  113. package/dist/select.d.ts +5 -2
  114. package/dist/select.js +2 -1
  115. package/dist/skeleton.d.ts +24 -0
  116. package/dist/skeleton.js +3 -0
  117. package/dist/skeleton.js.map +1 -0
  118. package/dist/split-view.d.ts +42 -0
  119. package/dist/split-view.js +21 -0
  120. package/dist/split-view.js.map +1 -0
  121. package/dist/state-banner.d.ts +3 -1
  122. package/dist/state-banner.js +2 -1
  123. package/dist/styles/app-tab.css +152 -0
  124. package/dist/styles/catalog.css +522 -0
  125. package/dist/styles/collapsible-panel.css +146 -0
  126. package/dist/styles/disclosure-arrow.css +23 -0
  127. package/dist/styles/empty-state.css +47 -0
  128. package/dist/styles/floating-toolbar.css +38 -0
  129. package/dist/styles/foundation.css +347 -0
  130. package/dist/styles/layout.css +73 -0
  131. package/dist/styles/list-action-row.css +160 -0
  132. package/dist/styles/list-header.css +160 -0
  133. package/dist/styles/list-item.css +123 -0
  134. package/dist/styles/loading-spinner.css +21 -0
  135. package/dist/styles/lucide-icon.css +6 -0
  136. package/dist/styles/nav-stack.css +111 -0
  137. package/dist/styles/panel-header.css +64 -0
  138. package/dist/styles/resizable-region.css +111 -0
  139. package/{src → dist/styles}/segmented-control.css +62 -31
  140. package/dist/styles/select.css +138 -0
  141. package/dist/styles/skeleton.css +31 -0
  142. package/dist/styles/split-view.css +35 -0
  143. package/dist/styles/state-banner.css +173 -0
  144. package/dist/styles/styles.css +23 -0
  145. package/dist/styles/tab-bar.css +45 -0
  146. package/dist/styles/tab-scaffold.css +84 -0
  147. package/dist/styles/token-search-field.css +289 -0
  148. package/dist/styles/toolbar-control-group.css +225 -0
  149. package/dist/styles/toolbar-text.css +40 -0
  150. package/dist/styles/toolbar.css +61 -0
  151. package/dist/styles/value-table.css +75 -0
  152. package/{src → dist/styles}/webawesome.css +119 -29
  153. package/dist/styles/workbench.css +94 -0
  154. package/dist/tab-bar.d.ts +8 -1
  155. package/dist/tab-bar.js +1 -1
  156. package/dist/tab-scaffold.d.ts +30 -0
  157. package/dist/tab-scaffold.js +16 -0
  158. package/dist/tab-scaffold.js.map +1 -0
  159. package/dist/token-search-field.d.ts +43 -0
  160. package/dist/token-search-field.js +4 -0
  161. package/dist/token-search-field.js.map +1 -0
  162. package/dist/toolbar-control-group.d.ts +3 -1
  163. package/dist/toolbar-control-group.js +1 -1
  164. package/dist/toolbar-text.d.ts +15 -3
  165. package/dist/toolbar-text.js +2 -1
  166. package/dist/value-table.d.ts +12 -2
  167. package/dist/value-table.js +2 -1
  168. package/dist/webawesome.d.ts +100 -0
  169. package/dist/webawesome.js +3 -0
  170. package/dist/webawesome.js.map +1 -0
  171. package/dist/wire-catalog.d.ts +26 -0
  172. package/dist/wire-catalog.js +48 -0
  173. package/dist/wire-catalog.js.map +1 -0
  174. package/dist/wire-nav-stack.d.ts +15 -0
  175. package/dist/wire-nav-stack.js +88 -0
  176. package/dist/wire-nav-stack.js.map +1 -0
  177. package/dist/wire-resizable-regions.js +1 -1
  178. package/dist/wire-sidebar.d.ts +43 -0
  179. package/dist/wire-sidebar.js +117 -0
  180. package/dist/wire-sidebar.js.map +1 -0
  181. package/dist/wire-tab-bars.d.ts +15 -2
  182. package/dist/wire-tab-bars.js +1 -1
  183. package/dist/wire-tab-scaffold.d.ts +11 -0
  184. package/dist/wire-tab-scaffold.js +16 -0
  185. package/dist/wire-tab-scaffold.js.map +1 -0
  186. package/dist/wire-token-search-fields.d.ts +106 -0
  187. package/dist/wire-token-search-fields.js +5 -0
  188. package/dist/wire-token-search-fields.js.map +1 -0
  189. package/dist/workbench.d.ts +33 -0
  190. package/dist/workbench.js +17 -0
  191. package/dist/workbench.js.map +1 -0
  192. package/docs/accessibility.md +112 -3
  193. package/docs/app-layouts.md +61 -0
  194. package/docs/catalog.md +155 -0
  195. package/docs/collapsible-panel.md +102 -0
  196. package/docs/component-contract.md +169 -4
  197. package/docs/component-selection.md +186 -0
  198. package/docs/design/templates/empty-state/filtered-dark.svg +1 -0
  199. package/docs/design/templates/empty-state/filtered.svg +1 -0
  200. package/docs/design/templates/empty-state/with-action-dark.svg +1 -0
  201. package/docs/design/templates/empty-state/with-action.svg +1 -0
  202. package/docs/design/templates/empty-state-dark.svg +7 -0
  203. package/docs/design/templates/empty-state.svg +7 -0
  204. package/docs/design/templates/list-action-row/default-dark.svg +1 -0
  205. package/docs/design/templates/list-action-row/default.svg +1 -0
  206. package/docs/design/templates/list-action-row/selected-dark.svg +1 -0
  207. package/docs/design/templates/list-action-row/selected.svg +1 -0
  208. package/docs/design/templates/list-action-row-dark.svg +7 -0
  209. package/docs/design/templates/list-action-row.svg +7 -0
  210. package/docs/design/templates/list-header/action-dark.svg +1 -0
  211. package/docs/design/templates/list-header/action.svg +1 -0
  212. package/docs/design/templates/list-header/count-dark.svg +1 -0
  213. package/docs/design/templates/list-header/count.svg +1 -0
  214. package/docs/design/templates/list-header/toggle-collapsed-dark.svg +1 -0
  215. package/docs/design/templates/list-header/toggle-collapsed.svg +1 -0
  216. package/docs/design/templates/list-header/toggle-expanded-dark.svg +1 -0
  217. package/docs/design/templates/list-header/toggle-expanded.svg +1 -0
  218. package/docs/design/templates/list-header-dark.svg +11 -0
  219. package/docs/design/templates/list-header.svg +11 -0
  220. package/docs/design/templates/list-item/default-dark.svg +1 -0
  221. package/docs/design/templates/list-item/default.svg +1 -0
  222. package/docs/design/templates/list-item/multiline-dark.svg +1 -0
  223. package/docs/design/templates/list-item/multiline.svg +1 -0
  224. package/docs/design/templates/list-item/selected-dark.svg +1 -0
  225. package/docs/design/templates/list-item/selected.svg +1 -0
  226. package/docs/design/templates/list-item/trailing-dark.svg +1 -0
  227. package/docs/design/templates/list-item/trailing.svg +1 -0
  228. package/docs/design/templates/list-item-dark.svg +11 -0
  229. package/docs/design/templates/list-item.svg +11 -0
  230. package/docs/design/templates/panel-header/icon-actions-dark.svg +1 -0
  231. package/docs/design/templates/panel-header/icon-actions.svg +1 -0
  232. package/docs/design/templates/panel-header/icon-summary-actions-dark.svg +1 -0
  233. package/docs/design/templates/panel-header/icon-summary-actions.svg +1 -0
  234. package/docs/design/templates/panel-header/no-icon-dark.svg +1 -0
  235. package/docs/design/templates/panel-header/no-icon.svg +1 -0
  236. package/docs/design/templates/panel-header/page-heading-dark.svg +1 -0
  237. package/docs/design/templates/panel-header/page-heading.svg +1 -0
  238. package/docs/design/templates/panel-header/title-only-dark.svg +1 -0
  239. package/docs/design/templates/panel-header/title-only.svg +1 -0
  240. package/docs/design/templates/panel-header-dark.svg +13 -0
  241. package/docs/design/templates/panel-header.svg +13 -0
  242. package/docs/design/templates/segmented-control/equal-dark.svg +1 -0
  243. package/docs/design/templates/segmented-control/equal.svg +1 -0
  244. package/docs/design/templates/segmented-control/pill-small-dark.svg +1 -0
  245. package/docs/design/templates/segmented-control/pill-small.svg +1 -0
  246. package/docs/design/templates/segmented-control-dark.svg +7 -0
  247. package/docs/design/templates/segmented-control.svg +7 -0
  248. package/docs/design/templates/skeleton/avatar-dark.svg +1 -0
  249. package/docs/design/templates/skeleton/avatar.svg +1 -0
  250. package/docs/design/templates/skeleton/block-dark.svg +1 -0
  251. package/docs/design/templates/skeleton/block.svg +1 -0
  252. package/docs/design/templates/skeleton/lines-dark.svg +1 -0
  253. package/docs/design/templates/skeleton/lines.svg +1 -0
  254. package/docs/design/templates/skeleton-dark.svg +9 -0
  255. package/docs/design/templates/skeleton.svg +9 -0
  256. package/docs/design/templates/state-banner/danger-dark.svg +1 -0
  257. package/docs/design/templates/state-banner/danger.svg +1 -0
  258. package/docs/design/templates/state-banner/info-dark.svg +1 -0
  259. package/docs/design/templates/state-banner/info.svg +1 -0
  260. package/docs/design/templates/state-banner/success-dark.svg +1 -0
  261. package/docs/design/templates/state-banner/success.svg +1 -0
  262. package/docs/design/templates/state-banner/warning-dark.svg +1 -0
  263. package/docs/design/templates/state-banner/warning.svg +1 -0
  264. package/docs/design/templates/state-banner-dark.svg +11 -0
  265. package/docs/design/templates/state-banner.svg +11 -0
  266. package/docs/design/templates/tab-bar/workspace-tabs-dark.svg +1 -0
  267. package/docs/design/templates/tab-bar/workspace-tabs.svg +1 -0
  268. package/docs/design/templates/tab-bar-dark.svg +5 -0
  269. package/docs/design/templates/tab-bar.svg +5 -0
  270. package/docs/design/templates/token-search-field/empty-dark.svg +1 -0
  271. package/docs/design/templates/token-search-field/empty.svg +1 -0
  272. package/docs/design/templates/token-search-field/tokens-dark.svg +1 -0
  273. package/docs/design/templates/token-search-field/tokens.svg +1 -0
  274. package/docs/design/templates/token-search-field-dark.svg +7 -0
  275. package/docs/design/templates/token-search-field.svg +7 -0
  276. package/docs/design/templates/toolbar/title-and-actions-dark.svg +1 -0
  277. package/docs/design/templates/toolbar/title-and-actions.svg +1 -0
  278. package/docs/design/templates/toolbar-control-group/borderless-single-dark.svg +1 -0
  279. package/docs/design/templates/toolbar-control-group/borderless-single.svg +1 -0
  280. package/docs/design/templates/toolbar-control-group/icon-buttons-dark.svg +1 -0
  281. package/docs/design/templates/toolbar-control-group/icon-buttons.svg +1 -0
  282. package/docs/design/templates/toolbar-control-group/push-buttons-dark.svg +1 -0
  283. package/docs/design/templates/toolbar-control-group/push-buttons.svg +1 -0
  284. package/docs/design/templates/toolbar-control-group/with-text-dark.svg +1 -0
  285. package/docs/design/templates/toolbar-control-group/with-text.svg +1 -0
  286. package/docs/design/templates/toolbar-control-group-dark.svg +11 -0
  287. package/docs/design/templates/toolbar-control-group.svg +11 -0
  288. package/docs/design/templates/toolbar-dark.svg +5 -0
  289. package/docs/design/templates/toolbar-text/default-dark.svg +1 -0
  290. package/docs/design/templates/toolbar-text/default.svg +1 -0
  291. package/docs/design/templates/toolbar-text/large-dark.svg +1 -0
  292. package/docs/design/templates/toolbar-text/large.svg +1 -0
  293. package/docs/design/templates/toolbar-text/small-dark.svg +1 -0
  294. package/docs/design/templates/toolbar-text/small.svg +1 -0
  295. package/docs/design/templates/toolbar-text-dark.svg +9 -0
  296. package/docs/design/templates/toolbar-text.svg +9 -0
  297. package/docs/design/templates/toolbar.svg +5 -0
  298. package/docs/design/templates/value-table/details-dark.svg +1 -0
  299. package/docs/design/templates/value-table/details.svg +1 -0
  300. package/docs/design/templates/value-table-dark.svg +5 -0
  301. package/docs/design/templates/value-table.svg +5 -0
  302. package/docs/design/templates.md +114 -0
  303. package/docs/design-philosophy.md +61 -1
  304. package/docs/device-class.md +54 -0
  305. package/docs/examples/command-palette-adapter.tsx +70 -0
  306. package/docs/layout.md +131 -0
  307. package/docs/nav-stack.md +47 -0
  308. package/docs/recipes.md +167 -0
  309. package/docs/split-view.md +49 -0
  310. package/docs/tab-scaffold.md +41 -0
  311. package/docs/ux-demo.md +23 -9
  312. package/docs/webawesome-theme.md +15 -0
  313. package/docs/workbench.md +47 -0
  314. package/llms.txt +123 -14
  315. package/package.json +147 -44
  316. package/ux-demo/recipes/app-shell.tsx +32 -0
  317. package/ux-demo/recipes/collapsible-sidebar.tsx +100 -0
  318. package/ux-demo/recipes/compact-toolbar.tsx +43 -0
  319. package/ux-demo/recipes/composer-form.tsx +63 -0
  320. package/ux-demo/recipes/list-detail-dialog.tsx +45 -0
  321. package/ux-demo/recipes/list-workspace-states.tsx +26 -0
  322. package/ux-demo/recipes/loaders.ts +33 -0
  323. package/ux-demo/recipes/loading-inspector.tsx +81 -0
  324. package/ux-demo/recipes/mount-recipe.ts +43 -0
  325. package/ux-demo/recipes/navigation-sidebar.tsx +26 -0
  326. package/ux-demo/recipes/navigation-stack.tsx +76 -0
  327. package/ux-demo/recipes/recipes.css +448 -0
  328. package/ux-demo/recipes/types.ts +17 -0
  329. package/ux-demo/recipes/workspace-header.tsx +12 -0
  330. package/dist/browser/dialog-header.js +0 -3
  331. package/dist/browser/menu-header.js +0 -3
  332. package/dist/browser/menu-item.js +0 -3
  333. package/dist/browser/page-header.js +0 -3
  334. package/dist/chunk-2PES33HS.js +0 -13
  335. package/dist/chunk-2PES33HS.js.map +0 -1
  336. package/dist/chunk-3O7ZEUW2.js.map +0 -1
  337. package/dist/chunk-723YNJBH.js +0 -17
  338. package/dist/chunk-723YNJBH.js.map +0 -1
  339. package/dist/chunk-GY5WH7TO.js +0 -10
  340. package/dist/chunk-GY5WH7TO.js.map +0 -1
  341. package/dist/chunk-MBR3TYNL.js.map +0 -1
  342. package/dist/chunk-MFKMHK5W.js.map +0 -1
  343. package/dist/chunk-MQIZAD4A.js.map +0 -1
  344. package/dist/chunk-NHXX4JI5.js +0 -28
  345. package/dist/chunk-NHXX4JI5.js.map +0 -1
  346. package/dist/chunk-OPCJRCYO.js +0 -19
  347. package/dist/chunk-OPCJRCYO.js.map +0 -1
  348. package/dist/chunk-T5XNMVOI.js +0 -24
  349. package/dist/chunk-T5XNMVOI.js.map +0 -1
  350. package/dist/chunk-TRNBHPNW.js.map +0 -1
  351. package/dist/chunk-VHW5YNIB.js +0 -17
  352. package/dist/chunk-VHW5YNIB.js.map +0 -1
  353. package/dist/chunk-VKH2JLDZ.js +0 -10
  354. package/dist/chunk-VKH2JLDZ.js.map +0 -1
  355. package/dist/chunk-WY4CAEPG.js +0 -14
  356. package/dist/chunk-WY4CAEPG.js.map +0 -1
  357. package/dist/dialog-header.d.ts +0 -14
  358. package/dist/dialog-header.js +0 -3
  359. package/dist/dialog-header.js.map +0 -1
  360. package/dist/menu-header.d.ts +0 -15
  361. package/dist/menu-header.js +0 -3
  362. package/dist/menu-header.js.map +0 -1
  363. package/dist/menu-item.d.ts +0 -22
  364. package/dist/menu-item.js +0 -3
  365. package/dist/menu-item.js.map +0 -1
  366. package/dist/page-header.d.ts +0 -9
  367. package/dist/page-header.js +0 -3
  368. package/dist/page-header.js.map +0 -1
  369. package/src/app-tab.css +0 -20
  370. package/src/dialog-header.css +0 -9
  371. package/src/empty-state.css +0 -6
  372. package/src/foundation.css +0 -106
  373. package/src/loading-spinner.css +0 -4
  374. package/src/lucide-icon.css +0 -1
  375. package/src/menu-header.css +0 -13
  376. package/src/menu-item.css +0 -12
  377. package/src/page-header.css +0 -3
  378. package/src/resizable-region.css +0 -19
  379. package/src/select.css +0 -18
  380. package/src/state-banner.css +0 -31
  381. package/src/styles.css +0 -18
  382. package/src/tab-bar.css +0 -4
  383. package/src/toolbar-control-group.css +0 -25
  384. package/src/toolbar-text.css +0 -4
  385. package/src/toolbar.css +0 -9
  386. package/src/value-table.css +0 -5
@@ -0,0 +1,1371 @@
1
+ # Public API signatures for the UI authoring corpus
2
+
3
+ Generated from emitted declarations for `@kerfjs/ui@5.0.0-beta.11` and `kerfjs@5.0.0-beta.11`. This bounded reference covers only APIs used by the seven-task corpus. It is interface evidence, not an implementation or runtime guarantee.
4
+
5
+ ## `@kerfjs/ui/disclosure-arrow`
6
+
7
+ ```ts
8
+ import { SafeHtml } from 'kerfjs';
9
+
10
+ type DisclosureDirection = 'up' | 'down' | 'left' | 'right';
11
+ interface DisclosureArrowProps {
12
+ open: boolean;
13
+ openDirection?: DisclosureDirection;
14
+ closedDirection?: DisclosureDirection;
15
+ /** Replacement icons should use right as their unrotated orientation. */
16
+ icon?: SafeHtml;
17
+ className?: string;
18
+ }
19
+ declare function DisclosureArrow({ open, openDirection, closedDirection, icon, className, }: DisclosureArrowProps): SafeHtml;
20
+
21
+ export { DisclosureArrow, type DisclosureArrowProps, type DisclosureDirection };
22
+ ```
23
+
24
+ ## `@kerfjs/ui/toolbar`
25
+
26
+ ```ts
27
+ import { SafeHtml } from 'kerfjs';
28
+
29
+ interface ToolbarProps {
30
+ leading?: SafeHtml;
31
+ center?: SafeHtml;
32
+ trailing?: SafeHtml;
33
+ label?: string;
34
+ divider?: boolean;
35
+ className?: string;
36
+ }
37
+ declare function Toolbar({ leading, center, trailing, label, divider, className }: ToolbarProps): SafeHtml;
38
+
39
+ export { Toolbar, type ToolbarProps };
40
+ ```
41
+
42
+ ## `@kerfjs/ui/toolbar-text`
43
+
44
+ ```ts
45
+ import * as kerfjs from 'kerfjs';
46
+
47
+ type ToolbarTextSize = 'xlarge' | 'large' | 'default' | 'small';
48
+ /** ARIA heading level for a title exposed as a heading landmark. */
49
+ type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
50
+ interface ToolbarTextProps {
51
+ text: string;
52
+ size?: ToolbarTextSize;
53
+ className?: string;
54
+ /** Optional id, e.g. so a dialog can reference the title via aria-labelledby. */
55
+ id?: string;
56
+ /**
57
+ * Expose heading semantics (`role="heading"` + `aria-level`) so the text acts as
58
+ * a heading landmark — e.g. a page's primary title. Omit to keep the plain span
59
+ * (the default), which suits a dialog title referenced via `aria-labelledby`.
60
+ */
61
+ headingLevel?: HeadingLevel;
62
+ /** Render the text as an unanimated loading skeleton instead of its value. */
63
+ placeholder?: boolean;
64
+ }
65
+ declare function ToolbarText({ text, size, className, id, headingLevel, placeholder }: ToolbarTextProps): kerfjs.SafeHtml;
66
+
67
+ export { type HeadingLevel, ToolbarText, type ToolbarTextProps, type ToolbarTextSize };
68
+ ```
69
+
70
+ ## `@kerfjs/ui/toolbar-control-group`
71
+
72
+ ```ts
73
+ import { SafeHtml } from 'kerfjs';
74
+
75
+ interface ToolbarControlGroupProps {
76
+ children: SafeHtml | SafeHtml[];
77
+ label?: string;
78
+ className?: string;
79
+ expanded?: boolean;
80
+ single?: boolean;
81
+ appearance?: 'contained' | 'borderless';
82
+ tone?: 'default' | 'dark';
83
+ buttonAppearance?: 'plain' | 'push';
84
+ /** Corner shape: fully round `pill` (default) or a softer `rounded` rectangle. */
85
+ shape?: 'pill' | 'rounded';
86
+ }
87
+ declare function ToolbarControlGroup({ children, label, className, expanded, single, appearance, tone, buttonAppearance, shape }: ToolbarControlGroupProps): SafeHtml;
88
+
89
+ export { ToolbarControlGroup, type ToolbarControlGroupProps };
90
+ ```
91
+
92
+ ## `@kerfjs/ui/floating-toolbar`
93
+
94
+ ```ts
95
+ import { SafeHtml } from 'kerfjs';
96
+
97
+ /** Where a {@link FloatingToolbar} floats within its positioned container. */
98
+ type FloatingToolbarPosition = 'bottom' | 'bottom-start' | 'bottom-end' | 'top' | 'top-start' | 'top-end';
99
+ interface FloatingToolbarProps {
100
+ /** Toolbar contents — normally one or more `ToolbarControlGroup`s. */
101
+ children: SafeHtml | SafeHtml[];
102
+ /** Accessible name for the toolbar (required — it exposes `role="toolbar"`). */
103
+ label: string;
104
+ /**
105
+ * Corner or edge it floats to inside its nearest positioned ancestor.
106
+ * Default: `'bottom-end'`.
107
+ */
108
+ position?: FloatingToolbarPosition;
109
+ className?: string;
110
+ }
111
+ /**
112
+ * A toolbar that floats above the main content of its nearest positioned
113
+ * ancestor — a transparent, forced-dark cluster of controls (e.g. a drawer
114
+ * restore button) that sits over the content but NOT over dialogs or overlays
115
+ * (it is not in the top layer). It is inset from the container edges by
116
+ * `--kui-floating-toolbar-inset` (default `--kui-space-m`, i.e. 8px more than a
117
+ * top toolbar's own inset); override that token to move it. The app owns the
118
+ * controls and their behavior — wire them with `delegate()` as usual.
119
+ */
120
+ declare function FloatingToolbar({ children, label, position, className }: FloatingToolbarProps): SafeHtml;
121
+
122
+ export { FloatingToolbar, type FloatingToolbarPosition, type FloatingToolbarProps };
123
+ ```
124
+
125
+ ## `@kerfjs/ui/list-header`
126
+
127
+ ```ts
128
+ import { SafeHtml } from 'kerfjs';
129
+
130
+ type ListHeaderRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
131
+ 'data-component'?: never;
132
+ 'data-action'?: never;
133
+ 'data-has-badge'?: never;
134
+ 'data-has-count'?: never;
135
+ 'data-toggle'?: never;
136
+ }>;
137
+ type ListHeaderTriggerAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
138
+ 'data-action'?: never;
139
+ popoverTarget?: string;
140
+ popoverTargetAction?: 'toggle' | 'show' | 'hide';
141
+ 'aria-controls'?: string;
142
+ 'aria-haspopup'?: 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid' | 'true';
143
+ }>;
144
+ interface ListHeaderBaseProps {
145
+ label: string;
146
+ action?: string;
147
+ actionLabel?: string;
148
+ actionIcon?: SafeHtml;
149
+ actionDisabled?: boolean;
150
+ disabledReason?: string;
151
+ expanded?: boolean;
152
+ toggle?: boolean;
153
+ /** Render as an unanimated loading skeleton: keep the label and action affordance, disable interaction. */
154
+ placeholder?: boolean;
155
+ rootAttributes?: ListHeaderRootAttributes;
156
+ triggerAttributes?: ListHeaderTriggerAttributes;
157
+ }
158
+ type ListHeaderIndicatorProps = {
159
+ count: number;
160
+ countLabel: string;
161
+ badge?: never;
162
+ } | {
163
+ count?: never;
164
+ countLabel?: never;
165
+ badge?: SafeHtml;
166
+ };
167
+ type ListHeaderProps = ListHeaderBaseProps & ListHeaderIndicatorProps;
168
+ declare function ListHeader({ label, count, countLabel, badge, action, actionLabel, actionIcon, actionDisabled, disabledReason, expanded, toggle, placeholder, rootAttributes, triggerAttributes }: ListHeaderProps): SafeHtml;
169
+
170
+ export { ListHeader, type ListHeaderProps };
171
+ ```
172
+
173
+ ## `@kerfjs/ui/list-action-row`
174
+
175
+ ```ts
176
+ import { SafeHtml } from 'kerfjs';
177
+
178
+ type ListActionRowRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
179
+ 'data-component'?: never;
180
+ 'data-action'?: never;
181
+ 'data-item-id'?: never;
182
+ 'data-has-icon'?: never;
183
+ 'data-multiline'?: never;
184
+ 'data-state'?: never;
185
+ 'data-selected'?: never;
186
+ 'data-pressed'?: never;
187
+ }>;
188
+ type ListActionRowTrailingAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
189
+ 'data-component'?: never;
190
+ 'data-action'?: never;
191
+ 'data-item-id'?: never;
192
+ popoverTarget?: string;
193
+ popoverTargetAction?: 'toggle' | 'show' | 'hide';
194
+ 'aria-controls'?: string;
195
+ 'aria-haspopup'?: 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid' | 'true';
196
+ }>;
197
+ interface ListActionRowProps {
198
+ /** Visible dormant content for the primary button. Must not contain interactive descendants. */
199
+ label: string | SafeHtml;
200
+ /** Decorative dormant content for the primary button. Must not contain interactive descendants. */
201
+ icon?: SafeHtml;
202
+ action: string;
203
+ itemId?: string;
204
+ selected?: boolean;
205
+ pressed?: boolean;
206
+ accessibleLabel?: string;
207
+ title?: string;
208
+ multiline?: boolean;
209
+ state?: string;
210
+ disabled?: boolean;
211
+ tabIndex?: number;
212
+ /** Render as an unanimated loading skeleton, disabling both actions. */
213
+ placeholder?: boolean;
214
+ trailingAction: string;
215
+ trailingActionLabel: string;
216
+ /** Decorative dormant content for the trailing button. Must not contain interactive descendants. */
217
+ trailingActionIcon: SafeHtml;
218
+ trailingActionDisabled?: boolean;
219
+ trailingActionTitle?: string;
220
+ className?: string;
221
+ style?: string;
222
+ rootAttributes?: ListActionRowRootAttributes;
223
+ trailingActionAttributes?: ListActionRowTrailingAttributes;
224
+ }
225
+ declare function ListActionRow({ label, icon, action, itemId, selected, pressed, accessibleLabel, title, multiline, state, disabled, tabIndex, placeholder, trailingAction, trailingActionLabel, trailingActionIcon, trailingActionDisabled, trailingActionTitle, className, style, rootAttributes, trailingActionAttributes }: ListActionRowProps): SafeHtml;
226
+
227
+ export { ListActionRow, type ListActionRowProps };
228
+ ```
229
+
230
+ ## `@kerfjs/ui/list-item`
231
+
232
+ ```ts
233
+ import { SafeHtml } from 'kerfjs';
234
+
235
+ type ListItemRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
236
+ 'data-component'?: never;
237
+ 'data-action'?: never;
238
+ 'data-item-id'?: never;
239
+ 'data-has-icon'?: never;
240
+ 'data-multiline'?: never;
241
+ 'data-state'?: never;
242
+ }>;
243
+ interface ListItemProps {
244
+ label: string | SafeHtml;
245
+ icon?: SafeHtml;
246
+ trailing?: SafeHtml;
247
+ selected?: boolean;
248
+ action: string;
249
+ itemId?: string;
250
+ className?: string;
251
+ style?: string;
252
+ pressed?: boolean;
253
+ accessibleLabel?: string;
254
+ title?: string;
255
+ multiline?: boolean;
256
+ state?: string;
257
+ disabled?: boolean;
258
+ tabIndex?: number;
259
+ /** Render the row as an unanimated loading skeleton, disabling its action. */
260
+ placeholder?: boolean;
261
+ rootAttributes?: ListItemRootAttributes;
262
+ }
263
+ declare function ListItem({ label, icon, trailing, selected, action, itemId, className, style, pressed, accessibleLabel, title, multiline, state, disabled, tabIndex, placeholder, rootAttributes }: ListItemProps): SafeHtml;
264
+
265
+ export { ListItem, type ListItemProps };
266
+ ```
267
+
268
+ ## `@kerfjs/ui/panel-header`
269
+
270
+ ```ts
271
+ import { SafeHtml } from 'kerfjs';
272
+ import { HeadingLevel } from './toolbar-text.js';
273
+
274
+ interface PanelHeaderProps {
275
+ title: string;
276
+ titleId: string;
277
+ summary?: string;
278
+ summaryId?: string;
279
+ icon?: SafeHtml;
280
+ iconClassName?: string;
281
+ actions?: SafeHtml;
282
+ /**
283
+ * Expose the title as a heading landmark (`role="heading"` + `aria-level`). Set it
284
+ * for a PAGE or view heading so screen-reader heading navigation works and the view
285
+ * has a primary heading; omit it (the default) for a dialog title, which is instead
286
+ * referenced via `aria-labelledby={titleId}` and needs no heading landmark.
287
+ */
288
+ headingLevel?: HeadingLevel;
289
+ /** Render the title and summary as unanimated loading skeletons, keeping the icon and actions. */
290
+ placeholder?: boolean;
291
+ }
292
+ /**
293
+ * The heading of a panel, dialog, or page: a plain `Toolbar` whose leading zone
294
+ * holds an optional icon control group and the title as extra-large `ToolbarText`,
295
+ * whose trailing zone holds the app's action controls, and with an optional
296
+ * subtitle on its own row, left-aligned with the title.
297
+ *
298
+ * PanelHeader overrides no Toolbar styles — it is just a Toolbar with an xl title.
299
+ * The only styling it adds is the icon group's fill/border color and the subtitle.
300
+ * When no icon is provided, the icon group is omitted entirely. The `actions` slot
301
+ * is passed straight into the toolbar's trailing zone; the app supplies whatever
302
+ * trailing controls it needs (typically a `ToolbarControlGroup`).
303
+ */
304
+ declare function PanelHeader({ title, titleId, summary, summaryId, icon, iconClassName, actions, headingLevel, placeholder }: PanelHeaderProps): SafeHtml;
305
+
306
+ export { PanelHeader, type PanelHeaderProps };
307
+ ```
308
+
309
+ ## `@kerfjs/ui/value-table`
310
+
311
+ ```ts
312
+ import { SafeHtml } from 'kerfjs';
313
+
314
+ interface ValueTableRowProps {
315
+ label: string | SafeHtml;
316
+ value: string | SafeHtml;
317
+ icon?: SafeHtml;
318
+ className?: string;
319
+ /** Render the value as an unanimated loading skeleton, keeping the field label. */
320
+ placeholder?: boolean;
321
+ }
322
+ declare function ValueTableRow({ label, value, icon, className, placeholder }: ValueTableRowProps): SafeHtml;
323
+
324
+ interface ValueTableProps {
325
+ label: string;
326
+ className?: string;
327
+ children: SafeHtml | readonly SafeHtml[];
328
+ }
329
+ declare function ValueTable({ label, className, children }: ValueTableProps): SafeHtml;
330
+
331
+ export { ValueTable, type ValueTableProps, ValueTableRow, type ValueTableRowProps };
332
+ ```
333
+
334
+ ## `@kerfjs/ui/app-tab`
335
+
336
+ ```ts
337
+ import { SafeHtml } from 'kerfjs';
338
+
339
+ type AppTabRootAttributes = Readonly<Record<`data-${string}`, string | undefined> & {
340
+ 'data-component'?: never;
341
+ 'data-action'?: never;
342
+ 'data-tab-id'?: never;
343
+ 'data-selected'?: never;
344
+ 'data-tab-dragging'?: never;
345
+ 'data-tab-drop-position'?: never;
346
+ }>;
347
+ interface AppTabProps {
348
+ id: string;
349
+ name: string;
350
+ selected?: boolean;
351
+ closable?: boolean;
352
+ draggable?: boolean;
353
+ leading?: SafeHtml;
354
+ trailing?: SafeHtml;
355
+ /** Decorative dormant content for the close button. Must not contain interactive descendants. */
356
+ closeIcon?: SafeHtml;
357
+ selectAction?: string;
358
+ closeAction?: string;
359
+ className?: string;
360
+ /** Render as an unanimated loading skeleton, disabling select/close and dragging. */
361
+ placeholder?: boolean;
362
+ rootAttributes?: AppTabRootAttributes;
363
+ }
364
+ declare function AppTab({ id, name, selected, closable, draggable, leading, trailing, closeIcon, selectAction, closeAction, className, placeholder, rootAttributes }: AppTabProps): SafeHtml;
365
+
366
+ export { AppTab, type AppTabProps };
367
+ ```
368
+
369
+ ## `@kerfjs/ui/tab-bar`
370
+
371
+ ```ts
372
+ import { SafeHtml } from 'kerfjs';
373
+
374
+ interface TabBarProps {
375
+ id: string;
376
+ label: string;
377
+ children: SafeHtml | readonly SafeHtml[];
378
+ leading?: SafeHtml;
379
+ trailing?: SafeHtml;
380
+ className?: string;
381
+ /**
382
+ * Keyboard activation mode for this strip, emitted as `data-tab-activation` for
383
+ * `wireTabBars` to read (overrides its `activation` option). `'automatic'` (default)
384
+ * selects on arrow / Home / End; `'manual'` moves roving focus only and the user
385
+ * selects with Enter / Space / click — use it when selecting a tab is a heavy action.
386
+ */
387
+ activation?: 'automatic' | 'manual';
388
+ }
389
+ /** Render a controlled tab strip. The application owns selection, order, and persistence. */
390
+ declare function TabBar({ id, label, children, leading, trailing, className, activation }: TabBarProps): SafeHtml;
391
+
392
+ export { TabBar, type TabBarProps };
393
+ ```
394
+
395
+ ## `@kerfjs/ui/wire-tab-bars`
396
+
397
+ ```ts
398
+ type TabReorderSource = 'pointer' | 'keyboard';
399
+ type TabDropPosition = 'before' | 'after';
400
+ interface TabReorder {
401
+ barId: string;
402
+ sourceId: string;
403
+ targetId: string;
404
+ position: TabDropPosition;
405
+ source: TabReorderSource;
406
+ }
407
+ type TabActivation = 'automatic' | 'manual';
408
+ interface WireTabBarsOptions {
409
+ onReorder: (change: TabReorder) => void;
410
+ /**
411
+ * How arrow / Home / End keys activate tabs (default `'automatic'`):
412
+ * - `'automatic'` moves roving focus **and** selects the focused tab (clicks it).
413
+ * - `'manual'` moves roving focus only; the user selects with Enter / Space / click
414
+ * (the ARIA Tabs manual-activation pattern). Use this when activation is a heavy or
415
+ * side-effecting action (e.g. a tab that loads a project) so arrowing through the
416
+ * strip doesn't trigger it on every tab.
417
+ *
418
+ * A per-bar `data-tab-activation="manual" | "automatic"` attribute (see the `TabBar`
419
+ * `activation` prop) overrides this option for that strip.
420
+ */
421
+ activation?: TabActivation;
422
+ }
423
+ declare function reorderTabs<T>(items: readonly T[], getId: (item: T) => string, sourceId: string, targetId: string, position: TabDropPosition): T[];
424
+ /** Wire reordering and keyboard navigation while leaving controlled state in the application. */
425
+ declare function wireTabBars(root: HTMLElement | Document, { onReorder, activation }: WireTabBarsOptions): () => void;
426
+
427
+ export { type TabActivation, type TabDropPosition, type TabReorder, type TabReorderSource, type WireTabBarsOptions, reorderTabs, wireTabBars };
428
+ ```
429
+
430
+ ## `@kerfjs/ui/nav-stack`
431
+
432
+ ```ts
433
+ import { SafeHtml } from 'kerfjs';
434
+
435
+ /**
436
+ * One entry in a {@link NavStack}. The app owns the stack as an array (usually a
437
+ * signal); `NavStack` renders it and `wireNavStack` animates the transitions.
438
+ */
439
+ interface NavStackView {
440
+ /** Stable identity for keyed reconcile and transition direction. */
441
+ key: string;
442
+ content: SafeHtml;
443
+ /** Title shown in the top toolbar for this view. */
444
+ title?: string;
445
+ /** Trailing actions for this view's top toolbar. */
446
+ toolbar?: SafeHtml;
447
+ }
448
+ interface NavStackProps {
449
+ id: string;
450
+ /** Accessible name for the stack region. */
451
+ label: string;
452
+ /** The stack, root first; the last entry is the active top view. */
453
+ views: NavStackView[];
454
+ /** Accessible label for the back control (default "Back"). */
455
+ backLabel?: string;
456
+ /** Hide the top toolbar entirely (rare — a fully custom-chrome view). */
457
+ hideToolbar?: boolean;
458
+ /** Optional persistent bottom toolbar. */
459
+ bottomToolbar?: SafeHtml;
460
+ className?: string;
461
+ }
462
+ /**
463
+ * A navigation stack (iOS-style push/pop). Renders every entry stacked, the last
464
+ * one active; `@kerfjs/ui/wire-nav-stack`'s `wireNavStack` slides the content and
465
+ * cross-fades the chrome across a change. A single-pane layout is a `NavStack`
466
+ * with one entry. See `docs/23-app-layouts.md` §3.1.
467
+ */
468
+ declare function NavStack({ id, label, views, backLabel, hideToolbar, bottomToolbar, className }: NavStackProps): SafeHtml;
469
+
470
+ export { NavStack, type NavStackProps, type NavStackView };
471
+ ```
472
+
473
+ ## `@kerfjs/ui/wire-nav-stack`
474
+
475
+ ```ts
476
+ interface WireNavStackOptions {
477
+ /** Invoked when the back control is activated. The app pops its own stack. */
478
+ onBack?: () => void;
479
+ /** Transition duration in ms (default 200). Set 0 to disable animation. */
480
+ duration?: number;
481
+ }
482
+ /**
483
+ * Animate a `NavStack`'s push/pop transitions and wire its back control. The app
484
+ * owns the stack (a signal of `NavStackView[]`) and re-renders `NavStack` when it
485
+ * changes; this helper slides the content and settles the chrome across each
486
+ * change, and calls `onBack` when the back control is used. Returns a disposer.
487
+ */
488
+ declare function wireNavStack(root: Element, options?: WireNavStackOptions): () => void;
489
+
490
+ export { type WireNavStackOptions, wireNavStack };
491
+ ```
492
+
493
+ ## `@kerfjs/ui/split-view`
494
+
495
+ ```ts
496
+ import { SafeHtml } from 'kerfjs';
497
+
498
+ interface SplitViewResizable {
499
+ size: number;
500
+ min: number;
501
+ max: number;
502
+ }
503
+ interface SplitViewProps {
504
+ id: string;
505
+ label: string;
506
+ /** The list (primary) pane. */
507
+ list: SafeHtml;
508
+ /** The detail (secondary) pane. */
509
+ detail: SafeHtml;
510
+ /**
511
+ * Compact ("one pane at a time") classes — a handset or portrait tablet.
512
+ * Derive from `deviceClass().value.compact`. When true the split collapses to
513
+ * a `NavStack`: the list is the root and the detail is pushed over it.
514
+ */
515
+ compact?: boolean;
516
+ /** In compact mode, whether the detail is currently pushed over the list. */
517
+ detailActive?: boolean;
518
+ /** Title/label for the list (compact NavStack root + region label). */
519
+ listTitle?: string;
520
+ /** Title/label for the detail (compact NavStack pushed view + region label). */
521
+ detailTitle?: string;
522
+ /** Back label for the compact NavStack (default "Back"). */
523
+ backLabel?: string;
524
+ /** A resizable separator on roomy classes (min/max px). Omit for a fixed split. */
525
+ resizable?: SplitViewResizable;
526
+ className?: string;
527
+ }
528
+ /**
529
+ * A list-detail split. On roomy classes it shows both panes side
530
+ * by side with an optional resizable separator; on compact classes it collapses
531
+ * to a `NavStack` (list → detail). See `docs/23-app-layouts.md` §3.2. Compose the
532
+ * resizable wiring with `wireResizableRegions` and the compact back with
533
+ * `wireNavStack`.
534
+ */
535
+ declare function SplitView({ id, label, list, detail, compact, detailActive, listTitle, detailTitle, backLabel, resizable, className }: SplitViewProps): SafeHtml;
536
+
537
+ export { SplitView, type SplitViewProps, type SplitViewResizable };
538
+ ```
539
+
540
+ ## `@kerfjs/ui/workbench`
541
+
542
+ ```ts
543
+ import { SafeHtml } from 'kerfjs';
544
+
545
+ /** A collapsible Workbench panel — a side rail or the bottom drawer. */
546
+ interface WorkbenchPanel {
547
+ content: SafeHtml;
548
+ /** Whether the panel is currently collapsed (the app owns this). */
549
+ collapsed?: boolean;
550
+ /** Rail width, or drawer height, in px. Overrides the CSS default. */
551
+ size?: number;
552
+ /** Accessible name for the panel region. */
553
+ label?: string;
554
+ }
555
+ interface WorkbenchProps {
556
+ id: string;
557
+ label: string;
558
+ /** The central work area. */
559
+ main: SafeHtml;
560
+ leftRail?: WorkbenchPanel;
561
+ rightRail?: WorkbenchPanel;
562
+ bottomDrawer?: WorkbenchPanel;
563
+ className?: string;
564
+ }
565
+ /**
566
+ * The Xcode-like multi-panel workspace: a collapsible left rail, right rail, and
567
+ * bottom drawer around a central work area (any absent). Collapsing snaps the
568
+ * panel's track to zero in one reflow while its fixed-size content slides out via
569
+ * a composited transform — the instant-width / sliding-content technique, so the
570
+ * work area relayouts once, not per frame. The app owns each `collapsed` flag;
571
+ * the collapse is pure CSS (no wire). See `docs/23-app-layouts.md` §3.3.
572
+ */
573
+ declare function Workbench({ id, label, main, leftRail, rightRail, bottomDrawer, className }: WorkbenchProps): SafeHtml;
574
+
575
+ export { Workbench, type WorkbenchPanel, type WorkbenchProps };
576
+ ```
577
+
578
+ ## `@kerfjs/ui/collapsible-panel`
579
+
580
+ ```ts
581
+ import { SafeHtml } from 'kerfjs';
582
+ import { LucideIcon } from './lucide-icon.js';
583
+ import 'lucide';
584
+
585
+ /** Which edge a {@link CollapsiblePanel} docks to. */
586
+ type CollapsiblePanelSide = 'left' | 'right' | 'bottom';
587
+ /**
588
+ * The standard collapse/expand icon for a panel `side` and `collapsed` state,
589
+ * so every app's sidebars and drawers use one recognizable convention:
590
+ * `PanelLeft*` for a left rail, `PanelRight*` for a right rail, `PanelBottom*`
591
+ * for a bottom drawer — the `Close` glyph while open, the `Open` glyph while
592
+ * collapsed. Exposed so an app can render its own toggle affordance.
593
+ */
594
+ declare function collapsiblePanelToggleIcon(side: CollapsiblePanelSide, collapsed: boolean): {
595
+ icon: Parameters<typeof LucideIcon>[0]['icon'];
596
+ name: string;
597
+ };
598
+ interface CollapsiblePanelToggleProps {
599
+ /** The panel this toggle controls. */
600
+ side: CollapsiblePanelSide;
601
+ /** The panel's current collapsed state (drives the icon direction). */
602
+ collapsed: boolean;
603
+ /** `data-action` the button carries so `wireSidebar` can delegate its click. */
604
+ action: string;
605
+ /** The panel id the button targets (`data-tab-panel`-style: `data-collapsible-panel`). */
606
+ panelId?: string;
607
+ /** Accessible label; defaults to "Collapse"/"Expand". */
608
+ label?: string;
609
+ className?: string;
610
+ }
611
+ /**
612
+ * A standard collapse/expand toggle button for a {@link CollapsiblePanel}: the
613
+ * recognizable per-side icon (see {@link collapsiblePanelToggleIcon}) plus the
614
+ * `data-action` / `aria-expanded` `wireSidebar` reads. Placement is the app's —
615
+ * put it in the panel's own header (to collapse) and somewhere always-visible
616
+ * (to expand while collapsed).
617
+ */
618
+ declare function CollapsiblePanelToggle({ side, collapsed, action, panelId, label, className }: CollapsiblePanelToggleProps): SafeHtml;
619
+ interface CollapsiblePanelProps {
620
+ /** A stable id for the panel — `wireSidebar` targets it and toggles reference it. */
621
+ id: string;
622
+ /** Which edge the panel docks to: a left/right rail or a bottom drawer. */
623
+ side: CollapsiblePanelSide;
624
+ /** Whether the panel is currently collapsed (the app owns this signal). */
625
+ collapsed?: boolean;
626
+ /** Rail width or drawer height in px. Overrides the CSS default. */
627
+ size?: number;
628
+ /** Accessible label for the panel region. */
629
+ label?: string;
630
+ /** Panel content. */
631
+ children?: SafeHtml | readonly SafeHtml[];
632
+ className?: string;
633
+ }
634
+ /**
635
+ * A standalone collapsible side rail or bottom drawer, outside the full
636
+ * {@link Workbench} shell. It owns only the presentation: a fixed-size content
637
+ * area that stays laid out while the panel's track snaps to zero and the content
638
+ * slides out via `transform` (one reflow, composited — the same technique
639
+ * `Workbench` and the catalog sidebar use). The app owns the `collapsed` signal;
640
+ * pair it with `wireSidebar` for the toggle, focus, compact-overlay, keyboard,
641
+ * and persistence semantics, and with `CollapsiblePanelToggle` for the standard
642
+ * affordance. See `docs/24-collapsible-panel.md`.
643
+ */
644
+ declare function CollapsiblePanel({ id, side, collapsed, size, label, children, className }: CollapsiblePanelProps): SafeHtml;
645
+
646
+ export { CollapsiblePanel, type CollapsiblePanelProps, type CollapsiblePanelSide, CollapsiblePanelToggle, type CollapsiblePanelToggleProps, collapsiblePanelToggleIcon };
647
+ ```
648
+
649
+ ## `@kerfjs/ui/wire-sidebar`
650
+
651
+ ```ts
652
+ import { Signal, ReadonlySignal } from 'kerfjs';
653
+ import { DeviceClass } from './device-class.js';
654
+
655
+ /** Minimal `localStorage`-shaped store, so the persistence hook is testable. */
656
+ interface SidebarStorage {
657
+ getItem(key: string): string | null;
658
+ setItem(key: string, value: string): void;
659
+ }
660
+ interface WireSidebarPanel {
661
+ /** The panel id — matches `CollapsiblePanel`'s `id` and a toggle's `panelId`. */
662
+ id: string;
663
+ /** The app-owned collapsed signal. `wireSidebar` reads it (focus, overlay) and
664
+ * writes it (toggle, Escape, backdrop, persistence). */
665
+ collapsed: Signal<boolean>;
666
+ /** `data-action` value the panel's toggle button(s) carry. */
667
+ toggleAction: string;
668
+ /** When set, the collapsed state is loaded from and saved to `storage` under
669
+ * this key (a persistence hook), so the panel remembers its state. */
670
+ storageKey?: string;
671
+ }
672
+ interface WireSidebarOptions {
673
+ panels: readonly WireSidebarPanel[];
674
+ /**
675
+ * When provided, the sidebar adopts a compact **overlay** presentation while
676
+ * `deviceClass.compact` is true: an open panel floats over the content with a
677
+ * dismissable backdrop, Escape and backdrop-click collapse it, and focus is
678
+ * trapped within the open panel (the ARIA dialog pattern). Without it the panel
679
+ * is always inline.
680
+ */
681
+ deviceClass?: ReadonlySignal<DeviceClass>;
682
+ /** Persistence store (default `globalThis.localStorage`, if present). */
683
+ storage?: SidebarStorage;
684
+ }
685
+ /**
686
+ * The reusable sidebar-semantics layer for {@link CollapsiblePanel}s: toggle
687
+ * delegation with focus restore, focus-into on open, an optional compact overlay
688
+ * (backdrop + Escape + focus trap) driven by {@link deviceClass}, and an optional
689
+ * persistence hook. The app owns each `collapsed` signal and the layout; this wire
690
+ * owns the interaction. Returns a disposer. See `docs/24-collapsible-panel.md`.
691
+ */
692
+ declare function wireSidebar(root: HTMLElement, { panels, deviceClass, storage }: WireSidebarOptions): () => void;
693
+
694
+ export { type SidebarStorage, type WireSidebarOptions, type WireSidebarPanel, wireSidebar };
695
+ ```
696
+
697
+ ## `@kerfjs/ui/tab-scaffold`
698
+
699
+ ```ts
700
+ import { SafeHtml } from 'kerfjs';
701
+
702
+ interface TabScaffoldTab {
703
+ id: string;
704
+ label: string;
705
+ /** Decorative icon shown above the label in the bottom bar. */
706
+ icon?: SafeHtml;
707
+ /** The tab's content — typically a `NavStack` so each tab keeps its own stack. */
708
+ content: SafeHtml;
709
+ }
710
+ interface TabScaffoldProps {
711
+ id: string;
712
+ /** Accessible name for the tab bar. */
713
+ label: string;
714
+ tabs: TabScaffoldTab[];
715
+ /** The controlled active tab id (the app owns selection). */
716
+ active: string;
717
+ className?: string;
718
+ }
719
+ /**
720
+ * A mobile-first, iOS-like bottom tab scaffold: a bottom tab bar that switches
721
+ * between major sections, each tab keeping its own content (usually a `NavStack`)
722
+ * mounted so its stack and scroll survive a switch. Controlled — the app owns
723
+ * `active`; wire selection with `@kerfjs/ui/wire-tab-scaffold`'s `wireTabScaffold`.
724
+ * On larger classes, promote the tabs to a `Workbench` rail or sidebar instead of
725
+ * a bottom bar. See `docs/23-app-layouts.md` §3.4.
726
+ */
727
+ declare function TabScaffold({ id, label, tabs, active, className }: TabScaffoldProps): SafeHtml;
728
+
729
+ export { TabScaffold, type TabScaffoldProps, type TabScaffoldTab };
730
+ ```
731
+
732
+ ## `@kerfjs/ui/wire-tab-scaffold`
733
+
734
+ ```ts
735
+ interface WireTabScaffoldOptions {
736
+ /** Invoked with the selected tab id when a bottom-bar tab is activated. */
737
+ onSelect: (tabId: string) => void;
738
+ }
739
+ /**
740
+ * Wire a `TabScaffold`'s bottom tab bar: clicking a tab calls `onSelect` with its
741
+ * id (the app then updates its controlled `active`). Returns a disposer.
742
+ */
743
+ declare function wireTabScaffold(root: Element, options: WireTabScaffoldOptions): () => void;
744
+
745
+ export { type WireTabScaffoldOptions, wireTabScaffold };
746
+ ```
747
+
748
+ ## `@kerfjs/ui/resizable-region`
749
+
750
+ ```ts
751
+ import { SafeHtml } from 'kerfjs';
752
+
753
+ type ResizableRegionAxis = 'horizontal' | 'vertical';
754
+ type ResizableRegionEdge = 'start' | 'end';
755
+ interface ResizableRegionProps {
756
+ id: string;
757
+ label: string;
758
+ size: number;
759
+ min: number;
760
+ max: number;
761
+ axis?: ResizableRegionAxis;
762
+ edge?: ResizableRegionEdge;
763
+ collapsed?: boolean;
764
+ transitioning?: boolean;
765
+ /** Decorative dormant content for the separator handle. Must not contain interactive descendants. */
766
+ handleIcon?: SafeHtml;
767
+ children: SafeHtml | SafeHtml[];
768
+ }
769
+ declare const clampRegionSize: (size: number, min: number, max: number) => number;
770
+ declare const resizeRegionFromPointer: (startSize: number, delta: number, edge: ResizableRegionEdge) => number;
771
+ declare function ResizableRegion({ id, label, size, min, max, axis, edge, collapsed, transitioning, handleIcon, children }: ResizableRegionProps): SafeHtml;
772
+
773
+ export { ResizableRegion, type ResizableRegionAxis, type ResizableRegionEdge, type ResizableRegionProps, clampRegionSize, resizeRegionFromPointer };
774
+ ```
775
+
776
+ ## `@kerfjs/ui/wire-resizable-regions`
777
+
778
+ ```ts
779
+ interface ResizeCommit {
780
+ id: string;
781
+ size: number;
782
+ source: 'keyboard' | 'pointer';
783
+ }
784
+ interface WireResizableRegionsOptions {
785
+ step?: number;
786
+ largeStep?: number;
787
+ onPreview?: (change: ResizeCommit) => void;
788
+ onCommit: (change: ResizeCommit) => void;
789
+ }
790
+ /** Wire pointer and separator-keyboard behavior for every ResizableRegion below root. */
791
+ declare function wireResizableRegions(root: HTMLElement, { step, largeStep, onPreview, onCommit }: WireResizableRegionsOptions): () => void;
792
+
793
+ export { type ResizeCommit, type WireResizableRegionsOptions, wireResizableRegions };
794
+ ```
795
+
796
+ ## `@kerfjs/ui/device-class`
797
+
798
+ ```ts
799
+ import { ReadonlySignal } from 'kerfjs';
800
+
801
+ /**
802
+ * Reactive device-class detection for `@kerfjs/ui` (see `docs/23-app-layouts.md`
803
+ * §2). `deviceClass()` returns a `ReadonlySignal<DeviceClass>` describing the
804
+ * current viewport as a size bucket × orientation × viewport-segment count, so a
805
+ * layout can pick its presentation reactively instead of hand-wiring `matchMedia`.
806
+ *
807
+ * One shared viewport source backs every reader; the pure `classifyViewport`
808
+ * core is DOM-free and directly unit-tested.
809
+ */
810
+ type DeviceSize = 'xs-mobile' | 'mobile' | 'tablet' | 'desktop' | 'xl-desktop';
811
+ type DeviceOrientation = 'portrait' | 'landscape';
812
+ /** Minimum widths (px) at which each larger bucket begins. `xs-mobile` is 0. */
813
+ interface DeviceBreakpoints {
814
+ mobile: number;
815
+ tablet: number;
816
+ desktop: number;
817
+ 'xl-desktop': number;
818
+ }
819
+ interface DeviceClass {
820
+ size: DeviceSize;
821
+ orientation: DeviceOrientation;
822
+ /** Horizontal viewport segments (foldables / dual-screen); 1 on ordinary devices. */
823
+ segments: number;
824
+ /** Vertical viewport segments; 1 on ordinary devices. */
825
+ verticalSegments: number;
826
+ /** Small phones — `xs-mobile` or `mobile`. */
827
+ handset: boolean;
828
+ /** "One pane at a time" — a handset or a portrait tablet. */
829
+ compact: boolean;
830
+ /** True when the current size is `size` or larger, e.g. `atLeast('tablet')`. */
831
+ atLeast(size: DeviceSize): boolean;
832
+ }
833
+ /** A raw viewport snapshot, before breakpoints are applied. */
834
+ interface Viewport {
835
+ width: number;
836
+ height: number;
837
+ segments: number;
838
+ verticalSegments: number;
839
+ }
840
+ interface DeviceClassOptions {
841
+ /** Override any of the default bucket thresholds. */
842
+ breakpoints?: Partial<DeviceBreakpoints>;
843
+ /** The viewport assumed when there is no DOM (SSR). Defaults to 1024×768, one segment. */
844
+ ssr?: Partial<Viewport>;
845
+ }
846
+ declare const DEFAULT_BREAKPOINTS: DeviceBreakpoints;
847
+ /**
848
+ * Classify a raw viewport into a {@link DeviceClass}. Pure and DOM-free — the
849
+ * single source of truth for the bucketing rules.
850
+ */
851
+ declare function classifyViewport(width: number, orientation: DeviceOrientation, segments?: number, verticalSegments?: number, breakpoints?: DeviceBreakpoints): DeviceClass;
852
+ /**
853
+ * A reactive signal of the current {@link DeviceClass}. Reading it inside an
854
+ * `effect`/`computed` re-runs when the viewport crosses a breakpoint, rotates,
855
+ * or changes its segment count. Without a DOM it resolves to `options.ssr`
856
+ * (default 1024×768, landscape, one segment).
857
+ */
858
+ declare function deviceClass(options?: DeviceClassOptions): ReadonlySignal<DeviceClass>;
859
+
860
+ export { DEFAULT_BREAKPOINTS, type DeviceBreakpoints, type DeviceClass, type DeviceClassOptions, type DeviceOrientation, type DeviceSize, type Viewport, classifyViewport, deviceClass };
861
+ ```
862
+
863
+ ## `@kerfjs/ui/catalog`
864
+
865
+ ```ts
866
+ import { SafeHtml } from 'kerfjs';
867
+
868
+ /** A reference link shown in the detail footer for the active entry. */
869
+ interface CatalogResource {
870
+ label: string;
871
+ href: string;
872
+ /** Optional monospace detail (e.g. a file path) shown after the label. */
873
+ detail?: string;
874
+ }
875
+ /** A related entry offered in the detail footer's "Related entries" popup menu. */
876
+ interface CatalogRelated {
877
+ id: string;
878
+ name: string;
879
+ /** Group heading in the menu, e.g. "Uses" / "Used by". */
880
+ group: string;
881
+ }
882
+ interface CatalogEntry {
883
+ id: string;
884
+ name: string;
885
+ description?: string;
886
+ resources?: readonly CatalogResource[];
887
+ related?: readonly CatalogRelated[];
888
+ }
889
+ interface CatalogSection {
890
+ category: string;
891
+ entries: readonly CatalogEntry[];
892
+ }
893
+ /**
894
+ * A secondary group of sections shown below the primary sidebar sections with a
895
+ * quieter "ecosystem" treatment (e.g. third-party components). Optionally
896
+ * collapsible — the app owns `expanded` and toggles it from `wireCatalog`'s
897
+ * `onToggleSecondary`.
898
+ */
899
+ interface CatalogSecondaryGroup {
900
+ label: string;
901
+ sections: readonly CatalogSection[];
902
+ /** When true, the group's label is a disclosure toggle controlling `expanded`. */
903
+ collapsible?: boolean;
904
+ /** Whether the group is expanded (controlled). Ignored unless `collapsible`. */
905
+ expanded?: boolean;
906
+ }
907
+ interface CatalogBrand {
908
+ title: string;
909
+ subtitle?: string;
910
+ /** Logo image URL (rendered decorative). Omit for a text-only brand. */
911
+ logoUrl?: string;
912
+ }
913
+ interface CatalogProps {
914
+ brand: CatalogBrand;
915
+ sections: readonly CatalogSection[];
916
+ /** The controlled active entry id — the app owns this signal. */
917
+ active: string;
918
+ /** The rendered preview for the active entry; the app computes it from `active`. */
919
+ content: SafeHtml;
920
+ /** Whether the sidebar is collapsed (controlled). */
921
+ collapsed?: boolean;
922
+ /** Current theme; when set, a theme toggle is shown that switches to the opposite. Omit to hide it. */
923
+ theme?: 'light' | 'dark';
924
+ /** Extra header controls placed before the theme toggle (each a `ToolbarControlGroup`). */
925
+ headerActions?: SafeHtml;
926
+ /** A secondary "ecosystem" group of sections below the primary category groups. */
927
+ secondarySections?: CatalogSecondaryGroup;
928
+ /** Extra sidebar content below the category groups (and the secondary group). */
929
+ sidebarFooter?: SafeHtml;
930
+ /** Status line content shown at the start of the detail footer. */
931
+ status?: SafeHtml;
932
+ selectAction?: string;
933
+ toggleSidebarAction?: string;
934
+ toggleThemeAction?: string;
935
+ /** Action fired by the secondary group's disclosure toggle (when collapsible). */
936
+ toggleSecondaryAction?: string;
937
+ className?: string;
938
+ }
939
+ /**
940
+ * A reusable component-catalog shell: a collapsible category sidebar, a titled
941
+ * detail stage that renders the active entry's preview, and a footer with
942
+ * reference links and a related-entry popup menu. Built entirely from public
943
+ * `@kerfjs/ui` primitives. Controlled and stateless — the app owns the `active`,
944
+ * `collapsed`, and `theme` signals and computes `content` from `active` in its own
945
+ * render; wire the sidebar/collapse/theme actions with `wireCatalog`.
946
+ */
947
+ declare function Catalog({ brand, sections, active, content, collapsed, theme, headerActions, secondarySections, sidebarFooter, status, selectAction, toggleSidebarAction, toggleThemeAction, toggleSecondaryAction, className, }: CatalogProps): SafeHtml;
948
+ /**
949
+ * How a {@link CatalogExample}'s content aligns its visible left edge with the
950
+ * example's `ListHeader` label (which sits 16px in — 8px title + 8px label):
951
+ * - `'glyph'` — a bare glyph/text specimen with no inline geometry insets the full 16px.
952
+ * - `'inline-control'` — a control that already carries ~8px of its own inline padding insets 8px so its content lands on the same line.
953
+ * - `'none'` — a content-item / composition that owns its geometry and already aligns; no inset (default).
954
+ */
955
+ type CatalogExampleAlign = 'glyph' | 'inline-control' | 'none';
956
+ interface CatalogExampleProps {
957
+ /** The example's label, shown as a `ListHeader` above the specimen. Omit for a bare specimen. */
958
+ label?: string;
959
+ /** Optional explanatory note between the label and the specimen. */
960
+ note?: SafeHtml | string;
961
+ /** Alignment inset for the specimen — see {@link CatalogExampleAlign}. Default `'none'`. */
962
+ align?: CatalogExampleAlign;
963
+ className?: string;
964
+ children?: SafeHtml | readonly SafeHtml[];
965
+ }
966
+ /**
967
+ * One labeled example in a catalog preview: a `ListHeader` label, an optional
968
+ * note, and the specimen. `align` insets the specimen so its visible left edge
969
+ * lines up with the label text, encoding the catalog's alignment rules as a
970
+ * first-class prop instead of per-demo CSS. The inset is published as the
971
+ * `--kui-catalog-example-align` custom property so a debug overlay can exclude it
972
+ * from a specimen's measured margin.
973
+ */
974
+ declare function CatalogExample({ label, note, align, className, children }: CatalogExampleProps): SafeHtml;
975
+ interface CatalogExampleStackProps {
976
+ /** Accessible label for the stack region. */
977
+ label?: string;
978
+ className?: string;
979
+ children?: SafeHtml | readonly SafeHtml[];
980
+ }
981
+ /** A vertically-stacked group of {@link CatalogExample}s with the catalog's example rhythm. */
982
+ declare function CatalogExampleStack({ label, className, children }: CatalogExampleStackProps): SafeHtml;
983
+
984
+ export { Catalog, type CatalogBrand, type CatalogEntry, CatalogExample, type CatalogExampleAlign, type CatalogExampleProps, CatalogExampleStack, type CatalogExampleStackProps, type CatalogProps, type CatalogRelated, type CatalogResource, type CatalogSecondaryGroup, type CatalogSection };
985
+ ```
986
+
987
+ ## `@kerfjs/ui/wire-catalog`
988
+
989
+ ```ts
990
+ interface WireCatalogOptions {
991
+ /** Invoked with the entry id when a sidebar item or a related-entry option is chosen. */
992
+ onSelect: (id: string) => void;
993
+ /** Invoked when the sidebar collapse/expand control is activated. */
994
+ onToggleSidebar?: () => void;
995
+ /** Invoked when the theme toggle is activated. */
996
+ onToggleTheme?: () => void;
997
+ /** Invoked when the secondary (ecosystem) group's disclosure toggle is activated. */
998
+ onToggleSecondary?: () => void;
999
+ /** When set, `?<urlParam>=<id>` is written on select via `history.replaceState`. */
1000
+ urlParam?: string;
1001
+ selectAction?: string;
1002
+ toggleSidebarAction?: string;
1003
+ toggleThemeAction?: string;
1004
+ toggleSecondaryAction?: string;
1005
+ }
1006
+ /**
1007
+ * Wire a {@link Catalog}'s interactions with one delegated listener set: sidebar
1008
+ * item selection (and the related-entry popup menu), the sidebar collapse toggle, and
1009
+ * the theme toggle. The app owns the `active`/`collapsed`/`theme` signals and updates
1010
+ * them in the callbacks; optionally mirror the active id into the URL via `urlParam`.
1011
+ * Returns a disposer.
1012
+ */
1013
+ declare function wireCatalog(root: HTMLElement, { onSelect, onToggleSidebar, onToggleTheme, onToggleSecondary, urlParam, selectAction, toggleSidebarAction, toggleThemeAction, toggleSecondaryAction, }: WireCatalogOptions): () => void;
1014
+
1015
+ export { type WireCatalogOptions, wireCatalog };
1016
+ ```
1017
+
1018
+ ## `@kerfjs/ui/segmented-control`
1019
+
1020
+ ```ts
1021
+ import { SafeHtml } from 'kerfjs';
1022
+
1023
+ type SegmentedControlAppearance = 'filled' | 'outlined' | 'toolbar';
1024
+ type SegmentedControlShape = 'rounded' | 'pill';
1025
+ type SegmentedControlSize = 'small' | 'default';
1026
+ type SegmentedControlLayout = 'content' | 'equal';
1027
+ interface SegmentedControlChoice {
1028
+ value: string;
1029
+ label: string;
1030
+ content?: SafeHtml;
1031
+ title?: string;
1032
+ disabled?: boolean;
1033
+ }
1034
+ interface SegmentedControlProps {
1035
+ id: string;
1036
+ label: string;
1037
+ value: string;
1038
+ choices: readonly SegmentedControlChoice[];
1039
+ action?: string;
1040
+ appearance?: SegmentedControlAppearance;
1041
+ shape?: SegmentedControlShape;
1042
+ size?: SegmentedControlSize;
1043
+ layout?: SegmentedControlLayout;
1044
+ className?: string;
1045
+ /** Render as an unanimated loading skeleton, disabling every segment. */
1046
+ placeholder?: boolean;
1047
+ }
1048
+ declare function SegmentedControl({ id, label, value, choices, action, appearance, shape, size, layout, className, placeholder, }: SegmentedControlProps): SafeHtml;
1049
+
1050
+ export { SegmentedControl, type SegmentedControlAppearance, type SegmentedControlChoice, type SegmentedControlLayout, type SegmentedControlProps, type SegmentedControlShape, type SegmentedControlSize };
1051
+ ```
1052
+
1053
+ ## `@kerfjs/ui/state-banner`
1054
+
1055
+ ```ts
1056
+ import { SafeHtml } from 'kerfjs';
1057
+
1058
+ type StateBannerTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger';
1059
+ interface StateBannerProps {
1060
+ title: string;
1061
+ detail?: string;
1062
+ icon?: SafeHtml;
1063
+ action?: SafeHtml;
1064
+ tone?: StateBannerTone;
1065
+ urgency?: 'status' | 'alert';
1066
+ className?: string;
1067
+ /** Render the title and detail as unanimated loading skeletons, keeping the icon and tone. */
1068
+ placeholder?: boolean;
1069
+ }
1070
+ declare function StateBanner({ title, detail, icon, action, tone, urgency, className, placeholder }: StateBannerProps): SafeHtml;
1071
+
1072
+ export { StateBanner, type StateBannerProps, type StateBannerTone };
1073
+ ```
1074
+
1075
+ ## `@kerfjs/ui/empty-state`
1076
+
1077
+ ```ts
1078
+ import { SafeHtml } from 'kerfjs';
1079
+
1080
+ interface EmptyStateProps {
1081
+ title: string;
1082
+ detail?: string;
1083
+ icon?: SafeHtml;
1084
+ action?: SafeHtml;
1085
+ busy?: boolean;
1086
+ className?: string;
1087
+ }
1088
+ declare function EmptyState({ title, detail, icon, action, busy, className }: EmptyStateProps): SafeHtml;
1089
+
1090
+ export { EmptyState, type EmptyStateProps };
1091
+ ```
1092
+
1093
+ ## `@kerfjs/ui/loading-spinner`
1094
+
1095
+ ```ts
1096
+ import * as kerfjs from 'kerfjs';
1097
+
1098
+ interface LoadingSpinnerProps {
1099
+ className?: string;
1100
+ label?: string;
1101
+ }
1102
+ /** Stable viewBox-centered progress ring based on svg-spinners' MIT-licensed 180-ring. */
1103
+ declare function LoadingSpinner({ className, label }: LoadingSpinnerProps): kerfjs.SafeHtml;
1104
+
1105
+ export { LoadingSpinner, type LoadingSpinnerProps };
1106
+ ```
1107
+
1108
+ ## `@kerfjs/ui/skeleton`
1109
+
1110
+ ```ts
1111
+ import * as kerfjs from 'kerfjs';
1112
+
1113
+ interface SkeletonProps {
1114
+ /** Width as any CSS length (e.g. `remify(120px)`, `60%`). Defaults to filling its slot. */
1115
+ width?: string;
1116
+ /** Height as any CSS length. Defaults to a single text line. */
1117
+ height?: string;
1118
+ /** Corner radius override (a CSS length). Defaults to the small radius token. */
1119
+ radius?: string;
1120
+ /** Render this many stacked lines (the last one shorter), for multi-line text. */
1121
+ lines?: number;
1122
+ /** Accessible label. Omit to keep the block decorative (`aria-hidden`). */
1123
+ label?: string;
1124
+ className?: string;
1125
+ }
1126
+ /**
1127
+ * A subtle, deliberately **unanimated** loading placeholder block. Use it for a
1128
+ * value slot whose content is not yet known, on its own or via a component's
1129
+ * `placeholder` prop. Decorative by default (`aria-hidden`); pass `label` to
1130
+ * announce it. Sizes to its slot unless `width`/`height` are given.
1131
+ */
1132
+ declare function Skeleton({ width, height, radius, lines, label, className }: SkeletonProps): kerfjs.SafeHtml;
1133
+
1134
+ export { Skeleton, type SkeletonProps };
1135
+ ```
1136
+
1137
+ ## `@kerfjs/ui/token-search-field`
1138
+
1139
+ ```ts
1140
+ import { SafeHtml } from 'kerfjs';
1141
+
1142
+ interface TokenSearchToken {
1143
+ value: string;
1144
+ label: string;
1145
+ offset?: number;
1146
+ accessibleLabel?: string;
1147
+ }
1148
+ interface TokenSearchFieldProps {
1149
+ id: string;
1150
+ label: string;
1151
+ query?: string;
1152
+ tokens?: readonly TokenSearchToken[];
1153
+ placeholder?: string;
1154
+ tokenPlaceholder?: string;
1155
+ disabled?: boolean;
1156
+ autofocus?: boolean;
1157
+ /** Allow an empty field to render as one iconic action. */
1158
+ collapsible?: boolean;
1159
+ /** Keep an empty collapsible field open while the application owns focus. */
1160
+ expanded?: boolean;
1161
+ expandAction?: string;
1162
+ expandLabel?: string;
1163
+ leading?: SafeHtml;
1164
+ trailing?: SafeHtml;
1165
+ editAction?: string;
1166
+ removeAction?: string;
1167
+ clearAction?: string;
1168
+ clearLabel?: string;
1169
+ className?: string;
1170
+ editorAttributes?: Readonly<Record<`data-${string}`, string>>;
1171
+ }
1172
+ interface TokenSearchFieldValue {
1173
+ query: string;
1174
+ tokens: TokenSearchToken[];
1175
+ }
1176
+ declare function TokenSearchField({ id, label, query, tokens, placeholder, tokenPlaceholder, disabled, autofocus, collapsible, expanded, expandAction, expandLabel, leading, trailing, editAction, removeAction, clearAction, clearLabel, className, editorAttributes, }: TokenSearchFieldProps): SafeHtml;
1177
+ /** Read editable text and ordered token offsets from a rendered TokenSearchField editor. */
1178
+ declare function readTokenSearchField(editor: HTMLElement, knownTokens?: readonly TokenSearchToken[]): TokenSearchFieldValue;
1179
+ /** Focus an editor and place its caret at a text offset, skipping atomic token chips. */
1180
+ declare function placeTokenSearchCaret(editor: HTMLElement, offset?: number): void;
1181
+
1182
+ export { TokenSearchField, type TokenSearchFieldProps, type TokenSearchFieldValue, type TokenSearchToken, placeTokenSearchCaret, readTokenSearchField };
1183
+ ```
1184
+
1185
+ ## `@kerfjs/ui/wire-token-search-fields`
1186
+
1187
+ ```ts
1188
+ import { Signal } from 'kerfjs';
1189
+
1190
+ interface TokenSearchSubmit {
1191
+ id: string;
1192
+ editor: HTMLElement;
1193
+ }
1194
+ /** Reported to {@link WireTokenSearchFieldsOptions.onEdit} on every editor input. */
1195
+ interface TokenSearchEdit extends TokenSearchSubmit {
1196
+ /**
1197
+ * The `InputEvent` that mutated the editor — read `event.inputType` / `event.data`
1198
+ * to gate commit behavior (e.g. only parse a chip on whitespace-terminated input)
1199
+ * without keeping a separate `input` listener.
1200
+ */
1201
+ event: InputEvent;
1202
+ }
1203
+ /** Reported when adjacent-token keyboard deletion asks the app to drop a chip. */
1204
+ interface TokenSearchTokenRemoval {
1205
+ id: string;
1206
+ /** The `data-token-value` of the token the app should remove from its state. */
1207
+ value: string;
1208
+ editor: HTMLElement;
1209
+ /** `'backward'` = the token before the caret (Backspace); `'forward'` = after (Delete). */
1210
+ direction: 'backward' | 'forward';
1211
+ }
1212
+ /**
1213
+ * Opt-in keyboard behavior for the atomic token chips. Off unless `keyboard` is
1214
+ * set; each piece defaults on once opted in. The helper never mutates app state:
1215
+ * a removal is reported through {@link TokenSearchKeyboardOptions.onRemoveToken}
1216
+ * for the caller to apply, while caret movement past a chip is a pure ephemeral
1217
+ * mechanic the helper performs itself.
1218
+ */
1219
+ interface TokenSearchKeyboardOptions {
1220
+ /**
1221
+ * From a collapsed caret with no selection, Backspace removes the token
1222
+ * immediately before it and Delete the token immediately after — reported via
1223
+ * `onRemoveToken` — instead of deleting a character. Default: true.
1224
+ */
1225
+ removeAdjacentToken?: boolean;
1226
+ /**
1227
+ * ArrowRight moves the caret past a trailing atomic token so text typed next
1228
+ * lands after the chip. Default: true.
1229
+ */
1230
+ moveCaretPastToken?: boolean;
1231
+ /** Apply the reported removal to your controlled state, then re-render. */
1232
+ onRemoveToken?: (removal: TokenSearchTokenRemoval) => void;
1233
+ }
1234
+ /**
1235
+ * Managed collapsible behavior for the iconic TokenSearchField. Every piece is on
1236
+ * by default; disable a specific one to own it in the app. Provide `signals` to
1237
+ * drive app-owned `expanded` signals per field id instead of helper-created ones.
1238
+ */
1239
+ interface TokenSearchCollapsibleOptions {
1240
+ /** Expand the field and focus its editor when the iconic trigger is activated. Default: true. */
1241
+ expandOnActivate?: boolean;
1242
+ /** Collapse the field when focus leaves it while it is empty. Default: true. */
1243
+ collapseOnEmptyBlur?: boolean;
1244
+ /** Collapse an empty field on Escape and restore focus to its trigger. Default: true. */
1245
+ collapseOnEscape?: boolean;
1246
+ /** Focus the editor on expand and the trigger on Escape-collapse. Default: true. */
1247
+ manageFocus?: boolean;
1248
+ /**
1249
+ * Keep an empty field expanded when focus moves to a caller-owned surface
1250
+ * rendered outside the field — a suggestions dropdown, date picker, or help
1251
+ * popover shown beside it. Return true for any focus target that must NOT
1252
+ * trigger collapse-on-empty-blur. An element carrying `data-token-search-keep-open`
1253
+ * (or any node inside one) is always exempt, so this predicate is only needed
1254
+ * for surfaces you cannot mark declaratively.
1255
+ */
1256
+ keepOpenOn?: (target: Node | null) => boolean;
1257
+ /** App-owned `expanded` signals keyed by field id; adopted instead of helper-created. */
1258
+ signals?: Readonly<Record<string, Signal<boolean>>>;
1259
+ }
1260
+ interface WireTokenSearchFieldsOptions {
1261
+ onSubmit?: (submission: TokenSearchSubmit) => void;
1262
+ /** Fired on every editor `input`, after the browser mutates it, so a caller can drop its own `input` listener. */
1263
+ onEdit?: (edit: TokenSearchEdit) => void;
1264
+ /** Managed collapsible transient behavior. `true`/omitted = on with defaults; `false` = fully off. */
1265
+ collapsible?: boolean | TokenSearchCollapsibleOptions;
1266
+ /** Opt-in atomic-chip keyboard behavior (off by default). `true` = on with defaults. */
1267
+ keyboard?: boolean | TokenSearchKeyboardOptions;
1268
+ }
1269
+ /**
1270
+ * The value returned from {@link wireTokenSearchFields}: call it (or `dispose()`) to
1271
+ * tear down. When collapsible behavior is managed, it also exposes the transient
1272
+ * `expanded` state per field id so the app can read it in render, hand in its own
1273
+ * signal, or drive it imperatively.
1274
+ */
1275
+ interface TokenSearchFieldsHandle {
1276
+ (): void;
1277
+ dispose(): void;
1278
+ /** The managed `expanded` signal for a field id (adopted or helper-created); undefined when unmanaged. */
1279
+ expanded(id: string): Signal<boolean> | undefined;
1280
+ /** Expand the field (and, when focus is managed, focus its editor). */
1281
+ open(id: string): void;
1282
+ /** Collapse the field (and, when focus is managed, restore focus to its trigger). */
1283
+ close(id: string): void;
1284
+ }
1285
+ /**
1286
+ * Wire every TokenSearchField under `root`: submit on Enter, preserve the caret across
1287
+ * controlled token deletion, and (by default) manage the collapsible field's transient
1288
+ * expand/collapse/focus. Returns a {@link TokenSearchFieldsHandle} — a disposer that also
1289
+ * exposes the managed `expanded` state per field id.
1290
+ */
1291
+ declare function wireTokenSearchFields(root: HTMLElement, { onSubmit, onEdit, collapsible, keyboard }?: WireTokenSearchFieldsOptions): TokenSearchFieldsHandle;
1292
+
1293
+ export { type TokenSearchCollapsibleOptions, type TokenSearchEdit, type TokenSearchFieldsHandle, type TokenSearchKeyboardOptions, type TokenSearchSubmit, type TokenSearchTokenRemoval, type WireTokenSearchFieldsOptions, wireTokenSearchFields };
1294
+ ```
1295
+
1296
+ ## `kerfjs/actions`
1297
+
1298
+ ```ts
1299
+ import { A as AttrSpec } from './attrSelector-Cmu2ZoGO.js';
1300
+ import { D as DelegateOptions } from './delegate-CL9VTZFb.js';
1301
+
1302
+ /**
1303
+ * `kerfjs/actions` — the delegated action-table helper.
1304
+ *
1305
+ * The most-reinvented idiom across real kerf apps: one table of `data-action`
1306
+ * attribute specs used as the single source of truth for BOTH the JSX attribute
1307
+ * and the delegate selector, plus a hand-rolled `switch (dataset.action)`
1308
+ * dispatcher. This subpath blesses it as two thin helpers over the existing
1309
+ * `attr()` + `delegate()` — it does NOT replace them.
1310
+ *
1311
+ * import { action, delegateActions } from 'kerfjs/actions';
1312
+ *
1313
+ * const A = {
1314
+ * select: action('select-file'),
1315
+ * remove: action('remove-file'),
1316
+ * };
1317
+ *
1318
+ * // JSX — spread the attr (rename-safe; no hardcoded attribute name):
1319
+ * // <button {...A.select.attrs} data-id={id}>…</button>
1320
+ *
1321
+ * // Wire the whole table with ONE delegated listener; returns a disposer:
1322
+ * const dispose = delegateActions(root, 'click', {
1323
+ * [A.select.value]: (_e, el) => selectFile(el.getAttribute('data-id')),
1324
+ * [A.remove.value]: (_e, el) => removeFile(el.getAttribute('data-id')),
1325
+ * });
1326
+ *
1327
+ * Contract: `delegateActions` returns a `() => void` disposer and holds no
1328
+ * per-instance state — the same shape as `delegate()`, which it builds on (so
1329
+ * it inherits the single-listener dispatch and the capture auto-promotion for
1330
+ * well-known non-bubbling event types). One event type per call, mirroring
1331
+ * `delegate()`; collect the disposers for a root that needs several.
1332
+ */
1333
+
1334
+ /**
1335
+ * A handler in a {@link delegateActions} table. Receives the DOM event and the
1336
+ * matched element (walk-up `closest()` match by default) — the same shape as a
1337
+ * `delegate()` handler.
1338
+ */
1339
+ type ActionHandler<E extends Element = Element> = (event: Event, el: E) => void;
1340
+ /**
1341
+ * `action(value)` — an {@link AttrSpec} on `data-action`. A thin specialization
1342
+ * of `attr('data-action', value)`: spread its `.attrs` in JSX and use its
1343
+ * `.value` as the handler-table key, so the action name lives in exactly one
1344
+ * place and can't drift between the markup and the dispatcher.
1345
+ */
1346
+ declare function action<V extends string>(value: V): AttrSpec<'data-action', V>;
1347
+ /** Options for {@link delegateActions}. Extends {@link DelegateOptions}. */
1348
+ interface DelegateActionsOptions extends DelegateOptions {
1349
+ /**
1350
+ * The attribute the table keys on. Default `'data-action'`. Override it only
1351
+ * if you also author the specs with `attr(yourName, …)` instead of `action()`.
1352
+ */
1353
+ attr?: string;
1354
+ }
1355
+ /**
1356
+ * Wire a whole table of action handlers with ONE delegated listener.
1357
+ *
1358
+ * On `eventType`, the nearest element carrying the action attribute (walk-up
1359
+ * `closest()` by default; pass `{ match: 'direct' }` for an exact-element match)
1360
+ * is looked up in `table` by its attribute value, and the matching handler
1361
+ * runs. An element whose action is absent from the table is ignored — the same
1362
+ * behavior as a `switch (dataset.action)` with no matching `case`.
1363
+ *
1364
+ * Returns a `() => void` disposer. One event type per call (the smallest
1365
+ * surface, mirroring `delegate()`); collect the disposers when a root needs
1366
+ * several event types.
1367
+ */
1368
+ declare function delegateActions<E extends Element = Element>(root: HTMLElement, eventType: string, table: Readonly<Record<string, ActionHandler<E>>>, options?: DelegateActionsOptions): () => void;
1369
+
1370
+ export { type ActionHandler, type DelegateActionsOptions, action, delegateActions };
1371
+ ```