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

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 (325) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/LICENSE.md +63 -9
  3. package/README.md +3 -3
  4. package/dist/core/index.js +3 -3
  5. package/dist/ink/canvas/braille.d.ts +22 -0
  6. package/dist/ink/canvas/buffer.d.ts +67 -0
  7. package/dist/ink/components/accordion.d.ts +52 -0
  8. package/dist/ink/components/animate-presence.d.ts +15 -0
  9. package/dist/ink/components/approval-prompt.d.ts +55 -0
  10. package/dist/ink/components/area-chart.d.ts +54 -0
  11. package/dist/ink/components/bar-chart.d.ts +57 -0
  12. package/dist/ink/components/blink-dot.d.ts +30 -0
  13. package/dist/ink/components/breadcrumb.d.ts +28 -0
  14. package/dist/ink/components/button.d.ts +38 -0
  15. package/dist/ink/components/calendar.d.ts +60 -0
  16. package/dist/ink/components/canvas.d.ts +38 -0
  17. package/dist/ink/components/card.d.ts +46 -0
  18. package/dist/ink/components/chart-utils.d.ts +54 -0
  19. package/dist/ink/components/checkbox.d.ts +39 -0
  20. package/dist/ink/components/collapsible.d.ts +43 -0
  21. package/dist/ink/components/command-block.d.ts +38 -0
  22. package/dist/ink/components/command-palette.d.ts +72 -0
  23. package/dist/ink/components/confirm-dialog.d.ts +63 -0
  24. package/dist/ink/components/content-switcher.d.ts +49 -0
  25. package/dist/ink/components/date-picker.d.ts +53 -0
  26. package/dist/ink/components/definition-list.d.ts +37 -0
  27. package/dist/ink/components/divider.d.ts +40 -0
  28. package/dist/ink/components/file-picker/{FilePicker.d.ts → file-picker.d.ts} +2 -19
  29. package/dist/ink/components/file-picker/types.d.ts +1 -4
  30. package/dist/ink/components/file-picker/use-file-system.d.ts +1 -1
  31. package/dist/ink/components/form.d.ts +74 -0
  32. package/dist/ink/components/gauge.d.ts +75 -0
  33. package/dist/ink/components/heading.d.ts +27 -0
  34. package/dist/ink/components/heatmap.d.ts +51 -0
  35. package/dist/ink/components/{Help.d.ts → help.d.ts} +4 -9
  36. package/dist/ink/components/histogram.d.ts +52 -0
  37. package/dist/ink/components/kbd.d.ts +27 -0
  38. package/dist/ink/components/line-chart.d.ts +94 -0
  39. package/dist/ink/components/loading-indicator.d.ts +24 -0
  40. package/dist/ink/components/masked-input.d.ts +41 -0
  41. package/dist/ink/components/menu.d.ts +70 -0
  42. package/dist/ink/components/message-bubble.d.ts +35 -0
  43. package/dist/ink/components/model-badge.d.ts +32 -0
  44. package/dist/ink/components/operation-tree.d.ts +46 -0
  45. package/dist/ink/components/option-list.d.ts +41 -0
  46. package/dist/ink/components/{Paginator.d.ts → paginator.d.ts} +4 -20
  47. package/dist/ink/components/paragraph.d.ts +31 -0
  48. package/dist/ink/components/placeholder.d.ts +47 -0
  49. package/dist/ink/components/{ProgressBar.d.ts → progress-bar.d.ts} +1 -1
  50. package/dist/ink/components/radio-group.d.ts +62 -0
  51. package/dist/ink/components/scatter-plot.d.ts +23 -0
  52. package/dist/ink/components/scroll/{ControlledScrollView.d.ts → controlled-scroll-view.d.ts} +1 -1
  53. package/dist/ink/components/scroll/index.d.ts +10 -10
  54. package/dist/ink/components/scroll/{ScrollBarBox.d.ts → scroll-bar-box.d.ts} +1 -1
  55. package/dist/ink/components/scroll/{ScrollBar.d.ts → scroll-bar.d.ts} +1 -1
  56. package/dist/ink/components/scroll/{ScrollList.d.ts → scroll-list.d.ts} +1 -1
  57. package/dist/ink/components/scroll/{ScrollView.d.ts → scroll-view.d.ts} +1 -1
  58. package/dist/ink/components/search-input.d.ts +46 -0
  59. package/dist/ink/components/{SelectInput.d.ts → select-input.d.ts} +2 -2
  60. package/dist/ink/components/shimmer-text.d.ts +39 -0
  61. package/dist/ink/components/sparkline.d.ts +30 -0
  62. package/dist/ink/components/{Spinner.d.ts → spinner.d.ts} +2 -4
  63. package/dist/ink/components/{StaticRender.d.ts → static-render.d.ts} +14 -2
  64. package/dist/ink/components/status-line.d.ts +30 -0
  65. package/dist/ink/components/stepper.d.ts +42 -0
  66. package/dist/ink/components/{Stopwatch.d.ts → stopwatch.d.ts} +5 -7
  67. package/dist/ink/components/streaming-text.d.ts +38 -0
  68. package/dist/ink/components/switch.d.ts +46 -0
  69. package/dist/ink/components/{Tabs.d.ts → tabs.d.ts} +1 -1
  70. package/dist/ink/components/tag.d.ts +30 -0
  71. package/dist/ink/components/{Timer.d.ts → timer.d.ts} +5 -7
  72. package/dist/ink/components/toast.d.ts +41 -0
  73. package/dist/ink/components/tooltip.d.ts +36 -0
  74. package/dist/ink/components/transition.d.ts +53 -0
  75. package/dist/ink/components/tree-view/theme.d.ts +2 -2
  76. package/dist/ink/cursor-helpers.d.ts +0 -3
  77. package/dist/ink/dom.d.ts +9 -8
  78. package/dist/ink/hooks/use-animation.d.ts +0 -2
  79. package/dist/ink/hooks/use-app.d.ts +1 -1
  80. package/dist/ink/hooks/use-focus-manager.d.ts +1 -1
  81. package/dist/ink/hooks/use-form.d.ts +70 -0
  82. package/dist/ink/hooks/use-hotkey.d.ts +37 -0
  83. package/dist/ink/hooks/use-interval.d.ts +25 -0
  84. package/dist/ink/hooks/use-key-bindings.d.ts +4 -6
  85. package/dist/ink/hooks/use-key-chord.d.ts +26 -0
  86. package/dist/ink/hooks/use-linked-scroll.d.ts +1 -1
  87. package/dist/ink/hooks/use-persistent-state.d.ts +56 -0
  88. package/dist/ink/hooks/use-stderr.d.ts +1 -1
  89. package/dist/ink/hooks/use-stdin.d.ts +1 -1
  90. package/dist/ink/hooks/use-stdout.d.ts +1 -1
  91. package/dist/ink/hooks/use-stopwatch.d.ts +1 -3
  92. package/dist/ink/hooks/use-timeout.d.ts +24 -0
  93. package/dist/ink/hooks/use-timer.d.ts +0 -2
  94. package/dist/ink/index.d.ts +228 -92
  95. package/dist/ink/index.js +132 -77
  96. package/dist/ink/ink.d.ts +7 -6
  97. package/dist/ink/mouse/constants.d.ts +5 -50
  98. package/dist/ink/mouse/index.d.ts +2 -2
  99. package/dist/ink/output.d.ts +2 -1
  100. package/dist/ink/styled-line.d.ts +10 -0
  101. package/dist/ink/write-synchronized.d.ts +2 -2
  102. package/dist/packem_shared/Accordion-BG-yfIkV.js +80 -0
  103. package/dist/packem_shared/{Alert-Dr3s_LD9.js → Alert-BLcwIW8V.js} +2 -2
  104. package/dist/packem_shared/AnimatePresence-D8nEOr_B.js +98 -0
  105. package/dist/packem_shared/ApprovalPrompt-BXdPros1.js +104 -0
  106. package/dist/packem_shared/AreaChart-CmTcxLum.js +116 -0
  107. package/dist/packem_shared/{Badge-Dk7EGGM6.js → Badge-CUfbXwAB.js} +1 -1
  108. package/dist/packem_shared/BarChart-DWRae67P.js +87 -0
  109. package/dist/packem_shared/{BigText-CjMdY63X.js → BigText-CVq2X7B5.js} +1 -1
  110. package/dist/packem_shared/BlinkDot-CrbHMR3L.js +11 -0
  111. package/dist/packem_shared/{Box-D_pSJ9Jp.js → Box-W1w_NGin.js} +4 -6
  112. package/dist/packem_shared/Breadcrumb-CPdNxVYs.js +26 -0
  113. package/dist/packem_shared/Button-CBmTbJ_D.js +57 -0
  114. package/dist/packem_shared/Calendar-C2Qxt-LA.js +139 -0
  115. package/dist/packem_shared/Canvas-COttmLPX.js +246 -0
  116. package/dist/packem_shared/Card-D3tGkNCm.js +24 -0
  117. package/dist/packem_shared/Checkbox-Dpy_4Lws.js +49 -0
  118. package/dist/packem_shared/{Code-DjQvPBD9.js → Code-CwzzbsLx.js} +3 -3
  119. package/dist/packem_shared/Collapsible-BMDrXf5C.js +45 -0
  120. package/dist/packem_shared/CommandBlock-jdOGJPjY.js +80 -0
  121. package/dist/packem_shared/CommandPalette-B5IfUQwi.js +146 -0
  122. package/dist/packem_shared/ConfirmDialog-5XJv3Cc4.js +67 -0
  123. package/dist/packem_shared/{ConfirmInput-85Y4kRQW.js → ConfirmInput-CxUS0XAA.js} +3 -3
  124. package/dist/packem_shared/{ConsoleOverlay-DBNa4vtj.js → ConsoleOverlay-BvnCEgjG.js} +2 -2
  125. package/dist/packem_shared/ContentSwitcher-BHFpO5Za.js +81 -0
  126. package/dist/packem_shared/ControlledScrollView-C2wOOlJO.js +5 -0
  127. package/dist/packem_shared/DatePicker-CPejKoqS.js +73 -0
  128. package/dist/packem_shared/DefinitionList-BAwr0l5J.js +18 -0
  129. package/dist/packem_shared/{DevTools-aMPIsaHx.js → DevTools-BdxRSkhL.js} +6 -4
  130. package/dist/packem_shared/{Dialog-DsSNAVgC.js → Dialog-S9r7Izff.js} +5 -5
  131. package/dist/packem_shared/{DiffView-hqaw-2S6.js → DiffView-BR4T6-Sj.js} +4 -4
  132. package/dist/packem_shared/Divider-DocXIqNn.js +30 -0
  133. package/dist/packem_shared/{FilePicker-DNwFxRhq.js → FilePicker-BZ55oF_n.js} +39 -32
  134. package/dist/packem_shared/FormField-BSG16cnA.js +29 -0
  135. package/dist/packem_shared/{Fullscreen-DrElAE1o.js → Fullscreen-DO7voOq5.js} +2 -2
  136. package/dist/packem_shared/Gauge-CKXUXxft.js +122 -0
  137. package/dist/packem_shared/{Gradient-Ql5P0GUd.js → Gradient-Dg0NezWc.js} +3 -3
  138. package/dist/packem_shared/Heading-BnR7McmP.js +29 -0
  139. package/dist/packem_shared/Heatmap-_jqISOU0.js +79 -0
  140. package/dist/packem_shared/{Help-6wanGG38.js → Help-0yZ_IcQg.js} +4 -11
  141. package/dist/packem_shared/Histogram-cgAjY5AJ.js +92 -0
  142. package/dist/packem_shared/{InputParser-BKHpWfvN.js → InputParser-BlsfeY9J.js} +8 -6
  143. package/dist/packem_shared/KEY-STOdi-nc.js +74 -0
  144. package/dist/packem_shared/Kbd-BNDXQgey.js +19 -0
  145. package/dist/packem_shared/{LayoutNode-Cjnsodiy.js → LayoutNode-DAkKg9TE.js} +5 -7
  146. package/dist/packem_shared/LineChart-ef3HF816.js +7 -0
  147. package/dist/packem_shared/{Link-COcKYfGT.js → Link-DZ2Tiq1m.js} +2 -2
  148. package/dist/packem_shared/LoadingIndicator-DzbLGfyJ.js +13 -0
  149. package/dist/packem_shared/{Markdown-y1ISztof.js → Markdown-33bpCUoe.js} +8 -8
  150. package/dist/packem_shared/MaskedInput-Ctr6v2dO.js +119 -0
  151. package/dist/packem_shared/Menu-CeKxhEix.js +112 -0
  152. package/dist/packem_shared/MessageBubble-BMoU8L2Q.js +26 -0
  153. package/dist/packem_shared/ModelBadge-CNIxPs7v.js +40 -0
  154. package/dist/packem_shared/{MouseProvider-Y9TSSEGl.js → MouseProvider-CekPbXCh.js} +3 -3
  155. package/dist/packem_shared/{MultiSelect-ChoLUcDI.js → MultiSelect-yz7-w0Zv.js} +4 -4
  156. package/dist/packem_shared/{NAMED_COLORS-a4QBvb5r.js → NAMED_COLORS-DcI3erCu.js} +79 -41
  157. package/dist/packem_shared/OperationTree-Dudx5o1o.js +67 -0
  158. package/dist/packem_shared/OptionList-CTyqQaZ1.js +24 -0
  159. package/dist/packem_shared/{OrderedList-Cp7pXr6m.js → OrderedList-VsvSmHUC.js} +2 -2
  160. package/dist/packem_shared/{Paginator-D1AuD-kj.js → Paginator-DmGogvEI.js} +44 -44
  161. package/dist/packem_shared/Paragraph-CNNhfepo.js +9 -0
  162. package/dist/packem_shared/Placeholder-DkM69Q8Z.js +29 -0
  163. package/dist/packem_shared/{ProgressBar-DOfpVagn.js → ProgressBar-B7cS4uQm.js} +2 -2
  164. package/dist/packem_shared/RadioGroup-B4F9PUyL.js +108 -0
  165. package/dist/packem_shared/{ResizeObserverEntry-Br4seLeQ.js → ResizeObserverEntry-Vr8GZ74x.js} +4 -4
  166. package/dist/packem_shared/ScatterPlot-CWOg4G5h.js +63 -0
  167. package/dist/packem_shared/{ScrollBar-EWAs2Uc7.js → ScrollBar-DFeWH43I.js} +2 -2
  168. package/dist/packem_shared/{ScrollBarBox-DTNNlh7R.js → ScrollBarBox-C7VL6Izd.js} +2 -2
  169. package/dist/packem_shared/{ScrollList-DCeIFL8M.js → ScrollList-DRcr_RrN.js} +2 -2
  170. package/dist/packem_shared/{ScrollView-v3MCNIyX.js → ScrollView-C6rdlGwU.js} +4 -4
  171. package/dist/packem_shared/SearchInput-cB8zFhSg.js +32 -0
  172. package/dist/packem_shared/{SelectInput-BN2TMyxp.js → SelectInput-WzZSqp72.js} +6 -6
  173. package/dist/packem_shared/{SelectInputIndicator-DkRMoH_b.js → SelectInputIndicator-DKeN6v5Z.js} +2 -2
  174. package/dist/packem_shared/{SelectInputItem-BF9LQgKu.js → SelectInputItem-CxFL3spM.js} +1 -1
  175. package/dist/packem_shared/ShimmerText-B2VbPUSB.js +34 -0
  176. package/dist/packem_shared/{Slider-BWD7xZX6.js → Slider-BOrNTOQe.js} +3 -3
  177. package/dist/packem_shared/{Spacer-Bs4ER-HK.js → Spacer-DhmXyTb8.js} +1 -1
  178. package/dist/packem_shared/Sparkline-BSbjPrwK.js +44 -0
  179. package/dist/packem_shared/Spinner-BcO5BCAa.js +1942 -0
  180. package/dist/packem_shared/StaticRender-C3XWvJdC.js +69 -0
  181. package/dist/packem_shared/StatusLine-DQNUstN9.js +22 -0
  182. package/dist/packem_shared/{StatusMessage-BtSYxzwb.js → StatusMessage-BYTL6Pl-.js} +2 -2
  183. package/dist/packem_shared/Stepper-CmUPRK3z.js +60 -0
  184. package/dist/packem_shared/Stopwatch-zqLQAxXC.js +21 -0
  185. package/dist/packem_shared/StreamingText-BmuoJtGu.js +38 -0
  186. package/dist/packem_shared/Switch-DcPdy8nm.js +59 -0
  187. package/dist/packem_shared/{Table-D-rSVlzb.js → Table-Bgxo87Df.js} +11 -5
  188. package/dist/packem_shared/{Tabs-hki-KRnx.js → Tabs-DubuHdYV.js} +30 -19
  189. package/dist/packem_shared/Tag-CCqM7Ee9.js +35 -0
  190. package/dist/packem_shared/{Text-DvAUdZcK.js → Text-CtUwV89_.js} +2 -2
  191. package/dist/packem_shared/{TextInput-C79WEQ5U.js → TextInput-C9r7zT0U.js} +3 -3
  192. package/dist/packem_shared/{Textarea-Dj06R6Zd.js → Textarea-CGmgt-Nl.js} +5 -5
  193. package/dist/packem_shared/Timer-D7ZZ0_wz.js +20 -0
  194. package/dist/packem_shared/Toast-DXSCXFPY.js +37 -0
  195. package/dist/packem_shared/Tooltip-SvVjj-2k.js +32 -0
  196. package/dist/packem_shared/{Transform-BHxY_dAM.js → Transform-Cfyva2wd.js} +1 -1
  197. package/dist/packem_shared/Transition-CbNfKhaj.js +108 -0
  198. package/dist/packem_shared/{TreeView-C2062dtj.js → TreeView-DGlZeSsK.js} +4 -4
  199. package/dist/packem_shared/{TuiApp-DfxOnXqi.js → TuiApp-DtdgNRWa.js} +4 -2
  200. package/dist/packem_shared/{TuiContext-CqEjMyXd.js → TuiContext-lXmJFd-x.js} +6 -3
  201. package/dist/packem_shared/{UnorderedList-DhnadWjX.js → UnorderedList-D8RPaEAW.js} +2 -2
  202. package/dist/packem_shared/{ansi-parser-0BdVTKho.js → ansi-parser-BOP8fNdT.js} +6 -4
  203. package/dist/packem_shared/braille-BoEWoH2I.js +93 -0
  204. package/dist/packem_shared/{comparePoints-CGMDnd3_.js → comparePoints-CAAlhiMS.js} +2 -2
  205. package/dist/packem_shared/{ControlledScrollView-BlOaxcsN.js → controlled-scroll-view-DJXfdWMm.js} +2 -2
  206. package/dist/packem_shared/{createInlineLoop-BxMmcq9D.js → createInlineLoop-Dnfm1ZSJ.js} +19 -13
  207. package/dist/packem_shared/createMemoryStorage-esFJ61La.js +115 -0
  208. package/dist/packem_shared/createScreen-Dh0sZlQ0.js +38 -0
  209. package/dist/packem_shared/{dom-DvzhsAez.js → dom-CrbpQgat.js} +17 -14
  210. package/dist/packem_shared/{getPathToRoot-a1wbwxfL.js → getPathToRoot-BbvlppLC.js} +2 -2
  211. package/dist/packem_shared/{getScrollHeight-BubfU_df.js → getScrollHeight-Cz3CDQN2.js} +5 -5
  212. package/dist/packem_shared/line-chart-VGU2l7pu.js +139 -0
  213. package/dist/packem_shared/{measure-element-Reza_yfC.js → measure-element-Bc6PEaIe.js} +26 -17
  214. package/dist/packem_shared/{measure-text-DItZYotK.js → measure-text-BdOhbOeh.js} +74 -7
  215. package/dist/packem_shared/{measureElement-CTgFCmKd.js → measureElement-DTELRaij.js} +2 -2
  216. package/dist/packem_shared/parseSgrMouse-4hpBJBsW.js +1 -0
  217. package/dist/packem_shared/{processLayout-BQ9kXfd3.js → processLayout-B0Coz0Ua.js} +1 -1
  218. package/dist/packem_shared/{reconciler-gfmqURLy.js → reconciler-Dd7Z0A97.js} +21 -5
  219. package/dist/packem_shared/{reconciler-BXf6miSS.js → reconciler-mzMwSOft.js} +23 -13
  220. package/dist/packem_shared/{render-BAwdjfki.js → render-Bm9Oa1sG.js} +72 -79
  221. package/dist/packem_shared/{render-Bpjhf0lD.js → render-CjlKdg4m.js} +15 -11
  222. package/dist/packem_shared/{renderToString-ClIaXgrC.js → renderToString-CWYS1ZXE.js} +4 -4
  223. package/dist/packem_shared/{renderToString-Cfg55DRD.js → renderToString-DB3ILWFm.js} +4 -4
  224. package/dist/packem_shared/{renderTreeToBuffer-D3mo7M7m.js → renderTreeToBuffer-CDDTGyZn.js} +8 -5
  225. package/dist/packem_shared/{renderer-B3wROkeg.js → renderer-GE9OLNNM.js} +47 -41
  226. package/dist/packem_shared/{setEnableStyledLineCache-BpskngSJ.js → setEnableStyledLineCache-D5f4favX.js} +1 -1
  227. package/dist/packem_shared/{text-width-DhuarWcB.js → text-width-Db-AxMea.js} +2 -1
  228. package/dist/packem_shared/{token-to-elements-BRFl_rzw.js → token-to-elements-CK4s8MJd.js} +2 -2
  229. package/dist/packem_shared/{useAnimation-kj31sA-T.js → useAnimation-DV22qxiJ.js} +2 -2
  230. package/dist/packem_shared/{useApp-DPQlRzi5.js → useApp-Cbi788rV.js} +1 -1
  231. package/dist/packem_shared/{useBoxMetrics-rBjKc-g4.js → useBoxMetrics-_5icypir.js} +2 -2
  232. package/dist/packem_shared/{useClipboard-B_9-adw1.js → useClipboard-MNj6MNR-.js} +1 -1
  233. package/dist/packem_shared/{useCursor-BIJzc8k9.js → useCursor-DS6LjIgv.js} +1 -1
  234. package/dist/packem_shared/{useFocus-CNl5QHHf.js → useFocus-DLoGQJd9.js} +2 -2
  235. package/dist/packem_shared/{useFocusManager-BPYaUuKQ.js → useFocusManager-UeZWtnNc.js} +1 -1
  236. package/dist/packem_shared/useForm-sQENbEuv.js +88 -0
  237. package/dist/packem_shared/useHotkey-D9giUX3q.js +112 -0
  238. package/dist/packem_shared/{useInput-Cfp5zB2s.js → useInput-DKZbqMRc.js} +2 -2
  239. package/dist/packem_shared/useInterval-CSXM8c2I.js +32 -0
  240. package/dist/packem_shared/{useIsScreenReaderEnabled-CnGKCe0f.js → useIsScreenReaderEnabled-BeoVqo1R.js} +1 -1
  241. package/dist/packem_shared/{useKeyBindings-B78l1E1n.js → useKeyBindings-S4fSIEAk.js} +2 -2
  242. package/dist/packem_shared/useKeyChord-BmXGNuEO.js +114 -0
  243. package/dist/packem_shared/{usePaste-Ct8J4AGR.js → usePaste-png73gvT.js} +2 -2
  244. package/dist/packem_shared/{useScrollInput-D3CpBq_a.js → useScrollInput-DfzRGQFe.js} +2 -2
  245. package/dist/packem_shared/{useStderr-CAOVUh4E.js → useStderr-BSWerMZ7.js} +1 -1
  246. package/dist/packem_shared/{useStdin-X-O0kd-n.js → useStdin-Rf0zPzVA.js} +1 -1
  247. package/dist/packem_shared/{useStdout-DyF6DSH0.js → useStdout-B5yRcg9N.js} +1 -1
  248. package/dist/packem_shared/{useStopwatch-qC4Beai4.js → useStopwatch-C__Zu6hd.js} +2 -2
  249. package/dist/packem_shared/{useTerminalPalette-BaWO2c4Q.js → useTerminalPalette-CtFG2JTq.js} +2 -2
  250. package/dist/packem_shared/{useTextSelection-mXtxgsPK.js → useTextSelection-ChrYZXsn.js} +2 -2
  251. package/dist/packem_shared/useTimeout-DuCqgWPX.js +34 -0
  252. package/dist/packem_shared/{useTimer-CPQ7j827.js → useTimer-DnBtbhB5.js} +1 -1
  253. package/dist/packem_shared/{useTreeView-BT57P3Kx.js → useTreeView-mkN5Di7w.js} +1 -1
  254. package/dist/packem_shared/{useWindowSize-ugEmGZJm.js → useWindowSize-D3UU41mv.js} +1 -1
  255. package/dist/packem_shared/waitFor-Cv9M2jKA.js +39 -0
  256. package/dist/packem_shared/{wrapOrTruncateStyledLine-DN3Nogoc.js → wrapOrTruncateStyledLine-49Mne3t3.js} +1 -1
  257. package/dist/react/index.js +7 -7
  258. package/dist/react/layout.d.ts +0 -2
  259. package/dist/testing/index.d.ts +4 -4
  260. package/dist/testing/index.js +6 -114
  261. package/dist/testing/wait-for.d.ts +0 -1
  262. package/index.js +691 -539
  263. package/package.json +17 -17
  264. package/dist/ink/components/file-picker/index.d.ts +0 -3
  265. package/dist/ink/components/tree-view/index.d.ts +0 -11
  266. package/dist/packem_shared/ControlledScrollView-DfAhcufF.js +0 -5
  267. package/dist/packem_shared/Spinner-BuI-kN4p.js +0 -1799
  268. package/dist/packem_shared/StaticRender-tYwH6QXl.js +0 -33
  269. package/dist/packem_shared/Stopwatch-DjtTCyHn.js +0 -23
  270. package/dist/packem_shared/Timer-wi9zuh4n.js +0 -22
  271. package/dist/packem_shared/parseSgrMouse-BHVBPP9G.js +0 -1
  272. /package/dist/ink/components/{AccessibilityContext.d.ts → accessibility-context.d.ts} +0 -0
  273. /package/dist/ink/components/{Alert.d.ts → alert.d.ts} +0 -0
  274. /package/dist/ink/components/{AnimationContext.d.ts → animation-context.d.ts} +0 -0
  275. /package/dist/ink/components/{AppContext.d.ts → app-context.d.ts} +0 -0
  276. /package/dist/ink/components/{App.d.ts → app.d.ts} +0 -0
  277. /package/dist/ink/components/{BackgroundContext.d.ts → background-context.d.ts} +0 -0
  278. /package/dist/ink/components/{Badge.d.ts → badge.d.ts} +0 -0
  279. /package/dist/ink/components/{BigText.d.ts → big-text.d.ts} +0 -0
  280. /package/dist/ink/components/{Box.d.ts → box.d.ts} +0 -0
  281. /package/dist/ink/components/{Code.d.ts → code.d.ts} +0 -0
  282. /package/dist/ink/components/{ConfirmInput.d.ts → confirm-input.d.ts} +0 -0
  283. /package/dist/ink/components/{ConsoleOverlay.d.ts → console-overlay.d.ts} +0 -0
  284. /package/dist/ink/components/{CursorContext.d.ts → cursor-context.d.ts} +0 -0
  285. /package/dist/ink/components/{Cursor.d.ts → cursor.d.ts} +0 -0
  286. /package/dist/ink/components/{Dialog.d.ts → dialog.d.ts} +0 -0
  287. /package/dist/ink/components/{DiffView.d.ts → diff-view.d.ts} +0 -0
  288. /package/dist/ink/components/{ErrorBoundary.d.ts → error-boundary.d.ts} +0 -0
  289. /package/dist/ink/components/{ErrorOverview.d.ts → error-overview.d.ts} +0 -0
  290. /package/dist/ink/components/{FocusContext.d.ts → focus-context.d.ts} +0 -0
  291. /package/dist/ink/components/{Gradient.d.ts → gradient.d.ts} +0 -0
  292. /package/dist/ink/components/{Link.d.ts → link.d.ts} +0 -0
  293. /package/dist/ink/components/{Markdown.d.ts → markdown.d.ts} +0 -0
  294. /package/dist/ink/components/{MultiSelect.d.ts → multi-select.d.ts} +0 -0
  295. /package/dist/ink/components/{Newline.d.ts → newline.d.ts} +0 -0
  296. /package/dist/ink/components/{OrderedList.d.ts → ordered-list.d.ts} +0 -0
  297. /package/dist/ink/components/{SelectInputIndicator.d.ts → select-input-indicator.d.ts} +0 -0
  298. /package/dist/ink/components/{SelectInputItem.d.ts → select-input-item.d.ts} +0 -0
  299. /package/dist/ink/components/{Slider.d.ts → slider.d.ts} +0 -0
  300. /package/dist/ink/components/{Spacer.d.ts → spacer.d.ts} +0 -0
  301. /package/dist/ink/components/{Static.d.ts → static.d.ts} +0 -0
  302. /package/dist/ink/components/{StatusMessage.d.ts → status-message.d.ts} +0 -0
  303. /package/dist/ink/components/{StderrContext.d.ts → stderr-context.d.ts} +0 -0
  304. /package/dist/ink/components/{StdinContext.d.ts → stdin-context.d.ts} +0 -0
  305. /package/dist/ink/components/{StdoutContext.d.ts → stdout-context.d.ts} +0 -0
  306. /package/dist/ink/components/{Tab.d.ts → tab.d.ts} +0 -0
  307. /package/dist/ink/components/{Table.d.ts → table.d.ts} +0 -0
  308. /package/dist/ink/components/{TextInput.d.ts → text-input.d.ts} +0 -0
  309. /package/dist/ink/components/{Text.d.ts → text.d.ts} +0 -0
  310. /package/dist/ink/components/{Textarea.d.ts → textarea.d.ts} +0 -0
  311. /package/dist/ink/components/{Transform.d.ts → transform.d.ts} +0 -0
  312. /package/dist/ink/components/tree-view/{TreeViewNode.d.ts → tree-view-node.d.ts} +0 -0
  313. /package/dist/ink/components/tree-view/{TreeView.d.ts → tree-view.d.ts} +0 -0
  314. /package/dist/ink/components/{UnorderedList.d.ts → unordered-list.d.ts} +0 -0
  315. /package/dist/ink/mouse/{Fullscreen.d.ts → fullscreen.d.ts} +0 -0
  316. /package/dist/ink/mouse/{MouseProvider.d.ts → mouse-provider.d.ts} +0 -0
  317. /package/dist/packem_shared/{AccessibilityContext-BLelHhNU.js → accessibility-context-BLelHhNU.js} +0 -0
  318. /package/dist/packem_shared/{AnimationContext-BcJg8Jr6.js → animation-context-BcJg8Jr6.js} +0 -0
  319. /package/dist/packem_shared/{AppContext-CP0U6H7O.js → app-context-CP0U6H7O.js} +0 -0
  320. /package/dist/packem_shared/{BackgroundContext-BAUaxfOb.js → background-context-BAUaxfOb.js} +0 -0
  321. /package/dist/packem_shared/{CursorContext-JxRzlqAx.js → cursor-context-JxRzlqAx.js} +0 -0
  322. /package/dist/packem_shared/{FocusContext-CWkYtgcm.js → focus-context-CWkYtgcm.js} +0 -0
  323. /package/dist/packem_shared/{StderrContext-Bj4Mf7v7.js → stderr-context-Bj4Mf7v7.js} +0 -0
  324. /package/dist/packem_shared/{StdinContext-Bq_GNJ3z.js → stdin-context-Bq_GNJ3z.js} +0 -0
  325. /package/dist/packem_shared/{StdoutContext-CgjWeCdO.js → stdout-context-CgjWeCdO.js} +0 -0
@@ -1,8 +1,8 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { useMemo } from 'react';
3
3
  import useConsoleCapture from './useConsoleCapture-Dvt7G1W1.js';
4
- import Box from './Box-D_pSJ9Jp.js';
5
- import Text from './Text-DvAUdZcK.js';
4
+ import Box from './Box-W1w_NGin.js';
5
+ import Text from './Text-CtUwV89_.js';
6
6
 
7
7
  const LEVEL_COLORS = {
8
8
  debug: "gray",
@@ -0,0 +1,81 @@
1
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
+ import { useState, useMemo, useCallback } from 'react';
3
+ import useFocus from './useFocus-DLoGQJd9.js';
4
+ import useInput from './useInput-DKZbqMRc.js';
5
+ import Box from './Box-W1w_NGin.js';
6
+ import Text from './Text-CtUwV89_.js';
7
+
8
+ function ContentSwitcher({
9
+ accentColor = "blue",
10
+ autoFocus = false,
11
+ defaultValue,
12
+ isDisabled = false,
13
+ onChange,
14
+ options,
15
+ value
16
+ }) {
17
+ const { isFocused } = useFocus({ autoFocus, isActive: !isDisabled });
18
+ const initialId = defaultValue ?? options[0]?.id;
19
+ const [internal, setInternal] = useState(initialId);
20
+ const current = value ?? internal;
21
+ const currentIndex = useMemo(() => {
22
+ if (current === void 0) {
23
+ return 0;
24
+ }
25
+ const index = options.findIndex((option) => option.id === current);
26
+ return Math.max(index, 0);
27
+ }, [options, current]);
28
+ const commit = useCallback(
29
+ (index) => {
30
+ const target = options[index];
31
+ if (!target) {
32
+ return;
33
+ }
34
+ const currentId = value ?? internal;
35
+ if (target.id === currentId) {
36
+ return;
37
+ }
38
+ if (value === void 0) {
39
+ setInternal(target.id);
40
+ }
41
+ onChange?.(target.id);
42
+ },
43
+ [options, value, internal, onChange]
44
+ );
45
+ useInput(
46
+ useCallback(
47
+ (input, key) => {
48
+ if (!isFocused) {
49
+ return;
50
+ }
51
+ if (key.leftArrow || input === "h") {
52
+ commit(Math.max(0, currentIndex - 1));
53
+ } else if (key.rightArrow || input === "l") {
54
+ commit(Math.min(options.length - 1, currentIndex + 1));
55
+ }
56
+ },
57
+ [isFocused, currentIndex, options.length, commit]
58
+ ),
59
+ { isActive: !isDisabled && isFocused }
60
+ );
61
+ const activeOption = options[currentIndex];
62
+ return jsxs(Box, { flexDirection: "column", children: [
63
+ jsx(Box, { children: options.map((option, index) => {
64
+ const isActive = index === currentIndex;
65
+ const background = isActive ? accentColor : void 0;
66
+ const color = isActive ? "black" : void 0;
67
+ return jsxs(Text, { backgroundColor: background, color, dimColor: isDisabled && !isActive, children: [
68
+ " ",
69
+ option.icon === void 0 ? void 0 : jsxs(Fragment, { children: [
70
+ option.icon,
71
+ " "
72
+ ] }),
73
+ option.label,
74
+ " "
75
+ ] }, option.id);
76
+ }) }),
77
+ activeOption === void 0 ? void 0 : jsx(Box, { flexDirection: "column", marginTop: 1, children: activeOption.content })
78
+ ] });
79
+ }
80
+
81
+ export { ContentSwitcher as default };
@@ -0,0 +1,5 @@
1
+ import 'react/jsx-runtime';
2
+ import 'react';
3
+ import './measure-element-Bc6PEaIe.js';
4
+ import './Box-W1w_NGin.js';
5
+ export { C as ControlledScrollView } from './controlled-scroll-view-DJXfdWMm.js';
@@ -0,0 +1,73 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useState, useCallback } from 'react';
3
+ import useFocus from './useFocus-DLoGQJd9.js';
4
+ import useInput from './useInput-DKZbqMRc.js';
5
+ import Box from './Box-W1w_NGin.js';
6
+ import Calendar from './Calendar-C2Qxt-LA.js';
7
+ import Text from './Text-CtUwV89_.js';
8
+
9
+ const defaultFormat = (date) => {
10
+ const year = date.getFullYear();
11
+ const month = String(date.getMonth() + 1).padStart(2, "0");
12
+ const day = String(date.getDate()).padStart(2, "0");
13
+ return `${year}-${month}-${day}`;
14
+ };
15
+ function DatePicker({
16
+ accentColor = "blue",
17
+ autoFocus = false,
18
+ defaultValue,
19
+ formatValue = defaultFormat,
20
+ isDisabled = false,
21
+ maxDate,
22
+ minDate,
23
+ onChange,
24
+ placeholder = "Pick a date",
25
+ value
26
+ }) {
27
+ const { isFocused } = useFocus({ autoFocus, isActive: !isDisabled });
28
+ const [isOpen, setIsOpen] = useState(false);
29
+ const [internal, setInternal] = useState(defaultValue);
30
+ const current = value ?? internal;
31
+ useInput(
32
+ useCallback(
33
+ (input, key) => {
34
+ if (!isFocused || isOpen) {
35
+ return;
36
+ }
37
+ if (key.return || input === " ") {
38
+ setIsOpen(true);
39
+ }
40
+ },
41
+ [isFocused, isOpen]
42
+ ),
43
+ { isActive: !isDisabled && isFocused && !isOpen }
44
+ );
45
+ useInput(
46
+ useCallback((_input, key) => {
47
+ if (key.escape) {
48
+ setIsOpen(false);
49
+ }
50
+ }, []),
51
+ { isActive: !isDisabled && isFocused && isOpen }
52
+ );
53
+ const handleCalendarSubmit = useCallback(
54
+ (date) => {
55
+ if (value === void 0) {
56
+ setInternal(date);
57
+ }
58
+ setIsOpen(false);
59
+ onChange?.(date);
60
+ },
61
+ [value, onChange]
62
+ );
63
+ return jsxs(Box, { flexDirection: "column", children: [
64
+ jsxs(Box, { borderColor: isFocused ? accentColor : void 0, borderStyle: "round", paddingX: 1, children: [
65
+ jsx(Text, { color: accentColor, children: "📅 " }),
66
+ current === void 0 ? jsx(Text, { dimColor: true, children: placeholder }) : jsx(Text, { bold: true, children: formatValue(current) }),
67
+ isFocused && !isOpen ? jsx(Box, { marginLeft: 1, children: jsx(Text, { dimColor: true, children: "(Enter to open)" }) }) : void 0
68
+ ] }),
69
+ isOpen ? jsx(Box, { marginTop: 1, children: jsx(Calendar, { accentColor, autoFocus: true, defaultValue: current, maxDate, minDate, onSubmit: handleCalendarSubmit }) }) : void 0
70
+ ] });
71
+ }
72
+
73
+ export { DatePicker as default };
@@ -0,0 +1,18 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import Box from './Box-W1w_NGin.js';
3
+ import Text from './Text-CtUwV89_.js';
4
+
5
+ function DefinitionList({ columnGap = 2, items, layout = "inline", termColor = "cyan", termWidth }) {
6
+ if (layout === "stacked") {
7
+ return jsx(Box, { flexDirection: "column", gap: 1, children: items.map((item, index) => jsxs(Box, { flexDirection: "column", children: [
8
+ jsx(Text, { bold: true, color: termColor, children: item.term }),
9
+ jsx(Text, { children: item.description })
10
+ ] }, item.key ?? index)) });
11
+ }
12
+ return jsx(Box, { flexDirection: "column", children: items.map((item, index) => jsxs(Box, { gap: columnGap, children: [
13
+ jsx(Box, { flexShrink: 0, width: termWidth, children: jsx(Text, { color: termColor, children: item.term }) }),
14
+ jsx(Box, { flexGrow: 1, flexShrink: 1, children: jsx(Text, { children: item.description }) })
15
+ ] }, item.key ?? index)) });
16
+ }
17
+
18
+ export { DefinitionList as default };
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { useState, useRef, useEffect } from 'react';
3
- import { useWindowSize, useTuiContext } from './TuiContext-CqEjMyXd.js';
4
- import { _Box, _Spacer, _Text } from './render-Bpjhf0lD.js';
3
+ import { useWindowSize, useTuiContext } from './TuiContext-lXmJFd-x.js';
4
+ import { _Box, _Spacer, _Text } from './render-CjlKdg4m.js';
5
5
 
6
6
  function useFpsCounter() {
7
7
  const { app } = useTuiContext();
@@ -11,8 +11,9 @@ function useFpsCounter() {
11
11
  const idleTimer = useRef(null);
12
12
  useEffect(() => {
13
13
  const onRender = () => {
14
- if (idleTimer.current)
14
+ if (idleTimer.current) {
15
15
  clearTimeout(idleTimer.current);
16
+ }
16
17
  idleTimer.current = setTimeout(() => {
17
18
  setFps(0);
18
19
  frames.current = 0;
@@ -32,8 +33,9 @@ function useFpsCounter() {
32
33
  });
33
34
  return () => {
34
35
  unsub();
35
- if (idleTimer.current)
36
+ if (idleTimer.current) {
36
37
  clearTimeout(idleTimer.current);
38
+ }
37
39
  };
38
40
  }, [app]);
39
41
  return fps;
@@ -1,10 +1,10 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { useRef } from 'react';
3
- import useTerminalPalette from './useTerminalPalette-BaWO2c4Q.js';
4
- import useWindowSize from './useWindowSize-ugEmGZJm.js';
5
- import Box from './Box-D_pSJ9Jp.js';
6
- import Text from './Text-DvAUdZcK.js';
7
- import { ScrollView } from './ScrollView-v3MCNIyX.js';
3
+ import useTerminalPalette from './useTerminalPalette-CtFG2JTq.js';
4
+ import useWindowSize from './useWindowSize-D3UU41mv.js';
5
+ import Box from './Box-W1w_NGin.js';
6
+ import Text from './Text-CtUwV89_.js';
7
+ import { ScrollView } from './ScrollView-C6rdlGwU.js';
8
8
 
9
9
  const Dialog = ({
10
10
  backgroundColor: backgroundColorProp,
@@ -1,10 +1,10 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { createPatch, parsePatch, diffWords, diffChars } from 'diff';
3
3
  import { useMemo, useState, useRef, useEffect } from 'react';
4
- import { r as resolveLanguage, i as isLanguageSupported, g as getHighlighter, a as getCachedTokens, b as renderTokenLine } from './token-to-elements-BRFl_rzw.js';
5
- import useWindowSize from './useWindowSize-ugEmGZJm.js';
6
- import Box from './Box-D_pSJ9Jp.js';
7
- import Text from './Text-DvAUdZcK.js';
4
+ import { r as resolveLanguage, i as isLanguageSupported, g as getHighlighter, a as getCachedTokens, b as renderTokenLine } from './token-to-elements-CK4s8MJd.js';
5
+ import useWindowSize from './useWindowSize-D3UU41mv.js';
6
+ import Box from './Box-W1w_NGin.js';
7
+ import Text from './Text-CtUwV89_.js';
8
8
 
9
9
  const renderHighlightedContent = (content, highlightedLines, lineNumber, fallbackColor) => {
10
10
  if (!highlightedLines || lineNumber === void 0 || lineNumber < 1 || lineNumber > highlightedLines.length) {
@@ -0,0 +1,30 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import useWindowSize from './useWindowSize-D3UU41mv.js';
3
+ import Box from './Box-W1w_NGin.js';
4
+ import Text from './Text-CtUwV89_.js';
5
+
6
+ function Divider({ character, color, dimColor = false, label, labelPadding = 1, length, orientation = "horizontal" }) {
7
+ const { columns } = useWindowSize();
8
+ const char = character ?? (orientation === "horizontal" ? "─" : "│");
9
+ if (orientation === "vertical") {
10
+ const rows = length ?? 1;
11
+ return jsx(Box, { flexDirection: "column", height: rows, children: Array.from({ length: rows }, (_, index) => jsx(Text, { color, dimColor, children: char }, `divider-row-${index}`)) });
12
+ }
13
+ const MAX_FILL = 500;
14
+ const fillLength = Math.min(MAX_FILL, length ?? Math.max(columns, 1));
15
+ if (label === void 0) {
16
+ return jsx(Box, { flexGrow: length === void 0 ? 1 : 0, width: length, children: jsx(Text, { color, dimColor, wrap: "truncate", children: char.repeat(fillLength) }) });
17
+ }
18
+ const padding = " ".repeat(labelPadding);
19
+ return jsxs(Box, { flexGrow: length === void 0 ? 1 : 0, width: length, children: [
20
+ jsx(Box, { flexGrow: 1, flexShrink: 1, children: jsx(Text, { color, dimColor, wrap: "truncate", children: char.repeat(fillLength) }) }),
21
+ jsx(Box, { flexShrink: 0, children: jsxs(Text, { color, dimColor, children: [
22
+ padding,
23
+ label,
24
+ padding
25
+ ] }) }),
26
+ jsx(Box, { flexGrow: 1, flexShrink: 1, children: jsx(Text, { color, dimColor, wrap: "truncate", children: char.repeat(fillLength) }) })
27
+ ] });
28
+ }
29
+
30
+ export { Divider as default };
@@ -19,10 +19,10 @@ const __cjs_getBuiltinModule = (module) => {
19
19
 
20
20
  import { jsxs, jsx } from 'react/jsx-runtime';
21
21
  import { useState, useRef, useEffect, useCallback } from 'react';
22
- import useInput from './useInput-Cfp5zB2s.js';
23
- import Box from './Box-D_pSJ9Jp.js';
24
- import Spinner from './Spinner-BuI-kN4p.js';
25
- import Text from './Text-DvAUdZcK.js';
22
+ import useInput from './useInput-DKZbqMRc.js';
23
+ import Box from './Box-W1w_NGin.js';
24
+ import Spinner from './Spinner-BcO5BCAa.js';
25
+ import Text from './Text-CtUwV89_.js';
26
26
  const {
27
27
  readdir,
28
28
  stat
@@ -35,9 +35,10 @@ const {
35
35
  } = __cjs_getBuiltinModule("node:path");
36
36
 
37
37
  function formatPermissions(mode) {
38
- const rwx = (m) => {
39
- return `${m & 4 ? "r" : "-"}${m & 2 ? "w" : "-"}${m & 1 ? "x" : "-"}`;
40
- };
38
+ const rwx = (m) => (
39
+ // eslint-disable-next-line no-bitwise
40
+ `${m & 4 ? "r" : "-"}${m & 2 ? "w" : "-"}${m & 1 ? "x" : "-"}`
41
+ );
41
42
  return `${rwx(mode >> 6 & 7)}${rwx(mode >> 3 & 7)}${rwx(mode & 7)}`;
42
43
  }
43
44
  function matchesFilter(entry, filter) {
@@ -51,8 +52,8 @@ function matchesFilter(entry, filter) {
51
52
  return false;
52
53
  }
53
54
  if (filter.extensions && filter.extensions.length > 0 && !entry.isDirectory) {
54
- const ext = extname(entry.name);
55
- if (!filter.extensions.includes(ext)) {
55
+ const extension = extname(entry.name);
56
+ if (!filter.extensions.includes(extension)) {
56
57
  return false;
57
58
  }
58
59
  }
@@ -73,33 +74,36 @@ function useFileSystem(options) {
73
74
  setIsLoading(true);
74
75
  setError(void 0);
75
76
  try {
76
- const dirEntries = await readdir(currentPath, { withFileTypes: true });
77
- const fileEntries = [];
78
- for (const entry of dirEntries) {
77
+ const directoryEntries = await readdir(currentPath, { withFileTypes: true });
78
+ const statsResults = await Promise.all(
79
+ directoryEntries.map(async (entry) => {
80
+ try {
81
+ return await stat(join(currentPath, entry.name));
82
+ } catch {
83
+ return void 0;
84
+ }
85
+ })
86
+ );
87
+ const fileEntries = directoryEntries.map((entry, index) => {
79
88
  const entryPath = join(currentPath, entry.name);
80
89
  const isDirectory = entry.isDirectory();
81
90
  const isHidden = entry.name.startsWith(".");
82
- let size = 0;
83
- let permissions = "---------";
84
- try {
85
- const stats = await stat(entryPath);
86
- size = stats.size;
87
- permissions = formatPermissions(stats.mode);
88
- } catch {
89
- }
90
- fileEntries.push({
91
+ const stats = statsResults[index];
92
+ const size = stats?.size ?? 0;
93
+ const permissions = stats ? formatPermissions(stats.mode) : "---------";
94
+ return {
91
95
  isDirectory,
92
96
  isHidden,
93
97
  name: entry.name,
94
98
  path: entryPath,
95
99
  permissions,
96
100
  size
97
- });
98
- }
101
+ };
102
+ });
99
103
  if (cancelled) {
100
104
  return;
101
105
  }
102
- const filtered = fileEntries.filter((e) => matchesFilter(e, filterRef.current));
106
+ const filtered = fileEntries.filter((entry) => matchesFilter(entry, filterRef.current));
103
107
  filtered.sort((a, b) => {
104
108
  if (a.isDirectory !== b.isDirectory) {
105
109
  return a.isDirectory ? -1 : 1;
@@ -118,7 +122,7 @@ function useFileSystem(options) {
118
122
  }
119
123
  }
120
124
  };
121
- void loadDirectory();
125
+ loadDirectory().catch(() => void 0);
122
126
  return () => {
123
127
  cancelled = true;
124
128
  };
@@ -150,20 +154,23 @@ function formatSize(bytes) {
150
154
  }
151
155
  return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)}G`;
152
156
  }
153
- function FilePicker({
157
+ const EMPTY_FILTER = {};
158
+ const getDefaultInitialPath = () => process.cwd();
159
+ const FilePicker = ({
154
160
  accentColor = "cyan",
155
161
  directoryColor = "blue",
156
162
  fileColor = "white",
157
- filter = {},
158
- initialPath = process.cwd(),
163
+ filter = EMPTY_FILTER,
164
+ initialPath,
159
165
  isFocused = true,
160
166
  limit = 10,
161
167
  onCancel,
162
168
  onSelect,
163
169
  showPermissions = false,
164
170
  showSize = false
165
- }) {
166
- const fs = useFileSystem({ filter, initialPath });
171
+ }) => {
172
+ const resolvedInitialPath = initialPath ?? getDefaultInitialPath();
173
+ const fs = useFileSystem({ filter, initialPath: resolvedInitialPath });
167
174
  const [focusedIndex, setFocusedIndex] = useState(0);
168
175
  const maxIndex = Math.max(0, fs.entries.length - 1);
169
176
  const safeIndex = Math.min(focusedIndex, maxIndex);
@@ -217,7 +224,7 @@ function FilePicker({
217
224
  jsx(Text, { children: " Loading..." })
218
225
  ] }),
219
226
  fs.error && jsxs(Text, { color: "red", children: [
220
- "Error: ",
227
+ "Error:",
221
228
  fs.error
222
229
  ] }),
223
230
  !fs.isLoading && !fs.error && fs.entries.length === 0 && jsx(Text, { dimColor: true, children: "(empty directory)" }),
@@ -249,6 +256,6 @@ function FilePicker({
249
256
  fs.entries.length
250
257
  ] })
251
258
  ] });
252
- }
259
+ };
253
260
 
254
261
  export { FilePicker as default };
@@ -0,0 +1,29 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import Box from './Box-W1w_NGin.js';
3
+ import Text from './Text-CtUwV89_.js';
4
+
5
+ const FormField = ({ children, description, error, isDisabled = false, label, required = false }) => jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [
6
+ jsxs(Box, { children: [
7
+ jsx(Text, { bold: true, dimColor: isDisabled, children: label }),
8
+ required ? jsx(Text, { color: "red", children: " *" }) : void 0
9
+ ] }),
10
+ jsx(Box, { marginTop: 0, children }),
11
+ error === void 0 ? description === void 0 ? void 0 : jsx(Text, { dimColor: true, children: description }) : jsx(Text, { color: "red", children: error })
12
+ ] });
13
+ const Form = Object.assign(
14
+ ({ accentColor = "blue", bordered = true, children, description, footer, title, width }) => {
15
+ const content = jsxs(Box, { flexDirection: "column", children: [
16
+ title === void 0 ? void 0 : jsx(Box, { marginBottom: 1, children: jsx(Text, { bold: true, color: accentColor, children: title }) }),
17
+ description === void 0 ? void 0 : jsx(Box, { marginBottom: 1, children: jsx(Text, { dimColor: true, children: description }) }),
18
+ jsx(Box, { flexDirection: "column", children }),
19
+ footer === void 0 ? void 0 : jsx(Box, { marginTop: 1, children: footer })
20
+ ] });
21
+ if (!bordered) {
22
+ return jsx(Box, { flexDirection: "column", width, children: content });
23
+ }
24
+ return jsx(Box, { borderColor: accentColor, borderStyle: "round", flexDirection: "column", paddingX: 1, paddingY: 1, width, children: content });
25
+ },
26
+ { Field: FormField }
27
+ );
28
+
29
+ export { FormField, Form as default };
@@ -1,7 +1,7 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import 'react';
3
- import Box from './Box-D_pSJ9Jp.js';
4
- import useWindowSize from './useWindowSize-ugEmGZJm.js';
3
+ import Box from './Box-W1w_NGin.js';
4
+ import useWindowSize from './useWindowSize-D3UU41mv.js';
5
5
 
6
6
  const Fullscreen = ({ children }) => {
7
7
  const { columns, rows } = useWindowSize();
@@ -0,0 +1,122 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useMemo } from 'react';
3
+ import { c as createBrailleGrid } from './braille-BoEWoH2I.js';
4
+ import Box from './Box-W1w_NGin.js';
5
+ import Canvas from './Canvas-COttmLPX.js';
6
+ import Text from './Text-CtUwV89_.js';
7
+
8
+ const SIZES = {
9
+ large: { cols: 40, rows: 10 },
10
+ medium: { cols: 24, rows: 6 },
11
+ small: { cols: 16, rows: 4 }
12
+ };
13
+ const NEEDLE_RATIO = 0.9;
14
+ const ARC_ANGLE_STEPS_PER_PIXEL = 2;
15
+ const defaultFormat = (value) => String(Math.round(value));
16
+ const thresholdAtRatio = (thresholds, min, max, ratio) => {
17
+ const value = min + (max - min) * ratio;
18
+ for (const threshold of thresholds) {
19
+ if (value <= threshold.max) {
20
+ return threshold;
21
+ }
22
+ }
23
+ return thresholds[thresholds.length - 1];
24
+ };
25
+ function Gauge({
26
+ backgroundColor = "gray",
27
+ formatValue = defaultFormat,
28
+ label,
29
+ max = 100,
30
+ min = 0,
31
+ showLegend = false,
32
+ showValue = true,
33
+ size = "medium",
34
+ thresholds,
35
+ value
36
+ }) {
37
+ const { cols, rows } = SIZES[size];
38
+ const clampedValue = Math.max(min, Math.min(max, value));
39
+ const range = max - min || 1;
40
+ const ratio = (clampedValue - min) / range;
41
+ const sortedThresholds = useMemo(() => {
42
+ if (thresholds === void 0 || thresholds.length === 0) {
43
+ return void 0;
44
+ }
45
+ return [...thresholds].sort((a, b) => a.max - b.max);
46
+ }, [thresholds]);
47
+ const activeThreshold = useMemo(() => {
48
+ if (sortedThresholds === void 0) {
49
+ return void 0;
50
+ }
51
+ return thresholdAtRatio(sortedThresholds, min, max, ratio);
52
+ }, [sortedThresholds, min, max, ratio]);
53
+ const readout = formatValue(clampedValue);
54
+ return jsxs(Box, { flexDirection: "column", children: [
55
+ jsx(
56
+ Canvas,
57
+ {
58
+ draw: (context) => {
59
+ context.clear();
60
+ const pixelWidth = context.width * 2;
61
+ const pixelHeight = context.height * 4;
62
+ const cx = pixelWidth / 2;
63
+ const cy = pixelHeight - 1;
64
+ const rx = pixelWidth / 2 - 1;
65
+ const ry = pixelHeight - 1;
66
+ const radius = Math.max(1, Math.min(rx, ry));
67
+ const gridsByColor = /* @__PURE__ */ new Map();
68
+ const gridFor = (color) => {
69
+ const existing = gridsByColor.get(color);
70
+ if (existing !== void 0) {
71
+ return existing;
72
+ }
73
+ const grid = createBrailleGrid(context.width, context.height);
74
+ gridsByColor.set(color, grid);
75
+ return grid;
76
+ };
77
+ const arcSteps = Math.max(32, Math.round(Math.PI * radius) * ARC_ANGLE_STEPS_PER_PIXEL);
78
+ for (let step = 0; step <= arcSteps; step += 1) {
79
+ const stepRatio = step / arcSteps;
80
+ const angle = Math.PI * (1 - stepRatio);
81
+ const px = Math.round(cx + radius * Math.cos(angle));
82
+ const py = Math.round(cy - radius * Math.sin(angle));
83
+ let color;
84
+ if (stepRatio > ratio) {
85
+ color = backgroundColor;
86
+ } else if (sortedThresholds) {
87
+ const segment = thresholdAtRatio(sortedThresholds, min, max, stepRatio);
88
+ color = segment?.color ?? "cyan";
89
+ } else {
90
+ color = "cyan";
91
+ }
92
+ const grid = gridFor(color);
93
+ grid.plotPoint(px, py);
94
+ }
95
+ const needleRadius = radius * NEEDLE_RATIO;
96
+ const needleAngle = Math.PI * (1 - ratio);
97
+ const nx = Math.round(cx + needleRadius * Math.cos(needleAngle));
98
+ const ny = Math.round(cy - needleRadius * Math.sin(needleAngle));
99
+ const needleColor = activeThreshold?.color ?? "white";
100
+ const needleGrid = gridFor(needleColor);
101
+ needleGrid.plotLine(Math.round(cx), Math.round(cy), nx, ny);
102
+ for (const [color, grid] of gridsByColor) {
103
+ grid.flush(context, { color });
104
+ }
105
+ },
106
+ height: rows,
107
+ version: [value, min, max, size, thresholds, backgroundColor],
108
+ width: cols
109
+ }
110
+ ),
111
+ showValue || label ? jsxs(Box, { flexDirection: "column", children: [
112
+ label === void 0 ? void 0 : jsx(Box, { justifyContent: "center", children: jsx(Text, { dimColor: true, children: label }) }),
113
+ showValue ? jsx(Box, { justifyContent: "center", children: jsx(Text, { bold: true, color: activeThreshold?.color ?? "white", children: readout }) }) : void 0
114
+ ] }) : void 0,
115
+ showLegend && thresholds && thresholds.length > 0 ? jsx(Box, { gap: 2, justifyContent: "center", marginTop: 1, children: thresholds.map((threshold, index) => jsxs(Box, { gap: 1, children: [
116
+ jsx(Text, { color: threshold.color, children: "●" }),
117
+ jsx(Text, { dimColor: true, children: threshold.label ?? `≤ ${threshold.max}` })
118
+ ] }, index)) }) : void 0
119
+ ] });
120
+ }
121
+
122
+ export { Gauge as default };
@@ -2,9 +2,9 @@ import { jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { strip } from '@visulima/ansi';
3
3
  import { multilineGradient } from '@visulima/colorize/gradient';
4
4
  import { useMemo, Children, isValidElement, cloneElement } from 'react';
5
- import Box from './Box-D_pSJ9Jp.js';
6
- import Text from './Text-DvAUdZcK.js';
7
- import Transform from './Transform-BHxY_dAM.js';
5
+ import Box from './Box-W1w_NGin.js';
6
+ import Text from './Text-CtUwV89_.js';
7
+ import Transform from './Transform-Cfyva2wd.js';
8
8
 
9
9
  const presets = {
10
10
  atlas: { colors: ["#feac5e", "#c779d0", "#4bc0c8"] },
@@ -0,0 +1,29 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import Box from './Box-W1w_NGin.js';
3
+ import Text from './Text-CtUwV89_.js';
4
+
5
+ const LEVEL_COLOR = {
6
+ 1: "blueBright",
7
+ 2: "cyanBright",
8
+ 3: "magentaBright",
9
+ 4: "yellowBright",
10
+ 5: "green",
11
+ 6: "white"
12
+ };
13
+ const LEVEL_PREFIX = {
14
+ 1: "# ",
15
+ 2: "## ",
16
+ 3: "### ",
17
+ 4: "#### ",
18
+ 5: "##### ",
19
+ 6: "###### "
20
+ };
21
+ function Heading({ children, color, level = 1, underline = false }) {
22
+ const resolvedColor = color ?? LEVEL_COLOR[level];
23
+ return jsx(Box, { flexDirection: "column", children: jsxs(Text, { bold: level <= 2, color: resolvedColor, underline, children: [
24
+ LEVEL_PREFIX[level],
25
+ children
26
+ ] }) });
27
+ }
28
+
29
+ export { Heading as default };