@storybook/react-native-ui 9.0.9 → 9.0.14
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 +1 -265
- package/package.json +6 -6
- package/src/Explorer.stories.tsx +2 -0
- package/src/Layout.stories.tsx +2 -14
- package/src/Layout.tsx +1 -1
- package/src/SearchResults.stories.tsx +2 -0
- package/src/Sidebar.stories.tsx +3 -2
- package/src/StorybookLogo.stories.tsx +2 -0
- package/src/Tree.stories.tsx +2 -0
- package/src/TreeNode.stories.tsx +3 -0
- package/src/decorators.tsx +21 -0
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { State, StoriesHash } from 'storybook/internal/manager-api';
|
|
|
6
6
|
import { Item, ExpandAction, CombinedDataset, Selection, SBUI } from '@storybook/react-native-ui-common';
|
|
7
7
|
import { API_LoadedRefData, API_IndexHash } from 'storybook/internal/types';
|
|
8
8
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
9
|
+
import { StoryContext, Args } from 'storybook/internal/csf';
|
|
9
10
|
import { ReactRenderer } from '@storybook/react';
|
|
10
11
|
|
|
11
12
|
interface NodeProps$1 {
|
|
@@ -105,271 +106,6 @@ interface SidebarProps extends API_LoadedRefData {
|
|
|
105
106
|
}
|
|
106
107
|
declare const Sidebar: React.NamedExoticComponent<SidebarProps>;
|
|
107
108
|
|
|
108
|
-
declare global {
|
|
109
|
-
interface SymbolConstructor {
|
|
110
|
-
readonly observable: symbol;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
interface SBBaseType {
|
|
115
|
-
required?: boolean;
|
|
116
|
-
raw?: string;
|
|
117
|
-
}
|
|
118
|
-
type SBScalarType = SBBaseType & {
|
|
119
|
-
name: 'boolean' | 'string' | 'number' | 'function' | 'symbol';
|
|
120
|
-
};
|
|
121
|
-
type SBArrayType = SBBaseType & {
|
|
122
|
-
name: 'array';
|
|
123
|
-
value: SBType;
|
|
124
|
-
};
|
|
125
|
-
type SBObjectType = SBBaseType & {
|
|
126
|
-
name: 'object';
|
|
127
|
-
value: Record<string, SBType>;
|
|
128
|
-
};
|
|
129
|
-
type SBEnumType = SBBaseType & {
|
|
130
|
-
name: 'enum';
|
|
131
|
-
value: (string | number)[];
|
|
132
|
-
};
|
|
133
|
-
type SBIntersectionType = SBBaseType & {
|
|
134
|
-
name: 'intersection';
|
|
135
|
-
value: SBType[];
|
|
136
|
-
};
|
|
137
|
-
type SBUnionType = SBBaseType & {
|
|
138
|
-
name: 'union';
|
|
139
|
-
value: SBType[];
|
|
140
|
-
};
|
|
141
|
-
type SBOtherType = SBBaseType & {
|
|
142
|
-
name: 'other';
|
|
143
|
-
value: string;
|
|
144
|
-
};
|
|
145
|
-
type SBType = SBScalarType | SBEnumType | SBArrayType | SBObjectType | SBIntersectionType | SBUnionType | SBOtherType;
|
|
146
|
-
|
|
147
|
-
type StoryId = string;
|
|
148
|
-
type ComponentId = string;
|
|
149
|
-
type ComponentTitle = string;
|
|
150
|
-
type StoryName = string;
|
|
151
|
-
type Tag = string;
|
|
152
|
-
interface StoryIdentifier {
|
|
153
|
-
componentId: ComponentId;
|
|
154
|
-
title: ComponentTitle;
|
|
155
|
-
/** @deprecated */
|
|
156
|
-
kind: ComponentTitle;
|
|
157
|
-
id: StoryId;
|
|
158
|
-
name: StoryName;
|
|
159
|
-
/** @deprecated */
|
|
160
|
-
story: StoryName;
|
|
161
|
-
tags: Tag[];
|
|
162
|
-
}
|
|
163
|
-
interface Parameters {
|
|
164
|
-
[name: string]: any;
|
|
165
|
-
}
|
|
166
|
-
type ControlType = 'object' | 'boolean' | 'check' | 'inline-check' | 'radio' | 'inline-radio' | 'select' | 'multi-select' | 'number' | 'range' | 'file' | 'color' | 'date' | 'text';
|
|
167
|
-
type ConditionalTest = {
|
|
168
|
-
truthy?: boolean;
|
|
169
|
-
} | {
|
|
170
|
-
exists: boolean;
|
|
171
|
-
} | {
|
|
172
|
-
eq: any;
|
|
173
|
-
} | {
|
|
174
|
-
neq: any;
|
|
175
|
-
};
|
|
176
|
-
type ConditionalValue = {
|
|
177
|
-
arg: string;
|
|
178
|
-
} | {
|
|
179
|
-
global: string;
|
|
180
|
-
};
|
|
181
|
-
type Conditional = ConditionalValue & ConditionalTest;
|
|
182
|
-
interface ControlBase {
|
|
183
|
-
[key: string]: any;
|
|
184
|
-
/**
|
|
185
|
-
* @see https://storybook.js.org/docs/api/arg-types#controltype
|
|
186
|
-
*/
|
|
187
|
-
type?: ControlType;
|
|
188
|
-
disable?: boolean;
|
|
189
|
-
}
|
|
190
|
-
interface Report {
|
|
191
|
-
type: string;
|
|
192
|
-
version?: number;
|
|
193
|
-
result: unknown;
|
|
194
|
-
status: 'failed' | 'passed' | 'warning';
|
|
195
|
-
}
|
|
196
|
-
interface ReportingAPI {
|
|
197
|
-
reports: Report[];
|
|
198
|
-
addReport: (report: Report) => void;
|
|
199
|
-
}
|
|
200
|
-
type Control = ControlType | false | (ControlBase & (ControlBase | {
|
|
201
|
-
type: 'color';
|
|
202
|
-
/**
|
|
203
|
-
* @see https://storybook.js.org/docs/api/arg-types#controlpresetcolors
|
|
204
|
-
*/
|
|
205
|
-
presetColors?: string[];
|
|
206
|
-
} | {
|
|
207
|
-
type: 'file';
|
|
208
|
-
/**
|
|
209
|
-
* @see https://storybook.js.org/docs/api/arg-types#controlaccept
|
|
210
|
-
*/
|
|
211
|
-
accept?: string;
|
|
212
|
-
} | {
|
|
213
|
-
type: 'inline-check' | 'radio' | 'inline-radio' | 'select' | 'multi-select';
|
|
214
|
-
/**
|
|
215
|
-
* @see https://storybook.js.org/docs/api/arg-types#controllabels
|
|
216
|
-
*/
|
|
217
|
-
labels?: {
|
|
218
|
-
[options: string]: string;
|
|
219
|
-
};
|
|
220
|
-
} | {
|
|
221
|
-
type: 'number' | 'range';
|
|
222
|
-
/**
|
|
223
|
-
* @see https://storybook.js.org/docs/api/arg-types#controlmax
|
|
224
|
-
*/
|
|
225
|
-
max?: number;
|
|
226
|
-
/**
|
|
227
|
-
* @see https://storybook.js.org/docs/api/arg-types#controlmin
|
|
228
|
-
*/
|
|
229
|
-
min?: number;
|
|
230
|
-
/**
|
|
231
|
-
* @see https://storybook.js.org/docs/api/arg-types#controlstep
|
|
232
|
-
*/
|
|
233
|
-
step?: number;
|
|
234
|
-
}));
|
|
235
|
-
interface InputType {
|
|
236
|
-
/**
|
|
237
|
-
* @see https://storybook.js.org/docs/api/arg-types#control
|
|
238
|
-
*/
|
|
239
|
-
control?: Control;
|
|
240
|
-
/**
|
|
241
|
-
* @see https://storybook.js.org/docs/api/arg-types#description
|
|
242
|
-
*/
|
|
243
|
-
description?: string;
|
|
244
|
-
/**
|
|
245
|
-
* @see https://storybook.js.org/docs/api/arg-types#if
|
|
246
|
-
*/
|
|
247
|
-
if?: Conditional;
|
|
248
|
-
/**
|
|
249
|
-
* @see https://storybook.js.org/docs/api/arg-types#mapping
|
|
250
|
-
*/
|
|
251
|
-
mapping?: {
|
|
252
|
-
[key: string]: any;
|
|
253
|
-
};
|
|
254
|
-
/**
|
|
255
|
-
* @see https://storybook.js.org/docs/api/arg-types#name
|
|
256
|
-
*/
|
|
257
|
-
name?: string;
|
|
258
|
-
/**
|
|
259
|
-
* @see https://storybook.js.org/docs/api/arg-types#options
|
|
260
|
-
*/
|
|
261
|
-
options?: readonly any[];
|
|
262
|
-
/**
|
|
263
|
-
* @see https://storybook.js.org/docs/api/arg-types#table
|
|
264
|
-
*/
|
|
265
|
-
table?: {
|
|
266
|
-
[key: string]: unknown;
|
|
267
|
-
/**
|
|
268
|
-
* @see https://storybook.js.org/docs/api/arg-types#tablecategory
|
|
269
|
-
*/
|
|
270
|
-
category?: string;
|
|
271
|
-
/**
|
|
272
|
-
* @see https://storybook.js.org/docs/api/arg-types#tabledefaultvalue
|
|
273
|
-
*/
|
|
274
|
-
defaultValue?: {
|
|
275
|
-
summary?: string;
|
|
276
|
-
detail?: string;
|
|
277
|
-
};
|
|
278
|
-
/**
|
|
279
|
-
* @see https://storybook.js.org/docs/api/arg-types#tabledisable
|
|
280
|
-
*/
|
|
281
|
-
disable?: boolean;
|
|
282
|
-
/**
|
|
283
|
-
* @see https://storybook.js.org/docs/api/arg-types#tablesubcategory
|
|
284
|
-
*/
|
|
285
|
-
subcategory?: string;
|
|
286
|
-
/**
|
|
287
|
-
* @see https://storybook.js.org/docs/api/arg-types#tabletype
|
|
288
|
-
*/
|
|
289
|
-
type?: {
|
|
290
|
-
summary?: string;
|
|
291
|
-
detail?: string;
|
|
292
|
-
};
|
|
293
|
-
};
|
|
294
|
-
/**
|
|
295
|
-
* @see https://storybook.js.org/docs/api/arg-types#type
|
|
296
|
-
*/
|
|
297
|
-
type?: SBType | SBScalarType['name'];
|
|
298
|
-
/**
|
|
299
|
-
* @see https://storybook.js.org/docs/api/arg-types#defaultvalue
|
|
300
|
-
*
|
|
301
|
-
* @deprecated Use `table.defaultValue.summary` instead.
|
|
302
|
-
*/
|
|
303
|
-
defaultValue?: any;
|
|
304
|
-
[key: string]: any;
|
|
305
|
-
}
|
|
306
|
-
interface StrictInputType extends InputType {
|
|
307
|
-
name: string;
|
|
308
|
-
type?: SBType;
|
|
309
|
-
}
|
|
310
|
-
interface Args {
|
|
311
|
-
[name: string]: any;
|
|
312
|
-
}
|
|
313
|
-
type StrictArgTypes<TArgs = Args> = {
|
|
314
|
-
[name in keyof TArgs]: StrictInputType;
|
|
315
|
-
};
|
|
316
|
-
interface Globals {
|
|
317
|
-
[name: string]: any;
|
|
318
|
-
}
|
|
319
|
-
interface Renderer {
|
|
320
|
-
/** What is the type of the `component` annotation in this renderer? */
|
|
321
|
-
component: unknown;
|
|
322
|
-
/** What does the story function return in this renderer? */
|
|
323
|
-
storyResult: unknown;
|
|
324
|
-
/** What type of element does this renderer render to? */
|
|
325
|
-
canvasElement: unknown;
|
|
326
|
-
mount(): Promise<Canvas>;
|
|
327
|
-
T?: unknown;
|
|
328
|
-
}
|
|
329
|
-
interface StoryContextForEnhancers<TRenderer extends Renderer = Renderer, TArgs = Args> extends StoryIdentifier {
|
|
330
|
-
component?: (TRenderer & {
|
|
331
|
-
T: any;
|
|
332
|
-
})['component'];
|
|
333
|
-
subcomponents?: Record<string, (TRenderer & {
|
|
334
|
-
T: any;
|
|
335
|
-
})['component']>;
|
|
336
|
-
parameters: Parameters;
|
|
337
|
-
initialArgs: TArgs;
|
|
338
|
-
argTypes: StrictArgTypes<TArgs>;
|
|
339
|
-
}
|
|
340
|
-
interface StoryContextUpdate<TArgs = Args> {
|
|
341
|
-
args?: TArgs;
|
|
342
|
-
globals?: Globals;
|
|
343
|
-
[key: string]: any;
|
|
344
|
-
}
|
|
345
|
-
type ViewMode = 'story' | 'docs';
|
|
346
|
-
interface Canvas {
|
|
347
|
-
}
|
|
348
|
-
interface StoryContext<TRenderer extends Renderer = Renderer, TArgs = Args> extends StoryContextForEnhancers<TRenderer, TArgs>, Required<StoryContextUpdate<TArgs>> {
|
|
349
|
-
loaded: Record<string, any>;
|
|
350
|
-
abortSignal: AbortSignal;
|
|
351
|
-
canvasElement: TRenderer['canvasElement'];
|
|
352
|
-
hooks: unknown;
|
|
353
|
-
originalStoryFn: StoryFn<TRenderer>;
|
|
354
|
-
viewMode: ViewMode;
|
|
355
|
-
step: StepFunction<TRenderer, TArgs>;
|
|
356
|
-
context: this;
|
|
357
|
-
canvas: Canvas;
|
|
358
|
-
mount: TRenderer['mount'];
|
|
359
|
-
reporting: ReportingAPI;
|
|
360
|
-
}
|
|
361
|
-
/** @deprecated Use {@link StoryContext} instead. */
|
|
362
|
-
interface PlayFunctionContext<TRenderer extends Renderer = Renderer, TArgs = Args> extends StoryContext<TRenderer, TArgs> {
|
|
363
|
-
}
|
|
364
|
-
type StepLabel = string;
|
|
365
|
-
type StepFunction<TRenderer extends Renderer = Renderer, TArgs = Args> = (label: StepLabel, play: PlayFunction<TRenderer, TArgs>) => Promise<void> | void;
|
|
366
|
-
type PlayFunction<TRenderer extends Renderer = Renderer, TArgs = Args> = (context: PlayFunctionContext<TRenderer, TArgs>) => Promise<void> | void;
|
|
367
|
-
type LegacyStoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = (context: StoryContext<TRenderer, TArgs>) => TRenderer['storyResult'];
|
|
368
|
-
type ArgsStoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = (args: TArgs, context: StoryContext<TRenderer, TArgs>) => (TRenderer & {
|
|
369
|
-
T: TArgs;
|
|
370
|
-
})['storyResult'];
|
|
371
|
-
type StoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = LegacyStoryFn<TRenderer, TArgs> | ArgsStoryFn<TRenderer, TArgs>;
|
|
372
|
-
|
|
373
109
|
declare const FullUI: SBUI;
|
|
374
110
|
declare const Layout: ({ storyHash, story, children, }: {
|
|
375
111
|
storyHash: API_IndexHash | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native-ui",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.14",
|
|
4
4
|
"description": "ui components for react native storybook",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"typescript": "~5.8.3"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@storybook/react": "
|
|
62
|
-
"@storybook/react-native-theming": "^9.0.
|
|
63
|
-
"@storybook/react-native-ui-common": "^9.0.
|
|
61
|
+
"@storybook/react": "9.0.14",
|
|
62
|
+
"@storybook/react-native-theming": "^9.0.14",
|
|
63
|
+
"@storybook/react-native-ui-common": "^9.0.14",
|
|
64
64
|
"es-toolkit": "^1.38.0",
|
|
65
65
|
"fuse.js": "^7.0.0",
|
|
66
66
|
"memoizerific": "^1.11.3",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"react-native-reanimated": ">=3",
|
|
76
76
|
"react-native-safe-area-context": "*",
|
|
77
77
|
"react-native-svg": ">=14",
|
|
78
|
-
"storybook": "
|
|
78
|
+
"storybook": "9.0.14"
|
|
79
79
|
},
|
|
80
80
|
"engines": {
|
|
81
81
|
"node": ">=18.0.0"
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "19bb44781daef1f4bd1c5782c0a00d5b7fa5b943"
|
|
87
87
|
}
|
package/src/Explorer.stories.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import { Explorer } from './Explorer';
|
|
|
2
2
|
import { mockDataset } from './mockdata';
|
|
3
3
|
import type { RefType } from '@storybook/react-native-ui-common';
|
|
4
4
|
import { View } from 'react-native';
|
|
5
|
+
import { decorators } from './decorators';
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
component: Explorer,
|
|
@@ -10,6 +11,7 @@ export default {
|
|
|
10
11
|
decorators: [
|
|
11
12
|
(storyFn: any) => <View style={{ paddingHorizontal: 20 }}>{storyFn()}</View>,
|
|
12
13
|
(storyFn: any) => <View style={{ paddingHorizontal: 20 }}>{storyFn()}</View>,
|
|
14
|
+
...decorators,
|
|
13
15
|
],
|
|
14
16
|
};
|
|
15
17
|
|
package/src/Layout.stories.tsx
CHANGED
|
@@ -2,23 +2,11 @@ import type { Meta, StoryObj } from '@storybook/react';
|
|
|
2
2
|
import { Layout } from './Layout';
|
|
3
3
|
import { mockDataset } from './mockdata';
|
|
4
4
|
import { Text, View } from 'react-native';
|
|
5
|
-
import {
|
|
6
|
-
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
|
|
7
|
-
import { LayoutProvider } from '@storybook/react-native-ui-common';
|
|
5
|
+
import { decorators } from './decorators';
|
|
8
6
|
|
|
9
7
|
const meta = {
|
|
10
8
|
component: Layout,
|
|
11
|
-
decorators
|
|
12
|
-
(Story) => (
|
|
13
|
-
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
14
|
-
<BottomSheetModalProvider>
|
|
15
|
-
<LayoutProvider>
|
|
16
|
-
<Story />
|
|
17
|
-
</LayoutProvider>
|
|
18
|
-
</BottomSheetModalProvider>
|
|
19
|
-
</GestureHandlerRootView>
|
|
20
|
-
),
|
|
21
|
-
],
|
|
9
|
+
decorators,
|
|
22
10
|
} satisfies Meta<typeof Layout>;
|
|
23
11
|
|
|
24
12
|
export default meta;
|
package/src/Layout.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
|
|
2
|
-
import type { Args, StoryContext } from '
|
|
2
|
+
import type { Args, StoryContext } from 'storybook/internal/csf';
|
|
3
3
|
import type { ReactRenderer } from '@storybook/react';
|
|
4
4
|
import { styled, ThemeProvider, useTheme } from '@storybook/react-native-theming';
|
|
5
5
|
import {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { StoryObj, Meta } from '@storybook/react';
|
|
2
2
|
import { SearchResults } from './SearchResults';
|
|
3
|
+
import { decorators } from './decorators';
|
|
3
4
|
|
|
4
5
|
const meta = {
|
|
5
6
|
component: SearchResults,
|
|
6
7
|
title: 'UI/SearchResults',
|
|
8
|
+
decorators,
|
|
7
9
|
} satisfies Meta<typeof SearchResults>;
|
|
8
10
|
|
|
9
11
|
export default meta;
|
package/src/Sidebar.stories.tsx
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { IndexHash, State } from 'storybook/internal/manager-api';
|
|
4
|
-
import { Button,
|
|
4
|
+
import { Button, type RefType } from '@storybook/react-native-ui-common';
|
|
5
5
|
import { Sidebar } from './Sidebar';
|
|
6
6
|
import { DEFAULT_REF_ID } from './constants';
|
|
7
7
|
import { mockDataset } from './mockdata';
|
|
8
|
+
import { decorators } from './decorators';
|
|
8
9
|
|
|
9
10
|
const index = mockDataset.withRoot as IndexHash;
|
|
10
11
|
const storyId = 'root-1-child-a2--grandchild-a1-1';
|
|
@@ -23,7 +24,7 @@ const meta = {
|
|
|
23
24
|
status: {},
|
|
24
25
|
setSelection: () => {},
|
|
25
26
|
},
|
|
26
|
-
decorators
|
|
27
|
+
decorators,
|
|
27
28
|
} satisfies Meta<typeof Sidebar>;
|
|
28
29
|
|
|
29
30
|
export default meta;
|
|
@@ -2,6 +2,7 @@ import type { StoryObj, Meta } from '@storybook/react';
|
|
|
2
2
|
import { StorybookLogo } from './StorybookLogo';
|
|
3
3
|
import { Theme, theme } from '@storybook/react-native-theming';
|
|
4
4
|
import { Text } from 'react-native';
|
|
5
|
+
import { decorators } from './decorators';
|
|
5
6
|
|
|
6
7
|
const meta = {
|
|
7
8
|
component: StorybookLogo,
|
|
@@ -9,6 +10,7 @@ const meta = {
|
|
|
9
10
|
args: {
|
|
10
11
|
theme: null,
|
|
11
12
|
},
|
|
13
|
+
decorators,
|
|
12
14
|
} satisfies Meta<typeof StorybookLogo>;
|
|
13
15
|
|
|
14
16
|
export default meta;
|
package/src/Tree.stories.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import type { Dataset } from '@storybook/react-native-ui-common';
|
|
|
6
6
|
import { index } from './mockdata.large';
|
|
7
7
|
import { DEFAULT_REF_ID } from './constants';
|
|
8
8
|
import { ScrollView, Text } from 'react-native';
|
|
9
|
+
import { decorators } from './decorators';
|
|
9
10
|
|
|
10
11
|
const customViewports = {
|
|
11
12
|
sized: {
|
|
@@ -35,6 +36,7 @@ const meta = {
|
|
|
35
36
|
<Story />
|
|
36
37
|
</ScrollView>
|
|
37
38
|
),
|
|
39
|
+
...decorators,
|
|
38
40
|
],
|
|
39
41
|
} satisfies Meta<typeof Tree>;
|
|
40
42
|
|
package/src/TreeNode.stories.tsx
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { ComponentNode, GroupNode, StoryNode } from './TreeNode';
|
|
3
3
|
import { View } from 'react-native';
|
|
4
|
+
import { decorators } from './decorators';
|
|
4
5
|
|
|
5
6
|
const meta = {
|
|
6
7
|
title: 'UI/Sidebar/TreeNode',
|
|
7
8
|
parameters: { layout: 'fullscreen' },
|
|
8
9
|
component: StoryNode,
|
|
10
|
+
decorators,
|
|
9
11
|
} satisfies Meta<typeof StoryNode>;
|
|
12
|
+
|
|
10
13
|
export default meta;
|
|
11
14
|
|
|
12
15
|
export const Types: StoryObj<typeof meta> = {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
2
|
+
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
|
|
3
|
+
import { LayoutProvider } from '@storybook/react-native-ui-common';
|
|
4
|
+
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
5
|
+
import { theme, ThemeProvider } from '@storybook/react-native-theming';
|
|
6
|
+
|
|
7
|
+
export const decorators = [
|
|
8
|
+
(Story) => (
|
|
9
|
+
<ThemeProvider theme={theme}>
|
|
10
|
+
<SafeAreaProvider>
|
|
11
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
12
|
+
<BottomSheetModalProvider>
|
|
13
|
+
<LayoutProvider>
|
|
14
|
+
<Story />
|
|
15
|
+
</LayoutProvider>
|
|
16
|
+
</BottomSheetModalProvider>
|
|
17
|
+
</GestureHandlerRootView>
|
|
18
|
+
</SafeAreaProvider>
|
|
19
|
+
</ThemeProvider>
|
|
20
|
+
),
|
|
21
|
+
];
|