@visulima/tui 1.0.0-alpha.4 → 1.0.0-alpha.6

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 (249) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/LICENSE.md +140 -0
  3. package/dist/core/index.d.ts +58 -5
  4. package/dist/ink/index.d.ts +6592 -294
  5. package/dist/ink/index.js +1 -1
  6. package/dist/packem_shared/{Histogram-cgAjY5AJ.js → Histogram-CB6XcmZW.js} +1 -1
  7. package/dist/packem_shared/input.d-Bfq7oc06.d.ts +90 -0
  8. package/dist/packem_shared/render.d-BR3gA-N8.d.ts +1257 -0
  9. package/dist/react/index.d.ts +519 -8
  10. package/dist/testing/index.d.ts +274 -135
  11. package/package.json +16 -17
  12. package/dist/core/app.d.ts +0 -50
  13. package/dist/core/cell.d.ts +0 -33
  14. package/dist/core/inline.d.ts +0 -22
  15. package/dist/core/input.d.ts +0 -18
  16. package/dist/core/native-binding.d.ts +0 -22
  17. package/dist/ink/ansi-to-cell.d.ts +0 -5
  18. package/dist/ink/ansi-tokenizer.d.ts +0 -38
  19. package/dist/ink/canvas/braille.d.ts +0 -22
  20. package/dist/ink/canvas/buffer.d.ts +0 -67
  21. package/dist/ink/clipboard.d.ts +0 -29
  22. package/dist/ink/color-matrix.d.ts +0 -49
  23. package/dist/ink/color-utils.d.ts +0 -30
  24. package/dist/ink/colorize.d.ts +0 -4
  25. package/dist/ink/components/accessibility-context.d.ts +0 -4
  26. package/dist/ink/components/accordion.d.ts +0 -52
  27. package/dist/ink/components/alert.d.ts +0 -30
  28. package/dist/ink/components/animate-presence.d.ts +0 -15
  29. package/dist/ink/components/animation-context.d.ts +0 -10
  30. package/dist/ink/components/app-context.d.ts +0 -38
  31. package/dist/ink/components/app.d.ts +0 -19
  32. package/dist/ink/components/approval-prompt.d.ts +0 -55
  33. package/dist/ink/components/area-chart.d.ts +0 -54
  34. package/dist/ink/components/background-context.d.ts +0 -5
  35. package/dist/ink/components/badge.d.ts +0 -27
  36. package/dist/ink/components/bar-chart.d.ts +0 -57
  37. package/dist/ink/components/big-text.d.ts +0 -71
  38. package/dist/ink/components/blink-dot.d.ts +0 -30
  39. package/dist/ink/components/box.d.ts +0 -58
  40. package/dist/ink/components/breadcrumb.d.ts +0 -28
  41. package/dist/ink/components/button.d.ts +0 -38
  42. package/dist/ink/components/calendar.d.ts +0 -60
  43. package/dist/ink/components/canvas.d.ts +0 -38
  44. package/dist/ink/components/card.d.ts +0 -46
  45. package/dist/ink/components/chart-utils.d.ts +0 -54
  46. package/dist/ink/components/checkbox.d.ts +0 -39
  47. package/dist/ink/components/code.d.ts +0 -46
  48. package/dist/ink/components/collapsible.d.ts +0 -43
  49. package/dist/ink/components/command-block.d.ts +0 -38
  50. package/dist/ink/components/command-palette.d.ts +0 -72
  51. package/dist/ink/components/confirm-dialog.d.ts +0 -63
  52. package/dist/ink/components/confirm-input.d.ts +0 -40
  53. package/dist/ink/components/console-overlay.d.ts +0 -52
  54. package/dist/ink/components/content-switcher.d.ts +0 -49
  55. package/dist/ink/components/cursor-context.d.ts +0 -12
  56. package/dist/ink/components/cursor.d.ts +0 -43
  57. package/dist/ink/components/date-picker.d.ts +0 -53
  58. package/dist/ink/components/definition-list.d.ts +0 -37
  59. package/dist/ink/components/dialog.d.ts +0 -93
  60. package/dist/ink/components/diff-view.d.ts +0 -71
  61. package/dist/ink/components/divider.d.ts +0 -40
  62. package/dist/ink/components/error-boundary.d.ts +0 -17
  63. package/dist/ink/components/error-overview.d.ts +0 -6
  64. package/dist/ink/components/file-picker/file-picker.d.ts +0 -58
  65. package/dist/ink/components/file-picker/types.d.ts +0 -35
  66. package/dist/ink/components/file-picker/use-file-system.d.ts +0 -16
  67. package/dist/ink/components/focus-context.d.ts +0 -17
  68. package/dist/ink/components/form.d.ts +0 -74
  69. package/dist/ink/components/gauge.d.ts +0 -75
  70. package/dist/ink/components/gradient.d.ts +0 -38
  71. package/dist/ink/components/heading.d.ts +0 -27
  72. package/dist/ink/components/heatmap.d.ts +0 -51
  73. package/dist/ink/components/help.d.ts +0 -44
  74. package/dist/ink/components/histogram.d.ts +0 -52
  75. package/dist/ink/components/kbd.d.ts +0 -27
  76. package/dist/ink/components/line-chart.d.ts +0 -94
  77. package/dist/ink/components/link.d.ts +0 -34
  78. package/dist/ink/components/loading-indicator.d.ts +0 -24
  79. package/dist/ink/components/markdown.d.ts +0 -34
  80. package/dist/ink/components/masked-input.d.ts +0 -41
  81. package/dist/ink/components/menu.d.ts +0 -70
  82. package/dist/ink/components/message-bubble.d.ts +0 -35
  83. package/dist/ink/components/model-badge.d.ts +0 -32
  84. package/dist/ink/components/multi-select.d.ts +0 -63
  85. package/dist/ink/components/newline.d.ts +0 -12
  86. package/dist/ink/components/operation-tree.d.ts +0 -46
  87. package/dist/ink/components/option-list.d.ts +0 -41
  88. package/dist/ink/components/ordered-list.d.ts +0 -30
  89. package/dist/ink/components/paginator.d.ts +0 -59
  90. package/dist/ink/components/paragraph.d.ts +0 -31
  91. package/dist/ink/components/placeholder.d.ts +0 -47
  92. package/dist/ink/components/progress-bar.d.ts +0 -51
  93. package/dist/ink/components/radio-group.d.ts +0 -62
  94. package/dist/ink/components/scatter-plot.d.ts +0 -23
  95. package/dist/ink/components/scroll/controlled-scroll-view.d.ts +0 -43
  96. package/dist/ink/components/scroll/index.d.ts +0 -10
  97. package/dist/ink/components/scroll/scroll-bar-box.d.ts +0 -15
  98. package/dist/ink/components/scroll/scroll-bar.d.ts +0 -20
  99. package/dist/ink/components/scroll/scroll-list.d.ts +0 -12
  100. package/dist/ink/components/scroll/scroll-view.d.ts +0 -98
  101. package/dist/ink/components/scroll/use-state-ref.d.ts +0 -8
  102. package/dist/ink/components/search-input.d.ts +0 -46
  103. package/dist/ink/components/select-input-indicator.d.ts +0 -36
  104. package/dist/ink/components/select-input-item.d.ts +0 -43
  105. package/dist/ink/components/select-input.d.ts +0 -96
  106. package/dist/ink/components/shimmer-text.d.ts +0 -39
  107. package/dist/ink/components/slider.d.ts +0 -92
  108. package/dist/ink/components/spacer.d.ts +0 -7
  109. package/dist/ink/components/sparkline.d.ts +0 -30
  110. package/dist/ink/components/spinner.d.ts +0 -40
  111. package/dist/ink/components/static-render.d.ts +0 -40
  112. package/dist/ink/components/static.d.ts +0 -24
  113. package/dist/ink/components/status-line.d.ts +0 -30
  114. package/dist/ink/components/status-message.d.ts +0 -26
  115. package/dist/ink/components/stderr-context.d.ts +0 -16
  116. package/dist/ink/components/stdin-context.d.ts +0 -29
  117. package/dist/ink/components/stdout-context.d.ts +0 -16
  118. package/dist/ink/components/stepper.d.ts +0 -42
  119. package/dist/ink/components/stopwatch.d.ts +0 -42
  120. package/dist/ink/components/streaming-text.d.ts +0 -38
  121. package/dist/ink/components/switch.d.ts +0 -46
  122. package/dist/ink/components/tab.d.ts +0 -25
  123. package/dist/ink/components/table.d.ts +0 -80
  124. package/dist/ink/components/tabs.d.ts +0 -104
  125. package/dist/ink/components/tag.d.ts +0 -30
  126. package/dist/ink/components/text-input.d.ts +0 -48
  127. package/dist/ink/components/text.d.ts +0 -63
  128. package/dist/ink/components/textarea.d.ts +0 -62
  129. package/dist/ink/components/timer.d.ts +0 -50
  130. package/dist/ink/components/toast.d.ts +0 -41
  131. package/dist/ink/components/tooltip.d.ts +0 -36
  132. package/dist/ink/components/transform.d.ts +0 -16
  133. package/dist/ink/components/transition.d.ts +0 -53
  134. package/dist/ink/components/tree-view/theme.d.ts +0 -24
  135. package/dist/ink/components/tree-view/tree-node-map.d.ts +0 -72
  136. package/dist/ink/components/tree-view/tree-view-node.d.ts +0 -29
  137. package/dist/ink/components/tree-view/tree-view.d.ts +0 -89
  138. package/dist/ink/components/tree-view/types.d.ts +0 -55
  139. package/dist/ink/components/tree-view/use-tree-view-state.d.ts +0 -135
  140. package/dist/ink/components/tree-view/use-tree-view.d.ts +0 -26
  141. package/dist/ink/components/unordered-list.d.ts +0 -35
  142. package/dist/ink/components/variant-config.d.ts +0 -10
  143. package/dist/ink/cursor-helpers.d.ts +0 -35
  144. package/dist/ink/data-limited-lru-map.d.ts +0 -21
  145. package/dist/ink/devtools-window-polyfill.d.ts +0 -1
  146. package/dist/ink/devtools.d.ts +0 -1
  147. package/dist/ink/dom.d.ts +0 -214
  148. package/dist/ink/get-max-width.d.ts +0 -3
  149. package/dist/ink/highlighter.d.ts +0 -28
  150. package/dist/ink/hooks/use-animation.d.ts +0 -41
  151. package/dist/ink/hooks/use-app.d.ts +0 -6
  152. package/dist/ink/hooks/use-box-metrics.d.ts +0 -58
  153. package/dist/ink/hooks/use-clipboard.d.ts +0 -29
  154. package/dist/ink/hooks/use-color-blindness.d.ts +0 -33
  155. package/dist/ink/hooks/use-console-capture.d.ts +0 -43
  156. package/dist/ink/hooks/use-cursor.d.ts +0 -12
  157. package/dist/ink/hooks/use-focus-manager.d.ts +0 -42
  158. package/dist/ink/hooks/use-focus.d.ts +0 -30
  159. package/dist/ink/hooks/use-form.d.ts +0 -70
  160. package/dist/ink/hooks/use-hotkey.d.ts +0 -37
  161. package/dist/ink/hooks/use-input.d.ts +0 -149
  162. package/dist/ink/hooks/use-interval.d.ts +0 -25
  163. package/dist/ink/hooks/use-is-screen-reader-enabled.d.ts +0 -6
  164. package/dist/ink/hooks/use-key-bindings.d.ts +0 -59
  165. package/dist/ink/hooks/use-key-chord.d.ts +0 -26
  166. package/dist/ink/hooks/use-linked-scroll.d.ts +0 -41
  167. package/dist/ink/hooks/use-paste.d.ts +0 -44
  168. package/dist/ink/hooks/use-persistent-state.d.ts +0 -56
  169. package/dist/ink/hooks/use-scroll-acceleration.d.ts +0 -47
  170. package/dist/ink/hooks/use-scroll-input.d.ts +0 -34
  171. package/dist/ink/hooks/use-stderr.d.ts +0 -6
  172. package/dist/ink/hooks/use-stdin.d.ts +0 -7
  173. package/dist/ink/hooks/use-stdout.d.ts +0 -6
  174. package/dist/ink/hooks/use-stopwatch.d.ts +0 -38
  175. package/dist/ink/hooks/use-terminal-palette.d.ts +0 -19
  176. package/dist/ink/hooks/use-text-buffer.d.ts +0 -42
  177. package/dist/ink/hooks/use-text-selection.d.ts +0 -45
  178. package/dist/ink/hooks/use-timeout.d.ts +0 -24
  179. package/dist/ink/hooks/use-timer.d.ts +0 -47
  180. package/dist/ink/hooks/use-window-size.d.ts +0 -18
  181. package/dist/ink/ime-utils.d.ts +0 -25
  182. package/dist/ink/ink.d.ts +0 -190
  183. package/dist/ink/input-parser.d.ts +0 -10
  184. package/dist/ink/input-utils.d.ts +0 -16
  185. package/dist/ink/instances.d.ts +0 -3
  186. package/dist/ink/kitty-keyboard.d.ts +0 -23
  187. package/dist/ink/layout.d.ts +0 -26
  188. package/dist/ink/log-update-native.d.ts +0 -14
  189. package/dist/ink/log-update.d.ts +0 -21
  190. package/dist/ink/measure-element.d.ts +0 -147
  191. package/dist/ink/measure-text.d.ts +0 -56
  192. package/dist/ink/mouse/ansi-parser.d.ts +0 -37
  193. package/dist/ink/mouse/constants.d.ts +0 -14
  194. package/dist/ink/mouse/fullscreen.d.ts +0 -8
  195. package/dist/ink/mouse/index.d.ts +0 -20
  196. package/dist/ink/mouse/is-intersecting.d.ts +0 -18
  197. package/dist/ink/mouse/mouse-context.d.ts +0 -36
  198. package/dist/ink/mouse/mouse-provider.d.ts +0 -11
  199. package/dist/ink/mouse/use-element-position.d.ts +0 -29
  200. package/dist/ink/mouse/use-mouse-action.d.ts +0 -7
  201. package/dist/ink/mouse/use-mouse-position.d.ts +0 -7
  202. package/dist/ink/mouse/use-mouse.d.ts +0 -7
  203. package/dist/ink/mouse/use-on-mouse-click.d.ts +0 -14
  204. package/dist/ink/mouse/use-on-mouse-hover.d.ts +0 -8
  205. package/dist/ink/mouse/use-on-mouse-state.d.ts +0 -11
  206. package/dist/ink/output.d.ts +0 -75
  207. package/dist/ink/parse-keypress.d.ts +0 -22
  208. package/dist/ink/reconciler.d.ts +0 -3
  209. package/dist/ink/region.d.ts +0 -99
  210. package/dist/ink/render-background.d.ts +0 -4
  211. package/dist/ink/render-border.d.ts +0 -4
  212. package/dist/ink/render-node-to-output.d.ts +0 -38
  213. package/dist/ink/render-scrollbar.d.ts +0 -9
  214. package/dist/ink/render-sticky.d.ts +0 -44
  215. package/dist/ink/render-to-string.d.ts +0 -37
  216. package/dist/ink/render.d.ts +0 -191
  217. package/dist/ink/renderer.d.ts +0 -17
  218. package/dist/ink/resize-observer.d.ts +0 -44
  219. package/dist/ink/sanitize-ansi.d.ts +0 -2
  220. package/dist/ink/scroll.d.ts +0 -23
  221. package/dist/ink/selection.d.ts +0 -70
  222. package/dist/ink/squash-text-nodes.d.ts +0 -18
  223. package/dist/ink/style-flags.d.ts +0 -17
  224. package/dist/ink/styled-line-factory.d.ts +0 -25
  225. package/dist/ink/styled-line-serializer.d.ts +0 -18
  226. package/dist/ink/styled-line.d.ts +0 -119
  227. package/dist/ink/styles.d.ts +0 -369
  228. package/dist/ink/terminal-palette.d.ts +0 -25
  229. package/dist/ink/text-wrap.d.ts +0 -10
  230. package/dist/ink/token-to-elements.d.ts +0 -22
  231. package/dist/ink/utils/format-time.d.ts +0 -4
  232. package/dist/ink/utils.d.ts +0 -9
  233. package/dist/ink/wrap-text.d.ts +0 -3
  234. package/dist/ink/write-synchronized.d.ts +0 -4
  235. package/dist/react/devtools.d.ts +0 -27
  236. package/dist/react/focus.d.ts +0 -39
  237. package/dist/react/hooks.d.ts +0 -238
  238. package/dist/react/layout.d.ts +0 -33
  239. package/dist/react/react.d.ts +0 -57
  240. package/dist/react/reconciler.d.ts +0 -4
  241. package/dist/react/render-to-string.d.ts +0 -21
  242. package/dist/react/renderer.d.ts +0 -2
  243. package/dist/react/scene.d.ts +0 -3
  244. package/dist/react/static.d.ts +0 -39
  245. package/dist/react/styles.d.ts +0 -83
  246. package/dist/react/text-width.d.ts +0 -20
  247. package/dist/testing/keys.d.ts +0 -89
  248. package/dist/testing/screen.d.ts +0 -35
  249. package/dist/testing/wait-for.d.ts +0 -20
@@ -1,30 +0,0 @@
1
- import type { AnsiColors } from "@visulima/colorize";
2
- import type { ReactElement } from "react";
3
- import type { LiteralUnion } from "type-fest";
4
- export type Props = {
5
- /**
6
- * Dot character.
7
- * @default "●"
8
- */
9
- readonly character?: string;
10
- /**
11
- * Dot color.
12
- * @default "red"
13
- */
14
- readonly color?: LiteralUnion<AnsiColors, string>;
15
- /**
16
- * Milliseconds per blink cycle. The dot is visible for half the cycle.
17
- * @default 800
18
- */
19
- readonly interval?: number;
20
- /**
21
- * When false, the dot stays solid (no animation).
22
- * @default true
23
- */
24
- readonly isActive?: boolean;
25
- };
26
- /**
27
- * Steady or blinking indicator dot. Pair with `StatusLine` or next to a
28
- * label to show a "live" / "recording" status.
29
- */
30
- export default function BlinkDot({ character, color, interval, isActive }: Props): ReactElement;
@@ -1,58 +0,0 @@
1
- import type { ForwardRefExoticComponent, PropsWithChildren, ReactNode, RefAttributes } from "react";
2
- import type { Except } from "type-fest";
3
- import type { DOMElement } from "../dom.d.ts";
4
- import type { Styles } from "../styles.d.ts";
5
- export type Props = Except<Styles, "textWrap"> & {
6
- /**
7
- * Hide the element from screen readers.
8
- */
9
- readonly "aria-hidden"?: boolean;
10
- /**
11
- * A label for the element for screen readers.
12
- */
13
- readonly "aria-label"?: string;
14
- /**
15
- * The role of the element.
16
- */
17
- readonly "aria-role"?: "button" | "checkbox" | "combobox" | "list" | "listbox" | "listitem" | "menu" | "menuitem" | "option" | "progressbar" | "radio" | "radiogroup" | "tab" | "tablist" | "table" | "textbox" | "timer" | "toolbar";
18
- /**
19
- * The state of the element.
20
- */
21
- readonly "aria-state"?: {
22
- readonly busy?: boolean;
23
- readonly checked?: boolean;
24
- readonly disabled?: boolean;
25
- readonly expanded?: boolean;
26
- readonly multiline?: boolean;
27
- readonly multiselectable?: boolean;
28
- readonly readonly?: boolean;
29
- readonly required?: boolean;
30
- readonly selected?: boolean;
31
- };
32
- /**
33
- * Whether this element is opaque (prevents rendering of covered content beneath it).
34
- * Useful for performance optimization with layered content.
35
- */
36
- readonly opaque?: boolean;
37
- /**
38
- * Whether to render a scrollbar for this scrollable element.
39
- * Only applies when `overflow` is `'scroll'`. Defaults to `true`.
40
- */
41
- readonly scrollbar?: boolean;
42
- /**
43
- * Makes this element sticky within its scroll container.
44
- * - `true` or `'top'`: pinned to the top during scroll
45
- * - `'bottom'`: pinned to the bottom during scroll
46
- */
47
- readonly sticky?: boolean | "top" | "bottom";
48
- /**
49
- * Alternate content to render when this element is in its sticky (pinned) state.
50
- * Only applies when `sticky` is set. When omitted, the normal children are used.
51
- */
52
- readonly stickyChildren?: ReactNode;
53
- };
54
- /**
55
- * `&lt;Box>` is an essential Ink component to build your layout. It's like `&lt;div style="display: flex">` in the browser.
56
- */
57
- declare const Box: ForwardRefExoticComponent<PropsWithChildren<Props> & RefAttributes<DOMElement>>;
58
- export default Box;
@@ -1,28 +0,0 @@
1
- import type { AnsiColors } from "@visulima/colorize";
2
- import type { ReactElement, ReactNode } from "react";
3
- import type { LiteralUnion } from "type-fest";
4
- export type BreadcrumbItem = {
5
- readonly icon?: ReactNode;
6
- readonly key?: string;
7
- readonly label: string;
8
- };
9
- export type Props = {
10
- /**
11
- * Color applied to the trailing (current) item.
12
- * @default "blue"
13
- */
14
- readonly currentColor?: LiteralUnion<AnsiColors, string>;
15
- /**
16
- * Items to display from root to current page.
17
- */
18
- readonly items: ReadonlyArray<BreadcrumbItem>;
19
- /**
20
- * Separator between items.
21
- * @default "›"
22
- */
23
- readonly separator?: string;
24
- };
25
- /**
26
- * Render a breadcrumb trail (last item is highlighted).
27
- */
28
- export default function Breadcrumb({ currentColor, items, separator }: Props): ReactElement;
@@ -1,38 +0,0 @@
1
- import type { AnsiColors } from "@visulima/colorize";
2
- import type { ReactElement, ReactNode } from "react";
3
- import type { LiteralUnion } from "type-fest";
4
- export type ButtonVariant = "ghost" | "outline" | "primary" | "secondary";
5
- export type Props = {
6
- /**
7
- * Accent color used when the button is focused.
8
- * @default "blue"
9
- */
10
- readonly accentColor?: LiteralUnion<AnsiColors, string>;
11
- /**
12
- * Focus this button when mounted if nothing else is focused.
13
- */
14
- readonly autoFocus?: boolean;
15
- /**
16
- * Button label.
17
- */
18
- readonly children: ReactNode;
19
- /**
20
- * When true, the button ignores input and is rendered dim.
21
- */
22
- readonly isDisabled?: boolean;
23
- /**
24
- * Called when the user presses Enter or Space while the button has focus.
25
- */
26
- readonly onPress?: () => void;
27
- /**
28
- * Visual style.
29
- * @default "primary"
30
- */
31
- readonly variant?: ButtonVariant;
32
- };
33
- /**
34
- * Focusable button. Triggers `onPress` on Enter / Space.
35
- * @param props See {@link Props}.
36
- * @returns A `ReactElement` rendering the button (bordered or ghost variant).
37
- */
38
- export default function Button({ accentColor, autoFocus, children, isDisabled, onPress, variant }: Props): ReactElement;
@@ -1,60 +0,0 @@
1
- import type { AnsiColors } from "@visulima/colorize";
2
- import type { ReactElement } from "react";
3
- import type { LiteralUnion } from "type-fest";
4
- export type Props = {
5
- /**
6
- * Accent color for today / the focused cell.
7
- * @default "blue"
8
- */
9
- readonly accentColor?: LiteralUnion<AnsiColors, string>;
10
- /**
11
- * Auto-focus the grid on mount.
12
- */
13
- readonly autoFocus?: boolean;
14
- /**
15
- * Initial focused day when uncontrolled. Defaults to `value` or today.
16
- */
17
- readonly defaultValue?: Date;
18
- /**
19
- * First day of the week: 0 = Sunday, 1 = Monday.
20
- * @default 1
21
- */
22
- readonly firstDayOfWeek?: 0 | 1;
23
- /**
24
- * When true, disable input and render the grid dim.
25
- */
26
- readonly isDisabled?: boolean;
27
- /**
28
- * Upper bound; days after `maxDate` cannot be selected.
29
- */
30
- readonly maxDate?: Date;
31
- /**
32
- * Lower bound; days before `minDate` cannot be selected.
33
- */
34
- readonly minDate?: Date;
35
- /**
36
- * Called whenever the user navigates or selects a day.
37
- */
38
- readonly onChange?: (date: Date) => void;
39
- /**
40
- * Called when the user presses Enter.
41
- */
42
- readonly onSubmit?: (date: Date) => void;
43
- /**
44
- * Color used to mark the currently selected day.
45
- * @default "green"
46
- */
47
- readonly selectedColor?: LiteralUnion<AnsiColors, string>;
48
- /**
49
- * Controlled selected date.
50
- */
51
- readonly value?: Date;
52
- };
53
- /**
54
- * Month-grid date picker. Arrow keys move focus by one day, page up/down move
55
- * by month. Enter submits; Space or Enter selects.
56
- * @param props See {@link Props}.
57
- * @returns A bordered `ReactElement` containing the month header, weekday
58
- * labels, and the day grid.
59
- */
60
- export default function Calendar({ accentColor, autoFocus, defaultValue, firstDayOfWeek, isDisabled, maxDate, minDate, onChange, onSubmit, selectedColor, value, }: Props): ReactElement;
@@ -1,38 +0,0 @@
1
- import type { ReactElement } from "react";
2
- import type { CanvasContext } from "../canvas/buffer.d.ts";
3
- export type { CanvasColor, CanvasContext, CellStyle } from "../canvas/buffer.d.ts";
4
- export type Props = {
5
- /**
6
- * Imperative draw callback. Mutates the underlying typed-array buffer via
7
- * the provided `CanvasContext`. Runs in a `useMemo` keyed by `version` —
8
- * pass a stable reference (or hash) so the canvas only re-renders when
9
- * the input data truly changes.
10
- */
11
- readonly draw: (context: CanvasContext) => void;
12
- /**
13
- * Number of rows (character cells vertically).
14
- */
15
- readonly height: number;
16
- /**
17
- * Invalidation key — required so the memoization contract is explicit.
18
- * Re-runs `draw` and re-serializes only the rows the draw callback
19
- * dirtied. Pass the data you render (or a hash of it). Use a stable
20
- * value (e.g. a counter) when you intentionally want to redraw on
21
- * every render.
22
- */
23
- readonly version: unknown;
24
- /**
25
- * Number of columns (character cells horizontally).
26
- */
27
- readonly width: number;
28
- };
29
- /**
30
- * A fixed-size cell grid backed by typed arrays. Use the imperative `draw`
31
- * callback to paint. The canvas emits one `Text` child per row (not per cell)
32
- * and caches the ANSI output of each row: only rows marked dirty by the last
33
- * draw pass are re-serialized, and only when `version` changes.
34
- *
35
- * This is the foundation for chart/grid components that need more layout
36
- * control than `Text` alone.
37
- */
38
- export default function Canvas({ draw, height, version, width }: Props): ReactElement;
@@ -1,46 +0,0 @@
1
- import type { AnsiColors } from "@visulima/colorize";
2
- import type { ReactElement, ReactNode } from "react";
3
- import type { LiteralUnion } from "type-fest";
4
- export type Props = {
5
- /**
6
- * Border color.
7
- */
8
- readonly borderColor?: LiteralUnion<AnsiColors, string>;
9
- /**
10
- * Border style name, passed through to `Box`.
11
- * @default "round"
12
- */
13
- readonly borderStyle?: "arrow" | "bold" | "classic" | "double" | "doubleSingle" | "round" | "single" | "singleDouble";
14
- /**
15
- * Card body.
16
- */
17
- readonly children: ReactNode;
18
- /**
19
- * Optional footer rendered below body with a dim divider.
20
- */
21
- readonly footer?: ReactNode;
22
- /**
23
- * Optional content rendered after the title on the same row.
24
- */
25
- readonly headerRight?: ReactNode;
26
- /**
27
- * Optional subtitle rendered below the title.
28
- */
29
- readonly subtitle?: string;
30
- /**
31
- * Optional title rendered in the header area.
32
- */
33
- readonly title?: string;
34
- /**
35
- * Color applied to the title.
36
- */
37
- readonly titleColor?: LiteralUnion<AnsiColors, string>;
38
- /**
39
- * Fix the card width. When omitted the card grows to fill its parent.
40
- */
41
- readonly width?: number | string;
42
- };
43
- /**
44
- * Bordered container with optional title, subtitle, and footer.
45
- */
46
- export default function Card({ borderColor, borderStyle, children, footer, headerRight, subtitle, title, titleColor, width }: Props): ReactElement;
@@ -1,54 +0,0 @@
1
- import type { AnsiColors } from "@visulima/colorize";
2
- import type { LiteralUnion } from "type-fest";
3
- /**
4
- * A single 2D data point.
5
- */
6
- export type Point = {
7
- readonly x: number;
8
- readonly y: number;
9
- };
10
- /**
11
- * Minimal shape every "series-like" chart entry conforms to. Used so chart
12
- * components share utilities without coupling to a specific Props type.
13
- */
14
- export type SeriesLike = {
15
- readonly color?: LiteralUnion<AnsiColors, string>;
16
- readonly data: ReadonlyArray<number> | ReadonlyArray<Point>;
17
- readonly label?: string;
18
- };
19
- /**
20
- * Default palette cycled through when a series does not declare its own color.
21
- */
22
- export declare const DEFAULT_CHART_PALETTE: ReadonlyArray<LiteralUnion<AnsiColors, string>>;
23
- /**
24
- * Normalize the per-series `data` prop into a uniform `Point[]`. Numeric
25
- * arrays are treated as y-values with their index as x.
26
- * @param data Either a numeric array or an array of `{x, y}` points.
27
- * @returns A uniform `Point[]` — empty when no samples were provided.
28
- */
29
- export declare const toPoints: (data: SeriesLike["data"]) => ReadonlyArray<Point>;
30
- /**
31
- * Pick the effective color for a series: per-series override, else palette
32
- * cycling by index, with a safe `"cyan"` fallback.
33
- * @param series The series whose color we want.
34
- * @param index The series index for palette cycling.
35
- * @param palette Fallback palette.
36
- * @returns The resolved color string.
37
- */
38
- export declare const pickSeriesColor: (series: SeriesLike, index: number, palette: ReadonlyArray<LiteralUnion<AnsiColors, string>>) => LiteralUnion<AnsiColors, string>;
39
- export type Extents = {
40
- readonly xMax: number;
41
- readonly xMin: number;
42
- readonly yMax: number;
43
- readonly yMin: number;
44
- };
45
- /**
46
- * Single-pass min/max scan for an arbitrary collection of series. Returns
47
- * `Infinity` / `-Infinity` sentinels when no points are provided; callers
48
- * should replace these with their chosen defaults before rendering.
49
- * @param seriesList Iterable of series whose projected `points` need extents.
50
- * @returns The `{xMin, xMax, yMin, yMax}` tuple across all input points.
51
- */
52
- export declare const computeExtents: (seriesList: Iterable<{
53
- readonly points: ReadonlyArray<Point>;
54
- }>) => Extents;
@@ -1,39 +0,0 @@
1
- import type { AnsiColors } from "@visulima/colorize";
2
- import type { ReactElement, ReactNode } from "react";
3
- import type { LiteralUnion } from "type-fest";
4
- export type Props = {
5
- /**
6
- * Accent color when focused.
7
- * @default "blue"
8
- */
9
- readonly accentColor?: LiteralUnion<AnsiColors, string>;
10
- /**
11
- * Auto-focus when mounted if nothing else is focused.
12
- */
13
- readonly autoFocus?: boolean;
14
- /**
15
- * Label rendered next to the checkbox.
16
- */
17
- readonly children?: ReactNode;
18
- /**
19
- * Initial checked state when uncontrolled.
20
- * @default false
21
- */
22
- readonly defaultChecked?: boolean;
23
- /**
24
- * Controlled checked state. When provided, `onChange` should update the parent.
25
- */
26
- readonly isChecked?: boolean;
27
- /**
28
- * Disable input and dim the label.
29
- */
30
- readonly isDisabled?: boolean;
31
- /**
32
- * Fired when the checkbox toggles.
33
- */
34
- readonly onChange?: (checked: boolean) => void;
35
- };
36
- /**
37
- * Focusable checkbox. Toggles with Space or Enter.
38
- */
39
- export default function Checkbox({ accentColor, autoFocus, children, defaultChecked, isChecked, isDisabled, onChange, }: Props): ReactElement;
@@ -1,46 +0,0 @@
1
- /**
2
- * Syntax-highlighted code display component for Ink.
3
- *
4
- * Uses Shiki for tokenization and maps themed tokens to colored
5
- * Ink Text elements for terminal rendering.
6
- */
7
- import type { ReactElement } from "react";
8
- export type Props = {
9
- /**
10
- * The source code string to highlight.
11
- */
12
- readonly code: string;
13
- /**
14
- * Set of line numbers to visually emphasize.
15
- */
16
- readonly highlightLines?: ReadonlySet<number>;
17
- /**
18
- * Programming language for syntax highlighting.
19
- * Falls back to plain text if the language is unknown.
20
- */
21
- readonly language?: string;
22
- /**
23
- * Whether to show line numbers in the gutter.
24
- * @default false
25
- */
26
- readonly showLineNumbers?: boolean;
27
- /**
28
- * Starting line number (useful for code excerpts).
29
- * @default 1
30
- */
31
- readonly startLine?: number;
32
- /**
33
- * Shiki theme name.
34
- * @default "github-dark-default"
35
- */
36
- readonly theme?: string;
37
- };
38
- /**
39
- * Render source code with syntax highlighting.
40
- *
41
- * ```tsx
42
- * &lt;Code code="const x = 42;" language="typescript" />
43
- * &lt;Code code={source} language="python" showLineNumbers />
44
- * ```
45
- */
46
- export default function Code({ code, highlightLines, language, showLineNumbers, startLine, theme }: Props): ReactElement;
@@ -1,43 +0,0 @@
1
- import type { AnsiColors } from "@visulima/colorize";
2
- import type { ReactElement, ReactNode } from "react";
3
- import type { LiteralUnion } from "type-fest";
4
- export type Props = {
5
- /**
6
- * Accent color when the header is focused.
7
- * @default "blue"
8
- */
9
- readonly accentColor?: LiteralUnion<AnsiColors, string>;
10
- /**
11
- * Auto-focus the collapsible on mount.
12
- */
13
- readonly autoFocus?: boolean;
14
- /**
15
- * Child content rendered when open.
16
- */
17
- readonly children: ReactNode;
18
- /**
19
- * Whether the section starts expanded.
20
- * @default false
21
- */
22
- readonly defaultOpen?: boolean;
23
- /**
24
- * Disable interaction.
25
- */
26
- readonly isDisabled?: boolean;
27
- /**
28
- * Controlled open state.
29
- */
30
- readonly isOpen?: boolean;
31
- /**
32
- * Called when the user toggles the section.
33
- */
34
- readonly onToggle?: (isOpen: boolean) => void;
35
- /**
36
- * Header label.
37
- */
38
- readonly title: ReactNode;
39
- };
40
- /**
41
- * Focusable section that can be expanded or collapsed.
42
- */
43
- export default function Collapsible({ accentColor, autoFocus, children, defaultOpen, isDisabled, isOpen, onToggle, title, }: Props): ReactElement;
@@ -1,38 +0,0 @@
1
- import type { ReactElement, ReactNode } from "react";
2
- export type CommandStatus = "error" | "idle" | "running" | "success";
3
- export type Props = {
4
- /**
5
- * Shell command rendered in the header.
6
- */
7
- readonly command: string;
8
- /**
9
- * Optional working directory shown after the command name.
10
- */
11
- readonly cwd?: string;
12
- /**
13
- * Duration in ms; shown when finished.
14
- */
15
- readonly durationMs?: number;
16
- /**
17
- * Exit code of the completed command.
18
- */
19
- readonly exitCode?: number;
20
- /**
21
- * Max output rows rendered before truncation. Use `Infinity` to disable.
22
- */
23
- readonly maxOutputRows?: number;
24
- /**
25
- * Command output. Either a string (rendered as-is) or arbitrary children.
26
- */
27
- readonly output?: ReactNode;
28
- /**
29
- * Lifecycle state. Controls the header icon and color.
30
- * @default "idle"
31
- */
32
- readonly status?: CommandStatus;
33
- };
34
- /**
35
- * Renders a shell command with its output and a status header. Designed for
36
- * coding-agent UIs that stream terminal operations.
37
- */
38
- export default function CommandBlock({ command, cwd, durationMs, exitCode, maxOutputRows, output, status }: Props): ReactElement;
@@ -1,72 +0,0 @@
1
- import type { AnsiColors } from "@visulima/colorize";
2
- import type { ReactElement, ReactNode } from "react";
3
- import type { LiteralUnion } from "type-fest";
4
- export type CommandEntry = {
5
- /**
6
- * Optional description rendered under the label.
7
- */
8
- readonly description?: string;
9
- /**
10
- * Optional hotkey rendered on the right.
11
- */
12
- readonly hotkey?: string;
13
- /**
14
- * Optional icon rendered before the label.
15
- */
16
- readonly icon?: ReactNode;
17
- /**
18
- * Stable identifier returned by `onSelect`.
19
- */
20
- readonly id: string;
21
- /**
22
- * Optional keywords to boost matching (not displayed).
23
- */
24
- readonly keywords?: ReadonlyArray<string>;
25
- /**
26
- * Label shown in the list (and used as the primary match target).
27
- */
28
- readonly label: string;
29
- };
30
- export type Props = {
31
- /**
32
- * Accent color for the border and focused row.
33
- * @default "cyan"
34
- */
35
- readonly accentColor?: LiteralUnion<AnsiColors, string>;
36
- /**
37
- * Auto-focus the palette on mount.
38
- */
39
- readonly autoFocus?: boolean;
40
- /**
41
- * Available commands to search.
42
- */
43
- readonly commands: ReadonlyArray<CommandEntry>;
44
- /**
45
- * Empty-state text when nothing matches.
46
- * @default "No results"
47
- */
48
- readonly emptyText?: string;
49
- /**
50
- * Max rows rendered in the list.
51
- * @default 8
52
- */
53
- readonly limit?: number;
54
- /**
55
- * Called when the user presses Escape.
56
- */
57
- readonly onCancel?: () => void;
58
- /**
59
- * Called when the user picks a command with Enter.
60
- */
61
- readonly onSelect: (id: string, query: string) => void;
62
- /**
63
- * Placeholder inside the search field.
64
- * @default "Type a command or search..."
65
- */
66
- readonly placeholder?: string;
67
- };
68
- /**
69
- * Ctrl-P style fuzzy command finder. Features a search input, ranked results,
70
- * keyboard navigation, and Esc to cancel.
71
- */
72
- export default function CommandPalette({ accentColor, autoFocus, commands, emptyText, limit, onCancel, onSelect, placeholder, }: Props): ReactElement;
@@ -1,63 +0,0 @@
1
- import type { ReactElement, ReactNode } from "react";
2
- export type ConfirmTone = "danger" | "info" | "warning";
3
- export type Props = {
4
- /**
5
- * Auto-focus the dialog on mount. Set `false` if a parent already owns
6
- * focus and routes input here.
7
- * @default true
8
- */
9
- readonly autoFocus?: boolean;
10
- /**
11
- * Label for the cancel button.
12
- * @default "Cancel"
13
- */
14
- readonly cancelLabel?: string;
15
- /**
16
- * Body content (rendered between title and buttons).
17
- */
18
- readonly children?: ReactNode;
19
- /**
20
- * Label for the confirm button.
21
- * @default "Confirm"
22
- */
23
- readonly confirmLabel?: string;
24
- /**
25
- * Default button when opening the dialog.
26
- * @default "confirm"
27
- */
28
- readonly defaultFocus?: "cancel" | "confirm";
29
- /**
30
- * Disable input.
31
- */
32
- readonly isDisabled?: boolean;
33
- /**
34
- * Fired when the user declines.
35
- */
36
- readonly onCancel: () => void;
37
- /**
38
- * Fired when the user confirms.
39
- */
40
- readonly onConfirm: () => void;
41
- /**
42
- * Heading rendered at the top of the dialog.
43
- */
44
- readonly title?: string;
45
- /**
46
- * Controls the border color.
47
- * @default "info"
48
- */
49
- readonly tone?: ConfirmTone;
50
- /**
51
- * Dialog width.
52
- */
53
- readonly width?: number;
54
- };
55
- /**
56
- * Full-width modal-style confirm/cancel prompt. Unlike `ConfirmInput`, this
57
- * renders a visible two-button UI: ← / → to toggle focus, Enter to activate,
58
- * y/n as shortcuts, Esc to cancel.
59
- * @param props See {@link Props}.
60
- * @returns A bordered `ReactElement` with optional title, body, and two
61
- * buttons (cancel / confirm).
62
- */
63
- export default function ConfirmDialog({ autoFocus, cancelLabel, children, confirmLabel, defaultFocus, isDisabled, onCancel, onConfirm, title, tone, width, }: Props): ReactElement;