@rezi-ui/core 0.1.0-alpha.60 → 0.1.0-alpha.63

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 (345) hide show
  1. package/dist/app/createApp/breadcrumbs.d.ts +38 -0
  2. package/dist/app/createApp/breadcrumbs.d.ts.map +1 -0
  3. package/dist/app/createApp/breadcrumbs.js +65 -0
  4. package/dist/app/createApp/breadcrumbs.js.map +1 -0
  5. package/dist/app/createApp/config.d.ts +25 -0
  6. package/dist/app/createApp/config.d.ts.map +1 -0
  7. package/dist/app/createApp/config.js +130 -0
  8. package/dist/app/createApp/config.js.map +1 -0
  9. package/dist/app/createApp/eventLoop.d.ts +95 -0
  10. package/dist/app/createApp/eventLoop.d.ts.map +1 -0
  11. package/dist/app/createApp/eventLoop.js +384 -0
  12. package/dist/app/createApp/eventLoop.js.map +1 -0
  13. package/dist/app/createApp/guards.d.ts +21 -0
  14. package/dist/app/createApp/guards.d.ts.map +1 -0
  15. package/dist/app/createApp/guards.js +54 -0
  16. package/dist/app/createApp/guards.js.map +1 -0
  17. package/dist/app/createApp/keybindings.d.ts +28 -0
  18. package/dist/app/createApp/keybindings.d.ts.map +1 -0
  19. package/dist/app/createApp/keybindings.js +113 -0
  20. package/dist/app/createApp/keybindings.js.map +1 -0
  21. package/dist/app/createApp/renderLoop.d.ts +64 -0
  22. package/dist/app/createApp/renderLoop.d.ts.map +1 -0
  23. package/dist/app/createApp/renderLoop.js +305 -0
  24. package/dist/app/createApp/renderLoop.js.map +1 -0
  25. package/dist/app/createApp.d.ts +3 -39
  26. package/dist/app/createApp.d.ts.map +1 -1
  27. package/dist/app/createApp.js +403 -1205
  28. package/dist/app/createApp.js.map +1 -1
  29. package/dist/app/widgetRenderer/constraintState.d.ts +98 -0
  30. package/dist/app/widgetRenderer/constraintState.d.ts.map +1 -0
  31. package/dist/app/widgetRenderer/constraintState.js +563 -0
  32. package/dist/app/widgetRenderer/constraintState.js.map +1 -0
  33. package/dist/app/widgetRenderer/fileNodeCache.d.ts +2 -0
  34. package/dist/app/widgetRenderer/fileNodeCache.d.ts.map +1 -1
  35. package/dist/app/widgetRenderer/fileNodeCache.js +31 -0
  36. package/dist/app/widgetRenderer/fileNodeCache.js.map +1 -1
  37. package/dist/app/widgetRenderer/filePickerRouting.d.ts +12 -1
  38. package/dist/app/widgetRenderer/filePickerRouting.d.ts.map +1 -1
  39. package/dist/app/widgetRenderer/filePickerRouting.js +63 -14
  40. package/dist/app/widgetRenderer/filePickerRouting.js.map +1 -1
  41. package/dist/app/widgetRenderer/focusState.d.ts +46 -0
  42. package/dist/app/widgetRenderer/focusState.d.ts.map +1 -0
  43. package/dist/app/widgetRenderer/focusState.js +122 -0
  44. package/dist/app/widgetRenderer/focusState.js.map +1 -0
  45. package/dist/app/widgetRenderer/keyboardRouting.d.ts.map +1 -1
  46. package/dist/app/widgetRenderer/keyboardRouting.js.map +1 -1
  47. package/dist/app/widgetRenderer/mouseRouting.d.ts +5 -0
  48. package/dist/app/widgetRenderer/mouseRouting.d.ts.map +1 -1
  49. package/dist/app/widgetRenderer/mouseRouting.js +78 -8
  50. package/dist/app/widgetRenderer/mouseRouting.js.map +1 -1
  51. package/dist/app/widgetRenderer/overlayShortcuts.d.ts.map +1 -1
  52. package/dist/app/widgetRenderer/overlayShortcuts.js +14 -4
  53. package/dist/app/widgetRenderer/overlayShortcuts.js.map +1 -1
  54. package/dist/app/widgetRenderer/overlayState.d.ts +198 -0
  55. package/dist/app/widgetRenderer/overlayState.d.ts.map +1 -0
  56. package/dist/app/widgetRenderer/overlayState.js +590 -0
  57. package/dist/app/widgetRenderer/overlayState.js.map +1 -0
  58. package/dist/app/widgetRenderer/routeEngineEvent.d.ts +189 -0
  59. package/dist/app/widgetRenderer/routeEngineEvent.d.ts.map +1 -0
  60. package/dist/app/widgetRenderer/routeEngineEvent.js +527 -0
  61. package/dist/app/widgetRenderer/routeEngineEvent.js.map +1 -0
  62. package/dist/app/widgetRenderer.d.ts +2 -1
  63. package/dist/app/widgetRenderer.d.ts.map +1 -1
  64. package/dist/app/widgetRenderer.js +334 -1707
  65. package/dist/app/widgetRenderer.js.map +1 -1
  66. package/dist/forms/internal/arrayState.d.ts +35 -0
  67. package/dist/forms/internal/arrayState.d.ts.map +1 -0
  68. package/dist/forms/internal/arrayState.js +238 -0
  69. package/dist/forms/internal/arrayState.js.map +1 -0
  70. package/dist/forms/internal/bindings.d.ts +46 -0
  71. package/dist/forms/internal/bindings.d.ts.map +1 -0
  72. package/dist/forms/internal/bindings.js +161 -0
  73. package/dist/forms/internal/bindings.js.map +1 -0
  74. package/dist/forms/internal/dev.d.ts +4 -0
  75. package/dist/forms/internal/dev.d.ts.map +1 -0
  76. package/dist/forms/internal/dev.js +21 -0
  77. package/dist/forms/internal/dev.js.map +1 -0
  78. package/dist/forms/internal/state.d.ts +52 -0
  79. package/dist/forms/internal/state.d.ts.map +1 -0
  80. package/dist/forms/internal/state.js +240 -0
  81. package/dist/forms/internal/state.js.map +1 -0
  82. package/dist/forms/internal/submit.d.ts +43 -0
  83. package/dist/forms/internal/submit.d.ts.map +1 -0
  84. package/dist/forms/internal/submit.js +165 -0
  85. package/dist/forms/internal/submit.js.map +1 -0
  86. package/dist/forms/internal/wizard.d.ts +53 -0
  87. package/dist/forms/internal/wizard.d.ts.map +1 -0
  88. package/dist/forms/internal/wizard.js +311 -0
  89. package/dist/forms/internal/wizard.js.map +1 -0
  90. package/dist/forms/useForm.d.ts.map +1 -1
  91. package/dist/forms/useForm.js +90 -1117
  92. package/dist/forms/useForm.js.map +1 -1
  93. package/dist/index.d.ts +1 -1
  94. package/dist/index.d.ts.map +1 -1
  95. package/dist/index.js +1 -1
  96. package/dist/index.js.map +1 -1
  97. package/dist/keybindings/manager.d.ts.map +1 -1
  98. package/dist/keybindings/manager.js.map +1 -1
  99. package/dist/keybindings/parser.d.ts.map +1 -1
  100. package/dist/keybindings/parser.js +10 -5
  101. package/dist/keybindings/parser.js.map +1 -1
  102. package/dist/layout/dropdownGeometry.d.ts +8 -0
  103. package/dist/layout/dropdownGeometry.d.ts.map +1 -1
  104. package/dist/layout/dropdownGeometry.js +40 -0
  105. package/dist/layout/dropdownGeometry.js.map +1 -1
  106. package/dist/layout/engine/layoutEngine.js +1 -1
  107. package/dist/layout/engine/layoutEngine.js.map +1 -1
  108. package/dist/layout/kinds/overlays.d.ts.map +1 -1
  109. package/dist/layout/kinds/stack.d.ts +1 -3
  110. package/dist/layout/kinds/stack.d.ts.map +1 -1
  111. package/dist/layout/kinds/stack.js +11 -1523
  112. package/dist/layout/kinds/stack.js.map +1 -1
  113. package/dist/layout/kinds/stackParts/axis.d.ts +32 -0
  114. package/dist/layout/kinds/stackParts/axis.d.ts.map +1 -0
  115. package/dist/layout/kinds/stackParts/axis.js +61 -0
  116. package/dist/layout/kinds/stackParts/axis.js.map +1 -0
  117. package/dist/layout/kinds/stackParts/constraintPlan.d.ts +18 -0
  118. package/dist/layout/kinds/stackParts/constraintPlan.d.ts.map +1 -0
  119. package/dist/layout/kinds/stackParts/constraintPlan.js +434 -0
  120. package/dist/layout/kinds/stackParts/constraintPlan.js.map +1 -0
  121. package/dist/layout/kinds/stackParts/layout.d.ts +6 -0
  122. package/dist/layout/kinds/stackParts/layout.d.ts.map +1 -0
  123. package/dist/layout/kinds/stackParts/layout.js +376 -0
  124. package/dist/layout/kinds/stackParts/layout.js.map +1 -0
  125. package/dist/layout/kinds/stackParts/measure.d.ts +6 -0
  126. package/dist/layout/kinds/stackParts/measure.d.ts.map +1 -0
  127. package/dist/layout/kinds/stackParts/measure.js +212 -0
  128. package/dist/layout/kinds/stackParts/measure.js.map +1 -0
  129. package/dist/layout/kinds/stackParts/shared.d.ts +31 -0
  130. package/dist/layout/kinds/stackParts/shared.d.ts.map +1 -0
  131. package/dist/layout/kinds/stackParts/shared.js +94 -0
  132. package/dist/layout/kinds/stackParts/shared.js.map +1 -0
  133. package/dist/layout/kinds/stackParts/wrap.d.ts +26 -0
  134. package/dist/layout/kinds/stackParts/wrap.d.ts.map +1 -0
  135. package/dist/layout/kinds/stackParts/wrap.js +374 -0
  136. package/dist/layout/kinds/stackParts/wrap.js.map +1 -0
  137. package/dist/layout/validate/interactive.d.ts +106 -0
  138. package/dist/layout/validate/interactive.d.ts.map +1 -0
  139. package/dist/layout/validate/interactive.js +430 -0
  140. package/dist/layout/validate/interactive.js.map +1 -0
  141. package/dist/layout/validate/layoutConstraints.d.ts +51 -0
  142. package/dist/layout/validate/layoutConstraints.d.ts.map +1 -0
  143. package/dist/layout/validate/layoutConstraints.js +100 -0
  144. package/dist/layout/validate/layoutConstraints.js.map +1 -0
  145. package/dist/layout/validate/primitives.d.ts +31 -0
  146. package/dist/layout/validate/primitives.d.ts.map +1 -0
  147. package/dist/layout/validate/primitives.js +299 -0
  148. package/dist/layout/validate/primitives.js.map +1 -0
  149. package/dist/layout/validate/shared.d.ts +23 -0
  150. package/dist/layout/validate/shared.d.ts.map +1 -0
  151. package/dist/layout/validate/shared.js +32 -0
  152. package/dist/layout/validate/shared.js.map +1 -0
  153. package/dist/layout/validate/spacing.d.ts +21 -0
  154. package/dist/layout/validate/spacing.d.ts.map +1 -0
  155. package/dist/layout/validate/spacing.js +33 -0
  156. package/dist/layout/validate/spacing.js.map +1 -0
  157. package/dist/layout/validateProps.d.ts +5 -159
  158. package/dist/layout/validateProps.d.ts.map +1 -1
  159. package/dist/layout/validateProps.js +1 -832
  160. package/dist/layout/validateProps.js.map +1 -1
  161. package/dist/pipeline.js +1 -1
  162. package/dist/pipeline.js.map +1 -1
  163. package/dist/renderer/renderToDrawlist/renderTree.d.ts +1 -1
  164. package/dist/renderer/renderToDrawlist/renderTree.d.ts.map +1 -1
  165. package/dist/renderer/renderToDrawlist/renderTree.js +3 -3
  166. package/dist/renderer/renderToDrawlist/renderTree.js.map +1 -1
  167. package/dist/renderer/renderToDrawlist/types.d.ts +2 -0
  168. package/dist/renderer/renderToDrawlist/types.d.ts.map +1 -1
  169. package/dist/renderer/renderToDrawlist/widgets/containers.d.ts.map +1 -1
  170. package/dist/renderer/renderToDrawlist/widgets/containers.js +1 -1
  171. package/dist/renderer/renderToDrawlist/widgets/containers.js.map +1 -1
  172. package/dist/renderer/renderToDrawlist/widgets/files.d.ts +2 -1
  173. package/dist/renderer/renderToDrawlist/widgets/files.d.ts.map +1 -1
  174. package/dist/renderer/renderToDrawlist/widgets/files.js +30 -3
  175. package/dist/renderer/renderToDrawlist/widgets/files.js.map +1 -1
  176. package/dist/renderer/renderToDrawlist/widgets/overlays.d.ts +1 -1
  177. package/dist/renderer/renderToDrawlist/widgets/overlays.d.ts.map +1 -1
  178. package/dist/renderer/renderToDrawlist/widgets/overlays.js +26 -6
  179. package/dist/renderer/renderToDrawlist/widgets/overlays.js.map +1 -1
  180. package/dist/renderer/renderToDrawlist/widgets/renderFormWidgets.d.ts.map +1 -1
  181. package/dist/renderer/renderToDrawlist/widgets/renderFormWidgets.js +52 -18
  182. package/dist/renderer/renderToDrawlist/widgets/renderFormWidgets.js.map +1 -1
  183. package/dist/renderer/renderToDrawlist.d.ts +0 -8
  184. package/dist/renderer/renderToDrawlist.d.ts.map +1 -1
  185. package/dist/renderer/renderToDrawlist.js +1 -9
  186. package/dist/renderer/renderToDrawlist.js.map +1 -1
  187. package/dist/runtime/commit/composite.d.ts +11 -0
  188. package/dist/runtime/commit/composite.d.ts.map +1 -0
  189. package/dist/runtime/commit/composite.js +238 -0
  190. package/dist/runtime/commit/composite.js.map +1 -0
  191. package/dist/runtime/commit/container.d.ts +7 -0
  192. package/dist/runtime/commit/container.d.ts.map +1 -0
  193. package/dist/runtime/commit/container.js +350 -0
  194. package/dist/runtime/commit/container.js.map +1 -0
  195. package/dist/runtime/commit/equality.d.ts +20 -0
  196. package/dist/runtime/commit/equality.d.ts.map +1 -0
  197. package/dist/runtime/commit/equality.js +436 -0
  198. package/dist/runtime/commit/equality.js.map +1 -0
  199. package/dist/runtime/commit/errorBoundary.d.ts +7 -0
  200. package/dist/runtime/commit/errorBoundary.d.ts.map +1 -0
  201. package/dist/runtime/commit/errorBoundary.js +53 -0
  202. package/dist/runtime/commit/errorBoundary.js.map +1 -0
  203. package/dist/runtime/commit/shared.d.ts +138 -0
  204. package/dist/runtime/commit/shared.d.ts.map +1 -0
  205. package/dist/runtime/commit/shared.js +11 -0
  206. package/dist/runtime/commit/shared.js.map +1 -0
  207. package/dist/runtime/commit/transitions.d.ts +9 -0
  208. package/dist/runtime/commit/transitions.d.ts.map +1 -0
  209. package/dist/runtime/commit/transitions.js +93 -0
  210. package/dist/runtime/commit/transitions.js.map +1 -0
  211. package/dist/runtime/commit/validation.d.ts +16 -0
  212. package/dist/runtime/commit/validation.d.ts.map +1 -0
  213. package/dist/runtime/commit/validation.js +157 -0
  214. package/dist/runtime/commit/validation.js.map +1 -0
  215. package/dist/runtime/commit.d.ts +7 -117
  216. package/dist/runtime/commit.d.ts.map +1 -1
  217. package/dist/runtime/commit.js +13 -1394
  218. package/dist/runtime/commit.js.map +1 -1
  219. package/dist/runtime/localState.d.ts +4 -0
  220. package/dist/runtime/localState.d.ts.map +1 -1
  221. package/dist/runtime/localState.js.map +1 -1
  222. package/dist/runtime/widgetMeta/collector.d.ts +77 -0
  223. package/dist/runtime/widgetMeta/collector.d.ts.map +1 -0
  224. package/dist/runtime/widgetMeta/collector.js +293 -0
  225. package/dist/runtime/widgetMeta/collector.js.map +1 -0
  226. package/dist/runtime/widgetMeta/focusContainers.d.ts +44 -0
  227. package/dist/runtime/widgetMeta/focusContainers.d.ts.map +1 -0
  228. package/dist/runtime/widgetMeta/focusContainers.js +190 -0
  229. package/dist/runtime/widgetMeta/focusContainers.js.map +1 -0
  230. package/dist/runtime/widgetMeta/focusInfo.d.ts +19 -0
  231. package/dist/runtime/widgetMeta/focusInfo.d.ts.map +1 -0
  232. package/dist/runtime/widgetMeta/focusInfo.js +172 -0
  233. package/dist/runtime/widgetMeta/focusInfo.js.map +1 -0
  234. package/dist/runtime/widgetMeta/helpers.d.ts +47 -0
  235. package/dist/runtime/widgetMeta/helpers.d.ts.map +1 -0
  236. package/dist/runtime/widgetMeta/helpers.js +182 -0
  237. package/dist/runtime/widgetMeta/helpers.js.map +1 -0
  238. package/dist/runtime/widgetMeta.d.ts +12 -175
  239. package/dist/runtime/widgetMeta.d.ts.map +1 -1
  240. package/dist/runtime/widgetMeta.js +6 -847
  241. package/dist/runtime/widgetMeta.js.map +1 -1
  242. package/dist/ui/capabilities.d.ts.map +1 -1
  243. package/dist/ui/designTokens.d.ts.map +1 -1
  244. package/dist/widgets/accordion.d.ts.map +1 -1
  245. package/dist/widgets/accordion.js +8 -13
  246. package/dist/widgets/accordion.js.map +1 -1
  247. package/dist/widgets/factories/advanced.d.ts +20 -0
  248. package/dist/widgets/factories/advanced.d.ts.map +1 -0
  249. package/dist/widgets/factories/advanced.js +75 -0
  250. package/dist/widgets/factories/advanced.js.map +1 -0
  251. package/dist/widgets/factories/basic.d.ts +14 -0
  252. package/dist/widgets/factories/basic.d.ts.map +1 -0
  253. package/dist/widgets/factories/basic.js +44 -0
  254. package/dist/widgets/factories/basic.js.map +1 -0
  255. package/dist/widgets/factories/feedback.d.ts +20 -0
  256. package/dist/widgets/factories/feedback.d.ts.map +1 -0
  257. package/dist/widgets/factories/feedback.js +102 -0
  258. package/dist/widgets/factories/feedback.js.map +1 -0
  259. package/dist/widgets/factories/helpers.d.ts +41 -0
  260. package/dist/widgets/factories/helpers.d.ts.map +1 -0
  261. package/dist/widgets/factories/helpers.js +72 -0
  262. package/dist/widgets/factories/helpers.js.map +1 -0
  263. package/dist/widgets/factories/interactive.d.ts +15 -0
  264. package/dist/widgets/factories/interactive.d.ts.map +1 -0
  265. package/dist/widgets/factories/interactive.js +46 -0
  266. package/dist/widgets/factories/interactive.js.map +1 -0
  267. package/dist/widgets/factories/layoutShell.d.ts +22 -0
  268. package/dist/widgets/factories/layoutShell.d.ts.map +1 -0
  269. package/dist/widgets/factories/layoutShell.js +190 -0
  270. package/dist/widgets/factories/layoutShell.js.map +1 -0
  271. package/dist/widgets/factories/media.d.ts +14 -0
  272. package/dist/widgets/factories/media.d.ts.map +1 -0
  273. package/dist/widgets/factories/media.js +25 -0
  274. package/dist/widgets/factories/media.js.map +1 -0
  275. package/dist/widgets/factories/navigation.d.ts +10 -0
  276. package/dist/widgets/factories/navigation.d.ts.map +1 -0
  277. package/dist/widgets/factories/navigation.js +24 -0
  278. package/dist/widgets/factories/navigation.js.map +1 -0
  279. package/dist/widgets/field.d.ts +6 -1
  280. package/dist/widgets/field.d.ts.map +1 -1
  281. package/dist/widgets/field.js +8 -2
  282. package/dist/widgets/field.js.map +1 -1
  283. package/dist/widgets/filePicker.d.ts +5 -0
  284. package/dist/widgets/filePicker.d.ts.map +1 -0
  285. package/dist/widgets/filePicker.js +136 -0
  286. package/dist/widgets/filePicker.js.map +1 -0
  287. package/dist/widgets/protocol.d.ts +0 -6
  288. package/dist/widgets/protocol.d.ts.map +1 -1
  289. package/dist/widgets/protocol.js +0 -6
  290. package/dist/widgets/protocol.js.map +1 -1
  291. package/dist/widgets/select.js +1 -1
  292. package/dist/widgets/select.js.map +1 -1
  293. package/dist/widgets/splitPane.d.ts.map +1 -1
  294. package/dist/widgets/splitPane.js.map +1 -1
  295. package/dist/widgets/table.d.ts.map +1 -1
  296. package/dist/widgets/table.js +43 -1
  297. package/dist/widgets/table.js.map +1 -1
  298. package/dist/widgets/tree.d.ts.map +1 -1
  299. package/dist/widgets/types/advanced.d.ts +611 -0
  300. package/dist/widgets/types/advanced.d.ts.map +1 -0
  301. package/dist/widgets/types/advanced.js +2 -0
  302. package/dist/widgets/types/advanced.js.map +1 -0
  303. package/dist/widgets/types/base.d.ts +933 -0
  304. package/dist/widgets/types/base.d.ts.map +1 -0
  305. package/dist/widgets/types/base.js +2 -0
  306. package/dist/widgets/types/base.js.map +1 -0
  307. package/dist/widgets/types/forms.d.ts +136 -0
  308. package/dist/widgets/types/forms.d.ts.map +1 -0
  309. package/dist/widgets/types/forms.js +2 -0
  310. package/dist/widgets/types/forms.js.map +1 -0
  311. package/dist/widgets/types/navigation.d.ts +83 -0
  312. package/dist/widgets/types/navigation.d.ts.map +1 -0
  313. package/dist/widgets/types/navigation.js +2 -0
  314. package/dist/widgets/types/navigation.js.map +1 -0
  315. package/dist/widgets/types/overlaysShell.d.ts +223 -0
  316. package/dist/widgets/types/overlaysShell.d.ts.map +1 -0
  317. package/dist/widgets/types/overlaysShell.js +2 -0
  318. package/dist/widgets/types/overlaysShell.js.map +1 -0
  319. package/dist/widgets/types/table.d.ts +104 -0
  320. package/dist/widgets/types/table.d.ts.map +1 -0
  321. package/dist/widgets/types/table.js +2 -0
  322. package/dist/widgets/types/table.js.map +1 -0
  323. package/dist/widgets/types/tree.d.ts +64 -0
  324. package/dist/widgets/types/tree.d.ts.map +1 -0
  325. package/dist/widgets/types/tree.js +2 -0
  326. package/dist/widgets/types/tree.js.map +1 -0
  327. package/dist/widgets/types.d.ts +14 -2123
  328. package/dist/widgets/types.d.ts.map +1 -1
  329. package/dist/widgets/ui.d.ts +37 -843
  330. package/dist/widgets/ui.d.ts.map +1 -1
  331. package/dist/widgets/ui.js +37 -1262
  332. package/dist/widgets/ui.js.map +1 -1
  333. package/package.json +2 -2
  334. package/dist/constraints/aggregation.d.ts +0 -17
  335. package/dist/constraints/aggregation.d.ts.map +0 -1
  336. package/dist/constraints/aggregation.js +0 -59
  337. package/dist/constraints/aggregation.js.map +0 -1
  338. package/dist/renderer/renderToDrawlist/overflowCulling.d.ts +0 -3
  339. package/dist/renderer/renderToDrawlist/overflowCulling.d.ts.map +0 -1
  340. package/dist/renderer/renderToDrawlist/overflowCulling.js +0 -81
  341. package/dist/renderer/renderToDrawlist/overflowCulling.js.map +0 -1
  342. package/dist/widgets/tests/protocol.test.d.ts +0 -2
  343. package/dist/widgets/tests/protocol.test.d.ts.map +0 -1
  344. package/dist/widgets/tests/protocol.test.js +0 -120
  345. package/dist/widgets/tests/protocol.test.js.map +0 -1
@@ -16,2128 +16,20 @@
16
16
  *
17
17
  * @see docs/widgets/index.md
18
18
  */
19
- import type { EasingInput } from "../animation/types.js";
20
- import type { FocusConfig } from "../focus/styles.js";
21
- import type { SpacingValue } from "../layout/spacing-scale.js";
22
- import type { DisplayConstraint, LayoutConstraints, SizeConstraint, SizeConstraintAtom } from "../layout/types.js";
23
- import type { InstanceId } from "../runtime/instance.js";
24
- import type { ThemeOverrides } from "../theme/extend.js";
25
- import type { ThemeDefinition } from "../theme/tokens.js";
26
- import type { WidgetSize, WidgetTone, WidgetVariant } from "../ui/designTokens.js";
27
- import type { TextStyle } from "./style.js";
28
- /** Cross-axis alignment for stack layouts. */
29
- export type Align = "start" | "center" | "end" | "stretch";
30
- export type Overflow = "visible" | "hidden" | "scroll";
31
- /**
32
- * Spacing props for padding and margin.
33
- * Accepts either a number (cells) or a spacing key ("xs", "sm", "md", "lg", "xl", "2xl").
34
- */
35
- export type SpacingProps = Readonly<{
36
- /** All sides padding */
37
- p?: SpacingValue;
38
- /** Horizontal padding */
39
- px?: SpacingValue;
40
- /** Vertical padding */
41
- py?: SpacingValue;
42
- /** Top padding */
43
- pt?: SpacingValue;
44
- /** Bottom padding */
45
- pb?: SpacingValue;
46
- /** Left padding */
47
- pl?: SpacingValue;
48
- /** Right padding */
49
- pr?: SpacingValue;
50
- /** All sides margin */
51
- m?: SpacingValue;
52
- /** Horizontal margin */
53
- mx?: SpacingValue;
54
- /** Vertical margin */
55
- my?: SpacingValue;
56
- /** Top margin */
57
- mt?: SpacingValue;
58
- /** Right margin */
59
- mr?: SpacingValue;
60
- /** Bottom margin */
61
- mb?: SpacingValue;
62
- /** Left margin */
63
- ml?: SpacingValue;
64
- }>;
65
- export type ScopedThemeOverride = ThemeDefinition | ThemeOverrides;
66
- export type ThemedProps = Readonly<{
67
- key?: string;
68
- /** Partial theme overrides applied to children. */
69
- theme: ThemeOverrides;
70
- }>;
71
- export type FragmentProps = Readonly<{
72
- key?: string;
73
- }>;
74
- type DisplayableProps = Readonly<{
75
- /** Conditional layout visibility. false (or expr <= 0) hides this node. */
76
- display?: DisplayConstraint;
77
- }>;
78
- /**
79
- * Text display variants with predefined styling.
80
- */
81
- export type TextVariant = "body" | "heading" | "caption" | "code" | "label";
82
- /** Properties that can be animated via widget transition props. */
83
- export type TransitionProperty = "position" | "size" | "opacity";
84
- /** Declarative transition settings for render-time widget animation. */
85
- export type TransitionSpec = Readonly<{
86
- /** Transition duration in milliseconds. */
87
- duration?: number;
88
- /** Easing curve for interpolation. */
89
- easing?: EasingInput;
90
- /**
91
- * Transitioned properties. Defaults to `"all"` when omitted.
92
- * Phase 1 implementation supports `"position"` (x/y).
93
- */
94
- properties?: "all" | readonly TransitionProperty[];
95
- }>;
96
- export type ExitAnimationState = Readonly<{
97
- instanceId: InstanceId;
98
- startMs: number;
99
- durationMs: number;
100
- easing: (t: number) => number;
101
- properties: "all" | readonly TransitionProperty[];
102
- }>;
103
- /** Props for text widget. key is for reconciliation; style for visual appearance. */
104
- export type TextProps = Readonly<{
105
- id?: string;
106
- key?: string;
107
- style?: TextStyle;
108
- /** Text variant with predefined styling */
109
- variant?: TextVariant;
110
- /** How to handle text that exceeds available width. Defaults to "clip". */
111
- textOverflow?: "clip" | "ellipsis" | "middle" | "start";
112
- /** Maximum width for overflow handling (in cells) */
113
- maxWidth?: SizeConstraint;
114
- /** When true, text wraps to multiple lines instead of single-line truncation. */
115
- wrap?: boolean;
116
- /** Internal callback used by ink-compat to transform rendered lines. */
117
- __inkTransform?: (line: string, index: number) => string;
118
- }> & DisplayableProps;
119
- /**
120
- * Shadow configuration for box widgets.
121
- */
122
- export type BoxShadow = boolean | Readonly<{
123
- /** Horizontal offset (default: 1) */
124
- offsetX?: number;
125
- /** Vertical offset (default: 1) */
126
- offsetY?: number;
127
- /** Shadow density: "light", "medium", "dense" (default: "light") */
128
- density?: "light" | "medium" | "dense";
129
- }>;
130
- export type BoxPreset = "card" | "surface" | "well" | "elevated";
131
- export type BoxBorderSideStyles = Readonly<{
132
- top?: TextStyle;
133
- right?: TextStyle;
134
- bottom?: TextStyle;
135
- left?: TextStyle;
136
- }>;
137
- /** Props for box container. border defaults to "single". */
138
- export type BoxProps = Readonly<{
139
- id?: string;
140
- key?: string;
141
- title?: string;
142
- /** Alignment of title within the top border. */
143
- titleAlign?: "left" | "center" | "right";
144
- /**
145
- * @deprecated Use `p`/`px`/`py`/`pt`/`pr`/`pb`/`pl` instead. Will be removed in v2.0.
146
- */
147
- pad?: SpacingValue;
148
- /** Style preset. Applied before explicit border/style props. */
149
- preset?: BoxPreset;
150
- /** Border style. */
151
- border?: "none" | "single" | "double" | "rounded" | "heavy" | "dashed" | "heavy-dashed";
152
- /**
153
- * Render individual border sides. Defaults to true when `border` is not "none".
154
- * Mirrors Ink-style per-side border toggles.
155
- */
156
- borderTop?: boolean;
157
- borderRight?: boolean;
158
- borderBottom?: boolean;
159
- borderLeft?: boolean;
160
- /**
161
- * Enable shadow effect for depth.
162
- * Pass `true` for default shadow, or an object for custom configuration.
163
- */
164
- shadow?: BoxShadow;
165
- /**
166
- * Optional style applied to the box surface (for borders and background fill).
167
- * When `bg` is provided, the renderer fills the box rect.
168
- * When `borderStyle` is not set, this also styles the border.
169
- */
170
- style?: TextStyle;
171
- /**
172
- * Optional style applied only to the box border and title.
173
- * When set, decouples border appearance from child content:
174
- * `style` controls children/fill, `borderStyle` controls the border.
175
- * When not set, `style` applies to both (backward compatible).
176
- */
177
- borderStyle?: TextStyle;
178
- /** Optional per-edge border style overrides. */
179
- borderStyleSides?: BoxBorderSideStyles;
180
- /**
181
- * Style inherited by descendants when they do not override their own style.
182
- * Unlike `style`, this does not force container background fill.
183
- */
184
- inheritStyle?: TextStyle;
185
- /** Child overflow behavior. Defaults to "visible". */
186
- overflow?: Overflow;
187
- /** Horizontal scroll offset in cells. Clamped by layout metadata bounds. */
188
- scrollX?: number;
189
- /** Vertical scroll offset in cells. Clamped by layout metadata bounds. */
190
- scrollY?: number;
191
- /** Scrollbar glyph variant for overflow: "scroll" (default: "minimal"). */
192
- scrollbarVariant?: "minimal" | "classic" | "modern" | "dots" | "thin";
193
- /** Optional style override for rendered scrollbars. */
194
- scrollbarStyle?: TextStyle;
195
- /** Optional scoped theme override for this container subtree. */
196
- theme?: ScopedThemeOverride;
197
- /** Surface opacity in [0..1]. Defaults to 1. */
198
- opacity?: number;
199
- /** Gap between box children when laid out by the synthetic inner column. */
200
- gap?: SpacingValue;
201
- /** Optional declarative transition settings for this container. */
202
- transition?: TransitionSpec;
203
- /** Optional declarative exit transition before unmount removal. */
204
- exitTransition?: TransitionSpec;
205
- } & SpacingProps & LayoutConstraints>;
206
- /** Props for row/column stack layouts. pad is internal, gap is between children. */
207
- export type JustifyContent = "start" | "end" | "center" | "between" | "around" | "evenly";
208
- export type AlignItems = "start" | "end" | "center" | "stretch";
209
- export type StackProps = Readonly<{
210
- id?: string;
211
- key?: string;
212
- /**
213
- * @deprecated Use `p`/`px`/`py`/`pt`/`pr`/`pb`/`pl` instead. Will be removed in v2.0.
214
- */
215
- pad?: SpacingValue;
216
- /** Gap between children. Accepts number or spacing key. */
217
- gap?: SpacingValue;
218
- /** Render children in reverse order while preserving original child arrays. */
219
- reverse?: boolean;
220
- align?: Align;
221
- justify?: JustifyContent;
222
- items?: AlignItems;
223
- /**
224
- * Optional style applied to the stack surface.
225
- * When `bg` is provided, the renderer fills the stack rect.
226
- */
227
- style?: TextStyle;
228
- /**
229
- * Style inherited by descendants when they do not override their own style.
230
- * Unlike `style`, this does not force stack background fill.
231
- */
232
- inheritStyle?: TextStyle;
233
- /** Child overflow behavior. Defaults to "visible". */
234
- overflow?: Overflow;
235
- /** Horizontal scroll offset in cells. Clamped by layout metadata bounds. */
236
- scrollX?: number;
237
- /** Vertical scroll offset in cells. Clamped by layout metadata bounds. */
238
- scrollY?: number;
239
- /** Scrollbar glyph variant for overflow: "scroll" (default: "minimal"). */
240
- scrollbarVariant?: "minimal" | "classic" | "modern" | "dots" | "thin";
241
- /** Optional style override for rendered scrollbars. */
242
- scrollbarStyle?: TextStyle;
243
- /** Optional scoped theme override for this container subtree. */
244
- theme?: ScopedThemeOverride;
245
- /** Optional declarative transition settings for this container. */
246
- transition?: TransitionSpec;
247
- /** Optional declarative exit transition before unmount removal. */
248
- exitTransition?: TransitionSpec;
249
- } & SpacingProps & LayoutConstraints>;
250
- /** Props for horizontal stacks. `wrap` controls line breaking (default: false). */
251
- export type RowProps = StackProps & Readonly<{
252
- wrap?: boolean;
253
- }>;
254
- /** Props for vertical stacks. `wrap` controls line breaking (default: false). */
255
- export type ColumnProps = StackProps & Readonly<{
256
- wrap?: boolean;
257
- }>;
258
- export type GridProps = Readonly<{
259
- id?: string;
260
- key?: string;
261
- columns: number | string;
262
- rows?: number | string;
263
- gap?: number;
264
- rowGap?: number;
265
- columnGap?: number;
266
- theme?: ScopedThemeOverride;
267
- transition?: TransitionSpec;
268
- exitTransition?: TransitionSpec;
269
- } & LayoutConstraints>;
270
- /** Props for spacer element. size is in cells along stack axis. */
271
- export type SpacerProps = Readonly<{
272
- key?: string;
273
- size?: number;
274
- flex?: number;
275
- }>;
276
- export type DividerProps = Readonly<{
277
- key?: string;
278
- direction?: "horizontal" | "vertical";
279
- char?: string;
280
- label?: string;
281
- color?: string;
282
- }>;
283
- /**
284
- * Props for icon widget.
285
- * Icons are single-character glyphs from the icon registry.
286
- */
287
- export type IconProps = Readonly<{
288
- key?: string;
289
- /** Icon path (e.g., "status.check", "arrow.right", "ui.search") */
290
- icon: string;
291
- /** Optional style for the icon */
292
- style?: TextStyle;
293
- /** Use ASCII fallback instead of Unicode/Nerd Font character */
294
- fallback?: boolean;
295
- }>;
296
- /**
297
- * Props for spinner widget.
298
- * Animated loading indicator driven by tick events.
299
- */
300
- export type SpinnerProps = Readonly<{
301
- key?: string;
302
- /** Spinner animation variant */
303
- variant?: "dots" | "line" | "circle" | "bounce" | "pulse" | "arrows" | "dots2";
304
- /** Optional style for the spinner */
305
- style?: TextStyle;
306
- /** Optional label text after spinner */
307
- label?: string;
308
- }>;
309
- /**
310
- * Progress bar variant styles.
311
- */
312
- export type ProgressVariant = "bar" | "blocks" | "minimal";
313
- /**
314
- * Props for progress bar widget.
315
- * Displays completion progress with customizable appearance.
316
- */
317
- export type ProgressProps = Readonly<{
318
- key?: string;
319
- /** Progress value from 0 to 1 */
320
- value: number;
321
- /** Display width in cells (default: fills available space) */
322
- width?: number;
323
- /** Visual variant */
324
- variant?: ProgressVariant;
325
- /** Show percentage label */
326
- showPercent?: boolean;
327
- /** Optional label before the bar */
328
- label?: string;
329
- /** Style for filled portion */
330
- style?: TextStyle;
331
- /** Style for track/unfilled portion */
332
- trackStyle?: TextStyle;
333
- /** Design system: color tone. */
334
- dsTone?: WidgetTone;
335
- }>;
336
- /**
337
- * Skeleton variant styles.
338
- */
339
- export type SkeletonVariant = "text" | "rect" | "circle";
340
- /**
341
- * Props for skeleton loading widget.
342
- * Placeholder for content that is loading.
343
- */
344
- export type SkeletonProps = Readonly<{
345
- key?: string;
346
- /** Width in cells */
347
- width: number;
348
- /** Height in rows (default: 1) */
349
- height?: number;
350
- /** Visual variant */
351
- variant?: SkeletonVariant;
352
- /** Optional style override */
353
- style?: TextStyle;
354
- }>;
355
- /**
356
- * A span of styled text within a richText widget.
357
- */
358
- export type RichTextSpan = Readonly<{
359
- /** Text content */
360
- text: string;
361
- /** Optional style for this span */
362
- style?: TextStyle;
363
- }>;
364
- /**
365
- * Props for rich text widget with multiple styled spans.
366
- */
367
- export type RichTextProps = Readonly<{
368
- key?: string;
369
- /** Array of styled text spans */
370
- spans: readonly RichTextSpan[];
371
- }>;
372
- /**
373
- * Props for keyboard shortcut display widget.
374
- */
375
- export type KbdProps = Readonly<{
376
- key?: string;
377
- /** Key or keys to display (e.g., "Ctrl+S" or ["Ctrl", "S"]) */
378
- keys: string | readonly string[];
379
- /** Separator between keys (default: "+") */
380
- separator?: string;
381
- /** Optional style override */
382
- style?: TextStyle;
383
- /** Design system: visual variant. */
384
- dsVariant?: WidgetVariant;
385
- /** Design system: color tone. */
386
- dsTone?: WidgetTone;
387
- /** Design system: size preset. */
388
- dsSize?: WidgetSize;
389
- }>;
390
- /**
391
- * Badge visual variants.
392
- */
393
- export type BadgeVariant = "default" | "success" | "warning" | "error" | "info";
394
- /**
395
- * Props for badge widget.
396
- */
397
- export type BadgeProps = Readonly<{
398
- key?: string;
399
- /** Badge text */
400
- text: string;
401
- /** Visual variant */
402
- variant?: BadgeVariant;
403
- /** Optional style override */
404
- style?: TextStyle;
405
- }>;
406
- /**
407
- * Status indicator types.
408
- */
409
- export type StatusType = "online" | "offline" | "away" | "busy" | "unknown";
410
- /**
411
- * Props for status indicator widget.
412
- * Shows a colored dot with optional label.
413
- */
414
- export type StatusProps = Readonly<{
415
- key?: string;
416
- /** Status type determines color */
417
- status: StatusType;
418
- /** Optional label after the indicator */
419
- label?: string;
420
- /** Show the label text (default: true if label provided) */
421
- showLabel?: boolean;
422
- /** Optional style override */
423
- style?: TextStyle;
424
- }>;
425
- /**
426
- * Props for tag widget.
427
- * Inline label with background color.
428
- */
429
- export type TagProps = Readonly<{
430
- key?: string;
431
- /** Tag text */
432
- text: string;
433
- /** Tag color variant */
434
- variant?: BadgeVariant;
435
- /** Make tag removable (shows x) */
436
- removable?: boolean;
437
- /** Optional style override */
438
- style?: TextStyle;
439
- }>;
440
- /**
441
- * Props for gauge widget.
442
- * Compact progress display with label.
443
- */
444
- export type GaugeProps = Readonly<{
445
- key?: string;
446
- /** Value from 0 to 1 */
447
- value: number;
448
- /** Optional forced width in cells. */
449
- width?: SizeConstraint;
450
- /** Optional forced height in rows. */
451
- height?: SizeConstraint;
452
- /** Label before the gauge */
453
- label?: string;
454
- /** Display variant */
455
- variant?: "linear" | "compact";
456
- /** Color thresholds for value ranges */
457
- thresholds?: readonly {
458
- value: number;
459
- variant: BadgeVariant;
460
- }[];
461
- /** Optional style override */
462
- style?: TextStyle;
463
- }> & DisplayableProps;
464
- /**
465
- * Props for empty state widget.
466
- * Displays a centered placeholder when content is empty.
467
- */
468
- export type EmptyProps = Readonly<{
469
- key?: string;
470
- /** Icon path to display (e.g., "ui.search", "file.folder") */
471
- icon?: string;
472
- /** Main title text */
473
- title: string;
474
- /** Optional description text */
475
- description?: string;
476
- /** Optional action button or other widget */
477
- action?: VNode;
478
- /** Optional style override */
479
- style?: TextStyle;
480
- }>;
481
- /**
482
- * Props for error display widget.
483
- * Shows error information with optional stack trace and retry action.
484
- */
485
- export type ErrorDisplayProps = Readonly<{
486
- key?: string;
487
- /** Error title (default: "Error") */
488
- title?: string;
489
- /** Error message to display */
490
- message: string;
491
- /** Optional stack trace */
492
- stack?: string;
493
- /** Show stack trace (default: false) */
494
- showStack?: boolean;
495
- /** Callback for retry action */
496
- onRetry?: () => void;
497
- /** Optional style override */
498
- style?: TextStyle;
499
- }>;
500
- /**
501
- * Error payload passed to `errorBoundary` fallbacks.
502
- */
503
- export type ErrorBoundaryError = Readonly<{
504
- /** Runtime error code for the trapped boundary failure. */
505
- code: "ZRUI_USER_CODE_THROW";
506
- /** Friendly error message (for display in fallbacks). */
507
- message: string;
508
- /** Full detail string emitted by runtime error reporting. */
509
- detail: string;
510
- /** Optional stack trace when available. */
511
- stack?: string;
512
- /** Retry this boundary subtree on the next commit turn. */
513
- retry: () => void;
514
- }>;
515
- /**
516
- * Props for error boundary container widget.
517
- * Isolates subtree render failures and renders a fallback instead of faulting the app.
518
- */
519
- export type ErrorBoundaryProps = Readonly<{
520
- key?: string;
521
- /** Risky subtree to protect. */
522
- children: VNode;
523
- /** Fallback renderer invoked when the protected subtree throws. */
524
- fallback: (error: ErrorBoundaryError) => VNode;
525
- }>;
526
- /**
527
- * Props for callout/alert widget.
528
- * Highlighted message box for important information.
529
- */
530
- export type CalloutProps = Readonly<{
531
- key?: string;
532
- /** Callout variant determines styling */
533
- variant?: "info" | "success" | "warning" | "error";
534
- /** Optional title */
535
- title?: string;
536
- /** Message content */
537
- message: string;
538
- /** Optional icon override */
539
- icon?: string;
540
- /** Optional style override */
541
- style?: TextStyle;
542
- }>;
543
- export type GraphicsBlitter = "auto" | "braille" | "sextant" | "quadrant" | "halfblock" | "ascii";
544
- export type CanvasPoint = Readonly<{
545
- x: number;
546
- y: number;
547
- }>;
548
- export type CanvasContext = Readonly<{
549
- readonly width: number;
550
- readonly height: number;
551
- line: (x0: number, y0: number, x1: number, y1: number, color: string) => void;
552
- polyline: (points: readonly CanvasPoint[], color: string) => void;
553
- fillRect: (x: number, y: number, w: number, h: number, color: string) => void;
554
- strokeRect: (x: number, y: number, w: number, h: number, color: string) => void;
555
- roundedRect: (x: number, y: number, w: number, h: number, radius: number, color: string) => void;
556
- circle: (cx: number, cy: number, radius: number, color: string) => void;
557
- arc: (cx: number, cy: number, radius: number, startAngle: number, endAngle: number, color: string) => void;
558
- fillCircle: (cx: number, cy: number, radius: number, color: string) => void;
559
- fillTriangle: (x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, color: string) => void;
560
- setPixel: (x: number, y: number, color: string) => void;
561
- text: (x: number, y: number, str: string, color?: string) => void;
562
- clear: (color?: string) => void;
563
- }>;
564
- export type LinkProps = Readonly<{
565
- id?: string;
566
- key?: string;
567
- /** Optional semantic label used for accessibility/debug announcements. */
568
- accessibleLabel?: string;
569
- /** URL to open in terminal hyperlink-capable renderers. */
570
- url: string;
571
- /** Link label text. Defaults to url. */
572
- label?: string;
573
- /** Optional text style for the link. */
574
- style?: TextStyle;
575
- /** Optional local press handler. */
576
- onPress?: () => void;
577
- /** Disabled links are rendered but not focusable/pressable. */
578
- disabled?: boolean;
579
- /** Opt out of Tab focus order while keeping id-based routing available. */
580
- focusable?: boolean;
581
- }> & DisplayableProps;
582
- export type CanvasProps = Readonly<{
583
- id?: string;
584
- key?: string;
585
- /** Width in terminal columns. */
586
- width?: SizeConstraint;
587
- /** Height in terminal rows. */
588
- height?: SizeConstraint;
589
- /** Drawing callback, called every frame with a fresh context. */
590
- draw: (ctx: CanvasContext) => void;
591
- /** Preferred blitter. */
592
- blitter?: GraphicsBlitter;
593
- }> & DisplayableProps;
594
- export type ImageFit = "fill" | "contain" | "cover";
595
- export type ImageProtocol = "auto" | "kitty" | "sixel" | "iterm2" | "blitter";
596
- export type ImageProps = Readonly<{
597
- id?: string;
598
- key?: string;
599
- /** Image bytes (PNG or RGBA payload). */
600
- src: Uint8Array;
601
- /** Optional source width in pixels (recommended for raw RGBA inputs). */
602
- sourceWidth?: number;
603
- /** Optional source height in pixels (recommended for raw RGBA inputs). */
604
- sourceHeight?: number;
605
- /** Width in terminal columns. */
606
- width?: SizeConstraint;
607
- /** Height in terminal rows. */
608
- height?: SizeConstraint;
609
- /** Fit mode (default: contain). */
610
- fit?: ImageFit;
611
- /** Alt text for unsupported terminals or decode failures. */
612
- alt?: string;
613
- /** Preferred image protocol. */
614
- protocol?: ImageProtocol;
615
- /** Z-layer for compositing. */
616
- zLayer?: -1 | 0 | 1;
617
- /** Stable image id for protocol-level caching. */
618
- imageId?: number;
619
- }> & DisplayableProps;
620
- export type LineChartSeries = Readonly<{
621
- data: readonly number[];
622
- color: string;
623
- label?: string;
624
- }>;
625
- export type ChartAxis = Readonly<{
626
- label?: string;
627
- min?: number;
628
- max?: number;
629
- }>;
630
- export type LineChartProps = Readonly<{
631
- id?: string;
632
- key?: string;
633
- width?: SizeConstraint;
634
- height?: SizeConstraint;
635
- series: readonly LineChartSeries[];
636
- axes?: Readonly<{
637
- x?: ChartAxis;
638
- y?: ChartAxis;
639
- }>;
640
- blitter?: Exclude<GraphicsBlitter, "ascii">;
641
- showLegend?: boolean;
642
- }> & DisplayableProps;
643
- export type ScatterPoint = Readonly<{
644
- x: number;
645
- y: number;
646
- color?: string;
647
- }>;
648
- export type ScatterProps = Readonly<{
649
- id?: string;
650
- key?: string;
651
- width?: SizeConstraint;
652
- height?: SizeConstraint;
653
- points: readonly ScatterPoint[];
654
- axes?: Readonly<{
655
- x?: ChartAxis;
656
- y?: ChartAxis;
657
- }>;
658
- color?: string;
659
- blitter?: Exclude<GraphicsBlitter, "ascii">;
660
- }> & DisplayableProps;
661
- export type HeatmapColorScale = "viridis" | "plasma" | "inferno" | "magma" | "turbo" | "grayscale";
662
- export type HeatmapProps = Readonly<{
663
- id?: string;
664
- key?: string;
665
- width?: SizeConstraint;
666
- height?: SizeConstraint;
667
- /** 2D value matrix [row][col]. */
668
- data: readonly (readonly number[])[];
669
- colorScale?: HeatmapColorScale;
670
- min?: number;
671
- max?: number;
672
- }> & DisplayableProps;
673
- /**
674
- * Props for sparkline widget.
675
- * Mini inline chart using block characters.
676
- */
677
- export type SparklineProps = Readonly<{
678
- key?: string;
679
- /** Data points (will be normalized to 0-1 range) */
680
- data: readonly number[];
681
- /** Display width in cells (default: data.length) */
682
- width?: SizeConstraint;
683
- /** Display height in rows (default: 1) */
684
- height?: SizeConstraint;
685
- /** Minimum value for scaling (default: auto) */
686
- min?: number;
687
- /** Maximum value for scaling (default: auto) */
688
- max?: number;
689
- /** Enables sub-cell rendering when supported. */
690
- highRes?: boolean;
691
- /** Blitter for highRes mode. */
692
- blitter?: Exclude<GraphicsBlitter, "auto" | "ascii">;
693
- /** Optional style override */
694
- style?: TextStyle;
695
- }> & DisplayableProps;
696
- /**
697
- * Single item in a bar chart.
698
- */
699
- export type BarChartItem = Readonly<{
700
- /** Item label */
701
- label: string;
702
- /** Item value */
703
- value: number;
704
- /** Optional color variant */
705
- variant?: BadgeVariant;
706
- }>;
707
- /**
708
- * Props for bar chart widget.
709
- * Horizontal or vertical bar chart.
710
- */
711
- export type BarChartProps = Readonly<{
712
- key?: string;
713
- /** Optional forced width in cells. */
714
- width?: SizeConstraint;
715
- /** Optional forced height in rows. */
716
- height?: SizeConstraint;
717
- /** Data items to display */
718
- data: readonly BarChartItem[];
719
- /** Chart orientation (default: "horizontal") */
720
- orientation?: "horizontal" | "vertical";
721
- /** Show value labels (default: true) */
722
- showValues?: boolean;
723
- /** Show item labels (default: true) */
724
- showLabels?: boolean;
725
- /** Maximum bar length in cells */
726
- maxBarLength?: number;
727
- /** Enables sub-cell rendering when supported. */
728
- highRes?: boolean;
729
- /** Blitter for highRes mode. */
730
- blitter?: Exclude<GraphicsBlitter, "auto" | "ascii">;
731
- /** Optional style override */
732
- style?: TextStyle;
733
- }> & DisplayableProps;
734
- /**
735
- * Props for mini chart widget.
736
- * Compact multi-value display.
737
- */
738
- export type MiniChartProps = Readonly<{
739
- key?: string;
740
- /** Optional forced width in cells. */
741
- width?: SizeConstraint;
742
- /** Optional forced height in rows. */
743
- height?: SizeConstraint;
744
- /** Chart values (2-4 values recommended) */
745
- values: readonly {
746
- label: string;
747
- value: number;
748
- max?: number;
749
- }[];
750
- /** Display variant */
751
- variant?: "bars" | "pills";
752
- /** Optional style override */
753
- style?: TextStyle;
754
- }> & DisplayableProps;
755
- export type ButtonIntent = "primary" | "secondary" | "danger" | "success" | "warning" | "link";
756
- /** Props for button widget. id is required for focus/routing; label is display text. */
757
- export type ButtonProps = Readonly<{
758
- id: string;
759
- key?: string;
760
- /** Optional semantic label used for accessibility/debug announcements. */
761
- accessibleLabel?: string;
762
- label: string;
763
- disabled?: boolean;
764
- /** Opt out of Tab focus order while keeping id-based routing available. */
765
- focusable?: boolean;
766
- /**
767
- * Horizontal padding in cells.
768
- * - Legacy/manual path default: 1
769
- * - Recipe path: derived from `dsSize` unless overridden by `px`
770
- */
771
- px?: number;
772
- /** Optional style applied to the button label (merged with focus/disabled state). */
773
- style?: TextStyle;
774
- /** Optional style applied while the button is pressed. */
775
- pressedStyle?: TextStyle;
776
- /** Optional callback invoked when the button is activated. */
777
- onPress?: () => void;
778
- /** Optional focus appearance configuration. */
779
- focusConfig?: FocusConfig;
780
- /**
781
- * Design system: visual variant.
782
- * - "solid": Accent background, inverse text (primary CTA)
783
- * - "soft": Subtle background, accent text (secondary)
784
- * - "outline": Border, no fill (tertiary)
785
- * - "ghost": No background or border (minimal)
786
- * @default "soft"
787
- */
788
- dsVariant?: WidgetVariant;
789
- /**
790
- * Design system: color tone.
791
- * @default "default"
792
- */
793
- dsTone?: WidgetTone;
794
- /**
795
- * Design system: size preset.
796
- * @default "md"
797
- */
798
- dsSize?: WidgetSize;
799
- /** Shorthand for dsVariant + dsTone. Overridden by explicit dsVariant/dsTone. */
800
- intent?: ButtonIntent;
801
- }>;
802
- /** Props for input widget. id is required; value is controlled by app state. */
803
- export type InputProps = Readonly<{
804
- id: string;
805
- key?: string;
806
- /** Optional semantic label used for accessibility/debug announcements. */
807
- accessibleLabel?: string;
808
- value: string;
809
- disabled?: boolean;
810
- /** Keep the input focusable/selectable while preventing edits. */
811
- readOnly?: boolean;
812
- /** Opt out of Tab focus order while keeping id-based routing available. */
813
- focusable?: boolean;
814
- /** Optional style applied to the input value (merged with focus/disabled state). */
815
- style?: TextStyle;
816
- /** Optional callback invoked on input edits (docs/18). */
817
- onInput?: (value: string, cursor: number) => void;
818
- /** Optional callback invoked when the input loses focus. */
819
- onBlur?: () => void;
820
- /** Internal multiline mode used by ui.textarea(). */
821
- multiline?: boolean;
822
- /** Visible line count when multiline mode is enabled (default: 3). */
823
- rows?: number;
824
- /** Wrap long lines in multiline mode (default: true). */
825
- wordWrap?: boolean;
826
- /** Optional focus appearance configuration. */
827
- focusConfig?: FocusConfig;
828
- /**
829
- * Design system: size preset.
830
- * @default "md"
831
- */
832
- dsSize?: WidgetSize;
833
- /**
834
- * Design system: placeholder text displayed when value is empty.
835
- */
836
- placeholder?: string;
837
- }>;
838
- /** Props for ui.textarea(). Multi-line controlled text input. */
839
- export type TextareaProps = Readonly<{
840
- id: string;
841
- key?: string;
842
- /** Optional semantic label used for accessibility/debug announcements. */
843
- accessibleLabel?: string;
844
- value: string;
845
- disabled?: boolean;
846
- /** Keep the textarea focusable/selectable while preventing edits. */
847
- readOnly?: boolean;
848
- /** Opt out of Tab focus order while keeping id-based routing available. */
849
- focusable?: boolean;
850
- /** Visible line count (default: 3). */
851
- rows?: number;
852
- /** Wrap long lines (default: true). */
853
- wordWrap?: boolean;
854
- /** Placeholder text shown when value is empty. */
855
- placeholder?: string;
856
- /** Optional style applied to the textarea value (merged with focus/disabled state). */
857
- style?: TextStyle;
858
- /** Optional callback invoked on input edits. */
859
- onInput?: (value: string, cursor: number) => void;
860
- /** Optional callback invoked when the textarea loses focus. */
861
- onBlur?: () => void;
862
- /** Optional focus appearance configuration. */
863
- focusConfig?: FocusConfig;
864
- }>;
865
- /** Props for focus announcer widget. Renders a live summary for the focused element. */
866
- export type FocusAnnouncerProps = Readonly<{
867
- key?: string;
868
- /** Optional fallback text when no widget is focused. */
869
- emptyText?: string;
870
- /** Optional style applied to the announcement line. */
871
- style?: TextStyle;
872
- }>;
873
- /** Navigation mode for focus zones. */
874
- export type FocusZoneNavigation = "linear" | "grid" | "none";
875
- /** Props for focus zone container. Groups focusable widgets for TAB navigation. */
876
- export type FocusZoneProps = Readonly<{
877
- id: string;
878
- key?: string;
879
- tabIndex?: number;
880
- navigation?: FocusZoneNavigation;
881
- columns?: number;
882
- wrapAround?: boolean;
883
- onEnter?: () => void;
884
- onExit?: () => void;
885
- }>;
886
- /** Props for focus trap container. Contains focus within its boundaries when active. */
887
- export type FocusTrapProps = Readonly<{
888
- id: string;
889
- key?: string;
890
- active: boolean;
891
- returnFocusTo?: string;
892
- initialFocus?: string;
893
- }>;
894
- /** Height specification for virtual list items: fixed number or callback for variable heights. */
895
- export type ItemHeightSpec<T> = number | ((item: T, index: number) => number);
896
- /** Context passed to custom virtual-list measurement callbacks. */
897
- export type VirtualListMeasureItemHeightCtx = Readonly<{
898
- /** Available content width in terminal cells for this item. */
899
- width: number;
900
- /** Estimated height used for initial windowing before correction. */
901
- estimatedHeight: number;
902
- /** Rendered VNode returned by `renderItem`. */
903
- vnode: VNode;
904
- }>;
905
- /** Props for virtualList widget. Efficiently renders large datasets with windowed virtualization. */
906
- export type VirtualListProps<T = unknown> = Readonly<{
907
- id: string;
908
- key?: string;
909
- /** Opt out of Tab focus order while keeping id-based routing available. */
910
- focusable?: boolean;
911
- /** Optional semantic label used for accessibility/debug announcements. */
912
- accessibleLabel?: string;
913
- items: readonly T[];
914
- /**
915
- * Exact item height specification (fixed or callback).
916
- * Use this for fixed-height or precomputed variable-height rows.
917
- */
918
- itemHeight?: ItemHeightSpec<T>;
919
- /**
920
- * Estimated item height used for variable-height virtualization.
921
- * When provided, visible items are measured and cached to correct offsets.
922
- */
923
- estimateItemHeight?: ItemHeightSpec<T>;
924
- /**
925
- * Optional custom measurement callback for estimate mode.
926
- * Return the measured height in cells for the rendered VNode.
927
- */
928
- measureItemHeight?: (item: T, index: number, ctx: VirtualListMeasureItemHeightCtx) => number;
929
- /** Number of items to render outside the visible viewport (default: 3) */
930
- overscan?: number;
931
- renderItem: (item: T, index: number, focused: boolean) => VNode;
932
- onScroll?: (scrollTop: number, visibleRange: [number, number]) => void;
933
- onSelect?: (item: T, index: number) => void;
934
- /** Enable keyboard navigation with arrow keys, page up/down, home/end (default: true) */
935
- keyboardNavigation?: boolean;
936
- /** Wrap selection from last item to first and vice versa (default: false) */
937
- wrapAround?: boolean;
938
- /**
939
- * Mouse wheel scroll direction (default: "traditional").
940
- * - "traditional": wheel down moves the viewport down
941
- * - "natural": wheel down moves content down (trackpad-style)
942
- */
943
- scrollDirection?: "natural" | "traditional";
944
- /** Optional style override for the selected/focused row highlight. */
945
- selectionStyle?: TextStyle;
946
- /** Optional focus appearance configuration. */
947
- focusConfig?: FocusConfig;
948
- }> & LayoutConstraints;
949
- /** Backdrop style presets for modals and overlays. */
950
- export type BackdropStyle = "none" | "dim" | "opaque";
951
- /** Shared frame/surface styling for overlay widgets. */
952
- export type OverlayFrameStyle = Readonly<{
953
- /** Surface background color. */
954
- background?: NonNullable<TextStyle["bg"]>;
955
- /** Default text/icon color for overlay content. */
956
- foreground?: NonNullable<TextStyle["fg"]>;
957
- /** Border color for framed overlays. */
958
- border?: NonNullable<TextStyle["fg"]>;
959
- }>;
960
- /** Extended modal backdrop config (preset-compatible). */
961
- export type ModalBackdrop = BackdropStyle | Readonly<{
962
- /** Backdrop variant (default: "dim"). */
963
- variant?: BackdropStyle;
964
- /** Optional dim-pattern character (default: "░", dim variant only). */
965
- pattern?: string;
966
- /** Optional backdrop foreground color. */
967
- foreground?: NonNullable<TextStyle["fg"]>;
968
- /** Optional backdrop background color. */
969
- background?: NonNullable<TextStyle["bg"]>;
970
- }>;
971
- /** Position for dropdown relative to anchor. */
972
- export type DropdownPosition = "below-start" | "below-center" | "below-end" | "above-start" | "above-center" | "above-end";
973
- /** Props for layers container. Stacks children with later items on top. */
974
- export type LayersProps = Readonly<{
975
- key?: string;
976
- }>;
977
- /** Props for modal overlay. Centered with optional backdrop and focus trap. */
978
- export type ModalProps = Readonly<{
979
- id: string;
980
- key?: string;
981
- /** Optional title rendered in modal header. */
982
- title?: string;
983
- /** Main content of the modal. */
984
- content: VNode;
985
- /** Action buttons rendered in modal footer. */
986
- actions?: readonly VNode[];
987
- /** Modal width sizing. Supports fixed values, "auto", "full", `fluid(...)`, or `expr(...)`. */
988
- width?: SizeConstraintAtom;
989
- /** Modal height sizing. Supports fixed values, "full", `fluid(...)`, or `expr(...)` (no "auto" height). */
990
- height?: Exclude<SizeConstraintAtom, "auto">;
991
- /** Maximum width bound (cells, "full", `fluid(...)`, or `expr(...)`). */
992
- maxWidth?: Exclude<SizeConstraintAtom, "auto">;
993
- /** Minimum width bound (cells, "full", `fluid(...)`, or `expr(...)`). */
994
- minWidth?: Exclude<SizeConstraintAtom, "auto">;
995
- /** Minimum height bound (cells, "full", `fluid(...)`, or `expr(...)`). */
996
- minHeight?: Exclude<SizeConstraintAtom, "auto">;
997
- /** Frame/surface colors for modal body and border. */
998
- frameStyle?: OverlayFrameStyle;
999
- /** Backdrop style/config (default: "dim"). */
1000
- backdrop?: ModalBackdrop;
1001
- /** Close when backdrop is clicked (default: true). */
1002
- closeOnBackdrop?: boolean;
1003
- /** Close when ESC is pressed (default: true). */
1004
- closeOnEscape?: boolean;
1005
- /** Callback when modal should close. */
1006
- onClose?: () => void;
1007
- /** ID of element to focus when modal opens. */
1008
- initialFocus?: string;
1009
- /** ID of element to return focus to when modal closes. */
1010
- returnFocusTo?: string;
1011
- }>;
1012
- /** Intent hint for declarative dialog actions. */
1013
- export type DialogActionIntent = "primary" | "danger";
1014
- /** Action descriptor for declarative dialog buttons. */
1015
- export type DialogAction = Readonly<{
1016
- id?: string;
1017
- label: string;
1018
- intent?: DialogActionIntent;
1019
- onPress: () => void;
1020
- disabled?: boolean;
1021
- /** Opt out of Tab focus order while keeping id-based routing available. */
1022
- focusable?: boolean;
1023
- }>;
1024
- /** Declarative dialog props sugar over `ui.modal(...)`. */
1025
- export type DialogProps = Readonly<Omit<ModalProps, "content" | "actions"> & {
1026
- message: string | VNode;
1027
- actions: readonly DialogAction[];
1028
- }>;
1029
- export type AppShellSidebar = Readonly<{
1030
- content: VNode;
1031
- /** Sidebar width. Supports fixed values, "full", `fluid(...)`, or `expr(...)`. */
1032
- width?: SizeConstraint;
1033
- }>;
1034
- export type AppShellOptions = Readonly<{
1035
- id?: string;
1036
- key?: string;
1037
- /** Header content — typically title text, badges, action buttons */
1038
- header?: VNode | null;
1039
- /** Sidebar content — typically navigation */
1040
- sidebar?: AppShellSidebar | null;
1041
- /** Main body content */
1042
- body: VNode;
1043
- /** Footer/status bar content */
1044
- footer?: VNode | null;
1045
- /** Padding around the shell (default: 1) */
1046
- p?: SpacingValue;
1047
- /** Gap between sections (default: 1) */
1048
- gap?: number;
1049
- } & LayoutConstraints>;
1050
- export type PageOptions = Readonly<{
1051
- id?: string;
1052
- key?: string;
1053
- header?: VNode | null;
1054
- body: VNode;
1055
- footer?: VNode | null;
1056
- gap?: SpacingValue;
1057
- p?: SpacingValue;
1058
- } & LayoutConstraints>;
1059
- export type CardOptions = Readonly<{
1060
- id?: string;
1061
- key?: string;
1062
- title?: string;
1063
- subtitle?: string;
1064
- actions?: readonly VNode[];
1065
- border?: BoxProps["border"];
1066
- p?: SpacingValue;
1067
- gap?: number;
1068
- style?: TextStyle;
1069
- }>;
1070
- export type ToolbarOptions = Readonly<{
1071
- id?: string;
1072
- key?: string;
1073
- gap?: number;
1074
- }>;
1075
- export type StatusBarOptions = Readonly<{
1076
- id?: string;
1077
- key?: string;
1078
- left?: readonly VNode[];
1079
- right?: readonly VNode[];
1080
- style?: TextStyle;
1081
- }>;
1082
- export type HeaderOptions = Readonly<{
1083
- id?: string;
1084
- key?: string;
1085
- title: string;
1086
- subtitle?: string;
1087
- actions?: readonly VNode[];
1088
- }>;
1089
- export type SidebarItem = Readonly<{
1090
- id: string;
1091
- label: string;
1092
- icon?: string;
1093
- }>;
1094
- export type SidebarOptions = Readonly<{
1095
- id?: string;
1096
- key?: string;
1097
- items: readonly SidebarItem[];
1098
- selected?: string;
1099
- onSelect?: (id: string) => void;
1100
- width?: number;
1101
- title?: string;
1102
- }>;
1103
- export type MasterDetailOptions = Readonly<{
1104
- id?: string;
1105
- key?: string;
1106
- master: VNode;
1107
- detail: VNode;
1108
- masterWidth?: number;
1109
- gap?: number;
1110
- }>;
1111
- /** Dropdown menu item. */
1112
- export type DropdownItem = Readonly<{
1113
- id: string;
1114
- label: string;
1115
- shortcut?: string;
1116
- disabled?: boolean;
1117
- /** Render as a divider instead of a selectable item. */
1118
- divider?: boolean;
1119
- }>;
1120
- /** Props for dropdown menu. Positioned relative to an anchor element. */
1121
- export type DropdownProps = Readonly<{
1122
- id: string;
1123
- key?: string;
1124
- /** ID of the anchor element to position relative to. */
1125
- anchorId: string;
1126
- /** Position relative to anchor (default: "below-start"). */
1127
- position?: DropdownPosition;
1128
- /** Frame/surface colors for dropdown background, text, and border. */
1129
- frameStyle?: OverlayFrameStyle;
1130
- /** Menu items to render. */
1131
- items: readonly DropdownItem[];
1132
- /** Callback when an item is selected. */
1133
- onSelect?: (item: DropdownItem) => void;
1134
- /** Callback when dropdown should close. */
1135
- onClose?: () => void;
1136
- /** Design system: visual variant. */
1137
- dsVariant?: WidgetVariant;
1138
- /** Design system: color tone. */
1139
- dsTone?: WidgetTone;
1140
- /** Design system: size preset. */
1141
- dsSize?: WidgetSize;
1142
- }>;
1143
- /** Props for a layer in the layer stack. */
1144
- export type LayerProps = Readonly<{
1145
- id: string;
1146
- key?: string;
1147
- /**
1148
- * Z-index for layer ordering (higher = on top). Default is insertion order.
1149
- * Values are truncated to integers and clamped to `±9,007,199,253` for deterministic ordering.
1150
- */
1151
- zIndex?: number;
1152
- /** Frame/surface colors for the layer container. */
1153
- frameStyle?: OverlayFrameStyle;
1154
- /** Backdrop to render behind content. */
1155
- backdrop?: BackdropStyle;
1156
- /** Whether layer blocks input to lower layers. */
1157
- modal?: boolean;
1158
- /** Whether layer should close on ESC key (default: true). */
1159
- closeOnEscape?: boolean;
1160
- /** Callback when layer should close. */
1161
- onClose?: () => void;
1162
- /** Content to render in the layer. */
1163
- content: VNode;
1164
- }>;
1165
- /** Overflow behavior for table header/cell text. */
1166
- export type TableColumnOverflow = "clip" | "ellipsis" | "middle";
1167
- /** Row stripe styling for table body backgrounds. */
1168
- export type TableStripeStyle = Readonly<{
1169
- /** Background color for odd body rows (0-based index: 1, 3, 5, ...). */
1170
- odd?: NonNullable<TextStyle["bg"]>;
1171
- /** Background color for even body rows (0-based index: 0, 2, 4, ...). */
1172
- even?: NonNullable<TextStyle["bg"]>;
1173
- }>;
1174
- /** Border glyph variants supported by table borders. */
1175
- export type TableBorderVariant = "single" | "double" | "rounded" | "heavy" | "dashed" | "heavy-dashed";
1176
- /** Border styling options for tables. */
1177
- export type TableBorderStyle = Readonly<{
1178
- /** Border glyph variant (default: "single"). */
1179
- variant?: TableBorderVariant;
1180
- /** Border foreground color override. */
1181
- color?: NonNullable<TextStyle["fg"]>;
1182
- }>;
1183
- /** Column definition for table widget. */
1184
- export type TableColumn<T = unknown> = Readonly<{
1185
- /** Unique column identifier. */
1186
- key: string;
1187
- /** Column header text. */
1188
- header: string;
1189
- /** Fixed width in cells. */
1190
- width?: number;
1191
- /** Minimum width in cells. */
1192
- minWidth?: number;
1193
- /** Maximum width in cells. */
1194
- maxWidth?: number;
1195
- /** Flex factor for distributing remaining space. */
1196
- flex?: number;
1197
- /** Custom render function for cell content. */
1198
- render?: (value: unknown, row: T, index: number) => VNode;
1199
- /** Cell content alignment. */
1200
- align?: "left" | "center" | "right";
1201
- /** Overflow handling for this column (default: "ellipsis"). */
1202
- overflow?: TableColumnOverflow;
1203
- /** Whether column is sortable. */
1204
- sortable?: boolean;
1205
- }>;
1206
- /** Props for table widget. */
1207
- export type TableProps<T = unknown> = Readonly<{
1208
- id: string;
1209
- key?: string;
1210
- /** Opt out of Tab focus order while keeping id-based routing available. */
1211
- focusable?: boolean;
1212
- /** Optional semantic label used for accessibility/debug announcements. */
1213
- accessibleLabel?: string;
1214
- /** Column definitions. */
1215
- columns: readonly TableColumn<T>[];
1216
- /** Row data array. */
1217
- data: readonly T[];
1218
- /** Function to get unique key for each row. */
1219
- getRowKey: (row: T, index: number) => string;
1220
- /** Height of each row in cells (default: 1). */
1221
- rowHeight?: number;
1222
- /** Height of header row in cells (default: 1). */
1223
- headerHeight?: number;
1224
- /** Currently selected row keys. */
1225
- selection?: readonly string[];
1226
- /** Selection mode (default: "none"). */
1227
- selectionMode?: "none" | "single" | "multi";
1228
- /** Callback when selection changes. */
1229
- onSelectionChange?: (keys: readonly string[]) => void;
1230
- /** Currently sorted column key. */
1231
- sortColumn?: string;
1232
- /** Sort direction. */
1233
- sortDirection?: "asc" | "desc";
1234
- /** Callback when sort changes. */
1235
- onSort?: (column: string, direction: "asc" | "desc") => void;
1236
- /** Callback when row is pressed (Enter key or click). */
1237
- onRowPress?: (row: T, index: number) => void;
1238
- /** Callback when row is double-pressed (double-click). */
1239
- onRowDoublePress?: (row: T, index: number) => void;
1240
- /** Enable virtualization for large datasets (default: true). */
1241
- virtualized?: boolean;
1242
- /** Number of rows to render outside viewport (default: 3). */
1243
- overscan?: number;
1244
- /** Legacy stripe toggle. */
1245
- stripedRows?: boolean;
1246
- /** Stripe background styling for body rows. */
1247
- stripeStyle?: TableStripeStyle;
1248
- /** Optional style override for selected rows. */
1249
- selectionStyle?: TextStyle;
1250
- /** Show header row (default: true). */
1251
- showHeader?: boolean;
1252
- /** Legacy border toggle. */
1253
- border?: "none" | "single";
1254
- /** Border styling for rendered table frame. */
1255
- borderStyle?: TableBorderStyle;
1256
- /** Optional focus appearance configuration. */
1257
- focusConfig?: FocusConfig;
1258
- /** Design system: size preset. */
1259
- dsSize?: WidgetSize;
1260
- /** Design system: tone (reserved for future table recipe variants). */
1261
- dsTone?: WidgetTone;
1262
- }> & LayoutConstraints;
1263
- /** Option for select and radio group widgets. */
1264
- export type SelectOption = Readonly<{
1265
- /** Option value used in form state. */
1266
- value: string;
1267
- /** Display label for the option. */
1268
- label: string;
1269
- /** Whether this option is disabled. */
1270
- disabled?: boolean;
1271
- }>;
1272
- /** Props for field wrapper widget. Wraps an input with label, error, and hint. */
1273
- export type FieldProps = Readonly<{
1274
- key?: string;
1275
- /** Field label displayed above the input. */
1276
- label: string;
1277
- /** Error message to display below the input. */
1278
- error?: string;
1279
- /** Whether the field is required (shows asterisk). */
1280
- required?: boolean;
1281
- /** Help text displayed below the input. */
1282
- hint?: string;
1283
- /** The wrapped input widget. */
1284
- children: VNode;
1285
- }>;
1286
- /** Props for select dropdown widget. */
1287
- export type SelectProps = Readonly<{
1288
- id: string;
1289
- key?: string;
1290
- /** Opt out of Tab focus order while keeping id-based routing available. */
1291
- focusable?: boolean;
1292
- /** Optional semantic label used for accessibility/debug announcements. */
1293
- accessibleLabel?: string;
1294
- /** Currently selected value. */
1295
- value: string;
1296
- /** Available options. */
1297
- options: readonly SelectOption[];
1298
- /** Callback when selection changes. */
1299
- onChange?: (value: string) => void;
1300
- /** Whether the select is disabled. */
1301
- disabled?: boolean;
1302
- /** Placeholder text when no value is selected. */
1303
- placeholder?: string;
1304
- /** Whether to show the select in an error state. */
1305
- error?: boolean;
1306
- /** Optional focus appearance configuration. */
1307
- focusConfig?: FocusConfig;
1308
- /** Design system: visual variant (reserved for future select recipes). */
1309
- dsVariant?: WidgetVariant;
1310
- /** Design system: tone (reserved for future select recipes). */
1311
- dsTone?: WidgetTone;
1312
- /** Design system: size preset. */
1313
- dsSize?: WidgetSize;
1314
- }>;
1315
- /** Props for slider widget. */
1316
- export type SliderProps = Readonly<{
1317
- id: string;
1318
- key?: string;
1319
- /** Opt out of Tab focus order while keeping id-based routing available. */
1320
- focusable?: boolean;
1321
- /** Optional semantic label used for accessibility/debug announcements. */
1322
- accessibleLabel?: string;
1323
- /** Current slider value. */
1324
- value: number;
1325
- /** Minimum value (default: 0). */
1326
- min?: number;
1327
- /** Maximum value (default: 100). */
1328
- max?: number;
1329
- /** Step increment for keyboard changes (default: 1). */
1330
- step?: number;
1331
- /** Optional fixed track width in cells (default: fills available width). */
1332
- width?: number;
1333
- /** Optional label shown before the track. */
1334
- label?: string;
1335
- /** Show numeric value text (default: true). */
1336
- showValue?: boolean;
1337
- /** Callback when value changes. */
1338
- onChange?: (value: number) => void;
1339
- /** Whether the slider is disabled. */
1340
- disabled?: boolean;
1341
- /** Whether the slider is read-only (focusable but non-editable). */
1342
- readOnly?: boolean;
1343
- /** Optional style applied to label/value text. */
1344
- style?: TextStyle;
1345
- /** Optional focus appearance configuration. */
1346
- focusConfig?: FocusConfig;
1347
- }>;
1348
- /** Props for checkbox widget. */
1349
- export type CheckboxProps = Readonly<{
1350
- id: string;
1351
- key?: string;
1352
- /** Opt out of Tab focus order while keeping id-based routing available. */
1353
- focusable?: boolean;
1354
- /** Optional semantic label used for accessibility/debug announcements. */
1355
- accessibleLabel?: string;
1356
- /** Whether the checkbox is checked. */
1357
- checked: boolean;
1358
- /** Label displayed next to the checkbox. */
1359
- label?: string;
1360
- /** Callback when checked state changes. */
1361
- onChange?: (checked: boolean) => void;
1362
- /** Whether the checkbox is disabled. */
1363
- disabled?: boolean;
1364
- /** Optional focus appearance configuration. */
1365
- focusConfig?: FocusConfig;
1366
- /** Design system: tone for checked/focus rendering. */
1367
- dsTone?: WidgetTone;
1368
- /** Design system: size preset. */
1369
- dsSize?: WidgetSize;
1370
- }>;
1371
- /** Props for radio group widget. */
1372
- export type RadioGroupProps = Readonly<{
1373
- id: string;
1374
- key?: string;
1375
- /** Opt out of Tab focus order while keeping id-based routing available. */
1376
- focusable?: boolean;
1377
- /** Optional semantic label used for accessibility/debug announcements. */
1378
- accessibleLabel?: string;
1379
- /** Currently selected value. */
1380
- value: string;
1381
- /** Available options. */
1382
- options: readonly SelectOption[];
1383
- /** Callback when selection changes. */
1384
- onChange?: (value: string) => void;
1385
- /** Layout direction. */
1386
- direction?: "horizontal" | "vertical";
1387
- /** Whether the radio group is disabled. */
1388
- disabled?: boolean;
1389
- /** Optional focus appearance configuration. */
1390
- focusConfig?: FocusConfig;
1391
- /** Design system: tone for selected/focus rendering. */
1392
- dsTone?: WidgetTone;
1393
- /** Design system: size preset. */
1394
- dsSize?: WidgetSize;
1395
- }>;
1396
- /** Tabs visual style variant. */
1397
- export type TabsVariant = "line" | "enclosed" | "pills";
1398
- /** Tabs bar position relative to content. */
1399
- export type TabsPosition = "top" | "bottom";
1400
- /** Tab item descriptor. */
1401
- export type TabsItem = Readonly<{
1402
- key: string;
1403
- label: string;
1404
- content: VNode;
1405
- }>;
1406
- /** Props for tabs widget. */
1407
- export type TabsProps = Readonly<{
1408
- id: string;
1409
- key?: string;
1410
- tabs: readonly TabsItem[];
1411
- activeTab: string;
1412
- onChange: (key: string) => void;
1413
- variant?: TabsVariant;
1414
- position?: TabsPosition;
1415
- /** Design system: visual variant. */
1416
- dsVariant?: WidgetVariant;
1417
- /** Design system: color tone. */
1418
- dsTone?: WidgetTone;
1419
- /** Design system: size preset. */
1420
- dsSize?: WidgetSize;
1421
- }>;
1422
- /** Accordion item descriptor. */
1423
- export type AccordionItem = Readonly<{
1424
- key: string;
1425
- title: string;
1426
- content: VNode;
1427
- }>;
1428
- /** Props for accordion widget. */
1429
- export type AccordionProps = Readonly<{
1430
- id: string;
1431
- key?: string;
1432
- items: readonly AccordionItem[];
1433
- expanded: readonly string[];
1434
- onChange: (expanded: readonly string[]) => void;
1435
- allowMultiple?: boolean;
1436
- /** Design system: visual variant. */
1437
- dsVariant?: WidgetVariant;
1438
- /** Design system: color tone. */
1439
- dsTone?: WidgetTone;
1440
- /** Design system: size preset. */
1441
- dsSize?: WidgetSize;
1442
- }>;
1443
- /** Breadcrumb item descriptor. */
1444
- export type BreadcrumbItem = Readonly<{
1445
- label: string;
1446
- onPress?: () => void;
1447
- }>;
1448
- /** Props for breadcrumb widget. */
1449
- export type BreadcrumbProps = Readonly<{
1450
- id?: string;
1451
- key?: string;
1452
- items: readonly BreadcrumbItem[];
1453
- separator?: string;
1454
- /** Design system: visual variant. */
1455
- dsVariant?: WidgetVariant;
1456
- /** Design system: color tone. */
1457
- dsTone?: WidgetTone;
1458
- /** Design system: size preset. */
1459
- dsSize?: WidgetSize;
1460
- }>;
1461
- /** Props for pagination widget. */
1462
- export type PaginationProps = Readonly<{
1463
- id: string;
1464
- key?: string;
1465
- page: number;
1466
- totalPages: number;
1467
- onChange: (page: number) => void;
1468
- showFirstLast?: boolean;
1469
- /** Design system: visual variant. */
1470
- dsVariant?: WidgetVariant;
1471
- /** Design system: color tone. */
1472
- dsTone?: WidgetTone;
1473
- /** Design system: size preset. */
1474
- dsSize?: WidgetSize;
1475
- }>;
1476
- /** Source of commands for CommandPalette. */
1477
- export type CommandSource = Readonly<{
1478
- /** Source identifier. */
1479
- id: string;
1480
- /** Source display name. */
1481
- name: string;
1482
- /** Prefix trigger (e.g., ">" for commands, "@" for symbols). */
1483
- prefix?: string;
1484
- /** Sync or async item provider. */
1485
- getItems: (query: string) => readonly CommandItem[] | Promise<readonly CommandItem[]>;
1486
- /** Priority for sorting (higher = first). */
1487
- priority?: number;
1488
- }>;
1489
- /** Item in CommandPalette. */
1490
- export type CommandItem = Readonly<{
1491
- /** Unique item identifier. */
1492
- id: string;
1493
- /** Display label. */
1494
- label: string;
1495
- /** Secondary description. */
1496
- description?: string;
1497
- /** Keyboard shortcut hint. */
1498
- shortcut?: string;
1499
- /** Icon character (single cell). */
1500
- icon?: string;
1501
- /** Source ID this item came from. */
1502
- sourceId: string;
1503
- /** Payload for onSelect. */
1504
- data?: unknown;
1505
- /** Whether item is disabled. */
1506
- disabled?: boolean;
1507
- }>;
1508
- /** Props for CommandPalette widget. Quick-access command execution and navigation. */
1509
- export type CommandPaletteProps = Readonly<{
1510
- /** REQUIRED - Interactive widget identifier. */
1511
- id: string;
1512
- key?: string;
1513
- /** Opt out of Tab focus order while keeping id-based routing available. */
1514
- focusable?: boolean;
1515
- /** Optional semantic label used for accessibility/debug announcements. */
1516
- accessibleLabel?: string;
1517
- /** Visible state. */
1518
- open: boolean;
1519
- /** Current search query. */
1520
- query: string;
1521
- /** Command sources. */
1522
- sources: readonly CommandSource[];
1523
- /** Selected item index. */
1524
- selectedIndex: number;
1525
- /** Loading state for async sources. */
1526
- loading?: boolean;
1527
- /** Placeholder text. */
1528
- placeholder?: string;
1529
- /** Maximum visible items (default: 10). */
1530
- maxVisible?: number;
1531
- /** Palette width in cells (default: 60). */
1532
- width?: number;
1533
- /** Frame/surface colors for palette background, text, and border. */
1534
- frameStyle?: OverlayFrameStyle;
1535
- /** Optional style override for selected result row highlighting. */
1536
- selectionStyle?: TextStyle;
1537
- /** Callback when query changes. */
1538
- onChange: (query: string) => void;
1539
- /** Callback when item is selected. */
1540
- onSelect: (item: CommandItem) => void;
1541
- /** Callback when palette should close. */
1542
- onClose: () => void;
1543
- /** Callback when selection index changes. */
1544
- onSelectionChange?: (index: number) => void;
1545
- /** Optional focus appearance configuration. */
1546
- focusConfig?: FocusConfig;
1547
- }>;
1548
- /** Node in file tree. */
1549
- export type FileNode = Readonly<{
1550
- /** File/directory name. */
1551
- name: string;
1552
- /** Full path. */
1553
- path: string;
1554
- /** Node type. */
1555
- type: "file" | "directory";
1556
- /** Child nodes (for directories). */
1557
- children?: readonly FileNode[];
1558
- /** Git status indicator. */
1559
- status?: "modified" | "staged" | "untracked" | "deleted" | "renamed";
1560
- }>;
1561
- /** State information for a file tree node during rendering. */
1562
- export type FileNodeState = Readonly<{
1563
- /** Whether the node is expanded. */
1564
- expanded: boolean;
1565
- /** Whether the node is selected. */
1566
- selected: boolean;
1567
- /** Whether the node is focused. */
1568
- focused: boolean;
1569
- /** Depth level in the tree (0 = root). */
1570
- depth: number;
1571
- /** Whether this is the first sibling. */
1572
- isFirst: boolean;
1573
- /** Whether this is the last sibling. */
1574
- isLast: boolean;
1575
- /** Whether the node has children. */
1576
- hasChildren: boolean;
1577
- }>;
1578
- /** Props for FilePicker widget. Browse and select workspace files. */
1579
- export type FilePickerProps = Readonly<{
1580
- /** REQUIRED - Interactive widget identifier. */
1581
- id: string;
1582
- key?: string;
1583
- /** Opt out of Tab focus order while keeping id-based routing available. */
1584
- focusable?: boolean;
1585
- /** Optional semantic label used for accessibility/debug announcements. */
1586
- accessibleLabel?: string;
1587
- /** Root path for file browsing. */
1588
- rootPath: string;
1589
- /** File tree data to render (provided by app/runtime; core does not read the filesystem). */
1590
- data: FileNode | readonly FileNode[];
1591
- /** Currently selected file path. */
1592
- selectedPath?: string;
1593
- /** Expanded directory paths. */
1594
- expandedPaths: readonly string[];
1595
- /** Files with modified state. */
1596
- modifiedPaths?: readonly string[];
1597
- /** Files with staged state. */
1598
- stagedPaths?: readonly string[];
1599
- /** Optional style override for selected rows. */
1600
- selectionStyle?: TextStyle;
1601
- /** Filter pattern (glob). */
1602
- filter?: string;
1603
- /** Show hidden files. */
1604
- showHidden?: boolean;
1605
- /** Allow multiple selection. */
1606
- multiSelect?: boolean;
1607
- /** Selected paths for multi-select. */
1608
- selection?: readonly string[];
1609
- /** Callback when file is selected. */
1610
- onSelect: (path: string) => void;
1611
- /** Callback when directory expand state changes. */
1612
- onChange: (path: string, expanded: boolean) => void;
1613
- /** Callback when file is opened (double-click / Enter). */
1614
- onPress: (path: string) => void;
1615
- /** Callback when selection changes (multi-select). */
1616
- onSelectionChange?: (paths: readonly string[]) => void;
1617
- /** Optional focus appearance configuration. */
1618
- focusConfig?: FocusConfig;
1619
- }> & LayoutConstraints;
1620
- /** Props for FileTreeExplorer widget. Tree view of files with expand/collapse. */
1621
- export type FileTreeExplorerProps = Readonly<{
1622
- /** REQUIRED - Interactive widget identifier. */
1623
- id: string;
1624
- key?: string;
1625
- /** Opt out of Tab focus order while keeping id-based routing available. */
1626
- focusable?: boolean;
1627
- /** Optional semantic label used for accessibility/debug announcements. */
1628
- accessibleLabel?: string;
1629
- /** File tree data. */
1630
- data: FileNode | readonly FileNode[];
1631
- /** Expanded node paths. */
1632
- expanded: readonly string[];
1633
- /** Selected node path. */
1634
- selected?: string;
1635
- /** Focused node path (for keyboard nav). */
1636
- focused?: string;
1637
- /** Show file icons. */
1638
- showIcons?: boolean;
1639
- /** Show git status indicators. */
1640
- showStatus?: boolean;
1641
- /** Optional style override for selected rows. */
1642
- selectionStyle?: TextStyle;
1643
- /** Indentation per level (default: 2). */
1644
- indentSize?: number;
1645
- /** Callback when node expand state changes. */
1646
- onChange: (node: FileNode, expanded: boolean) => void;
1647
- /** Callback when node is selected. */
1648
- onSelect: (node: FileNode) => void;
1649
- /** Callback when node is activated (Enter / double-click). */
1650
- onPress: (node: FileNode) => void;
1651
- /** Callback for context menu (right-click / Menu key). */
1652
- onContextMenu?: (node: FileNode) => void;
1653
- /** Custom node renderer. */
1654
- renderNode?: (node: FileNode, depth: number, state: FileNodeState) => VNode;
1655
- /** Optional focus appearance configuration. */
1656
- focusConfig?: FocusConfig;
1657
- }> & LayoutConstraints;
1658
- /** Direction for split pane layout. */
1659
- export type SplitDirection = "horizontal" | "vertical";
1660
- /** Props for SplitPane widget. Draggable divider between panels. */
1661
- export type SplitPaneProps = Readonly<{
1662
- /** REQUIRED - Interactive widget identifier. */
1663
- id: string;
1664
- key?: string;
1665
- /** Optional semantic label used for accessibility/debug announcements. */
1666
- accessibleLabel?: string;
1667
- /** Split direction. */
1668
- direction: SplitDirection;
1669
- /** Panel sizes (percentages 0-100 or absolute cells). */
1670
- sizes: readonly number[];
1671
- /** Size mode. */
1672
- sizeMode?: "percent" | "absolute";
1673
- /** Minimum panel sizes. */
1674
- minSizes?: readonly number[];
1675
- /** Maximum panel sizes. */
1676
- maxSizes?: readonly number[];
1677
- /** Divider size in cells (default: 1). */
1678
- dividerSize?: number;
1679
- /** Allow collapsing panels. */
1680
- collapsible?: boolean;
1681
- /** Collapsed panel indices. */
1682
- collapsed?: readonly number[];
1683
- /** Callback when sizes change from dragging. */
1684
- onChange: (sizes: readonly number[]) => void;
1685
- /** Callback when panel collapse state changes. */
1686
- onCollapse?: (index: number, collapsed: boolean) => void;
1687
- }>;
1688
- /** Props for ResizablePanel widget. Panel within SplitPane/PanelGroup. */
1689
- export type ResizablePanelProps = Readonly<{
1690
- key?: string;
1691
- /** Initial size (percent or cells based on parent sizeMode). */
1692
- defaultSize?: number;
1693
- /** Minimum size. */
1694
- minSize?: number;
1695
- /** Maximum size. */
1696
- maxSize?: number;
1697
- /** Whether panel can be collapsed. */
1698
- collapsible?: boolean;
1699
- }>;
1700
- /** Props for PanelGroup widget. Container for resizable panels. */
1701
- export type PanelGroupProps = Readonly<{
1702
- /** REQUIRED - Interactive widget identifier. */
1703
- id: string;
1704
- key?: string;
1705
- /** Optional semantic label used for accessibility/debug announcements. */
1706
- accessibleLabel?: string;
1707
- /** Layout direction. */
1708
- direction: SplitDirection;
1709
- }>;
1710
- /** Cursor position in CodeEditor. */
1711
- export type CursorPosition = Readonly<{
1712
- /** Line number (0-indexed). */
1713
- line: number;
1714
- /** Column number (0-indexed, in characters not cells). */
1715
- column: number;
1716
- }>;
1717
- /** Selection range in CodeEditor. */
1718
- export type EditorSelection = Readonly<{
1719
- /** Selection anchor (start). */
1720
- anchor: CursorPosition;
1721
- /** Selection active end (cursor position). */
1722
- active: CursorPosition;
1723
- }>;
1724
- /** Search match in CodeEditor. */
1725
- export type SearchMatch = Readonly<{
1726
- /** Line number of match. */
1727
- line: number;
1728
- /** Start column of match. */
1729
- startColumn: number;
1730
- /** End column of match. */
1731
- endColumn: number;
1732
- }>;
1733
- /** Diagnostic severity for CodeEditor inline markers. */
1734
- export type CodeEditorDiagnosticSeverity = "error" | "warning" | "info" | "hint";
1735
- /** Inline diagnostic range rendered in CodeEditor. */
1736
- export type CodeEditorDiagnostic = Readonly<{
1737
- /** 0-based line index. */
1738
- line: number;
1739
- /** 0-based start column. */
1740
- startColumn: number;
1741
- /** 0-based end column (exclusive). */
1742
- endColumn: number;
1743
- /** Severity bucket controlling underline color. */
1744
- severity: CodeEditorDiagnosticSeverity;
1745
- /** Optional diagnostic message. */
1746
- message?: string;
1747
- }>;
1748
- /** Built-in syntax language presets for CodeEditor tokenization. */
1749
- export type CodeEditorSyntaxLanguage = "plain" | "typescript" | "javascript" | "json" | "go" | "rust" | "c" | "cpp" | "c++" | "csharp" | "c#" | "java" | "python" | "bash";
1750
- /** Semantic token buckets produced by CodeEditor syntax tokenizers. */
1751
- export type CodeEditorSyntaxTokenKind = "plain" | "keyword" | "type" | "string" | "number" | "comment" | "operator" | "punctuation" | "function" | "variable";
1752
- /** Single syntax token emitted by a CodeEditor line tokenizer. */
1753
- export type CodeEditorSyntaxToken = Readonly<{
1754
- /** Token text (must map back to the source line). */
1755
- text: string;
1756
- /** Semantic token kind used for style mapping. */
1757
- kind: CodeEditorSyntaxTokenKind;
1758
- }>;
1759
- /** Context passed to custom CodeEditor line tokenizers. */
1760
- export type CodeEditorTokenizeContext = Readonly<{
1761
- /** Active syntax language preset. */
1762
- language: CodeEditorSyntaxLanguage;
1763
- /** 0-based document line index. */
1764
- lineNumber: number;
1765
- }>;
1766
- /** Optional custom per-line tokenizer for CodeEditor. */
1767
- export type CodeEditorLineTokenizer = (line: string, context: CodeEditorTokenizeContext) => readonly CodeEditorSyntaxToken[];
1768
- /** Props for CodeEditor widget. Multiline text editing with selections. */
1769
- export type CodeEditorProps = Readonly<{
1770
- /** REQUIRED - Interactive widget identifier. */
1771
- id: string;
1772
- key?: string;
1773
- /** Opt out of Tab focus order while keeping id-based routing available. */
1774
- focusable?: boolean;
1775
- /** Optional semantic label used for accessibility/debug announcements. */
1776
- accessibleLabel?: string;
1777
- /** Document content (lines). */
1778
- lines: readonly string[];
1779
- /** Cursor position. */
1780
- cursor: CursorPosition;
1781
- /** Selection (null if no selection). */
1782
- selection: EditorSelection | null;
1783
- /** Scroll position (lines from top). */
1784
- scrollTop: number;
1785
- /** Horizontal scroll position (columns from left). */
1786
- scrollLeft: number;
1787
- /** Tab size in spaces (default: 2). */
1788
- tabSize?: number;
1789
- /** Insert spaces instead of tabs (default: true). */
1790
- insertSpaces?: boolean;
1791
- /** Show line numbers (default: true). */
1792
- lineNumbers?: boolean;
1793
- /** Wrap long lines (default: false). */
1794
- wordWrap?: boolean;
1795
- /** Read-only mode. */
1796
- readOnly?: boolean;
1797
- /** Search query. */
1798
- searchQuery?: string;
1799
- /** Search match positions. */
1800
- searchMatches?: readonly SearchMatch[];
1801
- /** Currently highlighted match index. */
1802
- currentMatchIndex?: number;
1803
- /** Optional diagnostics rendered as styled underlines. */
1804
- diagnostics?: readonly CodeEditorDiagnostic[];
1805
- /** Built-in syntax language preset (default: "plain"). */
1806
- syntaxLanguage?: CodeEditorSyntaxLanguage;
1807
- /** Optional custom tokenizer for per-line syntax highlighting. */
1808
- tokenizeLine?: CodeEditorLineTokenizer;
1809
- /** Render a visible highlighted cursor cell (default: true). */
1810
- highlightActiveCursorCell?: boolean;
1811
- /** Callback when content changes. */
1812
- onChange: (lines: readonly string[], cursor: CursorPosition) => void;
1813
- /** Callback when selection changes. */
1814
- onSelectionChange: (selection: EditorSelection | null) => void;
1815
- /** Callback when scroll position changes. */
1816
- onScroll: (scrollTop: number, scrollLeft: number) => void;
1817
- /** Callback for undo action. */
1818
- onUndo?: () => void;
1819
- /** Callback for redo action. */
1820
- onRedo?: () => void;
1821
- /** Optional focus appearance configuration. */
1822
- focusConfig?: FocusConfig;
1823
- /** Scrollbar glyph variant (default: "minimal"). */
1824
- scrollbarVariant?: "minimal" | "classic" | "modern" | "dots" | "thin";
1825
- /** Optional style override for rendered scrollbar. */
1826
- scrollbarStyle?: TextStyle;
1827
- }> & LayoutConstraints;
1828
- /** Line in a diff hunk. */
1829
- export type DiffLine = Readonly<{
1830
- /** Line type. */
1831
- type: "context" | "add" | "delete";
1832
- /** Line content. */
1833
- content: string;
1834
- /** Original line number (for context and delete). */
1835
- oldLineNumber?: number;
1836
- /** New line number (for context and add). */
1837
- newLineNumber?: number;
1838
- /** Intra-line change highlights as [start, end] pairs. */
1839
- highlights?: readonly (readonly [number, number])[];
1840
- }>;
1841
- /** Diff hunk containing a group of changes. */
1842
- export type DiffHunk = Readonly<{
1843
- /** Original line range start. */
1844
- oldStart: number;
1845
- /** Original line count. */
1846
- oldCount: number;
1847
- /** New line range start. */
1848
- newStart: number;
1849
- /** New line count. */
1850
- newCount: number;
1851
- /** Header text (e.g., function name). */
1852
- header?: string;
1853
- /** Diff lines in this hunk. */
1854
- lines: readonly DiffLine[];
1855
- }>;
1856
- /** Complete diff data for a file. */
1857
- export type DiffData = Readonly<{
1858
- /** Original file path. */
1859
- oldPath: string;
1860
- /** New file path. */
1861
- newPath: string;
1862
- /** Diff hunks. */
1863
- hunks: readonly DiffHunk[];
1864
- /** Binary file flag. */
1865
- isBinary?: boolean;
1866
- /** File change status. */
1867
- status: "added" | "deleted" | "modified" | "renamed" | "copied";
1868
- }>;
1869
- /** Props for DiffViewer widget. Show unified or side-by-side diffs. */
1870
- export type DiffViewerProps = Readonly<{
1871
- /** REQUIRED - Interactive widget identifier. */
1872
- id: string;
1873
- key?: string;
1874
- /** Opt out of Tab focus order while keeping id-based routing available. */
1875
- focusable?: boolean;
1876
- /** Optional semantic label used for accessibility/debug announcements. */
1877
- accessibleLabel?: string;
1878
- /** Diff data to display. */
1879
- diff: DiffData;
1880
- /** View mode. */
1881
- mode: "unified" | "sideBySide";
1882
- /** Scroll position (lines from top). */
1883
- scrollTop: number;
1884
- /** Expanded hunk indices (collapsed by default if > threshold). */
1885
- expandedHunks?: readonly number[];
1886
- /** Currently focused hunk index. */
1887
- focusedHunk?: number;
1888
- /** Show line numbers. */
1889
- lineNumbers?: boolean;
1890
- /** Context lines around changes (default: 3). */
1891
- contextLines?: number;
1892
- /** Optional style override for focused hunk header. */
1893
- focusedHunkStyle?: TextStyle;
1894
- /** Callback when scroll position changes. */
1895
- onScroll: (scrollTop: number) => void;
1896
- /** Callback when hunk expand state changes. */
1897
- onHunkToggle?: (hunkIndex: number, expanded: boolean) => void;
1898
- /** Callback to stage a hunk. */
1899
- onStageHunk?: (hunkIndex: number) => void;
1900
- /** Callback to unstage a hunk. */
1901
- onUnstageHunk?: (hunkIndex: number) => void;
1902
- /** Callback to apply a hunk. */
1903
- onApplyHunk?: (hunkIndex: number) => void;
1904
- /** Callback to revert a hunk. */
1905
- onRevertHunk?: (hunkIndex: number) => void;
1906
- /** Optional focus appearance configuration. */
1907
- focusConfig?: FocusConfig;
1908
- /** Scrollbar glyph variant (default: "minimal"). */
1909
- scrollbarVariant?: "minimal" | "classic" | "modern" | "dots" | "thin";
1910
- /** Optional style override for rendered scrollbar. */
1911
- scrollbarStyle?: TextStyle;
1912
- }> & LayoutConstraints;
1913
- /** File change in a tool request. */
1914
- export type ToolFileChange = Readonly<{
1915
- /** File path. */
1916
- path: string;
1917
- /** Type of change. */
1918
- changeType: "create" | "modify" | "delete" | "rename";
1919
- /** Preview of changes (first N lines). */
1920
- preview?: string;
1921
- /** Old path for renames. */
1922
- oldPath?: string;
1923
- }>;
1924
- /** Tool request being approved. */
1925
- export type ToolRequest = Readonly<{
1926
- /** Tool identifier. */
1927
- toolId: string;
1928
- /** Tool display name. */
1929
- toolName: string;
1930
- /** Tool description. */
1931
- description?: string;
1932
- /** Command to execute (if CLI tool). */
1933
- command?: string;
1934
- /** Files that will be modified. */
1935
- fileChanges?: readonly ToolFileChange[];
1936
- /** Risk level. */
1937
- riskLevel: "low" | "medium" | "high";
1938
- /** Additional context/arguments. */
1939
- args?: Record<string, unknown>;
1940
- }>;
1941
- /** Props for ToolApprovalDialog widget. Modal for reviewing tool execution. */
1942
- export type ToolApprovalDialogProps = Readonly<{
1943
- /** REQUIRED - Interactive widget identifier. */
1944
- id: string;
1945
- key?: string;
1946
- /** Opt out of Tab focus order while keeping id-based routing available. */
1947
- focusable?: boolean;
1948
- /** Optional semantic label used for accessibility/debug announcements. */
1949
- accessibleLabel?: string;
1950
- /** Tool request being approved. */
1951
- request: ToolRequest;
1952
- /** Visible state. */
1953
- open: boolean;
1954
- /** Dialog width in cells (default: 50). */
1955
- width?: number;
1956
- /** Dialog height in cells (default: 15). */
1957
- height?: number;
1958
- /** Focused action button. */
1959
- focusedAction?: "allow" | "deny" | "allowSession";
1960
- /** Callback when an allow/deny action is pressed. */
1961
- onPress: (action: "allow" | "deny") => void;
1962
- /** Callback when allowed for session. */
1963
- onAllowForSession?: () => void;
1964
- /** Callback when dialog should close. */
1965
- onClose: () => void;
1966
- }>;
1967
- /** Log severity level. */
1968
- export type LogLevel = "trace" | "debug" | "info" | "warn" | "error";
1969
- /** Token usage count. */
1970
- export type TokenCount = Readonly<{
1971
- /** Input tokens. */
1972
- input: number;
1973
- /** Output tokens. */
1974
- output: number;
1975
- /** Total tokens. */
1976
- total: number;
1977
- }>;
1978
- /** Log entry in LogsConsole. */
1979
- export type LogEntry = Readonly<{
1980
- /** Unique entry identifier. */
1981
- id: string;
1982
- /** Timestamp (Unix ms). */
1983
- timestamp: number;
1984
- /** Log level. */
1985
- level: LogLevel;
1986
- /** Source/category. */
1987
- source: string;
1988
- /** Log message. */
1989
- message: string;
1990
- /** Expandable details. */
1991
- details?: string;
1992
- /** Token count (for LLM responses). */
1993
- tokens?: TokenCount;
1994
- /** Duration in milliseconds. */
1995
- durationMs?: number;
1996
- /** Cost in cents. */
1997
- costCents?: number;
1998
- }>;
1999
- /** Props for LogsConsole widget. Streaming tool output and events. */
2000
- export type LogsConsoleProps = Readonly<{
2001
- /** REQUIRED - Interactive widget identifier. */
2002
- id: string;
2003
- key?: string;
2004
- /** Opt out of Tab focus order while keeping id-based routing available. */
2005
- focusable?: boolean;
2006
- /** Optional semantic label used for accessibility/debug announcements. */
2007
- accessibleLabel?: string;
2008
- /** Log entries. */
2009
- entries: readonly LogEntry[];
2010
- /** Auto-scroll to bottom (default: true). */
2011
- autoScroll?: boolean;
2012
- /** Filter by log level. */
2013
- levelFilter?: readonly LogLevel[];
2014
- /** Filter by source. */
2015
- sourceFilter?: readonly string[];
2016
- /** Search query. */
2017
- searchQuery?: string;
2018
- /** Scroll position (entries from top). */
2019
- scrollTop: number;
2020
- /** Show timestamps (default: true). */
2021
- showTimestamps?: boolean;
2022
- /** Show source labels (default: true). */
2023
- showSource?: boolean;
2024
- /** Expanded entry IDs. */
2025
- expandedEntries?: readonly string[];
2026
- /** Optional style override for focused-console ring. */
2027
- focusedStyle?: TextStyle;
2028
- /** Callback when scroll position changes. */
2029
- onScroll: (scrollTop: number) => void;
2030
- /** Callback when entry expand state changes. */
2031
- onChange?: (entryId: string, expanded: boolean) => void;
2032
- /** Callback to clear logs. */
2033
- onPress?: () => void;
2034
- /** Optional focus appearance configuration. */
2035
- focusConfig?: FocusConfig;
2036
- /** Scrollbar glyph variant (default: "minimal"). */
2037
- scrollbarVariant?: "minimal" | "classic" | "modern" | "dots" | "thin";
2038
- /** Optional style override for rendered scrollbar. */
2039
- scrollbarStyle?: TextStyle;
2040
- }> & LayoutConstraints;
2041
- /** Position for toast container. */
2042
- export type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
2043
- /** Action button in a toast. */
2044
- export type ToastAction = Readonly<{
2045
- /** Action button label. */
2046
- label: string;
2047
- /** Callback when action is clicked. */
2048
- onAction: () => void;
2049
- }>;
2050
- /** Toast notification. */
2051
- export type Toast = Readonly<{
2052
- /** Unique toast identifier. */
2053
- id: string;
2054
- /** Message text. */
2055
- message: string;
2056
- /** Toast type. */
2057
- type: "info" | "success" | "warning" | "error";
2058
- /** Auto-dismiss duration in ms (0 = persistent, default: 3000). */
2059
- duration?: number;
2060
- /** Action button. */
2061
- action?: ToastAction;
2062
- /** Progress indicator (0-100). */
2063
- progress?: number;
2064
- }>;
2065
- /** Props for ToastContainer widget. Non-blocking feedback messages. */
2066
- export type ToastContainerProps = Readonly<{
2067
- key?: string;
2068
- /** Active toasts. */
2069
- toasts: readonly Toast[];
2070
- /** Position on screen (default: "bottom-right"). */
2071
- position?: ToastPosition;
2072
- /** Maximum visible toasts (default: 5). */
2073
- maxVisible?: number;
2074
- /** Toast container width in cells (default: 40). */
2075
- width?: number;
2076
- /** Frame/surface colors for toast backgrounds, text, and borders. */
2077
- frameStyle?: OverlayFrameStyle;
2078
- /** Callback when toast is dismissed. */
2079
- onClose: (id: string) => void;
2080
- }>;
2081
- /** State information for a tree node during rendering. */
2082
- export type NodeState = Readonly<{
2083
- /** Whether the node is expanded. */
2084
- expanded: boolean;
2085
- /** Whether the node is selected. */
2086
- selected: boolean;
2087
- /** Whether the node is focused. */
2088
- focused: boolean;
2089
- /** Whether the node is loading children. */
2090
- loading: boolean;
2091
- /** Depth level in the tree (0 = root). */
2092
- depth: number;
2093
- /** Whether this is the first sibling. */
2094
- isFirst: boolean;
2095
- /** Whether this is the last sibling. */
2096
- isLast: boolean;
2097
- /** Whether the node has children (or could have). */
2098
- hasChildren: boolean;
2099
- }>;
2100
- /** Props for tree widget. */
2101
- export type TreeProps<T = unknown> = Readonly<{
2102
- id: string;
2103
- key?: string;
2104
- /** Opt out of Tab focus order while keeping id-based routing available. */
2105
- focusable?: boolean;
2106
- /** Optional semantic label used for accessibility/debug announcements. */
2107
- accessibleLabel?: string;
2108
- /** Root node(s). Can be a single root or array of roots. */
2109
- data: T | readonly T[];
2110
- /** Function to get unique key for each node. */
2111
- getKey: (node: T) => string;
2112
- /** Function to get children of a node (undefined = leaf node). */
2113
- getChildren?: (node: T) => readonly T[] | undefined;
2114
- /** Function to check if node has children (for lazy loading). */
2115
- hasChildren?: (node: T) => boolean;
2116
- /** Set of expanded node keys. */
2117
- expanded: readonly string[];
2118
- /** Currently selected node key. */
2119
- selected?: string;
2120
- /** Callback when node expand/collapse state changes. */
2121
- onChange: (node: T, expanded: boolean) => void;
2122
- /** Callback when node is selected. */
2123
- onSelect?: (node: T) => void;
2124
- /** Callback when node is activated (Enter key or double-click). */
2125
- onPress?: (node: T) => void;
2126
- /** Custom render function for node content. */
2127
- renderNode: (node: T, depth: number, state: NodeState) => VNode;
2128
- /** Function to load children asynchronously. */
2129
- loadChildren?: (node: T) => Promise<readonly T[]>;
2130
- /** Indentation per depth level in cells (default: 2). */
2131
- indentSize?: number;
2132
- /** Show tree lines (├── └── │). */
2133
- showLines?: boolean;
2134
- /** Design system: visual variant. */
2135
- dsVariant?: WidgetVariant;
2136
- /** Design system: color tone. */
2137
- dsTone?: WidgetTone;
2138
- /** Design system: size preset. */
2139
- dsSize?: WidgetSize;
2140
- }> & LayoutConstraints;
19
+ export type { Align, Overflow, SpacingProps, ScopedThemeOverride, ThemedProps, FragmentProps, TextVariant, TransitionProperty, TransitionSpec, ExitAnimationState, TextProps, BoxShadow, BoxPreset, BoxBorderSideStyles, BoxProps, JustifyContent, AlignItems, StackProps, RowProps, ColumnProps, GridProps, SpacerProps, DividerProps, IconProps, SpinnerProps, ProgressVariant, ProgressProps, SkeletonVariant, SkeletonProps, RichTextSpan, RichTextProps, KbdProps, BadgeVariant, BadgeProps, StatusType, StatusProps, TagProps, GaugeProps, EmptyProps, ErrorDisplayProps, ErrorBoundaryError, ErrorBoundaryProps, CalloutProps, GraphicsBlitter, CanvasPoint, CanvasContext, LinkProps, CanvasProps, ImageFit, ImageProtocol, ImageProps, LineChartSeries, ChartAxis, LineChartProps, ScatterPoint, ScatterProps, HeatmapColorScale, HeatmapProps, SparklineProps, BarChartItem, BarChartProps, MiniChartProps, ButtonIntent, ButtonProps, InputProps, TextareaProps, FocusAnnouncerProps, FocusZoneNavigation, FocusZoneProps, FocusTrapProps, ItemHeightSpec, VirtualListMeasureItemHeightCtx, VirtualListProps, } from "./types/base.js";
20
+ export type { BackdropStyle, OverlayFrameStyle, ModalBackdrop, DropdownPosition, LayersProps, ModalProps, DialogActionIntent, DialogAction, DialogProps, AppShellSidebar, AppShellOptions, PageOptions, CardOptions, ToolbarOptions, StatusBarOptions, HeaderOptions, SidebarItem, SidebarOptions, MasterDetailOptions, DropdownItem, DropdownProps, LayerProps, } from "./types/overlaysShell.js";
21
+ export type { TableColumnOverflow, TableStripeStyle, TableBorderVariant, TableBorderStyle, TableColumn, TableProps, } from "./types/table.js";
22
+ export type { SelectOption, FieldProps, SelectProps, SliderProps, CheckboxProps, RadioGroupProps, } from "./types/forms.js";
23
+ export type { TabsVariant, TabsPosition, TabsItem, TabsProps, AccordionItem, AccordionProps, BreadcrumbItem, BreadcrumbProps, PaginationProps, } from "./types/navigation.js";
24
+ export type { CommandSource, CommandItem, CommandPaletteProps, FileNode, FileNodeState, FilePickerProps, FileTreeExplorerProps, SplitDirection, SplitPaneProps, ResizablePanelProps, PanelGroupProps, CursorPosition, EditorSelection, SearchMatch, CodeEditorDiagnosticSeverity, CodeEditorDiagnostic, CodeEditorSyntaxLanguage, CodeEditorSyntaxTokenKind, CodeEditorSyntaxToken, CodeEditorTokenizeContext, CodeEditorLineTokenizer, CodeEditorProps, DiffLine, DiffHunk, DiffData, DiffViewerProps, ToolFileChange, ToolRequest, ToolApprovalDialogProps, LogLevel, TokenCount, LogEntry, LogsConsoleProps, ToastPosition, ToastAction, Toast, ToastContainerProps, } from "./types/advanced.js";
25
+ export type { NodeState, TreeProps } from "./types/tree.js";
26
+ import type { CodeEditorProps, CommandPaletteProps, DiffViewerProps, FilePickerProps, FileTreeExplorerProps, LogsConsoleProps, PanelGroupProps, ResizablePanelProps, SplitPaneProps, ToastContainerProps, ToolApprovalDialogProps } from "./types/advanced.js";
27
+ import type { BadgeProps, BarChartProps, BoxProps, ButtonProps, CalloutProps, CanvasProps, ColumnProps, DividerProps, EmptyProps, ErrorBoundaryProps, ErrorDisplayProps, FocusAnnouncerProps, FocusTrapProps, FocusZoneProps, FragmentProps, GaugeProps, GridProps, HeatmapProps, IconProps, ImageProps, InputProps, KbdProps, LineChartProps, LinkProps, MiniChartProps, ProgressProps, RichTextProps, RowProps, ScatterProps, SkeletonProps, SpacerProps, SparklineProps, SpinnerProps, StatusProps, TagProps, TextProps, ThemedProps, VirtualListProps } from "./types/base.js";
28
+ import type { CheckboxProps, FieldProps, RadioGroupProps, SelectProps, SliderProps } from "./types/forms.js";
29
+ import type { AccordionProps, BreadcrumbProps, PaginationProps, TabsProps } from "./types/navigation.js";
30
+ import type { DropdownProps, LayerProps, LayersProps, ModalProps } from "./types/overlaysShell.js";
31
+ import type { TableProps } from "./types/table.js";
32
+ import type { TreeProps } from "./types/tree.js";
2141
33
  export type VNode = Readonly<{
2142
34
  kind: "text";
2143
35
  text: string;
@@ -2355,5 +247,4 @@ export type VNode = Readonly<{
2355
247
  kind: "toastContainer";
2356
248
  props: ToastContainerProps;
2357
249
  }>;
2358
- export {};
2359
250
  //# sourceMappingURL=types.d.ts.map