@storybook/csf 0.1.4--canary.82.4a5a941.0 → 0.1.4--canary.82.c8a52dd.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +45 -42
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -73,50 +73,53 @@ type ConditionalValue = {
|
|
73
73
|
global: string;
|
74
74
|
};
|
75
75
|
type Conditional = ConditionalValue & ConditionalTest;
|
76
|
+
interface ControlBase {
|
77
|
+
/**
|
78
|
+
* @see https://storybook.js.org/docs/api/arg-types#controltype
|
79
|
+
*/
|
80
|
+
type: ControlType;
|
81
|
+
disable: boolean;
|
82
|
+
}
|
83
|
+
type Control = ControlType | false | (ControlBase & ({
|
84
|
+
type: 'color';
|
85
|
+
/**
|
86
|
+
* @see https://storybook.js.org/docs/api/arg-types#controlpresetcolors
|
87
|
+
*/
|
88
|
+
presetColors?: string[];
|
89
|
+
} | {
|
90
|
+
type: 'file';
|
91
|
+
/**
|
92
|
+
* @see https://storybook.js.org/docs/api/arg-types#controlaccept
|
93
|
+
*/
|
94
|
+
accept?: string;
|
95
|
+
} | {
|
96
|
+
type: 'inline-check' | 'radio' | 'inline-radio' | 'select' | 'multi-select';
|
97
|
+
/**
|
98
|
+
* @see https://storybook.js.org/docs/api/arg-types#controllabels
|
99
|
+
*/
|
100
|
+
labels?: {
|
101
|
+
[options: string]: string;
|
102
|
+
};
|
103
|
+
} | {
|
104
|
+
type: 'number' | 'range';
|
105
|
+
/**
|
106
|
+
* @see https://storybook.js.org/docs/api/arg-types#controlmax
|
107
|
+
*/
|
108
|
+
max?: number;
|
109
|
+
/**
|
110
|
+
* @see https://storybook.js.org/docs/api/arg-types#controlmin
|
111
|
+
*/
|
112
|
+
min?: number;
|
113
|
+
/**
|
114
|
+
* @see https://storybook.js.org/docs/api/arg-types#controlstep
|
115
|
+
*/
|
116
|
+
step?: number;
|
117
|
+
}));
|
76
118
|
interface InputType {
|
77
119
|
/**
|
78
120
|
* @see https://storybook.js.org/docs/api/arg-types#control
|
79
121
|
*/
|
80
|
-
control?:
|
81
|
-
/**
|
82
|
-
* @see https://storybook.js.org/docs/api/arg-types#controltype
|
83
|
-
*/
|
84
|
-
type: ControlType;
|
85
|
-
} | {
|
86
|
-
type: 'color';
|
87
|
-
/**
|
88
|
-
* @see https://storybook.js.org/docs/api/arg-types#controlpresetcolors
|
89
|
-
*/
|
90
|
-
presetColors?: string[];
|
91
|
-
} | {
|
92
|
-
type: 'file';
|
93
|
-
/**
|
94
|
-
* @see https://storybook.js.org/docs/api/arg-types#controlaccept
|
95
|
-
*/
|
96
|
-
accept?: string;
|
97
|
-
} | {
|
98
|
-
type: 'inline-check' | 'radio' | 'inline-radio' | 'select' | 'multi-select';
|
99
|
-
/**
|
100
|
-
* @see https://storybook.js.org/docs/api/arg-types#controllabels
|
101
|
-
*/
|
102
|
-
labels?: {
|
103
|
-
[options: string]: string;
|
104
|
-
};
|
105
|
-
} | {
|
106
|
-
type: 'number' | 'range';
|
107
|
-
/**
|
108
|
-
* @see https://storybook.js.org/docs/api/arg-types#controlmax
|
109
|
-
*/
|
110
|
-
max?: number;
|
111
|
-
/**
|
112
|
-
* @see https://storybook.js.org/docs/api/arg-types#controlmin
|
113
|
-
*/
|
114
|
-
min?: number;
|
115
|
-
/**
|
116
|
-
* @see https://storybook.js.org/docs/api/arg-types#controlstep
|
117
|
-
*/
|
118
|
-
step?: number;
|
119
|
-
} | false;
|
122
|
+
control?: Control;
|
120
123
|
/**
|
121
124
|
* @see https://storybook.js.org/docs/api/arg-types#description
|
122
125
|
*/
|
@@ -251,8 +254,8 @@ interface StoryContextForLoaders<TRenderer extends Renderer = Renderer, TArgs =
|
|
251
254
|
}
|
252
255
|
type LoaderFunction<TRenderer extends Renderer = Renderer, TArgs = Args> = (context: StoryContextForLoaders<TRenderer, TArgs>) => Promise<Record<string, any> | void> | Record<string, any> | void;
|
253
256
|
type Awaitable<T> = T | PromiseLike<T>;
|
254
|
-
type CleanupCallback = (
|
255
|
-
type BeforeEach<TRenderer extends Renderer = Renderer, TArgs = Args> = (context: StoryContextForLoaders<TRenderer, TArgs>) => Awaitable<CleanupCallback>;
|
257
|
+
type CleanupCallback = () => Awaitable<unknown>;
|
258
|
+
type BeforeEach<TRenderer extends Renderer = Renderer, TArgs = Args> = (context: StoryContextForLoaders<TRenderer, TArgs>) => Awaitable<CleanupCallback | void>;
|
256
259
|
interface StoryContext<TRenderer extends Renderer = Renderer, TArgs = Args> extends StoryContextForLoaders<TRenderer, TArgs> {
|
257
260
|
loaded: Record<string, any>;
|
258
261
|
abortSignal: AbortSignal;
|
package/dist/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var
|
3
|
+
var B=Object.create;var u=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var E=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var I=(r,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of F(e))!w.call(r,a)&&a!==n&&u(r,a,{get:()=>e[a],enumerable:!(t=C(e,a))||t.enumerable});return r};var v=(r,e,n)=>(n=r!=null?B(h(r)):{},I(e||!r||!r.__esModule?u(n,"default",{value:r,enumerable:!0}):n,r));var x=E(T=>{Object.defineProperty(T,"__esModule",{value:!0}),T.isEqual=function(){var r=Object.prototype.toString,e=Object.getPrototypeOf,n=Object.getOwnPropertySymbols?function(t){return Object.keys(t).concat(Object.getOwnPropertySymbols(t))}:Object.keys;return function(t,a){return function i(o,s,d){var y,g,p,l=r.call(o),b=r.call(s);if(o===s)return !0;if(o==null||s==null)return !1;if(d.indexOf(o)>-1&&d.indexOf(s)>-1)return !0;if(d.push(o,s),l!=b||(y=n(o),g=n(s),y.length!=g.length||y.some(function(A){return !i(o[A],s[A],d)})))return !1;switch(l.slice(8,-1)){case"Symbol":return o.valueOf()==s.valueOf();case"Date":case"Number":return +o==+s||+o!=+o&&+s!=+s;case"RegExp":case"Function":case"String":case"Boolean":return ""+o==""+s;case"Set":case"Map":y=o.entries(),g=s.entries();do if(!i((p=y.next()).value,g.next().value,d))return !1;while(!p.done);return !0;case"ArrayBuffer":o=new Uint8Array(o),s=new Uint8Array(s);case"DataView":o=new Uint8Array(o.buffer),s=new Uint8Array(s.buffer);case"Float32Array":case"Float64Array":case"Int8Array":case"Int16Array":case"Int32Array":case"Uint8Array":case"Uint16Array":case"Uint32Array":case"Uint8ClampedArray":case"Arguments":case"Array":if(o.length!=s.length)return !1;for(p=0;p<o.length;p++)if((p in o||p in s)&&(p in o!=p in s||!i(o[p],s[p],d)))return !1;return !0;case"Object":return i(e(o),e(s),d);default:return !1}}(t,a,[])}}();});function R(r){return r.replace(/_/g," ").replace(/-/g," ").replace(/\./g," ").replace(/([^\n])([A-Z])([a-z])/g,(e,n,t,a)=>`${n} ${t}${a}`).replace(/([a-z])([A-Z])/g,(e,n,t)=>`${n} ${t}`).replace(/([a-z])([0-9])/gi,(e,n,t)=>`${n} ${t}`).replace(/([0-9])([a-z])/gi,(e,n,t)=>`${n} ${t}`).replace(/(\s|^)(\w)/g,(e,n,t)=>`${n}${t.toUpperCase()}`).replace(/ +/g," ").trim()}var c=v(x()),S=r=>r.map(e=>typeof e<"u").filter(Boolean).length,P=(r,e)=>{let{exists:n,eq:t,neq:a,truthy:i}=r;if(S([n,t,a,i])>1)throw new Error(`Invalid conditional test ${JSON.stringify({exists:n,eq:t,neq:a})}`);if(typeof t<"u")return (0, c.isEqual)(e,t);if(typeof a<"u")return !(0, c.isEqual)(e,a);if(typeof n<"u"){let s=typeof e<"u";return n?s:!s}return (typeof i>"u"?!0:i)?!!e:!e},L=(r,e,n)=>{if(!r.if)return !0;let{arg:t,global:a}=r.if;if(S([t,a])!==1)throw new Error(`Invalid conditional value ${JSON.stringify({arg:t,global:a})}`);let i=t?e[t]:n[a];return P(r.if,i)};var O=r=>r.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,"-").replace(/-+/g,"-").replace(/^-+/,"").replace(/-+$/,""),m=(r,e)=>{let n=O(r);if(n==="")throw new Error(`Invalid ${e} '${r}', must include alphanumeric characters`);return n},N=(r,e)=>`${m(r,"kind")}${e?`--${m(e,"name")}`:""}`,M=r=>R(r);function f(r,e){return Array.isArray(e)?e.includes(r):r.match(e)}function G(r,{includeStories:e,excludeStories:n}){return r!=="__esModule"&&(!e||f(r,e))&&(!n||!f(r,n))}var V=(r,{rootSeparator:e,groupSeparator:n})=>{let[t,a]=r.split(e,2),i=(a||r).split(n).filter(o=>!!o);return {root:a?t:null,groups:i}};
|
4
4
|
|
5
5
|
exports.includeConditionalArg = L;
|
6
6
|
exports.isExportStory = G;
|
package/dist/index.mjs
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
var
|
1
|
+
var B=Object.create;var u=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var E=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var I=(r,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of F(e))!w.call(r,a)&&a!==n&&u(r,a,{get:()=>e[a],enumerable:!(t=C(e,a))||t.enumerable});return r};var v=(r,e,n)=>(n=r!=null?B(h(r)):{},I(e||!r||!r.__esModule?u(n,"default",{value:r,enumerable:!0}):n,r));var x=E(T=>{Object.defineProperty(T,"__esModule",{value:!0}),T.isEqual=function(){var r=Object.prototype.toString,e=Object.getPrototypeOf,n=Object.getOwnPropertySymbols?function(t){return Object.keys(t).concat(Object.getOwnPropertySymbols(t))}:Object.keys;return function(t,a){return function i(o,s,d){var y,g,p,l=r.call(o),b=r.call(s);if(o===s)return !0;if(o==null||s==null)return !1;if(d.indexOf(o)>-1&&d.indexOf(s)>-1)return !0;if(d.push(o,s),l!=b||(y=n(o),g=n(s),y.length!=g.length||y.some(function(A){return !i(o[A],s[A],d)})))return !1;switch(l.slice(8,-1)){case"Symbol":return o.valueOf()==s.valueOf();case"Date":case"Number":return +o==+s||+o!=+o&&+s!=+s;case"RegExp":case"Function":case"String":case"Boolean":return ""+o==""+s;case"Set":case"Map":y=o.entries(),g=s.entries();do if(!i((p=y.next()).value,g.next().value,d))return !1;while(!p.done);return !0;case"ArrayBuffer":o=new Uint8Array(o),s=new Uint8Array(s);case"DataView":o=new Uint8Array(o.buffer),s=new Uint8Array(s.buffer);case"Float32Array":case"Float64Array":case"Int8Array":case"Int16Array":case"Int32Array":case"Uint8Array":case"Uint16Array":case"Uint32Array":case"Uint8ClampedArray":case"Arguments":case"Array":if(o.length!=s.length)return !1;for(p=0;p<o.length;p++)if((p in o||p in s)&&(p in o!=p in s||!i(o[p],s[p],d)))return !1;return !0;case"Object":return i(e(o),e(s),d);default:return !1}}(t,a,[])}}();});function R(r){return r.replace(/_/g," ").replace(/-/g," ").replace(/\./g," ").replace(/([^\n])([A-Z])([a-z])/g,(e,n,t,a)=>`${n} ${t}${a}`).replace(/([a-z])([A-Z])/g,(e,n,t)=>`${n} ${t}`).replace(/([a-z])([0-9])/gi,(e,n,t)=>`${n} ${t}`).replace(/([0-9])([a-z])/gi,(e,n,t)=>`${n} ${t}`).replace(/(\s|^)(\w)/g,(e,n,t)=>`${n}${t.toUpperCase()}`).replace(/ +/g," ").trim()}var c=v(x()),S=r=>r.map(e=>typeof e<"u").filter(Boolean).length,P=(r,e)=>{let{exists:n,eq:t,neq:a,truthy:i}=r;if(S([n,t,a,i])>1)throw new Error(`Invalid conditional test ${JSON.stringify({exists:n,eq:t,neq:a})}`);if(typeof t<"u")return (0, c.isEqual)(e,t);if(typeof a<"u")return !(0, c.isEqual)(e,a);if(typeof n<"u"){let s=typeof e<"u";return n?s:!s}return (typeof i>"u"?!0:i)?!!e:!e},L=(r,e,n)=>{if(!r.if)return !0;let{arg:t,global:a}=r.if;if(S([t,a])!==1)throw new Error(`Invalid conditional value ${JSON.stringify({arg:t,global:a})}`);let i=t?e[t]:n[a];return P(r.if,i)};var O=r=>r.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,"-").replace(/-+/g,"-").replace(/^-+/,"").replace(/-+$/,""),m=(r,e)=>{let n=O(r);if(n==="")throw new Error(`Invalid ${e} '${r}', must include alphanumeric characters`);return n},N=(r,e)=>`${m(r,"kind")}${e?`--${m(e,"name")}`:""}`,M=r=>R(r);function f(r,e){return Array.isArray(e)?e.includes(r):r.match(e)}function G(r,{includeStories:e,excludeStories:n}){return r!=="__esModule"&&(!e||f(r,e))&&(!n||!f(r,n))}var V=(r,{rootSeparator:e,groupSeparator:n})=>{let[t,a]=r.split(e,2),i=(a||r).split(n).filter(o=>!!o);return {root:a?t:null,groups:i}};
|
2
2
|
|
3
3
|
export { L as includeConditionalArg, G as isExportStory, V as parseKind, O as sanitize, M as storyNameFromExport, N as toId };
|