@storybook/react-native-ui 9.0.0-beta.11 → 9.0.0-beta.13
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 +266 -1
- package/package.json +3 -3
- package/src/Layout.tsx +2 -1
- package/src/util/StoryHash.ts +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { View, PressableProps, TouchableOpacityProps } from 'react-native';
|
|
|
5
5
|
import * as React$1 from 'react';
|
|
6
6
|
import React__default, { FC, ComponentProps, ReactElement, PropsWithChildren, ReactNode } from 'react';
|
|
7
7
|
import { State, StoriesHash, API } from 'storybook/internal/manager-api';
|
|
8
|
-
import { StatusesByStoryIdAndTypeId, StatusValue, API_LoadedRefData, API_IndexHash,
|
|
8
|
+
import { StatusesByStoryIdAndTypeId, StatusValue, API_LoadedRefData, API_IndexHash, API_PreparedStoryIndex, StoryIndexV2, StoryIndexV3, API_Provider, DocsOptions } from 'storybook/internal/types';
|
|
9
9
|
import * as Fuse from 'fuse.js';
|
|
10
10
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
11
11
|
import { SvgProps } from 'react-native-svg';
|
|
@@ -201,6 +201,271 @@ interface SidebarProps extends API_LoadedRefData {
|
|
|
201
201
|
}
|
|
202
202
|
declare const Sidebar: React__default.NamedExoticComponent<SidebarProps>;
|
|
203
203
|
|
|
204
|
+
declare global {
|
|
205
|
+
interface SymbolConstructor {
|
|
206
|
+
readonly observable: symbol;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
interface SBBaseType {
|
|
211
|
+
required?: boolean;
|
|
212
|
+
raw?: string;
|
|
213
|
+
}
|
|
214
|
+
type SBScalarType = SBBaseType & {
|
|
215
|
+
name: 'boolean' | 'string' | 'number' | 'function' | 'symbol';
|
|
216
|
+
};
|
|
217
|
+
type SBArrayType = SBBaseType & {
|
|
218
|
+
name: 'array';
|
|
219
|
+
value: SBType;
|
|
220
|
+
};
|
|
221
|
+
type SBObjectType = SBBaseType & {
|
|
222
|
+
name: 'object';
|
|
223
|
+
value: Record<string, SBType>;
|
|
224
|
+
};
|
|
225
|
+
type SBEnumType = SBBaseType & {
|
|
226
|
+
name: 'enum';
|
|
227
|
+
value: (string | number)[];
|
|
228
|
+
};
|
|
229
|
+
type SBIntersectionType = SBBaseType & {
|
|
230
|
+
name: 'intersection';
|
|
231
|
+
value: SBType[];
|
|
232
|
+
};
|
|
233
|
+
type SBUnionType = SBBaseType & {
|
|
234
|
+
name: 'union';
|
|
235
|
+
value: SBType[];
|
|
236
|
+
};
|
|
237
|
+
type SBOtherType = SBBaseType & {
|
|
238
|
+
name: 'other';
|
|
239
|
+
value: string;
|
|
240
|
+
};
|
|
241
|
+
type SBType = SBScalarType | SBEnumType | SBArrayType | SBObjectType | SBIntersectionType | SBUnionType | SBOtherType;
|
|
242
|
+
|
|
243
|
+
type StoryId = string;
|
|
244
|
+
type ComponentId = string;
|
|
245
|
+
type ComponentTitle = string;
|
|
246
|
+
type StoryName = string;
|
|
247
|
+
type Tag = string;
|
|
248
|
+
interface StoryIdentifier {
|
|
249
|
+
componentId: ComponentId;
|
|
250
|
+
title: ComponentTitle;
|
|
251
|
+
/** @deprecated */
|
|
252
|
+
kind: ComponentTitle;
|
|
253
|
+
id: StoryId;
|
|
254
|
+
name: StoryName;
|
|
255
|
+
/** @deprecated */
|
|
256
|
+
story: StoryName;
|
|
257
|
+
tags: Tag[];
|
|
258
|
+
}
|
|
259
|
+
interface Parameters {
|
|
260
|
+
[name: string]: any;
|
|
261
|
+
}
|
|
262
|
+
type ControlType = 'object' | 'boolean' | 'check' | 'inline-check' | 'radio' | 'inline-radio' | 'select' | 'multi-select' | 'number' | 'range' | 'file' | 'color' | 'date' | 'text';
|
|
263
|
+
type ConditionalTest = {
|
|
264
|
+
truthy?: boolean;
|
|
265
|
+
} | {
|
|
266
|
+
exists: boolean;
|
|
267
|
+
} | {
|
|
268
|
+
eq: any;
|
|
269
|
+
} | {
|
|
270
|
+
neq: any;
|
|
271
|
+
};
|
|
272
|
+
type ConditionalValue = {
|
|
273
|
+
arg: string;
|
|
274
|
+
} | {
|
|
275
|
+
global: string;
|
|
276
|
+
};
|
|
277
|
+
type Conditional = ConditionalValue & ConditionalTest;
|
|
278
|
+
interface ControlBase {
|
|
279
|
+
[key: string]: any;
|
|
280
|
+
/**
|
|
281
|
+
* @see https://storybook.js.org/docs/api/arg-types#controltype
|
|
282
|
+
*/
|
|
283
|
+
type?: ControlType;
|
|
284
|
+
disable?: boolean;
|
|
285
|
+
}
|
|
286
|
+
interface Report {
|
|
287
|
+
type: string;
|
|
288
|
+
version?: number;
|
|
289
|
+
result: unknown;
|
|
290
|
+
status: 'failed' | 'passed' | 'warning';
|
|
291
|
+
}
|
|
292
|
+
interface ReportingAPI {
|
|
293
|
+
reports: Report[];
|
|
294
|
+
addReport: (report: Report) => void;
|
|
295
|
+
}
|
|
296
|
+
type Control = ControlType | false | (ControlBase & (ControlBase | {
|
|
297
|
+
type: 'color';
|
|
298
|
+
/**
|
|
299
|
+
* @see https://storybook.js.org/docs/api/arg-types#controlpresetcolors
|
|
300
|
+
*/
|
|
301
|
+
presetColors?: string[];
|
|
302
|
+
} | {
|
|
303
|
+
type: 'file';
|
|
304
|
+
/**
|
|
305
|
+
* @see https://storybook.js.org/docs/api/arg-types#controlaccept
|
|
306
|
+
*/
|
|
307
|
+
accept?: string;
|
|
308
|
+
} | {
|
|
309
|
+
type: 'inline-check' | 'radio' | 'inline-radio' | 'select' | 'multi-select';
|
|
310
|
+
/**
|
|
311
|
+
* @see https://storybook.js.org/docs/api/arg-types#controllabels
|
|
312
|
+
*/
|
|
313
|
+
labels?: {
|
|
314
|
+
[options: string]: string;
|
|
315
|
+
};
|
|
316
|
+
} | {
|
|
317
|
+
type: 'number' | 'range';
|
|
318
|
+
/**
|
|
319
|
+
* @see https://storybook.js.org/docs/api/arg-types#controlmax
|
|
320
|
+
*/
|
|
321
|
+
max?: number;
|
|
322
|
+
/**
|
|
323
|
+
* @see https://storybook.js.org/docs/api/arg-types#controlmin
|
|
324
|
+
*/
|
|
325
|
+
min?: number;
|
|
326
|
+
/**
|
|
327
|
+
* @see https://storybook.js.org/docs/api/arg-types#controlstep
|
|
328
|
+
*/
|
|
329
|
+
step?: number;
|
|
330
|
+
}));
|
|
331
|
+
interface InputType {
|
|
332
|
+
/**
|
|
333
|
+
* @see https://storybook.js.org/docs/api/arg-types#control
|
|
334
|
+
*/
|
|
335
|
+
control?: Control;
|
|
336
|
+
/**
|
|
337
|
+
* @see https://storybook.js.org/docs/api/arg-types#description
|
|
338
|
+
*/
|
|
339
|
+
description?: string;
|
|
340
|
+
/**
|
|
341
|
+
* @see https://storybook.js.org/docs/api/arg-types#if
|
|
342
|
+
*/
|
|
343
|
+
if?: Conditional;
|
|
344
|
+
/**
|
|
345
|
+
* @see https://storybook.js.org/docs/api/arg-types#mapping
|
|
346
|
+
*/
|
|
347
|
+
mapping?: {
|
|
348
|
+
[key: string]: any;
|
|
349
|
+
};
|
|
350
|
+
/**
|
|
351
|
+
* @see https://storybook.js.org/docs/api/arg-types#name
|
|
352
|
+
*/
|
|
353
|
+
name?: string;
|
|
354
|
+
/**
|
|
355
|
+
* @see https://storybook.js.org/docs/api/arg-types#options
|
|
356
|
+
*/
|
|
357
|
+
options?: readonly any[];
|
|
358
|
+
/**
|
|
359
|
+
* @see https://storybook.js.org/docs/api/arg-types#table
|
|
360
|
+
*/
|
|
361
|
+
table?: {
|
|
362
|
+
[key: string]: unknown;
|
|
363
|
+
/**
|
|
364
|
+
* @see https://storybook.js.org/docs/api/arg-types#tablecategory
|
|
365
|
+
*/
|
|
366
|
+
category?: string;
|
|
367
|
+
/**
|
|
368
|
+
* @see https://storybook.js.org/docs/api/arg-types#tabledefaultvalue
|
|
369
|
+
*/
|
|
370
|
+
defaultValue?: {
|
|
371
|
+
summary?: string;
|
|
372
|
+
detail?: string;
|
|
373
|
+
};
|
|
374
|
+
/**
|
|
375
|
+
* @see https://storybook.js.org/docs/api/arg-types#tabledisable
|
|
376
|
+
*/
|
|
377
|
+
disable?: boolean;
|
|
378
|
+
/**
|
|
379
|
+
* @see https://storybook.js.org/docs/api/arg-types#tablesubcategory
|
|
380
|
+
*/
|
|
381
|
+
subcategory?: string;
|
|
382
|
+
/**
|
|
383
|
+
* @see https://storybook.js.org/docs/api/arg-types#tabletype
|
|
384
|
+
*/
|
|
385
|
+
type?: {
|
|
386
|
+
summary?: string;
|
|
387
|
+
detail?: string;
|
|
388
|
+
};
|
|
389
|
+
};
|
|
390
|
+
/**
|
|
391
|
+
* @see https://storybook.js.org/docs/api/arg-types#type
|
|
392
|
+
*/
|
|
393
|
+
type?: SBType | SBScalarType['name'];
|
|
394
|
+
/**
|
|
395
|
+
* @see https://storybook.js.org/docs/api/arg-types#defaultvalue
|
|
396
|
+
*
|
|
397
|
+
* @deprecated Use `table.defaultValue.summary` instead.
|
|
398
|
+
*/
|
|
399
|
+
defaultValue?: any;
|
|
400
|
+
[key: string]: any;
|
|
401
|
+
}
|
|
402
|
+
interface StrictInputType extends InputType {
|
|
403
|
+
name: string;
|
|
404
|
+
type?: SBType;
|
|
405
|
+
}
|
|
406
|
+
interface Args {
|
|
407
|
+
[name: string]: any;
|
|
408
|
+
}
|
|
409
|
+
type StrictArgTypes<TArgs = Args> = {
|
|
410
|
+
[name in keyof TArgs]: StrictInputType;
|
|
411
|
+
};
|
|
412
|
+
interface Globals {
|
|
413
|
+
[name: string]: any;
|
|
414
|
+
}
|
|
415
|
+
interface Renderer {
|
|
416
|
+
/** What is the type of the `component` annotation in this renderer? */
|
|
417
|
+
component: unknown;
|
|
418
|
+
/** What does the story function return in this renderer? */
|
|
419
|
+
storyResult: unknown;
|
|
420
|
+
/** What type of element does this renderer render to? */
|
|
421
|
+
canvasElement: unknown;
|
|
422
|
+
mount(): Promise<Canvas>;
|
|
423
|
+
T?: unknown;
|
|
424
|
+
}
|
|
425
|
+
interface StoryContextForEnhancers<TRenderer extends Renderer = Renderer, TArgs = Args> extends StoryIdentifier {
|
|
426
|
+
component?: (TRenderer & {
|
|
427
|
+
T: any;
|
|
428
|
+
})['component'];
|
|
429
|
+
subcomponents?: Record<string, (TRenderer & {
|
|
430
|
+
T: any;
|
|
431
|
+
})['component']>;
|
|
432
|
+
parameters: Parameters;
|
|
433
|
+
initialArgs: TArgs;
|
|
434
|
+
argTypes: StrictArgTypes<TArgs>;
|
|
435
|
+
}
|
|
436
|
+
interface StoryContextUpdate<TArgs = Args> {
|
|
437
|
+
args?: TArgs;
|
|
438
|
+
globals?: Globals;
|
|
439
|
+
[key: string]: any;
|
|
440
|
+
}
|
|
441
|
+
type ViewMode = 'story' | 'docs';
|
|
442
|
+
interface Canvas {
|
|
443
|
+
}
|
|
444
|
+
interface StoryContext<TRenderer extends Renderer = Renderer, TArgs = Args> extends StoryContextForEnhancers<TRenderer, TArgs>, Required<StoryContextUpdate<TArgs>> {
|
|
445
|
+
loaded: Record<string, any>;
|
|
446
|
+
abortSignal: AbortSignal;
|
|
447
|
+
canvasElement: TRenderer['canvasElement'];
|
|
448
|
+
hooks: unknown;
|
|
449
|
+
originalStoryFn: StoryFn<TRenderer>;
|
|
450
|
+
viewMode: ViewMode;
|
|
451
|
+
step: StepFunction<TRenderer, TArgs>;
|
|
452
|
+
context: this;
|
|
453
|
+
canvas: Canvas;
|
|
454
|
+
mount: TRenderer['mount'];
|
|
455
|
+
reporting: ReportingAPI;
|
|
456
|
+
}
|
|
457
|
+
/** @deprecated Use {@link StoryContext} instead. */
|
|
458
|
+
interface PlayFunctionContext<TRenderer extends Renderer = Renderer, TArgs = Args> extends StoryContext<TRenderer, TArgs> {
|
|
459
|
+
}
|
|
460
|
+
type StepLabel = string;
|
|
461
|
+
type StepFunction<TRenderer extends Renderer = Renderer, TArgs = Args> = (label: StepLabel, play: PlayFunction<TRenderer, TArgs>) => Promise<void> | void;
|
|
462
|
+
type PlayFunction<TRenderer extends Renderer = Renderer, TArgs = Args> = (context: PlayFunctionContext<TRenderer, TArgs>) => Promise<void> | void;
|
|
463
|
+
type LegacyStoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = (context: StoryContext<TRenderer, TArgs>) => TRenderer['storyResult'];
|
|
464
|
+
type ArgsStoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = (args: TArgs, context: StoryContext<TRenderer, TArgs>) => (TRenderer & {
|
|
465
|
+
T: TArgs;
|
|
466
|
+
})['storyResult'];
|
|
467
|
+
type StoryFn<TRenderer extends Renderer = Renderer, TArgs = Args> = LegacyStoryFn<TRenderer, TArgs> | ArgsStoryFn<TRenderer, TArgs>;
|
|
468
|
+
|
|
204
469
|
declare const Layout: ({ storyHash, story, children, }: {
|
|
205
470
|
storyHash: API_IndexHash | undefined;
|
|
206
471
|
story?: StoryContext<ReactRenderer, Args>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native-ui",
|
|
3
|
-
"version": "9.0.0-beta.
|
|
3
|
+
"version": "9.0.0-beta.13",
|
|
4
4
|
"description": "ui components for react native storybook",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@storybook/react": "9.0.0-beta.10",
|
|
62
|
-
"@storybook/react-native-theming": "^9.0.0-beta.
|
|
62
|
+
"@storybook/react-native-theming": "^9.0.0-beta.13",
|
|
63
63
|
"fuse.js": "^7.0.0",
|
|
64
64
|
"memoizerific": "^1.11.3",
|
|
65
65
|
"polished": "^4.3.1",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "092ffff0237dd5a9ccbb66d470db29108d2607c1"
|
|
85
85
|
}
|
package/src/Layout.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SET_CURRENT_STORY } from 'storybook/internal/core-events';
|
|
2
2
|
import { addons } from 'storybook/internal/manager-api';
|
|
3
|
-
import {
|
|
3
|
+
import type { API_IndexHash } from 'storybook/internal/types';
|
|
4
|
+
import type { Args, StoryContext } from '@storybook/csf';
|
|
4
5
|
import type { ReactRenderer } from '@storybook/react';
|
|
5
6
|
import { styled, useTheme } from '@storybook/react-native-theming';
|
|
6
7
|
import { ReactNode, useRef, useState, useCallback } from 'react';
|
package/src/util/StoryHash.ts
CHANGED