carbon-react
Version:
A library of reusable React components for easily building user interfaces.
2 lines (1 loc) • 2.68 kB
JavaScript
import o,{css as r}from"styled-components";import{space as t,layout as e,flexbox as i,grid as n,position as l}from"styled-system";import s from"../../style/utils/box-gap.js";import c from"../../style/utils/color.js";import a from"./box.config.js";import p from"../../style/themes/apply-base-theme.js";function u(o,r,t){return r in o?Object.defineProperty(o,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[r]=t,o}function b(o){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},e=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(t).filter((function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})))),e.forEach((function(r){u(o,r,t[r])}))}return o}function d(o,r){if(null==o)return{};var t,e,i=function(o,r){if(null==o)return{};var t,e,i={},n=Object.keys(o);for(e=0;e<n.length;e++)t=n[e],r.indexOf(t)>=0||(i[t]=o[t]);return i}(o,r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);for(e=0;e<n.length;e++)t=n[e],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(o,t)&&(i[t]=o[t])}return i}const f=o.div.attrs(p).withConfig({displayName:"box.style__StyledBox",componentId:"sc-fcf46366-0"})([""," "," "," "," "," "," "," "," "," "," "," "," "," ",";"," ",""],t,e,i,n,(o=>{const r=l(o),{position:t}=r,e=d(r,["position"]);return b({position:t,zIndex:["sticky","fixed"].includes(t)?3:void 0},e)}),(({$borderRadius:o="borderRadius000"})=>{const t=o.split(" ");return r(["border-radius:",";"],t.map((o=>`var(--${o})`)).join(" "))}),(o=>{var{cssProps:r,bg:t,backgroundColor:e}=o,i=d(o,["cssProps","bg","backgroundColor"]);return c(b({color:null==r?void 0:r.color,bg:t,backgroundColor:e},i))}),(({cssProps:o})=>r(["opacity:",";"],null==o?void 0:o.opacity)),(({overflowWrap:o})=>o&&r(["overflow-wrap:",";"],o)),(({cssProps:o,size:t})=>(null==o?void 0:o.height)&&!t&&r(["height:",";"],null==o?void 0:o.height)),(({cssProps:o,size:t})=>(null==o?void 0:o.width)&&!t&&r(["width:",";"],null==o?void 0:o.width)),(({scrollVariant:o})=>o&&r(["scrollbar-color:"," ",";&::-webkit-scrollbar{width:8px;}&::-webkit-scrollbar-track{background-color:",";}&::-webkit-scrollbar-thumb{background-color:",";}"],a[o].thumb,a[o].track,a[o].track,a[o].thumb)),(({boxSizing:o})=>o&&r(["box-sizing:",";"],o)),(({display:o,gap:t,columnGap:e,rowGap:i})=>("flex"===o||"inline-flex"===o||"grid"===o||"inline-grid"===o)&&r([""," "," ",""],void 0!==t&&r(["gap:",";"],s(t)),void 0!==e&&r(["column-gap:",";"],s(e)),void 0!==i&&r(["row-gap:",";"],s(i)))),(({boxShadow:o})=>o&&r(["box-shadow:var(--",");"],o)),(({display:o,hidden:t})=>r(["display:",";"],t?"none":o)));export{f as default};