minor snippets improvements

This commit is contained in:
jonniebigodes 2021-01-28 00:11:22 +00:00
parent 9978407e0e
commit b031b9b6af
42 changed files with 61 additions and 59 deletions

View File

@ -1,5 +1,5 @@
```js
// Badge.stories.js
// Badge.stories.js | Badge.stories.ts
export default {
component: Badge,

View File

@ -1,6 +1,8 @@
```ts
// ButtonGroup.stories.ts
import { Meta } from '@storybook/react/types-6-0';
import { Button, ButtonGroup } from '../ButtonGroup';
export default {

View File

@ -1,5 +1,5 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
export default {
title: 'Button',

View File

@ -1,5 +1,5 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
export default {
title: 'Button',

View File

@ -1,5 +1,5 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
export default {
title: 'Button',

View File

@ -1,5 +1,5 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
export default {
title: 'Button'

View File

@ -1,5 +1,5 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
import { Button } from './Button';

View File

@ -1,5 +1,5 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
export const Primary = Template.bind({});
Primary.parameters = { docs: { page: null } }

View File

@ -1,5 +1,5 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
export default {
title: 'Button',

View File

@ -1,5 +1,5 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
export default {
title: 'Design System/Atoms/Button'

View File

@ -1,5 +1,5 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
export const Large = Template.bind({});

View File

@ -1,5 +1,5 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
export default {
title: 'Design System/Atoms/Button',

View File

@ -1,5 +1,5 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
export default {
title: 'Button',

View File

@ -1,5 +1,5 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
export default {
title: 'Button',

View File

@ -1,5 +1,5 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
const Primary = ButtonStory.bind({});
Primary.args = {

View File

@ -1,5 +1,5 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
export const PrimaryLongName = Template.bind({});

View File

@ -1,5 +1,5 @@
```js
// Checkbox.stories.js
// Checkbox.stories.js | Checkbox.stories.ts
export default {
title: 'Design System/Atoms/Checkbox'

View File

@ -1,5 +1,5 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
export default {
title: 'Button',

View File

@ -1,23 +1,23 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
export default {
title: 'CustomDescription'
title: 'CustomDescription',
parameters: {
docs: {
description: {
component: 'some component _markdown_'
}
docs: {
description: {
component: 'some component _markdown_',
},
},
}
},
};
export const WithStoryDescription = Template.bind({});
WithStoryDescription.parameters = {
docs: {
description: {
story: 'some story **markdown**'
}
docs: {
description: {
story: 'some story **markdown**',
},
},
};
```
```

View File

@ -1,5 +1,5 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
export const CustomSource = () => Template.bind({});

View File

@ -1,5 +1,5 @@
```js
// YourComponent.stories.js
// YourComponent.stories.js | YourComponent.stories.ts
import { YourComponent } from './your-component'

View File

@ -1,5 +1,5 @@
```js
// YourComponent.stories.js
// YourComponent.stories.js | YourComponent.stories.ts
import { YourComponent } from './your-component'

View File

@ -1,5 +1,5 @@
```js
// MyComponent.stories.js
// MyComponent.stories.js | MyComponent.stories.ts
import base from 'paths.macro';
export default {

View File

@ -1,5 +1,5 @@
```js
// FooBar.stories.js
// FooBar.stories.js | FooBar.stories.ts
export default {
title: 'Foo/Bar',

View File

@ -1,5 +1,5 @@
```js
// Gizmo.stories.js
// Gizmo.stories.js | Gizmo.stories.ts
export default {
title: 'Gizmo',

View File

@ -1,5 +1,5 @@
```js
// MyComponent.stories.js
// MyComponent.stories.js | MyComponent.stories.ts
// This will automatically be parsed to the contents of `data.json`
import data from './data.json';

View File

@ -1,5 +1,5 @@
```js
// MyComponent.stories.js
// MyComponent.stories.js | MyComponent.stories.ts
// This will include './static/image.png' in the bundle.
// And return a path to be included in a src attribute

View File

@ -1,5 +1,5 @@
```js
// MyComponent.stories.js
// MyComponent.stories.js | MyComponent.stories.ts
import { MyComponent } from './MyComponent';

View File

@ -1,5 +1,5 @@
```js
// FooBar.stories.js
// FooBar.stories.js | FooBar.stories.ts
export default {
title: 'OtherFoo/Bar',

View File

@ -1,5 +1,5 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
// To apply a set of backgrounds to all stories of Button:
export default {

View File

@ -1,5 +1,5 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
// To apply a grid to all stories of Button:
export default {

View File

@ -1,5 +1,5 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
export const Large = Template.bind({});
Large.parameters = {

View File

@ -1,5 +1,5 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
export const Large = Template.bind({});
Large.parameters = {

View File

@ -1,5 +1,5 @@
```js
// Button.stories.js
// Button.stories.js | Button.stories.ts
export const Large = Template.bind({});
Large.parameters = {

View File

@ -1,5 +1,5 @@
```js
// Widget.stories.js
// Widget.stories.js | Widget.stories.ts
export default {
title: 'Widget',

View File

@ -8,12 +8,12 @@ import * as ButtonStories from './Button.stories';
export default {
title: 'ButtonGroup',
component: ButtonGroup,
}
const Template = (args) => <ButtonGroup {...args} />
};
const Template = (args) => <ButtonGroup {...args} />;
export const Pair = Template.bind({});
Pair.args = {
buttons: [ ...ButtonStories.Primary.args, ...ButtonStories.Secondary.args ],
buttons: [{ ...ButtonStories.Primary.args }, { ...ButtonStories.Secondary.args }],
orientation: 'horizontal',
};
```
```

View File

@ -3,7 +3,7 @@
import React from 'react';
import { Story, Meta } from '@storybook/react';
import { ButtonGroup,ButtonGroupProps } from '../ButtonGroup';
import { ButtonGroup, ButtonGroupProps } from '../ButtonGroup';
import * as ButtonStories from './Button.stories';
export default {
@ -15,7 +15,7 @@ const Template: Story<ButtonGroupProps> = (args) => <ButtonGroup {...args} />;
export const Pair = Template.bind({});
Pair.args = {
buttons: [ ...ButtonStories.Primary.args, ...ButtonStories.Secondary.args ],
buttons: [{ ...ButtonStories.Primary.args }, { ...ButtonStories.Secondary.args }],
orientation: 'horizontal',
};
```
```

View File

@ -1,5 +1,5 @@
```js
// MyComponent.stories.js
// MyComponent.stories.js | MyComponent.stories.ts
import React from 'react';
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';

View File

@ -2,7 +2,7 @@
// YourPage.stories.js
import React from 'react';
import DocumentScreen from './DocumentScreen';
import DocumentScreen from './YourPage';
import PageLayout from './PageLayout.stories';
import DocumentHeader from './DocumentHeader.stories';

View File

@ -3,7 +3,7 @@
import React from 'react';
import { Story, Meta } from '@storybook/react';
import {DocumentScreen, DocumentScreenProps} from './DocumentScreen';
import { DocumentScreen, DocumentScreenProps } from './YourPage';
import PageLayout from './PageLayout.stories';
import DocumentHeader from './DocumentHeader.stories';

View File

@ -1,7 +1,7 @@
```js
// YourPage.stories.js
import DocumentScreen from './DocumentScreen.vue';
import DocumentScreen from './YourPage.vue';
import * as PageLayoutStories from './PageLayout.stories';
import * as DocumentHeaderStories from './DocumentHeader.stories';

View File

@ -11,7 +11,7 @@ For example, lets customize the backgrounds addon via a parameter. Well us
We can set a parameter for a single story with the `parameters` key on a CSF export:
```js
// Button.story.js
// Button.stories.js | Button.stories.ts
export const Primary = Template.bind({});
Primary.args = {
@ -33,9 +33,9 @@ Primary.parameters = {
We can set the parameters for all stories of a component using the `parameters` key on the default CSF export:
```js
// Button.story.js
// Button.stories.js | Button.stories.ts
import Button from './';
import Button from './Button';
export default {
title: 'Button',