@visulima/tui 1.0.0-alpha.8 → 1.0.0

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 (549) hide show
  1. package/CHANGELOG.md +654 -0
  2. package/LICENSE.md +2414 -187
  3. package/README.md +49 -4
  4. package/dist/components/accordion.d.ts +59 -0
  5. package/dist/components/accordion.js +1 -0
  6. package/dist/components/alert.d.ts +26 -0
  7. package/dist/components/alert.js +1 -0
  8. package/dist/components/animate-presence.d.ts +18 -0
  9. package/dist/components/animate-presence.js +1 -0
  10. package/dist/components/approval-prompt.d.ts +65 -0
  11. package/dist/components/approval-prompt.js +1 -0
  12. package/dist/components/area-chart.d.ts +66 -0
  13. package/dist/components/area-chart.js +1 -0
  14. package/dist/components/badge.d.ts +22 -0
  15. package/dist/components/badge.js +1 -0
  16. package/dist/components/bar-chart.d.ts +67 -0
  17. package/dist/components/bar-chart.js +1 -0
  18. package/dist/components/big-text.d.ts +81 -0
  19. package/dist/components/big-text.js +1 -0
  20. package/dist/components/blink-dot.d.ts +36 -0
  21. package/dist/components/blink-dot.js +1 -0
  22. package/dist/components/box.d.ts +62 -0
  23. package/dist/components/box.js +1 -0
  24. package/dist/components/breadcrumb.d.ts +33 -0
  25. package/dist/components/breadcrumb.js +1 -0
  26. package/dist/components/button.d.ts +45 -0
  27. package/dist/components/button.js +1 -0
  28. package/dist/components/calendar.d.ts +72 -0
  29. package/dist/components/calendar.js +1 -0
  30. package/dist/components/canvas.d.ts +44 -0
  31. package/dist/components/canvas.js +1 -0
  32. package/dist/components/card.d.ts +57 -0
  33. package/dist/components/card.js +1 -0
  34. package/dist/components/checkbox.d.ts +48 -0
  35. package/dist/components/checkbox.js +1 -0
  36. package/dist/components/code.d.ts +48 -0
  37. package/dist/components/code.js +2 -0
  38. package/dist/components/collapsible.d.ts +53 -0
  39. package/dist/components/collapsible.js +1 -0
  40. package/dist/components/command-block.d.ts +47 -0
  41. package/dist/components/command-block.js +4 -0
  42. package/dist/components/command-palette.d.ts +82 -0
  43. package/dist/components/command-palette.js +1 -0
  44. package/dist/components/confirm-dialog.d.ts +75 -0
  45. package/dist/components/confirm-dialog.js +1 -0
  46. package/dist/components/confirm-input.d.ts +38 -0
  47. package/dist/components/confirm-input.js +1 -0
  48. package/dist/components/console-overlay.d.ts +54 -0
  49. package/dist/components/console-overlay.js +1 -0
  50. package/dist/components/content-switcher.d.ts +57 -0
  51. package/dist/components/content-switcher.js +1 -0
  52. package/dist/components/controlled-scroll-view.d.ts +61 -0
  53. package/dist/components/controlled-scroll-view.js +1 -0
  54. package/dist/components/cursor.d.ts +62 -0
  55. package/dist/components/cursor.js +1 -0
  56. package/dist/components/date-picker.d.ts +65 -0
  57. package/dist/components/date-picker.js +1 -0
  58. package/dist/components/definition-list.d.ts +44 -0
  59. package/dist/components/definition-list.js +1 -0
  60. package/dist/components/dialog.d.ts +117 -0
  61. package/dist/components/dialog.js +1 -0
  62. package/dist/components/diff-view.d.ts +85 -0
  63. package/dist/components/diff-view.js +1 -0
  64. package/dist/components/divider.d.ts +49 -0
  65. package/dist/components/divider.js +1 -0
  66. package/dist/components/file-picker-entry.d.ts +104 -0
  67. package/dist/components/file-picker-entry.js +1 -0
  68. package/dist/components/form.d.ts +81 -0
  69. package/dist/components/form.js +1 -0
  70. package/dist/components/gauge.d.ts +87 -0
  71. package/dist/components/gauge.js +1 -0
  72. package/dist/components/gradient.d.ts +42 -0
  73. package/dist/components/gradient.js +1 -0
  74. package/dist/components/heading.d.ts +33 -0
  75. package/dist/components/heading.js +1 -0
  76. package/dist/components/heatmap.d.ts +62 -0
  77. package/dist/components/heatmap.js +1 -0
  78. package/dist/components/help.d.ts +52 -0
  79. package/dist/components/help.js +1 -0
  80. package/dist/components/histogram.d.ts +62 -0
  81. package/dist/components/histogram.js +1 -0
  82. package/dist/components/kbd.d.ts +31 -0
  83. package/dist/components/kbd.js +1 -0
  84. package/dist/components/line-chart.d.ts +109 -0
  85. package/dist/components/line-chart.js +1 -0
  86. package/dist/components/link.d.ts +38 -0
  87. package/dist/components/link.js +1 -0
  88. package/dist/components/loading-indicator.d.ts +29 -0
  89. package/dist/components/loading-indicator.js +1 -0
  90. package/dist/components/markdown.d.ts +40 -0
  91. package/dist/components/markdown.js +1 -0
  92. package/dist/components/masked-input.d.ts +50 -0
  93. package/dist/components/masked-input.js +1 -0
  94. package/dist/components/menu.d.ts +78 -0
  95. package/dist/components/menu.js +1 -0
  96. package/dist/components/message-bubble.d.ts +43 -0
  97. package/dist/components/message-bubble.js +1 -0
  98. package/dist/components/model-badge.d.ts +39 -0
  99. package/dist/components/model-badge.js +1 -0
  100. package/dist/components/multi-select.d.ts +65 -0
  101. package/dist/components/multi-select.js +1 -0
  102. package/dist/components/newline.d.ts +15 -0
  103. package/dist/components/newline.js +2 -0
  104. package/dist/components/operation-tree.d.ts +49 -0
  105. package/dist/components/operation-tree.js +1 -0
  106. package/dist/components/option-list.d.ts +47 -0
  107. package/dist/components/option-list.js +1 -0
  108. package/dist/components/ordered-list.d.ts +24 -0
  109. package/dist/components/ordered-list.js +1 -0
  110. package/dist/components/paginator.d.ts +69 -0
  111. package/dist/components/paginator.js +1 -0
  112. package/dist/components/paragraph.d.ts +38 -0
  113. package/dist/components/paragraph.js +1 -0
  114. package/dist/components/placeholder.d.ts +55 -0
  115. package/dist/components/placeholder.js +1 -0
  116. package/dist/components/progress-bar.d.ts +56 -0
  117. package/dist/components/progress-bar.js +1 -0
  118. package/dist/components/radio-group.d.ts +74 -0
  119. package/dist/components/radio-group.js +1 -0
  120. package/dist/components/scatter-plot.d.ts +35 -0
  121. package/dist/components/scatter-plot.js +1 -0
  122. package/dist/components/scroll-bar-box.d.ts +37 -0
  123. package/dist/components/scroll-bar-box.js +1 -0
  124. package/dist/components/scroll-bar.d.ts +25 -0
  125. package/dist/components/scroll-bar.js +1 -0
  126. package/dist/components/scroll-list.d.ts +20 -0
  127. package/dist/components/scroll-list.js +1 -0
  128. package/dist/components/scroll-view.d.ts +10 -0
  129. package/dist/components/scroll-view.js +1 -0
  130. package/dist/components/search-input.d.ts +55 -0
  131. package/dist/components/search-input.js +1 -0
  132. package/dist/components/select-input-indicator.d.ts +32 -0
  133. package/dist/components/select-input-indicator.js +1 -0
  134. package/dist/components/select-input-item.d.ts +41 -0
  135. package/dist/components/select-input-item.js +1 -0
  136. package/dist/components/select-input.d.ts +110 -0
  137. package/dist/components/select-input.js +1 -0
  138. package/dist/components/shimmer-text.d.ts +47 -0
  139. package/dist/components/shimmer-text.js +1 -0
  140. package/dist/components/slider.d.ts +103 -0
  141. package/dist/components/slider.js +1 -0
  142. package/dist/components/spacer.d.ts +8 -0
  143. package/dist/components/spacer.js +1 -0
  144. package/dist/components/sparkline.d.ts +35 -0
  145. package/dist/components/sparkline.js +1 -0
  146. package/dist/components/spinner.d.ts +17 -0
  147. package/dist/components/spinner.js +1 -0
  148. package/dist/components/static-render.d.ts +55 -0
  149. package/dist/components/static-render.js +1 -0
  150. package/dist/components/static.d.ts +29 -0
  151. package/dist/components/static.js +1 -0
  152. package/dist/components/status-line.d.ts +37 -0
  153. package/dist/components/status-line.js +1 -0
  154. package/dist/components/status-message.d.ts +21 -0
  155. package/dist/components/status-message.js +1 -0
  156. package/dist/components/stepper.d.ts +48 -0
  157. package/dist/components/stepper.js +1 -0
  158. package/dist/components/stopwatch.d.ts +49 -0
  159. package/dist/components/stopwatch.js +1 -0
  160. package/dist/components/streaming-text.d.ts +46 -0
  161. package/dist/components/streaming-text.js +1 -0
  162. package/dist/components/switch.d.ts +55 -0
  163. package/dist/components/switch.js +1 -0
  164. package/dist/components/tab.d.ts +19 -0
  165. package/dist/components/tab.js +1 -0
  166. package/dist/components/table.d.ts +119 -0
  167. package/dist/components/table.js +1 -0
  168. package/dist/components/tabs.d.ts +107 -0
  169. package/dist/components/tabs.js +1 -0
  170. package/dist/components/tag.d.ts +35 -0
  171. package/dist/components/tag.js +1 -0
  172. package/dist/components/text-input.d.ts +48 -0
  173. package/dist/components/text-input.js +1 -0
  174. package/dist/components/text.d.ts +79 -0
  175. package/dist/components/text.js +1 -0
  176. package/dist/components/textarea.d.ts +68 -0
  177. package/dist/components/textarea.js +2 -0
  178. package/dist/components/timer.d.ts +59 -0
  179. package/dist/components/timer.js +1 -0
  180. package/dist/components/toast.d.ts +49 -0
  181. package/dist/components/toast.js +1 -0
  182. package/dist/components/tooltip.d.ts +43 -0
  183. package/dist/components/tooltip.js +1 -0
  184. package/dist/components/transform.d.ts +21 -0
  185. package/dist/components/transform.js +1 -0
  186. package/dist/components/transition.d.ts +74 -0
  187. package/dist/components/transition.js +1 -0
  188. package/dist/components/tree-view-entry.d.ts +357 -0
  189. package/dist/components/tree-view-entry.js +1 -0
  190. package/dist/components/unordered-list.d.ts +30 -0
  191. package/dist/components/unordered-list.js +1 -0
  192. package/dist/core/index.d.ts +2 -2
  193. package/dist/core/index.js +1 -1
  194. package/dist/ink/hooks/use-animation.d.ts +41 -0
  195. package/dist/ink/hooks/use-animation.js +1 -0
  196. package/dist/ink/hooks/use-app.d.ts +38 -0
  197. package/dist/ink/hooks/use-app.js +1 -0
  198. package/dist/ink/hooks/use-box-metrics.d.ts +66 -0
  199. package/dist/ink/hooks/use-box-metrics.js +1 -0
  200. package/dist/ink/hooks/use-clipboard.d.ts +30 -0
  201. package/dist/ink/hooks/use-clipboard.js +1 -0
  202. package/dist/ink/hooks/use-color-blindness.d.ts +33 -0
  203. package/dist/ink/hooks/use-color-blindness.js +1 -0
  204. package/dist/ink/hooks/use-console-capture.d.ts +43 -0
  205. package/dist/ink/hooks/use-console-capture.js +1 -0
  206. package/dist/ink/hooks/use-cursor.d.ts +13 -0
  207. package/dist/ink/hooks/use-cursor.js +1 -0
  208. package/dist/ink/hooks/use-focus-manager.d.ts +57 -0
  209. package/dist/ink/hooks/use-focus-manager.js +1 -0
  210. package/dist/ink/hooks/use-focus.d.ts +34 -0
  211. package/dist/ink/hooks/use-focus.js +1 -0
  212. package/dist/ink/hooks/use-form.d.ts +68 -0
  213. package/dist/ink/hooks/use-form.js +1 -0
  214. package/dist/ink/hooks/use-hotkey.d.ts +37 -0
  215. package/dist/ink/hooks/use-hotkey.js +1 -0
  216. package/dist/ink/hooks/use-input.d.ts +149 -0
  217. package/dist/ink/hooks/use-input.js +2 -0
  218. package/dist/ink/hooks/use-interval.d.ts +25 -0
  219. package/dist/ink/hooks/use-interval.js +1 -0
  220. package/dist/ink/hooks/use-is-screen-reader-enabled.d.ts +6 -0
  221. package/dist/ink/hooks/use-is-screen-reader-enabled.js +1 -0
  222. package/dist/ink/hooks/use-key-bindings.d.ts +59 -0
  223. package/dist/ink/hooks/use-key-bindings.js +1 -0
  224. package/dist/ink/hooks/use-key-chord.d.ts +25 -0
  225. package/dist/ink/hooks/use-key-chord.js +1 -0
  226. package/dist/ink/hooks/use-linked-scroll.d.ts +49 -0
  227. package/dist/ink/hooks/use-linked-scroll.js +1 -0
  228. package/dist/ink/hooks/use-paste.d.ts +45 -0
  229. package/dist/ink/hooks/use-paste.js +1 -0
  230. package/dist/ink/hooks/use-persistent-state.d.ts +65 -0
  231. package/dist/ink/hooks/use-persistent-state.js +2 -0
  232. package/dist/ink/hooks/use-scroll-acceleration.d.ts +47 -0
  233. package/dist/ink/hooks/use-scroll-acceleration.js +1 -0
  234. package/dist/ink/hooks/use-scroll-input.d.ts +34 -0
  235. package/dist/ink/hooks/use-scroll-input.js +1 -0
  236. package/dist/ink/hooks/use-stderr.d.ts +16 -0
  237. package/dist/ink/hooks/use-stderr.js +1 -0
  238. package/dist/ink/hooks/use-stdin.d.ts +30 -0
  239. package/dist/ink/hooks/use-stdin.js +1 -0
  240. package/dist/ink/hooks/use-stdout.d.ts +16 -0
  241. package/dist/ink/hooks/use-stdout.js +1 -0
  242. package/dist/ink/hooks/use-stopwatch.d.ts +39 -0
  243. package/dist/ink/hooks/use-stopwatch.js +1 -0
  244. package/dist/ink/hooks/use-terminal-palette.d.ts +20 -0
  245. package/dist/ink/hooks/use-terminal-palette.js +1 -0
  246. package/dist/ink/hooks/use-text-buffer.d.ts +42 -0
  247. package/dist/ink/hooks/use-text-buffer.js +4 -0
  248. package/dist/ink/hooks/use-text-selection.d.ts +45 -0
  249. package/dist/ink/hooks/use-text-selection.js +1 -0
  250. package/dist/ink/hooks/use-timeout.d.ts +24 -0
  251. package/dist/ink/hooks/use-timeout.js +1 -0
  252. package/dist/ink/hooks/use-timer.d.ts +48 -0
  253. package/dist/ink/hooks/use-timer.js +1 -0
  254. package/dist/ink/hooks/use-window-size.d.ts +18 -0
  255. package/dist/ink/hooks/use-window-size.js +1 -0
  256. package/dist/ink/index.d.ts +30 -6251
  257. package/dist/ink/index.js +1 -1
  258. package/dist/ink/mouse/use-element-position.d.ts +31 -0
  259. package/dist/ink/mouse/use-element-position.js +1 -0
  260. package/dist/ink/mouse/use-mouse-action.d.ts +5 -0
  261. package/dist/ink/mouse/use-mouse-action.js +1 -0
  262. package/dist/ink/mouse/use-mouse-position.d.ts +5 -0
  263. package/dist/ink/mouse/use-mouse-position.js +1 -0
  264. package/dist/ink/mouse/use-mouse.d.ts +5 -0
  265. package/dist/ink/mouse/use-mouse.js +1 -0
  266. package/dist/ink/mouse/use-on-mouse-click.d.ts +16 -0
  267. package/dist/ink/mouse/use-on-mouse-click.js +1 -0
  268. package/dist/ink/mouse/use-on-mouse-hover.d.ts +10 -0
  269. package/dist/ink/mouse/use-on-mouse-hover.js +1 -0
  270. package/dist/ink/mouse/use-on-mouse-state.d.ts +13 -0
  271. package/dist/ink/mouse/use-on-mouse-state.js +1 -0
  272. package/dist/packem_chunks/devtools.js +1 -1
  273. package/dist/packem_shared/COLOR_BLINDNESS_COMPENSATION-Ilnoyeqc.js +1 -0
  274. package/dist/packem_shared/ControlledScrollView-Cn4byU2n.js +1 -0
  275. package/dist/packem_shared/DevTools-k6uiVzqv.js +1 -0
  276. package/dist/packem_shared/FilePicker-BLS9nOPz.js +1 -0
  277. package/dist/packem_shared/FocusContext-C2Sosxa4.js +1 -0
  278. package/dist/packem_shared/Fullscreen-BRhuBLBh.js +1 -0
  279. package/dist/packem_shared/IMECompositionBuffer-VhC9HRCv.js +1 -0
  280. package/dist/packem_shared/InputParser-CtwkCbrQ.js +2 -0
  281. package/dist/packem_shared/KEY-C--kOw41.js +1 -0
  282. package/dist/packem_shared/LayoutNode-LPYsuzBg.js +1 -0
  283. package/dist/packem_shared/MouseProvider-DUqQ3Eaa.js +1 -0
  284. package/dist/packem_shared/NAMED_COLORS-82DpREQV.js +1 -0
  285. package/dist/packem_shared/Range-BsVYNWtg.js +1 -0
  286. package/dist/packem_shared/Renderer-DsskdkUd.js +1 -0
  287. package/dist/packem_shared/ResizeObserver-BI9bDy-j.js +1 -0
  288. package/dist/packem_shared/ScrollBar-qa1IzDDv.js +1 -0
  289. package/dist/packem_shared/ScrollBarBox-DchESZWv.js +1 -0
  290. package/dist/packem_shared/ScrollList-BBAnRsrC.js +1 -0
  291. package/dist/packem_shared/ScrollView-CHAo7Epj.js +1 -0
  292. package/dist/packem_shared/Static-DSzsElz4.js +1 -0
  293. package/dist/packem_shared/TreeNodeMap-cJlYqckB.js +1 -0
  294. package/dist/packem_shared/TreeView-BsvLCsf0.js +1 -0
  295. package/dist/packem_shared/TuiApp-BPL8v1i1.js +1 -0
  296. package/dist/packem_shared/TuiContext-BNmP0lMY.js +3 -0
  297. package/dist/packem_shared/ansi-parser-DlgLtOYO.js +1 -0
  298. package/dist/packem_shared/ansi-tokenizer-BU67A126.js +1 -0
  299. package/dist/packem_shared/braille-ch3O5D7I.js +1 -0
  300. package/dist/packem_shared/buffer.d-EJkZr8uH.d.ts +39 -0
  301. package/dist/packem_shared/calculateScroll-D4Y_JR4H.js +1 -0
  302. package/dist/packem_shared/{measureElement-DA8WqFP_.js → calculateScrollbarLayout-Lf6i24c9.js} +1 -1
  303. package/dist/packem_shared/clearOsc52-BUpnQOav.js +1 -0
  304. package/dist/packem_shared/clearStringWidthCache-DKFjfJuB.js +1 -0
  305. package/dist/packem_shared/clipboard.d-D6lZTQ21.d.ts +23 -0
  306. package/dist/packem_shared/color-matrix.d-DSXLsB64.d.ts +50 -0
  307. package/dist/packem_shared/colorize-DU4YZkp3.js +1 -0
  308. package/dist/packem_shared/controlled-scroll-view-BVg7ywNW.js +1 -0
  309. package/dist/packem_shared/createInlineLoop-BT40Wpmx.js +2 -0
  310. package/dist/packem_shared/createScreen-DoYpyL0V.js +3 -0
  311. package/dist/packem_shared/cursor-helpers.d-BONB9tky.d.ts +12 -0
  312. package/dist/packem_shared/dom-rphpG0kf.js +1 -0
  313. package/dist/packem_shared/dom.d-B4kXbaVY.d.ts +449 -0
  314. package/dist/packem_shared/format-time-fjoQHMxD.js +1 -0
  315. package/dist/packem_shared/{getPathToRoot-B2tKmx3i.js → getPathToRoot-PDJeqiEH.js} +1 -1
  316. package/dist/packem_shared/input-utils-BSWCb4F_.js +1 -0
  317. package/dist/packem_shared/{input.d-Bfq7oc06.d.ts → input.d-CgxV2e8U.d.ts} +1 -1
  318. package/dist/packem_shared/isIntersecting-Bo2npvMR.js +1 -0
  319. package/dist/packem_shared/isTerminalPaletteQuerySupported-BYzmqq9-.js +1 -0
  320. package/dist/packem_shared/kittyFlags-g8ALyoCU.js +1 -0
  321. package/dist/packem_shared/line-chart-C7CUrvVs.js +1 -0
  322. package/dist/packem_shared/load-native-root-binding-DDikxNox.js +1 -0
  323. package/dist/packem_shared/measure-element-D4M9iSYp.js +1 -0
  324. package/dist/packem_shared/measure-text-B7juNq4Y.js +3 -0
  325. package/dist/packem_shared/mouse-context.d-BfL9xGk_.d.ts +30 -0
  326. package/dist/packem_shared/parseSgrMouse-bUrqPrh-.js +1 -0
  327. package/dist/packem_shared/processLayout-I83k6vXE.js +2 -0
  328. package/dist/packem_shared/reconciler-CFyBVf7l.js +1 -0
  329. package/dist/packem_shared/reconciler-ClpU7Y-V.js +1 -0
  330. package/dist/packem_shared/render-CuQecTAs.js +24 -0
  331. package/dist/packem_shared/render-DFZ8NHlG.js +1 -0
  332. package/dist/packem_shared/render.d-CBnYBDk2.d.ts +417 -0
  333. package/dist/packem_shared/renderToString-DwXFY8Qh.js +4 -0
  334. package/dist/packem_shared/renderToString-L_bpw4OQ.js +2 -0
  335. package/dist/packem_shared/renderTreeToBuffer-C8lS0lJ2.js +2 -0
  336. package/dist/packem_shared/renderer-k-xShm1P.js +17 -0
  337. package/dist/packem_shared/scroll-view.d-DtpsgHLg.d.ts +119 -0
  338. package/dist/packem_shared/selection.d-CI3_p8wg.d.ts +62 -0
  339. package/dist/packem_shared/squashTextNodesWithMap-BmUSBPfc.js +1 -0
  340. package/dist/packem_shared/stderr-context-Bvnik0hL.js +1 -0
  341. package/dist/packem_shared/stdin-context-88AhuztD.js +1 -0
  342. package/dist/packem_shared/styles.d-cMo36xQz.d.ts +396 -0
  343. package/dist/packem_shared/terminal-palette.d-D2SQjfn-.d.ts +19 -0
  344. package/dist/packem_shared/text-width-e49vlbQH.js +2 -0
  345. package/dist/packem_shared/token-to-elements-D6J6-P2A.js +1 -0
  346. package/dist/packem_shared/treeViewTheme-Dq3ekRAC.js +1 -0
  347. package/dist/packem_shared/useTreeView-D5ifGwG3.js +1 -0
  348. package/dist/packem_shared/useTreeViewState-BiTJakkh.js +1 -0
  349. package/dist/packem_shared/utils-Bup8lyK8.js +1 -0
  350. package/dist/packem_shared/variant-config.d-D5NnrrQK.d.ts +2 -0
  351. package/dist/packem_shared/waitFor-CTAki32d.js +4 -0
  352. package/dist/packem_shared/wrapOrTruncateStyledLine-46W8bTtv.js +3 -0
  353. package/dist/react/index.d.ts +2 -2
  354. package/dist/react/index.js +1 -1
  355. package/dist/testing/index.d.ts +5 -1
  356. package/dist/testing/index.js +1 -1
  357. package/index.js +550 -692
  358. package/package.json +583 -32
  359. package/dist/packem_shared/Accordion-BXsqchV-.js +0 -1
  360. package/dist/packem_shared/Alert-BhYVMHtR.js +0 -1
  361. package/dist/packem_shared/AnimatePresence-Eu7Z8KHc.js +0 -1
  362. package/dist/packem_shared/ApprovalPrompt-BSn0FT1g.js +0 -1
  363. package/dist/packem_shared/AreaChart-Chy-frI7.js +0 -1
  364. package/dist/packem_shared/Badge-B8WPyRsK.js +0 -1
  365. package/dist/packem_shared/BarChart-rpZtlMcF.js +0 -1
  366. package/dist/packem_shared/BigText-CRpwUzrt.js +0 -1
  367. package/dist/packem_shared/BlinkDot-BvnRuWP8.js +0 -1
  368. package/dist/packem_shared/Box-BwqSvWuq.js +0 -1
  369. package/dist/packem_shared/Breadcrumb-D0hClbRV.js +0 -1
  370. package/dist/packem_shared/Button-B89Yvbc6.js +0 -1
  371. package/dist/packem_shared/COLOR_BLINDNESS_SIMULATION-DqErf7XX.js +0 -1
  372. package/dist/packem_shared/Calendar-Dmflvm2S.js +0 -1
  373. package/dist/packem_shared/Canvas-CKg6WV47.js +0 -1
  374. package/dist/packem_shared/Card-B_9fXdtU.js +0 -1
  375. package/dist/packem_shared/Checkbox-BN71eCWU.js +0 -1
  376. package/dist/packem_shared/Code-HhevcyiH.js +0 -2
  377. package/dist/packem_shared/Collapsible-u6uf_FdV.js +0 -1
  378. package/dist/packem_shared/CommandBlock-B-nslpCv.js +0 -4
  379. package/dist/packem_shared/CommandPalette-CEFdaURo.js +0 -1
  380. package/dist/packem_shared/ConfirmDialog-5Jje_Xpu.js +0 -1
  381. package/dist/packem_shared/ConfirmInput-D44Mb9oo.js +0 -1
  382. package/dist/packem_shared/ConsoleOverlay-CM3APfgP.js +0 -1
  383. package/dist/packem_shared/ContentSwitcher-Dm5BkrCt.js +0 -1
  384. package/dist/packem_shared/ControlledScrollView-DI8KZOQB.js +0 -1
  385. package/dist/packem_shared/Cursor-BoLFIMol.js +0 -1
  386. package/dist/packem_shared/DatePicker-CnSrFFAE.js +0 -1
  387. package/dist/packem_shared/DefinitionList-v8RDuF_R.js +0 -1
  388. package/dist/packem_shared/DevTools-O8EbCfHa.js +0 -1
  389. package/dist/packem_shared/Dialog-CTaL8pn0.js +0 -1
  390. package/dist/packem_shared/DiffView-BUIFqUB0.js +0 -1
  391. package/dist/packem_shared/Divider-C47bKmqu.js +0 -1
  392. package/dist/packem_shared/FilePicker-CUo7R5Qb.js +0 -1
  393. package/dist/packem_shared/FocusContext-Xy0cwJpO.js +0 -1
  394. package/dist/packem_shared/FormField-af3aUpRL.js +0 -1
  395. package/dist/packem_shared/Fullscreen-CuJ8y0s0.js +0 -1
  396. package/dist/packem_shared/Gauge-Dz-usH__.js +0 -1
  397. package/dist/packem_shared/Gradient-DYNc0GZA.js +0 -1
  398. package/dist/packem_shared/Heading-mwEYza3Y.js +0 -1
  399. package/dist/packem_shared/Heatmap-ChL97U1-.js +0 -1
  400. package/dist/packem_shared/Help-Zcelyw_U.js +0 -1
  401. package/dist/packem_shared/Histogram-FIf2F83d.js +0 -1
  402. package/dist/packem_shared/IMECompositionBuffer-C89PhiOu.js +0 -1
  403. package/dist/packem_shared/InputParser-rZKjY_7Y.js +0 -2
  404. package/dist/packem_shared/KEY-Bk8B-3h_.js +0 -1
  405. package/dist/packem_shared/Kbd-DpkPp4jB.js +0 -1
  406. package/dist/packem_shared/LayoutNode-rxblE317.js +0 -1
  407. package/dist/packem_shared/LineChart-BXE_girm.js +0 -1
  408. package/dist/packem_shared/Link-i2o2EG4-.js +0 -1
  409. package/dist/packem_shared/LoadingIndicator-TC1Fjwyt.js +0 -1
  410. package/dist/packem_shared/Markdown-R1XqK63D.js +0 -1
  411. package/dist/packem_shared/MaskedInput-J01phOZs.js +0 -1
  412. package/dist/packem_shared/Menu-CfrH4ymk.js +0 -1
  413. package/dist/packem_shared/MessageBubble-BmBBU2Rm.js +0 -1
  414. package/dist/packem_shared/ModelBadge-D3wrXncu.js +0 -1
  415. package/dist/packem_shared/MouseProvider-pjza-lpc.js +0 -1
  416. package/dist/packem_shared/MultiSelect-Dqmn-bVo.js +0 -1
  417. package/dist/packem_shared/NAMED_COLORS-B9fJsYdg.js +0 -1
  418. package/dist/packem_shared/Newline-BSG4iUqp.js +0 -2
  419. package/dist/packem_shared/OperationTree-DksxjMIV.js +0 -1
  420. package/dist/packem_shared/OptionList-CNx7r9yN.js +0 -1
  421. package/dist/packem_shared/OrderedList-BeDy035w.js +0 -1
  422. package/dist/packem_shared/Paginator-B56s6bhS.js +0 -1
  423. package/dist/packem_shared/Paragraph-BqJlH0R-.js +0 -1
  424. package/dist/packem_shared/Placeholder-GMpHRGC8.js +0 -1
  425. package/dist/packem_shared/ProgressBar-Bj3fmORR.js +0 -1
  426. package/dist/packem_shared/RadioGroup-Br8BeEwS.js +0 -1
  427. package/dist/packem_shared/Renderer-DJXooAsp.js +0 -1
  428. package/dist/packem_shared/ResizeObserverEntry-Dq0dk8Kq.js +0 -1
  429. package/dist/packem_shared/ScatterPlot-OhfYco5l.js +0 -1
  430. package/dist/packem_shared/ScrollBar-Da5Y3z7N.js +0 -1
  431. package/dist/packem_shared/ScrollBarBox-Dz6F-Eat.js +0 -1
  432. package/dist/packem_shared/ScrollList-DiVGyEjv.js +0 -1
  433. package/dist/packem_shared/ScrollView-BojONotI.js +0 -1
  434. package/dist/packem_shared/SearchInput-BoPTRbhV.js +0 -1
  435. package/dist/packem_shared/SelectInput-CAJ7SCBq.js +0 -1
  436. package/dist/packem_shared/SelectInputIndicator-N1n8ULHs.js +0 -1
  437. package/dist/packem_shared/SelectInputItem-BEkbmobs.js +0 -1
  438. package/dist/packem_shared/ShimmerText-CuGQ2NDC.js +0 -1
  439. package/dist/packem_shared/Slider-Cg_tJpKa.js +0 -1
  440. package/dist/packem_shared/Spacer-eT3HOrXk.js +0 -1
  441. package/dist/packem_shared/Sparkline-T6_FPVET.js +0 -1
  442. package/dist/packem_shared/Spinner-B0-A50pu.js +0 -1
  443. package/dist/packem_shared/Static-DLynr5pn.js +0 -1
  444. package/dist/packem_shared/Static-jzLPaHJF.js +0 -1
  445. package/dist/packem_shared/StaticRender-BgD61E7x.js +0 -1
  446. package/dist/packem_shared/StatusLine-Ch4jjef1.js +0 -1
  447. package/dist/packem_shared/StatusMessage-B1qfKeMM.js +0 -1
  448. package/dist/packem_shared/Stepper-CNPAqxiU.js +0 -1
  449. package/dist/packem_shared/Stopwatch-CAx2EWwq.js +0 -1
  450. package/dist/packem_shared/StreamingText-BYOKSB2T.js +0 -1
  451. package/dist/packem_shared/Switch-DzSpKYu7.js +0 -1
  452. package/dist/packem_shared/Tab-BcXzSUdj.js +0 -1
  453. package/dist/packem_shared/Table-DJp1TLrR.js +0 -1
  454. package/dist/packem_shared/Tabs-D68z0SOt.js +0 -1
  455. package/dist/packem_shared/Tag-BvLHnYRn.js +0 -1
  456. package/dist/packem_shared/Text-mTAve9R2.js +0 -1
  457. package/dist/packem_shared/TextInput-C_gYQlnF.js +0 -1
  458. package/dist/packem_shared/Textarea-C2ET_oMb.js +0 -2
  459. package/dist/packem_shared/Timer-CI3aQX65.js +0 -1
  460. package/dist/packem_shared/Toast-Drvc8XfG.js +0 -1
  461. package/dist/packem_shared/Tooltip-C5UnQlLd.js +0 -1
  462. package/dist/packem_shared/Transform-fYmcdqRT.js +0 -1
  463. package/dist/packem_shared/Transition-CJDBKYUB.js +0 -1
  464. package/dist/packem_shared/TreeNodeMap-CspqSCpb.js +0 -1
  465. package/dist/packem_shared/TreeView-DjhacGJ5.js +0 -1
  466. package/dist/packem_shared/TuiApp-DrjI_i-R.js +0 -1
  467. package/dist/packem_shared/TuiContext-BoJvG3NN.js +0 -3
  468. package/dist/packem_shared/UnorderedList-BnfqexZs.js +0 -1
  469. package/dist/packem_shared/ansi-parser-B6uXaq65.js +0 -1
  470. package/dist/packem_shared/ansi-tokenizer-DqX9nJuk.js +0 -1
  471. package/dist/packem_shared/boxes-DyY_LXCi.js +0 -1
  472. package/dist/packem_shared/braille-BBjIoaN0.js +0 -1
  473. package/dist/packem_shared/colorize-DbTZMrJO.js +0 -1
  474. package/dist/packem_shared/comparePoints-C85EsmNz.js +0 -1
  475. package/dist/packem_shared/controlled-scroll-view-CmrAEvJk.js +0 -1
  476. package/dist/packem_shared/createInlineLoop-DRNZ7jqH.js +0 -2
  477. package/dist/packem_shared/createLinkedScrollGroup-BMTJ7rAj.js +0 -1
  478. package/dist/packem_shared/createMemoryStorage-QVZNXbWz.js +0 -2
  479. package/dist/packem_shared/createScreen-CrLrxA6t.js +0 -3
  480. package/dist/packem_shared/dom-4y__5fWB.js +0 -1
  481. package/dist/packem_shared/format-time-C7Q-hQZq.js +0 -1
  482. package/dist/packem_shared/getScrollHeight-BTEY8ewu.js +0 -1
  483. package/dist/packem_shared/input-utils-fAxzSlNh.js +0 -1
  484. package/dist/packem_shared/isIntersecting-B3KbKTmu.js +0 -1
  485. package/dist/packem_shared/isOsc52Supported-DKK7Uee6.js +0 -1
  486. package/dist/packem_shared/isTerminalPaletteQuerySupported-Dn2hFAZ_.js +0 -1
  487. package/dist/packem_shared/kittyFlags-C3rZLbcK.js +0 -1
  488. package/dist/packem_shared/line-chart-DrM8PwnI.js +0 -1
  489. package/dist/packem_shared/measure-element-DSp7YDus.js +0 -2
  490. package/dist/packem_shared/measure-text-DDjHT1jD.js +0 -3
  491. package/dist/packem_shared/parseSgrMouse-Ccj70ijb.js +0 -1
  492. package/dist/packem_shared/processLayout-DXDfFb_d.js +0 -1
  493. package/dist/packem_shared/reconciler-BuOP-TZ6.js +0 -1
  494. package/dist/packem_shared/reconciler-DSYCrIZs.js +0 -1
  495. package/dist/packem_shared/render-DDqtMAFN.js +0 -1
  496. package/dist/packem_shared/render-_r0K9K11.js +0 -28
  497. package/dist/packem_shared/render.d-BR3gA-N8.d.ts +0 -1257
  498. package/dist/packem_shared/renderToString-DeqOWRP8.js +0 -4
  499. package/dist/packem_shared/renderToString-IYYPyASm.js +0 -2
  500. package/dist/packem_shared/renderTreeToBuffer-DPkoCgP2.js +0 -2
  501. package/dist/packem_shared/renderer-D2p6av2X.js +0 -17
  502. package/dist/packem_shared/setEnableStyledLineCache-D2gZbwFM.js +0 -1
  503. package/dist/packem_shared/squashTextNodesWithMap-Cpqmc45i.js +0 -1
  504. package/dist/packem_shared/stderr-context-BzEaUICS.js +0 -1
  505. package/dist/packem_shared/stdin-context-BTaaFagk.js +0 -1
  506. package/dist/packem_shared/text-width-CZ9vPvM0.js +0 -2
  507. package/dist/packem_shared/token-to-elements-BYxT6J_Q.js +0 -1
  508. package/dist/packem_shared/treeViewTheme-1RIZyB4M.js +0 -1
  509. package/dist/packem_shared/useAnimation-B9we6ZzL.js +0 -1
  510. package/dist/packem_shared/useApp-B6fvM42d.js +0 -1
  511. package/dist/packem_shared/useBoxMetrics-D5pkIr6P.js +0 -1
  512. package/dist/packem_shared/useClipboard-CBxy0hT8.js +0 -1
  513. package/dist/packem_shared/useColorBlindness-BvWcu2Bb.js +0 -1
  514. package/dist/packem_shared/useConsoleCapture-BxiG8iLJ.js +0 -1
  515. package/dist/packem_shared/useCursor-CPu8T5Db.js +0 -1
  516. package/dist/packem_shared/useElementDimensions-qJ_WXFZ9.js +0 -1
  517. package/dist/packem_shared/useFocus-DSmziO_x.js +0 -1
  518. package/dist/packem_shared/useFocusManager-Uapn3LQo.js +0 -1
  519. package/dist/packem_shared/useForm-CzV-Oext.js +0 -1
  520. package/dist/packem_shared/useHotkey-D0dGey14.js +0 -1
  521. package/dist/packem_shared/useInput-D1_jG26Z.js +0 -2
  522. package/dist/packem_shared/useInterval-AobjZT3u.js +0 -1
  523. package/dist/packem_shared/useIsScreenReaderEnabled-DjWHh-II.js +0 -1
  524. package/dist/packem_shared/useKeyBindings-zabkEJQs.js +0 -1
  525. package/dist/packem_shared/useKeyChord-CICQIxXj.js +0 -1
  526. package/dist/packem_shared/useMouseAction-2dRfU1vE.js +0 -1
  527. package/dist/packem_shared/useMouseContext-C746G7kY.js +0 -1
  528. package/dist/packem_shared/useMousePosition-BTWfV4JK.js +0 -1
  529. package/dist/packem_shared/useOnMouseClick-nY8xLZmt.js +0 -1
  530. package/dist/packem_shared/useOnMouseHover-D3DczIol.js +0 -1
  531. package/dist/packem_shared/useOnMouseState-cRK8QvzD.js +0 -1
  532. package/dist/packem_shared/usePaste-CKKB9H-Z.js +0 -1
  533. package/dist/packem_shared/useScrollAcceleration-NrY1oVMs.js +0 -1
  534. package/dist/packem_shared/useScrollInput-Caghtn-Q.js +0 -1
  535. package/dist/packem_shared/useStderr-BDZb6InG.js +0 -1
  536. package/dist/packem_shared/useStdin-DKa4h35k.js +0 -1
  537. package/dist/packem_shared/useStdout-B-2lX4C5.js +0 -1
  538. package/dist/packem_shared/useStopwatch-DffK7iMh.js +0 -1
  539. package/dist/packem_shared/useTerminalPalette-Cv7tSduR.js +0 -1
  540. package/dist/packem_shared/useTextBuffer-DekkGLxI.js +0 -4
  541. package/dist/packem_shared/useTextSelection-CGT0GLDR.js +0 -1
  542. package/dist/packem_shared/useTimeout-7LEFYTnG.js +0 -1
  543. package/dist/packem_shared/useTimer-DyoqSyGi.js +0 -1
  544. package/dist/packem_shared/useTreeView-8UlTK6sW.js +0 -1
  545. package/dist/packem_shared/useTreeViewState-CRPCUWrb.js +0 -1
  546. package/dist/packem_shared/useWindowSize-yDZsXF8z.js +0 -1
  547. package/dist/packem_shared/utils-THUhYKG2.js +0 -1
  548. package/dist/packem_shared/waitFor-Dj5zfL5s.js +0 -4
  549. package/dist/packem_shared/wrapOrTruncateStyledLine-BZ00SM8i.js +0 -3
@@ -0,0 +1,109 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ import { C as CanvasContext } from "../packem_shared/buffer.d-EJkZr8uH.js";
5
+ /**
6
+ * A single 2D data point.
7
+ */
8
+ type Point = {
9
+ readonly x: number;
10
+ readonly y: number;
11
+ };
12
+ type LineSeries = {
13
+ /**
14
+ * Per-series color override. Falls back to the chart-level palette.
15
+ */
16
+ readonly color?: LiteralUnion<AnsiColors, string>;
17
+ /**
18
+ * Numeric samples to plot. Pass either a list of y-values (x is the
19
+ * index) or {x, y} tuples.
20
+ */
21
+ readonly data: ReadonlyArray<number> | ReadonlyArray<{
22
+ readonly x: number;
23
+ readonly y: number;
24
+ }>;
25
+ /**
26
+ * Optional label shown in the legend.
27
+ */
28
+ readonly label?: string;
29
+ };
30
+ type LineChartProps = {
31
+ /**
32
+ * Color for axis ticks / labels.
33
+ * @default "gray"
34
+ */
35
+ readonly axisColor?: LiteralUnion<AnsiColors, string>;
36
+ /**
37
+ * Chart body height in character rows.
38
+ * @default 10
39
+ */
40
+ readonly height?: number;
41
+ /**
42
+ * Upper bound for the y-axis. When omitted the chart auto-scales.
43
+ */
44
+ readonly maxY?: number;
45
+ /**
46
+ * Lower bound for the y-axis. When omitted the chart auto-scales.
47
+ */
48
+ readonly minY?: number;
49
+ /**
50
+ * Fallback palette cycled through when a series does not set `color`.
51
+ * @default ["cyan", "magenta", "yellow", "green", "blue", "red"]
52
+ */
53
+ readonly palette?: ReadonlyArray<LiteralUnion<AnsiColors, string>>;
54
+ /**
55
+ * One or more line series.
56
+ */
57
+ readonly series: ReadonlyArray<LineSeries>;
58
+ /**
59
+ * Render the legend row under the plot.
60
+ * @default true
61
+ */
62
+ readonly showLegend?: boolean;
63
+ /**
64
+ * Chart body width in character columns.
65
+ * @default 40
66
+ */
67
+ readonly width?: number;
68
+ };
69
+ type RenderConfig = {
70
+ readonly axisColor: LiteralUnion<AnsiColors, string>;
71
+ readonly palette: ReadonlyArray<LiteralUnion<AnsiColors, string>>;
72
+ readonly seriesList: ReadonlyArray<{
73
+ color: LiteralUnion<AnsiColors, string>;
74
+ points: ReadonlyArray<Point>;
75
+ series: LineSeries;
76
+ }>;
77
+ readonly xMax: number;
78
+ readonly xMin: number;
79
+ readonly yMax: number;
80
+ readonly yMin: number;
81
+ };
82
+ /**
83
+ * Project an (x, y) data point into pixel-grid coordinates for the given
84
+ * canvas size. Used by every chart that paints on top of a braille grid.
85
+ */
86
+ declare const projectPoint: (point: Point, config: Pick<RenderConfig, "xMax" | "xMin" | "yMax" | "yMin">, pixelWidth: number, pixelHeight: number) => {
87
+ px: number;
88
+ py: number;
89
+ };
90
+ /**
91
+ * Shared drawing path used by LineChart and ScatterPlot. AreaChart wraps
92
+ * this with a fill pass.
93
+ */
94
+ declare const drawSeriesOnCanvas: (context: CanvasContext, mode: "line" | "scatter", config: RenderConfig) => void;
95
+ /**
96
+ * Smooth multi-series line chart rendered at 2x4 sub-cell resolution using
97
+ * Unicode braille patterns. Auto-scales both axes by default.
98
+ */
99
+ declare function LineChart({
100
+ axisColor,
101
+ height,
102
+ maxY,
103
+ minY,
104
+ palette,
105
+ series,
106
+ showLegend,
107
+ width
108
+ }: LineChartProps): ReactElement;
109
+ export { LineChart, LineChartProps, type RenderConfig as LineChartRenderConfig, LineSeries, LineChart as default, drawSeriesOnCanvas, projectPoint };
@@ -0,0 +1 @@
1
+ import"react/jsx-runtime";import"react";import"../packem_shared/braille-ch3O5D7I.js";import"./box.js";import"./canvas.js";import{h as s,h as n,d,a as h}from"../packem_shared/line-chart-C7CUrvVs.js";import"./text.js";export{s as LineChart,n as default,d as drawSeriesOnCanvas,h as projectPoint};
@@ -0,0 +1,38 @@
1
+ import { ReactNode, ReactElement } from 'react';
2
+ type Props = {
3
+ readonly children: ReactNode;
4
+ /**
5
+ * Determines whether the URL should be printed for unsupported terminals.
6
+ *
7
+ * - `true` (default): appends the URL after the text, e.g. `"My website https://example.com"`
8
+ * - `false`: renders just the text with no URL
9
+ * - `function`: custom fallback formatting, e.g. `(text, url) => \`[\${text}](\${url})\``
10
+ * @default true
11
+ */
12
+ readonly fallback?: ((text: string, url: string) => string) | boolean;
13
+ /**
14
+ * The URL to link to.
15
+ */
16
+ readonly url: string;
17
+ };
18
+ /**
19
+ * An Ink component that creates clickable links in the terminal using OSC 8 hyperlink sequences.
20
+ *
21
+ * [Supported terminals.](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda)
22
+ *
23
+ * For unsupported terminals, the link will be printed after the text: `My website https://example.com`.
24
+ *
25
+ * ```tsx
26
+ * import { Link, Text } from "@visulima/tui/ink";
27
+ *
28
+ * &lt;Link url="https://example.com"&gt;
29
+ * &lt;Text color="cyan"&gt;My Website&lt;/Text&gt;
30
+ * &lt;/Link&gt;
31
+ * ```
32
+ */
33
+ declare function Link({
34
+ children,
35
+ fallback,
36
+ url
37
+ }: Props): ReactElement;
38
+ export { Link, type Props as LinkProps, type Props, Link as default };
@@ -0,0 +1 @@
1
+ import{jsx as i}from"react/jsx-runtime";import{hyperlink as u}from"@visulima/ansi";import{useCallback as c}from"react";import{Text as f}from"./text.js";import{Transform as a}from"./transform.js";let n;const m=()=>{if(!process.stdout.isTTY)return!1;const o=process.env.TERM_PROGRAM??"",r=process.env.TERM_PROGRAM_VERSION??"";if(o==="iTerm.app")return Number.parseInt(r.split(".")[0]??"0",10)>=3;if(o==="WezTerm"||o==="ghostty")return!0;if(o==="vscode"){const s=r.split("."),t=Number.parseInt(s[0]??"0",10),p=Number.parseInt(s[1]??"0",10);return t>1||t===1&&p>=72}if(process.env.WT_SESSION)return!0;const e=process.env.VTE_VERSION;if(e){const s=Number.parseInt(e,10);return s>=5e3&&s!==5e3}return!1},l=()=>process.env.FORCE_HYPERLINK?process.env.FORCE_HYPERLINK!=="0":(n!==void 0||(n=m()),n);function v({children:o,fallback:r=!0,url:e}){const s=c(t=>l()?u(t,e):r===!1?t:typeof r=="function"?r(t,e):`${t} ${e}`,[r,e]);return i(a,{transform:s,children:i(f,{children:o})})}export{v as Link,v as default};
@@ -0,0 +1,29 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { SpinnerName } from '@visulima/spinner';
3
+ import { ReactNode, ReactElement } from 'react';
4
+ import { LiteralUnion } from 'type-fest';
5
+ type Props = {
6
+ /**
7
+ * Optional message rendered after the spinner.
8
+ */
9
+ readonly children?: ReactNode;
10
+ /**
11
+ * Color used for the spinner and label.
12
+ * @default "cyan"
13
+ */
14
+ readonly color?: LiteralUnion<AnsiColors, string>;
15
+ /**
16
+ * Spinner preset.
17
+ * @default "dots"
18
+ */
19
+ readonly type?: SpinnerName;
20
+ };
21
+ /**
22
+ * Compact spinner + label for loading states.
23
+ */
24
+ declare function LoadingIndicator({
25
+ children,
26
+ color,
27
+ type
28
+ }: Props): ReactElement;
29
+ export { LoadingIndicator, type Props as LoadingIndicatorProps, Props, LoadingIndicator as default };
@@ -0,0 +1 @@
1
+ import{jsxs as a,jsx as o}from"react/jsx-runtime";import{Box as c}from"./box.js";import{Spinner as d}from"./spinner.js";import{Text as i}from"./text.js";function m({children:r,color:n="cyan",type:t="dots"}){return a(c,{gap:1,children:[o(i,{color:n,children:o(d,{type:t})}),r===void 0?void 0:o(i,{color:n,children:r})]})}export{m as LoadingIndicator,m as default};
@@ -0,0 +1,40 @@
1
+ import { ReactElement } from 'react';
2
+ type Props = {
3
+ /**
4
+ * The Markdown source string.
5
+ */
6
+ readonly children: string;
7
+ /**
8
+ * Shiki theme for code block syntax highlighting.
9
+ * @default "github-dark-default"
10
+ */
11
+ readonly codeTheme?: string;
12
+ /**
13
+ * Maximum width for text wrapping. Defaults to terminal width.
14
+ */
15
+ readonly maxWidth?: number;
16
+ /**
17
+ * Enable streaming mode for progressive rendering.
18
+ * When true, the component re-renders on every prop change and handles
19
+ * incomplete Markdown gracefully (e.g., unclosed code fences, partial lists).
20
+ * Useful for rendering AI-generated text arriving token-by-token.
21
+ * @default false
22
+ */
23
+ readonly streaming?: boolean;
24
+ };
25
+ /**
26
+ * Render Markdown content as Ink terminal UI elements.
27
+ *
28
+ * ```tsx
29
+ * &lt;Markdown>{"# Hello\n\nThis is **bold** and *italic*."}&lt;/Markdown>
30
+ * &lt;Markdown codeTheme="github-dark-default">{"```js\nconst x = 1;\n```"}&lt;/Markdown>
31
+ * &lt;Markdown streaming>{"# Streaming\n\nText arriving..."}&lt;/Markdown>
32
+ * ```
33
+ */
34
+ declare function Markdown({
35
+ children,
36
+ codeTheme,
37
+ maxWidth: maxWidthProp,
38
+ streaming
39
+ }: Props): ReactElement;
40
+ export { Markdown, type Props as MarkdownProps, Props, Markdown as default };
@@ -0,0 +1 @@
1
+ import{jsx as r,jsxs as x}from"react/jsx-runtime";import{Lexer as C}from"marked";import k,{useMemo as b}from"react";import D from"../ink/hooks/use-window-size.js";import{Box as l}from"./box.js";import{Code as F}from"./code.js";import{Link as M}from"./link.js";import{Newline as w}from"./newline.js";import{OrderedList as j}from"./ordered-list.js";import{Table as v}from"./table.js";import{Text as m}from"./text.js";import{UnorderedList as B}from"./unordered-list.js";const q={1:"cyan",2:"green",3:"yellow",4:"blue",5:"magenta",6:"gray"};function p(c){return!c||c.length===0?null:c.map((a,t)=>{switch(a.type){case"br":return r(w,{},t);case"codespan":return x(m,{inverse:!0,children:[" ",a.text," "]},t);case"del":return r(m,{strikethrough:!0,children:p(a.tokens)},t);case"em":return r(m,{italic:!0,children:p(a.tokens)},t);case"escape":return r(k.Fragment,{children:a.text},t);case"image":{const e=a;return x(m,{dimColor:!0,children:["[image:"," ",e.text||e.href,"]"]},t)}case"link":{const e=a;return r(M,{url:e.href,children:p(e.tokens)??e.text},t)}case"strong":return r(m,{bold:!0,children:p(a.tokens)},t);case"text":return r(k.Fragment,{children:a.text},t);default:{const e="raw"in a?a.raw:"";return r(k.Fragment,{children:e},t)}}})}function T(c){return c.map(a=>{const t=a.tokens??[],e=t.find(i=>i.type==="text"),n=p(e?.tokens??t),h=t.find(i=>i.type==="list");return{children:h?T(h.items):void 0,label:n}})}function $(c,a,t){const e=[];for(const[n,h]of c.entries()){const i=h,s=n>0?1:0;switch(i.type){case"blockquote":{const o=i;e.push(r(l,{borderLeft:!0,borderLeftColor:"gray",marginTop:s,paddingLeft:1,children:r(l,{flexDirection:"column",children:$(o.tokens,a,t-3)})},n));break}case"code":{const o=i;e.push(r(l,{marginTop:s,children:r(F,{code:o.text,language:o.lang,theme:a})},n));break}case"heading":{const o=i,d=q[o.depth]??"white",g=`${"#".repeat(o.depth)} `;e.push(r(l,{marginTop:s,children:x(m,{bold:!0,color:d,children:[g,p(o.tokens)]})},n));break}case"hr":{e.push(r(l,{marginTop:s,children:r(m,{dimColor:!0,children:"─".repeat(Math.min(t,40))})},n));break}case"html":{const o=i.text.replaceAll(/<[^>]*>/g,"");o.trim()&&e.push(r(l,{marginTop:s,children:r(m,{dimColor:!0,children:o})},n));break}case"list":{const o=i,d=T(o.items);o.ordered?e.push(r(l,{marginTop:s,children:r(j,{items:d})},n)):e.push(r(l,{marginTop:s,children:r(B,{items:d})},n));break}case"paragraph":{const o=i;e.push(r(l,{marginTop:s,children:r(m,{wrap:"wrap",children:p(o.tokens)})},n));break}case"space":{e.push(r(w,{},n));break}case"table":{const o=i,d=(o.header??[]).map(u=>u.text),g=(o.rows??[]).map(u=>u.map(f=>f.text)).map(u=>{const f={};return d.forEach((y,L)=>{f[y]=u[L]??""}),f});e.push(r(l,{marginTop:s,children:r(v,{data:g})},n));break}default:{const o="raw"in i?i.raw:"",d="text"in i?i.text:o;d&&e.push(r(l,{marginTop:s,children:r(m,{children:d})},n));break}}}return e}function A(c,a){const t=C.lex(c);if(!a||c.length===0)return t;let e=0;for(const n of t)e+=n.raw?.length??0;if(e<c.length){const n=c.slice(e);n.trim().length>0&&t.push({raw:n,text:n,tokens:[{raw:n,text:n,type:"text"}],type:"paragraph"})}return t}function P({children:c,codeTheme:a="github-dark-default",maxWidth:t,streaming:e=!1}){const{columns:n}=D(),h=t??n??80,i=b(()=>A(c,e),[c,e]),s=b(()=>$(i,a,h),[i,a,h]);return r(l,{flexDirection:"column",children:s})}export{P as Markdown,P as default};
@@ -0,0 +1,50 @@
1
+ import { ReactElement } from 'react';
2
+ type Props = {
3
+ /**
4
+ * Initial raw value (digits/characters only, without mask symbols).
5
+ */
6
+ readonly defaultValue?: string;
7
+ /**
8
+ * Disable input and dim the display.
9
+ */
10
+ readonly isDisabled?: boolean;
11
+ /**
12
+ * Mask definition. Each `#` is replaced with a user character; any other
13
+ * character is rendered literally. Example: `(###) ###-####`.
14
+ */
15
+ readonly mask: string;
16
+ /**
17
+ * Called whenever the underlying raw value changes.
18
+ */
19
+ readonly onChange?: (value: string) => void;
20
+ /**
21
+ * Called when the user presses Enter with the current raw value.
22
+ */
23
+ readonly onSubmit?: (value: string) => void;
24
+ /**
25
+ * Placeholder character used in the mask for empty positions.
26
+ * @default "_"
27
+ */
28
+ readonly placeholderChar?: string;
29
+ /**
30
+ * Sentinel character in the mask string used to mark editable positions.
31
+ * @default "#" (hash)
32
+ */
33
+ readonly token?: string;
34
+ };
35
+ /**
36
+ * Input with a fixed-width mask. The mask token (`#` by default) marks
37
+ * positions where the user can type; every other character is preserved.
38
+ * Supports ←/→ to move within the mask, Home/End to jump, and
39
+ * Backspace/Delete to clear characters.
40
+ */
41
+ declare function MaskedInput({
42
+ defaultValue,
43
+ isDisabled,
44
+ mask,
45
+ onChange,
46
+ onSubmit,
47
+ placeholderChar,
48
+ token
49
+ }: Props): ReactElement;
50
+ export { MaskedInput, type Props as MaskedInputProps, Props, MaskedInput as default };
@@ -0,0 +1 @@
1
+ import{jsxs as T,jsx as x}from"react/jsx-runtime";import{useMemo as V,useState as M,useCallback as A}from"react";import B from"../ink/hooks/use-input.js";import{Box as D}from"./box.js";import{Text as C}from"./text.js";const I=(m,n)=>{const s=[];let i=0;for(const[l,o]of[...m].entries())o===n&&(s.push({maskColumn:l,rawPosition:i}),i+=1);return s},L=(m,n,s,i)=>{let l=0,o="";for(const f of n)if(f===s){const u=m[l];u===void 0?o+=i:(o+=u,l+=1)}else o+=f;return o};function F({defaultValue:m="",isDisabled:n=!1,mask:s,onChange:i,onSubmit:l,placeholderChar:o="_",token:f="#"}){const u=V(()=>I(s,f),[s,f]),h=u.length,b=m.slice(0,h),[e,v]=M(b),[t,d]=M(b.length),g=A((c,r)=>{v(c),d(Math.max(0,Math.min(h,r))),i?.(c)},[h,i]);B(A((c,r)=>{if(r.return){l?.(e);return}if(r.leftArrow){d(a=>Math.max(0,a-1));return}if(r.rightArrow){d(a=>Math.min(e.length,a+1));return}if(r.home||r.ctrl&&c==="a"){d(0);return}if(r.end||r.ctrl&&c==="e"){d(e.length);return}if(r.backspace){if(t===0)return;const a=e.slice(0,t-1)+e.slice(t);g(a,t-1);return}if(r.delete){if(t>=e.length)return;const a=e.slice(0,t)+e.slice(t+1);g(a,t);return}if(c.length!==1||e.length>=h)return;const S=e.slice(0,t)+c+e.slice(t);g(S,t+1)},[e,t,h,g,l]),{isActive:!n});const p=L(e,s,f,o),k=u[t]?.maskColumn??s.length,w=p.slice(0,k),j=p.charAt(k)||" ",P=p.slice(k+1);return T(D,{children:[x(C,{dimColor:n,children:w}),x(C,{dimColor:n,inverse:!n,children:j}),x(C,{dimColor:n,children:P})]})}export{F as MaskedInput,F as default};
@@ -0,0 +1,78 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactNode, ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type MenuItem = {
5
+ /**
6
+ * Optional hotkey rendered on the right side of the row (e.g. `"Ctrl+S"`).
7
+ */
8
+ readonly hotkey?: string;
9
+ /**
10
+ * Optional icon rendered before the label.
11
+ */
12
+ readonly icon?: ReactNode;
13
+ /**
14
+ * Identifier returned by `onSelect`.
15
+ */
16
+ readonly id: string;
17
+ /**
18
+ * When true, renders the item dimmed and skips it during navigation.
19
+ */
20
+ readonly isDisabled?: boolean;
21
+ /**
22
+ * Human-readable label.
23
+ */
24
+ readonly label: ReactNode;
25
+ };
26
+ type MenuSection = {
27
+ readonly id: string;
28
+ readonly items: ReadonlyArray<MenuItem>;
29
+ readonly title?: string;
30
+ };
31
+ type Props = {
32
+ /**
33
+ * Accent color for the focused item.
34
+ * @default "blue"
35
+ */
36
+ readonly accentColor?: LiteralUnion<AnsiColors, string>;
37
+ /**
38
+ * Auto-focus the menu on mount.
39
+ */
40
+ readonly autoFocus?: boolean;
41
+ /**
42
+ * Render a border around the menu.
43
+ * @default true
44
+ */
45
+ readonly bordered?: boolean;
46
+ /**
47
+ * Flat list of items. Ignored if `sections` is provided.
48
+ */
49
+ readonly items?: ReadonlyArray<MenuItem>;
50
+ /**
51
+ * Called with the item id when the user presses Enter.
52
+ */
53
+ readonly onSelect: (id: string) => void;
54
+ /**
55
+ * Grouped items. Takes precedence over `items`.
56
+ */
57
+ readonly sections?: ReadonlyArray<MenuSection>;
58
+ /**
59
+ * Optional title rendered at the top of the menu.
60
+ */
61
+ readonly title?: string;
62
+ };
63
+ /**
64
+ * Dropdown / context menu with optional sections and disabled items.
65
+ * Keyboard: ↑/↓ (or j/k) to navigate, Enter to select, Esc to cancel.
66
+ * @returns A `ReactElement` rendering the menu, optionally wrapped in a
67
+ * rounded border when `bordered` is true.
68
+ */
69
+ declare function Menu({
70
+ accentColor,
71
+ autoFocus,
72
+ bordered,
73
+ items,
74
+ onSelect,
75
+ sections,
76
+ title
77
+ }: Props): ReactElement;
78
+ export { Menu, MenuItem, type Props as MenuProps, MenuSection, Props, Menu as default };
@@ -0,0 +1 @@
1
+ import{jsxs as b,jsx as l}from"react/jsx-runtime";import{useMemo as g,useState as A,useRef as F,useEffect as j,useCallback as y}from"react";import M from"../ink/hooks/use-focus.js";import $ from"../ink/hooks/use-input.js";import{Box as m}from"./box.js";import{Text as f}from"./text.js";const B=(t,r)=>{if(r&&r.length>0){const o=[];for(const i of r){i.title!==void 0&&o.push({kind:"section-header",sectionId:i.id,title:i.title});for(const d of i.items)o.push({item:d,kind:"item",sectionId:i.id})}return o}return(t??[]).map(o=>({item:o,kind:"item",sectionId:void 0}))},w=(t,r,o)=>{const i=t.length;if(i===0)return r;for(let d=1;d<=i;d+=1){const a=(r+o*d+i*d)%i,h=t[a];if(h?.kind==="item"&&!h.item.isDisabled)return a}return r},I=t=>{for(const[r,o]of t.entries())if(o.kind==="item"&&!o.item.isDisabled)return r;return 0};function W({accentColor:t="blue",autoFocus:r=!1,bordered:o=!0,items:i,onSelect:d,sections:a,title:h}){const{isFocused:p}=M({autoFocus:r}),n=g(()=>B(i,a),[i,a]),S=g(()=>I(n),[n]),[k,v]=A(S),u=F(k);u.current=k,j(()=>{const{current:s}=u,c=n[s];if(!(c?.kind==="item"&&!c.item.isDisabled)){const e=I(n);v(e),u.current=e}},[n]),$(y((s,c)=>{if(p){if(c.downArrow||s==="j")v(w(n,u.current,1));else if(c.upArrow||s==="k")v(w(n,u.current,-1));else if(c.return){const e=n[u.current];e?.kind==="item"&&!e.item.isDisabled&&d(e.item.id)}}},[p,n,d]),{isActive:p});const D=b(m,{flexDirection:"column",children:[h===void 0?void 0:l(m,{marginBottom:1,children:l(f,{bold:!0,color:t,children:h})}),n.map((s,c)=>{if(s.kind==="section-header")return l(m,{marginTop:c===0?0:1,children:l(f,{dimColor:!0,children:s.title.toUpperCase()})},`header:${s.sectionId}`);const{item:e}=s,x=p&&c===k,C=x?t:void 0;return b(m,{children:[l(f,{color:C,dimColor:e.isDisabled,children:x?"▸ ":" "}),e.icon===void 0?void 0:b(f,{color:C,dimColor:e.isDisabled,children:[e.icon," "]}),l(m,{flexGrow:1,flexShrink:1,minWidth:0,children:l(f,{bold:x,color:C,dimColor:e.isDisabled,wrap:"truncate-end",children:e.label})}),e.hotkey===void 0?void 0:l(m,{flexShrink:0,children:b(f,{dimColor:!0,children:[" ",e.hotkey]})})]},`item:${e.id}`)})]});return o?l(m,{borderColor:p?t:void 0,borderStyle:"round",paddingX:1,children:D}):D}export{W as Menu,W as default};
@@ -0,0 +1,43 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactNode, ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type MessageRole = "assistant" | "system" | "tool" | "user";
5
+ type Props = {
6
+ /**
7
+ * Bubble body.
8
+ */
9
+ readonly children: ReactNode;
10
+ /**
11
+ * Color override.
12
+ */
13
+ readonly color?: LiteralUnion<AnsiColors, string>;
14
+ /**
15
+ * When true, draws the bubble without a border.
16
+ */
17
+ readonly flat?: boolean;
18
+ /**
19
+ * Text rendered above the bubble (name, model, etc.).
20
+ */
21
+ readonly label?: string;
22
+ /**
23
+ * Optional metadata rendered next to the label (e.g. timestamp).
24
+ */
25
+ readonly meta?: string;
26
+ /**
27
+ * Determines the alignment, color, and icon of the bubble.
28
+ * @default "assistant"
29
+ */
30
+ readonly role?: MessageRole;
31
+ };
32
+ /**
33
+ * Chat-style message bubble for AI agent UIs.
34
+ */
35
+ declare function MessageBubble({
36
+ children,
37
+ color,
38
+ flat,
39
+ label,
40
+ meta,
41
+ role
42
+ }: Props): ReactElement;
43
+ export { MessageBubble, type Props as MessageBubbleProps, MessageRole, Props, MessageBubble as default };
@@ -0,0 +1 @@
1
+ import{jsxs as a,jsx as o}from"react/jsx-runtime";import{Box as i}from"./box.js";import{Text as e}from"./text.js";const f={assistant:{align:"flex-start",color:"blueBright",icon:""},system:{align:"flex-start",color:"gray",icon:""},tool:{align:"flex-start",color:"magentaBright",icon:""},user:{align:"flex-end",color:"greenBright",icon:""}};function u({children:r,color:d,flat:s=!1,label:l,meta:n,role:g="assistant"}){const c=f[g],t=d??c.color;return a(i,{alignSelf:c.align,flexDirection:"column",marginBottom:1,children:[l===void 0&&n===void 0?void 0:a(i,{gap:1,paddingX:1,children:[l===void 0?void 0:o(e,{bold:!0,color:t,children:l}),n===void 0?void 0:o(e,{dimColor:!0,children:n})]}),s?a(i,{paddingX:1,children:[o(e,{color:t,children:"│ "}),o(i,{flexDirection:"column",flexGrow:1,children:typeof r=="string"?o(e,{children:r}):r})]}):o(i,{borderColor:t,borderStyle:"round",flexDirection:"column",paddingX:1,children:typeof r=="string"?o(e,{children:r}):r})]})}export{u as MessageBubble,u as default};
@@ -0,0 +1,39 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactNode, ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type Props = {
5
+ /**
6
+ * Background color of the badge.
7
+ * @default "magenta"
8
+ */
9
+ readonly color?: LiteralUnion<AnsiColors, string>;
10
+ /**
11
+ * Optional icon/symbol (e.g. `✨`, `◈`) shown before the label.
12
+ */
13
+ readonly icon?: ReactNode;
14
+ /**
15
+ * Short model identifier, e.g. `claude-opus-4.6`.
16
+ */
17
+ readonly model: string;
18
+ /**
19
+ * Optional provider name rendered as a separate chip before the model.
20
+ */
21
+ readonly provider?: string;
22
+ /**
23
+ * Visual style.
24
+ * @default "solid"
25
+ */
26
+ readonly variant?: "outline" | "solid" | "subtle";
27
+ };
28
+ /**
29
+ * Pill-shaped chip identifying the active model / provider. Pair with
30
+ * `MessageBubble` to label assistant output.
31
+ */
32
+ declare function ModelBadge({
33
+ color,
34
+ icon,
35
+ model,
36
+ provider,
37
+ variant
38
+ }: Props): ReactElement;
39
+ export { ModelBadge, type Props as ModelBadgeProps, Props, ModelBadge as default };
@@ -0,0 +1 @@
1
+ import{jsxs as o,jsx as l,Fragment as u}from"react/jsx-runtime";import{Box as m}from"./box.js";import{Text as r}from"./text.js";function g({color:e="magenta",icon:i,model:c,provider:t,variant:a="solid"}){const s=d=>{const n=i===void 0?void 0:o(u,{children:[i," "]});return a==="outline"?l(m,{borderColor:e,borderStyle:"round",paddingX:1,children:o(r,{color:e,children:[n,d]})}):a==="subtle"?o(r,{color:e,children:[n,d]}):o(r,{backgroundColor:e,color:"black",children:[" ",n,d," "]})};return t===void 0?s(c):o(m,{children:[l(r,{dimColor:!0,children:t}),l(r,{dimColor:!0,children:"/"}),s(c)]})}export{g as ModelBadge,g as default};
@@ -0,0 +1,65 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type MultiSelectOption = {
5
+ readonly key?: string;
6
+ readonly label: string;
7
+ readonly value: string;
8
+ };
9
+ type Props = {
10
+ /**
11
+ * Color for the focused item indicator and selected checkmarks.
12
+ * @default "blue"
13
+ */
14
+ readonly accentColor?: LiteralUnion<AnsiColors, string>;
15
+ /**
16
+ * Color for unselected, unfocused option labels.
17
+ */
18
+ readonly defaultColor?: LiteralUnion<AnsiColors, string>;
19
+ /**
20
+ * Initially selected values.
21
+ */
22
+ readonly defaultValue?: ReadonlyArray<string>;
23
+ /**
24
+ * When true, all input is ignored and labels are dimmed.
25
+ * @default false
26
+ */
27
+ readonly isDisabled?: boolean;
28
+ /**
29
+ * Whether the parent has focus. When false, indicators are dimmed.
30
+ * @default true
31
+ */
32
+ readonly isFocused?: boolean;
33
+ /**
34
+ * Number of visible options before scrolling.
35
+ * When omitted, auto-limits to terminal height.
36
+ */
37
+ readonly limit?: number;
38
+ /**
39
+ * Fires when the set of selected values changes (space to toggle).
40
+ */
41
+ readonly onChange?: (values: ReadonlyArray<string>) => void;
42
+ /**
43
+ * Fires when the user presses Enter to submit.
44
+ */
45
+ readonly onSubmit?: (values: ReadonlyArray<string>) => void;
46
+ /**
47
+ * Available choices to pick from.
48
+ */
49
+ readonly options: ReadonlyArray<MultiSelectOption>;
50
+ };
51
+ /**
52
+ * Renders a multi-choice selection list with checkboxes and keyboard navigation.
53
+ */
54
+ declare function MultiSelect({
55
+ accentColor,
56
+ defaultColor,
57
+ defaultValue,
58
+ isDisabled,
59
+ isFocused,
60
+ limit: customLimit,
61
+ onChange,
62
+ onSubmit,
63
+ options
64
+ }: Props): ReactElement;
65
+ export { MultiSelect, MultiSelectOption, type Props as MultiSelectProps, Props, MultiSelect as default };
@@ -0,0 +1 @@
1
+ import{jsx as m,jsxs as S}from"react/jsx-runtime";import{useReducer as V,useState as B,useRef as f,useMemo as E,useCallback as F}from"react";import U from"../ink/hooks/use-input.js";import W from"../ink/hooks/use-window-size.js";import{Box as A}from"./box.js";import{Text as a}from"./text.js";const Y=[],q=(o,u)=>{switch(u.type){case"focus":return{...o,focusedIndex:u.index};case"focus-next":{const i=o.focusedIndex+1,c=i>=o.visibleFrom+u.limit;return{...o,focusedIndex:i,visibleFrom:c?o.visibleFrom+1:o.visibleFrom}}case"focus-prev":{const i=o.focusedIndex-1,c=i<o.visibleFrom;return{...o,focusedIndex:i,visibleFrom:c?o.visibleFrom-1:o.visibleFrom}}default:return o}};function N({accentColor:o="blue",defaultColor:u,defaultValue:i=Y,isDisabled:c=!1,isFocused:v=!0,limit:g,onChange:C,onSubmit:I,options:t}){const{rows:D}=W(),l=Math.min(typeof g=="number"?g:D,t.length),[s,w]=V(q,{focusedIndex:0,visibleFrom:0}),[b,k]=B(i),M=f(b);M.current=b;const j=f(I);j.current=I;const p=f(C);p.current=C;const x=f(s);x.current=s;const T=E(()=>t.slice(s.visibleFrom,s.visibleFrom+l),[t,s.visibleFrom,l]),y=F(()=>{const e=t[x.current.focusedIndex]?.value;e&&k(r=>{const n=r.includes(e)?r.filter(d=>d!==e):[...r,e];return p.current?.(n),n})},[t]),R=F(()=>{k(e=>{const r=e.length===t.length?[]:t.map(n=>n.value);return p.current?.(r),r})},[t]);return U(F((e,r)=>{const{focusedIndex:n}=x.current;(r.downArrow||e==="j")&&n<t.length-1&&w({limit:l,type:"focus-next"}),(r.upArrow||e==="k")&&n>0&&w({limit:l,type:"focus-prev"}),e===" "&&y(),e==="a"&&R(),r.return&&j.current?.(M.current)},[t.length,l,y,R]),{isActive:!c&&v}),m(A,{flexDirection:"column",children:T.map((e,r)=>{const n=s.visibleFrom+r===s.focusedIndex,d=b.includes(e.value);let h=u;return d?h="green":n&&(h=o),S(A,{gap:1,children:[n?m(a,{color:o,dimColor:!v,children:"▸"}):m(a,{children:" "}),S(a,{color:h,dimColor:c,children:[d?"◼":"◻"," ",e.label]}),d?m(a,{color:"green",dimColor:!v,children:"✓"}):void 0]},e.key??e.value)})})}export{N as MultiSelect,N as default};
@@ -0,0 +1,15 @@
1
+ import { ReactElement } from 'react';
2
+ type Props = {
3
+ /**
4
+ * Number of newlines to insert.
5
+ * @default 1
6
+ */
7
+ readonly count?: number;
8
+ };
9
+ /**
10
+ * Adds one or more newline (`\n`) characters. Must be used within `&lt;Text>` components.
11
+ */
12
+ declare function Newline({
13
+ count
14
+ }: Props): ReactElement;
15
+ export { Newline, type Props as NewlineProps, Props, Newline as default };
@@ -0,0 +1,2 @@
1
+ import{jsx as t}from"react/jsx-runtime";function r({count:e=1}){return t("ink-text",{children:`
2
+ `.repeat(e)})}export{r as Newline,r as default};
@@ -0,0 +1,49 @@
1
+ import { ReactNode, ReactElement } from 'react';
2
+ type OperationStatus = "completed" | "error" | "pending" | "running" | "skipped";
3
+ type OperationNode = {
4
+ /**
5
+ * Nested child operations rendered beneath this node.
6
+ */
7
+ readonly children?: ReadonlyArray<OperationNode>;
8
+ /**
9
+ * Optional supplementary info rendered on the next line (dimmed).
10
+ */
11
+ readonly details?: ReactNode;
12
+ /**
13
+ * Wall-clock duration in ms, displayed right-aligned.
14
+ */
15
+ readonly durationMs?: number;
16
+ /**
17
+ * Unique identifier within the tree.
18
+ */
19
+ readonly id: string;
20
+ /**
21
+ * Human-readable label.
22
+ */
23
+ readonly label: ReactNode;
24
+ /**
25
+ * Lifecycle state controlling icon + color.
26
+ */
27
+ readonly status: OperationStatus;
28
+ };
29
+ type Props = {
30
+ /**
31
+ * Tree of operations. Each node can have its own children.
32
+ */
33
+ readonly nodes: ReadonlyArray<OperationNode>;
34
+ /**
35
+ * When true, runs the running-spinner animation.
36
+ * @default true
37
+ */
38
+ readonly showSpinner?: boolean;
39
+ };
40
+ /**
41
+ * Renders a tree of operations with per-node status. Perfect for agent
42
+ * progress panels (reading → editing → running tests → done).
43
+ * @returns A `ReactElement` rendering the nested tree of operation rows.
44
+ */
45
+ declare function OperationTree({
46
+ nodes,
47
+ showSpinner
48
+ }: Props): ReactElement;
49
+ export { OperationNode, OperationStatus, OperationTree, type Props as OperationTreeProps, Props, OperationTree as default };
@@ -0,0 +1 @@
1
+ import{jsx as n,jsxs as s,Fragment as S}from"react/jsx-runtime";import{Box as t}from"./box.js";import{Spinner as k}from"./spinner.js";import{Text as o}from"./text.js";const w={completed:"green",error:"red",pending:"gray",running:"cyan",skipped:"yellow"},C={completed:"✔",error:"✖",pending:"○",skipped:"⊘"},y=e=>{if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const r=Math.round(e/1e3),i=Math.floor(r/60),d=r%60;return`${i}m ${d}s`},h=({isLast:e,node:r,prefix:i,showSpinner:d})=>{const p=w[r.status],c=e?"└─ ":"├─ ",u=i.length===0?"":c,l=i+(e?" ":"│ "),m=d?n(k,{type:"dots"}):"…",f=r.status==="running"?m:C[r.status];return s(S,{children:[s(t,{children:[n(o,{dimColor:!0,children:i}),n(o,{dimColor:!0,children:u}),n(t,{flexShrink:0,children:n(o,{color:p,children:f})}),n(o,{children:" "}),n(t,{flexGrow:1,flexShrink:1,minWidth:0,children:n(o,{bold:r.status==="running",color:r.status==="pending"?"gray":void 0,dimColor:r.status==="skipped",wrap:"truncate-end",children:r.label})}),r.durationMs===void 0?void 0:n(t,{flexShrink:0,children:s(o,{dimColor:!0,children:[" ",y(r.durationMs)]})})]}),r.details===void 0?void 0:s(t,{children:[n(o,{dimColor:!0,children:l}),n(o,{dimColor:!0,children:r.details})]}),r.children?.map((a,x,g)=>n(h,{isLast:x===g.length-1,node:a,prefix:l,showSpinner:d},a.id))]})};function T({nodes:e,showSpinner:r=!0}){return n(t,{flexDirection:"column",children:e.map((i,d)=>n(h,{isLast:d===e.length-1,node:i,prefix:"",showSpinner:r},i.id))})}export{T as OperationTree,T as default};