storybook/code/lib/cli/rendererAssets/aurelia/1-Button.stories.ts
Michael Shilman 54503208a6 CLI: Fix sb init to use renderer assets instead of frameworks
In 6.5 the `framework` config option was one of `react`, `angular`, etc. and included Webpack settings.

In the 7.0, we’ve updated it so that these are now called `renderers`, and are builder-independent. Now, frameworks contain specific builder information, such as `cra` or `nextjs` (for specific app environments) or `react-webpack5` / `react-vite` (for custom apps).

This fixes the `sb init` CLI command to use renderer-specific templates. I also call out some follow-up work to fix automigrations & telemetry
2022-09-02 15:35:27 +08:00

50 lines
1.0 KiB
TypeScript

import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';
import Button from './button';
export default {
title: 'Button',
component: Button,
argTypes: {
text: { control: 'text' },
},
};
const Template = (args) => ({
component: Button,
props: args,
});
export const Text = Template.bind({});
Text.args = {
text: 'Button',
onClick: action('onClick'),
};
export const Emoji = Template.bind({});
Emoji.args = {
text: '😀 😎 👍 💯',
};
export const TextWithAction = () => ({
component: Button,
props: {
text: 'Trigger Action',
onClick: () => action('This was clicked')(),
},
});
TextWithAction.storyName = 'With an action';
TextWithAction.parameters = { notes: 'My notes on a button with emojis' };
export const ButtonWithLinkToAnotherStory = () => ({
component: Button,
props: {
text: 'Go to Welcome Story',
onClick: linkTo('example-introduction--page'),
},
});
ButtonWithLinkToAnotherStory.storyName = 'button with link to another story';