@lanaco/lnc-react-ui
Version:
React component library
13 lines (12 loc) • 1.25 kB
JavaScript
;const G=require("react/jsx-runtime"),p=require("react"),C=require("./emotion-styled.browser.esm-DwHBgTPn.cjs"),I=C.styled.div`
display: ${e=>e.inline?"inline-grid":"grid"};
row-gap: ${e=>e.rowGap?e.rowGap:e.gap?e.gap:0};
column-gap: ${e=>e.columnGap?e.columnGap:e.gap?e.gap:0};
${e=>e.gridTemplate&&`grid-template: ${e.gridTemplate};`}
${e=>e.templateRows&&`grid-template-rows: ${e.templateRows};`}
${e=>e.templateColumns&&`grid-template-columns: ${e.templateColumns};`}
${e=>e.justifyItems&&`justify-items: ${e.justifyItems};`}
${e=>e.alignItems&&`align-items: ${e.alignItems};`}
${e=>e.justifyContent&&`justify-content: ${e.justifyContent};`}
${e=>e.templateAreas&&`grid-template-areas: ${e.templateAreas};`}
`,t=p.forwardRef((e,a)=>{const{inline:l=!1,template:i,templateColumns:s,templateRows:n,gap:m,rowGap:r,columnGap:u,justifyItems:g,alignItems:o,justifyContent:d,templateAreas:c,children:$,className:y="",style:f={},...j}=e;var w={inline:l,template:i,templateColumns:s,templateRows:n,gap:m,rowGap:r,columnGap:u,justifyItems:g,alignItems:o,justifyContent:d,templateAreas:c};return G.jsx(I,{ref:a,...w,className:y,style:f,...j,children:$})});t.defaultProps={inline:!1,style:{},className:""};module.exports=t;