Skip to content

Commit

Permalink
Update to 6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
sapegin committed Aug 1, 2017
1 parent 02a671b commit e8e9093
Show file tree
Hide file tree
Showing 10 changed files with 8,518 additions and 4,992 deletions.
11 changes: 2 additions & 9 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
{
"presets": [
"es2015",
"env",
"react",
"stage-0"
],
"env": {
"development": {
"presets": [
"react-hmre"
]
}
}
]
}
21 changes: 9 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
node_modules

# testing
coverage

# production
build

# misc
.DS_Store
.env
npm-debug.log
node_modules/
Thumbs.db
.idea/
.vscode/
*.sublime-project
*.sublime-workspace
*.log
.eslintcache
styleguide/
30 changes: 26 additions & 4 deletions lib/components/Button/Readme.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@
Basic button:

<Button>Push Me</Button>
```jsx
<Button>Push Me</Button>
```

Big pink button:

<Button size="large" color="deeppink">Lick Me</Button>
```jsx
<Button size="large" color="deeppink">Lick Me</Button>
```

And you *can* **use** `any` [Markdown](http://daringfireball.net/projects/markdown/) here.

If you define a fenced code block with a language flag it will be rendered as a regular Markdown code snippet:
Fenced code blocks with `js`, `jsx` or `javascript` languages are rendered as a interactive playgrounds:

```jsx
<Button>Push Me</Button>
```

You can disable an editor by passing a `noeditor` modifier (```` ```js noeditor````):

```javascript
```jsx noeditor
<Button>Push Me</Button>
```

To render an example as highlighted source code add a `static` modifier: (```` ```js static````):

```js static
import React from 'react';
```

Fenced blocks with other languages are rendered as highlighted code:

```html
<h1>Hello world</h1>
```
22 changes: 13 additions & 9 deletions lib/components/Modal/Readme.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
Each example has its own state that you can access at the `state` variable and change with the `setState` function. Default state is `{}`.

<div>
<button onClick={() => setState({isOpen: true})}>Open</button>
<Modal isOpen={state.isOpen}>
<h1>Hallo!</h1>
<button onClick={() => setState({isOpen: false})}>Close</button>
</Modal>
</div>
```jsx
<div>
<button onClick={() => setState({isOpen: true})}>Open</button>
<Modal isOpen={state.isOpen}>
<h1>Hallo!</h1>
<button onClick={() => setState({isOpen: false})}>Close</button>
</Modal>
</div>
```

If you want to set the default state you can do something like that:

initialState = {count: 1};
<button onClick={() => setState({count: state.count+1})}>{state.count}</button>
```jsx
initialState = {count: 1};
<button onClick={() => setState({count: state.count+1})}>{state.count}</button>
```
4 changes: 3 additions & 1 deletion lib/components/Placeholder/Readme.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<Placeholder type="beard"/>
```jsx
<Placeholder type="beard"/>
```
6 changes: 4 additions & 2 deletions lib/components/RandomButton/Readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
You can `require` external files in your examples:

const names = require('dog-names').all;
<RandomButton variants={names}/>
```jsx
const names = require('dog-names').all;
<RandomButton variants={names}/>
```
Loading

0 comments on commit e8e9093

Please sign in to comment.