atomic-layout
Advanced tools
Comparing version 0.9.3 to 0.9.4
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("styled-components"))&&"object"==typeof e&&"default"in e?e.default:e,r=require("react");const n={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 o(e,t){if(!e)throw new Error(t)}function a(e,t){e||console.warn(t)}var i=new class{constructor(e){return this.defaultUnit=n.defaultUnit,this.defaultBehavior=n.defaultBehavior,this.breakpoints=n.breakpoints,this.defaultBreakpointName=n.defaultBreakpointName,this.isConfigureCalled=!1,e?this.configure(e,!1):this}configure(e,t=!0){return t&&a(!this.isConfigureCalled,"Failed to configure Layout: do not call `Layout.configure()` more than once. Layout configuration must remain consistent throughout the application."),o(e&&"object"==typeof e,`Failed to configure Layout: expected an options Object, but got: ${e}.`),Object.keys(e||{}).forEach(t=>{this[t]=e[t]}),o(this.breakpoints,"Failed to configure Layout: expected to have at least one breakpoint specified, but got none."),o(this.breakpoints.hasOwnProperty(this.defaultBreakpointName),`Failed to configure Layout: cannot use "${this.defaultBreakpointName}" as the default breakpoint (breakpoint not found).`),o(this.defaultBreakpointName,`Failed to configure Layout: expected "defaultBreakpointName" property set, but got: ${this.defaultBreakpointName}.`),this.isConfigureCalled=t,this}};function s(...e){return e.reduce((e,t)=>(...r)=>e(t(...r)))}function p(e){return null!=e}function u(e){if(!p(e))return"";return`${e}${"number"==typeof e&&0!==e?i.defaultUnit:""}`}const l=["/","auto"];function c(e){const t=/^[0-9]/.test(e),r=l.includes(e);return!t&&!r}const m=s(e=>{const t=[],r=[];return e.forEach(e=>{c(e)?t.push(e):r.push(e)}),[t.length>0?`'${t.join(" ")}'`:"",r.join(" ")].filter(Boolean).join(" ")},e=>e.split(" "),e=>e.replace(/'+/gm,""),e=>e.trim()),d=s(e=>e.join("\n"),e=>e.map(m),e=>e.split("\n"),e=>e.trim()),f={area:{props:["grid-area"]},areas:{props:["grid-template-areas"],transformValue:d},template:{props:["grid-template"],transformValue:d},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"]},gap:{props:["grid-gap"],transformValue:u},gapCol:{props:["grid-column-gap"],transformValue:u},gapRow:{props:["grid-row-gap"],transformValue:u},gutter:{props:["grid-gap"],transformValue:u},gutterCol:{props:["grid-column-gap"],transformValue:u},gutterRow:{props:["grid-row-gap"],transformValue:u},autoRows:{props:["grid-auto-rows"],transformValue:u},autoCols:{props:["grid-auto-columns"],transformValue:u},autoFlow:{props:["grid-auto-flow"]},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"]},flexDirection:{props:["flex-direction"]},flexShrink:{props:["flex-shrink"]},flexGrow:{props:["flex-grow"]},flexWrap:{props:["flex-wrap"]},height:{props:["height"],transformValue:u},minHeight:{props:["min-height"],transformValue:u},maxHeight:{props:["max-height"],transformValue:u},width:{props:["width"],transformValue:u},minWidth:{props:["min-width"],transformValue:u},maxWidth:{props:["max-width"],transformValue:u},margin:{props:["margin"],transformValue:u},marginTop:{props:["margin-top"],transformValue:u},marginRight:{props:["margin-right"],transformValue:u},marginBottom:{props:["margin-bottom"],transformValue:u},marginLeft:{props:["margin-left"],transformValue:u},marginVertical:{props:["margin-top","margin-bottom"],transformValue:u},marginHorizontal:{props:["margin-right","margin-left"],transformValue:u},padding:{props:["padding"],transformValue:u},paddingTop:{props:["padding-top"],transformValue:u},paddingRight:{props:["padding-right"],transformValue:u},paddingBottom:{props:["padding-bottom"],transformValue:u},paddingLeft:{props:["padding-left"],transformValue:u},paddingVertical:{props:["padding-top","padding-bottom"],transformValue:u},paddingHorizontal:{props:["padding-right","padding-left"],transformValue:u}};function g(e){return e.slice(0,1).toLowerCase()+e.slice(1,e.length)}function h(e){const t=Object.keys(i.breakpoints).join("|"),r=["down","only"].join("|"),n=new RegExp(`(${t})$`,"gi"),o=new RegExp(`(${r})$`,"gi"),a=e.match(o),s=a?a[0]:"",p=e.replace(s,"").match(n),u=p?p[0]:"",l=e.replace(u,"").replace(s,""),c=u?g(u):i.defaultBreakpointName,m=c===i.defaultBreakpointName;return{originPropName:e,purePropName:l,behavior:s?g(s):i.defaultBehavior,breakpoint:{name:c,isDefault:m}}}function b(e){return e.replace(/[A-Z]/g,e=>`-${e}`.toLowerCase())}function x(e){return Object.entries(e).filter(([e,t])=>p(t)).map(([e,t])=>[b(e),t])}const y=e=>t=>t.filter(([t])=>((e,t)=>{const[r,n]=e.split("-");return!["height","width"].includes(n)||"min"===r&&["up","only"].includes(t)||"max"===r&&["down","only"].includes(t)})(t,e)),k=e=>t=>t.map(e).join(" and ");function w(e,t){return s(k(([e,t])=>`(${e}:${String(u(t))})`),y(t),x)(e)}const j=(e,t,r,n)=>{const o=e.map(e=>`${e}:${String(t)};`).join(""),a=i.breakpoints[r.name];return a&&!(r.isDefault&&n===i.defaultBehavior)?`@media ${w(a,n)} {${o}}`:o};function v(e){return Object.keys(e).map(h).filter(({purePropName:e})=>f.hasOwnProperty(e)).filter(({originPropName:t})=>p(e[t])).map(({purePropName:t,originPropName:r,breakpoint:n,behavior:o})=>{const{props:a,transformValue:i}=f[t],s=e[r],p=i?i(s):s;return j(a,p,n,o)}).join(" ")}const V=t.div` | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("styled-components"))&&"object"==typeof e&&"default"in e?e.default:e,r=require("react");const n={defaultUnit:"px",defaultBehavior:"up",defaultBreakpointName:"xs",breakpoints:{xs:{maxWidth:"575px"},sm:{minWidth:"576px",maxWidth:"767px"},md:{minWidth:"768px",maxWidth:"991px"},lg:{minWidth:"992px",maxWidth:"1199px"},xl:{minWidth:"1200px"}}};function o(e,t){if(!e)throw new Error(t)}function a(e,t){e||console.warn(t)}var i=new class{constructor(e){return this.defaultUnit=n.defaultUnit,this.defaultBehavior=n.defaultBehavior,this.breakpoints=n.breakpoints,this.defaultBreakpointName=n.defaultBreakpointName,this.isConfigureCalled=!1,e?this.configure(e,!1):this}configure(e,t=!0){return t&&a(!this.isConfigureCalled,"Failed to configure Layout: do not call `Layout.configure()` more than once. Layout configuration must remain consistent throughout the application."),o(e&&"object"==typeof e,`Failed to configure Layout: expected an options Object, but got: ${e}.`),Object.keys(e||{}).forEach(t=>{this[t]=e[t]}),o(this.breakpoints,"Failed to configure Layout: expected to have at least one breakpoint specified, but got none."),o(this.breakpoints.hasOwnProperty(this.defaultBreakpointName),`Failed to configure Layout: cannot use "${this.defaultBreakpointName}" as the default breakpoint (breakpoint not found).`),o(this.defaultBreakpointName,`Failed to configure Layout: expected "defaultBreakpointName" property set, but got: ${this.defaultBreakpointName}.`),this.isConfigureCalled=t,this}};function s(...e){return e.reduce((e,t)=>(...r)=>e(t(...r)))}function p(e){return null!=e}function u(e){if(!p(e))return"";return`${e}${"number"==typeof e&&0!==e?i.defaultUnit:""}`}const l=["/","auto"];function c(e){const t=/^[0-9]/.test(e),r=l.includes(e);return!t&&!r}const m=s(e=>{const t=[],r=[];return e.forEach(e=>{c(e)?t.push(e):r.push(e)}),[t.length>0?`'${t.join(" ")}'`:"",r.join(" ")].filter(Boolean).join(" ")},e=>e.split(" "),e=>e.replace(/'+/gm,""),e=>e.trim()),d=s(e=>e.join("\n"),e=>e.map(m),e=>e.split("\n"),e=>e.trim()),f={area:{props:["grid-area"]},areas:{props:["grid-template-areas"],transformValue:d},template:{props:["grid-template"],transformValue:d},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"]},gap:{props:["grid-gap"],transformValue:u},gapCol:{props:["grid-column-gap"],transformValue:u},gapRow:{props:["grid-row-gap"],transformValue:u},gutter:{props:["grid-gap"],transformValue:u},gutterCol:{props:["grid-column-gap"],transformValue:u},gutterRow:{props:["grid-row-gap"],transformValue:u},autoRows:{props:["grid-auto-rows"],transformValue:u},autoCols:{props:["grid-auto-columns"],transformValue:u},autoFlow:{props:["grid-auto-flow"]},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"]},flexDirection:{props:["flex-direction"]},flexShrink:{props:["flex-shrink"]},flexGrow:{props:["flex-grow"]},flexWrap:{props:["flex-wrap"]},height:{props:["height"],transformValue:u},minHeight:{props:["min-height"],transformValue:u},maxHeight:{props:["max-height"],transformValue:u},width:{props:["width"],transformValue:u},minWidth:{props:["min-width"],transformValue:u},maxWidth:{props:["max-width"],transformValue:u},margin:{props:["margin"],transformValue:u},marginTop:{props:["margin-top"],transformValue:u},marginRight:{props:["margin-right"],transformValue:u},marginBottom:{props:["margin-bottom"],transformValue:u},marginLeft:{props:["margin-left"],transformValue:u},marginVertical:{props:["margin-top","margin-bottom"],transformValue:u},marginHorizontal:{props:["margin-right","margin-left"],transformValue:u},padding:{props:["padding"],transformValue:u},paddingTop:{props:["padding-top"],transformValue:u},paddingRight:{props:["padding-right"],transformValue:u},paddingBottom:{props:["padding-bottom"],transformValue:u},paddingLeft:{props:["padding-left"],transformValue:u},paddingVertical:{props:["padding-top","padding-bottom"],transformValue:u},paddingHorizontal:{props:["padding-right","padding-left"],transformValue:u}};function g(e){return e.slice(0,1).toLowerCase()+e.slice(1,e.length)}function h(e){const t=Object.keys(i.breakpoints).join("|"),r=["down","only"].join("|"),n=new RegExp(`(${t})$`,"gi"),o=new RegExp(`(${r})$`,"gi"),a=e.match(o),s=a?a[0]:"",p=e.replace(s,"").match(n),u=p?p[0]:"",l=e.replace(u,"").replace(s,""),c=u?g(u):i.defaultBreakpointName,m=c===i.defaultBreakpointName;return{originPropName:e,purePropName:l,behavior:s?g(s):i.defaultBehavior,breakpoint:{name:c,isDefault:m}}}function b(e){return e.replace(/[A-Z]/g,e=>`-${e}`.toLowerCase())}function x(e){return Object.entries(e).filter(([e,t])=>p(t)).map(([e,t])=>[b(e),t])}const y=e=>t=>t.filter(([t])=>((e,t)=>{const[r,n]=e.split("-");return!["height","width"].includes(n)||"min"===r&&["up","only"].includes(t)||"max"===r&&["down","only"].includes(t)})(t,e)),k=e=>t=>t.map(e).join(" and ");function w(e,t){return s(k(([e,t])=>`(${e}:${String(u(t))})`),y(t),x)(e)}const j=(e,t,r,n)=>{const o=e.map(e=>`${e}:${String(t)};`).join(""),a=i.breakpoints[r.name];return a&&!(r.isDefault&&n===i.defaultBehavior)?`@media ${w(a,n)} {${o}}`:o};function v(e){return Object.keys(e).map(h).filter(({purePropName:e})=>f.hasOwnProperty(e)).filter(({originPropName:t})=>p(e[t])).map(({purePropName:t,originPropName:r,breakpoint:n,behavior:o})=>{const{props:a,transformValue:i}=f[t],s=e[r],p=i?i(s):s;return j(a,p,n,o)}).join(" ")}const V=t.div` | ||
display: ${({flex:e,inline:t})=>e?t?"inline-flex":"flex":t?"inline-block":"block"}; | ||
@@ -3,0 +3,0 @@ |
@@ -14,10 +14,10 @@ import styled from 'styled-components'; | ||
minWidth: '576px', | ||
maxWidth: '768px', | ||
maxWidth: '767px', | ||
}, | ||
md: { | ||
minWidth: '769px', | ||
maxWidth: '992px', | ||
minWidth: '768px', | ||
maxWidth: '991px', | ||
}, | ||
lg: { | ||
minWidth: '993px', | ||
minWidth: '992px', | ||
maxWidth: '1199px', | ||
@@ -24,0 +24,0 @@ }, |
{ | ||
"name": "atomic-layout", | ||
"version": "0.9.3", | ||
"version": "0.9.4", | ||
"description": "Physical representation of layout composition to create declarative, responsive layouts in React.", | ||
@@ -5,0 +5,0 @@ "esnext": "src/index.ts", |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("styled-components"),require("react")):"function"==typeof define&&define.amd?define(["exports","styled-components","react"],t):t((e=e||self).AtomicLayout={},e.styled,e.React)}(this,function(e,t,r){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;const n={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 o(e,t){if(!e)throw new Error(t)}function a(e,t){e||console.warn(t)}var i=new class{constructor(e){return this.defaultUnit=n.defaultUnit,this.defaultBehavior=n.defaultBehavior,this.breakpoints=n.breakpoints,this.defaultBreakpointName=n.defaultBreakpointName,this.isConfigureCalled=!1,e?this.configure(e,!1):this}configure(e,t=!0){return t&&a(!this.isConfigureCalled,"Failed to configure Layout: do not call `Layout.configure()` more than once. Layout configuration must remain consistent throughout the application."),o(e&&"object"==typeof e,`Failed to configure Layout: expected an options Object, but got: ${e}.`),Object.keys(e||{}).forEach(t=>{this[t]=e[t]}),o(this.breakpoints,"Failed to configure Layout: expected to have at least one breakpoint specified, but got none."),o(this.breakpoints.hasOwnProperty(this.defaultBreakpointName),`Failed to configure Layout: cannot use "${this.defaultBreakpointName}" as the default breakpoint (breakpoint not found).`),o(this.defaultBreakpointName,`Failed to configure Layout: expected "defaultBreakpointName" property set, but got: ${this.defaultBreakpointName}.`),this.isConfigureCalled=t,this}};function s(...e){return e.reduce((e,t)=>(...r)=>e(t(...r)))}function p(e){return null!=e}function u(e){if(!p(e))return"";return`${e}${"number"==typeof e&&0!==e?i.defaultUnit:""}`}const l=["/","auto"];function c(e){const t=/^[0-9]/.test(e),r=l.includes(e);return!t&&!r}const d=s(e=>{const t=[],r=[];return e.forEach(e=>{c(e)?t.push(e):r.push(e)}),[t.length>0?`'${t.join(" ")}'`:"",r.join(" ")].filter(Boolean).join(" ")},e=>e.split(" "),e=>e.replace(/'+/gm,""),e=>e.trim()),m=s(e=>e.join("\n"),e=>e.map(d),e=>e.split("\n"),e=>e.trim()),f={area:{props:["grid-area"]},areas:{props:["grid-template-areas"],transformValue:m},template:{props:["grid-template"],transformValue:m},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"]},gap:{props:["grid-gap"],transformValue:u},gapCol:{props:["grid-column-gap"],transformValue:u},gapRow:{props:["grid-row-gap"],transformValue:u},gutter:{props:["grid-gap"],transformValue:u},gutterCol:{props:["grid-column-gap"],transformValue:u},gutterRow:{props:["grid-row-gap"],transformValue:u},autoRows:{props:["grid-auto-rows"],transformValue:u},autoCols:{props:["grid-auto-columns"],transformValue:u},autoFlow:{props:["grid-auto-flow"]},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"]},flexDirection:{props:["flex-direction"]},flexShrink:{props:["flex-shrink"]},flexGrow:{props:["flex-grow"]},flexWrap:{props:["flex-wrap"]},height:{props:["height"],transformValue:u},minHeight:{props:["min-height"],transformValue:u},maxHeight:{props:["max-height"],transformValue:u},width:{props:["width"],transformValue:u},minWidth:{props:["min-width"],transformValue:u},maxWidth:{props:["max-width"],transformValue:u},margin:{props:["margin"],transformValue:u},marginTop:{props:["margin-top"],transformValue:u},marginRight:{props:["margin-right"],transformValue:u},marginBottom:{props:["margin-bottom"],transformValue:u},marginLeft:{props:["margin-left"],transformValue:u},marginVertical:{props:["margin-top","margin-bottom"],transformValue:u},marginHorizontal:{props:["margin-right","margin-left"],transformValue:u},padding:{props:["padding"],transformValue:u},paddingTop:{props:["padding-top"],transformValue:u},paddingRight:{props:["padding-right"],transformValue:u},paddingBottom:{props:["padding-bottom"],transformValue:u},paddingLeft:{props:["padding-left"],transformValue:u},paddingVertical:{props:["padding-top","padding-bottom"],transformValue:u},paddingHorizontal:{props:["padding-right","padding-left"],transformValue:u}};function g(e){return e.slice(0,1).toLowerCase()+e.slice(1,e.length)}function h(e){const t=Object.keys(i.breakpoints).join("|"),r=["down","only"].join("|"),n=new RegExp(`(${t})$`,"gi"),o=new RegExp(`(${r})$`,"gi"),a=e.match(o),s=a?a[0]:"",p=e.replace(s,"").match(n),u=p?p[0]:"",l=e.replace(u,"").replace(s,""),c=u?g(u):i.defaultBreakpointName,d=c===i.defaultBreakpointName;return{originPropName:e,purePropName:l,behavior:s?g(s):i.defaultBehavior,breakpoint:{name:c,isDefault:d}}}function b(e){return e.replace(/[A-Z]/g,e=>`-${e}`.toLowerCase())}function y(e){return Object.entries(e).filter(([e,t])=>p(t)).map(([e,t])=>[b(e),t])}const k=e=>t=>t.filter(([t])=>((e,t)=>{const[r,n]=e.split("-");return!["height","width"].includes(n)||"min"===r&&["up","only"].includes(t)||"max"===r&&["down","only"].includes(t)})(t,e)),x=e=>t=>t.map(e).join(" and ");function w(e,t){return s(x(([e,t])=>`(${e}:${String(u(t))})`),k(t),y)(e)}const j=(e,t,r,n)=>{const o=e.map(e=>`${e}:${String(t)};`).join(""),a=i.breakpoints[r.name];return a&&!(r.isDefault&&n===i.defaultBehavior)?`@media ${w(a,n)} {${o}}`:o};function v(e){return Object.keys(e).map(h).filter(({purePropName:e})=>f.hasOwnProperty(e)).filter(({originPropName:t})=>p(e[t])).map(({purePropName:t,originPropName:r,breakpoint:n,behavior:o})=>{const{props:a,transformValue:i}=f[t],s=e[r],p=i?i(s):s;return j(a,p,n,o)}).join(" ")}const V=t.div` | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("styled-components"),require("react")):"function"==typeof define&&define.amd?define(["exports","styled-components","react"],t):t((e=e||self).AtomicLayout={},e.styled,e.React)}(this,function(e,t,r){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;const n={defaultUnit:"px",defaultBehavior:"up",defaultBreakpointName:"xs",breakpoints:{xs:{maxWidth:"575px"},sm:{minWidth:"576px",maxWidth:"767px"},md:{minWidth:"768px",maxWidth:"991px"},lg:{minWidth:"992px",maxWidth:"1199px"},xl:{minWidth:"1200px"}}};function o(e,t){if(!e)throw new Error(t)}function a(e,t){e||console.warn(t)}var i=new class{constructor(e){return this.defaultUnit=n.defaultUnit,this.defaultBehavior=n.defaultBehavior,this.breakpoints=n.breakpoints,this.defaultBreakpointName=n.defaultBreakpointName,this.isConfigureCalled=!1,e?this.configure(e,!1):this}configure(e,t=!0){return t&&a(!this.isConfigureCalled,"Failed to configure Layout: do not call `Layout.configure()` more than once. Layout configuration must remain consistent throughout the application."),o(e&&"object"==typeof e,`Failed to configure Layout: expected an options Object, but got: ${e}.`),Object.keys(e||{}).forEach(t=>{this[t]=e[t]}),o(this.breakpoints,"Failed to configure Layout: expected to have at least one breakpoint specified, but got none."),o(this.breakpoints.hasOwnProperty(this.defaultBreakpointName),`Failed to configure Layout: cannot use "${this.defaultBreakpointName}" as the default breakpoint (breakpoint not found).`),o(this.defaultBreakpointName,`Failed to configure Layout: expected "defaultBreakpointName" property set, but got: ${this.defaultBreakpointName}.`),this.isConfigureCalled=t,this}};function s(...e){return e.reduce((e,t)=>(...r)=>e(t(...r)))}function p(e){return null!=e}function u(e){if(!p(e))return"";return`${e}${"number"==typeof e&&0!==e?i.defaultUnit:""}`}const l=["/","auto"];function c(e){const t=/^[0-9]/.test(e),r=l.includes(e);return!t&&!r}const d=s(e=>{const t=[],r=[];return e.forEach(e=>{c(e)?t.push(e):r.push(e)}),[t.length>0?`'${t.join(" ")}'`:"",r.join(" ")].filter(Boolean).join(" ")},e=>e.split(" "),e=>e.replace(/'+/gm,""),e=>e.trim()),m=s(e=>e.join("\n"),e=>e.map(d),e=>e.split("\n"),e=>e.trim()),f={area:{props:["grid-area"]},areas:{props:["grid-template-areas"],transformValue:m},template:{props:["grid-template"],transformValue:m},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"]},gap:{props:["grid-gap"],transformValue:u},gapCol:{props:["grid-column-gap"],transformValue:u},gapRow:{props:["grid-row-gap"],transformValue:u},gutter:{props:["grid-gap"],transformValue:u},gutterCol:{props:["grid-column-gap"],transformValue:u},gutterRow:{props:["grid-row-gap"],transformValue:u},autoRows:{props:["grid-auto-rows"],transformValue:u},autoCols:{props:["grid-auto-columns"],transformValue:u},autoFlow:{props:["grid-auto-flow"]},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"]},flexDirection:{props:["flex-direction"]},flexShrink:{props:["flex-shrink"]},flexGrow:{props:["flex-grow"]},flexWrap:{props:["flex-wrap"]},height:{props:["height"],transformValue:u},minHeight:{props:["min-height"],transformValue:u},maxHeight:{props:["max-height"],transformValue:u},width:{props:["width"],transformValue:u},minWidth:{props:["min-width"],transformValue:u},maxWidth:{props:["max-width"],transformValue:u},margin:{props:["margin"],transformValue:u},marginTop:{props:["margin-top"],transformValue:u},marginRight:{props:["margin-right"],transformValue:u},marginBottom:{props:["margin-bottom"],transformValue:u},marginLeft:{props:["margin-left"],transformValue:u},marginVertical:{props:["margin-top","margin-bottom"],transformValue:u},marginHorizontal:{props:["margin-right","margin-left"],transformValue:u},padding:{props:["padding"],transformValue:u},paddingTop:{props:["padding-top"],transformValue:u},paddingRight:{props:["padding-right"],transformValue:u},paddingBottom:{props:["padding-bottom"],transformValue:u},paddingLeft:{props:["padding-left"],transformValue:u},paddingVertical:{props:["padding-top","padding-bottom"],transformValue:u},paddingHorizontal:{props:["padding-right","padding-left"],transformValue:u}};function g(e){return e.slice(0,1).toLowerCase()+e.slice(1,e.length)}function h(e){const t=Object.keys(i.breakpoints).join("|"),r=["down","only"].join("|"),n=new RegExp(`(${t})$`,"gi"),o=new RegExp(`(${r})$`,"gi"),a=e.match(o),s=a?a[0]:"",p=e.replace(s,"").match(n),u=p?p[0]:"",l=e.replace(u,"").replace(s,""),c=u?g(u):i.defaultBreakpointName,d=c===i.defaultBreakpointName;return{originPropName:e,purePropName:l,behavior:s?g(s):i.defaultBehavior,breakpoint:{name:c,isDefault:d}}}function b(e){return e.replace(/[A-Z]/g,e=>`-${e}`.toLowerCase())}function y(e){return Object.entries(e).filter(([e,t])=>p(t)).map(([e,t])=>[b(e),t])}const k=e=>t=>t.filter(([t])=>((e,t)=>{const[r,n]=e.split("-");return!["height","width"].includes(n)||"min"===r&&["up","only"].includes(t)||"max"===r&&["down","only"].includes(t)})(t,e)),x=e=>t=>t.map(e).join(" and ");function w(e,t){return s(x(([e,t])=>`(${e}:${String(u(t))})`),k(t),y)(e)}const j=(e,t,r,n)=>{const o=e.map(e=>`${e}:${String(t)};`).join(""),a=i.breakpoints[r.name];return a&&!(r.isDefault&&n===i.defaultBehavior)?`@media ${w(a,n)} {${o}}`:o};function v(e){return Object.keys(e).map(h).filter(({purePropName:e})=>f.hasOwnProperty(e)).filter(({originPropName:t})=>p(e[t])).map(({purePropName:t,originPropName:r,breakpoint:n,behavior:o})=>{const{props:a,transformValue:i}=f[t],s=e[r],p=i?i(s):s;return j(a,p,n,o)}).join(" ")}const V=t.div` | ||
display: ${({flex:e,inline:t})=>e?t?"inline-flex":"flex":t?"inline-block":"block"}; | ||
@@ -3,0 +3,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package