UNPKG

d2-ui

Version:
1 lines 1.71 kB
"use strict";(function(){var r,p,e,t=function(r,p){function e(){this.constructor=r}for(var t in p)o.call(p,t)&&(r[t]=p[t]);return e.prototype=p.prototype,r.prototype=new e,r.__super__=p.prototype,r},o={}.hasOwnProperty;p=require("react"),e=require("reactcss"),r=function(r){function o(){return o.__super__.constructor.apply(this,arguments)}return t(o,r),o.prototype.css=e.inline,o.propTypes={background:p.PropTypes.string,zDepth:p.PropTypes.oneOf(["0","1","2","3","4","5",0,1,2,3,4,5]),radius:p.PropTypes.oneOfType([p.PropTypes.string,p.PropTypes.number])},o.defaultProps={background:"#fff",zDepth:"1",radius:"2px"},o.prototype.classes=function(){return{"default":{wrap:{position:"relative"},content:{position:"relative"},bg:{Absolute:"0 0 0 0",boxShadow:"0 "+this.props.zDepth+"px "+4*this.props.zDepth+"px rgba(0,0,0,.24)",borderRadius:this.props.radius,background:this.props.background}},"zDepth-0":{bg:{boxShadow:"none"}},"zDepth-1":{bg:{boxShadow:"0 2px 10px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.16)"}},"zDepth-2":{bg:{boxShadow:"0 6px 20px rgba(0,0,0,.19), 0 8px 17px rgba(0,0,0,.2)"}},"zDepth-3":{bg:{boxShadow:"0 17px 50px rgba(0,0,0,.19), 0 12px 15px rgba(0,0,0,.24)"}},"zDepth-4":{bg:{boxShadow:"0 25px 55px rgba(0,0,0,.21), 0 16px 28px rgba(0,0,0,.22)"}},"zDepth-5":{bg:{boxShadow:"0 40px 77px rgba(0,0,0,.22), 0 27px 24px rgba(0,0,0,.2)"}},square:{bg:{borderRadius:"0"}},circle:{bg:{borderRadius:"50%"}},full:{wrap:{width:"100%"}}}},o.prototype.styles=function(){return this.css()},o.prototype.render=function(){return p.createElement("div",{is:"wrap"},p.createElement("div",{is:"bg"}),p.createElement("div",{is:"content"},this.props.children))},o}(p.Component),module.exports=r}).call(void 0);