storybook 9.0.0-alpha.3 → 9.0.0-alpha.4

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 (73) hide show
  1. package/README.md +1 -1
  2. package/dist/actions/decorator.d.ts +6 -0
  3. package/dist/actions/decorator.js +139 -0
  4. package/dist/actions/index.cjs +127 -0
  5. package/dist/actions/index.d.ts +105 -0
  6. package/dist/actions/index.js +112 -0
  7. package/dist/actions/manager.js +1196 -0
  8. package/dist/actions/preview.cjs +165 -0
  9. package/dist/actions/preview.d.ts +55 -0
  10. package/dist/actions/preview.js +156 -0
  11. package/dist/bin/index.cjs +63 -64
  12. package/dist/bin/index.js +63 -64
  13. package/dist/channels/index.cjs +207 -230
  14. package/dist/channels/index.js +302 -304
  15. package/dist/cli/bin/index.cjs +405 -405
  16. package/dist/cli/bin/index.js +410 -410
  17. package/dist/client-logger/index.cjs +56 -88
  18. package/dist/client-logger/index.js +41 -47
  19. package/dist/common/index.cjs +65 -67
  20. package/dist/common/index.d.ts +1 -4
  21. package/dist/common/index.js +65 -67
  22. package/dist/components/index.cjs +9413 -11578
  23. package/dist/components/index.d.ts +92 -92
  24. package/dist/components/index.js +6768 -7544
  25. package/dist/core-events/index.d.ts +138 -25
  26. package/dist/core-server/index.cjs +5241 -5265
  27. package/dist/core-server/index.js +5353 -5375
  28. package/dist/core-server/presets/common-manager.js +11 -19
  29. package/dist/core-server/presets/common-preset.cjs +243 -242
  30. package/dist/core-server/presets/common-preset.js +379 -378
  31. package/dist/csf/index.cjs +76 -120
  32. package/dist/csf/index.d.ts +1 -3
  33. package/dist/csf/index.js +69 -113
  34. package/dist/docs-tools/index.cjs +1 -1
  35. package/dist/docs-tools/index.d.ts +2 -2
  36. package/dist/docs-tools/index.js +1 -1
  37. package/dist/instrumenter/index.cjs +1260 -1289
  38. package/dist/instrumenter/index.js +1344 -1348
  39. package/dist/manager/globals-module-info.cjs +272 -135
  40. package/dist/manager/globals-module-info.d.ts +1 -1
  41. package/dist/manager/globals-module-info.js +257 -120
  42. package/dist/manager/globals-runtime.js +59553 -22371
  43. package/dist/manager/globals.cjs +23 -19
  44. package/dist/manager/globals.d.ts +8 -5
  45. package/dist/manager/globals.js +10 -6
  46. package/dist/manager/runtime.js +129 -129
  47. package/dist/manager-api/index.cjs +1182 -1205
  48. package/dist/manager-api/index.d.ts +2 -2
  49. package/dist/manager-api/index.js +1010 -1008
  50. package/dist/preview/globals.cjs +21 -17
  51. package/dist/preview/globals.d.ts +4 -1
  52. package/dist/preview/globals.js +6 -2
  53. package/dist/preview/runtime.js +43946 -6546
  54. package/dist/preview-api/index.cjs +1243 -1239
  55. package/dist/preview-api/index.d.ts +104 -60
  56. package/dist/preview-api/index.js +1310 -1270
  57. package/dist/router/index.cjs +847 -871
  58. package/dist/router/index.js +193 -199
  59. package/dist/test/index.cjs +10068 -10205
  60. package/dist/test/index.d.ts +4 -4
  61. package/dist/test/index.js +9741 -9623
  62. package/dist/test/preview.cjs +15870 -0
  63. package/dist/test/preview.d.ts +54 -0
  64. package/dist/test/preview.js +14441 -0
  65. package/dist/test/spy.cjs +258 -0
  66. package/dist/test/spy.d.ts +66 -0
  67. package/dist/test/spy.js +240 -0
  68. package/dist/theming/create.cjs +79 -2269
  69. package/dist/theming/create.js +67 -841
  70. package/dist/theming/index.cjs +1065 -3232
  71. package/dist/theming/index.js +951 -1719
  72. package/dist/types/index.d.ts +242 -242
  73. package/package.json +134 -3
@@ -1,42 +1,42 @@
1
1
  "use strict";
2
- var _ = Object.create;
3
- var u = Object.defineProperty;
4
- var $ = Object.getOwnPropertyDescriptor;
5
- var j = Object.getOwnPropertyNames;
2
+ var v = Object.create;
3
+ var d = Object.defineProperty;
4
+ var j = Object.getOwnPropertyDescriptor;
5
+ var _ = Object.getOwnPropertyNames;
6
6
  var C = Object.getPrototypeOf, E = Object.prototype.hasOwnProperty;
7
- var s = (e, r) => u(e, "name", { value: r, configurable: !0 });
8
- var z = (e, r) => () => (r || e((r = { exports: {} }).exports, r), r.exports), M = (e, r) => {
7
+ var a = (e, r) => d(e, "name", { value: r, configurable: !0 });
8
+ var P = (e, r) => () => (r || e((r = { exports: {} }).exports, r), r.exports), z = (e, r) => {
9
9
  for (var t in r)
10
- u(e, t, { get: r[t], enumerable: !0 });
11
- }, T = (e, r, t, n) => {
10
+ d(e, t, { get: r[t], enumerable: !0 });
11
+ }, x = (e, r, t, n) => {
12
12
  if (r && typeof r == "object" || typeof r == "function")
13
- for (let a of j(r))
14
- !E.call(e, a) && a !== t && u(e, a, { get: () => r[a], enumerable: !(n = $(r, a)) || n.enumerable });
13
+ for (let s of _(r))
14
+ !E.call(e, s) && s !== t && d(e, s, { get: () => r[s], enumerable: !(n = j(r, s)) || n.enumerable });
15
15
  return e;
16
16
  };
17
- var N = (e, r, t) => (t = e != null ? _(C(e)) : {}, T(
17
+ var I = (e, r, t) => (t = e != null ? v(C(e)) : {}, x(
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
- r || !e || !e.__esModule ? u(t, "default", { value: e, enumerable: !0 }) : t,
22
+ r || !e || !e.__esModule ? d(t, "default", { value: e, enumerable: !0 }) : t,
23
23
  e
24
- )), I = (e) => T(u({}, "__esModule", { value: !0 }), e);
24
+ )), M = (e) => x(d({}, "__esModule", { value: !0 }), e);
25
25
 
26
26
  // ../node_modules/@ngard/tiny-isequal/index.js
27
- var w = z((y) => {
28
- Object.defineProperty(y, "__esModule", { value: !0 }), y.isEqual = /* @__PURE__ */ function() {
27
+ var w = P((g) => {
28
+ Object.defineProperty(g, "__esModule", { value: !0 }), g.isEqual = /* @__PURE__ */ function() {
29
29
  var e = Object.prototype.toString, r = Object.getPrototypeOf, t = Object.getOwnPropertySymbols ? function(n) {
30
30
  return Object.keys(n).concat(Object.getOwnPropertySymbols(n));
31
31
  } : Object.keys;
32
- return function(n, a) {
33
- return (/* @__PURE__ */ s(function d(o, i, p) {
34
- var c, f, l, A = e.call(o), O = e.call(i);
32
+ return function(n, s) {
33
+ return (/* @__PURE__ */ a(function l(o, i, p) {
34
+ var c, f, u, A = e.call(o), $ = e.call(i);
35
35
  if (o === i) return !0;
36
36
  if (o == null || i == null) return !1;
37
37
  if (p.indexOf(o) > -1 && p.indexOf(i) > -1) return !0;
38
- if (p.push(o, i), A != O || (c = t(o), f = t(i), c.length != f.length || c.some(function(R) {
39
- return !d(o[R], i[R], p);
38
+ if (p.push(o, i), A != $ || (c = t(o), f = t(i), c.length != f.length || c.some(function(m) {
39
+ return !l(o[m], i[m], p);
40
40
  }))) return !1;
41
41
  switch (A.slice(8, -1)) {
42
42
  case "Symbol":
@@ -53,8 +53,8 @@ var w = z((y) => {
53
53
  case "Map":
54
54
  c = o.entries(), f = i.entries();
55
55
  do
56
- if (!d((l = c.next()).value, f.next().value, p)) return !1;
57
- while (!l.done);
56
+ if (!l((u = c.next()).value, f.next().value, p)) return !1;
57
+ while (!u.done);
58
58
  return !0;
59
59
  case "ArrayBuffer":
60
60
  o = new Uint8Array(o), i = new Uint8Array(i);
@@ -72,152 +72,108 @@ var w = z((y) => {
72
72
  case "Arguments":
73
73
  case "Array":
74
74
  if (o.length != i.length) return !1;
75
- for (l = 0; l < o.length; l++) if ((l in o || l in i) && (l in o != l in i || !d(o[l], i[l], p))) return !1;
75
+ for (u = 0; u < o.length; u++) if ((u in o || u in i) && (u in o != u in i || !l(o[u], i[u], p))) return !1;
76
76
  return !0;
77
77
  case "Object":
78
- return d(r(o), r(i), p);
78
+ return l(r(o), r(i), p);
79
79
  default:
80
80
  return !1;
81
81
  }
82
- }, "n"))(n, a, []);
82
+ }, "n"))(n, s, []);
83
83
  };
84
84
  }();
85
85
  });
86
86
 
87
87
  // src/csf/index.ts
88
- var H = {};
89
- M(H, {
90
- __definePreview: () => D,
91
- combineTags: () => W,
92
- includeConditionalArg: () => h,
93
- isExportStory: () => Z,
94
- isMeta: () => k,
95
- isPreview: () => B,
96
- isStory: () => G,
97
- parseKind: () => L,
98
- sanitize: () => P,
99
- storyNameFromExport: () => V,
100
- toId: () => J
88
+ var V = {};
89
+ z(V, {
90
+ combineTags: () => J,
91
+ includeConditionalArg: () => T,
92
+ isExportStory: () => F,
93
+ isMeta: () => D,
94
+ isPreview: () => U,
95
+ isStory: () => B,
96
+ parseKind: () => G,
97
+ sanitize: () => O,
98
+ storyNameFromExport: () => q,
99
+ toId: () => k
101
100
  });
102
- module.exports = I(H);
101
+ module.exports = M(V);
103
102
 
104
103
  // src/csf/toStartCaseStr.ts
105
- function x(e) {
106
- return e.replace(/_/g, " ").replace(/-/g, " ").replace(/\./g, " ").replace(/([^\n])([A-Z])([a-z])/g, (r, t, n, a) => `${t} ${n}${a}`).replace(
104
+ function S(e) {
105
+ return e.replace(/_/g, " ").replace(/-/g, " ").replace(/\./g, " ").replace(/([^\n])([A-Z])([a-z])/g, (r, t, n, s) => `${t} ${n}${s}`).replace(
107
106
  /([a-z])([A-Z])/g, (r, t, n) => `${t} ${n}`).replace(/([a-z])([0-9])/gi, (r, t, n) => `${t} ${n}`).replace(/([0-9])([a-z])/gi, (r, t, n) => `${t}\
108
107
  ${n}`).replace(/(\s|^)(\w)/g, (r, t, n) => `${t}${n.toUpperCase()}`).replace(/ +/g, " ").trim();
109
108
  }
110
- s(x, "toStartCaseStr");
109
+ a(S, "toStartCaseStr");
111
110
 
112
111
  // src/csf/includeConditionalArg.ts
113
- var m = N(w(), 1);
114
- var S = /* @__PURE__ */ s((e) => e.map((r) => typeof r < "u").filter(Boolean).length, "count"), U = /* @__PURE__ */ s((e, r) => {
115
- let { exists: t, eq: n, neq: a, truthy: d } = e;
116
- if (S([t, n, a, d]) > 1)
117
- throw new Error(`Invalid conditional test ${JSON.stringify({ exists: t, eq: n, neq: a })}`);
112
+ var y = I(w(), 1);
113
+ var R = /* @__PURE__ */ a((e) => e.map((r) => typeof r < "u").filter(Boolean).length, "count"), N = /* @__PURE__ */ a((e, r) => {
114
+ let { exists: t, eq: n, neq: s, truthy: l } = e;
115
+ if (R([t, n, s, l]) > 1)
116
+ throw new Error(`Invalid conditional test ${JSON.stringify({ exists: t, eq: n, neq: s })}`);
118
117
  if (typeof n < "u")
119
- return (0, m.isEqual)(r, n);
120
- if (typeof a < "u")
121
- return !(0, m.isEqual)(r, a);
118
+ return (0, y.isEqual)(r, n);
119
+ if (typeof s < "u")
120
+ return !(0, y.isEqual)(r, s);
122
121
  if (typeof t < "u") {
123
122
  let i = typeof r < "u";
124
123
  return t ? i : !i;
125
124
  }
126
- return (typeof d > "u" ? !0 : d) ? !!r : !r;
127
- }, "testValue"), h = /* @__PURE__ */ s((e, r, t) => {
125
+ return (typeof l > "u" ? !0 : l) ? !!r : !r;
126
+ }, "testValue"), T = /* @__PURE__ */ a((e, r, t) => {
128
127
  if (!e.if)
129
128
  return !0;
130
- let { arg: n, global: a } = e.if;
131
- if (S([n, a]) !== 1)
132
- throw new Error(`Invalid conditional value ${JSON.stringify({ arg: n, global: a })}`);
133
- let d = n ? r[n] : t[a];
134
- return U(e.if, d);
129
+ let { arg: n, global: s } = e.if;
130
+ if (R([n, s]) !== 1)
131
+ throw new Error(`Invalid conditional value ${JSON.stringify({ arg: n, global: s })}`);
132
+ let l = n ? r[n] : t[s];
133
+ return N(e.if, l);
135
134
  }, "includeConditionalArg");
136
135
 
137
136
  // src/csf/csf-factories.ts
138
- var g = require("storybook/internal/preview-api");
139
- function D(e) {
140
- let r, t = {
141
- _tag: "Preview",
142
- input: e,
143
- get composed() {
144
- if (r)
145
- return r;
146
- let { addons: n, ...a } = e;
147
- return r = (0, g.normalizeProjectAnnotations)((0, g.composeConfigs)([...n ?? [], a])), r;
148
- },
149
- meta(n) {
150
- return q(n, this);
151
- }
152
- };
153
- return globalThis.globalProjectAnnotations = t.composed, t;
154
- }
155
- s(D, "__definePreview");
156
- function B(e) {
137
+ function U(e) {
157
138
  return e != null && typeof e == "object" && "_tag" in e && e?._tag === "Preview";
158
139
  }
159
- s(B, "isPreview");
160
- function k(e) {
140
+ a(U, "isPreview");
141
+ function D(e) {
161
142
  return e != null && typeof e == "object" && "_tag" in e && e?._tag === "Meta";
162
143
  }
163
- s(k, "isMeta");
164
- function q(e, r) {
165
- return {
166
- _tag: "Meta",
167
- input: e,
168
- preview: r,
169
- get composed() {
170
- throw new Error("Not implemented");
171
- },
172
- story(t) {
173
- return F(t, this);
174
- }
175
- };
176
- }
177
- s(q, "defineMeta");
178
- function F(e, r) {
179
- return {
180
- _tag: "Story",
181
- input: e,
182
- meta: r,
183
- get composed() {
184
- throw new Error("Not implemented");
185
- }
186
- };
187
- }
188
- s(F, "defineStory");
189
- function G(e) {
144
+ a(D, "isMeta");
145
+ function B(e) {
190
146
  return e != null && typeof e == "object" && "_tag" in e && e?._tag === "Story";
191
147
  }
192
- s(G, "isStory");
148
+ a(B, "isStory");
193
149
 
194
150
  // src/csf/index.ts
195
- var P = /* @__PURE__ */ s((e) => e.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, "-").replace(/-+/g,
196
- "-").replace(/^-+/, "").replace(/-+$/, ""), "sanitize"), b = /* @__PURE__ */ s((e, r) => {
197
- let t = P(e);
151
+ var O = /* @__PURE__ */ a((e) => e.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, "-").replace(/-+/g,
152
+ "-").replace(/^-+/, "").replace(/-+$/, ""), "sanitize"), b = /* @__PURE__ */ a((e, r) => {
153
+ let t = O(e);
198
154
  if (t === "")
199
155
  throw new Error(`Invalid ${r} '${e}', must include alphanumeric characters`);
200
156
  return t;
201
- }, "sanitizeSafe"), J = /* @__PURE__ */ s((e, r) => `${b(e, "kind")}${r ? `--${b(r, "name")}` : ""}`, "toId"), V = /* @__PURE__ */ s((e) => x(
157
+ }, "sanitizeSafe"), k = /* @__PURE__ */ a((e, r) => `${b(e, "kind")}${r ? `--${b(r, "name")}` : ""}`, "toId"), q = /* @__PURE__ */ a((e) => S(
202
158
  e), "storyNameFromExport");
203
- function v(e, r) {
159
+ function h(e, r) {
204
160
  return Array.isArray(r) ? r.includes(e) : e.match(r);
205
161
  }
206
- s(v, "matches");
207
- function Z(e, { includeStories: r, excludeStories: t }) {
162
+ a(h, "matches");
163
+ function F(e, { includeStories: r, excludeStories: t }) {
208
164
  return (
209
165
  // https://babeljs.io/docs/en/babel-plugin-transform-modules-commonjs
210
- e !== "__esModule" && (!r || v(e, r)) && (!t || !v(e, t))
166
+ e !== "__esModule" && (!r || h(e, r)) && (!t || !h(e, t))
211
167
  );
212
168
  }
213
- s(Z, "isExportStory");
214
- var L = /* @__PURE__ */ s((e, { rootSeparator: r, groupSeparator: t }) => {
215
- let [n, a] = e.split(r, 2), d = (a || e).split(t).filter((o) => !!o);
169
+ a(F, "isExportStory");
170
+ var G = /* @__PURE__ */ a((e, { rootSeparator: r, groupSeparator: t }) => {
171
+ let [n, s] = e.split(r, 2), l = (s || e).split(t).filter((o) => !!o);
216
172
  return {
217
- root: a ? n : null,
218
- groups: d
173
+ root: s ? n : null,
174
+ groups: l
219
175
  };
220
- }, "parseKind"), W = /* @__PURE__ */ s((...e) => {
176
+ }, "parseKind"), J = /* @__PURE__ */ a((...e) => {
221
177
  let r = e.reduce((t, n) => (n.startsWith("!") ? t.delete(n.slice(1)) : t.add(n), t), /* @__PURE__ */ new Set());
222
178
  return Array.from(r);
223
179
  }, "combineTags");
@@ -701,8 +701,6 @@ interface Preview<TRenderer extends Renderer$1 = Renderer$1> {
701
701
  composed: NormalizedProjectAnnotations<TRenderer>;
702
702
  meta(input: ComponentAnnotations$1<TRenderer>): Meta<TRenderer>;
703
703
  }
704
- /** Do not use, use the definePreview exported from the framework instead. */
705
- declare function __definePreview<TRenderer extends Renderer$1>(input: Preview<TRenderer>['input']): Preview<TRenderer>;
706
704
  declare function isPreview(input: unknown): input is Preview<Renderer$1>;
707
705
  interface Meta<TRenderer extends Renderer$1, TArgs extends Args$1 = Args$1> {
708
706
  readonly _tag: 'Meta';
@@ -749,4 +747,4 @@ declare const parseKind: (kind: string, { rootSeparator, groupSeparator }: Separ
749
747
  /** Combine a set of project / meta / story tags, removing duplicates and handling negations. */
750
748
  declare const combineTags: (...tags: string[]) => string[];
751
749
 
752
- 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, __definePreview, combineTags, includeConditionalArg, isExportStory, isMeta, isPreview, isStory, parseKind, sanitize, storyNameFromExport, toId };
750
+ 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 };
package/dist/csf/index.js CHANGED
@@ -1,17 +1,17 @@
1
- var b = Object.create;
1
+ var h = Object.create;
2
2
  var f = Object.defineProperty;
3
- var v = Object.getOwnPropertyDescriptor;
4
- var P = Object.getOwnPropertyNames;
5
- var O = Object.getPrototypeOf, _ = Object.prototype.hasOwnProperty;
6
- var s = (e, r) => f(e, "name", { value: r, configurable: !0 });
7
- var $ = (e, r) => () => (r || e((r = { exports: {} }).exports, r), r.exports);
8
- var j = (e, r, t, n) => {
3
+ var O = Object.getOwnPropertyDescriptor;
4
+ var $ = Object.getOwnPropertyNames;
5
+ var v = Object.getPrototypeOf, j = Object.prototype.hasOwnProperty;
6
+ var a = (e, r) => f(e, "name", { value: r, configurable: !0 });
7
+ var _ = (e, r) => () => (r || e((r = { exports: {} }).exports, r), r.exports);
8
+ var C = (e, r, t, n) => {
9
9
  if (r && typeof r == "object" || typeof r == "function")
10
- for (let a of P(r))
11
- !_.call(e, a) && a !== t && f(e, a, { get: () => r[a], enumerable: !(n = v(r, a)) || n.enumerable });
10
+ for (let s of $(r))
11
+ !j.call(e, s) && s !== t && f(e, s, { get: () => r[s], enumerable: !(n = O(r, s)) || n.enumerable });
12
12
  return e;
13
13
  };
14
- var C = (e, r, t) => (t = e != null ? b(O(e)) : {}, j(
14
+ var E = (e, r, t) => (t = e != null ? h(v(e)) : {}, C(
15
15
  // If the importer is in node compatibility mode or this is not an ESM
16
16
  // file that has been converted to a CommonJS file using a Babel-
17
17
  // compatible transform (i.e. "__esModule" has not been set), then set
@@ -21,21 +21,21 @@ var C = (e, r, t) => (t = e != null ? b(O(e)) : {}, j(
21
21
  ));
22
22
 
23
23
  // ../node_modules/@ngard/tiny-isequal/index.js
24
- var T = $((g) => {
24
+ var S = _((g) => {
25
25
  Object.defineProperty(g, "__esModule", { value: !0 }), g.isEqual = /* @__PURE__ */ function() {
26
26
  var e = Object.prototype.toString, r = Object.getPrototypeOf, t = Object.getOwnPropertySymbols ? function(n) {
27
27
  return Object.keys(n).concat(Object.getOwnPropertySymbols(n));
28
28
  } : Object.keys;
29
- return function(n, a) {
30
- return (/* @__PURE__ */ s(function d(o, i, p) {
31
- var c, u, l, m = e.call(o), h = e.call(i);
29
+ return function(n, s) {
30
+ return (/* @__PURE__ */ a(function l(o, i, p) {
31
+ var c, d, u, A = e.call(o), b = e.call(i);
32
32
  if (o === i) return !0;
33
33
  if (o == null || i == null) return !1;
34
34
  if (p.indexOf(o) > -1 && p.indexOf(i) > -1) return !0;
35
- if (p.push(o, i), m != h || (c = t(o), u = t(i), c.length != u.length || c.some(function(A) {
36
- return !d(o[A], i[A], p);
35
+ if (p.push(o, i), A != b || (c = t(o), d = t(i), c.length != d.length || c.some(function(m) {
36
+ return !l(o[m], i[m], p);
37
37
  }))) return !1;
38
- switch (m.slice(8, -1)) {
38
+ switch (A.slice(8, -1)) {
39
39
  case "Symbol":
40
40
  return o.valueOf() == i.valueOf();
41
41
  case "Date":
@@ -48,10 +48,10 @@ var T = $((g) => {
48
48
  return "" + o == "" + i;
49
49
  case "Set":
50
50
  case "Map":
51
- c = o.entries(), u = i.entries();
51
+ c = o.entries(), d = i.entries();
52
52
  do
53
- if (!d((l = c.next()).value, u.next().value, p)) return !1;
54
- while (!l.done);
53
+ if (!l((u = c.next()).value, d.next().value, p)) return !1;
54
+ while (!u.done);
55
55
  return !0;
56
56
  case "ArrayBuffer":
57
57
  o = new Uint8Array(o), i = new Uint8Array(i);
@@ -69,148 +69,104 @@ var T = $((g) => {
69
69
  case "Arguments":
70
70
  case "Array":
71
71
  if (o.length != i.length) return !1;
72
- for (l = 0; l < o.length; l++) if ((l in o || l in i) && (l in o != l in i || !d(o[l], i[l], p))) return !1;
72
+ for (u = 0; u < o.length; u++) if ((u in o || u in i) && (u in o != u in i || !l(o[u], i[u], p))) return !1;
73
73
  return !0;
74
74
  case "Object":
75
- return d(r(o), r(i), p);
75
+ return l(r(o), r(i), p);
76
76
  default:
77
77
  return !1;
78
78
  }
79
- }, "n"))(n, a, []);
79
+ }, "n"))(n, s, []);
80
80
  };
81
81
  }();
82
82
  });
83
83
 
84
84
  // src/csf/toStartCaseStr.ts
85
- function R(e) {
86
- return e.replace(/_/g, " ").replace(/-/g, " ").replace(/\./g, " ").replace(/([^\n])([A-Z])([a-z])/g, (r, t, n, a) => `${t} ${n}${a}`).replace(
85
+ function x(e) {
86
+ return e.replace(/_/g, " ").replace(/-/g, " ").replace(/\./g, " ").replace(/([^\n])([A-Z])([a-z])/g, (r, t, n, s) => `${t} ${n}${s}`).replace(
87
87
  /([a-z])([A-Z])/g, (r, t, n) => `${t} ${n}`).replace(/([a-z])([0-9])/gi, (r, t, n) => `${t} ${n}`).replace(/([0-9])([a-z])/gi, (r, t, n) => `${t}\
88
88
  ${n}`).replace(/(\s|^)(\w)/g, (r, t, n) => `${t}${n.toUpperCase()}`).replace(/ +/g, " ").trim();
89
89
  }
90
- s(R, "toStartCaseStr");
90
+ a(x, "toStartCaseStr");
91
91
 
92
92
  // src/csf/includeConditionalArg.ts
93
- var y = C(T(), 1);
94
- var x = /* @__PURE__ */ s((e) => e.map((r) => typeof r < "u").filter(Boolean).length, "count"), E = /* @__PURE__ */ s((e, r) => {
95
- let { exists: t, eq: n, neq: a, truthy: d } = e;
96
- if (x([t, n, a, d]) > 1)
97
- throw new Error(`Invalid conditional test ${JSON.stringify({ exists: t, eq: n, neq: a })}`);
93
+ var y = E(S(), 1);
94
+ var w = /* @__PURE__ */ a((e) => e.map((r) => typeof r < "u").filter(Boolean).length, "count"), P = /* @__PURE__ */ a((e, r) => {
95
+ let { exists: t, eq: n, neq: s, truthy: l } = e;
96
+ if (w([t, n, s, l]) > 1)
97
+ throw new Error(`Invalid conditional test ${JSON.stringify({ exists: t, eq: n, neq: s })}`);
98
98
  if (typeof n < "u")
99
99
  return (0, y.isEqual)(r, n);
100
- if (typeof a < "u")
101
- return !(0, y.isEqual)(r, a);
100
+ if (typeof s < "u")
101
+ return !(0, y.isEqual)(r, s);
102
102
  if (typeof t < "u") {
103
103
  let i = typeof r < "u";
104
104
  return t ? i : !i;
105
105
  }
106
- return (typeof d > "u" ? !0 : d) ? !!r : !r;
107
- }, "testValue"), z = /* @__PURE__ */ s((e, r, t) => {
106
+ return (typeof l > "u" ? !0 : l) ? !!r : !r;
107
+ }, "testValue"), z = /* @__PURE__ */ a((e, r, t) => {
108
108
  if (!e.if)
109
109
  return !0;
110
- let { arg: n, global: a } = e.if;
111
- if (x([n, a]) !== 1)
112
- throw new Error(`Invalid conditional value ${JSON.stringify({ arg: n, global: a })}`);
113
- let d = n ? r[n] : t[a];
114
- return E(e.if, d);
110
+ let { arg: n, global: s } = e.if;
111
+ if (w([n, s]) !== 1)
112
+ throw new Error(`Invalid conditional value ${JSON.stringify({ arg: n, global: s })}`);
113
+ let l = n ? r[n] : t[s];
114
+ return P(e.if, l);
115
115
  }, "includeConditionalArg");
116
116
 
117
117
  // src/csf/csf-factories.ts
118
- import { composeConfigs as M, normalizeProjectAnnotations as N } from "storybook/internal/preview-api";
119
- function L(e) {
120
- let r, t = {
121
- _tag: "Preview",
122
- input: e,
123
- get composed() {
124
- if (r)
125
- return r;
126
- let { addons: n, ...a } = e;
127
- return r = N(M([...n ?? [], a])), r;
128
- },
129
- meta(n) {
130
- return I(n, this);
131
- }
132
- };
133
- return globalThis.globalProjectAnnotations = t.composed, t;
134
- }
135
- s(L, "__definePreview");
136
- function W(e) {
118
+ function F(e) {
137
119
  return e != null && typeof e == "object" && "_tag" in e && e?._tag === "Preview";
138
120
  }
139
- s(W, "isPreview");
140
- function H(e) {
121
+ a(F, "isPreview");
122
+ function G(e) {
141
123
  return e != null && typeof e == "object" && "_tag" in e && e?._tag === "Meta";
142
124
  }
143
- s(H, "isMeta");
144
- function I(e, r) {
145
- return {
146
- _tag: "Meta",
147
- input: e,
148
- preview: r,
149
- get composed() {
150
- throw new Error("Not implemented");
151
- },
152
- story(t) {
153
- return U(t, this);
154
- }
155
- };
156
- }
157
- s(I, "defineMeta");
158
- function U(e, r) {
159
- return {
160
- _tag: "Story",
161
- input: e,
162
- meta: r,
163
- get composed() {
164
- throw new Error("Not implemented");
165
- }
166
- };
167
- }
168
- s(U, "defineStory");
169
- function K(e) {
125
+ a(G, "isMeta");
126
+ function J(e) {
170
127
  return e != null && typeof e == "object" && "_tag" in e && e?._tag === "Story";
171
128
  }
172
- s(K, "isStory");
129
+ a(J, "isStory");
173
130
 
174
131
  // src/csf/index.ts
175
- var D = /* @__PURE__ */ s((e) => e.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, "-").replace(/-+/g,
176
- "-").replace(/^-+/, "").replace(/-+$/, ""), "sanitize"), w = /* @__PURE__ */ s((e, r) => {
177
- let t = D(e);
132
+ var I = /* @__PURE__ */ a((e) => e.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, "-").replace(/-+/g,
133
+ "-").replace(/^-+/, "").replace(/-+$/, ""), "sanitize"), R = /* @__PURE__ */ a((e, r) => {
134
+ let t = I(e);
178
135
  if (t === "")
179
136
  throw new Error(`Invalid ${r} '${e}', must include alphanumeric characters`);
180
137
  return t;
181
- }, "sanitizeSafe"), ee = /* @__PURE__ */ s((e, r) => `${w(e, "kind")}${r ? `--${w(r, "name")}` : ""}`, "toId"), re = /* @__PURE__ */ s((e) => R(
138
+ }, "sanitizeSafe"), W = /* @__PURE__ */ a((e, r) => `${R(e, "kind")}${r ? `--${R(r, "name")}` : ""}`, "toId"), H = /* @__PURE__ */ a((e) => x(
182
139
  e), "storyNameFromExport");
183
- function S(e, r) {
140
+ function T(e, r) {
184
141
  return Array.isArray(r) ? r.includes(e) : e.match(r);
185
142
  }
186
- s(S, "matches");
187
- function te(e, { includeStories: r, excludeStories: t }) {
143
+ a(T, "matches");
144
+ function K(e, { includeStories: r, excludeStories: t }) {
188
145
  return (
189
146
  // https://babeljs.io/docs/en/babel-plugin-transform-modules-commonjs
190
- e !== "__esModule" && (!r || S(e, r)) && (!t || !S(e, t))
147
+ e !== "__esModule" && (!r || T(e, r)) && (!t || !T(e, t))
191
148
  );
192
149
  }
193
- s(te, "isExportStory");
194
- var ne = /* @__PURE__ */ s((e, { rootSeparator: r, groupSeparator: t }) => {
195
- let [n, a] = e.split(r, 2), d = (a || e).split(t).filter((o) => !!o);
150
+ a(K, "isExportStory");
151
+ var Q = /* @__PURE__ */ a((e, { rootSeparator: r, groupSeparator: t }) => {
152
+ let [n, s] = e.split(r, 2), l = (s || e).split(t).filter((o) => !!o);
196
153
  return {
197
- root: a ? n : null,
198
- groups: d
154
+ root: s ? n : null,
155
+ groups: l
199
156
  };
200
- }, "parseKind"), oe = /* @__PURE__ */ s((...e) => {
157
+ }, "parseKind"), X = /* @__PURE__ */ a((...e) => {
201
158
  let r = e.reduce((t, n) => (n.startsWith("!") ? t.delete(n.slice(1)) : t.add(n), t), /* @__PURE__ */ new Set());
202
159
  return Array.from(r);
203
160
  }, "combineTags");
204
161
  export {
205
- L as __definePreview,
206
- oe as combineTags,
162
+ X as combineTags,
207
163
  z as includeConditionalArg,
208
- te as isExportStory,
209
- H as isMeta,
210
- W as isPreview,
211
- K as isStory,
212
- ne as parseKind,
213
- D as sanitize,
214
- re as storyNameFromExport,
215
- ee as toId
164
+ K as isExportStory,
165
+ G as isMeta,
166
+ F as isPreview,
167
+ J as isStory,
168
+ Q as parseKind,
169
+ I as sanitize,
170
+ H as storyNameFromExport,
171
+ W as toId
216
172
  };
@@ -904,7 +904,7 @@ function Ot(e) {
904
904
  o(Ot, "extractComponentDescription");
905
905
 
906
906
  // src/docs-tools/argTypes/enhanceArgTypes.ts
907
- var Pe = require("storybook/internal/preview-api");
907
+ var Pe = require("storybook/preview-api");
908
908
  var vt = /* @__PURE__ */ o((e) => {
909
909
  let {
910
910
  component: t,
@@ -1,5 +1,5 @@
1
- import * as storybook_internal_types from 'storybook/internal/types';
2
1
  import { StrictArgTypes, Renderer, StoryContextForEnhancers, Options } from 'storybook/internal/types';
2
+ import * as storybook_internal_csf from 'storybook/internal/csf';
3
3
 
4
4
  type Component = any;
5
5
 
@@ -133,7 +133,7 @@ declare function isTooLongForDefaultValueSummary(value: string): boolean;
133
133
  declare function createSummaryValue(summary?: string, detail?: string): PropSummaryValue;
134
134
  declare const normalizeNewlines: (string: string) => string;
135
135
 
136
- declare const enhanceArgTypes: <TRenderer extends Renderer>(context: StoryContextForEnhancers<TRenderer>) => storybook_internal_types.StrictArgTypes<storybook_internal_types.Args>;
136
+ declare const enhanceArgTypes: <TRenderer extends Renderer>(context: StoryContextForEnhancers<TRenderer>) => storybook_internal_csf.StrictArgTypes<storybook_internal_csf.Args>;
137
137
 
138
138
  declare const ADDON_ID = "storybook/docs";
139
139
  declare const PANEL_ID = "storybook/docs/panel";
@@ -862,7 +862,7 @@ function nn(e) {
862
862
  o(nn, "extractComponentDescription");
863
863
 
864
864
  // src/docs-tools/argTypes/enhanceArgTypes.ts
865
- import { combineParameters as yt } from "storybook/internal/preview-api";
865
+ import { combineParameters as yt } from "storybook/preview-api";
866
866
  var cn = /* @__PURE__ */ o((e) => {
867
867
  let {
868
868
  component: t,