effcss 3.5.0 → 3.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build/define-provider.min.js +2 -2
- package/dist/consumer.js +1 -1
- package/dist/index.js +2 -2
- package/dist/types/src/_provider/_process/base.d.ts +0 -1
- package/dist/types/src/_provider/_process/coef.d.ts +2 -127
- package/dist/types/src/_provider/_process/palette.d.ts +2 -116
- package/dist/types/src/_provider/_process/utils.d.ts +1 -1
- package/dist/types/src/_provider/process.d.ts +5 -1
- package/dist/types/src/common.d.ts +226 -26
- package/dist/types/src/index.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* EffCSS v3.5.
|
|
2
|
+
* EffCSS v3.5.2
|
|
3
3
|
* {@link https://gitverse.ru/msabitov/effcss}
|
|
4
4
|
* Copyright (c) Marat Sabitov
|
|
5
5
|
* @license Apache-2.0
|
|
6
6
|
*/
|
|
7
|
-
"function"==typeof SuppressedError&&SuppressedError;const t="@media",e="@container",s="@property",r="@keyframes",n="@layer",i="@scope",a="@supports",l=(e,s)=>{const r=t+` ${s||""}${s?" and ":""}(${e})`;return{s:r,q:e,t:s,toString:()=>r}};l.toString=()=>t;const c=t=>t+"px",h=t=>t+"vh",o=t=>t+"vw",g=t=>t+"vmin",u=t=>t+"vmax",d=t=>t+"rem",m=t=>t+"deg",p=t=>t+"ms",b=t=>t+"%",f=t=>t+"cqw",v=t=>t+"cqh",x=t=>t+"cqi",$=t=>t+"cqb",y=t=>t+"cqmin",j=t=>t+"cqmax",O=Object.fromEntries,_=Object.entries,k=":first-",w=":last-",S=":only-",q="child",A=":nth-",E="of-type",P=A+q,z=":focus",C={r:":root",h:":hover",f:z,fv:z+"-visible",a:":active",v:":visited",val:":valid",inv:":invalid",e:":empty",d:":disabled",rq:":required",o:":optional",m:":modal",l:":link",ph:":placeholder",ch:":checked",po:":popover-open",fc:k+q,lc:w+q,oc:S+q,odd:P+"(odd)",even:P+"(even)",ft:k+E,lt:w+E,ot:S+E,bef:"::before",aft:"::after",bd:"::backdrop"},N={has:":has",not:":not",is:":is",wh:":where",st:":state",nthc:P,ntho:A+E,dir:":dir",lang:":lang"},I="oklch",W=t=>I+`(${t})`,F=t=>W(`from ${t}`),K="def",M=t=>{const e=(e,s)=>"string"==typeof s?t(e,s):s;class s{constructor(t={}){this.state={l:e("l",K),c:e("c",K),h:e("h",K),a:e("a",K)},this.merge=t=>new s(Object.assign(this.state,t)),this.l=t=>this.merge({l:e("l",t)}),this.c=t=>this.merge({c:e("c",t)}),this.h=t=>this.merge({h:e("h",t)}),this.a=t=>this.merge({a:e("a",t)}),this.state=Object.assign(this.state,t)}get s(){return this.toString()}toString(){const{l:t,c:e,h:s,a:r}=this.state;return W(`${t} ${e} ${s} / ${r}`)}}return t=>new s(t)},B=(t,e=.1)=>F(`${t} calc(l + ${e}) c h / alpha)`),L=(t,e=.1)=>F(`${t} calc(l - ${e}) c h / alpha)`),R=(t,e=.1)=>F(`${t} l c h / calc(alpha + ${e}))`),H=(t,e=.1)=>F(`${t} l c h / calc(alpha - ${e}))`),T=(t,e=.04)=>F(`${t} l calc(c + ${e}) h / alpha)`),V=(t,e=.04)=>F(`${t} l calc(c - ${e}) h / alpha)`),Z=(t,e=30)=>F(`${t} l c calc(h${"number"==typeof e?e>0?" + "+e:" - "+-e:e}) / alpha)`),D=({base:t,mixin:e,method:s,bpart:r,mpart:n})=>`color-mix(in ${s||I}, ${t}${void 0!==r?` ${r}%`:""}, ${e}${void 0!==n?` ${n}%`:""})`,G=t=>({create:M(t),oklch:W,lighten:B,darken:L,saturate:T,desaturate:V,fadein:R,fadeout:H,spin:Z,mix:D}),J=(t,e,s)=>Object.entries(t).reduce(e,s),Q=Symbol("noParse"),U=(t,e,s)=>{var r,n,i;let a=""+t;return null==e?"":"object"!=typeof e||e.hasOwnProperty(Q)?`${l=a,l.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}:${""+e};`:(!s||(null===(r=s.startsWith)||void 0===r?void 0:r.call(s,"@"))||(null===(n=a.startsWith)||void 0===n?void 0:n.call(a,"&"))||(null===(i=a.startsWith)||void 0===i?void 0:i.call(a,"@"))?"":"&")+a+`{${J(e,((t,e)=>t+U(...e,a)),"")}}`;var l},X="palette",Y=t=>{const e={pri:t(X,"h","pri"),sec:t(X,"h","sec"),ter:t(X,"h","ter"),suc:t(X,"h","suc"),inf:t(X,"h","inf"),war:t(X,"h","war"),dan:t(X,"h","dan")};class s{constructor(t={}){this.state={l:"l",c:"base",h:e.pri,a:1,m:"bg"},Object.assign(this,{[Q]:!0}),this.state=Object.assign(this.state,t)}get xs(){return new s(Object.assign(Object.assign({},this.state),{l:"xs"}))}get s(){return new s(Object.assign(Object.assign({},this.state),{l:"s"}))}get m(){return new s(Object.assign(Object.assign({},this.state),{l:"m"}))}get l(){return new s(Object.assign(Object.assign({},this.state),{l:"l"}))}get xl(){return new s(Object.assign(Object.assign({},this.state),{l:"xl"}))}get lightness(){return{xs:this.xs,s:this.s,m:this.m,l:this.l,xl:this.xl}}get gray(){return new s(Object.assign(Object.assign({},this.state),{c:"gray"}))}get pale(){return new s(Object.assign(Object.assign({},this.state),{c:"pale"}))}get base(){return new s(Object.assign(Object.assign({},this.state),{c:"base"}))}get rich(){return new s(Object.assign(Object.assign({},this.state),{c:"rich"}))}get chroma(){return{gray:this.gray,pale:this.pale,base:this.base,rich:this.rich}}get pri(){return new s(Object.assign(Object.assign({},this.state),{h:e.pri}))}get sec(){return new s(Object.assign(Object.assign({},this.state),{h:e.sec}))}get suc(){return new s(Object.assign(Object.assign({},this.state),{h:e.suc}))}get inf(){return new s(Object.assign(Object.assign({},this.state),{h:e.inf}))}get war(){return new s(Object.assign(Object.assign({},this.state),{h:e.war}))}get dan(){return new s(Object.assign(Object.assign({},this.state),{h:e.dan}))}get hue(){return{pri:this.pri,sec:this.sec,suc:this.suc,inf:this.inf,war:this.war,dan:this.dan}}alpha(t=1){return new s(Object.assign(Object.assign({},this.state),{a:t}))}get bg(){return new s(Object.assign(Object.assign({},this.state),{m:"bg"}))}get fg(){return new s(Object.assign(Object.assign({},this.state),{m:"fg"}))}toString(){const{l:e,c:s,h:r,a:n,m:i}=this.state;return`oklch(${t(X,"l",i,e)} ${t(X,"c",i,s)} ${r} / ${n})`}}return new s},tt="coef",et=t=>{class e{constructor(t={}){this.state={center:8},this.state=Object.assign(this.state,t)}get min(){return t(tt,this.state.center-4)}get xxs(){return t(tt,this.state.center-3)}get xs(){return t(tt,this.state.center-2)}get s(){return t(tt,this.state.center-1)}get m(){return t(tt,this.state.center)}get l(){return t(tt,this.state.center+1)}get xl(){return t(tt,this.state.center+2)}get xxl(){return t(tt,this.state.center+3)}get max(){return t(tt,this.state.center+4)}get $0_(){return new e({center:4})}get $1_(){return new e({center:12})}get $2_(){return new e({center:20})}get $16_(){return new e({center:28})}get $1(){return new e({center:8})}get $2(){return new e({center:16})}get $16(){return new e({center:24})}get short(){return{s:this.s,m:this.m,l:this.l}}get base(){return Object.assign(Object.assign({xs:this.xs},this.short),{xl:this.xl})}get long(){return Object.assign(Object.assign({xxs:this.xxs},this.base),{xxl:this.xxl})}get full(){return Object.assign(Object.assign({min:this.min},this.long),{max:this.max})}get sparse(){return{min:this.min,xs:this.xs,m:this.m,xl:this.xl,max:this.max}}}return new e},st=Object.assign,rt=Object.entries,nt=Array.isArray,it=(t,...e)=>e.length?e.reduce(((t,e)=>(rt(e).forEach((([e,s])=>{s&&"object"==typeof s&&t[e]?nt(t[e])&&nt(s)?t[e]=[...t[e],...s]:it(t[e],s||{}):t[e]=s})),t)),t):t,at={dash:(...t)=>t.join("-"),comma:(...t)=>t.join(),space:(...t)=>t.join(" "),range:(t,e)=>Array.from(Array(t).entries()).reduce(((t,[s])=>st(t,e(s+1))),{}),each:(t,e)=>rt(t).reduce(((t,[s,r])=>st(t,e(s,r))),{}),merge:it,when:(t,e,s={})=>t?e:s},lt="width: ",ct=t=>{const{scope:k,globalKey:w="",bp:S={}}=t,q=k(w).varExp,A=t=>q(...t.split(".")),E=(t=1)=>`calc(${t} * ${A("rtime")})`,P=(t=1)=>`calc(${t} * ${A("rangle")})`,z=(t=1)=>`calc(${t} * 1rem)`;return{compile:({key:t,maker:w})=>{const I=k(t),W=(t=>{const c={cp:1,lay:1,kf:1,cq:1},h=(s,r)=>{const n="string"==typeof r?r:t.name("cq",c.cq++),i=e+` ${n?n+" ":""}(${s})`;return{c:n,q:s,s:i,toString:()=>i}};h.toString=()=>e;const o=(e,r)=>{const n="--"+(e||t.name("cp",c.cp++)),i=s+" "+n;return{k:n,v:`var(${n})`,s:i,r:{[i]:{syntax:(null==r?void 0:r.syn)||'"*"',inherits:(null==r?void 0:r.inh)||!1,initialValue:null==r?void 0:r.ini}},toString:()=>i}};o.toString=()=>s;const g=e=>{const s=e||t.name("kf",c.kf++),n=r+" "+s;return{k:s,s:n,toString:()=>n}};g.toString=()=>r;const u=e=>{const s=e||t.name("lay",c.lay++),r=n+" "+s;return{k:s,s:r,toString:()=>r}};u.toString=()=>n,u.toString=()=>i;const d=(t="",e=!1)=>{const s=a+` ${e?"not ":""}(${t})`;return{c:t,n:e,s:s,toString:()=>s}};return d.toString=()=>a,{pr:o,kf:g,mq:l,cq:h,lay:u,sc:(t="",e="")=>{const s=i+` ${t?`(${t})`:""}${t&&e?" ":""}${e?`to (${e})`:""}`;return{r:t,l:e,s:s,toString:()=>s}},sup:d}})(I),F=t=>{const e=S[t]||t;return"number"==typeof e?e+"rem":""},K=t=>"min-"+lt+F(t),M=t=>"max-"+lt+F(t),B=(t,e)=>"string"==typeof e?W.cq(t,e):W.mq(t),L=(t,e,s)=>""+B(K(t)+") and ("+M(e),s),R={up:(t,e)=>""+B(K(t),e),down:(t,e)=>""+B(M(t),e),between:L,only:(t,e)=>L(t,t,e)};return H=w(Object.assign(at,{key:t,vars:A,size:z,time:E,angle:P,bem:I.selector,pseudo:Object.assign(O(_(C).map((([t,e])=>{function s(t=""){return t+e}return s.toString=()=>e,[t,s]}))),O(_(N).map((([t,e])=>{function s(t,s=""){return s+e+`(${t})`}return s.toString=()=>e,[t,s]})))),color:G(q),palette:Y(q),coef:et(q),units:{px:c,vh:h,vw:o,vmin:g,vmax:u,rem:d,deg:m,ms:p,pc:b,cqw:f,cqh:v,cqb:$,cqi:x,cqmin:y,cqmax:j},at:W,limit:R})),J(H,((t,e)=>t+U(...e)),"");var H}}};const ht=void 0,ot=Object.entries,gt=Object.assign,ut=Object.defineProperties,dt=t=>`data-${t}`,mt=t=>"string"==typeof t,pt=t=>null!==t&&"object"==typeof t,bt=(t,e)=>`${t}${e?"__"+e:""}`,ft=t=>t.split("."),vt=(t,e)=>ot(t).reduce(((t,[s,r])=>{if(pt(r)){const n=ot(r);n.length?t.push(...n.reduce(((t,[r,n])=>{if((t=>null!==t&&t!==ht)(r)&&e&&t.push([s,r,ht,ht]),pt(n)){const e=ot(n);e.length&&t.push(...e.reduce(((t,[e,n])=>{const i=typeof n;return"string"!==i&&"number"!==i||t.push([s,r,e,n]),t}),[]))}return t}),[])):t.push([s,ht,ht,ht])}return t}),[]),xt=(t,e,s,r)=>""+(bt(t,e)+(s?"_"+s:"")+(s&&r?"_"+r:"")),$t=(t,e,s,r)=>"."+xt(t,e,s,r),yt=(t,e,s,r)=>`[${dt(bt(t,e))}${s&&r?`~="${s}_${r}"`:s?`~="${s}"`:""}]`,jt={def:.75,c:.05,s:.65,m:.75,l:.85,n:.9},Ot="effcss-provider",_t={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null,angle:null},kt={l:{dark:{bg:{xl:.24,l:.3,m:.36,s:.42,xs:.48},fg:{xl:.98,l:.93,m:.86,s:.79,xs:.72}},light:{bg:{xl:.98,l:.93,m:.88,s:.83,xs:.78},fg:{xl:0,l:.12,m:.24,s:.36,xs:.48}}},c:{dark:{bg:{pale:.02,base:.06,rich:.1},fg:{pale:.06,base:.1,rich:.14}},light:{bg:{pale:.01,base:.04,rich:.7},fg:{pale:.07,base:.11,rich:.15}}},h:{pri:184,sec:290,suc:Number(146.2.toFixed(2)),inf:Number(256..toFixed(2)),war:Number((.1*184+.9*109).toFixed(2)),dan:Number(44.5.toFixed(2))}},wt=(t,e)=>{var s,r,n,i,a,l,c,h,o,g,u,d,m,p,b,f;return e?{l:{dark:{bg:gt(t.l.dark.bg,null===(r=null===(s=null==e?void 0:e.l)||void 0===s?void 0:s.dark)||void 0===r?void 0:r.bg),fg:gt(t.l.dark.fg,null===(i=null===(n=null==e?void 0:e.l)||void 0===n?void 0:n.dark)||void 0===i?void 0:i.fg)},light:{bg:gt(t.l.light.bg,null===(l=null===(a=null==e?void 0:e.l)||void 0===a?void 0:a.light)||void 0===l?void 0:l.bg),fg:gt(t.l.light.fg,null===(h=null===(c=null==e?void 0:e.l)||void 0===c?void 0:c.light)||void 0===h?void 0:h.fg)}},c:{dark:{bg:gt(t.c.dark.bg,null===(g=null===(o=null==e?void 0:e.c)||void 0===o?void 0:o.dark)||void 0===g?void 0:g.bg),fg:gt(t.c.dark.fg,null===(d=null===(u=null==e?void 0:e.c)||void 0===u?void 0:u.dark)||void 0===d?void 0:d.fg)},light:{bg:gt(t.c.light.bg,null===(p=null===(m=null==e?void 0:e.c)||void 0===m?void 0:m.light)||void 0===p?void 0:p.bg),fg:gt(t.c.light.fg,null===(f=null===(b=null==e?void 0:e.c)||void 0===b?void 0:b.light)||void 0===f?void 0:f.fg)}},h:gt(t.h,null==e?void 0:e.h)}:t},St={bp:{"3xs":18,"2xs":24,xs:30,sm:40,md:48,lg:64,xl:80,"2xl":96},vars:{"":{rtime:"200ms",rem:"16px",rangle:"30deg",l:jt,h:{def:261.35,b:261.35,i:194.77,e:29.23,w:70.66,s:142.49},c:{def:.03,xs:.03,s:.06,m:.1,l:.15,xl:.25},a:{def:1,min:0,xs:.1,s:.25,m:.5,l:.75,xl:.9,max:1},t:{def:300,xs:100,s:200,m:300,l:450,xl:600,no:0,min:50,max:750},int:[...Array(12).keys()],fr:{0:0,"1/12":"0.0833","1/10":"0.1","1/6":"0.1667","1/5":"0.2","1/4":"0.25","3/10":"0.3","1/3":"0.3333","2/5":"0.4","5/12":"0.4167","1/2":"0.5","7/12":"0.5833","3/5":"0.6","2/3":"0.6667","7/10":"0.7","3/4":"0.75","4/5":"0.8","5/6":"0.8333","9/10":"0.9","11/12":"0.9167",1:"1"},ar:{1:1,"2/1":2,"1/2":.5,"4/3":1.3333,"3/4":.75,"9/16":.5625,"16/9":1.7778}},light:{l:jt},dark:{l:{def:.4,n:.25,s:.3,m:.4,l:.5,c:.95}}},palette:kt,coef:{$0_:{xxs:.0625,xs:.125,s:.25,m:.5,l:.75,xl:.875,xxl:.9375},$1_:{xxs:1.0625,xs:1.125,s:1.25,m:1.5,l:1.75,xl:1.875,xxl:1.9375},$2_:{xxs:2.5,xs:4,s:5,m:7.5,l:10,xl:12,xxl:15},$16_:{xxs:20,xs:28,s:36,m:48,l:64,xl:80,xxl:120},max:150}},qt=({prefix:t})=>{let e=1;return{get base(){return t+0},get current(){return t+e},next(){return e++,this.current},reset(){e=1}}},At=()=>{const t=new Set,e=new Map;return{use(s,r){const n=e.get(s);return n||(t.add(r),e.set(s,r),r)},useMany(t){return ot(t).map((([t,e])=>this.use(e,t)))},getKey:t=>e.get(t),get keys(){return[...t]},get makers(){return Object.fromEntries(e.entries().map((([t,e])=>[e,t])))}}},Et="theme",Pt="size",zt="time",Ct="angle",Nt="palette",It=Object.assign,Wt=Object.entries,Ft=Object.fromEntries,Kt=(t,e)=>t.getAttribute(e)||_t[e],Mt=(t,e)=>{const s=Kt(t,e);return null!==s?Number(s):null},Bt=(t,e,s)=>null===s?t.removeAttribute(e):t.setAttribute(e,s+""),Lt=t=>`:root:has(script[is=${Ot}]${t?`[${t}]`:""})`,Rt=t=>[t.xxs,t.xs,t.s,t.m,t.l,t.xl,t.xxl],Ht=["xs","s","m","l","xl"],Tt=["pale","base","rich"];!function(t={}){const e=window.document,s=window.customElements;if(null==s?void 0:s.get(Ot))return!1;{class r extends HTMLScriptElement{constructor(){super(...arguments),this._c=At(),this._m=function(){let t={},e={},s=[],r=[];const n=(t,e)=>(e.toString=()=>"effcss-"+t,e),i=t=>{var e;return t.adoptedStyleSheets=[...(null===(e=t.adoptedStyleSheets)||void 0===e?void 0:e.length)?[...t.adoptedStyleSheets].filter((t=>!(t+"").startsWith("effcss-"))):[],...s]},a=()=>{r=r.reduce(((t,e)=>{const s=e.deref();return s&&(i(s),t.push(e)),t}),[])},l=t=>s.findIndex((e=>e===t)),c=e=>e?t[e]:void 0,h=(e,r)=>{if(!t[e])return t[e]=n(e,r),s.push(t[e]),a(),!0},o=t=>{const e=c(t);return!!e&&-1!==l(e)};return{apply:i,notify:a,getIndex:l,get:c,has:t=>!!t&&!!c(t),getAll:()=>t,add:h,status:o,on:(...t)=>{const e=t.reduce(((t,e)=>{const r=c(e);return!(!r||o(e))&&(s.push(r),t)}),!0);return a(),e},off:(...t)=>{const e=t.reduce(((t,e)=>{const r=c(e);if(r&&o(e)){const e=l(r);return s.splice(e,1),t}return!1}),!0);return a(),e},remove:r=>{const n=c(r);if(!n)return;const i=l(n);return i>-1&&(s.splice(i,1),delete t[r],delete e[r]),a(),!0},removeAll:()=>(s.splice(0),t={},e={},a(),!0),pack:(e,s)=>{let r=t[e]||new CSSStyleSheet;return r.replaceSync(s),r=n(e,r),!!r.cssRules.length&&h(e,r)},replace:(e,s)=>{const r=t[e];if(r)return r.replaceSync(s),a(),!0},register:t=>{r.findIndex((e=>e.deref()===t))>=0||(r.push(new WeakRef(t)),i(t))},unregister:t=>{const e=r.findIndex((e=>e.deref()===t));e>=0&&r.splice(e,1)}}}(),this._settings=St,this._cust=()=>{var t;const e=null===(t=this._settings)||void 0===t?void 0:t.vars,{varName:s}=this._s(this._k.base),r=t=>s("",t);function n(t,e){return Wt(t).reduce(((t,[r,i])=>i&&"object"==typeof i?It(t,n(i,[...e,r])):(t[s(...e,r)]=i,t)),{})}const i=Ft(Wt(e||{}).map((([t,e])=>[t,n(e,[])]))),{"":a={},dark:l,light:c}=i,h=function(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(s[r[n]]=t[r[n]])}return s}(i,["","dark","light"]),o=this.size,g=this.time,u=this.angle,{l:d,c:m,h:p}=this._settings.palette,b=this._settings.coef,f=[0,...Rt(b.$0_),1,...Rt(b.$1_),2,...Rt(b.$2_),16,...Rt(b.$16_)];this._=({bem:t,each:e,when:n,vars:l,merge:c,at:{mq:b},units:{px:v,ms:x,deg:$}})=>{const y="prefers-color-scheme",j={light:`${y}: light`,dark:`${y}: dark`};return c({[Lt()]:c({fontSize:l("rem")},a,e(f,((t,e)=>({[s("coef",t)]:e}))),e(p,((t,e)=>({[s(Nt,"h",t)]:e}))),{[s(Nt,"c","bg","gray")]:0,[s(Nt,"c","fg","gray")]:0},e(j,((t,r)=>({[b(r).s]:c(i[t]||{},e(Ht,((e,r)=>({[s(Nt,"l","bg",r)]:d[t].bg[r],[s(Nt,"l","fg",r)]:d[t].fg[r]}))),e(Tt,((e,r)=>({[s(Nt,"c","bg",r)]:m[t].bg[r],[s(Nt,"c","fg",r)]:m[t].fg[r]}))))}))))},e(h,((e,s)=>({[Lt(`${Et}=${e}`)]:s,[t(`..theme.${e}`)]:s}))),n(!!o,{[Lt(Pt)]:{[r("rem")]:v(o)}}),n(!!g,{[Lt(zt)]:{[r("rtime")]:x(g)}}),n(!!u,{[Lt(Ct)]:{[r("rangle")]:$(u)}}))},this.use(this._,this._k.base,!0)},this.use=(t,e,s)=>{const r=e||this._k.current;let n=this._c.use(t,r);return(s||this._m&&!this._m.has(e))&&this._m.pack(n,this.css(t,n)),e||this._k.next(),this.resolve(n)},this.usePublic=t=>Ft(Wt(t).map((([t,e])=>[t,this.use(e,t)]))),this.usePrivate=t=>t.map((t=>this.use(t))),this.resolve=t=>this._s(t||this._k.base).attr,this.css=(t,e)=>this._p.compile({key:e,maker:t}),this.status=t=>{const e=this.key(t);return!!e&&this._m.status(e)},this.on=(...t)=>this._m.on(...t.map(this.key)),this.off=(...t)=>this._m.off(...t.map(this.key)),this.key=t=>"string"==typeof t?t:this._c.getKey(t),this.stylesheets=(t=this._c.keys)=>t.map((t=>this._m.get(this.key(t))))}static get observedAttributes(){return[Pt,zt,Ct]}get prefix(){return Kt(this,"prefix")||""}get mode(){return Kt(this,"mode")}get hydrate(){return""===this.getAttribute("hydrate")}get settings(){return this._settings}set settings(t){var e,s,r;const n=It({},this._settings,t,{palette:wt(this._settings.palette,null==t?void 0:t.palette)}),{makers:i,vars:a,bp:l,off:c,palette:h}=n;(l&&(null===(e=this._settings)||void 0===e?void 0:e.bp)!==l||!this._p)&&(this._p=ct({scope:this._s,globalKey:this._k.base,bp:l})),i&&(null===(s=this._settings)||void 0===s?void 0:s.makers)!==i&&(this._c.useMany(i),this.usePublic(i),(null==c?void 0:c.length)&&this._settings.off!==c&&this.off(...c),this.hydrate&&this._k.reset()),this._settings=n,(!(null===(r=this._m)||void 0===r?void 0:r.has(this._k.base))||t.vars||t.palette||t.coef)&&this._cust()}set theme(t){Bt(this,Et,t)}get theme(){return Kt(this,Et)||""}set size(t){Bt(this,Pt,t)}get size(){return Mt(this,Pt)}set time(t){Bt(this,"time",t)}get time(){return Mt(this,zt)}set angle(t){Bt(this,"angle",t)}get angle(){return Mt(this,Ct)}attributeChangedCallback(){this._k&&this._cust()}connectedCallback(){this._k=qt({prefix:this.prefix}),this._s=((t={})=>{const{mode:e}=t;let s,r;return t=>{const n=(...e)=>""+e.filter(Boolean).reduce(((t,e)=>`${t}-${e}`),t),i=(...t)=>"--"+n(...t);return"c"===e?(s=t=>{let e,s,r,i;return mt(t)?([e,s,r,i]=ft(t),$t(n(e),s,r,i)):t&&vt(t).map((([t,e,s,r])=>$t(n(t),e,s,r))).join(",")},r=t=>{let e,s,r,i;const a="class";let l="";return Array.isArray(t)?l=[...t.reduce(((t,a)=>([e,s,r,i]=ft(a),t.add(xt(n(e),s)),r&&t.add(xt(n(e),s,r,i)),t)),new Set).values()].join(" "):mt(t)?([e,s,r,i]=ft(t),l=xt(n(e),s,r,i)):l=t&&vt(t,!0).map((([t,e,s,r])=>xt(n(t),e,s,r))).join(" "),ut({[a]:l},{toString:{value:()=>`${a}="${l}"`}})}):(s=t=>{let e,s,r,i;return mt(t)?([e,s,r,i]=ft(t),yt(n(e),s,r,i)):t&&vt(t).map((([t,e,s,r])=>yt(n(t),e,s,r))).join(",")},r=t=>{let e,s,r,i,a,l,c="";if(Array.isArray(t))l=t.reduce(((t,l)=>{[e,s,r,i]=ft(l);const h=bt(n(e),s);return a=dt(h),c=r?i?`${r}_${i}`:`${r}`:"",t[a]&&c?t[a]=t[a]+" "+c:t[a]=c,t}),{});else if(mt(t)){[e,s,r,i]=ft(t);const h=bt(n(e),s);a=dt(h),c=r?i?`${r}_${i}`:`${r}`:"",l={[a]:c}}else l=t&&vt(t,!0).reduce(((t,[e,s,r,i])=>{const l=bt(n(e),s);a=dt(l);const h=r?i?`${r}_${i}`:`${r}`:"";return c=t[a]?t[a]+" "+h:h,t[a]=c,t}),{});return ut(l,{toString:{value:()=>ot(l).map((([t,e])=>`${t}="${e}"`)).join(" ")}}),l}),{selector:s,attr:r,name:n,varName:i,varExp:(...t)=>`var(${i(...t)})`}}})({mode:this.mode});const s=this;this._n={set adoptedStyleSheets(t){s.dispatchEvent(new CustomEvent("effcsschanges",{detail:{styles:t},bubbles:!0}))}},this._m.register(this._n),this._m.register(e),this.settings=t}toString(){return`<script ${[...this.attributes].map((t=>t.value?`${t.name}="${t.value}"`:""===t.value?t.name:"")).filter(Boolean).join(" ")}>${this.textContent}<\/script>`}}s.define(Ot,r,{extends:"script"})}}();
|
|
7
|
+
"function"==typeof SuppressedError&&SuppressedError;const t=void 0,e=Object.entries,s=Array.isArray,r=Object.defineProperties,n=t=>`data-${t}`,i=t=>"string"==typeof t,a=t=>null!==t&&"object"==typeof t,c=(t,e)=>`${t}${e?"__"+e:""}`,l=t=>t.split("."),h=(s,r)=>e(s).reduce(((s,[n,i])=>{if(a(i)){const c=e(i);c.length?s.push(...c.reduce(((s,[i,c])=>{if((e=>null!==e&&e!==t)(i)&&r&&s.push([n,i,t,t]),a(c)){const t=e(c);t.length&&s.push(...t.reduce(((t,[e,s])=>{const r=typeof s;return"string"!==r&&"number"!==r||t.push([n,i,e,s]),t}),[]))}return s}),[])):s.push([n,t,t,t])}return s}),[]),o=(t,e,s,r)=>""+(c(t,e)+(s?"_"+s:"")+(s&&r?"_"+r:"")),u=(t,e,s,r)=>"."+o(t,e,s,r),g=(t,e,s,r)=>`[${n(c(t,e))}${s&&r?`~="${s}_${r}"`:s?`~="${s}"`:""}]`,m=(t,...r)=>r.length?r.reduce(((t,r)=>(e(r).forEach((([e,r])=>{r&&"object"==typeof r&&t[e]?s(t[e])&&s(r)?t[e]=[...t[e],...r]:m(t[e],r||{}):t[e]=r})),t)),t):t,p={def:.75,c:.05,s:.65,m:.75,l:.85,n:.9},d="effcss-provider",b={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null,angle:null},f={l:{dark:{bg:{xl:.24,l:.3,m:.36,s:.42,xs:.48},fg:{xl:.98,l:.93,m:.86,s:.79,xs:.72}},light:{bg:{xl:.98,l:.93,m:.88,s:.83,xs:.78},fg:{xl:0,l:.12,m:.24,s:.36,xs:.48}}},c:{dark:{bg:{pale:.02,base:.06,rich:.1},fg:{pale:.06,base:.1,rich:.14}},light:{bg:{pale:.01,base:.04,rich:.7},fg:{pale:.07,base:.11,rich:.15}}},h:{pri:184,sec:290,suc:Number(146.2.toFixed(2)),inf:Number(256..toFixed(2)),war:Number((.1*184+.9*109).toFixed(2)),dan:Number(44.5.toFixed(2))}},x={bp:{"3xs":18,"2xs":24,xs:30,sm:40,md:48,lg:64,xl:80,"2xl":96},vars:{"":{rtime:"200ms",rem:"16px",rangle:"30deg",l:p,h:{def:261.35,b:261.35,i:194.77,e:29.23,w:70.66,s:142.49},c:{def:.03,xs:.03,s:.06,m:.1,l:.15,xl:.25},a:{def:1,min:0,xs:.1,s:.25,m:.5,l:.75,xl:.9,max:1},t:{def:300,xs:100,s:200,m:300,l:450,xl:600,no:0,min:50,max:750},int:[...Array(12).keys()],fr:{0:0,"1/12":"0.0833","1/10":"0.1","1/6":"0.1667","1/5":"0.2","1/4":"0.25","3/10":"0.3","1/3":"0.3333","2/5":"0.4","5/12":"0.4167","1/2":"0.5","7/12":"0.5833","3/5":"0.6","2/3":"0.6667","7/10":"0.7","3/4":"0.75","4/5":"0.8","5/6":"0.8333","9/10":"0.9","11/12":"0.9167",1:"1"},ar:{1:1,"2/1":2,"1/2":.5,"4/3":1.3333,"3/4":.75,"9/16":.5625,"16/9":1.7778}},light:{l:p},dark:{l:{def:.4,n:.25,s:.3,m:.4,l:.5,c:.95}}},palette:f,coef:{$0_:{xxs:.0625,xs:.125,s:.25,m:.5,l:.75,xl:.875,xxl:.9375},$1_:{xxs:1.0625,xs:1.125,s:1.25,m:1.5,l:1.75,xl:1.875,xxl:1.9375},$2_:{xxs:2.5,xs:4,s:5,m:7.5,l:10,xl:12,xxl:15},$16_:{xxs:20,xs:28,s:36,m:48,l:64,xl:80,xxl:120},max:150}},$=({prefix:t})=>{let e=1;return{get base(){return t+0},get current(){return t+e},next(){return e++,this.current},reset(){e=1}}},y=()=>{const t=new Set,s=new Map;return{use(e,r){const n=s.get(e);return n||(t.add(r),s.set(e,r),r)},useMany(t){return e(t).map((([t,e])=>this.use(e,t)))},getKey:t=>s.get(t),get keys(){return[...t]},get makers(){return Object.fromEntries(s.entries().map((([t,e])=>[e,t])))}}},v="@media",j="@container",O="@property",_="@keyframes",w="@layer",k="@scope",S="@supports",q=(t,e)=>{const s=v+` ${e||""}${e?" and ":""}(${t})`;return{s:s,q:t,t:e,toString:()=>s}};q.toString=()=>v;const A=t=>t+"px",E=t=>t+"vh",P=t=>t+"vw",z=t=>t+"vmin",C=t=>t+"vmax",N=t=>t+"rem",I=t=>t+"deg",W=t=>t+"ms",F=t=>t+"%",K=t=>t+"cqw",M=t=>t+"cqh",B=t=>t+"cqi",L=t=>t+"cqb",R=t=>t+"cqmin",H=t=>t+"cqmax",T=Object.fromEntries,V=Object.entries,Z=":first-",D=":last-",G=":only-",J="child",Q=":nth-",U="of-type",X=Q+J,Y=":focus",tt={r:":root",h:":hover",f:Y,fv:Y+"-visible",a:":active",v:":visited",val:":valid",inv:":invalid",e:":empty",d:":disabled",rq:":required",o:":optional",m:":modal",l:":link",ph:":placeholder",ch:":checked",po:":popover-open",fc:Z+J,lc:D+J,oc:G+J,odd:X+"(odd)",even:X+"(even)",ft:Z+U,lt:D+U,ot:G+U,bef:"::before",aft:"::after",bd:"::backdrop"},et={has:":has",not:":not",is:":is",wh:":where",st:":state",nthc:X,ntho:Q+U,dir:":dir",lang:":lang"},st="oklch",rt=t=>st+`(${t})`,nt=t=>rt(`from ${t}`),it="def",at=t=>{const e=(e,s)=>"string"==typeof s?t(e,s):s;class s{constructor(t={}){this.state={l:e("l",it),c:e("c",it),h:e("h",it),a:e("a",it)},this.merge=t=>new s(Object.assign(this.state,t)),this.l=t=>this.merge({l:e("l",t)}),this.c=t=>this.merge({c:e("c",t)}),this.h=t=>this.merge({h:e("h",t)}),this.a=t=>this.merge({a:e("a",t)}),this.state=Object.assign(this.state,t)}get s(){return this.toString()}toString(){const{l:t,c:e,h:s,a:r}=this.state;return rt(`${t} ${e} ${s} / ${r}`)}}return t=>new s(t)},ct=(t,e=.1)=>nt(`${t} calc(l + ${e}) c h / alpha)`),lt=(t,e=.1)=>nt(`${t} calc(l - ${e}) c h / alpha)`),ht=(t,e=.1)=>nt(`${t} l c h / calc(alpha + ${e}))`),ot=(t,e=.1)=>nt(`${t} l c h / calc(alpha - ${e}))`),ut=(t,e=.04)=>nt(`${t} l calc(c + ${e}) h / alpha)`),gt=(t,e=.04)=>nt(`${t} l calc(c - ${e}) h / alpha)`),mt=(t,e=30)=>nt(`${t} l c calc(h${"number"==typeof e?e>0?" + "+e:" - "+-e:e}) / alpha)`),pt=({base:t,mixin:e,method:s,bpart:r,mpart:n})=>`color-mix(in ${s||st}, ${t}${void 0!==r?` ${r}%`:""}, ${e}${void 0!==n?` ${n}%`:""})`,dt=t=>({create:at(t),oklch:rt,lighten:ct,darken:lt,saturate:ut,desaturate:gt,fadein:ht,fadeout:ot,spin:mt,mix:pt}),bt=(t,e,s)=>Object.entries(t).reduce(e,s),ft=Symbol("noParse"),xt=(t,e,s)=>{var r,n,i;let a=""+t;return null==e?"":"object"!=typeof e||e.hasOwnProperty(ft)?`${c=a,c.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}:${""+e};`:(!s||(null===(r=s.startsWith)||void 0===r?void 0:r.call(s,"@"))||(null===(n=a.startsWith)||void 0===n?void 0:n.call(a,"&"))||(null===(i=a.startsWith)||void 0===i?void 0:i.call(a,"@"))?"":"&")+a+`{${bt(e,((t,e)=>t+xt(...e,a)),"")}}`;var c},$t="palette",yt=t=>{class e{constructor(t={}){this.state={l:"l",c:"base",h:"pri",a:1,m:"bg"},Object.assign(this,{[ft]:!0}),this.state=Object.assign(this.state,t)}get xs(){return new e(Object.assign(Object.assign({},this.state),{l:"xs"}))}get s(){return new e(Object.assign(Object.assign({},this.state),{l:"s"}))}get m(){return new e(Object.assign(Object.assign({},this.state),{l:"m"}))}get l(){return new e(Object.assign(Object.assign({},this.state),{l:"l"}))}get xl(){return new e(Object.assign(Object.assign({},this.state),{l:"xl"}))}get lightness(){return{xs:this.xs,s:this.s,m:this.m,l:this.l,xl:this.xl}}get gray(){return new e(Object.assign(Object.assign({},this.state),{c:"gray"}))}get pale(){return new e(Object.assign(Object.assign({},this.state),{c:"pale"}))}get base(){return new e(Object.assign(Object.assign({},this.state),{c:"base"}))}get rich(){return new e(Object.assign(Object.assign({},this.state),{c:"rich"}))}get chroma(){return{gray:this.gray,pale:this.pale,base:this.base,rich:this.rich}}get pri(){return new e(Object.assign(Object.assign({},this.state),{h:"pri"}))}get sec(){return new e(Object.assign(Object.assign({},this.state),{h:"sec"}))}get suc(){return new e(Object.assign(Object.assign({},this.state),{h:"suc"}))}get inf(){return new e(Object.assign(Object.assign({},this.state),{h:"inf"}))}get war(){return new e(Object.assign(Object.assign({},this.state),{h:"war"}))}get dan(){return new e(Object.assign(Object.assign({},this.state),{h:"dan"}))}get hue(){return{pri:this.pri,sec:this.sec,suc:this.suc,inf:this.inf,war:this.war,dan:this.dan}}alpha(t=1){return new e(Object.assign(Object.assign({},this.state),{a:t}))}get bg(){return new e(Object.assign(Object.assign({},this.state),{m:"bg"}))}get fg(){return new e(Object.assign(Object.assign({},this.state),{m:"fg"}))}toString(){const{l:e,c:s,h:r,a:n,m:i}=this.state;return`oklch(${t($t,"l",i,e)} ${t($t,"c",i,s)} ${t($t,"h",r)} / ${n})`}}return new e},vt="coef",jt=t=>{class e{constructor(t={}){this.state={center:8},this.state=Object.assign(this.state,t)}get min(){return t(vt,this.state.center-4)}get xxs(){return t(vt,this.state.center-3)}get xs(){return t(vt,this.state.center-2)}get s(){return t(vt,this.state.center-1)}get m(){return t(vt,this.state.center)}get l(){return t(vt,this.state.center+1)}get xl(){return t(vt,this.state.center+2)}get xxl(){return t(vt,this.state.center+3)}get max(){return t(vt,this.state.center+4)}get $0_(){return new e({center:4})}get $1_(){return new e({center:12})}get $2_(){return new e({center:20})}get $16_(){return new e({center:28})}get $1(){return new e({center:8})}get $2(){return new e({center:16})}get $16(){return new e({center:24})}get short(){return{s:this.s,m:this.m,l:this.l}}get base(){return Object.assign(Object.assign({xs:this.xs},this.short),{xl:this.xl})}get long(){return Object.assign(Object.assign({xxs:this.xxs},this.base),{xxl:this.xxl})}get full(){return Object.assign(Object.assign({min:this.min},this.long),{max:this.max})}get main(){return{min:this.min,m:this.m,max:this.max}}get sparse(){return{min:this.min,xs:this.xs,m:this.m,xl:this.xl,max:this.max}}}return new e},Ot=Object.assign,_t=Object.entries,wt={dash:(...t)=>t.join("-"),comma:(...t)=>t.join(),space:(...t)=>t.join(" "),range:(t,e)=>Array.from(Array(t).entries()).reduce(((t,[s])=>Ot(t,e(s+1))),{}),each:(t,e)=>_t(t).reduce(((t,[s,r])=>Ot(t,e(s,r))),{}),when:(t,e,s={})=>t?e:s},kt="width: ",St=t=>{const{scope:e,globalKey:s="",bp:r={}}=t,n=e(s).varExp,i=t=>n(...t.split(".")),a=(t=1)=>`calc(${t} * ${i("rtime")})`,c=(t=1)=>`calc(${t} * ${i("rangle")})`,l=(t=1)=>`calc(${t} * 1rem)`;return{compile:({key:t,maker:s})=>{const h=e(t),o=(t=>{const e={cp:1,lay:1,kf:1,cq:1},s=(s,r)=>{const n="string"==typeof r?r:t.name("cq",e.cq++),i=j+` ${n?n+" ":""}(${s})`;return{c:n,q:s,s:i,toString:()=>i}};s.toString=()=>j;const r=(s,r)=>{const n="--"+(s||t.name("cp",e.cp++)),i=O+" "+n;return{k:n,v:`var(${n})`,s:i,r:{[i]:{syntax:(null==r?void 0:r.syn)||'"*"',inherits:(null==r?void 0:r.inh)||!1,initialValue:null==r?void 0:r.ini}},toString:()=>i}};r.toString=()=>O;const n=s=>{const r=s||t.name("kf",e.kf++),n=_+" "+r;return{k:r,s:n,toString:()=>n}};n.toString=()=>_;const i=s=>{const r=s||t.name("lay",e.lay++),n=w+" "+r;return{k:r,s:n,toString:()=>n}};i.toString=()=>w,i.toString=()=>k;const a=(t="",e=!1)=>{const s=S+` ${e?"not ":""}(${t})`;return{c:t,n:e,s:s,toString:()=>s}};return a.toString=()=>S,{pr:r,kf:n,mq:q,cq:s,lay:i,sc:(t="",e="")=>{const s=k+` ${t?`(${t})`:""}${t&&e?" ":""}${e?`to (${e})`:""}`;return{r:t,l:e,s:s,toString:()=>s}},sup:a}})(h),u=t=>{const e=r[t]||t;return"number"==typeof e?e+"rem":""},g=t=>"min-"+kt+u(t),p=t=>"max-"+kt+u(t),d=(t,e)=>"string"==typeof e?o.cq(t,e):o.mq(t),b=(t,e,s)=>""+d(g(t)+") and ("+p(e),s),f={up:(t,e)=>""+d(g(t),e),down:(t,e)=>""+d(p(t),e),between:b,only:(t,e)=>b(t,t,e)};return x=s(Object.assign(wt,{key:t,vars:i,size:l,time:a,angle:c,bem:h.selector,pseudo:Object.assign(T(V(tt).map((([t,e])=>{function s(t=""){return t+e}return s.toString=()=>e,[t,s]}))),T(V(et).map((([t,e])=>{function s(t,s=""){return s+e+`(${t})`}return s.toString=()=>e,[t,s]})))),color:dt(n),palette:yt(n),coef:jt(n),units:{px:A,vh:E,vw:P,vmin:z,vmax:C,rem:N,deg:I,ms:W,pc:F,cqw:K,cqh:M,cqb:L,cqi:B,cqmin:R,cqmax:H},at:o,limit:f,merge:m})),bt(x,((t,e)=>t+xt(...e)),"");var x}}};const qt="theme",At="size",Et="time",Pt="angle",zt="palette",Ct=Object.assign,Nt=Object.entries,It=Object.fromEntries,Wt=(t,e)=>t.getAttribute(e)||b[e],Ft=(t,e)=>{const s=Wt(t,e);return null!==s?Number(s):null},Kt=(t,e,s)=>null===s?t.removeAttribute(e):t.setAttribute(e,s+""),Mt=t=>`:root:has(script[is=${d}]${t?`[${t}]`:""})`,Bt=t=>[t.xxs,t.xs,t.s,t.m,t.l,t.xl,t.xxl],Lt=["xs","s","m","l","xl"],Rt=["pale","base","rich"];!function(t={}){const s=window.document,a=window.customElements;if(null==a?void 0:a.get(d))return!1;{class p extends HTMLScriptElement{constructor(){super(...arguments),this._c=y(),this._m=function(){let t={},e={},s=[],r=[];const n=(t,e)=>(e.toString=()=>"effcss-"+t,e),i=t=>{var e;return t.adoptedStyleSheets=[...(null===(e=t.adoptedStyleSheets)||void 0===e?void 0:e.length)?[...t.adoptedStyleSheets].filter((t=>!(t+"").startsWith("effcss-"))):[],...s]},a=()=>{r=r.reduce(((t,e)=>{const s=e.deref();return s&&(i(s),t.push(e)),t}),[])},c=t=>s.findIndex((e=>e===t)),l=e=>e?t[e]:void 0,h=(e,r)=>{if(!t[e])return t[e]=n(e,r),s.push(t[e]),a(),!0},o=t=>{const e=l(t);return!!e&&-1!==c(e)};return{apply:i,notify:a,getIndex:c,get:l,has:t=>!!t&&!!l(t),getAll:()=>t,add:h,status:o,on:(...t)=>{const e=t.reduce(((t,e)=>{const r=l(e);return!(!r||o(e))&&(s.push(r),t)}),!0);return a(),e},off:(...t)=>{const e=t.reduce(((t,e)=>{const r=l(e);if(r&&o(e)){const e=c(r);return s.splice(e,1),t}return!1}),!0);return a(),e},remove:r=>{const n=l(r);if(!n)return;const i=c(n);return i>-1&&(s.splice(i,1),delete t[r],delete e[r]),a(),!0},removeAll:()=>(s.splice(0),t={},e={},a(),!0),pack:(e,s)=>{let r=t[e]||new CSSStyleSheet;return r.replaceSync(s),r=n(e,r),!!r.cssRules.length&&h(e,r)},replace:(e,s)=>{const r=t[e];if(r)return r.replaceSync(s),a(),!0},register:t=>{r.findIndex((e=>e.deref()===t))>=0||(r.push(new WeakRef(t)),i(t))},unregister:t=>{const e=r.findIndex((e=>e.deref()===t));e>=0&&r.splice(e,1)}}}(),this._settings=x,this._cust=()=>{var t;const e=null===(t=this._settings)||void 0===t?void 0:t.vars,{varName:s}=this._s(this._k.base),r=t=>s("",t);function n(t,e){return Nt(t).reduce(((t,[r,i])=>i&&"object"==typeof i?Ct(t,n(i,[...e,r])):(t[s(...e,r)]=i,t)),{})}const i=It(Nt(e||{}).map((([t,e])=>[t,n(e,[])]))),{"":a={},dark:c,light:l}=i,h=function(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(s[r[n]]=t[r[n]])}return s}(i,["","dark","light"]),o=this.size,u=this.time,g=this.angle,{l:m,c:p,h:d}=this._settings.palette,b=this._settings.coef,f=[0,...Bt(b.$0_),1,...Bt(b.$1_),2,...Bt(b.$2_),16,...Bt(b.$16_),b.max];this._=({bem:t,each:e,when:n,vars:c,merge:l,at:{mq:b},units:{px:x,ms:$,deg:y}})=>{const v="prefers-color-scheme",j={light:`${v}: light`,dark:`${v}: dark`};return l({[Mt()]:l({fontSize:c("rem")},a,e(f,((t,e)=>({[s("coef",t)]:e}))),e(d,((t,e)=>({[s(zt,"h",t)]:e}))),{[s(zt,"c","bg","gray")]:0,[s(zt,"c","fg","gray")]:0},e(j,((t,r)=>({[b(r).s]:l(i[t]||{},e(Lt,((e,r)=>({[s(zt,"l","bg",r)]:m[t].bg[r],[s(zt,"l","fg",r)]:m[t].fg[r]}))),e(Rt,((e,r)=>({[s(zt,"c","bg",r)]:p[t].bg[r],[s(zt,"c","fg",r)]:p[t].fg[r]}))))}))))},e(h,((e,s)=>({[Mt(`${qt}=${e}`)]:s,[t(`..theme.${e}`)]:s}))),n(!!o,{[Mt(At)]:{[r("rem")]:x(o)}}),n(!!u,{[Mt(Et)]:{[r("rtime")]:$(u)}}),n(!!g,{[Mt(Pt)]:{[r("rangle")]:y(g)}}))},this.use(this._,this._k.base,!0)},this.use=(t,e,s)=>{const r=e||this._k.current;let n=this._c.use(t,r);return(s||this._m&&!this._m.has(e))&&this._m.pack(n,this.css(t,n)),e||this._k.next(),this.resolve(n)},this.usePublic=t=>It(Nt(t).map((([t,e])=>[t,this.use(e,t)]))),this.usePrivate=t=>t.map((t=>this.use(t))),this.resolve=t=>this._s(t||this._k.base).attr,this.css=(t,e)=>this._p.compile({key:e,maker:t}),this.status=t=>{const e=this.key(t);return!!e&&this._m.status(e)},this.on=(...t)=>this._m.on(...t.map(this.key)),this.off=(...t)=>this._m.off(...t.map(this.key)),this.key=t=>"string"==typeof t?t:this._c.getKey(t),this.stylesheets=(t=this._c.keys)=>t.map((t=>this._m.get(this.key(t))))}static get observedAttributes(){return[At,Et,Pt]}get prefix(){return Wt(this,"prefix")||""}get mode(){return Wt(this,"mode")}get hydrate(){return""===this.getAttribute("hydrate")}get settings(){return this._settings}set settings(t){var e,s,r;const n=m({},this._settings,t),{makers:i,bp:a,off:c}=n;(a&&(null===(e=this._settings)||void 0===e?void 0:e.bp)!==a||!this._p)&&(this._p=St({scope:this._s,globalKey:this._k.base,bp:a})),i&&(null===(s=this._settings)||void 0===s?void 0:s.makers)!==i&&(this._c.useMany(i),this.usePublic(i),(null==c?void 0:c.length)&&this._settings.off!==c&&this.off(...c),this.hydrate&&this._k.reset()),this._settings=n,(!(null===(r=this._m)||void 0===r?void 0:r.has(this._k.base))||t.vars||t.palette||t.coef)&&this._cust()}set theme(t){Kt(this,qt,t)}get theme(){return Wt(this,qt)||""}set size(t){Kt(this,At,t)}get size(){return Ft(this,At)}set time(t){Kt(this,"time",t)}get time(){return Ft(this,Et)}set angle(t){Kt(this,"angle",t)}get angle(){return Ft(this,Pt)}attributeChangedCallback(){this._k&&this._cust()}connectedCallback(){this._k=$({prefix:this.prefix}),this._s=((t={})=>{const{mode:s}=t;let a,m;return t=>{const p=(...e)=>""+e.filter(Boolean).reduce(((t,e)=>`${t}-${e}`),t),d=(...t)=>"--"+p(...t);return"c"===s?(a=t=>{let e,s,r,n;return i(t)?([e,s,r,n]=l(t),u(p(e),s,r,n)):t&&h(t).map((([t,e,s,r])=>u(p(t),e,s,r))).join(",")},m=t=>{let e,s,n,a;const c="class";let u="";return Array.isArray(t)?u=[...t.reduce(((t,r)=>([e,s,n,a]=l(r),t.add(o(p(e),s)),n&&t.add(o(p(e),s,n,a)),t)),new Set).values()].join(" "):i(t)?([e,s,n,a]=l(t),u=o(p(e),s,n,a)):u=t&&h(t,!0).map((([t,e,s,r])=>o(p(t),e,s,r))).join(" "),r({[c]:u},{toString:{value:()=>`${c}="${u}"`}})}):(a=t=>{let e,s,r,n;return i(t)?([e,s,r,n]=l(t),g(p(e),s,r,n)):t&&h(t).map((([t,e,s,r])=>g(p(t),e,s,r))).join(",")},m=t=>{let s,a,o,u,g,m,d="";if(Array.isArray(t))m=t.reduce(((t,e)=>{[s,a,o,u]=l(e);const r=c(p(s),a);return g=n(r),d=o?u?`${o}_${u}`:`${o}`:"",t[g]&&d?t[g]=t[g]+" "+d:t[g]=d,t}),{});else if(i(t)){[s,a,o,u]=l(t);const e=c(p(s),a);g=n(e),d=o?u?`${o}_${u}`:`${o}`:"",m={[g]:d}}else m=t&&h(t,!0).reduce(((t,[e,s,r,i])=>{const a=c(p(e),s);g=n(a);const l=r?i?`${r}_${i}`:`${r}`:"";return d=t[g]?t[g]+" "+l:l,t[g]=d,t}),{});return r(m,{toString:{value:()=>e(m).map((([t,e])=>`${t}="${e}"`)).join(" ")}}),m}),{selector:a,attr:m,name:p,varName:d,varExp:(...t)=>`var(${d(...t)})`}}})({mode:this.mode});const a=this;this._n={set adoptedStyleSheets(t){a.dispatchEvent(new CustomEvent("effcsschanges",{detail:{styles:t},bubbles:!0}))}},this._m.register(this._n),this._m.register(s),this.settings=t}toString(){return`<script ${[...this.attributes].map((t=>t.value?`${t.name}="${t.value}"`:""===t.value?t.name:"")).filter(Boolean).join(" ")}>${this.textContent}<\/script>`}}a.define(d,p,{extends:"script"})}}();
|
package/dist/consumer.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* EffCSS v3.5.
|
|
2
|
+
* EffCSS v3.5.2
|
|
3
3
|
* {@link https://gitverse.ru/msabitov/effcss}
|
|
4
4
|
* Copyright (c) Marat Sabitov
|
|
5
5
|
* @license Apache-2.0
|
|
6
6
|
*/
|
|
7
|
-
"function"==typeof SuppressedError&&SuppressedError;const t="@media",e="@container",s="@property",r="@keyframes",n="@layer",i="@scope",a="@supports",l=(e,s)=>{const r=t+` ${s||""}${s?" and ":""}(${e})`;return{s:r,q:e,t:s,toString:()=>r}};l.toString=()=>t;const c=t=>t+"px",h=t=>t+"vh",o=t=>t+"vw",u=t=>t+"vmin",g=t=>t+"vmax",d=t=>t+"rem",m=t=>t+"deg",p=t=>t+"ms",b=t=>t+"%",f=t=>t+"cqw",v=t=>t+"cqh",x=t=>t+"cqi",$=t=>t+"cqb",y=t=>t+"cqmin",j=t=>t+"cqmax",O=Object.fromEntries,_=Object.entries,k=":first-",w=":last-",S=":only-",q="child",A=":nth-",E="of-type",P=A+q,z=":focus",C={r:":root",h:":hover",f:z,fv:z+"-visible",a:":active",v:":visited",val:":valid",inv:":invalid",e:":empty",d:":disabled",rq:":required",o:":optional",m:":modal",l:":link",ph:":placeholder",ch:":checked",po:":popover-open",fc:k+q,lc:w+q,oc:S+q,odd:P+"(odd)",even:P+"(even)",ft:k+E,lt:w+E,ot:S+E,bef:"::before",aft:"::after",bd:"::backdrop"},N={has:":has",not:":not",is:":is",wh:":where",st:":state",nthc:P,ntho:A+E,dir:":dir",lang:":lang"},I="oklch",W=t=>I+`(${t})`,F=t=>W(`from ${t}`),K="def",M=t=>{const e=(e,s)=>"string"==typeof s?t(e,s):s;class s{constructor(t={}){this.state={l:e("l",K),c:e("c",K),h:e("h",K),a:e("a",K)},this.merge=t=>new s(Object.assign(this.state,t)),this.l=t=>this.merge({l:e("l",t)}),this.c=t=>this.merge({c:e("c",t)}),this.h=t=>this.merge({h:e("h",t)}),this.a=t=>this.merge({a:e("a",t)}),this.state=Object.assign(this.state,t)}get s(){return this.toString()}toString(){const{l:t,c:e,h:s,a:r}=this.state;return W(`${t} ${e} ${s} / ${r}`)}}return t=>new s(t)},B=(t,e=.1)=>F(`${t} calc(l + ${e}) c h / alpha)`),L=(t,e=.1)=>F(`${t} calc(l - ${e}) c h / alpha)`),R=(t,e=.1)=>F(`${t} l c h / calc(alpha + ${e}))`),H=(t,e=.1)=>F(`${t} l c h / calc(alpha - ${e}))`),T=(t,e=.04)=>F(`${t} l calc(c + ${e}) h / alpha)`),V=(t,e=.04)=>F(`${t} l calc(c - ${e}) h / alpha)`),Z=(t,e=30)=>F(`${t} l c calc(h${"number"==typeof e?e>0?" + "+e:" - "+-e:e}) / alpha)`),D=({base:t,mixin:e,method:s,bpart:r,mpart:n})=>`color-mix(in ${s||I}, ${t}${void 0!==r?` ${r}%`:""}, ${e}${void 0!==n?` ${n}%`:""})`,G=t=>({create:M(t),oklch:W,lighten:B,darken:L,saturate:T,desaturate:V,fadein:R,fadeout:H,spin:Z,mix:D}),J=(t,e,s)=>Object.entries(t).reduce(e,s),Q=Symbol("noParse"),U=(t,e,s)=>{var r,n,i;let a=""+t;return null==e?"":"object"!=typeof e||e.hasOwnProperty(Q)?`${l=a,l.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}:${""+e};`:(!s||(null===(r=s.startsWith)||void 0===r?void 0:r.call(s,"@"))||(null===(n=a.startsWith)||void 0===n?void 0:n.call(a,"&"))||(null===(i=a.startsWith)||void 0===i?void 0:i.call(a,"@"))?"":"&")+a+`{${J(e,((t,e)=>t+U(...e,a)),"")}}`;var l},X="palette",Y=t=>{const e={pri:t(X,"h","pri"),sec:t(X,"h","sec"),ter:t(X,"h","ter"),suc:t(X,"h","suc"),inf:t(X,"h","inf"),war:t(X,"h","war"),dan:t(X,"h","dan")};class s{constructor(t={}){this.state={l:"l",c:"base",h:e.pri,a:1,m:"bg"},Object.assign(this,{[Q]:!0}),this.state=Object.assign(this.state,t)}get xs(){return new s(Object.assign(Object.assign({},this.state),{l:"xs"}))}get s(){return new s(Object.assign(Object.assign({},this.state),{l:"s"}))}get m(){return new s(Object.assign(Object.assign({},this.state),{l:"m"}))}get l(){return new s(Object.assign(Object.assign({},this.state),{l:"l"}))}get xl(){return new s(Object.assign(Object.assign({},this.state),{l:"xl"}))}get lightness(){return{xs:this.xs,s:this.s,m:this.m,l:this.l,xl:this.xl}}get gray(){return new s(Object.assign(Object.assign({},this.state),{c:"gray"}))}get pale(){return new s(Object.assign(Object.assign({},this.state),{c:"pale"}))}get base(){return new s(Object.assign(Object.assign({},this.state),{c:"base"}))}get rich(){return new s(Object.assign(Object.assign({},this.state),{c:"rich"}))}get chroma(){return{gray:this.gray,pale:this.pale,base:this.base,rich:this.rich}}get pri(){return new s(Object.assign(Object.assign({},this.state),{h:e.pri}))}get sec(){return new s(Object.assign(Object.assign({},this.state),{h:e.sec}))}get suc(){return new s(Object.assign(Object.assign({},this.state),{h:e.suc}))}get inf(){return new s(Object.assign(Object.assign({},this.state),{h:e.inf}))}get war(){return new s(Object.assign(Object.assign({},this.state),{h:e.war}))}get dan(){return new s(Object.assign(Object.assign({},this.state),{h:e.dan}))}get hue(){return{pri:this.pri,sec:this.sec,suc:this.suc,inf:this.inf,war:this.war,dan:this.dan}}alpha(t=1){return new s(Object.assign(Object.assign({},this.state),{a:t}))}get bg(){return new s(Object.assign(Object.assign({},this.state),{m:"bg"}))}get fg(){return new s(Object.assign(Object.assign({},this.state),{m:"fg"}))}toString(){const{l:e,c:s,h:r,a:n,m:i}=this.state;return`oklch(${t(X,"l",i,e)} ${t(X,"c",i,s)} ${r} / ${n})`}}return new s},tt="coef",et=t=>{class e{constructor(t={}){this.state={center:8},this.state=Object.assign(this.state,t)}get min(){return t(tt,this.state.center-4)}get xxs(){return t(tt,this.state.center-3)}get xs(){return t(tt,this.state.center-2)}get s(){return t(tt,this.state.center-1)}get m(){return t(tt,this.state.center)}get l(){return t(tt,this.state.center+1)}get xl(){return t(tt,this.state.center+2)}get xxl(){return t(tt,this.state.center+3)}get max(){return t(tt,this.state.center+4)}get $0_(){return new e({center:4})}get $1_(){return new e({center:12})}get $2_(){return new e({center:20})}get $16_(){return new e({center:28})}get $1(){return new e({center:8})}get $2(){return new e({center:16})}get $16(){return new e({center:24})}get short(){return{s:this.s,m:this.m,l:this.l}}get base(){return Object.assign(Object.assign({xs:this.xs},this.short),{xl:this.xl})}get long(){return Object.assign(Object.assign({xxs:this.xxs},this.base),{xxl:this.xxl})}get full(){return Object.assign(Object.assign({min:this.min},this.long),{max:this.max})}get sparse(){return{min:this.min,xs:this.xs,m:this.m,xl:this.xl,max:this.max}}}return new e},st=Object.assign,rt=Object.entries,nt=Array.isArray,it=(t,...e)=>e.length?e.reduce(((t,e)=>(rt(e).forEach((([e,s])=>{s&&"object"==typeof s&&t[e]?nt(t[e])&&nt(s)?t[e]=[...t[e],...s]:it(t[e],s||{}):t[e]=s})),t)),t):t,at={dash:(...t)=>t.join("-"),comma:(...t)=>t.join(),space:(...t)=>t.join(" "),range:(t,e)=>Array.from(Array(t).entries()).reduce(((t,[s])=>st(t,e(s+1))),{}),each:(t,e)=>rt(t).reduce(((t,[s,r])=>st(t,e(s,r))),{}),merge:it,when:(t,e,s={})=>t?e:s},lt="width: ",ct=t=>{const{scope:k,globalKey:w="",bp:S={}}=t,q=k(w).varExp,A=t=>q(...t.split(".")),E=(t=1)=>`calc(${t} * ${A("rtime")})`,P=(t=1)=>`calc(${t} * ${A("rangle")})`,z=(t=1)=>`calc(${t} * 1rem)`;return{compile:({key:t,maker:w})=>{const I=k(t),W=(t=>{const c={cp:1,lay:1,kf:1,cq:1},h=(s,r)=>{const n="string"==typeof r?r:t.name("cq",c.cq++),i=e+` ${n?n+" ":""}(${s})`;return{c:n,q:s,s:i,toString:()=>i}};h.toString=()=>e;const o=(e,r)=>{const n="--"+(e||t.name("cp",c.cp++)),i=s+" "+n;return{k:n,v:`var(${n})`,s:i,r:{[i]:{syntax:(null==r?void 0:r.syn)||'"*"',inherits:(null==r?void 0:r.inh)||!1,initialValue:null==r?void 0:r.ini}},toString:()=>i}};o.toString=()=>s;const u=e=>{const s=e||t.name("kf",c.kf++),n=r+" "+s;return{k:s,s:n,toString:()=>n}};u.toString=()=>r;const g=e=>{const s=e||t.name("lay",c.lay++),r=n+" "+s;return{k:s,s:r,toString:()=>r}};g.toString=()=>n,g.toString=()=>i;const d=(t="",e=!1)=>{const s=a+` ${e?"not ":""}(${t})`;return{c:t,n:e,s:s,toString:()=>s}};return d.toString=()=>a,{pr:o,kf:u,mq:l,cq:h,lay:g,sc:(t="",e="")=>{const s=i+` ${t?`(${t})`:""}${t&&e?" ":""}${e?`to (${e})`:""}`;return{r:t,l:e,s:s,toString:()=>s}},sup:d}})(I),F=t=>{const e=S[t]||t;return"number"==typeof e?e+"rem":""},K=t=>"min-"+lt+F(t),M=t=>"max-"+lt+F(t),B=(t,e)=>"string"==typeof e?W.cq(t,e):W.mq(t),L=(t,e,s)=>""+B(K(t)+") and ("+M(e),s),R={up:(t,e)=>""+B(K(t),e),down:(t,e)=>""+B(M(t),e),between:L,only:(t,e)=>L(t,t,e)};return H=w(Object.assign(at,{key:t,vars:A,size:z,time:E,angle:P,bem:I.selector,pseudo:Object.assign(O(_(C).map((([t,e])=>{function s(t=""){return t+e}return s.toString=()=>e,[t,s]}))),O(_(N).map((([t,e])=>{function s(t,s=""){return s+e+`(${t})`}return s.toString=()=>e,[t,s]})))),color:G(q),palette:Y(q),coef:et(q),units:{px:c,vh:h,vw:o,vmin:u,vmax:g,rem:d,deg:m,ms:p,pc:b,cqw:f,cqh:v,cqb:$,cqi:x,cqmin:y,cqmax:j},at:W,limit:R})),J(H,((t,e)=>t+U(...e)),"");var H}}};const ht=void 0,ot=Object.entries,ut=Object.assign,gt=Object.defineProperties,dt=t=>`data-${t}`,mt=t=>"string"==typeof t,pt=t=>null!==t&&"object"==typeof t,bt=(t,e)=>`${t}${e?"__"+e:""}`,ft=t=>t.split("."),vt=(t,e)=>ot(t).reduce(((t,[s,r])=>{if(pt(r)){const n=ot(r);n.length?t.push(...n.reduce(((t,[r,n])=>{if((t=>null!==t&&t!==ht)(r)&&e&&t.push([s,r,ht,ht]),pt(n)){const e=ot(n);e.length&&t.push(...e.reduce(((t,[e,n])=>{const i=typeof n;return"string"!==i&&"number"!==i||t.push([s,r,e,n]),t}),[]))}return t}),[])):t.push([s,ht,ht,ht])}return t}),[]),xt=(t,e,s,r)=>""+(bt(t,e)+(s?"_"+s:"")+(s&&r?"_"+r:"")),$t=(t,e,s,r)=>"."+xt(t,e,s,r),yt=(t,e,s,r)=>`[${dt(bt(t,e))}${s&&r?`~="${s}_${r}"`:s?`~="${s}"`:""}]`,jt={def:.75,c:.05,s:.65,m:.75,l:.85,n:.9},Ot="effcss-provider",_t={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null,angle:null},kt={l:{dark:{bg:{xl:.24,l:.3,m:.36,s:.42,xs:.48},fg:{xl:.98,l:.93,m:.86,s:.79,xs:.72}},light:{bg:{xl:.98,l:.93,m:.88,s:.83,xs:.78},fg:{xl:0,l:.12,m:.24,s:.36,xs:.48}}},c:{dark:{bg:{pale:.02,base:.06,rich:.1},fg:{pale:.06,base:.1,rich:.14}},light:{bg:{pale:.01,base:.04,rich:.7},fg:{pale:.07,base:.11,rich:.15}}},h:{pri:184,sec:290,suc:Number(146.2.toFixed(2)),inf:Number(256..toFixed(2)),war:Number((.1*184+.9*109).toFixed(2)),dan:Number(44.5.toFixed(2))}},wt=(t,e)=>{var s,r,n,i,a,l,c,h,o,u,g,d,m,p,b,f;return e?{l:{dark:{bg:ut(t.l.dark.bg,null===(r=null===(s=null==e?void 0:e.l)||void 0===s?void 0:s.dark)||void 0===r?void 0:r.bg),fg:ut(t.l.dark.fg,null===(i=null===(n=null==e?void 0:e.l)||void 0===n?void 0:n.dark)||void 0===i?void 0:i.fg)},light:{bg:ut(t.l.light.bg,null===(l=null===(a=null==e?void 0:e.l)||void 0===a?void 0:a.light)||void 0===l?void 0:l.bg),fg:ut(t.l.light.fg,null===(h=null===(c=null==e?void 0:e.l)||void 0===c?void 0:c.light)||void 0===h?void 0:h.fg)}},c:{dark:{bg:ut(t.c.dark.bg,null===(u=null===(o=null==e?void 0:e.c)||void 0===o?void 0:o.dark)||void 0===u?void 0:u.bg),fg:ut(t.c.dark.fg,null===(d=null===(g=null==e?void 0:e.c)||void 0===g?void 0:g.dark)||void 0===d?void 0:d.fg)},light:{bg:ut(t.c.light.bg,null===(p=null===(m=null==e?void 0:e.c)||void 0===m?void 0:m.light)||void 0===p?void 0:p.bg),fg:ut(t.c.light.fg,null===(f=null===(b=null==e?void 0:e.c)||void 0===b?void 0:b.light)||void 0===f?void 0:f.fg)}},h:ut(t.h,null==e?void 0:e.h)}:t},St={bp:{"3xs":18,"2xs":24,xs:30,sm:40,md:48,lg:64,xl:80,"2xl":96},vars:{"":{rtime:"200ms",rem:"16px",rangle:"30deg",l:jt,h:{def:261.35,b:261.35,i:194.77,e:29.23,w:70.66,s:142.49},c:{def:.03,xs:.03,s:.06,m:.1,l:.15,xl:.25},a:{def:1,min:0,xs:.1,s:.25,m:.5,l:.75,xl:.9,max:1},t:{def:300,xs:100,s:200,m:300,l:450,xl:600,no:0,min:50,max:750},int:[...Array(12).keys()],fr:{0:0,"1/12":"0.0833","1/10":"0.1","1/6":"0.1667","1/5":"0.2","1/4":"0.25","3/10":"0.3","1/3":"0.3333","2/5":"0.4","5/12":"0.4167","1/2":"0.5","7/12":"0.5833","3/5":"0.6","2/3":"0.6667","7/10":"0.7","3/4":"0.75","4/5":"0.8","5/6":"0.8333","9/10":"0.9","11/12":"0.9167",1:"1"},ar:{1:1,"2/1":2,"1/2":.5,"4/3":1.3333,"3/4":.75,"9/16":.5625,"16/9":1.7778}},light:{l:jt},dark:{l:{def:.4,n:.25,s:.3,m:.4,l:.5,c:.95}}},palette:kt,coef:{$0_:{xxs:.0625,xs:.125,s:.25,m:.5,l:.75,xl:.875,xxl:.9375},$1_:{xxs:1.0625,xs:1.125,s:1.25,m:1.5,l:1.75,xl:1.875,xxl:1.9375},$2_:{xxs:2.5,xs:4,s:5,m:7.5,l:10,xl:12,xxl:15},$16_:{xxs:20,xs:28,s:36,m:48,l:64,xl:80,xxl:120},max:150}},qt=({prefix:t})=>{let e=1;return{get base(){return t+0},get current(){return t+e},next(){return e++,this.current},reset(){e=1}}},At=()=>{const t=new Set,e=new Map;return{use(s,r){const n=e.get(s);return n||(t.add(r),e.set(s,r),r)},useMany(t){return ot(t).map((([t,e])=>this.use(e,t)))},getKey:t=>e.get(t),get keys(){return[...t]},get makers(){return Object.fromEntries(e.entries().map((([t,e])=>[e,t])))}}},Et="theme",Pt="size",zt="time",Ct="angle",Nt="palette",It=Object.assign,Wt=Object.entries,Ft=Object.fromEntries,Kt=(t,e)=>t.getAttribute(e)||_t[e],Mt=(t,e)=>{const s=Kt(t,e);return null!==s?Number(s):null},Bt=(t,e,s)=>null===s?t.removeAttribute(e):t.setAttribute(e,s+""),Lt=t=>`:root:has(script[is=${Ot}]${t?`[${t}]`:""})`,Rt=t=>[t.xxs,t.xs,t.s,t.m,t.l,t.xl,t.xxl],Ht=["xs","s","m","l","xl"],Tt=["pale","base","rich"];function Vt(t={}){const e=window.document,s=window.customElements;if(null==s?void 0:s.get(Ot))return!1;{class r extends HTMLScriptElement{constructor(){super(...arguments),this._c=At(),this._m=function(){let t={},e={},s=[],r=[];const n=(t,e)=>(e.toString=()=>"effcss-"+t,e),i=t=>{var e;return t.adoptedStyleSheets=[...(null===(e=t.adoptedStyleSheets)||void 0===e?void 0:e.length)?[...t.adoptedStyleSheets].filter((t=>!(t+"").startsWith("effcss-"))):[],...s]},a=()=>{r=r.reduce(((t,e)=>{const s=e.deref();return s&&(i(s),t.push(e)),t}),[])},l=t=>s.findIndex((e=>e===t)),c=e=>e?t[e]:void 0,h=(e,r)=>{if(!t[e])return t[e]=n(e,r),s.push(t[e]),a(),!0},o=t=>{const e=c(t);return!!e&&-1!==l(e)};return{apply:i,notify:a,getIndex:l,get:c,has:t=>!!t&&!!c(t),getAll:()=>t,add:h,status:o,on:(...t)=>{const e=t.reduce(((t,e)=>{const r=c(e);return!(!r||o(e))&&(s.push(r),t)}),!0);return a(),e},off:(...t)=>{const e=t.reduce(((t,e)=>{const r=c(e);if(r&&o(e)){const e=l(r);return s.splice(e,1),t}return!1}),!0);return a(),e},remove:r=>{const n=c(r);if(!n)return;const i=l(n);return i>-1&&(s.splice(i,1),delete t[r],delete e[r]),a(),!0},removeAll:()=>(s.splice(0),t={},e={},a(),!0),pack:(e,s)=>{let r=t[e]||new CSSStyleSheet;return r.replaceSync(s),r=n(e,r),!!r.cssRules.length&&h(e,r)},replace:(e,s)=>{const r=t[e];if(r)return r.replaceSync(s),a(),!0},register:t=>{r.findIndex((e=>e.deref()===t))>=0||(r.push(new WeakRef(t)),i(t))},unregister:t=>{const e=r.findIndex((e=>e.deref()===t));e>=0&&r.splice(e,1)}}}(),this._settings=St,this._cust=()=>{var t;const e=null===(t=this._settings)||void 0===t?void 0:t.vars,{varName:s}=this._s(this._k.base),r=t=>s("",t);function n(t,e){return Wt(t).reduce(((t,[r,i])=>i&&"object"==typeof i?It(t,n(i,[...e,r])):(t[s(...e,r)]=i,t)),{})}const i=Ft(Wt(e||{}).map((([t,e])=>[t,n(e,[])]))),{"":a={},dark:l,light:c}=i,h=function(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(s[r[n]]=t[r[n]])}return s}(i,["","dark","light"]),o=this.size,u=this.time,g=this.angle,{l:d,c:m,h:p}=this._settings.palette,b=this._settings.coef,f=[0,...Rt(b.$0_),1,...Rt(b.$1_),2,...Rt(b.$2_),16,...Rt(b.$16_)];this._=({bem:t,each:e,when:n,vars:l,merge:c,at:{mq:b},units:{px:v,ms:x,deg:$}})=>{const y="prefers-color-scheme",j={light:`${y}: light`,dark:`${y}: dark`};return c({[Lt()]:c({fontSize:l("rem")},a,e(f,((t,e)=>({[s("coef",t)]:e}))),e(p,((t,e)=>({[s(Nt,"h",t)]:e}))),{[s(Nt,"c","bg","gray")]:0,[s(Nt,"c","fg","gray")]:0},e(j,((t,r)=>({[b(r).s]:c(i[t]||{},e(Ht,((e,r)=>({[s(Nt,"l","bg",r)]:d[t].bg[r],[s(Nt,"l","fg",r)]:d[t].fg[r]}))),e(Tt,((e,r)=>({[s(Nt,"c","bg",r)]:m[t].bg[r],[s(Nt,"c","fg",r)]:m[t].fg[r]}))))}))))},e(h,((e,s)=>({[Lt(`${Et}=${e}`)]:s,[t(`..theme.${e}`)]:s}))),n(!!o,{[Lt(Pt)]:{[r("rem")]:v(o)}}),n(!!u,{[Lt(zt)]:{[r("rtime")]:x(u)}}),n(!!g,{[Lt(Ct)]:{[r("rangle")]:$(g)}}))},this.use(this._,this._k.base,!0)},this.use=(t,e,s)=>{const r=e||this._k.current;let n=this._c.use(t,r);return(s||this._m&&!this._m.has(e))&&this._m.pack(n,this.css(t,n)),e||this._k.next(),this.resolve(n)},this.usePublic=t=>Ft(Wt(t).map((([t,e])=>[t,this.use(e,t)]))),this.usePrivate=t=>t.map((t=>this.use(t))),this.resolve=t=>this._s(t||this._k.base).attr,this.css=(t,e)=>this._p.compile({key:e,maker:t}),this.status=t=>{const e=this.key(t);return!!e&&this._m.status(e)},this.on=(...t)=>this._m.on(...t.map(this.key)),this.off=(...t)=>this._m.off(...t.map(this.key)),this.key=t=>"string"==typeof t?t:this._c.getKey(t),this.stylesheets=(t=this._c.keys)=>t.map((t=>this._m.get(this.key(t))))}static get observedAttributes(){return[Pt,zt,Ct]}get prefix(){return Kt(this,"prefix")||""}get mode(){return Kt(this,"mode")}get hydrate(){return""===this.getAttribute("hydrate")}get settings(){return this._settings}set settings(t){var e,s,r;const n=It({},this._settings,t,{palette:wt(this._settings.palette,null==t?void 0:t.palette)}),{makers:i,vars:a,bp:l,off:c,palette:h}=n;(l&&(null===(e=this._settings)||void 0===e?void 0:e.bp)!==l||!this._p)&&(this._p=ct({scope:this._s,globalKey:this._k.base,bp:l})),i&&(null===(s=this._settings)||void 0===s?void 0:s.makers)!==i&&(this._c.useMany(i),this.usePublic(i),(null==c?void 0:c.length)&&this._settings.off!==c&&this.off(...c),this.hydrate&&this._k.reset()),this._settings=n,(!(null===(r=this._m)||void 0===r?void 0:r.has(this._k.base))||t.vars||t.palette||t.coef)&&this._cust()}set theme(t){Bt(this,Et,t)}get theme(){return Kt(this,Et)||""}set size(t){Bt(this,Pt,t)}get size(){return Mt(this,Pt)}set time(t){Bt(this,"time",t)}get time(){return Mt(this,zt)}set angle(t){Bt(this,"angle",t)}get angle(){return Mt(this,Ct)}attributeChangedCallback(){this._k&&this._cust()}connectedCallback(){this._k=qt({prefix:this.prefix}),this._s=((t={})=>{const{mode:e}=t;let s,r;return t=>{const n=(...e)=>""+e.filter(Boolean).reduce(((t,e)=>`${t}-${e}`),t),i=(...t)=>"--"+n(...t);return"c"===e?(s=t=>{let e,s,r,i;return mt(t)?([e,s,r,i]=ft(t),$t(n(e),s,r,i)):t&&vt(t).map((([t,e,s,r])=>$t(n(t),e,s,r))).join(",")},r=t=>{let e,s,r,i;const a="class";let l="";return Array.isArray(t)?l=[...t.reduce(((t,a)=>([e,s,r,i]=ft(a),t.add(xt(n(e),s)),r&&t.add(xt(n(e),s,r,i)),t)),new Set).values()].join(" "):mt(t)?([e,s,r,i]=ft(t),l=xt(n(e),s,r,i)):l=t&&vt(t,!0).map((([t,e,s,r])=>xt(n(t),e,s,r))).join(" "),gt({[a]:l},{toString:{value:()=>`${a}="${l}"`}})}):(s=t=>{let e,s,r,i;return mt(t)?([e,s,r,i]=ft(t),yt(n(e),s,r,i)):t&&vt(t).map((([t,e,s,r])=>yt(n(t),e,s,r))).join(",")},r=t=>{let e,s,r,i,a,l,c="";if(Array.isArray(t))l=t.reduce(((t,l)=>{[e,s,r,i]=ft(l);const h=bt(n(e),s);return a=dt(h),c=r?i?`${r}_${i}`:`${r}`:"",t[a]&&c?t[a]=t[a]+" "+c:t[a]=c,t}),{});else if(mt(t)){[e,s,r,i]=ft(t);const h=bt(n(e),s);a=dt(h),c=r?i?`${r}_${i}`:`${r}`:"",l={[a]:c}}else l=t&&vt(t,!0).reduce(((t,[e,s,r,i])=>{const l=bt(n(e),s);a=dt(l);const h=r?i?`${r}_${i}`:`${r}`:"";return c=t[a]?t[a]+" "+h:h,t[a]=c,t}),{});return gt(l,{toString:{value:()=>ot(l).map((([t,e])=>`${t}="${e}"`)).join(" ")}}),l}),{selector:s,attr:r,name:n,varName:i,varExp:(...t)=>`var(${i(...t)})`}}})({mode:this.mode});const s=this;this._n={set adoptedStyleSheets(t){s.dispatchEvent(new CustomEvent("effcsschanges",{detail:{styles:t},bubbles:!0}))}},this._m.register(this._n),this._m.register(e),this.settings=t}toString(){return`<script ${[...this.attributes].map((t=>t.value?`${t.name}="${t.value}"`:""===t.value?t.name:"")).filter(Boolean).join(" ")}>${this.textContent}<\/script>`}}return s.define(Ot,r,{extends:"script"}),!0}}export{Vt as defineProvider};
|
|
7
|
+
"function"==typeof SuppressedError&&SuppressedError;const t=void 0,e=Object.entries,s=Array.isArray,r=Object.defineProperties,n=t=>`data-${t}`,i=t=>"string"==typeof t,a=t=>null!==t&&"object"==typeof t,c=(t,e)=>`${t}${e?"__"+e:""}`,l=t=>t.split("."),h=(s,r)=>e(s).reduce(((s,[n,i])=>{if(a(i)){const c=e(i);c.length?s.push(...c.reduce(((s,[i,c])=>{if((e=>null!==e&&e!==t)(i)&&r&&s.push([n,i,t,t]),a(c)){const t=e(c);t.length&&s.push(...t.reduce(((t,[e,s])=>{const r=typeof s;return"string"!==r&&"number"!==r||t.push([n,i,e,s]),t}),[]))}return s}),[])):s.push([n,t,t,t])}return s}),[]),o=(t,e,s,r)=>""+(c(t,e)+(s?"_"+s:"")+(s&&r?"_"+r:"")),u=(t,e,s,r)=>"."+o(t,e,s,r),g=(t,e,s,r)=>`[${n(c(t,e))}${s&&r?`~="${s}_${r}"`:s?`~="${s}"`:""}]`,m=(t,...r)=>r.length?r.reduce(((t,r)=>(e(r).forEach((([e,r])=>{r&&"object"==typeof r&&t[e]?s(t[e])&&s(r)?t[e]=[...t[e],...r]:m(t[e],r||{}):t[e]=r})),t)),t):t,p={def:.75,c:.05,s:.65,m:.75,l:.85,n:.9},d="effcss-provider",b={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null,angle:null},f={l:{dark:{bg:{xl:.24,l:.3,m:.36,s:.42,xs:.48},fg:{xl:.98,l:.93,m:.86,s:.79,xs:.72}},light:{bg:{xl:.98,l:.93,m:.88,s:.83,xs:.78},fg:{xl:0,l:.12,m:.24,s:.36,xs:.48}}},c:{dark:{bg:{pale:.02,base:.06,rich:.1},fg:{pale:.06,base:.1,rich:.14}},light:{bg:{pale:.01,base:.04,rich:.7},fg:{pale:.07,base:.11,rich:.15}}},h:{pri:184,sec:290,suc:Number(146.2.toFixed(2)),inf:Number(256..toFixed(2)),war:Number((.1*184+.9*109).toFixed(2)),dan:Number(44.5.toFixed(2))}},x={bp:{"3xs":18,"2xs":24,xs:30,sm:40,md:48,lg:64,xl:80,"2xl":96},vars:{"":{rtime:"200ms",rem:"16px",rangle:"30deg",l:p,h:{def:261.35,b:261.35,i:194.77,e:29.23,w:70.66,s:142.49},c:{def:.03,xs:.03,s:.06,m:.1,l:.15,xl:.25},a:{def:1,min:0,xs:.1,s:.25,m:.5,l:.75,xl:.9,max:1},t:{def:300,xs:100,s:200,m:300,l:450,xl:600,no:0,min:50,max:750},int:[...Array(12).keys()],fr:{0:0,"1/12":"0.0833","1/10":"0.1","1/6":"0.1667","1/5":"0.2","1/4":"0.25","3/10":"0.3","1/3":"0.3333","2/5":"0.4","5/12":"0.4167","1/2":"0.5","7/12":"0.5833","3/5":"0.6","2/3":"0.6667","7/10":"0.7","3/4":"0.75","4/5":"0.8","5/6":"0.8333","9/10":"0.9","11/12":"0.9167",1:"1"},ar:{1:1,"2/1":2,"1/2":.5,"4/3":1.3333,"3/4":.75,"9/16":.5625,"16/9":1.7778}},light:{l:p},dark:{l:{def:.4,n:.25,s:.3,m:.4,l:.5,c:.95}}},palette:f,coef:{$0_:{xxs:.0625,xs:.125,s:.25,m:.5,l:.75,xl:.875,xxl:.9375},$1_:{xxs:1.0625,xs:1.125,s:1.25,m:1.5,l:1.75,xl:1.875,xxl:1.9375},$2_:{xxs:2.5,xs:4,s:5,m:7.5,l:10,xl:12,xxl:15},$16_:{xxs:20,xs:28,s:36,m:48,l:64,xl:80,xxl:120},max:150}},$=({prefix:t})=>{let e=1;return{get base(){return t+0},get current(){return t+e},next(){return e++,this.current},reset(){e=1}}},y=()=>{const t=new Set,s=new Map;return{use(e,r){const n=s.get(e);return n||(t.add(r),s.set(e,r),r)},useMany(t){return e(t).map((([t,e])=>this.use(e,t)))},getKey:t=>s.get(t),get keys(){return[...t]},get makers(){return Object.fromEntries(s.entries().map((([t,e])=>[e,t])))}}},v="@media",j="@container",O="@property",_="@keyframes",w="@layer",k="@scope",S="@supports",q=(t,e)=>{const s=v+` ${e||""}${e?" and ":""}(${t})`;return{s:s,q:t,t:e,toString:()=>s}};q.toString=()=>v;const A=t=>t+"px",E=t=>t+"vh",P=t=>t+"vw",z=t=>t+"vmin",C=t=>t+"vmax",N=t=>t+"rem",I=t=>t+"deg",W=t=>t+"ms",F=t=>t+"%",K=t=>t+"cqw",M=t=>t+"cqh",B=t=>t+"cqi",L=t=>t+"cqb",R=t=>t+"cqmin",H=t=>t+"cqmax",T=Object.fromEntries,V=Object.entries,Z=":first-",D=":last-",G=":only-",J="child",Q=":nth-",U="of-type",X=Q+J,Y=":focus",tt={r:":root",h:":hover",f:Y,fv:Y+"-visible",a:":active",v:":visited",val:":valid",inv:":invalid",e:":empty",d:":disabled",rq:":required",o:":optional",m:":modal",l:":link",ph:":placeholder",ch:":checked",po:":popover-open",fc:Z+J,lc:D+J,oc:G+J,odd:X+"(odd)",even:X+"(even)",ft:Z+U,lt:D+U,ot:G+U,bef:"::before",aft:"::after",bd:"::backdrop"},et={has:":has",not:":not",is:":is",wh:":where",st:":state",nthc:X,ntho:Q+U,dir:":dir",lang:":lang"},st="oklch",rt=t=>st+`(${t})`,nt=t=>rt(`from ${t}`),it="def",at=t=>{const e=(e,s)=>"string"==typeof s?t(e,s):s;class s{constructor(t={}){this.state={l:e("l",it),c:e("c",it),h:e("h",it),a:e("a",it)},this.merge=t=>new s(Object.assign(this.state,t)),this.l=t=>this.merge({l:e("l",t)}),this.c=t=>this.merge({c:e("c",t)}),this.h=t=>this.merge({h:e("h",t)}),this.a=t=>this.merge({a:e("a",t)}),this.state=Object.assign(this.state,t)}get s(){return this.toString()}toString(){const{l:t,c:e,h:s,a:r}=this.state;return rt(`${t} ${e} ${s} / ${r}`)}}return t=>new s(t)},ct=(t,e=.1)=>nt(`${t} calc(l + ${e}) c h / alpha)`),lt=(t,e=.1)=>nt(`${t} calc(l - ${e}) c h / alpha)`),ht=(t,e=.1)=>nt(`${t} l c h / calc(alpha + ${e}))`),ot=(t,e=.1)=>nt(`${t} l c h / calc(alpha - ${e}))`),ut=(t,e=.04)=>nt(`${t} l calc(c + ${e}) h / alpha)`),gt=(t,e=.04)=>nt(`${t} l calc(c - ${e}) h / alpha)`),mt=(t,e=30)=>nt(`${t} l c calc(h${"number"==typeof e?e>0?" + "+e:" - "+-e:e}) / alpha)`),pt=({base:t,mixin:e,method:s,bpart:r,mpart:n})=>`color-mix(in ${s||st}, ${t}${void 0!==r?` ${r}%`:""}, ${e}${void 0!==n?` ${n}%`:""})`,dt=t=>({create:at(t),oklch:rt,lighten:ct,darken:lt,saturate:ut,desaturate:gt,fadein:ht,fadeout:ot,spin:mt,mix:pt}),bt=(t,e,s)=>Object.entries(t).reduce(e,s),ft=Symbol("noParse"),xt=(t,e,s)=>{var r,n,i;let a=""+t;return null==e?"":"object"!=typeof e||e.hasOwnProperty(ft)?`${c=a,c.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}:${""+e};`:(!s||(null===(r=s.startsWith)||void 0===r?void 0:r.call(s,"@"))||(null===(n=a.startsWith)||void 0===n?void 0:n.call(a,"&"))||(null===(i=a.startsWith)||void 0===i?void 0:i.call(a,"@"))?"":"&")+a+`{${bt(e,((t,e)=>t+xt(...e,a)),"")}}`;var c},$t="palette",yt=t=>{class e{constructor(t={}){this.state={l:"l",c:"base",h:"pri",a:1,m:"bg"},Object.assign(this,{[ft]:!0}),this.state=Object.assign(this.state,t)}get xs(){return new e(Object.assign(Object.assign({},this.state),{l:"xs"}))}get s(){return new e(Object.assign(Object.assign({},this.state),{l:"s"}))}get m(){return new e(Object.assign(Object.assign({},this.state),{l:"m"}))}get l(){return new e(Object.assign(Object.assign({},this.state),{l:"l"}))}get xl(){return new e(Object.assign(Object.assign({},this.state),{l:"xl"}))}get lightness(){return{xs:this.xs,s:this.s,m:this.m,l:this.l,xl:this.xl}}get gray(){return new e(Object.assign(Object.assign({},this.state),{c:"gray"}))}get pale(){return new e(Object.assign(Object.assign({},this.state),{c:"pale"}))}get base(){return new e(Object.assign(Object.assign({},this.state),{c:"base"}))}get rich(){return new e(Object.assign(Object.assign({},this.state),{c:"rich"}))}get chroma(){return{gray:this.gray,pale:this.pale,base:this.base,rich:this.rich}}get pri(){return new e(Object.assign(Object.assign({},this.state),{h:"pri"}))}get sec(){return new e(Object.assign(Object.assign({},this.state),{h:"sec"}))}get suc(){return new e(Object.assign(Object.assign({},this.state),{h:"suc"}))}get inf(){return new e(Object.assign(Object.assign({},this.state),{h:"inf"}))}get war(){return new e(Object.assign(Object.assign({},this.state),{h:"war"}))}get dan(){return new e(Object.assign(Object.assign({},this.state),{h:"dan"}))}get hue(){return{pri:this.pri,sec:this.sec,suc:this.suc,inf:this.inf,war:this.war,dan:this.dan}}alpha(t=1){return new e(Object.assign(Object.assign({},this.state),{a:t}))}get bg(){return new e(Object.assign(Object.assign({},this.state),{m:"bg"}))}get fg(){return new e(Object.assign(Object.assign({},this.state),{m:"fg"}))}toString(){const{l:e,c:s,h:r,a:n,m:i}=this.state;return`oklch(${t($t,"l",i,e)} ${t($t,"c",i,s)} ${t($t,"h",r)} / ${n})`}}return new e},vt="coef",jt=t=>{class e{constructor(t={}){this.state={center:8},this.state=Object.assign(this.state,t)}get min(){return t(vt,this.state.center-4)}get xxs(){return t(vt,this.state.center-3)}get xs(){return t(vt,this.state.center-2)}get s(){return t(vt,this.state.center-1)}get m(){return t(vt,this.state.center)}get l(){return t(vt,this.state.center+1)}get xl(){return t(vt,this.state.center+2)}get xxl(){return t(vt,this.state.center+3)}get max(){return t(vt,this.state.center+4)}get $0_(){return new e({center:4})}get $1_(){return new e({center:12})}get $2_(){return new e({center:20})}get $16_(){return new e({center:28})}get $1(){return new e({center:8})}get $2(){return new e({center:16})}get $16(){return new e({center:24})}get short(){return{s:this.s,m:this.m,l:this.l}}get base(){return Object.assign(Object.assign({xs:this.xs},this.short),{xl:this.xl})}get long(){return Object.assign(Object.assign({xxs:this.xxs},this.base),{xxl:this.xxl})}get full(){return Object.assign(Object.assign({min:this.min},this.long),{max:this.max})}get main(){return{min:this.min,m:this.m,max:this.max}}get sparse(){return{min:this.min,xs:this.xs,m:this.m,xl:this.xl,max:this.max}}}return new e},Ot=Object.assign,_t=Object.entries,wt={dash:(...t)=>t.join("-"),comma:(...t)=>t.join(),space:(...t)=>t.join(" "),range:(t,e)=>Array.from(Array(t).entries()).reduce(((t,[s])=>Ot(t,e(s+1))),{}),each:(t,e)=>_t(t).reduce(((t,[s,r])=>Ot(t,e(s,r))),{}),when:(t,e,s={})=>t?e:s},kt="width: ",St=t=>{const{scope:e,globalKey:s="",bp:r={}}=t,n=e(s).varExp,i=t=>n(...t.split(".")),a=(t=1)=>`calc(${t} * ${i("rtime")})`,c=(t=1)=>`calc(${t} * ${i("rangle")})`,l=(t=1)=>`calc(${t} * 1rem)`;return{compile:({key:t,maker:s})=>{const h=e(t),o=(t=>{const e={cp:1,lay:1,kf:1,cq:1},s=(s,r)=>{const n="string"==typeof r?r:t.name("cq",e.cq++),i=j+` ${n?n+" ":""}(${s})`;return{c:n,q:s,s:i,toString:()=>i}};s.toString=()=>j;const r=(s,r)=>{const n="--"+(s||t.name("cp",e.cp++)),i=O+" "+n;return{k:n,v:`var(${n})`,s:i,r:{[i]:{syntax:(null==r?void 0:r.syn)||'"*"',inherits:(null==r?void 0:r.inh)||!1,initialValue:null==r?void 0:r.ini}},toString:()=>i}};r.toString=()=>O;const n=s=>{const r=s||t.name("kf",e.kf++),n=_+" "+r;return{k:r,s:n,toString:()=>n}};n.toString=()=>_;const i=s=>{const r=s||t.name("lay",e.lay++),n=w+" "+r;return{k:r,s:n,toString:()=>n}};i.toString=()=>w,i.toString=()=>k;const a=(t="",e=!1)=>{const s=S+` ${e?"not ":""}(${t})`;return{c:t,n:e,s:s,toString:()=>s}};return a.toString=()=>S,{pr:r,kf:n,mq:q,cq:s,lay:i,sc:(t="",e="")=>{const s=k+` ${t?`(${t})`:""}${t&&e?" ":""}${e?`to (${e})`:""}`;return{r:t,l:e,s:s,toString:()=>s}},sup:a}})(h),u=t=>{const e=r[t]||t;return"number"==typeof e?e+"rem":""},g=t=>"min-"+kt+u(t),p=t=>"max-"+kt+u(t),d=(t,e)=>"string"==typeof e?o.cq(t,e):o.mq(t),b=(t,e,s)=>""+d(g(t)+") and ("+p(e),s),f={up:(t,e)=>""+d(g(t),e),down:(t,e)=>""+d(p(t),e),between:b,only:(t,e)=>b(t,t,e)};return x=s(Object.assign(wt,{key:t,vars:i,size:l,time:a,angle:c,bem:h.selector,pseudo:Object.assign(T(V(tt).map((([t,e])=>{function s(t=""){return t+e}return s.toString=()=>e,[t,s]}))),T(V(et).map((([t,e])=>{function s(t,s=""){return s+e+`(${t})`}return s.toString=()=>e,[t,s]})))),color:dt(n),palette:yt(n),coef:jt(n),units:{px:A,vh:E,vw:P,vmin:z,vmax:C,rem:N,deg:I,ms:W,pc:F,cqw:K,cqh:M,cqb:L,cqi:B,cqmin:R,cqmax:H},at:o,limit:f,merge:m})),bt(x,((t,e)=>t+xt(...e)),"");var x}}};const qt="theme",At="size",Et="time",Pt="angle",zt="palette",Ct=Object.assign,Nt=Object.entries,It=Object.fromEntries,Wt=(t,e)=>t.getAttribute(e)||b[e],Ft=(t,e)=>{const s=Wt(t,e);return null!==s?Number(s):null},Kt=(t,e,s)=>null===s?t.removeAttribute(e):t.setAttribute(e,s+""),Mt=t=>`:root:has(script[is=${d}]${t?`[${t}]`:""})`,Bt=t=>[t.xxs,t.xs,t.s,t.m,t.l,t.xl,t.xxl],Lt=["xs","s","m","l","xl"],Rt=["pale","base","rich"];function Ht(t={}){const s=window.document,a=window.customElements;if(null==a?void 0:a.get(d))return!1;{class p extends HTMLScriptElement{constructor(){super(...arguments),this._c=y(),this._m=function(){let t={},e={},s=[],r=[];const n=(t,e)=>(e.toString=()=>"effcss-"+t,e),i=t=>{var e;return t.adoptedStyleSheets=[...(null===(e=t.adoptedStyleSheets)||void 0===e?void 0:e.length)?[...t.adoptedStyleSheets].filter((t=>!(t+"").startsWith("effcss-"))):[],...s]},a=()=>{r=r.reduce(((t,e)=>{const s=e.deref();return s&&(i(s),t.push(e)),t}),[])},c=t=>s.findIndex((e=>e===t)),l=e=>e?t[e]:void 0,h=(e,r)=>{if(!t[e])return t[e]=n(e,r),s.push(t[e]),a(),!0},o=t=>{const e=l(t);return!!e&&-1!==c(e)};return{apply:i,notify:a,getIndex:c,get:l,has:t=>!!t&&!!l(t),getAll:()=>t,add:h,status:o,on:(...t)=>{const e=t.reduce(((t,e)=>{const r=l(e);return!(!r||o(e))&&(s.push(r),t)}),!0);return a(),e},off:(...t)=>{const e=t.reduce(((t,e)=>{const r=l(e);if(r&&o(e)){const e=c(r);return s.splice(e,1),t}return!1}),!0);return a(),e},remove:r=>{const n=l(r);if(!n)return;const i=c(n);return i>-1&&(s.splice(i,1),delete t[r],delete e[r]),a(),!0},removeAll:()=>(s.splice(0),t={},e={},a(),!0),pack:(e,s)=>{let r=t[e]||new CSSStyleSheet;return r.replaceSync(s),r=n(e,r),!!r.cssRules.length&&h(e,r)},replace:(e,s)=>{const r=t[e];if(r)return r.replaceSync(s),a(),!0},register:t=>{r.findIndex((e=>e.deref()===t))>=0||(r.push(new WeakRef(t)),i(t))},unregister:t=>{const e=r.findIndex((e=>e.deref()===t));e>=0&&r.splice(e,1)}}}(),this._settings=x,this._cust=()=>{var t;const e=null===(t=this._settings)||void 0===t?void 0:t.vars,{varName:s}=this._s(this._k.base),r=t=>s("",t);function n(t,e){return Nt(t).reduce(((t,[r,i])=>i&&"object"==typeof i?Ct(t,n(i,[...e,r])):(t[s(...e,r)]=i,t)),{})}const i=It(Nt(e||{}).map((([t,e])=>[t,n(e,[])]))),{"":a={},dark:c,light:l}=i,h=function(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(t);n<r.length;n++)e.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(s[r[n]]=t[r[n]])}return s}(i,["","dark","light"]),o=this.size,u=this.time,g=this.angle,{l:m,c:p,h:d}=this._settings.palette,b=this._settings.coef,f=[0,...Bt(b.$0_),1,...Bt(b.$1_),2,...Bt(b.$2_),16,...Bt(b.$16_),b.max];this._=({bem:t,each:e,when:n,vars:c,merge:l,at:{mq:b},units:{px:x,ms:$,deg:y}})=>{const v="prefers-color-scheme",j={light:`${v}: light`,dark:`${v}: dark`};return l({[Mt()]:l({fontSize:c("rem")},a,e(f,((t,e)=>({[s("coef",t)]:e}))),e(d,((t,e)=>({[s(zt,"h",t)]:e}))),{[s(zt,"c","bg","gray")]:0,[s(zt,"c","fg","gray")]:0},e(j,((t,r)=>({[b(r).s]:l(i[t]||{},e(Lt,((e,r)=>({[s(zt,"l","bg",r)]:m[t].bg[r],[s(zt,"l","fg",r)]:m[t].fg[r]}))),e(Rt,((e,r)=>({[s(zt,"c","bg",r)]:p[t].bg[r],[s(zt,"c","fg",r)]:p[t].fg[r]}))))}))))},e(h,((e,s)=>({[Mt(`${qt}=${e}`)]:s,[t(`..theme.${e}`)]:s}))),n(!!o,{[Mt(At)]:{[r("rem")]:x(o)}}),n(!!u,{[Mt(Et)]:{[r("rtime")]:$(u)}}),n(!!g,{[Mt(Pt)]:{[r("rangle")]:y(g)}}))},this.use(this._,this._k.base,!0)},this.use=(t,e,s)=>{const r=e||this._k.current;let n=this._c.use(t,r);return(s||this._m&&!this._m.has(e))&&this._m.pack(n,this.css(t,n)),e||this._k.next(),this.resolve(n)},this.usePublic=t=>It(Nt(t).map((([t,e])=>[t,this.use(e,t)]))),this.usePrivate=t=>t.map((t=>this.use(t))),this.resolve=t=>this._s(t||this._k.base).attr,this.css=(t,e)=>this._p.compile({key:e,maker:t}),this.status=t=>{const e=this.key(t);return!!e&&this._m.status(e)},this.on=(...t)=>this._m.on(...t.map(this.key)),this.off=(...t)=>this._m.off(...t.map(this.key)),this.key=t=>"string"==typeof t?t:this._c.getKey(t),this.stylesheets=(t=this._c.keys)=>t.map((t=>this._m.get(this.key(t))))}static get observedAttributes(){return[At,Et,Pt]}get prefix(){return Wt(this,"prefix")||""}get mode(){return Wt(this,"mode")}get hydrate(){return""===this.getAttribute("hydrate")}get settings(){return this._settings}set settings(t){var e,s,r;const n=m({},this._settings,t),{makers:i,bp:a,off:c}=n;(a&&(null===(e=this._settings)||void 0===e?void 0:e.bp)!==a||!this._p)&&(this._p=St({scope:this._s,globalKey:this._k.base,bp:a})),i&&(null===(s=this._settings)||void 0===s?void 0:s.makers)!==i&&(this._c.useMany(i),this.usePublic(i),(null==c?void 0:c.length)&&this._settings.off!==c&&this.off(...c),this.hydrate&&this._k.reset()),this._settings=n,(!(null===(r=this._m)||void 0===r?void 0:r.has(this._k.base))||t.vars||t.palette||t.coef)&&this._cust()}set theme(t){Kt(this,qt,t)}get theme(){return Wt(this,qt)||""}set size(t){Kt(this,At,t)}get size(){return Ft(this,At)}set time(t){Kt(this,"time",t)}get time(){return Ft(this,Et)}set angle(t){Kt(this,"angle",t)}get angle(){return Ft(this,Pt)}attributeChangedCallback(){this._k&&this._cust()}connectedCallback(){this._k=$({prefix:this.prefix}),this._s=((t={})=>{const{mode:s}=t;let a,m;return t=>{const p=(...e)=>""+e.filter(Boolean).reduce(((t,e)=>`${t}-${e}`),t),d=(...t)=>"--"+p(...t);return"c"===s?(a=t=>{let e,s,r,n;return i(t)?([e,s,r,n]=l(t),u(p(e),s,r,n)):t&&h(t).map((([t,e,s,r])=>u(p(t),e,s,r))).join(",")},m=t=>{let e,s,n,a;const c="class";let u="";return Array.isArray(t)?u=[...t.reduce(((t,r)=>([e,s,n,a]=l(r),t.add(o(p(e),s)),n&&t.add(o(p(e),s,n,a)),t)),new Set).values()].join(" "):i(t)?([e,s,n,a]=l(t),u=o(p(e),s,n,a)):u=t&&h(t,!0).map((([t,e,s,r])=>o(p(t),e,s,r))).join(" "),r({[c]:u},{toString:{value:()=>`${c}="${u}"`}})}):(a=t=>{let e,s,r,n;return i(t)?([e,s,r,n]=l(t),g(p(e),s,r,n)):t&&h(t).map((([t,e,s,r])=>g(p(t),e,s,r))).join(",")},m=t=>{let s,a,o,u,g,m,d="";if(Array.isArray(t))m=t.reduce(((t,e)=>{[s,a,o,u]=l(e);const r=c(p(s),a);return g=n(r),d=o?u?`${o}_${u}`:`${o}`:"",t[g]&&d?t[g]=t[g]+" "+d:t[g]=d,t}),{});else if(i(t)){[s,a,o,u]=l(t);const e=c(p(s),a);g=n(e),d=o?u?`${o}_${u}`:`${o}`:"",m={[g]:d}}else m=t&&h(t,!0).reduce(((t,[e,s,r,i])=>{const a=c(p(e),s);g=n(a);const l=r?i?`${r}_${i}`:`${r}`:"";return d=t[g]?t[g]+" "+l:l,t[g]=d,t}),{});return r(m,{toString:{value:()=>e(m).map((([t,e])=>`${t}="${e}"`)).join(" ")}}),m}),{selector:a,attr:m,name:p,varName:d,varExp:(...t)=>`var(${d(...t)})`}}})({mode:this.mode});const a=this;this._n={set adoptedStyleSheets(t){a.dispatchEvent(new CustomEvent("effcsschanges",{detail:{styles:t},bubbles:!0}))}},this._m.register(this._n),this._m.register(s),this.settings=t}toString(){return`<script ${[...this.attributes].map((t=>t.value?`${t.name}="${t.value}"`:""===t.value?t.name:"")).filter(Boolean).join(" ")}>${this.textContent}<\/script>`}}return a.define(d,p,{extends:"script"}),!0}}export{Ht as defineProvider};
|
|
@@ -6,7 +6,6 @@ export declare const getBaseHandlers: () => {
|
|
|
6
6
|
space: TJoinArr;
|
|
7
7
|
range: (size: number, handler: (k: number) => object) => object;
|
|
8
8
|
each: <V extends Record<TStrOrNum, any>>(rules: V, handler: (k: V extends ArrayLike<any> ? string : keyof V, v: V extends ArrayLike<any> ? NoInfer<V[number]> : NoInfer<V[keyof V]>) => object) => object;
|
|
9
|
-
merge: (target: Record<string, any>, ...sources: Record<string, any>[]) => Record<string, any>;
|
|
10
9
|
when: (condition: boolean | undefined, rules: object, otherwise?: object) => object;
|
|
11
10
|
};
|
|
12
11
|
export {};
|
|
@@ -1,127 +1,2 @@
|
|
|
1
|
-
import { TCreateScope } from '../../common';
|
|
2
|
-
export declare const resolveCoef: (varExp: ReturnType<ReturnType<TCreateScope>>["varExp"]) =>
|
|
3
|
-
/**
|
|
4
|
-
* Coefficient state
|
|
5
|
-
*/
|
|
6
|
-
state: {
|
|
7
|
-
center: number;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Returns `xxs` coefficient
|
|
11
|
-
*/
|
|
12
|
-
readonly min: string;
|
|
13
|
-
/**
|
|
14
|
-
* Returns `xxs` coefficient
|
|
15
|
-
*/
|
|
16
|
-
readonly xxs: string;
|
|
17
|
-
/**
|
|
18
|
-
* Returns `xs` coefficient
|
|
19
|
-
*/
|
|
20
|
-
readonly xs: string;
|
|
21
|
-
/**
|
|
22
|
-
* Returns `s` coefficient
|
|
23
|
-
*/
|
|
24
|
-
readonly s: string;
|
|
25
|
-
/**
|
|
26
|
-
* Returns `m` coefficient
|
|
27
|
-
*/
|
|
28
|
-
readonly m: string;
|
|
29
|
-
/**
|
|
30
|
-
* Returns `l` coefficient
|
|
31
|
-
*/
|
|
32
|
-
readonly l: string;
|
|
33
|
-
/**
|
|
34
|
-
* Returns `xl` coefficient
|
|
35
|
-
*/
|
|
36
|
-
readonly xl: string;
|
|
37
|
-
/**
|
|
38
|
-
* Returns `xxl` coefficient
|
|
39
|
-
*/
|
|
40
|
-
readonly xxl: string;
|
|
41
|
-
/**
|
|
42
|
-
* Returns `xxl` coefficient
|
|
43
|
-
*/
|
|
44
|
-
readonly max: string;
|
|
45
|
-
/**
|
|
46
|
-
* Range from 0 to 1
|
|
47
|
-
*/
|
|
48
|
-
readonly $0_: /*elided*/ any;
|
|
49
|
-
/**
|
|
50
|
-
* Range from 1 to 2
|
|
51
|
-
*/
|
|
52
|
-
readonly $1_: /*elided*/ any;
|
|
53
|
-
/**
|
|
54
|
-
* Range from 2 to 16
|
|
55
|
-
*/
|
|
56
|
-
readonly $2_: /*elided*/ any;
|
|
57
|
-
/**
|
|
58
|
-
* Range from 16 to the end
|
|
59
|
-
*/
|
|
60
|
-
readonly $16_: /*elided*/ any;
|
|
61
|
-
/**
|
|
62
|
-
* Range around 1
|
|
63
|
-
*/
|
|
64
|
-
readonly $1: /*elided*/ any;
|
|
65
|
-
/**
|
|
66
|
-
* Range around 2
|
|
67
|
-
*/
|
|
68
|
-
readonly $2: /*elided*/ any;
|
|
69
|
-
/**
|
|
70
|
-
* Range around 16
|
|
71
|
-
*/
|
|
72
|
-
readonly $16: /*elided*/ any;
|
|
73
|
-
/**
|
|
74
|
-
* Short range dictionary
|
|
75
|
-
*/
|
|
76
|
-
readonly short: {
|
|
77
|
-
s: string;
|
|
78
|
-
m: string;
|
|
79
|
-
l: string;
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* Base range dictionary
|
|
83
|
-
*/
|
|
84
|
-
readonly base: {
|
|
85
|
-
xl: string;
|
|
86
|
-
s: string;
|
|
87
|
-
m: string;
|
|
88
|
-
l: string;
|
|
89
|
-
xs: string;
|
|
90
|
-
};
|
|
91
|
-
/**
|
|
92
|
-
* Long range dictionary
|
|
93
|
-
*/
|
|
94
|
-
readonly long: {
|
|
95
|
-
xxl: string;
|
|
96
|
-
xl: string;
|
|
97
|
-
s: string;
|
|
98
|
-
m: string;
|
|
99
|
-
l: string;
|
|
100
|
-
xs: string;
|
|
101
|
-
xxs: string;
|
|
102
|
-
};
|
|
103
|
-
/**
|
|
104
|
-
* Full range dictionary
|
|
105
|
-
*/
|
|
106
|
-
readonly full: {
|
|
107
|
-
max: string;
|
|
108
|
-
xxl: string;
|
|
109
|
-
xl: string;
|
|
110
|
-
s: string;
|
|
111
|
-
m: string;
|
|
112
|
-
l: string;
|
|
113
|
-
xs: string;
|
|
114
|
-
xxs: string;
|
|
115
|
-
min: string;
|
|
116
|
-
};
|
|
117
|
-
/**
|
|
118
|
-
* Sparse range dictionary
|
|
119
|
-
*/
|
|
120
|
-
readonly sparse: {
|
|
121
|
-
min: string;
|
|
122
|
-
xs: string;
|
|
123
|
-
m: string;
|
|
124
|
-
xl: string;
|
|
125
|
-
max: string;
|
|
126
|
-
};
|
|
127
|
-
};
|
|
1
|
+
import { TCreateScope, ICoef } from '../../common';
|
|
2
|
+
export declare const resolveCoef: (varExp: ReturnType<ReturnType<TCreateScope>>["varExp"]) => ICoef;
|
|
@@ -1,116 +1,2 @@
|
|
|
1
|
-
import { TCreateScope } from '../../common';
|
|
2
|
-
export declare const resolvePalette: (varExp: ReturnType<ReturnType<TCreateScope>>["varExp"]) =>
|
|
3
|
-
/**
|
|
4
|
-
* Palette state
|
|
5
|
-
*/
|
|
6
|
-
state: {
|
|
7
|
-
l: string;
|
|
8
|
-
c: string;
|
|
9
|
-
h: string;
|
|
10
|
-
a: number;
|
|
11
|
-
m: string;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Returns `xs` lightness color
|
|
15
|
-
*/
|
|
16
|
-
readonly xs: /*elided*/ any;
|
|
17
|
-
/**
|
|
18
|
-
* Returns `s` lightness color
|
|
19
|
-
*/
|
|
20
|
-
readonly s: /*elided*/ any;
|
|
21
|
-
/**
|
|
22
|
-
* Returns `m` lightness color
|
|
23
|
-
*/
|
|
24
|
-
readonly m: /*elided*/ any;
|
|
25
|
-
/**
|
|
26
|
-
* Returns `l` lightness color
|
|
27
|
-
*/
|
|
28
|
-
readonly l: /*elided*/ any;
|
|
29
|
-
/**
|
|
30
|
-
* Returns `xl` lightness color
|
|
31
|
-
*/
|
|
32
|
-
readonly xl: /*elided*/ any;
|
|
33
|
-
/**
|
|
34
|
-
* Returns lightness color dictionary
|
|
35
|
-
*/
|
|
36
|
-
readonly lightness: {
|
|
37
|
-
xs: /*elided*/ any;
|
|
38
|
-
s: /*elided*/ any;
|
|
39
|
-
m: /*elided*/ any;
|
|
40
|
-
l: /*elided*/ any;
|
|
41
|
-
xl: /*elided*/ any;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Returns zero chroma color
|
|
45
|
-
*/
|
|
46
|
-
readonly gray: /*elided*/ any;
|
|
47
|
-
/**
|
|
48
|
-
* Returns pale chroma color
|
|
49
|
-
*/
|
|
50
|
-
readonly pale: /*elided*/ any;
|
|
51
|
-
/**
|
|
52
|
-
* Returns base chroma color
|
|
53
|
-
*/
|
|
54
|
-
readonly base: /*elided*/ any;
|
|
55
|
-
/**
|
|
56
|
-
* Returns rich chroma color
|
|
57
|
-
*/
|
|
58
|
-
readonly rich: /*elided*/ any;
|
|
59
|
-
/**
|
|
60
|
-
* Returns chroma color dictionary
|
|
61
|
-
*/
|
|
62
|
-
readonly chroma: {
|
|
63
|
-
gray: /*elided*/ any;
|
|
64
|
-
pale: /*elided*/ any;
|
|
65
|
-
base: /*elided*/ any;
|
|
66
|
-
rich: /*elided*/ any;
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* Returns primary hue color
|
|
70
|
-
*/
|
|
71
|
-
readonly pri: /*elided*/ any;
|
|
72
|
-
/**
|
|
73
|
-
* Returns secondary hue color
|
|
74
|
-
*/
|
|
75
|
-
readonly sec: /*elided*/ any;
|
|
76
|
-
/**
|
|
77
|
-
* Returns success hue color
|
|
78
|
-
*/
|
|
79
|
-
readonly suc: /*elided*/ any;
|
|
80
|
-
/**
|
|
81
|
-
* Returns info hue color
|
|
82
|
-
*/
|
|
83
|
-
readonly inf: /*elided*/ any;
|
|
84
|
-
/**
|
|
85
|
-
* Returns warning hue color
|
|
86
|
-
*/
|
|
87
|
-
readonly war: /*elided*/ any;
|
|
88
|
-
/**
|
|
89
|
-
* Returns danger hue color
|
|
90
|
-
*/
|
|
91
|
-
readonly dan: /*elided*/ any;
|
|
92
|
-
/**
|
|
93
|
-
* Returns hue color dictionary
|
|
94
|
-
*/
|
|
95
|
-
readonly hue: {
|
|
96
|
-
pri: /*elided*/ any;
|
|
97
|
-
sec: /*elided*/ any;
|
|
98
|
-
suc: /*elided*/ any;
|
|
99
|
-
inf: /*elided*/ any;
|
|
100
|
-
war: /*elided*/ any;
|
|
101
|
-
dan: /*elided*/ any;
|
|
102
|
-
};
|
|
103
|
-
/**
|
|
104
|
-
* Returns specified alpha color
|
|
105
|
-
*/
|
|
106
|
-
alpha(a?: number): /*elided*/ any;
|
|
107
|
-
/**
|
|
108
|
-
* Returns background color
|
|
109
|
-
*/
|
|
110
|
-
readonly bg: /*elided*/ any;
|
|
111
|
-
/**
|
|
112
|
-
* Returns foreground color
|
|
113
|
-
*/
|
|
114
|
-
readonly fg: /*elided*/ any;
|
|
115
|
-
toString(): string;
|
|
116
|
-
};
|
|
1
|
+
import { TCreateScope, IPalette } from '../../common';
|
|
2
|
+
export declare const resolvePalette: (varExp: ReturnType<ReturnType<TCreateScope>>["varExp"]) => IPalette;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const NO_PARSE_SYMBOL: symbol;
|
|
2
|
-
export declare const parseStyles: (styles: object) =>
|
|
2
|
+
export declare const parseStyles: (styles: object) => string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TDeafultBreakpoints, TCreateScope } from '../common';
|
|
2
|
+
import { merge } from '../common';
|
|
2
3
|
import { resolveAtRules } from './_process/atrules';
|
|
3
4
|
import { resolveUnits } from './_process/units';
|
|
4
5
|
import { resolvePseudo } from './_process/pseudo';
|
|
@@ -88,6 +89,10 @@ interface IMakerParams extends ReturnType<typeof getBaseHandlers> {
|
|
|
88
89
|
*/
|
|
89
90
|
only: <T = TDeafultBreakpoints>(val: Exclude<keyof T, Symbol> | number, scope?: string) => string;
|
|
90
91
|
};
|
|
92
|
+
/**
|
|
93
|
+
* Merge
|
|
94
|
+
*/
|
|
95
|
+
merge: typeof merge;
|
|
91
96
|
}
|
|
92
97
|
type TCreateProcessor = (params: {
|
|
93
98
|
scope: ReturnType<TCreateScope>;
|
|
@@ -109,7 +114,6 @@ export declare const baseHandlers: {
|
|
|
109
114
|
space: (...val: (string | number)[]) => string;
|
|
110
115
|
range: (size: number, handler: (k: number) => object) => object;
|
|
111
116
|
each: <V extends Record<string | number, any>>(rules: V, handler: (k: V extends ArrayLike<any> ? string : keyof V, v: V extends ArrayLike<any> ? NoInfer<V[number]> : NoInfer<V[keyof V]>) => object) => object;
|
|
112
|
-
merge: (target: Record<string, any>, ...sources: Record<string, any>[]) => Record<string, any>;
|
|
113
117
|
when: (condition: boolean | undefined, rules: object, otherwise?: object) => object;
|
|
114
118
|
};
|
|
115
119
|
/**
|
|
@@ -1,6 +1,108 @@
|
|
|
1
|
-
type
|
|
2
|
-
type
|
|
3
|
-
type
|
|
1
|
+
type THue = 'pri' | 'sec' | 'suc' | 'inf' | 'war' | 'dan';
|
|
2
|
+
type TLightness = 'xs' | 's' | 'm' | 'l' | 'xl';
|
|
3
|
+
type TChroma = 'pale' | 'base' | 'rich';
|
|
4
|
+
type TMode = 'bg' | 'fg';
|
|
5
|
+
/**
|
|
6
|
+
* Palette generator
|
|
7
|
+
* @description
|
|
8
|
+
* Allows to create palette colors
|
|
9
|
+
*/
|
|
10
|
+
export interface IPalette {
|
|
11
|
+
state: {
|
|
12
|
+
l: TLightness;
|
|
13
|
+
c: TChroma | 'gray';
|
|
14
|
+
h: THue;
|
|
15
|
+
a: number;
|
|
16
|
+
m: TMode;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Returns `xs` lightness color
|
|
20
|
+
*/
|
|
21
|
+
get xs(): IPalette;
|
|
22
|
+
/**
|
|
23
|
+
* Returns `s` lightness color
|
|
24
|
+
*/
|
|
25
|
+
get s(): IPalette;
|
|
26
|
+
/**
|
|
27
|
+
* Returns `m` lightness color
|
|
28
|
+
*/
|
|
29
|
+
get m(): IPalette;
|
|
30
|
+
/**
|
|
31
|
+
* Returns `l` lightness color
|
|
32
|
+
*/
|
|
33
|
+
get l(): IPalette;
|
|
34
|
+
/**
|
|
35
|
+
* Returns `xl` lightness color
|
|
36
|
+
*/
|
|
37
|
+
get xl(): IPalette;
|
|
38
|
+
/**
|
|
39
|
+
* Returns lightness color dictionary
|
|
40
|
+
*/
|
|
41
|
+
get lightness(): Record<TLightness, IPalette>;
|
|
42
|
+
/**
|
|
43
|
+
* Returns zero chroma color
|
|
44
|
+
*/
|
|
45
|
+
get gray(): IPalette;
|
|
46
|
+
/**
|
|
47
|
+
* Returns pale chroma color
|
|
48
|
+
*/
|
|
49
|
+
get pale(): IPalette;
|
|
50
|
+
/**
|
|
51
|
+
* Returns base chroma color
|
|
52
|
+
*/
|
|
53
|
+
get base(): IPalette;
|
|
54
|
+
/**
|
|
55
|
+
* Returns rich chroma color
|
|
56
|
+
*/
|
|
57
|
+
get rich(): IPalette;
|
|
58
|
+
/**
|
|
59
|
+
* Returns chroma color dictionary
|
|
60
|
+
*/
|
|
61
|
+
get chroma(): Record<TChroma, IPalette>;
|
|
62
|
+
/**
|
|
63
|
+
* Returns primary hue color
|
|
64
|
+
*/
|
|
65
|
+
get pri(): IPalette;
|
|
66
|
+
/**
|
|
67
|
+
* Returns secondary hue color
|
|
68
|
+
*/
|
|
69
|
+
get sec(): IPalette;
|
|
70
|
+
/**
|
|
71
|
+
* Returns success hue color
|
|
72
|
+
*/
|
|
73
|
+
get suc(): IPalette;
|
|
74
|
+
/**
|
|
75
|
+
* Returns info hue color
|
|
76
|
+
*/
|
|
77
|
+
get inf(): IPalette;
|
|
78
|
+
/**
|
|
79
|
+
* Returns warning hue color
|
|
80
|
+
*/
|
|
81
|
+
get war(): IPalette;
|
|
82
|
+
/**
|
|
83
|
+
* Returns danger hue color
|
|
84
|
+
*/
|
|
85
|
+
get dan(): IPalette;
|
|
86
|
+
/**
|
|
87
|
+
* Returns hue color dictionary
|
|
88
|
+
*/
|
|
89
|
+
get hue(): Record<THue, IPalette>;
|
|
90
|
+
/**
|
|
91
|
+
* Returns specified alpha color
|
|
92
|
+
*/
|
|
93
|
+
alpha(a?: number): IPalette;
|
|
94
|
+
/**
|
|
95
|
+
* Returns background color
|
|
96
|
+
*/
|
|
97
|
+
get bg(): IPalette;
|
|
98
|
+
/**
|
|
99
|
+
* Returns foreground color
|
|
100
|
+
*/
|
|
101
|
+
get fg(): IPalette;
|
|
102
|
+
}
|
|
103
|
+
type RecursivePartial<T> = {
|
|
104
|
+
[P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial<U>[] : T[P] extends object | undefined ? RecursivePartial<T[P]> : T[P];
|
|
105
|
+
};
|
|
4
106
|
type TPaletteDict<T extends string> = {
|
|
5
107
|
dark: {
|
|
6
108
|
bg: Record<T, number>;
|
|
@@ -11,31 +113,129 @@ type TPaletteDict<T extends string> = {
|
|
|
11
113
|
fg: Record<T, number>;
|
|
12
114
|
};
|
|
13
115
|
};
|
|
14
|
-
type
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export type
|
|
18
|
-
export type TPaletteLightness = TPaletteDict<TLightnessToken>;
|
|
19
|
-
export type TPaletteChroma = TPaletteDict<TChromaToken>;
|
|
20
|
-
export type TPalette = {
|
|
116
|
+
export type TPaletteHue = Record<THue, number>;
|
|
117
|
+
export type TPaletteLightness = TPaletteDict<TLightness>;
|
|
118
|
+
export type TPaletteChroma = TPaletteDict<TChroma>;
|
|
119
|
+
export type TPaletteConfig = {
|
|
21
120
|
l: TPaletteLightness;
|
|
22
121
|
c: TPaletteChroma;
|
|
23
122
|
h: TPaletteHue;
|
|
24
123
|
};
|
|
25
|
-
export type
|
|
26
|
-
export type
|
|
27
|
-
export type
|
|
28
|
-
export type
|
|
29
|
-
export type
|
|
30
|
-
export type
|
|
31
|
-
export type
|
|
32
|
-
export type
|
|
33
|
-
$0_:
|
|
34
|
-
$1_:
|
|
35
|
-
$2_:
|
|
36
|
-
$16_:
|
|
124
|
+
export type TShortRange = 's' | 'm' | 'l';
|
|
125
|
+
export type TMainRange = 'min' | 'm' | 'max';
|
|
126
|
+
export type TBaseRange = 'xs' | TShortRange | 'xl';
|
|
127
|
+
export type TLongRange = 'xxs' | TBaseRange | 'xxl';
|
|
128
|
+
export type TFullRange = 'min' | TLongRange | 'max';
|
|
129
|
+
export type TSparseRange = 'min' | 'xs' | 'm' | 'xl' | 'max';
|
|
130
|
+
export type TRangeConfig = Record<'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxl', number>;
|
|
131
|
+
export type TCoefConfig = {
|
|
132
|
+
$0_: TRangeConfig;
|
|
133
|
+
$1_: TRangeConfig;
|
|
134
|
+
$2_: TRangeConfig;
|
|
135
|
+
$16_: TRangeConfig;
|
|
37
136
|
max: number;
|
|
38
137
|
};
|
|
138
|
+
/**
|
|
139
|
+
* Coefficient generator
|
|
140
|
+
* @description
|
|
141
|
+
* Allows to create coefficient ranges
|
|
142
|
+
*/
|
|
143
|
+
export interface ICoef {
|
|
144
|
+
/**
|
|
145
|
+
* Coefficient state
|
|
146
|
+
*/
|
|
147
|
+
state: {
|
|
148
|
+
center: number;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Returns `xxs` coefficient
|
|
152
|
+
*/
|
|
153
|
+
get min(): string;
|
|
154
|
+
/**
|
|
155
|
+
* Returns `xxs` coefficient
|
|
156
|
+
*/
|
|
157
|
+
get xxs(): string;
|
|
158
|
+
/**
|
|
159
|
+
* Returns `xs` coefficient
|
|
160
|
+
*/
|
|
161
|
+
get xs(): string;
|
|
162
|
+
/**
|
|
163
|
+
* Returns `s` coefficient
|
|
164
|
+
*/
|
|
165
|
+
get s(): string;
|
|
166
|
+
/**
|
|
167
|
+
* Returns `m` coefficient
|
|
168
|
+
*/
|
|
169
|
+
get m(): string;
|
|
170
|
+
/**
|
|
171
|
+
* Returns `l` coefficient
|
|
172
|
+
*/
|
|
173
|
+
get l(): string;
|
|
174
|
+
/**
|
|
175
|
+
* Returns `xl` coefficient
|
|
176
|
+
*/
|
|
177
|
+
get xl(): string;
|
|
178
|
+
/**
|
|
179
|
+
* Returns `xxl` coefficient
|
|
180
|
+
*/
|
|
181
|
+
get xxl(): string;
|
|
182
|
+
/**
|
|
183
|
+
* Returns `xxl` coefficient
|
|
184
|
+
*/
|
|
185
|
+
get max(): string;
|
|
186
|
+
/**
|
|
187
|
+
* Range from 0 to 1
|
|
188
|
+
*/
|
|
189
|
+
get $0_(): ICoef;
|
|
190
|
+
/**
|
|
191
|
+
* Range around 1
|
|
192
|
+
*/
|
|
193
|
+
get $1(): ICoef;
|
|
194
|
+
/**
|
|
195
|
+
* Range from 1 to 2
|
|
196
|
+
*/
|
|
197
|
+
get $1_(): ICoef;
|
|
198
|
+
/**
|
|
199
|
+
* Range around 2
|
|
200
|
+
*/
|
|
201
|
+
get $2(): ICoef;
|
|
202
|
+
/**
|
|
203
|
+
* Range from 2 to 16
|
|
204
|
+
*/
|
|
205
|
+
get $2_(): ICoef;
|
|
206
|
+
/**
|
|
207
|
+
* Range around 16
|
|
208
|
+
*/
|
|
209
|
+
get $16(): ICoef;
|
|
210
|
+
/**
|
|
211
|
+
* Range from 16 to the end
|
|
212
|
+
*/
|
|
213
|
+
get $16_(): ICoef;
|
|
214
|
+
/**
|
|
215
|
+
* Short range dictionary
|
|
216
|
+
*/
|
|
217
|
+
get short(): Record<TShortRange, string>;
|
|
218
|
+
/**
|
|
219
|
+
* Base range dictionary
|
|
220
|
+
*/
|
|
221
|
+
get base(): Record<TBaseRange, string>;
|
|
222
|
+
/**
|
|
223
|
+
* Long range dictionary
|
|
224
|
+
*/
|
|
225
|
+
get long(): Record<TLongRange, string>;
|
|
226
|
+
/**
|
|
227
|
+
* Full range dictionary
|
|
228
|
+
*/
|
|
229
|
+
get full(): Record<TFullRange, string>;
|
|
230
|
+
/**
|
|
231
|
+
* Main range dictionary
|
|
232
|
+
*/
|
|
233
|
+
get main(): Record<TMainRange, string>;
|
|
234
|
+
/**
|
|
235
|
+
* Sparse range dictionary
|
|
236
|
+
*/
|
|
237
|
+
get sparse(): Record<TSparseRange, string>;
|
|
238
|
+
}
|
|
39
239
|
/**
|
|
40
240
|
* Provider attributes
|
|
41
241
|
*/
|
|
@@ -95,11 +295,11 @@ export type TProviderSettings = {
|
|
|
95
295
|
/**
|
|
96
296
|
* Palette
|
|
97
297
|
*/
|
|
98
|
-
palette:
|
|
298
|
+
palette: TPaletteConfig;
|
|
99
299
|
/**
|
|
100
300
|
* Coefficients
|
|
101
301
|
*/
|
|
102
|
-
coef:
|
|
302
|
+
coef: TCoefConfig;
|
|
103
303
|
};
|
|
104
304
|
export type TProviderSettingsPartial = RecursivePartial<TProviderSettings>;
|
|
105
305
|
type TStrDict = Record<string, string>;
|
|
@@ -119,7 +319,7 @@ type TMods<T> = T extends object ? {
|
|
|
119
319
|
type TStringBEM<T> = TBlocks<T> | TMods<T> | TElems<T>;
|
|
120
320
|
type TBEM<T> = TDeepPartial<T> | TStringBEM<T> | TStringBEM<T>[];
|
|
121
321
|
type TResolveSelector = <T extends object>(params: TBEM<T>) => string;
|
|
122
|
-
type TResolveAttr = <T extends object>(params: TBEM<T>) => TStrDict;
|
|
322
|
+
type TResolveAttr = <T extends object>(params: TBEM<T>, scope?: TBlocks<T> | TElems<T>) => TStrDict;
|
|
123
323
|
type TParts = (string | number)[];
|
|
124
324
|
type TScope = {
|
|
125
325
|
/**
|
|
@@ -153,9 +353,9 @@ type TScopeResolver = (key: string) => TScope;
|
|
|
153
353
|
export type TCreateScope = (params?: {
|
|
154
354
|
mode?: string | null;
|
|
155
355
|
}) => TScopeResolver;
|
|
356
|
+
export declare const merge: (target: Record<string, any>, ...sources: Record<string, any>[]) => Record<string, any>;
|
|
156
357
|
export declare const TAG_NAME = "effcss-provider";
|
|
157
358
|
export declare const DEFAULT_ATTRS: TProviderAttrs;
|
|
158
|
-
export declare const mixPalette: (prev: TPalette, next?: TPaletteConfig) => TPalette;
|
|
159
359
|
export declare const DEFAULT_BREAKPOINTS: {
|
|
160
360
|
'3xs': number;
|
|
161
361
|
'2xs': number;
|
|
@@ -6,6 +6,10 @@ type TResolveAttr = ReturnType<ReturnType<typeof createScope>>['attr'];
|
|
|
6
6
|
* StyleSheet maker
|
|
7
7
|
*/
|
|
8
8
|
export type TStyleSheetMaker = Parameters<ReturnType<typeof createProcessor>['compile']>[0]['maker'];
|
|
9
|
+
/**
|
|
10
|
+
* StyleSheet maker utils
|
|
11
|
+
*/
|
|
12
|
+
export type TStyleSheetUtils = Parameters<TStyleSheetMaker>[0];
|
|
9
13
|
/**
|
|
10
14
|
* Style target
|
|
11
15
|
*/
|