@storybook/addon-docs 6.5.9 → 7.0.0-alpha.10
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/blocks.d.ts +1 -1
- package/dist/cjs/blocks/index.js +5 -359
- package/dist/cjs/index.js +1 -7
- package/dist/cjs/manager.js +9 -15
- package/dist/cjs/preset.js +121 -193
- package/dist/cjs/preview.js +9 -87
- package/dist/cjs/shared.js +5 -5
- package/dist/esm/blocks/index.js +1 -24
- package/dist/esm/manager.js +9 -14
- package/dist/esm/preset.js +114 -179
- package/dist/esm/preview.js +7 -61
- package/dist/esm/shared.js +5 -5
- package/dist/types/blocks/index.d.ts +1 -0
- package/dist/{ts3.9 → types}/index.d.ts +0 -0
- package/dist/{ts3.9 → types}/manager.d.ts +0 -0
- package/dist/{ts3.9 → types}/preset.d.ts +2 -1
- package/dist/types/preview.d.ts +1 -0
- package/dist/{ts3.9 → types}/shared.d.ts +0 -0
- package/package.json +18 -25
- package/dist/cjs/blocks/Anchor.js +0 -26
- package/dist/cjs/blocks/ArgsTable.js +0 -400
- package/dist/cjs/blocks/Canvas.js +0 -144
- package/dist/cjs/blocks/Description.js +0 -153
- package/dist/cjs/blocks/DocsContainer.js +0 -155
- package/dist/cjs/blocks/DocsContext.js +0 -25
- package/dist/cjs/blocks/DocsPage.js +0 -32
- package/dist/cjs/blocks/DocsStory.js +0 -78
- package/dist/cjs/blocks/Heading.js +0 -35
- package/dist/cjs/blocks/Meta.js +0 -72
- package/dist/cjs/blocks/Preview.js +0 -29
- package/dist/cjs/blocks/Primary.js +0 -67
- package/dist/cjs/blocks/Props.js +0 -35
- package/dist/cjs/blocks/Source.js +0 -197
- package/dist/cjs/blocks/SourceContainer.js +0 -116
- package/dist/cjs/blocks/Stories.js +0 -82
- package/dist/cjs/blocks/Story.js +0 -263
- package/dist/cjs/blocks/Subheading.js +0 -35
- package/dist/cjs/blocks/Subtitle.js +0 -59
- package/dist/cjs/blocks/Title.js +0 -68
- package/dist/cjs/blocks/Wrapper.js +0 -21
- package/dist/cjs/blocks/enhanceSource.js +0 -129
- package/dist/cjs/blocks/mdx.js +0 -245
- package/dist/cjs/blocks/types.js +0 -10
- package/dist/cjs/blocks/useStory.js +0 -108
- package/dist/cjs/blocks/utils.js +0 -61
- package/dist/esm/blocks/Anchor.js +0 -11
- package/dist/esm/blocks/ArgsTable.js +0 -341
- package/dist/esm/blocks/Canvas.js +0 -95
- package/dist/esm/blocks/Description.js +0 -113
- package/dist/esm/blocks/DocsContainer.js +0 -106
- package/dist/esm/blocks/DocsContext.js +0 -16
- package/dist/esm/blocks/DocsPage.js +0 -13
- package/dist/esm/blocks/DocsStory.js +0 -55
- package/dist/esm/blocks/Heading.js +0 -19
- package/dist/esm/blocks/Meta.js +0 -35
- package/dist/esm/blocks/Preview.js +0 -14
- package/dist/esm/blocks/Primary.js +0 -29
- package/dist/esm/blocks/Props.js +0 -19
- package/dist/esm/blocks/Source.js +0 -150
- package/dist/esm/blocks/SourceContainer.js +0 -77
- package/dist/esm/blocks/Stories.js +0 -42
- package/dist/esm/blocks/Story.js +0 -207
- package/dist/esm/blocks/Subheading.js +0 -19
- package/dist/esm/blocks/Subtitle.js +0 -23
- package/dist/esm/blocks/Title.js +0 -25
- package/dist/esm/blocks/Wrapper.js +0 -9
- package/dist/esm/blocks/enhanceSource.js +0 -111
- package/dist/esm/blocks/mdx.js +0 -207
- package/dist/esm/blocks/types.js +0 -2
- package/dist/esm/blocks/useStory.js +0 -84
- package/dist/esm/blocks/utils.js +0 -43
- package/dist/modern/blocks/Anchor.js +0 -8
- package/dist/modern/blocks/ArgsTable.js +0 -292
- package/dist/modern/blocks/Canvas.js +0 -83
- package/dist/modern/blocks/Description.js +0 -107
- package/dist/modern/blocks/DocsContainer.js +0 -98
- package/dist/modern/blocks/DocsContext.js +0 -16
- package/dist/modern/blocks/DocsPage.js +0 -11
- package/dist/modern/blocks/DocsStory.js +0 -48
- package/dist/modern/blocks/Heading.js +0 -17
- package/dist/modern/blocks/Meta.js +0 -31
- package/dist/modern/blocks/Preview.js +0 -9
- package/dist/modern/blocks/Primary.js +0 -23
- package/dist/modern/blocks/Props.js +0 -14
- package/dist/modern/blocks/Source.js +0 -154
- package/dist/modern/blocks/SourceContainer.js +0 -44
- package/dist/modern/blocks/Stories.js +0 -34
- package/dist/modern/blocks/Story.js +0 -168
- package/dist/modern/blocks/Subheading.js +0 -17
- package/dist/modern/blocks/Subtitle.js +0 -23
- package/dist/modern/blocks/Title.js +0 -24
- package/dist/modern/blocks/Wrapper.js +0 -8
- package/dist/modern/blocks/enhanceSource.js +0 -89
- package/dist/modern/blocks/index.js +0 -24
- package/dist/modern/blocks/mdx.js +0 -204
- package/dist/modern/blocks/types.js +0 -2
- package/dist/modern/blocks/useStory.js +0 -28
- package/dist/modern/blocks/utils.js +0 -29
- package/dist/modern/index.js +0 -1
- package/dist/modern/manager.js +0 -16
- package/dist/modern/preset.js +0 -130
- package/dist/modern/preview.js +0 -6
- package/dist/modern/shared.js +0 -11
- package/dist/ts3.4/blocks/Anchor.d.ts +0 -6
- package/dist/ts3.4/blocks/ArgsTable.d.ts +0 -33
- package/dist/ts3.4/blocks/Canvas.d.ts +0 -9
- package/dist/ts3.4/blocks/Description.d.ts +0 -20
- package/dist/ts3.4/blocks/DocsContainer.d.ts +0 -7
- package/dist/ts3.4/blocks/DocsContext.d.ts +0 -5
- package/dist/ts3.4/blocks/DocsPage.d.ts +0 -2
- package/dist/ts3.4/blocks/DocsStory.d.ts +0 -3
- package/dist/ts3.4/blocks/Heading.d.ts +0 -6
- package/dist/ts3.4/blocks/Meta.d.ts +0 -9
- package/dist/ts3.4/blocks/Preview.d.ts +0 -3
- package/dist/ts3.4/blocks/Primary.d.ts +0 -6
- package/dist/ts3.4/blocks/Props.d.ts +0 -3
- package/dist/ts3.4/blocks/Source.d.ts +0 -38
- package/dist/ts3.4/blocks/SourceContainer.d.ts +0 -14
- package/dist/ts3.4/blocks/Stories.d.ts +0 -7
- package/dist/ts3.4/blocks/Story.d.ts +0 -28
- package/dist/ts3.4/blocks/Subheading.d.ts +0 -3
- package/dist/ts3.4/blocks/Subtitle.d.ts +0 -6
- package/dist/ts3.4/blocks/Title.d.ts +0 -8
- package/dist/ts3.4/blocks/Wrapper.d.ts +0 -2
- package/dist/ts3.4/blocks/enhanceSource.d.ts +0 -3
- package/dist/ts3.4/blocks/index.d.ts +0 -24
- package/dist/ts3.4/blocks/mdx.d.ts +0 -20
- package/dist/ts3.4/blocks/types.d.ts +0 -13
- package/dist/ts3.4/blocks/useStory.d.ts +0 -5
- package/dist/ts3.4/blocks/utils.d.ts +0 -3
- package/dist/ts3.4/index.d.ts +0 -1
- package/dist/ts3.4/manager.d.ts +0 -1
- package/dist/ts3.4/preset.d.ts +0 -11
- package/dist/ts3.4/preview.d.ts +0 -6
- package/dist/ts3.4/shared.d.ts +0 -24
- package/dist/ts3.9/blocks/Anchor.d.ts +0 -6
- package/dist/ts3.9/blocks/ArgsTable.d.ts +0 -33
- package/dist/ts3.9/blocks/Canvas.d.ts +0 -9
- package/dist/ts3.9/blocks/Description.d.ts +0 -20
- package/dist/ts3.9/blocks/DocsContainer.d.ts +0 -7
- package/dist/ts3.9/blocks/DocsContext.d.ts +0 -5
- package/dist/ts3.9/blocks/DocsPage.d.ts +0 -2
- package/dist/ts3.9/blocks/DocsStory.d.ts +0 -3
- package/dist/ts3.9/blocks/Heading.d.ts +0 -6
- package/dist/ts3.9/blocks/Meta.d.ts +0 -9
- package/dist/ts3.9/blocks/Preview.d.ts +0 -3
- package/dist/ts3.9/blocks/Primary.d.ts +0 -6
- package/dist/ts3.9/blocks/Props.d.ts +0 -3
- package/dist/ts3.9/blocks/Source.d.ts +0 -38
- package/dist/ts3.9/blocks/SourceContainer.d.ts +0 -14
- package/dist/ts3.9/blocks/Stories.d.ts +0 -7
- package/dist/ts3.9/blocks/Story.d.ts +0 -28
- package/dist/ts3.9/blocks/Subheading.d.ts +0 -3
- package/dist/ts3.9/blocks/Subtitle.d.ts +0 -6
- package/dist/ts3.9/blocks/Title.d.ts +0 -8
- package/dist/ts3.9/blocks/Wrapper.d.ts +0 -2
- package/dist/ts3.9/blocks/enhanceSource.d.ts +0 -3
- package/dist/ts3.9/blocks/index.d.ts +0 -24
- package/dist/ts3.9/blocks/mdx.d.ts +0 -20
- package/dist/ts3.9/blocks/types.d.ts +0 -13
- package/dist/ts3.9/blocks/useStory.d.ts +0 -5
- package/dist/ts3.9/blocks/utils.d.ts +0 -3
- package/dist/ts3.9/preview.d.ts +0 -6
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import { DescriptionProps as PureDescriptionProps } from '@storybook/components';
|
|
3
|
-
import { DocsContextProps } from './DocsContext';
|
|
4
|
-
import { Component } from './types';
|
|
5
|
-
export declare enum DescriptionType {
|
|
6
|
-
INFO = "info",
|
|
7
|
-
NOTES = "notes",
|
|
8
|
-
DOCGEN = "docgen",
|
|
9
|
-
LEGACY_5_2 = "legacy-5.2",
|
|
10
|
-
AUTO = "auto"
|
|
11
|
-
}
|
|
12
|
-
interface DescriptionProps {
|
|
13
|
-
of?: '.' | Component;
|
|
14
|
-
type?: DescriptionType;
|
|
15
|
-
markdown?: string;
|
|
16
|
-
children?: string;
|
|
17
|
-
}
|
|
18
|
-
export declare const getDescriptionProps: ({ of, type, markdown, children }: DescriptionProps, { id, storyById }: DocsContextProps<any>) => PureDescriptionProps;
|
|
19
|
-
declare const DescriptionContainer: FunctionComponent<DescriptionProps>;
|
|
20
|
-
export { DescriptionContainer as Description };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import { AnyFramework } from '@storybook/csf';
|
|
3
|
-
import { DocsContextProps } from './DocsContext';
|
|
4
|
-
export interface DocsContainerProps<TFramework extends AnyFramework = AnyFramework> {
|
|
5
|
-
context: DocsContextProps<TFramework>;
|
|
6
|
-
}
|
|
7
|
-
export declare const DocsContainer: FunctionComponent<DocsContainerProps>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { BaseAnnotations } from '@storybook/csf';
|
|
3
|
-
declare type MetaProps = BaseAnnotations;
|
|
4
|
-
/**
|
|
5
|
-
* This component is used to declare component metadata in docs
|
|
6
|
-
* and gets transformed into a default export underneath the hood.
|
|
7
|
-
*/
|
|
8
|
-
export declare const Meta: FC<MetaProps>;
|
|
9
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { ComponentProps, FC } from 'react';
|
|
2
|
-
import { Source as PureSource } from '@storybook/components';
|
|
3
|
-
import { DocsContextProps } from './DocsContext';
|
|
4
|
-
import { SourceContextProps } from './SourceContainer';
|
|
5
|
-
export declare enum SourceState {
|
|
6
|
-
OPEN = "open",
|
|
7
|
-
CLOSED = "closed",
|
|
8
|
-
NONE = "none"
|
|
9
|
-
}
|
|
10
|
-
interface CommonProps {
|
|
11
|
-
language?: string;
|
|
12
|
-
dark?: boolean;
|
|
13
|
-
format?: PureSourceProps['format'];
|
|
14
|
-
code?: string;
|
|
15
|
-
}
|
|
16
|
-
declare type SingleSourceProps = {
|
|
17
|
-
id: string;
|
|
18
|
-
} & CommonProps;
|
|
19
|
-
declare type MultiSourceProps = {
|
|
20
|
-
ids: string[];
|
|
21
|
-
} & CommonProps;
|
|
22
|
-
declare type CodeProps = {
|
|
23
|
-
code: string;
|
|
24
|
-
} & CommonProps;
|
|
25
|
-
declare type NoneProps = CommonProps;
|
|
26
|
-
declare type SourceProps = SingleSourceProps | MultiSourceProps | CodeProps | NoneProps;
|
|
27
|
-
declare type SourceStateProps = {
|
|
28
|
-
state: SourceState;
|
|
29
|
-
};
|
|
30
|
-
declare type PureSourceProps = ComponentProps<typeof PureSource>;
|
|
31
|
-
export declare const getSourceProps: (props: SourceProps, docsContext: DocsContextProps<any>, sourceContext: SourceContextProps) => PureSourceProps & SourceStateProps;
|
|
32
|
-
/**
|
|
33
|
-
* Story source doc block renders source code if provided,
|
|
34
|
-
* or the source for a story if `storyId` is provided, or
|
|
35
|
-
* the source for the current story if nothing is provided.
|
|
36
|
-
*/
|
|
37
|
-
export declare const Source: FC<PureSourceProps>;
|
|
38
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FC, Context } from 'react';
|
|
2
|
-
import { SyntaxHighlighterFormatTypes } from '@storybook/components';
|
|
3
|
-
import { StoryId } from '@storybook/api';
|
|
4
|
-
export interface SourceItem {
|
|
5
|
-
code: string;
|
|
6
|
-
format: SyntaxHighlighterFormatTypes;
|
|
7
|
-
}
|
|
8
|
-
export declare type StorySources = Record<StoryId, SourceItem>;
|
|
9
|
-
export interface SourceContextProps {
|
|
10
|
-
sources: StorySources;
|
|
11
|
-
setSource?: (id: StoryId, item: SourceItem) => void;
|
|
12
|
-
}
|
|
13
|
-
export declare const SourceContext: Context<SourceContextProps>;
|
|
14
|
-
export declare const SourceContainer: FC<{}>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent, ReactNode, ElementType, ComponentProps } from 'react';
|
|
2
|
-
import { Story as PureStory } from '@storybook/components';
|
|
3
|
-
import { StoryId, StoryAnnotations, AnyFramework } from '@storybook/csf';
|
|
4
|
-
import { Story as StoryType } from '@storybook/store';
|
|
5
|
-
import { DocsContextProps } from './DocsContext';
|
|
6
|
-
export declare const storyBlockIdFromId: (storyId: string) => string;
|
|
7
|
-
declare type PureStoryProps = ComponentProps<typeof PureStory>;
|
|
8
|
-
declare type CommonProps = StoryAnnotations & {
|
|
9
|
-
height?: string;
|
|
10
|
-
inline?: boolean;
|
|
11
|
-
};
|
|
12
|
-
declare type StoryDefProps = {
|
|
13
|
-
name: string;
|
|
14
|
-
children: ReactNode;
|
|
15
|
-
};
|
|
16
|
-
declare type StoryRefProps = {
|
|
17
|
-
id?: string;
|
|
18
|
-
};
|
|
19
|
-
declare type StoryImportProps = {
|
|
20
|
-
name: string;
|
|
21
|
-
story: ElementType;
|
|
22
|
-
};
|
|
23
|
-
export declare type StoryProps = (StoryDefProps | StoryRefProps | StoryImportProps) & CommonProps;
|
|
24
|
-
export declare const lookupStoryId: (storyName: string, { mdxStoryNameToKey, mdxComponentAnnotations }: DocsContextProps) => string;
|
|
25
|
-
export declare const getStoryId: (props: StoryProps, context: DocsContextProps) => StoryId;
|
|
26
|
-
export declare const getStoryProps: <TFramework extends AnyFramework>({ height, inline }: StoryProps, story: StoryType<TFramework>, context: DocsContextProps<TFramework>, onStoryFnCalled: () => void) => PureStoryProps;
|
|
27
|
-
declare const Story: FunctionComponent<StoryProps>;
|
|
28
|
-
export { Story };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import { DocsContextProps } from './DocsContext';
|
|
3
|
-
interface TitleProps {
|
|
4
|
-
children?: JSX.Element | string;
|
|
5
|
-
}
|
|
6
|
-
export declare const extractTitle: ({ title }: DocsContextProps) => string;
|
|
7
|
-
export declare const Title: FunctionComponent<TitleProps>;
|
|
8
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export { ColorPalette, ColorItem, IconGallery, IconItem, Typeset } from '@storybook/components';
|
|
2
|
-
export * from './Anchor';
|
|
3
|
-
export * from './ArgsTable';
|
|
4
|
-
export * from './Canvas';
|
|
5
|
-
export * from './Description';
|
|
6
|
-
export * from './DocsContext';
|
|
7
|
-
export * from './DocsPage';
|
|
8
|
-
export * from './DocsContainer';
|
|
9
|
-
export * from './DocsStory';
|
|
10
|
-
export * from './Heading';
|
|
11
|
-
export * from './Meta';
|
|
12
|
-
export * from './Preview';
|
|
13
|
-
export * from './Primary';
|
|
14
|
-
export * from './Props';
|
|
15
|
-
export * from './Source';
|
|
16
|
-
export * from './SourceContainer';
|
|
17
|
-
export * from './Stories';
|
|
18
|
-
export * from './Story';
|
|
19
|
-
export * from './Subheading';
|
|
20
|
-
export * from './Subtitle';
|
|
21
|
-
export * from './Title';
|
|
22
|
-
export * from './Wrapper';
|
|
23
|
-
export * from './types';
|
|
24
|
-
export * from './mdx';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { DocsContextProps } from './DocsContext';
|
|
3
|
-
export declare const assertIsFn: (val: any) => any;
|
|
4
|
-
export declare const AddContext: FC<DocsContextProps>;
|
|
5
|
-
interface CodeOrSourceMdxProps {
|
|
6
|
-
className?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const CodeOrSourceMdx: FC<CodeOrSourceMdxProps>;
|
|
9
|
-
interface AnchorMdxProps {
|
|
10
|
-
href: string;
|
|
11
|
-
target: string;
|
|
12
|
-
}
|
|
13
|
-
export declare const AnchorMdx: FC<AnchorMdxProps>;
|
|
14
|
-
interface HeaderMdxProps {
|
|
15
|
-
as: string;
|
|
16
|
-
id: string;
|
|
17
|
-
}
|
|
18
|
-
export declare const HeaderMdx: FC<HeaderMdxProps>;
|
|
19
|
-
export declare const HeadersMdx: {};
|
|
20
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const CURRENT_SELECTION = ".";
|
|
2
|
-
export declare const PRIMARY_STORY = "^";
|
|
3
|
-
export declare type Component = any;
|
|
4
|
-
export interface StoryData {
|
|
5
|
-
id?: string;
|
|
6
|
-
kind?: string;
|
|
7
|
-
name?: string;
|
|
8
|
-
parameters?: any;
|
|
9
|
-
}
|
|
10
|
-
export declare type DocsStoryProps = StoryData & {
|
|
11
|
-
expanded?: boolean;
|
|
12
|
-
withToolbar?: boolean;
|
|
13
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { StoryId, AnyFramework } from '@storybook/csf';
|
|
2
|
-
import { Story } from '@storybook/store';
|
|
3
|
-
import { DocsContextProps } from './DocsContext';
|
|
4
|
-
export declare function useStory<TFramework extends AnyFramework = AnyFramework>(storyId: StoryId, context: DocsContextProps<TFramework>): Story<TFramework> | void;
|
|
5
|
-
export declare function useStories<TFramework extends AnyFramework = AnyFramework>(storyIds: StoryId[], context: DocsContextProps<TFramework>): (Story<TFramework> | void)[];
|
package/dist/ts3.4/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './blocks';
|
package/dist/ts3.4/manager.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/ts3.4/preset.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Options } from '@storybook/core-common';
|
|
2
|
-
declare type BabelParams = {
|
|
3
|
-
babelOptions?: any;
|
|
4
|
-
mdxBabelOptions?: any;
|
|
5
|
-
configureJSX?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare function webpack(webpackConfig: any, options: Options & BabelParams & {
|
|
8
|
-
sourceLoaderOptions: any;
|
|
9
|
-
transcludeMarkdown: boolean;
|
|
10
|
-
}): Promise<any>;
|
|
11
|
-
export {};
|
package/dist/ts3.4/preview.d.ts
DELETED
package/dist/ts3.4/shared.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export declare const ADDON_ID = "storybook/docs";
|
|
2
|
-
export declare const PANEL_ID: string;
|
|
3
|
-
export declare const PARAM_KEY = "docs";
|
|
4
|
-
export declare const SNIPPET_RENDERED: string;
|
|
5
|
-
export declare enum SourceType {
|
|
6
|
-
/**
|
|
7
|
-
* AUTO is the default
|
|
8
|
-
*
|
|
9
|
-
* Use the CODE logic if:
|
|
10
|
-
* - the user has set a custom source snippet in `docs.source.code` story parameter
|
|
11
|
-
* - the story is not an args-based story
|
|
12
|
-
*
|
|
13
|
-
* Use the DYNAMIC rendered snippet if the story is an args story
|
|
14
|
-
*/
|
|
15
|
-
AUTO = "auto",
|
|
16
|
-
/**
|
|
17
|
-
* Render the code extracted by source-loader
|
|
18
|
-
*/
|
|
19
|
-
CODE = "code",
|
|
20
|
-
/**
|
|
21
|
-
* Render dynamically-rendered source snippet from the story's virtual DOM (currently React only)
|
|
22
|
-
*/
|
|
23
|
-
DYNAMIC = "dynamic"
|
|
24
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { SortType } from '@storybook/components';
|
|
3
|
-
import { PropDescriptor } from '@storybook/store';
|
|
4
|
-
import { StrictArgTypes } from '@storybook/csf';
|
|
5
|
-
import { DocsContextProps } from './DocsContext';
|
|
6
|
-
import { Component } from './types';
|
|
7
|
-
interface BaseProps {
|
|
8
|
-
include?: PropDescriptor;
|
|
9
|
-
exclude?: PropDescriptor;
|
|
10
|
-
sort?: SortType;
|
|
11
|
-
}
|
|
12
|
-
declare type OfProps = BaseProps & {
|
|
13
|
-
of: '.' | '^' | Component;
|
|
14
|
-
};
|
|
15
|
-
declare type ComponentsProps = BaseProps & {
|
|
16
|
-
components: {
|
|
17
|
-
[label: string]: Component;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
declare type StoryProps = BaseProps & {
|
|
21
|
-
story: '.' | '^' | string;
|
|
22
|
-
showComponent?: boolean;
|
|
23
|
-
};
|
|
24
|
-
declare type ArgsTableProps = BaseProps | OfProps | ComponentsProps | StoryProps;
|
|
25
|
-
export declare const extractComponentArgTypes: (component: Component, { id, storyById }: DocsContextProps, include?: PropDescriptor, exclude?: PropDescriptor) => StrictArgTypes;
|
|
26
|
-
export declare const getComponent: (props: ArgsTableProps, { id, storyById }: DocsContextProps) => Component;
|
|
27
|
-
export declare const StoryTable: FC<StoryProps & {
|
|
28
|
-
component: Component;
|
|
29
|
-
subcomponents: Record<string, Component>;
|
|
30
|
-
}>;
|
|
31
|
-
export declare const ComponentsTable: FC<ComponentsProps>;
|
|
32
|
-
export declare const ArgsTable: FC<ArgsTableProps>;
|
|
33
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { PreviewProps as PurePreviewProps } from '@storybook/components';
|
|
3
|
-
import { SourceState } from './Source';
|
|
4
|
-
export { SourceState };
|
|
5
|
-
declare type CanvasProps = PurePreviewProps & {
|
|
6
|
-
withSource?: SourceState;
|
|
7
|
-
mdxSource?: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const Canvas: FC<CanvasProps>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import { DescriptionProps as PureDescriptionProps } from '@storybook/components';
|
|
3
|
-
import { DocsContextProps } from './DocsContext';
|
|
4
|
-
import { Component } from './types';
|
|
5
|
-
export declare enum DescriptionType {
|
|
6
|
-
INFO = "info",
|
|
7
|
-
NOTES = "notes",
|
|
8
|
-
DOCGEN = "docgen",
|
|
9
|
-
LEGACY_5_2 = "legacy-5.2",
|
|
10
|
-
AUTO = "auto"
|
|
11
|
-
}
|
|
12
|
-
interface DescriptionProps {
|
|
13
|
-
of?: '.' | Component;
|
|
14
|
-
type?: DescriptionType;
|
|
15
|
-
markdown?: string;
|
|
16
|
-
children?: string;
|
|
17
|
-
}
|
|
18
|
-
export declare const getDescriptionProps: ({ of, type, markdown, children }: DescriptionProps, { id, storyById }: DocsContextProps<any>) => PureDescriptionProps;
|
|
19
|
-
declare const DescriptionContainer: FunctionComponent<DescriptionProps>;
|
|
20
|
-
export { DescriptionContainer as Description };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import { AnyFramework } from '@storybook/csf';
|
|
3
|
-
import { DocsContextProps } from './DocsContext';
|
|
4
|
-
export interface DocsContainerProps<TFramework extends AnyFramework = AnyFramework> {
|
|
5
|
-
context: DocsContextProps<TFramework>;
|
|
6
|
-
}
|
|
7
|
-
export declare const DocsContainer: FunctionComponent<DocsContainerProps>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { BaseAnnotations } from '@storybook/csf';
|
|
3
|
-
declare type MetaProps = BaseAnnotations;
|
|
4
|
-
/**
|
|
5
|
-
* This component is used to declare component metadata in docs
|
|
6
|
-
* and gets transformed into a default export underneath the hood.
|
|
7
|
-
*/
|
|
8
|
-
export declare const Meta: FC<MetaProps>;
|
|
9
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { ComponentProps, FC } from 'react';
|
|
2
|
-
import { Source as PureSource } from '@storybook/components';
|
|
3
|
-
import { DocsContextProps } from './DocsContext';
|
|
4
|
-
import { SourceContextProps } from './SourceContainer';
|
|
5
|
-
export declare enum SourceState {
|
|
6
|
-
OPEN = "open",
|
|
7
|
-
CLOSED = "closed",
|
|
8
|
-
NONE = "none"
|
|
9
|
-
}
|
|
10
|
-
interface CommonProps {
|
|
11
|
-
language?: string;
|
|
12
|
-
dark?: boolean;
|
|
13
|
-
format?: PureSourceProps['format'];
|
|
14
|
-
code?: string;
|
|
15
|
-
}
|
|
16
|
-
declare type SingleSourceProps = {
|
|
17
|
-
id: string;
|
|
18
|
-
} & CommonProps;
|
|
19
|
-
declare type MultiSourceProps = {
|
|
20
|
-
ids: string[];
|
|
21
|
-
} & CommonProps;
|
|
22
|
-
declare type CodeProps = {
|
|
23
|
-
code: string;
|
|
24
|
-
} & CommonProps;
|
|
25
|
-
declare type NoneProps = CommonProps;
|
|
26
|
-
declare type SourceProps = SingleSourceProps | MultiSourceProps | CodeProps | NoneProps;
|
|
27
|
-
declare type SourceStateProps = {
|
|
28
|
-
state: SourceState;
|
|
29
|
-
};
|
|
30
|
-
declare type PureSourceProps = ComponentProps<typeof PureSource>;
|
|
31
|
-
export declare const getSourceProps: (props: SourceProps, docsContext: DocsContextProps<any>, sourceContext: SourceContextProps) => PureSourceProps & SourceStateProps;
|
|
32
|
-
/**
|
|
33
|
-
* Story source doc block renders source code if provided,
|
|
34
|
-
* or the source for a story if `storyId` is provided, or
|
|
35
|
-
* the source for the current story if nothing is provided.
|
|
36
|
-
*/
|
|
37
|
-
export declare const Source: FC<PureSourceProps>;
|
|
38
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FC, Context } from 'react';
|
|
2
|
-
import type { SyntaxHighlighterFormatTypes } from '@storybook/components';
|
|
3
|
-
import type { StoryId } from '@storybook/api';
|
|
4
|
-
export interface SourceItem {
|
|
5
|
-
code: string;
|
|
6
|
-
format: SyntaxHighlighterFormatTypes;
|
|
7
|
-
}
|
|
8
|
-
export declare type StorySources = Record<StoryId, SourceItem>;
|
|
9
|
-
export interface SourceContextProps {
|
|
10
|
-
sources: StorySources;
|
|
11
|
-
setSource?: (id: StoryId, item: SourceItem) => void;
|
|
12
|
-
}
|
|
13
|
-
export declare const SourceContext: Context<SourceContextProps>;
|
|
14
|
-
export declare const SourceContainer: FC<{}>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent, ReactNode, ElementType, ComponentProps } from 'react';
|
|
2
|
-
import { Story as PureStory } from '@storybook/components';
|
|
3
|
-
import { StoryId, StoryAnnotations, AnyFramework } from '@storybook/csf';
|
|
4
|
-
import { Story as StoryType } from '@storybook/store';
|
|
5
|
-
import { DocsContextProps } from './DocsContext';
|
|
6
|
-
export declare const storyBlockIdFromId: (storyId: string) => string;
|
|
7
|
-
declare type PureStoryProps = ComponentProps<typeof PureStory>;
|
|
8
|
-
declare type CommonProps = StoryAnnotations & {
|
|
9
|
-
height?: string;
|
|
10
|
-
inline?: boolean;
|
|
11
|
-
};
|
|
12
|
-
declare type StoryDefProps = {
|
|
13
|
-
name: string;
|
|
14
|
-
children: ReactNode;
|
|
15
|
-
};
|
|
16
|
-
declare type StoryRefProps = {
|
|
17
|
-
id?: string;
|
|
18
|
-
};
|
|
19
|
-
declare type StoryImportProps = {
|
|
20
|
-
name: string;
|
|
21
|
-
story: ElementType;
|
|
22
|
-
};
|
|
23
|
-
export declare type StoryProps = (StoryDefProps | StoryRefProps | StoryImportProps) & CommonProps;
|
|
24
|
-
export declare const lookupStoryId: (storyName: string, { mdxStoryNameToKey, mdxComponentAnnotations }: DocsContextProps) => string;
|
|
25
|
-
export declare const getStoryId: (props: StoryProps, context: DocsContextProps) => StoryId;
|
|
26
|
-
export declare const getStoryProps: <TFramework extends AnyFramework>({ height, inline }: StoryProps, story: StoryType<TFramework>, context: DocsContextProps<TFramework>, onStoryFnCalled: () => void) => PureStoryProps;
|
|
27
|
-
declare const Story: FunctionComponent<StoryProps>;
|
|
28
|
-
export { Story };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import { DocsContextProps } from './DocsContext';
|
|
3
|
-
interface TitleProps {
|
|
4
|
-
children?: JSX.Element | string;
|
|
5
|
-
}
|
|
6
|
-
export declare const extractTitle: ({ title }: DocsContextProps) => string;
|
|
7
|
-
export declare const Title: FunctionComponent<TitleProps>;
|
|
8
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export { ColorPalette, ColorItem, IconGallery, IconItem, Typeset } from '@storybook/components';
|
|
2
|
-
export * from './Anchor';
|
|
3
|
-
export * from './ArgsTable';
|
|
4
|
-
export * from './Canvas';
|
|
5
|
-
export * from './Description';
|
|
6
|
-
export * from './DocsContext';
|
|
7
|
-
export * from './DocsPage';
|
|
8
|
-
export * from './DocsContainer';
|
|
9
|
-
export * from './DocsStory';
|
|
10
|
-
export * from './Heading';
|
|
11
|
-
export * from './Meta';
|
|
12
|
-
export * from './Preview';
|
|
13
|
-
export * from './Primary';
|
|
14
|
-
export * from './Props';
|
|
15
|
-
export * from './Source';
|
|
16
|
-
export * from './SourceContainer';
|
|
17
|
-
export * from './Stories';
|
|
18
|
-
export * from './Story';
|
|
19
|
-
export * from './Subheading';
|
|
20
|
-
export * from './Subtitle';
|
|
21
|
-
export * from './Title';
|
|
22
|
-
export * from './Wrapper';
|
|
23
|
-
export * from './types';
|
|
24
|
-
export * from './mdx';
|