Add Storybook patch
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
diff --git a/dist/preview.d.ts b/dist/preview.d.ts
|
||||
index 73525b5fe07240d27733b59362cf2076cd28a6ed..0420e6b170a65b6d0db64fcfcfa07b68cd851942 100644
|
||||
--- a/dist/preview.d.ts
|
||||
+++ b/dist/preview.d.ts
|
||||
@@ -174,7 +174,7 @@ type UnionToIntersection<Union> = (
|
||||
declare function __definePreview<Addons extends PreviewAddon<never>[]>(input: {
|
||||
addons: Addons;
|
||||
} & ProjectAnnotations<ReactTypes & InferTypes<Addons>>): ReactPreview<ReactTypes & InferTypes<Addons>>;
|
||||
-interface ReactPreview<T extends AddonTypes> extends Preview<ReactTypes & T> {
|
||||
+interface ReactPreview<T extends AddonTypes = any> extends Omit<Preview<ReactTypes & T>, 'meta'> {
|
||||
meta<TArgs extends Args, Decorators extends DecoratorFunction<ReactTypes & T, any>, TMetaArgs extends Partial<TArgs>>(meta: {
|
||||
render?: ArgsStoryFn<ReactTypes & T, TArgs>;
|
||||
component?: ComponentType<TArgs>;
|
||||
@@ -187,16 +187,13 @@ interface ReactPreview<T extends AddonTypes> extends Preview<ReactTypes & T> {
|
||||
}>;
|
||||
}
|
||||
type DecoratorsArgs<TRenderer extends Renderer, Decorators> = UnionToIntersection<Decorators extends DecoratorFunction<TRenderer, infer TArgs> ? TArgs : unknown>;
|
||||
-interface ReactMeta<T extends ReactTypes, MetaInput extends ComponentAnnotations<T>> extends Meta<T, MetaInput> {
|
||||
+interface ReactMeta<T extends ReactTypes = any, MetaInput = any> extends Omit<Meta<T, ComponentAnnotations<T, any>>, 'story'> {
|
||||
story<TInput extends (() => ReactTypes['storyResult']) | (StoryAnnotations<T, T['args']> & {
|
||||
render: () => ReactTypes['storyResult'];
|
||||
- })>(story?: TInput): ReactStory<T, TInput extends () => ReactTypes['storyResult'] ? {
|
||||
- render: TInput;
|
||||
- } : TInput>;
|
||||
- story<TInput extends Simplify<StoryAnnotations<T, AddMocks<T['args'], MetaInput['args']>, SetOptional<T['args'], keyof T['args'] & keyof MetaInput['args']>>>>(story?: TInput): ReactStory<T, TInput>;
|
||||
+ })>(story?: TInput): ReactStory<T>;
|
||||
+ story<TInput = any>(story?: TInput): ReactStory<T>;
|
||||
}
|
||||
-interface ReactStory<T extends ReactTypes, TInput extends StoryAnnotations<T, T['args']>> extends Story<T, TInput> {
|
||||
+interface ReactStory<T extends ReactTypes> {
|
||||
Component: ComponentType<Partial<T['args']>>;
|
||||
}
|
||||
-
|
||||
export { ReactPreview, ReactStory, __definePreview };
|
||||
\ No newline at end of file
|
||||
+2
-1
@@ -112,7 +112,8 @@
|
||||
"csstype@npm:^3.1.2": "3.0.9",
|
||||
"csstype@npm:^3.1.3": "3.0.9",
|
||||
"jest-haste-map@^29.7.0": "patch:jest-haste-map@npm%3A29.7.0#./.yarn/patches/jest-haste-map-npm-29.7.0-e3be419eff.patch",
|
||||
"recast@npm:0.23.9>ast-types": "patch:ast-types@npm%3A0.16.1#./.yarn/patches/ast-types-npm-0.16.1-43c4ac4b0d.patch"
|
||||
"recast@npm:0.23.9>ast-types": "patch:ast-types@npm%3A0.16.1#./.yarn/patches/ast-types-npm-0.16.1-43c4ac4b0d.patch",
|
||||
"@storybook/react@npm:9.1.5": "patch:@storybook/react@npm%3A9.1.5#~/.yarn/patches/@storybook-react-npm-9.1.5-2331f18b6b.patch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/errors": "workspace:^",
|
||||
|
||||
@@ -18456,6 +18456,24 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@storybook/react@patch:@storybook/react@npm%3A9.1.5#~/.yarn/patches/@storybook-react-npm-9.1.5-2331f18b6b.patch":
|
||||
version: 9.1.5
|
||||
resolution: "@storybook/react@patch:@storybook/react@npm%3A9.1.5#~/.yarn/patches/@storybook-react-npm-9.1.5-2331f18b6b.patch::version=9.1.5&hash=8c1145"
|
||||
dependencies:
|
||||
"@storybook/global": "npm:^5.0.0"
|
||||
"@storybook/react-dom-shim": "npm:9.1.5"
|
||||
peerDependencies:
|
||||
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
|
||||
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta
|
||||
storybook: ^9.1.5
|
||||
typescript: ">= 4.9.x"
|
||||
peerDependenciesMeta:
|
||||
typescript:
|
||||
optional: true
|
||||
checksum: 10/17edd1c58208ca26ed805656fadda3b0797a995afc0d64005ce50b4383dc1b3bbfead2c9c4523f1450ee7b82570b0302acadedb17ea3d8aeacfb1b66f7f436d1
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@swagger-api/apidom-ast@npm:^1.0.0-beta.11":
|
||||
version: 1.0.0-beta.11
|
||||
resolution: "@swagger-api/apidom-ast@npm:1.0.0-beta.11"
|
||||
|
||||
Reference in New Issue
Block a user