@storybook/react-native-ui-lite 9.0.0-beta.13 → 9.0.0-beta.15
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/dist/index.d.ts +23 -140
- package/dist/index.js +387 -3954
- package/package.json +4 -3
- package/src/Explorer.stories.tsx +1 -1
- package/src/Explorer.tsx +1 -1
- package/src/Layout.tsx +24 -11
- package/src/MobileAddonsPanel.tsx +8 -9
- package/src/Refs.tsx +2 -2
- package/src/Search.tsx +2 -2
- package/src/SearchResults.tsx +8 -12
- package/src/Sidebar.stories.tsx +2 -3
- package/src/Sidebar.tsx +5 -5
- package/src/Tree.stories.tsx +1 -1
- package/src/Tree.tsx +14 -9
- package/src/icon/iconDataUris.tsx +74 -31
- package/src/index.tsx +0 -6
- package/src/mockdata.large.ts +1 -1
- package/src/Button.stories.tsx +0 -134
- package/src/Button.tsx +0 -171
- package/src/IconButton.tsx +0 -10
- package/src/LayoutProvider.tsx +0 -32
- package/src/StorageProvider.tsx +0 -21
- package/src/hooks/useExpanded.ts +0 -64
- package/src/hooks/useLastViewed.ts +0 -48
- package/src/hooks/useStoreState.ts +0 -27
- package/src/types.ts +0 -66
- package/src/util/StoryHash.ts +0 -249
- package/src/util/status.tsx +0 -87
- package/src/util/tree.ts +0 -93
- package/src/util/useStyle.ts +0 -28
package/dist/index.d.ts
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import * as _storybook_react_native_theming from '@storybook/react-native-theming';
|
|
2
2
|
import { useTheme, Theme } from '@storybook/react-native-theming';
|
|
3
3
|
import * as react_native from 'react-native';
|
|
4
|
-
import { View
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { State, StoriesHash
|
|
8
|
-
import {
|
|
9
|
-
import * as Fuse from 'fuse.js';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import React, { FC, ComponentProps, ReactNode, ReactElement } from 'react';
|
|
6
|
+
import { Item, ExpandAction, CombinedDataset, Selection, Storage } from '@storybook/react-native-ui-common';
|
|
7
|
+
import { State, StoriesHash } from 'storybook/internal/manager-api';
|
|
8
|
+
import { API_LoadedRefData, API_IndexHash } from 'storybook/internal/types';
|
|
10
9
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
11
10
|
import { ReactRenderer } from '@storybook/react';
|
|
12
11
|
|
|
13
12
|
interface NodeProps$1 {
|
|
14
|
-
children:
|
|
13
|
+
children: React.ReactNode | React.ReactNode[];
|
|
15
14
|
isExpandable?: boolean;
|
|
16
15
|
isExpanded?: boolean;
|
|
17
16
|
}
|
|
18
|
-
declare const BranchNode: _storybook_react_native_theming.StyledComponent<react_native.TouchableOpacityProps &
|
|
17
|
+
declare const BranchNode: _storybook_react_native_theming.StyledComponent<react_native.TouchableOpacityProps & React.RefAttributes<View> & {
|
|
19
18
|
theme?: useTheme;
|
|
20
|
-
as?:
|
|
19
|
+
as?: React.ElementType;
|
|
21
20
|
} & {
|
|
22
21
|
depth?: number;
|
|
23
22
|
isExpandable?: boolean;
|
|
@@ -25,79 +24,22 @@ declare const BranchNode: _storybook_react_native_theming.StyledComponent<react_
|
|
|
25
24
|
isComponent?: boolean;
|
|
26
25
|
isSelected?: boolean;
|
|
27
26
|
}, {}, {
|
|
28
|
-
ref?:
|
|
27
|
+
ref?: React.Ref<any>;
|
|
29
28
|
}>;
|
|
30
29
|
declare const GroupNode: FC<ComponentProps<typeof BranchNode> & {
|
|
31
30
|
isExpanded?: boolean;
|
|
32
31
|
isExpandable?: boolean;
|
|
33
32
|
}>;
|
|
34
33
|
declare const ComponentNode: FC<ComponentProps<typeof BranchNode>>;
|
|
35
|
-
declare const StoryNode:
|
|
34
|
+
declare const StoryNode: React.NamedExoticComponent<Omit<react_native.TouchableOpacityProps & React.RefAttributes<View> & {
|
|
36
35
|
theme?: useTheme;
|
|
37
|
-
as?:
|
|
36
|
+
as?: React.ElementType;
|
|
38
37
|
} & {
|
|
39
38
|
depth?: number;
|
|
40
39
|
selected?: boolean;
|
|
41
40
|
} & {
|
|
42
|
-
ref?:
|
|
43
|
-
}, "ref"> &
|
|
44
|
-
|
|
45
|
-
type Refs = State['refs'];
|
|
46
|
-
type RefType = Refs[keyof Refs] & {
|
|
47
|
-
allStatuses?: StatusesByStoryIdAndTypeId;
|
|
48
|
-
};
|
|
49
|
-
type Item = StoriesHash[keyof StoriesHash];
|
|
50
|
-
type Dataset = Record<string, Item>;
|
|
51
|
-
interface CombinedDataset {
|
|
52
|
-
hash: Refs;
|
|
53
|
-
entries: [string, RefType][];
|
|
54
|
-
}
|
|
55
|
-
interface ItemRef {
|
|
56
|
-
itemId: string;
|
|
57
|
-
refId: string;
|
|
58
|
-
}
|
|
59
|
-
interface StoryRef {
|
|
60
|
-
storyId: string;
|
|
61
|
-
refId: string;
|
|
62
|
-
}
|
|
63
|
-
type Highlight = ItemRef | null;
|
|
64
|
-
type Selection = StoryRef | null;
|
|
65
|
-
declare function isExpandType(x: any): x is ExpandType;
|
|
66
|
-
interface ExpandType {
|
|
67
|
-
showAll: () => void;
|
|
68
|
-
totalCount: number;
|
|
69
|
-
moreCount: number;
|
|
70
|
-
}
|
|
71
|
-
type SearchItem = Item & {
|
|
72
|
-
refId: string;
|
|
73
|
-
path: string[];
|
|
74
|
-
status?: StatusValue;
|
|
75
|
-
showAll?: () => void;
|
|
76
|
-
};
|
|
77
|
-
type SearchResult = Fuse.FuseResult<SearchItem>;
|
|
78
|
-
type SearchResultProps = SearchResult & {
|
|
79
|
-
icon: string;
|
|
80
|
-
isHighlighted: boolean;
|
|
81
|
-
onPress: PressableProps['onPress'];
|
|
82
|
-
};
|
|
83
|
-
type GetSearchItemProps = (args: {
|
|
84
|
-
item: SearchResult;
|
|
85
|
-
index: number;
|
|
86
|
-
key: string;
|
|
87
|
-
}) => SearchResultProps;
|
|
88
|
-
type SearchChildrenFn = (args: {
|
|
89
|
-
query: string;
|
|
90
|
-
results: SearchResult[];
|
|
91
|
-
isBrowsing: boolean;
|
|
92
|
-
closeMenu: (cb?: () => void) => void;
|
|
93
|
-
getItemProps: GetSearchItemProps;
|
|
94
|
-
highlightedIndex: number | null;
|
|
95
|
-
}) => React.ReactNode;
|
|
96
|
-
|
|
97
|
-
interface ExpandAction {
|
|
98
|
-
ids: string[];
|
|
99
|
-
value: boolean;
|
|
100
|
-
}
|
|
41
|
+
ref?: React.Ref<any>;
|
|
42
|
+
}, "ref"> & React.RefAttributes<View>>;
|
|
101
43
|
|
|
102
44
|
interface NodeProps {
|
|
103
45
|
item: Item;
|
|
@@ -114,26 +56,26 @@ interface NodeProps {
|
|
|
114
56
|
onSelectStoryId: (itemId: string) => void;
|
|
115
57
|
status: State['status'][keyof State['status']];
|
|
116
58
|
}
|
|
117
|
-
declare const Node:
|
|
59
|
+
declare const Node: React.NamedExoticComponent<NodeProps>;
|
|
118
60
|
declare const LeafNodeStyleWrapper: _storybook_react_native_theming.StyledComponent<react_native.ViewProps & {
|
|
119
61
|
theme?: Theme$1;
|
|
120
|
-
as?:
|
|
62
|
+
as?: React.ElementType;
|
|
121
63
|
}, {}, {
|
|
122
|
-
ref?:
|
|
64
|
+
ref?: React.Ref<View>;
|
|
123
65
|
}>;
|
|
124
66
|
declare const RootNode: _storybook_react_native_theming.StyledComponent<react_native.ViewProps & {
|
|
125
67
|
theme?: Theme$1;
|
|
126
|
-
as?:
|
|
68
|
+
as?: React.ElementType;
|
|
127
69
|
}, {}, {
|
|
128
|
-
ref?:
|
|
70
|
+
ref?: React.Ref<View>;
|
|
129
71
|
}>;
|
|
130
72
|
declare const RootNodeText: _storybook_react_native_theming.StyledComponent<react_native.TextProps & {
|
|
131
73
|
theme?: Theme$1;
|
|
132
|
-
as?:
|
|
74
|
+
as?: React.ElementType;
|
|
133
75
|
}, {}, {
|
|
134
|
-
ref?:
|
|
76
|
+
ref?: React.Ref<react_native.Text>;
|
|
135
77
|
}>;
|
|
136
|
-
declare const Tree:
|
|
78
|
+
declare const Tree: React.NamedExoticComponent<{
|
|
137
79
|
isBrowsing: boolean;
|
|
138
80
|
isMain: boolean;
|
|
139
81
|
status?: State["status"];
|
|
@@ -144,46 +86,6 @@ declare const Tree: React__default.NamedExoticComponent<{
|
|
|
144
86
|
onSelectStoryId: (storyId: string) => void;
|
|
145
87
|
}>;
|
|
146
88
|
|
|
147
|
-
interface ButtonProps extends TouchableOpacityProps {
|
|
148
|
-
asChild?: boolean;
|
|
149
|
-
size?: 'small' | 'medium';
|
|
150
|
-
padding?: 'small' | 'medium';
|
|
151
|
-
variant?: 'outline' | 'solid' | 'ghost';
|
|
152
|
-
disabled?: boolean;
|
|
153
|
-
active?: boolean;
|
|
154
|
-
animation?: 'none' | 'rotate360' | 'glow' | 'jiggle';
|
|
155
|
-
text?: string;
|
|
156
|
-
Icon?: (props: {
|
|
157
|
-
color: string;
|
|
158
|
-
}) => ReactElement;
|
|
159
|
-
}
|
|
160
|
-
declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<any>>;
|
|
161
|
-
declare const ButtonText: _storybook_react_native_theming.StyledComponent<react_native.TextProps & {
|
|
162
|
-
theme?: useTheme;
|
|
163
|
-
as?: React.ElementType;
|
|
164
|
-
} & {
|
|
165
|
-
variant: ButtonProps["variant"];
|
|
166
|
-
active: ButtonProps["active"];
|
|
167
|
-
}, {}, {
|
|
168
|
-
ref?: React$1.Ref<react_native.Text>;
|
|
169
|
-
}>;
|
|
170
|
-
declare const ButtonIcon: ({ Icon, active, variant, }: {
|
|
171
|
-
Icon: (props: {
|
|
172
|
-
color: string;
|
|
173
|
-
}) => ReactElement;
|
|
174
|
-
variant: ButtonProps["variant"];
|
|
175
|
-
active: ButtonProps["active"];
|
|
176
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
177
|
-
|
|
178
|
-
declare const IconButton: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<unknown>>;
|
|
179
|
-
|
|
180
|
-
type LayoutContextType = {
|
|
181
|
-
isDesktop: boolean;
|
|
182
|
-
isMobile: boolean;
|
|
183
|
-
};
|
|
184
|
-
declare const LayoutProvider: FC<PropsWithChildren>;
|
|
185
|
-
declare const useLayout: () => LayoutContextType;
|
|
186
|
-
|
|
187
89
|
interface ExplorerProps {
|
|
188
90
|
isLoading: boolean;
|
|
189
91
|
isBrowsing: boolean;
|
|
@@ -202,7 +104,7 @@ interface SidebarProps extends API_LoadedRefData {
|
|
|
202
104
|
menuHighlighted?: boolean;
|
|
203
105
|
setSelection: (selection: Selection) => void;
|
|
204
106
|
}
|
|
205
|
-
declare const Sidebar:
|
|
107
|
+
declare const Sidebar: React.NamedExoticComponent<SidebarProps>;
|
|
206
108
|
|
|
207
109
|
declare global {
|
|
208
110
|
interface SymbolConstructor {
|
|
@@ -469,15 +371,6 @@ type ArgsStoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = (args: T
|
|
|
469
371
|
})['storyResult'];
|
|
470
372
|
type StoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = LegacyStoryFn<TRenderer, TArgs> | ArgsStoryFn<TRenderer, TArgs>;
|
|
471
373
|
|
|
472
|
-
interface Storage {
|
|
473
|
-
getItem: (key: string) => Promise<string | null>;
|
|
474
|
-
setItem: (key: string, value: string) => Promise<void>;
|
|
475
|
-
}
|
|
476
|
-
declare const StorageProvider: FC<PropsWithChildren<{
|
|
477
|
-
storage: Storage;
|
|
478
|
-
}>>;
|
|
479
|
-
declare const useStorage: () => Storage;
|
|
480
|
-
|
|
481
374
|
declare const LiteUI: ({ storage, theme, storyHash, story, children, }: {
|
|
482
375
|
storage: Storage;
|
|
483
376
|
theme: Theme;
|
|
@@ -491,14 +384,4 @@ declare const Layout: ({ storyHash, story, children, }: {
|
|
|
491
384
|
children: ReactNode | ReactNode[];
|
|
492
385
|
}) => react_jsx_runtime.JSX.Element;
|
|
493
386
|
|
|
494
|
-
|
|
495
|
-
provider: API_Provider<API>;
|
|
496
|
-
docsOptions: DocsOptions;
|
|
497
|
-
filters: State['filters'];
|
|
498
|
-
status: State['status'];
|
|
499
|
-
};
|
|
500
|
-
declare const transformStoryIndexToStoriesHash: (input: API_PreparedStoryIndex | StoryIndexV2 | StoryIndexV3, { provider, docsOptions, filters, status }: ToStoriesHashOptions) => API_IndexHash | any;
|
|
501
|
-
declare const transformStoryIndexV2toV3: (index: StoryIndexV2) => StoryIndexV3;
|
|
502
|
-
declare const transformStoryIndexV3toV4: (index: StoryIndexV3) => API_PreparedStoryIndex;
|
|
503
|
-
|
|
504
|
-
export { Button, ButtonIcon, ButtonProps, ButtonText, CombinedDataset, ComponentNode, Dataset, ExpandType, Explorer, ExplorerProps, GetSearchItemProps, GroupNode, Highlight, IconButton, Item, ItemRef, Layout, LayoutProvider, LeafNodeStyleWrapper, LiteUI, Node, NodeProps$1 as NodeProps, RefType, Refs, RootNode, RootNodeText, SearchChildrenFn, SearchItem, SearchResult, SearchResultProps, Selection, Sidebar, SidebarProps, Storage, StorageProvider, StoryNode, StoryRef, Tree, isExpandType, transformStoryIndexToStoriesHash, transformStoryIndexV2toV3, transformStoryIndexV3toV4, useCombination, useLayout, useStorage };
|
|
387
|
+
export { ComponentNode, Explorer, ExplorerProps, GroupNode, Layout, LeafNodeStyleWrapper, LiteUI, Node, NodeProps$1 as NodeProps, RootNode, RootNodeText, Sidebar, SidebarProps, StoryNode, Tree, useCombination };
|