Skip to content

Commit

Permalink
Updated documentation text
Browse files Browse the repository at this point in the history
  • Loading branch information
idesigncode committed Jun 2, 2023
1 parent 0f1e50e commit f185f74
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 12 deletions.
6 changes: 5 additions & 1 deletion stories/CSS.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import * as CSSStories from './CSS.stories.mjs';

# CSS

The component styles can be imported into `.storybook/preview.mjs` with a single css file:
The default themes and component styles can be imported into `.storybook/preview.mjs` with a single css file:

<Story of={CSSStories.CombinedStylesheet} />

> #### See also:
>
> - [DocsContainer](/docs/configuration-docscontainer--docs) - light and dark mode functionality for Storybook Docs.
14 changes: 7 additions & 7 deletions stories/DefaultValue.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ import * as DefaultValueStories from './DefaultValue.stories.mjs';

# DefaultValue

Adds a table with details of a single prop's default value.
A simple [MDX component](https://storybook.js.org/docs/react/writing-docs/mdx) that adds a table with details of a single prop's default value.

<Story of={DefaultValueStories.Props} />

### Implementation:

The `type` is automatically detected from the required `value`:

<Story of={DefaultValueStories.AutomaticTypeSource} />

<Story of={DefaultValueStories.AutomaticType} />

For further control, you can optionally override `type` or add a `link` as needed:
<Story of={DefaultValueStories.AutomaticTypeSource} />

<Story of={DefaultValueStories.ManualTypeWithLinkSource} />
For further control, you can optionally override `type` or add a `link` as needed:

<Story of={DefaultValueStories.ManualTypeWithLink} />

Specifying a `ref object` either by `type` or `value` will automatically generate text and a link to the React Docs:
<Story of={DefaultValueStories.ManualTypeWithLinkSource} />

<Story of={DefaultValueStories.RefTypeSource} />
Specifying a `ref object` either by `type` or `value` will automatically generate text and a link to the React Docs:

<Story of={DefaultValueStories.RefType} />

<Story of={DefaultValueStories.RefTypeSource} />
8 changes: 7 additions & 1 deletion stories/DocsContainer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import * as DocsContainerStories from './DocsContainer.stories.mjs';

# DocsContainer

The `DocsContainer` applies the light and dark theme functionality and should be used in `.storybook/preview.mjs`:
Applies the light and dark mode theme functionality for ["Docs mode"](https://storybook.js.org/docs/react/writing-docs/introduction) with [storybook-dark-mode](https://github.com/hipstersmoothie/storybook-dark-mode).

This component should be added to `.storybook/preview.mjs`:

<Story of={DocsContainerStories.DocsContainerConfig} />

> #### See also:
>
> - [CSS](/docs/components-css--docs) - use the default themes and component styles.
3 changes: 1 addition & 2 deletions stories/ImportPathReplacements.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,4 @@ To use import path replacements globally, you can add the configuration to an `.

> #### See also:
>
> - [Source](/docs/components-source--docs) - further information and examples of using import path replacements to display source code.
> - [Raw Imports](/docs/configuration-webpack--docs#raw-imports) - get the source code of an imported file.
> - [Source](/docs/components-source--docs) - further information and examples of using import path replacements.
2 changes: 2 additions & 0 deletions stories/PropsTable.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import * as PropsTableStories from './PropsTable.stories.mjs';

Adds a table of props details automatically generated from the props given to a single child component.

Can be used within [stories](https://storybook.js.org/docs/react/writing-stories/introduction) or directly in [MDX pages](https://storybook.js.org/docs/react/writing-docs/mdx).

<Story of={PropsTableStories.Props} />

> #### Note:
Expand Down
6 changes: 5 additions & 1 deletion stories/Source.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Adds a block of source code with "copy" functionality to the page.

Similar to [Storybook's Source block](https://storybook.js.org/docs/react/api/doc-block-source) but with code replacement functionality for production-ready source code and image snapshot testing compatibility.

Can be used within [stories](https://storybook.js.org/docs/react/writing-stories/introduction) or directly in [MDX pages](https://storybook.js.org/docs/react/writing-docs/mdx).

<Story of={SourceStories.Props} />

### Implementation:
Expand All @@ -26,9 +28,11 @@ The default theme is set with the `useDarkMode` hook from [storybook-dark-mode](
> - As `Source` is designed to show production-ready source code, it will automatically remove any use of [PropsTable](/docs/components-propstable--docs).
> - This can be disabled by setting `removePropsTable` to `false`.
<br />

### Import Path Replacements (optional):

The `Source` component can also display all [file import paths](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) as they would be used by a consumer of your code.
The `Source` component can automatically display all [file import paths](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) as they would be used by a consumer of your code.

Please see [Import Path Replacements](/docs/configuration-import-path-replacements--docs) for setting global (default) configuration of all instances of `Source`.

Expand Down
11 changes: 11 additions & 0 deletions stories/Webpack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,25 @@ These can be easily added to `.storybook/main.mjs` with the named export `webpac

<Story of={WebpackStories.Implementation} />

<details>
<summary>
<p>
<strong>Using `webpackFinal` with custom configuration settings</strong>
</p>
</summary>

You can alternatively use the imported `webpackFinal` async function with your own custom configuration settings:

<Story of={WebpackStories.ImplementationCustomSettings} />

</details>

The imported `webpackFinal` async function will set the following configurations:

<Story of={WebpackStories.WebpackFinalConfig} />

<br />

### Raw Imports

Once Webpack is configured, you can import the raw source code of any file with the `?raw` import suffix (a.k.a. "Webpack resource query"):
Expand Down

0 comments on commit f185f74

Please sign in to comment.