@visulima/tui 1.0.0-alpha.23 → 1.0.0-alpha.24

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 (307) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +17 -0
  3. package/dist/components/accordion.js +1 -1
  4. package/dist/components/alert.js +1 -1
  5. package/dist/components/animate-presence.js +1 -1
  6. package/dist/components/approval-prompt.js +1 -1
  7. package/dist/components/area-chart.js +1 -1
  8. package/dist/components/badge.js +1 -1
  9. package/dist/components/bar-chart.js +1 -1
  10. package/dist/components/big-text.js +1 -1
  11. package/dist/components/blink-dot.js +1 -1
  12. package/dist/components/box.d.ts +1 -1
  13. package/dist/components/breadcrumb.js +1 -1
  14. package/dist/components/button.js +1 -1
  15. package/dist/components/calendar.js +1 -1
  16. package/dist/components/canvas.d.ts +1 -1
  17. package/dist/components/canvas.js +1 -1
  18. package/dist/components/card.js +1 -1
  19. package/dist/components/checkbox.js +1 -1
  20. package/dist/components/code.js +2 -2
  21. package/dist/components/collapsible.js +1 -1
  22. package/dist/components/command-block.js +4 -4
  23. package/dist/components/command-palette.js +1 -1
  24. package/dist/components/confirm-dialog.js +1 -1
  25. package/dist/components/confirm-input.js +1 -1
  26. package/dist/components/console-overlay.js +1 -1
  27. package/dist/components/content-switcher.js +1 -1
  28. package/dist/components/controlled-scroll-view.d.ts +1 -1
  29. package/dist/components/controlled-scroll-view.js +1 -1
  30. package/dist/components/cursor.d.ts +1 -1
  31. package/dist/components/cursor.js +1 -1
  32. package/dist/components/date-picker.js +1 -1
  33. package/dist/components/definition-list.js +1 -1
  34. package/dist/components/dialog.d.ts +1 -1
  35. package/dist/components/dialog.js +1 -1
  36. package/dist/components/diff-view.js +1 -1
  37. package/dist/components/divider.js +1 -1
  38. package/dist/components/file-picker-entry.js +1 -1
  39. package/dist/components/form.js +1 -1
  40. package/dist/components/gauge.js +1 -1
  41. package/dist/components/gradient.js +1 -1
  42. package/dist/components/heading.js +1 -1
  43. package/dist/components/heatmap.js +1 -1
  44. package/dist/components/help.js +1 -1
  45. package/dist/components/histogram.js +1 -1
  46. package/dist/components/kbd.js +1 -1
  47. package/dist/components/line-chart.js +1 -1
  48. package/dist/components/link.js +1 -1
  49. package/dist/components/loading-indicator.js +1 -1
  50. package/dist/components/markdown.js +1 -1
  51. package/dist/components/masked-input.js +1 -1
  52. package/dist/components/menu.js +1 -1
  53. package/dist/components/message-bubble.js +1 -1
  54. package/dist/components/model-badge.js +1 -1
  55. package/dist/components/multi-select.js +1 -1
  56. package/dist/components/newline.js +2 -2
  57. package/dist/components/operation-tree.js +1 -1
  58. package/dist/components/option-list.js +1 -1
  59. package/dist/components/ordered-list.js +1 -1
  60. package/dist/components/paginator.js +1 -1
  61. package/dist/components/paragraph.js +1 -1
  62. package/dist/components/placeholder.js +1 -1
  63. package/dist/components/progress-bar.js +1 -1
  64. package/dist/components/radio-group.js +1 -1
  65. package/dist/components/scatter-plot.js +1 -1
  66. package/dist/components/scroll-bar-box.d.ts +1 -1
  67. package/dist/components/scroll-bar-box.js +1 -1
  68. package/dist/components/scroll-bar.d.ts +1 -1
  69. package/dist/components/scroll-bar.js +1 -1
  70. package/dist/components/scroll-list.d.ts +1 -1
  71. package/dist/components/scroll-list.js +1 -1
  72. package/dist/components/scroll-view.d.ts +1 -1
  73. package/dist/components/scroll-view.js +1 -1
  74. package/dist/components/search-input.js +1 -1
  75. package/dist/components/select-input-indicator.js +1 -1
  76. package/dist/components/select-input-item.js +1 -1
  77. package/dist/components/select-input.js +1 -1
  78. package/dist/components/shimmer-text.js +1 -1
  79. package/dist/components/slider.js +1 -1
  80. package/dist/components/spacer.js +1 -1
  81. package/dist/components/sparkline.js +1 -1
  82. package/dist/components/spinner.js +1 -1
  83. package/dist/components/static-render.d.ts +1 -1
  84. package/dist/components/static-render.js +1 -1
  85. package/dist/components/static.js +1 -1
  86. package/dist/components/status-line.js +1 -1
  87. package/dist/components/status-message.js +1 -1
  88. package/dist/components/stepper.js +1 -1
  89. package/dist/components/stopwatch.js +1 -1
  90. package/dist/components/streaming-text.js +1 -1
  91. package/dist/components/switch.js +1 -1
  92. package/dist/components/tab.js +1 -1
  93. package/dist/components/table.js +1 -1
  94. package/dist/components/tabs.js +1 -1
  95. package/dist/components/tag.js +1 -1
  96. package/dist/components/text-input.js +1 -1
  97. package/dist/components/text.js +1 -1
  98. package/dist/components/textarea.js +2 -2
  99. package/dist/components/timer.js +1 -1
  100. package/dist/components/toast.js +1 -1
  101. package/dist/components/tooltip.js +1 -1
  102. package/dist/components/transform.js +1 -1
  103. package/dist/components/transition.js +1 -1
  104. package/dist/components/tree-view-entry.d.ts +1 -1
  105. package/dist/components/tree-view-entry.js +1 -1
  106. package/dist/components/unordered-list.js +1 -1
  107. package/dist/core/index.js +1 -1
  108. package/dist/ink/hooks/use-animation.js +1 -1
  109. package/dist/ink/hooks/use-app.js +1 -1
  110. package/dist/ink/hooks/use-box-metrics.d.ts +1 -1
  111. package/dist/ink/hooks/use-box-metrics.js +1 -1
  112. package/dist/ink/hooks/use-clipboard.js +1 -1
  113. package/dist/ink/hooks/use-color-blindness.js +1 -1
  114. package/dist/ink/hooks/use-console-capture.js +1 -1
  115. package/dist/ink/hooks/use-cursor.js +1 -1
  116. package/dist/ink/hooks/use-focus-manager.js +1 -1
  117. package/dist/ink/hooks/use-focus.js +1 -1
  118. package/dist/ink/hooks/use-form.js +1 -1
  119. package/dist/ink/hooks/use-hotkey.js +1 -1
  120. package/dist/ink/hooks/use-input.js +2 -2
  121. package/dist/ink/hooks/use-interval.js +1 -1
  122. package/dist/ink/hooks/use-is-screen-reader-enabled.js +1 -1
  123. package/dist/ink/hooks/use-key-bindings.js +1 -1
  124. package/dist/ink/hooks/use-key-chord.js +1 -1
  125. package/dist/ink/hooks/use-linked-scroll.d.ts +1 -1
  126. package/dist/ink/hooks/use-linked-scroll.js +1 -1
  127. package/dist/ink/hooks/use-paste.js +1 -1
  128. package/dist/ink/hooks/use-persistent-state.d.ts +12 -3
  129. package/dist/ink/hooks/use-persistent-state.js +2 -2
  130. package/dist/ink/hooks/use-scroll-acceleration.js +1 -1
  131. package/dist/ink/hooks/use-scroll-input.js +1 -1
  132. package/dist/ink/hooks/use-stderr.js +1 -1
  133. package/dist/ink/hooks/use-stdin.js +1 -1
  134. package/dist/ink/hooks/use-stdout.js +1 -1
  135. package/dist/ink/hooks/use-stopwatch.js +1 -1
  136. package/dist/ink/hooks/use-terminal-palette.js +1 -1
  137. package/dist/ink/hooks/use-text-buffer.js +4 -4
  138. package/dist/ink/hooks/use-text-selection.d.ts +2 -2
  139. package/dist/ink/hooks/use-text-selection.js +1 -1
  140. package/dist/ink/hooks/use-timeout.js +1 -1
  141. package/dist/ink/hooks/use-timer.js +1 -1
  142. package/dist/ink/hooks/use-window-size.js +1 -1
  143. package/dist/ink/index.d.ts +17 -62
  144. package/dist/ink/index.js +1 -1
  145. package/dist/ink/mouse/use-element-position.d.ts +31 -0
  146. package/dist/ink/mouse/use-element-position.js +1 -0
  147. package/dist/ink/mouse/use-mouse-action.d.ts +5 -0
  148. package/dist/ink/mouse/use-mouse-action.js +1 -0
  149. package/dist/ink/mouse/use-mouse-position.d.ts +5 -0
  150. package/dist/ink/mouse/use-mouse-position.js +1 -0
  151. package/dist/ink/mouse/use-mouse.d.ts +5 -0
  152. package/dist/ink/mouse/use-mouse.js +1 -0
  153. package/dist/ink/mouse/use-on-mouse-click.d.ts +16 -0
  154. package/dist/ink/mouse/use-on-mouse-click.js +1 -0
  155. package/dist/ink/mouse/use-on-mouse-hover.d.ts +10 -0
  156. package/dist/ink/mouse/use-on-mouse-hover.js +1 -0
  157. package/dist/ink/mouse/use-on-mouse-state.d.ts +13 -0
  158. package/dist/ink/mouse/use-on-mouse-state.js +1 -0
  159. package/dist/packem_chunks/devtools.js +1 -1
  160. package/dist/packem_shared/COLOR_BLINDNESS_COMPENSATION-Ilnoyeqc.js +1 -0
  161. package/dist/packem_shared/ControlledScrollView-BoN5Oi-p.js +1 -0
  162. package/dist/packem_shared/DevTools-k6uiVzqv.js +1 -0
  163. package/dist/packem_shared/FilePicker-BLS9nOPz.js +1 -0
  164. package/dist/packem_shared/FocusContext-C2Sosxa4.js +1 -0
  165. package/dist/packem_shared/Fullscreen-BRhuBLBh.js +1 -0
  166. package/dist/packem_shared/IMECompositionBuffer-VhC9HRCv.js +1 -0
  167. package/dist/packem_shared/InputParser-CtwkCbrQ.js +2 -0
  168. package/dist/packem_shared/KEY-C--kOw41.js +1 -0
  169. package/dist/packem_shared/LayoutNode-LPYsuzBg.js +1 -0
  170. package/dist/packem_shared/MouseProvider-DUqQ3Eaa.js +1 -0
  171. package/dist/packem_shared/NAMED_COLORS-82DpREQV.js +1 -0
  172. package/dist/packem_shared/Range-BsVYNWtg.js +1 -0
  173. package/dist/packem_shared/Renderer-DsskdkUd.js +1 -0
  174. package/dist/packem_shared/ResizeObserver-aX8XOr2u.js +1 -0
  175. package/dist/packem_shared/ScrollBar-BKCK8jsb.js +1 -0
  176. package/dist/packem_shared/ScrollBarBox-CBhLo6eZ.js +1 -0
  177. package/dist/packem_shared/ScrollList-DyFyVs6I.js +1 -0
  178. package/dist/packem_shared/ScrollView-BEgrtSnt.js +1 -0
  179. package/dist/packem_shared/Static-DSzsElz4.js +1 -0
  180. package/dist/packem_shared/TreeNodeMap-cJlYqckB.js +1 -0
  181. package/dist/packem_shared/TreeView-BsvLCsf0.js +1 -0
  182. package/dist/packem_shared/TuiApp-BPL8v1i1.js +1 -0
  183. package/dist/packem_shared/TuiContext-BNmP0lMY.js +3 -0
  184. package/dist/packem_shared/ansi-parser-DlgLtOYO.js +1 -0
  185. package/dist/packem_shared/ansi-tokenizer-BU67A126.js +1 -0
  186. package/dist/packem_shared/braille-ch3O5D7I.js +1 -0
  187. package/dist/packem_shared/calculateScroll-D4Y_JR4H.js +1 -0
  188. package/dist/packem_shared/calculateScrollbarLayout--eUVRLw7.js +1 -0
  189. package/dist/packem_shared/clearOsc52-BUpnQOav.js +1 -0
  190. package/dist/packem_shared/clearStringWidthCache-DKFjfJuB.js +1 -0
  191. package/dist/packem_shared/colorize-DU4YZkp3.js +1 -0
  192. package/dist/packem_shared/controlled-scroll-view-t55HU9L8.js +1 -0
  193. package/dist/packem_shared/createInlineLoop-BT40Wpmx.js +2 -0
  194. package/dist/packem_shared/createScreen-DoYpyL0V.js +3 -0
  195. package/dist/packem_shared/dom-rphpG0kf.js +1 -0
  196. package/dist/packem_shared/{dom.d-C1IxuLJ9.d.ts → dom.d-B4kXbaVY.d.ts} +35 -0
  197. package/dist/packem_shared/format-time-fjoQHMxD.js +1 -0
  198. package/dist/packem_shared/{getPathToRoot-BuAM_kmj.js → getPathToRoot-PDJeqiEH.js} +1 -1
  199. package/dist/packem_shared/input-utils-BSWCb4F_.js +1 -0
  200. package/dist/packem_shared/isIntersecting-Bo2npvMR.js +1 -0
  201. package/dist/packem_shared/isTerminalPaletteQuerySupported-BYzmqq9-.js +1 -0
  202. package/dist/packem_shared/kittyFlags-g8ALyoCU.js +1 -0
  203. package/dist/packem_shared/line-chart-C7CUrvVs.js +1 -0
  204. package/dist/packem_shared/load-native-root-binding-DDikxNox.js +1 -0
  205. package/dist/packem_shared/measure-element-Cs7_proT.js +2 -0
  206. package/dist/packem_shared/measure-text-B7juNq4Y.js +3 -0
  207. package/dist/packem_shared/mouse-context.d-BfL9xGk_.d.ts +30 -0
  208. package/dist/packem_shared/parseSgrMouse-bUrqPrh-.js +1 -0
  209. package/dist/packem_shared/processLayout-tAee0ytT.js +1 -0
  210. package/dist/packem_shared/reconciler-ClpU7Y-V.js +1 -0
  211. package/dist/packem_shared/reconciler-DhUGYWCr.js +1 -0
  212. package/dist/packem_shared/render-DFZ8NHlG.js +1 -0
  213. package/dist/packem_shared/render-v2x7ZRzT.js +24 -0
  214. package/dist/packem_shared/{render.d-DuyG0zip.d.ts → render.d-CBnYBDk2.d.ts} +1 -1
  215. package/dist/packem_shared/renderToString-C2YmVNLG.js +4 -0
  216. package/dist/packem_shared/renderToString-L_bpw4OQ.js +2 -0
  217. package/dist/packem_shared/renderTreeToBuffer-C8lS0lJ2.js +2 -0
  218. package/dist/packem_shared/renderer-COXHo5Xk.js +17 -0
  219. package/dist/packem_shared/{selection.d-Dbha5bMS.d.ts → selection.d-CI3_p8wg.d.ts} +1 -1
  220. package/dist/packem_shared/squashTextNodesWithMap-BmUSBPfc.js +1 -0
  221. package/dist/packem_shared/stderr-context-Bvnik0hL.js +1 -0
  222. package/dist/packem_shared/stdin-context-88AhuztD.js +1 -0
  223. package/dist/packem_shared/text-width-e49vlbQH.js +2 -0
  224. package/dist/packem_shared/token-to-elements-D6J6-P2A.js +1 -0
  225. package/dist/packem_shared/treeViewTheme-Dq3ekRAC.js +1 -0
  226. package/dist/packem_shared/useTreeView-D5ifGwG3.js +1 -0
  227. package/dist/packem_shared/useTreeViewState-BiTJakkh.js +1 -0
  228. package/dist/packem_shared/utils-Bup8lyK8.js +1 -0
  229. package/dist/packem_shared/waitFor-CTAki32d.js +4 -0
  230. package/dist/packem_shared/wrapOrTruncateStyledLine-46W8bTtv.js +3 -0
  231. package/dist/react/index.js +1 -1
  232. package/dist/testing/index.d.ts +2 -2
  233. package/dist/testing/index.js +1 -1
  234. package/index.js +691 -539
  235. package/package.json +48 -23
  236. package/dist/packem_shared/COLOR_BLINDNESS_SIMULATION-DqErf7XX.js +0 -1
  237. package/dist/packem_shared/ControlledScrollView-CIc-x1Cx.js +0 -1
  238. package/dist/packem_shared/DevTools-ClAYpMVI.js +0 -1
  239. package/dist/packem_shared/FilePicker-tYj_CIau.js +0 -1
  240. package/dist/packem_shared/FocusContext-Xy0cwJpO.js +0 -1
  241. package/dist/packem_shared/Fullscreen-CxLd1-Zu.js +0 -1
  242. package/dist/packem_shared/IMECompositionBuffer-C89PhiOu.js +0 -1
  243. package/dist/packem_shared/InputParser-B_qZcN3r.js +0 -2
  244. package/dist/packem_shared/KEY-Bk8B-3h_.js +0 -1
  245. package/dist/packem_shared/LayoutNode-B8zej4dm.js +0 -1
  246. package/dist/packem_shared/MouseProvider-PnIUKURs.js +0 -1
  247. package/dist/packem_shared/NAMED_COLORS-B9fJsYdg.js +0 -1
  248. package/dist/packem_shared/Renderer-DJXooAsp.js +0 -1
  249. package/dist/packem_shared/ResizeObserverEntry-Dq0dk8Kq.js +0 -1
  250. package/dist/packem_shared/ScrollBar-U_37hlIT.js +0 -1
  251. package/dist/packem_shared/ScrollBarBox-DwiCxilX.js +0 -1
  252. package/dist/packem_shared/ScrollList-C7nZ9ufK.js +0 -1
  253. package/dist/packem_shared/ScrollView-DKZ8OM-m.js +0 -1
  254. package/dist/packem_shared/Static-DLynr5pn.js +0 -1
  255. package/dist/packem_shared/TreeNodeMap-CspqSCpb.js +0 -1
  256. package/dist/packem_shared/TreeView-C0Iv3et8.js +0 -1
  257. package/dist/packem_shared/TuiApp-BVDXP0Cv.js +0 -1
  258. package/dist/packem_shared/TuiContext-BoJvG3NN.js +0 -3
  259. package/dist/packem_shared/ansi-parser-B6uXaq65.js +0 -1
  260. package/dist/packem_shared/ansi-tokenizer-DqX9nJuk.js +0 -1
  261. package/dist/packem_shared/braille-BBjIoaN0.js +0 -1
  262. package/dist/packem_shared/colorize-DbTZMrJO.js +0 -1
  263. package/dist/packem_shared/comparePoints-C3NJirbh.js +0 -1
  264. package/dist/packem_shared/controlled-scroll-view-CcUS50jx.js +0 -1
  265. package/dist/packem_shared/createInlineLoop-DRNZ7jqH.js +0 -2
  266. package/dist/packem_shared/createScreen-CrLrxA6t.js +0 -3
  267. package/dist/packem_shared/dom-CXB-19sK.js +0 -1
  268. package/dist/packem_shared/format-time-C7Q-hQZq.js +0 -1
  269. package/dist/packem_shared/getScrollHeight-ClEOyLHH.js +0 -1
  270. package/dist/packem_shared/input-utils-fAxzSlNh.js +0 -1
  271. package/dist/packem_shared/isIntersecting-B3KbKTmu.js +0 -1
  272. package/dist/packem_shared/isOsc52Supported-DKK7Uee6.js +0 -1
  273. package/dist/packem_shared/isTerminalPaletteQuerySupported-Dn2hFAZ_.js +0 -1
  274. package/dist/packem_shared/kittyFlags-C3rZLbcK.js +0 -1
  275. package/dist/packem_shared/layout-BMo200nF.js +0 -2
  276. package/dist/packem_shared/line-chart-kf7uhR0K.js +0 -1
  277. package/dist/packem_shared/measure-text-Ce2widM1.js +0 -3
  278. package/dist/packem_shared/measureElement-BTtTFZg4.js +0 -1
  279. package/dist/packem_shared/parseSgrMouse-Ccj70ijb.js +0 -1
  280. package/dist/packem_shared/processLayout-FEKj_mWu.js +0 -1
  281. package/dist/packem_shared/reconciler-DIfG72R9.js +0 -1
  282. package/dist/packem_shared/reconciler-DYE5h4K4.js +0 -1
  283. package/dist/packem_shared/render-BRR1ESvR.js +0 -26
  284. package/dist/packem_shared/render-Dh7HMhK1.js +0 -1
  285. package/dist/packem_shared/renderToString-BbQiRHrd.js +0 -2
  286. package/dist/packem_shared/renderToString-vEQyGmv6.js +0 -4
  287. package/dist/packem_shared/renderTreeToBuffer-CZilzyhN.js +0 -2
  288. package/dist/packem_shared/renderer-maLLQcut.js +0 -17
  289. package/dist/packem_shared/setEnableStyledLineCache-DSbMbENc.js +0 -1
  290. package/dist/packem_shared/squashTextNodesWithMap-DCdi3SZ2.js +0 -1
  291. package/dist/packem_shared/stderr-context-BzEaUICS.js +0 -1
  292. package/dist/packem_shared/stdin-context-BTaaFagk.js +0 -1
  293. package/dist/packem_shared/text-width-BU2eeTWn.js +0 -2
  294. package/dist/packem_shared/token-to-elements-BAZpNZsu.js +0 -1
  295. package/dist/packem_shared/treeViewTheme-1RIZyB4M.js +0 -1
  296. package/dist/packem_shared/useElementDimensions-qJ_WXFZ9.js +0 -1
  297. package/dist/packem_shared/useMouseAction-2dRfU1vE.js +0 -1
  298. package/dist/packem_shared/useMouseContext-C746G7kY.js +0 -1
  299. package/dist/packem_shared/useMousePosition-BTWfV4JK.js +0 -1
  300. package/dist/packem_shared/useOnMouseClick-nY8xLZmt.js +0 -1
  301. package/dist/packem_shared/useOnMouseHover-D3DczIol.js +0 -1
  302. package/dist/packem_shared/useOnMouseState-cRK8QvzD.js +0 -1
  303. package/dist/packem_shared/useTreeView-BoMMeRPq.js +0 -1
  304. package/dist/packem_shared/useTreeViewState-CRPCUWrb.js +0 -1
  305. package/dist/packem_shared/utils-CoviI5Vm.js +0 -1
  306. package/dist/packem_shared/waitFor-Dj5zfL5s.js +0 -4
  307. package/dist/packem_shared/wrapOrTruncateStyledLine-C5rcIrNb.js +0 -3
@@ -1 +1 @@
1
- var w=Object.defineProperty;var d=(l,r)=>w(l,"name",{value:r,configurable:!0});import{jsx as o,jsxs as p}from"react/jsx-runtime";import C from"../ink/hooks/use-window-size.js";import{Box as i}from"./box.js";import{Text as n}from"./text.js";var g=Object.defineProperty,b=d((l,r)=>g(l,"name",{value:r,configurable:!0}),"m");function G({character:l,color:r,dimColor:t=!1,label:h,labelPadding:u=1,length:e,orientation:m="horizontal"}){const{columns:s}=C(),a=l??(m==="horizontal"?"─":"│");if(m==="vertical"){const x=e??1;return o(i,{flexDirection:"column",height:x,children:Array.from({length:x},(j,v)=>o(n,{color:r,dimColor:t,children:a},`divider-row-${v}`))})}const c=Math.min(500,e??Math.max(s,1));if(h===void 0)return o(i,{flexGrow:e===void 0?1:0,width:e,children:o(n,{color:r,dimColor:t,wrap:"truncate",children:a.repeat(c)})});const f=" ".repeat(u);return p(i,{flexGrow:e===void 0?1:0,width:e,children:[o(i,{flexGrow:1,flexShrink:1,children:o(n,{color:r,dimColor:t,wrap:"truncate",children:a.repeat(c)})}),o(i,{flexShrink:0,children:p(n,{color:r,dimColor:t,children:[f,h,f]})}),o(i,{flexGrow:1,flexShrink:1,children:o(n,{color:r,dimColor:t,wrap:"truncate",children:a.repeat(c)})})]})}d(G,"u");b(G,"Divider");export{G as Divider,G as default};
1
+ import{jsx as r,jsxs as f}from"react/jsx-runtime";import w from"../ink/hooks/use-window-size.js";import{Box as e}from"./box.js";import{Text as t}from"./text.js";function S({character:x,color:i,dimColor:l=!1,label:a,labelPadding:s=1,length:o,orientation:d="horizontal"}){const{columns:p}=w(),n=x??(d==="horizontal"?"─":"│");if(d==="vertical"){const m=o??1;return r(e,{flexDirection:"column",height:m,children:Array.from({length:m},(v,u)=>r(t,{color:i,dimColor:l,children:n},`divider-row-${u}`))})}const c=Math.min(500,o??Math.max(p,1));if(a===void 0)return r(e,{flexGrow:o===void 0?1:0,width:o,children:r(t,{color:i,dimColor:l,wrap:"truncate",children:n.repeat(c)})});const h=" ".repeat(s);return f(e,{flexGrow:o===void 0?1:0,width:o,children:[r(e,{flexGrow:1,flexShrink:1,children:r(t,{color:i,dimColor:l,wrap:"truncate",children:n.repeat(c)})}),r(e,{flexShrink:0,children:f(t,{color:i,dimColor:l,children:[h,a,h]})}),r(e,{flexGrow:1,flexShrink:1,children:r(t,{color:i,dimColor:l,wrap:"truncate",children:n.repeat(c)})})]})}export{S as Divider,S as default};
@@ -1 +1 @@
1
- import{default as f,default as l}from"../packem_shared/FilePicker-tYj_CIau.js";export{f as FilePicker,l as default};
1
+ import{default as f,default as l}from"../packem_shared/FilePicker-BLS9nOPz.js";export{f as FilePicker,l as default};
@@ -1 +1 @@
1
- var u=Object.defineProperty;var s=(e,i)=>u(e,"name",{value:i,configurable:!0});import{jsxs as m,jsx as r}from"react/jsx-runtime";import{Box as o}from"./box.js";import{Text as d}from"./text.js";var f=Object.defineProperty,v=s((e,i)=>f(e,"name",{value:i,configurable:!0}),"s");const b=v(({children:e,description:i,error:l,isDisabled:n=!1,label:c,required:t=!1})=>m(o,{flexDirection:"column",marginBottom:1,children:[m(o,{children:[r(d,{bold:!0,dimColor:n,children:c}),t?r(d,{color:"red",children:" *"}):void 0]}),r(o,{marginTop:0,children:e}),l===void 0?i===void 0?void 0:r(d,{dimColor:!0,children:i}):r(d,{color:"red",children:l})]}),"FormField"),F=Object.assign(({accentColor:e="blue",bordered:i=!0,children:l,description:n,footer:c,title:t,width:a})=>{const h=m(o,{flexDirection:"column",children:[t===void 0?void 0:r(o,{marginBottom:1,children:r(d,{bold:!0,color:e,children:t})}),n===void 0?void 0:r(o,{marginBottom:1,children:r(d,{dimColor:!0,children:n})}),r(o,{flexDirection:"column",children:l}),c===void 0?void 0:r(o,{marginTop:1,children:c})]});return i?r(o,{borderColor:e,borderStyle:"round",flexDirection:"column",paddingX:1,paddingY:1,width:a,children:h}):r(o,{flexDirection:"column",width:a,children:h})},{Field:b});export{F as Form,b as FormField,F as default};
1
+ import{jsxs as m,jsx as r}from"react/jsx-runtime";import{Box as o}from"./box.js";import{Text as i}from"./text.js";const a=({children:e,description:d,error:l,isDisabled:n=!1,label:c,required:t=!1})=>m(o,{flexDirection:"column",marginBottom:1,children:[m(o,{children:[r(i,{bold:!0,dimColor:n,children:c}),t?r(i,{color:"red",children:" *"}):void 0]}),r(o,{marginTop:0,children:e}),l===void 0?d===void 0?void 0:r(i,{dimColor:!0,children:d}):r(i,{color:"red",children:l})]}),x=Object.assign(({accentColor:e="blue",bordered:d=!0,children:l,description:n,footer:c,title:t,width:h})=>{const s=m(o,{flexDirection:"column",children:[t===void 0?void 0:r(o,{marginBottom:1,children:r(i,{bold:!0,color:e,children:t})}),n===void 0?void 0:r(o,{marginBottom:1,children:r(i,{dimColor:!0,children:n})}),r(o,{flexDirection:"column",children:l}),c===void 0?void 0:r(o,{marginTop:1,children:c})]});return d?r(o,{borderColor:e,borderStyle:"round",flexDirection:"column",paddingX:1,paddingY:1,width:h,children:s}):r(o,{flexDirection:"column",width:h,children:s})},{Field:a});export{x as Form,a as FormField,x as default};
@@ -1 +1 @@
1
- var Z=Object.defineProperty;var x=(o,e)=>Z(o,"name",{value:e,configurable:!0});import{jsxs as j,jsx as h}from"react/jsx-runtime";import{useMemo as A}from"react";import{c as _}from"../packem_shared/braille-BBjIoaN0.js";import{Box as d}from"./box.js";import{Canvas as $}from"./canvas.js";import{Text as w}from"./text.js";var q=Object.defineProperty,v=x((o,e)=>q(o,"name",{value:e,configurable:!0}),"f");const J={large:{cols:40,rows:10},medium:{cols:24,rows:6},small:{cols:16,rows:4}},R=.9,oo=2,ro=v(o=>String(Math.round(o)),"defaultFormat"),G=v((o,e,s,a)=>{const t=e+(s-e)*a;for(const f of o)if(t<=f.max)return f;return o[o.length-1]},"thresholdAtRatio");function to({backgroundColor:o="gray",formatValue:e=ro,label:s,max:a=100,min:t=0,showLegend:f=!1,showValue:P=!0,size:B="medium",thresholds:n,value:D}){const{cols:O,rows:T}=J[B],F=Math.max(t,Math.min(a,D)),E=a-t||1,M=(F-t)/E,m=A(()=>{if(!(n===void 0||n.length===0))return[...n].toSorted((r,c)=>r.max-c.max)},[n]),I=A(()=>{if(m!==void 0)return G(m,t,a,M)},[m,t,a,M]),H=e(F);return j(d,{flexDirection:"column",children:[h($,{draw:x(r=>{r.clear();const c=r.width*2,L=r.height*4,y=c/2,C=L-1,K=c/2-1,N=L-1,g=Math.max(1,Math.min(K,N)),b=new Map,S=v(i=>{const l=b.get(i);if(l!==void 0)return l;const u=_(r.width,r.height);return b.set(i,u),u},"gridFor"),V=Math.max(32,Math.round(Math.PI*g)*oo);for(let i=0;i<=V;i+=1){const l=i/V,u=Math.PI*(1-l),X=Math.round(y+g*Math.cos(u)),Y=Math.round(C-g*Math.sin(u));let p;l>M?p=o:m?p=G(m,t,a,l)?.color??"cyan":p="cyan",S(p).plotPoint(X,Y)}const k=g*R,z=Math.PI*(1-M),Q=Math.round(y+k*Math.cos(z)),U=Math.round(C-k*Math.sin(z)),W=I?.color??"white";S(W).plotLine(Math.round(y),Math.round(C),Q,U);for(const[i,l]of b)l.flush(r,{color:i})},"draw"),height:T,version:[D,t,a,B,n,o],width:O}),P||s?j(d,{flexDirection:"column",children:[s===void 0?void 0:h(d,{justifyContent:"center",children:h(w,{dimColor:!0,children:s})}),P?h(d,{justifyContent:"center",children:h(w,{bold:!0,color:I?.color??"white",children:H})}):void 0]}):void 0,f&&n&&n.length>0?h(d,{gap:2,justifyContent:"center",marginTop:1,children:n.map((r,c)=>j(d,{gap:1,children:[h(w,{color:r.color,children:"●"}),h(w,{dimColor:!0,children:r.label??`≤ ${r.max}`})]},c))}):void 0]})}x(to,"j");v(to,"Gauge");export{to as Gauge,to as default};
1
+ import{jsxs as C,jsx as l}from"react/jsx-runtime";import{useMemo as q}from"react";import{c as T}from"../packem_shared/braille-ch3O5D7I.js";import{Box as s}from"./box.js";import{Canvas as U}from"./canvas.js";import{Text as x}from"./text.js";const W={large:{cols:40,rows:10},medium:{cols:24,rows:6},small:{cols:16,rows:4}},X=.9,_=2,Y=r=>String(Math.round(r)),z=(r,m,c,e)=>{const t=m+(c-m)*e;for(const f of r)if(t<=f.max)return f;return r[r.length-1]};function no({backgroundColor:r="gray",formatValue:m=Y,label:c,max:e=100,min:t=0,showLegend:f=!1,showValue:j=!0,size:b="medium",thresholds:n,value:P}){const{cols:A,rows:E}=W[b],I=Math.max(t,Math.min(e,P)),F=e-t||1,M=(I-t)/F,d=q(()=>{if(!(n===void 0||n.length===0))return[...n].toSorted((o,h)=>o.max-h.max)},[n]),k=q(()=>{if(d!==void 0)return z(d,t,e,M)},[d,t,e,M]),G=m(I);return C(s,{flexDirection:"column",children:[l(U,{draw:o=>{o.clear();const h=o.width*2,B=o.height*4,w=h/2,v=B-1,H=h/2-1,J=B-1,g=Math.max(1,Math.min(H,J)),y=new Map,D=i=>{const a=y.get(i);if(a!==void 0)return a;const u=T(o.width,o.height);return y.set(i,u),u},L=Math.max(32,Math.round(Math.PI*g)*_);for(let i=0;i<=L;i+=1){const a=i/L,u=Math.PI*(1-a),Q=Math.round(w+g*Math.cos(u)),R=Math.round(v-g*Math.sin(u));let p;a>M?p=r:d?p=z(d,t,e,a)?.color??"cyan":p="cyan",D(p).plotPoint(Q,R)}const S=g*X,V=Math.PI*(1-M),K=Math.round(w+S*Math.cos(V)),N=Math.round(v-S*Math.sin(V)),O=k?.color??"white";D(O).plotLine(Math.round(w),Math.round(v),K,N);for(const[i,a]of y)a.flush(o,{color:i})},height:E,version:[P,t,e,b,n,r],width:A}),j||c?C(s,{flexDirection:"column",children:[c===void 0?void 0:l(s,{justifyContent:"center",children:l(x,{dimColor:!0,children:c})}),j?l(s,{justifyContent:"center",children:l(x,{bold:!0,color:k?.color??"white",children:G})}):void 0]}):void 0,f&&n&&n.length>0?l(s,{gap:2,justifyContent:"center",marginTop:1,children:n.map((o,h)=>C(s,{gap:1,children:[l(x,{color:o.color,children:"●"}),l(x,{dimColor:!0,children:o.label??`≤ ${o.max}`})]},h))}):void 0]})}export{no as Gauge,no as default};
@@ -1 +1 @@
1
- var D=Object.defineProperty;var y=(o,e)=>D(o,"name",{value:e,configurable:!0});import{jsx as c,Fragment as K}from"react/jsx-runtime";import{strip as N}from"@visulima/ansi";import{multilineGradient as G}from"@visulima/colorize/gradient";import{useMemo as F,Children as x,isValidElement as P,cloneElement as v}from"react";import{Box as B}from"./box.js";import{Text as O}from"./text.js";import{Transform as g}from"./transform.js";var M=Object.defineProperty,n=y((o,e)=>M(o,"name",{value:e,configurable:!0}),"o");const k={atlas:{colors:["#feac5e","#c779d0","#4bc0c8"]},cristal:{colors:["#bdfff3","#4ac29a"]},fruit:{colors:["#ff4e50","#f9d423"]},instagram:{colors:["#833ab4","#fd1d1d","#fcb045"]},mind:{colors:["#473b7b","#3584a7","#30d2be"]},morning:{colors:["#ff5f6d","#ffc371"],options:{interpolation:"hsv"}},passion:{colors:["#f43b47","#453a94"]},pastel:{colors:["#74ebd5","#74ecd5"],options:{hsvSpin:"long",interpolation:"hsv"}},rainbow:{colors:["#ff0000","#ff0100"],options:{hsvSpin:"long",interpolation:"hsv"}},retro:{colors:["#3f51b1","#5a55ae","#7b5fac","#8f6aae","#a86aa4","#cc6b8e","#f18271","#f3a469","#f7c978"]},summer:{colors:["#fdbb2d","#22c1c3"]},teen:{colors:["#77a1d3","#79cbca","#e684ae"]},vice:{colors:["#5ee7df","#b490ca"],options:{interpolation:"hsv"}}},C=n(o=>{let e=!1;const t=n(h=>{x.forEach(h,s=>{if(e||!P(s))return;if(s.type===B){e=!0;return}const f=s.props;Object.hasOwn(f,"children")&&t(f.children)})},"search");return t(o),e},"containsBoxDescendant"),j=n(o=>Object.hasOwn(o,"children"),"hasChildrenProp"),S=n(o=>typeof o=="string"||typeof o=="number","isPlainTextNode"),R=n(o=>o==null||typeof o=="boolean","isNonRenderableChild");function V({children:o,colors:e,name:t}){if(t&&e)throw new Error("The `name` and `colors` props are mutually exclusive");if(!t&&!e)throw new Error("Either `name` or `colors` prop must be provided");const h=F(()=>t?G(k[t].colors,k[t].options):G(e??[]),[t,e]),s=n(b=>h(N(b)),"applyGradient"),f=x.count(o);if(S(o))return c(g,{transform:s,children:o});if(f===1&&!C(o))return c(g,{transform:s,children:o});const m=n(b=>{const a=[];let l="",w=0;const E=n(()=>{const r=`gradient-node-${String(w)}`;return w+=1,r},"createKey"),p=n((r,i)=>{a.push(c(g,{transform:s,children:r},i))},"pushTransformed"),T=n(()=>{if(l==="")return;const r=l;l="",p(c(O,{children:r}),E())},"flushText");return x.forEach(b,r=>{if(!R(r)){if(S(r)){l+=String(r);return}if(T(),P(r)){const i=r.key??E(),d=r.props;if(r.type===O){p(r,i);return}if(r.type===B){if(j(d)){const u=d.children;a.push(v(r,{key:i},m(u)));return}a.push(v(r,{key:i}));return}if(j(d)){const u=d.children;if(!C(u)){p(r,i);return}a.push(v(r,{key:i},m(u)));return}p(r,i);return}a.push(r)}}),T(),a},"applyGradientToChildren");return c(K,{children:m(o)})}y(V,"K");n(V,"Gradient");export{V as Gradient,V as default};
1
+ import{jsx as c,Fragment as C}from"react/jsx-runtime";import{strip as F}from"@visulima/ansi";import{multilineGradient as k}from"@visulima/colorize/gradient";import{useMemo as M,Children as g,isValidElement as G,cloneElement as b}from"react";import{Box as B}from"./box.js";import{Text as x}from"./text.js";import{Transform as y}from"./transform.js";const S={atlas:{colors:["#feac5e","#c779d0","#4bc0c8"]},cristal:{colors:["#bdfff3","#4ac29a"]},fruit:{colors:["#ff4e50","#f9d423"]},instagram:{colors:["#833ab4","#fd1d1d","#fcb045"]},mind:{colors:["#473b7b","#3584a7","#30d2be"]},morning:{colors:["#ff5f6d","#ffc371"],options:{interpolation:"hsv"}},passion:{colors:["#f43b47","#453a94"]},pastel:{colors:["#74ebd5","#74ecd5"],options:{hsvSpin:"long",interpolation:"hsv"}},rainbow:{colors:["#ff0000","#ff0100"],options:{hsvSpin:"long",interpolation:"hsv"}},retro:{colors:["#3f51b1","#5a55ae","#7b5fac","#8f6aae","#a86aa4","#cc6b8e","#f18271","#f3a469","#f7c978"]},summer:{colors:["#fdbb2d","#22c1c3"]},teen:{colors:["#77a1d3","#79cbca","#e684ae"]},vice:{colors:["#5ee7df","#b490ca"],options:{interpolation:"hsv"}}},O=o=>{let t=!1;const n=u=>{g.forEach(u,s=>{if(t||!G(s))return;if(s.type===B){t=!0;return}const f=s.props;Object.hasOwn(f,"children")&&n(f.children)})};return n(o),t},T=o=>Object.hasOwn(o,"children"),j=o=>typeof o=="string"||typeof o=="number",N=o=>o==null||typeof o=="boolean";function J({children:o,colors:t,name:n}){if(n&&t)throw new Error("The `name` and `colors` props are mutually exclusive");if(!n&&!t)throw new Error("Either `name` or `colors` prop must be provided");const u=M(()=>n?k(S[n].colors,S[n].options):k(t??[]),[n,t]),s=h=>u(F(h)),f=g.count(o);if(j(o))return c(y,{transform:s,children:o});if(f===1&&!O(o))return c(y,{transform:s,children:o});const m=h=>{const i=[];let a="",v=0;const w=()=>{const r=`gradient-node-${String(v)}`;return v+=1,r},l=(r,e)=>{i.push(c(y,{transform:s,children:r},e))},E=()=>{if(a==="")return;const r=a;a="",l(c(x,{children:r}),w())};return g.forEach(h,r=>{if(!N(r)){if(j(r)){a+=String(r);return}if(E(),G(r)){const e=r.key??w(),p=r.props;if(r.type===x){l(r,e);return}if(r.type===B){if(T(p)){const d=p.children;i.push(b(r,{key:e},m(d)));return}i.push(b(r,{key:e}));return}if(T(p)){const d=p.children;if(!O(d)){l(r,e);return}i.push(b(r,{key:e},m(d)));return}l(r,e);return}i.push(r)}}),E(),i};return c(C,{children:m(o)})}export{J as Gradient,J as default};
@@ -1 +1 @@
1
- var l=Object.defineProperty;var o=(e,r)=>l(e,"name",{value:r,configurable:!0});import{jsx as a,jsxs as c}from"react/jsx-runtime";import{Box as s}from"./box.js";import{Text as d}from"./text.js";var u=Object.defineProperty,f=o((e,r)=>u(e,"name",{value:r,configurable:!0}),"t");const g={1:"blueBright",2:"cyanBright",3:"magentaBright",4:"yellowBright",5:"green",6:"white"},m={1:"# ",2:"## ",3:"### ",4:"#### ",5:"##### ",6:"###### "};function h({children:e,color:r,level:n=1,underline:t=!1}){const i=r??g[n];return a(s,{flexDirection:"column",children:c(d,{bold:n<=2,color:i,underline:t,children:[m[n],e]})})}o(h,"n");f(h,"Heading");export{h as Heading,h as default};
1
+ import{jsx as l,jsxs as t}from"react/jsx-runtime";import{Box as c}from"./box.js";import{Text as a}from"./text.js";const s={1:"blueBright",2:"cyanBright",3:"magentaBright",4:"yellowBright",5:"green",6:"white"},d={1:"# ",2:"## ",3:"### ",4:"#### ",5:"##### ",6:"###### "};function g({children:e,color:o,level:r=1,underline:n=!1}){const i=o??s[r];return l(c,{flexDirection:"column",children:t(a,{bold:r<=2,color:i,underline:n,children:[d[r],e]})})}export{g as Heading,g as default};
@@ -1 +1 @@
1
- var T=Object.defineProperty;var v=(r,l)=>T(r,"name",{value:l,configurable:!0});import{jsxs as j,jsx as c}from"react/jsx-runtime";import{useMemo as k}from"react";import{Box as s}from"./box.js";import{Canvas as B}from"./canvas.js";import{Text as y}from"./text.js";var E=Object.defineProperty,O=v((r,l)=>E(r,"name",{value:l,configurable:!0}),"A");const P=["#0b1e4f","#1f3b96","#3258c8","#4e84ec","#78b0ff"];function R({cellWidth:r=2,character:l="█",columnLabels:g,data:n,max:d,min:m,palette:x=P,rowLabels:w,textColor:D}){const{cols:C,colWidth:f,extent:L,rows:p}=k(()=>{const t=n.length,e=n.reduce((a,o)=>Math.max(a,o.length),0);let i=m??1/0,h=d??-1/0;if(m===void 0||d===void 0)for(const a of n)for(const o of a)m===void 0&&o<i&&(i=o),d===void 0&&o>h&&(h=o);return{cols:e,colWidth:r,extent:{max:h,min:i},rows:t}},[n,m,d,r]),W=C*f,A=p;return j(s,{children:[w===void 0?void 0:c(s,{flexDirection:"column",marginRight:1,children:Array.from({length:p},(t,e)=>c(y,{dimColor:!0,children:w[e]??""},e))}),j(s,{flexDirection:"column",children:[c(B,{draw:v(t=>{t.clear();const{max:e,min:i}=L,h=e-i||1,a=x.length-1;for(let o=0;o<p;o+=1)for(let u=0;u<C;u+=1){const M=n[o]?.[u],H=M===void 0?void 0:x[Math.max(0,Math.min(a,Math.round((M-i)/h*a)))];for(let b=0;b<f;b+=1)t.setCell(u*f+b,o,l,{background:H,color:D})}},"draw"),height:A,version:[n,x,r,m,d],width:W}),g===void 0?void 0:c(s,{children:g.map((t,e)=>c(s,{width:f,children:c(y,{dimColor:!0,wrap:"truncate-end",children:t})},e))})]})]})}v(R,"T");O(R,"Heatmap");export{R as Heatmap,R as default};
1
+ import{jsxs as C,jsx as a}from"react/jsx-runtime";import{useMemo as R}from"react";import{Box as m}from"./box.js";import{Canvas as A}from"./canvas.js";import{Text as M}from"./text.js";const B=["#0b1e4f","#1f3b96","#3258c8","#4e84ec","#78b0ff"];function G({cellWidth:s=2,character:k="█",columnLabels:p,data:t,max:c,min:l,palette:x=B,rowLabels:w,textColor:L}){const{cols:g,colWidth:f,extent:W,rows:u}=R(()=>{const e=t.length,r=t.reduce((n,o)=>Math.max(n,o.length),0);let i=l??1/0,d=c??-1/0;if(l===void 0||c===void 0)for(const n of t)for(const o of n)l===void 0&&o<i&&(i=o),c===void 0&&o>d&&(d=o);return{cols:r,colWidth:s,extent:{max:d,min:i},rows:e}},[t,l,c,s]),j=g*f,D=u;return C(m,{children:[w===void 0?void 0:a(m,{flexDirection:"column",marginRight:1,children:Array.from({length:u},(e,r)=>a(M,{dimColor:!0,children:w[r]??""},r))}),C(m,{flexDirection:"column",children:[a(A,{draw:e=>{e.clear();const{max:r,min:i}=W,d=r-i||1,n=x.length-1;for(let o=0;o<u;o+=1)for(let h=0;h<g;h+=1){const b=t[o]?.[h],H=b===void 0?void 0:x[Math.max(0,Math.min(n,Math.round((b-i)/d*n)))];for(let v=0;v<f;v+=1)e.setCell(h*f+v,o,k,{background:H,color:L})}},height:D,version:[t,x,s,l,c],width:j}),p===void 0?void 0:a(m,{children:p.map((e,r)=>a(m,{width:f,children:a(M,{dimColor:!0,wrap:"truncate-end",children:e})},r))})]})]})}export{G as Heatmap,G as default};
@@ -1 +1 @@
1
- var j=Object.defineProperty;var p=(o,r)=>j(o,"name",{value:r,configurable:!0});import{jsx as n,jsxs as x}from"react/jsx-runtime";import D from"../ink/hooks/use-window-size.js";import{Box as u}from"./box.js";import{Text as i}from"./text.js";var v=Object.defineProperty,h=p((o,r)=>v(o,"name",{value:r,configurable:!0}),"u");const g={backspace:"backspace",delete:"del",downArrow:"↓",end:"end",escape:"esc",home:"home",leftArrow:"←",pageDown:"pgdn",pageUp:"pgup",return:"enter",rightArrow:"→",tab:"tab",upArrow:"↑"};function y(o){const r=o.indexOf("+");if(r!==-1){const e=o.slice(0,r),t=o.slice(r+1);return`${e}+${g[t]??t}`}return g[o]??o}p(y,"w");h(y,"formatKeyLabel");function C(o){return(typeof o=="string"?[o]:o).map(r=>y(r)).join("/")}p(C,"x");h(C,"formatKeys");function M({bindings:o,descriptionColor:r,keyColor:e="cyan",maxColumns:t=3,mode:l="short",separator:s=" · "}){const{columns:d}=D();return l==="full"?w(o,{columns:d,descriptionColor:r,keyColor:e,maxColumns:t}):b(o,{columns:d,descriptionColor:r,keyColor:e,separator:s})}p(M,"h");h(M,"Help");function b(o,r){const e=[];let t=0;for(const[l,s]of o.entries()){const d=C(s.key),a=`${d} ${s.description}`,c=(l>0?r.separator.length:0)+a.length;if(t+c>r.columns&&e.length>0)break;l>0&&e.push(n(i,{dimColor:!0,children:r.separator},`sep-${l}`)),e.push(x(u,{children:[n(i,{color:r.keyColor,children:d}),n(i,{children:" "}),r.descriptionColor?n(i,{color:r.descriptionColor,children:s.description}):n(i,{dimColor:!0,children:s.description})]},`pair-${l}`)),t+=c}return n(u,{flexDirection:"row",children:e})}p(b,"T");h(b,"renderShort");function w(o,r){const e=new Map;for(const a of o){const c=a.group??"";e.has(c)||e.set(c,[]),e.get(c).push(a)}const t=[...e.entries()],l=Math.min(r.maxColumns,t.length||1),s=Math.floor(r.columns/l),d=[];for(const[a,[c,$]]of t.entries()){const f=[];c&&f.push(n(i,{bold:!0,children:c},"title"));for(const[k,m]of $.entries()){const A=C(m.key);f.push(x(u,{children:[n(i,{color:r.keyColor,children:A}),n(i,{children:" "}),r.descriptionColor?n(i,{color:r.descriptionColor,children:m.description}):n(i,{dimColor:!0,children:m.description})]},`b-${k}`))}d.push(n(u,{flexDirection:"column",width:s,children:f},`col-${a}`))}return n(u,{flexDirection:"row",children:d})}p(w,"A");h(w,"renderFull");export{M as Help,M as default};
1
+ import{jsx as e,jsxs as m}from"react/jsx-runtime";import w from"../ink/hooks/use-window-size.js";import{Box as a}from"./box.js";import{Text as i}from"./text.js";const f={backspace:"backspace",delete:"del",downArrow:"↓",end:"end",escape:"esc",home:"home",leftArrow:"←",pageDown:"pgdn",pageUp:"pgup",return:"enter",rightArrow:"→",tab:"tab",upArrow:"↑"};function y(r){const o=r.indexOf("+");if(o!==-1){const n=r.slice(0,o),t=r.slice(o+1);return`${n}+${f[t]??t}`}return f[r]??r}function C(r){return(typeof r=="string"?[r]:r).map(o=>y(o)).join("/")}function B({bindings:r,descriptionColor:o,keyColor:n="cyan",maxColumns:t=3,mode:s="short",separator:l=" · "}){const{columns:p}=w();return s==="full"?$(r,{columns:p,descriptionColor:o,keyColor:n,maxColumns:t}):b(r,{columns:p,descriptionColor:o,keyColor:n,separator:l})}function b(r,o){const n=[];let t=0;for(const[s,l]of r.entries()){const p=C(l.key),d=`${p} ${l.description}`,c=(s>0?o.separator.length:0)+d.length;if(t+c>o.columns&&n.length>0)break;s>0&&n.push(e(i,{dimColor:!0,children:o.separator},`sep-${s}`)),n.push(m(a,{children:[e(i,{color:o.keyColor,children:p}),e(i,{children:" "}),o.descriptionColor?e(i,{color:o.descriptionColor,children:l.description}):e(i,{dimColor:!0,children:l.description})]},`pair-${s}`)),t+=c}return e(a,{flexDirection:"row",children:n})}function $(r,o){const n=new Map;for(const d of r){const c=d.group??"";n.has(c)||n.set(c,[]),n.get(c).push(d)}const t=[...n.entries()],s=Math.min(o.maxColumns,t.length||1),l=Math.floor(o.columns/s),p=[];for(const[d,[c,g]]of t.entries()){const u=[];c&&u.push(e(i,{bold:!0,children:c},"title"));for(const[x,h]of g.entries()){const k=C(h.key);u.push(m(a,{children:[e(i,{color:o.keyColor,children:k}),e(i,{children:" "}),o.descriptionColor?e(i,{color:o.descriptionColor,children:h.description}):e(i,{dimColor:!0,children:h.description})]},`b-${x}`))}p.push(e(a,{flexDirection:"column",width:l,children:u},`col-${d}`))}return e(a,{flexDirection:"row",children:p})}export{B as Help,B as default};
@@ -1 +1 @@
1
- var b=Object.defineProperty;var c=(o,t)=>b(o,"name",{value:t,configurable:!0});import{jsx as p}from"react/jsx-runtime";import{useMemo as v}from"react";import{BarChart as w}from"./bar-chart.js";var y=Object.defineProperty,m=c((o,t)=>y(o,"name",{value:t,configurable:!0}),"c");const x=m((o,t,r)=>{if(r<=0||o>=t)return[o,t];const h=(t-o)/r;return Array.from({length:r+1},(n,e)=>o+e*h)},"computeThresholds"),g=m((o,t)=>{if(t.length<2)return[];const r=Array.from({length:t.length-1}).fill(0),h=t[0],n=t[t.length-1];for(const e of o)if(!(e<h||e>n))for(let a=0;a<t.length-1;a+=1){const l=a===t.length-2,s=t[a+1];if(e<s||l&&e<=s){r[a]=(r[a]??0)+1;break}}return r.map((e,a)=>{const l=t[a],s=t[a+1];return{count:e,label:`${Math.round(l)}-${Math.round(s)}`}})},"binData");function M({bins:o=10,color:t,data:r,height:h=10,max:n,min:e,showValues:a=!1,thresholds:l,width:s}){const d=v(()=>{if(l&&l.length>=2)return g(r,l);if(r.length===0)return[];let i=e??1/0,u=n??-1/0;if(e===void 0||n===void 0)for(const f of r)e===void 0&&f<i&&(i=f),n===void 0&&f>u&&(u=f);return i===u?[{count:r.length,label:i.toString()}]:g(r,x(i,u,o))},[r,l,o,e,n]);return p(w,{data:d.map(i=>({color:t,label:i.label,value:i.count})),height:h,orientation:"vertical",showLabels:!0,showValues:a,width:s})}c(M,"s");m(M,"Histogram");export{M as Histogram,M as default};
1
+ import{jsx as g}from"react/jsx-runtime";import{useMemo as d}from"react";import{BarChart as b}from"./bar-chart.js";const p=(l,t,o)=>{if(o<=0||l>=t)return[l,t];const s=(t-l)/o;return Array.from({length:o+1},(n,r)=>l+r*s)},c=(l,t)=>{if(t.length<2)return[];const o=Array.from({length:t.length-1}).fill(0),s=t[0],n=t[t.length-1];for(const r of l)if(!(r<s||r>n))for(let e=0;e<t.length-1;e+=1){const a=e===t.length-2,h=t[e+1];if(r<h||a&&r<=h){o[e]=(o[e]??0)+1;break}}return o.map((r,e)=>{const a=t[e],h=t[e+1];return{count:r,label:`${Math.round(a)}-${Math.round(h)}`}})};function x({bins:l=10,color:t,data:o,height:s=10,max:n,min:r,showValues:e=!1,thresholds:a,width:h}){const m=d(()=>{if(a&&a.length>=2)return c(o,a);if(o.length===0)return[];let i=r??1/0,f=n??-1/0;if(r===void 0||n===void 0)for(const u of o)r===void 0&&u<i&&(i=u),n===void 0&&u>f&&(f=u);return i===f?[{count:o.length,label:i.toString()}]:c(o,p(i,f,l))},[o,a,l,r,n]);return g(b,{data:m.map(i=>({color:t,label:i.label,value:i.count})),height:s,orientation:"vertical",showLabels:!0,showValues:e,width:h})}export{x as Histogram,x as default};
@@ -1 +1 @@
1
- var a=Object.defineProperty;var e=(r,o)=>a(r,"name",{value:o,configurable:!0});import{jsxs as i,jsx as l}from"react/jsx-runtime";import{Box as t}from"./box.js";import{Text as d}from"./text.js";var c=Object.defineProperty,u=e((r,o)=>c(r,"name",{value:o,configurable:!0}),"l");function s({children:r,color:o="gray",variant:n="solid"}){return n==="solid"?i(d,{backgroundColor:o,color:"black",children:[" ",r," "]}):n==="outline"?l(t,{borderColor:o,borderStyle:"round",paddingX:1,children:l(d,{color:o,children:r})}):l(d,{dimColor:!0,children:r})}e(s,"n");u(s,"Kbd");export{s as Kbd,s as default};
1
+ import{jsxs as i,jsx as l}from"react/jsx-runtime";import{Box as n}from"./box.js";import{Text as d}from"./text.js";function s({children:r,color:o="gray",variant:e="solid"}){return e==="solid"?i(d,{backgroundColor:o,color:"black",children:[" ",r," "]}):e==="outline"?l(n,{borderColor:o,borderStyle:"round",paddingX:1,children:l(d,{color:o,children:r})}):l(d,{dimColor:!0,children:r})}export{s as Kbd,s as default};
@@ -1 +1 @@
1
- import"react/jsx-runtime";import"react";import"../packem_shared/braille-BBjIoaN0.js";import"./box.js";import"./canvas.js";import{f as s,f,d as n,a as d}from"../packem_shared/line-chart-kf7uhR0K.js";import"./text.js";export{s as LineChart,f as default,n as drawSeriesOnCanvas,d as projectPoint};
1
+ import"react/jsx-runtime";import"react";import"../packem_shared/braille-ch3O5D7I.js";import"./box.js";import"./canvas.js";import{h as s,h as n,d,a as h}from"../packem_shared/line-chart-C7CUrvVs.js";import"./text.js";export{s as LineChart,n as default,d as drawSeriesOnCanvas,h as projectPoint};
@@ -1 +1 @@
1
- var a=Object.defineProperty;var o=(r,e)=>a(r,"name",{value:e,configurable:!0});import{jsx as u}from"react/jsx-runtime";import{hyperlink as f}from"@visulima/ansi";import{useCallback as l}from"react";import{Text as m}from"./text.js";import{Transform as R}from"./transform.js";var v=Object.defineProperty,i=o((r,e)=>v(r,"name",{value:e,configurable:!0}),"s");let p;const d=i(()=>{if(!process.stdout.isTTY)return!1;const r=process.env.TERM_PROGRAM??"",e=process.env.TERM_PROGRAM_VERSION??"";if(r==="iTerm.app")return Number.parseInt(e.split(".")[0]??"0",10)>=3;if(r==="WezTerm"||r==="ghostty")return!0;if(r==="vscode"){const s=e.split("."),n=Number.parseInt(s[0]??"0",10),c=Number.parseInt(s[1]??"0",10);return n>1||n===1&&c>=72}if(process.env.WT_SESSION)return!0;const t=process.env.VTE_VERSION;if(t){const s=Number.parseInt(t,10);return s>=5e3&&s!==5e3}return!1},"detectHyperlinkSupport"),E=i(()=>process.env.FORCE_HYPERLINK?process.env.FORCE_HYPERLINK!=="0":(p!==void 0||(p=d()),p),"supportsHyperlinks");function T({children:r,fallback:e=!0,url:t}){const s=l(n=>E()?f(n,t):e===!1?n:typeof e=="function"?e(n,t):`${n} ${t}`,[e,t]);return u(R,{transform:s,children:u(m,{children:r})})}o(T,"u");i(T,"Link");export{T as Link,T as default};
1
+ import{jsx as i}from"react/jsx-runtime";import{hyperlink as u}from"@visulima/ansi";import{useCallback as c}from"react";import{Text as f}from"./text.js";import{Transform as a}from"./transform.js";let n;const m=()=>{if(!process.stdout.isTTY)return!1;const o=process.env.TERM_PROGRAM??"",r=process.env.TERM_PROGRAM_VERSION??"";if(o==="iTerm.app")return Number.parseInt(r.split(".")[0]??"0",10)>=3;if(o==="WezTerm"||o==="ghostty")return!0;if(o==="vscode"){const s=r.split("."),t=Number.parseInt(s[0]??"0",10),p=Number.parseInt(s[1]??"0",10);return t>1||t===1&&p>=72}if(process.env.WT_SESSION)return!0;const e=process.env.VTE_VERSION;if(e){const s=Number.parseInt(e,10);return s>=5e3&&s!==5e3}return!1},l=()=>process.env.FORCE_HYPERLINK?process.env.FORCE_HYPERLINK!=="0":(n!==void 0||(n=m()),n);function v({children:o,fallback:r=!0,url:e}){const s=c(t=>l()?u(t,e):r===!1?t:typeof r=="function"?r(t,e):`${t} ${e}`,[r,e]);return i(a,{transform:s,children:i(f,{children:o})})}export{v as Link,v as default};
@@ -1 +1 @@
1
- var t=Object.defineProperty;var i=(r,o)=>t(r,"name",{value:o,configurable:!0});import{jsxs as c,jsx as n}from"react/jsx-runtime";import{Box as d}from"./box.js";import{Spinner as l}from"./spinner.js";import{Text as a}from"./text.js";var p=Object.defineProperty,m=i((r,o)=>p(r,"name",{value:o,configurable:!0}),"t");function s({children:r,color:o="cyan",type:e="dots"}){return c(d,{gap:1,children:[n(a,{color:o,children:n(l,{type:e})}),r===void 0?void 0:n(a,{color:o,children:r})]})}i(s,"i");m(s,"LoadingIndicator");export{s as LoadingIndicator,s as default};
1
+ import{jsxs as a,jsx as o}from"react/jsx-runtime";import{Box as c}from"./box.js";import{Spinner as d}from"./spinner.js";import{Text as i}from"./text.js";function m({children:r,color:n="cyan",type:t="dots"}){return a(c,{gap:1,children:[o(i,{color:n,children:o(d,{type:t})}),r===void 0?void 0:o(i,{color:n,children:r})]})}export{m as LoadingIndicator,m as default};
@@ -1 +1 @@
1
- var j=Object.defineProperty;var u=(c,t)=>j(c,"name",{value:t,configurable:!0});import{jsx as r,jsxs as w}from"react/jsx-runtime";import{Lexer as B}from"marked";import b,{useMemo as L}from"react";import D from"../ink/hooks/use-window-size.js";import{Box as l}from"./box.js";import{Code as W}from"./code.js";import{Link as $}from"./link.js";import{Newline as C}from"./newline.js";import{OrderedList as q}from"./ordered-list.js";import{Table as I}from"./table.js";import{Text as m}from"./text.js";import{UnorderedList as O}from"./unordered-list.js";var A=Object.defineProperty,g=u((c,t)=>A(c,"name",{value:t,configurable:!0}),"g");const E={1:"cyan",2:"green",3:"yellow",4:"blue",5:"magenta",6:"gray"};function h(c){return!c||c.length===0?null:c.map((t,n)=>{switch(t.type){case"br":return r(C,{},n);case"codespan":return w(m,{inverse:!0,children:[" ",t.text," "]},n);case"del":return r(m,{strikethrough:!0,children:h(t.tokens)},n);case"em":return r(m,{italic:!0,children:h(t.tokens)},n);case"escape":return r(b.Fragment,{children:t.text},n);case"image":{const e=t;return w(m,{dimColor:!0,children:["[image:"," ",e.text||e.href,"]"]},n)}case"link":{const e=t;return r($,{url:e.href,children:h(e.tokens)??e.text},n)}case"strong":return r(m,{bold:!0,children:h(t.tokens)},n);case"text":return r(b.Fragment,{children:t.text},n);default:{const e="raw"in t?t.raw:"";return r(b.Fragment,{children:e},n)}}})}u(h,"l");g(h,"renderInlineTokens");function T(c){return c.map(t=>{const n=t.tokens??[],e=n.find(i=>i.type==="text"),o=h(e?.tokens??n),p=n.find(i=>i.type==="list");return{children:p?T(p.items):void 0,label:o}})}u(T,"w");g(T,"mapListItems");function y(c,t,n){const e=[];for(const[o,p]of c.entries()){const i=p,s=o>0?1:0;switch(i.type){case"blockquote":{const a=i;e.push(r(l,{borderLeft:!0,borderLeftColor:"gray",marginTop:s,paddingLeft:1,children:r(l,{flexDirection:"column",children:y(a.tokens,t,n-3)})},o));break}case"code":{const a=i;e.push(r(l,{marginTop:s,children:r(W,{code:a.text,language:a.lang,theme:t})},o));break}case"heading":{const a=i,d=E[a.depth]??"white",x=`${"#".repeat(a.depth)} `;e.push(r(l,{marginTop:s,children:w(m,{bold:!0,color:d,children:[x,h(a.tokens)]})},o));break}case"hr":{e.push(r(l,{marginTop:s,children:r(m,{dimColor:!0,children:"─".repeat(Math.min(n,40))})},o));break}case"html":{const a=i.text.replaceAll(/<[^>]*>/g,"");a.trim()&&e.push(r(l,{marginTop:s,children:r(m,{dimColor:!0,children:a})},o));break}case"list":{const a=i,d=T(a.items);a.ordered?e.push(r(l,{marginTop:s,children:r(q,{items:d})},o)):e.push(r(l,{marginTop:s,children:r(O,{items:d})},o));break}case"paragraph":{const a=i;e.push(r(l,{marginTop:s,children:r(m,{wrap:"wrap",children:h(a.tokens)})},o));break}case"space":{e.push(r(C,{},o));break}case"table":{const a=i,d=(a.header??[]).map(f=>f.text),x=(a.rows??[]).map(f=>f.map(k=>k.text)).map(f=>{const k={};return d.forEach((F,M)=>{k[F]=f[M]??""}),k});e.push(r(l,{marginTop:s,children:r(I,{data:x})},o));break}default:{const a="raw"in i?i.raw:"",d="text"in i?i.text:a;d&&e.push(r(l,{marginTop:s,children:r(m,{children:d})},o));break}}}return e}u(y,"L");g(y,"renderBlockTokens");function v(c,t){const n=B.lex(c);if(!t||c.length===0)return n;let e=0;for(const o of n)e+=o.raw?.length??0;if(e<c.length){const o=c.slice(e);o.trim().length>0&&n.push({raw:o,text:o,tokens:[{raw:o,text:o,type:"text"}],type:"paragraph"})}return n}u(v,"q");g(v,"lexWithStreamingFallback");function N({children:c,codeTheme:t="github-dark-default",maxWidth:n,streaming:e=!1}){const{columns:o}=D(),p=n??o??80,i=L(()=>v(c,e),[c,e]),s=L(()=>y(i,t,p),[i,t,p]);return r(l,{flexDirection:"column",children:s})}u(N,"B");g(N,"Markdown");export{N as Markdown,N as default};
1
+ import{jsx as r,jsxs as x}from"react/jsx-runtime";import{Lexer as C}from"marked";import k,{useMemo as b}from"react";import D from"../ink/hooks/use-window-size.js";import{Box as l}from"./box.js";import{Code as F}from"./code.js";import{Link as M}from"./link.js";import{Newline as w}from"./newline.js";import{OrderedList as j}from"./ordered-list.js";import{Table as v}from"./table.js";import{Text as m}from"./text.js";import{UnorderedList as B}from"./unordered-list.js";const q={1:"cyan",2:"green",3:"yellow",4:"blue",5:"magenta",6:"gray"};function p(c){return!c||c.length===0?null:c.map((a,t)=>{switch(a.type){case"br":return r(w,{},t);case"codespan":return x(m,{inverse:!0,children:[" ",a.text," "]},t);case"del":return r(m,{strikethrough:!0,children:p(a.tokens)},t);case"em":return r(m,{italic:!0,children:p(a.tokens)},t);case"escape":return r(k.Fragment,{children:a.text},t);case"image":{const e=a;return x(m,{dimColor:!0,children:["[image:"," ",e.text||e.href,"]"]},t)}case"link":{const e=a;return r(M,{url:e.href,children:p(e.tokens)??e.text},t)}case"strong":return r(m,{bold:!0,children:p(a.tokens)},t);case"text":return r(k.Fragment,{children:a.text},t);default:{const e="raw"in a?a.raw:"";return r(k.Fragment,{children:e},t)}}})}function T(c){return c.map(a=>{const t=a.tokens??[],e=t.find(i=>i.type==="text"),n=p(e?.tokens??t),h=t.find(i=>i.type==="list");return{children:h?T(h.items):void 0,label:n}})}function $(c,a,t){const e=[];for(const[n,h]of c.entries()){const i=h,s=n>0?1:0;switch(i.type){case"blockquote":{const o=i;e.push(r(l,{borderLeft:!0,borderLeftColor:"gray",marginTop:s,paddingLeft:1,children:r(l,{flexDirection:"column",children:$(o.tokens,a,t-3)})},n));break}case"code":{const o=i;e.push(r(l,{marginTop:s,children:r(F,{code:o.text,language:o.lang,theme:a})},n));break}case"heading":{const o=i,d=q[o.depth]??"white",g=`${"#".repeat(o.depth)} `;e.push(r(l,{marginTop:s,children:x(m,{bold:!0,color:d,children:[g,p(o.tokens)]})},n));break}case"hr":{e.push(r(l,{marginTop:s,children:r(m,{dimColor:!0,children:"─".repeat(Math.min(t,40))})},n));break}case"html":{const o=i.text.replaceAll(/<[^>]*>/g,"");o.trim()&&e.push(r(l,{marginTop:s,children:r(m,{dimColor:!0,children:o})},n));break}case"list":{const o=i,d=T(o.items);o.ordered?e.push(r(l,{marginTop:s,children:r(j,{items:d})},n)):e.push(r(l,{marginTop:s,children:r(B,{items:d})},n));break}case"paragraph":{const o=i;e.push(r(l,{marginTop:s,children:r(m,{wrap:"wrap",children:p(o.tokens)})},n));break}case"space":{e.push(r(w,{},n));break}case"table":{const o=i,d=(o.header??[]).map(u=>u.text),g=(o.rows??[]).map(u=>u.map(f=>f.text)).map(u=>{const f={};return d.forEach((y,L)=>{f[y]=u[L]??""}),f});e.push(r(l,{marginTop:s,children:r(v,{data:g})},n));break}default:{const o="raw"in i?i.raw:"",d="text"in i?i.text:o;d&&e.push(r(l,{marginTop:s,children:r(m,{children:d})},n));break}}}return e}function A(c,a){const t=C.lex(c);if(!a||c.length===0)return t;let e=0;for(const n of t)e+=n.raw?.length??0;if(e<c.length){const n=c.slice(e);n.trim().length>0&&t.push({raw:n,text:n,tokens:[{raw:n,text:n,type:"text"}],type:"paragraph"})}return t}function P({children:c,codeTheme:a="github-dark-default",maxWidth:t,streaming:e=!1}){const{columns:n}=D(),h=t??n??80,i=b(()=>A(c,e),[c,e]),s=b(()=>$(i,a,h),[i,a,h]);return r(l,{flexDirection:"column",children:s})}export{P as Markdown,P as default};
@@ -1 +1 @@
1
- var B=Object.defineProperty;var x=(n,e)=>B(n,"name",{value:e,configurable:!0});import{jsxs as T,jsx as C}from"react/jsx-runtime";import{useMemo as V,useState as A,useCallback as j}from"react";import _ from"../ink/hooks/use-input.js";import{Box as D}from"./box.js";import{Text as b}from"./text.js";var O=Object.defineProperty,v=x((n,e)=>O(n,"name",{value:e,configurable:!0}),"h");const R=v((n,e)=>{const o=[];let s=0;for(const[a,l]of[...n].entries())l===e&&(o.push({maskColumn:a,rawPosition:s}),s+=1);return o},"buildTokenIndex"),$=v((n,e,o,s)=>{let a=0,l="";for(const f of e)if(f===o){const m=n[a];m===void 0?l+=s:(l+=m,a+=1)}else l+=f;return l},"formatValue");function q({defaultValue:n="",isDisabled:e=!1,mask:o,onChange:s,onSubmit:a,placeholderChar:l="_",token:f="#"}){const m=V(()=>R(o,f),[o,f]),h=m.length,M=n.slice(0,h),[t,w]=A(M),[r,d]=A(M.length),p=j((u,i)=>{w(u),d(Math.max(0,Math.min(h,i))),s?.(u)},[h,s]);_(j((u,i)=>{if(i.return){a?.(t);return}if(i.leftArrow){d(c=>Math.max(0,c-1));return}if(i.rightArrow){d(c=>Math.min(t.length,c+1));return}if(i.home||i.ctrl&&u==="a"){d(0);return}if(i.end||i.ctrl&&u==="e"){d(t.length);return}if(i.backspace){if(r===0)return;const c=t.slice(0,r-1)+t.slice(r);p(c,r-1);return}if(i.delete){if(r>=t.length)return;const c=t.slice(0,r)+t.slice(r+1);p(c,r);return}if(u.length!==1||t.length>=h)return;const S=t.slice(0,r)+u+t.slice(r);p(S,r+1)},[t,r,h,p,a]),{isActive:!e});const g=$(t,o,f,l),k=m[r]?.maskColumn??o.length,y=g.slice(0,k),I=g.charAt(k)||" ",P=g.slice(k+1);return T(D,{children:[C(b,{dimColor:e,children:y}),C(b,{dimColor:e,inverse:!e,children:I}),C(b,{dimColor:e,children:P})]})}x(q,"v");v(q,"MaskedInput");export{q as MaskedInput,q as default};
1
+ import{jsxs as T,jsx as x}from"react/jsx-runtime";import{useMemo as V,useState as M,useCallback as A}from"react";import B from"../ink/hooks/use-input.js";import{Box as D}from"./box.js";import{Text as C}from"./text.js";const I=(m,n)=>{const s=[];let i=0;for(const[l,o]of[...m].entries())o===n&&(s.push({maskColumn:l,rawPosition:i}),i+=1);return s},L=(m,n,s,i)=>{let l=0,o="";for(const f of n)if(f===s){const u=m[l];u===void 0?o+=i:(o+=u,l+=1)}else o+=f;return o};function F({defaultValue:m="",isDisabled:n=!1,mask:s,onChange:i,onSubmit:l,placeholderChar:o="_",token:f="#"}){const u=V(()=>I(s,f),[s,f]),h=u.length,b=m.slice(0,h),[e,v]=M(b),[t,d]=M(b.length),g=A((c,r)=>{v(c),d(Math.max(0,Math.min(h,r))),i?.(c)},[h,i]);B(A((c,r)=>{if(r.return){l?.(e);return}if(r.leftArrow){d(a=>Math.max(0,a-1));return}if(r.rightArrow){d(a=>Math.min(e.length,a+1));return}if(r.home||r.ctrl&&c==="a"){d(0);return}if(r.end||r.ctrl&&c==="e"){d(e.length);return}if(r.backspace){if(t===0)return;const a=e.slice(0,t-1)+e.slice(t);g(a,t-1);return}if(r.delete){if(t>=e.length)return;const a=e.slice(0,t)+e.slice(t+1);g(a,t);return}if(c.length!==1||e.length>=h)return;const S=e.slice(0,t)+c+e.slice(t);g(S,t+1)},[e,t,h,g,l]),{isActive:!n});const p=L(e,s,f,o),k=u[t]?.maskColumn??s.length,w=p.slice(0,k),j=p.charAt(k)||" ",P=p.slice(k+1);return T(D,{children:[x(C,{dimColor:n,children:w}),x(C,{dimColor:n,inverse:!n,children:j}),x(C,{dimColor:n,children:P})]})}export{F as MaskedInput,F as default};
@@ -1 +1 @@
1
- var A=Object.defineProperty;var g=(r,i)=>A(r,"name",{value:i,configurable:!0});import{jsxs as p,jsx as l}from"react/jsx-runtime";import{useMemo as w,useState as F,useRef as M,useEffect as B,useCallback as E}from"react";import T from"../ink/hooks/use-focus.js";import G from"../ink/hooks/use-input.js";import{Box as u}from"./box.js";import{Text as f}from"./text.js";var N=Object.defineProperty,k=g((r,i)=>N(r,"name",{value:i,configurable:!0}),"b");const O=k((r,i)=>{if(i&&i.length>0){const t=[];for(const o of i){o.title!==void 0&&t.push({kind:"section-header",sectionId:o.id,title:o.title});for(const d of o.items)t.push({item:d,kind:"item",sectionId:o.id})}return t}return(r??[]).map(t=>({item:t,kind:"item",sectionId:void 0}))},"flatten"),y=k((r,i,t)=>{const o=r.length;if(o===0)return i;for(let d=1;d<=o;d+=1){const a=(i+t*d+o*d)%o,h=r[a];if(h?.kind==="item"&&!h.item.isDisabled)return a}return i},"findNextIndex"),S=k(r=>{for(const[i,t]of r.entries())if(t.kind==="item"&&!t.item.isDisabled)return i;return 0},"firstEnabledIndex");function P({accentColor:r="blue",autoFocus:i=!1,bordered:t=!0,items:o,onSelect:d,sections:a,title:h}){const{isFocused:b}=T({autoFocus:i}),n=w(()=>O(o,a),[o,a]),j=w(()=>S(n),[n]),[v,x]=F(j),m=M(v);m.current=v,B(()=>{const{current:c}=m,s=n[c];if(!(s?.kind==="item"&&!s.item.isDisabled)){const e=S(n);x(e),m.current=e}},[n]),G(E((c,s)=>{if(b){if(s.downArrow||c==="j")x(y(n,m.current,1));else if(s.upArrow||c==="k")x(y(n,m.current,-1));else if(s.return){const e=n[m.current];e?.kind==="item"&&!e.item.isDisabled&&d(e.item.id)}}},[b,n,d]),{isActive:b});const I=p(u,{flexDirection:"column",children:[h===void 0?void 0:l(u,{marginBottom:1,children:l(f,{bold:!0,color:r,children:h})}),n.map((c,s)=>{if(c.kind==="section-header")return l(u,{marginTop:s===0?0:1,children:l(f,{dimColor:!0,children:c.title.toUpperCase()})},`header:${c.sectionId}`);const{item:e}=c,C=b&&s===v,D=C?r:void 0;return p(u,{children:[l(f,{color:D,dimColor:e.isDisabled,children:C?"▸ ":" "}),e.icon===void 0?void 0:p(f,{color:D,dimColor:e.isDisabled,children:[e.icon," "]}),l(u,{flexGrow:1,flexShrink:1,minWidth:0,children:l(f,{bold:C,color:D,dimColor:e.isDisabled,wrap:"truncate-end",children:e.label})}),e.hotkey===void 0?void 0:l(u,{flexShrink:0,children:p(f,{dimColor:!0,children:[" ",e.hotkey]})})]},`item:${e.id}`)})]});return t?l(u,{borderColor:b?r:void 0,borderStyle:"round",paddingX:1,children:I}):I}g(P,"F");k(P,"Menu");export{P as Menu,P as default};
1
+ import{jsxs as b,jsx as l}from"react/jsx-runtime";import{useMemo as g,useState as A,useRef as F,useEffect as j,useCallback as y}from"react";import M from"../ink/hooks/use-focus.js";import $ from"../ink/hooks/use-input.js";import{Box as m}from"./box.js";import{Text as f}from"./text.js";const B=(t,r)=>{if(r&&r.length>0){const o=[];for(const i of r){i.title!==void 0&&o.push({kind:"section-header",sectionId:i.id,title:i.title});for(const d of i.items)o.push({item:d,kind:"item",sectionId:i.id})}return o}return(t??[]).map(o=>({item:o,kind:"item",sectionId:void 0}))},w=(t,r,o)=>{const i=t.length;if(i===0)return r;for(let d=1;d<=i;d+=1){const a=(r+o*d+i*d)%i,h=t[a];if(h?.kind==="item"&&!h.item.isDisabled)return a}return r},I=t=>{for(const[r,o]of t.entries())if(o.kind==="item"&&!o.item.isDisabled)return r;return 0};function W({accentColor:t="blue",autoFocus:r=!1,bordered:o=!0,items:i,onSelect:d,sections:a,title:h}){const{isFocused:p}=M({autoFocus:r}),n=g(()=>B(i,a),[i,a]),S=g(()=>I(n),[n]),[k,v]=A(S),u=F(k);u.current=k,j(()=>{const{current:s}=u,c=n[s];if(!(c?.kind==="item"&&!c.item.isDisabled)){const e=I(n);v(e),u.current=e}},[n]),$(y((s,c)=>{if(p){if(c.downArrow||s==="j")v(w(n,u.current,1));else if(c.upArrow||s==="k")v(w(n,u.current,-1));else if(c.return){const e=n[u.current];e?.kind==="item"&&!e.item.isDisabled&&d(e.item.id)}}},[p,n,d]),{isActive:p});const D=b(m,{flexDirection:"column",children:[h===void 0?void 0:l(m,{marginBottom:1,children:l(f,{bold:!0,color:t,children:h})}),n.map((s,c)=>{if(s.kind==="section-header")return l(m,{marginTop:c===0?0:1,children:l(f,{dimColor:!0,children:s.title.toUpperCase()})},`header:${s.sectionId}`);const{item:e}=s,x=p&&c===k,C=x?t:void 0;return b(m,{children:[l(f,{color:C,dimColor:e.isDisabled,children:x?"▸ ":" "}),e.icon===void 0?void 0:b(f,{color:C,dimColor:e.isDisabled,children:[e.icon," "]}),l(m,{flexGrow:1,flexShrink:1,minWidth:0,children:l(f,{bold:x,color:C,dimColor:e.isDisabled,wrap:"truncate-end",children:e.label})}),e.hotkey===void 0?void 0:l(m,{flexShrink:0,children:b(f,{dimColor:!0,children:[" ",e.hotkey]})})]},`item:${e.id}`)})]});return o?l(m,{borderColor:p?t:void 0,borderStyle:"round",paddingX:1,children:D}):D}export{W as Menu,W as default};
@@ -1 +1 @@
1
- var m=Object.defineProperty;var c=(o,e)=>m(o,"name",{value:e,configurable:!0});import{jsxs as d,jsx as r}from"react/jsx-runtime";import{Box as l}from"./box.js";import{Text as i}from"./text.js";var u=Object.defineProperty,h=c((o,e)=>u(o,"name",{value:e,configurable:!0}),"f");const x={assistant:{align:"flex-start",color:"blueBright",icon:""},system:{align:"flex-start",color:"gray",icon:""},tool:{align:"flex-start",color:"magentaBright",icon:""},user:{align:"flex-end",color:"greenBright",icon:""}};function b({children:o,color:e,flat:g=!1,label:n,meta:t,role:f="assistant"}){const s=x[f],a=e??s.color;return d(l,{alignSelf:s.align,flexDirection:"column",marginBottom:1,children:[n===void 0&&t===void 0?void 0:d(l,{gap:1,paddingX:1,children:[n===void 0?void 0:r(i,{bold:!0,color:a,children:n}),t===void 0?void 0:r(i,{dimColor:!0,children:t})]}),g?d(l,{paddingX:1,children:[r(i,{color:a,children:"│ "}),r(l,{flexDirection:"column",flexGrow:1,children:typeof o=="string"?r(i,{children:o}):o})]}):r(l,{borderColor:a,borderStyle:"round",flexDirection:"column",paddingX:1,children:typeof o=="string"?r(i,{children:o}):o})]})}c(b,"g");h(b,"MessageBubble");export{b as MessageBubble,b as default};
1
+ import{jsxs as a,jsx as o}from"react/jsx-runtime";import{Box as i}from"./box.js";import{Text as e}from"./text.js";const f={assistant:{align:"flex-start",color:"blueBright",icon:""},system:{align:"flex-start",color:"gray",icon:""},tool:{align:"flex-start",color:"magentaBright",icon:""},user:{align:"flex-end",color:"greenBright",icon:""}};function u({children:r,color:d,flat:s=!1,label:l,meta:n,role:g="assistant"}){const c=f[g],t=d??c.color;return a(i,{alignSelf:c.align,flexDirection:"column",marginBottom:1,children:[l===void 0&&n===void 0?void 0:a(i,{gap:1,paddingX:1,children:[l===void 0?void 0:o(e,{bold:!0,color:t,children:l}),n===void 0?void 0:o(e,{dimColor:!0,children:n})]}),s?a(i,{paddingX:1,children:[o(e,{color:t,children:"│ "}),o(i,{flexDirection:"column",flexGrow:1,children:typeof r=="string"?o(e,{children:r}):r})]}):o(i,{borderColor:t,borderStyle:"round",flexDirection:"column",paddingX:1,children:typeof r=="string"?o(e,{children:r}):r})]})}export{u as MessageBubble,u as default};
@@ -1 +1 @@
1
- var f=Object.defineProperty;var n=(r,o)=>f(r,"name",{value:o,configurable:!0});import{jsxs as e,Fragment as v,jsx as c}from"react/jsx-runtime";import{Box as s}from"./box.js";import{Text as d}from"./text.js";var b=Object.defineProperty,h=n((r,o)=>b(r,"name",{value:o,configurable:!0}),"i");function g({color:r="magenta",icon:o,model:t,provider:a,variant:m="solid"}){const u=h(i=>{const l=o===void 0?void 0:e(v,{children:[o," "]});return m==="outline"?c(s,{borderColor:r,borderStyle:"round",paddingX:1,children:e(d,{color:r,children:[l,i]})}):m==="subtle"?e(d,{color:r,children:[l,i]}):e(d,{backgroundColor:r,color:"black",children:[" ",l,i," "]})},"chip");return a===void 0?u(t):e(s,{children:[c(d,{dimColor:!0,children:a}),c(d,{dimColor:!0,children:"/"}),u(t)]})}n(g,"f");h(g,"ModelBadge");export{g as ModelBadge,g as default};
1
+ import{jsxs as o,jsx as l,Fragment as u}from"react/jsx-runtime";import{Box as m}from"./box.js";import{Text as r}from"./text.js";function g({color:e="magenta",icon:i,model:c,provider:t,variant:a="solid"}){const s=d=>{const n=i===void 0?void 0:o(u,{children:[i," "]});return a==="outline"?l(m,{borderColor:e,borderStyle:"round",paddingX:1,children:o(r,{color:e,children:[n,d]})}):a==="subtle"?o(r,{color:e,children:[n,d]}):o(r,{backgroundColor:e,color:"black",children:[" ",n,d," "]})};return t===void 0?s(c):o(m,{children:[l(r,{dimColor:!0,children:t}),l(r,{dimColor:!0,children:"/"}),s(c)]})}export{g as ModelBadge,g as default};
@@ -1 +1 @@
1
- var B=Object.defineProperty;var F=(e,i)=>B(e,"name",{value:i,configurable:!0});import{jsx as m,jsxs as D}from"react/jsx-runtime";import{useReducer as E,useState as L,useRef as a,useMemo as P,useCallback as g}from"react";import _ from"../ink/hooks/use-input.js";import q from"../ink/hooks/use-window-size.js";import{Box as O}from"./box.js";import{Text as f}from"./text.js";var z=Object.defineProperty,R=F((e,i)=>z(e,"name",{value:i,configurable:!0}),"S");const G=[],H=R((e,i)=>{switch(i.type){case"focus":return{...e,focusedIndex:i.index};case"focus-next":{const c=e.focusedIndex+1,u=c>=e.visibleFrom+i.limit;return{...e,focusedIndex:c,visibleFrom:u?e.visibleFrom+1:e.visibleFrom}}case"focus-prev":{const c=e.focusedIndex-1,u=c<e.visibleFrom;return{...e,focusedIndex:c,visibleFrom:u?e.visibleFrom-1:e.visibleFrom}}default:return e}},"multiSelectReducer");function J({accentColor:e="blue",defaultColor:i,defaultValue:c=G,isDisabled:u=!1,isFocused:v=!0,limit:C,onChange:I,onSubmit:w,options:t}){const{rows:T}=q(),l=Math.min(typeof C=="number"?C:T,t.length),[s,S]=E(H,{focusedIndex:0,visibleFrom:0}),[b,j]=L(c),y=a(b);y.current=b;const M=a(w);M.current=w;const p=a(I);p.current=I;const x=a(s);x.current=s;const V=P(()=>t.slice(s.visibleFrom,s.visibleFrom+l),[t,s.visibleFrom,l]),k=g(()=>{const r=t[x.current.focusedIndex]?.value;r&&j(o=>{const n=o.includes(r)?o.filter(d=>d!==r):[...o,r];return p.current?.(n),n})},[t]),A=g(()=>{j(r=>{const o=r.length===t.length?[]:t.map(n=>n.value);return p.current?.(o),o})},[t]);return _(g((r,o)=>{const{focusedIndex:n}=x.current;(o.downArrow||r==="j")&&n<t.length-1&&S({limit:l,type:"focus-next"}),(o.upArrow||r==="k")&&n>0&&S({limit:l,type:"focus-prev"}),r===" "&&k(),r==="a"&&A(),o.return&&M.current?.(y.current)},[t.length,l,k,A]),{isActive:!u&&v}),m(O,{flexDirection:"column",children:V.map((r,o)=>{const n=s.visibleFrom+o===s.focusedIndex,d=b.includes(r.value);let h=i;return d?h="green":n&&(h=e),D(O,{gap:1,children:[n?m(f,{color:e,dimColor:!v,children:"▸"}):m(f,{children:" "}),D(f,{color:h,dimColor:u,children:[d?"◼":"◻"," ",r.label]}),d?m(f,{color:"green",dimColor:!v,children:"✓"}):void 0]},r.key??r.value)})})}F(J,"V");R(J,"MultiSelect");export{J as MultiSelect,J as default};
1
+ import{jsx as m,jsxs as S}from"react/jsx-runtime";import{useReducer as V,useState as B,useRef as f,useMemo as E,useCallback as F}from"react";import U from"../ink/hooks/use-input.js";import W from"../ink/hooks/use-window-size.js";import{Box as A}from"./box.js";import{Text as a}from"./text.js";const Y=[],q=(o,u)=>{switch(u.type){case"focus":return{...o,focusedIndex:u.index};case"focus-next":{const i=o.focusedIndex+1,c=i>=o.visibleFrom+u.limit;return{...o,focusedIndex:i,visibleFrom:c?o.visibleFrom+1:o.visibleFrom}}case"focus-prev":{const i=o.focusedIndex-1,c=i<o.visibleFrom;return{...o,focusedIndex:i,visibleFrom:c?o.visibleFrom-1:o.visibleFrom}}default:return o}};function N({accentColor:o="blue",defaultColor:u,defaultValue:i=Y,isDisabled:c=!1,isFocused:v=!0,limit:g,onChange:C,onSubmit:I,options:t}){const{rows:D}=W(),l=Math.min(typeof g=="number"?g:D,t.length),[s,w]=V(q,{focusedIndex:0,visibleFrom:0}),[b,k]=B(i),M=f(b);M.current=b;const j=f(I);j.current=I;const p=f(C);p.current=C;const x=f(s);x.current=s;const T=E(()=>t.slice(s.visibleFrom,s.visibleFrom+l),[t,s.visibleFrom,l]),y=F(()=>{const e=t[x.current.focusedIndex]?.value;e&&k(r=>{const n=r.includes(e)?r.filter(d=>d!==e):[...r,e];return p.current?.(n),n})},[t]),R=F(()=>{k(e=>{const r=e.length===t.length?[]:t.map(n=>n.value);return p.current?.(r),r})},[t]);return U(F((e,r)=>{const{focusedIndex:n}=x.current;(r.downArrow||e==="j")&&n<t.length-1&&w({limit:l,type:"focus-next"}),(r.upArrow||e==="k")&&n>0&&w({limit:l,type:"focus-prev"}),e===" "&&y(),e==="a"&&R(),r.return&&j.current?.(M.current)},[t.length,l,y,R]),{isActive:!c&&v}),m(A,{flexDirection:"column",children:T.map((e,r)=>{const n=s.visibleFrom+r===s.focusedIndex,d=b.includes(e.value);let h=u;return d?h="green":n&&(h=o),S(A,{gap:1,children:[n?m(a,{color:o,dimColor:!v,children:"▸"}):m(a,{children:" "}),S(a,{color:h,dimColor:c,children:[d?"◼":"◻"," ",e.label]}),d?m(a,{color:"green",dimColor:!v,children:"✓"}):void 0]},e.key??e.value)})})}export{N as MultiSelect,N as default};
@@ -1,2 +1,2 @@
1
- var n=Object.defineProperty;var t=(e,r)=>n(e,"name",{value:r,configurable:!0});import{jsx as a}from"react/jsx-runtime";var i=Object.defineProperty,o=t((e,r)=>i(e,"name",{value:r,configurable:!0}),"t");function u({count:e=1}){return a("ink-text",{children:`
2
- `.repeat(e)})}t(u,"r");o(u,"Newline");export{u as Newline,u as default};
1
+ import{jsx as t}from"react/jsx-runtime";function r({count:e=1}){return t("ink-text",{children:`
2
+ `.repeat(e)})}export{r as Newline,r as default};
@@ -1 +1 @@
1
- var w=Object.defineProperty;var s=(e,r)=>w(e,"name",{value:r,configurable:!0});import{jsx as n,jsxs as l,Fragment as y}from"react/jsx-runtime";import{Box as d}from"./box.js";import{Spinner as C}from"./spinner.js";import{Text as o}from"./text.js";var k=Object.defineProperty,a=s((e,r)=>k(e,"name",{value:r,configurable:!0}),"s");const $={completed:"green",error:"red",pending:"gray",running:"cyan",skipped:"yellow"},M={completed:"✔",error:"✖",pending:"○",skipped:"⊘"},b=a(e=>{if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const r=Math.round(e/1e3),i=Math.floor(r/60),t=r%60;return`${i}m ${t}s`},"formatDuration"),h=a(({isLast:e,node:r,prefix:i,showSpinner:t})=>{const p=$[r.status],m=e?"└─ ":"├─ ",f=i.length===0?"":m,u=i+(e?" ":"│ "),g=t?n(C,{type:"dots"}):"…",x=r.status==="running"?g:M[r.status];return l(y,{children:[l(d,{children:[n(o,{dimColor:!0,children:i}),n(o,{dimColor:!0,children:f}),n(d,{flexShrink:0,children:n(o,{color:p,children:x})}),n(o,{children:" "}),n(d,{flexGrow:1,flexShrink:1,minWidth:0,children:n(o,{bold:r.status==="running",color:r.status==="pending"?"gray":void 0,dimColor:r.status==="skipped",wrap:"truncate-end",children:r.label})}),r.durationMs===void 0?void 0:n(d,{flexShrink:0,children:l(o,{dimColor:!0,children:[" ",b(r.durationMs)]})})]}),r.details===void 0?void 0:l(d,{children:[n(o,{dimColor:!0,children:u}),n(o,{dimColor:!0,children:r.details})]}),r.children?.map((c,v,S)=>n(h,{isLast:v===S.length-1,node:c,prefix:u,showSpinner:t},c.id))]})},"NodeLine");function L({nodes:e,showSpinner:r=!0}){return n(d,{flexDirection:"column",children:e.map((i,t)=>n(h,{isLast:t===e.length-1,node:i,prefix:"",showSpinner:r},i.id))})}s(L,"c");a(L,"OperationTree");export{L as OperationTree,L as default};
1
+ import{jsx as n,jsxs as s,Fragment as S}from"react/jsx-runtime";import{Box as t}from"./box.js";import{Spinner as k}from"./spinner.js";import{Text as o}from"./text.js";const w={completed:"green",error:"red",pending:"gray",running:"cyan",skipped:"yellow"},C={completed:"✔",error:"✖",pending:"○",skipped:"⊘"},y=e=>{if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const r=Math.round(e/1e3),i=Math.floor(r/60),d=r%60;return`${i}m ${d}s`},h=({isLast:e,node:r,prefix:i,showSpinner:d})=>{const p=w[r.status],c=e?"└─ ":"├─ ",u=i.length===0?"":c,l=i+(e?" ":"│ "),m=d?n(k,{type:"dots"}):"…",f=r.status==="running"?m:C[r.status];return s(S,{children:[s(t,{children:[n(o,{dimColor:!0,children:i}),n(o,{dimColor:!0,children:u}),n(t,{flexShrink:0,children:n(o,{color:p,children:f})}),n(o,{children:" "}),n(t,{flexGrow:1,flexShrink:1,minWidth:0,children:n(o,{bold:r.status==="running",color:r.status==="pending"?"gray":void 0,dimColor:r.status==="skipped",wrap:"truncate-end",children:r.label})}),r.durationMs===void 0?void 0:n(t,{flexShrink:0,children:s(o,{dimColor:!0,children:[" ",y(r.durationMs)]})})]}),r.details===void 0?void 0:s(t,{children:[n(o,{dimColor:!0,children:l}),n(o,{dimColor:!0,children:r.details})]}),r.children?.map((a,x,g)=>n(h,{isLast:x===g.length-1,node:a,prefix:l,showSpinner:d},a.id))]})};function T({nodes:e,showSpinner:r=!0}){return n(t,{flexDirection:"column",children:e.map((i,d)=>n(h,{isLast:d===e.length-1,node:i,prefix:"",showSpinner:r},i.id))})}export{T as OperationTree,T as default};
@@ -1 +1 @@
1
- var m=Object.defineProperty;var d=(r,o)=>m(r,"name",{value:o,configurable:!0});import{jsx as i,jsxs as s}from"react/jsx-runtime";import{Box as n}from"./box.js";import{Text as l}from"./text.js";var p=Object.defineProperty,x=d((r,o)=>p(r,"name",{value:o,configurable:!0}),"s");function v({accentColor:r="blue",bordered:o=!1,currentId:u,iconColumnWidth:c=2,options:f}){const a=i(n,{flexDirection:"column",children:f.map(e=>{const t=e.id===u,h=t?r:void 0;return s(n,{flexDirection:"column",children:[s(n,{children:[i(n,{flexShrink:0,width:c,children:i(l,{color:h,children:e.icon??(t?"▸":" ")})}),i(n,{flexGrow:1,flexShrink:1,minWidth:0,children:i(l,{bold:t,color:h,wrap:"truncate-end",children:e.label})}),e.trailing===void 0?void 0:i(n,{flexShrink:0,children:e.trailing})]}),e.description===void 0?void 0:i(n,{marginLeft:c,children:i(l,{dimColor:!0,wrap:"truncate-end",children:e.description})})]},e.id)})});return o?i(n,{borderStyle:"round",paddingX:1,children:a}):a}d(v,"x");x(v,"OptionList");export{v as OptionList,v as default};
1
+ import{jsx as i,jsxs as c}from"react/jsx-runtime";import{Box as r}from"./box.js";import{Text as o}from"./text.js";function x({accentColor:a="blue",bordered:h=!1,currentId:s,iconColumnWidth:d=2,options:f}){const l=i(r,{flexDirection:"column",children:f.map(n=>{const e=n.id===s,t=e?a:void 0;return c(r,{flexDirection:"column",children:[c(r,{children:[i(r,{flexShrink:0,width:d,children:i(o,{color:t,children:n.icon??(e?"▸":" ")})}),i(r,{flexGrow:1,flexShrink:1,minWidth:0,children:i(o,{bold:e,color:t,wrap:"truncate-end",children:n.label})}),n.trailing===void 0?void 0:i(r,{flexShrink:0,children:n.trailing})]}),n.description===void 0?void 0:i(r,{marginLeft:d,children:i(o,{dimColor:!0,wrap:"truncate-end",children:n.description})})]},n.id)})});return h?i(r,{borderStyle:"round",paddingX:1,children:l}):l}export{x as OptionList,x as default};
@@ -1 +1 @@
1
- var h=Object.defineProperty;var t=(r,e)=>h(r,"name",{value:e,configurable:!0});import{jsx as i,jsxs as d}from"react/jsx-runtime";import{Box as o}from"./box.js";import{Text as s}from"./text.js";var p=Object.defineProperty,a=t((r,e)=>p(r,"name",{value:e,configurable:!0}),"o");const m=a((r,e)=>{const u=String(r.length).length;return i(o,{flexDirection:"column",children:r.map((n,l)=>{const f=`${String(l+1).padStart(u)}.`,c=`${e}${f}`;return d(o,{gap:1,children:[i(s,{dimColor:!0,children:c}),d(o,{flexDirection:"column",children:[i(s,{children:n.label}),n.children?m(n.children,c):void 0]})]},l)})})},"renderList");function x({items:r}){return m(r,"")}t(x,"c");a(x,"OrderedList");export{x as OrderedList,x as default};
1
+ import{jsx as e,jsxs as l}from"react/jsx-runtime";import{Box as n}from"./box.js";import{Text as c}from"./text.js";const d=(r,s)=>{const m=String(r.length).length;return e(n,{flexDirection:"column",children:r.map((t,i)=>{const a=`${String(i+1).padStart(m)}.`,o=`${s}${a}`;return l(n,{gap:1,children:[e(c,{dimColor:!0,children:o}),l(n,{flexDirection:"column",children:[e(c,{children:t.label}),t.children?d(t.children,o):void 0]})]},i)})})};function f({items:r}){return d(r,"")}export{f as OrderedList,f as default};
@@ -1 +1 @@
1
- var F=Object.defineProperty;var C=(e,r)=>F(e,"name",{value:r,configurable:!0});import{jsxs as m,jsx as o}from"react/jsx-runtime";import{useState as B,useCallback as M}from"react";import S from"../ink/hooks/use-input.js";import{Box as x}from"./box.js";import{Text as t}from"./text.js";var T=Object.defineProperty,v=C((e,r)=>T(e,"name",{value:r,configurable:!0}),"f");const $=v(({color:e,currentPage:r,style:u,totalPages:c})=>{if(u==="fraction")return m(t,{children:[o(t,{color:e,children:r+1}),m(t,{dimColor:!0,children:["/",c]})]});if(u==="numeric"){const s=r>0?o(t,{color:e,children:"‹ "}):o(t,{dimColor:!0,children:"‹ "}),a=r<c-1?o(t,{color:e,children:" ›"}):o(t,{dimColor:!0,children:" ›"});return m(x,{children:[s,o(t,{color:e,children:r+1}),m(t,{dimColor:!0,children:[" ","/",c]}),a]})}const d=Array.from({length:c},(s,a)=>a===r?o(t,{color:e,children:"●"},a):o(t,{dimColor:!0,children:"○"},a));return o(x,{gap:1,children:d})},"Indicator"),q=v(({children:e,defaultPage:r=0,indicatorColor:u="cyan",isFocused:c=!0,items:d,onChange:s,page:a,pageSize:g,style:A="dots"})=>{const f=a!==void 0,[b,w]=B(r),I=f?a:b,n=Math.max(1,Math.ceil(d.length/g)),l=Math.max(0,Math.min(I,n-1)),h=M(y=>{const i=Math.max(0,Math.min(y,n-1));f||w(i),s?.(i)},[n,f,s]);S(M((y,i)=>{i.leftArrow||i.pageUp?h(l-1):i.rightArrow||i.pageDown?h(l+1):i.home?h(0):i.end&&h(n-1)},[l,n,h]),{isActive:c});const p=l*g,P=Math.min(p+g,d.length),j=d.slice(p,P),D={currentPage:l,endIndex:P,isFirstPage:l===0,isLastPage:l===n-1,startIndex:p,totalPages:n};return m(x,{flexDirection:"column",children:[e(j,D),n>1&&o($,{color:u,currentPage:l,style:A,totalPages:n})]})},"Paginator");export{q as Paginator,q as default};
1
+ import{jsxs as m,jsx as r}from"react/jsx-runtime";import{useState as j,useCallback as M}from"react";import k from"../ink/hooks/use-input.js";import{Box as p}from"./box.js";import{Text as e}from"./text.js";const D=({color:i,currentPage:c,style:u,totalPages:l})=>{if(u==="fraction")return m(e,{children:[r(e,{color:i,children:c+1}),m(e,{dimColor:!0,children:["/",l]})]});if(u==="numeric"){const h=c>0?r(e,{color:i,children:"‹ "}):r(e,{dimColor:!0,children:"‹ "}),n=c<l-1?r(e,{color:i,children:" ›"}):r(e,{dimColor:!0,children:" ›"});return m(p,{children:[h,r(e,{color:i,children:c+1}),m(e,{dimColor:!0,children:[" ","/",l]}),n]})}const d=Array.from({length:l},(h,n)=>n===c?r(e,{color:i,children:"●"},n):r(e,{dimColor:!0,children:"○"},n));return r(p,{gap:1,children:d})},L=({children:i,defaultPage:c=0,indicatorColor:u="cyan",isFocused:l=!0,items:d,onChange:h,page:n,pageSize:g,style:y="dots"})=>{const f=n!==void 0,[w,A]=j(c),v=f?n:w,o=Math.max(1,Math.ceil(d.length/g)),a=Math.max(0,Math.min(v,o-1)),s=M(C=>{const t=Math.max(0,Math.min(C,o-1));f||A(t),h?.(t)},[o,f,h]);k(M((C,t)=>{t.leftArrow||t.pageUp?s(a-1):t.rightArrow||t.pageDown?s(a+1):t.home?s(0):t.end&&s(o-1)},[a,o,s]),{isActive:l});const x=a*g,P=Math.min(x+g,d.length),I=d.slice(x,P),b={currentPage:a,endIndex:P,isFirstPage:a===0,isLastPage:a===o-1,startIndex:x,totalPages:o};return m(p,{flexDirection:"column",children:[i(I,b),o>1&&r(D,{color:u,currentPage:a,style:y,totalPages:o})]})};export{L as Paginator,L as default};
@@ -1 +1 @@
1
- var t=Object.defineProperty;var a=(r,o)=>t(r,"name",{value:o,configurable:!0});import{jsx as e}from"react/jsx-runtime";import{Box as l}from"./box.js";import{Text as c}from"./text.js";var f=Object.defineProperty,p=a((r,o)=>f(r,"name",{value:o,configurable:!0}),"e");function d({children:r,color:o,dimColor:i=!1,marginBottom:m=1,marginTop:n=0}){return e(l,{flexDirection:"column",marginBottom:m,marginTop:n,children:e(c,{color:o,dimColor:i,children:r})})}a(d,"a");p(d,"Paragraph");export{d as Paragraph,d as default};
1
+ import{jsx as o}from"react/jsx-runtime";import{Box as t}from"./box.js";import{Text as l}from"./text.js";function p({children:r,color:i,dimColor:m=!1,marginBottom:a=1,marginTop:n=0}){return o(t,{flexDirection:"column",marginBottom:a,marginTop:n,children:o(l,{color:i,dimColor:m,children:r})})}export{p as Paragraph,p as default};
@@ -1 +1 @@
1
- var v=Object.defineProperty;var o=(r,t)=>v(r,"name",{value:t,configurable:!0});import{jsx as a}from"react/jsx-runtime";import g from"../ink/hooks/use-animation.js";import y from"../ink/hooks/use-window-size.js";import{Box as c}from"./box.js";import{Text as b}from"./text.js";var A=Object.defineProperty,M=o((r,t)=>A(r,"name",{value:t,configurable:!0}),"l");const P=[1,.85,.6];function j({animated:r=!0,character:t="█",color:m="gray",interval:h=500,rows:d=3,width:n,widths:e=P}){const{frame:f}=g({interval:h,isActive:r}),{columns:s}=y(),u=r&&f%2===0,p=n??Math.max(1,s);return a(c,{flexDirection:"column",width:n,children:Array.from({length:d},(T,i)=>{const x=e.length>0?e[i%e.length]??1:1,l=Math.max(1,Math.round(p*x)),w=t.repeat(l);return a(c,{width:l,children:a(b,{color:m,dimColor:u,wrap:"truncate-end",children:w})},i)})})}o(j,"s");M(j,"Placeholder");export{j as Placeholder,j as default};
1
+ import{jsx as t}from"react/jsx-runtime";import w from"../ink/hooks/use-animation.js";import g from"../ink/hooks/use-window-size.js";import{Box as i}from"./box.js";import{Text as v}from"./text.js";const y=[1,.85,.6];function C({animated:o=!0,character:l="█",color:m="gray",interval:c=500,rows:h=3,width:e,widths:r=y}){const{frame:d}=w({interval:c,isActive:o}),{columns:s}=g(),f=o&&d%2===0,u=e??Math.max(1,s);return t(i,{flexDirection:"column",width:e,children:Array.from({length:h},(M,a)=>{const p=r.length>0?r[a%r.length]??1:1,n=Math.max(1,Math.round(u*p)),x=l.repeat(n);return t(i,{width:n,children:t(v,{color:m,dimColor:f,wrap:"truncate-end",children:x})},a)})})}export{C as Placeholder,C as default};
@@ -1 +1 @@
1
- var l=Object.defineProperty;var e=(r,a)=>l(r,"name",{value:a,configurable:!0});import{jsx as u}from"react/jsx-runtime";import p from"../ink/hooks/use-window-size.js";import{Text as d}from"./text.js";var g=Object.defineProperty,x=e((r,a)=>g(r,"name",{value:a,configurable:!0}),"n");function M({character:r="█",columns:a=0,left:n=0,percent:m=1,right:i=0,rightPad:s=!1,...c}){const{columns:f}=p(),t=Math.max(0,(a||f||80)-i-n),o=Math.min(Math.floor(t*Math.max(0,Math.min(1,m))),t),h=r.repeat(o)+(s?" ".repeat(t-o):"");return u(d,{...c,children:h})}e(M,"a");x(M,"ProgressBar");export{M as ProgressBar,M as default};
1
+ import{jsx as f}from"react/jsx-runtime";import l from"../ink/hooks/use-window-size.js";import{Text as p}from"./text.js";function d({character:a="█",columns:e=0,left:o=0,percent:m=1,right:i=0,rightPad:n=!1,...s}){const{columns:c}=l(),r=Math.max(0,(e||c||80)-i-o),t=Math.min(Math.floor(r*Math.max(0,Math.min(1,m))),r),h=a.repeat(t)+(n?" ".repeat(r-t):"");return f(p,{...s,children:h})}export{d as ProgressBar,d as default};
@@ -1 +1 @@
1
- var B=Object.defineProperty;var A=(i,e)=>B(i,"name",{value:e,configurable:!0});import{jsx as x,jsxs as D}from"react/jsx-runtime";import{useState as M,useRef as G,useCallback as R}from"react";import I from"../ink/hooks/use-focus.js";import O from"../ink/hooks/use-input.js";import{Box as k}from"./box.js";import{Text as y}from"./text.js";var T=Object.defineProperty,S=A((i,e)=>T(i,"name",{value:e,configurable:!0}),"A");const N=S((i,e)=>{if(e===void 0)return 0;const c=i.findIndex(b=>b.value===e);return Math.max(c,0)},"initialFocusIndex");function P({accentColor:i="blue",autoFocus:e=!1,commitOnNavigate:c=!0,defaultValue:b,isDisabled:v=!1,onChange:C,onSubmit:j,options:t,orientation:a="vertical",value:f}){const{isFocused:s}=I({autoFocus:e,isActive:!v}),[g,z]=M(b??t[0]?.value),m=f??g,[w,F]=M(()=>N(t,m)),l=G(w);l.current=w;const d=R(r=>{const o=t[r];if(!o)return;const u=f??g;o.value!==u&&(f===void 0&&z(o.value),C?.(o.value))},[t,f,g,C]);return O(R((r,o)=>{if(!s)return;const u=t.length;if(u===0)return;const p=o.downArrow&&a==="vertical"||o.rightArrow&&a==="horizontal"||r==="j",h=o.upArrow&&a==="vertical"||o.leftArrow&&a==="horizontal"||r==="k";if(p){const n=Math.min(u-1,l.current+1);F(n),c&&d(n);return}if(h){const n=Math.max(0,l.current-1);F(n),c&&d(n);return}if(r===" "){d(l.current);return}if(o.return){c||d(l.current);const n=t[l.current]?.value??m;n!==void 0&&j?.(n)}},[s,t,a,d,c,m,j]),{isActive:!v&&s}),x(k,{flexDirection:a==="vertical"?"column":"row",gap:a==="vertical"?0:2,children:t.map((r,o)=>{const u=r.value===m,p=s&&o===w,h=(u||p)&&s?i:void 0;return D(k,{gap:1,children:[x(y,{color:h,dimColor:v,children:u?"●":"○"}),x(y,{bold:p,color:h,dimColor:v,children:r.label}),r.description===void 0?void 0:x(y,{dimColor:!0,children:r.description})]},r.key??r.value)})})}A(P,"T");S(P,"RadioGroup");export{P as RadioGroup,P as default};
1
+ import{jsx as h,jsxs as D}from"react/jsx-runtime";import{useState as z,useRef as G,useCallback as F}from"react";import S from"../ink/hooks/use-focus.js";import T from"../ink/hooks/use-input.js";import{Box as M}from"./box.js";import{Text as w}from"./text.js";const $=(x,s)=>{if(s===void 0)return 0;const l=x.findIndex(b=>b.value===s);return Math.max(l,0)};function E({accentColor:x="blue",autoFocus:s=!1,commitOnNavigate:l=!0,defaultValue:b,isDisabled:d=!1,onChange:A,onSubmit:k,options:t,orientation:i="vertical",value:m}){const{isFocused:a}=S({autoFocus:s,isActive:!d}),[C,R]=z(b??t[0]?.value),v=m??C,[g,j]=z(()=>$(t,v)),u=G(g);u.current=g;const c=F(r=>{const o=t[r];if(!o)return;const n=m??C;o.value!==n&&(m===void 0&&R(o.value),A?.(o.value))},[t,m,C,A]);return T(F((r,o)=>{if(!a)return;const n=t.length;if(n===0)return;const f=o.downArrow&&i==="vertical"||o.rightArrow&&i==="horizontal"||r==="j",p=o.upArrow&&i==="vertical"||o.leftArrow&&i==="horizontal"||r==="k";if(f){const e=Math.min(n-1,u.current+1);j(e),l&&c(e);return}if(p){const e=Math.max(0,u.current-1);j(e),l&&c(e);return}if(r===" "){c(u.current);return}if(o.return){l||c(u.current);const e=t[u.current]?.value??v;e!==void 0&&k?.(e)}},[a,t,i,c,l,v,k]),{isActive:!d&&a}),h(M,{flexDirection:i==="vertical"?"column":"row",gap:i==="vertical"?0:2,children:t.map((r,o)=>{const n=r.value===v,f=a&&o===g,p=(n||f)&&a?x:void 0;return D(M,{gap:1,children:[h(w,{color:p,dimColor:d,children:n?"●":"○"}),h(w,{bold:f,color:p,dimColor:d,children:r.label}),r.description===void 0?void 0:h(w,{dimColor:!0,children:r.description})]},r.key??r.value)})})}export{E as RadioGroup,E as default};
@@ -1 +1 @@
1
- var h=Object.defineProperty;var s=(r,i)=>h(r,"name",{value:i,configurable:!0});import{jsxs as N,jsx as n}from"react/jsx-runtime";import{useMemo as E}from"react";import{Box as d}from"./box.js";import{Canvas as b}from"./canvas.js";import{t as g,p as S,D as v,c as P,d as y}from"../packem_shared/line-chart-kf7uhR0K.js";import{Text as T}from"./text.js";var C=Object.defineProperty,Y=s((r,i)=>C(r,"name",{value:i,configurable:!0}),"f");const _=v;function w({axisColor:r="gray",height:i=10,maxX:m,maxY:x,minX:c,minY:l,palette:o=_,series:I,showLegend:M=!0,width:p=40}){const u=E(()=>{const t=I.map((a,f)=>({color:S(a,f,o),points:g(a.data),series:a})),e=P(t);return{axisColor:r,palette:o,seriesList:t,xMax:m??(e.xMax===Number.NEGATIVE_INFINITY?1:e.xMax),xMin:c??(e.xMin===Number.POSITIVE_INFINITY?0:e.xMin),yMax:x??(e.yMax===Number.NEGATIVE_INFINITY?1:e.yMax),yMin:l??(e.yMin===Number.POSITIVE_INFINITY?0:e.yMin)}},[I,r,o,c,m,l,x]);return N(d,{flexDirection:"column",children:[n(b,{draw:s(t=>{y(t,"scatter",u)},"draw"),height:i,version:[I,p,i,c,m,l,x,r,o],width:p}),M?n(d,{gap:2,marginTop:1,children:u.seriesList.map(({color:t,series:e},a)=>N(d,{gap:1,children:[n(T,{color:t,children:"●"}),n(T,{children:e.label??`Series ${a+1}`})]},`${a}:${e.label??""}`))}):void 0]})}s(w,"I");Y(w,"ScatterPlot");export{w as ScatterPlot,w as default};
1
+ import{jsxs as T,jsx as t}from"react/jsx-runtime";import{useMemo as h}from"react";import{Box as c}from"./box.js";import{Canvas as E}from"./canvas.js";import{t as f,p as g,c as y,D as b,d as C}from"../packem_shared/line-chart-C7CUrvVs.js";import{Text as N}from"./text.js";const S=b;function P({axisColor:a="gray",height:I=10,maxX:o,maxY:n,minX:m,minY:x,palette:s=S,series:l,showLegend:u=!0,width:p=40}){const d=h(()=>{const r=l.map((i,M)=>({color:g(i,M,s),points:f(i.data),series:i})),e=y(r);return{axisColor:a,palette:s,seriesList:r,xMax:o??(e.xMax===Number.NEGATIVE_INFINITY?1:e.xMax),xMin:m??(e.xMin===Number.POSITIVE_INFINITY?0:e.xMin),yMax:n??(e.yMax===Number.NEGATIVE_INFINITY?1:e.yMax),yMin:x??(e.yMin===Number.POSITIVE_INFINITY?0:e.yMin)}},[l,a,s,m,o,x,n]);return T(c,{flexDirection:"column",children:[t(E,{draw:r=>{C(r,"scatter",d)},height:I,version:[l,p,I,m,o,x,n,a,s],width:p}),u?t(c,{gap:2,marginTop:1,children:d.seriesList.map(({color:r,series:e},i)=>T(c,{gap:1,children:[t(N,{color:r,children:"●"}),t(N,{children:e.label??`Series ${i+1}`})]},`${i}:${e.label??""}`))}):void 0]})}export{P as ScatterPlot,P as default};
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { BoxProps as Props } from "./box.js";
3
3
  import 'type-fest';
4
- import "../packem_shared/dom.d-C1IxuLJ9.js";
4
+ import "../packem_shared/dom.d-B4kXbaVY.js";
5
5
  import 'yoga-layout';
6
6
  import "../packem_shared/cursor-helpers.d-BONB9tky.js";
7
7
  import '@visulima/colorize';
@@ -1 +1 @@
1
- import{ScrollBarBox as l}from"../packem_shared/ScrollBarBox-DwiCxilX.js";export{l as ScrollBarBox};
1
+ import{ScrollBarBox as l}from"../packem_shared/ScrollBarBox-CBhLo6eZ.js";export{l as ScrollBarBox};
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { BoxProps as Props } from "./box.js";
3
3
  import 'type-fest';
4
- import "../packem_shared/dom.d-C1IxuLJ9.js";
4
+ import "../packem_shared/dom.d-B4kXbaVY.js";
5
5
  import 'yoga-layout';
6
6
  import "../packem_shared/cursor-helpers.d-BONB9tky.js";
7
7
  import '@visulima/colorize';
@@ -1 +1 @@
1
- import{ScrollBar as l}from"../packem_shared/ScrollBar-U_37hlIT.js";export{l as ScrollBar};
1
+ import{ScrollBar as l}from"../packem_shared/ScrollBar-BKCK8jsb.js";export{l as ScrollBar};
@@ -2,7 +2,7 @@ import React, { Ref } from 'react';
2
2
  import { a as ScrollViewProps, b as ScrollViewRef } from "../packem_shared/scroll-view.d-DtpsgHLg.js";
3
3
  import "./box.js";
4
4
  import 'type-fest';
5
- import "../packem_shared/dom.d-C1IxuLJ9.js";
5
+ import "../packem_shared/dom.d-B4kXbaVY.js";
6
6
  import 'yoga-layout';
7
7
  import "../packem_shared/cursor-helpers.d-BONB9tky.js";
8
8
  import '@visulima/colorize';
@@ -1 +1 @@
1
- import{ScrollList as l}from"../packem_shared/ScrollList-C7nZ9ufK.js";export{l as ScrollList};
1
+ import{ScrollList as l}from"../packem_shared/ScrollList-DyFyVs6I.js";export{l as ScrollList};
@@ -2,7 +2,7 @@ export { S as ScrollView, type a as ScrollViewProps, type b as ScrollViewRef } f
2
2
  import 'react';
3
3
  import "./box.js";
4
4
  import 'type-fest';
5
- import "../packem_shared/dom.d-C1IxuLJ9.js";
5
+ import "../packem_shared/dom.d-B4kXbaVY.js";
6
6
  import 'yoga-layout';
7
7
  import "../packem_shared/cursor-helpers.d-BONB9tky.js";
8
8
  import '@visulima/colorize';
@@ -1 +1 @@
1
- import{ScrollView as e}from"../packem_shared/ScrollView-DKZ8OM-m.js";export{e as ScrollView};
1
+ import{ScrollView as e}from"../packem_shared/ScrollView-BEgrtSnt.js";export{e as ScrollView};
@@ -1 +1 @@
1
- var d=Object.defineProperty;var o=(e,r)=>d(e,"name",{value:r,configurable:!0});import{jsxs as p,jsx as a}from"react/jsx-runtime";import{Box as n}from"./box.js";import{Text as f}from"./text.js";import{TextInput as m}from"./text-input.js";var h=Object.defineProperty,b=o((e,r)=>h(e,"name",{value:r,configurable:!0}),"t");function g({accentColor:e="blue",defaultValue:r="",icon:t="⌕",isDisabled:l=!1,onChange:i,onSubmit:s,placeholder:u="Search...",suggestions:c}){return p(n,{borderColor:e,borderStyle:"round",gap:1,paddingX:1,children:[a(f,{color:e,children:t}),a(n,{flexGrow:1,children:a(m,{defaultValue:r,isDisabled:l,onChange:i,onSubmit:s,placeholder:u,suggestions:c})})]})}o(g,"a");b(g,"SearchInput");export{g as SearchInput,g as default};
1
+ import{jsxs as u,jsx as e}from"react/jsx-runtime";import{Box as r}from"./box.js";import{Text as c}from"./text.js";import{TextInput as p}from"./text-input.js";function b({accentColor:o="blue",defaultValue:a="",icon:l="⌕",isDisabled:n=!1,onChange:t,onSubmit:s,placeholder:i="Search...",suggestions:d}){return u(r,{borderColor:o,borderStyle:"round",gap:1,paddingX:1,children:[e(c,{color:o,children:l}),e(r,{flexGrow:1,children:e(p,{defaultValue:a,isDisabled:n,onChange:t,onSubmit:s,placeholder:i,suggestions:d})})]})}export{b as SearchInput,b as default};
@@ -1 +1 @@
1
- var n=Object.defineProperty;var t=(e,r)=>n(e,"name",{value:r,configurable:!0});import{jsx as o}from"react/jsx-runtime";import{Box as a}from"./box.js";import{Text as c}from"./text.js";var l=Object.defineProperty,u=t((e,r)=>l(e,"name",{value:r,configurable:!0}),"r");function d({accentColor:e="blue",isFocused:r=!0,isSelected:i=!1}){return o(a,{marginRight:1,children:i?o(c,{color:e,dimColor:!r,children:"❯"}):o(c,{children:" "})})}t(d,"l");u(d,"SelectInputIndicator");export{d as SelectInputIndicator,d as default};
1
+ import{jsx as r}from"react/jsx-runtime";import{Box as c}from"./box.js";import{Text as e}from"./text.js";function s({accentColor:o="blue",isFocused:t=!0,isSelected:i=!1}){return r(c,{marginRight:1,children:i?r(e,{color:o,dimColor:!t,children:"❯"}):r(e,{children:" "})})}export{s as SelectInputIndicator,s as default};
@@ -1 +1 @@
1
- var c=Object.defineProperty;var t=(e,r)=>c(e,"name",{value:r,configurable:!0});import{jsx as u}from"react/jsx-runtime";import{Text as n}from"./text.js";var i=Object.defineProperty,f=t((e,r)=>i(e,"name",{value:r,configurable:!0}),"r");function m({accentColor:e="blue",defaultColor:r,isFocused:o=!0,isSelected:l=!1,label:a}){return u(n,{color:l?e:r,dimColor:l&&!o,children:a})}t(m,"l");f(m,"SelectInputItem");export{m as SelectInputItem,m as default};
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};
@@ -1 +1 @@
1
- var ne=Object.defineProperty;var F=(t,e)=>ne(t,"name",{value:e,configurable:!0});import{createRequire as re}from"node:module";import{jsx as T,jsxs as se}from"react/jsx-runtime";import{useReducer as ae,useRef as j,useMemo as le,useEffect as Y,useCallback as k,createElement as Z}from"react";import de from"../ink/hooks/use-input.js";import ue from"../ink/hooks/use-window-size.js";import{Box as A}from"./box.js";import{SelectInputIndicator as fe}from"./select-input-indicator.js";import{SelectInputItem as pe}from"./select-input-item.js";import{Text as me}from"./text.js";const oe=re(import.meta.url),R=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ce=F(t=>{if(typeof R<"u"&&R.versions&&R.versions.node){const[e,o]=R.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return R.getBuiltinModule(t)}return oe(t)},"__cjs_getBuiltinModule"),{isDeepStrictEqual:ie}=ce("node:util");var Ie=Object.defineProperty,S=F((t,e)=>Ie(t,"name",{value:e,configurable:!0}),"S");const y=S(t=>"isSeparator"in t&&t.isSeparator,"isSeparator"),xe=[],ge=/^[1-9]$/,l=-1,ye="───",he=Symbol("separator"),be=S((t,e)=>{switch(e.type){case"navigate":return{rotateIndex:e.rotateIndex,selectedIndex:e.selectedIndex};case"reset":return{rotateIndex:0,selectedIndex:e.hasInitialSelection?e.initialIndex:l};case"set":return{rotateIndex:e.selectedIndex,selectedIndex:e.selectedIndex};default:return t}},"selectionReducer"),Se=S((t,e)=>{const{length:o}=t;if(o===0)return[];const u=(e%o+o)%o;return[...t.slice(u),...t.slice(0,u)]},"rotateArray"),b=S((t,e,o,u)=>e?Se(t,o).slice(0,u):t,"getVisibleItems"),$=S((t,e,o)=>{const{length:u}=t;for(let v=0;v<u;v+=1){const _=((e+(v+1)*o)%u+u)%u;if(!y(t[_]))return _}return l},"findNextSelectableIndex"),G=S((t,e)=>{if(e<0||e>=t.length)return l;const o=t[e];return o&&!y(o)?e:$(t,e-1,1)},"resolveSelectableIndex");function ve({accentColor:t="blue",defaultColor:e,index:o,indicatorComponent:u=fe,initialIndex:v,isFocused:_=!0,itemComponent:X=pe,items:r=xe,limit:D,onHighlight:f,onSelect:O,resetOnItemsChange:P=!0}){const{rows:U}=ue(),V=typeof D=="number"?D:U,c=r.length>V,d=c?Math.min(V,r.length):r.length,w=d-1,B=typeof o=="number"||typeof v=="number",H=typeof o=="number"?o:v??l,M=H===l?l:G(r,Math.min(H,w)),[q,C]=ae(be,{rotateIndex:M>w?w-M:0,selectedIndex:M}),z=j(B),J=j(M),K=j(q);K.current=q;const N=j(O);N.current=O;const ee=j(r),E=le(()=>r.map(n=>y(n)?he:n.value),[r]),L=j(E);z.current=B,J.current=M,Y(()=>{P&&!ie(L.current,E)&&C({hasInitialSelection:z.current,initialIndex:J.current,type:"reset"}),L.current=E,ee.current=r},[r,E,P]),Y(()=>{if(typeof o=="number"){const n=G(r,Math.min(o,w));C({selectedIndex:n===l?0:n,type:"set"})}},[o,r,w]);const Q=k((n,s)=>{const i=b(r,c,n,d);if(s===l){const x=$(i,0,-1);if(x===l)return;C({rotateIndex:n,selectedIndex:x,type:"navigate"}),typeof f=="function"&&f(i[x],x);return}const g=(c?d:r.length)-1,a=s===0,p=a?g:s-1,m=a&&c?n+1:n,h=b(r,c,m,d),I=y(h[p])?$(h,p,-1):p;I!==l&&(C({rotateIndex:m,selectedIndex:I,type:"navigate"}),typeof f=="function"&&f(h[I],I))},[c,d,r,f]),W=k((n,s)=>{const i=b(r,c,n,d);if(s===l){const x=$(i,i.length-1,1);if(x===l)return;C({rotateIndex:n,selectedIndex:x,type:"navigate"}),typeof f=="function"&&f(i[x],x);return}const g=(c?d:r.length)-1,a=s===g,p=a?0:s+1,m=a&&c?n-1:n,h=b(r,c,m,d),I=y(h[p])?$(h,p,1):p;I!==l&&(C({rotateIndex:m,selectedIndex:I,type:"navigate"}),typeof f=="function"&&f(h[I],I))},[c,d,r,f]);de(k((n,s)=>{const{rotateIndex:i,selectedIndex:g}=K.current;if((n==="k"||s.upArrow)&&Q(i,g),(n==="j"||s.downArrow)&&W(i,g),ge.test(n)){const a=Number.parseInt(n,10)-1,p=b(r,c,i,d);if(a>=0&&a<p.length){const m=p[a];m&&!y(m)&&(N.current?.(m),m.action?.())}}if(s.return&&g!==l){const a=b(r,c,i,d)[g];a&&!y(a)&&(N.current?.(a),a.action?.())}},[Q,W,c,d,r]),{isActive:_});const te=b(r,c,q.rotateIndex,d);return T(A,{flexDirection:"column",children:te.map((n,s)=>{if(y(n))return T(A,{children:T(me,{dimColor:!0,children:n.label??ye})},n.key??`separator-${String(s)}`);const i=s===q.selectedIndex;return se(A,{children:[Z(u,{accentColor:t,isFocused:_,isSelected:i}),Z(X,{...n,accentColor:t,defaultColor:e,isFocused:_,isSelected:i})]},n.key??String(n.value))})})}F(ve,"Q");S(ve,"SelectInput");export{ve as SelectInput,ve as default};
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};
@@ -1 +1 @@
1
- var g=Object.defineProperty;var h=(e,r)=>g(e,"name",{value:r,configurable:!0});import{jsx as i}from"react/jsx-runtime";import{useMemo as f}from"react";import T from"../ink/hooks/use-animation.js";import{Text as n}from"./text.js";var S=Object.defineProperty,j=h((e,r)=>S(e,"name",{value:r,configurable:!0}),"c");function C({bandWidth:e=3,color:r,highlightColor:u="white",interval:p=60,text:l}){const{frame:s}=T({interval:p}),t=f(()=>[...l],[l]),c=t.length,x=c+e,b=c===0?0:s%x,v=f(()=>t.map((o,a)=>i(n,{color:r,dimColor:r===void 0,children:o},a)),[t,r]);if(c===0)return i(n,{color:r,children:l});const m=[];for(const[o,a]of t.entries()){const d=b-o;if(!(d>=0&&d<e)){m.push(v[o]);continue}m.push(i(n,{bold:!0,color:u,children:a},`band-${o}`))}return i(n,{children:m})}h(C,"d");j(C,"ShimmerText");export{C as ShimmerText,C as default};
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};
@@ -1 +1 @@
1
- var H=Object.defineProperty;var M=(t,i)=>H(t,"name",{value:i,configurable:!0});import{jsx as s,jsxs as L}from"react/jsx-runtime";import{useState as R,useRef as q,useCallback as E}from"react";import T from"../ink/hooks/use-input.js";import{Box as y}from"./box.js";import{Text as C}from"./text.js";var U=Object.defineProperty,G=M((t,i)=>U(t,"name",{value:i,configurable:!0}),"v");const j=G((t,i,v)=>Math.min(v,Math.max(i,t)),"clamp");function Z({accentColor:t="green",defaultColor:i="gray",defaultValue:v=0,emptyCharacter:D="░",filledCharacter:$="█",isDisabled:o=!1,isFocused:I=!0,max:z=100,min:O=0,onChange:P,orientation:d="horizontal",step:h=1,thumbCharacter:S="●",value:V,width:J=20}){const n=Math.min(O,z),c=Math.max(O,z),x=V!==void 0,[K,N]=R(j(v,n,c)),b=x?j(V,n,c):K,k=q(P);k.current=P;const m=q(b);m.current=b;const a=E(e=>{const r=j(e,n,c);x||N(r),k.current?.(r)},[n,c,x]),g=h*10,f=c-n,Q=E((e,r)=>{const A=d==="horizontal"?r.rightArrow:r.upArrow,p=d==="horizontal"?r.leftArrow:r.downArrow;if(A){a(m.current+h);return}if(p){a(m.current-h);return}if(r.pageUp){a(m.current+g);return}if(r.pageDown){a(m.current-g);return}if(r.home){a(n);return}if(r.end){a(c);return}if(e>="0"&&e<="9"){const F=Number.parseInt(e,10)/10;a(n+f*F)}},[h,g,n,c,f,d,a]);T(Q,{isActive:I&&!o});const w=Math.max(1,J),W=f===0?0:(b-n)/f,l=Math.round(W*(w-1));if(d==="vertical"){const e=[];for(let r=w-1;r>=0;r--){const A=r===l,p=r<=l;e.push(s(y,{children:s(C,{color:o?void 0:p?t:i,dimColor:o,children:A?S:p?$:D})},r))}return s(y,{flexDirection:"column",children:e})}let u="";for(let e=0;e<w;e++)e===l?u+=S:e<l?u+=$:u+=D;const X=u.slice(0,l),Y=u[l]??"",B=u.slice(l+1);return L(y,{children:[s(C,{color:o?void 0:t,dimColor:o,children:X}),s(C,{bold:!0,color:o?void 0:t,dimColor:o,children:Y}),s(C,{color:o?void 0:i,dimColor:o,children:B})]})}M(Z,"V");G(Z,"Slider");export{Z as Slider,Z as default};
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};
@@ -1 +1 @@
1
- var o=Object.defineProperty;var a=(r,e)=>o(r,"name",{value:e,configurable:!0});import{jsx as t}from"react/jsx-runtime";import{Box as f}from"./box.js";var n=Object.defineProperty,p=a((r,e)=>n(r,"name",{value:e,configurable:!0}),"e");function u(){return t(f,{flexGrow:1})}a(u,"t");p(u,"Spacer");export{u as Spacer,u as default};
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};