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,53 +1,53 @@
1
- var oe = Object.defineProperty;
2
- var t = (u, n) => oe(u, "name", { value: n, configurable: !0 });
1
+ var M = Object.defineProperty;
2
+ var o = (t, n) => M(t, "name", { value: n, configurable: !0 });
3
3
 
4
4
  // ../node_modules/ts-dedent/esm/index.js
5
- function r(u) {
5
+ function a(t) {
6
6
  for (var n = [], e = 1; e < arguments.length; e++)
7
7
  n[e - 1] = arguments[e];
8
- var a = Array.from(typeof u == "string" ? [u] : u);
9
- a[a.length - 1] = a[a.length - 1].replace(/\r?\n([\t ]*)$/, "");
10
- var g = a.reduce(function(i, m) {
11
- var y = m.match(/\n([\t ]+|(?!\s).)/g);
12
- return y ? i.concat(y.map(function(E) {
13
- var l, d;
14
- return (d = (l = E.match(/[\t ]/g)) === null || l === void 0 ? void 0 : l.length) !== null && d !== void 0 ? d : 0;
15
- })) : i;
8
+ var i = Array.from(typeof t == "string" ? [t] : t);
9
+ i[i.length - 1] = i[i.length - 1].replace(/\r?\n([\t ]*)$/, "");
10
+ var p = i.reduce(function(c, h) {
11
+ var y = h.match(/\n([\t ]+|(?!\s).)/g);
12
+ return y ? c.concat(y.map(function(m) {
13
+ var d, l;
14
+ return (l = (d = m.match(/[\t ]/g)) === null || d === void 0 ? void 0 : d.length) !== null && l !== void 0 ? l : 0;
15
+ })) : c;
16
16
  }, []);
17
- if (g.length) {
18
- var h = new RegExp(`
19
- [ ]{` + Math.min.apply(Math, g) + "}", "g");
20
- a = a.map(function(i) {
21
- return i.replace(h, `
17
+ if (p.length) {
18
+ var g = new RegExp(`
19
+ [ ]{` + Math.min.apply(Math, p) + "}", "g");
20
+ i = i.map(function(c) {
21
+ return c.replace(g, `
22
22
  `);
23
23
  });
24
24
  }
25
- a[0] = a[0].replace(/^\r?\n/, "");
26
- var c = a[0];
27
- return n.forEach(function(i, m) {
28
- var y = c.match(/(?:^|\n)( *)$/), E = y ? y[1] : "", l = i;
29
- typeof i == "string" && i.includes(`
30
- `) && (l = String(i).split(`
31
- `).map(function(d, te) {
32
- return te === 0 ? d : "" + E + d;
25
+ i[0] = i[0].replace(/^\r?\n/, "");
26
+ var u = i[0];
27
+ return n.forEach(function(c, h) {
28
+ var y = u.match(/(?:^|\n)( *)$/), m = y ? y[1] : "", d = c;
29
+ typeof c == "string" && c.includes(`
30
+ `) && (d = String(c).split(`
31
+ `).map(function(l, j) {
32
+ return j === 0 ? l : "" + m + l;
33
33
  }).join(`
34
- `)), c += l + a[m + 1];
35
- }), c;
34
+ `)), u += d + i[h + 1];
35
+ }), u;
36
36
  }
37
- t(r, "dedent");
37
+ o(a, "dedent");
38
38
 
39
39
  // src/storybook-error.ts
40
- function C({
41
- code: u,
40
+ function E({
41
+ code: t,
42
42
  category: n
43
43
  }) {
44
- let e = String(u).padStart(4, "0");
44
+ let e = String(t).padStart(4, "0");
45
45
  return `SB_${n}_${e}`;
46
46
  }
47
- t(C, "parseErrorCode");
48
- var p = class p extends Error {
47
+ o(E, "parseErrorCode");
48
+ var s = class t extends Error {
49
49
  constructor(e) {
50
- super(p.getFullMessage(e));
50
+ super(t.getFullMessage(e));
51
51
  /**
52
52
  * Data associated with the error. Used to provide additional information in the error message or
53
53
  * to be passed to telemetry.
@@ -57,8 +57,11 @@ var p = class p extends Error {
57
57
  this.fromStorybook = !0;
58
58
  this.category = e.category, this.documentation = e.documentation ?? !1, this.code = e.code;
59
59
  }
60
+ static {
61
+ o(this, "StorybookError");
62
+ }
60
63
  get fullErrorCode() {
61
- return C({ code: this.code, category: this.category });
64
+ return E({ code: this.code, category: this.category });
62
65
  }
63
66
  /** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */
64
67
  get name() {
@@ -68,35 +71,33 @@ var p = class p extends Error {
68
71
  /** Generates the error message along with additional documentation link (if applicable). */
69
72
  static getFullMessage({
70
73
  documentation: e,
71
- code: a,
72
- category: g,
73
- message: h
74
+ code: i,
75
+ category: p,
76
+ message: g
74
77
  }) {
75
- let c;
76
- return e === !0 ? c = `https://storybook.js.org/error/${C({ code: a, category: g })}` : typeof e == "string" ? c = e : Array.isArray(e) &&
77
- (c = `
78
- ${e.map((i) => ` - ${i}`).join(`
79
- `)}`), `${h}${c != null ? `
78
+ let u;
79
+ return e === !0 ? u = `https://storybook.js.org/error/${E({ code: i, category: p })}` : typeof e == "string" ? u = e : Array.isArray(e) &&
80
+ (u = `
81
+ ${e.map((c) => ` - ${c}`).join(`
82
+ `)}`), `${g}${u != null ? `
80
83
 
81
- More info: ${c}
84
+ More info: ${u}
82
85
  ` : ""}`;
83
86
  }
84
87
  };
85
- t(p, "StorybookError");
86
- var o = p;
87
88
 
88
89
  // src/preview-errors.ts
89
- var se = /* @__PURE__ */ ((s) => (s.BLOCKS = "BLOCKS", s.DOCS_TOOLS = "DOCS-TOOLS", s.PREVIEW_CLIENT_LOGGER = "PREVIEW_CLIENT-LOGGER", s.PREVIEW_CHANNELS =
90
- "PREVIEW_CHANNELS", s.PREVIEW_CORE_EVENTS = "PREVIEW_CORE-EVENTS", s.PREVIEW_INSTRUMENTER = "PREVIEW_INSTRUMENTER", s.PREVIEW_API = "PREVIEW\
91
- _API", s.PREVIEW_REACT_DOM_SHIM = "PREVIEW_REACT-DOM-SHIM", s.PREVIEW_ROUTER = "PREVIEW_ROUTER", s.PREVIEW_THEMING = "PREVIEW_THEMING", s.RENDERER_HTML =
92
- "RENDERER_HTML", s.RENDERER_PREACT = "RENDERER_PREACT", s.RENDERER_REACT = "RENDERER_REACT", s.RENDERER_SERVER = "RENDERER_SERVER", s.RENDERER_SVELTE =
93
- "RENDERER_SVELTE", s.RENDERER_VUE = "RENDERER_VUE", s.RENDERER_VUE3 = "RENDERER_VUE3", s.RENDERER_WEB_COMPONENTS = "RENDERER_WEB-COMPONENTS",
94
- s.FRAMEWORK_NEXTJS = "FRAMEWORK_NEXTJS", s.ADDON_VITEST = "ADDON_VITEST", s))(se || {}), f = class f extends o {
90
+ var L = /* @__PURE__ */ ((r) => (r.BLOCKS = "BLOCKS", r.DOCS_TOOLS = "DOCS-TOOLS", r.PREVIEW_CLIENT_LOGGER = "PREVIEW_CLIENT-LOGGER", r.PREVIEW_CHANNELS =
91
+ "PREVIEW_CHANNELS", r.PREVIEW_CORE_EVENTS = "PREVIEW_CORE-EVENTS", r.PREVIEW_INSTRUMENTER = "PREVIEW_INSTRUMENTER", r.PREVIEW_API = "PREVIEW\
92
+ _API", r.PREVIEW_REACT_DOM_SHIM = "PREVIEW_REACT-DOM-SHIM", r.PREVIEW_ROUTER = "PREVIEW_ROUTER", r.PREVIEW_THEMING = "PREVIEW_THEMING", r.RENDERER_HTML =
93
+ "RENDERER_HTML", r.RENDERER_PREACT = "RENDERER_PREACT", r.RENDERER_REACT = "RENDERER_REACT", r.RENDERER_SERVER = "RENDERER_SERVER", r.RENDERER_SVELTE =
94
+ "RENDERER_SVELTE", r.RENDERER_VUE = "RENDERER_VUE", r.RENDERER_VUE3 = "RENDERER_VUE3", r.RENDERER_WEB_COMPONENTS = "RENDERER_WEB-COMPONENTS",
95
+ r.FRAMEWORK_NEXTJS = "FRAMEWORK_NEXTJS", r.ADDON_VITEST = "ADDON_VITEST", r.ADDON_A11Y = "ADDON_A11Y", r))(L || {}), f = class extends s {
95
96
  constructor(e) {
96
97
  super({
97
98
  category: "PREVIEW_API",
98
99
  code: 1,
99
- message: r`
100
+ message: a`
100
101
  Couldn't find story matching id '${e.storyId}' after HMR.
101
102
  - Did you just rename a story?
102
103
  - Did you remove it from your CSF file?
@@ -106,22 +107,23 @@ s.FRAMEWORK_NEXTJS = "FRAMEWORK_NEXTJS", s.ADDON_VITEST = "ADDON_VITEST", s))(se
106
107
  });
107
108
  this.data = e;
108
109
  }
109
- };
110
- t(f, "MissingStoryAfterHmrError");
111
- var D = f, R = class R extends o {
110
+ static {
111
+ o(this, "MissingStoryAfterHmrError");
112
+ }
113
+ }, R = class extends s {
112
114
  constructor(e) {
113
115
  super({
114
116
  category: "PREVIEW_API",
115
117
  code: 2,
116
118
  documentation: "https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#using-implicit-actions-during-rendering-is-deprecated-\
117
119
  for-example-in-the-play-function",
118
- message: r`
120
+ message: a`
119
121
  We detected that you use an implicit action arg while ${e.phase} of your story.
120
122
  ${e.deprecated ? `
121
123
  This is deprecated and won't work in Storybook 8 anymore.
122
124
  ` : ""}
123
125
  Please provide an explicit spy to your args like this:
124
- import { fn } from '@storybook/test';
126
+ import { fn } from 'storybook/test';
125
127
  ...
126
128
  args: {
127
129
  ${e.name}: fn()
@@ -129,41 +131,44 @@ This is deprecated and won't work in Storybook 8 anymore.
129
131
  });
130
132
  this.data = e;
131
133
  }
132
- };
133
- t(R, "ImplicitActionsDuringRendering");
134
- var j = R, b = class b extends o {
134
+ static {
135
+ o(this, "ImplicitActionsDuringRendering");
136
+ }
137
+ }, b = class extends s {
138
+ static {
139
+ o(this, "CalledExtractOnStoreError");
140
+ }
135
141
  constructor() {
136
142
  super({
137
143
  category: "PREVIEW_API",
138
144
  code: 3,
139
- message: r`
145
+ message: a`
140
146
  Cannot call \`storyStore.extract()\` without calling \`storyStore.cacheAllCsfFiles()\` first.
141
147
 
142
148
  You probably meant to call \`await preview.extract()\` which does the above for you.`
143
149
  });
144
150
  }
145
- };
146
- t(b, "CalledExtractOnStoreError");
147
- var L = b, I = class I extends o {
151
+ }, I = class extends s {
152
+ static {
153
+ o(this, "MissingRenderToCanvasError");
154
+ }
148
155
  constructor() {
149
156
  super({
150
157
  category: "PREVIEW_API",
151
158
  code: 4,
152
- message: r`
159
+ message: a`
153
160
  Expected your framework's preset to export a \`renderToCanvas\` field.
154
161
 
155
162
  Perhaps it needs to be upgraded for Storybook 7.0?`,
156
163
  documentation: "https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#mainjs-framework-field"
157
164
  });
158
165
  }
159
- };
160
- t(I, "MissingRenderToCanvasError");
161
- var G = I, P = class P extends o {
166
+ }, x = class extends s {
162
167
  constructor(e) {
163
168
  super({
164
169
  category: "PREVIEW_API",
165
170
  code: 5,
166
- message: r`
171
+ message: a`
167
172
  Called \`Preview.${e.methodName}()\` before initialization.
168
173
 
169
174
  The preview needs to load the story index before most methods can be called. If you want
@@ -174,14 +179,15 @@ var G = I, P = class P extends o {
174
179
  });
175
180
  this.data = e;
176
181
  }
177
- };
178
- t(P, "CalledPreviewMethodBeforeInitializationError");
179
- var Y = P, x = class x extends o {
182
+ static {
183
+ o(this, "CalledPreviewMethodBeforeInitializationError");
184
+ }
185
+ }, _ = class extends s {
180
186
  constructor(e) {
181
187
  super({
182
188
  category: "PREVIEW_API",
183
189
  code: 6,
184
- message: r`
190
+ message: a`
185
191
  Error fetching \`/index.json\`:
186
192
 
187
193
  ${e.text}
@@ -194,14 +200,15 @@ var Y = P, x = class x extends o {
194
200
  });
195
201
  this.data = e;
196
202
  }
197
- };
198
- t(x, "StoryIndexFetchError");
199
- var M = x, T = class T extends o {
203
+ static {
204
+ o(this, "StoryIndexFetchError");
205
+ }
206
+ }, S = class extends s {
200
207
  constructor(e) {
201
208
  super({
202
209
  category: "PREVIEW_API",
203
210
  code: 7,
204
- message: r`
211
+ message: a`
205
212
  Tried to render docs entry ${e.storyId} but it is a MDX file that has no CSF
206
213
  references, or autodocs for a CSF file that some doesn't refer to itself.
207
214
 
@@ -210,28 +217,30 @@ var M = x, T = class T extends o {
210
217
  });
211
218
  this.data = e;
212
219
  }
213
- };
214
- t(T, "MdxFileWithNoCsfReferencesError");
215
- var H = T, w = class w extends o {
220
+ static {
221
+ o(this, "MdxFileWithNoCsfReferencesError");
222
+ }
223
+ }, P = class extends s {
224
+ static {
225
+ o(this, "EmptyIndexError");
226
+ }
216
227
  constructor() {
217
228
  super({
218
229
  category: "PREVIEW_API",
219
230
  code: 8,
220
- message: r`
231
+ message: a`
221
232
  Couldn't find any stories in your Storybook.
222
233
 
223
234
  - Please check your stories field of your main.js config: does it match correctly?
224
235
  - Also check the browser console and terminal for error messages.`
225
236
  });
226
237
  }
227
- };
228
- t(w, "EmptyIndexError");
229
- var F = w, k = class k extends o {
238
+ }, w = class extends s {
230
239
  constructor(e) {
231
240
  super({
232
241
  category: "PREVIEW_API",
233
242
  code: 9,
234
- message: r`
243
+ message: a`
235
244
  Couldn't find story matching '${e.storySpecifier}'.
236
245
 
237
246
  - Are you sure a story with that id exists?
@@ -240,14 +249,15 @@ var F = w, k = class k extends o {
240
249
  });
241
250
  this.data = e;
242
251
  }
243
- };
244
- t(k, "NoStoryMatchError");
245
- var K = k, S = class S extends o {
252
+ static {
253
+ o(this, "NoStoryMatchError");
254
+ }
255
+ }, T = class extends s {
246
256
  constructor(e) {
247
257
  super({
248
258
  category: "PREVIEW_API",
249
259
  code: 10,
250
- message: r`
260
+ message: a`
251
261
  Couldn't find story matching id '${e.storyId}' after importing a CSF file.
252
262
 
253
263
  The file was indexed as if the story was there, but then after importing the file in the browser
@@ -259,28 +269,30 @@ var K = k, S = class S extends o {
259
269
  });
260
270
  this.data = e;
261
271
  }
262
- };
263
- t(S, "MissingStoryFromCsfFileError");
264
- var X = S, v = class v extends o {
272
+ static {
273
+ o(this, "MissingStoryFromCsfFileError");
274
+ }
275
+ }, k = class extends s {
276
+ static {
277
+ o(this, "StoryStoreAccessedBeforeInitializationError");
278
+ }
265
279
  constructor() {
266
280
  super({
267
281
  category: "PREVIEW_API",
268
282
  code: 11,
269
- message: r`
283
+ message: a`
270
284
  Cannot access the Story Store until the index is ready.
271
285
 
272
286
  It is not recommended to use methods directly on the Story Store anyway, in Storybook 9 we will
273
287
  remove access to the store entirely`
274
288
  });
275
289
  }
276
- };
277
- t(v, "StoryStoreAccessedBeforeInitializationError");
278
- var U = v, _ = class _ extends o {
290
+ }, N = class extends s {
279
291
  constructor(e) {
280
292
  super({
281
293
  category: "PREVIEW_API",
282
294
  code: 12,
283
- message: r`
295
+ message: a`
284
296
  Incorrect use of mount in the play function.
285
297
 
286
298
  To use mount in the play function, you must satisfy the following two requirements:
@@ -301,27 +313,32 @@ var U = v, _ = class _ extends o {
301
313
  });
302
314
  this.data = e;
303
315
  }
304
- };
305
- t(_, "MountMustBeDestructuredError");
306
- var J = _, V = class V extends o {
316
+ static {
317
+ o(this, "MountMustBeDestructuredError");
318
+ }
319
+ }, v = class extends s {
307
320
  constructor(e) {
308
321
  super({
309
322
  category: "PREVIEW_API",
310
323
  code: 14,
311
- message: r`
324
+ message: a`
312
325
  No render function available for storyId '${e.id}'
313
326
  `
314
327
  });
315
328
  this.data = e;
316
329
  }
317
- };
318
- t(V, "NoRenderFunctionError");
319
- var q = V, N = class N extends o {
330
+ static {
331
+ o(this, "NoRenderFunctionError");
332
+ }
333
+ }, A = class extends s {
334
+ static {
335
+ o(this, "NoStoryMountedError");
336
+ }
320
337
  constructor() {
321
338
  super({
322
339
  category: "PREVIEW_API",
323
340
  code: 15,
324
- message: r`
341
+ message: a`
325
342
  No component is mounted in your story.
326
343
 
327
344
  This usually occurs when you destructure mount in the play function, but forget to call it.
@@ -339,43 +356,59 @@ var q = V, N = class N extends o {
339
356
  `
340
357
  });
341
358
  }
342
- };
343
- t(N, "NoStoryMountedError");
344
- var z = N, A = class A extends o {
359
+ }, V = class extends s {
360
+ constructor(e) {
361
+ super({
362
+ category: "PREVIEW_API",
363
+ code: 16,
364
+ message: `Status has typeId "${e.status.typeId}" but was added to store with typeId "${e.typeId}". Full status: ${JSON.stringify(
365
+ e.status,
366
+ null,
367
+ 2
368
+ )}`
369
+ });
370
+ this.data = e;
371
+ }
372
+ static {
373
+ o(this, "StatusTypeIdMismatchError");
374
+ }
375
+ }, O = class extends s {
376
+ static {
377
+ o(this, "NextJsSharpError");
378
+ }
345
379
  constructor() {
346
380
  super({
347
381
  category: "FRAMEWORK_NEXTJS",
348
382
  code: 1,
349
383
  documentation: "https://storybook.js.org/docs/get-started/nextjs#faq",
350
- message: r`
384
+ message: a`
351
385
  You are importing avif images, but you don't have sharp installed.
352
386
 
353
387
  You have to install sharp in order to use image optimization features in Next.js.
354
388
  `
355
389
  });
356
390
  }
357
- };
358
- t(A, "NextJsSharpError");
359
- var B = A, W = class W extends o {
391
+ }, W = class extends s {
360
392
  constructor(e) {
361
393
  super({
362
394
  category: "FRAMEWORK_NEXTJS",
363
395
  code: 2,
364
- message: r`
396
+ message: a`
365
397
  Tried to access router mocks from "${e.importType}" but they were not created yet. You might be running code in an unsupported environment.
366
398
  `
367
399
  });
368
400
  this.data = e;
369
401
  }
370
- };
371
- t(W, "NextjsRouterMocksNotAvailable");
372
- var Q = W, $ = class $ extends o {
402
+ static {
403
+ o(this, "NextjsRouterMocksNotAvailable");
404
+ }
405
+ }, $ = class extends s {
373
406
  constructor(e) {
374
407
  super({
375
408
  category: "DOCS-TOOLS",
376
409
  code: 1,
377
410
  documentation: "https://github.com/storybookjs/storybook/issues/26606",
378
- message: r`
411
+ message: a`
379
412
  There was a failure when generating detailed ArgTypes in ${e.language} for:
380
413
  ${JSON.stringify(e.type, null, 2)}
381
414
 
@@ -387,16 +420,17 @@ var Q = W, $ = class $ extends o {
387
420
  });
388
421
  this.data = e;
389
422
  }
390
- };
391
- t($, "UnknownArgTypesError");
392
- var Z = $, O = class O extends o {
423
+ static {
424
+ o(this, "UnknownArgTypesError");
425
+ }
426
+ }, D = class extends s {
393
427
  constructor(e) {
394
428
  super({
395
429
  category: "ADDON_VITEST",
396
430
  code: 1,
397
431
  // TODO: Add documentation about viewports support
398
432
  // documentation: '',
399
- message: r`
433
+ message: a`
400
434
  Encountered an unsupported value "${e.value}" when setting the viewport ${e.dimension} dimension.
401
435
 
402
436
  The Storybook plugin only supports values in the following units:
@@ -407,27 +441,43 @@ var Z = $, O = class O extends o {
407
441
  });
408
442
  this.data = e;
409
443
  }
444
+ static {
445
+ o(this, "UnsupportedViewportDimensionError");
446
+ }
447
+ }, C = class extends s {
448
+ static {
449
+ o(this, "ElementA11yParameterError");
450
+ }
451
+ constructor() {
452
+ super({
453
+ category: "ADDON_A11Y",
454
+ code: 1,
455
+ documentation: "https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#a11y-addon-replace-element-parameter-with-context-para\
456
+ meter",
457
+ message: 'The "element" parameter in parameters.a11y has been removed. Use "context" instead.'
458
+ });
459
+ }
410
460
  };
411
- t(O, "UnsupportedViewportDimensionError");
412
- var ee = O;
413
461
  export {
414
- L as CalledExtractOnStoreError,
415
- Y as CalledPreviewMethodBeforeInitializationError,
416
- se as Category,
417
- F as EmptyIndexError,
418
- j as ImplicitActionsDuringRendering,
419
- H as MdxFileWithNoCsfReferencesError,
420
- G as MissingRenderToCanvasError,
421
- D as MissingStoryAfterHmrError,
422
- X as MissingStoryFromCsfFileError,
423
- J as MountMustBeDestructuredError,
424
- B as NextJsSharpError,
425
- Q as NextjsRouterMocksNotAvailable,
426
- q as NoRenderFunctionError,
427
- K as NoStoryMatchError,
428
- z as NoStoryMountedError,
429
- M as StoryIndexFetchError,
430
- U as StoryStoreAccessedBeforeInitializationError,
431
- Z as UnknownArgTypesError,
432
- ee as UnsupportedViewportDimensionError
462
+ b as CalledExtractOnStoreError,
463
+ x as CalledPreviewMethodBeforeInitializationError,
464
+ L as Category,
465
+ C as ElementA11yParameterError,
466
+ P as EmptyIndexError,
467
+ R as ImplicitActionsDuringRendering,
468
+ S as MdxFileWithNoCsfReferencesError,
469
+ I as MissingRenderToCanvasError,
470
+ f as MissingStoryAfterHmrError,
471
+ T as MissingStoryFromCsfFileError,
472
+ N as MountMustBeDestructuredError,
473
+ O as NextJsSharpError,
474
+ W as NextjsRouterMocksNotAvailable,
475
+ v as NoRenderFunctionError,
476
+ w as NoStoryMatchError,
477
+ A as NoStoryMountedError,
478
+ V as StatusTypeIdMismatchError,
479
+ _ as StoryIndexFetchError,
480
+ k as StoryStoreAccessedBeforeInitializationError,
481
+ $ as UnknownArgTypesError,
482
+ D as UnsupportedViewportDimensionError
433
483
  };