@potok/button
Advanced tools
Comparing version 0.1.1 to 0.2.0
@@ -60,4 +60,10 @@ // @flow | ||
type ButtonAppearances = 'primary' | 'primary-outline' | 'dashed'; | ||
export const appearances = { | ||
primary: 'primary', | ||
primaryOutline: 'primary-outline', | ||
dashed: 'dashed', | ||
}; | ||
type ButtonAppearances = $Values<appearances>; | ||
type Props = { | ||
@@ -64,0 +70,0 @@ /** The base styling to apply to the button. */ |
@@ -12,7 +12,7 @@ ### Install | ||
```js static | ||
import Button from '@potok/button'; | ||
import Button, { appearances } from '@potok/button'; | ||
const ButtonExample = () => ( | ||
<div> | ||
<Button>Button</Button> | ||
<Button appearance={appearances.primaryOutline}>Button</Button> | ||
</div> | ||
@@ -29,2 +29,3 @@ ); | ||
const Button = require("./Button").default; | ||
const appearances = require("./Button").appearances; | ||
@@ -34,11 +35,11 @@ <Grid rowCount={2}> | ||
<Button>Button</Button> | ||
<Button appearance="dashed">Button</Button> | ||
<Button appearance="primary-outline">Button</Button> | ||
<Button appearance={appearances.dashed}>Button</Button> | ||
<Button appearance={appearances.primaryOutline}>Button</Button> | ||
</div> | ||
<div> | ||
<Button disabled>Button</Button> | ||
<Button appearance="dashed" disabled> | ||
<Button disabled appearance={appearances.dashed}> | ||
Button | ||
</Button> | ||
<Button appearance="primary-outline" disabled> | ||
<Button disabled appearance={appearances.primaryOutline}> | ||
Button | ||
@@ -55,2 +56,3 @@ </Button> | ||
const Button = require("./Button").default; | ||
const appearances = require("./Button").appearances; | ||
const CreateIcon = require("@potok/icons/glyph/create").default; | ||
@@ -62,6 +64,6 @@ const FavIcon = require("@potok/icons/glyph/fav").default; | ||
<Button iconAfter={<CreateIcon />}>Button</Button> | ||
<Button appearance="dashed" iconBefore={<FavIcon />}> | ||
<Button appearance={appearances.dashed} iconBefore={<FavIcon />}> | ||
Button | ||
</Button> | ||
<Button appearance="primary-outline" iconAfter={<CreateIcon />}> | ||
<Button appearance={appearances.primaryOutline} iconAfter={<CreateIcon />}> | ||
Button | ||
@@ -71,9 +73,9 @@ </Button> | ||
<div> | ||
<Button iconAfter={<CreateIcon />} disabled> | ||
<Button disabled iconAfter={<CreateIcon />}> | ||
Button | ||
</Button> | ||
<Button appearance="dashed" iconBefore={<FavIcon />} disabled> | ||
<Button disabled appearance={appearances.dashed} iconBefore={<FavIcon />}> | ||
Button | ||
</Button> | ||
<Button appearance="primary-outline" iconAfter={<CreateIcon />} disabled> | ||
<Button disabled appearance={appearances.primaryOutline} iconAfter={<CreateIcon />}> | ||
Button | ||
@@ -80,0 +82,0 @@ </Button> |
{ | ||
"name": "@potok/button", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "Potok.io UI Kit buttons", | ||
@@ -5,0 +5,0 @@ "main": "./lib/Button.jsx", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6768
189
1