@visulima/tui-kit 0.0.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (371) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/LICENSE.md +2095 -0
  3. package/README.md +115 -29
  4. package/dist/accordion.d.ts +59 -0
  5. package/dist/accordion.js +1 -0
  6. package/dist/alert.d.ts +26 -0
  7. package/dist/alert.js +1 -0
  8. package/dist/animate-presence.d.ts +18 -0
  9. package/dist/animate-presence.js +1 -0
  10. package/dist/approval-prompt.d.ts +65 -0
  11. package/dist/approval-prompt.js +1 -0
  12. package/dist/area-chart.d.ts +66 -0
  13. package/dist/area-chart.js +1 -0
  14. package/dist/badge.d.ts +22 -0
  15. package/dist/badge.js +1 -0
  16. package/dist/bar-chart.d.ts +67 -0
  17. package/dist/bar-chart.js +1 -0
  18. package/dist/big-text.d.ts +81 -0
  19. package/dist/big-text.js +1 -0
  20. package/dist/blink-dot.d.ts +36 -0
  21. package/dist/blink-dot.js +1 -0
  22. package/dist/breadcrumb.d.ts +33 -0
  23. package/dist/breadcrumb.js +1 -0
  24. package/dist/button.d.ts +45 -0
  25. package/dist/button.js +1 -0
  26. package/dist/calendar.d.ts +72 -0
  27. package/dist/calendar.js +1 -0
  28. package/dist/card.d.ts +57 -0
  29. package/dist/card.js +1 -0
  30. package/dist/checkbox-group.d.ts +59 -0
  31. package/dist/checkbox-group.js +1 -0
  32. package/dist/checkbox.d.ts +48 -0
  33. package/dist/checkbox.js +1 -0
  34. package/dist/code.d.ts +48 -0
  35. package/dist/code.js +2 -0
  36. package/dist/collapsible.d.ts +53 -0
  37. package/dist/collapsible.js +1 -0
  38. package/dist/color-picker.d.ts +71 -0
  39. package/dist/color-picker.js +1 -0
  40. package/dist/command-block.d.ts +47 -0
  41. package/dist/command-block.js +4 -0
  42. package/dist/command-palette.d.ts +82 -0
  43. package/dist/command-palette.js +1 -0
  44. package/dist/confirm-dialog.d.ts +75 -0
  45. package/dist/confirm-dialog.js +1 -0
  46. package/dist/confirm-input.d.ts +38 -0
  47. package/dist/confirm-input.js +1 -0
  48. package/dist/console-overlay.d.ts +54 -0
  49. package/dist/console-overlay.js +1 -0
  50. package/dist/content-switcher.d.ts +57 -0
  51. package/dist/content-switcher.js +1 -0
  52. package/dist/controlled-scroll-view.d.ts +3 -0
  53. package/dist/controlled-scroll-view.js +1 -0
  54. package/dist/data-grid.d.ts +49 -0
  55. package/dist/data-grid.js +1 -0
  56. package/dist/date-picker.d.ts +65 -0
  57. package/dist/date-picker.js +1 -0
  58. package/dist/definition-list.d.ts +44 -0
  59. package/dist/definition-list.js +1 -0
  60. package/dist/dialog.d.ts +110 -0
  61. package/dist/dialog.js +1 -0
  62. package/dist/diff-view.d.ts +85 -0
  63. package/dist/diff-view.js +1 -0
  64. package/dist/digits.d.ts +30 -0
  65. package/dist/digits.js +1 -0
  66. package/dist/directory-tree.d.ts +51 -0
  67. package/dist/directory-tree.js +1 -0
  68. package/dist/divider.d.ts +49 -0
  69. package/dist/divider.js +1 -0
  70. package/dist/drawer.d.ts +53 -0
  71. package/dist/drawer.js +1 -0
  72. package/dist/file-change.d.ts +40 -0
  73. package/dist/file-change.js +1 -0
  74. package/dist/file-picker-entry.d.ts +2 -0
  75. package/dist/file-picker-entry.js +1 -0
  76. package/dist/form.d.ts +81 -0
  77. package/dist/form.js +1 -0
  78. package/dist/gauge.d.ts +87 -0
  79. package/dist/gauge.js +1 -0
  80. package/dist/gradient.d.ts +42 -0
  81. package/dist/gradient.js +1 -0
  82. package/dist/grid.d.ts +40 -0
  83. package/dist/grid.js +1 -0
  84. package/dist/heading.d.ts +33 -0
  85. package/dist/heading.js +1 -0
  86. package/dist/heatmap.d.ts +62 -0
  87. package/dist/heatmap.js +1 -0
  88. package/dist/help.d.ts +52 -0
  89. package/dist/help.js +1 -0
  90. package/dist/histogram.d.ts +62 -0
  91. package/dist/histogram.js +1 -0
  92. package/dist/image.d.ts +26 -0
  93. package/dist/image.js +1 -0
  94. package/dist/index.d.ts +125 -0
  95. package/dist/index.js +1 -0
  96. package/dist/json.d.ts +58 -0
  97. package/dist/json.js +1 -0
  98. package/dist/kbd.d.ts +31 -0
  99. package/dist/kbd.js +1 -0
  100. package/dist/line-chart.d.ts +109 -0
  101. package/dist/line-chart.js +1 -0
  102. package/dist/link.d.ts +38 -0
  103. package/dist/link.js +1 -0
  104. package/dist/loading-indicator.d.ts +29 -0
  105. package/dist/loading-indicator.js +1 -0
  106. package/dist/log.d.ts +38 -0
  107. package/dist/log.js +1 -0
  108. package/dist/markdown.d.ts +40 -0
  109. package/dist/markdown.js +1 -0
  110. package/dist/masked-input.d.ts +50 -0
  111. package/dist/masked-input.js +1 -0
  112. package/dist/menu.d.ts +78 -0
  113. package/dist/menu.js +1 -0
  114. package/dist/message-bubble.d.ts +43 -0
  115. package/dist/message-bubble.js +1 -0
  116. package/dist/model-badge.d.ts +39 -0
  117. package/dist/model-badge.js +1 -0
  118. package/dist/model-selector.d.ts +52 -0
  119. package/dist/model-selector.js +1 -0
  120. package/dist/multi-progress.d.ts +55 -0
  121. package/dist/multi-progress.js +1 -0
  122. package/dist/multi-select.d.ts +65 -0
  123. package/dist/multi-select.js +1 -0
  124. package/dist/notification-badge.d.ts +47 -0
  125. package/dist/notification-badge.js +1 -0
  126. package/dist/number-input.d.ts +85 -0
  127. package/dist/number-input.js +1 -0
  128. package/dist/operation-tree.d.ts +49 -0
  129. package/dist/operation-tree.js +1 -0
  130. package/dist/option-list.d.ts +47 -0
  131. package/dist/option-list.js +1 -0
  132. package/dist/ordered-list.d.ts +24 -0
  133. package/dist/ordered-list.js +1 -0
  134. package/dist/packem_shared/ControlledScrollView-BzlbIUph.js +1 -0
  135. package/dist/packem_shared/FilePicker-V5H2fb-v.js +1 -0
  136. package/dist/packem_shared/ScrollBar-C9i3z3Ft.js +1 -0
  137. package/dist/packem_shared/ScrollBarBox-DZEC8YnV.js +1 -0
  138. package/dist/packem_shared/ScrollList-Djtb2vVy.js +1 -0
  139. package/dist/packem_shared/ScrollView-ESxpl6Hy.js +1 -0
  140. package/dist/packem_shared/TreeNodeMap-cJlYqckB.js +1 -0
  141. package/dist/packem_shared/TreeView-q0l446NV.js +1 -0
  142. package/dist/packem_shared/controlled-scroll-view-DerVKKv6.js +1 -0
  143. package/dist/packem_shared/controlled-scroll-view.d-vF4wevEJ.d.ts +54 -0
  144. package/dist/packem_shared/file-picker.d-Cie6aAMD.d.ts +104 -0
  145. package/dist/packem_shared/line-chart-BbhMhcZg.js +1 -0
  146. package/dist/packem_shared/scroll-bar-box.d-DSBbBsRc.d.ts +30 -0
  147. package/dist/packem_shared/scroll-bar.d-B4sD1hBR.d.ts +18 -0
  148. package/dist/packem_shared/scroll-list.d-BP0UZSY4.d.ts +12 -0
  149. package/dist/packem_shared/scroll-view.d-BqKpI-F-.d.ts +119 -0
  150. package/dist/packem_shared/treeViewTheme-Dq3ekRAC.js +1 -0
  151. package/dist/packem_shared/use-tree-view.d-dXTKoDPM.d.ts +350 -0
  152. package/dist/packem_shared/useTreeView-D0JEqT6W.js +1 -0
  153. package/dist/packem_shared/useTreeViewState-BiTJakkh.js +1 -0
  154. package/dist/packem_shared/variant-config-BJqpNo7H.js +1 -0
  155. package/dist/packem_shared/variant-config.d-D5NnrrQK.d.ts +2 -0
  156. package/dist/paginator.d.ts +69 -0
  157. package/dist/paginator.js +1 -0
  158. package/dist/paragraph.d.ts +38 -0
  159. package/dist/paragraph.js +1 -0
  160. package/dist/path-input.d.ts +67 -0
  161. package/dist/path-input.js +1 -0
  162. package/dist/pie-chart.d.ts +50 -0
  163. package/dist/pie-chart.js +1 -0
  164. package/dist/placeholder.d.ts +55 -0
  165. package/dist/placeholder.js +1 -0
  166. package/dist/popover.d.ts +46 -0
  167. package/dist/popover.js +1 -0
  168. package/dist/progress-bar.d.ts +51 -0
  169. package/dist/progress-bar.js +1 -0
  170. package/dist/progress-circle.d.ts +59 -0
  171. package/dist/progress-circle.js +1 -0
  172. package/dist/qr-code.d.ts +45 -0
  173. package/dist/qr-code.js +1 -0
  174. package/dist/r/accordion.json +24 -0
  175. package/dist/r/alert.json +24 -0
  176. package/dist/r/animate-presence.json +22 -0
  177. package/dist/r/approval-prompt.json +24 -0
  178. package/dist/r/area-chart.json +27 -0
  179. package/dist/r/badge.json +24 -0
  180. package/dist/r/bar-chart.json +24 -0
  181. package/dist/r/big-text.json +23 -0
  182. package/dist/r/blink-dot.json +24 -0
  183. package/dist/r/breadcrumb.json +24 -0
  184. package/dist/r/button.json +24 -0
  185. package/dist/r/calendar.json +24 -0
  186. package/dist/r/card.json +26 -0
  187. package/dist/r/chart-utils.json +24 -0
  188. package/dist/r/checkbox-group.json +24 -0
  189. package/dist/r/checkbox.json +24 -0
  190. package/dist/r/code.json +23 -0
  191. package/dist/r/collapsible.json +24 -0
  192. package/dist/r/color-picker.json +24 -0
  193. package/dist/r/command-block.json +26 -0
  194. package/dist/r/command-palette.json +24 -0
  195. package/dist/r/confirm-dialog.json +24 -0
  196. package/dist/r/confirm-input.json +22 -0
  197. package/dist/r/console-overlay.json +22 -0
  198. package/dist/r/content-switcher.json +24 -0
  199. package/dist/r/controlled-scroll-view.json +24 -0
  200. package/dist/r/data-grid.json +24 -0
  201. package/dist/r/date-picker.json +26 -0
  202. package/dist/r/definition-list.json +24 -0
  203. package/dist/r/dialog.json +24 -0
  204. package/dist/r/diff-view.json +24 -0
  205. package/dist/r/digits.json +24 -0
  206. package/dist/r/directory-tree.json +24 -0
  207. package/dist/r/divider.json +24 -0
  208. package/dist/r/drawer.json +24 -0
  209. package/dist/r/file-change.json +24 -0
  210. package/dist/r/file-picker.json +44 -0
  211. package/dist/r/form.json +24 -0
  212. package/dist/r/gauge.json +24 -0
  213. package/dist/r/gradient.json +24 -0
  214. package/dist/r/grid.json +22 -0
  215. package/dist/r/heading.json +24 -0
  216. package/dist/r/heatmap.json +24 -0
  217. package/dist/r/help.json +22 -0
  218. package/dist/r/histogram.json +26 -0
  219. package/dist/r/image.json +24 -0
  220. package/dist/r/json.json +24 -0
  221. package/dist/r/kbd.json +24 -0
  222. package/dist/r/line-chart.json +26 -0
  223. package/dist/r/link.json +23 -0
  224. package/dist/r/loading-indicator.json +27 -0
  225. package/dist/r/log.json +24 -0
  226. package/dist/r/markdown.json +29 -0
  227. package/dist/r/masked-input.json +22 -0
  228. package/dist/r/menu.json +24 -0
  229. package/dist/r/message-bubble.json +24 -0
  230. package/dist/r/model-badge.json +24 -0
  231. package/dist/r/model-selector.json +24 -0
  232. package/dist/r/multi-progress.json +24 -0
  233. package/dist/r/multi-select.json +24 -0
  234. package/dist/r/notification-badge.json +24 -0
  235. package/dist/r/number-input.json +24 -0
  236. package/dist/r/operation-tree.json +26 -0
  237. package/dist/r/option-list.json +24 -0
  238. package/dist/r/ordered-list.json +22 -0
  239. package/dist/r/paginator.json +22 -0
  240. package/dist/r/paragraph.json +24 -0
  241. package/dist/r/path-input.json +26 -0
  242. package/dist/r/pie-chart.json +24 -0
  243. package/dist/r/placeholder.json +24 -0
  244. package/dist/r/popover.json +24 -0
  245. package/dist/r/progress-bar.json +22 -0
  246. package/dist/r/progress-circle.json +24 -0
  247. package/dist/r/qr-code.json +24 -0
  248. package/dist/r/radio-group.json +24 -0
  249. package/dist/r/registry.json +1051 -0
  250. package/dist/r/scatter-plot.json +27 -0
  251. package/dist/r/scroll-bar-box.json +24 -0
  252. package/dist/r/scroll-bar.json +24 -0
  253. package/dist/r/scroll-list.json +24 -0
  254. package/dist/r/scroll-view.json +24 -0
  255. package/dist/r/scroll.json +58 -0
  256. package/dist/r/search-input.json +26 -0
  257. package/dist/r/select-input-indicator.json +24 -0
  258. package/dist/r/select-input-item.json +24 -0
  259. package/dist/r/select-input.json +28 -0
  260. package/dist/r/shimmer-text.json +24 -0
  261. package/dist/r/sidebar.json +24 -0
  262. package/dist/r/slider.json +24 -0
  263. package/dist/r/sparkline.json +24 -0
  264. package/dist/r/spinner.json +23 -0
  265. package/dist/r/status-line.json +24 -0
  266. package/dist/r/status-message.json +24 -0
  267. package/dist/r/stepper.json +24 -0
  268. package/dist/r/stopwatch.json +22 -0
  269. package/dist/r/streaming-text.json +24 -0
  270. package/dist/r/switch.json +24 -0
  271. package/dist/r/tab.json +22 -0
  272. package/dist/r/table.json +23 -0
  273. package/dist/r/tabs.json +26 -0
  274. package/dist/r/tag-input.json +24 -0
  275. package/dist/r/tag.json +24 -0
  276. package/dist/r/text-input.json +22 -0
  277. package/dist/r/textarea.json +22 -0
  278. package/dist/r/thinking-block.json +24 -0
  279. package/dist/r/time-picker.json +24 -0
  280. package/dist/r/timer.json +22 -0
  281. package/dist/r/toast.json +24 -0
  282. package/dist/r/token-usage.json +24 -0
  283. package/dist/r/tool-call.json +24 -0
  284. package/dist/r/tooltip.json +24 -0
  285. package/dist/r/transition.json +22 -0
  286. package/dist/r/tree-select.json +24 -0
  287. package/dist/r/tree-view.json +64 -0
  288. package/dist/r/unordered-list.json +22 -0
  289. package/dist/r/use-linked-scroll.json +24 -0
  290. package/dist/r/variant-config.json +22 -0
  291. package/dist/radio-group.d.ts +74 -0
  292. package/dist/radio-group.js +1 -0
  293. package/dist/scatter-plot.d.ts +35 -0
  294. package/dist/scatter-plot.js +1 -0
  295. package/dist/scroll-bar-box.d.ts +3 -0
  296. package/dist/scroll-bar-box.js +1 -0
  297. package/dist/scroll-bar.d.ts +3 -0
  298. package/dist/scroll-bar.js +1 -0
  299. package/dist/scroll-list.d.ts +4 -0
  300. package/dist/scroll-list.js +1 -0
  301. package/dist/scroll-view.d.ts +3 -0
  302. package/dist/scroll-view.js +1 -0
  303. package/dist/search-input.d.ts +55 -0
  304. package/dist/search-input.js +1 -0
  305. package/dist/select-input-indicator.d.ts +32 -0
  306. package/dist/select-input-indicator.js +1 -0
  307. package/dist/select-input-item.d.ts +41 -0
  308. package/dist/select-input-item.js +1 -0
  309. package/dist/select-input.d.ts +110 -0
  310. package/dist/select-input.js +1 -0
  311. package/dist/shimmer-text.d.ts +47 -0
  312. package/dist/shimmer-text.js +1 -0
  313. package/dist/sidebar.d.ts +47 -0
  314. package/dist/sidebar.js +1 -0
  315. package/dist/slider.d.ts +103 -0
  316. package/dist/slider.js +1 -0
  317. package/dist/sparkline.d.ts +42 -0
  318. package/dist/sparkline.js +1 -0
  319. package/dist/spinner.d.ts +17 -0
  320. package/dist/spinner.js +1 -0
  321. package/dist/status-line.d.ts +37 -0
  322. package/dist/status-line.js +1 -0
  323. package/dist/status-message.d.ts +21 -0
  324. package/dist/status-message.js +1 -0
  325. package/dist/stepper.d.ts +48 -0
  326. package/dist/stepper.js +1 -0
  327. package/dist/stopwatch.d.ts +49 -0
  328. package/dist/stopwatch.js +1 -0
  329. package/dist/streaming-text.d.ts +46 -0
  330. package/dist/streaming-text.js +1 -0
  331. package/dist/switch.d.ts +55 -0
  332. package/dist/switch.js +1 -0
  333. package/dist/tab.d.ts +19 -0
  334. package/dist/tab.js +1 -0
  335. package/dist/table.d.ts +119 -0
  336. package/dist/table.js +1 -0
  337. package/dist/tabs.d.ts +107 -0
  338. package/dist/tabs.js +1 -0
  339. package/dist/tag-input.d.ts +71 -0
  340. package/dist/tag-input.js +1 -0
  341. package/dist/tag.d.ts +35 -0
  342. package/dist/tag.js +1 -0
  343. package/dist/text-input.d.ts +48 -0
  344. package/dist/text-input.js +1 -0
  345. package/dist/textarea.d.ts +68 -0
  346. package/dist/textarea.js +2 -0
  347. package/dist/thinking-block.d.ts +57 -0
  348. package/dist/thinking-block.js +1 -0
  349. package/dist/time-picker.d.ts +67 -0
  350. package/dist/time-picker.js +1 -0
  351. package/dist/timer.d.ts +59 -0
  352. package/dist/timer.js +1 -0
  353. package/dist/toast.d.ts +49 -0
  354. package/dist/toast.js +1 -0
  355. package/dist/token-usage.d.ts +50 -0
  356. package/dist/token-usage.js +1 -0
  357. package/dist/tool-call.d.ts +33 -0
  358. package/dist/tool-call.js +1 -0
  359. package/dist/tooltip.d.ts +43 -0
  360. package/dist/tooltip.js +1 -0
  361. package/dist/transition.d.ts +74 -0
  362. package/dist/transition.js +1 -0
  363. package/dist/tree-select.d.ts +65 -0
  364. package/dist/tree-select.js +1 -0
  365. package/dist/tree-view-entry.d.ts +4 -0
  366. package/dist/tree-view-entry.js +1 -0
  367. package/dist/unordered-list.d.ts +30 -0
  368. package/dist/unordered-list.js +1 -0
  369. package/dist/use-linked-scroll.d.ts +42 -0
  370. package/dist/use-linked-scroll.js +1 -0
  371. package/package.json +553 -7
package/dist/help.d.ts ADDED
@@ -0,0 +1,52 @@
1
+ import { KeyBinding } from '@visulima/tui/hooks/use-key-bindings';
2
+ import { ReactElement } from 'react';
3
+ type Props = {
4
+ /**
5
+ * Key bindings to display. Typically the `bindings` array returned by `useKeyBindings`.
6
+ */
7
+ readonly bindings: ReadonlyArray<KeyBinding>;
8
+ /**
9
+ * Color for description text.
10
+ * @default undefined (uses dimColor)
11
+ */
12
+ readonly descriptionColor?: string;
13
+ /**
14
+ * Color for key labels.
15
+ * @default "cyan"
16
+ */
17
+ readonly keyColor?: string;
18
+ /**
19
+ * Maximum number of columns in full mode.
20
+ * @default 3
21
+ */
22
+ readonly maxColumns?: number;
23
+ /**
24
+ * Display mode.
25
+ * - `"short"`: Single-line horizontal bar, truncated to terminal width.
26
+ * - `"full"`: Multi-column layout grouped by `group` field.
27
+ * @default "short"
28
+ */
29
+ readonly mode?: "full" | "short";
30
+ /**
31
+ * Separator between key-description pairs in short mode.
32
+ * @default " \u00b7 "
33
+ */
34
+ readonly separator?: string;
35
+ };
36
+ /**
37
+ * Renders a keybinding help bar from an array of `KeyBinding` definitions.
38
+ *
39
+ * ```tsx
40
+ * &lt;Help bindings={bindings} />
41
+ * &lt;Help bindings={bindings} mode="full" />
42
+ * ```
43
+ */
44
+ declare function Help({
45
+ bindings,
46
+ descriptionColor,
47
+ keyColor,
48
+ maxColumns,
49
+ mode,
50
+ separator
51
+ }: Props): ReactElement;
52
+ export { Help, type Props as HelpProps, Props, Help as default };
package/dist/help.js ADDED
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as m}from"react/jsx-runtime";import u from"@visulima/tui/components/box";import i from"@visulima/tui/components/text";import x from"@visulima/tui/hooks/use-window-size";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}=x();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(u,{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(u,{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 a=[];c&&a.push(e(i,{bold:!0,children:c},"title"));for(const[k,h]of g.entries()){const w=C(h.key);a.push(m(u,{children:[e(i,{color:o.keyColor,children:w}),e(i,{children:" "}),o.descriptionColor?e(i,{color:o.descriptionColor,children:h.description}):e(i,{dimColor:!0,children:h.description})]},`b-${k}`))}p.push(e(u,{flexDirection:"column",width:l,children:a},`col-${d}`))}return e(u,{flexDirection:"row",children:p})}export{B as Help,B as default};
@@ -0,0 +1,62 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type Props = {
5
+ /**
6
+ * Number of equal-width buckets. Ignored if `thresholds` is set.
7
+ * @default 10
8
+ */
9
+ readonly bins?: number;
10
+ /**
11
+ * Bar color.
12
+ */
13
+ readonly color?: LiteralUnion<AnsiColors, string>;
14
+ /**
15
+ * Raw values to bin.
16
+ */
17
+ readonly data: ReadonlyArray<number>;
18
+ /**
19
+ * Plot height in character rows.
20
+ * @default 10
21
+ */
22
+ readonly height?: number;
23
+ /**
24
+ * Optional fixed maximum.
25
+ */
26
+ readonly max?: number;
27
+ /**
28
+ * Optional fixed minimum.
29
+ */
30
+ readonly min?: number;
31
+ /**
32
+ * Render a numeric count above each bucket.
33
+ * @default false
34
+ */
35
+ readonly showValues?: boolean;
36
+ /**
37
+ * Explicit bin edges. When provided, `bins`, `min`, and `max` are ignored.
38
+ * Must be strictly increasing.
39
+ */
40
+ readonly thresholds?: ReadonlyArray<number>;
41
+ /**
42
+ * Plot width in character columns.
43
+ */
44
+ readonly width?: number;
45
+ };
46
+ /**
47
+ * Histogram built on top of BarChart. Bins the raw values (via explicit
48
+ * thresholds or equal-width bins) and hands the counts off to BarChart.
49
+ * @returns A `ReactElement` rendering a BarChart of bucket counts.
50
+ */
51
+ declare function Histogram({
52
+ bins,
53
+ color,
54
+ data,
55
+ height,
56
+ max: maxOverride,
57
+ min: minOverride,
58
+ showValues,
59
+ thresholds,
60
+ width
61
+ }: Props): ReactElement;
62
+ export { Histogram, type Props as HistogramProps, Props, Histogram as default };
@@ -0,0 +1 @@
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};
@@ -0,0 +1,26 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type Pixel = LiteralUnion<AnsiColors, string> | undefined;
5
+ type Props = {
6
+ /**
7
+ * Character drawn for a transparent (undefined) pixel; defaults to a space.
8
+ */
9
+ readonly emptyChar?: string;
10
+ /**
11
+ * A row-major grid of colors, one entry per pixel. `undefined` is treated
12
+ * as transparent. Two vertical pixels share one character cell via the
13
+ * upper-half-block technique, so the rendered height is `ceil(rows / 2)`.
14
+ */
15
+ readonly pixels: ReadonlyArray<ReadonlyArray<Pixel>>;
16
+ };
17
+ /**
18
+ * Render a small pixel grid using the upper-half-block technique: each text
19
+ * cell packs two vertical pixels — the top pixel as the glyph's foreground and
20
+ * the bottom pixel as its background — doubling vertical resolution.
21
+ */
22
+ declare function Image({
23
+ emptyChar,
24
+ pixels
25
+ }: Props): ReactElement;
26
+ export { Image, type Props as ImageProps, Props, Image as default };
package/dist/image.js ADDED
@@ -0,0 +1 @@
1
+ import{jsx as t}from"react/jsx-runtime";import f from"@visulima/tui/components/box";import h from"@visulima/tui/components/text";const p="▀",a="▄";function y({emptyChar:u=" ",pixels:e}){let c=0;for(const o of e)c=Math.max(c,o.length);const s=[];for(let o=0;o<e.length;o+=2){const d=e[o]??[],m=e[o+1]??[],i=[];for(let r=0;r<c;r+=1){const n=d[r],l=m[r];if(n===void 0&&l===void 0){i.push(t(h,{children:u},r));continue}if(n===void 0){i.push(t(h,{color:l,children:a},r));continue}i.push(t(h,{backgroundColor:l,color:n,children:p},r))}s.push(t(f,{children:i},o))}return t(f,{flexDirection:"column",children:s})}export{y as Image,y as default};
@@ -0,0 +1,125 @@
1
+ export { Accordion, type AccordionItem, type AccordionProps } from "./accordion.js";
2
+ export { Alert, type AlertProps, type AlertVariant } from "./alert.js";
3
+ export { AnimatePresence, type AnimatePresenceProps } from "./animate-presence.js";
4
+ export { type ApprovalDecision, ApprovalPrompt, type ApprovalPromptProps, type ApprovalRisk } from "./approval-prompt.js";
5
+ export { AreaChart, type AreaChartProps } from "./area-chart.js";
6
+ export { Badge, type BadgeProps } from "./badge.js";
7
+ export { BarChart, type BarChartProps, type BarDatum } from "./bar-chart.js";
8
+ export { BigText, type Align as BigTextAlign, type BackgroundColor as BigTextBackgroundColor, type BigTextFont, type BigTextProps } from "./big-text.js";
9
+ export { BlinkDot, type BlinkDotProps } from "./blink-dot.js";
10
+ export { Breadcrumb, type BreadcrumbItem, type BreadcrumbProps } from "./breadcrumb.js";
11
+ export { Button, type ButtonProps, type ButtonVariant } from "./button.js";
12
+ export { Calendar, type CalendarProps } from "./calendar.js";
13
+ export { Card, type CardProps } from "./card.js";
14
+ export { Checkbox, type CheckboxProps } from "./checkbox.js";
15
+ export { CheckboxGroup, type CheckboxGroupProps, type CheckboxOption } from "./checkbox-group.js";
16
+ export { Code, type CodeProps } from "./code.js";
17
+ export { Collapsible, type CollapsibleProps } from "./collapsible.js";
18
+ export { ColorPicker, type ColorPickerProps } from "./color-picker.js";
19
+ export { CommandBlock, type CommandBlockProps, type CommandStatus } from "./command-block.js";
20
+ export { type CommandEntry, CommandPalette, type CommandPaletteProps } from "./command-palette.js";
21
+ export { ConfirmDialog, type ConfirmDialogProps, type ConfirmTone } from "./confirm-dialog.js";
22
+ export { ConfirmInput, type ConfirmInputProps } from "./confirm-input.js";
23
+ export { ConsoleOverlay, type ConsoleOverlayDock, type ConsoleOverlayProps } from "./console-overlay.js";
24
+ export { ContentSwitcher, type ContentSwitcherOption, type ContentSwitcherProps } from "./content-switcher.js";
25
+ export { DataGrid, type DataGridColumn, type DataGridProps } from "./data-grid.js";
26
+ export { DatePicker, type DatePickerProps } from "./date-picker.js";
27
+ export { type DefinitionItem, DefinitionList, type DefinitionListProps } from "./definition-list.js";
28
+ export { Dialog, type DialogProps } from "./dialog.js";
29
+ export { DiffView, type DiffViewMode, type DiffViewProps, type InlineDiffMode } from "./diff-view.js";
30
+ export { Digits, type DigitsProps } from "./digits.js";
31
+ export { type DirectoryNode, DirectoryTree, type DirectoryTreeProps } from "./directory-tree.js";
32
+ export { Divider, type DividerProps } from "./divider.js";
33
+ export { Drawer, type DrawerProps } from "./drawer.js";
34
+ export { FileChange, type FileChangeProps, type FileChangeStatus } from "./file-change.js";
35
+ export { type F as FileEntry, a as FilePicker, type b as FilePickerFilter, type P as FilePickerProps } from "./packem_shared/file-picker.d-Cie6aAMD.js";
36
+ export { Form, FormField, type FormFieldProps, type FormProps } from "./form.js";
37
+ export { Gauge, type GaugeProps, type GaugeSize, type GaugeThreshold } from "./gauge.js";
38
+ export { Gradient, type GradientColors, type GradientName, type GradientProps } from "./gradient.js";
39
+ export { Grid, type GridProps } from "./grid.js";
40
+ export { Heading, type HeadingLevel, type HeadingProps } from "./heading.js";
41
+ export { Heatmap, type HeatmapProps } from "./heatmap.js";
42
+ export { Help, type HelpProps } from "./help.js";
43
+ export { Histogram, type HistogramProps } from "./histogram.js";
44
+ export { Image, type ImageProps } from "./image.js";
45
+ export { Json, type JsonProps, type JsonTheme } from "./json.js";
46
+ export { Kbd, type KbdProps } from "./kbd.js";
47
+ export { LineChart, type LineChartProps, type LineSeries } from "./line-chart.js";
48
+ export { Link, type LinkProps } from "./link.js";
49
+ export { LoadingIndicator, type LoadingIndicatorProps } from "./loading-indicator.js";
50
+ export { Log, type LogEntry, type LogLevel, type LogProps } from "./log.js";
51
+ export { Markdown, type MarkdownProps } from "./markdown.js";
52
+ export { MaskedInput, type MaskedInputProps } from "./masked-input.js";
53
+ export { Menu, type MenuItem, type MenuProps, type MenuSection } from "./menu.js";
54
+ export { MessageBubble, type MessageBubbleProps, type MessageRole } from "./message-bubble.js";
55
+ export { ModelBadge, type ModelBadgeProps } from "./model-badge.js";
56
+ export { type ModelOption, ModelSelector, type ModelSelectorProps } from "./model-selector.js";
57
+ export { MultiProgress, type MultiProgressProps, type ProgressItem } from "./multi-progress.js";
58
+ export { MultiSelect, type MultiSelectOption, type MultiSelectProps } from "./multi-select.js";
59
+ export { NotificationBadge, type NotificationBadgeProps } from "./notification-badge.js";
60
+ export { NumberInput, type NumberInputProps } from "./number-input.js";
61
+ export { type OperationNode, type OperationStatus, OperationTree, type OperationTreeProps } from "./operation-tree.js";
62
+ export { OptionList, type OptionListEntry, type OptionListProps } from "./option-list.js";
63
+ export { OrderedList, type OrderedListEntry, type OrderedListProps } from "./ordered-list.js";
64
+ export { type PageMeta, Paginator, type PaginatorProps } from "./paginator.js";
65
+ export { Paragraph, type ParagraphProps } from "./paragraph.js";
66
+ export { PathInput, type PathInputProps } from "./path-input.js";
67
+ export { PieChart, type PieChartProps, type PieSlice } from "./pie-chart.js";
68
+ export { Placeholder, type PlaceholderProps } from "./placeholder.js";
69
+ export { Popover, type PopoverProps } from "./popover.js";
70
+ export { ProgressBar, type ProgressBarProps } from "./progress-bar.js";
71
+ export { ProgressCircle, type ProgressCircleProps } from "./progress-circle.js";
72
+ export { QrCode, type Props as QrCodeProps } from "./qr-code.js";
73
+ export { RadioGroup, type Props as RadioGroupProps, type RadioOption } from "./radio-group.js";
74
+ export { ScatterPlot, type Props as ScatterPlotProps } from "./scatter-plot.js";
75
+ export { C as ControlledScrollView, type a as ControlledScrollViewProps, type b as ControlledScrollViewRef } from "./packem_shared/controlled-scroll-view.d-vF4wevEJ.js";
76
+ export { S as ScrollBar, type a as ScrollBarPlacement, type b as ScrollBarProps, type c as ScrollBarStyle } from "./packem_shared/scroll-bar.d-B4sD1hBR.js";
77
+ export { S as ScrollBarBox, type a as ScrollBarBoxProps } from "./packem_shared/scroll-bar-box.d-DSBbBsRc.js";
78
+ export { type S as ScrollAlignment, a as ScrollList, type b as ScrollListProps, type c as ScrollListRef } from "./packem_shared/scroll-list.d-BP0UZSY4.js";
79
+ export { S as ScrollView, type a as ScrollViewProps, type b as ScrollViewRef } from "./packem_shared/scroll-view.d-BqKpI-F-.js";
80
+ export { SearchInput, type Props as SearchInputProps } from "./search-input.js";
81
+ export { SelectInput, type SelectInputEntry, type Item as SelectInputItemType, type Props as SelectInputProps, type SelectInputSeparator } from "./select-input.js";
82
+ export { SelectInputIndicator, type Props as SelectInputIndicatorProps } from "./select-input-indicator.js";
83
+ export { SelectInputItem, type Props as SelectInputItemProps } from "./select-input-item.js";
84
+ export { ShimmerText, type Props as ShimmerTextProps } from "./shimmer-text.js";
85
+ export { Sidebar, type Props as SidebarProps } from "./sidebar.js";
86
+ export { Slider, type Props as SliderProps } from "./slider.js";
87
+ export { Sparkline, type Props as SparklineProps } from "./sparkline.js";
88
+ export { Spinner, type Props as SpinnerProps } from "./spinner.js";
89
+ export { StatusLine, type Props as StatusLineProps } from "./status-line.js";
90
+ export { StatusMessage, type Props as StatusMessageProps, type StatusMessageVariant } from "./status-message.js";
91
+ export { type StepStatus, Stepper, type Props as StepperProps, type StepperStep } from "./stepper.js";
92
+ export { Stopwatch, type Props as StopwatchProps, type StopwatchRef } from "./stopwatch.js";
93
+ export { StreamingText, type Props as StreamingTextProps } from "./streaming-text.js";
94
+ export { Switch, type Props as SwitchProps } from "./switch.js";
95
+ export { Tab, type Props as TabProps } from "./tab.js";
96
+ export { Table, type ColumnConfig as TableColumnConfig, type Props as TableProps, type Scalar as TableScalar, type ScalarDict as TableScalarDict } from "./table.js";
97
+ export { type TabColors, Tabs, type KeyMap as TabsKeyMap, type Props as TabsProps } from "./tabs.js";
98
+ export { Tag, type Props as TagProps, type TagVariant } from "./tag.js";
99
+ export { TagInput, type Props as TagInputProps } from "./tag-input.js";
100
+ export { TextInput, type Props as TextInputProps } from "./text-input.js";
101
+ export { Textarea, type Props as TextareaProps } from "./textarea.js";
102
+ export { ThinkingBlock, type Props as ThinkingBlockProps } from "./thinking-block.js";
103
+ export { TimePicker, type Props as TimePickerProps, type TimeValue } from "./time-picker.js";
104
+ export { Timer, type Props as TimerProps, type TimerRef } from "./timer.js";
105
+ export { Toast, type Props as ToastProps, type ToastVariant } from "./toast.js";
106
+ export { TokenUsage, type Props as TokenUsageProps } from "./token-usage.js";
107
+ export { ToolCall, type Props as ToolCallProps, type ToolCallStatus } from "./tool-call.js";
108
+ export { Tooltip, type TooltipPlacement, type Props as TooltipProps } from "./tooltip.js";
109
+ export { default as Transition, type TransitionPhase, type TransitionPreset, type Props as TransitionProps } from "./transition.js";
110
+ export { TreeSelect, type TreeSelectNode, type Props as TreeSelectProps } from "./tree-select.js";
111
+ export { type A as AsyncChildrenFunction, type F as FlatNode, type S as SelectionMode, type T as TreeNode, a as TreeNodeMap, type b as TreeNodeRendererProps, type c as TreeNodeState, d as TreeView, type P as TreeViewProps, type e as TreeViewState, type f as TreeViewTheme, type U as UseTreeViewProps, type g as UseTreeViewStateProps, t as treeViewTheme, u as useTreeView, h as useTreeViewState } from "./packem_shared/use-tree-view.d-dXTKoDPM.js";
112
+ export { UnorderedList, type UnorderedListEntry, type Props as UnorderedListProps } from "./unordered-list.js";
113
+ import '@visulima/colorize';
114
+ import 'react';
115
+ import 'type-fest';
116
+ import "./packem_shared/variant-config.d-D5NnrrQK.js";
117
+ import '@visulima/tui/hooks/use-console-capture';
118
+ import '@visulima/tui/components/box';
119
+ import '@visulima/colorize/gradient';
120
+ import '@visulima/tui/hooks/use-key-bindings';
121
+ import '@visulima/tui/canvas';
122
+ import '@visulima/spinner';
123
+ import '@visulima/tui/components/text';
124
+ import '@visulima/tui/hooks/use-stopwatch';
125
+ import '@visulima/tui/hooks/use-timer';
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ import{Accordion as e}from"./accordion.js";import{Alert as p}from"./alert.js";import{AnimatePresence as f}from"./animate-presence.js";import{ApprovalPrompt as a}from"./approval-prompt.js";import{AreaChart as l}from"./area-chart.js";import{Badge as d}from"./badge.js";import{BarChart as c}from"./bar-chart.js";import{BigText as u}from"./big-text.js";import{BlinkDot as T}from"./blink-dot.js";import{Breadcrumb as h}from"./breadcrumb.js";import{Button as k}from"./button.js";import{Calendar as I}from"./calendar.js";import{Card as w}from"./card.js";import{Checkbox as L}from"./checkbox.js";import{CheckboxGroup as V}from"./checkbox-group.js";import{Code as A}from"./code.js";import{Collapsible as v}from"./collapsible.js";import{ColorPicker as O}from"./color-picker.js";import{CommandBlock as y}from"./command-block.js";import{CommandPalette as J}from"./command-palette.js";import{ConfirmDialog as Q}from"./confirm-dialog.js";import{ConfirmInput as j}from"./confirm-input.js";import{ConsoleOverlay as z}from"./console-overlay.js";import{ContentSwitcher as W}from"./content-switcher.js";import{DataGrid as Y}from"./data-grid.js";import{DatePicker as _}from"./date-picker.js";import{DefinitionList as rr}from"./definition-list.js";import{Dialog as er}from"./dialog.js";import{DiffView as pr}from"./diff-view.js";import{Digits as fr}from"./digits.js";import{DirectoryTree as ar}from"./directory-tree.js";import{Divider as lr}from"./divider.js";import{Drawer as dr}from"./drawer.js";import{FileChange as cr}from"./file-change.js";import{Form as ur,FormField as Sr}from"./form.js";import{Gauge as Cr}from"./gauge.js";import{Gradient as Pr}from"./gradient.js";import{Grid as Br}from"./grid.js";import{Heading as br}from"./heading.js";import{Heatmap as Dr}from"./heatmap.js";import{Help as Mr}from"./help.js";import{Histogram as Gr}from"./histogram.js";import{Image as Fr}from"./image.js";import{Json as Hr}from"./json.js";import{Kbd as Nr}from"./kbd.js";import{h as Ur}from"./packem_shared/line-chart-BbhMhcZg.js";import{Link as Kr}from"./link.js";import{LoadingIndicator as Rr}from"./loading-indicator.js";import{Log as qr}from"./log.js";import{Markdown as Er}from"./markdown.js";import{MaskedInput as Xr}from"./masked-input.js";import{Menu as Zr}from"./menu.js";import{MessageBubble as $r}from"./message-bubble.js";import{ModelBadge as oo}from"./model-badge.js";import{ModelSelector as to}from"./model-selector.js";import{MultiProgress as mo}from"./multi-progress.js";import{MultiSelect as xo}from"./multi-select.js";import{NotificationBadge as io}from"./notification-badge.js";import{NumberInput as no}from"./number-input.js";import{OperationTree as co}from"./operation-tree.js";import{OptionList as uo}from"./option-list.js";import{OrderedList as To}from"./ordered-list.js";import{Paginator as ho}from"./paginator.js";import{Paragraph as ko}from"./paragraph.js";import{PathInput as Io}from"./path-input.js";import{PieChart as wo}from"./pie-chart.js";import{Placeholder as Lo}from"./placeholder.js";import{Popover as Vo}from"./popover.js";import{ProgressBar as Ao}from"./progress-bar.js";import{ProgressCircle as vo}from"./progress-circle.js";import{QrCode as Oo}from"./qr-code.js";import{RadioGroup as yo}from"./radio-group.js";import{ScatterPlot as Jo}from"./scatter-plot.js";import{SearchInput as Qo}from"./search-input.js";import{SelectInput as jo}from"./select-input.js";import{SelectInputIndicator as zo}from"./select-input-indicator.js";import{SelectInputItem as Wo}from"./select-input-item.js";import{ShimmerText as Yo}from"./shimmer-text.js";import{Sidebar as _o}from"./sidebar.js";import{Slider as re}from"./slider.js";import{Sparkline as ee}from"./sparkline.js";import{Spinner as pe}from"./spinner.js";import{StatusLine as fe}from"./status-line.js";import{StatusMessage as ae}from"./status-message.js";import{Stepper as le}from"./stepper.js";import{Stopwatch as de}from"./stopwatch.js";import{StreamingText as ce}from"./streaming-text.js";import{Switch as ue}from"./switch.js";import{Tab as Te}from"./tab.js";import{Table as he}from"./table.js";import{Tabs as ke}from"./tabs.js";import{Tag as Ie}from"./tag.js";import{TagInput as we}from"./tag-input.js";import{TextInput as Le}from"./text-input.js";import{Textarea as Ve}from"./textarea.js";import{ThinkingBlock as Ae}from"./thinking-block.js";import{TimePicker as ve}from"./time-picker.js";import{Timer as Oe}from"./timer.js";import{Toast as ye}from"./toast.js";import{TokenUsage as Je}from"./token-usage.js";import{ToolCall as Qe}from"./tool-call.js";import{Tooltip as je}from"./tooltip.js";import{default as ze}from"./transition.js";import{TreeSelect as We}from"./tree-select.js";import{UnorderedList as Ye}from"./unordered-list.js";import{default as _e}from"./packem_shared/FilePicker-V5H2fb-v.js";import{C as rt}from"./packem_shared/controlled-scroll-view-DerVKKv6.js";import{ScrollBar as et}from"./packem_shared/ScrollBar-C9i3z3Ft.js";import{ScrollBarBox as pt}from"./packem_shared/ScrollBarBox-DZEC8YnV.js";import{ScrollList as ft}from"./packem_shared/ScrollList-Djtb2vVy.js";import{ScrollView as at}from"./packem_shared/ScrollView-ESxpl6Hy.js";import{TreeNodeMap as lt}from"./packem_shared/TreeNodeMap-cJlYqckB.js";import{TreeView as dt}from"./packem_shared/TreeView-q0l446NV.js";import{theme as ct}from"./packem_shared/treeViewTheme-Dq3ekRAC.js";import{useTreeView as ut}from"./packem_shared/useTreeView-D0JEqT6W.js";import{useTreeViewState as Tt}from"./packem_shared/useTreeViewState-BiTJakkh.js";export{e as Accordion,p as Alert,f as AnimatePresence,a as ApprovalPrompt,l as AreaChart,d as Badge,c as BarChart,u as BigText,T as BlinkDot,h as Breadcrumb,k as Button,I as Calendar,w as Card,L as Checkbox,V as CheckboxGroup,A as Code,v as Collapsible,O as ColorPicker,y as CommandBlock,J as CommandPalette,Q as ConfirmDialog,j as ConfirmInput,z as ConsoleOverlay,W as ContentSwitcher,rt as ControlledScrollView,Y as DataGrid,_ as DatePicker,rr as DefinitionList,er as Dialog,pr as DiffView,fr as Digits,ar as DirectoryTree,lr as Divider,dr as Drawer,cr as FileChange,_e as FilePicker,ur as Form,Sr as FormField,Cr as Gauge,Pr as Gradient,Br as Grid,br as Heading,Dr as Heatmap,Mr as Help,Gr as Histogram,Fr as Image,Hr as Json,Nr as Kbd,Ur as LineChart,Kr as Link,Rr as LoadingIndicator,qr as Log,Er as Markdown,Xr as MaskedInput,Zr as Menu,$r as MessageBubble,oo as ModelBadge,to as ModelSelector,mo as MultiProgress,xo as MultiSelect,io as NotificationBadge,no as NumberInput,co as OperationTree,uo as OptionList,To as OrderedList,ho as Paginator,ko as Paragraph,Io as PathInput,wo as PieChart,Lo as Placeholder,Vo as Popover,Ao as ProgressBar,vo as ProgressCircle,Oo as QrCode,yo as RadioGroup,Jo as ScatterPlot,et as ScrollBar,pt as ScrollBarBox,ft as ScrollList,at as ScrollView,Qo as SearchInput,jo as SelectInput,zo as SelectInputIndicator,Wo as SelectInputItem,Yo as ShimmerText,_o as Sidebar,re as Slider,ee as Sparkline,pe as Spinner,fe as StatusLine,ae as StatusMessage,le as Stepper,de as Stopwatch,ce as StreamingText,ue as Switch,Te as Tab,he as Table,ke as Tabs,Ie as Tag,we as TagInput,Le as TextInput,Ve as Textarea,Ae as ThinkingBlock,ve as TimePicker,Oe as Timer,ye as Toast,Je as TokenUsage,Qe as ToolCall,je as Tooltip,ze as Transition,lt as TreeNodeMap,We as TreeSelect,dt as TreeView,Ye as UnorderedList,ct as treeViewTheme,ut as useTreeView,Tt as useTreeViewState};
package/dist/json.d.ts ADDED
@@ -0,0 +1,58 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type Color = LiteralUnion<AnsiColors, string>;
5
+ type JsonTheme = {
6
+ readonly boolean: Color;
7
+ readonly bracket: Color;
8
+ readonly key: Color;
9
+ readonly null: Color;
10
+ readonly number: Color;
11
+ readonly string: Color;
12
+ };
13
+ type Props = {
14
+ /**
15
+ * Accent color for the focused row.
16
+ * @default "blue"
17
+ */
18
+ readonly accentColor?: Color;
19
+ /**
20
+ * Auto-focus for keyboard navigation.
21
+ */
22
+ readonly autoFocus?: boolean;
23
+ /**
24
+ * Depth at which nested containers start collapsed. `0` collapses
25
+ * everything below the root; `Infinity` expands all.
26
+ * @default Infinity
27
+ */
28
+ readonly collapseDepth?: number;
29
+ /**
30
+ * The value to render.
31
+ */
32
+ readonly data: unknown;
33
+ /**
34
+ * When true, arrow keys move a cursor and Space toggles the focused
35
+ * container. When false, the tree renders statically fully expanded down to
36
+ * `collapseDepth`.
37
+ * @default true
38
+ */
39
+ readonly interactive?: boolean;
40
+ /**
41
+ * Color theme for the different JSON token kinds.
42
+ */
43
+ readonly theme?: Partial<JsonTheme>;
44
+ };
45
+ /**
46
+ * A collapsible JSON viewer. Objects and arrays can be folded; when
47
+ * `interactive`, arrow keys move a cursor and Space toggles the focused
48
+ * container. Values are colored by type.
49
+ */
50
+ declare function Json({
51
+ accentColor,
52
+ autoFocus,
53
+ collapseDepth,
54
+ data,
55
+ interactive,
56
+ theme
57
+ }: Props): ReactElement;
58
+ export { Json, type Props as JsonProps, JsonTheme, Props, Json as default };
package/dist/json.js ADDED
@@ -0,0 +1 @@
1
+ import{jsx as l,jsxs as $}from"react/jsx-runtime";import O from"@visulima/tui/components/box";import a from"@visulima/tui/components/text";import P from"@visulima/tui/hooks/use-focus";import V from"@visulima/tui/hooks/use-input";import{useMemo as I,useState as F,useCallback as N}from"react";const B={boolean:"yellow",bracket:"gray",key:"cyan",null:"gray",number:"green",string:"yellow"},D=e=>{if(e===null)return"null";if(Array.isArray(e))return"array";const o=typeof e;return o==="object"||o==="boolean"||o==="number"||o==="string"||o==="undefined"?o:"string"},C=e=>{const o=D(e);return o==="array"||o==="object"},M=e=>Array.isArray(e)?`[…${e.length}]`:`{…${Object.keys(e).length}}`,w=(e,o,d,c,s,y)=>{const i=C(e)&&(Array.isArray(e)?e.length>0:Object.keys(e).length>0);if(y.push({collapsible:i,depth:d,id:c,key:o,summary:i?M(e):void 0,value:e}),!(!i||s.has(c))){if(Array.isArray(e)){e.forEach((u,f)=>{w(u,String(f),d+1,`${c}.${f}`,s,y)});return}for(const[u,f]of Object.entries(e))w(f,u,d+1,`${c}.${u}`,s,y)}};function x(e,o){return o===0?0:(e%o+o)%o}function H({accentColor:e="blue",autoFocus:o=!1,collapseDepth:d=Number.POSITIVE_INFINITY,data:c,interactive:s=!0,theme:y}){const i={...B,...y},{isFocused:u}=P({autoFocus:o,isActive:s}),f=I(()=>{const r=new Set,n=(t,p,g)=>{if(!C(t))return;p>=d&&r.add(g);const m=Array.isArray(t)?t.map((v,k)=>[String(k),v]):Object.entries(t);for(const[v,k]of m)n(k,p+1,`${g}.${v}`)};return n(c,0,"$"),r},[d,c]),[h,J]=F(f),[A,S]=F(0),b=I(()=>{const r=[];return w(c,void 0,0,"$",h,r),r},[h,c]),j=N(r=>{J(n=>{const t=new Set(n);return t.has(r)?t.delete(r):t.add(r),t})},[]),T=N((r,n)=>{if(n.upArrow){S(m=>x(m-1,b.length));return}if(n.downArrow){S(m=>x(m+1,b.length));return}const t=b[A];if(!t?.collapsible)return;const p=n.rightArrow&&h.has(t.id),g=n.leftArrow&&!h.has(t.id);(r===" "||p||g)&&j(t.id)},[h,A,b,j]);V(T,{isActive:s&&u});const E=r=>{if(r.collapsible){const t=h.has(r.id)?"▸":"▾";return $(a,{color:i.bracket,children:[t," ",r.summary]})}const n=D(r.value);return n==="array"||n==="object"?l(a,{color:i.bracket,children:n==="array"?"[]":"{}"}):n==="string"?l(a,{color:i.string,children:JSON.stringify(r.value)}):n==="number"?l(a,{color:i.number,children:String(r.value)}):n==="boolean"?l(a,{color:i.boolean,children:String(r.value)}):l(a,{color:i.null,children:r.value===void 0?"undefined":"null"})};return l(O,{flexDirection:"column",children:b.map((r,n)=>{const t=s&&u&&n===A;return $(O,{children:[l(a,{color:t?e:void 0,children:t?"❯":" "}),l(a,{children:" ".repeat(r.depth)}),r.key===void 0?void 0:$(a,{color:i.key,children:[r.key,":"," "]}),E(r)]},r.id)})})}export{H as Json,H as default};
package/dist/kbd.d.ts ADDED
@@ -0,0 +1,31 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { ReactNode, ReactElement } from 'react';
3
+ import { LiteralUnion } from 'type-fest';
4
+ type Props = {
5
+ /**
6
+ * Key cap content.
7
+ */
8
+ readonly children: ReactNode;
9
+ /**
10
+ * Background color of the key cap.
11
+ * @default "gray"
12
+ */
13
+ readonly color?: LiteralUnion<AnsiColors, string>;
14
+ /**
15
+ * Visual style.
16
+ * - `solid` (default): background filled
17
+ * - `outline`: border only
18
+ * - `bare`: no decoration, just dimmed text
19
+ */
20
+ readonly variant?: "bare" | "outline" | "solid";
21
+ };
22
+ /**
23
+ * Render a keyboard key (e.g. `&lt;Kbd>Enter&lt;/Kbd>`).
24
+ * @returns A `ReactElement` styled as a key cap (solid / outline / bare).
25
+ */
26
+ declare function Kbd({
27
+ children,
28
+ color,
29
+ variant
30
+ }: Props): ReactElement;
31
+ export { Kbd, type Props as KbdProps, Props, Kbd as default };
package/dist/kbd.js ADDED
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as l}from"react/jsx-runtime";import n from"@visulima/tui/components/box";import d from"@visulima/tui/components/text";function m({children:r,color:o="gray",variant:i="solid"}){return i==="solid"?e(d,{backgroundColor:o,color:"black",children:[" ",r," "]}):i==="outline"?l(n,{borderColor:o,borderStyle:"round",paddingX:1,children:l(d,{color:o,children:r})}):l(d,{dimColor:!0,children:r})}export{m as Kbd,m as default};
@@ -0,0 +1,109 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { CanvasContext } from '@visulima/tui/canvas';
3
+ import { ReactElement } from 'react';
4
+ import { LiteralUnion } from 'type-fest';
5
+ /**
6
+ * A single 2D data point.
7
+ */
8
+ type Point = {
9
+ readonly x: number;
10
+ readonly y: number;
11
+ };
12
+ type LineSeries = {
13
+ /**
14
+ * Per-series color override. Falls back to the chart-level palette.
15
+ */
16
+ readonly color?: LiteralUnion<AnsiColors, string>;
17
+ /**
18
+ * Numeric samples to plot. Pass either a list of y-values (x is the
19
+ * index) or {x, y} tuples.
20
+ */
21
+ readonly data: ReadonlyArray<number> | ReadonlyArray<{
22
+ readonly x: number;
23
+ readonly y: number;
24
+ }>;
25
+ /**
26
+ * Optional label shown in the legend.
27
+ */
28
+ readonly label?: string;
29
+ };
30
+ type LineChartProps = {
31
+ /**
32
+ * Color for axis ticks / labels.
33
+ * @default "gray"
34
+ */
35
+ readonly axisColor?: LiteralUnion<AnsiColors, string>;
36
+ /**
37
+ * Chart body height in character rows.
38
+ * @default 10
39
+ */
40
+ readonly height?: number;
41
+ /**
42
+ * Upper bound for the y-axis. When omitted the chart auto-scales.
43
+ */
44
+ readonly maxY?: number;
45
+ /**
46
+ * Lower bound for the y-axis. When omitted the chart auto-scales.
47
+ */
48
+ readonly minY?: number;
49
+ /**
50
+ * Fallback palette cycled through when a series does not set `color`.
51
+ * @default ["cyan", "magenta", "yellow", "green", "blue", "red"]
52
+ */
53
+ readonly palette?: ReadonlyArray<LiteralUnion<AnsiColors, string>>;
54
+ /**
55
+ * One or more line series.
56
+ */
57
+ readonly series: ReadonlyArray<LineSeries>;
58
+ /**
59
+ * Render the legend row under the plot.
60
+ * @default true
61
+ */
62
+ readonly showLegend?: boolean;
63
+ /**
64
+ * Chart body width in character columns.
65
+ * @default 40
66
+ */
67
+ readonly width?: number;
68
+ };
69
+ type RenderConfig = {
70
+ readonly axisColor: LiteralUnion<AnsiColors, string>;
71
+ readonly palette: ReadonlyArray<LiteralUnion<AnsiColors, string>>;
72
+ readonly seriesList: ReadonlyArray<{
73
+ color: LiteralUnion<AnsiColors, string>;
74
+ points: ReadonlyArray<Point>;
75
+ series: LineSeries;
76
+ }>;
77
+ readonly xMax: number;
78
+ readonly xMin: number;
79
+ readonly yMax: number;
80
+ readonly yMin: number;
81
+ };
82
+ /**
83
+ * Project an (x, y) data point into pixel-grid coordinates for the given
84
+ * canvas size. Used by every chart that paints on top of a braille grid.
85
+ */
86
+ declare const projectPoint: (point: Point, config: Pick<RenderConfig, "xMax" | "xMin" | "yMax" | "yMin">, pixelWidth: number, pixelHeight: number) => {
87
+ px: number;
88
+ py: number;
89
+ };
90
+ /**
91
+ * Shared drawing path used by LineChart and ScatterPlot. AreaChart wraps
92
+ * this with a fill pass.
93
+ */
94
+ declare const drawSeriesOnCanvas: (context: CanvasContext, mode: "line" | "scatter", config: RenderConfig) => void;
95
+ /**
96
+ * Smooth multi-series line chart rendered at 2x4 sub-cell resolution using
97
+ * Unicode braille patterns. Auto-scales both axes by default.
98
+ */
99
+ declare function LineChart({
100
+ axisColor,
101
+ height,
102
+ maxY,
103
+ minY,
104
+ palette,
105
+ series,
106
+ showLegend,
107
+ width
108
+ }: LineChartProps): ReactElement;
109
+ export { LineChart, LineChartProps, type RenderConfig as LineChartRenderConfig, LineSeries, LineChart as default, drawSeriesOnCanvas, projectPoint };
@@ -0,0 +1 @@
1
+ import"react/jsx-runtime";import"@visulima/tui/canvas";import"@visulima/tui/components/box";import"@visulima/tui/components/canvas";import"@visulima/tui/components/text";import"react";import{h as s,h as n,d,a as h}from"./packem_shared/line-chart-BbhMhcZg.js";export{s as LineChart,n as default,d as drawSeriesOnCanvas,h as projectPoint};
package/dist/link.d.ts ADDED
@@ -0,0 +1,38 @@
1
+ import { ReactNode, ReactElement } from 'react';
2
+ type Props = {
3
+ readonly children: ReactNode;
4
+ /**
5
+ * Determines whether the URL should be printed for unsupported terminals.
6
+ *
7
+ * - `true` (default): appends the URL after the text, e.g. `"My website https://example.com"`
8
+ * - `false`: renders just the text with no URL
9
+ * - `function`: custom fallback formatting, e.g. `(text, url) => \`[\${text}](\${url})\``
10
+ * @default true
11
+ */
12
+ readonly fallback?: ((text: string, url: string) => string) | boolean;
13
+ /**
14
+ * The URL to link to.
15
+ */
16
+ readonly url: string;
17
+ };
18
+ /**
19
+ * An Ink component that creates clickable links in the terminal using OSC 8 hyperlink sequences.
20
+ *
21
+ * [Supported terminals.](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda)
22
+ *
23
+ * For unsupported terminals, the link will be printed after the text: `My website https://example.com`.
24
+ *
25
+ * ```tsx
26
+ * import { Link, Text } from "@visulima/tui/ink";
27
+ *
28
+ * &lt;Link url="https://example.com"&gt;
29
+ * &lt;Text color="cyan"&gt;My Website&lt;/Text&gt;
30
+ * &lt;/Link&gt;
31
+ * ```
32
+ */
33
+ declare function Link({
34
+ children,
35
+ fallback,
36
+ url
37
+ }: Props): ReactElement;
38
+ export { Link, type Props as LinkProps, type Props, Link as default };
package/dist/link.js ADDED
@@ -0,0 +1 @@
1
+ import{jsx as i}from"react/jsx-runtime";import{hyperlink as u}from"@visulima/ansi";import c from"@visulima/tui/components/text";import f from"@visulima/tui/components/transform";import{useCallback as l}from"react";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},a=()=>process.env.FORCE_HYPERLINK?process.env.FORCE_HYPERLINK!=="0":(n!==void 0||(n=m()),n);function T({children:o,fallback:r=!0,url:e}){const s=l(t=>a()?u(t,e):r===!1?t:typeof r=="function"?r(t,e):`${t} ${e}`,[r,e]);return i(f,{transform:s,children:i(c,{children:o})})}export{T as Link,T as default};
@@ -0,0 +1,29 @@
1
+ import { AnsiColors } from '@visulima/colorize';
2
+ import { SpinnerName } from '@visulima/spinner';
3
+ import { ReactNode, ReactElement } from 'react';
4
+ import { LiteralUnion } from 'type-fest';
5
+ type Props = {
6
+ /**
7
+ * Optional message rendered after the spinner.
8
+ */
9
+ readonly children?: ReactNode;
10
+ /**
11
+ * Color used for the spinner and label.
12
+ * @default "cyan"
13
+ */
14
+ readonly color?: LiteralUnion<AnsiColors, string>;
15
+ /**
16
+ * Spinner preset.
17
+ * @default "dots"
18
+ */
19
+ readonly type?: SpinnerName;
20
+ };
21
+ /**
22
+ * Compact spinner + label for loading states.
23
+ */
24
+ declare function LoadingIndicator({
25
+ children,
26
+ color,
27
+ type
28
+ }: Props): ReactElement;
29
+ export { LoadingIndicator, type Props as LoadingIndicatorProps, Props, LoadingIndicator as default };
@@ -0,0 +1 @@
1
+ import{jsxs as c,jsx as o}from"react/jsx-runtime";import d from"@visulima/tui/components/box";import n from"@visulima/tui/components/text";import{Spinner as e}from"./spinner.js";function s({children:r,color:i="cyan",type:t="dots"}){return c(d,{gap:1,children:[o(n,{color:i,children:o(e,{type:t})}),r===void 0?void 0:o(n,{color:i,children:r})]})}export{s as LoadingIndicator,s as default};
package/dist/log.d.ts ADDED
@@ -0,0 +1,38 @@
1
+ import { ReactElement } from 'react';
2
+ type LogLevel = "debug" | "error" | "info" | "success" | "warn";
3
+ type LogEntry = {
4
+ readonly level?: LogLevel;
5
+ readonly message: string;
6
+ readonly timestamp?: string;
7
+ };
8
+ type Props = {
9
+ /**
10
+ * The log entries, oldest first.
11
+ */
12
+ readonly entries: ReadonlyArray<LogEntry>;
13
+ /**
14
+ * Keep only the last N entries (tail). Omit to render all.
15
+ */
16
+ readonly maxLines?: number;
17
+ /**
18
+ * Render the `[LEVEL]` badge before each message.
19
+ * @default true
20
+ */
21
+ readonly showLevel?: boolean;
22
+ /**
23
+ * Render each entry's timestamp, when present.
24
+ * @default true
25
+ */
26
+ readonly showTimestamp?: boolean;
27
+ };
28
+ /**
29
+ * A leveled log view. Renders entries with a colored level badge and optional
30
+ * timestamp; `maxLines` tails the buffer to the most recent entries.
31
+ */
32
+ declare function Log({
33
+ entries,
34
+ maxLines,
35
+ showLevel,
36
+ showTimestamp
37
+ }: Props): ReactElement;
38
+ export { Log, LogEntry, LogLevel, type Props as LogProps, Props, Log as default };
package/dist/log.js ADDED
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as d}from"react/jsx-runtime";import r from"@visulima/tui/components/box";import n from"@visulima/tui/components/text";const h={debug:{color:"gray",label:"DBG"},error:{color:"red",label:"ERR"},info:{color:"blue",label:"INF"},success:{color:"green",label:"OK "},warn:{color:"yellow",label:"WRN"}};function p({entries:l,maxLines:i,showLevel:t=!0,showTimestamp:s=!0}){const a=i!==void 0&&l.length>i?l.slice(l.length-i):l;return e(r,{flexDirection:"column",children:a.map((o,m)=>{const c=h[o.level??"info"];return d(r,{children:[s&&o.timestamp!==void 0?e(r,{marginRight:1,children:e(n,{dimColor:!0,children:o.timestamp})}):void 0,t?e(r,{marginRight:1,children:e(n,{bold:!0,color:c.color,children:c.label})}):void 0,e(n,{children:o.message})]},m)})})}export{p as Log,p as default};