2022-12-01 12:05:08 +01:00
|
|
|
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
|
|
|
|
import React from "react";
|
|
|
|
|
import { Button } from "./index";
|
|
|
|
|
|
|
|
|
|
export default {
|
2023-01-19 15:31:22 +01:00
|
|
|
title: "Components/Button",
|
2022-12-01 12:05:08 +01:00
|
|
|
component: Button,
|
|
|
|
|
} as ComponentMeta<typeof Button>;
|
|
|
|
|
|
2023-01-04 15:52:24 +01:00
|
|
|
const Template: ComponentStory<typeof Button> = (args) => <Button {...args} />;
|
2022-12-01 12:05:08 +01:00
|
|
|
|
2023-01-12 17:41:14 +01:00
|
|
|
export const Primary = Template.bind({});
|
|
|
|
|
Primary.args = {
|
2023-01-13 17:14:39 +01:00
|
|
|
children: "Primary",
|
2023-01-12 17:41:14 +01:00
|
|
|
color: "primary",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const Secondary = Template.bind({});
|
|
|
|
|
Secondary.args = {
|
2023-01-13 17:14:39 +01:00
|
|
|
children: "Secondary",
|
2023-01-12 17:41:14 +01:00
|
|
|
color: "secondary",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const Tertiary = Template.bind({});
|
|
|
|
|
Tertiary.args = {
|
2023-01-13 17:14:39 +01:00
|
|
|
children: "Tertiary",
|
2023-01-12 17:41:14 +01:00
|
|
|
color: "tertiary",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const Disabled = Template.bind({});
|
|
|
|
|
Disabled.args = {
|
2023-01-13 17:14:39 +01:00
|
|
|
children: "Disabled",
|
2023-01-12 17:41:14 +01:00
|
|
|
color: "primary",
|
|
|
|
|
disabled: true,
|
2023-01-04 15:52:24 +01:00
|
|
|
};
|
2023-01-16 11:17:27 +01:00
|
|
|
|
|
|
|
|
export const Danger = Template.bind({});
|
|
|
|
|
Danger.args = {
|
|
|
|
|
children: "Danger",
|
|
|
|
|
color: "danger",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const IconLeft = Template.bind({});
|
|
|
|
|
IconLeft.args = {
|
|
|
|
|
children: "Icon",
|
|
|
|
|
icon: (
|
|
|
|
|
<svg
|
|
|
|
|
width="24"
|
|
|
|
|
height="24"
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
fill="none"
|
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
|
>
|
|
|
|
|
<path
|
|
|
|
|
fill="currentColor"
|
|
|
|
|
fillRule="evenodd"
|
|
|
|
|
clipRule="evenodd"
|
|
|
|
|
d="M17.8724 10.0166H13.248L16.6251 4.07749C16.9258 3.54846 16.2447 3.01176 15.8005 3.42755L6.57343 12.0655C6.22192 12.3946 6.45489 12.9838 6.93615 12.9838H11.5606L8.18353 18.9229C7.88275 19.4519 8.56335 19.9886 9.00746 19.5728L18.2352 10.9349C18.5867 10.6058 18.3537 10.0166 17.8724 10.0166Z"
|
|
|
|
|
/>
|
|
|
|
|
</svg>
|
|
|
|
|
),
|
|
|
|
|
color: "primary",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const IconRight = Template.bind({});
|
|
|
|
|
IconRight.args = {
|
|
|
|
|
children: "Icon",
|
|
|
|
|
iconPosition: "right",
|
|
|
|
|
icon: (
|
|
|
|
|
<svg
|
|
|
|
|
width="24"
|
|
|
|
|
height="24"
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
fill="none"
|
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
|
>
|
|
|
|
|
<path
|
|
|
|
|
fill="currentColor"
|
|
|
|
|
fillRule="evenodd"
|
|
|
|
|
clipRule="evenodd"
|
|
|
|
|
d="M17.8724 10.0166H13.248L16.6251 4.07749C16.9258 3.54846 16.2447 3.01176 15.8005 3.42755L6.57343 12.0655C6.22192 12.3946 6.45489 12.9838 6.93615 12.9838H11.5606L8.18353 18.9229C7.88275 19.4519 8.56335 19.9886 9.00746 19.5728L18.2352 10.9349C18.5867 10.6058 18.3537 10.0166 17.8724 10.0166Z"
|
|
|
|
|
/>
|
|
|
|
|
</svg>
|
|
|
|
|
),
|
|
|
|
|
color: "primary",
|
|
|
|
|
};
|
2023-02-13 12:07:38 +01:00
|
|
|
|
|
|
|
|
export const IconOnly = Template.bind({});
|
|
|
|
|
IconOnly.args = {
|
2023-02-23 16:21:26 +01:00
|
|
|
"aria-label": "Button with only an icon",
|
2023-02-13 12:07:38 +01:00
|
|
|
icon: (
|
|
|
|
|
<svg
|
|
|
|
|
width="24"
|
|
|
|
|
height="24"
|
|
|
|
|
viewBox="0 0 24 24"
|
|
|
|
|
fill="none"
|
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
|
>
|
|
|
|
|
<path
|
|
|
|
|
fill="currentColor"
|
|
|
|
|
fillRule="evenodd"
|
|
|
|
|
clipRule="evenodd"
|
|
|
|
|
d="M17.8724 10.0166H13.248L16.6251 4.07749C16.9258 3.54846 16.2447 3.01176 15.8005 3.42755L6.57343 12.0655C6.22192 12.3946 6.45489 12.9838 6.93615 12.9838H11.5606L8.18353 18.9229C7.88275 19.4519 8.56335 19.9886 9.00746 19.5728L18.2352 10.9349C18.5867 10.6058 18.3537 10.0166 17.8724 10.0166Z"
|
|
|
|
|
/>
|
|
|
|
|
</svg>
|
|
|
|
|
),
|
|
|
|
|
color: "primary",
|
|
|
|
|
};
|