This repository has been archived by the owner on Jun 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 136
/
button.stories.ts
52 lines (44 loc) · 1.55 KB
/
button.stories.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { Meta, Story } from "@storybook/angular";
import { ButtonComponent } from "./button.component";
// More on default export: https://storybook.js.org/docs/angular/writing-stories/introduction#default-export
export default {
title: "Jslib/Button",
component: ButtonComponent,
args: {
buttonType: "primary",
},
// More on argTypes: https://storybook.js.org/docs/angular/api/argtypes
} as Meta;
// More on component templates: https://storybook.js.org/docs/angular/writing-stories/introduction#using-args
const Template: Story<ButtonComponent> = (args: ButtonComponent) => ({
props: args,
template: `
<button bit-button [buttonType]="buttonType" [block]="block">Button</button>
<a bit-button [buttonType]="buttonType" [block]="block" href="#" class="tw-ml-2">Link</a>
`,
});
export const Primary = Template.bind({});
// More on args: https://storybook.js.org/docs/angular/writing-stories/args
Primary.args = {
buttonType: "primary",
};
export const Secondary = Template.bind({});
Secondary.args = {
buttonType: "secondary",
};
export const Danger = Template.bind({});
Danger.args = {
buttonType: "danger",
};
const DisabledTemplate: Story = (args) => ({
props: args,
template: `
<button bit-button disabled buttonType="primary" class="tw-mr-2">Primary</button>
<button bit-button disabled buttonType="secondary" class="tw-mr-2">Secondary</button>
<button bit-button disabled buttonType="danger" class="tw-mr-2">Danger</button>
`,
});
export const Disabled = DisabledTemplate.bind({});
Disabled.args = {
size: "small",
};