import { Global } from '@emotion/react';
import React from 'react';
import { config as designConfig, withDesign } from 'storybook-addon-designs';
import tw, { css, styled } from 'twin.macro';
import Button from '~/inputs/Button';
import { buttonColors, buttonSizes, buttonVariants } from '~/inputs/types';
export default {
title: 'Inputs/Button',
component: Button,
args: {
size: 'md',
color: 'brand',
variant: 'primary',
children: 'Button',
disabled: false,
},
argTypes: {
variant: {
control: {
type: 'select',
options: buttonVariants,
},
},
color: {
control: {
type: 'select',
options: buttonColors,
},
},
size: {
control: {
type: 'select',
options: buttonSizes,
},
},
},
decorators: [
withDesign,
(Story) => (
<>
{Story()}
>
),
],
parameters: {
design: designConfig({
type: 'figma',
url:
'https://www.figma.com/file/77dkQryMN3UStlzTDFl5xd/Proper-2021-Sprints?node-id=2839%3A2724',
}),
},
};
const Template = (args) => ;
export const Primary = Template.bind({});
Primary.args = {
variant: 'primary',
};
export const Secondary = Template.bind({});
Secondary.args = {
variant: 'secondary',
};
export const Brand = Template.bind({});
Brand.args = { color: 'brand' };
export const Product = Template.bind({});
Product.args = { color: 'product' };
export const Plant = Template.bind({});
Plant.args = { color: 'plant' };
export const Large = Template.bind({});
Large.args = {
size: 'md',
};
export const Small = Template.bind({});
Small.args = {
size: 'sm',
};
export const AsLink = (props: { className?: string }) => (
);
export const All = (props) => (
<>
>
);
const DIFFERENT_BACKGROUNDS = [
styled.div(() => tw`p-4 bg-white ring-offset-white`),
styled.div(() => tw`p-4 bg-black ring-offset-black`),
styled.div(() => tw`p-4 bg-indigo-900 ring-offset-indigo-900`),
];
export const AgainstDifferentBackgrounds = (props) => (
<>
{DIFFERENT_BACKGROUNDS.map((Container, index) => (
))}
>
);