From 968a6914f5811b62114d1ba9a18e4ebb71efc992 Mon Sep 17 00:00:00 2001 From: Alex Windett Date: Thu, 6 Apr 2017 16:21:23 +0100 Subject: [PATCH] adding button docs --- ui/src/components/button/readme.md | 72 ++++++++++++------------------ ui/src/components/button/story.js | 14 +++--- 2 files changed, 36 insertions(+), 50 deletions(-) diff --git a/ui/src/components/button/readme.md b/ui/src/components/button/readme.md index 61b8e64b..0e57923f 100644 --- a/ui/src/components/button/readme.md +++ b/ui/src/components/button/readme.md @@ -1,51 +1,35 @@ -# ` - - - - - - - - - -); -``` - -## usage +### Usage ```js -const React = require('react'); -const Button = require('ui/button'); +import Button from '@ui/components/button'; -module.exports = () => { - return ( - - ); -} +
+ + + + + + +
``` + +### Properties +| propName | propType | defaultValue | isRequired | +|----------|----------|--------------|------------| +| href | string | - | | +| to | string | - | | +| secondary | bool | false | | +| disabled | bool | false | | +| tertiary | bool | false | | + +## Roadmap +* `onClick` - click callback +* `label` - button accessibility tag \ No newline at end of file diff --git a/ui/src/components/button/story.js b/ui/src/components/button/story.js index 7702c49c..42c07ae3 100644 --- a/ui/src/components/button/story.js +++ b/ui/src/components/button/story.js @@ -1,26 +1,28 @@ import React from 'react'; import { storiesOf } from '@kadira/storybook'; +import withReadme from 'storybook-readme/with-readme'; import Button from './'; +import README from './readme.md'; storiesOf('Button', module) - .add('With text', () => ( + .add('With text', withReadme(README, () => ( - )).add('Secondary', () => ( + ))).add('Secondary', withReadme(README, () => ( - )).add('Tertiary', () => ( + ))).add('Tertiary', withReadme(README, () => ( - )).add('Disabled', () => ( + ))).add('Disabled', withReadme(README, () => ( - )).add('Anchor', () => ( + ))).add('Anchor', withReadme(README, () => ( - )); + )));