@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 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, PressableProps, TouchableOpacityProps } from 'react-native';
5
- import * as React$1 from 'react';
6
- import React__default, { FC, ComponentProps, ReactElement, PropsWithChildren, ReactNode } from 'react';
7
- import { State, StoriesHash, API } from 'storybook/internal/manager-api';
8
- import { StatusesByStoryIdAndTypeId, StatusValue, API_LoadedRefData, API_IndexHash, API_PreparedStoryIndex, StoryIndexV2, StoryIndexV3, API_Provider, DocsOptions } from 'storybook/internal/types';
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: React__default.ReactNode | React__default.ReactNode[];
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 & React__default.RefAttributes<View> & {
17
+ declare const BranchNode: _storybook_react_native_theming.StyledComponent<react_native.TouchableOpacityProps & React.RefAttributes<View> & {
19
18
  theme?: useTheme;
20
- as?: React__default.ElementType;
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?: React__default.Ref<any>;
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: React__default.NamedExoticComponent<Omit<react_native.TouchableOpacityProps & React__default.RefAttributes<View> & {
34
+ declare const StoryNode: React.NamedExoticComponent<Omit<react_native.TouchableOpacityProps & React.RefAttributes<View> & {
36
35
  theme?: useTheme;
37
- as?: React__default.ElementType;
36
+ as?: React.ElementType;
38
37
  } & {
39
38
  depth?: number;
40
39
  selected?: boolean;
41
40
  } & {
42
- ref?: React__default.Ref<any>;
43
- }, "ref"> & React__default.RefAttributes<View>>;
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: React__default.NamedExoticComponent<NodeProps>;
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?: React__default.ElementType;
62
+ as?: React.ElementType;
121
63
  }, {}, {
122
- ref?: React__default.Ref<View>;
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?: React__default.ElementType;
68
+ as?: React.ElementType;
127
69
  }, {}, {
128
- ref?: React__default.Ref<View>;
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?: React__default.ElementType;
74
+ as?: React.ElementType;
133
75
  }, {}, {
134
- ref?: React__default.Ref<react_native.Text>;
76
+ ref?: React.Ref<react_native.Text>;
135
77
  }>;
136
- declare const Tree: React__default.NamedExoticComponent<{
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: React__default.NamedExoticComponent<SidebarProps>;
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
- type ToStoriesHashOptions = {
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 };