@visulima/tui-kit 1.0.0 → 1.0.1

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 +7 -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 +2 -2
  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
@@ -2,48 +2,45 @@ import { ReactNode, ReactElement } from 'react';
2
2
  type OperationStatus = "completed" | "error" | "pending" | "running" | "skipped";
3
3
  type OperationNode = {
4
4
  /**
5
- * Nested child operations rendered beneath this node.
6
- */
5
+ * Nested child operations rendered beneath this node.
6
+ */
7
7
  readonly children?: ReadonlyArray<OperationNode>;
8
8
  /**
9
- * Optional supplementary info rendered on the next line (dimmed).
10
- */
9
+ * Optional supplementary info rendered on the next line (dimmed).
10
+ */
11
11
  readonly details?: ReactNode;
12
12
  /**
13
- * Wall-clock duration in ms, displayed right-aligned.
14
- */
13
+ * Wall-clock duration in ms, displayed right-aligned.
14
+ */
15
15
  readonly durationMs?: number;
16
16
  /**
17
- * Unique identifier within the tree.
18
- */
17
+ * Unique identifier within the tree.
18
+ */
19
19
  readonly id: string;
20
20
  /**
21
- * Human-readable label.
22
- */
21
+ * Human-readable label.
22
+ */
23
23
  readonly label: ReactNode;
24
24
  /**
25
- * Lifecycle state controlling icon + color.
26
- */
25
+ * Lifecycle state controlling icon + color.
26
+ */
27
27
  readonly status: OperationStatus;
28
28
  };
29
29
  type Props = {
30
30
  /**
31
- * Tree of operations. Each node can have its own children.
32
- */
31
+ * Tree of operations. Each node can have its own children.
32
+ */
33
33
  readonly nodes: ReadonlyArray<OperationNode>;
34
34
  /**
35
- * When true, runs the running-spinner animation.
36
- * @default true
37
- */
35
+ * When true, runs the running-spinner animation.
36
+ * @default true
37
+ */
38
38
  readonly showSpinner?: boolean;
39
39
  };
40
40
  /**
41
- * Renders a tree of operations with per-node status. Perfect for agent
42
- * progress panels (reading → editing → running tests → done).
43
- * @returns A `ReactElement` rendering the nested tree of operation rows.
44
- */
45
- declare function OperationTree({
46
- nodes,
47
- showSpinner
48
- }: Props): ReactElement;
41
+ * Renders a tree of operations with per-node status. Perfect for agent
42
+ * progress panels (reading → editing → running tests → done).
43
+ * @returns A `ReactElement` rendering the nested tree of operation rows.
44
+ */
45
+ declare function OperationTree({ nodes, showSpinner }: Props): ReactElement;
49
46
  export { OperationNode, OperationStatus, OperationTree, type Props as OperationTreeProps, Props, OperationTree as default };
@@ -10,38 +10,32 @@ type OptionListEntry = {
10
10
  };
11
11
  type Props = {
12
12
  /**
13
- * Highlight color for the row marked as current.
14
- */
13
+ * Highlight color for the row marked as current.
14
+ */
15
15
  readonly accentColor?: LiteralUnion<AnsiColors, string>;
16
16
  /**
17
- * Render the list with a border.
18
- */
17
+ * Render the list with a border.
18
+ */
19
19
  readonly bordered?: boolean;
20
20
  /**
21
- * Id of the row to highlight. No visual change if omitted.
22
- */
21
+ * Id of the row to highlight. No visual change if omitted.
22
+ */
23
23
  readonly currentId?: string;
24
24
  /**
25
- * Icon width in characters for column alignment.
26
- * @default 2
27
- */
25
+ * Icon width in characters for column alignment.
26
+ * @default 2
27
+ */
28
28
  readonly iconColumnWidth?: number;
29
29
  /**
30
- * Entries to render.
31
- */
30
+ * Entries to render.
31
+ */
32
32
  readonly options: ReadonlyArray<OptionListEntry>;
33
33
  };
34
34
  /**
35
- * Read-only presentational option list. Like `SelectInput` but without focus,
36
- * input handling, or scrolling — just a styled list of rows. Useful inside
37
- * modals, sidebars, or summary panels.
38
- * @returns A `ReactElement` rendering the list; bordered when requested.
39
- */
40
- declare function OptionList({
41
- accentColor,
42
- bordered,
43
- currentId,
44
- iconColumnWidth,
45
- options
46
- }: Props): ReactElement;
35
+ * Read-only presentational option list. Like `SelectInput` but without focus,
36
+ * input handling, or scrolling — just a styled list of rows. Useful inside
37
+ * modals, sidebars, or summary panels.
38
+ * @returns A `ReactElement` rendering the list; bordered when requested.
39
+ */
40
+ declare function OptionList({ accentColor, bordered, currentId, iconColumnWidth, options }: Props): ReactElement;
47
41
  export { OptionList, OptionListEntry, type Props as OptionListProps, Props, OptionList as default };
@@ -1,24 +1,22 @@
1
1
  import { ReactNode, ReactElement } from 'react';
2
2
  type OrderedListEntry = {
3
3
  /**
4
- * Nested sub-items, rendered as a sub-list with hierarchical numbering.
5
- */
4
+ * Nested sub-items, rendered as a sub-list with hierarchical numbering.
5
+ */
6
6
  readonly children?: ReadonlyArray<OrderedListEntry>;
7
7
  /**
8
- * Display text for this item.
9
- */
8
+ * Display text for this item.
9
+ */
10
10
  readonly label: ReactNode;
11
11
  };
12
12
  type Props = {
13
13
  /**
14
- * Entries to render as a numbered list.
15
- */
14
+ * Entries to render as a numbered list.
15
+ */
16
16
  readonly items: ReadonlyArray<OrderedListEntry>;
17
17
  };
18
18
  /**
19
- * Renders a numbered list with hierarchical nesting support.
20
- */
21
- declare function OrderedList({
22
- items
23
- }: Props): ReactElement;
19
+ * Renders a numbered list with hierarchical nesting support.
20
+ */
21
+ declare function OrderedList({ items }: Props): ReactElement;
24
22
  export { OrderedList, OrderedListEntry, type Props as OrderedListProps, Props, OrderedList as default };
@@ -13,16 +13,16 @@ interface ControlledScrollViewProps extends Props {
13
13
  width: number;
14
14
  }) => void;
15
15
  /**
16
- * Number of extra items to render above/below the viewport when virtualized.
17
- * @default 3
18
- */
16
+ * Number of extra items to render above/below the viewport when virtualized.
17
+ * @default 3
18
+ */
19
19
  overscan?: number;
20
20
  scrollOffset: number;
21
21
  /**
22
- * Only render items visible in the viewport plus overscan.
23
- * Items must be measured first (first render always renders all items).
24
- * @default false
25
- */
22
+ * Only render items visible in the viewport plus overscan.
23
+ * Items must be measured first (first render always renders all items).
24
+ * @default false
25
+ */
26
26
  virtualize?: boolean;
27
27
  }
28
28
  interface ControlledScrollViewRef {
@@ -37,18 +37,7 @@ interface ControlledScrollViewRef {
37
37
  remeasure: () => void;
38
38
  remeasureItem: (index: number) => void;
39
39
  }
40
- declare const ControlledScrollView: ({
41
- children,
42
- debug,
43
- onContentHeightChange,
44
- onItemHeightChange,
45
- onViewportSizeChange,
46
- overscan,
47
- ref,
48
- scrollOffset,
49
- virtualize,
50
- ...boxProps
51
- }: ControlledScrollViewProps & {
40
+ declare const ControlledScrollView: ({ children, debug, onContentHeightChange, onItemHeightChange, onViewportSizeChange, overscan, ref, scrollOffset, virtualize, ...boxProps }: ControlledScrollViewProps & {
52
41
  ref?: Ref<ControlledScrollViewRef>;
53
42
  }) => React.JSX.Element;
54
43
  export { ControlledScrollView as C, ControlledScrollViewProps as a, ControlledScrollViewRef as b };
@@ -0,0 +1,92 @@
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: ({ accentColor, directoryColor, fileColor, filter, initialPath, isFocused, limit, onCancel, onSelect, showPermissions, showSize }: Props) => ReactElement;
92
+ export { FileEntry as F, Props as P, FilePicker as a, FilePickerFilter as b };
@@ -9,22 +9,5 @@ interface ScrollBarBoxProps extends Props {
9
9
  thumbChar?: string;
10
10
  viewportHeight: number;
11
11
  }
12
- declare const ScrollBarBox: ({
13
- borderColor,
14
- borderDimColor,
15
- borderLeftColor,
16
- borderLeftDimColor,
17
- borderRightColor,
18
- borderRightDimColor,
19
- borderStyle,
20
- children,
21
- contentHeight,
22
- height,
23
- scrollBarAutoHide,
24
- scrollBarPosition,
25
- scrollOffset,
26
- thumbChar,
27
- viewportHeight,
28
- ...boxProps
29
- }: ScrollBarBoxProps) => React.JSX.Element;
12
+ declare const ScrollBarBox: ({ borderColor, borderDimColor, borderLeftColor, borderLeftDimColor, borderRightColor, borderRightDimColor, borderStyle, children, contentHeight, height, scrollBarAutoHide, scrollBarPosition, scrollOffset, thumbChar, viewportHeight, ...boxProps }: ScrollBarBoxProps) => React.JSX.Element;
30
13
  export { ScrollBarBox as S, ScrollBarBoxProps as a };
@@ -1,5 +1,5 @@
1
1
  import React, { Ref } from 'react';
2
- import { a as ScrollViewProps, b as ScrollViewRef } from "./scroll-view.d-BqKpI-F-.js";
2
+ import { a as ScrollViewProps, b as ScrollViewRef } from "./scroll-view.d-GZcgAHl4.js";
3
3
  type ScrollAlignment = "auto" | "bottom" | "center" | "top";
4
4
  interface ScrollListProps extends ScrollViewProps {
5
5
  readonly scrollAlignment?: ScrollAlignment;
@@ -0,0 +1,98 @@
1
+ import { Props } from '@visulima/tui/components/box';
2
+ import React, { ReactNode, Ref } from 'react';
3
+ interface ScrollViewProps extends Props {
4
+ children?: ReactNode;
5
+ debug?: boolean;
6
+ /**
7
+ * Auto-scroll to bottom when content grows and user is at/near the bottom.
8
+ * Pauses when user scrolls away from bottom; resumes when they return.
9
+ * @default false
10
+ */
11
+ followOutput?: boolean;
12
+ /**
13
+ * Number of lines from bottom that still counts as "at bottom" for followOutput.
14
+ * @default 3
15
+ */
16
+ followThreshold?: number;
17
+ /**
18
+ * Enable built-in keyboard navigation (arrows, page up/down, home/end, ctrl+u/d).
19
+ * When enabled, the component becomes focusable.
20
+ * @default false
21
+ */
22
+ keyboard?: boolean;
23
+ onContentHeightChange?: (height: number, previousHeight: number) => void;
24
+ onItemHeightChange?: (index: number, height: number, previousHeight: number) => void;
25
+ /**
26
+ * Fires when scrolled within `reachThreshold` lines of the end.
27
+ * Only fires once per entry into the threshold zone.
28
+ */
29
+ onReachEnd?: () => void;
30
+ /**
31
+ * Fires when scrolled within `reachThreshold` lines of the start.
32
+ * Only fires once per entry into the threshold zone.
33
+ */
34
+ onReachStart?: () => void;
35
+ onScroll?: (scrollOffset: number) => void;
36
+ onViewportSizeChange?: (size: {
37
+ height: number;
38
+ width: number;
39
+ }, previousSize: {
40
+ height: number;
41
+ width: number;
42
+ }) => void;
43
+ /**
44
+ * Number of extra items to render above/below the viewport when virtualized.
45
+ * @default 3
46
+ */
47
+ overscan?: number;
48
+ /**
49
+ * Distance in lines from the edge to trigger onReachEnd/onReachStart.
50
+ * @default 5
51
+ */
52
+ reachThreshold?: number;
53
+ /**
54
+ * Show a scrollbar track when content overflows the viewport.
55
+ * @default false
56
+ */
57
+ scrollbar?: boolean;
58
+ /**
59
+ * Color of the scrollbar thumb and track.
60
+ */
61
+ scrollbarColor?: string;
62
+ /**
63
+ * Scrollbar visual style.
64
+ * @default "line"
65
+ */
66
+ scrollbarStyle?: "arrow" | "block" | "bold" | "classic" | "dots" | "double" | "doubleSingle" | "line" | "round" | "single" | "singleDouble" | "thick";
67
+ /**
68
+ * Enable vim-style keybindings (j/k/g/G/u/d). Requires `keyboard` to be true.
69
+ * @default false
70
+ */
71
+ vimBindings?: boolean;
72
+ /**
73
+ * Only render items visible in the viewport plus overscan. Requires items to be measured first.
74
+ * @default false
75
+ */
76
+ virtualize?: boolean;
77
+ }
78
+ interface ScrollViewRef {
79
+ getBottomOffset: () => number;
80
+ getContentHeight: () => number;
81
+ getItemHeight: (index: number) => number;
82
+ getItemPosition: (index: number) => {
83
+ height: number;
84
+ top: number;
85
+ } | null;
86
+ getScrollOffset: () => number;
87
+ getViewportHeight: () => number;
88
+ remeasure: () => void;
89
+ remeasureItem: (index: number) => void;
90
+ scrollBy: (delta: number) => void;
91
+ scrollTo: (offset: number) => void;
92
+ scrollToBottom: () => void;
93
+ scrollToTop: () => void;
94
+ }
95
+ declare const ScrollView: ({ children, debug, followOutput, followThreshold, keyboard, onContentHeightChange, onItemHeightChange, onReachEnd, onReachStart, onScroll, onViewportSizeChange, overscan, reachThreshold, ref, scrollbar, scrollbarColor, scrollbarStyle: scrollbarStyleProp, vimBindings, virtualize, ...boxProps }: ScrollViewProps & {
96
+ ref?: Ref<ScrollViewRef>;
97
+ }) => React.JSX.Element;
98
+ export { ScrollView as S, ScrollViewProps as a, ScrollViewRef as b };