@visulima/tui 1.0.0-alpha.9 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (549) hide show
  1. package/CHANGELOG.md +648 -0
  2. package/LICENSE.md +2414 -187
  3. package/README.md +49 -4
  4. package/dist/components/accordion.d.ts +59 -0
  5. package/dist/components/accordion.js +1 -0
  6. package/dist/components/alert.d.ts +26 -0
  7. package/dist/components/alert.js +1 -0
  8. package/dist/components/animate-presence.d.ts +18 -0
  9. package/dist/components/animate-presence.js +1 -0
  10. package/dist/components/approval-prompt.d.ts +65 -0
  11. package/dist/components/approval-prompt.js +1 -0
  12. package/dist/components/area-chart.d.ts +66 -0
  13. package/dist/components/area-chart.js +1 -0
  14. package/dist/components/badge.d.ts +22 -0
  15. package/dist/components/badge.js +1 -0
  16. package/dist/components/bar-chart.d.ts +67 -0
  17. package/dist/components/bar-chart.js +1 -0
  18. package/dist/components/big-text.d.ts +81 -0
  19. package/dist/components/big-text.js +1 -0
  20. package/dist/components/blink-dot.d.ts +36 -0
  21. package/dist/components/blink-dot.js +1 -0
  22. package/dist/components/box.d.ts +62 -0
  23. package/dist/components/box.js +1 -0
  24. package/dist/components/breadcrumb.d.ts +33 -0
  25. package/dist/components/breadcrumb.js +1 -0
  26. package/dist/components/button.d.ts +45 -0
  27. package/dist/components/button.js +1 -0
  28. package/dist/components/calendar.d.ts +72 -0
  29. package/dist/components/calendar.js +1 -0
  30. package/dist/components/canvas.d.ts +44 -0
  31. package/dist/components/canvas.js +1 -0
  32. package/dist/components/card.d.ts +57 -0
  33. package/dist/components/card.js +1 -0
  34. package/dist/components/checkbox.d.ts +48 -0
  35. package/dist/components/checkbox.js +1 -0
  36. package/dist/components/code.d.ts +48 -0
  37. package/dist/components/code.js +2 -0
  38. package/dist/components/collapsible.d.ts +53 -0
  39. package/dist/components/collapsible.js +1 -0
  40. package/dist/components/command-block.d.ts +47 -0
  41. package/dist/components/command-block.js +4 -0
  42. package/dist/components/command-palette.d.ts +82 -0
  43. package/dist/components/command-palette.js +1 -0
  44. package/dist/components/confirm-dialog.d.ts +75 -0
  45. package/dist/components/confirm-dialog.js +1 -0
  46. package/dist/components/confirm-input.d.ts +38 -0
  47. package/dist/components/confirm-input.js +1 -0
  48. package/dist/components/console-overlay.d.ts +54 -0
  49. package/dist/components/console-overlay.js +1 -0
  50. package/dist/components/content-switcher.d.ts +57 -0
  51. package/dist/components/content-switcher.js +1 -0
  52. package/dist/components/controlled-scroll-view.d.ts +61 -0
  53. package/dist/components/controlled-scroll-view.js +1 -0
  54. package/dist/components/cursor.d.ts +62 -0
  55. package/dist/components/cursor.js +1 -0
  56. package/dist/components/date-picker.d.ts +65 -0
  57. package/dist/components/date-picker.js +1 -0
  58. package/dist/components/definition-list.d.ts +44 -0
  59. package/dist/components/definition-list.js +1 -0
  60. package/dist/components/dialog.d.ts +117 -0
  61. package/dist/components/dialog.js +1 -0
  62. package/dist/components/diff-view.d.ts +85 -0
  63. package/dist/components/diff-view.js +1 -0
  64. package/dist/components/divider.d.ts +49 -0
  65. package/dist/components/divider.js +1 -0
  66. package/dist/components/file-picker-entry.d.ts +104 -0
  67. package/dist/components/file-picker-entry.js +1 -0
  68. package/dist/components/form.d.ts +81 -0
  69. package/dist/components/form.js +1 -0
  70. package/dist/components/gauge.d.ts +87 -0
  71. package/dist/components/gauge.js +1 -0
  72. package/dist/components/gradient.d.ts +42 -0
  73. package/dist/components/gradient.js +1 -0
  74. package/dist/components/heading.d.ts +33 -0
  75. package/dist/components/heading.js +1 -0
  76. package/dist/components/heatmap.d.ts +62 -0
  77. package/dist/components/heatmap.js +1 -0
  78. package/dist/components/help.d.ts +52 -0
  79. package/dist/components/help.js +1 -0
  80. package/dist/components/histogram.d.ts +62 -0
  81. package/dist/components/histogram.js +1 -0
  82. package/dist/components/kbd.d.ts +31 -0
  83. package/dist/components/kbd.js +1 -0
  84. package/dist/components/line-chart.d.ts +109 -0
  85. package/dist/components/line-chart.js +1 -0
  86. package/dist/components/link.d.ts +38 -0
  87. package/dist/components/link.js +1 -0
  88. package/dist/components/loading-indicator.d.ts +29 -0
  89. package/dist/components/loading-indicator.js +1 -0
  90. package/dist/components/markdown.d.ts +40 -0
  91. package/dist/components/markdown.js +1 -0
  92. package/dist/components/masked-input.d.ts +50 -0
  93. package/dist/components/masked-input.js +1 -0
  94. package/dist/components/menu.d.ts +78 -0
  95. package/dist/components/menu.js +1 -0
  96. package/dist/components/message-bubble.d.ts +43 -0
  97. package/dist/components/message-bubble.js +1 -0
  98. package/dist/components/model-badge.d.ts +39 -0
  99. package/dist/components/model-badge.js +1 -0
  100. package/dist/components/multi-select.d.ts +65 -0
  101. package/dist/components/multi-select.js +1 -0
  102. package/dist/components/newline.d.ts +15 -0
  103. package/dist/components/newline.js +2 -0
  104. package/dist/components/operation-tree.d.ts +49 -0
  105. package/dist/components/operation-tree.js +1 -0
  106. package/dist/components/option-list.d.ts +47 -0
  107. package/dist/components/option-list.js +1 -0
  108. package/dist/components/ordered-list.d.ts +24 -0
  109. package/dist/components/ordered-list.js +1 -0
  110. package/dist/components/paginator.d.ts +69 -0
  111. package/dist/components/paginator.js +1 -0
  112. package/dist/components/paragraph.d.ts +38 -0
  113. package/dist/components/paragraph.js +1 -0
  114. package/dist/components/placeholder.d.ts +55 -0
  115. package/dist/components/placeholder.js +1 -0
  116. package/dist/components/progress-bar.d.ts +56 -0
  117. package/dist/components/progress-bar.js +1 -0
  118. package/dist/components/radio-group.d.ts +74 -0
  119. package/dist/components/radio-group.js +1 -0
  120. package/dist/components/scatter-plot.d.ts +35 -0
  121. package/dist/components/scatter-plot.js +1 -0
  122. package/dist/components/scroll-bar-box.d.ts +37 -0
  123. package/dist/components/scroll-bar-box.js +1 -0
  124. package/dist/components/scroll-bar.d.ts +25 -0
  125. package/dist/components/scroll-bar.js +1 -0
  126. package/dist/components/scroll-list.d.ts +20 -0
  127. package/dist/components/scroll-list.js +1 -0
  128. package/dist/components/scroll-view.d.ts +10 -0
  129. package/dist/components/scroll-view.js +1 -0
  130. package/dist/components/search-input.d.ts +55 -0
  131. package/dist/components/search-input.js +1 -0
  132. package/dist/components/select-input-indicator.d.ts +32 -0
  133. package/dist/components/select-input-indicator.js +1 -0
  134. package/dist/components/select-input-item.d.ts +41 -0
  135. package/dist/components/select-input-item.js +1 -0
  136. package/dist/components/select-input.d.ts +110 -0
  137. package/dist/components/select-input.js +1 -0
  138. package/dist/components/shimmer-text.d.ts +47 -0
  139. package/dist/components/shimmer-text.js +1 -0
  140. package/dist/components/slider.d.ts +103 -0
  141. package/dist/components/slider.js +1 -0
  142. package/dist/components/spacer.d.ts +8 -0
  143. package/dist/components/spacer.js +1 -0
  144. package/dist/components/sparkline.d.ts +35 -0
  145. package/dist/components/sparkline.js +1 -0
  146. package/dist/components/spinner.d.ts +17 -0
  147. package/dist/components/spinner.js +1 -0
  148. package/dist/components/static-render.d.ts +55 -0
  149. package/dist/components/static-render.js +1 -0
  150. package/dist/components/static.d.ts +29 -0
  151. package/dist/components/static.js +1 -0
  152. package/dist/components/status-line.d.ts +37 -0
  153. package/dist/components/status-line.js +1 -0
  154. package/dist/components/status-message.d.ts +21 -0
  155. package/dist/components/status-message.js +1 -0
  156. package/dist/components/stepper.d.ts +48 -0
  157. package/dist/components/stepper.js +1 -0
  158. package/dist/components/stopwatch.d.ts +49 -0
  159. package/dist/components/stopwatch.js +1 -0
  160. package/dist/components/streaming-text.d.ts +46 -0
  161. package/dist/components/streaming-text.js +1 -0
  162. package/dist/components/switch.d.ts +55 -0
  163. package/dist/components/switch.js +1 -0
  164. package/dist/components/tab.d.ts +19 -0
  165. package/dist/components/tab.js +1 -0
  166. package/dist/components/table.d.ts +119 -0
  167. package/dist/components/table.js +1 -0
  168. package/dist/components/tabs.d.ts +107 -0
  169. package/dist/components/tabs.js +1 -0
  170. package/dist/components/tag.d.ts +35 -0
  171. package/dist/components/tag.js +1 -0
  172. package/dist/components/text-input.d.ts +48 -0
  173. package/dist/components/text-input.js +1 -0
  174. package/dist/components/text.d.ts +79 -0
  175. package/dist/components/text.js +1 -0
  176. package/dist/components/textarea.d.ts +68 -0
  177. package/dist/components/textarea.js +2 -0
  178. package/dist/components/timer.d.ts +59 -0
  179. package/dist/components/timer.js +1 -0
  180. package/dist/components/toast.d.ts +49 -0
  181. package/dist/components/toast.js +1 -0
  182. package/dist/components/tooltip.d.ts +43 -0
  183. package/dist/components/tooltip.js +1 -0
  184. package/dist/components/transform.d.ts +21 -0
  185. package/dist/components/transform.js +1 -0
  186. package/dist/components/transition.d.ts +74 -0
  187. package/dist/components/transition.js +1 -0
  188. package/dist/components/tree-view-entry.d.ts +357 -0
  189. package/dist/components/tree-view-entry.js +1 -0
  190. package/dist/components/unordered-list.d.ts +30 -0
  191. package/dist/components/unordered-list.js +1 -0
  192. package/dist/core/index.d.ts +2 -2
  193. package/dist/core/index.js +1 -1
  194. package/dist/ink/hooks/use-animation.d.ts +41 -0
  195. package/dist/ink/hooks/use-animation.js +1 -0
  196. package/dist/ink/hooks/use-app.d.ts +38 -0
  197. package/dist/ink/hooks/use-app.js +1 -0
  198. package/dist/ink/hooks/use-box-metrics.d.ts +66 -0
  199. package/dist/ink/hooks/use-box-metrics.js +1 -0
  200. package/dist/ink/hooks/use-clipboard.d.ts +30 -0
  201. package/dist/ink/hooks/use-clipboard.js +1 -0
  202. package/dist/ink/hooks/use-color-blindness.d.ts +33 -0
  203. package/dist/ink/hooks/use-color-blindness.js +1 -0
  204. package/dist/ink/hooks/use-console-capture.d.ts +43 -0
  205. package/dist/ink/hooks/use-console-capture.js +1 -0
  206. package/dist/ink/hooks/use-cursor.d.ts +13 -0
  207. package/dist/ink/hooks/use-cursor.js +1 -0
  208. package/dist/ink/hooks/use-focus-manager.d.ts +57 -0
  209. package/dist/ink/hooks/use-focus-manager.js +1 -0
  210. package/dist/ink/hooks/use-focus.d.ts +34 -0
  211. package/dist/ink/hooks/use-focus.js +1 -0
  212. package/dist/ink/hooks/use-form.d.ts +68 -0
  213. package/dist/ink/hooks/use-form.js +1 -0
  214. package/dist/ink/hooks/use-hotkey.d.ts +37 -0
  215. package/dist/ink/hooks/use-hotkey.js +1 -0
  216. package/dist/ink/hooks/use-input.d.ts +149 -0
  217. package/dist/ink/hooks/use-input.js +2 -0
  218. package/dist/ink/hooks/use-interval.d.ts +25 -0
  219. package/dist/ink/hooks/use-interval.js +1 -0
  220. package/dist/ink/hooks/use-is-screen-reader-enabled.d.ts +6 -0
  221. package/dist/ink/hooks/use-is-screen-reader-enabled.js +1 -0
  222. package/dist/ink/hooks/use-key-bindings.d.ts +59 -0
  223. package/dist/ink/hooks/use-key-bindings.js +1 -0
  224. package/dist/ink/hooks/use-key-chord.d.ts +25 -0
  225. package/dist/ink/hooks/use-key-chord.js +1 -0
  226. package/dist/ink/hooks/use-linked-scroll.d.ts +49 -0
  227. package/dist/ink/hooks/use-linked-scroll.js +1 -0
  228. package/dist/ink/hooks/use-paste.d.ts +45 -0
  229. package/dist/ink/hooks/use-paste.js +1 -0
  230. package/dist/ink/hooks/use-persistent-state.d.ts +65 -0
  231. package/dist/ink/hooks/use-persistent-state.js +2 -0
  232. package/dist/ink/hooks/use-scroll-acceleration.d.ts +47 -0
  233. package/dist/ink/hooks/use-scroll-acceleration.js +1 -0
  234. package/dist/ink/hooks/use-scroll-input.d.ts +34 -0
  235. package/dist/ink/hooks/use-scroll-input.js +1 -0
  236. package/dist/ink/hooks/use-stderr.d.ts +16 -0
  237. package/dist/ink/hooks/use-stderr.js +1 -0
  238. package/dist/ink/hooks/use-stdin.d.ts +30 -0
  239. package/dist/ink/hooks/use-stdin.js +1 -0
  240. package/dist/ink/hooks/use-stdout.d.ts +16 -0
  241. package/dist/ink/hooks/use-stdout.js +1 -0
  242. package/dist/ink/hooks/use-stopwatch.d.ts +39 -0
  243. package/dist/ink/hooks/use-stopwatch.js +1 -0
  244. package/dist/ink/hooks/use-terminal-palette.d.ts +20 -0
  245. package/dist/ink/hooks/use-terminal-palette.js +1 -0
  246. package/dist/ink/hooks/use-text-buffer.d.ts +42 -0
  247. package/dist/ink/hooks/use-text-buffer.js +4 -0
  248. package/dist/ink/hooks/use-text-selection.d.ts +45 -0
  249. package/dist/ink/hooks/use-text-selection.js +1 -0
  250. package/dist/ink/hooks/use-timeout.d.ts +24 -0
  251. package/dist/ink/hooks/use-timeout.js +1 -0
  252. package/dist/ink/hooks/use-timer.d.ts +48 -0
  253. package/dist/ink/hooks/use-timer.js +1 -0
  254. package/dist/ink/hooks/use-window-size.d.ts +18 -0
  255. package/dist/ink/hooks/use-window-size.js +1 -0
  256. package/dist/ink/index.d.ts +30 -6251
  257. package/dist/ink/index.js +1 -1
  258. package/dist/ink/mouse/use-element-position.d.ts +31 -0
  259. package/dist/ink/mouse/use-element-position.js +1 -0
  260. package/dist/ink/mouse/use-mouse-action.d.ts +5 -0
  261. package/dist/ink/mouse/use-mouse-action.js +1 -0
  262. package/dist/ink/mouse/use-mouse-position.d.ts +5 -0
  263. package/dist/ink/mouse/use-mouse-position.js +1 -0
  264. package/dist/ink/mouse/use-mouse.d.ts +5 -0
  265. package/dist/ink/mouse/use-mouse.js +1 -0
  266. package/dist/ink/mouse/use-on-mouse-click.d.ts +16 -0
  267. package/dist/ink/mouse/use-on-mouse-click.js +1 -0
  268. package/dist/ink/mouse/use-on-mouse-hover.d.ts +10 -0
  269. package/dist/ink/mouse/use-on-mouse-hover.js +1 -0
  270. package/dist/ink/mouse/use-on-mouse-state.d.ts +13 -0
  271. package/dist/ink/mouse/use-on-mouse-state.js +1 -0
  272. package/dist/packem_chunks/devtools.js +1 -1
  273. package/dist/packem_shared/COLOR_BLINDNESS_COMPENSATION-Ilnoyeqc.js +1 -0
  274. package/dist/packem_shared/ControlledScrollView-Cn4byU2n.js +1 -0
  275. package/dist/packem_shared/DevTools-k6uiVzqv.js +1 -0
  276. package/dist/packem_shared/FilePicker-BLS9nOPz.js +1 -0
  277. package/dist/packem_shared/FocusContext-C2Sosxa4.js +1 -0
  278. package/dist/packem_shared/Fullscreen-BRhuBLBh.js +1 -0
  279. package/dist/packem_shared/IMECompositionBuffer-VhC9HRCv.js +1 -0
  280. package/dist/packem_shared/InputParser-CtwkCbrQ.js +2 -0
  281. package/dist/packem_shared/KEY-C--kOw41.js +1 -0
  282. package/dist/packem_shared/LayoutNode-LPYsuzBg.js +1 -0
  283. package/dist/packem_shared/MouseProvider-DUqQ3Eaa.js +1 -0
  284. package/dist/packem_shared/NAMED_COLORS-82DpREQV.js +1 -0
  285. package/dist/packem_shared/Range-BsVYNWtg.js +1 -0
  286. package/dist/packem_shared/Renderer-DsskdkUd.js +1 -0
  287. package/dist/packem_shared/ResizeObserver-BI9bDy-j.js +1 -0
  288. package/dist/packem_shared/ScrollBar-qa1IzDDv.js +1 -0
  289. package/dist/packem_shared/ScrollBarBox-DchESZWv.js +1 -0
  290. package/dist/packem_shared/ScrollList-BBAnRsrC.js +1 -0
  291. package/dist/packem_shared/ScrollView-CHAo7Epj.js +1 -0
  292. package/dist/packem_shared/Static-DSzsElz4.js +1 -0
  293. package/dist/packem_shared/TreeNodeMap-cJlYqckB.js +1 -0
  294. package/dist/packem_shared/TreeView-BsvLCsf0.js +1 -0
  295. package/dist/packem_shared/TuiApp-BPL8v1i1.js +1 -0
  296. package/dist/packem_shared/TuiContext-BNmP0lMY.js +3 -0
  297. package/dist/packem_shared/ansi-parser-DlgLtOYO.js +1 -0
  298. package/dist/packem_shared/ansi-tokenizer-BU67A126.js +1 -0
  299. package/dist/packem_shared/braille-ch3O5D7I.js +1 -0
  300. package/dist/packem_shared/buffer.d-EJkZr8uH.d.ts +39 -0
  301. package/dist/packem_shared/calculateScroll-D4Y_JR4H.js +1 -0
  302. package/dist/packem_shared/{measureElement-DA8WqFP_.js → calculateScrollbarLayout-Lf6i24c9.js} +1 -1
  303. package/dist/packem_shared/clearOsc52-BUpnQOav.js +1 -0
  304. package/dist/packem_shared/clearStringWidthCache-DKFjfJuB.js +1 -0
  305. package/dist/packem_shared/clipboard.d-D6lZTQ21.d.ts +23 -0
  306. package/dist/packem_shared/color-matrix.d-DSXLsB64.d.ts +50 -0
  307. package/dist/packem_shared/colorize-DU4YZkp3.js +1 -0
  308. package/dist/packem_shared/controlled-scroll-view-BVg7ywNW.js +1 -0
  309. package/dist/packem_shared/createInlineLoop-BT40Wpmx.js +2 -0
  310. package/dist/packem_shared/createScreen-DoYpyL0V.js +3 -0
  311. package/dist/packem_shared/cursor-helpers.d-BONB9tky.d.ts +12 -0
  312. package/dist/packem_shared/dom-rphpG0kf.js +1 -0
  313. package/dist/packem_shared/dom.d-B4kXbaVY.d.ts +449 -0
  314. package/dist/packem_shared/format-time-fjoQHMxD.js +1 -0
  315. package/dist/packem_shared/{getPathToRoot-B2tKmx3i.js → getPathToRoot-PDJeqiEH.js} +1 -1
  316. package/dist/packem_shared/input-utils-BSWCb4F_.js +1 -0
  317. package/dist/packem_shared/{input.d-Bfq7oc06.d.ts → input.d-CgxV2e8U.d.ts} +1 -1
  318. package/dist/packem_shared/isIntersecting-Bo2npvMR.js +1 -0
  319. package/dist/packem_shared/isTerminalPaletteQuerySupported-BYzmqq9-.js +1 -0
  320. package/dist/packem_shared/kittyFlags-g8ALyoCU.js +1 -0
  321. package/dist/packem_shared/line-chart-C7CUrvVs.js +1 -0
  322. package/dist/packem_shared/load-native-root-binding-DDikxNox.js +1 -0
  323. package/dist/packem_shared/measure-element-D4M9iSYp.js +1 -0
  324. package/dist/packem_shared/measure-text-B7juNq4Y.js +3 -0
  325. package/dist/packem_shared/mouse-context.d-BfL9xGk_.d.ts +30 -0
  326. package/dist/packem_shared/parseSgrMouse-bUrqPrh-.js +1 -0
  327. package/dist/packem_shared/processLayout-I83k6vXE.js +2 -0
  328. package/dist/packem_shared/reconciler-CFyBVf7l.js +1 -0
  329. package/dist/packem_shared/reconciler-ClpU7Y-V.js +1 -0
  330. package/dist/packem_shared/render-CuQecTAs.js +24 -0
  331. package/dist/packem_shared/render-DFZ8NHlG.js +1 -0
  332. package/dist/packem_shared/render.d-CBnYBDk2.d.ts +417 -0
  333. package/dist/packem_shared/renderToString-DwXFY8Qh.js +4 -0
  334. package/dist/packem_shared/renderToString-L_bpw4OQ.js +2 -0
  335. package/dist/packem_shared/renderTreeToBuffer-C8lS0lJ2.js +2 -0
  336. package/dist/packem_shared/renderer-k-xShm1P.js +17 -0
  337. package/dist/packem_shared/scroll-view.d-DtpsgHLg.d.ts +119 -0
  338. package/dist/packem_shared/selection.d-CI3_p8wg.d.ts +62 -0
  339. package/dist/packem_shared/squashTextNodesWithMap-BmUSBPfc.js +1 -0
  340. package/dist/packem_shared/stderr-context-Bvnik0hL.js +1 -0
  341. package/dist/packem_shared/stdin-context-88AhuztD.js +1 -0
  342. package/dist/packem_shared/styles.d-cMo36xQz.d.ts +396 -0
  343. package/dist/packem_shared/terminal-palette.d-D2SQjfn-.d.ts +19 -0
  344. package/dist/packem_shared/text-width-e49vlbQH.js +2 -0
  345. package/dist/packem_shared/token-to-elements-D6J6-P2A.js +1 -0
  346. package/dist/packem_shared/treeViewTheme-Dq3ekRAC.js +1 -0
  347. package/dist/packem_shared/useTreeView-D5ifGwG3.js +1 -0
  348. package/dist/packem_shared/useTreeViewState-BiTJakkh.js +1 -0
  349. package/dist/packem_shared/utils-Bup8lyK8.js +1 -0
  350. package/dist/packem_shared/variant-config.d-D5NnrrQK.d.ts +2 -0
  351. package/dist/packem_shared/waitFor-CTAki32d.js +4 -0
  352. package/dist/packem_shared/wrapOrTruncateStyledLine-46W8bTtv.js +3 -0
  353. package/dist/react/index.d.ts +2 -2
  354. package/dist/react/index.js +1 -1
  355. package/dist/testing/index.d.ts +5 -1
  356. package/dist/testing/index.js +1 -1
  357. package/index.js +550 -692
  358. package/package.json +585 -31
  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,33 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactNode, ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type BreadcrumbItem = {
5
+ readonly icon?: ReactNode;
6
+ readonly key?: string;
7
+ readonly label: string;
8
+ };
9
+ type Props = {
10
+ /**
11
+ * Color applied to the trailing (current) item.
12
+ * @default "blue"
13
+ */
14
+ readonly currentColor?: LiteralUnion<AnsiColors, string>;
15
+ /**
16
+ * Items to display from root to current page.
17
+ */
18
+ readonly items: ReadonlyArray<BreadcrumbItem>;
19
+ /**
20
+ * Glyph rendered between adjacent items.
21
+ * @default "›" (right single angle quote)
22
+ */
23
+ readonly separator?: string;
24
+ };
25
+ /**
26
+ * Render a breadcrumb trail (last item is highlighted).
27
+ */
28
+ declare function Breadcrumb({
29
+ currentColor,
30
+ items,
31
+ separator
32
+ }: Props): ReactElement;
33
+ export { Breadcrumb, BreadcrumbItem, type Props as BreadcrumbProps, Props, Breadcrumb as default };
@@ -0,0 +1 @@
1
+ import{jsx as a,jsxs as o,Fragment as d}from"react/jsx-runtime";import{Fragment as c}from"react";import{Box as s}from"./box.js";import{Text as t}from"./text.js";function b({currentColor:n="blue",items:i,separator:m="›"}){return a(s,{children:i.map((r,l)=>{const e=l===i.length-1;return o(c,{children:[l>0?o(t,{dimColor:!0,children:[" ",m," "]}):void 0,o(t,{bold:e,color:e?n:void 0,dimColor:!e,children:[r.icon===void 0?void 0:o(d,{children:[r.icon," "]}),r.label]})]},r.key??r.label)})})}export{b as Breadcrumb,b as default};
@@ -0,0 +1,45 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactNode, ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type ButtonVariant = "ghost" | "outline" | "primary" | "secondary";
5
+ type Props = {
6
+ /**
7
+ * Accent color used when the button is focused.
8
+ * @default "blue"
9
+ */
10
+ readonly accentColor?: LiteralUnion<AnsiColors, string>;
11
+ /**
12
+ * Focus this button when mounted if nothing else is focused.
13
+ */
14
+ readonly autoFocus?: boolean;
15
+ /**
16
+ * Button label.
17
+ */
18
+ readonly children: ReactNode;
19
+ /**
20
+ * When true, the button ignores input and is rendered dim.
21
+ */
22
+ readonly isDisabled?: boolean;
23
+ /**
24
+ * Called when the user presses Enter or Space while the button has focus.
25
+ */
26
+ readonly onPress?: () => void;
27
+ /**
28
+ * Visual style.
29
+ * @default "primary"
30
+ */
31
+ readonly variant?: ButtonVariant;
32
+ };
33
+ /**
34
+ * Focusable button. Triggers `onPress` on Enter / Space.
35
+ * @returns A `ReactElement` rendering the button (bordered or ghost variant).
36
+ */
37
+ declare function Button({
38
+ accentColor,
39
+ autoFocus,
40
+ children,
41
+ isDisabled,
42
+ onPress,
43
+ variant
44
+ }: Props): ReactElement;
45
+ export { Button, type Props as ButtonProps, ButtonVariant, Props, Button as default };
@@ -0,0 +1 @@
1
+ import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useCallback as p}from"react";import b from"../ink/hooks/use-focus.js";import g from"../ink/hooks/use-input.js";import{Box as e}from"./box.js";import{Text as c}from"./text.js";const h="round",y=(i,s,a,r)=>{if(!a){if(i==="primary"&&s)return"black";if(s)return r}};function A({accentColor:i="blue",autoFocus:s=!1,children:a,isDisabled:r=!1,onPress:l,variant:n="primary"}){const{isFocused:o}=b({autoFocus:s,isActive:!r});g(p((m,u)=>{o&&(u.return||m===" ")&&l?.()},[o,l]),{isActive:!r&&o});const t=y(n,o,r,i);return n==="ghost"?d(e,{paddingX:1,children:f(c,{bold:o,color:t,dimColor:r,children:[o?"▸ ":" ",a]})}):d(e,{backgroundColor:n==="primary"&&o?i:void 0,borderColor:n==="outline"?o?i:"gray":n==="secondary"||o?i:void 0,borderStyle:h,paddingX:1,children:d(c,{bold:o,color:t,dimColor:r,children:a})})}export{A as Button,A as default};
@@ -0,0 +1,72 @@
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 today / the focused cell.
7
+ * @default "blue"
8
+ */
9
+ readonly accentColor?: LiteralUnion<AnsiColors, string>;
10
+ /**
11
+ * Auto-focus the grid on mount.
12
+ */
13
+ readonly autoFocus?: boolean;
14
+ /**
15
+ * Initial focused day when uncontrolled. Defaults to `value` or today.
16
+ */
17
+ readonly defaultValue?: Date;
18
+ /**
19
+ * First day of the week: 0 = Sunday, 1 = Monday.
20
+ * @default 1
21
+ */
22
+ readonly firstDayOfWeek?: 0 | 1;
23
+ /**
24
+ * When true, disable input and render the grid dim.
25
+ */
26
+ readonly isDisabled?: boolean;
27
+ /**
28
+ * Upper bound; days after `maxDate` cannot be selected.
29
+ */
30
+ readonly maxDate?: Date;
31
+ /**
32
+ * Lower bound; days before `minDate` cannot be selected.
33
+ */
34
+ readonly minDate?: Date;
35
+ /**
36
+ * Called whenever the user navigates or selects a day.
37
+ */
38
+ readonly onChange?: (date: Date) => void;
39
+ /**
40
+ * Called when the user presses Enter.
41
+ */
42
+ readonly onSubmit?: (date: Date) => void;
43
+ /**
44
+ * Color used to mark the currently selected day.
45
+ * @default "green"
46
+ */
47
+ readonly selectedColor?: LiteralUnion<AnsiColors, string>;
48
+ /**
49
+ * Controlled selected date.
50
+ */
51
+ readonly value?: Date;
52
+ };
53
+ /**
54
+ * Month-grid date picker. Arrow keys move focus by one day, page up/down move
55
+ * by month. Enter submits; Space or Enter selects.
56
+ * @returns A bordered `ReactElement` containing the month header, weekday
57
+ * labels, and the day grid.
58
+ */
59
+ declare function Calendar({
60
+ accentColor,
61
+ autoFocus,
62
+ defaultValue,
63
+ firstDayOfWeek,
64
+ isDisabled,
65
+ maxDate,
66
+ minDate,
67
+ onChange,
68
+ onSubmit,
69
+ selectedColor,
70
+ value
71
+ }: Props): ReactElement;
72
+ export { Calendar, type Props as CalendarProps, Props, Calendar as default };
@@ -0,0 +1 @@
1
+ import{jsxs as y,jsx as u}from"react/jsx-runtime";import{useMemo as w,useState as V,useRef as W,useCallback as S}from"react";import I from"../ink/hooks/use-focus.js";import K from"../ink/hooks/use-input.js";import{Box as h}from"./box.js";import{Text as b}from"./text.js";const P=["January","February","March","April","May","June","July","August","September","October","November","December"],k=["Su","Mo","Tu","We","Th","Fr","Sa"],p=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),x=(e,r)=>{const i=e.getFullYear(),l=e.getMonth()+r,g=new Date(i,l+1,0).getDate(),a=Math.min(e.getDate(),g);return new Date(i,l,a)},T=(e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate(),J=(e,r,i)=>r!==void 0&&e<p(r)||i!==void 0&&e>p(i),X=(e,r,i)=>{const l=(new Date(e,r,1).getDay()-i+7)%7,g=new Date(e,r+1,0).getDate(),a=[];for(let o=0;o<l;o+=1)a.push(void 0);for(let o=1;o<=g;o+=1)a.push(new Date(e,r,o));for(;a.length%7!==0;)a.push(void 0);const D=[];for(let o=0;o<a.length;o+=7)D.push(a.slice(o,o+7));return D};function Z({accentColor:e="blue",autoFocus:r=!1,defaultValue:i,firstDayOfWeek:l=1,isDisabled:g=!1,maxDate:a,minDate:D,onChange:o,onSubmit:F,selectedColor:$="green",value:f}){const{isFocused:m}=I({autoFocus:r,isActive:!g}),M=w(()=>p(new Date),[]),j=p(f??i??M),[O,B]=V(j),c=f?p(f):O,v=W(c);v.current=c;const E=w(()=>[...k.slice(l),...k.slice(0,l)],[l]),N=w(()=>X(c.getFullYear(),c.getMonth(),l),[c,l]),d=S(s=>{const n=p(s);J(n,D,a)||(f===void 0&&B(n),o?.(n))},[f,o,D,a]);K(S((s,n)=>{if(!m)return;const{current:t}=v;n.leftArrow?d(new Date(t.getFullYear(),t.getMonth(),t.getDate()-1)):n.rightArrow?d(new Date(t.getFullYear(),t.getMonth(),t.getDate()+1)):n.upArrow?d(new Date(t.getFullYear(),t.getMonth(),t.getDate()-7)):n.downArrow?d(new Date(t.getFullYear(),t.getMonth(),t.getDate()+7)):n.pageUp?d(x(t,-1)):n.pageDown?d(x(t,1)):n.return&&F?.(t)},[m,d,F]),{isActive:!g&&m});const R=`${P[c.getMonth()]} ${c.getFullYear()}`;return y(h,{borderColor:m?e:void 0,borderStyle:"round",flexDirection:"column",paddingX:1,children:[u(h,{justifyContent:"center",children:u(b,{bold:!0,color:e,children:R})}),u(h,{marginTop:1,children:E.map(s=>u(h,{width:3,children:u(b,{dimColor:!0,children:s.padEnd(2," ")})},s))}),N.map((s,n)=>u(h,{children:s.map((t,C)=>{if(t===void 0)return u(h,{width:3,children:u(b,{children:" "})},C);const Y=T(t,M),A=T(t,c),U=J(t,D,a);return u(h,{width:3,children:y(b,{backgroundColor:A&&m?e:void 0,bold:Y,color:A&&m?"black":Y?$:void 0,dimColor:U||g,children:[String(t.getDate()).padStart(2," ")," "]})},C)})},n))]})}export{Z as Calendar,Z as default};
@@ -0,0 +1,44 @@
1
+ import { ReactElement } from 'react';
2
+ import { C as CanvasContext } from "../packem_shared/buffer.d-EJkZr8uH.js";
3
+ export type { a as CanvasColor, b as CellStyle } from "../packem_shared/buffer.d-EJkZr8uH.js";
4
+ type Props = {
5
+ /**
6
+ * Imperative draw callback. Mutates the underlying typed-array buffer via
7
+ * the provided `CanvasContext`. Runs in a `useMemo` keyed by `version` —
8
+ * pass a stable reference (or hash) so the canvas only re-renders when
9
+ * the input data truly changes.
10
+ */
11
+ readonly draw: (context: CanvasContext) => void;
12
+ /**
13
+ * Number of rows (character cells vertically).
14
+ */
15
+ readonly height: number;
16
+ /**
17
+ * Invalidation key — required so the memoization contract is explicit.
18
+ * Re-runs `draw` and re-serializes only the rows the draw callback
19
+ * dirtied. Pass the data you render (or a hash of it). Use a stable
20
+ * value (e.g. a counter) when you intentionally want to redraw on
21
+ * every render.
22
+ */
23
+ readonly version: unknown;
24
+ /**
25
+ * Number of columns (character cells horizontally).
26
+ */
27
+ readonly width: number;
28
+ };
29
+ /**
30
+ * A fixed-size cell grid backed by typed arrays. Use the imperative `draw`
31
+ * callback to paint. The canvas emits one `Text` child per row (not per cell)
32
+ * and caches the ANSI output of each row: only rows marked dirty by the last
33
+ * draw pass are re-serialized, and only when `version` changes.
34
+ *
35
+ * This is the foundation for chart/grid components that need more layout
36
+ * control than `Text` alone.
37
+ */
38
+ declare function Canvas({
39
+ draw,
40
+ height,
41
+ version,
42
+ width
43
+ }: Props): ReactElement;
44
+ export { Canvas, type CanvasContext, type Props as CanvasProps, Props, Canvas as default };
@@ -0,0 +1 @@
1
+ import{jsx as $}from"react/jsx-runtime";import{useRef as k,useMemo as _,Fragment as j}from"react";import{a as D}from"../packem_shared/colorize-DU4YZkp3.js";import{Box as z}from"./box.js";import{Text as E}from"./text.js";const T=Math.trunc(1),I=2,A=32,F=0,H=()=>{const c=new Map,r=[void 0];return{decode:l=>r[l],encode:l=>{if(l===void 0)return F;const h=typeof l=="number"?`n:${l}`:`s:${l}`,u=c.get(h);if(u!==void 0)return u;const w=r.length;return r.push(l),c.set(h,w),w}}},C=[9601,9602,9603,9604,9605,9606,9607,9608],S=[9615,9614,9613,9612,9611,9610,9609,9608],U=9608,L=c=>{if(!c)return 0;let r=0;return c.bold&&(r|=T),c.dim&&(r|=I),r},P=c=>typeof c=="number"?c:c.codePointAt(0)??A,O=(c,r)=>{const l=Math.max(0,c*r),h=new Uint32Array(l),u=new Uint32Array(l),w=new Int32Array(l),x=new Int32Array(l),y=new Uint8Array(r),{decode:p,encode:m}=H();h.fill(A);const b=n=>{n>=0&&n<r&&(y[n]=1)},g=(n,t,s,i)=>{if(n<0||n>=c||t<0||t>=r)return;const e=t*c+n,d=P(s),a=m(i?.color),o=m(i?.background),f=L(i);h[e]===d&&u[e]===f&&w[e]===a&&x[e]===o||(h[e]=d,u[e]=f,w[e]=a,x[e]=o,y[t]=1)};return{bg:x,chars:h,colorDecoder:p,context:{clear:()=>{h.fill(A),u.fill(0),w.fill(0),x.fill(0),y.fill(1)},drawHBar:(n,t,s,i,e)=>{if(s<=0||t<0||t>=r)return;const d=Math.max(0,Math.min(1,i)),a=s*S.length,o=Math.round(d*a),f=Math.floor(o/S.length),B=o%S.length;for(let M=0;M<s;M+=1){const v=n+M;M<f?g(v,t,U,e):M===f&&B>0?g(v,t,S[B-1],e):g(v,t,A,e)}b(t)},drawRect:(n,t,s,i,e,d)=>{if(s<=0||i<=0)return;const a=P(e);for(let o=0;o<i;o+=1){for(let f=0;f<s;f+=1)g(n+f,t+o,a,d);b(t+o)}},drawText:(n,t,s,i)=>{if(t<0||t>=r||s.length===0)return;let e=0;for(const d of s)g(n+e,t,d,i),e+=1;b(t)},drawVBar:(n,t,s,i,e)=>{if(s<=0||n<0||n>=c)return;const d=Math.max(0,Math.min(1,i)),a=s*C.length,o=Math.round(d*a),f=Math.floor(o/C.length),B=o%C.length;for(let M=0;M<s;M+=1){const v=s-M-1,R=t+M;v<f?g(n,R,U,e):v===f&&B>0?g(n,R,C[B-1],e):g(n,R,A,e),b(R)}},height:r,setCell:g,width:c},dirty:y,fg:w,height:r,styles:u,width:c}},V=(c,r)=>{const{bg:l,chars:h,colorDecoder:u,fg:w,styles:x,width:y}=c,p=r*y;let m="",b=0,g=x[p],n=w[p],t=l[p];const s=i=>{let e="";for(let f=b;f<i;f+=1)e+=String.fromCodePoint(h[p+f]);const d=u(n),a=u(t);let o=e;d!==void 0&&(o=D(o,typeof d=="number"?String(d):d,"foreground")),a!==void 0&&(o=D(o,typeof a=="number"?String(a):a,"background")),(g&T)!==0&&(o=`\x1B[1m${o}\x1B[22m`),(g&I)!==0&&(o=`\x1B[2m${o}\x1B[22m`),m+=o};for(let i=1;i<y;i+=1){const e=x[p+i],d=w[p+i],a=l[p+i];(e!==g||d!==n||a!==t)&&(s(i),b=i,g=e,n=d,t=a)}return s(y),m};function Q({draw:c,height:r,version:l,width:h}){const u=k(void 0),w=k(void 0);(u.current?.width!==h||u.current.height!==r)&&(u.current=O(h,r),w.current={hasRendered:!1,lines:Array.from({length:r}).fill("")});const x=u.current,y=w.current,p=_(()=>{c(x.context);for(let m=0;m<x.height;m+=1)y.hasRendered&&x.dirty[m]===0||(y.lines[m]=V(x,m),x.dirty[m]=0);return y.hasRendered=!0,[...y.lines]},[l,h,r]);return $(z,{flexDirection:"column",flexShrink:0,height:r,width:h,children:p.map((m,b)=>$(j,{children:$(E,{wrap:"truncate-end",children:m})},b))})}export{Q as Canvas,Q as default};
@@ -0,0 +1,57 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactNode, ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type Props = {
5
+ /**
6
+ * Border color.
7
+ */
8
+ readonly borderColor?: LiteralUnion<AnsiColors, string>;
9
+ /**
10
+ * Border style name, passed through to `Box`.
11
+ * @default "round"
12
+ */
13
+ readonly borderStyle?: "arrow" | "bold" | "classic" | "double" | "doubleSingle" | "round" | "single" | "singleDouble";
14
+ /**
15
+ * Card body.
16
+ */
17
+ readonly children: ReactNode;
18
+ /**
19
+ * Optional footer rendered below body with a dim divider.
20
+ */
21
+ readonly footer?: ReactNode;
22
+ /**
23
+ * Optional content rendered after the title on the same row.
24
+ */
25
+ readonly headerRight?: ReactNode;
26
+ /**
27
+ * Optional subtitle rendered below the title.
28
+ */
29
+ readonly subtitle?: string;
30
+ /**
31
+ * Optional title rendered in the header area.
32
+ */
33
+ readonly title?: string;
34
+ /**
35
+ * Color applied to the title.
36
+ */
37
+ readonly titleColor?: LiteralUnion<AnsiColors, string>;
38
+ /**
39
+ * Fix the card width. When omitted the card grows to fill its parent.
40
+ */
41
+ readonly width?: number | string;
42
+ };
43
+ /**
44
+ * Bordered container with optional title, subtitle, and footer.
45
+ */
46
+ declare function Card({
47
+ borderColor,
48
+ borderStyle,
49
+ children,
50
+ footer,
51
+ headerRight,
52
+ subtitle,
53
+ title,
54
+ titleColor,
55
+ width
56
+ }: Props): ReactElement;
57
+ export { Card, type Props as CardProps, Props, Card as default };
@@ -0,0 +1 @@
1
+ import{jsxs as r,jsx as i}from"react/jsx-runtime";import{Box as o}from"./box.js";import{Divider as u}from"./divider.js";import{Text as c}from"./text.js";function b({borderColor:m,borderStyle:h="round",children:a,footer:l,headerRight:e,subtitle:d,title:t,titleColor:f,width:n}){return r(o,{borderColor:m,borderStyle:h,flexDirection:"column",paddingX:1,width:n,children:[t!==void 0||d!==void 0||e!==void 0?r(o,{flexDirection:"column",marginBottom:1,children:[r(o,{justifyContent:"space-between",children:[i(o,{children:t===void 0?void 0:i(c,{bold:!0,color:f,children:t})}),e===void 0?void 0:i(o,{children:e})]}),d===void 0?void 0:i(c,{dimColor:!0,children:d})]}):void 0,i(o,{flexDirection:"column",children:a}),l===void 0?void 0:r(o,{flexDirection:"column",marginTop:1,children:[i(u,{dimColor:!0,length:typeof n=="number"?Math.max(1,n-4):void 0}),i(o,{marginTop:1,children:l})]})]})}export{b as Card,b 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 Props = {
5
+ /**
6
+ * Accent color when focused.
7
+ * @default "blue"
8
+ */
9
+ readonly accentColor?: LiteralUnion<AnsiColors, string>;
10
+ /**
11
+ * Auto-focus when mounted if nothing else is focused.
12
+ */
13
+ readonly autoFocus?: boolean;
14
+ /**
15
+ * Label rendered next to the checkbox.
16
+ */
17
+ readonly children?: ReactNode;
18
+ /**
19
+ * Initial checked state when uncontrolled.
20
+ * @default false
21
+ */
22
+ readonly defaultChecked?: boolean;
23
+ /**
24
+ * Controlled checked state. When provided, `onChange` should update the parent.
25
+ */
26
+ readonly isChecked?: boolean;
27
+ /**
28
+ * Disable input and dim the label.
29
+ */
30
+ readonly isDisabled?: boolean;
31
+ /**
32
+ * Fired when the checkbox toggles.
33
+ */
34
+ readonly onChange?: (checked: boolean) => void;
35
+ };
36
+ /**
37
+ * Focusable checkbox. Toggles with Space or Enter.
38
+ */
39
+ declare function Checkbox({
40
+ accentColor,
41
+ autoFocus,
42
+ children,
43
+ defaultChecked,
44
+ isChecked,
45
+ isDisabled,
46
+ onChange
47
+ }: Props): ReactElement;
48
+ export { Checkbox, type Props as CheckboxProps, Props, Checkbox as default };
@@ -0,0 +1 @@
1
+ import{jsxs as d,jsx as v}from"react/jsx-runtime";import{useState as C,useCallback as x}from"react";import b from"../ink/hooks/use-focus.js";import k from"../ink/hooks/use-input.js";import{Box as F}from"./box.js";import{Text as l}from"./text.js";const g="☒",j="☐";function q({accentColor:s="blue",autoFocus:m=!1,children:c,defaultChecked:n=!1,isChecked:i,isDisabled:e=!1,onChange:t}){const{isFocused:o}=b({autoFocus:m,isActive:!e}),[u,f]=C(n),r=i??u;return k(x((h,p)=>{if(o&&(p.return||h===" ")){const a=!r;i===void 0&&f(a),t?.(a)}},[o,r,i,t]),{isActive:!e&&o}),d(F,{gap:1,children:[d(l,{color:o?s:void 0,dimColor:e,children:[o?"▸ ":" ",r?g:j]}),c===void 0?void 0:v(l,{color:o?s:void 0,dimColor:e,children:c})]})}export{q as Checkbox,q as default};
@@ -0,0 +1,48 @@
1
+ import { ReactElement } from 'react';
2
+ type Props = {
3
+ /**
4
+ * The source code string to highlight.
5
+ */
6
+ readonly code: string;
7
+ /**
8
+ * Set of line numbers to visually emphasize.
9
+ */
10
+ readonly highlightLines?: ReadonlySet<number>;
11
+ /**
12
+ * Programming language for syntax highlighting.
13
+ * Falls back to plain text if the language is unknown.
14
+ */
15
+ readonly language?: string;
16
+ /**
17
+ * Whether to show line numbers in the gutter.
18
+ * @default false
19
+ */
20
+ readonly showLineNumbers?: boolean;
21
+ /**
22
+ * Starting line number (useful for code excerpts).
23
+ * @default 1
24
+ */
25
+ readonly startLine?: number;
26
+ /**
27
+ * Shiki theme name.
28
+ * @default "github-dark-default"
29
+ */
30
+ readonly theme?: string;
31
+ };
32
+ /**
33
+ * Render source code with syntax highlighting.
34
+ *
35
+ * ```tsx
36
+ * &lt;Code code="const x = 42;" language="typescript" />
37
+ * &lt;Code code={source} language="python" showLineNumbers />
38
+ * ```
39
+ */
40
+ declare function Code({
41
+ code,
42
+ highlightLines,
43
+ language,
44
+ showLineNumbers,
45
+ startLine,
46
+ theme
47
+ }: Props): ReactElement;
48
+ export { Code, type Props as CodeProps, Props, Code as default };
@@ -0,0 +1,2 @@
1
+ import{jsx as m,jsxs as d}from"react/jsx-runtime";import{useState as w,useRef as S,useEffect as T}from"react";import{r as b,i as v,w as y,g as C,t as j}from"../packem_shared/token-to-elements-D6J6-P2A.js";import{Box as p}from"./box.js";import{Text as x}from"./text.js";function q({code:o,highlightLines:c,language:s,showLineNumbers:i=!1,startLine:a=1,theme:l="github-dark-default"}){const[f,u]=w(null),t=S(!1);T(()=>{t.current=!1;const e=s?b(s):"text";if(e!=="text"&&!v(e)){u(null);return}return(async()=>{try{const r=await y(e==="text"?[]:[e],l),n=C(r,o,e,l);t.current||u(n.tokens)}catch{t.current||u(null)}})(),()=>{t.current=!0}},[o,s,l]);const L={highlightLines:c,showLineNumbers:i,startLine:a};if(f)return j(f,L);const h=o.split(`
2
+ `),k=i?String(a+h.length-1).length:0;return m(p,{flexDirection:"column",children:h.map((e,r)=>{const n=a+r,g=c?.has(n)??!1;return d(p,{children:[i?d(x,{color:g?"yellow":void 0,dimColor:!g,children:[String(n).padStart(k)," "]}):void 0,m(x,{children:e})]},r)})})}export{q as Code,q as default};
@@ -0,0 +1,53 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactNode, ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type Props = {
5
+ /**
6
+ * Accent color when the header is focused.
7
+ * @default "blue"
8
+ */
9
+ readonly accentColor?: LiteralUnion<AnsiColors, string>;
10
+ /**
11
+ * Auto-focus the collapsible on mount.
12
+ */
13
+ readonly autoFocus?: boolean;
14
+ /**
15
+ * Child content rendered when open.
16
+ */
17
+ readonly children: ReactNode;
18
+ /**
19
+ * Whether the section starts expanded.
20
+ * @default false
21
+ */
22
+ readonly defaultOpen?: boolean;
23
+ /**
24
+ * Disable interaction.
25
+ */
26
+ readonly isDisabled?: boolean;
27
+ /**
28
+ * Controlled open state.
29
+ */
30
+ readonly isOpen?: boolean;
31
+ /**
32
+ * Called when the user toggles the section.
33
+ */
34
+ readonly onToggle?: (isOpen: boolean) => void;
35
+ /**
36
+ * Header label.
37
+ */
38
+ readonly title: ReactNode;
39
+ };
40
+ /**
41
+ * Focusable section that can be expanded or collapsed.
42
+ */
43
+ declare function Collapsible({
44
+ accentColor,
45
+ autoFocus,
46
+ children,
47
+ defaultOpen,
48
+ isDisabled,
49
+ isOpen,
50
+ onToggle,
51
+ title
52
+ }: Props): ReactElement;
53
+ export { Collapsible, type Props as CollapsibleProps, Props, Collapsible as default };
@@ -0,0 +1 @@
1
+ import{jsxs as a,jsx as l}from"react/jsx-runtime";import{useState as C,useCallback as g}from"react";import D from"../ink/hooks/use-focus.js";import F from"../ink/hooks/use-input.js";import{Box as t}from"./box.js";import{Text as d}from"./text.js";function L({accentColor:c="blue",autoFocus:m=!1,children:f,defaultOpen:u=!1,isDisabled:o=!1,isOpen:r,onToggle:s,title:p}){const{isFocused:e}=D({autoFocus:m,isActive:!o}),[x,b]=C(u),i=r??x;return F(g((h,v)=>{if(v.return||h===" "){const n=!i;r===void 0&&b(n),s?.(n)}},[i,r,s]),{isActive:!o&&e}),a(t,{flexDirection:"column",children:[a(t,{children:[l(d,{color:e?c:void 0,dimColor:o,children:i?"▼ ":"▶ "}),l(d,{bold:e,color:e?c:void 0,dimColor:o,children:p})]}),i?l(t,{flexDirection:"column",marginLeft:2,children:f}):void 0]})}export{L as Collapsible,L as default};
@@ -0,0 +1,47 @@
1
+ import { ReactNode, ReactElement } from 'react';
2
+ type CommandStatus = "error" | "idle" | "running" | "success";
3
+ type Props = {
4
+ /**
5
+ * Shell command rendered in the header.
6
+ */
7
+ readonly command: string;
8
+ /**
9
+ * Optional working directory shown after the command name.
10
+ */
11
+ readonly cwd?: string;
12
+ /**
13
+ * Duration in ms; shown when finished.
14
+ */
15
+ readonly durationMs?: number;
16
+ /**
17
+ * Exit code of the completed command.
18
+ */
19
+ readonly exitCode?: number;
20
+ /**
21
+ * Max output rows rendered before truncation. Use `Infinity` to disable.
22
+ */
23
+ readonly maxOutputRows?: number;
24
+ /**
25
+ * Command output. Either a string (rendered as-is) or arbitrary children.
26
+ */
27
+ readonly output?: ReactNode;
28
+ /**
29
+ * Lifecycle state. Controls the header icon and color.
30
+ * @default "idle"
31
+ */
32
+ readonly status?: CommandStatus;
33
+ };
34
+ /**
35
+ * Renders a shell command with its output and a status header. Designed for
36
+ * coding-agent UIs that stream terminal operations.
37
+ */
38
+ declare function CommandBlock({
39
+ command,
40
+ cwd,
41
+ durationMs,
42
+ exitCode,
43
+ maxOutputRows,
44
+ output,
45
+ status
46
+ }: Props): ReactElement;
47
+ export { CommandBlock, type Props as CommandBlockProps, CommandStatus, Props, CommandBlock as default };
@@ -0,0 +1,4 @@
1
+ import{jsxs as d,jsx as e}from"react/jsx-runtime";import{Box as l}from"./box.js";import{Spinner as p}from"./spinner.js";import{Text as n}from"./text.js";const f={error:"red",idle:"gray",running:"cyan",success:"green"},x=r=>r<1e3?`${Math.round(r)}ms`:`${(r/1e3).toFixed(2)}s`,g=r=>r==="running"?e(p,{type:"dots"}):{error:"✖",idle:"$",success:"✔"}[r],v=(r,i)=>{if(!Number.isFinite(i))return r;const o=r.split(`
2
+ `);if(o.length<=i)return r;const t=o.slice(0,i).join(`
3
+ `),s=o.length-i;return`${t}
4
+ … ${s} more line${s===1?"":"s"}`};function b({command:r,cwd:i,durationMs:o,exitCode:t,maxOutputRows:s=12,output:c,status:m="idle"}){const h=f[m],a=g(m),u=[];return o!==void 0&&u.push(d(n,{dimColor:!0,children:[" ",x(o)]},"duration")),t!==void 0&&m!=="running"&&u.push(d(n,{color:t===0?"green":"red",children:[" ","exit"," ",t]},"exit")),d(l,{borderColor:h,borderStyle:"round",flexDirection:"column",paddingX:1,children:[d(l,{children:[e(n,{color:h,children:a}),e(n,{children:" "}),e(l,{flexGrow:1,flexShrink:1,minWidth:0,children:e(n,{bold:!0,wrap:"truncate-end",children:r})}),i===void 0?void 0:d(n,{dimColor:!0,children:[" ","@",i]}),u.length===0?void 0:e(l,{flexShrink:0,children:u})]}),c===void 0?void 0:e(l,{flexDirection:"column",marginTop:1,children:typeof c=="string"?e(n,{children:v(c,s)}):c})]})}export{b as CommandBlock,b as default};
@@ -0,0 +1,82 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactNode, ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type CommandEntry = {
5
+ /**
6
+ * Optional description rendered under the label.
7
+ */
8
+ readonly description?: string;
9
+ /**
10
+ * Optional hotkey rendered on the right.
11
+ */
12
+ readonly hotkey?: string;
13
+ /**
14
+ * Optional icon rendered before the label.
15
+ */
16
+ readonly icon?: ReactNode;
17
+ /**
18
+ * Stable identifier returned by `onSelect`.
19
+ */
20
+ readonly id: string;
21
+ /**
22
+ * Optional keywords to boost matching (not displayed).
23
+ */
24
+ readonly keywords?: ReadonlyArray<string>;
25
+ /**
26
+ * Label shown in the list (and used as the primary match target).
27
+ */
28
+ readonly label: string;
29
+ };
30
+ type Props = {
31
+ /**
32
+ * Accent color for the border and focused row.
33
+ * @default "cyan"
34
+ */
35
+ readonly accentColor?: LiteralUnion<AnsiColors, string>;
36
+ /**
37
+ * Auto-focus the palette on mount.
38
+ */
39
+ readonly autoFocus?: boolean;
40
+ /**
41
+ * Available commands to search.
42
+ */
43
+ readonly commands: ReadonlyArray<CommandEntry>;
44
+ /**
45
+ * Empty-state text when nothing matches.
46
+ * @default "No results"
47
+ */
48
+ readonly emptyText?: string;
49
+ /**
50
+ * Max rows rendered in the list.
51
+ * @default 8
52
+ */
53
+ readonly limit?: number;
54
+ /**
55
+ * Called when the user presses Escape.
56
+ */
57
+ readonly onCancel?: () => void;
58
+ /**
59
+ * Called when the user picks a command with Enter.
60
+ */
61
+ readonly onSelect: (id: string, query: string) => void;
62
+ /**
63
+ * Placeholder inside the search field.
64
+ * @default "Type a command or search..."
65
+ */
66
+ readonly placeholder?: string;
67
+ };
68
+ /**
69
+ * Ctrl-P style fuzzy command finder. Features a search input, ranked results,
70
+ * keyboard navigation, and Esc to cancel.
71
+ */
72
+ declare function CommandPalette({
73
+ accentColor,
74
+ autoFocus,
75
+ commands,
76
+ emptyText,
77
+ limit,
78
+ onCancel,
79
+ onSelect,
80
+ placeholder
81
+ }: Props): ReactElement;
82
+ export { CommandEntry, CommandPalette, type Props as CommandPaletteProps, Props, CommandPalette as default };
@@ -0,0 +1 @@
1
+ import{jsxs as a,jsx as n}from"react/jsx-runtime";import{useState as y,useRef as M,useMemo as T,useEffect as S,useCallback as F}from"react";import A from"../ink/hooks/use-focus.js";import D from"../ink/hooks/use-input.js";import{i as L}from"../packem_shared/input-utils-BSWCb4F_.js";import{Box as d}from"./box.js";import{Text as t}from"./text.js";const j=(m,f)=>{if(m.length===0)return 1;const p=[f.label,f.description??"",...f.keywords??[]].map(i=>i.toLowerCase()).filter(i=>i.length>0),h=m.toLowerCase();let s=0;for(const i of p){if(i.includes(h)){const u=i.indexOf(h);s=Math.max(s,100-u);continue}let x=0,g=0;for(const u of h){const c=i.indexOf(u,x);if(c===-1){g=0;break}g+=1,x=c+1}g===h.length&&(s=Math.max(s,20))}return s};function P({accentColor:m="cyan",autoFocus:f=!0,commands:p,emptyText:h="No results",limit:s=8,onCancel:i,onSelect:x,placeholder:g="Type a command or search..."}){const{isFocused:u}=A({autoFocus:f}),[c,v]=y(""),[w,C]=y(0),b=M(w);b.current=w;const l=T(()=>{const e=p.map(r=>({command:r,score:j(c,r)})).filter(({score:r})=>r>0);return e.sort((r,o)=>o.score-r.score),e.slice(0,s).map(({command:r})=>r)},[p,c,s]);return S(()=>{const e=Math.max(0,l.length-1);b.current>e&&(b.current=e,C(e))},[l]),D(F((e,r)=>{if(u){if(r.escape){i?.();return}if(r.downArrow){if(l.length===0)return;C(o=>Math.min(l.length-1,o+1));return}if(r.upArrow){C(o=>Math.max(0,o-1));return}if(r.return){const o=l[b.current];o&&x(o.id,c);return}if(r.backspace||r.delete){v(o=>o.slice(0,-1)),C(0);return}L(e,r)&&(v(o=>o+e),C(0))}},[u,l,c,x,i]),{isActive:u}),a(d,{borderColor:m,borderStyle:"round",flexDirection:"column",paddingX:1,children:[a(d,{children:[n(t,{color:m,children:"❯"}),a(t,{children:[" ",c.length===0?n(t,{dimColor:!0,children:g}):c]}),n(t,{inverse:!0,children:" "})]}),n(d,{marginTop:1,children:a(t,{dimColor:!0,children:[l.length," of ",p.length]})}),n(d,{flexDirection:"column",marginTop:1,children:l.length===0?n(t,{dimColor:!0,children:h}):l.map((e,r)=>{const o=r===w,k=o?m:void 0;return a(d,{flexDirection:"column",children:[a(d,{children:[n(t,{color:k,children:o?"▸ ":" "}),e.icon===void 0?void 0:a(t,{color:k,children:[e.icon," "]}),n(d,{flexGrow:1,flexShrink:1,minWidth:0,children:n(t,{bold:o,color:k,wrap:"truncate-end",children:e.label})}),e.hotkey===void 0?void 0:n(d,{flexShrink:0,children:a(t,{dimColor:!0,children:[" ",e.hotkey]})})]}),e.description===void 0?void 0:n(d,{marginLeft:2,children:n(t,{dimColor:!0,wrap:"truncate-end",children:e.description})})]},e.id)})})]})}export{P as CommandPalette,P as default};
@@ -0,0 +1,75 @@
1
+ import { ReactNode, ReactElement } from 'react';
2
+ type ConfirmTone = "danger" | "info" | "warning";
3
+ type Props = {
4
+ /**
5
+ * Auto-focus the dialog on mount. Set `false` if a parent already owns
6
+ * focus and routes input here.
7
+ * @default true
8
+ */
9
+ readonly autoFocus?: boolean;
10
+ /**
11
+ * Label for the cancel button.
12
+ * @default "Cancel"
13
+ */
14
+ readonly cancelLabel?: string;
15
+ /**
16
+ * Body content (rendered between title and buttons).
17
+ */
18
+ readonly children?: ReactNode;
19
+ /**
20
+ * Label for the confirm button.
21
+ * @default "Confirm"
22
+ */
23
+ readonly confirmLabel?: string;
24
+ /**
25
+ * Default button when opening the dialog.
26
+ * @default "confirm"
27
+ */
28
+ readonly defaultFocus?: "cancel" | "confirm";
29
+ /**
30
+ * Disable input.
31
+ */
32
+ readonly isDisabled?: boolean;
33
+ /**
34
+ * Fired when the user declines.
35
+ */
36
+ readonly onCancel: () => void;
37
+ /**
38
+ * Fired when the user confirms.
39
+ */
40
+ readonly onConfirm: () => void;
41
+ /**
42
+ * Heading rendered at the top of the dialog.
43
+ */
44
+ readonly title?: string;
45
+ /**
46
+ * Controls the border color.
47
+ * @default "info"
48
+ */
49
+ readonly tone?: ConfirmTone;
50
+ /**
51
+ * Dialog width.
52
+ */
53
+ readonly width?: number;
54
+ };
55
+ /**
56
+ * Full-width modal-style confirm/cancel prompt. Unlike `ConfirmInput`, this
57
+ * renders a visible two-button UI: ← / → to toggle focus, Enter to activate,
58
+ * y/n as shortcuts, Esc to cancel.
59
+ * @returns A bordered `ReactElement` with optional title, body, and two
60
+ * buttons (cancel / confirm).
61
+ */
62
+ declare function ConfirmDialog({
63
+ autoFocus,
64
+ cancelLabel,
65
+ children,
66
+ confirmLabel,
67
+ defaultFocus,
68
+ isDisabled,
69
+ onCancel,
70
+ onConfirm,
71
+ title,
72
+ tone,
73
+ width
74
+ }: Props): ReactElement;
75
+ export { ConfirmDialog, type Props as ConfirmDialogProps, ConfirmTone, Props, ConfirmDialog as default };