2022-03-08 11:50:34 +01:00
|
|
|
import { Meta, Story } from "@storybook/angular";
|
|
|
|
|
2022-06-02 11:16:59 +02:00
|
|
|
import { ButtonDirective } from "./button.directive";
|
2022-03-08 11:50:34 +01:00
|
|
|
|
|
|
|
export default {
|
2022-06-17 16:23:04 +02:00
|
|
|
title: "Component Library/Button",
|
2022-06-02 11:16:59 +02:00
|
|
|
component: ButtonDirective,
|
2022-03-08 11:50:34 +01:00
|
|
|
args: {
|
|
|
|
buttonType: "primary",
|
|
|
|
},
|
2022-04-08 17:47:32 +02:00
|
|
|
parameters: {
|
|
|
|
design: {
|
|
|
|
type: "figma",
|
|
|
|
url: "https://www.figma.com/file/f32LSg3jaegICkMu7rPARm/Tailwind-Component-Library-Update?node-id=1881%3A16733",
|
|
|
|
},
|
|
|
|
},
|
2022-03-08 11:50:34 +01:00
|
|
|
} as Meta;
|
|
|
|
|
2022-06-02 11:16:59 +02:00
|
|
|
const Template: Story<ButtonDirective> = (args: ButtonDirective) => ({
|
2022-03-08 11:50:34 +01:00
|
|
|
props: args,
|
2022-03-11 21:00:24 +01:00
|
|
|
template: `
|
2022-06-02 11:16:59 +02:00
|
|
|
<button bitButton [buttonType]="buttonType" [block]="block">Button</button>
|
|
|
|
<a bitButton [buttonType]="buttonType" [block]="block" href="#" class="tw-ml-2">Link</a>
|
2022-03-11 21:00:24 +01:00
|
|
|
`,
|
2022-03-08 11:50:34 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
export const Primary = Template.bind({});
|
|
|
|
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: `
|
2022-06-02 11:16:59 +02:00
|
|
|
<button bitButton disabled buttonType="primary" class="tw-mr-2">Primary</button>
|
|
|
|
<button bitButton disabled buttonType="secondary" class="tw-mr-2">Secondary</button>
|
|
|
|
<button bitButton disabled buttonType="danger" class="tw-mr-2">Danger</button>
|
2022-03-08 11:50:34 +01:00
|
|
|
`,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const Disabled = DisabledTemplate.bind({});
|
|
|
|
Disabled.args = {
|
|
|
|
size: "small",
|
|
|
|
};
|
2022-09-16 11:30:41 +02:00
|
|
|
|
|
|
|
const BlockTemplate: Story<ButtonDirective> = (args: ButtonDirective) => ({
|
|
|
|
props: args,
|
|
|
|
template: `
|
|
|
|
<span class="tw-flex">
|
|
|
|
<button bitButton [buttonType]="buttonType" [block]="block">[block]="true" Button</button>
|
|
|
|
<a bitButton [buttonType]="buttonType" [block]="block" href="#" class="tw-ml-2">[block]="true" Link</a>
|
|
|
|
|
|
|
|
<button bitButton [buttonType]="buttonType" block class="tw-ml-2">block Button</button>
|
|
|
|
<a bitButton [buttonType]="buttonType" block href="#" class="tw-ml-2">block Link</a>
|
|
|
|
</span>
|
|
|
|
`,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const Block = BlockTemplate.bind({});
|
|
|
|
Block.args = {
|
|
|
|
block: true,
|
|
|
|
};
|