@visulima/tui-kit 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/accordion.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/animate-presence.js +1 -1
- package/dist/approval-prompt.js +1 -1
- package/dist/area-chart.js +1 -1
- package/dist/badge.js +1 -1
- package/dist/bar-chart.js +1 -1
- package/dist/big-text.js +1 -1
- package/dist/blink-dot.js +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar.js +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox-group.js +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/code.js +2 -2
- package/dist/collapsible.js +1 -1
- package/dist/color-picker.js +1 -1
- package/dist/command-block.js +4 -4
- package/dist/command-palette.js +1 -1
- package/dist/confirm-dialog.js +1 -1
- package/dist/confirm-input.js +1 -1
- package/dist/console-overlay.js +1 -1
- package/dist/content-switcher.js +1 -1
- package/dist/controlled-scroll-view.d.ts +43 -3
- package/dist/controlled-scroll-view.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/definition-list.js +1 -1
- package/dist/dialog.d.ts +1 -1
- package/dist/dialog.js +1 -1
- package/dist/diff-view.js +1 -1
- package/dist/digits.js +1 -1
- package/dist/directory-tree.js +1 -1
- package/dist/divider.js +1 -1
- package/dist/drawer.js +1 -1
- package/dist/file-change.js +1 -1
- package/dist/file-picker-entry.d.ts +92 -2
- package/dist/file-picker-entry.js +1 -1
- package/dist/form.js +1 -1
- package/dist/gauge.js +1 -1
- package/dist/gradient.js +1 -1
- package/dist/grid.js +1 -1
- package/dist/heading.js +1 -1
- package/dist/heatmap.js +1 -1
- package/dist/help.js +1 -1
- package/dist/histogram.js +1 -1
- package/dist/image.js +1 -1
- package/dist/index.d.ts +25 -9
- package/dist/index.js +1 -1
- package/dist/json.js +1 -1
- package/dist/kbd.js +1 -1
- package/dist/line-chart.js +1 -1
- package/dist/link.js +1 -1
- package/dist/loading-indicator.js +1 -1
- package/dist/log.js +1 -1
- package/dist/markdown.js +1 -1
- package/dist/masked-input.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/message-bubble.js +1 -1
- package/dist/model-badge.js +1 -1
- package/dist/model-selector.js +1 -1
- package/dist/multi-progress.js +1 -1
- package/dist/multi-select.js +1 -1
- package/dist/notification-badge.js +1 -1
- package/dist/number-input.js +1 -1
- package/dist/operation-tree.js +1 -1
- package/dist/option-list.js +1 -1
- package/dist/ordered-list.js +1 -1
- package/dist/packem_shared/ControlledScrollView-soZtm3m7.js +1 -0
- package/dist/packem_shared/FilePicker-KGAg6v5x.js +1 -0
- package/dist/packem_shared/ScrollBar-arHRP6OT.js +1 -0
- package/dist/packem_shared/ScrollBarBox-C8wZ_Slk.js +1 -0
- package/dist/packem_shared/ScrollList-BCqHHps6.js +1 -0
- package/dist/packem_shared/ScrollView-Dt5E9Yl7.js +1 -0
- package/dist/packem_shared/TreeNodeMap-BK7nRlt0.js +1 -0
- package/dist/packem_shared/TreeView-BEZAFOfr.js +1 -0
- package/dist/packem_shared/controlled-scroll-view-BHCYjiKa.js +1 -0
- package/dist/packem_shared/line-chart-BqOUjZTt.js +1 -0
- package/dist/packem_shared/treeViewTheme-DuCcyBDe.js +1 -0
- package/dist/packem_shared/useTreeView-Dt_iWxVs.js +1 -0
- package/dist/packem_shared/useTreeViewState-aHwNZhIE.js +1 -0
- package/dist/packem_shared/{variant-config-BJqpNo7H.js → variant-config-BnAmf1rP.js} +1 -1
- package/dist/paginator.js +1 -1
- package/dist/paragraph.js +1 -1
- package/dist/path-input.js +1 -1
- package/dist/pie-chart.js +1 -1
- package/dist/placeholder.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/progress-bar.js +1 -1
- package/dist/progress-circle.js +1 -1
- package/dist/qr-code.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/scatter-plot.js +1 -1
- package/dist/scroll-bar-box.d.ts +13 -3
- package/dist/scroll-bar-box.js +1 -1
- package/dist/scroll-bar.d.ts +18 -3
- package/dist/scroll-bar.js +1 -1
- package/dist/scroll-list.d.ts +12 -3
- package/dist/scroll-list.js +1 -1
- package/dist/scroll-view.d.ts +98 -3
- package/dist/scroll-view.js +1 -1
- package/dist/search-input.js +1 -1
- package/dist/select-input-indicator.js +1 -1
- package/dist/select-input-item.js +1 -1
- package/dist/select-input.js +1 -1
- package/dist/shimmer-text.js +1 -1
- package/dist/sidebar.js +1 -1
- package/dist/slider.js +1 -1
- package/dist/sparkline.js +1 -1
- package/dist/spinner.js +1 -1
- package/dist/status-line.js +1 -1
- package/dist/status-message.js +1 -1
- package/dist/stepper.js +1 -1
- package/dist/stopwatch.js +1 -1
- package/dist/streaming-text.js +1 -1
- package/dist/switch.js +1 -1
- package/dist/tab.js +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tag-input.js +1 -1
- package/dist/tag.js +1 -1
- package/dist/text-input.js +1 -1
- package/dist/textarea.js +2 -2
- package/dist/thinking-block.js +1 -1
- package/dist/time-picker.js +1 -1
- package/dist/timer.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/token-usage.js +1 -1
- package/dist/tool-call.js +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/transition.js +1 -1
- package/dist/tree-select.js +1 -1
- package/dist/tree-view-entry.d.ts +314 -4
- package/dist/tree-view-entry.js +1 -1
- package/dist/unordered-list.js +1 -1
- package/dist/use-linked-scroll.d.ts +1 -1
- package/dist/use-linked-scroll.js +1 -1
- package/package.json +7 -7
- package/dist/packem_shared/ControlledScrollView-BzlbIUph.js +0 -1
- package/dist/packem_shared/FilePicker-V5H2fb-v.js +0 -1
- package/dist/packem_shared/ScrollBar-C9i3z3Ft.js +0 -1
- package/dist/packem_shared/ScrollBarBox-DZEC8YnV.js +0 -1
- package/dist/packem_shared/ScrollList-Djtb2vVy.js +0 -1
- package/dist/packem_shared/ScrollView-ESxpl6Hy.js +0 -1
- package/dist/packem_shared/TreeNodeMap-cJlYqckB.js +0 -1
- package/dist/packem_shared/TreeView-q0l446NV.js +0 -1
- package/dist/packem_shared/controlled-scroll-view-DerVKKv6.js +0 -1
- package/dist/packem_shared/controlled-scroll-view.d-D3kZZzjI.d.ts +0 -43
- package/dist/packem_shared/file-picker.d-CH7pccC7.d.ts +0 -92
- package/dist/packem_shared/line-chart-BbhMhcZg.js +0 -1
- package/dist/packem_shared/scroll-bar-box.d-CpTYEcTZ.d.ts +0 -13
- package/dist/packem_shared/scroll-bar.d-B4sD1hBR.d.ts +0 -18
- package/dist/packem_shared/scroll-list.d-CPCF0RwC.d.ts +0 -12
- package/dist/packem_shared/scroll-view.d-GZcgAHl4.d.ts +0 -98
- package/dist/packem_shared/treeViewTheme-Dq3ekRAC.js +0 -1
- package/dist/packem_shared/use-tree-view.d-DeMQ6G2r.d.ts +0 -314
- package/dist/packem_shared/useTreeView-D0JEqT6W.js +0 -1
- package/dist/packem_shared/useTreeViewState-BiTJakkh.js +0 -1
|
@@ -1,4 +1,314 @@
|
|
|
1
|
-
|
|
2
|
-
import '@visulima/tui/components/
|
|
3
|
-
import '
|
|
4
|
-
|
|
1
|
+
import { Props as Props$1 } from '@visulima/tui/components/box';
|
|
2
|
+
import { Props as Props$2 } from '@visulima/tui/components/text';
|
|
3
|
+
import { ReactNode, ReactElement } from 'react';
|
|
4
|
+
type StyleFunctionProps = {
|
|
5
|
+
readonly depth?: number;
|
|
6
|
+
readonly hasChildren?: boolean;
|
|
7
|
+
readonly isExpanded?: boolean;
|
|
8
|
+
readonly isFocused?: boolean;
|
|
9
|
+
readonly isLoading?: boolean;
|
|
10
|
+
readonly isSelected?: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const theme: {
|
|
13
|
+
styles: {
|
|
14
|
+
container: () => Props$1;
|
|
15
|
+
expandIndicator: (_props: StyleFunctionProps) => Props$2;
|
|
16
|
+
focusIndicator: () => Props$2;
|
|
17
|
+
indent: ({ depth }: StyleFunctionProps) => Props$1;
|
|
18
|
+
label: ({ isFocused, isSelected }: StyleFunctionProps) => Props$2;
|
|
19
|
+
loadingIndicator: () => Props$2;
|
|
20
|
+
node: ({ isFocused }: StyleFunctionProps) => Props$1;
|
|
21
|
+
selectedIndicator: () => Props$2;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
type Theme = typeof theme;
|
|
25
|
+
/**
|
|
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
|
+
*/
|
|
29
|
+
type TreeNode<T = Record<string, unknown>> = {
|
|
30
|
+
/** Child nodes. Undefined or empty array means leaf node. */
|
|
31
|
+
readonly children?: TreeNode<T>[];
|
|
32
|
+
/** Arbitrary user data attached to this node. */
|
|
33
|
+
readonly data?: T;
|
|
34
|
+
/** Unique identifier for this node. Used as the key for all lookups. */
|
|
35
|
+
readonly id: string;
|
|
36
|
+
/**
|
|
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
|
+
*/
|
|
42
|
+
readonly isParent?: boolean;
|
|
43
|
+
/** Display label. Used by the default renderer. */
|
|
44
|
+
readonly label: string;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* For async/lazy loading: a function that resolves children on demand.
|
|
48
|
+
*/
|
|
49
|
+
type AsyncChildrenFunction<T = Record<string, unknown>> = (node: TreeNode<T>) => Promise<TreeNode<T>[]>;
|
|
50
|
+
/**
|
|
51
|
+
* State passed to custom renderers and theme functions.
|
|
52
|
+
*/
|
|
53
|
+
type TreeNodeState = {
|
|
54
|
+
/** Depth of this node in the tree (root = 0). */
|
|
55
|
+
readonly depth: number;
|
|
56
|
+
/** Whether this node has children (or a lazy loader). */
|
|
57
|
+
readonly hasChildren: boolean;
|
|
58
|
+
/** Whether this node is expanded (children visible). */
|
|
59
|
+
readonly isExpanded: boolean;
|
|
60
|
+
/** Whether this node is currently focused (cursor is on it). */
|
|
61
|
+
readonly isFocused: boolean;
|
|
62
|
+
/** Whether children are currently loading (async mode). */
|
|
63
|
+
readonly isLoading: boolean;
|
|
64
|
+
/** Whether this node is selected (in select/multi-select mode). */
|
|
65
|
+
readonly isSelected: boolean;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Props received by a custom node renderer.
|
|
69
|
+
*/
|
|
70
|
+
type TreeNodeRendererProps<T = Record<string, unknown>> = {
|
|
71
|
+
/** The tree node data. */
|
|
72
|
+
readonly node: TreeNode<T>;
|
|
73
|
+
/** Current state of this node. */
|
|
74
|
+
readonly state: TreeNodeState;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Selection mode for the tree view.
|
|
78
|
+
*/
|
|
79
|
+
type SelectionMode = "multiple" | "none" | "single";
|
|
80
|
+
/**
|
|
81
|
+
* A flattened representation of a tree node with navigation links.
|
|
82
|
+
*/
|
|
83
|
+
type FlatNode<T = Record<string, unknown>> = {
|
|
84
|
+
/** Ordered list of direct children IDs. */
|
|
85
|
+
readonly childrenIds: ReadonlyArray<string>;
|
|
86
|
+
/** Depth in the tree (0 for roots). */
|
|
87
|
+
readonly depth: number;
|
|
88
|
+
/** Index in the flattened DFS order (across ALL nodes, not just visible). */
|
|
89
|
+
readonly flatIndex: number;
|
|
90
|
+
/** Whether this node has children. */
|
|
91
|
+
readonly hasChildren: boolean;
|
|
92
|
+
/** Next sibling's ID, or undefined. */
|
|
93
|
+
readonly nextSiblingId: string | undefined;
|
|
94
|
+
/** The original tree node. */
|
|
95
|
+
readonly node: TreeNode<T>;
|
|
96
|
+
/** Parent's id, or undefined if root. */
|
|
97
|
+
readonly parentId: string | undefined;
|
|
98
|
+
/** Previous sibling's ID, or undefined. */
|
|
99
|
+
readonly previousSiblingId: string | undefined;
|
|
100
|
+
/** Total number of siblings (including this node). */
|
|
101
|
+
readonly siblingCount: number;
|
|
102
|
+
/** Zero-based index among siblings. */
|
|
103
|
+
readonly siblingIndex: number;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* A flattened map of all tree nodes built via DFS traversal.
|
|
107
|
+
* Stores parent/child/sibling links for O(1) navigation.
|
|
108
|
+
*/
|
|
109
|
+
declare class TreeNodeMap<T = Record<string, unknown>> {
|
|
110
|
+
/** All node IDs in DFS order. */
|
|
111
|
+
readonly orderedIds: string[];
|
|
112
|
+
/** Root-level node IDs. */
|
|
113
|
+
readonly rootIds: string[];
|
|
114
|
+
/** Map from node ID to FlatNode. */
|
|
115
|
+
private readonly map;
|
|
116
|
+
constructor(data: TreeNode<T>[]);
|
|
117
|
+
/**
|
|
118
|
+
* Iterate over all entries.
|
|
119
|
+
*/
|
|
120
|
+
entries(): IterableIterator<[string, FlatNode<T>]>;
|
|
121
|
+
/**
|
|
122
|
+
* Get a flat node by ID.
|
|
123
|
+
*/
|
|
124
|
+
get(id: string): FlatNode<T> | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* Total number of nodes in the tree.
|
|
127
|
+
*/
|
|
128
|
+
get size(): number;
|
|
129
|
+
/**
|
|
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
|
+
*/
|
|
136
|
+
getVisibleIds(expandedIds: ReadonlySet<string>): string[];
|
|
137
|
+
/**
|
|
138
|
+
* Check if a node is a descendant of another node.
|
|
139
|
+
*/
|
|
140
|
+
isDescendantOf(nodeId: string, ancestorId: string): boolean;
|
|
141
|
+
/**
|
|
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
|
+
*/
|
|
148
|
+
withChildren(parentId: string, children: TreeNode<T>[]): TreeNodeMap<T>;
|
|
149
|
+
private buildFromData;
|
|
150
|
+
}
|
|
151
|
+
type Props<T = Record<string, unknown>> = {
|
|
152
|
+
/**
|
|
153
|
+
* Accessible label for the tree container.
|
|
154
|
+
* Useful when multiple tree views are on screen.
|
|
155
|
+
* @default "Tree view"
|
|
156
|
+
*/
|
|
157
|
+
readonly ariaLabel?: string;
|
|
158
|
+
/**
|
|
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
|
+
*/
|
|
165
|
+
readonly data: TreeNode<T>[];
|
|
166
|
+
/**
|
|
167
|
+
* Set of node IDs that are expanded by default.
|
|
168
|
+
* If not provided, all nodes start collapsed.
|
|
169
|
+
*/
|
|
170
|
+
readonly defaultExpanded?: ReadonlySet<string> | "all";
|
|
171
|
+
/**
|
|
172
|
+
* Set of node IDs that are selected by default.
|
|
173
|
+
*/
|
|
174
|
+
readonly defaultSelected?: ReadonlySet<string>;
|
|
175
|
+
/**
|
|
176
|
+
* When disabled, user input is ignored.
|
|
177
|
+
* @default false
|
|
178
|
+
*/
|
|
179
|
+
readonly isDisabled?: boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Async function to load children on demand.
|
|
182
|
+
*/
|
|
183
|
+
readonly loadChildren?: AsyncChildrenFunction<T>;
|
|
184
|
+
/** Called when expanded set changes. */
|
|
185
|
+
readonly onExpandChange?: (expandedIds: ReadonlySet<string>) => void;
|
|
186
|
+
/** Called when the focused node changes. */
|
|
187
|
+
readonly onFocusChange?: (nodeId: string) => void;
|
|
188
|
+
/**
|
|
189
|
+
* Called when `loadChildren` rejects. Receives the node ID and error.
|
|
190
|
+
*/
|
|
191
|
+
readonly onLoadError?: (nodeId: string, error: Error) => void;
|
|
192
|
+
/** Called when selection changes. */
|
|
193
|
+
readonly onSelectChange?: (selectedIds: ReadonlySet<string>) => void;
|
|
194
|
+
/**
|
|
195
|
+
* Custom node renderer. Receives node + state, returns Ink JSX.
|
|
196
|
+
*/
|
|
197
|
+
readonly renderNode?: (props: TreeNodeRendererProps<T>) => ReactNode;
|
|
198
|
+
/**
|
|
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
|
+
*/
|
|
205
|
+
readonly selectionMode?: SelectionMode;
|
|
206
|
+
/**
|
|
207
|
+
* Number of visible nodes in the viewport (for virtualization).
|
|
208
|
+
* @default Infinity (no virtualization)
|
|
209
|
+
*/
|
|
210
|
+
readonly visibleNodeCount?: number;
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* Renders an interactive tree view with keyboard navigation.
|
|
214
|
+
*
|
|
215
|
+
* ```tsx
|
|
216
|
+
* <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;
|
|
227
|
+
type UseTreeViewStateProps<T = Record<string, unknown>> = {
|
|
228
|
+
/** The tree data. Array of root-level nodes. */
|
|
229
|
+
readonly data: TreeNode<T>[];
|
|
230
|
+
/**
|
|
231
|
+
* Set of node IDs that are expanded by default.
|
|
232
|
+
* If not provided, all nodes start collapsed.
|
|
233
|
+
*/
|
|
234
|
+
readonly defaultExpanded?: ReadonlySet<string> | "all";
|
|
235
|
+
/**
|
|
236
|
+
* Set of node IDs that are selected by default.
|
|
237
|
+
*/
|
|
238
|
+
readonly defaultSelected?: ReadonlySet<string>;
|
|
239
|
+
/** Called when expanded set changes. */
|
|
240
|
+
readonly onExpandChange?: (expandedIds: ReadonlySet<string>) => void;
|
|
241
|
+
/** Called when the focused node changes. */
|
|
242
|
+
readonly onFocusChange?: (nodeId: string) => void;
|
|
243
|
+
/** Called when selection changes. */
|
|
244
|
+
readonly onSelectChange?: (selectedIds: ReadonlySet<string>) => void;
|
|
245
|
+
/**
|
|
246
|
+
* Selection mode.
|
|
247
|
+
* @default "none"
|
|
248
|
+
*/
|
|
249
|
+
readonly selectionMode?: SelectionMode;
|
|
250
|
+
/**
|
|
251
|
+
* Number of visible nodes in the viewport (for virtualization).
|
|
252
|
+
* @default Infinity
|
|
253
|
+
*/
|
|
254
|
+
readonly visibleNodeCount?: number;
|
|
255
|
+
};
|
|
256
|
+
type TreeViewState<T = Record<string, unknown>> = {
|
|
257
|
+
readonly collapse: () => void;
|
|
258
|
+
readonly collapseAll: () => void;
|
|
259
|
+
readonly collapseNode: (nodeId: string) => void;
|
|
260
|
+
readonly expand: () => void;
|
|
261
|
+
readonly expandAll: () => void;
|
|
262
|
+
readonly expandedIds: ReadonlySet<string>;
|
|
263
|
+
readonly expandNode: (nodeId: string) => void;
|
|
264
|
+
readonly focusedId: string | undefined;
|
|
265
|
+
readonly focusFirst: () => void;
|
|
266
|
+
readonly focusFirstChild: () => void;
|
|
267
|
+
readonly focusLast: () => void;
|
|
268
|
+
readonly focusNext: () => void;
|
|
269
|
+
readonly focusParent: () => void;
|
|
270
|
+
readonly focusPrevious: () => void;
|
|
271
|
+
readonly hasScrollDown: boolean;
|
|
272
|
+
readonly hasScrollUp: boolean;
|
|
273
|
+
readonly insertChildren: (parentId: string, children: TreeNode<T>[]) => void;
|
|
274
|
+
readonly loadingIds: ReadonlySet<string>;
|
|
275
|
+
readonly nodeMap: TreeNodeMap<T>;
|
|
276
|
+
readonly select: () => void;
|
|
277
|
+
readonly selectedIds: ReadonlySet<string>;
|
|
278
|
+
readonly setChildrenError: (nodeId: string) => void;
|
|
279
|
+
readonly setLoading: (nodeId: string, isLoading: boolean) => void;
|
|
280
|
+
readonly toggleExpanded: () => void;
|
|
281
|
+
readonly viewportFromIndex: number;
|
|
282
|
+
readonly viewportNodes: {
|
|
283
|
+
node: TreeNode<T>;
|
|
284
|
+
state: TreeNodeState;
|
|
285
|
+
}[];
|
|
286
|
+
readonly viewportToIndex: number;
|
|
287
|
+
readonly visibleCount: number;
|
|
288
|
+
};
|
|
289
|
+
declare function useTreeViewState<T = Record<string, unknown>>({ data, defaultExpanded, defaultSelected, onExpandChange, onFocusChange, onSelectChange, selectionMode, visibleNodeCount }: UseTreeViewStateProps<T>): TreeViewState<T>;
|
|
290
|
+
type UseTreeViewProps<T = Record<string, unknown>> = {
|
|
291
|
+
/**
|
|
292
|
+
* When disabled, user input is ignored.
|
|
293
|
+
* @default false
|
|
294
|
+
*/
|
|
295
|
+
readonly isDisabled?: boolean;
|
|
296
|
+
/**
|
|
297
|
+
* Async function to load children on demand.
|
|
298
|
+
*/
|
|
299
|
+
readonly loadChildren?: AsyncChildrenFunction<T>;
|
|
300
|
+
/**
|
|
301
|
+
* Called when `loadChildren` rejects.
|
|
302
|
+
*/
|
|
303
|
+
readonly onLoadError?: (nodeId: string, error: Error) => void;
|
|
304
|
+
/**
|
|
305
|
+
* Selection mode.
|
|
306
|
+
*/
|
|
307
|
+
readonly selectionMode: SelectionMode;
|
|
308
|
+
/**
|
|
309
|
+
* The tree view state from `useTreeViewState`.
|
|
310
|
+
*/
|
|
311
|
+
readonly state: TreeViewState<T>;
|
|
312
|
+
};
|
|
313
|
+
declare function useTreeView<T>({ isDisabled, loadChildren, onLoadError, selectionMode, state }: UseTreeViewProps<T>): void;
|
|
314
|
+
export { type AsyncChildrenFunction, type FlatNode, type SelectionMode, type TreeNode, TreeNodeMap, type TreeNodeRendererProps, type TreeNodeState, TreeView, type Props as TreeViewProps, type TreeViewState, type Theme as TreeViewTheme, type UseTreeViewProps, type UseTreeViewStateProps, theme as treeViewTheme, useTreeView, useTreeViewState };
|
package/dist/tree-view-entry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{theme as o}from"./packem_shared/treeViewTheme-
|
|
1
|
+
import{theme as o}from"./packem_shared/treeViewTheme-DuCcyBDe.js";import{TreeNodeMap as m}from"./packem_shared/TreeNodeMap-BK7nRlt0.js";import{TreeView as f}from"./packem_shared/TreeView-BEZAFOfr.js";import{useTreeView as T}from"./packem_shared/useTreeView-Dt_iWxVs.js";import{useTreeViewState as w}from"./packem_shared/useTreeViewState-aHwNZhIE.js";export{m as TreeNodeMap,f as TreeView,o as treeViewTheme,T as useTreeView,w as useTreeViewState};
|
package/dist/unordered-list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t,jsxs as l}from"react/jsx-runtime";import i from"@visulima/tui/components/box";import c from"@visulima/tui/components/text";const u=["─","◦","▪"],h=r=>typeof r=="string"?[r]:Array.isArray(r)?r:u,s=(r,n,e)=>{const d=n[e%n.length]??"─";return t(i,{flexDirection:"column",children:r.map((o,f)=>l(i,{gap:1,children:[t(c,{dimColor:!0,children:d}),l(i,{flexDirection:"column",children:[t(c,{children:o.label}),o.children?s(o.children,n,e+1):void 0]})]},f))})};function m({items:r,marker:n}){const e=h(n);return s(r,e,0)}export{m as UnorderedList,m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useRef as
|
|
1
|
+
import{useRef as c,useState as u,useEffect as a,useCallback as i}from"react";const p=()=>{const r=new Set;let t=!1;return{useLinkedScroll:()=>{const l=c(null),[,f]=u(0),n={ref:l,setOffset:()=>{f(e=>e+1)}},s=c(n);return s.current=n,a(()=>{const{current:e}=s;return r.add(e),()=>{r.delete(e)}},[]),{onScroll:i(e=>{if(!t){t=!0;try{for(const o of r)o.ref!==l&&o.ref.current?.scrollTo(e)}finally{t=!1}}},[]),ref:l}}}};export{p as createLinkedScrollGroup,p as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/tui-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
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",
|
|
@@ -506,19 +506,19 @@
|
|
|
506
506
|
"@visulima/ansi": "4.1.0",
|
|
507
507
|
"@visulima/colorize": "2.1.1",
|
|
508
508
|
"@visulima/spinner": "1.0.1",
|
|
509
|
-
"type-fest": "5.
|
|
509
|
+
"type-fest": "5.8.0"
|
|
510
510
|
},
|
|
511
511
|
"peerDependencies": {
|
|
512
|
-
"@shikijs/langs": "^4.3
|
|
513
|
-
"@shikijs/themes": "^4.3
|
|
512
|
+
"@shikijs/langs": "^4.4.3",
|
|
513
|
+
"@shikijs/themes": "^4.4.3",
|
|
514
514
|
"@visulima/tabular": "4.1.0",
|
|
515
|
-
"@visulima/tui": "4.0.
|
|
515
|
+
"@visulima/tui": "4.0.1",
|
|
516
516
|
"cfonts": "^3.3.1",
|
|
517
517
|
"diff": "^9.0.0",
|
|
518
|
-
"marked": "^18.0.
|
|
518
|
+
"marked": "^18.0.9",
|
|
519
519
|
"qrcode": "^1.5.4",
|
|
520
520
|
"react": "^19.2.6",
|
|
521
|
-
"shiki": "^4.3
|
|
521
|
+
"shiki": "^4.4.3"
|
|
522
522
|
},
|
|
523
523
|
"peerDependenciesMeta": {
|
|
524
524
|
"@shikijs/langs": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"react/jsx-runtime";import"@visulima/tui";import"@visulima/tui/components/box";import"react";import{C as l}from"./controlled-scroll-view-DerVKKv6.js";export{l as ControlledScrollView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as h,jsx as y}from"react/jsx-runtime";import z from"@visulima/tui/components/box";import m from"@visulima/tui/components/text";import R from"@visulima/tui/hooks/use-input";import{useState as g,useRef as B,useEffect as G,useCallback as $}from"react";import{Spinner as W}from"../spinner.js";import{readdir as q,stat as I}from"node:fs/promises";import{resolve as A,join as H,dirname as K,extname as N}from"node:path";function _(r){const o=d=>`${d&4?"r":"-"}${d&2?"w":"-"}${d&1?"x":"-"}`;return`${o(r>>6&7)}${o(r>>3&7)}${o(r&7)}`}function J(r,o){if(!(o.showHidden??!1)&&r.isHidden||!(o.showDirectories??!0)&&r.isDirectory||!(o.showFiles??!0)&&!r.isDirectory)return!1;if(o.extensions&&o.extensions.length>0&&!r.isDirectory){const d=N(r.name);if(!o.extensions.includes(d))return!1}return!0}function O(r){const{filter:o,initialPath:d}=r,[u,w]=g(()=>A(d)),[b,c]=g([]),[x,D]=g(!0),[F,C]=g(),[P,t]=g(0),M=B(o);M.current=o,G(()=>{let n=!1;return(async()=>{D(!0),C(void 0);try{const s=await q(u,{withFileTypes:!0}),v=await Promise.all(s.map(async e=>{try{return await I(H(u,e.name))}catch{return}})),S=s.map((e,i)=>{const E=H(u,e.name),L=e.isDirectory(),T=e.name.startsWith("."),U=v[i],j=U?.size??0,k=U?_(U.mode):"---------";return{isDirectory:L,isHidden:T,name:e.name,path:E,permissions:k,size:j}});if(n)return;const a=S.filter(e=>J(e,M.current));a.sort((e,i)=>e.isDirectory!==i.isDirectory?e.isDirectory?-1:1:e.name.localeCompare(i.name,void 0,{sensitivity:"base"})),c(a)}catch(s){n||(C(s instanceof Error?s.message:String(s)),c([]))}finally{n||D(!1)}})().catch(()=>{}),()=>{n=!0}},[u,P]);const l=$(n=>{w(A(n))},[]),f=$(()=>{w(n=>{const s=K(n);return s===n?n:s})},[]),p=$(()=>{t(n=>n+1)},[]);return{currentPath:u,entries:b,error:F,goUp:f,isLoading:x,navigateTo:l,refresh:p}}function Q(r){return r<1024?`${r}B`:r<1024*1024?`${(r/1024).toFixed(1)}K`:r<1024*1024*1024?`${(r/(1024*1024)).toFixed(1)}M`:`${(r/(1024*1024*1024)).toFixed(1)}G`}const V={},X=()=>process.cwd(),se=({accentColor:r="cyan",directoryColor:o="blue",fileColor:d="white",filter:u=V,initialPath:w,isFocused:b=!0,limit:c=10,onCancel:x,onSelect:D,showPermissions:F=!1,showSize:C=!1})=>{const P=w??X(),t=O({filter:u,initialPath:P}),[M,l]=g(0),f=Math.max(0,t.entries.length-1),p=Math.min(M,f);R($((a,e)=>{if(e.upArrow)l(i=>Math.max(0,i-1));else if(e.downArrow)l(i=>Math.min(f,i+1));else if(e.return){const i=t.entries[p];i&&(i.isDirectory?(t.navigateTo(i.path),l(0)):D?.(i))}else e.backspace||e.leftArrow?(t.goUp(),l(0)):e.escape?x?.():a==="."?t.refresh():e.pageUp?l(i=>Math.max(0,i-c)):e.pageDown?l(i=>Math.min(f,i+c)):e.home?l(0):e.end&&l(f)},[f,p,t,c,D,x]),{isActive:b});const n=Math.floor(c/2);let s=Math.max(0,p-n);const v=Math.min(t.entries.length,s+c);s=Math.max(0,v-c);const S=t.entries.slice(s,v);return h(z,{flexDirection:"column",children:[y(m,{bold:!0,dimColor:!0,children:t.currentPath}),t.isLoading&&h(z,{children:[y(W,{}),y(m,{children:" Loading..."})]}),t.error&&h(m,{color:"red",children:["Error:",t.error]}),!t.isLoading&&!t.error&&t.entries.length===0&&y(m,{dimColor:!0,children:"(empty directory)"}),S.map((a,e)=>{const i=s+e===p,E=a.isDirectory?"📁 ":"📄 ",L=a.isDirectory?o:d;return h(z,{children:[y(m,{color:i?r:void 0,children:i?"▸ ":" "}),y(m,{children:E}),h(m,{bold:a.isDirectory,color:i?r:L,children:[a.name,a.isDirectory?"/":""]}),C&&!a.isDirectory&&h(m,{dimColor:!0,children:[" ",Q(a.size)]}),F&&h(m,{dimColor:!0,children:[" ",a.permissions]})]},a.name)}),t.entries.length>c&&h(m,{dimColor:!0,children:[p+1,"/",t.entries.length]})]})};export{se as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as i,jsxs as I}from"react/jsx-runtime";import H from"@visulima/tui/components/box";import p from"@visulima/tui/components/text";import{useMemo as N}from"react";const S={arrow:{lowerThumb:"╽",thumb:"┃",track:"|",upperThumb:"╿"},block:{thumb:"█",track:"░"},bold:{lowerThumb:"╿",thumb:"│",track:"┃",upperThumb:"╽"},classic:{thumb:"┃",track:"|"},dots:{thumb:"●",track:"·"},double:{thumb:"┃",track:"║"},doubleSingle:{lowerThumb:"╽",thumb:"┃",track:"│",upperThumb:"╿"},line:{thumb:"│",track:" "},round:{lowerThumb:"╽",thumb:"┃",track:"│",upperThumb:"╿"},single:{lowerThumb:"╽",thumb:"┃",track:"│",upperThumb:"╿"},singleDouble:{thumb:"┃",track:"║"},thick:{thumb:"┃",track:"╏"}},j={arrow:{bottomLeft:"└",bottomRight:"┘",topLeft:"┌",topRight:"┐"},bold:{bottomLeft:"┗",bottomRight:"┛",topLeft:"┏",topRight:"┓"},classic:{bottomLeft:"+",bottomRight:"+",topLeft:"+",topRight:"+"},double:{bottomLeft:"╚",bottomRight:"╝",topLeft:"╔",topRight:"╗"},doubleSingle:{bottomLeft:"╘",bottomRight:"╛",topLeft:"╒",topRight:"╕"},round:{bottomLeft:"╰",bottomRight:"╯",topLeft:"╭",topRight:"╮"},single:{bottomLeft:"└",bottomRight:"┘",topLeft:"┌",topRight:"┐"},singleDouble:{bottomLeft:"╙",bottomRight:"╜",topLeft:"╓",topRight:"╖"}},Y=t=>S[typeof t=="string"?t:"single"]??S.single??{thumb:"┃",track:"│"},_=t=>j[typeof t=="string"?t:"single"]??j.single??{bottomLeft:"└",bottomRight:"┘",topLeft:"┌",topRight:"┐"},J=({autoHide:t=!1,color:m,contentHeight:L,dimColor:l,placement:c="right",scrollOffset:R,style:n,thumbChar:k,trackChar:w,viewportHeight:e})=>{const f=N(()=>{const r=Math.max(L,e);if(t&&r<=e)return null;const o=Y(n),a=k??o.thumb,q=w??o.track,x=e*2,v=Math.min(e/r,1),T=Math.max(2,Math.round(x*v)),M=r-e,A=M>0?Math.min(Math.max(R/M,0),1):0,E=x-T,g=Math.round(A*E),C=g+T,h=[];for(let b=0;b<e;b+=1){const D=b*2,y=b*2+1,s=D>=g&&D<C,d=y>=g&&y<C;s&&d?h.push(a):s&&!d?h.push(o.lowerThumb??a):!s&&d?h.push(o.upperThumb??a):h.push(q)}return h},[L,e,R,n,k,w,t]);if(f===null)return null;if(c==="inset")return i(H,{flexDirection:"column",flexShrink:0,width:1,children:f.map((r,o)=>i(p,{color:m,dimColor:l,children:r},o))});const u=_(n),B=c==="left"?u.topLeft:u.topRight,O=c==="left"?u.bottomLeft:u.bottomRight;return I(H,{flexDirection:"column",flexShrink:0,width:1,children:[i(p,{color:m,dimColor:l,children:B}),f.map((r,o)=>i(p,{color:m,dimColor:l,children:r},o)),i(p,{color:m,dimColor:l,children:O})]})};export{J as ScrollBar};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as D,jsx as l}from"react/jsx-runtime";import b from"@visulima/tui/components/box";import{ScrollBar as g}from"./ScrollBar-C9i3z3Ft.js";const S=({borderColor:r,borderDimColor:e,borderLeftColor:a,borderLeftDimColor:C,borderRightColor:p,borderRightDimColor:H,borderStyle:t="single",children:u,contentHeight:i,height:w,scrollBarAutoHide:h=!1,scrollBarPosition:x="right",scrollOffset:d,thumbChar:c,viewportHeight:f,...B})=>{const o=x==="left",s=o?"left":"right",m=o?a??r:p??r,n=o?C??e:H??e;return D(b,{flexDirection:"row",height:w,...B,children:[o&&l(g,{autoHide:h,color:m,contentHeight:i,dimColor:n,placement:s,scrollOffset:d,style:t,thumbChar:c,viewportHeight:f}),l(b,{borderColor:r,borderDimColor:e,borderLeft:!o,borderRight:o,borderStyle:t,flexGrow:1,overflow:"hidden",children:u}),!o&&l(g,{autoHide:h,color:m,contentHeight:i,dimColor:n,placement:s,scrollOffset:d,style:t,thumbChar:c,viewportHeight:f})]})};export{S as ScrollBarBox};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as X}from"react/jsx-runtime";import Y from"@visulima/tui/hooks/use-scroll-input";import{useRef as d,useState as N,useEffect as y,useCallback as g,useImperativeHandle as Q}from"react";import{C as U}from"./controlled-scroll-view-DerVKKv6.js";const et=O=>{const{children:P,keyboard:A=!1,onContentHeightChange:V,onItemHeightChange:B,onScroll:T,onViewportSizeChange:b,overscan:E,ref:L,scrollAlignment:h="auto",selectedIndex:p,vimBindings:R=!1,virtualize:j,...q}=O,n=d(null),[s,D]=N(0),C=d(0);y(()=>{C.current=s},[s]);const o=g(t=>{t!==C.current&&(D(t),T?.(t))},[T]),a=d(p);a.current=p;const S=g(()=>{const t=a.current;if(t===void 0||t<0)return null;const e=n.current?.getItemPosition(t);if(!e)return null;const i=n.current?.getViewportHeight()??0,l=n.current?.getContentHeight()??0;let r=e.top+e.height-i,c=e.top;r>c&&([r,c]=[c,r]);const M=Math.max(0,l-i);return{max:Math.min(M,c),min:Math.max(0,r)}},[]),u=g(t=>{const e=n.current?.getContentHeight()??0,i=n.current?.getViewportHeight()??0,l=Math.max(0,e-i);let r=Math.max(0,Math.min(t,l));const c=S();return c&&(r=Math.max(c.min,Math.min(r,c.max))),r},[S]),m=g((t,e,i,l)=>{const r=n.current?.getItemPosition(t);if(!r)return e;const c=l??n.current?.getViewportHeight()??0,M=n.current?.getContentHeight()??0;let f=e;switch(i){case"bottom":{f=r.top+r.height-c;break}case"center":{f=r.top+r.height/2-c/2;break}case"top":{f=r.top;break}default:{const w=r.top+r.height;r.top<=e&&w>=e+c?f=e:r.top<e?f=r.top:w>e+c&&(f=w-c)}}const W=Math.max(0,M-c);return Math.max(0,Math.min(f,W))},[]);let H=s;p!==void 0&&p>=0&&(H=m(p,s,h)),y(()=>{H!==s&&o(H)},[H,s,o]);const k=g((t,e)=>{if(a.current!==void 0&&a.current>=0){const i=m(a.current,s,h,t.height);o(i)}b?.(t,e)},[b,m,s,h,o]),F=g((t,e,i)=>{const l=a.current;if(l!==void 0&&l>=0){if(t<l){const r=u(s+(e-i));o(r)}else if(t===l){const r=m(t,s,h);o(r)}}B?.(t,e,i)},[B,m,h,s,u,o]),G=g((t,e)=>{if(a.current!==void 0&&a.current>=0){const i=m(a.current,s,h);o(i)}V?.(t,e)},[V,m,s,h,o]),z=d(0),x=g(t=>{const e=C.current,i=u(e+t);o(i)},[u,o]),v=g(()=>{const t=n.current?.getContentHeight()??0,e=n.current?.getViewportHeight()??0,i=Math.max(0,t-e),l=u(i);o(l)},[u,o]),I=g(()=>{const t=u(0);o(t)},[u,o]),J=g(()=>z.current,[]);Y({getViewportHeight:J,isActive:A,scrollBy:x,scrollToBottom:v,scrollToTop:I,vimBindings:R}),Q(L,()=>({getBottomOffset:()=>n.current?.getBottomOffset()??0,getContentHeight:()=>n.current?.getContentHeight()??0,getItemHeight:t=>n.current?.getItemHeight(t)??0,getItemPosition:t=>n.current?.getItemPosition(t)??null,getScrollOffset:()=>C.current,getViewportHeight:()=>n.current?.getViewportHeight()??0,remeasure:()=>n.current?.remeasure(),remeasureItem:t=>n.current?.remeasureItem(t),scrollBy:x,scrollTo:t=>{const e=u(t);o(e)},scrollToBottom:v,scrollToTop:I}),[u,o,x,v,I]);const K=g((t,e)=>{z.current=t.height,k(t,e)},[k]);return X(U,{onContentHeightChange:G,onItemHeightChange:F,onViewportSizeChange:K,overscan:E,ref:n,scrollOffset:H,virtualize:j,...q,children:P})};export{et as ScrollList};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as X,jsx as v}from"react/jsx-runtime";import _ from"@visulima/tui/components/box";import $ from"@visulima/tui/hooks/use-scroll-input";import{useRef as h,useState as q,useCallback as o,useImperativeHandle as ee}from"react";import{f as re,C as E}from"./controlled-scroll-view-DerVKKv6.js";import{ScrollBar as te}from"./ScrollBar-C9i3z3Ft.js";const se=({children:I,debug:M=!1,followOutput:T=!1,followThreshold:z=3,keyboard:F=!1,onContentHeightChange:B,onItemHeightChange:y,onReachEnd:g,onReachStart:p,onScroll:V,onViewportSizeChange:N,overscan:O,reachThreshold:a=5,ref:K,scrollbar:W=!1,scrollbarColor:Y,scrollbarStyle:Z="line",vimBindings:J=!1,virtualize:G,...m})=>{const[d,k,n]=re(0),c=h(null),s=h(0),l=h(0),[P,L]=q(0),[x,Q]=q(0),C=h(!1),w=h(!1),i=o(()=>Math.max(0,s.current-l.current),[]),j=o(e=>{const t=i();g&&e>=t-a&&!C.current?(C.current=!0,g()):e<t-a&&(C.current=!1),p&&e<=a&&!w.current?(w.current=!0,p()):e>a&&(w.current=!1)},[g,p,a,i]),r=o(e=>{e!==n()&&(k(e),V?.(e),j(e))},[n,k,V,j]),A=o((e,t)=>{const u=n()>=i()-z;if(s.current=e,L(e),B?.(e,t),T&&u&&e>t){const f=Math.max(0,e-l.current);r(f)}else{const f=Math.max(0,e-l.current);n()>f&&r(f)}},[B,T,z,n,i,r]),D=o((e,t)=>{l.current=e.height,Q(e.height),N?.(e,t)},[N]),H=o(e=>{if(typeof e!="number"||Number.isNaN(e))return;const t=Math.max(0,s.current-l.current),u=Math.max(0,Math.min(n()+e,t));r(u)},[n,r]),R=o(e=>{if(typeof e!="number"||Number.isNaN(e))return;const t=Math.max(0,s.current-l.current),u=Math.max(0,Math.min(e,t));r(u)},[r]),b=o(()=>{const e=i();r(e)},[i,r]),S=o(()=>{r(0)},[r]),U=o(()=>l.current,[]);return $({getViewportHeight:U,isActive:F,scrollBy:H,scrollToBottom:b,scrollToTop:S,vimBindings:J}),ee(K,()=>({getBottomOffset:i,getContentHeight:()=>s.current,getItemHeight:e=>c.current?.getItemHeight(e)??0,getItemPosition:e=>c.current?.getItemPosition(e)??null,getScrollOffset:n,getViewportHeight:()=>l.current,remeasure:()=>c.current?.remeasure(),remeasureItem:e=>c.current?.remeasureItem(e),scrollBy:H,scrollTo:R,scrollToBottom:b,scrollToTop:S}),[i,n,H,R,b,S]),W&&P>x&&x>0?X(_,{flexDirection:"row",flexGrow:m.flexGrow,flexShrink:m.flexShrink,overflow:"hidden",children:[v(E,{children:I,debug:M,onContentHeightChange:A,onItemHeightChange:y,onViewportSizeChange:D,overscan:O,ref:c,scrollOffset:d,virtualize:G,...m,flexGrow:1}),v(te,{color:Y,contentHeight:P,placement:"inset",scrollOffset:d,style:Z,viewportHeight:x})]}):v(E,{children:I,debug:M,onContentHeightChange:A,onItemHeightChange:y,onViewportSizeChange:D,overscan:O,ref:c,scrollOffset:d,virtualize:G,...m})};export{se as ScrollView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
class g{orderedIds;rootIds;map;constructor(i){this.map=new Map,this.orderedIds=[],this.rootIds=[],this.buildFromData(i)}entries(){return this.map.entries()}get(i){return this.map.get(i)}get size(){return this.map.size}getVisibleIds(i){const d=[],n=[];for(let e=this.rootIds.length-1;e>=0;e--)n.push(this.rootIds[e]);for(;n.length>0;){const e=n.pop();d.push(e);const s=this.map.get(e);if(s&&i.has(e)&&s.childrenIds.length>0)for(let t=s.childrenIds.length-1;t>=0;t--)n.push(s.childrenIds[t])}return d}isDescendantOf(i,d){let n=i;for(;n!==void 0;){const e=this.map.get(n);if(!e)return!1;if(e.parentId===d)return!0;n=e.parentId}return!1}withChildren(i,d){if(!this.map.get(i))return this;const n=s=>{const t=this.map.get(s);return s===i?{...t.node,children:d}:t.childrenIds.length>0?{...t.node,children:t.childrenIds.map(p=>n(p))}:t.node},e=this.rootIds.map(s=>n(s));return new g(e)}buildFromData(i){const d=[];for(let e=i.length-1;e>=0;e--)d.push({depth:0,node:i[e],parentId:void 0,siblingIndex:e,siblings:i});for(const e of i)this.rootIds.push(e.id);let n=0;for(;d.length>0;){const e=d.pop(),{depth:s,node:t,parentId:p,siblingIndex:o,siblings:l}=e;if(this.map.has(t.id))throw new Error(`TreeView: Duplicate node id '${t.id}' found. All node ids must be unique.`);const h=t.children??[],a=h.length>0||t.isParent===!0,u=h.map(r=>r.id),I=o>0?l[o-1].id:void 0,c=o<l.length-1?l[o+1].id:void 0,f={childrenIds:u,depth:s,flatIndex:n,hasChildren:a,nextSiblingId:c,node:t,parentId:p,previousSiblingId:I,siblingCount:l.length,siblingIndex:o};if(this.map.set(t.id,f),this.orderedIds.push(t.id),n++,a)for(let r=h.length-1;r>=0;r--)d.push({depth:s+1,node:h[r],parentId:t.id,siblingIndex:r,siblings:h})}}}export{g as TreeNodeMap};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as b,jsx as a}from"react/jsx-runtime";import v from"@visulima/tui/components/box";import n from"@visulima/tui/components/text";import L from"@visulima/tui/hooks/use-is-screen-reader-enabled";import{theme as M}from"./treeViewTheme-Dq3ekRAC.js";import{useTreeView as y}from"./useTreeView-D0JEqT6W.js";import{useTreeViewState as j}from"./useTreeViewState-BiTJakkh.js";const V="❯",D="▾",A="▸",P="☒",R="☐",$="✔",k="⟳";function T(t,r,i,l){const{depth:c,hasChildren:m,isExpanded:o,isLoading:u,isSelected:C}=r,d=[t,`item ${i} of ${l}`];return c>0&&d.push(`depth ${c}`),m&&d.push(o?"expanded":"collapsed"),u&&d.push("loading"),C&&d.push("selected"),d.join(", ")}function F(t,r){const i={};return t.hasChildren&&(i.expanded=t.isExpanded),r!=="none"&&(i.selected=t.isSelected),Object.keys(i).length>0?i:void 0}function O({isScreenReaderEnabled:t,node:r,nodeState:i,selectionMode:l,siblingCount:c,siblingPosition:m,styles:o}){const{depth:u,hasChildren:C,isExpanded:d,isFocused:h,isLoading:s,isSelected:f}=i;let e=" ";s?e=k:C&&(e=d?D:A);const g=t?T(r.label,i,m,c):void 0;return b(v,{...o.node({isFocused:h}),"aria-role":"listitem","aria-state":F(i,l),children:[g&&a(n,{"aria-label":g}),h&&a(n,{...o.focusIndicator(),"aria-hidden":!0,children:V}),u>0&&a(v,{...o.indent({depth:u}),"aria-hidden":!0}),l==="multiple"&&a(n,{...o.selectedIndicator(),"aria-hidden":!0,children:f?P:R}),a(n,{...s?o.loadingIndicator():o.expandIndicator({isExpanded:d}),"aria-hidden":!0,children:e}),a(n,{...o.label({isFocused:h,isSelected:f}),children:r.label}),l==="single"&&f&&b(n,{...o.selectedIndicator(),"aria-hidden":!0,children:[" ",$]})]})}function K({ariaLabel:t="Tree view",data:r,defaultExpanded:i,defaultSelected:l,isDisabled:c=!1,loadChildren:m,onExpandChange:o,onFocusChange:u,onLoadError:C,onSelectChange:d,renderNode:h,selectionMode:s="none",visibleNodeCount:f}){const e=j({data:r,defaultExpanded:i,defaultSelected:l,onExpandChange:o,onFocusChange:u,onSelectChange:d,selectionMode:s,visibleNodeCount:f});y({isDisabled:c,loadChildren:m,onLoadError:C,selectionMode:s,state:e});const{styles:g}=M,w=L();return b(v,{...g.container(),"aria-role":"list",children:[w&&a(n,{"aria-label":t}),e.hasScrollUp&&b(n,{"aria-label":`${e.viewportFromIndex} more items above`,dimColor:!0,children:[" ","↑",e.viewportFromIndex," ","more above"]}),e.viewportNodes.map(({node:p,state:x})=>{const S=e.nodeMap.get(p.id),E=S?S.siblingIndex+1:1,I=S?S.siblingCount:1;if(h){const N=w?T(p.label,x,E,I):void 0;return b(v,{"aria-role":"listitem","aria-state":F(x,s),children:[N&&a(n,{"aria-label":N}),h({node:p,state:x})]},p.id)}return a(O,{isScreenReaderEnabled:w,node:p,nodeState:x,selectionMode:s,siblingCount:I,siblingPosition:E,styles:g},p.id)}),e.hasScrollDown&&b(n,{"aria-label":`${e.visibleCount-e.viewportToIndex} more items below`,dimColor:!0,children:[" ","↓",e.visibleCount-e.viewportToIndex," ","more below"]})]})}export{K as TreeView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as E,jsxs as rr}from"react/jsx-runtime";import{measureElement as K}from"@visulima/tui";import H from"@visulima/tui/components/box";import{useState as N,useRef as d,useCallback as j,useLayoutEffect as T,isValidElement as z,useImperativeHandle as tr,Fragment as G}from"react";const J=u=>{const[g,m]=N(u),l=d(u),M=j(v=>{const k=typeof v=="function"?v(l.current):v;l.current=k,m(k)},[]),y=j(()=>l.current,[]);return[g,M,y]},er=({children:u,index:g,measureKey:m,onMeasure:l,width:M})=>{const y=d(null);return T(()=>{if(y.current){const{height:v}=K(y.current);l(g,v)}},[g,l,M,m,u]),E(H,{flexDirection:"column",flexShrink:0,ref:y,width:"100%",children:u})},D=u=>{if(u==null)return[];if(Array.isArray(u)){const g=[];for(let m=0;m<u.length;m+=1){const l=u[m];z(l)&&l.type===G?g.push(...D(l.props.children)):g.push(l)}return g}return z(u)&&u.type===G?D(u.props.children):[u]},hr=({children:u,debug:g=!1,onContentHeightChange:m,onItemHeightChange:l,onViewportSizeChange:M,overscan:y=3,ref:v,scrollOffset:k,virtualize:Q=!1,...U})=>{const O=d(!1),[$,q,V]=J({height:0,width:0}),[I,b,S]=J(0),[W,X]=N({}),A=d(null),B=d(0);T(()=>{I!==B.current&&(m?.(I,B.current),B.current=I)},[I,m]);const o=d({}),i=d([]),p=d([]),f=d(0),Y=j((r,t)=>{const e=i.current[r]??r;if(o.current[e]!==t){const h=o.current[e]??0;o.current={...o.current,[e]:t};let n=0;for(let s=0;s<i.current.length;s+=1){const x=i.current[s];x!=null&&(n+=o.current[x]??0)}const c=S();n!==c&&b(n),l?.(r,t,h),f.current=Math.min(f.current,r+1)}},[l,S,b]),F=j(()=>{if(A.current){const{height:r,width:t}=K(A.current),e=V();(t!==e.width||r!==e.height)&&(M?.({height:r,width:t},e),q({height:r,width:t}))}},[A,M,V,q]);T(()=>{F()});const Z=d(null);if(Z.current!==u){Z.current=u;const r=[],t={};D(u).forEach((n,c)=>{if(!n)return;const s=(z(n)?n.key:null)??c;r[c]=s;const x=o.current[s]??0;t[s]=x}),o.current=t,i.current=r,p.current=Array.from({length:r.length}).fill(0),f.current=0;let e=0;r.forEach(n=>{e+=t[n]??0});const h=S();e!==h&&b(e)}tr(v,()=>({getBottomOffset:()=>Math.max(0,S()-V().height),getContentHeight:S,getItemHeight:r=>{const t=i.current[r]??r;return o.current[t]??0},getItemPosition:r=>{if(r<0||r>=i.current.length)return null;if(r>=f.current){let h=0,n=0;if(f.current>0){n=f.current;const c=n-1,s=i.current[c]??c,x=o.current[s]??0;h=(p.current[c]??0)+x}for(let c=n;c<=r;c+=1){p.current[c]=h;const s=i.current[c]??c,x=o.current[s]??0;h+=x}f.current=r+1}const t=p.current[r]??0,e=i.current[r]??r;return{height:o.current[e]??0,top:t}},getViewportHeight:()=>V().height,remeasure:F,remeasureItem:r=>{X(t=>({...t,[r]:(t[r]??0)+1}))}}),[F,S,V,X]);const C=D(u);!O.current&&I>0&&(O.current=!0);let w=0,a=C.length-1,L=0,P=0;const _=C.length>0&&C.every((r,t)=>{const e=i.current[t]??t;return(o.current[e]??0)>0}),R=Q&&O.current&&_;if(R){const r=i.current.length;if(f.current<r){let e=0,h=0;if(f.current>0){h=f.current;const n=h-1,c=i.current[n]??n,s=o.current[c]??0;e=(p.current[n]??0)+s}for(let n=h;n<r;n+=1){p.current[n]=e;const c=i.current[n]??n;e+=o.current[c]??0}f.current=r}const t=k+$.height;w=C.length,a=-1;for(let e=0;e<r;e+=1){const h=p.current[e]??0,n=i.current[e]??e,c=o.current[n]??0;h+c>k&&h<t&&(e<w&&(w=e),a=e)}if(w>a&&(w=0,a=-1),w=Math.max(0,w-y),a=Math.min(C.length-1,Math.max(-1,a)+y),L=p.current[w]??0,a<C.length-1){const e=i.current[a]??a,h=(p.current[a]??0)+(o.current[e]??0);P=I-h}}return E(H,{...U,children:E(H,{ref:A,width:"100%",children:E(H,{overflow:g?void 0:"hidden",width:"100%",children:rr(H,{flexDirection:"column",marginTop:-k,width:"100%",children:[R&&L>0&&E(H,{height:L}),C.map((r,t)=>!r||R&&(t<w||t>a)?null:E(er,{index:t,measureKey:W[t],onMeasure:Y,width:$.width,children:r},z(r)?r.key??t:t)),R&&P>0&&E(H,{height:P})]})})})})};export{hr as C,J as f};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Props } from '@visulima/tui/components/box';
|
|
2
|
-
import React, { ReactNode, Ref } from 'react';
|
|
3
|
-
interface ControlledScrollViewProps extends Props {
|
|
4
|
-
children?: ReactNode;
|
|
5
|
-
debug?: boolean;
|
|
6
|
-
onContentHeightChange?: (height: number, previousHeight: number) => void;
|
|
7
|
-
onItemHeightChange?: (index: number, height: number, previousHeight: number) => void;
|
|
8
|
-
onViewportSizeChange?: (size: {
|
|
9
|
-
height: number;
|
|
10
|
-
width: number;
|
|
11
|
-
}, previousSize: {
|
|
12
|
-
height: number;
|
|
13
|
-
width: number;
|
|
14
|
-
}) => void;
|
|
15
|
-
/**
|
|
16
|
-
* Number of extra items to render above/below the viewport when virtualized.
|
|
17
|
-
* @default 3
|
|
18
|
-
*/
|
|
19
|
-
overscan?: number;
|
|
20
|
-
scrollOffset: number;
|
|
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
|
-
*/
|
|
26
|
-
virtualize?: boolean;
|
|
27
|
-
}
|
|
28
|
-
interface ControlledScrollViewRef {
|
|
29
|
-
getBottomOffset: () => number;
|
|
30
|
-
getContentHeight: () => number;
|
|
31
|
-
getItemHeight: (index: number) => number;
|
|
32
|
-
getItemPosition: (index: number) => {
|
|
33
|
-
height: number;
|
|
34
|
-
top: number;
|
|
35
|
-
} | null;
|
|
36
|
-
getViewportHeight: () => number;
|
|
37
|
-
remeasure: () => void;
|
|
38
|
-
remeasureItem: (index: number) => void;
|
|
39
|
-
}
|
|
40
|
-
declare const ControlledScrollView: ({ children, debug, onContentHeightChange, onItemHeightChange, onViewportSizeChange, overscan, ref, scrollOffset, virtualize, ...boxProps }: ControlledScrollViewProps & {
|
|
41
|
-
ref?: Ref<ControlledScrollViewRef>;
|
|
42
|
-
}) => React.JSX.Element;
|
|
43
|
-
export { ControlledScrollView as C, ControlledScrollViewProps as a, ControlledScrollViewRef as b };
|
|
@@ -1,92 +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: ({ 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 };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as N,jsx as I}from"react/jsx-runtime";import{createBrailleGrid as u}from"@visulima/tui/canvas";import h from"@visulima/tui/components/box";import d from"@visulima/tui/components/canvas";import y from"@visulima/tui/components/text";import{useMemo as f}from"react";const T=["cyan","magenta","yellow","green","blue","red"],g=e=>e.length===0?[]:typeof e[0]=="number"?e.map((t,o)=>({x:o,y:t})):e,E=(e,t,o)=>e.color??o[t%o.length]??"cyan",b=e=>{let t=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(const{points:x}of e)for(const n of x)n.x<t&&(t=n.x),n.x>o&&(o=n.x),n.y<a&&(a=n.y),n.y>s&&(s=n.y);return{xMax:o,xMin:t,yMax:s,yMin:a}},Y=T,M=(e,t,o,a)=>{const s=t.xMax-t.xMin||1,x=t.yMax-t.yMin||1,n=(e.x-t.xMin)/s,c=(e.y-t.yMin)/x;return{px:Math.max(0,Math.min(o-1,Math.round(n*(o-1)))),py:Math.max(0,Math.min(a-1,Math.round((1-c)*(a-1))))}},_=(e,t,o)=>{e.clear();const{axisColor:a,seriesList:s}=o,x=Math.max(1,e.width*2),n=Math.max(1,e.height*4);for(let c=0;c<e.width;c+=2)e.setCell(c,e.height-1,"·",{color:a,dim:!0});for(const{color:c,points:m}of s){if(m.length===0)continue;const l=u(e.width,e.height);if(t==="scatter")for(const i of m){const r=M(i,o,x,n);l.plotPoint(r.px,r.py)}else{let i=M(m[0],o,x,n);l.plotPoint(i.px,i.py);for(let r=1;r<m.length;r+=1){const p=M(m[r],o,x,n);l.plotLine(i.px,i.py,p.px,p.py),i=p}}l.flush(e,{color:c})}};function L({axisColor:e="gray",height:t=10,maxY:o,minY:a,palette:s=Y,series:x,showLegend:n=!0,width:c=40}){const m=f(()=>{const l=x.map((r,p)=>({color:E(r,p,s),points:g(r.data),series:r})),i=b(l);return{axisColor:e,palette:s,seriesList:l,xMax:i.xMax===Number.NEGATIVE_INFINITY?1:i.xMax,xMin:i.xMin===Number.POSITIVE_INFINITY?0:i.xMin,yMax:o??(i.yMax===Number.NEGATIVE_INFINITY?1:i.yMax),yMin:a??(i.yMin===Number.POSITIVE_INFINITY?0:i.yMin)}},[x,e,s,a,o]);return N(h,{flexDirection:"column",children:[I(d,{draw:l=>{_(l,"line",m)},height:t,version:[x,c,t,a,o,e,s],width:c}),n?I(h,{gap:2,marginTop:1,children:m.seriesList.map(({color:l,series:i},r)=>N(h,{gap:1,children:[I(y,{color:l,children:"●"}),I(y,{children:i.label??`Series ${r+1}`})]},`${r}:${i.label??""}`))}):void 0]})}export{T as D,M as a,b as c,_ as d,L as h,E as p,g as t};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Props } from '@visulima/tui/components/box';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
interface ScrollBarBoxProps extends Props {
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
contentHeight: number;
|
|
6
|
-
scrollBarAutoHide?: boolean;
|
|
7
|
-
scrollBarPosition?: "left" | "right";
|
|
8
|
-
scrollOffset: number;
|
|
9
|
-
thumbChar?: string;
|
|
10
|
-
viewportHeight: number;
|
|
11
|
-
}
|
|
12
|
-
declare const ScrollBarBox: ({ borderColor, borderDimColor, borderLeftColor, borderLeftDimColor, borderRightColor, borderRightDimColor, borderStyle, children, contentHeight, height, scrollBarAutoHide, scrollBarPosition, scrollOffset, thumbChar, viewportHeight, ...boxProps }: ScrollBarBoxProps) => React.JSX.Element;
|
|
13
|
-
export { ScrollBarBox as S, ScrollBarBoxProps as a };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Props } from '@visulima/tui/components/box';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
type ScrollBarPlacement = "inset" | "left" | "right";
|
|
4
|
-
type ScrollBarStyle = Props["borderStyle"] | "block" | "line" | "thick" | "dots";
|
|
5
|
-
interface ScrollBarProps {
|
|
6
|
-
autoHide?: boolean;
|
|
7
|
-
color?: string;
|
|
8
|
-
contentHeight: number;
|
|
9
|
-
dimColor?: boolean;
|
|
10
|
-
placement?: ScrollBarPlacement;
|
|
11
|
-
scrollOffset: number;
|
|
12
|
-
style?: ScrollBarStyle;
|
|
13
|
-
thumbChar?: string;
|
|
14
|
-
trackChar?: string;
|
|
15
|
-
viewportHeight: number;
|
|
16
|
-
}
|
|
17
|
-
declare const ScrollBar: React.FC<ScrollBarProps>;
|
|
18
|
-
export { ScrollBar as S, ScrollBarPlacement as a, ScrollBarProps as b, ScrollBarStyle as c };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React, { Ref } from 'react';
|
|
2
|
-
import { a as ScrollViewProps, b as ScrollViewRef } from "./scroll-view.d-GZcgAHl4.js";
|
|
3
|
-
type ScrollAlignment = "auto" | "bottom" | "center" | "top";
|
|
4
|
-
interface ScrollListProps extends ScrollViewProps {
|
|
5
|
-
readonly scrollAlignment?: ScrollAlignment;
|
|
6
|
-
readonly selectedIndex?: number;
|
|
7
|
-
}
|
|
8
|
-
type ScrollListRef = ScrollViewRef;
|
|
9
|
-
declare const ScrollList: (props: ScrollListProps & {
|
|
10
|
-
ref?: Ref<ScrollListRef>;
|
|
11
|
-
}) => React.JSX.Element;
|
|
12
|
-
export { ScrollAlignment as S, ScrollList as a, ScrollListProps as b, ScrollListRef as c };
|