@visulima/tui 1.0.8 → 2.0.1

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 (336) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/LICENSE.md +54 -2444
  3. package/MIGRATION-GUIDE.md +164 -0
  4. package/README.md +15 -12
  5. package/dist/components/box.d.ts +26 -27
  6. package/dist/components/canvas.d.ts +26 -31
  7. package/dist/components/canvas.js +1 -1
  8. package/dist/components/cursor.d.ts +40 -46
  9. package/dist/components/error-boundary.d.ts +16 -0
  10. package/dist/components/error-boundary.js +1 -0
  11. package/dist/components/error-overview.d.ts +6 -0
  12. package/dist/components/error-overview.js +1 -0
  13. package/dist/components/newline.d.ts +6 -8
  14. package/dist/components/spacer.d.ts +4 -4
  15. package/dist/components/static-render.d.ts +10 -42
  16. package/dist/components/static.d.ts +13 -14
  17. package/dist/components/text.d.ts +34 -48
  18. package/dist/components/transform.d.ts +7 -11
  19. package/dist/core/index.d.ts +11 -12
  20. package/dist/core/index.js +1 -1
  21. package/dist/ink/canvas/index.d.ts +24 -0
  22. package/dist/ink/canvas/index.js +1 -0
  23. package/dist/ink/hooks/use-animation.d.ts +22 -22
  24. package/dist/ink/hooks/use-app.d.ts +3 -34
  25. package/dist/ink/hooks/use-app.js +1 -1
  26. package/dist/ink/hooks/use-box-metrics.d.ts +17 -18
  27. package/dist/ink/hooks/use-clipboard.d.ts +16 -16
  28. package/dist/ink/hooks/use-color-blindness.d.ts +16 -16
  29. package/dist/ink/hooks/use-console-capture.d.ts +19 -19
  30. package/dist/ink/hooks/use-cursor.d.ts +7 -7
  31. package/dist/ink/hooks/use-focus-manager.d.ts +25 -25
  32. package/dist/ink/hooks/use-focus.d.ts +14 -18
  33. package/dist/ink/hooks/use-form.d.ts +32 -32
  34. package/dist/ink/hooks/use-hotkey.d.ts +17 -17
  35. package/dist/ink/hooks/use-input.d.ts +92 -92
  36. package/dist/ink/hooks/use-input.js +2 -2
  37. package/dist/ink/hooks/use-interval.d.ts +14 -14
  38. package/dist/ink/hooks/use-is-screen-reader-enabled.d.ts +3 -3
  39. package/dist/ink/hooks/use-key-bindings.d.ts +32 -32
  40. package/dist/ink/hooks/use-key-chord.d.ts +15 -15
  41. package/dist/ink/hooks/use-paste.d.ts +38 -38
  42. package/dist/ink/hooks/use-paste.js +1 -1
  43. package/dist/ink/hooks/use-persistent-state.d.ts +46 -46
  44. package/dist/ink/hooks/use-persistent-state.js +2 -2
  45. package/dist/ink/hooks/use-scroll-acceleration.d.ts +24 -24
  46. package/dist/ink/hooks/use-scroll-input.d.ts +15 -15
  47. package/dist/ink/hooks/use-stderr.d.ts +6 -6
  48. package/dist/ink/hooks/use-stderr.js +1 -1
  49. package/dist/ink/hooks/use-stdin.d.ts +10 -10
  50. package/dist/ink/hooks/use-stdin.js +1 -1
  51. package/dist/ink/hooks/use-stdout.d.ts +6 -6
  52. package/dist/ink/hooks/use-stdout.js +1 -1
  53. package/dist/ink/hooks/use-stopwatch.d.ts +12 -12
  54. package/dist/ink/hooks/use-terminal-palette.d.ts +11 -11
  55. package/dist/ink/hooks/use-text-buffer.d.ts +2 -2
  56. package/dist/ink/hooks/use-text-selection.d.ts +19 -20
  57. package/dist/ink/hooks/use-timeout.d.ts +11 -11
  58. package/dist/ink/hooks/use-timer.d.ts +19 -19
  59. package/dist/ink/hooks/use-window-size.d.ts +8 -8
  60. package/dist/ink/hooks/use-window-size.js +1 -1
  61. package/dist/ink/index.d.ts +110 -123
  62. package/dist/ink/index.js +1 -1
  63. package/dist/ink/mouse/use-element-position.d.ts +7 -8
  64. package/dist/ink/mouse/use-mouse-action.d.ts +1 -1
  65. package/dist/ink/mouse/use-mouse-position.d.ts +1 -1
  66. package/dist/ink/mouse/use-mouse.d.ts +1 -1
  67. package/dist/ink/mouse/use-on-mouse-click.d.ts +4 -5
  68. package/dist/ink/mouse/use-on-mouse-hover.d.ts +3 -4
  69. package/dist/ink/mouse/use-on-mouse-state.d.ts +3 -4
  70. package/dist/ink/public/cursor.d.ts +47 -0
  71. package/dist/ink/public/cursor.js +1 -0
  72. package/dist/ink/public/dom.d.ts +6 -0
  73. package/dist/ink/public/dom.js +0 -0
  74. package/dist/ink/public/highlighter.d.ts +44 -0
  75. package/dist/ink/public/highlighter.js +1 -0
  76. package/dist/ink/public/input.d.ts +14 -0
  77. package/dist/ink/public/input.js +1 -0
  78. package/dist/ink/public/styles.d.ts +4 -0
  79. package/dist/ink/public/styles.js +0 -0
  80. package/dist/ink/public/utils.d.ts +5 -0
  81. package/dist/ink/public/utils.js +1 -0
  82. package/dist/packem_chunks/devtools.js +1 -1
  83. package/dist/packem_shared/{DevTools-k6uiVzqv.js → DevTools-BxD3PYAN.js} +1 -1
  84. package/dist/packem_shared/InputParser-CiBitCva.js +2 -0
  85. package/dist/packem_shared/MouseProvider-DOcWCRVq.js +1 -0
  86. package/dist/packem_shared/{Renderer-DsskdkUd.js → Renderer-BeS49FNq.js} +1 -1
  87. package/dist/packem_shared/TuiApp-CCVaiKbf.js +1 -0
  88. package/dist/packem_shared/app-context-DTm1_XBA.js +1 -0
  89. package/dist/packem_shared/app-context.d-DMLw5Nxy.d.ts +56 -0
  90. package/dist/packem_shared/boxes-DyY_LXCi.js +1 -0
  91. package/dist/packem_shared/buffer.d-CttIC480.d.ts +67 -0
  92. package/dist/packem_shared/buildCursorOnlySequence-CerkmjWt.js +1 -0
  93. package/dist/packem_shared/clipboard.d-nDPQkZ2H.d.ts +23 -0
  94. package/dist/packem_shared/color-matrix.d-sTqnJ23h.d.ts +50 -0
  95. package/dist/packem_shared/{braille-ch3O5D7I.js → createBrailleGrid-BTOQrujS.js} +1 -1
  96. package/dist/packem_shared/createCanvasBuffer-CL6sAM-A.js +1 -0
  97. package/dist/packem_shared/{createInlineLoop-BT40Wpmx.js → createInlineLoop-DnEvE2eM.js} +1 -1
  98. package/dist/packem_shared/disposeHighlighter-D9OkrhwX.js +1 -0
  99. package/dist/packem_shared/{dom.d-B4kXbaVY.d.ts → dom.d-CLGlidfI.d.ts} +140 -154
  100. package/dist/packem_shared/formatDuration-Bdx4ZgRh.js +1 -0
  101. package/dist/packem_shared/index-Dl9I2_QH.js +75 -0
  102. package/dist/packem_shared/input.d-Bb8pWHvp.d.ts +172 -0
  103. package/dist/packem_shared/{input-utils-BSWCb4F_.js → isControlCharacter-uDgBe_32.js} +1 -1
  104. package/dist/packem_shared/load-native-root-binding-CxJnHcac.js +1 -0
  105. package/dist/packem_shared/{mouse-context.d-BfL9xGk_.d.ts → mouse-context.d-W-nszUps.d.ts} +8 -8
  106. package/dist/packem_shared/reconciler-DkwOtC5B.js +1 -0
  107. package/dist/packem_shared/render-CuCo-R-l.js +24 -0
  108. package/dist/packem_shared/{render-DFZ8NHlG.js → render-DtQd8qQq.js} +1 -1
  109. package/dist/packem_shared/render.d-DjQhFsiN.d.ts +435 -0
  110. package/dist/packem_shared/{renderToString-DwXFY8Qh.js → renderToString-B1LgWcJe.js} +1 -1
  111. package/dist/packem_shared/{renderToString-L_bpw4OQ.js → renderToString-DkTmJPaS.js} +1 -1
  112. package/dist/packem_shared/renderToken-DjiQ6dfv.js +1 -0
  113. package/dist/packem_shared/renderTreeToBuffer-BpSD0sBJ.js +2 -0
  114. package/dist/packem_shared/{renderer-k-xShm1P.js → renderer-Cs0KEr1o.js} +4 -4
  115. package/dist/packem_shared/{selection.d-CI3_p8wg.d.ts → selection.d-BSAWa4ey.d.ts} +16 -16
  116. package/dist/packem_shared/stderr-context-CR2LLec6.js +1 -0
  117. package/dist/packem_shared/stdin-context-BjMA9Sbi.js +1 -0
  118. package/dist/packem_shared/stdout-context-DAAlQct2.js +1 -0
  119. package/dist/packem_shared/styles.d-CKGQFfm4.d.ts +485 -0
  120. package/dist/packem_shared/{terminal-palette.d-D2SQjfn-.d.ts → terminal-palette.d-JbWHISW-.d.ts} +7 -7
  121. package/dist/packem_shared/utils-CVgM8kTn.js +1 -0
  122. package/dist/react/index.d.ts +160 -179
  123. package/dist/react/index.js +1 -1
  124. package/dist/testing/index.d.ts +152 -152
  125. package/dist/testing/index.js +1 -1
  126. package/index.js +52 -52
  127. package/package.json +49 -384
  128. package/dist/components/accordion.d.ts +0 -59
  129. package/dist/components/accordion.js +0 -1
  130. package/dist/components/alert.d.ts +0 -26
  131. package/dist/components/alert.js +0 -1
  132. package/dist/components/animate-presence.d.ts +0 -18
  133. package/dist/components/animate-presence.js +0 -1
  134. package/dist/components/approval-prompt.d.ts +0 -65
  135. package/dist/components/approval-prompt.js +0 -1
  136. package/dist/components/area-chart.d.ts +0 -66
  137. package/dist/components/area-chart.js +0 -1
  138. package/dist/components/badge.d.ts +0 -22
  139. package/dist/components/badge.js +0 -1
  140. package/dist/components/bar-chart.d.ts +0 -67
  141. package/dist/components/bar-chart.js +0 -1
  142. package/dist/components/big-text.d.ts +0 -81
  143. package/dist/components/big-text.js +0 -1
  144. package/dist/components/blink-dot.d.ts +0 -36
  145. package/dist/components/blink-dot.js +0 -1
  146. package/dist/components/breadcrumb.d.ts +0 -33
  147. package/dist/components/breadcrumb.js +0 -1
  148. package/dist/components/button.d.ts +0 -45
  149. package/dist/components/button.js +0 -1
  150. package/dist/components/calendar.d.ts +0 -72
  151. package/dist/components/calendar.js +0 -1
  152. package/dist/components/card.d.ts +0 -57
  153. package/dist/components/card.js +0 -1
  154. package/dist/components/checkbox.d.ts +0 -48
  155. package/dist/components/checkbox.js +0 -1
  156. package/dist/components/code.d.ts +0 -48
  157. package/dist/components/code.js +0 -2
  158. package/dist/components/collapsible.d.ts +0 -53
  159. package/dist/components/collapsible.js +0 -1
  160. package/dist/components/command-block.d.ts +0 -47
  161. package/dist/components/command-block.js +0 -4
  162. package/dist/components/command-palette.d.ts +0 -82
  163. package/dist/components/command-palette.js +0 -1
  164. package/dist/components/confirm-dialog.d.ts +0 -75
  165. package/dist/components/confirm-dialog.js +0 -1
  166. package/dist/components/confirm-input.d.ts +0 -38
  167. package/dist/components/confirm-input.js +0 -1
  168. package/dist/components/console-overlay.d.ts +0 -54
  169. package/dist/components/console-overlay.js +0 -1
  170. package/dist/components/content-switcher.d.ts +0 -57
  171. package/dist/components/content-switcher.js +0 -1
  172. package/dist/components/controlled-scroll-view.d.ts +0 -61
  173. package/dist/components/controlled-scroll-view.js +0 -1
  174. package/dist/components/date-picker.d.ts +0 -65
  175. package/dist/components/date-picker.js +0 -1
  176. package/dist/components/definition-list.d.ts +0 -44
  177. package/dist/components/definition-list.js +0 -1
  178. package/dist/components/dialog.d.ts +0 -117
  179. package/dist/components/dialog.js +0 -1
  180. package/dist/components/diff-view.d.ts +0 -85
  181. package/dist/components/diff-view.js +0 -1
  182. package/dist/components/divider.d.ts +0 -49
  183. package/dist/components/divider.js +0 -1
  184. package/dist/components/file-picker-entry.d.ts +0 -104
  185. package/dist/components/file-picker-entry.js +0 -1
  186. package/dist/components/form.d.ts +0 -81
  187. package/dist/components/form.js +0 -1
  188. package/dist/components/gauge.d.ts +0 -87
  189. package/dist/components/gauge.js +0 -1
  190. package/dist/components/gradient.d.ts +0 -42
  191. package/dist/components/gradient.js +0 -1
  192. package/dist/components/heading.d.ts +0 -33
  193. package/dist/components/heading.js +0 -1
  194. package/dist/components/heatmap.d.ts +0 -62
  195. package/dist/components/heatmap.js +0 -1
  196. package/dist/components/help.d.ts +0 -52
  197. package/dist/components/help.js +0 -1
  198. package/dist/components/histogram.d.ts +0 -62
  199. package/dist/components/histogram.js +0 -1
  200. package/dist/components/kbd.d.ts +0 -31
  201. package/dist/components/kbd.js +0 -1
  202. package/dist/components/line-chart.d.ts +0 -109
  203. package/dist/components/line-chart.js +0 -1
  204. package/dist/components/link.d.ts +0 -38
  205. package/dist/components/link.js +0 -1
  206. package/dist/components/loading-indicator.d.ts +0 -29
  207. package/dist/components/loading-indicator.js +0 -1
  208. package/dist/components/markdown.d.ts +0 -40
  209. package/dist/components/markdown.js +0 -1
  210. package/dist/components/masked-input.d.ts +0 -50
  211. package/dist/components/masked-input.js +0 -1
  212. package/dist/components/menu.d.ts +0 -78
  213. package/dist/components/menu.js +0 -1
  214. package/dist/components/message-bubble.d.ts +0 -43
  215. package/dist/components/message-bubble.js +0 -1
  216. package/dist/components/model-badge.d.ts +0 -39
  217. package/dist/components/model-badge.js +0 -1
  218. package/dist/components/multi-select.d.ts +0 -65
  219. package/dist/components/multi-select.js +0 -1
  220. package/dist/components/operation-tree.d.ts +0 -49
  221. package/dist/components/operation-tree.js +0 -1
  222. package/dist/components/option-list.d.ts +0 -47
  223. package/dist/components/option-list.js +0 -1
  224. package/dist/components/ordered-list.d.ts +0 -24
  225. package/dist/components/ordered-list.js +0 -1
  226. package/dist/components/paginator.d.ts +0 -69
  227. package/dist/components/paginator.js +0 -1
  228. package/dist/components/paragraph.d.ts +0 -38
  229. package/dist/components/paragraph.js +0 -1
  230. package/dist/components/placeholder.d.ts +0 -55
  231. package/dist/components/placeholder.js +0 -1
  232. package/dist/components/progress-bar.d.ts +0 -56
  233. package/dist/components/progress-bar.js +0 -1
  234. package/dist/components/radio-group.d.ts +0 -74
  235. package/dist/components/radio-group.js +0 -1
  236. package/dist/components/scatter-plot.d.ts +0 -35
  237. package/dist/components/scatter-plot.js +0 -1
  238. package/dist/components/scroll-bar-box.d.ts +0 -37
  239. package/dist/components/scroll-bar-box.js +0 -1
  240. package/dist/components/scroll-bar.d.ts +0 -25
  241. package/dist/components/scroll-bar.js +0 -1
  242. package/dist/components/scroll-list.d.ts +0 -20
  243. package/dist/components/scroll-list.js +0 -1
  244. package/dist/components/scroll-view.d.ts +0 -10
  245. package/dist/components/scroll-view.js +0 -1
  246. package/dist/components/search-input.d.ts +0 -55
  247. package/dist/components/search-input.js +0 -1
  248. package/dist/components/select-input-indicator.d.ts +0 -32
  249. package/dist/components/select-input-indicator.js +0 -1
  250. package/dist/components/select-input-item.d.ts +0 -41
  251. package/dist/components/select-input-item.js +0 -1
  252. package/dist/components/select-input.d.ts +0 -110
  253. package/dist/components/select-input.js +0 -1
  254. package/dist/components/shimmer-text.d.ts +0 -47
  255. package/dist/components/shimmer-text.js +0 -1
  256. package/dist/components/slider.d.ts +0 -103
  257. package/dist/components/slider.js +0 -1
  258. package/dist/components/sparkline.d.ts +0 -35
  259. package/dist/components/sparkline.js +0 -1
  260. package/dist/components/spinner.d.ts +0 -17
  261. package/dist/components/spinner.js +0 -1
  262. package/dist/components/status-line.d.ts +0 -37
  263. package/dist/components/status-line.js +0 -1
  264. package/dist/components/status-message.d.ts +0 -21
  265. package/dist/components/status-message.js +0 -1
  266. package/dist/components/stepper.d.ts +0 -48
  267. package/dist/components/stepper.js +0 -1
  268. package/dist/components/stopwatch.d.ts +0 -49
  269. package/dist/components/stopwatch.js +0 -1
  270. package/dist/components/streaming-text.d.ts +0 -46
  271. package/dist/components/streaming-text.js +0 -1
  272. package/dist/components/switch.d.ts +0 -55
  273. package/dist/components/switch.js +0 -1
  274. package/dist/components/tab.d.ts +0 -19
  275. package/dist/components/tab.js +0 -1
  276. package/dist/components/table.d.ts +0 -119
  277. package/dist/components/table.js +0 -1
  278. package/dist/components/tabs.d.ts +0 -107
  279. package/dist/components/tabs.js +0 -1
  280. package/dist/components/tag.d.ts +0 -35
  281. package/dist/components/tag.js +0 -1
  282. package/dist/components/text-input.d.ts +0 -48
  283. package/dist/components/text-input.js +0 -1
  284. package/dist/components/textarea.d.ts +0 -68
  285. package/dist/components/textarea.js +0 -2
  286. package/dist/components/timer.d.ts +0 -59
  287. package/dist/components/timer.js +0 -1
  288. package/dist/components/toast.d.ts +0 -49
  289. package/dist/components/toast.js +0 -1
  290. package/dist/components/tooltip.d.ts +0 -43
  291. package/dist/components/tooltip.js +0 -1
  292. package/dist/components/transition.d.ts +0 -74
  293. package/dist/components/transition.js +0 -1
  294. package/dist/components/tree-view-entry.d.ts +0 -357
  295. package/dist/components/tree-view-entry.js +0 -1
  296. package/dist/components/unordered-list.d.ts +0 -30
  297. package/dist/components/unordered-list.js +0 -1
  298. package/dist/ink/hooks/use-linked-scroll.d.ts +0 -49
  299. package/dist/ink/hooks/use-linked-scroll.js +0 -1
  300. package/dist/packem_shared/ControlledScrollView-Cn4byU2n.js +0 -1
  301. package/dist/packem_shared/FilePicker-BLS9nOPz.js +0 -1
  302. package/dist/packem_shared/InputParser-CtwkCbrQ.js +0 -2
  303. package/dist/packem_shared/MouseProvider-DUqQ3Eaa.js +0 -1
  304. package/dist/packem_shared/ScrollBar-qa1IzDDv.js +0 -1
  305. package/dist/packem_shared/ScrollBarBox-DchESZWv.js +0 -1
  306. package/dist/packem_shared/ScrollList-BBAnRsrC.js +0 -1
  307. package/dist/packem_shared/ScrollView-CHAo7Epj.js +0 -1
  308. package/dist/packem_shared/TreeNodeMap-cJlYqckB.js +0 -1
  309. package/dist/packem_shared/TreeView-BsvLCsf0.js +0 -1
  310. package/dist/packem_shared/TuiApp-BPL8v1i1.js +0 -1
  311. package/dist/packem_shared/app-context-BVpKlG1z.js +0 -1
  312. package/dist/packem_shared/buffer.d-EJkZr8uH.d.ts +0 -39
  313. package/dist/packem_shared/clipboard.d-D6lZTQ21.d.ts +0 -23
  314. package/dist/packem_shared/color-matrix.d-DSXLsB64.d.ts +0 -50
  315. package/dist/packem_shared/controlled-scroll-view-BVg7ywNW.js +0 -1
  316. package/dist/packem_shared/cursor-helpers.d-BONB9tky.d.ts +0 -12
  317. package/dist/packem_shared/format-time-fjoQHMxD.js +0 -1
  318. package/dist/packem_shared/input.d-CgxV2e8U.d.ts +0 -90
  319. package/dist/packem_shared/line-chart-C7CUrvVs.js +0 -1
  320. package/dist/packem_shared/load-native-root-binding-DDikxNox.js +0 -1
  321. package/dist/packem_shared/reconciler-CFyBVf7l.js +0 -1
  322. package/dist/packem_shared/render-CuQecTAs.js +0 -24
  323. package/dist/packem_shared/render.d-CBnYBDk2.d.ts +0 -417
  324. package/dist/packem_shared/renderTreeToBuffer-C8lS0lJ2.js +0 -2
  325. package/dist/packem_shared/scroll-view.d-DtpsgHLg.d.ts +0 -119
  326. package/dist/packem_shared/stderr-context-Bvnik0hL.js +0 -1
  327. package/dist/packem_shared/stdin-context-88AhuztD.js +0 -1
  328. package/dist/packem_shared/stdout-context-BnblEPez.js +0 -1
  329. package/dist/packem_shared/styles.d-cMo36xQz.d.ts +0 -396
  330. package/dist/packem_shared/token-to-elements-D6J6-P2A.js +0 -1
  331. package/dist/packem_shared/treeViewTheme-Dq3ekRAC.js +0 -1
  332. package/dist/packem_shared/useTreeView-D5ifGwG3.js +0 -1
  333. package/dist/packem_shared/useTreeViewState-BiTJakkh.js +0 -1
  334. package/dist/packem_shared/utils-Bup8lyK8.js +0 -1
  335. package/dist/packem_shared/variant-config-BJqpNo7H.js +0 -1
  336. package/dist/packem_shared/variant-config.d-D5NnrrQK.d.ts +0 -2
@@ -0,0 +1,485 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { LiteralUnion } from 'type-fest';
3
+ import 'yoga-layout';
4
+ /**
5
+ Style of the box border.
6
+ */
7
+ type BoxStyle = {
8
+ readonly topLeft: string;
9
+ readonly top: string;
10
+ readonly topRight: string;
11
+ readonly right: string;
12
+ readonly bottomRight: string;
13
+ readonly bottom: string;
14
+ readonly bottomLeft: string;
15
+ readonly left: string;
16
+ };
17
+ /**
18
+ All box styles.
19
+ */
20
+ type Boxes = {
21
+ /**
22
+ @example
23
+ ```
24
+ ┌────┐
25
+ │ │
26
+ └────┘
27
+ ```
28
+ */
29
+ readonly single: BoxStyle;
30
+ /**
31
+ @example
32
+ ```
33
+ ╔════╗
34
+ ║ ║
35
+ ╚════╝
36
+ ```
37
+ */
38
+ readonly double: BoxStyle;
39
+ /**
40
+ @example
41
+ ```
42
+ ╭────╮
43
+ │ │
44
+ ╰────╯
45
+ ```
46
+ */
47
+ readonly round: BoxStyle;
48
+ /**
49
+ @example
50
+ ```
51
+ ┏━━━━┓
52
+ ┃ ┃
53
+ ┗━━━━┛
54
+ ```
55
+ */
56
+ readonly bold: BoxStyle;
57
+ /**
58
+ @example
59
+ ```
60
+ ╓────╖
61
+ ║ ║
62
+ ╙────╜
63
+ ```
64
+ */
65
+ readonly singleDouble: BoxStyle;
66
+ /**
67
+ @example
68
+ ```
69
+ ╒════╕
70
+ │ │
71
+ ╘════╛
72
+ ```
73
+ */
74
+ readonly doubleSingle: BoxStyle;
75
+ /**
76
+ @example
77
+ ```
78
+ +----+
79
+ | |
80
+ +----+
81
+ ```
82
+ */
83
+ readonly classic: BoxStyle;
84
+ /**
85
+ @example
86
+ ```
87
+ ↘↓↓↓↓↙
88
+ → ←
89
+ ↗↑↑↑↑↖
90
+ ```
91
+ */
92
+ readonly arrow: BoxStyle;
93
+ };
94
+ type Styles = {
95
+ /**
96
+ * It defines the alignment along the cross axis when there are multiple lines of flex items (when using flex-wrap).
97
+ * See [align-content](https://css-tricks.com/almanac/properties/a/align-content/).
98
+ */
99
+ readonly alignContent?: "flex-start" | "flex-end" | "center" | "stretch" | "space-between" | "space-around" | "space-evenly";
100
+ /**
101
+ * The align-items property defines the default behavior for how items are laid out along the cross axis (perpendicular to the main axis).
102
+ * See [align-items](https://css-tricks.com/almanac/properties/a/align-items/).
103
+ */
104
+ readonly alignItems?: "flex-start" | "center" | "flex-end" | "stretch" | "baseline";
105
+ /**
106
+ * It makes possible to override the align-items value for specific flex items.
107
+ * See [align-self](https://css-tricks.com/almanac/properties/a/align-self/).
108
+ */
109
+ readonly alignSelf?: "flex-start" | "center" | "flex-end" | "auto" | "stretch" | "baseline";
110
+ /**
111
+ * Defines the aspect ratio (width/height) for the element.
112
+ *
113
+ * Use it with at least one size constraint (`width`, `height`, `minHeight`, or `maxHeight`) so Ink can derive the missing dimension.
114
+ */
115
+ readonly aspectRatio?: number;
116
+ /**
117
+ * Background color for the element.
118
+ *
119
+ * Accepts the same values as `color` in the `<Text>` component.
120
+ */
121
+ readonly backgroundColor?: LiteralUnion<AnsiColors, string>;
122
+ /**
123
+ * Change border background color. A shorthand for setting `borderTopBackgroundColor`, `borderRightBackgroundColor`, `borderBottomBackgroundColor`, and `borderLeftBackgroundColor`.
124
+ */
125
+ readonly borderBackgroundColor?: LiteralUnion<AnsiColors, string>;
126
+ /**
127
+ * Determines whether the bottom border is visible.
128
+ * @default true
129
+ */
130
+ readonly borderBottom?: boolean;
131
+ /**
132
+ * Change the bottom border background color. Accepts the same values as `backgroundColor` in `Text` component.
133
+ */
134
+ readonly borderBottomBackgroundColor?: LiteralUnion<AnsiColors, string>;
135
+ /**
136
+ * Change the bottom border color. Accepts the same values as `color` in `Text` component.
137
+ */
138
+ readonly borderBottomColor?: LiteralUnion<AnsiColors, string>;
139
+ /**
140
+ * Dim the bottom border color.
141
+ * @default false
142
+ */
143
+ readonly borderBottomDimColor?: boolean;
144
+ /**
145
+ * Text to display embedded in the bottom border line.
146
+ * Rendered as: `└─ title ─────────┘`
147
+ */
148
+ readonly borderBottomTitle?: string;
149
+ /**
150
+ * Alignment of the bottom border title.
151
+ * @default "left"
152
+ */
153
+ readonly borderBottomTitleAlignment?: "center" | "left" | "right";
154
+ /**
155
+ * Change border color. A shorthand for setting `borderTopColor`, `borderRightColor`, `borderBottomColor`, and `borderLeftColor`.
156
+ */
157
+ readonly borderColor?: LiteralUnion<AnsiColors, string>;
158
+ /**
159
+ * Dim the border color. A shorthand for setting `borderTopDimColor`, `borderBottomDimColor`, `borderLeftDimColor`, and `borderRightDimColor`.
160
+ * @default false
161
+ */
162
+ readonly borderDimColor?: boolean;
163
+ /**
164
+ * Determines whether the left border is visible.
165
+ * @default true
166
+ */
167
+ readonly borderLeft?: boolean;
168
+ /**
169
+ * Change the left border background color. Accepts the same values as `backgroundColor` in `Text` component.
170
+ */
171
+ readonly borderLeftBackgroundColor?: LiteralUnion<AnsiColors, string>;
172
+ /**
173
+ * Change the left border color. Accepts the same values as `color` in `Text` component.
174
+ */
175
+ readonly borderLeftColor?: LiteralUnion<AnsiColors, string>;
176
+ /**
177
+ * Dim the left border color.
178
+ * @default false
179
+ */
180
+ readonly borderLeftDimColor?: boolean;
181
+ /**
182
+ * Determines whether the right border is visible.
183
+ * @default true
184
+ */
185
+ readonly borderRight?: boolean;
186
+ /**
187
+ * Change the right border background color. Accepts the same values as `backgroundColor` in `Text` component.
188
+ */
189
+ readonly borderRightBackgroundColor?: LiteralUnion<AnsiColors, string>;
190
+ /**
191
+ * Change the right border color. Accepts the same values as `color` in `Text` component.
192
+ */
193
+ readonly borderRightColor?: LiteralUnion<AnsiColors, string>;
194
+ /**
195
+ * Dim the right border color.
196
+ * @default false
197
+ */
198
+ readonly borderRightDimColor?: boolean;
199
+ /**
200
+ * Add a border with a specified style. If `borderStyle` is `undefined` (the default), no border will be added.
201
+ */
202
+ readonly borderStyle?: keyof Boxes | BoxStyle;
203
+ /**
204
+ * Determines whether the top border is visible.
205
+ * @default true
206
+ */
207
+ readonly borderTop?: boolean;
208
+ /**
209
+ * Change the top border background color. Accepts the same values as `backgroundColor` in `Text` component.
210
+ */
211
+ readonly borderTopBackgroundColor?: LiteralUnion<AnsiColors, string>;
212
+ /**
213
+ * Change the top border color. Accepts the same values as `color` in `Text` component.
214
+ */
215
+ readonly borderTopColor?: LiteralUnion<AnsiColors, string>;
216
+ /**
217
+ * Dim the top border color.
218
+ * @default false
219
+ */
220
+ readonly borderTopDimColor?: boolean;
221
+ /**
222
+ * Text to display on the right side of the top border line.
223
+ * Rendered as: `┌─ title ──── rightTitle ─┐`
224
+ */
225
+ readonly borderTopRightTitle?: string;
226
+ /**
227
+ * Text to display embedded in the top border line.
228
+ * Rendered as: `┌─ title ─────────┐`
229
+ */
230
+ readonly borderTopTitle?: string;
231
+ /**
232
+ * Alignment of the top border title.
233
+ * @default "left"
234
+ */
235
+ readonly borderTopTitleAlignment?: "center" | "left" | "right";
236
+ /**
237
+ * Bottom offset for positioned elements.
238
+ */
239
+ readonly bottom?: number | string;
240
+ /**
241
+ * Size of the gap between an element's columns.
242
+ */
243
+ readonly columnGap?: number;
244
+ /**
245
+ * Set this property to `none` to hide the element.
246
+ */
247
+ readonly display?: "flex" | "none";
248
+ /**
249
+ * It specifies the initial size of the flex item, before any available space is distributed according to the flex factors.
250
+ * See [flex-basis](https://css-tricks.com/almanac/properties/f/flex-basis/).
251
+ */
252
+ readonly flexBasis?: number | string;
253
+ /**
254
+ * It establishes the main-axis, thus defining the direction flex items are placed in the flex container.
255
+ * See [flex-direction](https://css-tricks.com/almanac/properties/f/flex-direction/).
256
+ */
257
+ readonly flexDirection?: "row" | "column" | "row-reverse" | "column-reverse";
258
+ /**
259
+ * This property defines the ability for a flex item to grow if necessary.
260
+ * See [flex-grow](https://css-tricks.com/almanac/properties/f/flex-grow/).
261
+ */
262
+ readonly flexGrow?: number;
263
+ /**
264
+ * It specifies the “flex shrink factor”, which determines how much the flex item will shrink relative to the rest of the flex items in the flex container when there isn’t enough space on the row.
265
+ * See [flex-shrink](https://css-tricks.com/almanac/properties/f/flex-shrink/).
266
+ */
267
+ readonly flexShrink?: number;
268
+ /**
269
+ * It defines whether the flex items are forced in a single line or can be flowed into multiple lines. If set to multiple lines, it also defines the cross-axis which determines the direction new lines are stacked in.
270
+ * See [flex-wrap](https://css-tricks.com/almanac/properties/f/flex-wrap/).
271
+ */
272
+ readonly flexWrap?: "nowrap" | "wrap" | "wrap-reverse";
273
+ /**
274
+ * Size of the gap between an element's columns and rows. A shorthand for `columnGap` and `rowGap`.
275
+ */
276
+ readonly gap?: number;
277
+ /**
278
+ * Height of the element in lines (rows). You can also set it as a percentage, which will calculate the height based on the height of the parent element.
279
+ */
280
+ readonly height?: number | string;
281
+ /**
282
+ * It defines the alignment along the main axis.
283
+ * See [justify-content](https://css-tricks.com/almanac/properties/j/justify-content/).
284
+ */
285
+ readonly justifyContent?: "flex-start" | "flex-end" | "space-between" | "space-around" | "space-evenly" | "center";
286
+ /**
287
+ * Left offset for positioned elements.
288
+ */
289
+ readonly left?: number | string;
290
+ /**
291
+ * Margin on all sides. Equivalent to setting `marginTop`, `marginBottom`, `marginLeft`, and `marginRight`.
292
+ */
293
+ readonly margin?: number;
294
+ /**
295
+ * Bottom margin.
296
+ */
297
+ readonly marginBottom?: number;
298
+ /**
299
+ * Left margin.
300
+ */
301
+ readonly marginLeft?: number;
302
+ /**
303
+ * Right margin.
304
+ */
305
+ readonly marginRight?: number;
306
+ /**
307
+ * Top margin.
308
+ */
309
+ readonly marginTop?: number;
310
+ /**
311
+ * Horizontal margin. Equivalent to setting `marginLeft` and `marginRight`.
312
+ */
313
+ readonly marginX?: number;
314
+ /**
315
+ * Vertical margin. Equivalent to setting `marginTop` and `marginBottom`.
316
+ */
317
+ readonly marginY?: number;
318
+ /**
319
+ * Sets a maximum height of the element in lines (rows). You can also set it as a percentage, which will calculate the maximum height based on the height of the parent element.
320
+ */
321
+ readonly maxHeight?: number | string;
322
+ /**
323
+ * Caps how far the stable scroll height is allowed to grow beyond the
324
+ * content currently in the box, in rows. Only applies when both
325
+ * `stableScrollback` and `overflowToBackbuffer` are enabled.
326
+ *
327
+ * Without a cap, `scrollHeight` for a stable-scrollback box never shrinks
328
+ * and grows monotonically for the lifetime of the box (long-running logs,
329
+ * streaming output). That makes the scrollbar/scrollTop math treat an
330
+ * ever-growing region as scrollable even after the content is gone. This
331
+ * bounds the retained history to at most `maxScrollbackLength` rows past
332
+ * the current content. Omit for the previous unbounded behavior.
333
+ *
334
+ * It also bounds a single-frame backbuffer burst to at most this many rows
335
+ * on a large `scrollTop` jump. A value of `0` therefore disables
336
+ * terminal-scrollback emission entirely (scrolled-off lines are still
337
+ * clipped from the live view, just not flushed to history) — use it to
338
+ * cap growth without keeping any backbuffer, or omit it for unbounded
339
+ * retention.
340
+ */
341
+ readonly maxScrollbackLength?: number;
342
+ /**
343
+ * Sets a maximum width of the element.
344
+ * Percentages aren't supported yet; see https://github.com/facebook/yoga/issues/872.
345
+ */
346
+ readonly maxWidth?: number | string;
347
+ /**
348
+ * Sets a minimum height of the element in lines (rows). You can also set it as a percentage, which will calculate the minimum height based on the height of the parent element.
349
+ */
350
+ readonly minHeight?: number | string;
351
+ /**
352
+ * Sets a minimum width of the element.
353
+ * Percentages aren't supported yet; see https://github.com/facebook/yoga/issues/872.
354
+ */
355
+ readonly minWidth?: number | string;
356
+ /**
357
+ * Behavior for an element's overflow in both directions.
358
+ * @default 'visible'
359
+ */
360
+ readonly overflow?: "visible" | "hidden" | "scroll";
361
+ /**
362
+ * If true, content that is scrolled out of the top of the box (when overflowY is 'scroll')
363
+ * is flushed into the terminal emulator's real scrollback history instead
364
+ * of being clipped and discarded. Scrolling back up in the terminal reveals
365
+ * the original lines.
366
+ *
367
+ * Constraints:
368
+ * - Inline mode only. In alternate-screen mode the terminal has no
369
+ * scrollback, so this is a no-op. Non-TTY/piped output is also a no-op
370
+ * (content is clipped as before).
371
+ * - Exactly one scrollable region in the app may enable
372
+ * `overflowToBackbuffer`. Results are undefined with more than one.
373
+ *
374
+ * Each scrolled-off line is emitted exactly once; scrolling back up never
375
+ * re-emits. Pair with `stableScrollback` to keep `scrollTop` math stable as
376
+ * history accumulates, and `maxScrollbackLength` to bound a single-frame
377
+ * burst on a large `scrollTop` jump.
378
+ * @default false
379
+ */
380
+ readonly overflowToBackbuffer?: boolean;
381
+ /**
382
+ * Behavior for an element's overflow in the horizontal direction.
383
+ * @default 'visible'
384
+ */
385
+ readonly overflowX?: "visible" | "hidden" | "scroll";
386
+ /**
387
+ * Behavior for an element's overflow in the vertical direction.
388
+ * @default 'visible'
389
+ */
390
+ readonly overflowY?: "visible" | "hidden" | "scroll";
391
+ /**
392
+ * Padding on all sides. Equivalent to setting `paddingTop`, `paddingBottom`, `paddingLeft`, and `paddingRight`.
393
+ */
394
+ readonly padding?: number;
395
+ /**
396
+ * Bottom padding.
397
+ */
398
+ readonly paddingBottom?: number;
399
+ /**
400
+ * Left padding.
401
+ */
402
+ readonly paddingLeft?: number;
403
+ /**
404
+ * Right padding.
405
+ */
406
+ readonly paddingRight?: number;
407
+ /**
408
+ * Top padding.
409
+ */
410
+ readonly paddingTop?: number;
411
+ /**
412
+ * Horizontal padding. Equivalent to setting `paddingLeft` and `paddingRight`.
413
+ */
414
+ readonly paddingX?: number;
415
+ /**
416
+ * Vertical padding. Equivalent to setting `paddingTop` and `paddingBottom`.
417
+ */
418
+ readonly paddingY?: number;
419
+ /**
420
+ * Controls how the element is positioned.
421
+ *
422
+ * When `position` is `static`, `top`, `right`, `bottom`, and `left` are ignored.
423
+ */
424
+ readonly position?: "absolute" | "relative" | "static";
425
+ /**
426
+ * Right offset for positioned elements.
427
+ */
428
+ readonly right?: number | string;
429
+ /**
430
+ * Size of the gap between an element's rows.
431
+ */
432
+ readonly rowGap?: number;
433
+ /**
434
+ * Color of the scrollbar thumb when overflow is set to 'scroll'.
435
+ */
436
+ readonly scrollbarThumbColor?: LiteralUnion<AnsiColors, string>;
437
+ /**
438
+ * Horizontal scroll position (in columns). Only applies when overflowX or overflow is 'scroll'.
439
+ */
440
+ readonly scrollLeft?: number;
441
+ /**
442
+ * Vertical scroll position (in rows). Only applies when overflowY or overflow is 'scroll'.
443
+ */
444
+ readonly scrollTop?: number;
445
+ /**
446
+ * If true, and `overflowToBackbuffer` is also enabled, the `scrollHeight` of the box
447
+ * will never decrease as long as the existing history remains valid.
448
+ * This prevents the terminal's scrollback from being corrupted when content shrinks.
449
+ *
450
+ * Growth is bounded by `maxScrollbackLength` (if set); otherwise the stable
451
+ * height grows monotonically for the lifetime of the box.
452
+ * @default false
453
+ */
454
+ readonly stableScrollback?: boolean;
455
+ /**
456
+ * Controls how text wraps when it exceeds the container width.
457
+ *
458
+ * - `wrap` (default) — Wrap at word boundaries; break inside words only when a single word exceeds the width.
459
+ * - `wrap-anywhere` — Break at any character boundary, even when a whitespace break exists earlier.
460
+ * - `wrap-preserve-words` — Wrap at word boundaries; never break inside words (long words may overflow).
461
+ * - `wrap-strict` — Enforce exact width; always break at the column limit.
462
+ * - `hard` — Alias for `wrap-strict`. Fills each line to the full column width, breaking words mid-word as needed.
463
+ * - `truncate` / `truncate-end` — Truncate at the end with an ellipsis.
464
+ * - `truncate-start` — Truncate at the start with an ellipsis.
465
+ * - `truncate-middle` — Truncate in the middle with an ellipsis.
466
+ */
467
+ readonly textWrap?: "hard" | "wrap" | "wrap-anywhere" | "wrap-preserve-words" | "wrap-strict" | "end" | "middle" | "truncate-end" | "truncate" | "truncate-middle" | "truncate-start";
468
+ /**
469
+ * Top offset for positioned elements.
470
+ */
471
+ readonly top?: number | string;
472
+ /**
473
+ * Determines whether the user can select text within this element.
474
+ * - `auto`: Default behavior, text is selectable.
475
+ * - `none`: Text cannot be selected.
476
+ * - `text`: Only text can be selected.
477
+ * - `all`: All content is selected on click.
478
+ */
479
+ readonly userSelect?: "auto" | "none" | "text" | "all";
480
+ /**
481
+ * Width of the element in spaces. You can also set it as a percentage, which will calculate the width based on the width of the parent element.
482
+ */
483
+ readonly width?: number | string;
484
+ };
485
+ export { Styles as S };
@@ -6,14 +6,14 @@ type TerminalPalette = {
6
6
  readonly foreground: string;
7
7
  };
8
8
  /**
9
- * Check if the terminal likely supports OSC palette queries.
10
- */
9
+ * Check if the terminal likely supports OSC palette queries.
10
+ */
11
11
  declare const isTerminalPaletteQuerySupported: () => boolean;
12
12
  /**
13
- * Query the terminal for its current color palette.
14
- * @param stdin Readable stream (typically process.stdin in raw mode)
15
- * @param stdout Writable stream (typically process.stdout)
16
- * @param timeout Per-query timeout in milliseconds (default: 500)
17
- */
13
+ * Query the terminal for its current color palette.
14
+ * @param stdin Readable stream (typically process.stdin in raw mode)
15
+ * @param stdout Writable stream (typically process.stdout)
16
+ * @param timeout Per-query timeout in milliseconds (default: 500)
17
+ */
18
18
  declare const queryTerminalPalette: (stdin: NodeJS.ReadableStream, stdout: Writable, timeout?: number) => Promise<Partial<TerminalPalette>>;
19
19
  export { TerminalPalette as T, isTerminalPaletteQuerySupported as i, queryTerminalPalette as q };
@@ -0,0 +1 @@
1
+ import{createRequire as w}from"node:module";let _;const b=e=>(_??=w(import.meta.url))(e),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,m=e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[r,s]=o.versions.node.split(".").map(Number);if(r>22||r===22&&s>=3||r===20&&s>=16)return o.getBuiltinModule(e)}return b(e)},n=o,{execFileSync:g}=m("node:child_process"),c=m("node:fs"),h=m("node:tty"),d=80,p=24,a=(e,r,{shell:s,env:t}={})=>g(e,r,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:s,env:t}).trim(),u=(e,r)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(r,10)}),N=(e,r)=>{const{columns:s,rows:t}=u(e,r);if(!(Number.isNaN(s)||Number.isNaN(t))&&!(s===d&&t===p))return{columns:s,rows:t}},y=()=>{if(n.platform!=="linux")return!0;try{const e=c.readFileSync("/proc/self/stat","utf8"),r=e.lastIndexOf(") ");if(r===-1)return!1;const s=e.slice(r+2).trim().split(/\s+/),t=Number.parseInt(s[2],10),i=Number.parseInt(s[5],10);return Number.isNaN(t)||Number.isNaN(i)||i<=0?!1:t===i}catch{return!1}};function v(){const{env:e,stdout:r,stderr:s}=n;if(r?.columns&&r?.rows)return u(r.columns,r.rows);if(s?.columns&&s?.rows)return u(s.columns,s.rows);if(e.COLUMNS&&e.LINES)return u(e.COLUMNS,e.LINES);const t={columns:d,rows:p};return n.platform==="win32"?l()??t:n.platform==="darwin"?f()??l()??t:f()??l()??O()??t}const f=()=>{try{const e=n.platform==="darwin"?c.constants.O_EVTONLY|c.constants.O_NONBLOCK:c.constants.O_NONBLOCK,{columns:r,rows:s}=h.WriteStream(c.openSync("/dev/tty",e));return{columns:r,rows:s}}catch{}},l=()=>{try{const e=a("tput",["cols"],{env:{TERM:"dumb",...n.env}}),r=a("tput",["lines"],{env:{TERM:"dumb",...n.env}});if(e&&r)return N(e,r)}catch{}},O=()=>{try{if(!y())return;const e=a("resize",["-u"]).match(/\d+/g);if(e.length===2)return N(e[0],e[1])}catch{}},I=e=>{const{columns:r,rows:s}=e;if(r&&s)return{columns:r,rows:s};const t=v();return{columns:r||t.columns||80,rows:s||t.rows||24}};export{I as g};