@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
@@ -14,25 +14,18 @@ declare const theme: {
14
14
  container: () => Props$1;
15
15
  expandIndicator: (_props: StyleFunctionProps) => Props$2;
16
16
  focusIndicator: () => Props$2;
17
- indent: ({
18
- depth
19
- }: StyleFunctionProps) => Props$1;
20
- label: ({
21
- isFocused,
22
- isSelected
23
- }: StyleFunctionProps) => Props$2;
17
+ indent: ({ depth }: StyleFunctionProps) => Props$1;
18
+ label: ({ isFocused, isSelected }: StyleFunctionProps) => Props$2;
24
19
  loadingIndicator: () => Props$2;
25
- node: ({
26
- isFocused
27
- }: StyleFunctionProps) => Props$1;
20
+ node: ({ isFocused }: StyleFunctionProps) => Props$1;
28
21
  selectedIndicator: () => Props$2;
29
22
  };
30
23
  };
31
24
  type Theme = typeof theme;
32
25
  /**
33
- * A single node in the tree. Generic over the user's data shape.
34
- * The `id` field MUST be unique across the entire tree.
35
- */
26
+ * A single node in the tree. Generic over the user's data shape.
27
+ * The `id` field MUST be unique across the entire tree.
28
+ */
36
29
  type TreeNode<T = Record<string, unknown>> = {
37
30
  /** Child nodes. Undefined or empty array means leaf node. */
38
31
  readonly children?: TreeNode<T>[];
@@ -41,22 +34,22 @@ type TreeNode<T = Record<string, unknown>> = {
41
34
  /** Unique identifier for this node. Used as the key for all lookups. */
42
35
  readonly id: string;
43
36
  /**
44
- * Explicitly marks this node as a parent that can have children loaded
45
- * asynchronously via `loadChildren`. When true, the node shows an expand
46
- * indicator even if `children` is empty or undefined, and expanding it
47
- * triggers the `loadChildren` callback.
48
- */
37
+ * Explicitly marks this node as a parent that can have children loaded
38
+ * asynchronously via `loadChildren`. When true, the node shows an expand
39
+ * indicator even if `children` is empty or undefined, and expanding it
40
+ * triggers the `loadChildren` callback.
41
+ */
49
42
  readonly isParent?: boolean;
50
43
  /** Display label. Used by the default renderer. */
51
44
  readonly label: string;
52
45
  };
53
46
  /**
54
- * For async/lazy loading: a function that resolves children on demand.
55
- */
47
+ * For async/lazy loading: a function that resolves children on demand.
48
+ */
56
49
  type AsyncChildrenFunction<T = Record<string, unknown>> = (node: TreeNode<T>) => Promise<TreeNode<T>[]>;
57
50
  /**
58
- * State passed to custom renderers and theme functions.
59
- */
51
+ * State passed to custom renderers and theme functions.
52
+ */
60
53
  type TreeNodeState = {
61
54
  /** Depth of this node in the tree (root = 0). */
62
55
  readonly depth: number;
@@ -72,8 +65,8 @@ type TreeNodeState = {
72
65
  readonly isSelected: boolean;
73
66
  };
74
67
  /**
75
- * Props received by a custom node renderer.
76
- */
68
+ * Props received by a custom node renderer.
69
+ */
77
70
  type TreeNodeRendererProps<T = Record<string, unknown>> = {
78
71
  /** The tree node data. */
79
72
  readonly node: TreeNode<T>;
@@ -81,12 +74,12 @@ type TreeNodeRendererProps<T = Record<string, unknown>> = {
81
74
  readonly state: TreeNodeState;
82
75
  };
83
76
  /**
84
- * Selection mode for the tree view.
85
- */
77
+ * Selection mode for the tree view.
78
+ */
86
79
  type SelectionMode = "multiple" | "none" | "single";
87
80
  /**
88
- * A flattened representation of a tree node with navigation links.
89
- */
81
+ * A flattened representation of a tree node with navigation links.
82
+ */
90
83
  type FlatNode<T = Record<string, unknown>> = {
91
84
  /** Ordered list of direct children IDs. */
92
85
  readonly childrenIds: ReadonlyArray<string>;
@@ -110,9 +103,9 @@ type FlatNode<T = Record<string, unknown>> = {
110
103
  readonly siblingIndex: number;
111
104
  };
112
105
  /**
113
- * A flattened map of all tree nodes built via DFS traversal.
114
- * Stores parent/child/sibling links for O(1) navigation.
115
- */
106
+ * A flattened map of all tree nodes built via DFS traversal.
107
+ * Stores parent/child/sibling links for O(1) navigation.
108
+ */
116
109
  declare class TreeNodeMap<T = Record<string, unknown>> {
117
110
  /** All node IDs in DFS order. */
118
111
  readonly orderedIds: string[];
@@ -122,140 +115,126 @@ declare class TreeNodeMap<T = Record<string, unknown>> {
122
115
  private readonly map;
123
116
  constructor(data: TreeNode<T>[]);
124
117
  /**
125
- * Iterate over all entries.
126
- */
118
+ * Iterate over all entries.
119
+ */
127
120
  entries(): IterableIterator<[string, FlatNode<T>]>;
128
121
  /**
129
- * Get a flat node by ID.
130
- */
122
+ * Get a flat node by ID.
123
+ */
131
124
  get(id: string): FlatNode<T> | undefined;
132
125
  /**
133
- * Total number of nodes in the tree.
134
- */
126
+ * Total number of nodes in the tree.
127
+ */
135
128
  get size(): number;
136
129
  /**
137
- * Given a set of expanded node IDs, return the ordered list of
138
- * VISIBLE node IDs (i.e., a node is visible if all its ancestors
139
- * are expanded).
140
- *
141
- * Uses iterative DFS, skipping collapsed subtrees.
142
- */
130
+ * Given a set of expanded node IDs, return the ordered list of
131
+ * VISIBLE node IDs (i.e., a node is visible if all its ancestors
132
+ * are expanded).
133
+ *
134
+ * Uses iterative DFS, skipping collapsed subtrees.
135
+ */
143
136
  getVisibleIds(expandedIds: ReadonlySet<string>): string[];
144
137
  /**
145
- * Check if a node is a descendant of another node.
146
- */
138
+ * Check if a node is a descendant of another node.
139
+ */
147
140
  isDescendantOf(nodeId: string, ancestorId: string): boolean;
148
141
  /**
149
- * Insert dynamically-loaded children under a parent node.
150
- * Returns a new TreeNodeMap (immutable operation).
151
- *
152
- * Rebuilds the full tree from the current map state (not the original
153
- * input data), so successive calls for different parents are safe.
154
- */
142
+ * Insert dynamically-loaded children under a parent node.
143
+ * Returns a new TreeNodeMap (immutable operation).
144
+ *
145
+ * Rebuilds the full tree from the current map state (not the original
146
+ * input data), so successive calls for different parents are safe.
147
+ */
155
148
  withChildren(parentId: string, children: TreeNode<T>[]): TreeNodeMap<T>;
156
149
  private buildFromData;
157
150
  }
158
151
  type Props<T = Record<string, unknown>> = {
159
152
  /**
160
- * Accessible label for the tree container.
161
- * Useful when multiple tree views are on screen.
162
- * @default "Tree view"
163
- */
153
+ * Accessible label for the tree container.
154
+ * Useful when multiple tree views are on screen.
155
+ * @default "Tree view"
156
+ */
164
157
  readonly ariaLabel?: string;
165
158
  /**
166
- * The tree data. Array of root-level nodes.
167
- *
168
- * **Important:** Must be referentially stable across renders (e.g. stored
169
- * in state or wrapped in `useMemo`). Passing a new array reference on
170
- * every render will reset focus, expansion, and selection state.
171
- */
159
+ * The tree data. Array of root-level nodes.
160
+ *
161
+ * **Important:** Must be referentially stable across renders (e.g. stored
162
+ * in state or wrapped in `useMemo`). Passing a new array reference on
163
+ * every render will reset focus, expansion, and selection state.
164
+ */
172
165
  readonly data: TreeNode<T>[];
173
166
  /**
174
- * Set of node IDs that are expanded by default.
175
- * If not provided, all nodes start collapsed.
176
- */
167
+ * Set of node IDs that are expanded by default.
168
+ * If not provided, all nodes start collapsed.
169
+ */
177
170
  readonly defaultExpanded?: ReadonlySet<string> | "all";
178
171
  /**
179
- * Set of node IDs that are selected by default.
180
- */
172
+ * Set of node IDs that are selected by default.
173
+ */
181
174
  readonly defaultSelected?: ReadonlySet<string>;
182
175
  /**
183
- * When disabled, user input is ignored.
184
- * @default false
185
- */
176
+ * When disabled, user input is ignored.
177
+ * @default false
178
+ */
186
179
  readonly isDisabled?: boolean;
187
180
  /**
188
- * Async function to load children on demand.
189
- */
181
+ * Async function to load children on demand.
182
+ */
190
183
  readonly loadChildren?: AsyncChildrenFunction<T>;
191
184
  /** Called when expanded set changes. */
192
185
  readonly onExpandChange?: (expandedIds: ReadonlySet<string>) => void;
193
186
  /** Called when the focused node changes. */
194
187
  readonly onFocusChange?: (nodeId: string) => void;
195
188
  /**
196
- * Called when `loadChildren` rejects. Receives the node ID and error.
197
- */
189
+ * Called when `loadChildren` rejects. Receives the node ID and error.
190
+ */
198
191
  readonly onLoadError?: (nodeId: string, error: Error) => void;
199
192
  /** Called when selection changes. */
200
193
  readonly onSelectChange?: (selectedIds: ReadonlySet<string>) => void;
201
194
  /**
202
- * Custom node renderer. Receives node + state, returns Ink JSX.
203
- */
195
+ * Custom node renderer. Receives node + state, returns Ink JSX.
196
+ */
204
197
  readonly renderNode?: (props: TreeNodeRendererProps<T>) => ReactNode;
205
198
  /**
206
- * Selection mode.
207
- * - "none": No selection behavior (default).
208
- * - "single": One node can be selected at a time.
209
- * - "multiple": Multiple nodes can be selected (checkboxes shown).
210
- * @default "none"
211
- */
199
+ * Selection mode.
200
+ * - "none": No selection behavior (default).
201
+ * - "single": One node can be selected at a time.
202
+ * - "multiple": Multiple nodes can be selected (checkboxes shown).
203
+ * @default "none"
204
+ */
212
205
  readonly selectionMode?: SelectionMode;
213
206
  /**
214
- * Number of visible nodes in the viewport (for virtualization).
215
- * @default Infinity (no virtualization)
216
- */
207
+ * Number of visible nodes in the viewport (for virtualization).
208
+ * @default Infinity (no virtualization)
209
+ */
217
210
  readonly visibleNodeCount?: number;
218
211
  };
219
212
  /**
220
- * Renders an interactive tree view with keyboard navigation.
221
- *
222
- * ```tsx
223
- * &lt;TreeView
224
- * data={[
225
- * { id: "1", label: "Root", children: [
226
- * { id: "1.1", label: "Child" },
227
- * ]},
228
- * ]}
229
- * defaultExpanded="all"
230
- * />
231
- * ```
232
- */
233
- declare function TreeView<T = Record<string, unknown>>({
234
- ariaLabel,
235
- data,
236
- defaultExpanded,
237
- defaultSelected,
238
- isDisabled,
239
- loadChildren,
240
- onExpandChange,
241
- onFocusChange,
242
- onLoadError,
243
- onSelectChange,
244
- renderNode,
245
- selectionMode,
246
- visibleNodeCount
247
- }: Props<T>): ReactElement;
213
+ * Renders an interactive tree view with keyboard navigation.
214
+ *
215
+ * ```tsx
216
+ * &lt;TreeView
217
+ * data={[
218
+ * { id: "1", label: "Root", children: [
219
+ * { id: "1.1", label: "Child" },
220
+ * ]},
221
+ * ]}
222
+ * defaultExpanded="all"
223
+ * />
224
+ * ```
225
+ */
226
+ declare function TreeView<T = Record<string, unknown>>({ ariaLabel, data, defaultExpanded, defaultSelected, isDisabled, loadChildren, onExpandChange, onFocusChange, onLoadError, onSelectChange, renderNode, selectionMode, visibleNodeCount }: Props<T>): ReactElement;
248
227
  type UseTreeViewStateProps<T = Record<string, unknown>> = {
249
228
  /** The tree data. Array of root-level nodes. */
250
229
  readonly data: TreeNode<T>[];
251
230
  /**
252
- * Set of node IDs that are expanded by default.
253
- * If not provided, all nodes start collapsed.
254
- */
231
+ * Set of node IDs that are expanded by default.
232
+ * If not provided, all nodes start collapsed.
233
+ */
255
234
  readonly defaultExpanded?: ReadonlySet<string> | "all";
256
235
  /**
257
- * Set of node IDs that are selected by default.
258
- */
236
+ * Set of node IDs that are selected by default.
237
+ */
259
238
  readonly defaultSelected?: ReadonlySet<string>;
260
239
  /** Called when expanded set changes. */
261
240
  readonly onExpandChange?: (expandedIds: ReadonlySet<string>) => void;
@@ -264,14 +243,14 @@ type UseTreeViewStateProps<T = Record<string, unknown>> = {
264
243
  /** Called when selection changes. */
265
244
  readonly onSelectChange?: (selectedIds: ReadonlySet<string>) => void;
266
245
  /**
267
- * Selection mode.
268
- * @default "none"
269
- */
246
+ * Selection mode.
247
+ * @default "none"
248
+ */
270
249
  readonly selectionMode?: SelectionMode;
271
250
  /**
272
- * Number of visible nodes in the viewport (for virtualization).
273
- * @default Infinity
274
- */
251
+ * Number of visible nodes in the viewport (for virtualization).
252
+ * @default Infinity
253
+ */
275
254
  readonly visibleNodeCount?: number;
276
255
  };
277
256
  type TreeViewState<T = Record<string, unknown>> = {
@@ -307,44 +286,29 @@ type TreeViewState<T = Record<string, unknown>> = {
307
286
  readonly viewportToIndex: number;
308
287
  readonly visibleCount: number;
309
288
  };
310
- declare function useTreeViewState<T = Record<string, unknown>>({
311
- data,
312
- defaultExpanded,
313
- defaultSelected,
314
- onExpandChange,
315
- onFocusChange,
316
- onSelectChange,
317
- selectionMode,
318
- visibleNodeCount
319
- }: UseTreeViewStateProps<T>): TreeViewState<T>;
289
+ declare function useTreeViewState<T = Record<string, unknown>>({ data, defaultExpanded, defaultSelected, onExpandChange, onFocusChange, onSelectChange, selectionMode, visibleNodeCount }: UseTreeViewStateProps<T>): TreeViewState<T>;
320
290
  type UseTreeViewProps<T = Record<string, unknown>> = {
321
291
  /**
322
- * When disabled, user input is ignored.
323
- * @default false
324
- */
292
+ * When disabled, user input is ignored.
293
+ * @default false
294
+ */
325
295
  readonly isDisabled?: boolean;
326
296
  /**
327
- * Async function to load children on demand.
328
- */
297
+ * Async function to load children on demand.
298
+ */
329
299
  readonly loadChildren?: AsyncChildrenFunction<T>;
330
300
  /**
331
- * Called when `loadChildren` rejects.
332
- */
301
+ * Called when `loadChildren` rejects.
302
+ */
333
303
  readonly onLoadError?: (nodeId: string, error: Error) => void;
334
304
  /**
335
- * Selection mode.
336
- */
305
+ * Selection mode.
306
+ */
337
307
  readonly selectionMode: SelectionMode;
338
308
  /**
339
- * The tree view state from `useTreeViewState`.
340
- */
309
+ * The tree view state from `useTreeViewState`.
310
+ */
341
311
  readonly state: TreeViewState<T>;
342
312
  };
343
- declare function useTreeView<T>({
344
- isDisabled,
345
- loadChildren,
346
- onLoadError,
347
- selectionMode,
348
- state
349
- }: UseTreeViewProps<T>): void;
313
+ declare function useTreeView<T>({ isDisabled, loadChildren, onLoadError, selectionMode, state }: UseTreeViewProps<T>): void;
350
314
  export { AsyncChildrenFunction as A, FlatNode as F, Props as P, SelectionMode as S, TreeNode as T, UseTreeViewProps as U, TreeNodeMap as a, TreeNodeRendererProps as b, TreeNodeState as c, TreeView as d, TreeViewState as e, Theme as f, UseTreeViewStateProps as g, useTreeViewState as h, theme as t, useTreeView as u };
@@ -1,7 +1,7 @@
1
1
  import { ReactNode, ReactElement } from 'react';
2
2
  /**
3
- * Metadata about the current page state, passed to the render-prop children.
4
- */
3
+ * Metadata about the current page state, passed to the render-prop children.
4
+ */
5
5
  type PageMeta = {
6
6
  readonly currentPage: number;
7
7
  readonly endIndex: number;
@@ -12,58 +12,48 @@ type PageMeta = {
12
12
  };
13
13
  type Props<T> = {
14
14
  /**
15
- * Render-prop that receives the current page items and page metadata.
16
- */
15
+ * Render-prop that receives the current page items and page metadata.
16
+ */
17
17
  readonly children: (pageItems: ReadonlyArray<T>, meta: PageMeta) => ReactNode;
18
18
  /**
19
- * Uncontrolled initial page (0-indexed).
20
- * @default 0
21
- */
19
+ * Uncontrolled initial page (0-indexed).
20
+ * @default 0
21
+ */
22
22
  readonly defaultPage?: number;
23
23
  /**
24
- * Color for the active page indicator.
25
- * @default "cyan"
26
- */
24
+ * Color for the active page indicator.
25
+ * @default "cyan"
26
+ */
27
27
  readonly indicatorColor?: string;
28
28
  /**
29
- * Whether keyboard navigation is active.
30
- * @default true
31
- */
29
+ * Whether keyboard navigation is active.
30
+ * @default true
31
+ */
32
32
  readonly isFocused?: boolean;
33
33
  /**
34
- * The full list of items to paginate.
35
- */
34
+ * The full list of items to paginate.
35
+ */
36
36
  readonly items: ReadonlyArray<T>;
37
37
  /**
38
- * Called when the page changes.
39
- */
38
+ * Called when the page changes.
39
+ */
40
40
  readonly onChange?: (page: number) => void;
41
41
  /**
42
- * Controlled current page (0-indexed). When provided, the component is controlled.
43
- */
42
+ * Controlled current page (0-indexed). When provided, the component is controlled.
43
+ */
44
44
  readonly page?: number;
45
45
  /**
46
- * Number of items per page.
47
- */
46
+ * Number of items per page.
47
+ */
48
48
  readonly pageSize: number;
49
49
  /**
50
- * Indicator style.
51
- * - `"dots"`: `● ○ ○ ○`
52
- * - `"numeric"`: `‹ 1 / 4 ›`
53
- * - `"fraction"`: `1/4`
54
- * @default "dots"
55
- */
50
+ * Indicator style.
51
+ * - `"dots"`: `● ○ ○ ○`
52
+ * - `"numeric"`: `‹ 1 / 4 ›`
53
+ * - `"fraction"`: `1/4`
54
+ * @default "dots"
55
+ */
56
56
  readonly style?: "dots" | "fraction" | "numeric";
57
57
  };
58
- declare const Paginator: <T>({
59
- children,
60
- defaultPage,
61
- indicatorColor,
62
- isFocused,
63
- items,
64
- onChange,
65
- page: controlledPage,
66
- pageSize,
67
- style
68
- }: Props<T>) => ReactElement;
58
+ declare const Paginator: <T>({ children, defaultPage, indicatorColor, isFocused, items, onChange, page: controlledPage, pageSize, style }: Props<T>) => ReactElement;
69
59
  export { PageMeta, Paginator, type Props as PaginatorProps, Props, Paginator as default };
@@ -3,36 +3,30 @@ import { ReactNode, ReactElement } from 'react';
3
3
  import { LiteralUnion } from 'type-fest';
4
4
  type Props = {
5
5
  /**
6
- * Paragraph body.
7
- */
6
+ * Paragraph body.
7
+ */
8
8
  readonly children: ReactNode;
9
9
  /**
10
- * Foreground color.
11
- */
10
+ * Foreground color.
11
+ */
12
12
  readonly color?: LiteralUnion<AnsiColors, string>;
13
13
  /**
14
- * Render the paragraph with dim color.
15
- */
14
+ * Render the paragraph with dim color.
15
+ */
16
16
  readonly dimColor?: boolean;
17
17
  /**
18
- * Blank lines to add after the paragraph.
19
- * @default 1
20
- */
18
+ * Blank lines to add after the paragraph.
19
+ * @default 1
20
+ */
21
21
  readonly marginBottom?: number;
22
22
  /**
23
- * Blank lines to add before the paragraph.
24
- * @default 0
25
- */
23
+ * Blank lines to add before the paragraph.
24
+ * @default 0
25
+ */
26
26
  readonly marginTop?: number;
27
27
  };
28
28
  /**
29
- * Wraps body text with a trailing blank line. Useful for README-style layouts.
30
- */
31
- declare function Paragraph({
32
- children,
33
- color,
34
- dimColor,
35
- marginBottom,
36
- marginTop
37
- }: Props): ReactElement;
29
+ * Wraps body text with a trailing blank line. Useful for README-style layouts.
30
+ */
31
+ declare function Paragraph({ children, color, dimColor, marginBottom, marginTop }: Props): ReactElement;
38
32
  export { Paragraph, type Props as ParagraphProps, Props, Paragraph as default };
@@ -3,65 +3,54 @@ import { ReactElement } from 'react';
3
3
  import { LiteralUnion } from 'type-fest';
4
4
  type Props = {
5
5
  /**
6
- * Accent color for the focused border and caret.
7
- * @default "blue"
8
- */
6
+ * Accent color for the focused border and caret.
7
+ * @default "blue"
8
+ */
9
9
  readonly accentColor?: LiteralUnion<AnsiColors, string>;
10
10
  /**
11
- * Auto-focus on mount.
12
- */
11
+ * Auto-focus on mount.
12
+ */
13
13
  readonly autoFocus?: boolean;
14
14
  /**
15
- * Initial path when uncontrolled.
16
- */
15
+ * Initial path when uncontrolled.
16
+ */
17
17
  readonly defaultValue?: string;
18
18
  /**
19
- * Override how completions are produced (e.g. to sandbox or mock the
20
- * filesystem). Defaults to reading the real filesystem.
21
- */
19
+ * Override how completions are produced (e.g. to sandbox or mock the
20
+ * filesystem). Defaults to reading the real filesystem.
21
+ */
22
22
  readonly getCompletions?: (input: string) => ReadonlyArray<string>;
23
23
  /**
24
- * Disable input and dim the display.
25
- */
24
+ * Disable input and dim the display.
25
+ */
26
26
  readonly isDisabled?: boolean;
27
27
  /**
28
- * Fires whenever the path text changes.
29
- */
28
+ * Fires whenever the path text changes.
29
+ */
30
30
  readonly onChange?: (path: string) => void;
31
31
  /**
32
- * Fires on Enter with the current path.
33
- */
32
+ * Fires on Enter with the current path.
33
+ */
34
34
  readonly onSubmit?: (path: string) => void;
35
35
  /**
36
- * Placeholder shown when empty.
37
- * @default "Enter a path…"
38
- */
36
+ * Placeholder shown when empty.
37
+ * @default "Enter a path…"
38
+ */
39
39
  readonly placeholder?: string;
40
40
  /**
41
- * Show the first few completion candidates beneath the field.
42
- * @default true
43
- */
41
+ * Show the first few completion candidates beneath the field.
42
+ * @default true
43
+ */
44
44
  readonly showSuggestions?: boolean;
45
45
  /**
46
- * Controlled path. When provided, `defaultValue` is ignored.
47
- */
46
+ * Controlled path. When provided, `defaultValue` is ignored.
47
+ */
48
48
  readonly value?: string;
49
49
  };
50
50
  /**
51
- * A text input specialised for filesystem paths. Tab completes against the
52
- * directory being typed (cycling through matches on repeated presses), and a
53
- * short list of candidates is shown below the field.
54
- */
55
- declare function PathInput({
56
- accentColor,
57
- autoFocus,
58
- defaultValue,
59
- getCompletions,
60
- isDisabled,
61
- onChange,
62
- onSubmit,
63
- placeholder,
64
- showSuggestions,
65
- value: controlledValue
66
- }: Props): ReactElement;
51
+ * A text input specialised for filesystem paths. Tab completes against the
52
+ * directory being typed (cycling through matches on repeated presses), and a
53
+ * short list of candidates is shown below the field.
54
+ */
55
+ declare function PathInput({ accentColor, autoFocus, defaultValue, getCompletions, isDisabled, onChange, onSubmit, placeholder, showSuggestions, value: controlledValue }: Props): ReactElement;
67
56
  export { PathInput, type Props as PathInputProps, Props, PathInput as default };