Skip to content

Commit

Permalink
Merge pull request #22820 from storybookjs/chore_docs_removes_title
Browse files Browse the repository at this point in the history
Chore: (Docs) Snippets updates
  • Loading branch information
jonniebigodes authored May 26, 2023
2 parents 5bb9a26 + 2acec25 commit 0e12f70
Show file tree
Hide file tree
Showing 879 changed files with 225 additions and 4,347 deletions.
4 changes: 2 additions & 2 deletions docs/api/csf.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ Component Story Format (CSF) is the recommended way to [write stories](../writin

<div class="aside">

💡 If you are writing stories in the older `storiesOf()` syntax, you can find documentation in an [advanced README](../../lib/preview-api/docs/storiesOf.md).
💡 If you are writing stories in the older `storiesOf()` syntax, you can find documentation in an [advanced README](https://github.com/storybookjs/storybook/blob/next/code/lib/preview-api/docs/storiesOf.md).

</div>

In CSF, stories and component metadata are defined as ES Modules. Every component story file consists of a required [default export](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export#Using_the_default_export) and one or more [named exports](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export).

CSF is supported in all frameworks except React Native, where you should use the [storiesOf API](../../lib/preview-api/docs/storiesOf.md) instead.
CSF is supported in all frameworks except React Native, where you should use the [storiesOf API](https://github.com/storybookjs/storybook/blob/next/code/lib/preview-api/docs/storiesOf.md) instead.

## Default export

Expand Down
4 changes: 2 additions & 2 deletions docs/configure/images-and-assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Components often rely on images, videos, fonts, and other assets to render as th

### Import assets into stories

You can import any media assets by importing (or requiring) them. It works out of the box with our default config. But, if you are using a custom webpack config, you’ll need to add the [file loader](https://v4.webpack.js.org/loaders/) to handle the required files.
You can import any media assets by importing (or requiring) them. It works out of the box with our default config. But, if you are using a custom webpack config, you’ll need to add the [file loader](https://webpack.js.org/loaders/) to handle the required files.

Afterward, you can use any asset in your stories:

Expand Down Expand Up @@ -149,4 +149,4 @@ Inside the `.storybook/` configuration folder, create `preview-head.html`, then
<CodeSnippets
paths={['common/storybook-preview-head-example.html.mdx']} />

<!-- prettier-ignore-end -->
<!-- prettier-ignore-end -->
1 change: 0 additions & 1 deletion docs/essentials/auto-generated-controls/angular.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ To use auto-detected controls with Angular, you must fill in the `component` fie
import { Button } from './button.component';

export default {
title: 'Button',
component: Button,
};
```
Expand Down
1 change: 0 additions & 1 deletion docs/essentials/auto-generated-controls/ember.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Finally, to use auto-detected controls with Ember, you must fill in the `compone

```ts
export default {
title: 'Button',
component: 'button', // name of your button component from docgen-json file (index.js)
};
```
3 changes: 1 addition & 2 deletions docs/essentials/auto-generated-controls/react.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
To use auto-detected controls with React, you must fill in the `component` field in your story metadata:

```ts
```js
// Button.stories.js|jsx|ts|tsx

import { Button } from './Button';

export default {
title: 'Button',
component: Button,
};
```
Expand Down
3 changes: 1 addition & 2 deletions docs/essentials/auto-generated-controls/vue.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
To use auto-detected controls with Vue, you must fill in the `component` field in your story metadata:

```ts
```js
import { Button } from './Button.vue';

export default {
title: 'Button',
component: Button,
};
```
Expand Down
5 changes: 2 additions & 3 deletions docs/essentials/auto-generated-controls/web-components.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
To use auto-detected controls with Web components, you must fill in the `component` field in your story metadata:

```ts
```js
export default {
title: 'Button',
component: 'button', // name of your button component
component: 'button',
};
```

Expand Down
1 change: 0 additions & 1 deletion docs/snippets/angular/app-story-with-mock.ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import type { Meta, StoryObj } from '@storybook/angular';
import { App } from './app.component';

const meta: Meta<App> = {
title: 'App',
component: App,
};

Expand Down
10 changes: 0 additions & 10 deletions docs/snippets/angular/button-group-story.ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ import { Button } from './button.component';
import * as ButtonStories from './Button.stories';

const meta: Meta<ButtonGroup> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'ButtonGroup',
component: ButtonGroup,
decorators: [
moduleMetadata({
Expand All @@ -31,11 +26,6 @@ const meta: Meta<ButtonGroup> = {
export default meta;
type Story = StoryObj<ButtonGroup>;

/*
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/angular/api/csf
* to learn how to use render functions.
*/
export const Pair: Story = {
args: {
buttons: [{ ...ButtonStories.Primary.args }, { ...ButtonStories.Secondary.args }],
Expand Down
5 changes: 0 additions & 5 deletions docs/snippets/angular/button-story-action-event-handle.ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ import { withActions } from '@storybook/addon-actions/decorator';
import { Button } from './button.component';

const meta: Meta<Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
parameters: {
actions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import type { Meta } from '@storybook/angular';
import { Button } from './button.component';

const meta: Meta<Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
argTypes: {
// Assigns the argTypes to the Colors category
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import type { Meta } from '@storybook/angular';
import { Button } from './button.component';

const meta: Meta<Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
argTypes: {
// Assigns the argTypes to the Colors category
Expand Down
1 change: 0 additions & 1 deletion docs/snippets/angular/button-story-auto-docs.ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import type { Meta, StoryObj } from '@storybook/angular';
import { Button } from './button.component';

const meta: Meta<Button> = {
title: 'Button',
component: Button,
//👇 Enables auto-generated documentation for the component story
tags: ['autodocs'],
Expand Down
5 changes: 0 additions & 5 deletions docs/snippets/angular/button-story-baseline.ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import type { Meta, StoryObj } from '@storybook/angular';
import { Button } from './button.component';

const meta: Meta<Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
};

Expand Down
5 changes: 0 additions & 5 deletions docs/snippets/angular/button-story-click-handler-args.ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ import { action } from '@storybook/addon-actions';
import { Button } from './button.component';

const meta: Meta<Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import type { Meta, StoryObj } from '@storybook/angular';
import { Button } from './button.component';

const meta: Meta<Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
};

Expand Down
5 changes: 0 additions & 5 deletions docs/snippets/angular/button-story-click-handler.ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ import { Button } from './button.component';
import { action } from '@storybook/addon-actions';

const meta: Meta<Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import type { Meta } from '@storybook/angular';
import { Button } from './button.component';

const meta: Meta<Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
//👇 Creates specific argTypes
argTypes: {
Expand Down
5 changes: 0 additions & 5 deletions docs/snippets/angular/button-story-component-decorator.ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ import { Button } from './button.component';
import { Parent } from './parent.component'; // Parent contains ng-content

const meta: Meta<Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
decorators: [
moduleMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import type { Meta, StoryObj } from '@storybook/angular';
import { Button } from './button.component';

const meta: Meta<Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import type { Meta } from '@storybook/angular';
import { Button } from './button.component';

const meta: Meta<Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
argTypes: {
variant: {
Expand Down
5 changes: 0 additions & 5 deletions docs/snippets/angular/button-story-decorator.ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ import { Button } from './button.component';
import { Parent } from './parent.component'; // Parent contains ng-content

const meta: Meta<Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import type { Meta } from '@storybook/angular';
import { Button } from './button.component';

const meta: Meta<Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
};

Expand Down
5 changes: 0 additions & 5 deletions docs/snippets/angular/button-story-disable-addon.ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import type { Meta } from '@storybook/angular';
import { Button } from './button.component';

const meta: Meta<Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
parameters: {
myAddon: { disable: true }, // Disables the addon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import type { Meta, StoryObj } from '@storybook/angular';
import { Button } from './button.component';

const meta: Meta<Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
};

Expand Down
5 changes: 0 additions & 5 deletions docs/snippets/angular/button-story-matching-argtypes.ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import type { Meta } from '@storybook/angular';
import { Button } from './button.component';

const meta: Meta<Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
parameters: { actions: { argTypesRegex: '^on.*' } },
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import type { Meta, StoryObj } from '@storybook/angular';
import { Button } from './button.component';

const meta: Meta<Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
argTypes: { onClick: { action: 'clicked' } },
};
Expand Down
5 changes: 0 additions & 5 deletions docs/snippets/angular/button-story-primary-composition.ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import type { Meta, StoryObj } from '@storybook/angular';
import { Button } from './button.component';

const meta: Meta<Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
};

Expand Down
5 changes: 0 additions & 5 deletions docs/snippets/angular/button-story-primary-long-name.ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import type { Meta, StoryObj } from '@storybook/angular';
import { Button } from './button.component';

const meta: Meta<Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
};

Expand Down
5 changes: 0 additions & 5 deletions docs/snippets/angular/button-story-rename-story.ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import type { Meta, StoryObj } from '@storybook/angular';
import { Button } from './button.component';

const meta: Meta<Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
};

Expand Down
10 changes: 0 additions & 10 deletions docs/snippets/angular/button-story-using-args.ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,12 @@ import type { Meta, StoryObj } from '@storybook/angular';
import { Button } from './button.component';

const meta: Meta<Button> = {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/angular/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
};

export default meta;
type Story = StoryObj<Button>;

/*
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/angular/api/csf
* to learn how to use render functions.
*/
export const Primary: Story = {
args: {
label: 'Button',
Expand Down
Loading

0 comments on commit 0e12f70

Please sign in to comment.