@visulima/tui-kit 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/accordion.d.ts +25 -32
  3. package/dist/alert.d.ts +9 -13
  4. package/dist/animate-presence.d.ts +9 -11
  5. package/dist/approval-prompt.d.ts +28 -38
  6. package/dist/area-chart.d.ts +29 -39
  7. package/dist/badge.d.ts +8 -11
  8. package/dist/bar-chart.d.ts +29 -38
  9. package/dist/big-text.d.ts +42 -52
  10. package/dist/blink-dot.d.ts +16 -21
  11. package/dist/breadcrumb.d.ts +11 -15
  12. package/dist/button.d.ts +18 -25
  13. package/dist/calendar.d.ts +31 -43
  14. package/dist/card.d.ts +22 -32
  15. package/dist/checkbox-group.d.ts +21 -30
  16. package/dist/checkbox.d.ts +19 -27
  17. package/dist/code.d.ts +24 -31
  18. package/dist/collapsible.d.ts +21 -30
  19. package/dist/color-picker.d.ts +29 -41
  20. package/dist/command-block.d.ts +19 -27
  21. package/dist/command-palette.d.ts +36 -45
  22. package/dist/confirm-dialog.d.ts +35 -47
  23. package/dist/confirm-input.d.ts +17 -23
  24. package/dist/console-overlay.d.ts +28 -35
  25. package/dist/content-switcher.d.ts +22 -30
  26. package/dist/controlled-scroll-view.d.ts +1 -1
  27. package/dist/data-grid.d.ts +18 -24
  28. package/dist/date-picker.d.ts +27 -38
  29. package/dist/definition-list.d.ts +16 -22
  30. package/dist/dialog.d.ts +58 -74
  31. package/dist/diff-view.d.ts +41 -54
  32. package/dist/digits.d.ts +13 -17
  33. package/dist/directory-tree.d.ts +20 -27
  34. package/dist/divider.d.ts +20 -28
  35. package/dist/drawer.d.ts +24 -32
  36. package/dist/file-change.d.ts +18 -24
  37. package/dist/file-picker-entry.d.ts +1 -1
  38. package/dist/form.d.ts +34 -41
  39. package/dist/gauge.d.ts +40 -51
  40. package/dist/gradient.d.ts +21 -25
  41. package/dist/grid.d.ts +19 -25
  42. package/dist/heading.d.ts +12 -17
  43. package/dist/heatmap.d.ts +27 -37
  44. package/dist/help.d.ts +27 -34
  45. package/dist/histogram.d.ts +27 -37
  46. package/dist/image.d.ts +11 -14
  47. package/dist/index.d.ts +6 -6
  48. package/dist/json.d.ts +23 -30
  49. package/dist/kbd.d.ts +14 -18
  50. package/dist/line-chart.d.ts +40 -49
  51. package/dist/link.d.ts +24 -28
  52. package/dist/loading-indicator.d.ts +11 -15
  53. package/dist/log.d.ts +14 -19
  54. package/dist/markdown.d.ts +22 -27
  55. package/dist/masked-input.d.ts +23 -31
  56. package/dist/menu.d.ts +32 -40
  57. package/dist/message-bubble.d.ts +16 -23
  58. package/dist/model-badge.d.ts +16 -22
  59. package/dist/model-selector.d.ts +19 -26
  60. package/dist/multi-progress.d.ts +22 -29
  61. package/dist/multi-select.d.ts +25 -35
  62. package/dist/notification-badge.d.ts +21 -28
  63. package/dist/number-input.d.ts +38 -52
  64. package/dist/operation-tree.d.ts +22 -25
  65. package/dist/option-list.d.ts +17 -23
  66. package/dist/ordered-list.d.ts +9 -11
  67. package/dist/packem_shared/{controlled-scroll-view.d-vF4wevEJ.d.ts → controlled-scroll-view.d-D3kZZzjI.d.ts} +8 -19
  68. package/dist/packem_shared/file-picker.d-CH7pccC7.d.ts +92 -0
  69. package/dist/packem_shared/{scroll-bar-box.d-DSBbBsRc.d.ts → scroll-bar-box.d-CpTYEcTZ.d.ts} +1 -18
  70. package/dist/packem_shared/{scroll-list.d-BP0UZSY4.d.ts → scroll-list.d-CPCF0RwC.d.ts} +1 -1
  71. package/dist/packem_shared/scroll-view.d-GZcgAHl4.d.ts +98 -0
  72. package/dist/packem_shared/{use-tree-view.d-dXTKoDPM.d.ts → use-tree-view.d-DeMQ6G2r.d.ts} +115 -151
  73. package/dist/paginator.d.ts +28 -38
  74. package/dist/paragraph.d.ts +15 -21
  75. package/dist/path-input.d.ts +29 -40
  76. package/dist/pie-chart.d.ts +21 -27
  77. package/dist/placeholder.d.ts +26 -34
  78. package/dist/popover.d.ts +20 -27
  79. package/dist/progress-bar.d.ts +25 -33
  80. package/dist/progress-circle.d.ts +27 -36
  81. package/dist/qr-code.d.ts +21 -27
  82. package/dist/radio-group.d.ts +30 -41
  83. package/dist/scatter-plot.d.ts +5 -16
  84. package/dist/scroll-bar-box.d.ts +1 -1
  85. package/dist/scroll-list.d.ts +2 -2
  86. package/dist/scroll-view.d.ts +1 -1
  87. package/dist/search-input.d.ts +23 -32
  88. package/dist/select-input-indicator.d.ts +15 -19
  89. package/dist/select-input-item.d.ts +18 -24
  90. package/dist/select-input.d.ts +49 -62
  91. package/dist/shimmer-text.d.ts +24 -30
  92. package/dist/sidebar.d.ts +21 -28
  93. package/dist/slider.d.ts +50 -66
  94. package/dist/sparkline.d.ts +19 -25
  95. package/dist/spinner.d.ts +7 -9
  96. package/dist/status-line.d.ts +14 -20
  97. package/dist/status-message.d.ts +7 -10
  98. package/dist/stepper.d.ts +18 -24
  99. package/dist/stopwatch.d.ts +24 -31
  100. package/dist/streaming-text.d.ts +20 -27
  101. package/dist/switch.d.ts +23 -32
  102. package/dist/tab.d.ts +8 -10
  103. package/dist/table.d.ts +40 -41
  104. package/dist/tabs.d.ts +50 -61
  105. package/dist/tag-input.d.ts +30 -42
  106. package/dist/tag.d.ts +14 -19
  107. package/dist/text-input.d.ts +21 -29
  108. package/dist/textarea.d.ts +32 -43
  109. package/dist/thinking-block.d.ts +25 -34
  110. package/dist/time-picker.d.ts +27 -37
  111. package/dist/timer.d.ts +28 -37
  112. package/dist/toast.d.ts +20 -28
  113. package/dist/token-usage.d.ts +23 -30
  114. package/dist/tool-call.d.ts +14 -19
  115. package/dist/tooltip.d.ts +19 -25
  116. package/dist/transition.d.ts +40 -48
  117. package/dist/tree-select.d.ts +25 -35
  118. package/dist/tree-view-entry.d.ts +1 -1
  119. package/dist/unordered-list.d.ts +12 -15
  120. package/dist/use-linked-scroll.d.ts +27 -27
  121. package/package.json +6 -6
  122. package/dist/packem_shared/file-picker.d-Cie6aAMD.d.ts +0 -104
  123. package/dist/packem_shared/scroll-view.d-BqKpI-F-.d.ts +0 -119
@@ -3,35 +3,29 @@ import { ReactNode, ReactElement } from 'react';
3
3
  import { LiteralUnion } from 'type-fest';
4
4
  type Props = {
5
5
  /**
6
- * Background color spanning the whole row.
7
- */
6
+ * Background color spanning the whole row.
7
+ */
8
8
  readonly backgroundColor?: LiteralUnion<AnsiColors, string>;
9
9
  /**
10
- * Content rendered in the center. Optional.
11
- */
10
+ * Content rendered in the center. Optional.
11
+ */
12
12
  readonly center?: ReactNode;
13
13
  /**
14
- * Default foreground for text rendered inside the row.
15
- */
14
+ * Default foreground for text rendered inside the row.
15
+ */
16
16
  readonly color?: LiteralUnion<AnsiColors, string>;
17
17
  /**
18
- * Content rendered flush-left.
19
- */
18
+ * Content rendered flush-left.
19
+ */
20
20
  readonly left?: ReactNode;
21
21
  /**
22
- * Content rendered flush-right.
23
- */
22
+ * Content rendered flush-right.
23
+ */
24
24
  readonly right?: ReactNode;
25
25
  };
26
26
  /**
27
- * Full-width status bar with left / center / right slots. Typically pinned to
28
- * the bottom of the UI.
29
- */
30
- declare function StatusLine({
31
- backgroundColor,
32
- center,
33
- color,
34
- left,
35
- right
36
- }: Props): ReactElement;
27
+ * Full-width status bar with left / center / right slots. Typically pinned to
28
+ * the bottom of the UI.
29
+ */
30
+ declare function StatusLine({ backgroundColor, center, color, left, right }: Props): ReactElement;
37
31
  export { Props, StatusLine, type Props as StatusLineProps, StatusLine as default };
@@ -3,19 +3,16 @@ import { V as Variant } from "./packem_shared/variant-config.d-D5NnrrQK.js";
3
3
  type StatusMessageVariant = Variant;
4
4
  type Props = {
5
5
  /**
6
- * Message content.
7
- */
6
+ * Message content.
7
+ */
8
8
  readonly children: ReactNode;
9
9
  /**
10
- * Determines the icon and color of the status message.
11
- */
10
+ * Determines the icon and color of the status message.
11
+ */
12
12
  readonly variant: StatusMessageVariant;
13
13
  };
14
14
  /**
15
- * Renders a status notification with a colored icon and message text.
16
- */
17
- declare function StatusMessage({
18
- children,
19
- variant
20
- }: Props): ReactElement;
15
+ * Renders a status notification with a colored icon and message text.
16
+ */
17
+ declare function StatusMessage({ children, variant }: Props): ReactElement;
21
18
  export { Props, StatusMessage, type Props as StatusMessageProps, StatusMessageVariant, StatusMessage as default };
package/dist/stepper.d.ts CHANGED
@@ -10,39 +10,33 @@ type StepperStep = {
10
10
  };
11
11
  type Props = {
12
12
  /**
13
- * Color used for active and completed steps.
14
- * @default "blue"
15
- */
13
+ * Color used for active and completed steps.
14
+ * @default "blue"
15
+ */
16
16
  readonly accentColor?: LiteralUnion<AnsiColors, string>;
17
17
  /**
18
- * Index of the current step (used when steps do not provide a status).
19
- * @default 0
20
- */
18
+ * Index of the current step (used when steps do not provide a status).
19
+ * @default 0
20
+ */
21
21
  readonly activeIndex?: number;
22
22
  /**
23
- * Color used for errors.
24
- * @default "red"
25
- */
23
+ * Color used for errors.
24
+ * @default "red"
25
+ */
26
26
  readonly errorColor?: LiteralUnion<AnsiColors, string>;
27
27
  /**
28
- * Orientation of the stepper.
29
- * @default "horizontal"
30
- */
28
+ * Orientation of the stepper.
29
+ * @default "horizontal"
30
+ */
31
31
  readonly orientation?: "horizontal" | "vertical";
32
32
  /**
33
- * List of steps.
34
- */
33
+ * List of steps.
34
+ */
35
35
  readonly steps: ReadonlyArray<StepperStep>;
36
36
  };
37
37
  /**
38
- * Step indicator for multi-stage flows.
39
- * @returns A `ReactElement` rendering the steps horizontally or vertically.
40
- */
41
- declare function Stepper({
42
- accentColor,
43
- activeIndex,
44
- errorColor,
45
- orientation,
46
- steps
47
- }: Props): ReactElement;
38
+ * Step indicator for multi-stage flows.
39
+ * @returns A `ReactElement` rendering the steps horizontally or vertically.
40
+ */
41
+ declare function Stepper({ accentColor, activeIndex, errorColor, orientation, steps }: Props): ReactElement;
48
42
  export { Props, StepStatus, Stepper, type Props as StepperProps, StepperStep, Stepper as default };
@@ -3,47 +3,40 @@ import { Ref, ReactElement } from 'react';
3
3
  type StopwatchRef = Omit<UseStopwatchResult, "elapsed" | "isRunning" | "laps">;
4
4
  type Props = {
5
5
  /**
6
- * Whether to start counting immediately.
7
- * @default false
8
- */
6
+ * Whether to start counting immediately.
7
+ * @default false
8
+ */
9
9
  readonly autoStart?: boolean;
10
10
  /**
11
- * Make the rendered text bold.
12
- */
11
+ * Make the rendered text bold.
12
+ */
13
13
  readonly bold?: boolean;
14
14
  /**
15
- * Text color for the rendered time.
16
- */
15
+ * Text color for the rendered time.
16
+ */
17
17
  readonly color?: string;
18
18
  /**
19
- * Custom formatter for the elapsed time.
20
- * Receives elapsed milliseconds, returns a display string.
21
- * @default formatDuration (MM:SS or HH:MM:SS)
22
- */
19
+ * Custom formatter for the elapsed time.
20
+ * Receives elapsed milliseconds, returns a display string.
21
+ * @default formatDuration (MM:SS or HH:MM:SS)
22
+ */
23
23
  readonly format?: (elapsed: number) => string;
24
24
  /**
25
- * Tick interval in milliseconds.
26
- * @default 1000
27
- */
25
+ * Tick interval in milliseconds.
26
+ * @default 1000
27
+ */
28
28
  readonly interval?: number;
29
29
  readonly ref?: Ref<StopwatchRef>;
30
30
  };
31
31
  /**
32
- * A count-up stopwatch component.
33
- *
34
- * Exposes `start`, `stop`, `toggle`, `reset`, and `lap` methods via ref.
35
- *
36
- * ```tsx
37
- * const ref = useRef&lt;StopwatchRef>(null);
38
- * &lt;Stopwatch ref={ref} autoStart />
39
- * ```
40
- */
41
- declare const Stopwatch: ({
42
- autoStart,
43
- bold,
44
- color,
45
- format,
46
- interval,
47
- ref
48
- }: Props) => ReactElement;
32
+ * A count-up stopwatch component.
33
+ *
34
+ * Exposes `start`, `stop`, `toggle`, `reset`, and `lap` methods via ref.
35
+ *
36
+ * ```tsx
37
+ * const ref = useRef&lt;StopwatchRef>(null);
38
+ * &lt;Stopwatch ref={ref} autoStart />
39
+ * ```
40
+ */
41
+ declare const Stopwatch: ({ autoStart, bold, color, format, interval, ref }: Props) => ReactElement;
49
42
  export { Props, Stopwatch, type Props as StopwatchProps, StopwatchRef, Stopwatch as default };
@@ -3,44 +3,37 @@ import { ReactElement } from 'react';
3
3
  import { LiteralUnion } from 'type-fest';
4
4
  type Props = {
5
5
  /**
6
- * Color applied to the streamed output.
7
- */
6
+ * Color applied to the streamed output.
7
+ */
8
8
  readonly color?: LiteralUnion<AnsiColors, string>;
9
9
  /**
10
- * Glyph rendered at the streaming caret while characters are still being revealed.
11
- * @default "▊" (left three quarters block)
12
- */
10
+ * Glyph rendered at the streaming caret while characters are still being revealed.
11
+ * @default "▊" (left three quarters block)
12
+ */
13
13
  readonly cursor?: string;
14
14
  /**
15
- * Milliseconds between characters.
16
- * @default 20
17
- */
15
+ * Milliseconds between characters.
16
+ * @default 20
17
+ */
18
18
  readonly interval?: number;
19
19
  /**
20
- * Called exactly once per `text` value, after the full text has been revealed.
21
- */
20
+ * Called exactly once per `text` value, after the full text has been revealed.
21
+ */
22
22
  readonly onComplete?: () => void;
23
23
  /**
24
- * Whether to display the cursor after streaming completes.
25
- * @default false
26
- */
24
+ * Whether to display the cursor after streaming completes.
25
+ * @default false
26
+ */
27
27
  readonly showCursorWhenDone?: boolean;
28
28
  /**
29
- * Full text to stream into the output.
30
- */
29
+ * Full text to stream into the output.
30
+ */
31
31
  readonly text: string;
32
32
  };
33
33
  /**
34
- * Typewriter animation that reveals text one character at a time.
35
- * Automatically resets and replays when `text` changes. `onComplete`
36
- * fires exactly once per `text` value once it is fully revealed.
37
- */
38
- declare function StreamingText({
39
- color,
40
- cursor,
41
- interval,
42
- onComplete,
43
- showCursorWhenDone,
44
- text
45
- }: Props): ReactElement;
34
+ * Typewriter animation that reveals text one character at a time.
35
+ * Automatically resets and replays when `text` changes. `onComplete`
36
+ * fires exactly once per `text` value once it is fully revealed.
37
+ */
38
+ declare function StreamingText({ color, cursor, interval, onComplete, showCursorWhenDone, text }: Props): ReactElement;
46
39
  export { Props, StreamingText, type Props as StreamingTextProps, StreamingText as default };
package/dist/switch.d.ts CHANGED
@@ -3,53 +3,44 @@ import { ReactNode, ReactElement } from 'react';
3
3
  import { LiteralUnion } from 'type-fest';
4
4
  type Props = {
5
5
  /**
6
- * Accent color for the on state.
7
- * @default "green"
8
- */
6
+ * Accent color for the on state.
7
+ * @default "green"
8
+ */
9
9
  readonly accentColor?: LiteralUnion<AnsiColors, string>;
10
10
  /**
11
- * Auto-focus when mounted if nothing else is focused.
12
- */
11
+ * Auto-focus when mounted if nothing else is focused.
12
+ */
13
13
  readonly autoFocus?: boolean;
14
14
  /**
15
- * Optional label rendered after the switch.
16
- */
15
+ * Optional label rendered after the switch.
16
+ */
17
17
  readonly children?: ReactNode;
18
18
  /**
19
- * Initial value when uncontrolled.
20
- */
19
+ * Initial value when uncontrolled.
20
+ */
21
21
  readonly defaultValue?: boolean;
22
22
  /**
23
- * Disable input and dim the switch.
24
- */
23
+ * Disable input and dim the switch.
24
+ */
25
25
  readonly isDisabled?: boolean;
26
26
  /**
27
- * Labels displayed inside the switch track.
28
- * @default ["off", "on"]
29
- */
27
+ * Labels displayed inside the switch track.
28
+ * @default ["off", "on"]
29
+ */
30
30
  readonly labels?: readonly [string, string];
31
31
  /**
32
- * Fired when the switch is toggled.
33
- */
32
+ * Fired when the switch is toggled.
33
+ */
34
34
  readonly onChange?: (value: boolean) => void;
35
35
  /**
36
- * Controlled value. Pair with `onChange` to update the parent.
37
- */
36
+ * Controlled value. Pair with `onChange` to update the parent.
37
+ */
38
38
  readonly value?: boolean;
39
39
  };
40
40
  /**
41
- * Focusable on/off switch. Toggles with Space or Enter.
42
- * @returns A `ReactElement` rendering two labeled segments plus an optional
43
- * trailing label.
44
- */
45
- declare function Switch({
46
- accentColor,
47
- autoFocus,
48
- children,
49
- defaultValue,
50
- isDisabled,
51
- labels,
52
- onChange,
53
- value
54
- }: Props): ReactElement;
41
+ * Focusable on/off switch. Toggles with Space or Enter.
42
+ * @returns A `ReactElement` rendering two labeled segments plus an optional
43
+ * trailing label.
44
+ */
45
+ declare function Switch({ accentColor, autoFocus, children, defaultValue, isDisabled, labels, onChange, value }: Props): ReactElement;
55
46
  export { Props, Switch, type Props as SwitchProps, Switch as default };
package/dist/tab.d.ts CHANGED
@@ -1,19 +1,17 @@
1
1
  import { ReactNode, ReactElement } from 'react';
2
2
  type Props = {
3
3
  /**
4
- * Tab content to render when the tab is active.
5
- */
4
+ * Tab content to render when the tab is active.
5
+ */
6
6
  readonly children: ReactNode;
7
7
  /**
8
- * Unique name identifying this tab.
9
- */
8
+ * Unique name identifying this tab.
9
+ */
10
10
  readonly name: string;
11
11
  };
12
12
  /**
13
- * A single tab within a Tabs container.
14
- * The `name` prop identifies the tab; `children` is rendered when active.
15
- */
16
- declare function Tab({
17
- children
18
- }: Props): ReactElement;
13
+ * A single tab within a Tabs container.
14
+ * The `name` prop identifies the tab; `children` is rendered when active.
15
+ */
16
+ declare function Tab({ children }: Props): ReactElement;
19
17
  export { Props, Tab, type Props as TabProps, Tab as default };
package/dist/table.d.ts CHANGED
@@ -4,8 +4,8 @@ interface BorderComponent {
4
4
  width: number;
5
5
  }
6
6
  /**
7
- * Represents the style of the border for a table or grid.
8
- */
7
+ * Represents the style of the border for a table or grid.
8
+ */
9
9
  interface BorderStyle {
10
10
  /** Box vertical character. */
11
11
  bodyJoin: BorderComponent;
@@ -38,81 +38,80 @@ interface BorderStyle {
38
38
  /** Box top right character. */
39
39
  topRight: BorderComponent;
40
40
  }
41
- /** Base style properties applicable globally */
42
41
  type HorizontalAlignment = "center" | "left" | "right";
43
42
  /**
44
- * Scalar value that can be displayed in a table cell.
45
- */
43
+ * Scalar value that can be displayed in a table cell.
44
+ */
46
45
  type Scalar = bigint | boolean | number | string | null | undefined;
47
46
  /**
48
- * Dictionary with scalar values, representing a single row of data.
49
- */
47
+ * Dictionary with scalar values, representing a single row of data.
48
+ */
50
49
  type ScalarDict = Record<string, Scalar>;
51
50
  /**
52
- * Configuration for a single table column.
53
- */
51
+ * Configuration for a single table column.
52
+ */
54
53
  type ColumnConfig<T extends ScalarDict> = {
55
54
  /**
56
- * Horizontal alignment of cell content.
57
- */
55
+ * Horizontal alignment of cell content.
56
+ */
58
57
  readonly align?: HorizontalAlignment;
59
58
  /**
60
- * Custom header label. Defaults to the key name.
61
- */
59
+ * Custom header label. Defaults to the key name.
60
+ */
62
61
  readonly header?: string;
63
62
  /**
64
- * Key from the data object to display in this column.
65
- */
63
+ * Key from the data object to display in this column.
64
+ */
66
65
  readonly key: keyof T & string;
67
66
  /**
68
- * Fixed width for this column in characters.
69
- */
67
+ * Fixed width for this column in characters.
68
+ */
70
69
  readonly width?: number;
71
70
  };
72
71
  type Props<T extends ScalarDict> = {
73
72
  /**
74
- * Border style preset name or a custom `BorderStyle` object from `@visulima/tabular`.
75
- * @default "default"
76
- */
73
+ * Border style preset name or a custom `BorderStyle` object from `@visulima/tabular`.
74
+ * @default "default"
75
+ */
77
76
  readonly borderStyle?: "ascii" | "block" | "default" | "dots" | "double" | "markdown" | "minimal" | "none" | "rounded" | "thick" | BorderStyle;
78
77
  /**
79
- * Columns to display and their order.
80
- * Accepts simple key strings or `ColumnConfig` objects for advanced control.
81
- * If omitted, all keys from the first data item are used.
82
- */
78
+ * Columns to display and their order.
79
+ * Accepts simple key strings or `ColumnConfig` objects for advanced control.
80
+ * If omitted, all keys from the first data item are used.
81
+ */
83
82
  readonly columns?: ((keyof T & string) | ColumnConfig<T>)[];
84
83
  /**
85
- * Array of objects to display as rows.
86
- */
84
+ * Array of objects to display as rows.
85
+ */
87
86
  readonly data: T[];
88
87
  /**
89
- * Format a cell value before rendering. Return a string to display in the cell.
90
- */
88
+ * Format a cell value before rendering. Return a string to display in the cell.
89
+ */
91
90
  readonly formatCell?: (value: Scalar, column: keyof T & string, rowIndex: number) => string;
92
91
  /**
93
- * Format a header label before rendering. Return a string to display as the column header.
94
- */
92
+ * Format a header label before rendering. Return a string to display as the column header.
93
+ */
95
94
  readonly formatHeader?: (column: keyof T & string) => string;
96
95
  /**
97
- * Maximum width of the table in characters. Columns will be truncated or wrapped to fit.
98
- */
96
+ * Maximum width of the table in characters. Columns will be truncated or wrapped to fit.
97
+ */
99
98
  readonly maxWidth?: number;
100
99
  /**
101
- * Cell padding (left and right) in characters.
102
- * @default 1
103
- */
100
+ * Cell padding (left and right) in characters.
101
+ * @default 1
102
+ */
104
103
  readonly padding?: number;
105
104
  /**
106
- * Whether to show the header row.
107
- * @default true
108
- */
105
+ * Whether to show the header row.
106
+ * @default true
107
+ */
109
108
  readonly showHeader?: boolean;
110
109
  /** Placeholder shown in place of `null` or `undefined` cell values. Defaults to an empty string. */
111
110
  readonly skeleton?: string;
112
111
  /**
113
- * Enable word wrap instead of truncation when cells exceed their width.
114
- * @default false
115
- */
112
+ * Enable word wrap instead of truncation when cells exceed their width.
113
+ * @default false
114
+ */
116
115
  readonly wordWrap?: boolean;
117
116
  };
118
117
  declare const Table: <T extends ScalarDict>(props: Props<T>) => ReactElement;
package/dist/tabs.d.ts CHANGED
@@ -3,33 +3,33 @@ import { ReactNode, ReactElement } from 'react';
3
3
  import { LiteralUnion } from 'type-fest';
4
4
  import { Props as Props$1 } from "./tab.js";
5
5
  /**
6
- * Keyboard navigation configuration for Tabs.
7
- */
6
+ * Keyboard navigation configuration for Tabs.
7
+ */
8
8
  type KeyMap = {
9
9
  /**
10
- * Key names that move to the next tab.
11
- * Defaults to `["rightArrow"]` for row layouts and `["downArrow"]` for column layouts.
12
- */
10
+ * Key names that move to the next tab.
11
+ * Defaults to `["rightArrow"]` for row layouts and `["downArrow"]` for column layouts.
12
+ */
13
13
  readonly next?: ReadonlyArray<string>;
14
14
  /**
15
- * Key names that move to the previous tab.
16
- * Defaults to `["leftArrow"]` for row layouts and `["upArrow"]` for column layouts.
17
- */
15
+ * Key names that move to the previous tab.
16
+ * Defaults to `["leftArrow"]` for row layouts and `["upArrow"]` for column layouts.
17
+ */
18
18
  readonly previous?: ReadonlyArray<string>;
19
19
  /**
20
- * Whether Meta/Cmd + 1–9 jumps to a specific tab.
21
- * @default true
22
- */
20
+ * Whether Meta/Cmd + 1–9 jumps to a specific tab.
21
+ * @default true
22
+ */
23
23
  readonly useNumbers?: boolean;
24
24
  /**
25
- * Whether the Tab key cycles through tabs (only when `isFocused` is not managed by Ink).
26
- * @default true
27
- */
25
+ * Whether the Tab key cycles through tabs (only when `isFocused` is not managed by Ink).
26
+ * @default true
27
+ */
28
28
  readonly useTab?: boolean;
29
29
  };
30
30
  /**
31
- * Color customization for active tab styling.
32
- */
31
+ * Color customization for active tab styling.
32
+ */
33
33
  type TabColors = {
34
34
  readonly activeTab?: {
35
35
  readonly backgroundColor?: LiteralUnion<AnsiColors, string>;
@@ -38,70 +38,59 @@ type TabColors = {
38
38
  };
39
39
  type Props = {
40
40
  /**
41
- * Tab elements to render.
42
- */
41
+ * Tab elements to render.
42
+ */
43
43
  readonly children: ReactNode;
44
44
  /**
45
- * Active tab colors. When `isFocused` is `false`, the active tab uses gray.
46
- */
45
+ * Active tab colors. When `isFocused` is `false`, the active tab uses gray.
46
+ */
47
47
  readonly colors?: TabColors;
48
48
  /**
49
- * Name of the tab to select initially (uncontrolled mode).
50
- * Ignored when `value` is provided.
51
- */
49
+ * Name of the tab to select initially (uncontrolled mode).
50
+ * Ignored when `value` is provided.
51
+ */
52
52
  readonly defaultValue?: string;
53
53
  /**
54
- * Layout direction for the tab bar.
55
- * @default "row"
56
- */
54
+ * Layout direction for the tab bar.
55
+ * @default "row"
56
+ */
57
57
  readonly flexDirection?: "column" | "column-reverse" | "row" | "row-reverse";
58
58
  /**
59
- * Whether the tabs are focused and respond to keyboard input.
60
- * - `true`: focused, uses active colors.
61
- * - `false`: unfocused, uses gray active color, ignores input.
62
- * - `undefined`/`null`: always active (focus not managed by Ink).
63
- * @default undefined
64
- */
59
+ * Whether the tabs are focused and respond to keyboard input.
60
+ * - `true`: focused, uses active colors.
61
+ * - `false`: unfocused, uses gray active color, ignores input.
62
+ * - `undefined`/`null`: always active (focus not managed by Ink).
63
+ * @default undefined
64
+ */
65
65
  readonly isFocused?: boolean | null;
66
66
  /**
67
- * Custom keyboard mappings.
68
- */
67
+ * Custom keyboard mappings.
68
+ */
69
69
  readonly keyMap?: KeyMap;
70
70
  /**
71
- * Called when the active tab changes.
72
- */
71
+ * Called when the active tab changes.
72
+ */
73
73
  readonly onChange: (name: string, activeTab: ReactElement<Props$1>) => void;
74
74
  /**
75
- * Whether to display 1-based index numbers before each tab name.
76
- * @default true
77
- */
75
+ * Whether to display 1-based index numbers before each tab name.
76
+ * @default true
77
+ */
78
78
  readonly showIndex?: boolean;
79
79
  /**
80
- * Controlled active tab name. When provided, the component is controlled —
81
- * the parent owns the active tab state and must update it via `onChange`.
82
- * When omitted, the component manages its own state (uncontrolled mode).
83
- */
80
+ * Controlled active tab name. When provided, the component is controlled —
81
+ * the parent owns the active tab state and must update it via `onChange`.
82
+ * When omitted, the component manages its own state (uncontrolled mode).
83
+ */
84
84
  readonly value?: string;
85
85
  /**
86
- * Width of the container Box. Also determines the separator width in column layouts.
87
- */
86
+ * Width of the container Box. Also determines the separator width in column layouts.
87
+ */
88
88
  readonly width?: number | string;
89
89
  };
90
90
  /**
91
- * Tabbed navigation component. Renders a row or column of tabs with keyboard
92
- * navigation (arrow keys, Tab, number keys) and calls `onChange` when the
93
- * active tab changes.
94
- */
95
- declare function Tabs({
96
- children,
97
- colors: colorsProp,
98
- defaultValue,
99
- flexDirection,
100
- isFocused,
101
- keyMap: keyMapProp,
102
- onChange,
103
- showIndex,
104
- value,
105
- width
106
- }: Props): ReactElement;
91
+ * Tabbed navigation component. Renders a row or column of tabs with keyboard
92
+ * navigation (arrow keys, Tab, number keys) and calls `onChange` when the
93
+ * active tab changes.
94
+ */
95
+ declare function Tabs({ children, colors: colorsProp, defaultValue, flexDirection, isFocused, keyMap: keyMapProp, onChange, showIndex, value, width }: Props): ReactElement;
107
96
  export { KeyMap, Props, TabColors, Tabs, type KeyMap as TabsKeyMap, type Props as TabsProps, Tabs as default };