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