@storybook/react-native-ui 8.0.0-alpha.3
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/LICENSE +21 -0
- package/dist/index.d.ts +492 -0
- package/dist/index.js +2860 -0
- package/package.json +85 -0
- package/src/Button.stories.tsx +134 -0
- package/src/Button.tsx +243 -0
- package/src/Explorer.stories.tsx +46 -0
- package/src/Explorer.tsx +54 -0
- package/src/IconButton.tsx +11 -0
- package/src/Layout.stories.tsx +38 -0
- package/src/Layout.tsx +103 -0
- package/src/LayoutProvider.tsx +90 -0
- package/src/MobileAddonsPanel.tsx +166 -0
- package/src/MobileMenuDrawer.tsx +75 -0
- package/src/Refs.tsx +142 -0
- package/src/Search.tsx +336 -0
- package/src/SearchResults.tsx +315 -0
- package/src/Sidebar.stories.tsx +262 -0
- package/src/Sidebar.tsx +200 -0
- package/src/Tree.stories.tsx +139 -0
- package/src/Tree.tsx +441 -0
- package/src/TreeNode.stories.tsx +122 -0
- package/src/TreeNode.tsx +146 -0
- package/src/constants.ts +4 -0
- package/src/icon/BottomBarToggleIcon.tsx +23 -0
- package/src/icon/CloseIcon.tsx +22 -0
- package/src/icon/CollapseAllIcon.tsx +17 -0
- package/src/icon/CollapseIcon.tsx +39 -0
- package/src/icon/ComponentIcon.tsx +14 -0
- package/src/icon/ExpandAllIcon.tsx +17 -0
- package/src/icon/FaceHappyIcon.tsx +18 -0
- package/src/icon/GroupIcon.tsx +14 -0
- package/src/icon/MenuIcon.tsx +18 -0
- package/src/icon/SearchIcon.tsx +17 -0
- package/src/icon/StoryIcon.tsx +14 -0
- package/src/index.tsx +9 -0
- package/src/mockdata.large.ts +25217 -0
- package/src/mockdata.ts +287 -0
- package/src/types.ts +78 -0
- package/src/useExpanded.ts +130 -0
- package/src/useLastViewed.ts +48 -0
- package/src/util/status.tsx +70 -0
- package/src/util/tree.ts +91 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Kadira Inc. <hello@kadira.io>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
import * as _storybook_react_native_theming from '@storybook/react-native-theming';
|
|
2
|
+
import * as react_native from 'react-native';
|
|
3
|
+
import { PressableProps, View, Text, TouchableOpacityProps, TouchableOpacity } from 'react-native';
|
|
4
|
+
import * as React$1 from 'react';
|
|
5
|
+
import React__default, { FC, ComponentProps, ReactElement, PropsWithChildren, ReactNode } from 'react';
|
|
6
|
+
import { State, StoriesHash, API } from '@storybook/manager-api';
|
|
7
|
+
import * as Fuse from 'fuse.js';
|
|
8
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
9
|
+
import { SvgProps } from 'react-native-svg';
|
|
10
|
+
import { R } from './types-bf5e6555.js';
|
|
11
|
+
|
|
12
|
+
interface NodeProps$1 {
|
|
13
|
+
children: React__default.ReactNode | React__default.ReactNode[];
|
|
14
|
+
isExpandable?: boolean;
|
|
15
|
+
isExpanded?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare const BranchNode: _storybook_react_native_theming.StyledComponent<react_native.TouchableOpacityProps & {
|
|
18
|
+
theme?: _storybook_react_native_theming.Theme;
|
|
19
|
+
as?: React__default.ElementType<any, keyof React__default.JSX.IntrinsicElements>;
|
|
20
|
+
} & {
|
|
21
|
+
depth?: number;
|
|
22
|
+
isExpandable?: boolean;
|
|
23
|
+
isExpanded?: boolean;
|
|
24
|
+
isComponent?: boolean;
|
|
25
|
+
isSelected?: boolean;
|
|
26
|
+
}, {}, {
|
|
27
|
+
ref?: React__default.Ref<react_native.TouchableOpacity>;
|
|
28
|
+
}>;
|
|
29
|
+
declare const LeafNode: _storybook_react_native_theming.StyledComponent<react_native.TouchableOpacityProps & {
|
|
30
|
+
theme?: _storybook_react_native_theming.Theme;
|
|
31
|
+
as?: React__default.ElementType<any, keyof React__default.JSX.IntrinsicElements>;
|
|
32
|
+
} & {
|
|
33
|
+
depth?: number;
|
|
34
|
+
selected?: boolean;
|
|
35
|
+
}, {}, {
|
|
36
|
+
ref?: React__default.Ref<react_native.TouchableOpacity>;
|
|
37
|
+
}>;
|
|
38
|
+
declare const GroupNode: FC<ComponentProps<typeof BranchNode> & {
|
|
39
|
+
isExpanded?: boolean;
|
|
40
|
+
isExpandable?: boolean;
|
|
41
|
+
}>;
|
|
42
|
+
declare const ComponentNode: FC<ComponentProps<typeof BranchNode>>;
|
|
43
|
+
declare const StoryNode: FC<ComponentProps<typeof LeafNode>>;
|
|
44
|
+
|
|
45
|
+
interface ExpandAction {
|
|
46
|
+
ids: string[];
|
|
47
|
+
value: boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare global {
|
|
51
|
+
interface SymbolConstructor {
|
|
52
|
+
readonly observable: symbol;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
interface SBBaseType {
|
|
57
|
+
required?: boolean;
|
|
58
|
+
raw?: string;
|
|
59
|
+
}
|
|
60
|
+
type SBScalarType = SBBaseType & {
|
|
61
|
+
name: 'boolean' | 'string' | 'number' | 'function' | 'symbol';
|
|
62
|
+
};
|
|
63
|
+
type SBArrayType = SBBaseType & {
|
|
64
|
+
name: 'array';
|
|
65
|
+
value: SBType;
|
|
66
|
+
};
|
|
67
|
+
type SBObjectType = SBBaseType & {
|
|
68
|
+
name: 'object';
|
|
69
|
+
value: Record<string, SBType>;
|
|
70
|
+
};
|
|
71
|
+
type SBEnumType = SBBaseType & {
|
|
72
|
+
name: 'enum';
|
|
73
|
+
value: (string | number)[];
|
|
74
|
+
};
|
|
75
|
+
type SBIntersectionType = SBBaseType & {
|
|
76
|
+
name: 'intersection';
|
|
77
|
+
value: SBType[];
|
|
78
|
+
};
|
|
79
|
+
type SBUnionType = SBBaseType & {
|
|
80
|
+
name: 'union';
|
|
81
|
+
value: SBType[];
|
|
82
|
+
};
|
|
83
|
+
type SBOtherType = SBBaseType & {
|
|
84
|
+
name: 'other';
|
|
85
|
+
value: string;
|
|
86
|
+
};
|
|
87
|
+
type SBType = SBScalarType | SBEnumType | SBArrayType | SBObjectType | SBIntersectionType | SBUnionType | SBOtherType;
|
|
88
|
+
|
|
89
|
+
type StoryId = string;
|
|
90
|
+
type ComponentId = string;
|
|
91
|
+
type ComponentTitle = string;
|
|
92
|
+
type StoryName = string;
|
|
93
|
+
type Tag$1 = string;
|
|
94
|
+
interface StoryIdentifier {
|
|
95
|
+
componentId: ComponentId;
|
|
96
|
+
title: ComponentTitle;
|
|
97
|
+
/** @deprecated */
|
|
98
|
+
kind: ComponentTitle;
|
|
99
|
+
id: StoryId;
|
|
100
|
+
name: StoryName;
|
|
101
|
+
/** @deprecated */
|
|
102
|
+
story: StoryName;
|
|
103
|
+
tags: Tag$1[];
|
|
104
|
+
}
|
|
105
|
+
interface Parameters {
|
|
106
|
+
[name: string]: any;
|
|
107
|
+
}
|
|
108
|
+
type ConditionalTest = {
|
|
109
|
+
truthy?: boolean;
|
|
110
|
+
} | {
|
|
111
|
+
exists: boolean;
|
|
112
|
+
} | {
|
|
113
|
+
eq: any;
|
|
114
|
+
} | {
|
|
115
|
+
neq: any;
|
|
116
|
+
};
|
|
117
|
+
type ConditionalValue = {
|
|
118
|
+
arg: string;
|
|
119
|
+
} | {
|
|
120
|
+
global: string;
|
|
121
|
+
};
|
|
122
|
+
type Conditional = ConditionalValue & ConditionalTest;
|
|
123
|
+
interface InputType {
|
|
124
|
+
name?: string;
|
|
125
|
+
description?: string;
|
|
126
|
+
defaultValue?: any;
|
|
127
|
+
type?: SBType | SBScalarType['name'];
|
|
128
|
+
if?: Conditional;
|
|
129
|
+
[key: string]: any;
|
|
130
|
+
}
|
|
131
|
+
interface StrictInputType extends InputType {
|
|
132
|
+
name: string;
|
|
133
|
+
type?: SBType;
|
|
134
|
+
}
|
|
135
|
+
interface Args {
|
|
136
|
+
[name: string]: any;
|
|
137
|
+
}
|
|
138
|
+
type ArgTypes<TArgs = Args> = {
|
|
139
|
+
[name in keyof TArgs]: InputType;
|
|
140
|
+
};
|
|
141
|
+
type StrictArgTypes<TArgs = Args> = {
|
|
142
|
+
[name in keyof TArgs]: StrictInputType;
|
|
143
|
+
};
|
|
144
|
+
interface Globals {
|
|
145
|
+
[name: string]: any;
|
|
146
|
+
}
|
|
147
|
+
type Renderer = {
|
|
148
|
+
/** What is the type of the `component` annotation in this renderer? */
|
|
149
|
+
component: unknown;
|
|
150
|
+
/** What does the story function return in this renderer? */
|
|
151
|
+
storyResult: unknown;
|
|
152
|
+
/** What type of element does this renderer render to? */
|
|
153
|
+
canvasElement: unknown;
|
|
154
|
+
T?: unknown;
|
|
155
|
+
};
|
|
156
|
+
interface StoryContextForEnhancers<TRenderer extends Renderer = Renderer, TArgs = Args> extends StoryIdentifier {
|
|
157
|
+
component?: (TRenderer & {
|
|
158
|
+
T: any;
|
|
159
|
+
})['component'];
|
|
160
|
+
subcomponents?: Record<string, (TRenderer & {
|
|
161
|
+
T: any;
|
|
162
|
+
})['component']>;
|
|
163
|
+
parameters: Parameters;
|
|
164
|
+
initialArgs: TArgs;
|
|
165
|
+
argTypes: StrictArgTypes<TArgs>;
|
|
166
|
+
}
|
|
167
|
+
interface StoryContextUpdate<TArgs = Args> {
|
|
168
|
+
args?: TArgs;
|
|
169
|
+
globals?: Globals;
|
|
170
|
+
[key: string]: any;
|
|
171
|
+
}
|
|
172
|
+
type ViewMode$1 = 'story' | 'docs';
|
|
173
|
+
interface StoryContextForLoaders<TRenderer extends Renderer = Renderer, TArgs = Args> extends StoryContextForEnhancers<TRenderer, TArgs>, Required<StoryContextUpdate<TArgs>> {
|
|
174
|
+
hooks: unknown;
|
|
175
|
+
viewMode: ViewMode$1;
|
|
176
|
+
originalStoryFn: StoryFn<TRenderer>;
|
|
177
|
+
}
|
|
178
|
+
interface StoryContext<TRenderer extends Renderer = Renderer, TArgs = Args> extends StoryContextForLoaders<TRenderer, TArgs> {
|
|
179
|
+
loaded: Record<string, any>;
|
|
180
|
+
abortSignal: AbortSignal;
|
|
181
|
+
canvasElement: TRenderer['canvasElement'];
|
|
182
|
+
}
|
|
183
|
+
type LegacyStoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = (context: StoryContext<TRenderer, TArgs>) => TRenderer['storyResult'];
|
|
184
|
+
type ArgsStoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = (args: TArgs, context: StoryContext<TRenderer, TArgs>) => (TRenderer & {
|
|
185
|
+
T: TArgs;
|
|
186
|
+
})['storyResult'];
|
|
187
|
+
type StoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = LegacyStoryFn<TRenderer, TArgs> | ArgsStoryFn<TRenderer, TArgs>;
|
|
188
|
+
|
|
189
|
+
interface API_BaseEntry {
|
|
190
|
+
id: StoryId;
|
|
191
|
+
depth: number;
|
|
192
|
+
name: string;
|
|
193
|
+
refId?: string;
|
|
194
|
+
renderLabel?: (item: API_BaseEntry) => any;
|
|
195
|
+
}
|
|
196
|
+
interface API_RootEntry extends API_BaseEntry {
|
|
197
|
+
type: 'root';
|
|
198
|
+
startCollapsed?: boolean;
|
|
199
|
+
children: StoryId[];
|
|
200
|
+
}
|
|
201
|
+
interface API_GroupEntry extends API_BaseEntry {
|
|
202
|
+
type: 'group';
|
|
203
|
+
parent?: StoryId;
|
|
204
|
+
children: StoryId[];
|
|
205
|
+
}
|
|
206
|
+
interface API_ComponentEntry extends API_BaseEntry {
|
|
207
|
+
type: 'component';
|
|
208
|
+
parent?: StoryId;
|
|
209
|
+
children: StoryId[];
|
|
210
|
+
}
|
|
211
|
+
interface API_DocsEntry extends API_BaseEntry {
|
|
212
|
+
type: 'docs';
|
|
213
|
+
parent: StoryId;
|
|
214
|
+
title: ComponentTitle;
|
|
215
|
+
importPath: Path;
|
|
216
|
+
tags: Tag$1[];
|
|
217
|
+
prepared: boolean;
|
|
218
|
+
parameters?: {
|
|
219
|
+
[parameterName: string]: any;
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
interface API_StoryEntry extends API_BaseEntry {
|
|
223
|
+
type: 'story';
|
|
224
|
+
parent: StoryId;
|
|
225
|
+
title: ComponentTitle;
|
|
226
|
+
importPath: Path;
|
|
227
|
+
tags: Tag$1[];
|
|
228
|
+
prepared: boolean;
|
|
229
|
+
parameters?: {
|
|
230
|
+
[parameterName: string]: any;
|
|
231
|
+
};
|
|
232
|
+
args?: Args;
|
|
233
|
+
argTypes?: ArgTypes;
|
|
234
|
+
initialArgs?: Args;
|
|
235
|
+
}
|
|
236
|
+
type API_HashEntry = API_RootEntry | API_GroupEntry | API_ComponentEntry | API_DocsEntry | API_StoryEntry;
|
|
237
|
+
/**
|
|
238
|
+
* The `IndexHash` is our manager-side representation of the `StoryIndex`.
|
|
239
|
+
* We create entries in the hash not only for each story or docs entry, but
|
|
240
|
+
* also for each "group" of the component (split on '/'), as that's how things
|
|
241
|
+
* are manipulated in the manager (i.e. in the sidebar)
|
|
242
|
+
*/
|
|
243
|
+
interface API_IndexHash {
|
|
244
|
+
[id: string]: API_HashEntry;
|
|
245
|
+
}
|
|
246
|
+
type API_StatusValue = 'pending' | 'success' | 'error' | 'warn' | 'unknown';
|
|
247
|
+
interface API_StatusObject {
|
|
248
|
+
status: API_StatusValue;
|
|
249
|
+
title: string;
|
|
250
|
+
description: string;
|
|
251
|
+
data?: any;
|
|
252
|
+
}
|
|
253
|
+
type API_StatusState = Record<StoryId, Record<string, API_StatusObject>>;
|
|
254
|
+
interface API_LoadedRefData {
|
|
255
|
+
index?: API_IndexHash;
|
|
256
|
+
indexError?: Error;
|
|
257
|
+
previewInitialized: boolean;
|
|
258
|
+
}
|
|
259
|
+
interface Addon_SidebarBottomType {
|
|
260
|
+
type: Addon_TypesEnum.experimental_SIDEBAR_BOTTOM;
|
|
261
|
+
/**
|
|
262
|
+
* The unique id of the tool.
|
|
263
|
+
*/
|
|
264
|
+
id: string;
|
|
265
|
+
/**
|
|
266
|
+
* A React.FunctionComponent.
|
|
267
|
+
*/
|
|
268
|
+
render: FC;
|
|
269
|
+
}
|
|
270
|
+
interface Addon_SidebarTopType {
|
|
271
|
+
type: Addon_TypesEnum.experimental_SIDEBAR_TOP;
|
|
272
|
+
/**
|
|
273
|
+
* The unique id of the tool.
|
|
274
|
+
*/
|
|
275
|
+
id: string;
|
|
276
|
+
/**
|
|
277
|
+
* A React.FunctionComponent.
|
|
278
|
+
*/
|
|
279
|
+
render: FC;
|
|
280
|
+
}
|
|
281
|
+
declare enum Addon_TypesEnum {
|
|
282
|
+
/**
|
|
283
|
+
* This API is used to create a tab the toolbar above the canvas, This API might be removed in the future.
|
|
284
|
+
* @unstable
|
|
285
|
+
*/
|
|
286
|
+
TAB = "tab",
|
|
287
|
+
/**
|
|
288
|
+
* This adds panels to the addons side panel.
|
|
289
|
+
*/
|
|
290
|
+
PANEL = "panel",
|
|
291
|
+
/**
|
|
292
|
+
* This adds items in the toolbar above the canvas - on the left side.
|
|
293
|
+
*/
|
|
294
|
+
TOOL = "tool",
|
|
295
|
+
/**
|
|
296
|
+
* This adds items in the toolbar above the canvas - on the right side.
|
|
297
|
+
*/
|
|
298
|
+
TOOLEXTRA = "toolextra",
|
|
299
|
+
/**
|
|
300
|
+
* This adds wrapper components around the canvas/iframe component storybook renders.
|
|
301
|
+
* @unstable this API is not stable yet, and is likely to change in 8.0.
|
|
302
|
+
*/
|
|
303
|
+
PREVIEW = "preview",
|
|
304
|
+
/**
|
|
305
|
+
* This adds pages that render instead of the canvas.
|
|
306
|
+
* @unstable
|
|
307
|
+
*/
|
|
308
|
+
experimental_PAGE = "page",
|
|
309
|
+
/**
|
|
310
|
+
* This adds items in the bottom of the sidebar.
|
|
311
|
+
* @unstable
|
|
312
|
+
*/
|
|
313
|
+
experimental_SIDEBAR_BOTTOM = "sidebar-bottom",
|
|
314
|
+
/**
|
|
315
|
+
* This adds items in the top of the sidebar.
|
|
316
|
+
* @unstable This will get replaced with a new API in 8.0, use at your own risk.
|
|
317
|
+
*/
|
|
318
|
+
experimental_SIDEBAR_TOP = "sidebar-top"
|
|
319
|
+
}
|
|
320
|
+
type Path = string;
|
|
321
|
+
|
|
322
|
+
type Refs = State['refs'];
|
|
323
|
+
type RefType = Refs[keyof Refs] & {
|
|
324
|
+
status?: API_StatusState;
|
|
325
|
+
};
|
|
326
|
+
type Item = StoriesHash[keyof StoriesHash];
|
|
327
|
+
type Dataset = Record<string, Item>;
|
|
328
|
+
interface CombinedDataset {
|
|
329
|
+
hash: Refs;
|
|
330
|
+
entries: [string, RefType][];
|
|
331
|
+
}
|
|
332
|
+
interface ItemRef {
|
|
333
|
+
itemId: string;
|
|
334
|
+
refId: string;
|
|
335
|
+
}
|
|
336
|
+
interface StoryRef {
|
|
337
|
+
storyId: string;
|
|
338
|
+
refId: string;
|
|
339
|
+
}
|
|
340
|
+
type Highlight = ItemRef | null;
|
|
341
|
+
type Selection = StoryRef | null;
|
|
342
|
+
declare function isExpandType(x: any): x is ExpandType;
|
|
343
|
+
interface ExpandType {
|
|
344
|
+
showAll: () => void;
|
|
345
|
+
totalCount: number;
|
|
346
|
+
moreCount: number;
|
|
347
|
+
}
|
|
348
|
+
type SearchItem = Item & {
|
|
349
|
+
refId: string;
|
|
350
|
+
path: string[];
|
|
351
|
+
status?: API_StatusValue;
|
|
352
|
+
showAll?: () => void;
|
|
353
|
+
};
|
|
354
|
+
type SearchResult = Fuse.FuseResult<SearchItem>;
|
|
355
|
+
type SearchResultProps = SearchResult & {
|
|
356
|
+
icon: string;
|
|
357
|
+
isHighlighted: boolean;
|
|
358
|
+
onPress: PressableProps['onPress'];
|
|
359
|
+
};
|
|
360
|
+
type GetSearchItemProps = (args: {
|
|
361
|
+
item: SearchResult;
|
|
362
|
+
index: number;
|
|
363
|
+
key: string;
|
|
364
|
+
}) => SearchResultProps;
|
|
365
|
+
type SearchChildrenFn = (args: {
|
|
366
|
+
query: string;
|
|
367
|
+
results: SearchResult[];
|
|
368
|
+
isBrowsing: boolean;
|
|
369
|
+
closeMenu: (cb?: () => void) => void;
|
|
370
|
+
getItemProps: GetSearchItemProps;
|
|
371
|
+
highlightedIndex: number | null;
|
|
372
|
+
}) => React.ReactNode;
|
|
373
|
+
|
|
374
|
+
interface NodeProps {
|
|
375
|
+
item: Item;
|
|
376
|
+
refId: string;
|
|
377
|
+
docsMode: boolean;
|
|
378
|
+
isOrphan: boolean;
|
|
379
|
+
isDisplayed: boolean;
|
|
380
|
+
color: string | undefined;
|
|
381
|
+
isSelected: boolean;
|
|
382
|
+
isFullyExpanded?: boolean;
|
|
383
|
+
isExpanded: boolean;
|
|
384
|
+
setExpanded: (action: ExpandAction) => void;
|
|
385
|
+
setFullyExpanded?: () => void;
|
|
386
|
+
onSelectStoryId: (itemId: string) => void;
|
|
387
|
+
status: State['status'][keyof State['status']];
|
|
388
|
+
api: API;
|
|
389
|
+
}
|
|
390
|
+
declare const Node: React__default.NamedExoticComponent<NodeProps>;
|
|
391
|
+
declare const LeafNodeStyleWrapper: _storybook_react_native_theming.StyledComponent<react_native.ViewProps & {
|
|
392
|
+
theme?: _storybook_react_native_theming.Theme;
|
|
393
|
+
as?: React__default.ElementType<any, keyof React__default.JSX.IntrinsicElements>;
|
|
394
|
+
}, {}, {
|
|
395
|
+
ref?: React__default.Ref<View>;
|
|
396
|
+
}>;
|
|
397
|
+
declare const RootNode: _storybook_react_native_theming.StyledComponent<react_native.ViewProps & {
|
|
398
|
+
theme?: _storybook_react_native_theming.Theme;
|
|
399
|
+
as?: React__default.ElementType<any, keyof React__default.JSX.IntrinsicElements>;
|
|
400
|
+
}, {}, {
|
|
401
|
+
ref?: React__default.Ref<View>;
|
|
402
|
+
}>;
|
|
403
|
+
declare const RootNodeText: _storybook_react_native_theming.StyledComponent<react_native.TextProps & {
|
|
404
|
+
theme?: _storybook_react_native_theming.Theme;
|
|
405
|
+
as?: React__default.ElementType<any, keyof React__default.JSX.IntrinsicElements>;
|
|
406
|
+
}, {}, {
|
|
407
|
+
ref?: React__default.Ref<Text>;
|
|
408
|
+
}>;
|
|
409
|
+
declare const Tree: React__default.NamedExoticComponent<{
|
|
410
|
+
isBrowsing: boolean;
|
|
411
|
+
isMain: boolean;
|
|
412
|
+
status?: State['status'];
|
|
413
|
+
refId: string;
|
|
414
|
+
data: StoriesHash;
|
|
415
|
+
docsMode: boolean;
|
|
416
|
+
selectedStoryId: string | null;
|
|
417
|
+
onSelectStoryId: (storyId: string) => void;
|
|
418
|
+
}>;
|
|
419
|
+
|
|
420
|
+
interface ButtonProps extends TouchableOpacityProps {
|
|
421
|
+
asChild?: boolean;
|
|
422
|
+
size?: 'small' | 'medium';
|
|
423
|
+
padding?: 'small' | 'medium';
|
|
424
|
+
variant?: 'outline' | 'solid' | 'ghost';
|
|
425
|
+
disabled?: boolean;
|
|
426
|
+
active?: boolean;
|
|
427
|
+
animation?: 'none' | 'rotate360' | 'glow' | 'jiggle';
|
|
428
|
+
text?: string;
|
|
429
|
+
Icon?: (props: SvgProps) => ReactElement;
|
|
430
|
+
}
|
|
431
|
+
declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<TouchableOpacity>>;
|
|
432
|
+
declare const ButtonText: _storybook_react_native_theming.StyledComponent<react_native.TextProps & {
|
|
433
|
+
theme?: _storybook_react_native_theming.Theme;
|
|
434
|
+
as?: React$1.ElementType<any, keyof React$1.JSX.IntrinsicElements>;
|
|
435
|
+
} & {
|
|
436
|
+
variant: ButtonProps['variant'];
|
|
437
|
+
active: ButtonProps['active'];
|
|
438
|
+
}, {}, {
|
|
439
|
+
ref?: React$1.Ref<react_native.Text>;
|
|
440
|
+
}>;
|
|
441
|
+
declare const ButtonIcon: ({ Icon, active, variant, }: {
|
|
442
|
+
Icon: (props: SvgProps) => ReactElement;
|
|
443
|
+
variant: ButtonProps['variant'];
|
|
444
|
+
active: ButtonProps['active'];
|
|
445
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
446
|
+
|
|
447
|
+
declare const IconButton: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<TouchableOpacity>>;
|
|
448
|
+
|
|
449
|
+
type LayoutContextType = {
|
|
450
|
+
openMobileMenu: () => void;
|
|
451
|
+
closeMobileMenu: () => void;
|
|
452
|
+
isDesktop: boolean;
|
|
453
|
+
isMobile: boolean;
|
|
454
|
+
};
|
|
455
|
+
declare const LayoutProvider: FC<PropsWithChildren>;
|
|
456
|
+
declare const useLayout: () => LayoutContextType;
|
|
457
|
+
|
|
458
|
+
interface ExplorerProps {
|
|
459
|
+
isLoading: boolean;
|
|
460
|
+
isBrowsing: boolean;
|
|
461
|
+
dataset: CombinedDataset;
|
|
462
|
+
selected: Selection;
|
|
463
|
+
setSelection: (selection: Selection) => void;
|
|
464
|
+
}
|
|
465
|
+
declare const Explorer: FC<ExplorerProps>;
|
|
466
|
+
|
|
467
|
+
declare const useCombination: (index: SidebarProps['index'], indexError: SidebarProps['indexError'], previewInitialized: SidebarProps['previewInitialized'], status: SidebarProps['status'], refs: SidebarProps['refs']) => CombinedDataset;
|
|
468
|
+
interface SidebarProps extends API_LoadedRefData {
|
|
469
|
+
refs: State['refs'];
|
|
470
|
+
status: State['status'];
|
|
471
|
+
extra: Addon_SidebarTopType[];
|
|
472
|
+
bottom?: Addon_SidebarBottomType[];
|
|
473
|
+
storyId?: string;
|
|
474
|
+
refId?: string;
|
|
475
|
+
menuHighlighted?: boolean;
|
|
476
|
+
setSelection: (selection: Selection) => void;
|
|
477
|
+
}
|
|
478
|
+
declare const Sidebar: React__default.NamedExoticComponent<SidebarProps>;
|
|
479
|
+
|
|
480
|
+
declare global {
|
|
481
|
+
interface SymbolConstructor {
|
|
482
|
+
readonly observable: symbol;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
declare const Layout: ({ storyHash, story, children, }: {
|
|
487
|
+
storyHash: API_IndexHash | undefined;
|
|
488
|
+
story?: StoryContext<R, Args>;
|
|
489
|
+
children: ReactNode | ReactNode[];
|
|
490
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
491
|
+
|
|
492
|
+
export { Button, ButtonIcon, ButtonProps, ButtonText, CombinedDataset, ComponentNode, Dataset, ExpandType, Explorer, ExplorerProps, GetSearchItemProps, GroupNode, Highlight, IconButton, Item, ItemRef, Layout, LayoutProvider, LeafNodeStyleWrapper, Node, NodeProps$1 as NodeProps, RefType, Refs, RootNode, RootNodeText, SearchChildrenFn, SearchItem, SearchResult, SearchResultProps, Selection, Sidebar, SidebarProps, StoryNode, StoryRef, Tree, isExpandType, useCombination, useLayout };
|