-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
219 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,146 +1,140 @@ | ||
import DeleteIcon from "@material-ui/icons/Delete"; | ||
import { action } from "@storybook/addon-actions"; | ||
import { storiesOf } from "@storybook/react"; | ||
import { Meta, storiesOf, Story } from "@storybook/react"; | ||
import React from "react"; | ||
import Button from "./index"; | ||
|
||
export const text = "Click me!"; | ||
export default { | ||
argTypes: { | ||
color: { | ||
control: { | ||
type: "radio", | ||
}, | ||
options: ["primary", "secondary", "error", "info", "warning"], | ||
}, | ||
disabled: { | ||
control: { type: "boolean" }, | ||
}, | ||
}, | ||
component: Button, | ||
title: "Button", | ||
} as Meta; | ||
|
||
const TEXT = "Click me!"; | ||
|
||
const Template: Story = (props) => { | ||
return <Button {...props}>{TEXT}</Button>; | ||
}; | ||
|
||
// RoundedPrimary | ||
export const RoundedPrimary = Template.bind({}); | ||
|
||
export const actions = { | ||
onClick: action("onClick"), | ||
RoundedPrimary.args = { | ||
color: "primary", | ||
disabled: false, | ||
sdsStyle: "rounded", | ||
sdsType: "primary", | ||
}; | ||
|
||
storiesOf("Button", module).add("Rounded Primary", () => ( | ||
<Button onClick={actions.onClick} sdsStyle="rounded" sdsType="primary"> | ||
{text} | ||
</Button> | ||
)); | ||
RoundedPrimary.parameters = { | ||
snapshot: { | ||
skip: true, | ||
}, | ||
}; | ||
|
||
storiesOf("Button", module).add("Rounded Primary Disabled", () => ( | ||
<Button | ||
disabled | ||
onClick={actions.onClick} | ||
sdsStyle="rounded" | ||
sdsType="primary" | ||
> | ||
{text} | ||
</Button> | ||
)); | ||
// RoundedSecondary | ||
export const RoundedSecondary = Template.bind({}); | ||
|
||
storiesOf("Button", module).add("Rounded Secondary", () => ( | ||
<Button onClick={actions.onClick} sdsStyle="rounded" sdsType="secondary"> | ||
{text} | ||
</Button> | ||
)); | ||
RoundedSecondary.args = { | ||
color: "primary", | ||
disabled: false, | ||
sdsStyle: "rounded", | ||
sdsType: "secondary", | ||
}; | ||
|
||
storiesOf("Button", module).add("Rounded Secondary Disabled", () => ( | ||
<Button | ||
disabled | ||
onClick={actions.onClick} | ||
sdsStyle="rounded" | ||
sdsType="secondary" | ||
> | ||
{text} | ||
</Button> | ||
)); | ||
RoundedSecondary.parameters = { | ||
snapshot: { | ||
skip: true, | ||
}, | ||
}; | ||
|
||
storiesOf("Button", module).add("Square Primary", () => ( | ||
<Button onClick={actions.onClick} sdsStyle="square" sdsType="primary"> | ||
{text} | ||
</Button> | ||
)); | ||
// SquarePrimary | ||
export const SquarePrimary = Template.bind({}); | ||
|
||
storiesOf("Button", module).add("Square Primary Disabled", () => ( | ||
<Button | ||
disabled | ||
onClick={actions.onClick} | ||
sdsStyle="square" | ||
sdsType="primary" | ||
> | ||
{text} | ||
</Button> | ||
)); | ||
SquarePrimary.args = { | ||
color: "primary", | ||
disabled: false, | ||
sdsStyle: "square", | ||
sdsType: "primary", | ||
}; | ||
|
||
storiesOf("Button", module).add("Square Secondary", () => ( | ||
<Button onClick={actions.onClick} sdsStyle="square" sdsType="secondary"> | ||
{text} | ||
</Button> | ||
)); | ||
SquarePrimary.parameters = { | ||
snapshot: { | ||
skip: true, | ||
}, | ||
}; | ||
|
||
storiesOf("Button", module).add("Square Secondary Disabled", () => ( | ||
<Button | ||
disabled | ||
onClick={actions.onClick} | ||
sdsStyle="square" | ||
sdsType="secondary" | ||
> | ||
{text} | ||
</Button> | ||
)); | ||
// SquareSecondary | ||
export const SquareSecondary = Template.bind({}); | ||
|
||
storiesOf("Button", module).add("Minimal Primary", () => ( | ||
<Button onClick={actions.onClick} sdsStyle="minimal" sdsType="primary"> | ||
{text} | ||
</Button> | ||
)); | ||
SquareSecondary.args = { | ||
color: "primary", | ||
disabled: false, | ||
sdsStyle: "square", | ||
sdsType: "secondary", | ||
}; | ||
|
||
storiesOf("Button", module).add("Minimal Primary Disabled", () => ( | ||
<Button | ||
disabled | ||
onClick={actions.onClick} | ||
sdsStyle="minimal" | ||
sdsType="primary" | ||
> | ||
{text} | ||
</Button> | ||
)); | ||
SquareSecondary.parameters = { | ||
snapshot: { | ||
skip: true, | ||
}, | ||
}; | ||
|
||
storiesOf("Button", module).add("Minimal Secondary", () => ( | ||
<Button onClick={actions.onClick} sdsStyle="minimal" sdsType="secondary"> | ||
{text} | ||
</Button> | ||
)); | ||
// MinimalPrimary | ||
export const MinimalPrimary = Template.bind({}); | ||
|
||
storiesOf("Button", module).add("Minimal Secondary Disabled", () => ( | ||
<Button | ||
disabled | ||
onClick={actions.onClick} | ||
sdsStyle="minimal" | ||
sdsType="secondary" | ||
> | ||
{text} | ||
</Button> | ||
)); | ||
MinimalPrimary.args = { | ||
color: "primary", | ||
disabled: false, | ||
sdsStyle: "minimal", | ||
sdsType: "primary", | ||
}; | ||
|
||
MinimalPrimary.parameters = { | ||
snapshot: { | ||
skip: true, | ||
}, | ||
}; | ||
|
||
// MinimalSecondary | ||
export const MinimalSecondary = Template.bind({}); | ||
|
||
MinimalSecondary.args = { | ||
color: "primary", | ||
disabled: false, | ||
sdsStyle: "minimal", | ||
sdsType: "secondary", | ||
}; | ||
|
||
MinimalSecondary.parameters = { | ||
snapshot: { | ||
skip: true, | ||
}, | ||
}; | ||
|
||
storiesOf("Button", module).add("Minimal No Caps - use sparingly", () => ( | ||
<Button | ||
isAllCaps={false} | ||
onClick={actions.onClick} | ||
sdsStyle="minimal" | ||
sdsType="primary" | ||
> | ||
{text} | ||
<Button isAllCaps={false} sdsStyle="minimal" sdsType="primary"> | ||
{TEXT} | ||
</Button> | ||
)); | ||
|
||
storiesOf("Button", module).add("With Icon", () => ( | ||
<Button | ||
startIcon={<DeleteIcon />} | ||
onClick={actions.onClick} | ||
sdsStyle="rounded" | ||
sdsType="primary" | ||
> | ||
{text} | ||
<Button startIcon={<DeleteIcon />} sdsStyle="rounded" sdsType="primary"> | ||
{TEXT} | ||
</Button> | ||
)); | ||
|
||
storiesOf("Button", module).add("Minimal With Icon", () => ( | ||
<Button | ||
startIcon={<DeleteIcon />} | ||
onClick={actions.onClick} | ||
sdsStyle="minimal" | ||
sdsType="primary" | ||
> | ||
{text} | ||
<Button startIcon={<DeleteIcon />} sdsStyle="minimal" sdsType="primary"> | ||
{TEXT} | ||
</Button> | ||
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.