@storybook/addon-docs 6.5.6 → 7.0.0-alpha.0

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 (135) hide show
  1. package/blocks.d.ts +1 -1
  2. package/dist/cjs/blocks/ArgsTable.js +1 -1
  3. package/dist/cjs/blocks/Primary.js +1 -1
  4. package/dist/cjs/blocks/Stories.js +1 -1
  5. package/dist/cjs/blocks/mdx.js +1 -1
  6. package/dist/cjs/blocks/useStory.js +18 -4
  7. package/dist/cjs/preset.js +137 -33
  8. package/dist/cjs/preview.js +22 -6
  9. package/dist/esm/blocks/Anchor.js +7 -10
  10. package/dist/esm/blocks/ArgsTable.js +133 -182
  11. package/dist/esm/blocks/Canvas.js +34 -46
  12. package/dist/esm/blocks/Description.js +39 -45
  13. package/dist/esm/blocks/DocsContainer.js +36 -44
  14. package/dist/esm/blocks/DocsContext.js +1 -1
  15. package/dist/esm/blocks/DocsPage.js +3 -5
  16. package/dist/esm/blocks/DocsStory.js +18 -27
  17. package/dist/esm/blocks/Heading.js +5 -7
  18. package/dist/esm/blocks/Meta.js +9 -13
  19. package/dist/esm/blocks/Preview.js +5 -10
  20. package/dist/esm/blocks/Primary.js +10 -16
  21. package/dist/esm/blocks/Props.js +5 -10
  22. package/dist/esm/blocks/Source.js +64 -70
  23. package/dist/esm/blocks/SourceContainer.js +17 -50
  24. package/dist/esm/blocks/Stories.js +15 -27
  25. package/dist/esm/blocks/Story.js +58 -99
  26. package/dist/esm/blocks/Subheading.js +5 -7
  27. package/dist/esm/blocks/Subtitle.js +12 -12
  28. package/dist/esm/blocks/Title.js +10 -11
  29. package/dist/esm/blocks/Wrapper.js +7 -8
  30. package/dist/esm/blocks/enhanceSource.js +32 -56
  31. package/dist/esm/blocks/mdx.js +85 -89
  32. package/dist/esm/blocks/types.js +2 -2
  33. package/dist/esm/blocks/useStory.js +16 -73
  34. package/dist/esm/blocks/utils.js +4 -18
  35. package/dist/esm/manager.js +9 -14
  36. package/dist/esm/preset.js +114 -179
  37. package/dist/esm/preview.js +3 -61
  38. package/dist/esm/shared.js +5 -5
  39. package/dist/{ts3.9 → types}/blocks/Anchor.d.ts +0 -0
  40. package/dist/{ts3.9 → types}/blocks/ArgsTable.d.ts +0 -0
  41. package/dist/{ts3.9 → types}/blocks/Canvas.d.ts +0 -0
  42. package/dist/{ts3.9 → types}/blocks/Description.d.ts +0 -0
  43. package/dist/{ts3.9 → types}/blocks/DocsContainer.d.ts +0 -0
  44. package/dist/{ts3.9 → types}/blocks/DocsContext.d.ts +0 -0
  45. package/dist/{ts3.9 → types}/blocks/DocsPage.d.ts +0 -0
  46. package/dist/{ts3.9 → types}/blocks/DocsStory.d.ts +0 -0
  47. package/dist/{ts3.9 → types}/blocks/Heading.d.ts +0 -0
  48. package/dist/{ts3.9 → types}/blocks/Meta.d.ts +0 -0
  49. package/dist/{ts3.9 → types}/blocks/Preview.d.ts +0 -0
  50. package/dist/{ts3.9 → types}/blocks/Primary.d.ts +0 -0
  51. package/dist/{ts3.9 → types}/blocks/Props.d.ts +0 -0
  52. package/dist/{ts3.9 → types}/blocks/Source.d.ts +0 -0
  53. package/dist/{ts3.9 → types}/blocks/SourceContainer.d.ts +0 -0
  54. package/dist/{ts3.9 → types}/blocks/Stories.d.ts +0 -0
  55. package/dist/{ts3.9 → types}/blocks/Story.d.ts +0 -0
  56. package/dist/{ts3.9 → types}/blocks/Subheading.d.ts +0 -0
  57. package/dist/{ts3.9 → types}/blocks/Subtitle.d.ts +0 -0
  58. package/dist/{ts3.9 → types}/blocks/Title.d.ts +0 -0
  59. package/dist/{ts3.9 → types}/blocks/Wrapper.d.ts +0 -0
  60. package/dist/{ts3.9 → types}/blocks/enhanceSource.d.ts +0 -0
  61. package/dist/{ts3.9 → types}/blocks/index.d.ts +0 -0
  62. package/dist/{ts3.9 → types}/blocks/mdx.d.ts +0 -0
  63. package/dist/{ts3.9 → types}/blocks/types.d.ts +0 -0
  64. package/dist/{ts3.9 → types}/blocks/useStory.d.ts +0 -0
  65. package/dist/{ts3.9 → types}/blocks/utils.d.ts +0 -0
  66. package/dist/{ts3.9 → types}/index.d.ts +0 -0
  67. package/dist/{ts3.9 → types}/manager.d.ts +0 -0
  68. package/dist/{ts3.9 → types}/preset.d.ts +2 -1
  69. package/dist/{ts3.9 → types}/preview.d.ts +0 -0
  70. package/dist/{ts3.9 → types}/shared.d.ts +0 -0
  71. package/package.json +16 -24
  72. package/dist/modern/blocks/Anchor.js +0 -8
  73. package/dist/modern/blocks/ArgsTable.js +0 -292
  74. package/dist/modern/blocks/Canvas.js +0 -83
  75. package/dist/modern/blocks/Description.js +0 -107
  76. package/dist/modern/blocks/DocsContainer.js +0 -98
  77. package/dist/modern/blocks/DocsContext.js +0 -16
  78. package/dist/modern/blocks/DocsPage.js +0 -11
  79. package/dist/modern/blocks/DocsStory.js +0 -48
  80. package/dist/modern/blocks/Heading.js +0 -17
  81. package/dist/modern/blocks/Meta.js +0 -31
  82. package/dist/modern/blocks/Preview.js +0 -9
  83. package/dist/modern/blocks/Primary.js +0 -23
  84. package/dist/modern/blocks/Props.js +0 -14
  85. package/dist/modern/blocks/Source.js +0 -154
  86. package/dist/modern/blocks/SourceContainer.js +0 -44
  87. package/dist/modern/blocks/Stories.js +0 -34
  88. package/dist/modern/blocks/Story.js +0 -168
  89. package/dist/modern/blocks/Subheading.js +0 -17
  90. package/dist/modern/blocks/Subtitle.js +0 -23
  91. package/dist/modern/blocks/Title.js +0 -24
  92. package/dist/modern/blocks/Wrapper.js +0 -8
  93. package/dist/modern/blocks/enhanceSource.js +0 -89
  94. package/dist/modern/blocks/index.js +0 -24
  95. package/dist/modern/blocks/mdx.js +0 -204
  96. package/dist/modern/blocks/types.js +0 -2
  97. package/dist/modern/blocks/useStory.js +0 -28
  98. package/dist/modern/blocks/utils.js +0 -29
  99. package/dist/modern/index.js +0 -1
  100. package/dist/modern/manager.js +0 -16
  101. package/dist/modern/preset.js +0 -130
  102. package/dist/modern/preview.js +0 -6
  103. package/dist/modern/shared.js +0 -11
  104. package/dist/ts3.4/blocks/Anchor.d.ts +0 -6
  105. package/dist/ts3.4/blocks/ArgsTable.d.ts +0 -33
  106. package/dist/ts3.4/blocks/Canvas.d.ts +0 -9
  107. package/dist/ts3.4/blocks/Description.d.ts +0 -20
  108. package/dist/ts3.4/blocks/DocsContainer.d.ts +0 -7
  109. package/dist/ts3.4/blocks/DocsContext.d.ts +0 -5
  110. package/dist/ts3.4/blocks/DocsPage.d.ts +0 -2
  111. package/dist/ts3.4/blocks/DocsStory.d.ts +0 -3
  112. package/dist/ts3.4/blocks/Heading.d.ts +0 -6
  113. package/dist/ts3.4/blocks/Meta.d.ts +0 -9
  114. package/dist/ts3.4/blocks/Preview.d.ts +0 -3
  115. package/dist/ts3.4/blocks/Primary.d.ts +0 -6
  116. package/dist/ts3.4/blocks/Props.d.ts +0 -3
  117. package/dist/ts3.4/blocks/Source.d.ts +0 -38
  118. package/dist/ts3.4/blocks/SourceContainer.d.ts +0 -14
  119. package/dist/ts3.4/blocks/Stories.d.ts +0 -7
  120. package/dist/ts3.4/blocks/Story.d.ts +0 -28
  121. package/dist/ts3.4/blocks/Subheading.d.ts +0 -3
  122. package/dist/ts3.4/blocks/Subtitle.d.ts +0 -6
  123. package/dist/ts3.4/blocks/Title.d.ts +0 -8
  124. package/dist/ts3.4/blocks/Wrapper.d.ts +0 -2
  125. package/dist/ts3.4/blocks/enhanceSource.d.ts +0 -3
  126. package/dist/ts3.4/blocks/index.d.ts +0 -24
  127. package/dist/ts3.4/blocks/mdx.d.ts +0 -20
  128. package/dist/ts3.4/blocks/types.d.ts +0 -13
  129. package/dist/ts3.4/blocks/useStory.d.ts +0 -5
  130. package/dist/ts3.4/blocks/utils.d.ts +0 -3
  131. package/dist/ts3.4/index.d.ts +0 -1
  132. package/dist/ts3.4/manager.d.ts +0 -1
  133. package/dist/ts3.4/preset.d.ts +0 -11
  134. package/dist/ts3.4/preview.d.ts +0 -6
  135. package/dist/ts3.4/shared.d.ts +0 -24
@@ -1,6 +0,0 @@
1
- import { FunctionComponent } from 'react';
2
- interface SubtitleProps {
3
- children?: JSX.Element | string;
4
- }
5
- export declare const Subtitle: FunctionComponent<SubtitleProps>;
6
- export {};
@@ -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,2 +0,0 @@
1
- import { FunctionComponent } from 'react';
2
- export declare const Wrapper: FunctionComponent;
@@ -1,3 +0,0 @@
1
- import { Parameters } from '@storybook/addons';
2
- import { Story } from '@storybook/store';
3
- export declare const enhanceSource: (story: Story<any>) => Parameters;
@@ -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)[];
@@ -1,3 +0,0 @@
1
- import { Component } from './types';
2
- export declare const getComponentName: (component: Component) => string;
3
- export declare function scrollToElement(element: any, block?: string): void;
@@ -1 +0,0 @@
1
- export * from './blocks';
@@ -1 +0,0 @@
1
- export {};
@@ -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 {};
@@ -1,6 +0,0 @@
1
- export declare const parameters: {
2
- docs: {
3
- getContainer: () => Promise<import("react").FunctionComponent<import("./blocks").DocsContainerProps<import("@storybook/csf").AnyFramework>>>;
4
- getPage: () => Promise<import("react").FC<{}>>;
5
- };
6
- };
@@ -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
- }