@visulima/tui 1.0.0-alpha.9 → 1.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 (549) hide show
  1. package/CHANGELOG.md +650 -0
  2. package/LICENSE.md +2414 -187
  3. package/README.md +49 -4
  4. package/dist/components/accordion.d.ts +59 -0
  5. package/dist/components/accordion.js +1 -0
  6. package/dist/components/alert.d.ts +26 -0
  7. package/dist/components/alert.js +1 -0
  8. package/dist/components/animate-presence.d.ts +18 -0
  9. package/dist/components/animate-presence.js +1 -0
  10. package/dist/components/approval-prompt.d.ts +65 -0
  11. package/dist/components/approval-prompt.js +1 -0
  12. package/dist/components/area-chart.d.ts +66 -0
  13. package/dist/components/area-chart.js +1 -0
  14. package/dist/components/badge.d.ts +22 -0
  15. package/dist/components/badge.js +1 -0
  16. package/dist/components/bar-chart.d.ts +67 -0
  17. package/dist/components/bar-chart.js +1 -0
  18. package/dist/components/big-text.d.ts +81 -0
  19. package/dist/components/big-text.js +1 -0
  20. package/dist/components/blink-dot.d.ts +36 -0
  21. package/dist/components/blink-dot.js +1 -0
  22. package/dist/components/box.d.ts +62 -0
  23. package/dist/components/box.js +1 -0
  24. package/dist/components/breadcrumb.d.ts +33 -0
  25. package/dist/components/breadcrumb.js +1 -0
  26. package/dist/components/button.d.ts +45 -0
  27. package/dist/components/button.js +1 -0
  28. package/dist/components/calendar.d.ts +72 -0
  29. package/dist/components/calendar.js +1 -0
  30. package/dist/components/canvas.d.ts +44 -0
  31. package/dist/components/canvas.js +1 -0
  32. package/dist/components/card.d.ts +57 -0
  33. package/dist/components/card.js +1 -0
  34. package/dist/components/checkbox.d.ts +48 -0
  35. package/dist/components/checkbox.js +1 -0
  36. package/dist/components/code.d.ts +48 -0
  37. package/dist/components/code.js +2 -0
  38. package/dist/components/collapsible.d.ts +53 -0
  39. package/dist/components/collapsible.js +1 -0
  40. package/dist/components/command-block.d.ts +47 -0
  41. package/dist/components/command-block.js +4 -0
  42. package/dist/components/command-palette.d.ts +82 -0
  43. package/dist/components/command-palette.js +1 -0
  44. package/dist/components/confirm-dialog.d.ts +75 -0
  45. package/dist/components/confirm-dialog.js +1 -0
  46. package/dist/components/confirm-input.d.ts +38 -0
  47. package/dist/components/confirm-input.js +1 -0
  48. package/dist/components/console-overlay.d.ts +54 -0
  49. package/dist/components/console-overlay.js +1 -0
  50. package/dist/components/content-switcher.d.ts +57 -0
  51. package/dist/components/content-switcher.js +1 -0
  52. package/dist/components/controlled-scroll-view.d.ts +61 -0
  53. package/dist/components/controlled-scroll-view.js +1 -0
  54. package/dist/components/cursor.d.ts +62 -0
  55. package/dist/components/cursor.js +1 -0
  56. package/dist/components/date-picker.d.ts +65 -0
  57. package/dist/components/date-picker.js +1 -0
  58. package/dist/components/definition-list.d.ts +44 -0
  59. package/dist/components/definition-list.js +1 -0
  60. package/dist/components/dialog.d.ts +117 -0
  61. package/dist/components/dialog.js +1 -0
  62. package/dist/components/diff-view.d.ts +85 -0
  63. package/dist/components/diff-view.js +1 -0
  64. package/dist/components/divider.d.ts +49 -0
  65. package/dist/components/divider.js +1 -0
  66. package/dist/components/file-picker-entry.d.ts +104 -0
  67. package/dist/components/file-picker-entry.js +1 -0
  68. package/dist/components/form.d.ts +81 -0
  69. package/dist/components/form.js +1 -0
  70. package/dist/components/gauge.d.ts +87 -0
  71. package/dist/components/gauge.js +1 -0
  72. package/dist/components/gradient.d.ts +42 -0
  73. package/dist/components/gradient.js +1 -0
  74. package/dist/components/heading.d.ts +33 -0
  75. package/dist/components/heading.js +1 -0
  76. package/dist/components/heatmap.d.ts +62 -0
  77. package/dist/components/heatmap.js +1 -0
  78. package/dist/components/help.d.ts +52 -0
  79. package/dist/components/help.js +1 -0
  80. package/dist/components/histogram.d.ts +62 -0
  81. package/dist/components/histogram.js +1 -0
  82. package/dist/components/kbd.d.ts +31 -0
  83. package/dist/components/kbd.js +1 -0
  84. package/dist/components/line-chart.d.ts +109 -0
  85. package/dist/components/line-chart.js +1 -0
  86. package/dist/components/link.d.ts +38 -0
  87. package/dist/components/link.js +1 -0
  88. package/dist/components/loading-indicator.d.ts +29 -0
  89. package/dist/components/loading-indicator.js +1 -0
  90. package/dist/components/markdown.d.ts +40 -0
  91. package/dist/components/markdown.js +1 -0
  92. package/dist/components/masked-input.d.ts +50 -0
  93. package/dist/components/masked-input.js +1 -0
  94. package/dist/components/menu.d.ts +78 -0
  95. package/dist/components/menu.js +1 -0
  96. package/dist/components/message-bubble.d.ts +43 -0
  97. package/dist/components/message-bubble.js +1 -0
  98. package/dist/components/model-badge.d.ts +39 -0
  99. package/dist/components/model-badge.js +1 -0
  100. package/dist/components/multi-select.d.ts +65 -0
  101. package/dist/components/multi-select.js +1 -0
  102. package/dist/components/newline.d.ts +15 -0
  103. package/dist/components/newline.js +2 -0
  104. package/dist/components/operation-tree.d.ts +49 -0
  105. package/dist/components/operation-tree.js +1 -0
  106. package/dist/components/option-list.d.ts +47 -0
  107. package/dist/components/option-list.js +1 -0
  108. package/dist/components/ordered-list.d.ts +24 -0
  109. package/dist/components/ordered-list.js +1 -0
  110. package/dist/components/paginator.d.ts +69 -0
  111. package/dist/components/paginator.js +1 -0
  112. package/dist/components/paragraph.d.ts +38 -0
  113. package/dist/components/paragraph.js +1 -0
  114. package/dist/components/placeholder.d.ts +55 -0
  115. package/dist/components/placeholder.js +1 -0
  116. package/dist/components/progress-bar.d.ts +56 -0
  117. package/dist/components/progress-bar.js +1 -0
  118. package/dist/components/radio-group.d.ts +74 -0
  119. package/dist/components/radio-group.js +1 -0
  120. package/dist/components/scatter-plot.d.ts +35 -0
  121. package/dist/components/scatter-plot.js +1 -0
  122. package/dist/components/scroll-bar-box.d.ts +37 -0
  123. package/dist/components/scroll-bar-box.js +1 -0
  124. package/dist/components/scroll-bar.d.ts +25 -0
  125. package/dist/components/scroll-bar.js +1 -0
  126. package/dist/components/scroll-list.d.ts +20 -0
  127. package/dist/components/scroll-list.js +1 -0
  128. package/dist/components/scroll-view.d.ts +10 -0
  129. package/dist/components/scroll-view.js +1 -0
  130. package/dist/components/search-input.d.ts +55 -0
  131. package/dist/components/search-input.js +1 -0
  132. package/dist/components/select-input-indicator.d.ts +32 -0
  133. package/dist/components/select-input-indicator.js +1 -0
  134. package/dist/components/select-input-item.d.ts +41 -0
  135. package/dist/components/select-input-item.js +1 -0
  136. package/dist/components/select-input.d.ts +110 -0
  137. package/dist/components/select-input.js +1 -0
  138. package/dist/components/shimmer-text.d.ts +47 -0
  139. package/dist/components/shimmer-text.js +1 -0
  140. package/dist/components/slider.d.ts +103 -0
  141. package/dist/components/slider.js +1 -0
  142. package/dist/components/spacer.d.ts +8 -0
  143. package/dist/components/spacer.js +1 -0
  144. package/dist/components/sparkline.d.ts +35 -0
  145. package/dist/components/sparkline.js +1 -0
  146. package/dist/components/spinner.d.ts +17 -0
  147. package/dist/components/spinner.js +1 -0
  148. package/dist/components/static-render.d.ts +55 -0
  149. package/dist/components/static-render.js +1 -0
  150. package/dist/components/static.d.ts +29 -0
  151. package/dist/components/static.js +1 -0
  152. package/dist/components/status-line.d.ts +37 -0
  153. package/dist/components/status-line.js +1 -0
  154. package/dist/components/status-message.d.ts +21 -0
  155. package/dist/components/status-message.js +1 -0
  156. package/dist/components/stepper.d.ts +48 -0
  157. package/dist/components/stepper.js +1 -0
  158. package/dist/components/stopwatch.d.ts +49 -0
  159. package/dist/components/stopwatch.js +1 -0
  160. package/dist/components/streaming-text.d.ts +46 -0
  161. package/dist/components/streaming-text.js +1 -0
  162. package/dist/components/switch.d.ts +55 -0
  163. package/dist/components/switch.js +1 -0
  164. package/dist/components/tab.d.ts +19 -0
  165. package/dist/components/tab.js +1 -0
  166. package/dist/components/table.d.ts +119 -0
  167. package/dist/components/table.js +1 -0
  168. package/dist/components/tabs.d.ts +107 -0
  169. package/dist/components/tabs.js +1 -0
  170. package/dist/components/tag.d.ts +35 -0
  171. package/dist/components/tag.js +1 -0
  172. package/dist/components/text-input.d.ts +48 -0
  173. package/dist/components/text-input.js +1 -0
  174. package/dist/components/text.d.ts +79 -0
  175. package/dist/components/text.js +1 -0
  176. package/dist/components/textarea.d.ts +68 -0
  177. package/dist/components/textarea.js +2 -0
  178. package/dist/components/timer.d.ts +59 -0
  179. package/dist/components/timer.js +1 -0
  180. package/dist/components/toast.d.ts +49 -0
  181. package/dist/components/toast.js +1 -0
  182. package/dist/components/tooltip.d.ts +43 -0
  183. package/dist/components/tooltip.js +1 -0
  184. package/dist/components/transform.d.ts +21 -0
  185. package/dist/components/transform.js +1 -0
  186. package/dist/components/transition.d.ts +74 -0
  187. package/dist/components/transition.js +1 -0
  188. package/dist/components/tree-view-entry.d.ts +357 -0
  189. package/dist/components/tree-view-entry.js +1 -0
  190. package/dist/components/unordered-list.d.ts +30 -0
  191. package/dist/components/unordered-list.js +1 -0
  192. package/dist/core/index.d.ts +2 -2
  193. package/dist/core/index.js +1 -1
  194. package/dist/ink/hooks/use-animation.d.ts +41 -0
  195. package/dist/ink/hooks/use-animation.js +1 -0
  196. package/dist/ink/hooks/use-app.d.ts +38 -0
  197. package/dist/ink/hooks/use-app.js +1 -0
  198. package/dist/ink/hooks/use-box-metrics.d.ts +66 -0
  199. package/dist/ink/hooks/use-box-metrics.js +1 -0
  200. package/dist/ink/hooks/use-clipboard.d.ts +30 -0
  201. package/dist/ink/hooks/use-clipboard.js +1 -0
  202. package/dist/ink/hooks/use-color-blindness.d.ts +33 -0
  203. package/dist/ink/hooks/use-color-blindness.js +1 -0
  204. package/dist/ink/hooks/use-console-capture.d.ts +43 -0
  205. package/dist/ink/hooks/use-console-capture.js +1 -0
  206. package/dist/ink/hooks/use-cursor.d.ts +13 -0
  207. package/dist/ink/hooks/use-cursor.js +1 -0
  208. package/dist/ink/hooks/use-focus-manager.d.ts +57 -0
  209. package/dist/ink/hooks/use-focus-manager.js +1 -0
  210. package/dist/ink/hooks/use-focus.d.ts +34 -0
  211. package/dist/ink/hooks/use-focus.js +1 -0
  212. package/dist/ink/hooks/use-form.d.ts +68 -0
  213. package/dist/ink/hooks/use-form.js +1 -0
  214. package/dist/ink/hooks/use-hotkey.d.ts +37 -0
  215. package/dist/ink/hooks/use-hotkey.js +1 -0
  216. package/dist/ink/hooks/use-input.d.ts +149 -0
  217. package/dist/ink/hooks/use-input.js +2 -0
  218. package/dist/ink/hooks/use-interval.d.ts +25 -0
  219. package/dist/ink/hooks/use-interval.js +1 -0
  220. package/dist/ink/hooks/use-is-screen-reader-enabled.d.ts +6 -0
  221. package/dist/ink/hooks/use-is-screen-reader-enabled.js +1 -0
  222. package/dist/ink/hooks/use-key-bindings.d.ts +59 -0
  223. package/dist/ink/hooks/use-key-bindings.js +1 -0
  224. package/dist/ink/hooks/use-key-chord.d.ts +25 -0
  225. package/dist/ink/hooks/use-key-chord.js +1 -0
  226. package/dist/ink/hooks/use-linked-scroll.d.ts +49 -0
  227. package/dist/ink/hooks/use-linked-scroll.js +1 -0
  228. package/dist/ink/hooks/use-paste.d.ts +45 -0
  229. package/dist/ink/hooks/use-paste.js +1 -0
  230. package/dist/ink/hooks/use-persistent-state.d.ts +65 -0
  231. package/dist/ink/hooks/use-persistent-state.js +2 -0
  232. package/dist/ink/hooks/use-scroll-acceleration.d.ts +47 -0
  233. package/dist/ink/hooks/use-scroll-acceleration.js +1 -0
  234. package/dist/ink/hooks/use-scroll-input.d.ts +34 -0
  235. package/dist/ink/hooks/use-scroll-input.js +1 -0
  236. package/dist/ink/hooks/use-stderr.d.ts +16 -0
  237. package/dist/ink/hooks/use-stderr.js +1 -0
  238. package/dist/ink/hooks/use-stdin.d.ts +30 -0
  239. package/dist/ink/hooks/use-stdin.js +1 -0
  240. package/dist/ink/hooks/use-stdout.d.ts +16 -0
  241. package/dist/ink/hooks/use-stdout.js +1 -0
  242. package/dist/ink/hooks/use-stopwatch.d.ts +39 -0
  243. package/dist/ink/hooks/use-stopwatch.js +1 -0
  244. package/dist/ink/hooks/use-terminal-palette.d.ts +20 -0
  245. package/dist/ink/hooks/use-terminal-palette.js +1 -0
  246. package/dist/ink/hooks/use-text-buffer.d.ts +42 -0
  247. package/dist/ink/hooks/use-text-buffer.js +4 -0
  248. package/dist/ink/hooks/use-text-selection.d.ts +45 -0
  249. package/dist/ink/hooks/use-text-selection.js +1 -0
  250. package/dist/ink/hooks/use-timeout.d.ts +24 -0
  251. package/dist/ink/hooks/use-timeout.js +1 -0
  252. package/dist/ink/hooks/use-timer.d.ts +48 -0
  253. package/dist/ink/hooks/use-timer.js +1 -0
  254. package/dist/ink/hooks/use-window-size.d.ts +18 -0
  255. package/dist/ink/hooks/use-window-size.js +1 -0
  256. package/dist/ink/index.d.ts +30 -6251
  257. package/dist/ink/index.js +1 -1
  258. package/dist/ink/mouse/use-element-position.d.ts +31 -0
  259. package/dist/ink/mouse/use-element-position.js +1 -0
  260. package/dist/ink/mouse/use-mouse-action.d.ts +5 -0
  261. package/dist/ink/mouse/use-mouse-action.js +1 -0
  262. package/dist/ink/mouse/use-mouse-position.d.ts +5 -0
  263. package/dist/ink/mouse/use-mouse-position.js +1 -0
  264. package/dist/ink/mouse/use-mouse.d.ts +5 -0
  265. package/dist/ink/mouse/use-mouse.js +1 -0
  266. package/dist/ink/mouse/use-on-mouse-click.d.ts +16 -0
  267. package/dist/ink/mouse/use-on-mouse-click.js +1 -0
  268. package/dist/ink/mouse/use-on-mouse-hover.d.ts +10 -0
  269. package/dist/ink/mouse/use-on-mouse-hover.js +1 -0
  270. package/dist/ink/mouse/use-on-mouse-state.d.ts +13 -0
  271. package/dist/ink/mouse/use-on-mouse-state.js +1 -0
  272. package/dist/packem_chunks/devtools.js +1 -1
  273. package/dist/packem_shared/COLOR_BLINDNESS_COMPENSATION-Ilnoyeqc.js +1 -0
  274. package/dist/packem_shared/ControlledScrollView-Cn4byU2n.js +1 -0
  275. package/dist/packem_shared/DevTools-k6uiVzqv.js +1 -0
  276. package/dist/packem_shared/FilePicker-BLS9nOPz.js +1 -0
  277. package/dist/packem_shared/FocusContext-C2Sosxa4.js +1 -0
  278. package/dist/packem_shared/Fullscreen-BRhuBLBh.js +1 -0
  279. package/dist/packem_shared/IMECompositionBuffer-VhC9HRCv.js +1 -0
  280. package/dist/packem_shared/InputParser-CtwkCbrQ.js +2 -0
  281. package/dist/packem_shared/KEY-C--kOw41.js +1 -0
  282. package/dist/packem_shared/LayoutNode-LPYsuzBg.js +1 -0
  283. package/dist/packem_shared/MouseProvider-DUqQ3Eaa.js +1 -0
  284. package/dist/packem_shared/NAMED_COLORS-82DpREQV.js +1 -0
  285. package/dist/packem_shared/Range-BsVYNWtg.js +1 -0
  286. package/dist/packem_shared/Renderer-DsskdkUd.js +1 -0
  287. package/dist/packem_shared/ResizeObserver-BI9bDy-j.js +1 -0
  288. package/dist/packem_shared/ScrollBar-qa1IzDDv.js +1 -0
  289. package/dist/packem_shared/ScrollBarBox-DchESZWv.js +1 -0
  290. package/dist/packem_shared/ScrollList-BBAnRsrC.js +1 -0
  291. package/dist/packem_shared/ScrollView-CHAo7Epj.js +1 -0
  292. package/dist/packem_shared/Static-DSzsElz4.js +1 -0
  293. package/dist/packem_shared/TreeNodeMap-cJlYqckB.js +1 -0
  294. package/dist/packem_shared/TreeView-BsvLCsf0.js +1 -0
  295. package/dist/packem_shared/TuiApp-BPL8v1i1.js +1 -0
  296. package/dist/packem_shared/TuiContext-BNmP0lMY.js +3 -0
  297. package/dist/packem_shared/ansi-parser-DlgLtOYO.js +1 -0
  298. package/dist/packem_shared/ansi-tokenizer-BU67A126.js +1 -0
  299. package/dist/packem_shared/braille-ch3O5D7I.js +1 -0
  300. package/dist/packem_shared/buffer.d-EJkZr8uH.d.ts +39 -0
  301. package/dist/packem_shared/calculateScroll-D4Y_JR4H.js +1 -0
  302. package/dist/packem_shared/{measureElement-DA8WqFP_.js → calculateScrollbarLayout-Lf6i24c9.js} +1 -1
  303. package/dist/packem_shared/clearOsc52-BUpnQOav.js +1 -0
  304. package/dist/packem_shared/clearStringWidthCache-DKFjfJuB.js +1 -0
  305. package/dist/packem_shared/clipboard.d-D6lZTQ21.d.ts +23 -0
  306. package/dist/packem_shared/color-matrix.d-DSXLsB64.d.ts +50 -0
  307. package/dist/packem_shared/colorize-DU4YZkp3.js +1 -0
  308. package/dist/packem_shared/controlled-scroll-view-BVg7ywNW.js +1 -0
  309. package/dist/packem_shared/createInlineLoop-BT40Wpmx.js +2 -0
  310. package/dist/packem_shared/createScreen-DoYpyL0V.js +3 -0
  311. package/dist/packem_shared/cursor-helpers.d-BONB9tky.d.ts +12 -0
  312. package/dist/packem_shared/dom-rphpG0kf.js +1 -0
  313. package/dist/packem_shared/dom.d-B4kXbaVY.d.ts +449 -0
  314. package/dist/packem_shared/format-time-fjoQHMxD.js +1 -0
  315. package/dist/packem_shared/{getPathToRoot-B2tKmx3i.js → getPathToRoot-PDJeqiEH.js} +1 -1
  316. package/dist/packem_shared/input-utils-BSWCb4F_.js +1 -0
  317. package/dist/packem_shared/{input.d-Bfq7oc06.d.ts → input.d-CgxV2e8U.d.ts} +1 -1
  318. package/dist/packem_shared/isIntersecting-Bo2npvMR.js +1 -0
  319. package/dist/packem_shared/isTerminalPaletteQuerySupported-BYzmqq9-.js +1 -0
  320. package/dist/packem_shared/kittyFlags-g8ALyoCU.js +1 -0
  321. package/dist/packem_shared/line-chart-C7CUrvVs.js +1 -0
  322. package/dist/packem_shared/load-native-root-binding-DDikxNox.js +1 -0
  323. package/dist/packem_shared/measure-element-D4M9iSYp.js +1 -0
  324. package/dist/packem_shared/measure-text-B7juNq4Y.js +3 -0
  325. package/dist/packem_shared/mouse-context.d-BfL9xGk_.d.ts +30 -0
  326. package/dist/packem_shared/parseSgrMouse-bUrqPrh-.js +1 -0
  327. package/dist/packem_shared/processLayout-I83k6vXE.js +2 -0
  328. package/dist/packem_shared/reconciler-CFyBVf7l.js +1 -0
  329. package/dist/packem_shared/reconciler-ClpU7Y-V.js +1 -0
  330. package/dist/packem_shared/render-CuQecTAs.js +24 -0
  331. package/dist/packem_shared/render-DFZ8NHlG.js +1 -0
  332. package/dist/packem_shared/render.d-CBnYBDk2.d.ts +417 -0
  333. package/dist/packem_shared/renderToString-DwXFY8Qh.js +4 -0
  334. package/dist/packem_shared/renderToString-L_bpw4OQ.js +2 -0
  335. package/dist/packem_shared/renderTreeToBuffer-C8lS0lJ2.js +2 -0
  336. package/dist/packem_shared/renderer-k-xShm1P.js +17 -0
  337. package/dist/packem_shared/scroll-view.d-DtpsgHLg.d.ts +119 -0
  338. package/dist/packem_shared/selection.d-CI3_p8wg.d.ts +62 -0
  339. package/dist/packem_shared/squashTextNodesWithMap-BmUSBPfc.js +1 -0
  340. package/dist/packem_shared/stderr-context-Bvnik0hL.js +1 -0
  341. package/dist/packem_shared/stdin-context-88AhuztD.js +1 -0
  342. package/dist/packem_shared/styles.d-cMo36xQz.d.ts +396 -0
  343. package/dist/packem_shared/terminal-palette.d-D2SQjfn-.d.ts +19 -0
  344. package/dist/packem_shared/text-width-e49vlbQH.js +2 -0
  345. package/dist/packem_shared/token-to-elements-D6J6-P2A.js +1 -0
  346. package/dist/packem_shared/treeViewTheme-Dq3ekRAC.js +1 -0
  347. package/dist/packem_shared/useTreeView-D5ifGwG3.js +1 -0
  348. package/dist/packem_shared/useTreeViewState-BiTJakkh.js +1 -0
  349. package/dist/packem_shared/utils-Bup8lyK8.js +1 -0
  350. package/dist/packem_shared/variant-config.d-D5NnrrQK.d.ts +2 -0
  351. package/dist/packem_shared/waitFor-CTAki32d.js +4 -0
  352. package/dist/packem_shared/wrapOrTruncateStyledLine-46W8bTtv.js +3 -0
  353. package/dist/react/index.d.ts +2 -2
  354. package/dist/react/index.js +1 -1
  355. package/dist/testing/index.d.ts +5 -1
  356. package/dist/testing/index.js +1 -1
  357. package/index.js +65 -156
  358. package/package.json +601 -47
  359. package/dist/packem_shared/Accordion-BXsqchV-.js +0 -1
  360. package/dist/packem_shared/Alert-BhYVMHtR.js +0 -1
  361. package/dist/packem_shared/AnimatePresence-Eu7Z8KHc.js +0 -1
  362. package/dist/packem_shared/ApprovalPrompt-BSn0FT1g.js +0 -1
  363. package/dist/packem_shared/AreaChart-Chy-frI7.js +0 -1
  364. package/dist/packem_shared/Badge-B8WPyRsK.js +0 -1
  365. package/dist/packem_shared/BarChart-rpZtlMcF.js +0 -1
  366. package/dist/packem_shared/BigText-CRpwUzrt.js +0 -1
  367. package/dist/packem_shared/BlinkDot-BvnRuWP8.js +0 -1
  368. package/dist/packem_shared/Box-BwqSvWuq.js +0 -1
  369. package/dist/packem_shared/Breadcrumb-D0hClbRV.js +0 -1
  370. package/dist/packem_shared/Button-B89Yvbc6.js +0 -1
  371. package/dist/packem_shared/COLOR_BLINDNESS_SIMULATION-DqErf7XX.js +0 -1
  372. package/dist/packem_shared/Calendar-Dmflvm2S.js +0 -1
  373. package/dist/packem_shared/Canvas-CKg6WV47.js +0 -1
  374. package/dist/packem_shared/Card-B_9fXdtU.js +0 -1
  375. package/dist/packem_shared/Checkbox-BN71eCWU.js +0 -1
  376. package/dist/packem_shared/Code-HhevcyiH.js +0 -2
  377. package/dist/packem_shared/Collapsible-u6uf_FdV.js +0 -1
  378. package/dist/packem_shared/CommandBlock-B-nslpCv.js +0 -4
  379. package/dist/packem_shared/CommandPalette-CEFdaURo.js +0 -1
  380. package/dist/packem_shared/ConfirmDialog-5Jje_Xpu.js +0 -1
  381. package/dist/packem_shared/ConfirmInput-D44Mb9oo.js +0 -1
  382. package/dist/packem_shared/ConsoleOverlay-CM3APfgP.js +0 -1
  383. package/dist/packem_shared/ContentSwitcher-Dm5BkrCt.js +0 -1
  384. package/dist/packem_shared/ControlledScrollView-DI8KZOQB.js +0 -1
  385. package/dist/packem_shared/Cursor-BoLFIMol.js +0 -1
  386. package/dist/packem_shared/DatePicker-CnSrFFAE.js +0 -1
  387. package/dist/packem_shared/DefinitionList-v8RDuF_R.js +0 -1
  388. package/dist/packem_shared/DevTools-O8EbCfHa.js +0 -1
  389. package/dist/packem_shared/Dialog-CTaL8pn0.js +0 -1
  390. package/dist/packem_shared/DiffView-BUIFqUB0.js +0 -1
  391. package/dist/packem_shared/Divider-C47bKmqu.js +0 -1
  392. package/dist/packem_shared/FilePicker-CUo7R5Qb.js +0 -1
  393. package/dist/packem_shared/FocusContext-Xy0cwJpO.js +0 -1
  394. package/dist/packem_shared/FormField-af3aUpRL.js +0 -1
  395. package/dist/packem_shared/Fullscreen-CuJ8y0s0.js +0 -1
  396. package/dist/packem_shared/Gauge-Dz-usH__.js +0 -1
  397. package/dist/packem_shared/Gradient-DYNc0GZA.js +0 -1
  398. package/dist/packem_shared/Heading-mwEYza3Y.js +0 -1
  399. package/dist/packem_shared/Heatmap-ChL97U1-.js +0 -1
  400. package/dist/packem_shared/Help-Zcelyw_U.js +0 -1
  401. package/dist/packem_shared/Histogram-FIf2F83d.js +0 -1
  402. package/dist/packem_shared/IMECompositionBuffer-C89PhiOu.js +0 -1
  403. package/dist/packem_shared/InputParser-rZKjY_7Y.js +0 -2
  404. package/dist/packem_shared/KEY-Bk8B-3h_.js +0 -1
  405. package/dist/packem_shared/Kbd-DpkPp4jB.js +0 -1
  406. package/dist/packem_shared/LayoutNode-rxblE317.js +0 -1
  407. package/dist/packem_shared/LineChart-BXE_girm.js +0 -1
  408. package/dist/packem_shared/Link-i2o2EG4-.js +0 -1
  409. package/dist/packem_shared/LoadingIndicator-TC1Fjwyt.js +0 -1
  410. package/dist/packem_shared/Markdown-R1XqK63D.js +0 -1
  411. package/dist/packem_shared/MaskedInput-J01phOZs.js +0 -1
  412. package/dist/packem_shared/Menu-CfrH4ymk.js +0 -1
  413. package/dist/packem_shared/MessageBubble-BmBBU2Rm.js +0 -1
  414. package/dist/packem_shared/ModelBadge-D3wrXncu.js +0 -1
  415. package/dist/packem_shared/MouseProvider-pjza-lpc.js +0 -1
  416. package/dist/packem_shared/MultiSelect-Dqmn-bVo.js +0 -1
  417. package/dist/packem_shared/NAMED_COLORS-B9fJsYdg.js +0 -1
  418. package/dist/packem_shared/Newline-BSG4iUqp.js +0 -2
  419. package/dist/packem_shared/OperationTree-DksxjMIV.js +0 -1
  420. package/dist/packem_shared/OptionList-CNx7r9yN.js +0 -1
  421. package/dist/packem_shared/OrderedList-BeDy035w.js +0 -1
  422. package/dist/packem_shared/Paginator-B56s6bhS.js +0 -1
  423. package/dist/packem_shared/Paragraph-BqJlH0R-.js +0 -1
  424. package/dist/packem_shared/Placeholder-GMpHRGC8.js +0 -1
  425. package/dist/packem_shared/ProgressBar-Bj3fmORR.js +0 -1
  426. package/dist/packem_shared/RadioGroup-Br8BeEwS.js +0 -1
  427. package/dist/packem_shared/Renderer-DJXooAsp.js +0 -1
  428. package/dist/packem_shared/ResizeObserverEntry-Dq0dk8Kq.js +0 -1
  429. package/dist/packem_shared/ScatterPlot-OhfYco5l.js +0 -1
  430. package/dist/packem_shared/ScrollBar-Da5Y3z7N.js +0 -1
  431. package/dist/packem_shared/ScrollBarBox-Dz6F-Eat.js +0 -1
  432. package/dist/packem_shared/ScrollList-DiVGyEjv.js +0 -1
  433. package/dist/packem_shared/ScrollView-BojONotI.js +0 -1
  434. package/dist/packem_shared/SearchInput-BoPTRbhV.js +0 -1
  435. package/dist/packem_shared/SelectInput-CAJ7SCBq.js +0 -1
  436. package/dist/packem_shared/SelectInputIndicator-N1n8ULHs.js +0 -1
  437. package/dist/packem_shared/SelectInputItem-BEkbmobs.js +0 -1
  438. package/dist/packem_shared/ShimmerText-CuGQ2NDC.js +0 -1
  439. package/dist/packem_shared/Slider-Cg_tJpKa.js +0 -1
  440. package/dist/packem_shared/Spacer-eT3HOrXk.js +0 -1
  441. package/dist/packem_shared/Sparkline-T6_FPVET.js +0 -1
  442. package/dist/packem_shared/Spinner-B0-A50pu.js +0 -1
  443. package/dist/packem_shared/Static-DLynr5pn.js +0 -1
  444. package/dist/packem_shared/Static-jzLPaHJF.js +0 -1
  445. package/dist/packem_shared/StaticRender-BgD61E7x.js +0 -1
  446. package/dist/packem_shared/StatusLine-Ch4jjef1.js +0 -1
  447. package/dist/packem_shared/StatusMessage-B1qfKeMM.js +0 -1
  448. package/dist/packem_shared/Stepper-CNPAqxiU.js +0 -1
  449. package/dist/packem_shared/Stopwatch-CAx2EWwq.js +0 -1
  450. package/dist/packem_shared/StreamingText-BYOKSB2T.js +0 -1
  451. package/dist/packem_shared/Switch-DzSpKYu7.js +0 -1
  452. package/dist/packem_shared/Tab-BcXzSUdj.js +0 -1
  453. package/dist/packem_shared/Table-DJp1TLrR.js +0 -1
  454. package/dist/packem_shared/Tabs-D68z0SOt.js +0 -1
  455. package/dist/packem_shared/Tag-BvLHnYRn.js +0 -1
  456. package/dist/packem_shared/Text-mTAve9R2.js +0 -1
  457. package/dist/packem_shared/TextInput-C_gYQlnF.js +0 -1
  458. package/dist/packem_shared/Textarea-C2ET_oMb.js +0 -2
  459. package/dist/packem_shared/Timer-CI3aQX65.js +0 -1
  460. package/dist/packem_shared/Toast-Drvc8XfG.js +0 -1
  461. package/dist/packem_shared/Tooltip-C5UnQlLd.js +0 -1
  462. package/dist/packem_shared/Transform-fYmcdqRT.js +0 -1
  463. package/dist/packem_shared/Transition-CJDBKYUB.js +0 -1
  464. package/dist/packem_shared/TreeNodeMap-CspqSCpb.js +0 -1
  465. package/dist/packem_shared/TreeView-DjhacGJ5.js +0 -1
  466. package/dist/packem_shared/TuiApp-DrjI_i-R.js +0 -1
  467. package/dist/packem_shared/TuiContext-BoJvG3NN.js +0 -3
  468. package/dist/packem_shared/UnorderedList-BnfqexZs.js +0 -1
  469. package/dist/packem_shared/ansi-parser-B6uXaq65.js +0 -1
  470. package/dist/packem_shared/ansi-tokenizer-DqX9nJuk.js +0 -1
  471. package/dist/packem_shared/boxes-DyY_LXCi.js +0 -1
  472. package/dist/packem_shared/braille-BBjIoaN0.js +0 -1
  473. package/dist/packem_shared/colorize-DbTZMrJO.js +0 -1
  474. package/dist/packem_shared/comparePoints-C85EsmNz.js +0 -1
  475. package/dist/packem_shared/controlled-scroll-view-CmrAEvJk.js +0 -1
  476. package/dist/packem_shared/createInlineLoop-DRNZ7jqH.js +0 -2
  477. package/dist/packem_shared/createLinkedScrollGroup-BMTJ7rAj.js +0 -1
  478. package/dist/packem_shared/createMemoryStorage-QVZNXbWz.js +0 -2
  479. package/dist/packem_shared/createScreen-CrLrxA6t.js +0 -3
  480. package/dist/packem_shared/dom-4y__5fWB.js +0 -1
  481. package/dist/packem_shared/format-time-C7Q-hQZq.js +0 -1
  482. package/dist/packem_shared/getScrollHeight-BTEY8ewu.js +0 -1
  483. package/dist/packem_shared/input-utils-fAxzSlNh.js +0 -1
  484. package/dist/packem_shared/isIntersecting-B3KbKTmu.js +0 -1
  485. package/dist/packem_shared/isOsc52Supported-DKK7Uee6.js +0 -1
  486. package/dist/packem_shared/isTerminalPaletteQuerySupported-Dn2hFAZ_.js +0 -1
  487. package/dist/packem_shared/kittyFlags-C3rZLbcK.js +0 -1
  488. package/dist/packem_shared/line-chart-DrM8PwnI.js +0 -1
  489. package/dist/packem_shared/measure-element-DSp7YDus.js +0 -2
  490. package/dist/packem_shared/measure-text-DDjHT1jD.js +0 -3
  491. package/dist/packem_shared/parseSgrMouse-Ccj70ijb.js +0 -1
  492. package/dist/packem_shared/processLayout-DXDfFb_d.js +0 -1
  493. package/dist/packem_shared/reconciler-BuOP-TZ6.js +0 -1
  494. package/dist/packem_shared/reconciler-DSYCrIZs.js +0 -1
  495. package/dist/packem_shared/render-DDqtMAFN.js +0 -1
  496. package/dist/packem_shared/render-_r0K9K11.js +0 -28
  497. package/dist/packem_shared/render.d-CNIzVQTh.d.ts +0 -1257
  498. package/dist/packem_shared/renderToString-DeqOWRP8.js +0 -4
  499. package/dist/packem_shared/renderToString-IYYPyASm.js +0 -2
  500. package/dist/packem_shared/renderTreeToBuffer-DPkoCgP2.js +0 -2
  501. package/dist/packem_shared/renderer-D2p6av2X.js +0 -17
  502. package/dist/packem_shared/setEnableStyledLineCache-D2gZbwFM.js +0 -1
  503. package/dist/packem_shared/squashTextNodesWithMap-Cpqmc45i.js +0 -1
  504. package/dist/packem_shared/stderr-context-BzEaUICS.js +0 -1
  505. package/dist/packem_shared/stdin-context-BTaaFagk.js +0 -1
  506. package/dist/packem_shared/text-width-CZ9vPvM0.js +0 -2
  507. package/dist/packem_shared/token-to-elements-BYxT6J_Q.js +0 -1
  508. package/dist/packem_shared/treeViewTheme-1RIZyB4M.js +0 -1
  509. package/dist/packem_shared/useAnimation-B9we6ZzL.js +0 -1
  510. package/dist/packem_shared/useApp-B6fvM42d.js +0 -1
  511. package/dist/packem_shared/useBoxMetrics-D5pkIr6P.js +0 -1
  512. package/dist/packem_shared/useClipboard-CBxy0hT8.js +0 -1
  513. package/dist/packem_shared/useColorBlindness-BvWcu2Bb.js +0 -1
  514. package/dist/packem_shared/useConsoleCapture-BxiG8iLJ.js +0 -1
  515. package/dist/packem_shared/useCursor-CPu8T5Db.js +0 -1
  516. package/dist/packem_shared/useElementDimensions-qJ_WXFZ9.js +0 -1
  517. package/dist/packem_shared/useFocus-DSmziO_x.js +0 -1
  518. package/dist/packem_shared/useFocusManager-Uapn3LQo.js +0 -1
  519. package/dist/packem_shared/useForm-CzV-Oext.js +0 -1
  520. package/dist/packem_shared/useHotkey-D0dGey14.js +0 -1
  521. package/dist/packem_shared/useInput-D1_jG26Z.js +0 -2
  522. package/dist/packem_shared/useInterval-AobjZT3u.js +0 -1
  523. package/dist/packem_shared/useIsScreenReaderEnabled-DjWHh-II.js +0 -1
  524. package/dist/packem_shared/useKeyBindings-zabkEJQs.js +0 -1
  525. package/dist/packem_shared/useKeyChord-CICQIxXj.js +0 -1
  526. package/dist/packem_shared/useMouseAction-2dRfU1vE.js +0 -1
  527. package/dist/packem_shared/useMouseContext-C746G7kY.js +0 -1
  528. package/dist/packem_shared/useMousePosition-BTWfV4JK.js +0 -1
  529. package/dist/packem_shared/useOnMouseClick-nY8xLZmt.js +0 -1
  530. package/dist/packem_shared/useOnMouseHover-D3DczIol.js +0 -1
  531. package/dist/packem_shared/useOnMouseState-cRK8QvzD.js +0 -1
  532. package/dist/packem_shared/usePaste-CKKB9H-Z.js +0 -1
  533. package/dist/packem_shared/useScrollAcceleration-NrY1oVMs.js +0 -1
  534. package/dist/packem_shared/useScrollInput-Caghtn-Q.js +0 -1
  535. package/dist/packem_shared/useStderr-BDZb6InG.js +0 -1
  536. package/dist/packem_shared/useStdin-DKa4h35k.js +0 -1
  537. package/dist/packem_shared/useStdout-B-2lX4C5.js +0 -1
  538. package/dist/packem_shared/useStopwatch-DffK7iMh.js +0 -1
  539. package/dist/packem_shared/useTerminalPalette-Cv7tSduR.js +0 -1
  540. package/dist/packem_shared/useTextBuffer-DekkGLxI.js +0 -4
  541. package/dist/packem_shared/useTextSelection-CGT0GLDR.js +0 -1
  542. package/dist/packem_shared/useTimeout-7LEFYTnG.js +0 -1
  543. package/dist/packem_shared/useTimer-DyoqSyGi.js +0 -1
  544. package/dist/packem_shared/useTreeView-8UlTK6sW.js +0 -1
  545. package/dist/packem_shared/useTreeViewState-CRPCUWrb.js +0 -1
  546. package/dist/packem_shared/useWindowSize-yDZsXF8z.js +0 -1
  547. package/dist/packem_shared/utils-THUhYKG2.js +0 -1
  548. package/dist/packem_shared/waitFor-Dj5zfL5s.js +0 -4
  549. package/dist/packem_shared/wrapOrTruncateStyledLine-BZ00SM8i.js +0 -3
@@ -0,0 +1,41 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type Props = {
5
+ /**
6
+ * Color of the label when selected.
7
+ * @default "blue"
8
+ */
9
+ readonly accentColor?: LiteralUnion<AnsiColors, string>;
10
+ /**
11
+ * Color of the label when not selected.
12
+ */
13
+ readonly defaultColor?: LiteralUnion<AnsiColors, string>;
14
+ /**
15
+ * Whether the parent SelectInput has focus.
16
+ * When `false`, the selected item is dimmed.
17
+ * @default true
18
+ */
19
+ readonly isFocused?: boolean;
20
+ /**
21
+ * Whether this item is currently selected.
22
+ * @default false
23
+ */
24
+ readonly isSelected?: boolean;
25
+ /**
26
+ * Text label to display for this item.
27
+ */
28
+ readonly label: string;
29
+ };
30
+ /**
31
+ * Renders an item label, using `accentColor` when selected and `defaultColor` otherwise.
32
+ * When unfocused, selected items are rendered with `dimColor`.
33
+ */
34
+ declare function SelectInputItem({
35
+ accentColor,
36
+ defaultColor,
37
+ isFocused,
38
+ isSelected,
39
+ label
40
+ }: Props): ReactElement;
41
+ export { Props, SelectInputItem, type Props as SelectInputItemProps, SelectInputItem as default };
@@ -0,0 +1 @@
1
+ import{jsx as a}from"react/jsx-runtime";import{Text as c}from"./text.js";function i({accentColor:o="blue",defaultColor:t,isFocused:l=!0,isSelected:e=!1,label:r}){return a(c,{color:e?o:t,dimColor:e&&!l,children:r})}export{i as SelectInputItem,i as default};
@@ -0,0 +1,110 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { FC, ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ import { Props as Props$1 } from "./select-input-indicator.js";
5
+ import { Props as Props$2 } from "./select-input-item.js";
6
+ type Item<V> = {
7
+ /**
8
+ * Called automatically when this item is selected (via Enter or number key).
9
+ * Fires after `onSelect`. Useful for defining per-item behavior inline.
10
+ */
11
+ readonly action?: () => void;
12
+ readonly key?: string;
13
+ readonly label: string;
14
+ readonly value: V;
15
+ };
16
+ type SeparatorItem = {
17
+ /**
18
+ * Marks this entry as a non-focusable separator line.
19
+ */
20
+ readonly isSeparator: true;
21
+ readonly key?: string;
22
+ /**
23
+ * Custom separator text. Defaults to `"───"`.
24
+ */
25
+ readonly label?: string;
26
+ };
27
+ type SelectInputEntry<V> = Item<V> | SeparatorItem;
28
+ type Props<V> = {
29
+ /**
30
+ * Color used for the selected item and indicator.
31
+ * @default "blue"
32
+ */
33
+ readonly accentColor?: LiteralUnion<AnsiColors, string>;
34
+ /**
35
+ * Color used for unselected items.
36
+ */
37
+ readonly defaultColor?: LiteralUnion<AnsiColors, string>;
38
+ /**
39
+ * Controlled selected index. When provided, the component becomes controlled
40
+ * and `initialIndex` is ignored. Update this value in the `onHighlight` callback
41
+ * to track selection externally. If the index points to a separator, the nearest
42
+ * selectable item is highlighted instead.
43
+ */
44
+ readonly index?: number;
45
+ /**
46
+ * Custom component to override the default indicator component.
47
+ */
48
+ readonly indicatorComponent?: FC<Props$1>;
49
+ /**
50
+ * Index of initially-selected item in `items` array.
51
+ * Ignored when `index` is provided.
52
+ * When omitted (`undefined`), no item is highlighted until the user presses a key.
53
+ * If the index points to a separator, the nearest selectable item is used.
54
+ */
55
+ readonly initialIndex?: number;
56
+ /**
57
+ * Whether the input is focused. Useful for when there are multiple
58
+ * inputs on the screen and you need to control which one captures input.
59
+ * @default true
60
+ */
61
+ readonly isFocused?: boolean;
62
+ /**
63
+ * Custom component to override the default item component.
64
+ */
65
+ readonly itemComponent?: FC<Props$2>;
66
+ /** @default [] */
67
+ readonly items?: ReadonlyArray<SelectInputEntry<V>>;
68
+ /**
69
+ * Number of visible items. Useful if the list is long and you want
70
+ * to limit the display with a scrolling window.
71
+ */
72
+ readonly limit?: number;
73
+ /**
74
+ * Called when the user highlights a new item via arrow keys or `j`/`k`.
75
+ * The second argument is the index of the highlighted item in the visible list.
76
+ */
77
+ readonly onHighlight?: (item: Item<V>, index: number) => void;
78
+ /**
79
+ * Called when the user selects an item via Enter or a number key (1-9).
80
+ */
81
+ readonly onSelect?: (item: Item<V>) => void;
82
+ /**
83
+ * Whether to reset the selection when items change.
84
+ * Set to `false` to preserve the current selection across item updates.
85
+ * @default true
86
+ */
87
+ readonly resetOnItemsChange?: boolean;
88
+ };
89
+ /**
90
+ * A select input component for terminal UIs.
91
+ *
92
+ * Renders a list of items with an indicator showing the currently highlighted item.
93
+ * Users can navigate with arrow keys or `j`/`k`, select with Enter, or jump to an
94
+ * item by pressing a number key (1-9).
95
+ */
96
+ declare function SelectInput<V>({
97
+ accentColor,
98
+ defaultColor,
99
+ index,
100
+ indicatorComponent,
101
+ initialIndex,
102
+ isFocused,
103
+ itemComponent,
104
+ items,
105
+ limit: customLimit,
106
+ onHighlight,
107
+ onSelect,
108
+ resetOnItemsChange
109
+ }: Props<V>): ReactElement;
110
+ export { Item, Props, SelectInput, SelectInputEntry, type Item as SelectInputItemType, type Props as SelectInputProps, type SeparatorItem as SelectInputSeparator, SeparatorItem, SelectInput as default };
@@ -0,0 +1 @@
1
+ import{createRequire as ee}from"node:module";import{jsx as F,jsxs as re}from"react/jsx-runtime";import{useReducer as se,useRef as v,useMemo as ce,useEffect as V,useCallback as R,createElement as X}from"react";import ie from"../ink/hooks/use-input.js";import ae from"../ink/hooks/use-window-size.js";import{Box as D}from"./box.js";import{SelectInputIndicator as le}from"./select-input-indicator.js";import{SelectInputItem as de}from"./select-input-item.js";import{Text as ue}from"./text.js";const te=ee(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ne=n=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[t,o]=M.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return M.getBuiltinModule(n)}return te(n)},{isDeepStrictEqual:oe}=ne("node:util"),h=n=>"isSeparator"in n&&n.isSeparator,fe=[],pe=/^[1-9]$/,l=-1,me="───",Ie=Symbol("separator"),xe=(n,t)=>{switch(t.type){case"navigate":return{rotateIndex:t.rotateIndex,selectedIndex:t.selectedIndex};case"reset":return{rotateIndex:0,selectedIndex:t.hasInitialSelection?t.initialIndex:l};case"set":return{rotateIndex:t.selectedIndex,selectedIndex:t.selectedIndex};default:return n}},ge=(n,t)=>{const{length:o}=n;if(o===0)return[];const u=(t%o+o)%o;return[...n.slice(u),...n.slice(0,u)]},b=(n,t,o,u)=>t?ge(n,o).slice(0,u):n,q=(n,t,o)=>{const{length:u}=n;for(let S=0;S<u;S+=1){const C=((t+(S+1)*o)%u+u)%u;if(!h(n[C]))return C}return l},Y=(n,t)=>{if(t<0||t>=n.length)return l;const o=n[t];return o&&!h(o)?t:q(n,t-1,1)};function Me({accentColor:n="blue",defaultColor:t,index:o,indicatorComponent:u=le,initialIndex:S,isFocused:C=!0,itemComponent:Z=de,items:r=fe,limit:E,onHighlight:f,onSelect:N,resetOnItemsChange:B=!0}){const{rows:Q}=ae(),H=typeof E=="number"?E:Q,s=r.length>H,d=s?Math.min(H,r.length):r.length,j=d-1,O=typeof o=="number"||typeof S=="number",P=typeof o=="number"?o:S??l,w=P===l?l:Y(r,Math.min(P,j)),[T,_]=se(xe,{rotateIndex:w>j?j-w:0,selectedIndex:w}),z=v(O),G=v(w),J=v(T);J.current=T;const A=v(N);A.current=N;const W=v(r),k=ce(()=>r.map(e=>h(e)?Ie:e.value),[r]),K=v(k);z.current=O,G.current=w,V(()=>{B&&!oe(K.current,k)&&_({hasInitialSelection:z.current,initialIndex:G.current,type:"reset"}),K.current=k,W.current=r},[r,k,B]),V(()=>{if(typeof o=="number"){const e=Y(r,Math.min(o,j));_({selectedIndex:e===l?0:e,type:"set"})}},[o,r,j]);const L=R((e,c)=>{const i=b(r,s,e,d);if(c===l){const x=q(i,0,-1);if(x===l)return;_({rotateIndex:e,selectedIndex:x,type:"navigate"}),typeof f=="function"&&f(i[x],x);return}const g=(s?d:r.length)-1,a=c===0,p=a?g:c-1,m=a&&s?e+1:e,y=b(r,s,m,d),I=h(y[p])?q(y,p,-1):p;I!==l&&(_({rotateIndex:m,selectedIndex:I,type:"navigate"}),typeof f=="function"&&f(y[I],I))},[s,d,r,f]),U=R((e,c)=>{const i=b(r,s,e,d);if(c===l){const x=q(i,i.length-1,1);if(x===l)return;_({rotateIndex:e,selectedIndex:x,type:"navigate"}),typeof f=="function"&&f(i[x],x);return}const g=(s?d:r.length)-1,a=c===g,p=a?0:c+1,m=a&&s?e-1:e,y=b(r,s,m,d),I=h(y[p])?q(y,p,1):p;I!==l&&(_({rotateIndex:m,selectedIndex:I,type:"navigate"}),typeof f=="function"&&f(y[I],I))},[s,d,r,f]);ie(R((e,c)=>{const{rotateIndex:i,selectedIndex:g}=J.current;if((e==="k"||c.upArrow)&&L(i,g),(e==="j"||c.downArrow)&&U(i,g),pe.test(e)){const a=Number.parseInt(e,10)-1,p=b(r,s,i,d);if(a>=0&&a<p.length){const m=p[a];m&&!h(m)&&(A.current?.(m),m.action?.())}}if(c.return&&g!==l){const a=b(r,s,i,d)[g];a&&!h(a)&&(A.current?.(a),a.action?.())}},[L,U,s,d,r]),{isActive:C});const $=b(r,s,T.rotateIndex,d);return F(D,{flexDirection:"column",children:$.map((e,c)=>{if(h(e))return F(D,{children:F(ue,{dimColor:!0,children:e.label??me})},e.key??`separator-${String(c)}`);const i=c===T.selectedIndex;return re(D,{children:[X(u,{accentColor:n,isFocused:C,isSelected:i}),X(Z,{...e,accentColor:n,defaultColor:t,isFocused:C,isSelected:i})]},e.key??String(e.value))})})}export{Me as SelectInput,Me as default};
@@ -0,0 +1,47 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type Props = {
5
+ /**
6
+ * Width of the highlighted band in characters.
7
+ * @default 3
8
+ */
9
+ readonly bandWidth?: number;
10
+ /**
11
+ * Base color of the non-highlighted text.
12
+ */
13
+ readonly color?: LiteralUnion<AnsiColors, string>;
14
+ /**
15
+ * Highlight color of the sweeping band.
16
+ * @default "white"
17
+ */
18
+ readonly highlightColor?: LiteralUnion<AnsiColors, string>;
19
+ /**
20
+ * Milliseconds between frames of the shimmer.
21
+ * @default 60
22
+ */
23
+ readonly interval?: number;
24
+ /**
25
+ * Text to render with a shimmer sweep.
26
+ */
27
+ readonly text: string;
28
+ };
29
+ /**
30
+ * Text with an animated highlight band that sweeps across the characters.
31
+ * Perfect for "generating…" states.
32
+ * @param props Component props.
33
+ * @param props.bandWidth Number of characters in the bright band.
34
+ * @param props.color Color applied to characters outside the band.
35
+ * @param props.highlightColor Color applied to characters inside the band.
36
+ * @param props.interval Milliseconds between frames.
37
+ * @param props.text Content to shimmer.
38
+ * @returns A single `Text` element composed of per-character `Text` children.
39
+ */
40
+ declare function ShimmerText({
41
+ bandWidth,
42
+ color,
43
+ highlightColor,
44
+ interval,
45
+ text
46
+ }: Props): ReactElement;
47
+ export { Props, ShimmerText, type Props as ShimmerTextProps, ShimmerText as default };
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{useMemo as f}from"react";import g from"../ink/hooks/use-animation.js";import{Text as i}from"./text.js";function j({bandWidth:m=3,color:r,highlightColor:a="white",interval:d=60,text:n}){const{frame:u}=g({interval:d}),t=f(()=>[...n],[n]),l=t.length,p=l+m,x=l===0?0:u%p,b=f(()=>t.map((o,c)=>e(i,{color:r,dimColor:r===void 0,children:o},c)),[t,r]);if(l===0)return e(i,{color:r,children:n});const h=[];for(const[o,c]of t.entries()){const s=x-o;if(!(s>=0&&s<m)){h.push(b[o]);continue}h.push(e(i,{bold:!0,color:a,children:c},`band-${o}`))}return e(i,{children:h})}export{j as ShimmerText,j as default};
@@ -0,0 +1,103 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type Props = {
5
+ /**
6
+ * Accent color for the filled portion of the track and thumb.
7
+ * @default "green"
8
+ */
9
+ readonly accentColor?: LiteralUnion<AnsiColors, string>;
10
+ /**
11
+ * Color for the empty portion of the track.
12
+ * @default "gray"
13
+ */
14
+ readonly defaultColor?: LiteralUnion<AnsiColors, string>;
15
+ /**
16
+ * Initial value when uncontrolled.
17
+ * @default 0
18
+ */
19
+ readonly defaultValue?: number;
20
+ /**
21
+ * Character used for the empty portion of the track.
22
+ * @default "░"
23
+ */
24
+ readonly emptyCharacter?: string;
25
+ /**
26
+ * Character used for the filled portion of the track.
27
+ * @default "█"
28
+ */
29
+ readonly filledCharacter?: string;
30
+ /**
31
+ * When true, all input is ignored and the slider is dimmed.
32
+ * @default false
33
+ */
34
+ readonly isDisabled?: boolean;
35
+ /**
36
+ * When true, the component responds to keyboard input.
37
+ * @default true
38
+ */
39
+ readonly isFocused?: boolean;
40
+ /**
41
+ * Maximum value.
42
+ * @default 100
43
+ */
44
+ readonly max?: number;
45
+ /**
46
+ * Minimum value.
47
+ * @default 0
48
+ */
49
+ readonly min?: number;
50
+ /**
51
+ * Fires whenever the value changes.
52
+ */
53
+ readonly onChange?: (value: number) => void;
54
+ /**
55
+ * Layout direction of the slider.
56
+ * @default "horizontal"
57
+ */
58
+ readonly orientation?: "horizontal" | "vertical";
59
+ /**
60
+ * Increment size for arrow key presses.
61
+ * @default 1
62
+ */
63
+ readonly step?: number;
64
+ /**
65
+ * Character used to indicate the current position.
66
+ * @default "●"
67
+ */
68
+ readonly thumbCharacter?: string;
69
+ /**
70
+ * Controlled value. When provided, `defaultValue` is ignored.
71
+ */
72
+ readonly value?: number;
73
+ /**
74
+ * Width of the slider track in columns (horizontal) or rows (vertical).
75
+ * @default 20
76
+ */
77
+ readonly width?: number;
78
+ };
79
+ /**
80
+ * A keyboard-driven slider / range input.
81
+ *
82
+ * ```tsx
83
+ * &lt;Slider defaultValue={50} min={0} max={100} onChange={setValue} />
84
+ * ```
85
+ */
86
+ declare function Slider({
87
+ accentColor,
88
+ defaultColor,
89
+ defaultValue,
90
+ emptyCharacter,
91
+ filledCharacter,
92
+ isDisabled,
93
+ isFocused,
94
+ max,
95
+ min,
96
+ onChange,
97
+ orientation,
98
+ step,
99
+ thumbCharacter,
100
+ value: controlledValue,
101
+ width
102
+ }: Props): ReactElement;
103
+ export { Props, Slider, type Props as SliderProps, Slider as default };
@@ -0,0 +1 @@
1
+ import{jsx as c,jsxs as H}from"react/jsx-runtime";import{useState as R,useRef as I,useCallback as J}from"react";import T from"../ink/hooks/use-input.js";import{Box as A}from"./box.js";import{Text as C}from"./text.js";const y=(u,d,x)=>Math.min(x,Math.max(d,u));function P({accentColor:u="green",defaultColor:d="gray",defaultValue:x=0,emptyCharacter:D="░",filledCharacter:j="█",isDisabled:e=!1,isFocused:K=!0,max:k=100,min:z=0,onChange:F,orientation:h="horizontal",step:m=1,thumbCharacter:N="●",value:q,width:L=20}){const o=Math.min(z,k),i=Math.max(z,k),b=q!==void 0,[O,Q]=R(y(x,o,i)),v=b?y(q,o,i):O,G=I(F);G.current=F;const s=I(v);s.current=v;const n=J(t=>{const r=y(t,o,i);b||Q(r),G.current?.(r)},[o,i,b]),w=m*10,f=i-o,S=J((t,r)=>{const M=h==="horizontal"?r.rightArrow:r.upArrow,p=h==="horizontal"?r.leftArrow:r.downArrow;if(M){n(s.current+m);return}if(p){n(s.current-m);return}if(r.pageUp){n(s.current+w);return}if(r.pageDown){n(s.current-w);return}if(r.home){n(o);return}if(r.end){n(i);return}if(t>="0"&&t<="9"){const E=Number.parseInt(t,10)/10;n(o+f*E)}},[m,w,o,i,f,h,n]);T(S,{isActive:K&&!e});const g=Math.max(1,L),V=f===0?0:(v-o)/f,l=Math.round(V*(g-1));if(h==="vertical"){const t=[];for(let r=g-1;r>=0;r--){const M=r===l,p=r<=l;t.push(c(A,{children:c(C,{color:e?void 0:p?u:d,dimColor:e,children:M?N:p?j:D})},r))}return c(A,{flexDirection:"column",children:t})}let a="";for(let t=0;t<g;t++)t===l?a+=N:t<l?a+=j:a+=D;const W=a.slice(0,l),$=a[l]??"",B=a.slice(l+1);return H(A,{children:[c(C,{color:e?void 0:u,dimColor:e,children:W}),c(C,{bold:!0,color:e?void 0:u,dimColor:e,children:$}),c(C,{color:e?void 0:d,dimColor:e,children:B})]})}export{P as Slider,P as default};
@@ -0,0 +1,8 @@
1
+ import { ReactElement } from 'react';
2
+ /**
3
+ * A flexible space that expands along the major axis of its containing layout.
4
+ *
5
+ * It's useful as a shortcut for filling all the available space between elements.
6
+ */
7
+ declare function Spacer(): ReactElement;
8
+ export { Spacer, Spacer as default };
@@ -0,0 +1 @@
1
+ import{jsx as r}from"react/jsx-runtime";import{Box as o}from"./box.js";function a(){return r(o,{flexGrow:1})}export{a as Spacer,a as default};
@@ -0,0 +1,35 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type Props = {
5
+ /**
6
+ * Color applied to the chart glyphs.
7
+ */
8
+ readonly color?: LiteralUnion<AnsiColors, string>;
9
+ /**
10
+ * Data points to plot. Values may be any real numbers.
11
+ */
12
+ readonly data: ReadonlyArray<number>;
13
+ /**
14
+ * Optional fixed maximum for the vertical scale.
15
+ * When omitted the maximum data value is used.
16
+ */
17
+ readonly max?: number;
18
+ /**
19
+ * Optional fixed minimum for the vertical scale.
20
+ * When omitted the minimum data value is used.
21
+ */
22
+ readonly min?: number;
23
+ };
24
+ /**
25
+ * Inline bar chart using Unicode block glyphs.
26
+ * @returns A `ReactElement` containing the glyph string, or `null` when
27
+ * `data` is empty.
28
+ */
29
+ declare function Sparkline({
30
+ color,
31
+ data,
32
+ max,
33
+ min
34
+ }: Props): ReactElement | null;
35
+ export { Props, Sparkline, type Props as SparklineProps, Sparkline as default };
@@ -0,0 +1 @@
1
+ import{jsx as f}from"react/jsx-runtime";import{useMemo as s}from"react";import{Text as c}from"./text.js";const e="▁▂▃▄▅▆▇█",I=(m,t,o)=>{if(o===0)return e[0];const r=(m-t)/o,n=Math.max(0,Math.min(e.length-1,Math.floor(r*e.length)));return e[n]},h=(m,t,o)=>{let r=t??Number.POSITIVE_INFINITY,n=o??Number.NEGATIVE_INFINITY;if(t===void 0||o===void 0)for(const i of m)t===void 0&&i<r&&(r=i),o===void 0&&i>n&&(n=i);return{max:n,min:r}};function p({color:m,data:t,max:o,min:r}){const n=s(()=>{if(t.length===0)return"";const{max:i,min:a}=h(t,r,o),l=i-a;return t.map(u=>I(u,a,l)).join("")},[t,r,o]);return n.length===0?null:f(c,{color:m,children:n})}export{p as Sparkline,p as default};
@@ -0,0 +1,17 @@
1
+ import { SpinnerName } from '@visulima/spinner';
2
+ import { ReactElement } from 'react';
3
+ type Props = {
4
+ /**
5
+ * Type of a spinner.
6
+ * Accepts any preset from `@visulima/spinner` (cli-spinners + custom frame sets).
7
+ * @default "dots"
8
+ */
9
+ readonly type?: SpinnerName;
10
+ };
11
+ /**
12
+ * Spinner component that renders an animated loading indicator.
13
+ */
14
+ declare function Spinner({
15
+ type
16
+ }: Props): ReactElement;
17
+ export { Props, Spinner, type Props as SpinnerProps, Spinner as default };
@@ -0,0 +1 @@
1
+ import{jsx as i}from"react/jsx-runtime";import{getSpinner as e}from"@visulima/spinner";import m from"../ink/hooks/use-animation.js";import{Text as p}from"./text.js";function d({type:n="dots"}){const r=e(n)??e("dots"),t=r?.frames??[" "],{frame:o}=m({interval:r?.interval??80});return i(p,{children:t[o%t.length]})}export{d as Spinner,d as default};
@@ -0,0 +1,55 @@
1
+ import React, { ReactNode, DependencyList } from 'react';
2
+ import { D as DOMElement } from "../packem_shared/dom.d-B4kXbaVY.js";
3
+ import { S as Styles } from "../packem_shared/styles.d-cMo36xQz.js";
4
+ import 'yoga-layout';
5
+ import "../packem_shared/cursor-helpers.d-BONB9tky.js";
6
+ import '@visulima/colorize';
7
+ import 'cli-boxes';
8
+ import 'type-fest';
9
+
10
+ /**
11
+ * StaticRender component — pre-renders children once and caches the result.
12
+ *
13
+ * When mounted, StaticRender renders its children into a Region via
14
+ * prepareYogaTree() in the Ink layout phase, then caches the result on the
15
+ * DOM node. On subsequent renders, the cached Region is composited directly
16
+ * via addRegionTree(), skipping the entire subtree traversal.
17
+ *
18
+ * Children are passed as a render function `() => ReactNode`. Once the cache
19
+ * is ready, the component stops calling the function so React does not
20
+ * re-reconcile the subtree on subsequent renders.
21
+ *
22
+ * Re-rendering the cached content is controlled via the `deps` prop (similar
23
+ * to React's hook deps). When `deps` changes, the cache is invalidated and
24
+ * `children()` is invoked again. If `deps` is omitted, the cache is
25
+ * invalidated whenever the `children` function reference changes.
26
+ *
27
+ * Use this for content that renders once and doesn't change (e.g., completed
28
+ * task output, logged messages, static headers).
29
+ *
30
+ * Ported from jacob314/ink (Google LLC, Apache-2.0).
31
+ * @license Apache-2.0
32
+ */
33
+
34
+ /**
35
+ * @property children Render function invoked once to produce the cached content.
36
+ * @property deps Dependencies that control when the static content is re-rendered. When any dependency changes (shallow, Object.is comparison), the cache is invalidated and children() is invoked again. If omitted, the cache is invalidated whenever the children function reference changes.
37
+ * @property onRender Callback fired after the static content has been rendered and cached. The node's cachedRender holds the measured width/height — useful for reacting to the cached block's size without setting up a full ResizeObserver.
38
+ * @property style Optional style applied to the static-render container.
39
+ * @property width Optional fixed width for the cached region.
40
+ */
41
+ type Props = {
42
+ readonly children: () => ReactNode;
43
+ readonly deps?: DependencyList;
44
+ readonly onRender?: (node: DOMElement) => void;
45
+ readonly style?: Styles;
46
+ readonly width?: number;
47
+ };
48
+ declare const StaticRender: ({
49
+ children,
50
+ deps,
51
+ onRender,
52
+ style,
53
+ width
54
+ }: Props) => React.ReactNode;
55
+ export { Props, StaticRender, type Props as StaticRenderProps, StaticRender as default };
@@ -0,0 +1 @@
1
+ import{jsx as R}from"react/jsx-runtime";import{useRef as c,useLayoutEffect as m,useEffect as p,useMemo as v}from"react";const y=(e,r)=>{if(e===r)return!0;if(!e||!r||e.length!==r.length)return!1;for(const[u,s]of e.entries())if(!Object.is(s,r[u]))return!1;return!0},w=({children:e,deps:r,onRender:u,style:s,width:i})=>{const n=c(null),o=c(!1),f=c(r),l=c(e),a=c(u);a.current=u;let d=!1;r!==void 0?y(f.current,r)||(d=!0,f.current=r):e!==l.current&&(d=!0,l.current=e),d&&(o.current=!1,n.current&&(n.current.cachedRender=void 0)),m(()=>{const t=n.current;t&&(t.internal_onRendered=()=>{o.current=!0,a.current?.(t)})}),p(()=>()=>{const t=n.current;t&&(t.cachedRender=void 0,t.internal_onRendered=void 0)},[]);const h=v(()=>({...s,width:i}),[s,i]);return R("ink-static-render",{ref:n,style:h,children:o.current?null:e()})};export{w as StaticRender,w as default};
@@ -0,0 +1,29 @@
1
+ import { ReactNode, ReactElement } from 'react';
2
+ import { S as Styles } from "../packem_shared/styles.d-cMo36xQz.js";
3
+ import '@visulima/colorize';
4
+ import 'cli-boxes';
5
+ import 'type-fest';
6
+ import 'yoga-layout';
7
+ type Props<T> = {
8
+ /**
9
+ * Function that is called to render every item in the `items` array. The first argument is the item itself, and the second argument is the index of that item in the `items` array. Note that a `key` must be assigned to the root component.
10
+ */
11
+ readonly children: (item: T, index: number) => ReactNode;
12
+ /**
13
+ * Array of items of any type to render using the function you pass as a component child.
14
+ */
15
+ readonly items: T[];
16
+ /**
17
+ * Styles to apply to a container of child elements. See &lt;Box> for supported properties.
18
+ */
19
+ readonly style?: Styles;
20
+ };
21
+ /**
22
+ * `&lt;Static>` component permanently renders its output above everything else. It's useful for displaying activity like completed tasks or logs—things that don't change after they're rendered (hence the name "Static").
23
+ *
24
+ * It's preferred to use `&lt;Static>` for use cases like these when you can't know or control the number of items that need to be rendered.
25
+ *
26
+ * For example, [Tap](https://github.com/tapjs/node-tap) uses `&lt;Static>` to display a list of completed tests. [Gatsby](https://github.com/gatsbyjs/gatsby) uses it to display a list of generated pages while still displaying a live progress bar.
27
+ */
28
+ declare function Static<T>(props: Props<T>): ReactElement;
29
+ export { Props, Static, type Props as StaticProps, Static as default };
@@ -0,0 +1 @@
1
+ import{jsx as f}from"react/jsx-runtime";import{useState as p,useMemo as i,useLayoutEffect as h}from"react";function y(s){const{children:n,items:t,style:o}=s,[e,l]=p(0),c=i(()=>t.slice(e),[t,e]);h(()=>{l(t.length)},[t.length]);const r=c.map((u,m)=>n(u,e+m)),a=i(()=>({flexDirection:"column",position:"absolute",...o}),[o]);return f("ink-box",{internal_static:!0,style:a,children:r})}export{y as Static,y as default};
@@ -0,0 +1,37 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactNode, ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type Props = {
5
+ /**
6
+ * Background color spanning the whole row.
7
+ */
8
+ readonly backgroundColor?: LiteralUnion<AnsiColors, string>;
9
+ /**
10
+ * Content rendered in the center. Optional.
11
+ */
12
+ readonly center?: ReactNode;
13
+ /**
14
+ * Default foreground for text rendered inside the row.
15
+ */
16
+ readonly color?: LiteralUnion<AnsiColors, string>;
17
+ /**
18
+ * Content rendered flush-left.
19
+ */
20
+ readonly left?: ReactNode;
21
+ /**
22
+ * Content rendered flush-right.
23
+ */
24
+ readonly right?: ReactNode;
25
+ };
26
+ /**
27
+ * Full-width status bar with left / center / right slots. Typically pinned to
28
+ * the bottom of the UI.
29
+ */
30
+ declare function StatusLine({
31
+ backgroundColor,
32
+ center,
33
+ color,
34
+ left,
35
+ right
36
+ }: Props): ReactElement;
37
+ export { Props, StatusLine, type Props as StatusLineProps, StatusLine as default };
@@ -0,0 +1 @@
1
+ import{jsxs as l,jsx as t}from"react/jsx-runtime";import{Box as i}from"./box.js";import{Text as c}from"./text.js";const e=(r,o)=>{if(r!==void 0)return typeof r=="string"||typeof r=="number"?t(c,{color:o,children:r}):r};function u({backgroundColor:r,center:o,color:n,left:d,right:f}){return l(i,{backgroundColor:r,paddingX:1,width:"100%",children:[t(i,{flexGrow:1,flexShrink:1,minWidth:0,children:e(d,n)}),o===void 0?void 0:t(i,{flexGrow:0,flexShrink:0,justifyContent:"center",children:e(o,n)}),t(i,{flexGrow:1,flexShrink:1,justifyContent:"flex-end",minWidth:0,children:e(f,n)})]})}export{u as StatusLine,u as default};
@@ -0,0 +1,21 @@
1
+ import { ReactNode, ReactElement } from 'react';
2
+ import { V as Variant } from "../packem_shared/variant-config.d-D5NnrrQK.js";
3
+ type StatusMessageVariant = Variant;
4
+ type Props = {
5
+ /**
6
+ * Message content.
7
+ */
8
+ readonly children: ReactNode;
9
+ /**
10
+ * Determines the icon and color of the status message.
11
+ */
12
+ readonly variant: StatusMessageVariant;
13
+ };
14
+ /**
15
+ * Renders a status notification with a colored icon and message text.
16
+ */
17
+ declare function StatusMessage({
18
+ children,
19
+ variant
20
+ }: Props): ReactElement;
21
+ export { Props, StatusMessage, type Props as StatusMessageProps, StatusMessageVariant, StatusMessage as default };
@@ -0,0 +1 @@
1
+ import{jsxs as n,jsx as o}from"react/jsx-runtime";import{Box as e}from"./box.js";import{Text as r}from"./text.js";import{o as c}from"../packem_shared/variant-config-BJqpNo7H.js";function d({children:s,variant:t}){const{color:a,icon:i}=c[t];return n(e,{gap:1,children:[o(r,{color:a,children:i}),o(r,{children:s})]})}export{d as StatusMessage,d as default};
@@ -0,0 +1,48 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactNode, ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type StepStatus = "active" | "completed" | "error" | "pending";
5
+ type StepperStep = {
6
+ readonly description?: string;
7
+ readonly key?: string;
8
+ readonly label: ReactNode;
9
+ readonly status?: StepStatus;
10
+ };
11
+ type Props = {
12
+ /**
13
+ * Color used for active and completed steps.
14
+ * @default "blue"
15
+ */
16
+ readonly accentColor?: LiteralUnion<AnsiColors, string>;
17
+ /**
18
+ * Index of the current step (used when steps do not provide a status).
19
+ * @default 0
20
+ */
21
+ readonly activeIndex?: number;
22
+ /**
23
+ * Color used for errors.
24
+ * @default "red"
25
+ */
26
+ readonly errorColor?: LiteralUnion<AnsiColors, string>;
27
+ /**
28
+ * Orientation of the stepper.
29
+ * @default "horizontal"
30
+ */
31
+ readonly orientation?: "horizontal" | "vertical";
32
+ /**
33
+ * List of steps.
34
+ */
35
+ readonly steps: ReadonlyArray<StepperStep>;
36
+ };
37
+ /**
38
+ * Step indicator for multi-stage flows.
39
+ * @returns A `ReactElement` rendering the steps horizontally or vertically.
40
+ */
41
+ declare function Stepper({
42
+ accentColor,
43
+ activeIndex,
44
+ errorColor,
45
+ orientation,
46
+ steps
47
+ }: Props): ReactElement;
48
+ export { Props, StepStatus, Stepper, type Props as StepperProps, StepperStep, Stepper as default };
@@ -0,0 +1 @@
1
+ import{jsx as i,jsxs as d}from"react/jsx-runtime";import{Fragment as v}from"react";import{Box as n}from"./box.js";import{Text as l}from"./text.js";const h={active:"●",completed:"✔",error:"✖",pending:"○"},u=(t,c,m)=>t.status!==void 0?t.status:c<m?"completed":c===m?"active":"pending";function k({accentColor:t="blue",activeIndex:c=0,errorColor:m="red",orientation:g="horizontal",steps:a}){return g==="vertical"?i(n,{flexDirection:"column",children:a.map((r,o)=>{const e=u(r,o,c),p=o===a.length-1,s=e==="error"?m:e==="pending"?void 0:t;return d(n,{flexDirection:"column",children:[d(n,{children:[d(l,{color:s,dimColor:e==="pending",children:[h[e]," "]}),i(l,{bold:e==="active",color:s,dimColor:e==="pending",children:r.label})]}),r.description===void 0?void 0:i(n,{marginLeft:2,children:i(l,{dimColor:!0,children:r.description})}),p?void 0:i(n,{marginLeft:0,children:i(l,{dimColor:!0,children:"│"})})]},r.key??o)})}):i(n,{children:a.map((r,o)=>{const e=u(r,o,c),p=e==="error"?m:e==="pending"?void 0:t,s=o===a.length-1;return d(v,{children:[d(n,{children:[d(l,{color:p,dimColor:e==="pending",children:[h[e]," "]}),i(l,{bold:e==="active",color:p,dimColor:e==="pending",children:r.label})]}),s?void 0:i(l,{dimColor:!0,children:" ── "})]},r.key??o)})})}export{k as Stepper,k as default};
@@ -0,0 +1,49 @@
1
+ import { Ref, ReactElement } from 'react';
2
+ import { UseStopwatchResult } from "../ink/hooks/use-stopwatch.js";
3
+ type StopwatchRef = Omit<UseStopwatchResult, "elapsed" | "isRunning" | "laps">;
4
+ type Props = {
5
+ /**
6
+ * Whether to start counting immediately.
7
+ * @default false
8
+ */
9
+ readonly autoStart?: boolean;
10
+ /**
11
+ * Make the rendered text bold.
12
+ */
13
+ readonly bold?: boolean;
14
+ /**
15
+ * Text color for the rendered time.
16
+ */
17
+ readonly color?: string;
18
+ /**
19
+ * Custom formatter for the elapsed time.
20
+ * Receives elapsed milliseconds, returns a display string.
21
+ * @default formatDuration (MM:SS or HH:MM:SS)
22
+ */
23
+ readonly format?: (elapsed: number) => string;
24
+ /**
25
+ * Tick interval in milliseconds.
26
+ * @default 1000
27
+ */
28
+ readonly interval?: number;
29
+ readonly ref?: Ref<StopwatchRef>;
30
+ };
31
+ /**
32
+ * A count-up stopwatch component.
33
+ *
34
+ * Exposes `start`, `stop`, `toggle`, `reset`, and `lap` methods via ref.
35
+ *
36
+ * ```tsx
37
+ * const ref = useRef&lt;StopwatchRef>(null);
38
+ * &lt;Stopwatch ref={ref} autoStart />
39
+ * ```
40
+ */
41
+ declare const Stopwatch: ({
42
+ autoStart,
43
+ bold,
44
+ color,
45
+ format,
46
+ interval,
47
+ ref
48
+ }: Props) => ReactElement;
49
+ export { Props, Stopwatch, type Props as StopwatchProps, StopwatchRef, Stopwatch as default };