storybook 9.0.0-alpha.2 → 9.0.0-alpha.21

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.
Files changed (162) hide show
  1. package/README.md +1 -1
  2. package/assets/docs/addon-backgrounds.gif +0 -0
  3. package/assets/docs/addon-controls-args-annotated.png +0 -0
  4. package/assets/docs/addon-controls-args-background-color.png +0 -0
  5. package/assets/docs/addon-controls-args-background-string.png +0 -0
  6. package/assets/docs/addon-controls-args-docs.png +0 -0
  7. package/assets/docs/addon-controls-args-logging.png +0 -0
  8. package/assets/docs/addon-controls-args-no-annotation.png +0 -0
  9. package/assets/docs/addon-controls-args-reflow-slider.png +0 -0
  10. package/assets/docs/addon-controls-args-reflow.png +0 -0
  11. package/assets/docs/addon-controls-args-template.png +0 -0
  12. package/assets/docs/addon-controls-expanded.png +0 -0
  13. package/assets/docs/addon-controls-hero.gif +0 -0
  14. package/assets/docs/addon-controls-install.png +0 -0
  15. package/assets/docs/hero.gif +0 -0
  16. package/assets/docs/highlight.png +0 -0
  17. package/assets/docs/viewport.png +0 -0
  18. package/assets/server/base-preview-head.html +1 -3
  19. package/bin/index.cjs +2 -2
  20. package/dist/actions/decorator.d.ts +6 -0
  21. package/dist/actions/decorator.js +134 -0
  22. package/dist/actions/index.cjs +123 -0
  23. package/dist/actions/index.d.ts +102 -0
  24. package/dist/actions/index.js +108 -0
  25. package/dist/actions/preview.cjs +161 -0
  26. package/dist/actions/preview.d.ts +54 -0
  27. package/dist/actions/preview.js +152 -0
  28. package/dist/babel/index.cjs +822 -816
  29. package/dist/babel/index.js +822 -816
  30. package/dist/backgrounds/index.cjs +148 -0
  31. package/dist/backgrounds/index.d.ts +91 -0
  32. package/dist/backgrounds/index.js +130 -0
  33. package/dist/backgrounds/preview.cjs +143 -0
  34. package/dist/backgrounds/preview.d.ts +54 -0
  35. package/dist/backgrounds/preview.js +127 -0
  36. package/dist/bin/index.cjs +49 -70
  37. package/dist/bin/index.js +49 -70
  38. package/dist/builder-manager/index.cjs +319 -326
  39. package/dist/builder-manager/index.js +576 -583
  40. package/dist/channels/index.cjs +1026 -981
  41. package/dist/channels/index.js +1258 -1207
  42. package/dist/cli/bin/index.cjs +483 -483
  43. package/dist/cli/bin/index.js +495 -495
  44. package/dist/cli/index.cjs +61735 -7590
  45. package/dist/cli/index.d.ts +25 -21
  46. package/dist/cli/index.js +61776 -7631
  47. package/dist/client-logger/index.cjs +56 -88
  48. package/dist/client-logger/index.js +41 -47
  49. package/dist/common/index.cjs +16137 -9085
  50. package/dist/common/index.d.ts +35 -30
  51. package/dist/common/index.js +16230 -9172
  52. package/dist/component-testing/index.cjs +23 -0
  53. package/dist/component-testing/index.d.ts +3 -0
  54. package/dist/component-testing/index.js +5 -0
  55. package/dist/component-testing/preview.cjs +40 -0
  56. package/dist/component-testing/preview.d.ts +5 -0
  57. package/dist/component-testing/preview.js +25 -0
  58. package/dist/components/index.cjs +16268 -24926
  59. package/dist/components/index.d.ts +98 -347
  60. package/dist/components/index.js +5905 -19177
  61. package/dist/controls/decorator.d.ts +5 -0
  62. package/dist/controls/decorator.js +8 -0
  63. package/dist/controls/index.cjs +26 -0
  64. package/dist/controls/index.d.ts +39 -0
  65. package/dist/controls/index.js +6 -0
  66. package/dist/controls/preview.cjs +26 -0
  67. package/dist/controls/preview.d.ts +54 -0
  68. package/dist/controls/preview.js +9 -0
  69. package/dist/core-events/index.cjs +91 -106
  70. package/dist/core-events/index.d.ts +139 -104
  71. package/dist/core-events/index.js +79 -94
  72. package/dist/core-server/index.cjs +13898 -13409
  73. package/dist/core-server/index.d.ts +270 -3
  74. package/dist/core-server/index.js +13981 -13497
  75. package/dist/core-server/presets/common-manager.css +170 -0
  76. package/dist/core-server/presets/common-manager.js +12149 -17
  77. package/dist/core-server/presets/common-preset.cjs +3009 -3155
  78. package/dist/core-server/presets/common-preset.js +2862 -3009
  79. package/dist/csf/index.cjs +76 -120
  80. package/dist/csf/index.d.ts +2 -6
  81. package/dist/csf/index.js +69 -113
  82. package/dist/csf-tools/index.cjs +412 -403
  83. package/dist/csf-tools/index.d.ts +0 -4
  84. package/dist/csf-tools/index.js +410 -401
  85. package/dist/docs-tools/index.cjs +2569 -575
  86. package/dist/docs-tools/index.d.ts +2 -2
  87. package/dist/docs-tools/index.js +2565 -564
  88. package/dist/highlight/index.cjs +27 -0
  89. package/dist/highlight/index.d.ts +61 -0
  90. package/dist/highlight/index.js +7 -0
  91. package/dist/highlight/preview.cjs +535 -0
  92. package/dist/highlight/preview.d.ts +54 -0
  93. package/dist/highlight/preview.js +519 -0
  94. package/dist/instrumenter/index.cjs +2207 -2342
  95. package/dist/instrumenter/index.d.ts +8 -7
  96. package/dist/instrumenter/index.js +2430 -2603
  97. package/dist/manager/globals-module-info.cjs +291 -151
  98. package/dist/manager/globals-module-info.d.ts +1 -1
  99. package/dist/manager/globals-module-info.js +275 -135
  100. package/dist/manager/globals-runtime.js +60263 -28383
  101. package/dist/manager/globals.cjs +23 -19
  102. package/dist/manager/globals.d.ts +8 -5
  103. package/dist/manager/globals.js +10 -6
  104. package/dist/manager/runtime.js +4625 -3921
  105. package/dist/manager-api/index.cjs +4228 -3833
  106. package/dist/manager-api/index.d.ts +398 -102
  107. package/dist/manager-api/index.js +3500 -3084
  108. package/dist/manager-errors.d.ts +25 -1
  109. package/dist/manager-errors.js +50 -30
  110. package/dist/measure/index.cjs +476 -0
  111. package/dist/measure/index.d.ts +66 -0
  112. package/dist/measure/index.js +464 -0
  113. package/dist/measure/preview.cjs +466 -0
  114. package/dist/measure/preview.d.ts +59 -0
  115. package/dist/measure/preview.js +450 -0
  116. package/dist/outline/index.cjs +528 -0
  117. package/dist/outline/index.d.ts +66 -0
  118. package/dist/outline/index.js +500 -0
  119. package/dist/outline/preview.cjs +518 -0
  120. package/dist/outline/preview.d.ts +59 -0
  121. package/dist/outline/preview.js +486 -0
  122. package/dist/preview/globals.cjs +21 -17
  123. package/dist/preview/globals.d.ts +4 -1
  124. package/dist/preview/globals.js +6 -2
  125. package/dist/preview/runtime.js +46311 -6614
  126. package/dist/preview-api/index.cjs +1363 -1899
  127. package/dist/preview-api/index.d.ts +81 -395
  128. package/dist/preview-api/index.js +1711 -2169
  129. package/dist/preview-errors.cjs +119 -88
  130. package/dist/preview-errors.d.ts +30 -2
  131. package/dist/preview-errors.js +192 -142
  132. package/dist/router/index.cjs +847 -871
  133. package/dist/router/index.js +193 -199
  134. package/dist/server-errors.cjs +188 -124
  135. package/dist/server-errors.d.ts +36 -2
  136. package/dist/server-errors.js +188 -124
  137. package/dist/telemetry/index.cjs +1056 -1979
  138. package/dist/telemetry/index.d.ts +26 -5
  139. package/dist/telemetry/index.js +1091 -2010
  140. package/dist/test/index.cjs +35686 -0
  141. package/dist/test/index.d.ts +186 -0
  142. package/dist/test/index.js +33840 -0
  143. package/dist/test/preview.cjs +15870 -0
  144. package/dist/test/preview.d.ts +48 -0
  145. package/dist/test/preview.js +14501 -0
  146. package/dist/test/spy.cjs +258 -0
  147. package/dist/test/spy.d.ts +66 -0
  148. package/dist/test/spy.js +240 -0
  149. package/dist/theming/create.cjs +79 -2269
  150. package/dist/theming/create.js +67 -841
  151. package/dist/theming/index.cjs +1065 -3232
  152. package/dist/theming/index.js +951 -1719
  153. package/dist/types/index.cjs +11 -12
  154. package/dist/types/index.d.ts +684 -163
  155. package/dist/types/index.js +1 -2
  156. package/dist/viewport/index.cjs +310 -0
  157. package/dist/viewport/index.d.ts +320 -0
  158. package/dist/viewport/index.js +290 -0
  159. package/dist/viewport/preview.cjs +35 -0
  160. package/dist/viewport/preview.d.ts +68 -0
  161. package/dist/viewport/preview.js +19 -0
  162. package/package.json +359 -12
@@ -7,63 +7,42 @@ import { ConfigFile } from 'storybook/internal/csf-tools';
7
7
 
8
8
  declare const _default: {
9
9
  '@storybook/addon-a11y': string;
10
- '@storybook/addon-actions': string;
11
- '@storybook/addon-backgrounds': string;
12
- '@storybook/addon-controls': string;
13
10
  '@storybook/addon-docs': string;
14
- '@storybook/addon-essentials': string;
15
- '@storybook/addon-mdx-gfm': string;
16
- '@storybook/addon-highlight': string;
17
- '@storybook/addon-interactions': string;
18
11
  '@storybook/addon-jest': string;
19
12
  '@storybook/addon-links': string;
20
- '@storybook/addon-measure': string;
21
13
  '@storybook/addon-onboarding': string;
22
- '@storybook/addon-outline': string;
23
- '@storybook/addon-storysource': string;
24
- '@storybook/addon-test': string;
14
+ 'storybook-addon-pseudo-states': string;
25
15
  '@storybook/addon-themes': string;
26
- '@storybook/addon-toolbars': string;
27
- '@storybook/addon-viewport': string;
16
+ '@storybook/addon-vitest': string;
28
17
  '@storybook/builder-vite': string;
29
18
  '@storybook/builder-webpack5': string;
30
19
  storybook: string;
31
20
  '@storybook/angular': string;
32
21
  '@storybook/ember': string;
33
- '@storybook/experimental-nextjs-vite': string;
34
22
  '@storybook/html-vite': string;
35
- '@storybook/html-webpack5': string;
36
23
  '@storybook/nextjs': string;
24
+ '@storybook/nextjs-vite': string;
37
25
  '@storybook/preact-vite': string;
38
- '@storybook/preact-webpack5': string;
39
26
  '@storybook/react-native-web-vite': string;
40
27
  '@storybook/react-vite': string;
41
28
  '@storybook/react-webpack5': string;
42
29
  '@storybook/server-webpack5': string;
43
30
  '@storybook/svelte-vite': string;
44
- '@storybook/svelte-webpack5': string;
45
31
  '@storybook/sveltekit': string;
46
32
  '@storybook/vue3-vite': string;
47
- '@storybook/vue3-webpack5': string;
48
33
  '@storybook/web-components-vite': string;
49
- '@storybook/web-components-webpack5': string;
50
- '@storybook/blocks': string;
51
34
  sb: string;
52
35
  '@storybook/cli': string;
53
36
  '@storybook/codemod': string;
54
37
  '@storybook/core-webpack': string;
55
38
  'create-storybook': string;
56
39
  '@storybook/csf-plugin': string;
40
+ 'eslint-plugin-storybook': string;
57
41
  '@storybook/react-dom-shim': string;
58
42
  '@storybook/source-loader': string;
59
- '@storybook/test': string;
60
43
  '@storybook/preset-create-react-app': string;
61
- '@storybook/preset-html-webpack': string;
62
- '@storybook/preset-preact-webpack': string;
63
44
  '@storybook/preset-react-webpack': string;
64
45
  '@storybook/preset-server-webpack': string;
65
- '@storybook/preset-svelte-webpack': string;
66
- '@storybook/preset-vue3-webpack': string;
67
46
  '@storybook/html': string;
68
47
  '@storybook/preact': string;
69
48
  '@storybook/react': string;
@@ -83,7 +62,6 @@ declare function filterPresetsConfig(presetsConfig: PresetConfig[]): PresetConfi
83
62
  *
84
63
  * Valid inputs:
85
64
  *
86
- * - `'@storybook/addon-actions/manager' => { type: 'virtual', item }`
87
65
  * - `'@storybook/addon-docs/preset' => { type: 'presets', item }`
88
66
  * - `'@storybook/addon-docs' => { type: 'presets', item: '@storybook/addon-docs/preset' }`
89
67
  * - `{ name: '@storybook/addon-docs(/preset)?', options: { } } => { type: 'presets', item: { name:
@@ -525,7 +503,6 @@ declare abstract class JsPackageManager {
525
503
  * ```ts
526
504
  * addDependencies(options, [
527
505
  * `@storybook/react@${storybookVersion}`,
528
- * `@storybook/addon-actions@${actionsVersion}`,
529
506
  * `@storybook/addon-links@${linksVersion}`,
530
507
  * ]);
531
508
  * ```
@@ -538,6 +515,7 @@ declare abstract class JsPackageManager {
538
515
  skipInstall?: boolean;
539
516
  installAsDevDependencies?: boolean;
540
517
  packageJson?: PackageJson;
518
+ writeOutputToFile?: boolean;
541
519
  }, dependencies: string[]): Promise<void>;
542
520
  /**
543
521
  * Remove dependencies from a project using `yarn remove` or `npm uninstall`.
@@ -545,7 +523,7 @@ declare abstract class JsPackageManager {
545
523
  * @example
546
524
  *
547
525
  * ```ts
548
- * removeDependencies(options, [`@storybook/react`, `@storybook/addon-actions`]);
526
+ * removeDependencies(options, [`@storybook/react`]);
549
527
  * ```
550
528
  *
551
529
  * @param {Object} options Contains `skipInstall`, `packageJson` and `installAsDevDependencies`
@@ -601,7 +579,7 @@ declare abstract class JsPackageManager {
601
579
  addScripts(scripts: Record<string, string>): Promise<void>;
602
580
  addPackageResolutions(versions: Record<string, string>): Promise<void>;
603
581
  protected abstract runInstall(): Promise<void>;
604
- protected abstract runAddDeps(dependencies: string[], installAsDevDependencies: boolean): Promise<void>;
582
+ protected abstract runAddDeps(dependencies: string[], installAsDevDependencies: boolean, writeOutputToFile?: boolean): Promise<void>;
605
583
  protected abstract runRemoveDeps(dependencies: string[]): Promise<void>;
606
584
  protected abstract getResolutions(packageJson: PackageJson, versions: Record<string, string>): Record<string, any>;
607
585
  /**
@@ -952,4 +930,31 @@ declare const getAddonNames: (mainConfig: StorybookConfig) => string[];
952
930
  declare function syncStorybookAddons(mainConfig: StorybookConfig, previewConfigPath: string): Promise<void>;
953
931
  declare function getSyncedStorybookAddons(mainConfig: StorybookConfig, previewConfig: ConfigFile): Promise<ConfigFile>;
954
932
 
955
- export { type FileOptions, FileSystemCache, HandledError, type InstallationMetadata, JsPackageManager, JsPackageManagerFactory, type PackageJsonWithDepsAndDevDeps, type PackageJsonWithMaybeDeps, type PackageManagerName, type PackageMetadata, boost, builderPackages, cache, checkAddonOrder, codeLog, commandLog, commonGlobOptions, createFileSystemCache, createLogStream, extractProperFrameworkName, extractProperRendererNameFromFramework, filterPresetsConfig, findConfigFile, formatFileContent, frameworkPackages, frameworkToRenderer, getAddonNames, getAutoRefs, getBuilderOptions, getChars, getCoercedStorybookVersion, getConfigInfo, getDirectoryFromWorkingDir, getEnvConfig, getFrameworkName, getInterpretedFile, getInterpretedFileWithExt, getPackageDetails, getPresets, getPreviewBodyTemplate, getPreviewHeadTemplate, getProjectRoot, getRefs, getRendererName, getStoryId, getStoryTitle, getStorybookConfiguration, getStorybookInfo, getSyncedStorybookAddons, globToRegexp, interopRequireDefault, interpolate, isCorePackage, isPreservingSymlinks, loadAllPresets, loadCustomPresets, loadEnvs, loadMainConfig, loadManagerOrAddonsFile, loadPreset, loadPreviewOrConfigFile, logConfig, nodePathsToArray, normalizeStories, normalizeStoriesEntry, normalizeStoryPath, paddedLog, parseList, posix, readTemplate, removeAddon, rendererPackages, resolveAddonName, resolvePathInStorybookCache, satisfies, serverRequire, serverResolve, stringifyEnvs, stringifyProcessEnvs, stripAbsNodeModulesPath, syncStorybookAddons, temporaryDirectory, temporaryFile, validateConfigurationFiles, validateFrameworkName, _default as versions };
933
+ /**
934
+ * Helper function to scan for files matching a glob pattern and transform them
935
+ *
936
+ * @param options Configuration options
937
+ * @param transform Function to transform the found files
938
+ * @returns Array of errors encountered during transformation
939
+ */
940
+ declare function scanAndTransformFiles<T extends Record<string, unknown>>({ promptMessage, defaultGlob, dryRun, force, transformFn, transformOptions, }: {
941
+ promptMessage?: string;
942
+ defaultGlob?: string;
943
+ dryRun: boolean;
944
+ force?: boolean;
945
+ transformFn: (files: string[], options: T, dryRun: boolean) => Promise<Array<{
946
+ file: string;
947
+ error: Error;
948
+ }>>;
949
+ transformOptions: T;
950
+ }): Promise<Array<{
951
+ file: string;
952
+ error: Error;
953
+ }>>;
954
+
955
+ declare const transformImportFiles: (files: string[], renamedImports: Record<string, string>, dryRun?: boolean) => Promise<{
956
+ file: string;
957
+ error: Error;
958
+ }[]>;
959
+
960
+ export { type FileOptions, FileSystemCache, HandledError, type InstallationMetadata, JsPackageManager, JsPackageManagerFactory, type PackageJsonWithDepsAndDevDeps, type PackageJsonWithMaybeDeps, type PackageManagerName, type PackageMetadata, boost, builderPackages, cache, checkAddonOrder, codeLog, commandLog, commonGlobOptions, createFileSystemCache, createLogStream, extractProperFrameworkName, extractProperRendererNameFromFramework, filterPresetsConfig, findConfigFile, formatFileContent, frameworkPackages, frameworkToRenderer, getAddonNames, getAutoRefs, getBuilderOptions, getChars, getCoercedStorybookVersion, getConfigInfo, getDirectoryFromWorkingDir, getEnvConfig, getFrameworkName, getInterpretedFile, getInterpretedFileWithExt, getPackageDetails, getPresets, getPreviewBodyTemplate, getPreviewHeadTemplate, getProjectRoot, getRefs, getRendererName, getStoryId, getStoryTitle, getStorybookConfiguration, getStorybookInfo, getSyncedStorybookAddons, globToRegexp, interopRequireDefault, interpolate, isCorePackage, isPreservingSymlinks, loadAllPresets, loadCustomPresets, loadEnvs, loadMainConfig, loadManagerOrAddonsFile, loadPreset, loadPreviewOrConfigFile, logConfig, nodePathsToArray, normalizeStories, normalizeStoriesEntry, normalizeStoryPath, paddedLog, parseList, posix, readTemplate, removeAddon, rendererPackages, resolveAddonName, resolvePathInStorybookCache, satisfies, scanAndTransformFiles, serverRequire, serverResolve, stringifyEnvs, stringifyProcessEnvs, stripAbsNodeModulesPath, syncStorybookAddons, temporaryDirectory, temporaryFile, transformImportFiles, validateConfigurationFiles, validateFrameworkName, _default as versions };