storybook 9.1.0-alpha.0 → 9.1.0-alpha.10
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/assets/browser/favicon-wrapper.svg +46 -0
- package/assets/browser/favicon.svg +1 -1
- package/dist/actions/index.cjs +16 -16
- package/dist/actions/index.d.ts +1 -38
- package/dist/actions/index.js +12 -12
- package/dist/bin/index.cjs +62 -69
- package/dist/bin/index.js +43 -50
- package/dist/builder-manager/index.cjs +379 -378
- package/dist/builder-manager/index.d.ts +567 -2
- package/dist/builder-manager/index.js +280 -279
- package/dist/cli/bin/index.cjs +945 -945
- package/dist/cli/bin/index.js +673 -672
- package/dist/cli/index.cjs +14965 -14973
- package/dist/cli/index.d.ts +713 -15
- package/dist/cli/index.js +13488 -13495
- package/dist/common/index.cjs +11211 -11103
- package/dist/common/index.d.ts +351 -72
- package/dist/common/index.js +18491 -18379
- package/dist/components/index.cjs +4606 -4425
- package/dist/components/index.d.ts +11 -12
- package/dist/components/index.js +3020 -2834
- package/dist/controls/index.cjs +16 -16
- package/dist/controls/index.d.ts +1 -36
- package/dist/core-server/index.cjs +6690 -6624
- package/dist/core-server/index.d.ts +14 -2
- package/dist/core-server/index.js +6088 -6023
- package/dist/core-server/presets/common-manager.js +3582 -3475
- package/dist/core-server/presets/common-preset.cjs +85015 -5213
- package/dist/core-server/presets/common-preset.js +85107 -5291
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.cjs +28728 -0
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +28729 -0
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.cjs +29339 -0
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +29340 -0
- package/dist/csf/index.cjs +3019 -104
- package/dist/csf/index.d.ts +301 -18
- package/dist/csf/index.js +3031 -98
- package/dist/csf-tools/index.cjs +489 -488
- package/dist/csf-tools/index.js +311 -309
- package/dist/highlight/index.cjs +15 -15
- package/dist/highlight/index.d.ts +1 -12
- package/dist/highlight/index.js +4 -4
- package/dist/instrumenter/index.cjs +1308 -1239
- package/dist/instrumenter/index.d.ts +25 -3
- package/dist/instrumenter/index.js +1345 -1280
- package/dist/manager/globals-module-info.cjs +1 -1
- package/dist/manager/globals-module-info.js +1 -1
- package/dist/manager/globals-runtime.js +42257 -44665
- package/dist/manager/runtime.js +3715 -3536
- package/dist/manager-api/index.cjs +74 -74
- package/dist/manager-api/index.d.ts +4 -1
- package/dist/manager-api/index.js +142 -142
- package/dist/node-logger/index.cjs +8520 -994
- package/dist/node-logger/index.d.ts +395 -2
- package/dist/node-logger/index.js +8535 -995
- package/dist/preview/runtime.js +13701 -16331
- package/dist/preview-api/index.cjs +1434 -1458
- package/dist/preview-api/index.d.ts +13 -10
- package/dist/preview-api/index.js +950 -976
- package/dist/server-errors.cjs +201 -242
- package/dist/server-errors.d.ts +1 -12
- package/dist/server-errors.js +182 -223
- package/dist/telemetry/index.cjs +1919 -1638
- package/dist/telemetry/index.d.ts +4 -2
- package/dist/telemetry/index.js +1972 -1690
- package/dist/test/index.cjs +9184 -9816
- package/dist/test/index.d.ts +8 -1
- package/dist/test/index.js +8390 -9029
- package/dist/types/index.d.ts +19 -17
- package/dist/viewport/index.cjs +17 -24
- package/dist/viewport/index.d.ts +9 -532
- package/dist/viewport/index.js +9 -16
- package/package.json +18 -187
- package/templates/mocker-runtime.template.js +89 -0
- package/dist/actions/preview.cjs +0 -159
- package/dist/actions/preview.d.ts +0 -555
- package/dist/actions/preview.js +0 -149
- package/dist/backgrounds/index.cjs +0 -148
- package/dist/backgrounds/index.d.ts +0 -592
- package/dist/backgrounds/index.js +0 -130
- package/dist/backgrounds/preview.cjs +0 -143
- package/dist/backgrounds/preview.d.ts +0 -555
- package/dist/backgrounds/preview.js +0 -127
- package/dist/component-testing/index.cjs +0 -23
- package/dist/component-testing/index.d.ts +0 -3
- package/dist/component-testing/index.js +0 -5
- package/dist/component-testing/preview.cjs +0 -40
- package/dist/component-testing/preview.d.ts +0 -5
- package/dist/component-testing/preview.js +0 -25
- package/dist/controls/preview.cjs +0 -26
- package/dist/controls/preview.d.ts +0 -555
- package/dist/controls/preview.js +0 -9
- package/dist/highlight/preview.cjs +0 -590
- package/dist/highlight/preview.d.ts +0 -555
- package/dist/highlight/preview.js +0 -574
- package/dist/measure/index.cjs +0 -476
- package/dist/measure/index.d.ts +0 -567
- package/dist/measure/index.js +0 -464
- package/dist/measure/preview.cjs +0 -466
- package/dist/measure/preview.d.ts +0 -560
- package/dist/measure/preview.js +0 -450
- package/dist/outline/index.cjs +0 -528
- package/dist/outline/index.d.ts +0 -567
- package/dist/outline/index.js +0 -500
- package/dist/outline/preview.cjs +0 -518
- package/dist/outline/preview.d.ts +0 -560
- package/dist/outline/preview.js +0 -486
- package/dist/test/preview.cjs +0 -73
- package/dist/test/preview.d.ts +0 -555
- package/dist/test/preview.js +0 -66
- package/dist/viewport/preview.cjs +0 -35
- package/dist/viewport/preview.d.ts +0 -569
- package/dist/viewport/preview.js +0 -19
package/dist/csf/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Renderer as Renderer$1, ProjectAnnotations as ProjectAnnotations$1, NormalizedProjectAnnotations,
|
|
1
|
+
import { StorybookTypes, Renderer as Renderer$1, ProjectAnnotations as ProjectAnnotations$1, NormalizedProjectAnnotations, Args as Args$1, ComponentAnnotations as ComponentAnnotations$1, StoryAnnotations as StoryAnnotations$1, ComposedStoryFn } from 'storybook/internal/types';
|
|
2
|
+
import { AddonTypes as AddonTypes$1, StoryContext as StoryContext$1 } from 'storybook/internal/csf';
|
|
2
3
|
|
|
3
4
|
declare global {
|
|
4
5
|
interface SymbolConstructor {
|
|
@@ -289,6 +290,256 @@ type SBOtherType = SBBaseType & {
|
|
|
289
290
|
};
|
|
290
291
|
type SBType = SBScalarType | SBEnumType | SBArrayType | SBObjectType | SBIntersectionType | SBUnionType | SBOtherType;
|
|
291
292
|
|
|
293
|
+
interface ActionsParameters {
|
|
294
|
+
/**
|
|
295
|
+
* Actions configuration
|
|
296
|
+
*
|
|
297
|
+
* @see https://storybook.js.org/docs/essentials/actions#parameters
|
|
298
|
+
*/
|
|
299
|
+
actions?: {
|
|
300
|
+
/**
|
|
301
|
+
* Create actions for each arg that matches the regex. (**NOT recommended, see below**)
|
|
302
|
+
*
|
|
303
|
+
* This is quite useful when your component has dozens (or hundreds) of methods and you do not
|
|
304
|
+
* want to manually apply the fn utility for each of those methods. However, this is not the
|
|
305
|
+
* recommended way of writing actions. That's because automatically inferred args are not
|
|
306
|
+
* available as spies in your play function. If you use argTypesRegex and your stories have play
|
|
307
|
+
* functions, you will need to also define args with the fn utility to test them in your play
|
|
308
|
+
* function.
|
|
309
|
+
*
|
|
310
|
+
* @example `argTypesRegex: '^on.*'`
|
|
311
|
+
*/
|
|
312
|
+
argTypesRegex?: string;
|
|
313
|
+
/** Remove the addon panel and disable the addon's behavior */
|
|
314
|
+
disable?: boolean;
|
|
315
|
+
/**
|
|
316
|
+
* Binds a standard HTML event handler to the outermost HTML element rendered by your component
|
|
317
|
+
* and triggers an action when the event is called for a given selector. The format is
|
|
318
|
+
* `<eventname> <selector>`. The selector is optional; it defaults to all elements.
|
|
319
|
+
*
|
|
320
|
+
* **To enable this feature, you must use the `withActions` decorator.**
|
|
321
|
+
*
|
|
322
|
+
* @example `handles: ['mouseover', 'click .btn']`
|
|
323
|
+
*
|
|
324
|
+
* @see https://storybook.js.org/docs/essentials/actions#action-event-handlers
|
|
325
|
+
*/
|
|
326
|
+
handles?: string[];
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
interface ActionsTypes {
|
|
330
|
+
parameters: ActionsParameters;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
declare const PARAM_KEY = "backgrounds";
|
|
334
|
+
|
|
335
|
+
interface Background {
|
|
336
|
+
name: string;
|
|
337
|
+
value: string;
|
|
338
|
+
}
|
|
339
|
+
type BackgroundMap = Record<string, Background>;
|
|
340
|
+
interface GridConfig {
|
|
341
|
+
cellAmount: number;
|
|
342
|
+
cellSize: number;
|
|
343
|
+
opacity: number;
|
|
344
|
+
offsetX?: number;
|
|
345
|
+
offsetY?: number;
|
|
346
|
+
}
|
|
347
|
+
type GlobalState$1 = {
|
|
348
|
+
value: string | undefined;
|
|
349
|
+
grid?: boolean;
|
|
350
|
+
};
|
|
351
|
+
interface BackgroundsParameters {
|
|
352
|
+
/**
|
|
353
|
+
* Backgrounds configuration
|
|
354
|
+
*
|
|
355
|
+
* @see https://storybook.js.org/docs/essentials/backgrounds#parameters
|
|
356
|
+
*/
|
|
357
|
+
backgrounds?: {
|
|
358
|
+
/** Default background color */
|
|
359
|
+
default?: string;
|
|
360
|
+
/** Remove the addon panel and disable the addon's behavior */
|
|
361
|
+
disable?: boolean;
|
|
362
|
+
/** Configuration for the background grid */
|
|
363
|
+
grid?: GridConfig;
|
|
364
|
+
/** Available background colors */
|
|
365
|
+
options?: BackgroundMap;
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
interface BackgroundsGlobals {
|
|
369
|
+
/**
|
|
370
|
+
* Backgrounds configuration
|
|
371
|
+
*
|
|
372
|
+
* @see https://storybook.js.org/docs/essentials/backgrounds#globals
|
|
373
|
+
*/
|
|
374
|
+
[PARAM_KEY]?: GlobalState$1 | GlobalState$1['value'];
|
|
375
|
+
}
|
|
376
|
+
interface BackgroundTypes {
|
|
377
|
+
parameters: BackgroundsParameters;
|
|
378
|
+
globals: BackgroundsGlobals;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
interface ControlsParameters {
|
|
382
|
+
/**
|
|
383
|
+
* Controls configuration
|
|
384
|
+
*
|
|
385
|
+
* @see https://storybook.js.org/docs/essentials/controls#parameters-1
|
|
386
|
+
*/
|
|
387
|
+
controls?: {
|
|
388
|
+
/** Remove the addon panel and disable the addon's behavior */
|
|
389
|
+
disable?: boolean;
|
|
390
|
+
/** Disable the ability to create or edit stories from the Controls panel */
|
|
391
|
+
disableSaveFromUI?: boolean;
|
|
392
|
+
/** Exclude specific properties from the Controls panel */
|
|
393
|
+
exclude?: string[] | RegExp;
|
|
394
|
+
/**
|
|
395
|
+
* Show the full documentation for each property in the Controls addon panel, including the
|
|
396
|
+
* description and default value.
|
|
397
|
+
*/
|
|
398
|
+
expanded?: boolean;
|
|
399
|
+
/** Exclude only specific properties in the Controls panel */
|
|
400
|
+
include?: string[] | RegExp;
|
|
401
|
+
/**
|
|
402
|
+
* Custom control type matchers
|
|
403
|
+
*
|
|
404
|
+
* @see https://storybook.js.org/docs/essentials/controls#custom-control-type-matchers
|
|
405
|
+
*/
|
|
406
|
+
matchers?: {
|
|
407
|
+
date?: RegExp;
|
|
408
|
+
color?: RegExp;
|
|
409
|
+
};
|
|
410
|
+
/**
|
|
411
|
+
* Preset color swatches for the color picker control
|
|
412
|
+
*
|
|
413
|
+
* @example PresetColors: [{ color: '#ff4785', title: 'Coral' }, 'rgba(0, 159, 183, 1)',
|
|
414
|
+
* '#fe4a49']
|
|
415
|
+
*/
|
|
416
|
+
presetColors?: Array<string | {
|
|
417
|
+
color: string;
|
|
418
|
+
title?: string;
|
|
419
|
+
}>;
|
|
420
|
+
/** Controls sorting order */
|
|
421
|
+
sort?: 'none' | 'alpha' | 'requiredFirst';
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
interface ControlsTypes {
|
|
425
|
+
parameters: ControlsParameters;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
interface HighlightTypes {
|
|
429
|
+
parameters: HighlightParameters;
|
|
430
|
+
}
|
|
431
|
+
interface HighlightParameters {
|
|
432
|
+
/**
|
|
433
|
+
* Highlight configuration
|
|
434
|
+
*
|
|
435
|
+
* @see https://storybook.js.org/docs/essentials/highlight#parameters
|
|
436
|
+
*/
|
|
437
|
+
highlight?: {
|
|
438
|
+
/** Remove the addon panel and disable the addon's behavior */
|
|
439
|
+
disable?: boolean;
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
interface MeasureParameters {
|
|
444
|
+
/**
|
|
445
|
+
* Measure configuration
|
|
446
|
+
*
|
|
447
|
+
* @see https://storybook.js.org/docs/essentials/measure-and-outline#parameters
|
|
448
|
+
*/
|
|
449
|
+
measure?: {
|
|
450
|
+
/** Remove the addon panel and disable the addon's behavior */
|
|
451
|
+
disable?: boolean;
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
interface MeasureTypes {
|
|
455
|
+
parameters: MeasureParameters;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
interface OutlineParameters {
|
|
459
|
+
/**
|
|
460
|
+
* Outline configuration
|
|
461
|
+
*
|
|
462
|
+
* @see https://storybook.js.org/docs/essentials/measure-and-outline#parameters
|
|
463
|
+
*/
|
|
464
|
+
outline?: {
|
|
465
|
+
/** Remove the addon panel and disable the addon's behavior */
|
|
466
|
+
disable?: boolean;
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
interface OutlineTypes {
|
|
470
|
+
parameters: OutlineParameters;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
interface TestParameters {
|
|
474
|
+
test?: {
|
|
475
|
+
/** Ignore unhandled errors during test execution */
|
|
476
|
+
dangerouslyIgnoreUnhandledErrors?: boolean;
|
|
477
|
+
/** Whether to throw exceptions coming from the play function */
|
|
478
|
+
throwPlayFunctionExceptions?: boolean;
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
interface TestTypes {
|
|
482
|
+
parameters: TestParameters;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
interface Viewport {
|
|
486
|
+
name: string;
|
|
487
|
+
styles: ViewportStyles;
|
|
488
|
+
type?: 'desktop' | 'mobile' | 'tablet' | 'other';
|
|
489
|
+
}
|
|
490
|
+
interface ViewportStyles {
|
|
491
|
+
height: string;
|
|
492
|
+
width: string;
|
|
493
|
+
}
|
|
494
|
+
type GlobalState = {
|
|
495
|
+
/**
|
|
496
|
+
* When set, the viewport is applied and cannot be changed using the toolbar. Must match the key
|
|
497
|
+
* of one of the available viewports.
|
|
498
|
+
*/
|
|
499
|
+
value: string | undefined;
|
|
500
|
+
/**
|
|
501
|
+
* When true the viewport applied will be rotated 90°, e.g. it will rotate from portrait to
|
|
502
|
+
* landscape orientation.
|
|
503
|
+
*/
|
|
504
|
+
isRotated?: boolean;
|
|
505
|
+
};
|
|
506
|
+
interface ViewportParameters {
|
|
507
|
+
/**
|
|
508
|
+
* Viewport configuration
|
|
509
|
+
*
|
|
510
|
+
* @see https://storybook.js.org/docs/essentials/viewport#parameters
|
|
511
|
+
*/
|
|
512
|
+
viewport?: {
|
|
513
|
+
/**
|
|
514
|
+
* Remove the addon panel and disable the addon's behavior . If you wish to turn off this addon
|
|
515
|
+
* for the entire Storybook, you should do so when registering addon-essentials
|
|
516
|
+
*
|
|
517
|
+
* @see https://storybook.js.org/docs/essentials/index#disabling-addons
|
|
518
|
+
*/
|
|
519
|
+
disable?: boolean;
|
|
520
|
+
/**
|
|
521
|
+
* Specify the available viewports. The width and height values must include the unit, e.g.
|
|
522
|
+
* '320px'.
|
|
523
|
+
*/
|
|
524
|
+
options: Record<string, Viewport>;
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
interface ViewportGlobals {
|
|
528
|
+
/**
|
|
529
|
+
* Viewport configuration
|
|
530
|
+
*
|
|
531
|
+
* @see https://storybook.js.org/docs/essentials/viewport#globals
|
|
532
|
+
*/
|
|
533
|
+
viewport?: GlobalState | GlobalState['value'];
|
|
534
|
+
}
|
|
535
|
+
interface ViewportTypes {
|
|
536
|
+
parameters: ViewportParameters;
|
|
537
|
+
globals: ViewportGlobals;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
type CoreTypes = StorybookTypes & ActionsTypes & BackgroundTypes & ControlsTypes & HighlightTypes & MeasureTypes & OutlineTypes & TestTypes & ViewportTypes;
|
|
541
|
+
declare function getCoreAnnotations(): any[];
|
|
542
|
+
|
|
292
543
|
type StoryId = string;
|
|
293
544
|
type ComponentId = string;
|
|
294
545
|
type ComponentTitle = string;
|
|
@@ -438,7 +689,11 @@ interface GlobalTypes {
|
|
|
438
689
|
interface StrictGlobalTypes {
|
|
439
690
|
[name: string]: StrictInputType;
|
|
440
691
|
}
|
|
441
|
-
interface
|
|
692
|
+
interface AddonTypes {
|
|
693
|
+
parameters?: Record<string, any>;
|
|
694
|
+
globals?: Record<string, any>;
|
|
695
|
+
}
|
|
696
|
+
interface Renderer extends AddonTypes {
|
|
442
697
|
/** What is the type of the `component` annotation in this renderer? */
|
|
443
698
|
component: any;
|
|
444
699
|
/** What does the story function return in this renderer? */
|
|
@@ -447,6 +702,8 @@ interface Renderer {
|
|
|
447
702
|
canvasElement: any;
|
|
448
703
|
mount(): Promise<Canvas>;
|
|
449
704
|
T?: unknown;
|
|
705
|
+
args: unknown;
|
|
706
|
+
csf4: boolean;
|
|
450
707
|
}
|
|
451
708
|
/** @deprecated - Use `Renderer` */
|
|
452
709
|
type AnyFramework = Renderer;
|
|
@@ -524,7 +781,7 @@ interface BaseAnnotations<TRenderer extends Renderer = Renderer, TArgs = Args> {
|
|
|
524
781
|
*
|
|
525
782
|
* @see [Parameters](https://storybook.js.org/docs/writing-stories/parameters)
|
|
526
783
|
*/
|
|
527
|
-
parameters?: Parameters;
|
|
784
|
+
parameters?: Parameters & (TRenderer['csf4'] extends true ? CoreTypes['parameters'] & TRenderer['parameters'] : unknown);
|
|
528
785
|
/**
|
|
529
786
|
* Dynamic data that are provided (and possibly updated by) Storybook and its addons.
|
|
530
787
|
*
|
|
@@ -589,7 +846,7 @@ interface ProjectAnnotations<TRenderer extends Renderer = Renderer, TArgs = Args
|
|
|
589
846
|
* reverse order of initialization.
|
|
590
847
|
*/
|
|
591
848
|
beforeAll?: BeforeAll;
|
|
592
|
-
initialGlobals?: Globals;
|
|
849
|
+
initialGlobals?: Globals & (TRenderer['csf4'] extends true ? CoreTypes['globals'] & TRenderer['globals'] : unknown);
|
|
593
850
|
globalTypes?: GlobalTypes;
|
|
594
851
|
applyDecorators?: DecoratorApplicator<TRenderer, Args>;
|
|
595
852
|
runStep?: StepRunner<TRenderer, TArgs>;
|
|
@@ -653,11 +910,13 @@ interface ComponentAnnotations<TRenderer extends Renderer = Renderer, TArgs = Ar
|
|
|
653
910
|
*
|
|
654
911
|
* By defining them each component will have its tab in the args table.
|
|
655
912
|
*/
|
|
656
|
-
subcomponents?: Record<string, TRenderer
|
|
913
|
+
subcomponents?: Record<string, (TRenderer & {
|
|
914
|
+
T: any;
|
|
915
|
+
})['component']>;
|
|
657
916
|
/** Function that is executed after the story is rendered. */
|
|
658
917
|
play?: PlayFunction<TRenderer, TArgs>;
|
|
659
918
|
/** Override the globals values for all stories in this component */
|
|
660
|
-
globals?: Globals;
|
|
919
|
+
globals?: Globals & (TRenderer['csf4'] extends true ? CoreTypes['globals'] & TRenderer['globals'] : unknown);
|
|
661
920
|
}
|
|
662
921
|
type StoryAnnotations<TRenderer extends Renderer = Renderer, TArgs = Args, TRequiredArgs = Partial<TArgs>> = BaseAnnotations<TRenderer, TArgs> & {
|
|
663
922
|
/** Override the display name in the UI (CSF v3) */
|
|
@@ -667,7 +926,7 @@ type StoryAnnotations<TRenderer extends Renderer = Renderer, TArgs = Args, TRequ
|
|
|
667
926
|
/** Function that is executed after the story is rendered. */
|
|
668
927
|
play?: PlayFunction<TRenderer, TArgs>;
|
|
669
928
|
/** Override the globals values for this story */
|
|
670
|
-
globals?: Globals;
|
|
929
|
+
globals?: Globals & (TRenderer['csf4'] extends true ? CoreTypes['globals'] & TRenderer['globals'] : unknown);
|
|
671
930
|
/** @deprecated */
|
|
672
931
|
story?: Omit<StoryAnnotations<TRenderer, TArgs>, 'story'>;
|
|
673
932
|
} & ({} extends TRequiredArgs ? {
|
|
@@ -695,24 +954,48 @@ declare const includeConditionalArg: (argType: InputType, args: Args, globals: G
|
|
|
695
954
|
|
|
696
955
|
interface Preview<TRenderer extends Renderer$1 = Renderer$1> {
|
|
697
956
|
readonly _tag: 'Preview';
|
|
698
|
-
input: ProjectAnnotations$1<TRenderer
|
|
957
|
+
input: ProjectAnnotations$1<TRenderer> & {
|
|
958
|
+
addons?: PreviewAddon<never>[];
|
|
959
|
+
};
|
|
699
960
|
composed: NormalizedProjectAnnotations<TRenderer>;
|
|
700
|
-
meta
|
|
961
|
+
meta<TArgs extends Args$1, TInput extends ComponentAnnotations$1<TRenderer & {
|
|
962
|
+
args: TArgs;
|
|
963
|
+
}, TArgs>>(input: TInput): Meta<TRenderer & {
|
|
964
|
+
args: TArgs;
|
|
965
|
+
}, TInput>;
|
|
701
966
|
}
|
|
967
|
+
type InferTypes<T extends PreviewAddon<never>[]> = T extends PreviewAddon<infer C>[] ? C & {
|
|
968
|
+
csf4: true;
|
|
969
|
+
} : never;
|
|
970
|
+
declare function definePreview<TRenderer extends Renderer$1, Addons extends PreviewAddon<never>[]>(input: ProjectAnnotations$1<TRenderer> & {
|
|
971
|
+
addons?: Addons;
|
|
972
|
+
}): Preview<TRenderer & InferTypes<Addons>>;
|
|
973
|
+
interface PreviewAddon<in TExtraContext extends AddonTypes$1 = AddonTypes$1> extends ProjectAnnotations$1<Renderer$1> {
|
|
974
|
+
}
|
|
975
|
+
declare function definePreviewAddon<TExtraContext extends AddonTypes$1 = AddonTypes$1>(preview: ProjectAnnotations$1<Renderer$1>): PreviewAddon<TExtraContext>;
|
|
702
976
|
declare function isPreview(input: unknown): input is Preview<Renderer$1>;
|
|
703
|
-
interface Meta<TRenderer extends Renderer$1,
|
|
977
|
+
interface Meta<TRenderer extends Renderer$1, TInput extends ComponentAnnotations$1<TRenderer, TRenderer['args']> = ComponentAnnotations$1<TRenderer, TRenderer['args']>> {
|
|
704
978
|
readonly _tag: 'Meta';
|
|
705
|
-
input:
|
|
706
|
-
composed: NormalizedComponentAnnotations<TRenderer>;
|
|
979
|
+
input: TInput;
|
|
707
980
|
preview: Preview<TRenderer>;
|
|
708
|
-
story(input
|
|
981
|
+
story(input?: () => TRenderer['storyResult']): Story<TRenderer, {
|
|
982
|
+
render: () => TRenderer['storyResult'];
|
|
983
|
+
}>;
|
|
984
|
+
story<TInput extends StoryAnnotations$1<TRenderer, TRenderer['args']>>(input?: TInput): Story<TRenderer, TInput>;
|
|
709
985
|
}
|
|
710
986
|
declare function isMeta(input: unknown): input is Meta<Renderer$1>;
|
|
711
|
-
interface Story<TRenderer extends Renderer$1,
|
|
987
|
+
interface Story<TRenderer extends Renderer$1, TInput extends StoryAnnotations$1<TRenderer, TRenderer['args']> = StoryAnnotations$1<TRenderer, TRenderer['args']>> {
|
|
712
988
|
readonly _tag: 'Story';
|
|
713
|
-
input:
|
|
714
|
-
composed:
|
|
715
|
-
|
|
989
|
+
input: TInput;
|
|
990
|
+
composed: Pick<ComposedStoryFn<TRenderer>, 'argTypes' | 'parameters' | 'id' | 'tags' | 'globals'> & {
|
|
991
|
+
args: TRenderer['args'];
|
|
992
|
+
name: string;
|
|
993
|
+
};
|
|
994
|
+
meta: Meta<TRenderer>;
|
|
995
|
+
__compose: () => ComposedStoryFn<TRenderer>;
|
|
996
|
+
play: TInput['play'];
|
|
997
|
+
run: (context?: Partial<StoryContext$1<TRenderer, Partial<TRenderer['args']>>>) => Promise<void>;
|
|
998
|
+
extend<TInput extends StoryAnnotations$1<TRenderer, TRenderer['args']>>(input: TInput): Story<TRenderer, TInput>;
|
|
716
999
|
}
|
|
717
1000
|
declare function isStory<TRenderer extends Renderer$1>(input: unknown): input is Story<TRenderer>;
|
|
718
1001
|
|
|
@@ -745,4 +1028,4 @@ declare const parseKind: (kind: string, { rootSeparator, groupSeparator }: Separ
|
|
|
745
1028
|
/** Combine a set of project / meta / story tags, removing duplicates and handling negations. */
|
|
746
1029
|
declare const combineTags: (...tags: string[]) => string[];
|
|
747
1030
|
|
|
748
|
-
export { type AfterEach, type AnnotatedStoryFn, type AnyFramework, type ArgTypes, type ArgTypesEnhancer, type Args, type ArgsEnhancer, type ArgsFromMeta, type ArgsStoryFn, type BaseAnnotations, type BeforeAll, type BeforeEach, type Canvas, type CleanupCallback, type ComponentAnnotations, type ComponentId, type ComponentTitle, type Conditional, type DecoratorApplicator, type DecoratorFunction, type GlobalTypes, type Globals, type IncludeExcludeOptions, type InputType, type LegacyAnnotatedStoryFn, type LegacyStoryAnnotationsOrFn, type LegacyStoryFn, type LoaderFunction, type Meta, type Parameters, type PartialStoryFn, type PlayFunction, type PlayFunctionContext, type Preview, type ProjectAnnotations, type Renderer, type SBArrayType, type SBEnumType, type SBIntersectionType, type SBObjectType, type SBOtherType, type SBScalarType, type SBType, type SBUnionType, type SeparatorOptions, type StepFunction, type StepLabel, type StepRunner, type Story, type StoryAnnotations, type StoryAnnotationsOrFn, type StoryContext, type StoryContextForEnhancers, type StoryContextForLoaders, type StoryContextUpdate, type StoryFn, type StoryId, type StoryIdentifier, type StoryKind, type StoryName, type StrictArgTypes, type StrictArgs, type StrictGlobalTypes, type StrictInputType, type StrictParameters, type Tag, type ViewMode, combineTags, includeConditionalArg, isExportStory, isMeta, isPreview, isStory, parseKind, sanitize, storyNameFromExport, toId };
|
|
1031
|
+
export { type AddonTypes, type AfterEach, type AnnotatedStoryFn, type AnyFramework, type ArgTypes, type ArgTypesEnhancer, type Args, type ArgsEnhancer, type ArgsFromMeta, type ArgsStoryFn, type BaseAnnotations, type BeforeAll, type BeforeEach, type Canvas, type CleanupCallback, type ComponentAnnotations, type ComponentId, type ComponentTitle, type Conditional, type CoreTypes, type DecoratorApplicator, type DecoratorFunction, type GlobalTypes, type Globals, type IncludeExcludeOptions, type InferTypes, type InputType, type LegacyAnnotatedStoryFn, type LegacyStoryAnnotationsOrFn, type LegacyStoryFn, type LoaderFunction, type Meta, type Parameters, type PartialStoryFn, type PlayFunction, type PlayFunctionContext, type Preview, type PreviewAddon, type ProjectAnnotations, type Renderer, type SBArrayType, type SBEnumType, type SBIntersectionType, type SBObjectType, type SBOtherType, type SBScalarType, type SBType, type SBUnionType, type SeparatorOptions, type StepFunction, type StepLabel, type StepRunner, type Story, type StoryAnnotations, type StoryAnnotationsOrFn, type StoryContext, type StoryContextForEnhancers, type StoryContextForLoaders, type StoryContextUpdate, type StoryFn, type StoryId, type StoryIdentifier, type StoryKind, type StoryName, type StrictArgTypes, type StrictArgs, type StrictGlobalTypes, type StrictInputType, type StrictParameters, type Tag, type ViewMode, combineTags, definePreview, definePreviewAddon, getCoreAnnotations, includeConditionalArg, isExportStory, isMeta, isPreview, isStory, parseKind, sanitize, storyNameFromExport, toId };
|