Skip to content

Commit

Permalink
feat(Elevation): create new component
Browse files Browse the repository at this point in the history
  • Loading branch information
kradio3 committed Jan 20, 2017
1 parent f153cf0 commit 65de76f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-mdc-web",
"version": "0.1.2",
"version": "0.2.0",
"description": "React web components for Material Design",
"main": "lib/index.js",
"jsnext:main": "src/index.js",
Expand All @@ -11,7 +11,11 @@
"react",
"mdc",
"web",
"ui"
"ui",
"material",
"design",
"components",
"web"
],
"devDependencies": {
"babel-cli": "^6.18.0",
Expand Down
22 changes: 22 additions & 0 deletions src/Elevation/Elevation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React, { PropTypes } from 'react';
import classnames from 'classnames';

const propTypes = {
className: PropTypes.string,
children: PropTypes.node,
transition: PropTypes.bool,
z: PropTypes.number,
};


const Elevation = ({ className, children, z, transition }) => (
<div
className={classnames(`mdc-elevation--z${z}`, className, {
'mdc-elevation-transition': transition,
})}
>
{children}
</div>
);
Elevation.propTypes = propTypes;
export default Elevation;
3 changes: 3 additions & 0 deletions src/Elevation/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import '@material/elevation/dist/mdc.elevation.min.css';

export { default } from './Elevation';

0 comments on commit 65de76f

Please sign in to comment.