-
Notifications
You must be signed in to change notification settings - Fork 6
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
spring-raining
committed
Nov 8, 2017
1 parent
8cc979f
commit f0145d7
Showing
9 changed files
with
168 additions
and
22 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,13 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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,8 @@ | ||
import { configure } from '@storybook/react'; | ||
|
||
function loadStories() { | ||
const req = require.context('../src/ui', true, /\-story\.js$/); | ||
req.keys().forEach(filename => req(filename)); | ||
} | ||
|
||
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,58 @@ | ||
// you can use this file to add your custom webpack plugins, loaders and anything you like. | ||
// This is just the basic way to add additional webpack configurations. | ||
// For more information refer the docs: https://storybook.js.org/configurations/custom-webpack-config | ||
|
||
// IMPORTANT | ||
// When you add this file, we won't add the default configurations which is similar | ||
// to "React Create App". This only has babel loader to load JavaScript. | ||
|
||
const autoprefixer = require('autoprefixer'); | ||
|
||
module.exports = { | ||
plugins: [ | ||
// your custom plugins | ||
], | ||
module: { | ||
rules: [ | ||
{ | ||
exclude: [ | ||
/\.html$/, | ||
/\.(js|jsx)$/, | ||
/\.css$/, | ||
/\.json$/, | ||
], | ||
loader: require.resolve('file-loader'), | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: [ | ||
require.resolve('style-loader'), | ||
{ | ||
loader: require.resolve('css-loader'), | ||
options: { | ||
importLoaders: 1, | ||
}, | ||
}, | ||
{ | ||
loader: require.resolve('postcss-loader'), | ||
options: { | ||
ident: 'postcss', // https://webpack.js.org/guides/migrating/#complex-options | ||
plugins: () => [ | ||
require('postcss-flexbugs-fixes'), | ||
autoprefixer({ | ||
browsers: [ | ||
'>1%', | ||
'last 4 versions', | ||
'Firefox ESR', | ||
'not ie < 9', // React doesn't support IE8 anyway | ||
], | ||
flexbox: 'no-2009', | ||
}), | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
}; |
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
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,13 @@ | ||
import { storiesOf } from '@storybook/react'; | ||
import { action } from '@storybook/addon-actions'; | ||
|
||
import { IconButton } from './index.js'; | ||
|
||
storiesOf('Button', module) | ||
.add('IconButton', () => ( | ||
<div> | ||
<IconButton name="upload" onClick={action('clicked')} /> | ||
<IconButton name="plus" onClick={action('clicked')} /> | ||
<IconButton name="folder" onClick={action('clicked')} /> | ||
</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,21 @@ | ||
.IconButton_button { | ||
width: 20px; | ||
height: 20px; | ||
border-radius: 50%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
padding: 6px; | ||
margin: 0 3px; | ||
cursor: pointer; | ||
transition: background-color 0.1s ease-out; | ||
background-color: transarent; | ||
color: #dcdcdc; | ||
} | ||
.IconButton_button:hover { | ||
background-color: rgba(0, 0, 0, 0.3); | ||
} | ||
.IconButton_button:active { | ||
color: #dcdcdc; | ||
background-color: rgba(0, 0, 0, 0.4); | ||
} |
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,21 @@ | ||
import React from 'react'; | ||
import {Icon} from 'react-fa'; | ||
import classnames from 'classnames'; | ||
import './Button.css'; | ||
|
||
const IconButton = ({ | ||
className, name, | ||
...other | ||
}) => { | ||
const buttonClasses = classnames(className, 'IconButton_button'); | ||
|
||
return ( | ||
<div {...other} className={buttonClasses}> | ||
<Icon name={name} /> | ||
</div> | ||
); | ||
}; | ||
|
||
export { | ||
IconButton, | ||
}; |