@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.
- package/CHANGELOG.md +33 -0
- package/LICENSE.md +140 -0
- package/dist/core/index.d.ts +58 -5
- package/dist/ink/index.d.ts +6592 -294
- package/dist/ink/index.js +1 -1
- package/dist/packem_shared/{Histogram-cgAjY5AJ.js → Histogram-CB6XcmZW.js} +1 -1
- package/dist/packem_shared/input.d-Bfq7oc06.d.ts +90 -0
- package/dist/packem_shared/render.d-BR3gA-N8.d.ts +1257 -0
- package/dist/react/index.d.ts +519 -8
- package/dist/testing/index.d.ts +274 -135
- package/package.json +16 -17
- package/dist/core/app.d.ts +0 -50
- package/dist/core/cell.d.ts +0 -33
- package/dist/core/inline.d.ts +0 -22
- package/dist/core/input.d.ts +0 -18
- package/dist/core/native-binding.d.ts +0 -22
- package/dist/ink/ansi-to-cell.d.ts +0 -5
- package/dist/ink/ansi-tokenizer.d.ts +0 -38
- package/dist/ink/canvas/braille.d.ts +0 -22
- package/dist/ink/canvas/buffer.d.ts +0 -67
- package/dist/ink/clipboard.d.ts +0 -29
- package/dist/ink/color-matrix.d.ts +0 -49
- package/dist/ink/color-utils.d.ts +0 -30
- package/dist/ink/colorize.d.ts +0 -4
- package/dist/ink/components/accessibility-context.d.ts +0 -4
- package/dist/ink/components/accordion.d.ts +0 -52
- package/dist/ink/components/alert.d.ts +0 -30
- package/dist/ink/components/animate-presence.d.ts +0 -15
- package/dist/ink/components/animation-context.d.ts +0 -10
- package/dist/ink/components/app-context.d.ts +0 -38
- package/dist/ink/components/app.d.ts +0 -19
- package/dist/ink/components/approval-prompt.d.ts +0 -55
- package/dist/ink/components/area-chart.d.ts +0 -54
- package/dist/ink/components/background-context.d.ts +0 -5
- package/dist/ink/components/badge.d.ts +0 -27
- package/dist/ink/components/bar-chart.d.ts +0 -57
- package/dist/ink/components/big-text.d.ts +0 -71
- package/dist/ink/components/blink-dot.d.ts +0 -30
- package/dist/ink/components/box.d.ts +0 -58
- package/dist/ink/components/breadcrumb.d.ts +0 -28
- package/dist/ink/components/button.d.ts +0 -38
- package/dist/ink/components/calendar.d.ts +0 -60
- package/dist/ink/components/canvas.d.ts +0 -38
- package/dist/ink/components/card.d.ts +0 -46
- package/dist/ink/components/chart-utils.d.ts +0 -54
- package/dist/ink/components/checkbox.d.ts +0 -39
- package/dist/ink/components/code.d.ts +0 -46
- package/dist/ink/components/collapsible.d.ts +0 -43
- package/dist/ink/components/command-block.d.ts +0 -38
- package/dist/ink/components/command-palette.d.ts +0 -72
- package/dist/ink/components/confirm-dialog.d.ts +0 -63
- package/dist/ink/components/confirm-input.d.ts +0 -40
- package/dist/ink/components/console-overlay.d.ts +0 -52
- package/dist/ink/components/content-switcher.d.ts +0 -49
- package/dist/ink/components/cursor-context.d.ts +0 -12
- package/dist/ink/components/cursor.d.ts +0 -43
- package/dist/ink/components/date-picker.d.ts +0 -53
- package/dist/ink/components/definition-list.d.ts +0 -37
- package/dist/ink/components/dialog.d.ts +0 -93
- package/dist/ink/components/diff-view.d.ts +0 -71
- package/dist/ink/components/divider.d.ts +0 -40
- package/dist/ink/components/error-boundary.d.ts +0 -17
- package/dist/ink/components/error-overview.d.ts +0 -6
- package/dist/ink/components/file-picker/file-picker.d.ts +0 -58
- package/dist/ink/components/file-picker/types.d.ts +0 -35
- package/dist/ink/components/file-picker/use-file-system.d.ts +0 -16
- package/dist/ink/components/focus-context.d.ts +0 -17
- package/dist/ink/components/form.d.ts +0 -74
- package/dist/ink/components/gauge.d.ts +0 -75
- package/dist/ink/components/gradient.d.ts +0 -38
- package/dist/ink/components/heading.d.ts +0 -27
- package/dist/ink/components/heatmap.d.ts +0 -51
- package/dist/ink/components/help.d.ts +0 -44
- package/dist/ink/components/histogram.d.ts +0 -52
- package/dist/ink/components/kbd.d.ts +0 -27
- package/dist/ink/components/line-chart.d.ts +0 -94
- package/dist/ink/components/link.d.ts +0 -34
- package/dist/ink/components/loading-indicator.d.ts +0 -24
- package/dist/ink/components/markdown.d.ts +0 -34
- package/dist/ink/components/masked-input.d.ts +0 -41
- package/dist/ink/components/menu.d.ts +0 -70
- package/dist/ink/components/message-bubble.d.ts +0 -35
- package/dist/ink/components/model-badge.d.ts +0 -32
- package/dist/ink/components/multi-select.d.ts +0 -63
- package/dist/ink/components/newline.d.ts +0 -12
- package/dist/ink/components/operation-tree.d.ts +0 -46
- package/dist/ink/components/option-list.d.ts +0 -41
- package/dist/ink/components/ordered-list.d.ts +0 -30
- package/dist/ink/components/paginator.d.ts +0 -59
- package/dist/ink/components/paragraph.d.ts +0 -31
- package/dist/ink/components/placeholder.d.ts +0 -47
- package/dist/ink/components/progress-bar.d.ts +0 -51
- package/dist/ink/components/radio-group.d.ts +0 -62
- package/dist/ink/components/scatter-plot.d.ts +0 -23
- package/dist/ink/components/scroll/controlled-scroll-view.d.ts +0 -43
- package/dist/ink/components/scroll/index.d.ts +0 -10
- package/dist/ink/components/scroll/scroll-bar-box.d.ts +0 -15
- package/dist/ink/components/scroll/scroll-bar.d.ts +0 -20
- package/dist/ink/components/scroll/scroll-list.d.ts +0 -12
- package/dist/ink/components/scroll/scroll-view.d.ts +0 -98
- package/dist/ink/components/scroll/use-state-ref.d.ts +0 -8
- package/dist/ink/components/search-input.d.ts +0 -46
- package/dist/ink/components/select-input-indicator.d.ts +0 -36
- package/dist/ink/components/select-input-item.d.ts +0 -43
- package/dist/ink/components/select-input.d.ts +0 -96
- package/dist/ink/components/shimmer-text.d.ts +0 -39
- package/dist/ink/components/slider.d.ts +0 -92
- package/dist/ink/components/spacer.d.ts +0 -7
- package/dist/ink/components/sparkline.d.ts +0 -30
- package/dist/ink/components/spinner.d.ts +0 -40
- package/dist/ink/components/static-render.d.ts +0 -40
- package/dist/ink/components/static.d.ts +0 -24
- package/dist/ink/components/status-line.d.ts +0 -30
- package/dist/ink/components/status-message.d.ts +0 -26
- package/dist/ink/components/stderr-context.d.ts +0 -16
- package/dist/ink/components/stdin-context.d.ts +0 -29
- package/dist/ink/components/stdout-context.d.ts +0 -16
- package/dist/ink/components/stepper.d.ts +0 -42
- package/dist/ink/components/stopwatch.d.ts +0 -42
- package/dist/ink/components/streaming-text.d.ts +0 -38
- package/dist/ink/components/switch.d.ts +0 -46
- package/dist/ink/components/tab.d.ts +0 -25
- package/dist/ink/components/table.d.ts +0 -80
- package/dist/ink/components/tabs.d.ts +0 -104
- package/dist/ink/components/tag.d.ts +0 -30
- package/dist/ink/components/text-input.d.ts +0 -48
- package/dist/ink/components/text.d.ts +0 -63
- package/dist/ink/components/textarea.d.ts +0 -62
- package/dist/ink/components/timer.d.ts +0 -50
- package/dist/ink/components/toast.d.ts +0 -41
- package/dist/ink/components/tooltip.d.ts +0 -36
- package/dist/ink/components/transform.d.ts +0 -16
- package/dist/ink/components/transition.d.ts +0 -53
- package/dist/ink/components/tree-view/theme.d.ts +0 -24
- package/dist/ink/components/tree-view/tree-node-map.d.ts +0 -72
- package/dist/ink/components/tree-view/tree-view-node.d.ts +0 -29
- package/dist/ink/components/tree-view/tree-view.d.ts +0 -89
- package/dist/ink/components/tree-view/types.d.ts +0 -55
- package/dist/ink/components/tree-view/use-tree-view-state.d.ts +0 -135
- package/dist/ink/components/tree-view/use-tree-view.d.ts +0 -26
- package/dist/ink/components/unordered-list.d.ts +0 -35
- package/dist/ink/components/variant-config.d.ts +0 -10
- package/dist/ink/cursor-helpers.d.ts +0 -35
- package/dist/ink/data-limited-lru-map.d.ts +0 -21
- package/dist/ink/devtools-window-polyfill.d.ts +0 -1
- package/dist/ink/devtools.d.ts +0 -1
- package/dist/ink/dom.d.ts +0 -214
- package/dist/ink/get-max-width.d.ts +0 -3
- package/dist/ink/highlighter.d.ts +0 -28
- package/dist/ink/hooks/use-animation.d.ts +0 -41
- package/dist/ink/hooks/use-app.d.ts +0 -6
- package/dist/ink/hooks/use-box-metrics.d.ts +0 -58
- package/dist/ink/hooks/use-clipboard.d.ts +0 -29
- package/dist/ink/hooks/use-color-blindness.d.ts +0 -33
- package/dist/ink/hooks/use-console-capture.d.ts +0 -43
- package/dist/ink/hooks/use-cursor.d.ts +0 -12
- package/dist/ink/hooks/use-focus-manager.d.ts +0 -42
- package/dist/ink/hooks/use-focus.d.ts +0 -30
- package/dist/ink/hooks/use-form.d.ts +0 -70
- package/dist/ink/hooks/use-hotkey.d.ts +0 -37
- package/dist/ink/hooks/use-input.d.ts +0 -149
- package/dist/ink/hooks/use-interval.d.ts +0 -25
- package/dist/ink/hooks/use-is-screen-reader-enabled.d.ts +0 -6
- package/dist/ink/hooks/use-key-bindings.d.ts +0 -59
- package/dist/ink/hooks/use-key-chord.d.ts +0 -26
- package/dist/ink/hooks/use-linked-scroll.d.ts +0 -41
- package/dist/ink/hooks/use-paste.d.ts +0 -44
- package/dist/ink/hooks/use-persistent-state.d.ts +0 -56
- package/dist/ink/hooks/use-scroll-acceleration.d.ts +0 -47
- package/dist/ink/hooks/use-scroll-input.d.ts +0 -34
- package/dist/ink/hooks/use-stderr.d.ts +0 -6
- package/dist/ink/hooks/use-stdin.d.ts +0 -7
- package/dist/ink/hooks/use-stdout.d.ts +0 -6
- package/dist/ink/hooks/use-stopwatch.d.ts +0 -38
- package/dist/ink/hooks/use-terminal-palette.d.ts +0 -19
- package/dist/ink/hooks/use-text-buffer.d.ts +0 -42
- package/dist/ink/hooks/use-text-selection.d.ts +0 -45
- package/dist/ink/hooks/use-timeout.d.ts +0 -24
- package/dist/ink/hooks/use-timer.d.ts +0 -47
- package/dist/ink/hooks/use-window-size.d.ts +0 -18
- package/dist/ink/ime-utils.d.ts +0 -25
- package/dist/ink/ink.d.ts +0 -190
- package/dist/ink/input-parser.d.ts +0 -10
- package/dist/ink/input-utils.d.ts +0 -16
- package/dist/ink/instances.d.ts +0 -3
- package/dist/ink/kitty-keyboard.d.ts +0 -23
- package/dist/ink/layout.d.ts +0 -26
- package/dist/ink/log-update-native.d.ts +0 -14
- package/dist/ink/log-update.d.ts +0 -21
- package/dist/ink/measure-element.d.ts +0 -147
- package/dist/ink/measure-text.d.ts +0 -56
- package/dist/ink/mouse/ansi-parser.d.ts +0 -37
- package/dist/ink/mouse/constants.d.ts +0 -14
- package/dist/ink/mouse/fullscreen.d.ts +0 -8
- package/dist/ink/mouse/index.d.ts +0 -20
- package/dist/ink/mouse/is-intersecting.d.ts +0 -18
- package/dist/ink/mouse/mouse-context.d.ts +0 -36
- package/dist/ink/mouse/mouse-provider.d.ts +0 -11
- package/dist/ink/mouse/use-element-position.d.ts +0 -29
- package/dist/ink/mouse/use-mouse-action.d.ts +0 -7
- package/dist/ink/mouse/use-mouse-position.d.ts +0 -7
- package/dist/ink/mouse/use-mouse.d.ts +0 -7
- package/dist/ink/mouse/use-on-mouse-click.d.ts +0 -14
- package/dist/ink/mouse/use-on-mouse-hover.d.ts +0 -8
- package/dist/ink/mouse/use-on-mouse-state.d.ts +0 -11
- package/dist/ink/output.d.ts +0 -75
- package/dist/ink/parse-keypress.d.ts +0 -22
- package/dist/ink/reconciler.d.ts +0 -3
- package/dist/ink/region.d.ts +0 -99
- package/dist/ink/render-background.d.ts +0 -4
- package/dist/ink/render-border.d.ts +0 -4
- package/dist/ink/render-node-to-output.d.ts +0 -38
- package/dist/ink/render-scrollbar.d.ts +0 -9
- package/dist/ink/render-sticky.d.ts +0 -44
- package/dist/ink/render-to-string.d.ts +0 -37
- package/dist/ink/render.d.ts +0 -191
- package/dist/ink/renderer.d.ts +0 -17
- package/dist/ink/resize-observer.d.ts +0 -44
- package/dist/ink/sanitize-ansi.d.ts +0 -2
- package/dist/ink/scroll.d.ts +0 -23
- package/dist/ink/selection.d.ts +0 -70
- package/dist/ink/squash-text-nodes.d.ts +0 -18
- package/dist/ink/style-flags.d.ts +0 -17
- package/dist/ink/styled-line-factory.d.ts +0 -25
- package/dist/ink/styled-line-serializer.d.ts +0 -18
- package/dist/ink/styled-line.d.ts +0 -119
- package/dist/ink/styles.d.ts +0 -369
- package/dist/ink/terminal-palette.d.ts +0 -25
- package/dist/ink/text-wrap.d.ts +0 -10
- package/dist/ink/token-to-elements.d.ts +0 -22
- package/dist/ink/utils/format-time.d.ts +0 -4
- package/dist/ink/utils.d.ts +0 -9
- package/dist/ink/wrap-text.d.ts +0 -3
- package/dist/ink/write-synchronized.d.ts +0 -4
- package/dist/react/devtools.d.ts +0 -27
- package/dist/react/focus.d.ts +0 -39
- package/dist/react/hooks.d.ts +0 -238
- package/dist/react/layout.d.ts +0 -33
- package/dist/react/react.d.ts +0 -57
- package/dist/react/reconciler.d.ts +0 -4
- package/dist/react/render-to-string.d.ts +0 -21
- package/dist/react/renderer.d.ts +0 -2
- package/dist/react/scene.d.ts +0 -3
- package/dist/react/static.d.ts +0 -39
- package/dist/react/styles.d.ts +0 -83
- package/dist/react/text-width.d.ts +0 -20
- package/dist/testing/keys.d.ts +0 -89
- package/dist/testing/screen.d.ts +0 -35
- package/dist/testing/wait-for.d.ts +0 -20
|
@@ -1,74 +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 FormFieldProps = {
|
|
5
|
-
/**
|
|
6
|
-
* The input element (TextInput, Checkbox, Select, …).
|
|
7
|
-
*/
|
|
8
|
-
readonly children: ReactNode;
|
|
9
|
-
/**
|
|
10
|
-
* Optional helper text rendered beneath the input.
|
|
11
|
-
*/
|
|
12
|
-
readonly description?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Validation error — dimmed red below the input.
|
|
15
|
-
*/
|
|
16
|
-
readonly error?: string;
|
|
17
|
-
/**
|
|
18
|
-
* When true, the field's label and description are dim.
|
|
19
|
-
*/
|
|
20
|
-
readonly isDisabled?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Label rendered above the input.
|
|
23
|
-
*/
|
|
24
|
-
readonly label: string;
|
|
25
|
-
/**
|
|
26
|
-
* Mark the field as required (adds a trailing `*`).
|
|
27
|
-
*/
|
|
28
|
-
readonly required?: boolean;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Standard form field wrapper: label + input + helper/error.
|
|
32
|
-
*/
|
|
33
|
-
export declare const FormField: ({ children, description, error, isDisabled, label, required }: FormFieldProps) => ReactElement;
|
|
34
|
-
export type Props = {
|
|
35
|
-
/**
|
|
36
|
-
* Accent color for the form chrome.
|
|
37
|
-
* @default "blue"
|
|
38
|
-
*/
|
|
39
|
-
readonly accentColor?: LiteralUnion<AnsiColors, string>;
|
|
40
|
-
/**
|
|
41
|
-
* Render a border around the form.
|
|
42
|
-
* @default true
|
|
43
|
-
*/
|
|
44
|
-
readonly bordered?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Fields composed via `<FormField />`.
|
|
47
|
-
*/
|
|
48
|
-
readonly children: ReactNode;
|
|
49
|
-
/**
|
|
50
|
-
* Optional description rendered under the title.
|
|
51
|
-
*/
|
|
52
|
-
readonly description?: string;
|
|
53
|
-
/**
|
|
54
|
-
* Optional footer rendered below the fields (buttons, hints, summary).
|
|
55
|
-
*/
|
|
56
|
-
readonly footer?: ReactNode;
|
|
57
|
-
/**
|
|
58
|
-
* Optional heading rendered at the top.
|
|
59
|
-
*/
|
|
60
|
-
readonly title?: string;
|
|
61
|
-
/**
|
|
62
|
-
* Fixed width.
|
|
63
|
-
*/
|
|
64
|
-
readonly width?: number;
|
|
65
|
-
};
|
|
66
|
-
type FormComponent = ((props: Props) => ReactElement) & {
|
|
67
|
-
Field: typeof FormField;
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* Stateless form layout. Pair with the `useForm` hook for state management
|
|
71
|
-
* and `FormField` for consistent label/error styling.
|
|
72
|
-
*/
|
|
73
|
-
declare const Form: FormComponent;
|
|
74
|
-
export default Form;
|
|
@@ -1,75 +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 GaugeThreshold = {
|
|
5
|
-
/**
|
|
6
|
-
* Color used for the arc segment and, when the current value falls into
|
|
7
|
-
* this segment, for the value readout.
|
|
8
|
-
*/
|
|
9
|
-
readonly color: LiteralUnion<AnsiColors, string>;
|
|
10
|
-
/**
|
|
11
|
-
* Optional label used by the legend under the gauge.
|
|
12
|
-
*/
|
|
13
|
-
readonly label?: string;
|
|
14
|
-
/**
|
|
15
|
-
* Upper bound of this threshold segment (inclusive). Segments are sorted
|
|
16
|
-
* ascending and painted in order.
|
|
17
|
-
*/
|
|
18
|
-
readonly max: number;
|
|
19
|
-
};
|
|
20
|
-
export type GaugeSize = "large" | "medium" | "small";
|
|
21
|
-
export type Props = {
|
|
22
|
-
/**
|
|
23
|
-
* Color of the arc background (the portion beyond `value`).
|
|
24
|
-
* @default "gray"
|
|
25
|
-
*/
|
|
26
|
-
readonly backgroundColor?: LiteralUnion<AnsiColors, string>;
|
|
27
|
-
/**
|
|
28
|
-
* Format for the numeric readout. Defaults to rounding to an integer.
|
|
29
|
-
*/
|
|
30
|
-
readonly formatValue?: (value: number) => string;
|
|
31
|
-
/**
|
|
32
|
-
* Optional label rendered above the readout.
|
|
33
|
-
*/
|
|
34
|
-
readonly label?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Upper bound of the range.
|
|
37
|
-
* @default 100
|
|
38
|
-
*/
|
|
39
|
-
readonly max?: number;
|
|
40
|
-
/**
|
|
41
|
-
* Lower bound of the range.
|
|
42
|
-
* @default 0
|
|
43
|
-
*/
|
|
44
|
-
readonly min?: number;
|
|
45
|
-
/**
|
|
46
|
-
* Show a legend listing thresholds below the gauge.
|
|
47
|
-
* @default false
|
|
48
|
-
*/
|
|
49
|
-
readonly showLegend?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Show a numeric readout in the middle of the gauge.
|
|
52
|
-
* @default true
|
|
53
|
-
*/
|
|
54
|
-
readonly showValue?: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Overall dimension preset.
|
|
57
|
-
* @default "medium"
|
|
58
|
-
*/
|
|
59
|
-
readonly size?: GaugeSize;
|
|
60
|
-
/**
|
|
61
|
-
* Color threshold ramp. When provided, segments of the arc are painted in
|
|
62
|
-
* the corresponding colors and the value readout picks up the color for
|
|
63
|
-
* the segment `value` lands in.
|
|
64
|
-
*/
|
|
65
|
-
readonly thresholds?: ReadonlyArray<GaugeThreshold>;
|
|
66
|
-
/**
|
|
67
|
-
* Current value. Clamped into the `[min, max]` range.
|
|
68
|
-
*/
|
|
69
|
-
readonly value: number;
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Semi-circular gauge rendered at 2x4 sub-cell resolution. Supports colored
|
|
73
|
-
* threshold segments and an optional needle.
|
|
74
|
-
*/
|
|
75
|
-
export default function Gauge({ backgroundColor, formatValue, label, max, min, showLegend, showValue, size, thresholds, value, }: Props): ReactElement;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { multilineGradient } from "@visulima/colorize/gradient";
|
|
2
|
-
import type { ReactElement, ReactNode } from "react";
|
|
3
|
-
/**
|
|
4
|
-
* A color stop for the gradient — hex string, CSS color name, RGB tuple, RGB object, or positioned stop.
|
|
5
|
-
*/
|
|
6
|
-
type GradientStop = Parameters<typeof multilineGradient>[0][number];
|
|
7
|
-
/**
|
|
8
|
-
* Built-in gradient presets.
|
|
9
|
-
*/
|
|
10
|
-
type GradientName = "atlas" | "cristal" | "fruit" | "instagram" | "mind" | "morning" | "pastel" | "passion" | "rainbow" | "retro" | "summer" | "teen" | "vice";
|
|
11
|
-
/**
|
|
12
|
-
* Custom gradient colors — an array of color stops accepted by `@visulima/colorize`'s gradient API.
|
|
13
|
-
*/
|
|
14
|
-
type GradientColors = GradientStop[];
|
|
15
|
-
export type Props = {
|
|
16
|
-
/**
|
|
17
|
-
* The content to colorize.
|
|
18
|
-
*
|
|
19
|
-
* Multiple `<Text>` children are treated as separate nodes, which preserves layout when `<Gradient>` is placed inside a `<Box flexDirection="column">`.
|
|
20
|
-
*
|
|
21
|
-
* If you want a continuous gradient across multiple lines, pass a single string or a single `<Text>` with `\n`.
|
|
22
|
-
*/
|
|
23
|
-
readonly children: ReactNode;
|
|
24
|
-
/**
|
|
25
|
-
* [Colors to use to make the gradient.](https://visulima.com/packages/colorize)
|
|
26
|
-
*
|
|
27
|
-
* Mutually exclusive with `name`.
|
|
28
|
-
*/
|
|
29
|
-
readonly colors?: GradientColors;
|
|
30
|
-
/**
|
|
31
|
-
* The name of a built-in gradient preset.
|
|
32
|
-
*
|
|
33
|
-
* Mutually exclusive with `colors`.
|
|
34
|
-
*/
|
|
35
|
-
readonly name?: GradientName;
|
|
36
|
-
};
|
|
37
|
-
export default function Gradient({ children, colors, name }: Props): ReactElement | null;
|
|
38
|
-
export type { GradientColors, GradientName };
|
|
@@ -1,27 +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 HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
|
-
export type Props = {
|
|
6
|
-
/**
|
|
7
|
-
* Heading content.
|
|
8
|
-
*/
|
|
9
|
-
readonly children: ReactNode;
|
|
10
|
-
/**
|
|
11
|
-
* Explicit color. By default the color is derived from the level.
|
|
12
|
-
*/
|
|
13
|
-
readonly color?: LiteralUnion<AnsiColors, string>;
|
|
14
|
-
/**
|
|
15
|
-
* Heading level controls decoration and color.
|
|
16
|
-
* @default 1
|
|
17
|
-
*/
|
|
18
|
-
readonly level?: HeadingLevel;
|
|
19
|
-
/**
|
|
20
|
-
* When true, renders an underline on a second line.
|
|
21
|
-
*/
|
|
22
|
-
readonly underline?: boolean;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Semantic heading with level-based styling.
|
|
26
|
-
*/
|
|
27
|
-
export default function Heading({ children, color, level, underline }: Props): ReactElement;
|
|
@@ -1,51 +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 HeatmapProps = {
|
|
5
|
-
/**
|
|
6
|
-
* Width of each cell in character columns.
|
|
7
|
-
* @default 2
|
|
8
|
-
*/
|
|
9
|
-
readonly cellWidth?: number;
|
|
10
|
-
/**
|
|
11
|
-
* Character used to paint each heatmap cell. Defaults to `█` so the
|
|
12
|
-
* background color fills the cell.
|
|
13
|
-
* @default "█"
|
|
14
|
-
*/
|
|
15
|
-
readonly character?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Column labels rendered below the grid.
|
|
18
|
-
*/
|
|
19
|
-
readonly columnLabels?: ReadonlyArray<string>;
|
|
20
|
-
/**
|
|
21
|
-
* 2D matrix, rows × cols.
|
|
22
|
-
*/
|
|
23
|
-
readonly data: ReadonlyArray<ReadonlyArray<number>>;
|
|
24
|
-
/**
|
|
25
|
-
* Fixed maximum (for consistent scales across multiple heatmaps).
|
|
26
|
-
*/
|
|
27
|
-
readonly max?: number;
|
|
28
|
-
/**
|
|
29
|
-
* Fixed minimum.
|
|
30
|
-
*/
|
|
31
|
-
readonly min?: number;
|
|
32
|
-
/**
|
|
33
|
-
* Color palette, lowest-to-highest intensity. Values are mapped into the
|
|
34
|
-
* palette by their position in the [min, max] range.
|
|
35
|
-
* @default ["#0b1e4f", "#1f3b96", "#3258c8", "#4e84ec", "#78b0ff"]
|
|
36
|
-
*/
|
|
37
|
-
readonly palette?: ReadonlyArray<string>;
|
|
38
|
-
/**
|
|
39
|
-
* Row labels rendered to the left of the grid.
|
|
40
|
-
*/
|
|
41
|
-
readonly rowLabels?: ReadonlyArray<string>;
|
|
42
|
-
/**
|
|
43
|
-
* Foreground color override (rarely needed since the character is a full block).
|
|
44
|
-
*/
|
|
45
|
-
readonly textColor?: LiteralUnion<AnsiColors, string>;
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* 2D heatmap. Each cell's background color is derived from its value's
|
|
49
|
-
* position in the [min, max] range mapped into `palette`.
|
|
50
|
-
*/
|
|
51
|
-
export default function Heatmap({ cellWidth, character, columnLabels, data, max: maxOverride, min: minOverride, palette, rowLabels, textColor, }: HeatmapProps): ReactElement;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { ReactElement } from "react";
|
|
2
|
-
import type { KeyBinding } from "../hooks/use-key-bindings.d.ts";
|
|
3
|
-
export 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
|
-
* <Help bindings={bindings} />
|
|
41
|
-
* <Help bindings={bindings} mode="full" />
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
export default function Help({ bindings, descriptionColor, keyColor, maxColumns, mode, separator }: Props): ReactElement;
|
|
@@ -1,52 +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
|
-
* 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
|
-
* @param props See {@link Props}.
|
|
50
|
-
* @returns A `ReactElement` rendering a BarChart of bucket counts.
|
|
51
|
-
*/
|
|
52
|
-
export default function Histogram({ bins, color, data, height, max: maxOverride, min: minOverride, showValues, thresholds, width, }: Props): ReactElement;
|
|
@@ -1,27 +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
|
-
* 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. `<Kbd>Enter</Kbd>`).
|
|
24
|
-
* @param props See {@link Props}.
|
|
25
|
-
* @returns A `ReactElement` styled as a key cap (solid / outline / bare).
|
|
26
|
-
*/
|
|
27
|
-
export default function Kbd({ children, color, variant }: Props): ReactElement;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import type { AnsiColors } from "@visulima/colorize";
|
|
2
|
-
import type { ReactElement } from "react";
|
|
3
|
-
import type { LiteralUnion } from "type-fest";
|
|
4
|
-
import type { CanvasContext } from "../canvas/buffer.d.ts";
|
|
5
|
-
import type { Point } from "./chart-utils.d.ts";
|
|
6
|
-
export type LineSeries = {
|
|
7
|
-
/**
|
|
8
|
-
* Per-series color override. Falls back to the chart-level palette.
|
|
9
|
-
*/
|
|
10
|
-
readonly color?: LiteralUnion<AnsiColors, string>;
|
|
11
|
-
/**
|
|
12
|
-
* Numeric samples to plot. Pass either a list of y-values (x is the
|
|
13
|
-
* index) or {x, y} tuples.
|
|
14
|
-
*/
|
|
15
|
-
readonly data: ReadonlyArray<number> | ReadonlyArray<{
|
|
16
|
-
readonly x: number;
|
|
17
|
-
readonly y: number;
|
|
18
|
-
}>;
|
|
19
|
-
/**
|
|
20
|
-
* Optional label shown in the legend.
|
|
21
|
-
*/
|
|
22
|
-
readonly label?: string;
|
|
23
|
-
};
|
|
24
|
-
export type LineChartProps = {
|
|
25
|
-
/**
|
|
26
|
-
* Color for axis ticks / labels.
|
|
27
|
-
* @default "gray"
|
|
28
|
-
*/
|
|
29
|
-
readonly axisColor?: LiteralUnion<AnsiColors, string>;
|
|
30
|
-
/**
|
|
31
|
-
* Chart body height in character rows.
|
|
32
|
-
* @default 10
|
|
33
|
-
*/
|
|
34
|
-
readonly height?: number;
|
|
35
|
-
/**
|
|
36
|
-
* Upper bound for the y-axis. When omitted the chart auto-scales.
|
|
37
|
-
*/
|
|
38
|
-
readonly maxY?: number;
|
|
39
|
-
/**
|
|
40
|
-
* Lower bound for the y-axis. When omitted the chart auto-scales.
|
|
41
|
-
*/
|
|
42
|
-
readonly minY?: number;
|
|
43
|
-
/**
|
|
44
|
-
* Fallback palette cycled through when a series does not set `color`.
|
|
45
|
-
* @default ["cyan", "magenta", "yellow", "green", "blue", "red"]
|
|
46
|
-
*/
|
|
47
|
-
readonly palette?: ReadonlyArray<LiteralUnion<AnsiColors, string>>;
|
|
48
|
-
/**
|
|
49
|
-
* One or more line series.
|
|
50
|
-
*/
|
|
51
|
-
readonly series: ReadonlyArray<LineSeries>;
|
|
52
|
-
/**
|
|
53
|
-
* Render the legend row under the plot.
|
|
54
|
-
* @default true
|
|
55
|
-
*/
|
|
56
|
-
readonly showLegend?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Chart body width in character columns.
|
|
59
|
-
* @default 40
|
|
60
|
-
*/
|
|
61
|
-
readonly width?: number;
|
|
62
|
-
};
|
|
63
|
-
type RenderConfig = {
|
|
64
|
-
readonly axisColor: LiteralUnion<AnsiColors, string>;
|
|
65
|
-
readonly palette: ReadonlyArray<LiteralUnion<AnsiColors, string>>;
|
|
66
|
-
readonly seriesList: ReadonlyArray<{
|
|
67
|
-
color: LiteralUnion<AnsiColors, string>;
|
|
68
|
-
points: ReadonlyArray<Point>;
|
|
69
|
-
series: LineSeries;
|
|
70
|
-
}>;
|
|
71
|
-
readonly xMax: number;
|
|
72
|
-
readonly xMin: number;
|
|
73
|
-
readonly yMax: number;
|
|
74
|
-
readonly yMin: number;
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* Project an (x, y) data point into pixel-grid coordinates for the given
|
|
78
|
-
* canvas size. Used by every chart that paints on top of a braille grid.
|
|
79
|
-
*/
|
|
80
|
-
export declare const projectPoint: (point: Point, config: Pick<RenderConfig, "xMax" | "xMin" | "yMax" | "yMin">, pixelWidth: number, pixelHeight: number) => {
|
|
81
|
-
px: number;
|
|
82
|
-
py: number;
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* Shared drawing path used by LineChart and ScatterPlot. AreaChart wraps
|
|
86
|
-
* this with a fill pass.
|
|
87
|
-
*/
|
|
88
|
-
export declare const drawSeriesOnCanvas: (context: CanvasContext, mode: "line" | "scatter", config: RenderConfig) => void;
|
|
89
|
-
/**
|
|
90
|
-
* Smooth multi-series line chart rendered at 2x4 sub-cell resolution using
|
|
91
|
-
* Unicode braille patterns. Auto-scales both axes by default.
|
|
92
|
-
*/
|
|
93
|
-
export default function LineChart({ axisColor, height, maxY, minY, palette, series, showLegend, width, }: LineChartProps): ReactElement;
|
|
94
|
-
export type { RenderConfig as LineChartRenderConfig };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { ReactElement, ReactNode } 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
|
-
* <Link url="https://example.com">
|
|
29
|
-
* <Text color="cyan">My Website</Text>
|
|
30
|
-
* </Link>
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
export default function Link({ children, fallback, url }: Props): ReactElement;
|
|
34
|
-
export type { Props };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { AnsiColors } from "@visulima/colorize";
|
|
2
|
-
import type { SpinnerName } from "@visulima/spinner";
|
|
3
|
-
import type { ReactElement, ReactNode } from "react";
|
|
4
|
-
import type { LiteralUnion } from "type-fest";
|
|
5
|
-
export 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
|
-
export default function LoadingIndicator({ children, color, type }: Props): ReactElement;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { ReactElement } from "react";
|
|
2
|
-
export type Props = {
|
|
3
|
-
/**
|
|
4
|
-
* The Markdown source string.
|
|
5
|
-
*/
|
|
6
|
-
readonly children: string;
|
|
7
|
-
/**
|
|
8
|
-
* Shiki theme for code block syntax highlighting.
|
|
9
|
-
* @default "github-dark-default"
|
|
10
|
-
*/
|
|
11
|
-
readonly codeTheme?: string;
|
|
12
|
-
/**
|
|
13
|
-
* Maximum width for text wrapping. Defaults to terminal width.
|
|
14
|
-
*/
|
|
15
|
-
readonly maxWidth?: number;
|
|
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
|
-
*/
|
|
23
|
-
readonly streaming?: boolean;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Render Markdown content as Ink terminal UI elements.
|
|
27
|
-
*
|
|
28
|
-
* ```tsx
|
|
29
|
-
* <Markdown>{"# Hello\n\nThis is **bold** and *italic*."}</Markdown>
|
|
30
|
-
* <Markdown codeTheme="github-dark-default">{"```js\nconst x = 1;\n```"}</Markdown>
|
|
31
|
-
* <Markdown streaming>{"# Streaming\n\nText arriving..."}</Markdown>
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
export default function Markdown({ children, codeTheme, maxWidth: maxWidthProp, streaming }: Props): ReactElement;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { ReactElement } from "react";
|
|
2
|
-
export type Props = {
|
|
3
|
-
/**
|
|
4
|
-
* Initial raw value (digits/characters only, without mask symbols).
|
|
5
|
-
*/
|
|
6
|
-
readonly defaultValue?: string;
|
|
7
|
-
/**
|
|
8
|
-
* Disable input and dim the display.
|
|
9
|
-
*/
|
|
10
|
-
readonly isDisabled?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Mask definition. Each `#` is replaced with a user character; any other
|
|
13
|
-
* character is rendered literally. Example: `(###) ###-####`.
|
|
14
|
-
*/
|
|
15
|
-
readonly mask: string;
|
|
16
|
-
/**
|
|
17
|
-
* Called whenever the underlying raw value changes.
|
|
18
|
-
*/
|
|
19
|
-
readonly onChange?: (value: string) => void;
|
|
20
|
-
/**
|
|
21
|
-
* Called when the user presses Enter with the current raw value.
|
|
22
|
-
*/
|
|
23
|
-
readonly onSubmit?: (value: string) => void;
|
|
24
|
-
/**
|
|
25
|
-
* Placeholder character used in the mask for empty positions.
|
|
26
|
-
* @default "_"
|
|
27
|
-
*/
|
|
28
|
-
readonly placeholderChar?: string;
|
|
29
|
-
/**
|
|
30
|
-
* Character used to mark editable positions.
|
|
31
|
-
* @default "#"
|
|
32
|
-
*/
|
|
33
|
-
readonly token?: string;
|
|
34
|
-
};
|
|
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
|
-
export default function MaskedInput({ defaultValue, isDisabled, mask, onChange, onSubmit, placeholderChar, token, }: Props): ReactElement;
|