@visulima/tui 1.0.0-alpha.2 → 1.0.0-alpha.21

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 (658) hide show
  1. package/CHANGELOG.md +300 -0
  2. package/LICENSE.md +2490 -69
  3. package/README.md +38 -10
  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 +58 -5
  193. package/dist/core/index.js +1 -5
  194. package/dist/ink/hooks/use-animation.d.ts +37 -39
  195. package/dist/ink/hooks/use-animation.js +1 -0
  196. package/dist/ink/hooks/use-app.d.ts +36 -4
  197. package/dist/ink/hooks/use-app.js +1 -0
  198. package/dist/ink/hooks/use-box-metrics.d.ts +58 -50
  199. package/dist/ink/hooks/use-box-metrics.js +1 -0
  200. package/dist/ink/hooks/use-clipboard.d.ts +26 -25
  201. package/dist/ink/hooks/use-clipboard.js +1 -0
  202. package/dist/ink/hooks/use-color-blindness.d.ts +29 -29
  203. package/dist/ink/hooks/use-color-blindness.js +1 -0
  204. package/dist/ink/hooks/use-console-capture.d.ts +38 -38
  205. package/dist/ink/hooks/use-console-capture.js +1 -0
  206. package/dist/ink/hooks/use-cursor.d.ts +10 -9
  207. package/dist/ink/hooks/use-cursor.js +1 -0
  208. package/dist/ink/hooks/use-focus-manager.d.ts +53 -38
  209. package/dist/ink/hooks/use-focus-manager.js +1 -0
  210. package/dist/ink/hooks/use-focus.d.ts +29 -25
  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 +142 -142
  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 +4 -4
  221. package/dist/ink/hooks/use-is-screen-reader-enabled.js +1 -0
  222. package/dist/ink/hooks/use-key-bindings.d.ts +50 -52
  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 +45 -37
  227. package/dist/ink/hooks/use-linked-scroll.js +1 -0
  228. package/dist/ink/hooks/use-paste.d.ts +41 -40
  229. package/dist/ink/hooks/use-paste.js +1 -0
  230. package/dist/ink/hooks/use-persistent-state.d.ts +56 -0
  231. package/dist/ink/hooks/use-persistent-state.js +2 -0
  232. package/dist/ink/hooks/use-scroll-acceleration.d.ts +43 -43
  233. package/dist/ink/hooks/use-scroll-acceleration.js +1 -0
  234. package/dist/ink/hooks/use-scroll-input.d.ts +31 -31
  235. package/dist/ink/hooks/use-scroll-input.js +1 -0
  236. package/dist/ink/hooks/use-stderr.d.ts +14 -4
  237. package/dist/ink/hooks/use-stderr.js +1 -0
  238. package/dist/ink/hooks/use-stdin.d.ts +28 -5
  239. package/dist/ink/hooks/use-stdin.js +1 -0
  240. package/dist/ink/hooks/use-stdout.d.ts +14 -4
  241. package/dist/ink/hooks/use-stdout.js +1 -0
  242. package/dist/ink/hooks/use-stopwatch.d.ts +36 -37
  243. package/dist/ink/hooks/use-stopwatch.js +1 -0
  244. package/dist/ink/hooks/use-terminal-palette.d.ts +17 -16
  245. package/dist/ink/hooks/use-terminal-palette.js +1 -0
  246. package/dist/ink/hooks/use-text-buffer.d.ts +37 -37
  247. package/dist/ink/hooks/use-text-buffer.js +4 -0
  248. package/dist/ink/hooks/use-text-selection.d.ts +41 -41
  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 +45 -46
  253. package/dist/ink/hooks/use-timer.js +1 -0
  254. package/dist/ink/hooks/use-window-size.d.ts +14 -14
  255. package/dist/ink/hooks/use-window-size.js +1 -0
  256. package/dist/ink/index.d.ts +398 -159
  257. package/dist/ink/index.js +1 -100
  258. package/dist/packem_chunks/devtools.js +3 -26
  259. package/dist/packem_shared/COLOR_BLINDNESS_SIMULATION-DqErf7XX.js +1 -0
  260. package/dist/packem_shared/Cell-BrXn3jxY.js +1 -0
  261. package/dist/packem_shared/ControlledScrollView-CIc-x1Cx.js +1 -0
  262. package/dist/packem_shared/DevTools-ClAYpMVI.js +1 -0
  263. package/dist/packem_shared/FilePicker-tYj_CIau.js +1 -0
  264. package/dist/packem_shared/FocusContext-Xy0cwJpO.js +1 -0
  265. package/dist/packem_shared/Fullscreen-CxLd1-Zu.js +1 -0
  266. package/dist/packem_shared/IMECompositionBuffer-C89PhiOu.js +1 -0
  267. package/dist/packem_shared/InputParser-B_qZcN3r.js +2 -0
  268. package/dist/packem_shared/KEY-Bk8B-3h_.js +1 -0
  269. package/dist/packem_shared/LayoutNode-B8zej4dm.js +1 -0
  270. package/dist/packem_shared/MouseProvider-PnIUKURs.js +1 -0
  271. package/dist/packem_shared/NAMED_COLORS-B9fJsYdg.js +1 -0
  272. package/dist/packem_shared/Renderer-DJXooAsp.js +1 -0
  273. package/dist/packem_shared/ResizeObserverEntry-Dq0dk8Kq.js +1 -0
  274. package/dist/packem_shared/ScrollBar-U_37hlIT.js +1 -0
  275. package/dist/packem_shared/ScrollBarBox-DwiCxilX.js +1 -0
  276. package/dist/packem_shared/ScrollList-C7nZ9ufK.js +1 -0
  277. package/dist/packem_shared/ScrollView-DKZ8OM-m.js +1 -0
  278. package/dist/packem_shared/Static-DLynr5pn.js +1 -0
  279. package/dist/packem_shared/TreeNodeMap-CspqSCpb.js +1 -0
  280. package/dist/packem_shared/TreeView-C0Iv3et8.js +1 -0
  281. package/dist/packem_shared/TuiApp-BVDXP0Cv.js +1 -0
  282. package/dist/packem_shared/TuiContext-BoJvG3NN.js +3 -0
  283. package/dist/packem_shared/accessibility-context-DDyHTwmA.js +1 -0
  284. package/dist/packem_shared/animation-context-DW3p-vpk.js +1 -0
  285. package/dist/packem_shared/ansi-parser-B6uXaq65.js +1 -0
  286. package/dist/packem_shared/ansi-tokenizer-DqX9nJuk.js +1 -0
  287. package/dist/packem_shared/app-context-BVpKlG1z.js +1 -0
  288. package/dist/packem_shared/background-context-rjOaWFki.js +1 -0
  289. package/dist/packem_shared/braille-BBjIoaN0.js +1 -0
  290. package/dist/packem_shared/buffer.d-EJkZr8uH.d.ts +39 -0
  291. package/dist/packem_shared/clipboard.d-D6lZTQ21.d.ts +23 -0
  292. package/dist/packem_shared/color-matrix.d-DSXLsB64.d.ts +50 -0
  293. package/dist/packem_shared/colorize-DbTZMrJO.js +1 -0
  294. package/dist/packem_shared/comparePoints-YxQfR_zq.js +1 -0
  295. package/dist/packem_shared/controlled-scroll-view-CcUS50jx.js +1 -0
  296. package/dist/packem_shared/createInlineLoop-DRNZ7jqH.js +2 -0
  297. package/dist/packem_shared/createScreen-CrLrxA6t.js +3 -0
  298. package/dist/packem_shared/cursor-context-CFviBqPX.js +1 -0
  299. package/dist/packem_shared/cursor-helpers.d-BONB9tky.d.ts +12 -0
  300. package/dist/packem_shared/dom-BG-LS10p.js +1 -0
  301. package/dist/packem_shared/dom.d-C1IxuLJ9.d.ts +414 -0
  302. package/dist/packem_shared/focus-context-CsT69klR.js +1 -0
  303. package/dist/packem_shared/format-time-C7Q-hQZq.js +1 -0
  304. package/dist/packem_shared/getPathToRoot-D5Hns9Er.js +1 -0
  305. package/dist/packem_shared/getScrollHeight-ClEOyLHH.js +1 -0
  306. package/dist/packem_shared/input-utils-fAxzSlNh.js +1 -0
  307. package/dist/packem_shared/input.d-CgxV2e8U.d.ts +90 -0
  308. package/dist/packem_shared/isIntersecting-B3KbKTmu.js +1 -0
  309. package/dist/packem_shared/isOsc52Supported-DKK7Uee6.js +1 -0
  310. package/dist/packem_shared/isTerminalPaletteQuerySupported-Dn2hFAZ_.js +1 -0
  311. package/dist/packem_shared/kittyFlags-C3rZLbcK.js +1 -0
  312. package/dist/packem_shared/layout-BMo200nF.js +2 -0
  313. package/dist/packem_shared/line-chart-kf7uhR0K.js +1 -0
  314. package/dist/packem_shared/measure-text-DDjHT1jD.js +3 -0
  315. package/dist/packem_shared/measureElement-BTtTFZg4.js +1 -0
  316. package/dist/packem_shared/mouse-context-DaARgUu1.js +1 -0
  317. package/dist/packem_shared/parseSgrMouse-Ccj70ijb.js +1 -0
  318. package/dist/packem_shared/processLayout-FEKj_mWu.js +1 -0
  319. package/dist/packem_shared/reconciler-CUbhOvcr.js +1 -0
  320. package/dist/packem_shared/reconciler-DIfG72R9.js +1 -0
  321. package/dist/packem_shared/render-BFio00DS.js +26 -0
  322. package/dist/packem_shared/render-Dh7HMhK1.js +1 -0
  323. package/dist/packem_shared/render.d-DuyG0zip.d.ts +417 -0
  324. package/dist/packem_shared/renderToString-BbQiRHrd.js +2 -0
  325. package/dist/packem_shared/renderToString-SDrrFvu8.js +4 -0
  326. package/dist/packem_shared/renderTreeToBuffer-CZilzyhN.js +2 -0
  327. package/dist/packem_shared/renderer-DG986Pcr.js +17 -0
  328. package/dist/packem_shared/scroll-view.d-DtpsgHLg.d.ts +119 -0
  329. package/dist/packem_shared/selection.d-Dbha5bMS.d.ts +62 -0
  330. package/dist/packem_shared/setEnableStyledLineCache-D2gZbwFM.js +1 -0
  331. package/dist/packem_shared/squashTextNodesWithMap-DCdi3SZ2.js +1 -0
  332. package/dist/packem_shared/stderr-context-BzEaUICS.js +1 -0
  333. package/dist/packem_shared/stdin-context-BTaaFagk.js +1 -0
  334. package/dist/packem_shared/stdout-context-BnblEPez.js +1 -0
  335. package/dist/packem_shared/styles.d-cMo36xQz.d.ts +396 -0
  336. package/dist/packem_shared/terminal-palette.d-D2SQjfn-.d.ts +19 -0
  337. package/dist/packem_shared/text-width-BU2eeTWn.js +2 -0
  338. package/dist/packem_shared/token-to-elements-BAZpNZsu.js +1 -0
  339. package/dist/packem_shared/treeViewTheme-1RIZyB4M.js +1 -0
  340. package/dist/packem_shared/useElementDimensions-qJ_WXFZ9.js +1 -0
  341. package/dist/packem_shared/useMouseAction-2dRfU1vE.js +1 -0
  342. package/dist/packem_shared/useMouseContext-C746G7kY.js +1 -0
  343. package/dist/packem_shared/useMousePosition-BTWfV4JK.js +1 -0
  344. package/dist/packem_shared/useOnMouseClick-nY8xLZmt.js +1 -0
  345. package/dist/packem_shared/useOnMouseHover-D3DczIol.js +1 -0
  346. package/dist/packem_shared/useOnMouseState-cRK8QvzD.js +1 -0
  347. package/dist/packem_shared/useTreeView-BoMMeRPq.js +1 -0
  348. package/dist/packem_shared/useTreeViewState-CRPCUWrb.js +1 -0
  349. package/dist/packem_shared/utils-CoviI5Vm.js +1 -0
  350. package/dist/packem_shared/variant-config-BJqpNo7H.js +1 -0
  351. package/dist/packem_shared/variant-config.d-D5NnrrQK.d.ts +2 -0
  352. package/dist/packem_shared/waitFor-Dj5zfL5s.js +4 -0
  353. package/dist/packem_shared/wrapOrTruncateStyledLine-BZ00SM8i.js +3 -0
  354. package/dist/react/index.d.ts +519 -8
  355. package/dist/react/index.js +1 -9
  356. package/dist/testing/index.d.ts +278 -135
  357. package/dist/testing/index.js +1 -260
  358. package/index.js +52 -52
  359. package/package.json +563 -38
  360. package/dist/core/app.d.ts +0 -50
  361. package/dist/core/cell.d.ts +0 -33
  362. package/dist/core/inline.d.ts +0 -22
  363. package/dist/core/input.d.ts +0 -18
  364. package/dist/core/native-binding.d.ts +0 -22
  365. package/dist/ink/ansi-to-cell.d.ts +0 -5
  366. package/dist/ink/ansi-tokenizer.d.ts +0 -38
  367. package/dist/ink/clipboard.d.ts +0 -29
  368. package/dist/ink/color-matrix.d.ts +0 -49
  369. package/dist/ink/color-utils.d.ts +0 -30
  370. package/dist/ink/colorize.d.ts +0 -4
  371. package/dist/ink/components/AccessibilityContext.d.ts +0 -4
  372. package/dist/ink/components/Alert.d.ts +0 -30
  373. package/dist/ink/components/AnimationContext.d.ts +0 -10
  374. package/dist/ink/components/App.d.ts +0 -19
  375. package/dist/ink/components/AppContext.d.ts +0 -38
  376. package/dist/ink/components/BackgroundContext.d.ts +0 -5
  377. package/dist/ink/components/Badge.d.ts +0 -27
  378. package/dist/ink/components/BigText.d.ts +0 -71
  379. package/dist/ink/components/Box.d.ts +0 -58
  380. package/dist/ink/components/Code.d.ts +0 -46
  381. package/dist/ink/components/ConfirmInput.d.ts +0 -40
  382. package/dist/ink/components/ConsoleOverlay.d.ts +0 -52
  383. package/dist/ink/components/Cursor.d.ts +0 -43
  384. package/dist/ink/components/CursorContext.d.ts +0 -12
  385. package/dist/ink/components/Dialog.d.ts +0 -93
  386. package/dist/ink/components/DiffView.d.ts +0 -71
  387. package/dist/ink/components/ErrorBoundary.d.ts +0 -17
  388. package/dist/ink/components/ErrorOverview.d.ts +0 -6
  389. package/dist/ink/components/FocusContext.d.ts +0 -17
  390. package/dist/ink/components/Gradient.d.ts +0 -38
  391. package/dist/ink/components/Help.d.ts +0 -49
  392. package/dist/ink/components/Link.d.ts +0 -34
  393. package/dist/ink/components/Markdown.d.ts +0 -34
  394. package/dist/ink/components/MultiSelect.d.ts +0 -63
  395. package/dist/ink/components/Newline.d.ts +0 -12
  396. package/dist/ink/components/OrderedList.d.ts +0 -30
  397. package/dist/ink/components/Paginator.d.ts +0 -75
  398. package/dist/ink/components/ProgressBar.d.ts +0 -51
  399. package/dist/ink/components/SelectInput.d.ts +0 -96
  400. package/dist/ink/components/SelectInputIndicator.d.ts +0 -36
  401. package/dist/ink/components/SelectInputItem.d.ts +0 -43
  402. package/dist/ink/components/Slider.d.ts +0 -92
  403. package/dist/ink/components/Spacer.d.ts +0 -7
  404. package/dist/ink/components/Spinner.d.ts +0 -42
  405. package/dist/ink/components/Static.d.ts +0 -24
  406. package/dist/ink/components/StaticRender.d.ts +0 -28
  407. package/dist/ink/components/StatusMessage.d.ts +0 -26
  408. package/dist/ink/components/StderrContext.d.ts +0 -16
  409. package/dist/ink/components/StdinContext.d.ts +0 -29
  410. package/dist/ink/components/StdoutContext.d.ts +0 -16
  411. package/dist/ink/components/Stopwatch.d.ts +0 -44
  412. package/dist/ink/components/Tab.d.ts +0 -25
  413. package/dist/ink/components/Table.d.ts +0 -80
  414. package/dist/ink/components/Tabs.d.ts +0 -104
  415. package/dist/ink/components/Text.d.ts +0 -63
  416. package/dist/ink/components/TextInput.d.ts +0 -48
  417. package/dist/ink/components/Textarea.d.ts +0 -62
  418. package/dist/ink/components/Timer.d.ts +0 -52
  419. package/dist/ink/components/Transform.d.ts +0 -16
  420. package/dist/ink/components/UnorderedList.d.ts +0 -35
  421. package/dist/ink/components/file-picker/FilePicker.d.ts +0 -75
  422. package/dist/ink/components/file-picker/index.d.ts +0 -3
  423. package/dist/ink/components/file-picker/types.d.ts +0 -38
  424. package/dist/ink/components/file-picker/use-file-system.d.ts +0 -16
  425. package/dist/ink/components/scroll/ControlledScrollView.d.ts +0 -43
  426. package/dist/ink/components/scroll/ScrollBar.d.ts +0 -20
  427. package/dist/ink/components/scroll/ScrollBarBox.d.ts +0 -15
  428. package/dist/ink/components/scroll/ScrollList.d.ts +0 -12
  429. package/dist/ink/components/scroll/ScrollView.d.ts +0 -98
  430. package/dist/ink/components/scroll/index.d.ts +0 -10
  431. package/dist/ink/components/scroll/use-state-ref.d.ts +0 -8
  432. package/dist/ink/components/tree-view/TreeView.d.ts +0 -89
  433. package/dist/ink/components/tree-view/TreeViewNode.d.ts +0 -29
  434. package/dist/ink/components/tree-view/index.d.ts +0 -11
  435. package/dist/ink/components/tree-view/theme.d.ts +0 -24
  436. package/dist/ink/components/tree-view/tree-node-map.d.ts +0 -72
  437. package/dist/ink/components/tree-view/types.d.ts +0 -55
  438. package/dist/ink/components/tree-view/use-tree-view-state.d.ts +0 -135
  439. package/dist/ink/components/tree-view/use-tree-view.d.ts +0 -26
  440. package/dist/ink/components/variant-config.d.ts +0 -10
  441. package/dist/ink/cursor-helpers.d.ts +0 -38
  442. package/dist/ink/data-limited-lru-map.d.ts +0 -21
  443. package/dist/ink/devtools-window-polyfill.d.ts +0 -1
  444. package/dist/ink/devtools.d.ts +0 -1
  445. package/dist/ink/dom.d.ts +0 -213
  446. package/dist/ink/get-max-width.d.ts +0 -3
  447. package/dist/ink/highlighter.d.ts +0 -28
  448. package/dist/ink/ime-utils.d.ts +0 -25
  449. package/dist/ink/ink.d.ts +0 -189
  450. package/dist/ink/input-parser.d.ts +0 -10
  451. package/dist/ink/input-utils.d.ts +0 -16
  452. package/dist/ink/instances.d.ts +0 -3
  453. package/dist/ink/kitty-keyboard.d.ts +0 -23
  454. package/dist/ink/layout.d.ts +0 -26
  455. package/dist/ink/log-update-native.d.ts +0 -14
  456. package/dist/ink/log-update.d.ts +0 -21
  457. package/dist/ink/measure-element.d.ts +0 -147
  458. package/dist/ink/measure-text.d.ts +0 -56
  459. package/dist/ink/mouse/Fullscreen.d.ts +0 -8
  460. package/dist/ink/mouse/MouseProvider.d.ts +0 -11
  461. package/dist/ink/mouse/ansi-parser.d.ts +0 -37
  462. package/dist/ink/mouse/constants.d.ts +0 -59
  463. package/dist/ink/mouse/index.d.ts +0 -20
  464. package/dist/ink/mouse/is-intersecting.d.ts +0 -18
  465. package/dist/ink/mouse/mouse-context.d.ts +0 -36
  466. package/dist/ink/mouse/use-element-position.d.ts +0 -29
  467. package/dist/ink/mouse/use-mouse-action.d.ts +0 -7
  468. package/dist/ink/mouse/use-mouse-position.d.ts +0 -7
  469. package/dist/ink/mouse/use-mouse.d.ts +0 -7
  470. package/dist/ink/mouse/use-on-mouse-click.d.ts +0 -14
  471. package/dist/ink/mouse/use-on-mouse-hover.d.ts +0 -8
  472. package/dist/ink/mouse/use-on-mouse-state.d.ts +0 -11
  473. package/dist/ink/output.d.ts +0 -74
  474. package/dist/ink/parse-keypress.d.ts +0 -22
  475. package/dist/ink/reconciler.d.ts +0 -3
  476. package/dist/ink/region.d.ts +0 -99
  477. package/dist/ink/render-background.d.ts +0 -4
  478. package/dist/ink/render-border.d.ts +0 -4
  479. package/dist/ink/render-node-to-output.d.ts +0 -38
  480. package/dist/ink/render-scrollbar.d.ts +0 -9
  481. package/dist/ink/render-sticky.d.ts +0 -44
  482. package/dist/ink/render-to-string.d.ts +0 -37
  483. package/dist/ink/render.d.ts +0 -191
  484. package/dist/ink/renderer.d.ts +0 -17
  485. package/dist/ink/resize-observer.d.ts +0 -44
  486. package/dist/ink/sanitize-ansi.d.ts +0 -2
  487. package/dist/ink/scroll.d.ts +0 -23
  488. package/dist/ink/selection.d.ts +0 -70
  489. package/dist/ink/squash-text-nodes.d.ts +0 -18
  490. package/dist/ink/style-flags.d.ts +0 -17
  491. package/dist/ink/styled-line-factory.d.ts +0 -25
  492. package/dist/ink/styled-line-serializer.d.ts +0 -18
  493. package/dist/ink/styled-line.d.ts +0 -109
  494. package/dist/ink/styles.d.ts +0 -369
  495. package/dist/ink/terminal-palette.d.ts +0 -25
  496. package/dist/ink/text-wrap.d.ts +0 -10
  497. package/dist/ink/token-to-elements.d.ts +0 -22
  498. package/dist/ink/utils/format-time.d.ts +0 -4
  499. package/dist/ink/utils.d.ts +0 -9
  500. package/dist/ink/wrap-text.d.ts +0 -3
  501. package/dist/ink/write-synchronized.d.ts +0 -4
  502. package/dist/packem_shared/AccessibilityContext-BLelHhNU.js +0 -7
  503. package/dist/packem_shared/Alert-Dr3s_LD9.js +0 -17
  504. package/dist/packem_shared/AnimationContext-BcJg8Jr6.js +0 -15
  505. package/dist/packem_shared/AppContext-CP0U6H7O.js +0 -11
  506. package/dist/packem_shared/BackgroundContext-BAUaxfOb.js +0 -5
  507. package/dist/packem_shared/Badge-Dk7EGGM6.js +0 -13
  508. package/dist/packem_shared/BigText-CjMdY63X.js +0 -24
  509. package/dist/packem_shared/Box-D_pSJ9Jp.js +0 -73
  510. package/dist/packem_shared/COLOR_BLINDNESS_SIMULATION-BsMy5Ewl.js +0 -81
  511. package/dist/packem_shared/Cell-DCg1kJY-.js +0 -48
  512. package/dist/packem_shared/Code-DjQvPBD9.js +0 -53
  513. package/dist/packem_shared/ConfirmInput-85Y4kRQW.js +0 -44
  514. package/dist/packem_shared/ConsoleOverlay-DBNa4vtj.js +0 -57
  515. package/dist/packem_shared/ControlledScrollView-BlOaxcsN.js +0 -286
  516. package/dist/packem_shared/ControlledScrollView-DfAhcufF.js +0 -5
  517. package/dist/packem_shared/Cursor-DiW7YoSK.js +0 -18
  518. package/dist/packem_shared/CursorContext-JxRzlqAx.js +0 -9
  519. package/dist/packem_shared/DevTools-aMPIsaHx.js +0 -61
  520. package/dist/packem_shared/Dialog-DsSNAVgC.js +0 -71
  521. package/dist/packem_shared/DiffView-hqaw-2S6.js +0 -329
  522. package/dist/packem_shared/FilePicker-DNwFxRhq.js +0 -254
  523. package/dist/packem_shared/FocusContext-CWkYtgcm.js +0 -26
  524. package/dist/packem_shared/FocusContext-D5wFxSRz.js +0 -153
  525. package/dist/packem_shared/Fullscreen-DrElAE1o.js +0 -11
  526. package/dist/packem_shared/Gradient-Ql5P0GUd.js +0 -136
  527. package/dist/packem_shared/Help-6wanGG38.js +0 -112
  528. package/dist/packem_shared/IMECompositionBuffer-Dl3S0KnF.js +0 -55
  529. package/dist/packem_shared/InputParser-BKHpWfvN.js +0 -156
  530. package/dist/packem_shared/LayoutNode-Cjnsodiy.js +0 -131
  531. package/dist/packem_shared/Link-COcKYfGT.js +0 -66
  532. package/dist/packem_shared/Markdown-y1ISztof.js +0 -212
  533. package/dist/packem_shared/MouseProvider-Y9TSSEGl.js +0 -136
  534. package/dist/packem_shared/MultiSelect-ChoLUcDI.js +0 -129
  535. package/dist/packem_shared/NAMED_COLORS-a4QBvb5r.js +0 -262
  536. package/dist/packem_shared/Newline-DBtYEg8x.js +0 -7
  537. package/dist/packem_shared/OrderedList-Cp7pXr6m.js +0 -26
  538. package/dist/packem_shared/Paginator-D1AuD-kj.js +0 -104
  539. package/dist/packem_shared/ProgressBar-DOfpVagn.js +0 -22
  540. package/dist/packem_shared/Renderer-zZ5O3vxc.js +0 -31
  541. package/dist/packem_shared/ResizeObserverEntry-Br4seLeQ.js +0 -102
  542. package/dist/packem_shared/ScrollBar-EWAs2Uc7.js +0 -106
  543. package/dist/packem_shared/ScrollBarBox-DTNNlh7R.js +0 -72
  544. package/dist/packem_shared/ScrollList-DCeIFL8M.js +0 -227
  545. package/dist/packem_shared/ScrollView-v3MCNIyX.js +0 -196
  546. package/dist/packem_shared/SelectInput-BN2TMyxp.js +0 -260
  547. package/dist/packem_shared/SelectInputIndicator-DkRMoH_b.js +0 -9
  548. package/dist/packem_shared/SelectInputItem-BF9LQgKu.js +0 -8
  549. package/dist/packem_shared/Slider-BWD7xZX6.js +0 -116
  550. package/dist/packem_shared/Spacer-Bs4ER-HK.js +0 -8
  551. package/dist/packem_shared/Spinner-BuI-kN4p.js +0 -1799
  552. package/dist/packem_shared/Static-DpTd6Eed.js +0 -22
  553. package/dist/packem_shared/Static-xmD9giJj.js +0 -18
  554. package/dist/packem_shared/StaticRender-tYwH6QXl.js +0 -33
  555. package/dist/packem_shared/StatusMessage-BtSYxzwb.js +0 -14
  556. package/dist/packem_shared/StderrContext-Bj4Mf7v7.js +0 -17
  557. package/dist/packem_shared/StdinContext-Bq_GNJ3z.js +0 -38
  558. package/dist/packem_shared/StdoutContext-CgjWeCdO.js +0 -17
  559. package/dist/packem_shared/Stopwatch-DjtTCyHn.js +0 -23
  560. package/dist/packem_shared/Tab-C6r5q4hR.js +0 -7
  561. package/dist/packem_shared/Table-D-rSVlzb.js +0 -82
  562. package/dist/packem_shared/Tabs-hki-KRnx.js +0 -153
  563. package/dist/packem_shared/Text-DvAUdZcK.js +0 -65
  564. package/dist/packem_shared/TextInput-C79WEQ5U.js +0 -137
  565. package/dist/packem_shared/Textarea-Dj06R6Zd.js +0 -272
  566. package/dist/packem_shared/Timer-wi9zuh4n.js +0 -22
  567. package/dist/packem_shared/Transform-BHxY_dAM.js +0 -14
  568. package/dist/packem_shared/TreeNodeMap-CtJUvBnd.js +0 -155
  569. package/dist/packem_shared/TreeView-C2062dtj.js +0 -148
  570. package/dist/packem_shared/TuiApp-DfxOnXqi.js +0 -120
  571. package/dist/packem_shared/TuiContext-CqEjMyXd.js +0 -415
  572. package/dist/packem_shared/UnorderedList-DhnadWjX.js +0 -33
  573. package/dist/packem_shared/ansi-parser-0BdVTKho.js +0 -41
  574. package/dist/packem_shared/ansi-tokenizer-LHq2LUWA.js +0 -307
  575. package/dist/packem_shared/boxes-oi3WUbyR.js +0 -92
  576. package/dist/packem_shared/colorize-88_Vk8cn.js +0 -48
  577. package/dist/packem_shared/comparePoints-CGMDnd3_.js +0 -287
  578. package/dist/packem_shared/createInlineLoop-BxMmcq9D.js +0 -93
  579. package/dist/packem_shared/createLinkedScrollGroup-Djw4Ceo0.js +0 -44
  580. package/dist/packem_shared/dom-DvzhsAez.js +0 -225
  581. package/dist/packem_shared/format-time-BGmnDukX.js +0 -12
  582. package/dist/packem_shared/getPathToRoot-a1wbwxfL.js +0 -4
  583. package/dist/packem_shared/getScrollHeight-BubfU_df.js +0 -63
  584. package/dist/packem_shared/input-utils-ViAEXa0Z.js +0 -19
  585. package/dist/packem_shared/isIntersecting-fEXHJN5R.js +0 -10
  586. package/dist/packem_shared/isOsc52Supported-G0k4sXJx.js +0 -36
  587. package/dist/packem_shared/isTerminalPaletteQuerySupported-EeiwMKbr.js +0 -93
  588. package/dist/packem_shared/kittyFlags-bNNf_9kX.js +0 -26
  589. package/dist/packem_shared/measure-element-Reza_yfC.js +0 -396
  590. package/dist/packem_shared/measure-text-DItZYotK.js +0 -1189
  591. package/dist/packem_shared/measureElement-CTgFCmKd.js +0 -4
  592. package/dist/packem_shared/mouse-context-BUHWKEIe.js +0 -6
  593. package/dist/packem_shared/parseSgrMouse-BHVBPP9G.js +0 -1
  594. package/dist/packem_shared/processLayout-BQ9kXfd3.js +0 -2
  595. package/dist/packem_shared/reconciler-BXf6miSS.js +0 -211
  596. package/dist/packem_shared/reconciler-gfmqURLy.js +0 -680
  597. package/dist/packem_shared/render-BAwdjfki.js +0 -2806
  598. package/dist/packem_shared/render-Bpjhf0lD.js +0 -195
  599. package/dist/packem_shared/renderToString-Cfg55DRD.js +0 -62
  600. package/dist/packem_shared/renderToString-ClIaXgrC.js +0 -86
  601. package/dist/packem_shared/renderTreeToBuffer-D3mo7M7m.js +0 -308
  602. package/dist/packem_shared/renderer-B3wROkeg.js +0 -1431
  603. package/dist/packem_shared/setEnableStyledLineCache-BpskngSJ.js +0 -2
  604. package/dist/packem_shared/squashTextNodesWithMap-iqm6OMMT.js +0 -100
  605. package/dist/packem_shared/text-width-DhuarWcB.js +0 -42
  606. package/dist/packem_shared/token-to-elements-BRFl_rzw.js +0 -249
  607. package/dist/packem_shared/treeViewTheme-BpSw9TMf.js +0 -52
  608. package/dist/packem_shared/useAnimation-kj31sA-T.js +0 -62
  609. package/dist/packem_shared/useApp-DPQlRzi5.js +0 -6
  610. package/dist/packem_shared/useBoxMetrics-rBjKc-g4.js +0 -54
  611. package/dist/packem_shared/useClipboard-B_9-adw1.js +0 -23
  612. package/dist/packem_shared/useColorBlindness-D_sTIhcb.js +0 -30
  613. package/dist/packem_shared/useConsoleCapture-Dvt7G1W1.js +0 -61
  614. package/dist/packem_shared/useCursor-BIJzc8k9.js +0 -19
  615. package/dist/packem_shared/useElementDimensions-CAoKitVD.js +0 -67
  616. package/dist/packem_shared/useFocus-CNl5QHHf.js +0 -37
  617. package/dist/packem_shared/useFocusManager-BPYaUuKQ.js +0 -16
  618. package/dist/packem_shared/useInput-Cfp5zB2s.js +0 -594
  619. package/dist/packem_shared/useIsScreenReaderEnabled-CnGKCe0f.js +0 -9
  620. package/dist/packem_shared/useKeyBindings-B78l1E1n.js +0 -66
  621. package/dist/packem_shared/useMouseAction-C5gZ2nj7.js +0 -29
  622. package/dist/packem_shared/useMouseContext-D-rFy60Q.js +0 -12
  623. package/dist/packem_shared/useMousePosition-BHBJ-kBk.js +0 -25
  624. package/dist/packem_shared/useOnMouseClick--ZIyBOBO.js +0 -35
  625. package/dist/packem_shared/useOnMouseHover-26diuXUC.js +0 -32
  626. package/dist/packem_shared/useOnMouseState-NO_Kda_C.js +0 -13
  627. package/dist/packem_shared/usePaste-Ct8J4AGR.js +0 -35
  628. package/dist/packem_shared/useScrollAcceleration-R9LfrPVG.js +0 -73
  629. package/dist/packem_shared/useScrollInput-D3CpBq_a.js +0 -72
  630. package/dist/packem_shared/useStderr-CAOVUh4E.js +0 -6
  631. package/dist/packem_shared/useStdin-X-O0kd-n.js +0 -7
  632. package/dist/packem_shared/useStdout-DyF6DSH0.js +0 -6
  633. package/dist/packem_shared/useStopwatch-qC4Beai4.js +0 -33
  634. package/dist/packem_shared/useTerminalPalette-BaWO2c4Q.js +0 -38
  635. package/dist/packem_shared/useTextBuffer-C8fEe9Ly.js +0 -398
  636. package/dist/packem_shared/useTextSelection-mXtxgsPK.js +0 -50
  637. package/dist/packem_shared/useTimer-CPQ7j827.js +0 -46
  638. package/dist/packem_shared/useTreeView-BT57P3Kx.js +0 -101
  639. package/dist/packem_shared/useTreeViewState-BpS_KZ-K.js +0 -502
  640. package/dist/packem_shared/useWindowSize-ugEmGZJm.js +0 -20
  641. package/dist/packem_shared/utils-BgdlrbOH.js +0 -140
  642. package/dist/packem_shared/variant-config-DSZoX5TM.js +0 -8
  643. package/dist/packem_shared/wrapOrTruncateStyledLine-DN3Nogoc.js +0 -147
  644. package/dist/react/devtools.d.ts +0 -27
  645. package/dist/react/focus.d.ts +0 -39
  646. package/dist/react/hooks.d.ts +0 -238
  647. package/dist/react/layout.d.ts +0 -35
  648. package/dist/react/react.d.ts +0 -57
  649. package/dist/react/reconciler.d.ts +0 -4
  650. package/dist/react/render-to-string.d.ts +0 -21
  651. package/dist/react/renderer.d.ts +0 -2
  652. package/dist/react/scene.d.ts +0 -3
  653. package/dist/react/static.d.ts +0 -39
  654. package/dist/react/styles.d.ts +0 -83
  655. package/dist/react/text-width.d.ts +0 -20
  656. package/dist/testing/keys.d.ts +0 -89
  657. package/dist/testing/screen.d.ts +0 -35
  658. package/dist/testing/wait-for.d.ts +0 -21
@@ -0,0 +1,85 @@
1
+ import { ReactElement } from 'react';
2
+ type DiffViewMode = "split" | "unified";
3
+ type InlineDiffMode = "chars" | "words";
4
+ type Props = {
5
+ /**
6
+ * Number of unchanged context lines around changes.
7
+ * @default 3
8
+ */
9
+ readonly context?: number;
10
+ /**
11
+ * Pre-computed unified diff string. If provided, `oldText`/`newText` are ignored.
12
+ */
13
+ readonly diff?: string;
14
+ /**
15
+ * Enable character-level inline diff highlighting within changed lines.
16
+ * @default true
17
+ */
18
+ readonly inlineDiff?: boolean;
19
+ /**
20
+ * Granularity of inline diff highlighting.
21
+ * - `"chars"` — character-level (best for code)
22
+ * - `"words"` — word-level (best for prose)
23
+ * @default "chars"
24
+ */
25
+ readonly inlineDiffMode?: InlineDiffMode;
26
+ /**
27
+ * Programming language for syntax highlighting within diff lines.
28
+ * When provided, diff content is highlighted with Shiki.
29
+ */
30
+ readonly language?: string;
31
+ /**
32
+ * Display mode: unified (interleaved) or split (side-by-side).
33
+ * @default "unified"
34
+ */
35
+ readonly mode?: DiffViewMode;
36
+ /**
37
+ * Label for the new version.
38
+ */
39
+ readonly newLabel?: string;
40
+ /**
41
+ * Modified text ("new" / right side).
42
+ */
43
+ readonly newText?: string;
44
+ /**
45
+ * Label for the old version.
46
+ */
47
+ readonly oldLabel?: string;
48
+ /**
49
+ * Original text ("old" / left side).
50
+ */
51
+ readonly oldText?: string;
52
+ /**
53
+ * Whether to display line numbers.
54
+ * @default true
55
+ */
56
+ readonly showLineNumbers?: boolean;
57
+ /**
58
+ * Shiki theme for syntax highlighting.
59
+ * @default "github-dark-default"
60
+ */
61
+ readonly theme?: string;
62
+ };
63
+ /**
64
+ * Display file differences with colored additions/deletions.
65
+ *
66
+ * ```tsx
67
+ * <DiffView oldText="hello" newText="hello world" />
68
+ * <DiffView diff={unifiedDiffString} mode="split" />
69
+ * ```
70
+ */
71
+ declare function DiffView({
72
+ context,
73
+ diff: diffProp,
74
+ inlineDiff,
75
+ inlineDiffMode,
76
+ language,
77
+ mode,
78
+ newLabel,
79
+ newText,
80
+ oldLabel,
81
+ oldText,
82
+ showLineNumbers,
83
+ theme
84
+ }: Props): ReactElement;
85
+ export { DiffView, DiffViewMode, type Props as DiffViewProps, InlineDiffMode, Props, DiffView as default };
@@ -0,0 +1 @@
1
+ var M=Object.defineProperty;var v=(r,i)=>M(r,"name",{value:i,configurable:!0});import{jsx as u,jsxs as g,Fragment as $}from"react/jsx-runtime";import{createPatch as V,parsePatch as W,diffWords as j,diffChars as B}from"diff";import{useMemo as k,useState as U,useRef as q,useEffect as A}from"react";import{r as E,i as F,P as J,g as K,a as O}from"../packem_shared/token-to-elements-BAZpNZsu.js";import R from"../ink/hooks/use-window-size.js";import{Box as p}from"./box.js";import{Text as a}from"./text.js";var X=Object.defineProperty,x=v((r,i)=>X(r,"name",{value:i,configurable:!0}),"y");const L=x((r,i,n,d)=>{if(!i||n===void 0||n<1||n>i.length)return d?u(a,{color:d,children:r}):u(a,{dimColor:!0,children:r});const o=i[n-1];return!o||o.length===0?d?u(a,{color:d,children:r}):u(a,{dimColor:!0,children:r}):O(o)},"renderHighlightedContent"),S=x((r,i,n)=>{const[d,o]=U(null),h=q(!1);return A(()=>{if(h.current=!1,!i){o(null);return}const e=E(i);if(!F(e)){o(null);return}return(async()=>{try{const f=await J([e],n),l=K(f,r,e,n);h.current||o(l.tokens)}catch{h.current||o(null)}})(),()=>{h.current=!0}},[r,i,n]),d},"useHighlightedLines"),z=x((r,i,n="chars")=>{const d=W(r),o=[];for(const h of d)for(const e of h.hunks){const f=`@@ -${e.oldStart},${e.oldLines} +${e.newStart},${e.newLines} @@`,l=[];let s=e.oldStart,c=e.newStart;for(const w of e.lines)w.startsWith("\\")||(w.startsWith("+")?l.push({content:w.slice(1),newLineNum:c++,type:"add"}):w.startsWith("-")?l.push({content:w.slice(1),oldLineNum:s++,type:"del"}):l.push({content:w.slice(1),newLineNum:c++,oldLineNum:s++,type:"context"}));if(i){const w=Q(l);for(const[N,t]of w)if(l[N].type==="del"&&l[t].type==="add"){const m=G(l[N].content,l[t].content,n);l[N].inlineDiff=m??void 0,l[N].pairedIndex=t,l[t].inlineDiff=m??void 0,l[t].pairedIndex=N}}o.push({header:f,lines:l})}return o},"parseDiffLines"),P=500,G=x((r,i,n="chars")=>{if(r.length>P||i.length>P)return null;const d=n==="words"?j(r,i):B(r,i),o=[],h=[];for(const e of d)e.removed?o.push({highlight:!0,value:e.value}):e.added?h.push({highlight:!0,value:e.value}):(o.push({highlight:!1,value:e.value}),h.push({highlight:!1,value:e.value}));return{addParts:h,delParts:o}},"computeInlineDiff"),C=x((r,i,n)=>u($,{children:r.map((d,o)=>d.highlight?u(a,{backgroundColor:n,color:"white",children:d.value},o):u(a,{color:i,children:d.value},o))}),"renderInlineParts"),Q=x(r=>{const i=new Map;let n=0;for(;n<r.length;){const d=n;for(;n<r.length&&r[n].type==="del";)n++;const o=n,h=n;for(;n<r.length&&r[n].type==="add";)n++;const e=n,f=o-d,l=e-h,s=Math.min(f,l);for(let c=0;c<s;c++)i.set(d+c,h+c),i.set(h+c,d+c);n===d&&n++}return i},"findInlinePairs");function H({hunks:r,newHighlighted:i,oldHighlighted:n,showLineNumbers:d}){return u(p,{flexDirection:"column",children:r.map((o,h)=>g(p,{flexDirection:"column",children:[h>0?u(p,{marginBottom:0,marginTop:0,children:u(a,{dimColor:!0,children:"···"})}):void 0,u(a,{color:"cyan",dimColor:!0,children:o.header}),o.lines.map((e,f)=>{let l,s,c;switch(e.type){case"add":{s="+",c="green",l=e.inlineDiff?C(e.inlineDiff.addParts,"green","green"):L(e.content,i,e.newLineNum,"green");break}case"del":{s="-",c="red",l=e.inlineDiff?C(e.inlineDiff.delParts,"red","red"):L(e.content,n,e.oldLineNum,"red");break}default:{s=" ",c=void 0,l=L(e.content,n,e.oldLineNum);break}}return g(p,{children:[d?g(a,{color:c,dimColor:e.type==="context",children:[String(e.oldLineNum??"").padStart(4)," ",String(e.newLineNum??"").padStart(4)," "]}):void 0,u(a,{color:c,children:s}),l]},f)})]},h))})}v(H,"J");x(H,"UnifiedView");function I({hunks:r,newHighlighted:i,oldHighlighted:n,showLineNumbers:d,width:o}){const h=Math.floor(o/2)-1;return u(p,{flexDirection:"column",children:r.map((e,f)=>{const l=f>0?u(p,{marginBottom:0,marginTop:0,children:u(a,{dimColor:!0,children:"···"})}):void 0,s=[],c=[];for(let N=0;N<e.lines.length;N++){const t=e.lines[N];switch(t.type){case"add":{t.pairedIndex===void 0&&(s.push({content:u(a,{dimColor:!0})}),c.push({content:L(t.content,i,t.newLineNum,"green"),lineNum:t.newLineNum}));break}case"context":{s.push({content:L(t.content,n,t.oldLineNum),lineNum:t.oldLineNum}),c.push({content:L(t.content,i,t.newLineNum),lineNum:t.newLineNum});break}case"del":{if(t.pairedIndex===void 0)s.push({content:L(t.content,n,t.oldLineNum,"red"),lineNum:t.oldLineNum}),c.push({content:u(a,{dimColor:!0})});else{const m=e.lines[t.pairedIndex];s.push({content:t.inlineDiff?C(t.inlineDiff.delParts,"red","red"):L(t.content,n,t.oldLineNum,"red"),lineNum:t.oldLineNum}),c.push({content:m.inlineDiff?C(m.inlineDiff.addParts,"green","green"):L(m.content,i,m.newLineNum,"green"),lineNum:m.newLineNum})}break}}}const w=Math.max(s.length,c.length);return g(p,{flexDirection:"column",children:[l,u(a,{color:"cyan",dimColor:!0,children:e.header}),Array.from({length:w},(N,t)=>{const m=s[t],D=c[t];return g(p,{flexDirection:"row",children:[g(p,{width:h,children:[d?g(a,{dimColor:!0,children:[String(m?.lineNum??"").padStart(4)," "]}):void 0,m?.content]}),u(a,{dimColor:!0,children:"│"}),g(p,{width:h,children:[d?g(a,{dimColor:!0,children:[String(D?.lineNum??"").padStart(4)," "]}):void 0,D?.content]})]},t)})]},f)})})}v(I,"K");x(I,"SplitView");function Y({context:r=3,diff:i,inlineDiff:n=!0,inlineDiffMode:d="chars",language:o,mode:h="unified",newLabel:e="new",newText:f="",oldLabel:l="old",oldText:s="",showLineNumbers:c=!0,theme:w="github-dark-default"}){const{columns:N}=R(),t=S(s,o,w),m=S(f,o,w),D=k(()=>i||V("file",s,f,l,e,{context:r}),[i,s,f,l,e,r]),b=k(()=>z(D,n,d),[D,n,d]);if(b.every(T=>T.lines.length===0))return u(p,{children:u(a,{dimColor:!0,children:"No differences found."})});const y=g(p,{flexDirection:"column",children:[g(a,{color:"red",dimColor:!0,children:["---"," ",l]}),g(a,{color:"green",dimColor:!0,children:["+++"," ",e]})]});return h==="split"?g(p,{flexDirection:"column",children:[y,u(I,{hunks:b,newHighlighted:m,oldHighlighted:t,showLineNumbers:c,width:N??80})]}):g(p,{flexDirection:"column",children:[y,u(H,{hunks:b,newHighlighted:m,oldHighlighted:t,showLineNumbers:c})]})}v(Y,"S");x(Y,"DiffView");export{Y as DiffView,Y as default};
@@ -0,0 +1,49 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type Props = {
5
+ /**
6
+ * Custom character to use instead of the default line character.
7
+ */
8
+ readonly character?: string;
9
+ /**
10
+ * Color of the divider line.
11
+ */
12
+ readonly color?: LiteralUnion<AnsiColors, string>;
13
+ /**
14
+ * Render the divider with dim color.
15
+ */
16
+ readonly dimColor?: boolean;
17
+ /**
18
+ * Optional label rendered in the middle of a horizontal divider.
19
+ */
20
+ readonly label?: string;
21
+ /**
22
+ * Padding around the label.
23
+ * @default 1
24
+ */
25
+ readonly labelPadding?: number;
26
+ /**
27
+ * Total length of the divider. When omitted, horizontal dividers stretch to
28
+ * fill the available space and vertical dividers default to one row.
29
+ */
30
+ readonly length?: number;
31
+ /**
32
+ * Orientation of the divider.
33
+ * @default "horizontal"
34
+ */
35
+ readonly orientation?: "horizontal" | "vertical";
36
+ };
37
+ /**
38
+ * Horizontal or vertical divider line, optionally with a centered label.
39
+ */
40
+ declare function Divider({
41
+ character,
42
+ color,
43
+ dimColor,
44
+ label,
45
+ labelPadding,
46
+ length,
47
+ orientation
48
+ }: Props): ReactElement;
49
+ export { Divider, type Props as DividerProps, Props, Divider as default };
@@ -0,0 +1 @@
1
+ var w=Object.defineProperty;var d=(l,r)=>w(l,"name",{value:r,configurable:!0});import{jsx as o,jsxs as p}from"react/jsx-runtime";import C from"../ink/hooks/use-window-size.js";import{Box as i}from"./box.js";import{Text as n}from"./text.js";var g=Object.defineProperty,b=d((l,r)=>g(l,"name",{value:r,configurable:!0}),"m");function G({character:l,color:r,dimColor:t=!1,label:h,labelPadding:u=1,length:e,orientation:m="horizontal"}){const{columns:s}=C(),a=l??(m==="horizontal"?"─":"│");if(m==="vertical"){const x=e??1;return o(i,{flexDirection:"column",height:x,children:Array.from({length:x},(j,v)=>o(n,{color:r,dimColor:t,children:a},`divider-row-${v}`))})}const c=Math.min(500,e??Math.max(s,1));if(h===void 0)return o(i,{flexGrow:e===void 0?1:0,width:e,children:o(n,{color:r,dimColor:t,wrap:"truncate",children:a.repeat(c)})});const f=" ".repeat(u);return p(i,{flexGrow:e===void 0?1:0,width:e,children:[o(i,{flexGrow:1,flexShrink:1,children:o(n,{color:r,dimColor:t,wrap:"truncate",children:a.repeat(c)})}),o(i,{flexShrink:0,children:p(n,{color:r,dimColor:t,children:[f,h,f]})}),o(i,{flexGrow:1,flexShrink:1,children:o(n,{color:r,dimColor:t,wrap:"truncate",children:a.repeat(c)})})]})}d(G,"u");b(G,"Divider");export{G as Divider,G as default};
@@ -0,0 +1,104 @@
1
+ import { ReactElement } from 'react';
2
+ /**
3
+ * A single entry (file or directory) returned by the file system hook.
4
+ */
5
+ type FileEntry = {
6
+ readonly isDirectory: boolean;
7
+ readonly isHidden: boolean;
8
+ readonly name: string;
9
+ readonly path: string;
10
+ readonly permissions: string;
11
+ readonly size: number;
12
+ };
13
+ /**
14
+ * Filter options for the file picker.
15
+ */
16
+ type FilePickerFilter = {
17
+ /**
18
+ * Allowed file extensions (e.g. `[".ts", ".tsx"]`). Empty or omitted means all.
19
+ */
20
+ readonly extensions?: ReadonlyArray<string>;
21
+ /**
22
+ * Whether to include directories in the list.
23
+ * @default true
24
+ */
25
+ readonly showDirectories?: boolean;
26
+ /**
27
+ * Whether to include regular files in the list.
28
+ * @default true
29
+ */
30
+ readonly showFiles?: boolean;
31
+ /**
32
+ * Whether to include hidden files (names starting with `.`).
33
+ * @default false
34
+ */
35
+ readonly showHidden?: boolean;
36
+ };
37
+ type Props = {
38
+ /**
39
+ * Color for the focused item highlight.
40
+ * @default "cyan"
41
+ */
42
+ readonly accentColor?: string;
43
+ /**
44
+ * Color for directory entries.
45
+ * @default "blue"
46
+ */
47
+ readonly directoryColor?: string;
48
+ /**
49
+ * Color for file entries.
50
+ * @default "white"
51
+ */
52
+ readonly fileColor?: string;
53
+ /**
54
+ * File filter options.
55
+ */
56
+ readonly filter?: FilePickerFilter;
57
+ /**
58
+ * Starting directory path.
59
+ * @default process.cwd()
60
+ */
61
+ readonly initialPath?: string;
62
+ /**
63
+ * Whether keyboard navigation is active.
64
+ * @default true
65
+ */
66
+ readonly isFocused?: boolean;
67
+ /**
68
+ * Maximum number of visible items (viewport height).
69
+ * @default 10
70
+ */
71
+ readonly limit?: number;
72
+ /**
73
+ * Called when escape is pressed.
74
+ */
75
+ readonly onCancel?: () => void;
76
+ /**
77
+ * Called when a file is selected (enter on a file entry).
78
+ */
79
+ readonly onSelect?: (entry: FileEntry) => void;
80
+ /**
81
+ * Show file permissions column.
82
+ * @default false
83
+ */
84
+ readonly showPermissions?: boolean;
85
+ /**
86
+ * Show file size column.
87
+ * @default false
88
+ */
89
+ readonly showSize?: boolean;
90
+ };
91
+ declare const FilePicker: ({
92
+ accentColor,
93
+ directoryColor,
94
+ fileColor,
95
+ filter,
96
+ initialPath,
97
+ isFocused,
98
+ limit,
99
+ onCancel,
100
+ onSelect,
101
+ showPermissions,
102
+ showSize
103
+ }: Props) => ReactElement;
104
+ export { type FileEntry, FilePicker, type FilePickerFilter, type Props as FilePickerProps, FilePicker as default };
@@ -0,0 +1 @@
1
+ import{default as f,default as l}from"../packem_shared/FilePicker-tYj_CIau.js";export{f as FilePicker,l as default};
@@ -0,0 +1,81 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactNode, ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type FormFieldProps = {
5
+ /**
6
+ * The input element (TextInput, Checkbox, Select, …).
7
+ */
8
+ readonly children: ReactNode;
9
+ /**
10
+ * Optional helper text rendered beneath the input.
11
+ */
12
+ readonly description?: string;
13
+ /**
14
+ * Validation error — dimmed red below the input.
15
+ */
16
+ readonly error?: string;
17
+ /**
18
+ * When true, the field's label and description are dim.
19
+ */
20
+ readonly isDisabled?: boolean;
21
+ /**
22
+ * Label rendered above the input.
23
+ */
24
+ readonly label: string;
25
+ /**
26
+ * Mark the field as required (adds a trailing `*`).
27
+ */
28
+ readonly required?: boolean;
29
+ };
30
+ /**
31
+ * Standard form field wrapper: label + input + helper/error.
32
+ */
33
+ declare const FormField: ({
34
+ children,
35
+ description,
36
+ error,
37
+ isDisabled,
38
+ label,
39
+ required
40
+ }: FormFieldProps) => ReactElement;
41
+ type Props = {
42
+ /**
43
+ * Accent color for the form chrome.
44
+ * @default "blue"
45
+ */
46
+ readonly accentColor?: LiteralUnion<AnsiColors, string>;
47
+ /**
48
+ * Render a border around the form.
49
+ * @default true
50
+ */
51
+ readonly bordered?: boolean;
52
+ /**
53
+ * Fields composed via `&lt;FormField />`.
54
+ */
55
+ readonly children: ReactNode;
56
+ /**
57
+ * Optional description rendered under the title.
58
+ */
59
+ readonly description?: string;
60
+ /**
61
+ * Optional footer rendered below the fields (buttons, hints, summary).
62
+ */
63
+ readonly footer?: ReactNode;
64
+ /**
65
+ * Optional heading rendered at the top.
66
+ */
67
+ readonly title?: string;
68
+ /**
69
+ * Fixed width.
70
+ */
71
+ readonly width?: number;
72
+ };
73
+ type FormComponent = ((props: Props) => ReactElement) & {
74
+ Field: typeof FormField;
75
+ };
76
+ /**
77
+ * Stateless form layout. Pair with the `useForm` hook for state management
78
+ * and `FormField` for consistent label/error styling.
79
+ */
80
+ declare const Form: FormComponent;
81
+ export { Form, FormField, FormFieldProps, type Props as FormProps, Props, Form as default };
@@ -0,0 +1 @@
1
+ var u=Object.defineProperty;var s=(e,i)=>u(e,"name",{value:i,configurable:!0});import{jsxs as m,jsx as r}from"react/jsx-runtime";import{Box as o}from"./box.js";import{Text as d}from"./text.js";var f=Object.defineProperty,v=s((e,i)=>f(e,"name",{value:i,configurable:!0}),"s");const b=v(({children:e,description:i,error:l,isDisabled:n=!1,label:c,required:t=!1})=>m(o,{flexDirection:"column",marginBottom:1,children:[m(o,{children:[r(d,{bold:!0,dimColor:n,children:c}),t?r(d,{color:"red",children:" *"}):void 0]}),r(o,{marginTop:0,children:e}),l===void 0?i===void 0?void 0:r(d,{dimColor:!0,children:i}):r(d,{color:"red",children:l})]}),"FormField"),F=Object.assign(({accentColor:e="blue",bordered:i=!0,children:l,description:n,footer:c,title:t,width:a})=>{const h=m(o,{flexDirection:"column",children:[t===void 0?void 0:r(o,{marginBottom:1,children:r(d,{bold:!0,color:e,children:t})}),n===void 0?void 0:r(o,{marginBottom:1,children:r(d,{dimColor:!0,children:n})}),r(o,{flexDirection:"column",children:l}),c===void 0?void 0:r(o,{marginTop:1,children:c})]});return i?r(o,{borderColor:e,borderStyle:"round",flexDirection:"column",paddingX:1,paddingY:1,width:a,children:h}):r(o,{flexDirection:"column",width:a,children:h})},{Field:b});export{F as Form,b as FormField,F as default};
@@ -0,0 +1,87 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type GaugeThreshold = {
5
+ /**
6
+ * Color used for the arc segment and, when the current value falls into
7
+ * this segment, for the value readout.
8
+ */
9
+ readonly color: LiteralUnion<AnsiColors, string>;
10
+ /**
11
+ * Optional label used by the legend under the gauge.
12
+ */
13
+ readonly label?: string;
14
+ /**
15
+ * Upper bound of this threshold segment (inclusive). Segments are sorted
16
+ * ascending and painted in order.
17
+ */
18
+ readonly max: number;
19
+ };
20
+ type GaugeSize = "large" | "medium" | "small";
21
+ type Props = {
22
+ /**
23
+ * Color of the arc background (the portion beyond `value`).
24
+ * @default "gray"
25
+ */
26
+ readonly backgroundColor?: LiteralUnion<AnsiColors, string>;
27
+ /**
28
+ * Format for the numeric readout. Defaults to rounding to an integer.
29
+ */
30
+ readonly formatValue?: (value: number) => string;
31
+ /**
32
+ * Optional label rendered above the readout.
33
+ */
34
+ readonly label?: string;
35
+ /**
36
+ * Upper bound of the range.
37
+ * @default 100
38
+ */
39
+ readonly max?: number;
40
+ /**
41
+ * Lower bound of the range.
42
+ * @default 0
43
+ */
44
+ readonly min?: number;
45
+ /**
46
+ * Show a legend listing thresholds below the gauge.
47
+ * @default false
48
+ */
49
+ readonly showLegend?: boolean;
50
+ /**
51
+ * Show a numeric readout in the middle of the gauge.
52
+ * @default true
53
+ */
54
+ readonly showValue?: boolean;
55
+ /**
56
+ * Overall dimension preset.
57
+ * @default "medium"
58
+ */
59
+ readonly size?: GaugeSize;
60
+ /**
61
+ * Color threshold ramp. When provided, segments of the arc are painted in
62
+ * the corresponding colors and the value readout picks up the color for
63
+ * the segment `value` lands in.
64
+ */
65
+ readonly thresholds?: ReadonlyArray<GaugeThreshold>;
66
+ /**
67
+ * Current value. Clamped into the `[min, max]` range.
68
+ */
69
+ readonly value: number;
70
+ };
71
+ /**
72
+ * Semi-circular gauge rendered at 2x4 sub-cell resolution. Supports colored
73
+ * threshold segments and an optional needle.
74
+ */
75
+ declare function Gauge({
76
+ backgroundColor,
77
+ formatValue,
78
+ label,
79
+ max,
80
+ min,
81
+ showLegend,
82
+ showValue,
83
+ size,
84
+ thresholds,
85
+ value
86
+ }: Props): ReactElement;
87
+ export { Gauge, type Props as GaugeProps, GaugeSize, GaugeThreshold, Props, Gauge as default };
@@ -0,0 +1 @@
1
+ var Z=Object.defineProperty;var x=(o,e)=>Z(o,"name",{value:e,configurable:!0});import{jsxs as j,jsx as h}from"react/jsx-runtime";import{useMemo as A}from"react";import{c as _}from"../packem_shared/braille-BBjIoaN0.js";import{Box as d}from"./box.js";import{Canvas as $}from"./canvas.js";import{Text as w}from"./text.js";var q=Object.defineProperty,v=x((o,e)=>q(o,"name",{value:e,configurable:!0}),"f");const J={large:{cols:40,rows:10},medium:{cols:24,rows:6},small:{cols:16,rows:4}},R=.9,oo=2,ro=v(o=>String(Math.round(o)),"defaultFormat"),G=v((o,e,s,a)=>{const t=e+(s-e)*a;for(const f of o)if(t<=f.max)return f;return o[o.length-1]},"thresholdAtRatio");function to({backgroundColor:o="gray",formatValue:e=ro,label:s,max:a=100,min:t=0,showLegend:f=!1,showValue:P=!0,size:B="medium",thresholds:n,value:D}){const{cols:O,rows:T}=J[B],F=Math.max(t,Math.min(a,D)),E=a-t||1,M=(F-t)/E,m=A(()=>{if(!(n===void 0||n.length===0))return[...n].toSorted((r,c)=>r.max-c.max)},[n]),I=A(()=>{if(m!==void 0)return G(m,t,a,M)},[m,t,a,M]),H=e(F);return j(d,{flexDirection:"column",children:[h($,{draw:x(r=>{r.clear();const c=r.width*2,L=r.height*4,y=c/2,C=L-1,K=c/2-1,N=L-1,g=Math.max(1,Math.min(K,N)),b=new Map,S=v(i=>{const l=b.get(i);if(l!==void 0)return l;const u=_(r.width,r.height);return b.set(i,u),u},"gridFor"),V=Math.max(32,Math.round(Math.PI*g)*oo);for(let i=0;i<=V;i+=1){const l=i/V,u=Math.PI*(1-l),X=Math.round(y+g*Math.cos(u)),Y=Math.round(C-g*Math.sin(u));let p;l>M?p=o:m?p=G(m,t,a,l)?.color??"cyan":p="cyan",S(p).plotPoint(X,Y)}const k=g*R,z=Math.PI*(1-M),Q=Math.round(y+k*Math.cos(z)),U=Math.round(C-k*Math.sin(z)),W=I?.color??"white";S(W).plotLine(Math.round(y),Math.round(C),Q,U);for(const[i,l]of b)l.flush(r,{color:i})},"draw"),height:T,version:[D,t,a,B,n,o],width:O}),P||s?j(d,{flexDirection:"column",children:[s===void 0?void 0:h(d,{justifyContent:"center",children:h(w,{dimColor:!0,children:s})}),P?h(d,{justifyContent:"center",children:h(w,{bold:!0,color:I?.color??"white",children:H})}):void 0]}):void 0,f&&n&&n.length>0?h(d,{gap:2,justifyContent:"center",marginTop:1,children:n.map((r,c)=>j(d,{gap:1,children:[h(w,{color:r.color,children:"●"}),h(w,{dimColor:!0,children:r.label??`≤ ${r.max}`})]},c))}):void 0]})}x(to,"j");v(to,"Gauge");export{to as Gauge,to as default};
@@ -0,0 +1,42 @@
1
+ import { multilineGradient } from '@visulima/colorize/gradient';
2
+ import { ReactNode, ReactElement } from 'react';
3
+ /**
4
+ * A color stop for the gradient — hex string, CSS color name, RGB tuple, RGB object, or positioned stop.
5
+ */
6
+ type GradientStop = Parameters<typeof multilineGradient>[0][number];
7
+ /**
8
+ * Built-in gradient presets.
9
+ */
10
+ type GradientName = "atlas" | "cristal" | "fruit" | "instagram" | "mind" | "morning" | "pastel" | "passion" | "rainbow" | "retro" | "summer" | "teen" | "vice";
11
+ /**
12
+ * Custom gradient colors — an array of color stops accepted by `@visulima/colorize`'s gradient API.
13
+ */
14
+ type GradientColors = GradientStop[];
15
+ type Props = {
16
+ /**
17
+ * The content to colorize.
18
+ *
19
+ * Multiple `&lt;Text>` children are treated as separate nodes, which preserves layout when `&lt;Gradient>` is placed inside a `&lt;Box flexDirection="column">`.
20
+ *
21
+ * If you want a continuous gradient across multiple lines, pass a single string or a single `&lt;Text>` with `\n`.
22
+ */
23
+ readonly children: ReactNode;
24
+ /**
25
+ * [Colors to use to make the gradient.](https://visulima.com/packages/colorize)
26
+ *
27
+ * Mutually exclusive with `name`.
28
+ */
29
+ readonly colors?: GradientColors;
30
+ /**
31
+ * The name of a built-in gradient preset.
32
+ *
33
+ * Mutually exclusive with `colors`.
34
+ */
35
+ readonly name?: GradientName;
36
+ };
37
+ declare function Gradient({
38
+ children,
39
+ colors,
40
+ name
41
+ }: Props): ReactElement | null;
42
+ export { Gradient, type GradientColors, type GradientName, type Props as GradientProps, Props, Gradient as default };
@@ -0,0 +1 @@
1
+ var D=Object.defineProperty;var y=(o,e)=>D(o,"name",{value:e,configurable:!0});import{jsx as c,Fragment as K}from"react/jsx-runtime";import{strip as N}from"@visulima/ansi";import{multilineGradient as G}from"@visulima/colorize/gradient";import{useMemo as F,Children as x,isValidElement as P,cloneElement as v}from"react";import{Box as B}from"./box.js";import{Text as O}from"./text.js";import{Transform as g}from"./transform.js";var M=Object.defineProperty,n=y((o,e)=>M(o,"name",{value:e,configurable:!0}),"o");const k={atlas:{colors:["#feac5e","#c779d0","#4bc0c8"]},cristal:{colors:["#bdfff3","#4ac29a"]},fruit:{colors:["#ff4e50","#f9d423"]},instagram:{colors:["#833ab4","#fd1d1d","#fcb045"]},mind:{colors:["#473b7b","#3584a7","#30d2be"]},morning:{colors:["#ff5f6d","#ffc371"],options:{interpolation:"hsv"}},passion:{colors:["#f43b47","#453a94"]},pastel:{colors:["#74ebd5","#74ecd5"],options:{hsvSpin:"long",interpolation:"hsv"}},rainbow:{colors:["#ff0000","#ff0100"],options:{hsvSpin:"long",interpolation:"hsv"}},retro:{colors:["#3f51b1","#5a55ae","#7b5fac","#8f6aae","#a86aa4","#cc6b8e","#f18271","#f3a469","#f7c978"]},summer:{colors:["#fdbb2d","#22c1c3"]},teen:{colors:["#77a1d3","#79cbca","#e684ae"]},vice:{colors:["#5ee7df","#b490ca"],options:{interpolation:"hsv"}}},C=n(o=>{let e=!1;const t=n(h=>{x.forEach(h,s=>{if(e||!P(s))return;if(s.type===B){e=!0;return}const f=s.props;Object.hasOwn(f,"children")&&t(f.children)})},"search");return t(o),e},"containsBoxDescendant"),j=n(o=>Object.hasOwn(o,"children"),"hasChildrenProp"),S=n(o=>typeof o=="string"||typeof o=="number","isPlainTextNode"),R=n(o=>o==null||typeof o=="boolean","isNonRenderableChild");function V({children:o,colors:e,name:t}){if(t&&e)throw new Error("The `name` and `colors` props are mutually exclusive");if(!t&&!e)throw new Error("Either `name` or `colors` prop must be provided");const h=F(()=>t?G(k[t].colors,k[t].options):G(e??[]),[t,e]),s=n(b=>h(N(b)),"applyGradient"),f=x.count(o);if(S(o))return c(g,{transform:s,children:o});if(f===1&&!C(o))return c(g,{transform:s,children:o});const m=n(b=>{const a=[];let l="",w=0;const E=n(()=>{const r=`gradient-node-${String(w)}`;return w+=1,r},"createKey"),p=n((r,i)=>{a.push(c(g,{transform:s,children:r},i))},"pushTransformed"),T=n(()=>{if(l==="")return;const r=l;l="",p(c(O,{children:r}),E())},"flushText");return x.forEach(b,r=>{if(!R(r)){if(S(r)){l+=String(r);return}if(T(),P(r)){const i=r.key??E(),d=r.props;if(r.type===O){p(r,i);return}if(r.type===B){if(j(d)){const u=d.children;a.push(v(r,{key:i},m(u)));return}a.push(v(r,{key:i}));return}if(j(d)){const u=d.children;if(!C(u)){p(r,i);return}a.push(v(r,{key:i},m(u)));return}p(r,i);return}a.push(r)}}),T(),a},"applyGradientToChildren");return c(K,{children:m(o)})}y(V,"K");n(V,"Gradient");export{V as Gradient,V as default};
@@ -0,0 +1,33 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactNode, ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
5
+ type Props = {
6
+ /**
7
+ * Heading content.
8
+ */
9
+ readonly children: ReactNode;
10
+ /**
11
+ * Explicit color. By default the color is derived from the level.
12
+ */
13
+ readonly color?: LiteralUnion<AnsiColors, string>;
14
+ /**
15
+ * Heading level controls decoration and color.
16
+ * @default 1
17
+ */
18
+ readonly level?: HeadingLevel;
19
+ /**
20
+ * When true, renders an underline on a second line.
21
+ */
22
+ readonly underline?: boolean;
23
+ };
24
+ /**
25
+ * Semantic heading with level-based styling.
26
+ */
27
+ declare function Heading({
28
+ children,
29
+ color,
30
+ level,
31
+ underline
32
+ }: Props): ReactElement;
33
+ export { Heading, HeadingLevel, type Props as HeadingProps, Props, Heading as default };
@@ -0,0 +1 @@
1
+ var l=Object.defineProperty;var o=(e,r)=>l(e,"name",{value:r,configurable:!0});import{jsx as a,jsxs as c}from"react/jsx-runtime";import{Box as s}from"./box.js";import{Text as d}from"./text.js";var u=Object.defineProperty,f=o((e,r)=>u(e,"name",{value:r,configurable:!0}),"t");const g={1:"blueBright",2:"cyanBright",3:"magentaBright",4:"yellowBright",5:"green",6:"white"},m={1:"# ",2:"## ",3:"### ",4:"#### ",5:"##### ",6:"###### "};function h({children:e,color:r,level:n=1,underline:t=!1}){const i=r??g[n];return a(s,{flexDirection:"column",children:c(d,{bold:n<=2,color:i,underline:t,children:[m[n],e]})})}o(h,"n");f(h,"Heading");export{h as Heading,h as default};
@@ -0,0 +1,62 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type HeatmapProps = {
5
+ /**
6
+ * Width of each cell in character columns.
7
+ * @default 2
8
+ */
9
+ readonly cellWidth?: number;
10
+ /**
11
+ * Glyph used to paint each heatmap cell. Defaults to `█` so the
12
+ * background color fills the cell.
13
+ * @default "█" (full block)
14
+ */
15
+ readonly character?: string;
16
+ /**
17
+ * Column labels rendered below the grid.
18
+ */
19
+ readonly columnLabels?: ReadonlyArray<string>;
20
+ /**
21
+ * 2D matrix, rows × cols.
22
+ */
23
+ readonly data: ReadonlyArray<ReadonlyArray<number>>;
24
+ /**
25
+ * Fixed maximum (for consistent scales across multiple heatmaps).
26
+ */
27
+ readonly max?: number;
28
+ /**
29
+ * Fixed minimum.
30
+ */
31
+ readonly min?: number;
32
+ /**
33
+ * Color palette, lowest-to-highest intensity. Values are mapped into the
34
+ * palette by their position in the [min, max] range.
35
+ * @default ["#0b1e4f", "#1f3b96", "#3258c8", "#4e84ec", "#78b0ff"]
36
+ */
37
+ readonly palette?: ReadonlyArray<string>;
38
+ /**
39
+ * Row labels rendered to the left of the grid.
40
+ */
41
+ readonly rowLabels?: ReadonlyArray<string>;
42
+ /**
43
+ * Foreground color override (rarely needed since the character is a full block).
44
+ */
45
+ readonly textColor?: LiteralUnion<AnsiColors, string>;
46
+ };
47
+ /**
48
+ * 2D heatmap. Each cell's background color is derived from its value's
49
+ * position in the [min, max] range mapped into `palette`.
50
+ */
51
+ declare function Heatmap({
52
+ cellWidth,
53
+ character,
54
+ columnLabels,
55
+ data,
56
+ max: maxOverride,
57
+ min: minOverride,
58
+ palette,
59
+ rowLabels,
60
+ textColor
61
+ }: HeatmapProps): ReactElement;
62
+ export { Heatmap, HeatmapProps, Heatmap as default };
@@ -0,0 +1 @@
1
+ var T=Object.defineProperty;var v=(r,l)=>T(r,"name",{value:l,configurable:!0});import{jsxs as j,jsx as c}from"react/jsx-runtime";import{useMemo as k}from"react";import{Box as s}from"./box.js";import{Canvas as B}from"./canvas.js";import{Text as y}from"./text.js";var E=Object.defineProperty,O=v((r,l)=>E(r,"name",{value:l,configurable:!0}),"A");const P=["#0b1e4f","#1f3b96","#3258c8","#4e84ec","#78b0ff"];function R({cellWidth:r=2,character:l="█",columnLabels:g,data:n,max:d,min:m,palette:x=P,rowLabels:w,textColor:D}){const{cols:C,colWidth:f,extent:L,rows:p}=k(()=>{const t=n.length,e=n.reduce((a,o)=>Math.max(a,o.length),0);let i=m??1/0,h=d??-1/0;if(m===void 0||d===void 0)for(const a of n)for(const o of a)m===void 0&&o<i&&(i=o),d===void 0&&o>h&&(h=o);return{cols:e,colWidth:r,extent:{max:h,min:i},rows:t}},[n,m,d,r]),W=C*f,A=p;return j(s,{children:[w===void 0?void 0:c(s,{flexDirection:"column",marginRight:1,children:Array.from({length:p},(t,e)=>c(y,{dimColor:!0,children:w[e]??""},e))}),j(s,{flexDirection:"column",children:[c(B,{draw:v(t=>{t.clear();const{max:e,min:i}=L,h=e-i||1,a=x.length-1;for(let o=0;o<p;o+=1)for(let u=0;u<C;u+=1){const M=n[o]?.[u],H=M===void 0?void 0:x[Math.max(0,Math.min(a,Math.round((M-i)/h*a)))];for(let b=0;b<f;b+=1)t.setCell(u*f+b,o,l,{background:H,color:D})}},"draw"),height:A,version:[n,x,r,m,d],width:W}),g===void 0?void 0:c(s,{children:g.map((t,e)=>c(s,{width:f,children:c(y,{dimColor:!0,wrap:"truncate-end",children:t})},e))})]})]})}v(R,"T");O(R,"Heatmap");export{R as Heatmap,R as default};
@@ -0,0 +1,52 @@
1
+ import { ReactElement } from 'react';
2
+ import { KeyBinding } from "../ink/hooks/use-key-bindings.js";
3
+ type Props = {
4
+ /**
5
+ * Key bindings to display. Typically the `bindings` array returned by `useKeyBindings`.
6
+ */
7
+ readonly bindings: ReadonlyArray<KeyBinding>;
8
+ /**
9
+ * Color for description text.
10
+ * @default undefined (uses dimColor)
11
+ */
12
+ readonly descriptionColor?: string;
13
+ /**
14
+ * Color for key labels.
15
+ * @default "cyan"
16
+ */
17
+ readonly keyColor?: string;
18
+ /**
19
+ * Maximum number of columns in full mode.
20
+ * @default 3
21
+ */
22
+ readonly maxColumns?: number;
23
+ /**
24
+ * Display mode.
25
+ * - `"short"`: Single-line horizontal bar, truncated to terminal width.
26
+ * - `"full"`: Multi-column layout grouped by `group` field.
27
+ * @default "short"
28
+ */
29
+ readonly mode?: "full" | "short";
30
+ /**
31
+ * Separator between key-description pairs in short mode.
32
+ * @default " \u00b7 "
33
+ */
34
+ readonly separator?: string;
35
+ };
36
+ /**
37
+ * Renders a keybinding help bar from an array of `KeyBinding` definitions.
38
+ *
39
+ * ```tsx
40
+ * &lt;Help bindings={bindings} />
41
+ * &lt;Help bindings={bindings} mode="full" />
42
+ * ```
43
+ */
44
+ declare function Help({
45
+ bindings,
46
+ descriptionColor,
47
+ keyColor,
48
+ maxColumns,
49
+ mode,
50
+ separator
51
+ }: Props): ReactElement;
52
+ export { Help, type Props as HelpProps, Props, Help as default };
@@ -0,0 +1 @@
1
+ var j=Object.defineProperty;var p=(o,r)=>j(o,"name",{value:r,configurable:!0});import{jsx as n,jsxs as x}from"react/jsx-runtime";import D from"../ink/hooks/use-window-size.js";import{Box as u}from"./box.js";import{Text as i}from"./text.js";var v=Object.defineProperty,h=p((o,r)=>v(o,"name",{value:r,configurable:!0}),"u");const g={backspace:"backspace",delete:"del",downArrow:"↓",end:"end",escape:"esc",home:"home",leftArrow:"←",pageDown:"pgdn",pageUp:"pgup",return:"enter",rightArrow:"→",tab:"tab",upArrow:"↑"};function y(o){const r=o.indexOf("+");if(r!==-1){const e=o.slice(0,r),t=o.slice(r+1);return`${e}+${g[t]??t}`}return g[o]??o}p(y,"w");h(y,"formatKeyLabel");function C(o){return(typeof o=="string"?[o]:o).map(r=>y(r)).join("/")}p(C,"x");h(C,"formatKeys");function M({bindings:o,descriptionColor:r,keyColor:e="cyan",maxColumns:t=3,mode:l="short",separator:s=" · "}){const{columns:d}=D();return l==="full"?w(o,{columns:d,descriptionColor:r,keyColor:e,maxColumns:t}):b(o,{columns:d,descriptionColor:r,keyColor:e,separator:s})}p(M,"h");h(M,"Help");function b(o,r){const e=[];let t=0;for(const[l,s]of o.entries()){const d=C(s.key),a=`${d} ${s.description}`,c=(l>0?r.separator.length:0)+a.length;if(t+c>r.columns&&e.length>0)break;l>0&&e.push(n(i,{dimColor:!0,children:r.separator},`sep-${l}`)),e.push(x(u,{children:[n(i,{color:r.keyColor,children:d}),n(i,{children:" "}),r.descriptionColor?n(i,{color:r.descriptionColor,children:s.description}):n(i,{dimColor:!0,children:s.description})]},`pair-${l}`)),t+=c}return n(u,{flexDirection:"row",children:e})}p(b,"T");h(b,"renderShort");function w(o,r){const e=new Map;for(const a of o){const c=a.group??"";e.has(c)||e.set(c,[]),e.get(c).push(a)}const t=[...e.entries()],l=Math.min(r.maxColumns,t.length||1),s=Math.floor(r.columns/l),d=[];for(const[a,[c,$]]of t.entries()){const f=[];c&&f.push(n(i,{bold:!0,children:c},"title"));for(const[k,m]of $.entries()){const A=C(m.key);f.push(x(u,{children:[n(i,{color:r.keyColor,children:A}),n(i,{children:" "}),r.descriptionColor?n(i,{color:r.descriptionColor,children:m.description}):n(i,{dimColor:!0,children:m.description})]},`b-${k}`))}d.push(n(u,{flexDirection:"column",width:s,children:f},`col-${a}`))}return n(u,{flexDirection:"row",children:d})}p(w,"A");h(w,"renderFull");export{M as Help,M as default};