@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
@@ -4,47 +4,40 @@ import { LiteralUnion } from 'type-fest';
4
4
  type Color = LiteralUnion<AnsiColors, string>;
5
5
  type Props = {
6
6
  /**
7
- * Width of the input/output ratio bar in cells.
8
- * @default 20
9
- */
7
+ * Width of the input/output ratio bar in cells.
8
+ * @default 20
9
+ */
10
10
  readonly barWidth?: number;
11
11
  /**
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
- */
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
- * Number of input (prompt) tokens.
18
- * @default 0
19
- */
17
+ * Number of input (prompt) tokens.
18
+ * @default 0
19
+ */
20
20
  readonly input?: number;
21
21
  /**
22
- * Color for the input segment.
23
- * @default "cyan"
24
- */
22
+ * Color for the input segment.
23
+ * @default "cyan"
24
+ */
25
25
  readonly inputColor?: Color;
26
26
  /**
27
- * Number of output (completion) tokens.
28
- * @default 0
29
- */
27
+ * Number of output (completion) tokens.
28
+ * @default 0
29
+ */
30
30
  readonly output?: number;
31
31
  /**
32
- * Color for the output segment.
33
- * @default "magenta"
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 };
@@ -2,32 +2,27 @@ import { ReactNode, ReactElement } from 'react';
2
2
  type ToolCallStatus = "error" | "pending" | "running" | "success";
3
3
  type Props = {
4
4
  /**
5
- * The tool arguments. Objects are shown as compact `key=value` pairs;
6
- * strings are shown verbatim.
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
- * Rendered output/result of the call, shown indented beneath the header.
11
- */
10
+ * Rendered output/result of the call, shown indented beneath the header.
11
+ */
12
12
  readonly children?: ReactNode;
13
13
  /**
14
- * The tool name.
15
- */
14
+ * The tool name.
15
+ */
16
16
  readonly name: string;
17
17
  /**
18
- * Call status, driving the icon and color.
19
- * @default "pending"
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
- * The element the tooltip is attached to.
8
- */
7
+ * The element the tooltip is attached to.
8
+ */
9
9
  readonly children: ReactNode;
10
10
  /**
11
- * Border color.
12
- * @default "gray"
13
- */
11
+ * Border color.
12
+ * @default "gray"
13
+ */
14
14
  readonly color?: LiteralUnion<AnsiColors, string>;
15
15
  /**
16
- * Tooltip body content.
17
- */
16
+ * Tooltip body content.
17
+ */
18
18
  readonly content: ReactNode;
19
19
  /**
20
- * Controls whether the tooltip is rendered.
21
- * @default true
22
- */
20
+ * Controls whether the tooltip is rendered.
21
+ * @default true
22
+ */
23
23
  readonly isVisible?: boolean;
24
24
  /**
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
- */
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 };
@@ -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
- * Content to animate.
7
- */
6
+ * Content to animate.
7
+ */
8
8
  readonly children: ReactNode;
9
9
  /**
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
- */
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
- * Duration of both enter and exit transitions, in milliseconds.
17
- * @default 240
18
- */
16
+ * Duration of both enter and exit transitions, in milliseconds.
17
+ * @default 240
18
+ */
19
19
  readonly duration?: number;
20
20
  /**
21
- * Called once the exit animation finishes (i.e. the component has fully
22
- * transitioned out). AnimatePresence uses this to unmount the wrapper.
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
- * Animation preset controlling how the content appears/disappears.
27
- * @default "fade"
28
- */
26
+ * Animation preset controlling how the content appears/disappears.
27
+ * @default "fade"
28
+ */
29
29
  readonly preset?: TransitionPreset;
30
30
  /**
31
- * Controls the target phase. `true` drives towards `entered`, `false`
32
- * drives towards `exited`. Flip the value to trigger animation.
33
- * @default true
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
- * Tick interval in milliseconds. Lower values yield smoother animation
38
- * at the cost of CPU.
39
- * @default 30
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 `&lt;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 `&lt;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 };
@@ -8,58 +8,48 @@ type TreeSelectNode = {
8
8
  };
9
9
  type Props = {
10
10
  /**
11
- * Accent color for the focused row and selection marks.
12
- * @default "blue"
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
- * Auto-focus on mount.
17
- */
16
+ * Auto-focus on mount.
17
+ */
18
18
  readonly autoFocus?: boolean;
19
19
  /**
20
- * Selected values when uncontrolled.
21
- */
20
+ * Selected values when uncontrolled.
21
+ */
22
22
  readonly defaultValue?: ReadonlyArray<string>;
23
23
  /**
24
- * Disable input and dim the tree.
25
- */
24
+ * Disable input and dim the tree.
25
+ */
26
26
  readonly isDisabled?: boolean;
27
27
  /**
28
- * The tree to render.
29
- */
28
+ * The tree to render.
29
+ */
30
30
  readonly nodes: ReadonlyArray<TreeSelectNode>;
31
31
  /**
32
- * Fires whenever the selection changes.
33
- */
32
+ * Fires whenever the selection changes.
33
+ */
34
34
  readonly onChange?: (values: ReadonlyArray<string>) => void;
35
35
  /**
36
- * Fires on Enter with the current selection.
37
- */
36
+ * Fires on Enter with the current selection.
37
+ */
38
38
  readonly onSubmit?: (values: ReadonlyArray<string>) => void;
39
39
  /**
40
- * `single` replaces the selection; `multiple` toggles values.
41
- * @default "single"
42
- */
40
+ * `single` replaces the selection; `multiple` toggles values.
41
+ * @default "single"
42
+ */
43
43
  readonly selectionMode?: "multiple" | "single";
44
44
  /**
45
- * Controlled selection. When provided, `defaultValue` is ignored.
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-dXTKoDPM.js";
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';
@@ -1,30 +1,27 @@
1
1
  import { ReactNode, ReactElement } from 'react';
2
2
  type UnorderedListEntry = {
3
3
  /**
4
- * Content of the list entry. Can be a string or nested list.
5
- */
4
+ * Content of the list entry. Can be a string or nested list.
5
+ */
6
6
  readonly children?: ReadonlyArray<UnorderedListEntry>;
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 bullet list.
15
- */
14
+ * Entries to render as a bullet list.
15
+ */
16
16
  readonly items: ReadonlyArray<UnorderedListEntry>;
17
17
  /**
18
- * Custom bullet symbol(s). A string uses the same symbol at all depths.
19
- * An array cycles through symbols by nesting depth.
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-BqKpI-F-.js";
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
- * Callback to pass to ScrollView's `onScroll` prop.
7
- * Broadcasts the scroll position to all linked instances.
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
- * Ref to attach to the ScrollView component.
12
- * Used internally to call `scrollTo()` when other instances scroll.
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
- * Hook that returns a ref and onScroll callback for linking a ScrollView
19
- * to this group. Call once per ScrollView instance.
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.0",
3
+ "version": "1.0.1",
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",
@@ -512,7 +512,7 @@
512
512
  "@shikijs/langs": "^4.3.0",
513
513
  "@shikijs/themes": "^4.3.0",
514
514
  "@visulima/tabular": "4.0.0",
515
- "@visulima/tui": "2.0.0",
515
+ "@visulima/tui": "2.0.1",
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 };