-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17153 from storybookjs/chore_minor_api_docs_changes
Chore: (Docs) Updates the api/CSFsection
- Loading branch information
Showing
12 changed files
with
108 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
docs/snippets/react/button-story-click-handler-simple-docs.js.mdx
This file was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
docs/snippets/svelte/button-story-click-handler-args.js.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
```js | ||
// Button.stories.js | ||
|
||
import Button from './Button.svelte'; | ||
|
||
import { action } from '@storybook/addon-actions'; | ||
|
||
export default { | ||
/* 👇 The title prop is optional. | ||
* See https://storybook.js.org/docs/svelte/configure/overview#configure-story-loading | ||
* to learn how to generate automatic titles | ||
*/ | ||
title: 'Button', | ||
component: Button, | ||
}; | ||
|
||
export const Text = ({ label, click }) => ({ | ||
Component: Button, | ||
props: { | ||
label, | ||
}, | ||
on: { | ||
click, | ||
}, | ||
}); | ||
|
||
Text.args = { | ||
label: 'Hello', | ||
click: action('clicked'), | ||
}; | ||
``` |
27 changes: 27 additions & 0 deletions
27
docs/snippets/svelte/button-story-click-handler-simplificated.native-format.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
```html | ||
<!-- Button.stories.svelte --> | ||
|
||
<script> | ||
import { Meta, Template, Story } from "@storybook/addon-svelte-csf"; | ||
import Button from './Button.svelte'; | ||
</script> | ||
|
||
<!-- | ||
See https://storybook.js.org/docs/svelte/essentials/actions#action-argtype-annotation | ||
to learn how to set up argTypes for actions | ||
--> | ||
|
||
<Meta | ||
title="Button" | ||
component={Button} | ||
argTypes={{ | ||
onClick: { action: "onClick" }, | ||
}} | ||
/> | ||
|
||
<Template let:args> | ||
<Button {...args} on:click={args.onClick} /> | ||
</Template> | ||
|
||
<Story name="Text" args={{ label: 'Hello' }}/> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
docs/snippets/vue/button-story-click-handler-simple-docs.2.js.mdx
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
docs/snippets/vue/button-story-click-handler-simple-docs.3.js.mdx
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
docs/snippets/vue/button-story-click-handler-simplificated.js.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
```js | ||
// Button.stories.js | ||
|
||
import Button from './Button.vue'; | ||
|
||
export default { | ||
/* 👇 The title prop is optional. | ||
* See https://storybook.js.org/docs/vue/configure/overview#configure-story-loading | ||
* to learn how to generate automatic titles | ||
*/ | ||
title: 'Button', | ||
component: Button, | ||
/* | ||
* See https://storybook.js.org/docs/vue/essentials/actions#action-argtype-annotation | ||
* to learn how to set up argTypes for actions | ||
*/ | ||
argTypes: { | ||
onClick: {}, | ||
}, | ||
}; | ||
|
||
export const Text = (args) => ({ | ||
components: { Button }, | ||
setup() { | ||
return { args }; | ||
}, | ||
template: '<Button v-bind="args" />', | ||
}); | ||
``` |