atomic-layout
Advanced tools
Comparing version
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("styled-components"),require("react")):"function"==typeof define&&define.amd?define("atomicLayout",["styled-components","react"],t):"object"==typeof exports?exports.atomicLayout=t(require("styled-components"),require("react")):e.atomicLayout=t(e["styled-components"],e.react)}(window,function(e,t){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t,r){"undefined"!=typeof self&&self,e.exports=function(e){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(e,t,r){e.exports=r(5)()},function(e,t,r){"use strict";var n=/[A-Z]/g,o=/^ms-/,a={};e.exports=function(e){return e in a?a[e]:a[e]=e.replace(n,"-$&").toLowerCase().replace(o,"-ms-")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o=r(0),a=function(e){return e&&e.__esModule?e:{default:e}}(o),i=a.default.oneOfType([a.default.string,a.default.number]),u={orientation:a.default.oneOf(["portrait","landscape"]),scan:a.default.oneOf(["progressive","interlace"]),aspectRatio:a.default.string,deviceAspectRatio:a.default.string,height:i,deviceHeight:i,width:i,deviceWidth:i,color:a.default.bool,colorIndex:a.default.bool,monochrome:a.default.bool,resolution:i},c=n({minAspectRatio:a.default.string,maxAspectRatio:a.default.string,minDeviceAspectRatio:a.default.string,maxDeviceAspectRatio:a.default.string,minHeight:i,maxHeight:i,minDeviceHeight:i,maxDeviceHeight:i,minWidth:i,maxWidth:i,minDeviceWidth:i,maxDeviceWidth:i,minColor:a.default.number,maxColor:a.default.number,minColorIndex:a.default.number,maxColorIndex:a.default.number,minMonochrome:a.default.number,maxMonochrome:a.default.number,minResolution:i,maxResolution:i},u),s={all:a.default.bool,grid:a.default.bool,aural:a.default.bool,braille:a.default.bool,handheld:a.default.bool,print:a.default.bool,projection:a.default.bool,screen:a.default.bool,tty:a.default.bool,tv:a.default.bool,embossed:a.default.bool},l=n({},s,c);u.type=Object.keys(s),t.default={all:l,types:s,matchers:u,features:c},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){var r=u({},e);return t.forEach(function(e){return delete r[e]}),r}Object.defineProperty(t,"__esModule",{value:!0}),t.toQuery=t.default=void 0;var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c=r(4),s=n(c),l=r(0),f=n(l),p=r(7),d=n(p),m=r(1),h=n(m),v=r(2),y=n(v),b=r(9),g=n(b),O={component:f.default.node,query:f.default.string,values:f.default.shape(y.default.matchers),children:f.default.oneOfType([f.default.node,f.default.func]),onChange:f.default.func,onBeforeChange:f.default.func},w=Object.keys(y.default.all),j=Object.keys(O),x=j.concat(w),k=function(e){function t(){var e,r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var a=arguments.length,i=Array(a),u=0;u<a;u++)i[u]=arguments[u];return r=n=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),n.state={matches:!1},n.updateMatches=function(){n._mql.matches!==n.state.matches&&n.setState({matches:n._mql.matches})},n.removeMql=function(){n._mql&&(n._mql.removeListener(n.updateMatches),n._mql.dispose())},o(n,r)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentWillMount",value:function(){this.updateQuery(this.props)}},{key:"componentWillReceiveProps",value:function(e){this.updateQuery(e)}},{key:"updateQuery",value:function(e){var t=void 0,r=!1;if(e.query?this.query=e.query:this.query=(0,g.default)(a(e,j)),!this.query)throw new Error("Invalid or missing MediaQuery!");e.values&&(t=Object.keys(e.values).reduce(function(t,r){return t[(0,h.default)(r)]=e.values[r],t},{}),0!==Object.keys(t).length&&(r=!0)),this.removeMql(),this._mql=(0,d.default)(this.query,t,r),this._mql.addListener(this.updateMatches),this.updateMatches()}},{key:"componentWillUpdate",value:function(e,t){this.props.onBeforeChange&&this.state.matches!==t.matches&&this.props.onBeforeChange(this.state.matches)}},{key:"componentDidUpdate",value:function(e,t){this.props.onChange&&t.matches!==this.state.matches&&this.props.onChange(this.state.matches)}},{key:"componentWillUnmount",value:function(){this.removeMql()}},{key:"render",value:function(){if("function"==typeof this.props.children)return this.props.children(this.state.matches);if(!1===this.state.matches)return null;var e=a(this.props,x),t=Object.keys(e).length>0,r=s.default.Children.count(this.props.children);return this.props.component||null==this.props.children||t&&r>1?s.default.createElement(this.props.component||"div",e,this.props.children):t?s.default.cloneElement(this.props.children,e):r?this.props.children:null}}]),t}(s.default.Component);k.displayName="MediaQuery",k.defaultProps={values:{}},t.default=k,t.toQuery=g.default},function(t,r){t.exports=e},function(e,t,r){"use strict";function n(){}var o=r(6);e.exports=function(){function e(e,t,r,n,a,i){if(i!==o){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return r.checkPropTypes=n,r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";var n=r(8).match,o="undefined"!=typeof window?window.matchMedia:null;e.exports=function(e,t,r){return new function(e,t,r){function a(e){i.matches=e.matches,i.media=e.media}var i=this;if(o&&!r){var u=o.call(window,e);this.matches=u.matches,this.media=u.media,u.addListener(a)}else this.matches=n(e,t),this.media=e;this.addListener=function(e){u&&u.addListener(e)},this.removeListener=function(e){u&&u.removeListener(e)},this.dispose=function(){u&&u.removeListener(a)}}(e,t,r)}},function(e,t,r){"use strict";function n(e){return e.split(",").map(function(e){var t=(e=e.trim()).match(u),r=t[1],n=t[2],o=t[3]||"",a={};return a.inverse=!!r&&"not"===r.toLowerCase(),a.type=n?n.toLowerCase():"all",o=o.match(/\([^\)]+\)/g)||[],a.expressions=o.map(function(e){var t=e.match(c),r=t[1].toLowerCase().match(s);return{modifier:r[1],feature:r[2],value:t[2]}}),a})}function o(e){var t,r=Number(e);return r||(t=e.match(/^(\d+)\s*\/\s*(\d+)$/),r=t[1]/t[2]),r}function a(e){var t=parseFloat(e);switch(String(e).match(f)[1]){case"dpcm":return t/2.54;case"dppx":return 96*t;default:return t}}function i(e){var t=parseFloat(e);switch(String(e).match(l)[1]){case"em":case"rem":return 16*t;case"cm":return 96*t/2.54;case"mm":return 96*t/2.54/10;case"in":return 96*t;case"pt":return 72*t;case"pc":return 72*t/12;default:return t}}t.match=function(e,t){return n(e).some(function(e){var r=e.inverse,n="all"===e.type||t.type===e.type;if(n&&r||!n&&!r)return!1;var u=e.expressions.every(function(e){var r=e.feature,n=e.modifier,u=e.value,c=t[r];if(!c)return!1;switch(r){case"orientation":case"scan":return c.toLowerCase()===u.toLowerCase();case"width":case"height":case"device-width":case"device-height":u=i(u),c=i(c);break;case"resolution":u=a(u),c=a(c);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":u=o(u),c=o(c);break;case"grid":case"color":case"color-index":case"monochrome":u=parseInt(u,10)||1,c=parseInt(c,10)||0}switch(n){case"min":return c>=u;case"max":return c<=u;default:return c===u}});return u&&!r||!u&&r})},t.parse=n;var u=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,c=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,s=/^(?:(min|max)-)?(.+)/,l=/(em|rem|px|cm|mm|in|pt|pc)?$/,f=/(dpi|dpcm|dppx)?$/},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=[];return Object.keys(u.default.all).forEach(function(r){var n=e[r];null!=n&&t.push(function(e,t){var r=(0,a.default)(e);return"number"==typeof t&&(t+="px"),!0===t?e:!1===t?c(e):"("+r+": "+t+")"}(r,n))}),function(e){return e.join(" and ")}(t)};var o=r(1),a=n(o),i=r(2),u=n(i),c=function(e){return"not "+e};e.exports=t.default}])}(r(1))},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n);function a(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}var i={defaultUnit:"px",defaultBehavior:"up",defaultBreakpointName:"xs",breakpoints:{xs:{maxWidth:"575px"},sm:{minWidth:"576px",maxWidth:"768px"},md:{minWidth:"769px",maxWidth:"992px"},lg:{minWidth:"993px",maxWidth:"1199px"},xl:{minWidth:"1200px"}}};function u(e,t){e||console.error(t)}var c=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var s=new(function(){function e(t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.configure(t)}return c(e,[{key:"configure",value:function(e){var t=this;u(e,"Failed to configure Layout: expected an options Object, but got: "+e);var r=Object.assign({},i,e),n=r.defaultBreakpointName;return u(n,'Failed to configure Layout: expected "defaultBreakpointName" property set, but got: '+n),u(r.breakpoints,"Failed to configure Layout: expected to have at least one breakpoint specified, but got none."),u(r.breakpoints.hasOwnProperty(n),'Failed to configure Layout: cannot set default breakpoint to "'+n+'" (breakpoint not found).'),Object.keys(r).forEach(function(e){t[e]=r[e]}),this}},{key:"getBreakpointNames",value:function(){return Object.keys(this.breakpoints)}},{key:"getBreakpoint",value:function(e){return e&&this.breakpoints[e]}}]),e}())(i);function l(e){if(e)return""+e+(Number.isInteger(e)?s.defaultUnit:"")}var f=a(function(e){return e.replace(/^.+$/gm,function(e){return"'"+e+"'"})},function(e){return e.replace(/'+/gm,"")},function(e){return e.trim()}),p={template:{props:["grid-template-areas"],transformValue:a(function(e){return e.join("\n")},function(e){return e.map(f)},function(e){return e.split("\n")},function(e){return e.trim()})},templateCols:{props:["grid-template-columns"]},templateRows:{props:["grid-template-rows"]},col:{props:["grid-column"]},colStart:{props:["grid-column-start"]},colEnd:{props:["grid-column-end"]},row:{props:["grid-row"]},rowStart:{props:["grid-row-start"]},rowEnd:{props:["grid-row-end"]},gutter:{props:["grid-gap"],transformValue:l},gutterCol:{props:["grid-column-gap"],transformValue:l},gutterRow:{props:["grid-row-gap"],transformValue:l},align:{props:["align-self"]},alignItems:{props:["align-items"]},justify:{props:["justify-self"]},justifyItems:{props:["justify-items"]},justifyContent:{props:["justify-content"]},place:{props:["place-self"]},placeItems:{props:["place-items"]},placeContent:{props:["place-content"]},height:{props:["height"],transformValue:l},minHeight:{props:["min-height"],transformValue:l},maxHeight:{props:["max-height"],transformValue:l},width:{props:["width"],transformValue:l},minWidth:{props:["min-width"],transformValue:l},maxWidth:{props:["max-width"],transformValue:l},margin:{props:["margin"],transformValue:l},marginTop:{props:["margin-top"],transformValue:l},marginRight:{props:["margin-right"],transformValue:l},marginBottom:{props:["margin-bottom"],transformValue:l},marginLeft:{props:["margin-left"],transformValue:l},marginVertical:{props:["margin-top","margin-bottom"],transformValue:l},marginHorizontal:{props:["margin-right","margin-left"],transformValue:l},padding:{props:["padding"],transformValue:l},paddingTop:{props:["padding-top"],transformValue:l},paddingRight:{props:["padding-right"],transformValue:l},paddingBottom:{props:["padding-bottom"],transformValue:l},paddingLeft:{props:["padding-left"],transformValue:l},paddingVertical:{props:["padding-top","padding-bottom"],transformValue:l},paddingHorizontal:{props:["padding-right","padding-left"],transformValue:l}};function d(e){return e.slice(0,1).toLowerCase()+e.slice(1,e.length)}function m(e){var t=s.getBreakpointNames().join("|"),r=["down","only"].join("|"),n=new RegExp("("+t+")$","gi"),o=new RegExp("("+r+")$","gi"),a=e.match(o),i=a?a[0]:"",u=e.replace(i,"").match(n),c=u?u[0]:"",l=e.replace(c,"").replace(i,""),f=c?d(c):s.defaultBreakpointName,p=f===s.defaultBreakpointName;return{originPropName:e,purePropName:l,behavior:i?d(i):s.defaultBehavior,breakpoint:{name:f,isDefault:p}}}var h=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw a}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),v=function(e,t){var r=e.split("-"),n=h(r,2),o=n[0],a=n[1];return!["height","width"].includes(a)||("min"===o&&["up","only"].includes(t)||"max"===o&&["down","only"].includes(t))};var y=function(e,t,r,n){var o=e.map(function(e){return e+":"+String(t)+";"}).join(""),a=s.getBreakpoint(r.name);return a&&!(r.isDefault&&n===s.defaultBehavior)?"@media "+function(e,t){return Object.entries(e).map(function(e){var t=h(e,2),r=t[0],n=t[1];return[function(e){return e.replace(/[A-Z]/g,function(e){return("-"+e).toLowerCase()})}(r),n]}).filter(function(e){var r=h(e,1)[0];return v(r,t)}).map(function(e){var t=h(e,2),r=t[0],n=t[1];return"("+r+":"+String(l(n))+")"}).join(" and ")}(a,n)+" {"+o+"}":o};function b(e){return Object.keys(e).map(m).filter(function(e){var t=e.purePropName;return p.hasOwnProperty(t)}).map(function(t){var r=t.purePropName,n=t.originPropName,o=t.breakpoint,a=t.behavior,i=p[r],u=i.props,c=i.transformValue,s=e[n],l=c?c(s):s;return y(u,l,o,a)}).join(" ")}var g=function(e,t){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n ",";\n display: ",";\n"],["\n ",";\n display: ",";\n"]);var O=o.a.div(g,b,function(e){return e.inline?"inline-flex":"flex"}),w=r(1),j=r.n(w),x=a(function(e){return Array.from(new Set(e))},function(e){return e.filter(Boolean)},function(e){return e.split(" ")},function(e){return e.replace(/\s+/g," ")},function(e){return e.replace(/\r?\n|\'+/g," ")});var k=r(2),_=r.n(k);function P(e,t){return function(r){return e(r)?t(r):r}}function C(e){return function(t){return e.apply(null,t)}}function V(e){var t=e.match(/^min|max/);return t&&t[0]}var A=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};function L(e,t,r){var n=t.behavior,o=e.behavior,a="up"===n,i=n===o,u=a&&"down"===o,c=a,s=A({},t,e);return Object.keys(s).reduce(function(n,o){var a=s[o],f=V(o);("behavior"===o&&!r&&c&&(a="down"),"max"===f)&&(!r&&c&&(a="calc("+l(e[o.replace(/^max/,"min")])+" - 1px)"));return"min"===f&&(r?(i||u)&&(a=t[o]):c&&(a=t[o])),A({},n,function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},o,a))},{})}var E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};function M(e){return Object.keys(e).reduce(function(t,r){return E({},t,function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},r,"max"===V(r)?void 0:e[r]))},{})}function S(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var q=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw a}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),R=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};var T=function(e,t){return function(e){var r=function(e){return Array.isArray(e)?e:Array.from(e)}(e),n=(r[0],r.slice(1));return[t(e)].concat(function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(n))}},W=function(e){return function(t,r,n,o){var a=n===o.length-1,i=r.areas,u=r.behavior,c=r.breakpoint,s=i.includes(e),l=t[t.length-1],f=R({},c,{behavior:u}),p=l||{},d=(p.behavior,function(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(p,["behavior"]));return[f,l,s,a,l&&function(e,t){var r=[].concat(S(Object.keys(e)),S(Object.keys(t)));return r.every(function(e,t){var n=e.replace(/^min|max/,"_"),o=r[t-1];return n===(o?o.replace(/^min|max/,"_"):n)})}(d,c),t]}},B=function(e){var t=q(e,5);t[0],t[1],t[2],t[3];return t[4]},N=function(e){var t=q(e,4),r=t[0];t[1],t[2];return t[3]&&"up"===r.behavior},I=function(e){var t=q(e,6),r=t[0],n=t[1],o=t[2],a=(t[3],t[4]),i=t[5],u=(n||{}).behavior,c=r.behavior,s="up"===u,l=o&&(u===c||s&&"down"===c);a||(l=!1);var f=[r];return o||(f=s?[r,null]:[null],s&&(l=!0)),(l?function(e){return e.slice(0,e.length-1)}(i):i).concat(f)},D=function(e,t){return t.reduce(a(I,P(N,T(0,C(M))),P(B,T(0,C(L))),W(e)),[])},H=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},z=function(e,t){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n grid-area: ",";\n"],["\n grid-area: ",";\n"]);function F(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}var U=function(e,t){var r=function(r){var n=r.children,o=F(r,["children"]);return t.reduce(function(t,r,a){if(!r)return t;r.behavior;var i=F(r,["behavior"]);return t.concat(w.createElement(_.a,H({},o,i,{key:e.displayName+"_"+a,component:e}),n))},[])};return r.displayName="Placeholder("+e.displayName+")",r},Q=function(e){return o()(O)(z,e)};var $=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};var Z=a(function(e){var t=e.areas,r=e.templates;return t.reduce(function(e,t){var n=D(t,r),o=1===n.length&&n.every(function(e){return!e.minWidth&&!e.maxWidth}),a=Q(t),i=function(e){return e.replace(/^./,function(e){return e.toUpperCase()})}(t);a.displayName=i;var u=o?a:U(a,n);return H({},e,function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},i,u))},{})},function(e){var t=Object.keys(e).reduce(function(t,r){var n=m(r),o=n.breakpoint,a=n.behavior,i=x(e[r]);return{areas:t.areas.concat(i),templates:t.templates.concat({breakpoint:s.getBreakpoint(o.name),behavior:a,areas:i})}},{areas:[],templates:[]}),r=t.areas,n=t.templates;return{areas:Array.from(new Set(r)),templates:n}},function(e){return Object.keys(e).filter(function(e){return"template"===m(e).purePropName}).reduce(function(t,r){return $({},t,function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},r,e[r]))},{})}),Y=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),G=function(e,t){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n ",";\n display: ",";\n"],["\n ",";\n display: ",";\n"]);var J=o.a.div(G,b,function(e){return e.inline?"inline-grid":"grid"}),K=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.areaComponents=Z(e),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,j.a.Component),Y(t,[{key:"render",value:function(){var e=this.areaComponents,t=Object.keys(e).length>0;return u(t,"Failed to render Composition: received no layout areas. Please check the values of template definitions."),j.a.createElement(J,this.props,t&&this.props.children(e))}}]),t}();r.d(t,"Box",function(){return O}),r.d(t,"Composition",function(){return K}),r.d(t,"default",function(){return s})}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("styled-components"),require("react")):"function"==typeof define&&define.amd?define("atomicLayout",["styled-components","react"],t):"object"==typeof exports?exports.atomicLayout=t(require("styled-components"),require("react")):e.atomicLayout=t(e["styled-components"],e.react)}(window,function(e,t){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t,r){"undefined"!=typeof self&&self,e.exports=function(e){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(e,t,r){e.exports=r(5)()},function(e,t,r){"use strict";var n=/[A-Z]/g,o=/^ms-/,a={};e.exports=function(e){return e in a?a[e]:a[e]=e.replace(n,"-$&").toLowerCase().replace(o,"-ms-")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o=r(0),a=function(e){return e&&e.__esModule?e:{default:e}}(o),i=a.default.oneOfType([a.default.string,a.default.number]),u={orientation:a.default.oneOf(["portrait","landscape"]),scan:a.default.oneOf(["progressive","interlace"]),aspectRatio:a.default.string,deviceAspectRatio:a.default.string,height:i,deviceHeight:i,width:i,deviceWidth:i,color:a.default.bool,colorIndex:a.default.bool,monochrome:a.default.bool,resolution:i},c=n({minAspectRatio:a.default.string,maxAspectRatio:a.default.string,minDeviceAspectRatio:a.default.string,maxDeviceAspectRatio:a.default.string,minHeight:i,maxHeight:i,minDeviceHeight:i,maxDeviceHeight:i,minWidth:i,maxWidth:i,minDeviceWidth:i,maxDeviceWidth:i,minColor:a.default.number,maxColor:a.default.number,minColorIndex:a.default.number,maxColorIndex:a.default.number,minMonochrome:a.default.number,maxMonochrome:a.default.number,minResolution:i,maxResolution:i},u),s={all:a.default.bool,grid:a.default.bool,aural:a.default.bool,braille:a.default.bool,handheld:a.default.bool,print:a.default.bool,projection:a.default.bool,screen:a.default.bool,tty:a.default.bool,tv:a.default.bool,embossed:a.default.bool},l=n({},s,c);u.type=Object.keys(s),t.default={all:l,types:s,matchers:u,features:c},e.exports=t.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){var r=u({},e);return t.forEach(function(e){return delete r[e]}),r}Object.defineProperty(t,"__esModule",{value:!0}),t.toQuery=t.default=void 0;var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c=r(4),s=n(c),l=r(0),f=n(l),p=r(7),d=n(p),m=r(1),h=n(m),v=r(2),y=n(v),b=r(9),g=n(b),O={component:f.default.node,query:f.default.string,values:f.default.shape(y.default.matchers),children:f.default.oneOfType([f.default.node,f.default.func]),onChange:f.default.func,onBeforeChange:f.default.func},w=Object.keys(y.default.all),j=Object.keys(O),x=j.concat(w),k=function(e){function t(){var e,r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var a=arguments.length,i=Array(a),u=0;u<a;u++)i[u]=arguments[u];return r=n=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),n.state={matches:!1},n.updateMatches=function(){n._mql.matches!==n.state.matches&&n.setState({matches:n._mql.matches})},n.removeMql=function(){n._mql&&(n._mql.removeListener(n.updateMatches),n._mql.dispose())},o(n,r)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"componentWillMount",value:function(){this.updateQuery(this.props)}},{key:"componentWillReceiveProps",value:function(e){this.updateQuery(e)}},{key:"updateQuery",value:function(e){var t=void 0,r=!1;if(e.query?this.query=e.query:this.query=(0,g.default)(a(e,j)),!this.query)throw new Error("Invalid or missing MediaQuery!");e.values&&(t=Object.keys(e.values).reduce(function(t,r){return t[(0,h.default)(r)]=e.values[r],t},{}),0!==Object.keys(t).length&&(r=!0)),this.removeMql(),this._mql=(0,d.default)(this.query,t,r),this._mql.addListener(this.updateMatches),this.updateMatches()}},{key:"componentWillUpdate",value:function(e,t){this.props.onBeforeChange&&this.state.matches!==t.matches&&this.props.onBeforeChange(this.state.matches)}},{key:"componentDidUpdate",value:function(e,t){this.props.onChange&&t.matches!==this.state.matches&&this.props.onChange(this.state.matches)}},{key:"componentWillUnmount",value:function(){this.removeMql()}},{key:"render",value:function(){if("function"==typeof this.props.children)return this.props.children(this.state.matches);if(!1===this.state.matches)return null;var e=a(this.props,x),t=Object.keys(e).length>0,r=s.default.Children.count(this.props.children);return this.props.component||null==this.props.children||t&&r>1?s.default.createElement(this.props.component||"div",e,this.props.children):t?s.default.cloneElement(this.props.children,e):r?this.props.children:null}}]),t}(s.default.Component);k.displayName="MediaQuery",k.defaultProps={values:{}},t.default=k,t.toQuery=g.default},function(t,r){t.exports=e},function(e,t,r){"use strict";function n(){}var o=r(6);e.exports=function(){function e(e,t,r,n,a,i){if(i!==o){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return r.checkPropTypes=n,r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";var n=r(8).match,o="undefined"!=typeof window?window.matchMedia:null;e.exports=function(e,t,r){return new function(e,t,r){function a(e){i.matches=e.matches,i.media=e.media}var i=this;if(o&&!r){var u=o.call(window,e);this.matches=u.matches,this.media=u.media,u.addListener(a)}else this.matches=n(e,t),this.media=e;this.addListener=function(e){u&&u.addListener(e)},this.removeListener=function(e){u&&u.removeListener(e)},this.dispose=function(){u&&u.removeListener(a)}}(e,t,r)}},function(e,t,r){"use strict";function n(e){return e.split(",").map(function(e){var t=(e=e.trim()).match(u),r=t[1],n=t[2],o=t[3]||"",a={};return a.inverse=!!r&&"not"===r.toLowerCase(),a.type=n?n.toLowerCase():"all",o=o.match(/\([^\)]+\)/g)||[],a.expressions=o.map(function(e){var t=e.match(c),r=t[1].toLowerCase().match(s);return{modifier:r[1],feature:r[2],value:t[2]}}),a})}function o(e){var t,r=Number(e);return r||(t=e.match(/^(\d+)\s*\/\s*(\d+)$/),r=t[1]/t[2]),r}function a(e){var t=parseFloat(e);switch(String(e).match(f)[1]){case"dpcm":return t/2.54;case"dppx":return 96*t;default:return t}}function i(e){var t=parseFloat(e);switch(String(e).match(l)[1]){case"em":case"rem":return 16*t;case"cm":return 96*t/2.54;case"mm":return 96*t/2.54/10;case"in":return 96*t;case"pt":return 72*t;case"pc":return 72*t/12;default:return t}}t.match=function(e,t){return n(e).some(function(e){var r=e.inverse,n="all"===e.type||t.type===e.type;if(n&&r||!n&&!r)return!1;var u=e.expressions.every(function(e){var r=e.feature,n=e.modifier,u=e.value,c=t[r];if(!c)return!1;switch(r){case"orientation":case"scan":return c.toLowerCase()===u.toLowerCase();case"width":case"height":case"device-width":case"device-height":u=i(u),c=i(c);break;case"resolution":u=a(u),c=a(c);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":u=o(u),c=o(c);break;case"grid":case"color":case"color-index":case"monochrome":u=parseInt(u,10)||1,c=parseInt(c,10)||0}switch(n){case"min":return c>=u;case"max":return c<=u;default:return c===u}});return u&&!r||!u&&r})},t.parse=n;var u=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,c=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,s=/^(?:(min|max)-)?(.+)/,l=/(em|rem|px|cm|mm|in|pt|pc)?$/,f=/(dpi|dpcm|dppx)?$/},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=[];return Object.keys(u.default.all).forEach(function(r){var n=e[r];null!=n&&t.push(function(e,t){var r=(0,a.default)(e);return"number"==typeof t&&(t+="px"),!0===t?e:!1===t?c(e):"("+r+": "+t+")"}(r,n))}),function(e){return e.join(" and ")}(t)};var o=r(1),a=n(o),i=r(2),u=n(i),c=function(e){return"not "+e};e.exports=t.default}])}(r(1))},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n);function a(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}var i={defaultUnit:"px",defaultBehavior:"up",defaultBreakpointName:"xs",breakpoints:{xs:{maxWidth:"575px"},sm:{minWidth:"576px",maxWidth:"768px"},md:{minWidth:"769px",maxWidth:"992px"},lg:{minWidth:"993px",maxWidth:"1199px"},xl:{minWidth:"1200px"}}};function u(e,t){e||console.error(t)}var c=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var s=new(function(){function e(t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.configure(t)}return c(e,[{key:"configure",value:function(e){var t=this;u(e,"Failed to configure Layout: expected an options Object, but got: "+e);var r=Object.assign({},i,e),n=r.defaultBreakpointName;return u(n,'Failed to configure Layout: expected "defaultBreakpointName" property set, but got: '+n),u(r.breakpoints,"Failed to configure Layout: expected to have at least one breakpoint specified, but got none."),u(r.breakpoints.hasOwnProperty(n),'Failed to configure Layout: cannot set default breakpoint to "'+n+'" (breakpoint not found).'),Object.keys(r).forEach(function(e){t[e]=r[e]}),this}},{key:"getBreakpointNames",value:function(){return Object.keys(this.breakpoints)}},{key:"getBreakpoint",value:function(e){return e&&this.breakpoints[e]}}]),e}())(i);function l(e){if(e)return""+e+(Number.isInteger(e)?s.defaultUnit:"")}var f=a(function(e){return e.replace(/^.+$/gm,function(e){return"'"+e+"'"})},function(e){return e.replace(/'+/gm,"")},function(e){return e.trim()}),p={template:{props:["grid-template-areas"],transformValue:a(function(e){return e.join("\n")},function(e){return e.map(f)},function(e){return e.split("\n")},function(e){return e.trim()})},templateCols:{props:["grid-template-columns"]},templateRows:{props:["grid-template-rows"]},col:{props:["grid-column"]},colStart:{props:["grid-column-start"]},colEnd:{props:["grid-column-end"]},row:{props:["grid-row"]},rowStart:{props:["grid-row-start"]},rowEnd:{props:["grid-row-end"]},gutter:{props:["grid-gap"],transformValue:l},gutterCol:{props:["grid-column-gap"],transformValue:l},gutterRow:{props:["grid-row-gap"],transformValue:l},align:{props:["align-self"]},alignItems:{props:["align-items"]},justify:{props:["justify-self"]},justifyItems:{props:["justify-items"]},justifyContent:{props:["justify-content"]},place:{props:["place-self"]},placeItems:{props:["place-items"]},placeContent:{props:["place-content"]},height:{props:["height"],transformValue:l},minHeight:{props:["min-height"],transformValue:l},maxHeight:{props:["max-height"],transformValue:l},width:{props:["width"],transformValue:l},minWidth:{props:["min-width"],transformValue:l},maxWidth:{props:["max-width"],transformValue:l},margin:{props:["margin"],transformValue:l},marginTop:{props:["margin-top"],transformValue:l},marginRight:{props:["margin-right"],transformValue:l},marginBottom:{props:["margin-bottom"],transformValue:l},marginLeft:{props:["margin-left"],transformValue:l},marginVertical:{props:["margin-top","margin-bottom"],transformValue:l},marginHorizontal:{props:["margin-right","margin-left"],transformValue:l},padding:{props:["padding"],transformValue:l},paddingTop:{props:["padding-top"],transformValue:l},paddingRight:{props:["padding-right"],transformValue:l},paddingBottom:{props:["padding-bottom"],transformValue:l},paddingLeft:{props:["padding-left"],transformValue:l},paddingVertical:{props:["padding-top","padding-bottom"],transformValue:l},paddingHorizontal:{props:["padding-right","padding-left"],transformValue:l}};function d(e){return e.slice(0,1).toLowerCase()+e.slice(1,e.length)}function m(e){var t=s.getBreakpointNames().join("|"),r=["down","only"].join("|"),n=new RegExp("("+t+")$","gi"),o=new RegExp("("+r+")$","gi"),a=e.match(o),i=a?a[0]:"",u=e.replace(i,"").match(n),c=u?u[0]:"",l=e.replace(c,"").replace(i,""),f=c?d(c):s.defaultBreakpointName,p=f===s.defaultBreakpointName;return{originPropName:e,purePropName:l,behavior:i?d(i):s.defaultBehavior,breakpoint:{name:f,isDefault:p}}}var h=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw a}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),v=function(e,t){var r=e.split("-"),n=h(r,2),o=n[0],a=n[1];return!["height","width"].includes(a)||("min"===o&&["up","only"].includes(t)||"max"===o&&["down","only"].includes(t))};var y=function(e,t,r,n){var o=e.map(function(e){return e+":"+String(t)+";"}).join(""),a=s.getBreakpoint(r.name);return a&&!(r.isDefault&&n===s.defaultBehavior)?"@media "+function(e,t){return Object.entries(e).map(function(e){var t=h(e,2),r=t[0],n=t[1];return[function(e){return e.replace(/[A-Z]/g,function(e){return("-"+e).toLowerCase()})}(r),n]}).filter(function(e){var r=h(e,1)[0];return v(r,t)}).map(function(e){var t=h(e,2),r=t[0],n=t[1];return"("+r+":"+String(l(n))+")"}).join(" and ")}(a,n)+" {"+o+"}":o};function b(e){return Object.keys(e).map(m).filter(function(e){var t=e.purePropName;return p.hasOwnProperty(t)}).map(function(t){var r=t.purePropName,n=t.originPropName,o=t.breakpoint,a=t.behavior,i=p[r],u=i.props,c=i.transformValue,s=e[n],l=c?c(s):s;return y(u,l,o,a)}).join(" ")}var g=function(e,t){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n ",";\n display: ",";\n"],["\n ",";\n display: ",";\n"]);var O=o.a.div(g,b,function(e){var t=e.flex,r=e.inline;return t&&(r?"inline-flex":"flex")}),w=r(1),j=r.n(w),x=a(function(e){return Array.from(new Set(e))},function(e){return e.filter(Boolean)},function(e){return e.split(" ")},function(e){return e.replace(/\s+/g," ")},function(e){return e.replace(/\r?\n|\'+/g," ")});var k=r(2),_=r.n(k);function P(e,t){return function(r){return e(r)?t(r):r}}function C(e){return function(t){return e.apply(null,t)}}function V(e){var t=e.match(/^min|max/);return t&&t[0]}var A=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};function L(e,t,r){var n=t.behavior,o=e.behavior,a="up"===n,i=n===o,u=a&&"down"===o,c=a,s=A({},t,e);return Object.keys(s).reduce(function(n,o){var a=s[o],f=V(o);("behavior"===o&&!r&&c&&(a="down"),"max"===f)&&(!r&&c&&(a="calc("+l(e[o.replace(/^max/,"min")])+" - 1px)"));return"min"===f&&(r?(i||u)&&(a=t[o]):c&&(a=t[o])),A({},n,function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},o,a))},{})}var E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};function M(e){return Object.keys(e).reduce(function(t,r){return E({},t,function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},r,"max"===V(r)?void 0:e[r]))},{})}function S(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var q=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw a}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),R=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};var T=function(e,t){return function(e){var r=function(e){return Array.isArray(e)?e:Array.from(e)}(e),n=(r[0],r.slice(1));return[t(e)].concat(function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(n))}},W=function(e){return function(t,r,n,o){var a=n===o.length-1,i=r.areas,u=r.behavior,c=r.breakpoint,s=i.includes(e),l=t[t.length-1],f=R({},c,{behavior:u}),p=l||{},d=(p.behavior,function(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(p,["behavior"]));return[f,l,s,a,l&&function(e,t){var r=[].concat(S(Object.keys(e)),S(Object.keys(t)));return r.every(function(e,t){var n=e.replace(/^min|max/,"_"),o=r[t-1];return n===(o?o.replace(/^min|max/,"_"):n)})}(d,c),t]}},B=function(e){var t=q(e,5);t[0],t[1],t[2],t[3];return t[4]},N=function(e){var t=q(e,4),r=t[0];t[1],t[2];return t[3]&&"up"===r.behavior},I=function(e){var t=q(e,6),r=t[0],n=t[1],o=t[2],a=(t[3],t[4]),i=t[5],u=(n||{}).behavior,c=r.behavior,s="up"===u,l=o&&(u===c||s&&"down"===c);a||(l=!1);var f=[r];return o||(f=s?[r,null]:[null],s&&(l=!0)),(l?function(e){return e.slice(0,e.length-1)}(i):i).concat(f)},D=function(e,t){return t.reduce(a(I,P(N,T(0,C(M))),P(B,T(0,C(L))),W(e)),[])},H=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},z=function(e,t){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n grid-area: ",";\n"],["\n grid-area: ",";\n"]);function F(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}var U=function(e,t){var r=function(r){var n=r.children,o=F(r,["children"]);return t.reduce(function(t,r,a){if(!r)return t;r.behavior;var i=F(r,["behavior"]);return t.concat(w.createElement(_.a,H({},o,i,{key:e.displayName+"_"+a,component:e}),n))},[])};return r.displayName="Placeholder("+e.displayName+")",r},Q=function(e){return o()(O)(z,e)};var $=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};var Z=a(function(e){var t=e.areas,r=e.templates;return t.reduce(function(e,t){var n=D(t,r),o=1===n.length&&n.every(function(e){return!e.minWidth&&!e.maxWidth}),a=Q(t),i=function(e){return e.replace(/^./,function(e){return e.toUpperCase()})}(t);a.displayName=i;var u=o?a:U(a,n);return H({},e,function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},i,u))},{})},function(e){var t=Object.keys(e).reduce(function(t,r){var n=m(r),o=n.breakpoint,a=n.behavior,i=x(e[r]);return{areas:t.areas.concat(i),templates:t.templates.concat({breakpoint:s.getBreakpoint(o.name),behavior:a,areas:i})}},{areas:[],templates:[]}),r=t.areas,n=t.templates;return{areas:Array.from(new Set(r)),templates:n}},function(e){return Object.keys(e).filter(function(e){return"template"===m(e).purePropName}).reduce(function(t,r){return $({},t,function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},r,e[r]))},{})}),Y=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),G=function(e,t){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n ",";\n display: ",";\n"],["\n ",";\n display: ",";\n"]);var J=o.a.div(G,b,function(e){return e.inline?"inline-grid":"grid"}),K=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.areaComponents=Z(e),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,j.a.Component),Y(t,[{key:"render",value:function(){var e=this.areaComponents,t=Object.keys(e).length>0;return u(t,"Failed to render Composition: received no layout areas. Please check the values of template definitions."),j.a.createElement(J,this.props,t&&this.props.children(e))}}]),t}();r.d(t,"Box",function(){return O}),r.d(t,"Composition",function(){return K}),r.d(t,"default",function(){return s})}])}); |
{ | ||
"name": "atomic-layout", | ||
"version": "0.3.8", | ||
"version": "0.3.9", | ||
"description": "A single component to distribute a spacial relation in your layouts using CSS Grid.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
30633
0.07%