UNPKG

@volvo-cars/css

Version:
2 lines 3.1 kB
var p=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var y=(r,e)=>{for(var t in e)p(r,t,{get:e[t],enumerable:!0})},$=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of w(e))!m.call(r,s)&&s!==t&&p(r,s,{get:()=>e[s],enumerable:!(o=x(e,s))||o.enumerable});return r};var h=r=>$(p({},"__esModule",{value:!0}),r);var k={};y(k,{clsx:()=>E,cssJoin:()=>i,cssMerge:()=>b});module.exports=h(k);function u(r){let e,t,o="";if(typeof r=="string"||typeof r=="number")o+=r;else if(Array.isArray(r))for(e=0;e<r.length;e++)r[e]&&(t=u(r[e]))&&(o&&(o+=" "),o+=t);return o}function i(...r){let e=0,t,o,s="";for(;e<r.length;)(t=r[e++])&&(o=u(t))&&(s&&(s+=" "),s+=o);return s}var C=/\s+/,f=new Map([...["scale","stack","top","end","bottom","start"].map(r=>[r,new RegExp(`^${r}-[\\w\\d\\/]+$`)]),...["h","w","grid-cols","border","border-ring","border-x","border-y","border-r","border-l","border-t","border-b"].map(r=>[r,new RegExp(`^${r}(-\\d+)?$`)]),...["rounded","rounded-t","rounded-e","rounded-b","rounded-s"].map(r=>[r,new RegExp(`^${r}(-\\w+)?$`)]),...["button","contain","container","items","justify","link","overflow-x","overflow-y","overflow","self","transition"].map(r=>[r,new RegExp(`^${r}-\\w+$`)]),...["bg","whitespace"].map(r=>[r,new RegExp(`^${r}-[\\w-]+$`)]),...["p","pt","pr","pb","pl","px","py","m","mt","mr","mb","ml","mx","my","gap","gap-y","gap-x","translate-x","translate-y"].map(r=>[r,new RegExp(`^-?${r}-[\\w\\d\\/]+$`)]),["border-color",/^border-(?!(ring|[tlrb]))[\w-]{2,}$/],["flex",/^flex(-col|-row)(-reverse)?$/],["snap-align",/^snap-(start|center|end)$/],["snap-dir",/^snap-[xy]$/],["flex-wrap",/^flex-(no)?wrap$/],["display-outer",/^(inline|block|hidden)$/],["display-inner",/^(flex|grid|flow-root)$/],["grow",/^flex-grow(-\\d)?$/],["shrink",/^flex-shrink(-\\d)?$/],["weight",/^font-(light|medium)$/],["size",/^((heading|title|body|statement)-[\w\d]+|micro|font-\d+)$/],["text-color",/^text-(?!start|center|end|balance)[\w-]+$/],["aspect",/^aspect-\d+\/\d+/],["position",/^(absolute|fixed|relative|static|sticky)$/],["text-align",/^text-(start|center|end)$/]]),v=new Map([["p",["px","py","pt","pr","pb","pl"]],["px",["pr","pl"]],["py",["pt","pb"]],["m",["mx","my","mt","mr","mb","ml"]],["mx",["mr","ml"]],["my",["mt","mb"]],["gap",["gap-x","gap-y"]],["border",["border-x","border-y","border-t","border-r","border-b","border-l"]],["border-x",["border-l","border-r"]],["border-y",["border-t","border-b"]],["rounded",["rounded-t","rounded-e","rounded-b","rounded-s"]],["overflow",["overflow-x","overflow-y"]]]);function b(...r){let e=new Set,t=new Map,o=new Set(i(r).split(C).reverse());r:for(let s of o){let[n,c]=g(s);for(let[a,d]of t){let[l]=g(a);if(l===n&&d.test(c))continue r}for(let[a,d]of f)if(d.test(c)){t.set(n?`${n}:${a}`:a,d);for(let l of v.get(a)??[])t.set(n?`${n}:${l}`:l,f.get(l))}e.add(s)}return[...e].reverse().join(" ")}function g(r){let e=r.split(":");return e.length===1?["",e[0]]:e}var E=i;0&&(module.exports={clsx,cssJoin,cssMerge}); //# sourceMappingURL=utils.cjs.map