From aa186e5632125c6f38790be2996771a513292bb4 Mon Sep 17 00:00:00 2001 From: jonniebigodes Date: Thu, 6 Jan 2022 20:45:26 +0000 Subject: [PATCH] updates the api section --- docs/api/csf.md | 16 ++-------- .../button-story-click-handler-args.ts.mdx | 8 +++-- .../button-story-click-handler-args.js.mdx | 5 +++ ...ton-story-click-handler-simple-docs.js.mdx | 20 ------------ .../button-story-click-handler-args.js.mdx | 31 +++++++++++++++++++ ...ck-handler-simplificated.native-format.mdx | 27 ++++++++++++++++ ...tton-story-click-handler.native-format.mdx | 4 +-- .../button-story-click-handler-args.2.js.mdx | 1 + .../button-story-click-handler-args.3.js.mdx | 8 +++-- ...n-story-click-handler-simple-docs.2.js.mdx | 20 ------------ ...n-story-click-handler-simple-docs.3.js.mdx | 25 --------------- ...n-story-click-handler-simplificated.js.mdx | 29 +++++++++++++++++ 12 files changed, 108 insertions(+), 86 deletions(-) delete mode 100644 docs/snippets/react/button-story-click-handler-simple-docs.js.mdx create mode 100644 docs/snippets/svelte/button-story-click-handler-args.js.mdx create mode 100644 docs/snippets/svelte/button-story-click-handler-simplificated.native-format.mdx delete mode 100644 docs/snippets/vue/button-story-click-handler-simple-docs.2.js.mdx delete mode 100644 docs/snippets/vue/button-story-click-handler-simple-docs.3.js.mdx create mode 100644 docs/snippets/vue/button-story-click-handler-simplificated.js.mdx diff --git a/docs/api/csf.md b/docs/api/csf.md index af8b1d8041cb..b96c2fd970e3 100644 --- a/docs/api/csf.md +++ b/docs/api/csf.md @@ -109,24 +109,12 @@ Now consider the same example, re-written with args: 'vue/button-story-click-handler-args.2.js.mdx', 'vue/button-story-click-handler-args.3.js.mdx', 'angular/button-story-click-handler-args.ts.mdx', + 'svelte/button-story-click-handler-args.js.mdx', ]} /> -At first blush, this might seem no better than the original example. However, if we add the [Docs addon](https://github.com/storybookjs/storybook/tree/master/addons/docs) and configure the [Actions addon](https://github.com/storybookjs/storybook/tree/master/addons/actions) appropriately, we can write: - - - - - - Or even more simply: @@ -136,6 +124,8 @@ Or even more simply: paths={[ 'react/button-story-click-handler-simplificated.js.mdx', 'angular/button-story-click-handler-simplificated.ts.mdx', + 'vue/button-story-click-handler-simplificated.js.mdx', + 'svelte/button-story-click-handler-simplificated.native-format.mdx', ]} /> diff --git a/docs/snippets/angular/button-story-click-handler-args.ts.mdx b/docs/snippets/angular/button-story-click-handler-args.ts.mdx index 7ed232bab028..024ee79c92a6 100644 --- a/docs/snippets/angular/button-story-click-handler-args.ts.mdx +++ b/docs/snippets/angular/button-story-click-handler-args.ts.mdx @@ -16,9 +16,11 @@ export default { component: Button, } as Meta; -export const Text: Story = (args) => ({ - props: args, - template: ``, +export const Text: Story = ({ label, onClick }) => ({ + props: { + label, + onClick, + }, }); Text.args = { diff --git a/docs/snippets/react/button-story-click-handler-args.js.mdx b/docs/snippets/react/button-story-click-handler-args.js.mdx index bad3e5076f68..0219ef1a3d6e 100644 --- a/docs/snippets/react/button-story-click-handler-args.js.mdx +++ b/docs/snippets/react/button-story-click-handler-args.js.mdx @@ -17,4 +17,9 @@ export default { }; export const Text = ({ label, onClick }) =>