@visulima/tui-kit 1.0.0 → 1.0.2

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 (123) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/accordion.d.ts +25 -32
  3. package/dist/alert.d.ts +9 -13
  4. package/dist/animate-presence.d.ts +9 -11
  5. package/dist/approval-prompt.d.ts +28 -38
  6. package/dist/area-chart.d.ts +29 -39
  7. package/dist/badge.d.ts +8 -11
  8. package/dist/bar-chart.d.ts +29 -38
  9. package/dist/big-text.d.ts +42 -52
  10. package/dist/blink-dot.d.ts +16 -21
  11. package/dist/breadcrumb.d.ts +11 -15
  12. package/dist/button.d.ts +18 -25
  13. package/dist/calendar.d.ts +31 -43
  14. package/dist/card.d.ts +22 -32
  15. package/dist/checkbox-group.d.ts +21 -30
  16. package/dist/checkbox.d.ts +19 -27
  17. package/dist/code.d.ts +24 -31
  18. package/dist/collapsible.d.ts +21 -30
  19. package/dist/color-picker.d.ts +29 -41
  20. package/dist/command-block.d.ts +19 -27
  21. package/dist/command-palette.d.ts +36 -45
  22. package/dist/confirm-dialog.d.ts +35 -47
  23. package/dist/confirm-input.d.ts +17 -23
  24. package/dist/console-overlay.d.ts +28 -35
  25. package/dist/content-switcher.d.ts +22 -30
  26. package/dist/controlled-scroll-view.d.ts +1 -1
  27. package/dist/data-grid.d.ts +18 -24
  28. package/dist/date-picker.d.ts +27 -38
  29. package/dist/definition-list.d.ts +16 -22
  30. package/dist/dialog.d.ts +58 -74
  31. package/dist/diff-view.d.ts +41 -54
  32. package/dist/digits.d.ts +13 -17
  33. package/dist/directory-tree.d.ts +20 -27
  34. package/dist/divider.d.ts +20 -28
  35. package/dist/drawer.d.ts +24 -32
  36. package/dist/file-change.d.ts +18 -24
  37. package/dist/file-picker-entry.d.ts +1 -1
  38. package/dist/form.d.ts +34 -41
  39. package/dist/gauge.d.ts +40 -51
  40. package/dist/gradient.d.ts +21 -25
  41. package/dist/grid.d.ts +19 -25
  42. package/dist/heading.d.ts +12 -17
  43. package/dist/heatmap.d.ts +27 -37
  44. package/dist/help.d.ts +27 -34
  45. package/dist/histogram.d.ts +27 -37
  46. package/dist/image.d.ts +11 -14
  47. package/dist/index.d.ts +6 -6
  48. package/dist/json.d.ts +23 -30
  49. package/dist/kbd.d.ts +14 -18
  50. package/dist/line-chart.d.ts +40 -49
  51. package/dist/link.d.ts +24 -28
  52. package/dist/loading-indicator.d.ts +11 -15
  53. package/dist/log.d.ts +14 -19
  54. package/dist/markdown.d.ts +22 -27
  55. package/dist/masked-input.d.ts +23 -31
  56. package/dist/menu.d.ts +32 -40
  57. package/dist/message-bubble.d.ts +16 -23
  58. package/dist/model-badge.d.ts +16 -22
  59. package/dist/model-selector.d.ts +19 -26
  60. package/dist/multi-progress.d.ts +22 -29
  61. package/dist/multi-select.d.ts +25 -35
  62. package/dist/notification-badge.d.ts +21 -28
  63. package/dist/number-input.d.ts +38 -52
  64. package/dist/operation-tree.d.ts +22 -25
  65. package/dist/option-list.d.ts +17 -23
  66. package/dist/ordered-list.d.ts +9 -11
  67. package/dist/packem_shared/{controlled-scroll-view.d-vF4wevEJ.d.ts → controlled-scroll-view.d-D3kZZzjI.d.ts} +8 -19
  68. package/dist/packem_shared/file-picker.d-CH7pccC7.d.ts +92 -0
  69. package/dist/packem_shared/{scroll-bar-box.d-DSBbBsRc.d.ts → scroll-bar-box.d-CpTYEcTZ.d.ts} +1 -18
  70. package/dist/packem_shared/{scroll-list.d-BP0UZSY4.d.ts → scroll-list.d-CPCF0RwC.d.ts} +1 -1
  71. package/dist/packem_shared/scroll-view.d-GZcgAHl4.d.ts +98 -0
  72. package/dist/packem_shared/{use-tree-view.d-dXTKoDPM.d.ts → use-tree-view.d-DeMQ6G2r.d.ts} +115 -151
  73. package/dist/paginator.d.ts +28 -38
  74. package/dist/paragraph.d.ts +15 -21
  75. package/dist/path-input.d.ts +29 -40
  76. package/dist/pie-chart.d.ts +21 -27
  77. package/dist/placeholder.d.ts +26 -34
  78. package/dist/popover.d.ts +20 -27
  79. package/dist/progress-bar.d.ts +25 -33
  80. package/dist/progress-circle.d.ts +27 -36
  81. package/dist/qr-code.d.ts +21 -27
  82. package/dist/radio-group.d.ts +30 -41
  83. package/dist/scatter-plot.d.ts +5 -16
  84. package/dist/scroll-bar-box.d.ts +1 -1
  85. package/dist/scroll-list.d.ts +2 -2
  86. package/dist/scroll-view.d.ts +1 -1
  87. package/dist/search-input.d.ts +23 -32
  88. package/dist/select-input-indicator.d.ts +15 -19
  89. package/dist/select-input-item.d.ts +18 -24
  90. package/dist/select-input.d.ts +49 -62
  91. package/dist/shimmer-text.d.ts +24 -30
  92. package/dist/sidebar.d.ts +21 -28
  93. package/dist/slider.d.ts +50 -66
  94. package/dist/sparkline.d.ts +19 -25
  95. package/dist/spinner.d.ts +7 -9
  96. package/dist/status-line.d.ts +14 -20
  97. package/dist/status-message.d.ts +7 -10
  98. package/dist/stepper.d.ts +18 -24
  99. package/dist/stopwatch.d.ts +24 -31
  100. package/dist/streaming-text.d.ts +20 -27
  101. package/dist/switch.d.ts +23 -32
  102. package/dist/tab.d.ts +8 -10
  103. package/dist/table.d.ts +40 -41
  104. package/dist/tabs.d.ts +50 -61
  105. package/dist/tag-input.d.ts +30 -42
  106. package/dist/tag.d.ts +14 -19
  107. package/dist/text-input.d.ts +21 -29
  108. package/dist/textarea.d.ts +32 -43
  109. package/dist/thinking-block.d.ts +25 -34
  110. package/dist/time-picker.d.ts +27 -37
  111. package/dist/timer.d.ts +28 -37
  112. package/dist/toast.d.ts +20 -28
  113. package/dist/token-usage.d.ts +23 -30
  114. package/dist/tool-call.d.ts +14 -19
  115. package/dist/tooltip.d.ts +19 -25
  116. package/dist/transition.d.ts +40 -48
  117. package/dist/tree-select.d.ts +25 -35
  118. package/dist/tree-view-entry.d.ts +1 -1
  119. package/dist/unordered-list.d.ts +12 -15
  120. package/dist/use-linked-scroll.d.ts +27 -27
  121. package/package.json +6 -6
  122. package/dist/packem_shared/file-picker.d-Cie6aAMD.d.ts +0 -104
  123. package/dist/packem_shared/scroll-view.d-BqKpI-F-.d.ts +0 -119
package/dist/image.d.ts CHANGED
@@ -4,23 +4,20 @@ import { LiteralUnion } from 'type-fest';
4
4
  type Pixel = LiteralUnion<AnsiColors, string> | undefined;
5
5
  type Props = {
6
6
  /**
7
- * Character drawn for a transparent (undefined) pixel; defaults to a space.
8
- */
7
+ * Character drawn for a transparent (undefined) pixel; defaults to a space.
8
+ */
9
9
  readonly emptyChar?: string;
10
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
- */
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
15
  readonly pixels: ReadonlyArray<ReadonlyArray<Pixel>>;
16
16
  };
17
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;
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({ emptyChar, pixels }: Props): ReactElement;
26
23
  export { Image, type Props as ImageProps, Props, Image as default };
package/dist/index.d.ts CHANGED
@@ -32,7 +32,7 @@ export { type DirectoryNode, DirectoryTree, type DirectoryTreeProps } from "./di
32
32
  export { Divider, type DividerProps } from "./divider.js";
33
33
  export { Drawer, type DrawerProps } from "./drawer.js";
34
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";
35
+ export { type F as FileEntry, a as FilePicker, type b as FilePickerFilter, type P as FilePickerProps } from "./packem_shared/file-picker.d-CH7pccC7.js";
36
36
  export { Form, FormField, type FormFieldProps, type FormProps } from "./form.js";
37
37
  export { Gauge, type GaugeProps, type GaugeSize, type GaugeThreshold } from "./gauge.js";
38
38
  export { Gradient, type GradientColors, type GradientName, type GradientProps } from "./gradient.js";
@@ -72,11 +72,11 @@ export { ProgressCircle, type ProgressCircleProps } from "./progress-circle.js";
72
72
  export { QrCode, type Props as QrCodeProps } from "./qr-code.js";
73
73
  export { RadioGroup, type Props as RadioGroupProps, type RadioOption } from "./radio-group.js";
74
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";
75
+ export { C as ControlledScrollView, type a as ControlledScrollViewProps, type b as ControlledScrollViewRef } from "./packem_shared/controlled-scroll-view.d-D3kZZzjI.js";
76
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";
77
+ export { S as ScrollBarBox, type a as ScrollBarBoxProps } from "./packem_shared/scroll-bar-box.d-CpTYEcTZ.js";
78
+ export { type S as ScrollAlignment, a as ScrollList, type b as ScrollListProps, type c as ScrollListRef } from "./packem_shared/scroll-list.d-CPCF0RwC.js";
79
+ export { S as ScrollView, type a as ScrollViewProps, type b as ScrollViewRef } from "./packem_shared/scroll-view.d-GZcgAHl4.js";
80
80
  export { SearchInput, type Props as SearchInputProps } from "./search-input.js";
81
81
  export { SelectInput, type SelectInputEntry, type Item as SelectInputItemType, type Props as SelectInputProps, type SelectInputSeparator } from "./select-input.js";
82
82
  export { SelectInputIndicator, type Props as SelectInputIndicatorProps } from "./select-input-indicator.js";
@@ -108,7 +108,7 @@ export { ToolCall, type Props as ToolCallProps, type ToolCallStatus } from "./to
108
108
  export { Tooltip, type TooltipPlacement, type Props as TooltipProps } from "./tooltip.js";
109
109
  export { default as Transition, type TransitionPhase, type TransitionPreset, type Props as TransitionProps } from "./transition.js";
110
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";
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-DeMQ6G2r.js";
112
112
  export { UnorderedList, type UnorderedListEntry, type Props as UnorderedListProps } from "./unordered-list.js";
113
113
  import '@visulima/colorize';
114
114
  import 'react';
package/dist/json.d.ts CHANGED
@@ -12,47 +12,40 @@ type JsonTheme = {
12
12
  };
13
13
  type Props = {
14
14
  /**
15
- * Accent color for the focused row.
16
- * @default "blue"
17
- */
15
+ * Accent color for the focused row.
16
+ * @default "blue"
17
+ */
18
18
  readonly accentColor?: Color;
19
19
  /**
20
- * Auto-focus for keyboard navigation.
21
- */
20
+ * Auto-focus for keyboard navigation.
21
+ */
22
22
  readonly autoFocus?: boolean;
23
23
  /**
24
- * Depth at which nested containers start collapsed. `0` collapses
25
- * everything below the root; `Infinity` expands all.
26
- * @default Infinity
27
- */
24
+ * Depth at which nested containers start collapsed. `0` collapses
25
+ * everything below the root; `Infinity` expands all.
26
+ * @default Infinity
27
+ */
28
28
  readonly collapseDepth?: number;
29
29
  /**
30
- * The value to render.
31
- */
30
+ * The value to render.
31
+ */
32
32
  readonly data: unknown;
33
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
- */
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
39
  readonly interactive?: boolean;
40
40
  /**
41
- * Color theme for the different JSON token kinds.
42
- */
41
+ * Color theme for the different JSON token kinds.
42
+ */
43
43
  readonly theme?: Partial<JsonTheme>;
44
44
  };
45
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;
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({ accentColor, autoFocus, collapseDepth, data, interactive, theme }: Props): ReactElement;
58
51
  export { Json, type Props as JsonProps, JsonTheme, Props, Json as default };
package/dist/kbd.d.ts CHANGED
@@ -3,29 +3,25 @@ import { ReactNode, ReactElement } from 'react';
3
3
  import { LiteralUnion } from 'type-fest';
4
4
  type Props = {
5
5
  /**
6
- * Key cap content.
7
- */
6
+ * Key cap content.
7
+ */
8
8
  readonly children: ReactNode;
9
9
  /**
10
- * Background color of the key cap.
11
- * @default "gray"
12
- */
10
+ * Background color of the key cap.
11
+ * @default "gray"
12
+ */
13
13
  readonly color?: LiteralUnion<AnsiColors, string>;
14
14
  /**
15
- * Visual style.
16
- * - `solid` (default): background filled
17
- * - `outline`: border only
18
- * - `bare`: no decoration, just dimmed text
19
- */
15
+ * Visual style.
16
+ * - `solid` (default): background filled
17
+ * - `outline`: border only
18
+ * - `bare`: no decoration, just dimmed text
19
+ */
20
20
  readonly variant?: "bare" | "outline" | "solid";
21
21
  };
22
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;
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({ children, color, variant }: Props): ReactElement;
31
27
  export { Kbd, type Props as KbdProps, Props, Kbd as default };
@@ -3,67 +3,67 @@ import { CanvasContext } from '@visulima/tui/canvas';
3
3
  import { ReactElement } from 'react';
4
4
  import { LiteralUnion } from 'type-fest';
5
5
  /**
6
- * A single 2D data point.
7
- */
6
+ * A single 2D data point.
7
+ */
8
8
  type Point = {
9
9
  readonly x: number;
10
10
  readonly y: number;
11
11
  };
12
12
  type LineSeries = {
13
13
  /**
14
- * Per-series color override. Falls back to the chart-level palette.
15
- */
14
+ * Per-series color override. Falls back to the chart-level palette.
15
+ */
16
16
  readonly color?: LiteralUnion<AnsiColors, string>;
17
17
  /**
18
- * Numeric samples to plot. Pass either a list of y-values (x is the
19
- * index) or {x, y} tuples.
20
- */
18
+ * Numeric samples to plot. Pass either a list of y-values (x is the
19
+ * index) or {x, y} tuples.
20
+ */
21
21
  readonly data: ReadonlyArray<number> | ReadonlyArray<{
22
22
  readonly x: number;
23
23
  readonly y: number;
24
24
  }>;
25
25
  /**
26
- * Optional label shown in the legend.
27
- */
26
+ * Optional label shown in the legend.
27
+ */
28
28
  readonly label?: string;
29
29
  };
30
30
  type LineChartProps = {
31
31
  /**
32
- * Color for axis ticks / labels.
33
- * @default "gray"
34
- */
32
+ * Color for axis ticks / labels.
33
+ * @default "gray"
34
+ */
35
35
  readonly axisColor?: LiteralUnion<AnsiColors, string>;
36
36
  /**
37
- * Chart body height in character rows.
38
- * @default 10
39
- */
37
+ * Chart body height in character rows.
38
+ * @default 10
39
+ */
40
40
  readonly height?: number;
41
41
  /**
42
- * Upper bound for the y-axis. When omitted the chart auto-scales.
43
- */
42
+ * Upper bound for the y-axis. When omitted the chart auto-scales.
43
+ */
44
44
  readonly maxY?: number;
45
45
  /**
46
- * Lower bound for the y-axis. When omitted the chart auto-scales.
47
- */
46
+ * Lower bound for the y-axis. When omitted the chart auto-scales.
47
+ */
48
48
  readonly minY?: number;
49
49
  /**
50
- * Fallback palette cycled through when a series does not set `color`.
51
- * @default ["cyan", "magenta", "yellow", "green", "blue", "red"]
52
- */
50
+ * Fallback palette cycled through when a series does not set `color`.
51
+ * @default ["cyan", "magenta", "yellow", "green", "blue", "red"]
52
+ */
53
53
  readonly palette?: ReadonlyArray<LiteralUnion<AnsiColors, string>>;
54
54
  /**
55
- * One or more line series.
56
- */
55
+ * One or more line series.
56
+ */
57
57
  readonly series: ReadonlyArray<LineSeries>;
58
58
  /**
59
- * Render the legend row under the plot.
60
- * @default true
61
- */
59
+ * Render the legend row under the plot.
60
+ * @default true
61
+ */
62
62
  readonly showLegend?: boolean;
63
63
  /**
64
- * Chart body width in character columns.
65
- * @default 40
66
- */
64
+ * Chart body width in character columns.
65
+ * @default 40
66
+ */
67
67
  readonly width?: number;
68
68
  };
69
69
  type RenderConfig = {
@@ -80,30 +80,21 @@ type RenderConfig = {
80
80
  readonly yMin: number;
81
81
  };
82
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
- */
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
86
  declare const projectPoint: (point: Point, config: Pick<RenderConfig, "xMax" | "xMin" | "yMax" | "yMin">, pixelWidth: number, pixelHeight: number) => {
87
87
  px: number;
88
88
  py: number;
89
89
  };
90
90
  /**
91
- * Shared drawing path used by LineChart and ScatterPlot. AreaChart wraps
92
- * this with a fill pass.
93
- */
91
+ * Shared drawing path used by LineChart and ScatterPlot. AreaChart wraps
92
+ * this with a fill pass.
93
+ */
94
94
  declare const drawSeriesOnCanvas: (context: CanvasContext, mode: "line" | "scatter", config: RenderConfig) => void;
95
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;
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({ axisColor, height, maxY, minY, palette, series, showLegend, width }: LineChartProps): ReactElement;
109
100
  export { LineChart, LineChartProps, type RenderConfig as LineChartRenderConfig, LineSeries, LineChart as default, drawSeriesOnCanvas, projectPoint };
package/dist/link.d.ts CHANGED
@@ -2,37 +2,33 @@ import { ReactNode, ReactElement } from 'react';
2
2
  type Props = {
3
3
  readonly children: ReactNode;
4
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
- */
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
12
  readonly fallback?: ((text: string, url: string) => string) | boolean;
13
13
  /**
14
- * The URL to link to.
15
- */
14
+ * The URL to link to.
15
+ */
16
16
  readonly url: string;
17
17
  };
18
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;
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({ children, fallback, url }: Props): ReactElement;
38
34
  export { Link, type Props as LinkProps, type Props, Link as default };
@@ -4,26 +4,22 @@ import { ReactNode, ReactElement } from 'react';
4
4
  import { LiteralUnion } from 'type-fest';
5
5
  type Props = {
6
6
  /**
7
- * Optional message rendered after the spinner.
8
- */
7
+ * Optional message rendered after the spinner.
8
+ */
9
9
  readonly children?: ReactNode;
10
10
  /**
11
- * Color used for the spinner and label.
12
- * @default "cyan"
13
- */
11
+ * Color used for the spinner and label.
12
+ * @default "cyan"
13
+ */
14
14
  readonly color?: LiteralUnion<AnsiColors, string>;
15
15
  /**
16
- * Spinner preset.
17
- * @default "dots"
18
- */
16
+ * Spinner preset.
17
+ * @default "dots"
18
+ */
19
19
  readonly type?: SpinnerName;
20
20
  };
21
21
  /**
22
- * Compact spinner + label for loading states.
23
- */
24
- declare function LoadingIndicator({
25
- children,
26
- color,
27
- type
28
- }: Props): ReactElement;
22
+ * Compact spinner + label for loading states.
23
+ */
24
+ declare function LoadingIndicator({ children, color, type }: Props): ReactElement;
29
25
  export { LoadingIndicator, type Props as LoadingIndicatorProps, Props, LoadingIndicator as default };
package/dist/log.d.ts CHANGED
@@ -7,32 +7,27 @@ type LogEntry = {
7
7
  };
8
8
  type Props = {
9
9
  /**
10
- * The log entries, oldest first.
11
- */
10
+ * The log entries, oldest first.
11
+ */
12
12
  readonly entries: ReadonlyArray<LogEntry>;
13
13
  /**
14
- * Keep only the last N entries (tail). Omit to render all.
15
- */
14
+ * Keep only the last N entries (tail). Omit to render all.
15
+ */
16
16
  readonly maxLines?: number;
17
17
  /**
18
- * Render the `[LEVEL]` badge before each message.
19
- * @default true
20
- */
18
+ * Render the `[LEVEL]` badge before each message.
19
+ * @default true
20
+ */
21
21
  readonly showLevel?: boolean;
22
22
  /**
23
- * Render each entry's timestamp, when present.
24
- * @default true
25
- */
23
+ * Render each entry's timestamp, when present.
24
+ * @default true
25
+ */
26
26
  readonly showTimestamp?: boolean;
27
27
  };
28
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;
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({ entries, maxLines, showLevel, showTimestamp }: Props): ReactElement;
38
33
  export { Log, LogEntry, LogLevel, type Props as LogProps, Props, Log as default };
@@ -1,40 +1,35 @@
1
1
  import { ReactElement } from 'react';
2
2
  type Props = {
3
3
  /**
4
- * The Markdown source string.
5
- */
4
+ * The Markdown source string.
5
+ */
6
6
  readonly children: string;
7
7
  /**
8
- * Shiki theme for code block syntax highlighting.
9
- * @default "github-dark-default"
10
- */
8
+ * Shiki theme for code block syntax highlighting.
9
+ * @default "github-dark-default"
10
+ */
11
11
  readonly codeTheme?: string;
12
12
  /**
13
- * Maximum width for text wrapping. Defaults to terminal width.
14
- */
13
+ * Maximum width for text wrapping. Defaults to terminal width.
14
+ */
15
15
  readonly maxWidth?: number;
16
16
  /**
17
- * Enable streaming mode for progressive rendering.
18
- * When true, the component re-renders on every prop change and handles
19
- * incomplete Markdown gracefully (e.g., unclosed code fences, partial lists).
20
- * Useful for rendering AI-generated text arriving token-by-token.
21
- * @default false
22
- */
17
+ * Enable streaming mode for progressive rendering.
18
+ * When true, the component re-renders on every prop change and handles
19
+ * incomplete Markdown gracefully (e.g., unclosed code fences, partial lists).
20
+ * Useful for rendering AI-generated text arriving token-by-token.
21
+ * @default false
22
+ */
23
23
  readonly streaming?: boolean;
24
24
  };
25
25
  /**
26
- * Render Markdown content as Ink terminal UI elements.
27
- *
28
- * ```tsx
29
- * &lt;Markdown>{"# Hello\n\nThis is **bold** and *italic*."}&lt;/Markdown>
30
- * &lt;Markdown codeTheme="github-dark-default">{"```js\nconst x = 1;\n```"}&lt;/Markdown>
31
- * &lt;Markdown streaming>{"# Streaming\n\nText arriving..."}&lt;/Markdown>
32
- * ```
33
- */
34
- declare function Markdown({
35
- children,
36
- codeTheme,
37
- maxWidth: maxWidthProp,
38
- streaming
39
- }: Props): ReactElement;
26
+ * Render Markdown content as Ink terminal UI elements.
27
+ *
28
+ * ```tsx
29
+ * &lt;Markdown>{"# Hello\n\nThis is **bold** and *italic*."}&lt;/Markdown>
30
+ * &lt;Markdown codeTheme="github-dark-default">{"```js\nconst x = 1;\n```"}&lt;/Markdown>
31
+ * &lt;Markdown streaming>{"# Streaming\n\nText arriving..."}&lt;/Markdown>
32
+ * ```
33
+ */
34
+ declare function Markdown({ children, codeTheme, maxWidth: maxWidthProp, streaming }: Props): ReactElement;
40
35
  export { Markdown, type Props as MarkdownProps, Props, Markdown as default };
@@ -1,50 +1,42 @@
1
1
  import { ReactElement } from 'react';
2
2
  type Props = {
3
3
  /**
4
- * Initial raw value (digits/characters only, without mask symbols).
5
- */
4
+ * Initial raw value (digits/characters only, without mask symbols).
5
+ */
6
6
  readonly defaultValue?: string;
7
7
  /**
8
- * Disable input and dim the display.
9
- */
8
+ * Disable input and dim the display.
9
+ */
10
10
  readonly isDisabled?: boolean;
11
11
  /**
12
- * Mask definition. Each `#` is replaced with a user character; any other
13
- * character is rendered literally. Example: `(###) ###-####`.
14
- */
12
+ * Mask definition. Each `#` is replaced with a user character; any other
13
+ * character is rendered literally. Example: `(###) ###-####`.
14
+ */
15
15
  readonly mask: string;
16
16
  /**
17
- * Called whenever the underlying raw value changes.
18
- */
17
+ * Called whenever the underlying raw value changes.
18
+ */
19
19
  readonly onChange?: (value: string) => void;
20
20
  /**
21
- * Called when the user presses Enter with the current raw value.
22
- */
21
+ * Called when the user presses Enter with the current raw value.
22
+ */
23
23
  readonly onSubmit?: (value: string) => void;
24
24
  /**
25
- * Placeholder character used in the mask for empty positions.
26
- * @default "_"
27
- */
25
+ * Placeholder character used in the mask for empty positions.
26
+ * @default "_"
27
+ */
28
28
  readonly placeholderChar?: string;
29
29
  /**
30
- * Sentinel character in the mask string used to mark editable positions.
31
- * @default "#" (hash)
32
- */
30
+ * Sentinel character in the mask string used to mark editable positions.
31
+ * @default "#" (hash)
32
+ */
33
33
  readonly token?: string;
34
34
  };
35
35
  /**
36
- * Input with a fixed-width mask. The mask token (`#` by default) marks
37
- * positions where the user can type; every other character is preserved.
38
- * Supports ←/→ to move within the mask, Home/End to jump, and
39
- * Backspace/Delete to clear characters.
40
- */
41
- declare function MaskedInput({
42
- defaultValue,
43
- isDisabled,
44
- mask,
45
- onChange,
46
- onSubmit,
47
- placeholderChar,
48
- token
49
- }: Props): ReactElement;
36
+ * Input with a fixed-width mask. The mask token (`#` by default) marks
37
+ * positions where the user can type; every other character is preserved.
38
+ * Supports ←/→ to move within the mask, Home/End to jump, and
39
+ * Backspace/Delete to clear characters.
40
+ */
41
+ declare function MaskedInput({ defaultValue, isDisabled, mask, onChange, onSubmit, placeholderChar, token }: Props): ReactElement;
50
42
  export { MaskedInput, type Props as MaskedInputProps, Props, MaskedInput as default };