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
@@ -1,76 +1,77 @@
1
1
  "use strict";
2
- var Y = Object.create;
3
- var p = Object.defineProperty;
4
- var H = Object.getOwnPropertyDescriptor;
5
- var K = Object.getOwnPropertyNames;
6
- var U = Object.getPrototypeOf, X = Object.prototype.hasOwnProperty;
7
- var r = (t, o) => p(t, "name", { value: o, configurable: !0 });
8
- var B = (t, o) => () => (o || t((o = { exports: {} }).exports, o), o.exports), J = (t, o) => {
2
+ var U = Object.create;
3
+ var g = Object.defineProperty;
4
+ var K = Object.getOwnPropertyDescriptor;
5
+ var X = Object.getOwnPropertyNames;
6
+ var J = Object.getPrototypeOf, B = Object.prototype.hasOwnProperty;
7
+ var s = (t, o) => g(t, "name", { value: o, configurable: !0 });
8
+ var z = (t, o) => () => (o || t((o = { exports: {} }).exports, o), o.exports), q = (t, o) => {
9
9
  for (var e in o)
10
- p(t, e, { get: o[e], enumerable: !0 });
11
- }, D = (t, o, e, i) => {
10
+ g(t, e, { get: o[e], enumerable: !0 });
11
+ }, M = (t, o, e, i) => {
12
12
  if (o && typeof o == "object" || typeof o == "function")
13
- for (let u of K(o))
14
- !X.call(t, u) && u !== e && p(t, u, { get: () => o[u], enumerable: !(i = H(o, u)) || i.enumerable });
13
+ for (let u of X(o))
14
+ !B.call(t, u) && u !== e && g(t, u, { get: () => o[u], enumerable: !(i = K(o, u)) || i.enumerable });
15
15
  return t;
16
16
  };
17
- var z = (t, o, e) => (e = t != null ? Y(U(t)) : {}, D(
17
+ var Q = (t, o, e) => (e = t != null ? U(J(t)) : {}, M(
18
18
  // If the importer is in node compatibility mode or this is not an ESM
19
19
  // file that has been converted to a CommonJS file using a Babel-
20
20
  // compatible transform (i.e. "__esModule" has not been set), then set
21
21
  // "default" to the CommonJS "module.exports" for node compatibility.
22
- o || !t || !t.__esModule ? p(e, "default", { value: t, enumerable: !0 }) : e,
22
+ o || !t || !t.__esModule ? g(e, "default", { value: t, enumerable: !0 }) : e,
23
23
  t
24
- )), q = (t) => D(p({}, "__esModule", { value: !0 }), t);
24
+ )), Z = (t) => M(g({}, "__esModule", { value: !0 }), t);
25
25
 
26
26
  // ../node_modules/ts-dedent/dist/index.js
27
- var M = B((E) => {
27
+ var F = z((h) => {
28
28
  "use strict";
29
- Object.defineProperty(E, "__esModule", { value: !0 });
30
- E.dedent = void 0;
31
- function j(t) {
29
+ Object.defineProperty(h, "__esModule", { value: !0 });
30
+ h.dedent = void 0;
31
+ function L(t) {
32
32
  for (var o = [], e = 1; e < arguments.length; e++)
33
33
  o[e - 1] = arguments[e];
34
34
  var i = Array.from(typeof t == "string" ? [t] : t);
35
35
  i[i.length - 1] = i[i.length - 1].replace(/\r?\n([\t ]*)$/, "");
36
- var u = i.reduce(function(c, m) {
37
- var g = m.match(/\n([\t ]+|(?!\s).)/g);
38
- return g ? c.concat(g.map(function(f) {
36
+ var u = i.reduce(function(c, E) {
37
+ var p = E.match(/\n([\t ]+|(?!\s).)/g);
38
+ return p ? c.concat(p.map(function(f) {
39
39
  var l, y;
40
40
  return (y = (l = f.match(/[\t ]/g)) === null || l === void 0 ? void 0 : l.length) !== null && y !== void 0 ? y : 0;
41
41
  })) : c;
42
42
  }, []);
43
43
  if (u.length) {
44
- var h = new RegExp(`
44
+ var m = new RegExp(`
45
45
  [ ]{` + Math.min.apply(Math, u) + "}", "g");
46
46
  i = i.map(function(c) {
47
- return c.replace(h, `
47
+ return c.replace(m, `
48
48
  `);
49
49
  });
50
50
  }
51
51
  i[0] = i[0].replace(/^\r?\n/, "");
52
52
  var d = i[0];
53
- return o.forEach(function(c, m) {
54
- var g = d.match(/(?:^|\n)( *)$/), f = g ? g[1] : "", l = c;
53
+ return o.forEach(function(c, E) {
54
+ var p = d.match(/(?:^|\n)( *)$/), f = p ? p[1] : "", l = c;
55
55
  typeof c == "string" && c.includes(`
56
56
  `) && (l = String(c).split(`
57
- `).map(function(y, G) {
58
- return G === 0 ? y : "" + f + y;
57
+ `).map(function(y, H) {
58
+ return H === 0 ? y : "" + f + y;
59
59
  }).join(`
60
- `)), d += l + i[m + 1];
60
+ `)), d += l + i[E + 1];
61
61
  }), d;
62
62
  }
63
- r(j, "dedent");
64
- E.dedent = j;
65
- E.default = j;
63
+ s(L, "dedent");
64
+ h.dedent = L;
65
+ h.default = L;
66
66
  });
67
67
 
68
68
  // src/preview-errors.ts
69
- var Q = {};
70
- J(Q, {
69
+ var ee = {};
70
+ q(ee, {
71
71
  CalledExtractOnStoreError: () => I,
72
- CalledPreviewMethodBeforeInitializationError: () => P,
73
- Category: () => F,
72
+ CalledPreviewMethodBeforeInitializationError: () => x,
73
+ Category: () => G,
74
+ ElementA11yParameterError: () => j,
74
75
  EmptyIndexError: () => w,
75
76
  ImplicitActionsDuringRendering: () => b,
76
77
  MdxFileWithNoCsfReferencesError: () => S,
@@ -79,28 +80,29 @@ J(Q, {
79
80
  MissingStoryFromCsfFileError: () => k,
80
81
  MountMustBeDestructuredError: () => N,
81
82
  NextJsSharpError: () => W,
82
- NextjsRouterMocksNotAvailable: () => O,
83
- NoRenderFunctionError: () => V,
83
+ NextjsRouterMocksNotAvailable: () => $,
84
+ NoRenderFunctionError: () => A,
84
85
  NoStoryMatchError: () => T,
85
- NoStoryMountedError: () => A,
86
- StoryIndexFetchError: () => x,
86
+ NoStoryMountedError: () => V,
87
+ StatusTypeIdMismatchError: () => O,
88
+ StoryIndexFetchError: () => P,
87
89
  StoryStoreAccessedBeforeInitializationError: () => v,
88
- UnknownArgTypesError: () => $,
90
+ UnknownArgTypesError: () => D,
89
91
  UnsupportedViewportDimensionError: () => C
90
92
  });
91
- module.exports = q(Q);
92
- var a = z(M(), 1);
93
+ module.exports = Z(ee);
94
+ var a = Q(F(), 1);
93
95
 
94
96
  // src/storybook-error.ts
95
- function L({
97
+ function Y({
96
98
  code: t,
97
99
  category: o
98
100
  }) {
99
101
  let e = String(t).padStart(4, "0");
100
102
  return `SB_${o}_${e}`;
101
103
  }
102
- r(L, "parseErrorCode");
103
- var s = class t extends Error {
104
+ s(Y, "parseErrorCode");
105
+ var r = class t extends Error {
104
106
  constructor(e) {
105
107
  super(t.getFullMessage(e));
106
108
  /**
@@ -113,10 +115,10 @@ var s = class t extends Error {
113
115
  this.category = e.category, this.documentation = e.documentation ?? !1, this.code = e.code;
114
116
  }
115
117
  static {
116
- r(this, "StorybookError");
118
+ s(this, "StorybookError");
117
119
  }
118
120
  get fullErrorCode() {
119
- return L({ code: this.code, category: this.category });
121
+ return Y({ code: this.code, category: this.category });
120
122
  }
121
123
  /** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */
122
124
  get name() {
@@ -128,13 +130,13 @@ var s = class t extends Error {
128
130
  documentation: e,
129
131
  code: i,
130
132
  category: u,
131
- message: h
133
+ message: m
132
134
  }) {
133
135
  let d;
134
- return e === !0 ? d = `https://storybook.js.org/error/${L({ code: i, category: u })}` : typeof e == "string" ? d = e : Array.isArray(e) &&
136
+ return e === !0 ? d = `https://storybook.js.org/error/${Y({ code: i, category: u })}` : typeof e == "string" ? d = e : Array.isArray(e) &&
135
137
  (d = `
136
138
  ${e.map((c) => ` - ${c}`).join(`
137
- `)}`), `${h}${d != null ? `
139
+ `)}`), `${m}${d != null ? `
138
140
 
139
141
  More info: ${d}
140
142
  ` : ""}`;
@@ -142,12 +144,12 @@ More info: ${d}
142
144
  };
143
145
 
144
146
  // src/preview-errors.ts
145
- var F = /* @__PURE__ */ ((n) => (n.BLOCKS = "BLOCKS", n.DOCS_TOOLS = "DOCS-TOOLS", n.PREVIEW_CLIENT_LOGGER = "PREVIEW_CLIENT-LOGGER", n.PREVIEW_CHANNELS =
147
+ var G = /* @__PURE__ */ ((n) => (n.BLOCKS = "BLOCKS", n.DOCS_TOOLS = "DOCS-TOOLS", n.PREVIEW_CLIENT_LOGGER = "PREVIEW_CLIENT-LOGGER", n.PREVIEW_CHANNELS =
146
148
  "PREVIEW_CHANNELS", n.PREVIEW_CORE_EVENTS = "PREVIEW_CORE-EVENTS", n.PREVIEW_INSTRUMENTER = "PREVIEW_INSTRUMENTER", n.PREVIEW_API = "PREVIEW\
147
149
  _API", n.PREVIEW_REACT_DOM_SHIM = "PREVIEW_REACT-DOM-SHIM", n.PREVIEW_ROUTER = "PREVIEW_ROUTER", n.PREVIEW_THEMING = "PREVIEW_THEMING", n.RENDERER_HTML =
148
150
  "RENDERER_HTML", n.RENDERER_PREACT = "RENDERER_PREACT", n.RENDERER_REACT = "RENDERER_REACT", n.RENDERER_SERVER = "RENDERER_SERVER", n.RENDERER_SVELTE =
149
151
  "RENDERER_SVELTE", n.RENDERER_VUE = "RENDERER_VUE", n.RENDERER_VUE3 = "RENDERER_VUE3", n.RENDERER_WEB_COMPONENTS = "RENDERER_WEB-COMPONENTS",
150
- n.FRAMEWORK_NEXTJS = "FRAMEWORK_NEXTJS", n.ADDON_VITEST = "ADDON_VITEST", n))(F || {}), R = class extends s {
152
+ n.FRAMEWORK_NEXTJS = "FRAMEWORK_NEXTJS", n.ADDON_VITEST = "ADDON_VITEST", n.ADDON_A11Y = "ADDON_A11Y", n))(G || {}), R = class extends r {
151
153
  constructor(e) {
152
154
  super({
153
155
  category: "PREVIEW_API",
@@ -163,9 +165,9 @@ n.FRAMEWORK_NEXTJS = "FRAMEWORK_NEXTJS", n.ADDON_VITEST = "ADDON_VITEST", n))(F
163
165
  this.data = e;
164
166
  }
165
167
  static {
166
- r(this, "MissingStoryAfterHmrError");
168
+ s(this, "MissingStoryAfterHmrError");
167
169
  }
168
- }, b = class extends s {
170
+ }, b = class extends r {
169
171
  constructor(e) {
170
172
  super({
171
173
  category: "PREVIEW_API",
@@ -178,7 +180,7 @@ for-example-in-the-play-function",
178
180
  This is deprecated and won't work in Storybook 8 anymore.
179
181
  ` : ""}
180
182
  Please provide an explicit spy to your args like this:
181
- import { fn } from '@storybook/test';
183
+ import { fn } from 'storybook/test';
182
184
  ...
183
185
  args: {
184
186
  ${e.name}: fn()
@@ -187,11 +189,11 @@ This is deprecated and won't work in Storybook 8 anymore.
187
189
  this.data = e;
188
190
  }
189
191
  static {
190
- r(this, "ImplicitActionsDuringRendering");
192
+ s(this, "ImplicitActionsDuringRendering");
191
193
  }
192
- }, I = class extends s {
194
+ }, I = class extends r {
193
195
  static {
194
- r(this, "CalledExtractOnStoreError");
196
+ s(this, "CalledExtractOnStoreError");
195
197
  }
196
198
  constructor() {
197
199
  super({
@@ -203,9 +205,9 @@ This is deprecated and won't work in Storybook 8 anymore.
203
205
  You probably meant to call \`await preview.extract()\` which does the above for you.`
204
206
  });
205
207
  }
206
- }, _ = class extends s {
208
+ }, _ = class extends r {
207
209
  static {
208
- r(this, "MissingRenderToCanvasError");
210
+ s(this, "MissingRenderToCanvasError");
209
211
  }
210
212
  constructor() {
211
213
  super({
@@ -218,7 +220,7 @@ This is deprecated and won't work in Storybook 8 anymore.
218
220
  documentation: "https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#mainjs-framework-field"
219
221
  });
220
222
  }
221
- }, P = class extends s {
223
+ }, x = class extends r {
222
224
  constructor(e) {
223
225
  super({
224
226
  category: "PREVIEW_API",
@@ -235,9 +237,9 @@ This is deprecated and won't work in Storybook 8 anymore.
235
237
  this.data = e;
236
238
  }
237
239
  static {
238
- r(this, "CalledPreviewMethodBeforeInitializationError");
240
+ s(this, "CalledPreviewMethodBeforeInitializationError");
239
241
  }
240
- }, x = class extends s {
242
+ }, P = class extends r {
241
243
  constructor(e) {
242
244
  super({
243
245
  category: "PREVIEW_API",
@@ -256,9 +258,9 @@ This is deprecated and won't work in Storybook 8 anymore.
256
258
  this.data = e;
257
259
  }
258
260
  static {
259
- r(this, "StoryIndexFetchError");
261
+ s(this, "StoryIndexFetchError");
260
262
  }
261
- }, S = class extends s {
263
+ }, S = class extends r {
262
264
  constructor(e) {
263
265
  super({
264
266
  category: "PREVIEW_API",
@@ -273,11 +275,11 @@ This is deprecated and won't work in Storybook 8 anymore.
273
275
  this.data = e;
274
276
  }
275
277
  static {
276
- r(this, "MdxFileWithNoCsfReferencesError");
278
+ s(this, "MdxFileWithNoCsfReferencesError");
277
279
  }
278
- }, w = class extends s {
280
+ }, w = class extends r {
279
281
  static {
280
- r(this, "EmptyIndexError");
282
+ s(this, "EmptyIndexError");
281
283
  }
282
284
  constructor() {
283
285
  super({
@@ -290,7 +292,7 @@ This is deprecated and won't work in Storybook 8 anymore.
290
292
  - Also check the browser console and terminal for error messages.`
291
293
  });
292
294
  }
293
- }, T = class extends s {
295
+ }, T = class extends r {
294
296
  constructor(e) {
295
297
  super({
296
298
  category: "PREVIEW_API",
@@ -305,9 +307,9 @@ This is deprecated and won't work in Storybook 8 anymore.
305
307
  this.data = e;
306
308
  }
307
309
  static {
308
- r(this, "NoStoryMatchError");
310
+ s(this, "NoStoryMatchError");
309
311
  }
310
- }, k = class extends s {
312
+ }, k = class extends r {
311
313
  constructor(e) {
312
314
  super({
313
315
  category: "PREVIEW_API",
@@ -325,11 +327,11 @@ This is deprecated and won't work in Storybook 8 anymore.
325
327
  this.data = e;
326
328
  }
327
329
  static {
328
- r(this, "MissingStoryFromCsfFileError");
330
+ s(this, "MissingStoryFromCsfFileError");
329
331
  }
330
- }, v = class extends s {
332
+ }, v = class extends r {
331
333
  static {
332
- r(this, "StoryStoreAccessedBeforeInitializationError");
334
+ s(this, "StoryStoreAccessedBeforeInitializationError");
333
335
  }
334
336
  constructor() {
335
337
  super({
@@ -342,7 +344,7 @@ This is deprecated and won't work in Storybook 8 anymore.
342
344
  remove access to the store entirely`
343
345
  });
344
346
  }
345
- }, N = class extends s {
347
+ }, N = class extends r {
346
348
  constructor(e) {
347
349
  super({
348
350
  category: "PREVIEW_API",
@@ -369,9 +371,9 @@ This is deprecated and won't work in Storybook 8 anymore.
369
371
  this.data = e;
370
372
  }
371
373
  static {
372
- r(this, "MountMustBeDestructuredError");
374
+ s(this, "MountMustBeDestructuredError");
373
375
  }
374
- }, V = class extends s {
376
+ }, A = class extends r {
375
377
  constructor(e) {
376
378
  super({
377
379
  category: "PREVIEW_API",
@@ -383,11 +385,11 @@ This is deprecated and won't work in Storybook 8 anymore.
383
385
  this.data = e;
384
386
  }
385
387
  static {
386
- r(this, "NoRenderFunctionError");
388
+ s(this, "NoRenderFunctionError");
387
389
  }
388
- }, A = class extends s {
390
+ }, V = class extends r {
389
391
  static {
390
- r(this, "NoStoryMountedError");
392
+ s(this, "NoStoryMountedError");
391
393
  }
392
394
  constructor() {
393
395
  super({
@@ -411,9 +413,25 @@ This is deprecated and won't work in Storybook 8 anymore.
411
413
  `
412
414
  });
413
415
  }
414
- }, W = class extends s {
416
+ }, O = class extends r {
417
+ constructor(e) {
418
+ super({
419
+ category: "PREVIEW_API",
420
+ code: 16,
421
+ message: `Status has typeId "${e.status.typeId}" but was added to store with typeId "${e.typeId}". Full status: ${JSON.stringify(
422
+ e.status,
423
+ null,
424
+ 2
425
+ )}`
426
+ });
427
+ this.data = e;
428
+ }
429
+ static {
430
+ s(this, "StatusTypeIdMismatchError");
431
+ }
432
+ }, W = class extends r {
415
433
  static {
416
- r(this, "NextJsSharpError");
434
+ s(this, "NextJsSharpError");
417
435
  }
418
436
  constructor() {
419
437
  super({
@@ -427,7 +445,7 @@ This is deprecated and won't work in Storybook 8 anymore.
427
445
  `
428
446
  });
429
447
  }
430
- }, O = class extends s {
448
+ }, $ = class extends r {
431
449
  constructor(e) {
432
450
  super({
433
451
  category: "FRAMEWORK_NEXTJS",
@@ -439,9 +457,9 @@ This is deprecated and won't work in Storybook 8 anymore.
439
457
  this.data = e;
440
458
  }
441
459
  static {
442
- r(this, "NextjsRouterMocksNotAvailable");
460
+ s(this, "NextjsRouterMocksNotAvailable");
443
461
  }
444
- }, $ = class extends s {
462
+ }, D = class extends r {
445
463
  constructor(e) {
446
464
  super({
447
465
  category: "DOCS-TOOLS",
@@ -460,9 +478,9 @@ This is deprecated and won't work in Storybook 8 anymore.
460
478
  this.data = e;
461
479
  }
462
480
  static {
463
- r(this, "UnknownArgTypesError");
481
+ s(this, "UnknownArgTypesError");
464
482
  }
465
- }, C = class extends s {
483
+ }, C = class extends r {
466
484
  constructor(e) {
467
485
  super({
468
486
  category: "ADDON_VITEST",
@@ -481,6 +499,19 @@ This is deprecated and won't work in Storybook 8 anymore.
481
499
  this.data = e;
482
500
  }
483
501
  static {
484
- r(this, "UnsupportedViewportDimensionError");
502
+ s(this, "UnsupportedViewportDimensionError");
503
+ }
504
+ }, j = class extends r {
505
+ static {
506
+ s(this, "ElementA11yParameterError");
507
+ }
508
+ constructor() {
509
+ super({
510
+ category: "ADDON_A11Y",
511
+ code: 1,
512
+ documentation: "https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#a11y-addon-replace-element-parameter-with-context-para\
513
+ meter",
514
+ message: 'The "element" parameter in parameters.a11y has been removed. Use "context" instead.'
515
+ });
485
516
  }
486
517
  };
@@ -1,3 +1,17 @@
1
+ import { StoryId } from 'storybook/internal/csf';
2
+
3
+ type StatusValue = 'status-value:pending' | 'status-value:success' | 'status-value:error' | 'status-value:warning' | 'status-value:unknown';
4
+ type StatusTypeId = string;
5
+ interface Status {
6
+ value: StatusValue;
7
+ typeId: StatusTypeId;
8
+ storyId: StoryId;
9
+ title: string;
10
+ description: string;
11
+ data?: any;
12
+ sidebarContextMenu?: boolean;
13
+ }
14
+
1
15
  declare abstract class StorybookError extends Error {
2
16
  /** Category of the error. Used to classify the type of error, e.g., 'PREVIEW_API'. */
3
17
  readonly category: string;
@@ -60,7 +74,8 @@ declare enum Category {
60
74
  RENDERER_VUE3 = "RENDERER_VUE3",
61
75
  RENDERER_WEB_COMPONENTS = "RENDERER_WEB-COMPONENTS",
62
76
  FRAMEWORK_NEXTJS = "FRAMEWORK_NEXTJS",
63
- ADDON_VITEST = "ADDON_VITEST"
77
+ ADDON_VITEST = "ADDON_VITEST",
78
+ ADDON_A11Y = "ADDON_A11Y"
64
79
  }
65
80
  declare class MissingStoryAfterHmrError extends StorybookError {
66
81
  data: {
@@ -153,6 +168,16 @@ declare class NoRenderFunctionError extends StorybookError {
153
168
  declare class NoStoryMountedError extends StorybookError {
154
169
  constructor();
155
170
  }
171
+ declare class StatusTypeIdMismatchError extends StorybookError {
172
+ data: {
173
+ status: Status;
174
+ typeId: StatusTypeId;
175
+ };
176
+ constructor(data: {
177
+ status: Status;
178
+ typeId: StatusTypeId;
179
+ });
180
+ }
156
181
  declare class NextJsSharpError extends StorybookError {
157
182
  constructor();
158
183
  }
@@ -184,5 +209,8 @@ declare class UnsupportedViewportDimensionError extends StorybookError {
184
209
  value: string;
185
210
  });
186
211
  }
212
+ declare class ElementA11yParameterError extends StorybookError {
213
+ constructor();
214
+ }
187
215
 
188
- export { CalledExtractOnStoreError, CalledPreviewMethodBeforeInitializationError, Category, EmptyIndexError, ImplicitActionsDuringRendering, MdxFileWithNoCsfReferencesError, MissingRenderToCanvasError, MissingStoryAfterHmrError, MissingStoryFromCsfFileError, MountMustBeDestructuredError, NextJsSharpError, NextjsRouterMocksNotAvailable, NoRenderFunctionError, NoStoryMatchError, NoStoryMountedError, StoryIndexFetchError, StoryStoreAccessedBeforeInitializationError, UnknownArgTypesError, UnsupportedViewportDimensionError };
216
+ export { CalledExtractOnStoreError, CalledPreviewMethodBeforeInitializationError, Category, ElementA11yParameterError, EmptyIndexError, ImplicitActionsDuringRendering, MdxFileWithNoCsfReferencesError, MissingRenderToCanvasError, MissingStoryAfterHmrError, MissingStoryFromCsfFileError, MountMustBeDestructuredError, NextJsSharpError, NextjsRouterMocksNotAvailable, NoRenderFunctionError, NoStoryMatchError, NoStoryMountedError, StatusTypeIdMismatchError, StoryIndexFetchError, StoryStoreAccessedBeforeInitializationError, UnknownArgTypesError, UnsupportedViewportDimensionError };