Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ const ExampleToolbar = () => {
</IconButton>
);
};
```
```
2 changes: 1 addition & 1 deletion docs/snippets/common/addon-consume-globaltype.js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ const ThemePanel = props => {
</AddonPanel>
);
};
```
```
2 changes: 1 addition & 1 deletion docs/snippets/common/args-usage-with-addons.js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ resetArgs((argNames: ['key']));

// To reset all args
resetArgs();
```
```
1 change: 0 additions & 1 deletion docs/snippets/common/badge-story-custom-argtypes.js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,4 @@ export default {
}
}
};

```
2 changes: 1 addition & 1 deletion docs/snippets/common/badge-story-custom-argtypes.mdx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ Let's define a story for our `Badge` component
<ArgsTable of={Badge} />

<!-- remainder story implementation -->
```
```
2 changes: 1 addition & 1 deletion docs/snippets/common/badge-story-starter-example.mdx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ with unique URLs and isolated snapshot tests.
</Badge>
</Story>
</Canvas>
```
```
6 changes: 3 additions & 3 deletions docs/snippets/common/badge-story.mdx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ We can drop it in a `Canvas` to get a code snippet:
</Canvas>

We can even preview multiple Stories in a block. This
gets rendered as a group, but defines individual stories
with unique URLs which is great for review and testing.
gets rendered as a group but defines individual stories
with unique URLs, which is great for review and testing.

<Canvas>
<Story name="warning" args={{
Expand Down Expand Up @@ -64,4 +64,4 @@ with unique URLs which is great for review and testing.
{Template.bind({})}
</Story>
</Canvas>
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
component: ButtonGroup,
subcomponents: { Button },
};
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export default {
component: ButtonGroup,
subcomponents: { Button },
} as Meta;
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ export default {
},
},
};
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
handles: ['mouseover', 'click .btn'],
},
}} />
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
title: 'Button',
component: Button,
argTypes: {
// assigns the argTypes to the Colors category
// Assigns the argTypes to the Colors category
backgroundColor: {
control: 'color',
table: {
Expand All @@ -17,24 +17,24 @@ export default {
category: 'Colors'
}
},
// assigns the argType to the Text category
// Assigns the argType to the Text category
label: {
table: {
category: 'Text'
}
},
// assigns the argType to the Events category
// Assigns the argType to the Events category
onClick: {
table: {
category: 'Events'
}
},
// assigns the argType to the Sizes category
// Assigns the argType to the Sizes category
size: {
table: {
category: 'Sizes'
}
}
}
};
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ export default {
title: 'Button',
component: Button,
argTypes: {
// assigns the argTypes to the Colors category
// Assigns the argTypes to the Colors category
backgroundColor: {
control: 'color',
table: {
category: 'Colors',
// assigns the argTypes to a specific subcategory
// Assigns the argTypes to a specific subcategory
subcategory: 'Button colors'
}
},
Expand All @@ -26,19 +26,19 @@ export default {
subcategory: 'Button contents'
}
},
// assigns the argType to the Events category
// Assigns the argType to the Events category
onClick: {
table: {
category: 'Events',
subcategory: 'Button Events'
}
},
// assigns the argType to the Sizes category
// Assigns the argType to the Sizes category
size: {
table: {
category: 'Sizes'
}
}
}
};
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
<Story name="Primary" args={{ variant: 'primary' }}>
{Template.bind({})}
</Story>
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
}
}}
/>
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ export default {
}
},
};
```
```
3 changes: 1 addition & 2 deletions docs/snippets/common/button-story-docs-code-type.js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ export default {
}
};

// remainder story implementation

// Remainder story implementation
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export const Large = Template.bind({});
Large.parameters = {
controls: { hideNoControlsWarning: true },
};
```
```
2 changes: 1 addition & 1 deletion docs/snippets/common/button-story-hoisted.js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export default {

// This is the only named export in the file, and it matches the component name
export const Button = (args) => <ButtonComponent {...args} />;
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
<!-- Button.stories.mdx -->

<Meta title='Button' component={Button} parameters={{ actions: { argTypesRegex: '^on.\*' } }} />
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
<!-- Button.stories.mdx -->

<Meta title='Button' argTypes={{ onClick: { action: 'clicked' } }} />
```
```
2 changes: 1 addition & 1 deletion docs/snippets/common/button-story-remix-docspage.js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ export default {
},
},
};
```
```
2 changes: 1 addition & 1 deletion docs/snippets/common/button-story-remix-docspage.ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ export default {
},
},
} as Meta;
```
```
2 changes: 1 addition & 1 deletion docs/snippets/common/checkbox-story-csf.js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { Checkbox } from './Checkbox';

export default {
title: "MDX/Checkbox",
title: 'MDX/Checkbox',
component: Checkbox
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Checkbox } from './Checkbox';

# Checkbox

With `MDX` we can define a story for `Checkbox` right in the middle of our Markdown documentation.
With `MDX`, we can define a story for `Checkbox` right in the middle of our Markdown documentation.

<Canvas>
<Story name="all checkboxes">
Expand Down
3 changes: 1 addition & 2 deletions docs/snippets/common/checkbox-story.mdx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Checkbox } from './Checkbox';

# Checkbox

With `MDX` we can define a story for `Checkbox` right in the middle of our
With `MDX`, we can define a story for `Checkbox` right in the middle of our
Markdown documentation.

<!--- This is your Story template function, shown here in React -->
Expand All @@ -35,5 +35,4 @@ export const Template = (args) => <Checkbox {...args} />
{Template.bind({})}
</Story>
</Canvas>

```
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ export default {
component: Button,
argTypes: {
label: {
description: 'overwritten description',
description: 'Overwritten description',
table: {
type: {
summary: 'something short',
detail: 'something really really long'
summary: 'Something short',
detail: 'Something really really long'
},
},
control: {
Expand Down
6 changes: 3 additions & 3 deletions docs/snippets/common/component-story-csf-description.js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
parameters: {
docs: {
description: {
component: 'some component _markdown_',
component: 'Some component _markdown_',
},
},
},
Expand All @@ -16,8 +16,8 @@ export const WithStoryDescription = Template.bind({});
WithStoryDescription.parameters = {
docs: {
description: {
story: 'some story **markdown**',
story: 'Some story **markdown**',
},
},
};
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export default {
title: 'Button',
argTypes: {
arrow: {
options: Object.keys(arrows), // an array of serializable values
mapping: arrows, // maps serializable option values to complex arg values
options: Object.keys(arrows), // An array of serializable values
mapping: arrows, // Maps serializable option values to complex arg values
control: {
type: 'select', // type 'select' is automatically inferred when 'options' is defined
type: 'select', // Type 'select' is automatically inferred when 'options' is defined
labels: {
// 'labels' maps option values to string labels
ArrowUp: 'Up',
Expand All @@ -26,4 +26,4 @@ export default {
},
},
};
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ CustomSource.parameters = {
},
},
};
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ ArrayExclude.parameters = { controls: { exclude: ['foo', 'bar'] } };

RegexExclude = Template.bind({})
RegexExclude.parameters = { controls: { exclude: /^hello*/ } };
```
```
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
```md
<!--- YourComponent.stories.mdx -->

<Story name="Array Include" parameters={{ controls: { include: ['foo', 'bar'] } }}>
{Template.bind({})}
</Story>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// MyComponent.stories.js | MyComponent.stories.ts

import base from 'paths.macro';

export default {
title: `${base}/Component`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<!--- MyComponent.stories.mdx -->

import { ArgsTable } from '@storybook/addon-docs/blocks';

import { MyComponent } from './MyComponent';

# My Component!
Expand Down
3 changes: 1 addition & 2 deletions docs/snippets/common/component-story-mdx-argtypes.mdx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@
}}>
<!--- story contents --->
</Story>

```
```
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@
<Story name="story" decorators={[ ... ]} parameters={{ ... }} >
...
</Story>

```
2 changes: 1 addition & 1 deletion docs/snippets/common/component-story-mdx-dedent.mdx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<!--- MyComponent.stories.mdx -->

import { Source } from '@storybook/addon-docs/blocks';

import dedent from 'ts-dedent';

<Source
Expand All @@ -12,5 +13,4 @@ import dedent from 'ts-dedent';
}
`}
/>

```
Loading