storybook 9.0.0-alpha.2 → 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.
- package/README.md +1 -1
- package/dist/actions/decorator.d.ts +6 -0
- package/dist/actions/decorator.js +139 -0
- package/dist/actions/index.cjs +127 -0
- package/dist/actions/index.d.ts +105 -0
- package/dist/actions/index.js +112 -0
- package/dist/actions/manager.js +1196 -0
- package/dist/actions/preview.cjs +165 -0
- package/dist/actions/preview.d.ts +55 -0
- package/dist/actions/preview.js +156 -0
- package/dist/bin/index.cjs +63 -65
- package/dist/bin/index.js +63 -65
- package/dist/channels/index.cjs +209 -234
- package/dist/channels/index.js +304 -308
- package/dist/cli/bin/index.cjs +409 -409
- package/dist/cli/bin/index.js +414 -414
- package/dist/cli/index.cjs +1 -1
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +1 -1
- package/dist/client-logger/index.cjs +56 -88
- package/dist/client-logger/index.js +41 -47
- package/dist/common/index.cjs +148 -148
- package/dist/common/index.d.ts +1 -5
- package/dist/common/index.js +171 -171
- package/dist/components/index.cjs +9413 -11578
- package/dist/components/index.d.ts +92 -92
- package/dist/components/index.js +6768 -7544
- package/dist/core-events/index.d.ts +138 -25
- package/dist/core-server/index.cjs +5244 -5270
- package/dist/core-server/index.d.ts +1 -1
- package/dist/core-server/index.js +5356 -5380
- package/dist/core-server/presets/common-manager.js +11 -19
- package/dist/core-server/presets/common-preset.cjs +243 -242
- package/dist/core-server/presets/common-preset.js +379 -378
- package/dist/csf/index.cjs +76 -120
- package/dist/csf/index.d.ts +1 -3
- package/dist/csf/index.js +69 -113
- package/dist/docs-tools/index.cjs +1 -1
- package/dist/docs-tools/index.d.ts +2 -2
- package/dist/docs-tools/index.js +1 -1
- package/dist/instrumenter/index.cjs +1260 -1289
- package/dist/instrumenter/index.js +1344 -1348
- package/dist/manager/globals-module-info.cjs +272 -135
- package/dist/manager/globals-module-info.d.ts +1 -1
- package/dist/manager/globals-module-info.js +257 -120
- package/dist/manager/globals-runtime.js +59553 -22373
- package/dist/manager/globals.cjs +23 -19
- package/dist/manager/globals.d.ts +8 -5
- package/dist/manager/globals.js +10 -6
- package/dist/manager/runtime.js +129 -129
- package/dist/manager-api/index.cjs +1184 -1209
- package/dist/manager-api/index.d.ts +3 -3
- package/dist/manager-api/index.js +1012 -1012
- package/dist/preview/globals.cjs +21 -17
- package/dist/preview/globals.d.ts +4 -1
- package/dist/preview/globals.js +6 -2
- package/dist/preview/runtime.js +43946 -6548
- package/dist/preview-api/index.cjs +1245 -1243
- package/dist/preview-api/index.d.ts +105 -61
- package/dist/preview-api/index.js +1311 -1273
- package/dist/preview-errors.cjs +1 -1
- package/dist/preview-errors.js +1 -1
- package/dist/router/index.cjs +847 -871
- package/dist/router/index.js +193 -199
- package/dist/test/index.cjs +34778 -0
- package/dist/test/index.d.ts +186 -0
- package/dist/test/index.js +32916 -0
- package/dist/test/preview.cjs +15870 -0
- package/dist/test/preview.d.ts +54 -0
- package/dist/test/preview.js +14441 -0
- package/dist/test/spy.cjs +258 -0
- package/dist/test/spy.d.ts +66 -0
- package/dist/test/spy.js +240 -0
- package/dist/theming/create.cjs +79 -2269
- package/dist/theming/create.js +67 -841
- package/dist/theming/index.cjs +1065 -3232
- package/dist/theming/index.js +951 -1719
- package/dist/types/index.d.ts +242 -242
- package/package.json +155 -3
package/dist/csf/index.cjs
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
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
|
|
8
|
-
var
|
|
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
|
-
|
|
11
|
-
},
|
|
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
|
|
14
|
-
!E.call(e,
|
|
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
|
|
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 ?
|
|
22
|
+
r || !e || !e.__esModule ? d(t, "default", { value: e, enumerable: !0 }) : t,
|
|
23
23
|
e
|
|
24
|
-
)),
|
|
24
|
+
)), M = (e) => x(d({}, "__esModule", { value: !0 }), e);
|
|
25
25
|
|
|
26
26
|
// ../node_modules/@ngard/tiny-isequal/index.js
|
|
27
|
-
var w =
|
|
28
|
-
Object.defineProperty(
|
|
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,
|
|
33
|
-
return (/* @__PURE__ */
|
|
34
|
-
var c, f,
|
|
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 !=
|
|
39
|
-
return !
|
|
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 (!
|
|
57
|
-
while (!
|
|
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 (
|
|
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
|
|
78
|
+
return l(r(o), r(i), p);
|
|
79
79
|
default:
|
|
80
80
|
return !1;
|
|
81
81
|
}
|
|
82
|
-
}, "n"))(n,
|
|
82
|
+
}, "n"))(n, s, []);
|
|
83
83
|
};
|
|
84
84
|
}();
|
|
85
85
|
});
|
|
86
86
|
|
|
87
87
|
// src/csf/index.ts
|
|
88
|
-
var
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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 =
|
|
101
|
+
module.exports = M(V);
|
|
103
102
|
|
|
104
103
|
// src/csf/toStartCaseStr.ts
|
|
105
|
-
function
|
|
106
|
-
return e.replace(/_/g, " ").replace(/-/g, " ").replace(/\./g, " ").replace(/([^\n])([A-Z])([a-z])/g, (r, t, n,
|
|
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
|
-
|
|
109
|
+
a(S, "toStartCaseStr");
|
|
111
110
|
|
|
112
111
|
// src/csf/includeConditionalArg.ts
|
|
113
|
-
var
|
|
114
|
-
var
|
|
115
|
-
let { exists: t, eq: n, neq:
|
|
116
|
-
if (
|
|
117
|
-
throw new Error(`Invalid conditional test ${JSON.stringify({ exists: t, eq: n, neq:
|
|
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,
|
|
120
|
-
if (typeof
|
|
121
|
-
return !(0,
|
|
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
|
|
127
|
-
}, "testValue"),
|
|
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:
|
|
131
|
-
if (
|
|
132
|
-
throw new Error(`Invalid conditional value ${JSON.stringify({ arg: n, global:
|
|
133
|
-
let
|
|
134
|
-
return
|
|
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
|
-
|
|
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
|
-
|
|
160
|
-
function
|
|
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
|
-
|
|
164
|
-
function
|
|
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
|
-
|
|
148
|
+
a(B, "isStory");
|
|
193
149
|
|
|
194
150
|
// src/csf/index.ts
|
|
195
|
-
var
|
|
196
|
-
"-").replace(/^-+/, "").replace(/-+$/, ""), "sanitize"), b = /* @__PURE__ */
|
|
197
|
-
let t =
|
|
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"),
|
|
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
|
|
159
|
+
function h(e, r) {
|
|
204
160
|
return Array.isArray(r) ? r.includes(e) : e.match(r);
|
|
205
161
|
}
|
|
206
|
-
|
|
207
|
-
function
|
|
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 ||
|
|
166
|
+
e !== "__esModule" && (!r || h(e, r)) && (!t || !h(e, t))
|
|
211
167
|
);
|
|
212
168
|
}
|
|
213
|
-
|
|
214
|
-
var
|
|
215
|
-
let [n,
|
|
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:
|
|
218
|
-
groups:
|
|
173
|
+
root: s ? n : null,
|
|
174
|
+
groups: l
|
|
219
175
|
};
|
|
220
|
-
}, "parseKind"),
|
|
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");
|
package/dist/csf/index.d.ts
CHANGED
|
@@ -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,
|
|
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
|
|
1
|
+
var h = Object.create;
|
|
2
2
|
var f = Object.defineProperty;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
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
|
|
11
|
-
!
|
|
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
|
|
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
|
|
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,
|
|
30
|
-
return (/* @__PURE__ */
|
|
31
|
-
var c,
|
|
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),
|
|
36
|
-
return !
|
|
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 (
|
|
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(),
|
|
51
|
+
c = o.entries(), d = i.entries();
|
|
52
52
|
do
|
|
53
|
-
if (!
|
|
54
|
-
while (!
|
|
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 (
|
|
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
|
|
75
|
+
return l(r(o), r(i), p);
|
|
76
76
|
default:
|
|
77
77
|
return !1;
|
|
78
78
|
}
|
|
79
|
-
}, "n"))(n,
|
|
79
|
+
}, "n"))(n, s, []);
|
|
80
80
|
};
|
|
81
81
|
}();
|
|
82
82
|
});
|
|
83
83
|
|
|
84
84
|
// src/csf/toStartCaseStr.ts
|
|
85
|
-
function
|
|
86
|
-
return e.replace(/_/g, " ").replace(/-/g, " ").replace(/\./g, " ").replace(/([^\n])([A-Z])([a-z])/g, (r, t, n,
|
|
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
|
-
|
|
90
|
+
a(x, "toStartCaseStr");
|
|
91
91
|
|
|
92
92
|
// src/csf/includeConditionalArg.ts
|
|
93
|
-
var y =
|
|
94
|
-
var
|
|
95
|
-
let { exists: t, eq: n, neq:
|
|
96
|
-
if (
|
|
97
|
-
throw new Error(`Invalid conditional test ${JSON.stringify({ exists: t, eq: n, neq:
|
|
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
|
|
101
|
-
return !(0, y.isEqual)(r,
|
|
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
|
|
107
|
-
}, "testValue"), z = /* @__PURE__ */
|
|
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:
|
|
111
|
-
if (
|
|
112
|
-
throw new Error(`Invalid conditional value ${JSON.stringify({ arg: n, global:
|
|
113
|
-
let
|
|
114
|
-
return
|
|
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
|
-
|
|
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
|
-
|
|
140
|
-
function
|
|
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
|
-
|
|
144
|
-
function
|
|
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
|
-
|
|
129
|
+
a(J, "isStory");
|
|
173
130
|
|
|
174
131
|
// src/csf/index.ts
|
|
175
|
-
var
|
|
176
|
-
"-").replace(/^-+/, "").replace(/-+$/, ""), "sanitize"),
|
|
177
|
-
let t =
|
|
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"),
|
|
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
|
|
140
|
+
function T(e, r) {
|
|
184
141
|
return Array.isArray(r) ? r.includes(e) : e.match(r);
|
|
185
142
|
}
|
|
186
|
-
|
|
187
|
-
function
|
|
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 ||
|
|
147
|
+
e !== "__esModule" && (!r || T(e, r)) && (!t || !T(e, t))
|
|
191
148
|
);
|
|
192
149
|
}
|
|
193
|
-
|
|
194
|
-
var
|
|
195
|
-
let [n,
|
|
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:
|
|
198
|
-
groups:
|
|
154
|
+
root: s ? n : null,
|
|
155
|
+
groups: l
|
|
199
156
|
};
|
|
200
|
-
}, "parseKind"),
|
|
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
|
-
|
|
206
|
-
oe as combineTags,
|
|
162
|
+
X as combineTags,
|
|
207
163
|
z as includeConditionalArg,
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
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/
|
|
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>) =>
|
|
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";
|
package/dist/docs-tools/index.js
CHANGED
|
@@ -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/
|
|
865
|
+
import { combineParameters as yt } from "storybook/preview-api";
|
|
866
866
|
var cn = /* @__PURE__ */ o((e) => {
|
|
867
867
|
let {
|
|
868
868
|
component: t,
|