-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
1 parent
f7d2b3e
commit 57b4c0a
Showing
7 changed files
with
86 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { configure } from '@storybook/react'; | ||
import * as element from 'element'; | ||
|
||
function loadStories() { | ||
console.log( 'aloooooo' ); | ||
window.wp = { ...window.wp, element }; | ||
require( '../components/story' ); | ||
require( '../components/button/story' ); | ||
} | ||
|
||
configure( loadStories, module ); |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const config = require( '../webpack.config' ); | ||
config.module.rules = [ | ||
...config.module.rules, | ||
{ | ||
test: /\.md/, | ||
use: 'raw-loader', | ||
}, | ||
] | ||
config.externals = [], | ||
|
||
module.exports = config; |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Button | ||
====== | ||
|
||
This component is used to implement dang sweet buttons. | ||
|
||
#### How to use: | ||
|
||
```jsx | ||
import Button from 'components/button'; | ||
|
||
export default function RockOnButton() { | ||
return ( | ||
<Button isPrimary> | ||
You rock! | ||
</Button> | ||
); | ||
} | ||
``` | ||
|
||
#### Props | ||
|
||
The following props are used to control the display of the component. Any additional props will be passed to the rendered `<a />` or `<button />` element. The presence of a `href` prop determines whether an anchor element is rendered instead of a button. | ||
|
||
* `isPrimary`: (bool) whether the button is styled as a primary button. | ||
* `href`: (string) if this property is added, it will use an `a` rather than a `button` element. |
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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* External components | ||
*/ | ||
import ReactMarkdown from 'react-markdown'; | ||
import { storiesOf } from '@storybook/react'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import Button from '../'; | ||
import readme from '../README.md'; | ||
|
||
storiesOf( 'Components', module ).add( 'Button', () => <div> | ||
<Button>Test</Button> | ||
<ReactMarkdown source={ readme } /> | ||
</div> ); |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* External components | ||
*/ | ||
import ReactMarkdown from 'react-markdown'; | ||
import { storiesOf } from '@storybook/react'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import readme from '../README.md'; | ||
|
||
storiesOf( 'Components', module ).add( 'Welcome', () => <ReactMarkdown source={ readme } /> ); |
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