@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.
- package/CHANGELOG.md +18 -0
- package/dist/accordion.d.ts +25 -32
- package/dist/alert.d.ts +9 -13
- package/dist/animate-presence.d.ts +9 -11
- package/dist/approval-prompt.d.ts +28 -38
- package/dist/area-chart.d.ts +29 -39
- package/dist/badge.d.ts +8 -11
- package/dist/bar-chart.d.ts +29 -38
- package/dist/big-text.d.ts +42 -52
- package/dist/blink-dot.d.ts +16 -21
- package/dist/breadcrumb.d.ts +11 -15
- package/dist/button.d.ts +18 -25
- package/dist/calendar.d.ts +31 -43
- package/dist/card.d.ts +22 -32
- package/dist/checkbox-group.d.ts +21 -30
- package/dist/checkbox.d.ts +19 -27
- package/dist/code.d.ts +24 -31
- package/dist/collapsible.d.ts +21 -30
- package/dist/color-picker.d.ts +29 -41
- package/dist/command-block.d.ts +19 -27
- package/dist/command-palette.d.ts +36 -45
- package/dist/confirm-dialog.d.ts +35 -47
- package/dist/confirm-input.d.ts +17 -23
- package/dist/console-overlay.d.ts +28 -35
- package/dist/content-switcher.d.ts +22 -30
- package/dist/controlled-scroll-view.d.ts +1 -1
- package/dist/data-grid.d.ts +18 -24
- package/dist/date-picker.d.ts +27 -38
- package/dist/definition-list.d.ts +16 -22
- package/dist/dialog.d.ts +58 -74
- package/dist/diff-view.d.ts +41 -54
- package/dist/digits.d.ts +13 -17
- package/dist/directory-tree.d.ts +20 -27
- package/dist/divider.d.ts +20 -28
- package/dist/drawer.d.ts +24 -32
- package/dist/file-change.d.ts +18 -24
- package/dist/file-picker-entry.d.ts +1 -1
- package/dist/form.d.ts +34 -41
- package/dist/gauge.d.ts +40 -51
- package/dist/gradient.d.ts +21 -25
- package/dist/grid.d.ts +19 -25
- package/dist/heading.d.ts +12 -17
- package/dist/heatmap.d.ts +27 -37
- package/dist/help.d.ts +27 -34
- package/dist/histogram.d.ts +27 -37
- package/dist/image.d.ts +11 -14
- package/dist/index.d.ts +6 -6
- package/dist/json.d.ts +23 -30
- package/dist/kbd.d.ts +14 -18
- package/dist/line-chart.d.ts +40 -49
- package/dist/link.d.ts +24 -28
- package/dist/loading-indicator.d.ts +11 -15
- package/dist/log.d.ts +14 -19
- package/dist/markdown.d.ts +22 -27
- package/dist/masked-input.d.ts +23 -31
- package/dist/menu.d.ts +32 -40
- package/dist/message-bubble.d.ts +16 -23
- package/dist/model-badge.d.ts +16 -22
- package/dist/model-selector.d.ts +19 -26
- package/dist/multi-progress.d.ts +22 -29
- package/dist/multi-select.d.ts +25 -35
- package/dist/notification-badge.d.ts +21 -28
- package/dist/number-input.d.ts +38 -52
- package/dist/operation-tree.d.ts +22 -25
- package/dist/option-list.d.ts +17 -23
- package/dist/ordered-list.d.ts +9 -11
- package/dist/packem_shared/{controlled-scroll-view.d-vF4wevEJ.d.ts → controlled-scroll-view.d-D3kZZzjI.d.ts} +8 -19
- package/dist/packem_shared/file-picker.d-CH7pccC7.d.ts +92 -0
- package/dist/packem_shared/{scroll-bar-box.d-DSBbBsRc.d.ts → scroll-bar-box.d-CpTYEcTZ.d.ts} +1 -18
- package/dist/packem_shared/{scroll-list.d-BP0UZSY4.d.ts → scroll-list.d-CPCF0RwC.d.ts} +1 -1
- package/dist/packem_shared/scroll-view.d-GZcgAHl4.d.ts +98 -0
- package/dist/packem_shared/{use-tree-view.d-dXTKoDPM.d.ts → use-tree-view.d-DeMQ6G2r.d.ts} +115 -151
- package/dist/paginator.d.ts +28 -38
- package/dist/paragraph.d.ts +15 -21
- package/dist/path-input.d.ts +29 -40
- package/dist/pie-chart.d.ts +21 -27
- package/dist/placeholder.d.ts +26 -34
- package/dist/popover.d.ts +20 -27
- package/dist/progress-bar.d.ts +25 -33
- package/dist/progress-circle.d.ts +27 -36
- package/dist/qr-code.d.ts +21 -27
- package/dist/radio-group.d.ts +30 -41
- package/dist/scatter-plot.d.ts +5 -16
- package/dist/scroll-bar-box.d.ts +1 -1
- package/dist/scroll-list.d.ts +2 -2
- package/dist/scroll-view.d.ts +1 -1
- package/dist/search-input.d.ts +23 -32
- package/dist/select-input-indicator.d.ts +15 -19
- package/dist/select-input-item.d.ts +18 -24
- package/dist/select-input.d.ts +49 -62
- package/dist/shimmer-text.d.ts +24 -30
- package/dist/sidebar.d.ts +21 -28
- package/dist/slider.d.ts +50 -66
- package/dist/sparkline.d.ts +19 -25
- package/dist/spinner.d.ts +7 -9
- package/dist/status-line.d.ts +14 -20
- package/dist/status-message.d.ts +7 -10
- package/dist/stepper.d.ts +18 -24
- package/dist/stopwatch.d.ts +24 -31
- package/dist/streaming-text.d.ts +20 -27
- package/dist/switch.d.ts +23 -32
- package/dist/tab.d.ts +8 -10
- package/dist/table.d.ts +40 -41
- package/dist/tabs.d.ts +50 -61
- package/dist/tag-input.d.ts +30 -42
- package/dist/tag.d.ts +14 -19
- package/dist/text-input.d.ts +21 -29
- package/dist/textarea.d.ts +32 -43
- package/dist/thinking-block.d.ts +25 -34
- package/dist/time-picker.d.ts +27 -37
- package/dist/timer.d.ts +28 -37
- package/dist/toast.d.ts +20 -28
- package/dist/token-usage.d.ts +23 -30
- package/dist/tool-call.d.ts +14 -19
- package/dist/tooltip.d.ts +19 -25
- package/dist/transition.d.ts +40 -48
- package/dist/tree-select.d.ts +25 -35
- package/dist/tree-view-entry.d.ts +1 -1
- package/dist/unordered-list.d.ts +12 -15
- package/dist/use-linked-scroll.d.ts +27 -27
- package/package.json +6 -6
- package/dist/packem_shared/file-picker.d-Cie6aAMD.d.ts +0 -104
- package/dist/packem_shared/scroll-view.d-BqKpI-F-.d.ts +0 -119
package/dist/token-usage.d.ts
CHANGED
|
@@ -4,47 +4,40 @@ import { LiteralUnion } from 'type-fest';
|
|
|
4
4
|
type Color = LiteralUnion<AnsiColors, string>;
|
|
5
5
|
type Props = {
|
|
6
6
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
* Width of the input/output ratio bar in cells.
|
|
8
|
+
* @default 20
|
|
9
|
+
*/
|
|
10
10
|
readonly barWidth?: number;
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
* Optional context-window size. When set, a `used / limit (pct%)` summary
|
|
13
|
+
* and a fill bar are shown instead of the input/output split.
|
|
14
|
+
*/
|
|
15
15
|
readonly contextLimit?: number;
|
|
16
16
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
* Number of input (prompt) tokens.
|
|
18
|
+
* @default 0
|
|
19
|
+
*/
|
|
20
20
|
readonly input?: number;
|
|
21
21
|
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
* Color for the input segment.
|
|
23
|
+
* @default "cyan"
|
|
24
|
+
*/
|
|
25
25
|
readonly inputColor?: Color;
|
|
26
26
|
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
* Number of output (completion) tokens.
|
|
28
|
+
* @default 0
|
|
29
|
+
*/
|
|
30
30
|
readonly output?: number;
|
|
31
31
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
* Color for the output segment.
|
|
33
|
+
* @default "magenta"
|
|
34
|
+
*/
|
|
35
35
|
readonly outputColor?: Color;
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
|
-
* A compact token-usage readout. By default it shows input vs output counts
|
|
39
|
-
* with a proportional two-color bar; when `contextLimit` is set, it instead
|
|
40
|
-
* shows how much of the context window is used.
|
|
41
|
-
*/
|
|
42
|
-
declare function TokenUsage({
|
|
43
|
-
barWidth,
|
|
44
|
-
contextLimit,
|
|
45
|
-
input,
|
|
46
|
-
inputColor,
|
|
47
|
-
output,
|
|
48
|
-
outputColor
|
|
49
|
-
}: Props): ReactElement;
|
|
38
|
+
* A compact token-usage readout. By default it shows input vs output counts
|
|
39
|
+
* with a proportional two-color bar; when `contextLimit` is set, it instead
|
|
40
|
+
* shows how much of the context window is used.
|
|
41
|
+
*/
|
|
42
|
+
declare function TokenUsage({ barWidth, contextLimit, input, inputColor, output, outputColor }: Props): ReactElement;
|
|
50
43
|
export { Props, TokenUsage, type Props as TokenUsageProps, TokenUsage as default };
|
package/dist/tool-call.d.ts
CHANGED
|
@@ -2,32 +2,27 @@ import { ReactNode, ReactElement } from 'react';
|
|
|
2
2
|
type ToolCallStatus = "error" | "pending" | "running" | "success";
|
|
3
3
|
type Props = {
|
|
4
4
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
* The tool arguments. Objects are shown as compact `key=value` pairs;
|
|
6
|
+
* strings are shown verbatim.
|
|
7
|
+
*/
|
|
8
8
|
readonly args?: Record<string, unknown> | string;
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
* Rendered output/result of the call, shown indented beneath the header.
|
|
11
|
+
*/
|
|
12
12
|
readonly children?: ReactNode;
|
|
13
13
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
* The tool name.
|
|
15
|
+
*/
|
|
16
16
|
readonly name: string;
|
|
17
17
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
* Call status, driving the icon and color.
|
|
19
|
+
* @default "pending"
|
|
20
|
+
*/
|
|
21
21
|
readonly status?: ToolCallStatus;
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
|
-
* A single tool invocation: a status icon, the tool name, its arguments as
|
|
25
|
-
* compact `key=value` pairs, and any result rendered as indented children.
|
|
26
|
-
*/
|
|
27
|
-
declare function ToolCall({
|
|
28
|
-
args,
|
|
29
|
-
children,
|
|
30
|
-
name,
|
|
31
|
-
status
|
|
32
|
-
}: Props): ReactElement;
|
|
24
|
+
* A single tool invocation: a status icon, the tool name, its arguments as
|
|
25
|
+
* compact `key=value` pairs, and any result rendered as indented children.
|
|
26
|
+
*/
|
|
27
|
+
declare function ToolCall({ args, children, name, status }: Props): ReactElement;
|
|
33
28
|
export { Props, ToolCall, type Props as ToolCallProps, ToolCallStatus, ToolCall as default };
|
package/dist/tooltip.d.ts
CHANGED
|
@@ -4,40 +4,34 @@ import { LiteralUnion } from 'type-fest';
|
|
|
4
4
|
type TooltipPlacement = "bottom" | "left" | "right" | "top";
|
|
5
5
|
type Props = {
|
|
6
6
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
* The element the tooltip is attached to.
|
|
8
|
+
*/
|
|
9
9
|
readonly children: ReactNode;
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
* Border color.
|
|
12
|
+
* @default "gray"
|
|
13
|
+
*/
|
|
14
14
|
readonly color?: LiteralUnion<AnsiColors, string>;
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
* Tooltip body content.
|
|
17
|
+
*/
|
|
18
18
|
readonly content: ReactNode;
|
|
19
19
|
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
* Controls whether the tooltip is rendered.
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
23
|
readonly isVisible?: boolean;
|
|
24
24
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
* Relative position. Terminal rendering does not support floating layers,
|
|
26
|
+
* so the tooltip is placed inline next to (or above / below) the anchor.
|
|
27
|
+
* @default "right"
|
|
28
|
+
*/
|
|
29
29
|
readonly placement?: TooltipPlacement;
|
|
30
30
|
};
|
|
31
31
|
/**
|
|
32
|
-
* Renders supplementary text next to an anchor. Because terminals don't have
|
|
33
|
-
* a floating-layer concept, the tooltip lives inline in the layout. Hide it
|
|
34
|
-
* by toggling `isVisible`.
|
|
35
|
-
*/
|
|
36
|
-
declare function Tooltip({
|
|
37
|
-
children,
|
|
38
|
-
color,
|
|
39
|
-
content,
|
|
40
|
-
isVisible,
|
|
41
|
-
placement
|
|
42
|
-
}: Props): ReactElement;
|
|
32
|
+
* Renders supplementary text next to an anchor. Because terminals don't have
|
|
33
|
+
* a floating-layer concept, the tooltip lives inline in the layout. Hide it
|
|
34
|
+
* by toggling `isVisible`.
|
|
35
|
+
*/
|
|
36
|
+
declare function Tooltip({ children, color, content, isVisible, placement }: Props): ReactElement;
|
|
43
37
|
export { Props, Tooltip, TooltipPlacement, type Props as TooltipProps, Tooltip as default };
|
package/dist/transition.d.ts
CHANGED
|
@@ -3,72 +3,64 @@ type TransitionPreset = "fade" | "reveal" | "slide-down" | "slide-left" | "slide
|
|
|
3
3
|
type TransitionPhase = "entered" | "entering" | "exited" | "exiting";
|
|
4
4
|
type Props = {
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
* Content to animate.
|
|
7
|
+
*/
|
|
8
8
|
readonly children: ReactNode;
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
* For slide presets, how many characters of offset to animate across.
|
|
11
|
+
* For the `reveal` preset, the maximum row count to scale through.
|
|
12
|
+
* @default 4
|
|
13
|
+
*/
|
|
14
14
|
readonly distance?: number;
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
* Duration of both enter and exit transitions, in milliseconds.
|
|
17
|
+
* @default 240
|
|
18
|
+
*/
|
|
19
19
|
readonly duration?: number;
|
|
20
20
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
* Called once the exit animation finishes (i.e. the component has fully
|
|
22
|
+
* transitioned out). AnimatePresence uses this to unmount the wrapper.
|
|
23
|
+
*/
|
|
24
24
|
readonly onExit?: () => void;
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
* Animation preset controlling how the content appears/disappears.
|
|
27
|
+
* @default "fade"
|
|
28
|
+
*/
|
|
29
29
|
readonly preset?: TransitionPreset;
|
|
30
30
|
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
* Controls the target phase. `true` drives towards `entered`, `false`
|
|
32
|
+
* drives towards `exited`. Flip the value to trigger animation.
|
|
33
|
+
* @default true
|
|
34
|
+
*/
|
|
35
35
|
readonly show?: boolean;
|
|
36
36
|
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
* Tick interval in milliseconds. Lower values yield smoother animation
|
|
38
|
+
* at the cost of CPU.
|
|
39
|
+
* @default 30
|
|
40
|
+
*/
|
|
41
41
|
readonly tickInterval?: number;
|
|
42
42
|
};
|
|
43
43
|
type TransitionComponent = ((props: Props) => ReactElement | null) & {
|
|
44
44
|
isAnimatable: true;
|
|
45
45
|
};
|
|
46
46
|
/**
|
|
47
|
-
* Animate a child's entry and exit using a TUI-friendly preset. Drive via
|
|
48
|
-
* `show`; the component toggles between enter and exit, fires `onExit` once
|
|
49
|
-
* the exit animation completes.
|
|
50
|
-
*
|
|
51
|
-
* **Fade preset note:** `dimColor` is only applied when the child is a plain
|
|
52
|
-
* string. Non-string children (Box trees, other components) pass through
|
|
53
|
-
* untouched during the transition — wrap them in `<Text>` if you need the
|
|
54
|
-
* fade effect.
|
|
55
|
-
* @returns A `ReactElement` rendering the transitioning child, or `null`
|
|
56
|
-
* once a hidden transition has fully completed.
|
|
57
|
-
*/
|
|
58
|
-
declare function Transition({
|
|
59
|
-
children,
|
|
60
|
-
distance,
|
|
61
|
-
duration,
|
|
62
|
-
onExit,
|
|
63
|
-
preset,
|
|
64
|
-
show,
|
|
65
|
-
tickInterval
|
|
66
|
-
}: Props): ReactElement | null;
|
|
47
|
+
* Animate a child's entry and exit using a TUI-friendly preset. Drive via
|
|
48
|
+
* `show`; the component toggles between enter and exit, fires `onExit` once
|
|
49
|
+
* the exit animation completes.
|
|
50
|
+
*
|
|
51
|
+
* **Fade preset note:** `dimColor` is only applied when the child is a plain
|
|
52
|
+
* string. Non-string children (Box trees, other components) pass through
|
|
53
|
+
* untouched during the transition — wrap them in `<Text>` if you need the
|
|
54
|
+
* fade effect.
|
|
55
|
+
* @returns A `ReactElement` rendering the transitioning child, or `null`
|
|
56
|
+
* once a hidden transition has fully completed.
|
|
57
|
+
*/
|
|
58
|
+
declare function Transition({ children, distance, duration, onExit, preset, show, tickInterval }: Props): ReactElement | null;
|
|
67
59
|
/**
|
|
68
|
-
* Static marker used by `AnimatePresence` to recognize Transition children
|
|
69
|
-
* even when the consumer hasn't explicitly passed a `show` prop. Consumers
|
|
70
|
-
* can apply the same marker to their own wrappers (`MyWrapper.isAnimatable
|
|
71
|
-
* = true`) to opt them into animation orchestration.
|
|
72
|
-
*/
|
|
60
|
+
* Static marker used by `AnimatePresence` to recognize Transition children
|
|
61
|
+
* even when the consumer hasn't explicitly passed a `show` prop. Consumers
|
|
62
|
+
* can apply the same marker to their own wrappers (`MyWrapper.isAnimatable
|
|
63
|
+
* = true`) to opt them into animation orchestration.
|
|
64
|
+
*/
|
|
73
65
|
declare const TransitionWithMarker: TransitionComponent;
|
|
74
66
|
export { Props, Transition, TransitionPhase, TransitionPreset, type Props as TransitionProps, TransitionWithMarker as default };
|
package/dist/tree-select.d.ts
CHANGED
|
@@ -8,58 +8,48 @@ type TreeSelectNode = {
|
|
|
8
8
|
};
|
|
9
9
|
type Props = {
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
* Accent color for the focused row and selection marks.
|
|
12
|
+
* @default "blue"
|
|
13
|
+
*/
|
|
14
14
|
readonly accentColor?: LiteralUnion<AnsiColors, string>;
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
* Auto-focus on mount.
|
|
17
|
+
*/
|
|
18
18
|
readonly autoFocus?: boolean;
|
|
19
19
|
/**
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
* Selected values when uncontrolled.
|
|
21
|
+
*/
|
|
22
22
|
readonly defaultValue?: ReadonlyArray<string>;
|
|
23
23
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
* Disable input and dim the tree.
|
|
25
|
+
*/
|
|
26
26
|
readonly isDisabled?: boolean;
|
|
27
27
|
/**
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
* The tree to render.
|
|
29
|
+
*/
|
|
30
30
|
readonly nodes: ReadonlyArray<TreeSelectNode>;
|
|
31
31
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
* Fires whenever the selection changes.
|
|
33
|
+
*/
|
|
34
34
|
readonly onChange?: (values: ReadonlyArray<string>) => void;
|
|
35
35
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
* Fires on Enter with the current selection.
|
|
37
|
+
*/
|
|
38
38
|
readonly onSubmit?: (values: ReadonlyArray<string>) => void;
|
|
39
39
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
* `single` replaces the selection; `multiple` toggles values.
|
|
41
|
+
* @default "single"
|
|
42
|
+
*/
|
|
43
43
|
readonly selectionMode?: "multiple" | "single";
|
|
44
44
|
/**
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
* Controlled selection. When provided, `defaultValue` is ignored.
|
|
46
|
+
*/
|
|
47
47
|
readonly value?: ReadonlyArray<string>;
|
|
48
48
|
};
|
|
49
49
|
/**
|
|
50
|
-
* A keyboard-navigable tree with selectable leaves. ↑/↓ move the cursor, →/←
|
|
51
|
-
* expand/collapse a branch (or Space on a branch), Space selects a leaf, and
|
|
52
|
-
* Enter submits. Supports single or multiple selection.
|
|
53
|
-
*/
|
|
54
|
-
declare function TreeSelect({
|
|
55
|
-
accentColor,
|
|
56
|
-
autoFocus,
|
|
57
|
-
defaultValue,
|
|
58
|
-
isDisabled,
|
|
59
|
-
nodes,
|
|
60
|
-
onChange,
|
|
61
|
-
onSubmit,
|
|
62
|
-
selectionMode,
|
|
63
|
-
value: controlledValue
|
|
64
|
-
}: Props): ReactElement;
|
|
50
|
+
* A keyboard-navigable tree with selectable leaves. ↑/↓ move the cursor, →/←
|
|
51
|
+
* expand/collapse a branch (or Space on a branch), Space selects a leaf, and
|
|
52
|
+
* Enter submits. Supports single or multiple selection.
|
|
53
|
+
*/
|
|
54
|
+
declare function TreeSelect({ accentColor, autoFocus, defaultValue, isDisabled, nodes, onChange, onSubmit, selectionMode, value: controlledValue }: Props): ReactElement;
|
|
65
55
|
export { Props, TreeSelect, TreeSelectNode, type Props as TreeSelectProps, TreeSelect as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
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-
|
|
1
|
+
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";
|
|
2
2
|
import '@visulima/tui/components/box';
|
|
3
3
|
import '@visulima/tui/components/text';
|
|
4
4
|
import 'react';
|
package/dist/unordered-list.d.ts
CHANGED
|
@@ -1,30 +1,27 @@
|
|
|
1
1
|
import { ReactNode, ReactElement } from 'react';
|
|
2
2
|
type UnorderedListEntry = {
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
* Content of the list entry. Can be a string or nested list.
|
|
5
|
+
*/
|
|
6
6
|
readonly children?: ReadonlyArray<UnorderedListEntry>;
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
* Display text for this item.
|
|
9
|
+
*/
|
|
10
10
|
readonly label: ReactNode;
|
|
11
11
|
};
|
|
12
12
|
type Props = {
|
|
13
13
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
* Entries to render as a bullet list.
|
|
15
|
+
*/
|
|
16
16
|
readonly items: ReadonlyArray<UnorderedListEntry>;
|
|
17
17
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
* Custom bullet symbol(s). A string uses the same symbol at all depths.
|
|
19
|
+
* An array cycles through symbols by nesting depth.
|
|
20
|
+
*/
|
|
21
21
|
readonly marker?: ReadonlyArray<string> | string;
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
|
-
* Renders a bullet list with nesting support.
|
|
25
|
-
*/
|
|
26
|
-
declare function UnorderedList({
|
|
27
|
-
items,
|
|
28
|
-
marker
|
|
29
|
-
}: Props): ReactElement;
|
|
24
|
+
* Renders a bullet list with nesting support.
|
|
25
|
+
*/
|
|
26
|
+
declare function UnorderedList({ items, marker }: Props): ReactElement;
|
|
30
27
|
export { Props, UnorderedList, UnorderedListEntry, type Props as UnorderedListProps, UnorderedList as default };
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
|
-
import { b as ScrollViewRef } from "./packem_shared/scroll-view.d-
|
|
2
|
+
import { b as ScrollViewRef } from "./packem_shared/scroll-view.d-GZcgAHl4.js";
|
|
3
3
|
import '@visulima/tui/components/box';
|
|
4
4
|
type UseLinkedScrollReturn = {
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
* Callback to pass to ScrollView's `onScroll` prop.
|
|
7
|
+
* Broadcasts the scroll position to all linked instances.
|
|
8
|
+
*/
|
|
9
9
|
onScroll: (scrollOffset: number) => void;
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
* Ref to attach to the ScrollView component.
|
|
12
|
+
* Used internally to call `scrollTo()` when other instances scroll.
|
|
13
|
+
*/
|
|
14
14
|
ref: RefObject<ScrollViewRef | null>;
|
|
15
15
|
};
|
|
16
16
|
type LinkedScrollGroup = {
|
|
17
17
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
* Hook that returns a ref and onScroll callback for linking a ScrollView
|
|
19
|
+
* to this group. Call once per ScrollView instance.
|
|
20
|
+
*/
|
|
21
21
|
useLinkedScroll: () => UseLinkedScrollReturn;
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
|
-
* Creates a linked scroll group that synchronizes scroll position
|
|
25
|
-
* across multiple ScrollView instances.
|
|
26
|
-
* @example
|
|
27
|
-
* ```tsx
|
|
28
|
-
* const group = createLinkedScrollGroup();
|
|
29
|
-
*
|
|
30
|
-
* const PanelA = () => {
|
|
31
|
-
* const { ref, onScroll } = group.useLinkedScroll();
|
|
32
|
-
* return <ScrollView ref={ref} onScroll={onScroll}>...</ScrollView>;
|
|
33
|
-
* };
|
|
34
|
-
*
|
|
35
|
-
* const PanelB = () => {
|
|
36
|
-
* const { ref, onScroll } = group.useLinkedScroll();
|
|
37
|
-
* return <ScrollView ref={ref} onScroll={onScroll}>...</ScrollView>;
|
|
38
|
-
* };
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
24
|
+
* Creates a linked scroll group that synchronizes scroll position
|
|
25
|
+
* across multiple ScrollView instances.
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* const group = createLinkedScrollGroup();
|
|
29
|
+
*
|
|
30
|
+
* const PanelA = () => {
|
|
31
|
+
* const { ref, onScroll } = group.useLinkedScroll();
|
|
32
|
+
* return <ScrollView ref={ref} onScroll={onScroll}>...</ScrollView>;
|
|
33
|
+
* };
|
|
34
|
+
*
|
|
35
|
+
* const PanelB = () => {
|
|
36
|
+
* const { ref, onScroll } = group.useLinkedScroll();
|
|
37
|
+
* return <ScrollView ref={ref} onScroll={onScroll}>...</ScrollView>;
|
|
38
|
+
* };
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
41
|
declare const createLinkedScrollGroup: () => LinkedScrollGroup;
|
|
42
42
|
export { LinkedScrollGroup, UseLinkedScrollReturn, createLinkedScrollGroup, createLinkedScrollGroup as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/tui-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Component library for @visulima/tui — installable as a package, or copy-pasteable via the shadcn CLI registry",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -503,16 +503,16 @@
|
|
|
503
503
|
"LICENSE.md"
|
|
504
504
|
],
|
|
505
505
|
"dependencies": {
|
|
506
|
-
"@visulima/ansi": "4.
|
|
507
|
-
"@visulima/colorize": "2.0
|
|
508
|
-
"@visulima/spinner": "1.0.
|
|
506
|
+
"@visulima/ansi": "4.1.0",
|
|
507
|
+
"@visulima/colorize": "2.1.0",
|
|
508
|
+
"@visulima/spinner": "1.0.1",
|
|
509
509
|
"type-fest": "5.7.0"
|
|
510
510
|
},
|
|
511
511
|
"peerDependencies": {
|
|
512
512
|
"@shikijs/langs": "^4.3.0",
|
|
513
513
|
"@shikijs/themes": "^4.3.0",
|
|
514
|
-
"@visulima/tabular": "4.
|
|
515
|
-
"@visulima/tui": "
|
|
514
|
+
"@visulima/tabular": "4.1.0",
|
|
515
|
+
"@visulima/tui": "3.0.0",
|
|
516
516
|
"cfonts": "^3.3.1",
|
|
517
517
|
"diff": "^9.0.0",
|
|
518
518
|
"marked": "^18.0.5",
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* A single entry (file or directory) returned by the file system hook.
|
|
4
|
-
*/
|
|
5
|
-
type FileEntry = {
|
|
6
|
-
readonly isDirectory: boolean;
|
|
7
|
-
readonly isHidden: boolean;
|
|
8
|
-
readonly name: string;
|
|
9
|
-
readonly path: string;
|
|
10
|
-
readonly permissions: string;
|
|
11
|
-
readonly size: number;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Filter options for the file picker.
|
|
15
|
-
*/
|
|
16
|
-
type FilePickerFilter = {
|
|
17
|
-
/**
|
|
18
|
-
* Allowed file extensions (e.g. `[".ts", ".tsx"]`). Empty or omitted means all.
|
|
19
|
-
*/
|
|
20
|
-
readonly extensions?: ReadonlyArray<string>;
|
|
21
|
-
/**
|
|
22
|
-
* Whether to include directories in the list.
|
|
23
|
-
* @default true
|
|
24
|
-
*/
|
|
25
|
-
readonly showDirectories?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Whether to include regular files in the list.
|
|
28
|
-
* @default true
|
|
29
|
-
*/
|
|
30
|
-
readonly showFiles?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Whether to include hidden files (names starting with `.`).
|
|
33
|
-
* @default false
|
|
34
|
-
*/
|
|
35
|
-
readonly showHidden?: boolean;
|
|
36
|
-
};
|
|
37
|
-
type Props = {
|
|
38
|
-
/**
|
|
39
|
-
* Color for the focused item highlight.
|
|
40
|
-
* @default "cyan"
|
|
41
|
-
*/
|
|
42
|
-
readonly accentColor?: string;
|
|
43
|
-
/**
|
|
44
|
-
* Color for directory entries.
|
|
45
|
-
* @default "blue"
|
|
46
|
-
*/
|
|
47
|
-
readonly directoryColor?: string;
|
|
48
|
-
/**
|
|
49
|
-
* Color for file entries.
|
|
50
|
-
* @default "white"
|
|
51
|
-
*/
|
|
52
|
-
readonly fileColor?: string;
|
|
53
|
-
/**
|
|
54
|
-
* File filter options.
|
|
55
|
-
*/
|
|
56
|
-
readonly filter?: FilePickerFilter;
|
|
57
|
-
/**
|
|
58
|
-
* Starting directory path.
|
|
59
|
-
* @default process.cwd()
|
|
60
|
-
*/
|
|
61
|
-
readonly initialPath?: string;
|
|
62
|
-
/**
|
|
63
|
-
* Whether keyboard navigation is active.
|
|
64
|
-
* @default true
|
|
65
|
-
*/
|
|
66
|
-
readonly isFocused?: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* Maximum number of visible items (viewport height).
|
|
69
|
-
* @default 10
|
|
70
|
-
*/
|
|
71
|
-
readonly limit?: number;
|
|
72
|
-
/**
|
|
73
|
-
* Called when escape is pressed.
|
|
74
|
-
*/
|
|
75
|
-
readonly onCancel?: () => void;
|
|
76
|
-
/**
|
|
77
|
-
* Called when a file is selected (enter on a file entry).
|
|
78
|
-
*/
|
|
79
|
-
readonly onSelect?: (entry: FileEntry) => void;
|
|
80
|
-
/**
|
|
81
|
-
* Show file permissions column.
|
|
82
|
-
* @default false
|
|
83
|
-
*/
|
|
84
|
-
readonly showPermissions?: boolean;
|
|
85
|
-
/**
|
|
86
|
-
* Show file size column.
|
|
87
|
-
* @default false
|
|
88
|
-
*/
|
|
89
|
-
readonly showSize?: boolean;
|
|
90
|
-
};
|
|
91
|
-
declare const FilePicker: ({
|
|
92
|
-
accentColor,
|
|
93
|
-
directoryColor,
|
|
94
|
-
fileColor,
|
|
95
|
-
filter,
|
|
96
|
-
initialPath,
|
|
97
|
-
isFocused,
|
|
98
|
-
limit,
|
|
99
|
-
onCancel,
|
|
100
|
-
onSelect,
|
|
101
|
-
showPermissions,
|
|
102
|
-
showSize
|
|
103
|
-
}: Props) => ReactElement;
|
|
104
|
-
export { FileEntry as F, Props as P, FilePicker as a, FilePickerFilter as b };
|