effcss 3.4.0 → 3.5.1
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/README.md +6 -2
- package/dist/build/define-provider.min.js +2 -2
- package/dist/consumer.js +2 -2
- 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 +135 -0
- package/dist/types/src/_provider/process.d.ts +19 -2
- package/dist/types/src/common.d.ts +23 -1
- package/dist/types/src/index.d.ts +10 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -137,7 +137,7 @@ export interface ICardMaker {
|
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
const myStyleSheetMaker: TStyleSheetMaker = ({ bem, pseudo, at: { kf }, merge, palette }) = {
|
|
140
|
+
const myStyleSheetMaker: TStyleSheetMaker = ({ bem, pseudo, at: { kf }, merge, palette, coef, size }) = {
|
|
141
141
|
// creates unique keyframes identifier
|
|
142
142
|
const spin = kf();
|
|
143
143
|
// deeply merges objects
|
|
@@ -169,7 +169,11 @@ const myStyleSheetMaker: TStyleSheetMaker = ({ bem, pseudo, at: { kf }, merge, p
|
|
|
169
169
|
[bem<ICardMaker>('card..h.full')]: { ... },
|
|
170
170
|
[bem<ICardMaker>('card.footer')]: { ... },
|
|
171
171
|
[bem<ICardMaker>('card.footer.visible')]: { ... },
|
|
172
|
-
|
|
172
|
+
...each(coef.short, (k, v) => ({
|
|
173
|
+
[bem<ICardMaker>(`card.footer.sz.${k}`)]: {
|
|
174
|
+
height: size(v)
|
|
175
|
+
}
|
|
176
|
+
}))
|
|
173
177
|
};
|
|
174
178
|
};
|
|
175
179
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* EffCSS v3.
|
|
2
|
+
* EffCSS v3.5.1
|
|
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",i="@keyframes",r="@layer",n="@scope",a="@supports",l=(e,s)=>{const i=t+` ${s||""}${s?" and ":""}(${e})`;return{s:i,q:e,t:s,toString:()=>i}};l.toString=()=>t;const c=t=>t+"px",o=t=>t+"vh",h=t=>t+"vw",u=t=>t+"vmin",g=t=>t+"vmax",d=t=>t+"rem",p=t=>t+"deg",m=t=>t+"ms",b=t=>t+"%",f=t=>t+"cqw",v=t=>t+"cqh",$=t=>t+"cqi",y=t=>t+"cqb",j=t=>t+"cqmin",x=t=>t+"cqmax",O=Object.fromEntries,k=Object.entries,_=":first-",w=":last-",S=":only-",q="child",A=":nth-",E="of-type",z=A+q,P=":focus",N={r:":root",h:":hover",f:P,fv:P+"-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:_+q,lc:w+q,oc:S+q,odd:z+"(odd)",even:z+"(even)",ft:_+E,lt:w+E,ot:S+E,bef:"::before",aft:"::after",bd:"::backdrop"},C={has:":has",not:":not",is:":is",wh:":where",st:":state",nthc:z,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:i}=this.state;return W(`${t} ${e} ${s} / ${i}`)}}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:i,mpart:r})=>`color-mix(in ${s||I}, ${t}${void 0!==i?` ${i}%`:""}, ${e}${void 0!==r?` ${r}%`:""})`,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 i,r,n;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===(i=s.startsWith)||void 0===i?void 0:i.call(s,"@"))||(null===(r=a.startsWith)||void 0===r?void 0:r.call(a,"&"))||(null===(n=a.startsWith)||void 0===n?void 0:n.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:i,a:r,m:n}=this.state;return`oklch(${t(X,"l",n,e)} ${t(X,"c",n,s)} ${i} / ${r})`}}return new s},tt=Object.assign,et=Object.entries,st=Array.isArray,it=(t,...e)=>e.length?e.reduce(((t,e)=>(et(e).forEach((([e,s])=>{s&&"object"==typeof s&&t[e]?st(t[e])&&st(s)?t[e]=[...t[e],...s]:it(t[e],s||{}):t[e]=s})),t)),t):t,rt={dash:(...t)=>t.join("-"),comma:(...t)=>t.join(),space:(...t)=>t.join(" "),range:(t,e)=>Array.from(Array(t).entries()).reduce(((t,[s])=>tt(t,e(s+1))),{}),each:(t,e)=>et(t).reduce(((t,[s,i])=>tt(t,e(s,i))),{}),merge:it,when:(t,e,s={})=>t?e:s},nt="width: ",at=t=>{const{scope:_,globalKey:w="",bp:S={}}=t,q=_(w),A=t=>q.varExp(...t.split(".")),E=(t=1)=>`calc(${t} * ${A("rtime")})`;return{compile:({key:t,maker:w})=>{const z=_(t),P=(t=>{const c={cp:1,lay:1,kf:1,cq:1},o=(s,i)=>{const r="string"==typeof i?i:t.name("cq",c.cq++),n=e+` ${r?r+" ":""}(${s})`;return{c:r,q:s,s:n,toString:()=>n}};o.toString=()=>e;const h=(e,i)=>{const r="--"+(e||t.name("cp",c.cp++)),n=s+" "+r;return{k:r,v:`var(${r})`,s:n,r:{[n]:{syntax:(null==i?void 0:i.syn)||'"*"',inherits:(null==i?void 0:i.inh)||!1,initialValue:null==i?void 0:i.ini}},toString:()=>n}};h.toString=()=>s;const u=e=>{const s=e||t.name("kf",c.kf++),r=i+" "+s;return{k:s,s:r,toString:()=>r}};u.toString=()=>i;const g=e=>{const s=e||t.name("lay",c.lay++),i=r+" "+s;return{k:s,s:i,toString:()=>i}};g.toString=()=>r,g.toString=()=>n;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:h,kf:u,mq:l,cq:o,lay:g,sc:(t="",e="")=>{const s=n+` ${t?`(${t})`:""}${t&&e?" ":""}${e?`to (${e})`:""}`;return{r:t,l:e,s:s,toString:()=>s}},sup:d}})(z),I=t=>{const e=S[t]||t;return"number"==typeof e?e+"rem":""},W=t=>"min-"+nt+I(t),F=t=>"max-"+nt+I(t),K=(t,e)=>"string"==typeof e?P.cq(t,e):P.mq(t),M=(t,e,s)=>""+K(W(t)+") and ("+F(e),s),B={up:(t,e)=>""+K(W(t),e),down:(t,e)=>""+K(F(t),e),between:M,only:(t,e)=>M(t,t,e)};return L=w(Object.assign(rt,{key:t,vars:A,time:E,bem:z.selector,pseudo:Object.assign(O(k(N).map((([t,e])=>{function s(t=""){return t+e}return s.toString=()=>e,[t,s]}))),O(k(C).map((([t,e])=>{function s(t,s=""){return s+e+`(${t})`}return s.toString=()=>e,[t,s]})))),color:G(q.varExp),palette:Y(q.varExp),units:{px:c,vh:o,vw:h,vmin:u,vmax:g,rem:d,deg:p,ms:m,pc:b,cqw:f,cqh:v,cqb:y,cqi:$,cqmin:j,cqmax:x},at:P,limit:B})),J(L,((t,e)=>t+U(...e)),"");var L}}};const lt=void 0,ct=Object.entries,ot=Object.assign,ht=Object.defineProperties,ut=t=>`data-${t}`,gt=t=>"string"==typeof t,dt=t=>null!==t&&"object"==typeof t,pt=(t,e)=>`${t}${e?"__"+e:""}`,mt=t=>t.split("."),bt=(t,e)=>ct(t).reduce(((t,[s,i])=>{if(dt(i)){const r=ct(i);r.length?t.push(...r.reduce(((t,[i,r])=>{if((t=>null!==t&&t!==lt)(i)&&e&&t.push([s,i,lt,lt]),dt(r)){const e=ct(r);e.length&&t.push(...e.reduce(((t,[e,r])=>{const n=typeof r;return"string"!==n&&"number"!==n||t.push([s,i,e,r]),t}),[]))}return t}),[])):t.push([s,lt,lt,lt])}return t}),[]),ft=(t,e,s,i)=>""+(pt(t,e)+(s?"_"+s:"")+(s&&i?"_"+i:"")),vt=(t,e,s,i)=>"."+ft(t,e,s,i),$t=(t,e,s,i)=>`[${ut(pt(t,e))}${s&&i?`~="${s}_${i}"`:s?`~="${s}"`:""}]`,yt={def:.75,c:.05,s:.65,m:.75,l:.85,n:.9},jt="effcss-provider",xt={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null},Ot={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))}},kt=(t,e)=>{var s,i,r,n,a,l,c,o,h,u,g,d,p,m,b,f;return e?{l:{dark:{bg:ot(t.l.dark.bg,null===(i=null===(s=null==e?void 0:e.l)||void 0===s?void 0:s.dark)||void 0===i?void 0:i.bg),fg:ot(t.l.dark.fg,null===(n=null===(r=null==e?void 0:e.l)||void 0===r?void 0:r.dark)||void 0===n?void 0:n.fg)},light:{bg:ot(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:ot(t.l.light.fg,null===(o=null===(c=null==e?void 0:e.l)||void 0===c?void 0:c.light)||void 0===o?void 0:o.fg)}},c:{dark:{bg:ot(t.c.dark.bg,null===(u=null===(h=null==e?void 0:e.c)||void 0===h?void 0:h.dark)||void 0===u?void 0:u.bg),fg:ot(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:ot(t.c.light.bg,null===(m=null===(p=null==e?void 0:e.c)||void 0===p?void 0:p.light)||void 0===m?void 0:m.bg),fg:ot(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:ot(t.h,null==e?void 0:e.h)}:t},_t={bp:{"3xs":18,"2xs":24,xs:30,sm:40,md:48,lg:64,xl:80,"2xl":96},vars:{"":{rtime:"200ms",rem:"16px",l:yt,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:yt},dark:{l:{def:.4,n:.25,s:.3,m:.4,l:.5,c:.95}}},palette:Ot},wt=({prefix:t})=>{let e=1;return{get base(){return t+0},get current(){return t+e},next(){return e++,this.current},reset(){e=1}}},St=()=>{const t=new Set,e=new Map;return{use(s,i){const r=e.get(s);return r||(t.add(i),e.set(s,i),i)},useMany(t){return ct(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])))}}},qt="theme",At="palette",Et=Object.assign,zt=Object.entries,Pt=Object.fromEntries,Nt=(t,e)=>t.getAttribute(e)||xt[e];!function(t={}){const e=window.document,s=window.customElements;if(null==s?void 0:s.get(jt))return!1;{class i extends HTMLScriptElement{constructor(){super(...arguments),this._c=St(),this._m=function(){let t={},e={},s=[],i=[];const r=(t,e)=>(e.toString=()=>"effcss-"+t,e),n=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=()=>{i=i.reduce(((t,e)=>{const s=e.deref();return s&&(n(s),t.push(e)),t}),[])},l=t=>s.findIndex((e=>e===t)),c=e=>e?t[e]:void 0,o=(e,i)=>{if(!t[e])return t[e]=r(e,i),s.push(t[e]),a(),!0},h=t=>{const e=c(t);return!!e&&-1!==l(e)};return{apply:n,notify:a,getIndex:l,get:c,has:t=>!!t&&!!c(t),getAll:()=>t,add:o,status:h,on:(...t)=>{const e=t.reduce(((t,e)=>{const i=c(e);return!(!i||h(e))&&(s.push(i),t)}),!0);return a(),e},off:(...t)=>{const e=t.reduce(((t,e)=>{const i=c(e);if(i&&h(e)){const e=l(i);return s.splice(e,1),t}return!1}),!0);return a(),e},remove:i=>{const r=c(i);if(!r)return;const n=l(r);return n>-1&&(s.splice(n,1),delete t[i],delete e[i]),a(),!0},removeAll:()=>(s.splice(0),t={},e={},a(),!0),pack:(e,s)=>{let i=t[e]||new CSSStyleSheet;return i.replaceSync(s),i=r(e,i),!!i.cssRules.length&&o(e,i)},replace:(e,s)=>{const i=t[e];if(i)return i.replaceSync(s),a(),!0},register:t=>{i.findIndex((e=>e.deref()===t))>=0||(i.push(new WeakRef(t)),n(t))},unregister:t=>{const e=i.findIndex((e=>e.deref()===t));e>=0&&i.splice(e,1)}}}(),this._settings=_t,this._cust=()=>{var t;const e=null===(t=this._settings)||void 0===t?void 0:t.vars,{varName:s}=this._s(this._k.base);function i(t,e){return zt(t).reduce(((t,[r,n])=>n&&"object"==typeof n?Et(t,i(n,[...e,r])):(t[s(...e,r)]=n,t)),{})}const r=Pt(zt(e||{}).map((([t,e])=>[t,i(e,[])]))),{"":n={},dark:a,light:l}=r,c=function(t,e){var s={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(s[i[r]]=t[i[r]])}return s}(r,["","dark","light"]),o=this.size,h=this.time,{l:u,c:g,h:d}=this._settings.palette,p=["xs","s","m","l","xl"],m=["pale","base","rich"];this._=({bem:t,each:e,when:i,vars:a,merge:l,at:{mq:b},units:{px:f,ms:v,pc:$}})=>{const y="prefers-color-scheme",j={light:`${y}: light`,dark:`${y}: dark`};return l({[`:root:has(script[is=${jt}])`]:l({fontSize:a("rem")},n,e(d,((t,e)=>({[s(At,"h",t)]:e}))),{[s(At,"c","bg","gray")]:0,[s(At,"c","fg","gray")]:0},e(j,((t,i)=>({[b(i).s]:l(r[t]||{},e(p,((e,i)=>({[s(At,"l","bg",i)]:u[t].bg[i],[s(At,"l","fg",i)]:u[t].fg[i]}))),e(m,((e,i)=>({[s(At,"c","bg",i)]:g[t].bg[i],[s(At,"c","fg",i)]:g[t].fg[i]}))))}))))},e(c,((e,s)=>({[`:root:has(script[is=${jt}][${qt}=${e}])`]:s,[t(`..theme.${e}`)]:s}))),i(!!o,{[`:root:has(script[is=${jt}][size])`]:{[s("","rem")]:f(o)}}),i(!!h,{[`:root:has(script[is=${jt}][time])`]:{[s("","rtime")]:v(h)}}))},this.use(this._,this._k.base,!0)},this.use=(t,e,s)=>{const i=e||this._k.current;let r=this._c.use(t,i);return(s||this._m&&!this._m.has(e))&&this._m.pack(r,this.css(t,r)),e||this._k.next(),this.resolve(r)},this.usePublic=t=>Pt(zt(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["size","time"]}get prefix(){return Nt(this,"prefix")||""}get mode(){return Nt(this,"mode")}get hydrate(){return""===this.getAttribute("hydrate")}get settings(){return this._settings}set settings(t){var e,s,i,r,n;const a=Et({},this._settings,t,{palette:kt(this._settings.palette,null==t?void 0:t.palette)}),{makers:l,vars:c,bp:o,off:h,palette:u}=a;(o&&(null===(e=this._settings)||void 0===e?void 0:e.bp)!==o||!this._p)&&(this._p=at({scope:this._s,globalKey:this._k.base,bp:o})),l&&(null===(s=this._settings)||void 0===s?void 0:s.makers)!==l&&(this._c.useMany(l),this.usePublic(l),(null==h?void 0:h.length)&&this._settings.off!==h&&this.off(...h),this.hydrate&&this._k.reset()),this._settings=a,(!(null===(i=this._m)||void 0===i?void 0:i.has(this._k.base))||c&&(null===(r=this._settings)||void 0===r?void 0:r.vars)!==c||u&&(null===(n=this._settings)||void 0===n?void 0:n.palette)!==u)&&this._cust()}set theme(t){t?this.setAttribute(qt,t):this.removeAttribute(qt)}get theme(){return Nt(this,qt)||""}set size(t){null===t?this.removeAttribute("size"):this.setAttribute("size",t+"")}get size(){const t=this.getAttribute("size");return null!==t?Number(t):null}set time(t){null===t?this.removeAttribute("time"):this.setAttribute("time",t+"")}get time(){const t=this.getAttribute("time");return null!==t?Number(t):null}attributeChangedCallback(){this._k&&this._cust()}connectedCallback(){this._k=wt({prefix:this.prefix}),this._s=((t={})=>{const{mode:e}=t;let s,i;return t=>{const r=(...e)=>""+e.filter(Boolean).reduce(((t,e)=>`${t}-${e}`),t),n=(...t)=>"--"+r(...t);return"c"===e?(s=t=>{let e,s,i,n;return gt(t)?([e,s,i,n]=mt(t),vt(r(e),s,i,n)):t&&bt(t).map((([t,e,s,i])=>vt(r(t),e,s,i))).join(",")},i=t=>{let e,s,i,n;const a="class";let l="";return Array.isArray(t)?l=[...t.reduce(((t,a)=>([e,s,i,n]=mt(a),t.add(ft(r(e),s)),i&&t.add(ft(r(e),s,i,n)),t)),new Set).values()].join(" "):gt(t)?([e,s,i,n]=mt(t),l=ft(r(e),s,i,n)):l=t&&bt(t,!0).map((([t,e,s,i])=>ft(r(t),e,s,i))).join(" "),ht({[a]:l},{toString:{value:()=>`${a}="${l}"`}})}):(s=t=>{let e,s,i,n;return gt(t)?([e,s,i,n]=mt(t),$t(r(e),s,i,n)):t&&bt(t).map((([t,e,s,i])=>$t(r(t),e,s,i))).join(",")},i=t=>{let e,s,i,n,a,l,c="";if(Array.isArray(t))l=t.reduce(((t,l)=>{[e,s,i,n]=mt(l);const o=pt(r(e),s);return a=ut(o),c=i?n?`${i}_${n}`:`${i}`:"",t[a]&&c?t[a]=t[a]+" "+c:t[a]=c,t}),{});else if(gt(t)){[e,s,i,n]=mt(t);const o=pt(r(e),s);a=ut(o),c=i?n?`${i}_${n}`:`${i}`:"",l={[a]:c}}else l=t&&bt(t,!0).reduce(((t,[e,s,i,n])=>{const l=pt(r(e),s);a=ut(l);const o=i?n?`${i}_${n}`:`${i}`:"";return c=t[a]?t[a]+" "+o:o,t[a]=c,t}),{});return ht(l,{toString:{value:()=>ct(l).map((([t,e])=>`${t}="${e}"`)).join(" ")}}),l}),{selector:s,attr:i,name:r,varName:n,varExp:(...t)=>`var(${n(...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(jt,i,{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=>{const e={pri:t($t,"h","pri"),sec:t($t,"h","sec"),ter:t($t,"h","ter"),suc:t($t,"h","suc"),inf:t($t,"h","inf"),war:t($t,"h","war"),dan:t($t,"h","dan")};class s{constructor(t={}){this.state={l:"l",c:"base",h:e.pri,a:1,m:"bg"},Object.assign(this,{[ft]:!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($t,"l",i,e)} ${t($t,"c",i,s)} ${r} / ${n})`}}return new s},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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* EffCSS v3.
|
|
2
|
+
* EffCSS v3.5.1
|
|
3
3
|
* {@link https://gitverse.ru/msabitov/effcss}
|
|
4
4
|
* Copyright (c) Marat Sabitov
|
|
5
5
|
* @license Apache-2.0
|
|
6
6
|
*/
|
|
7
|
-
const e=void 0,t=Object.entries,r=Object.defineProperties,n=e=>`data-${e}`,s=e=>"string"==typeof e,u=e=>null!==e&&"object"==typeof e,i=(e,t)=>`${e}${t?"__"+t:""}`,
|
|
7
|
+
const e=void 0,t=Object.entries,r=Object.defineProperties,n=e=>`data-${e}`,s=e=>"string"==typeof e,u=e=>null!==e&&"object"==typeof e,i=(e,t)=>`${e}${t?"__"+t:""}`,l=e=>e.split("."),o=(r,n)=>t(r).reduce(((r,[s,i])=>{if(u(i)){const l=t(i);l.length?r.push(...l.reduce(((r,[i,l])=>{if((t=>null!==t&&t!==e)(i)&&n&&r.push([s,i,e,e]),u(l)){const e=t(l);e.length&&r.push(...e.reduce(((e,[t,r])=>{const n=typeof r;return"string"!==n&&"number"!==n||e.push([s,i,t,r]),e}),[]))}return r}),[])):r.push([s,e,e,e])}return r}),[]),a=(e,t,r,n)=>""+(i(e,t)+(r?"_"+r:"")+(r&&n?"_"+n:"")),c=(e,t,r,n)=>"."+a(e,t,r,n),d=(e,t,r,s)=>`[${n(i(e,t))}${r&&s?`~="${r}_${s}"`:r?`~="${r}"`:""}]`,m="effcss-provider",p={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null,angle:null};Number(146.2.toFixed(2)),Number(256..toFixed(2)),Number((.1*184+.9*109).toFixed(2)),Number(44.5.toFixed(2));Array(12).keys();const g=({prefix:e})=>{let t=1;return{get base(){return e+0},get current(){return e+t},next(){return t++,this.current},reset(){t=1}}},$=()=>{const e=new Set,r=new Map;return{use(t,n){const s=r.get(t);return s||(e.add(n),r.set(t,n),n)},useMany(e){return t(e).map((([e,t])=>this.use(t,e)))},getKey:e=>r.get(e),get keys(){return[...e]},get makers(){return Object.fromEntries(r.entries().map((([e,t])=>[t,e])))}}},f=e=>null==e?null:Number(e),b=(e={})=>{var u;let b,h,y,v,j,x,S,k=null===(u=null===globalThis||void 0===globalThis?void 0:globalThis.document)||void 0===u?void 0:u.querySelector(`script[is=${m}]`);if(k)return k;({prefix:h,mode:y,hydrate:v,theme:b,size:j,time:x,angle:S}=Object.assign({},p,e));let O,_,z,A=f(j),N=f(x),w=f(S);const F=new Set,E=()=>h||p.prefix,P=()=>y||p.mode,T=()=>""===v,B=g({prefix:E()}),K=((e={})=>{const{mode:u}=e;let m,p;return e=>{const g=(...t)=>""+t.filter(Boolean).reduce(((e,t)=>`${e}-${t}`),e),$=(...e)=>"--"+g(...e);return"c"===u?(m=e=>{let t,r,n,u;return s(e)?([t,r,n,u]=l(e),c(g(t),r,n,u)):e&&o(e).map((([e,t,r,n])=>c(g(e),t,r,n))).join(",")},p=e=>{let t,n,u,i;const c="class";let d="";return Array.isArray(e)?d=[...e.reduce(((e,r)=>([t,n,u,i]=l(r),e.add(a(g(t),n)),u&&e.add(a(g(t),n,u,i)),e)),new Set).values()].join(" "):s(e)?([t,n,u,i]=l(e),d=a(g(t),n,u,i)):d=e&&o(e,!0).map((([e,t,r,n])=>a(g(e),t,r,n))).join(" "),r({[c]:d},{toString:{value:()=>`${c}="${d}"`}})}):(m=e=>{let t,r,n,u;return s(e)?([t,r,n,u]=l(e),d(g(t),r,n,u)):e&&o(e).map((([e,t,r,n])=>d(g(e),t,r,n))).join(",")},p=e=>{let u,a,c,d,m,p,$="";if(Array.isArray(e))p=e.reduce(((e,t)=>{[u,a,c,d]=l(t);const r=i(g(u),a);return m=n(r),$=c?d?`${c}_${d}`:`${c}`:"",e[m]&&$?e[m]=e[m]+" "+$:e[m]=$,e}),{});else if(s(e)){[u,a,c,d]=l(e);const t=i(g(u),a);m=n(t),$=c?d?`${c}_${d}`:`${c}`:"",p={[m]:$}}else p=e&&o(e,!0).reduce(((e,[t,r,s,u])=>{const l=i(g(t),r);m=n(l);const o=s?u?`${s}_${u}`:`${s}`:"";return $=e[m]?e[m]+" "+o:o,e[m]=$,e}),{});return r(p,{toString:{value:()=>t(p).map((([e,t])=>`${e}="${t}"`)).join(" ")}}),p}),{selector:m,attr:p,name:g,varName:$,varExp:(...e)=>`var(${$(...e)})`}}})({mode:P()}),M=$(),q=e=>"string"==typeof e?e:M.getKey(e),C=e=>K(e||B.base).attr,D=(e,t)=>{const r=t||B.current;let n=M.use(e,r);return t||B.next(),C(n)};return{get prefix(){return E()},get mode(){return P()},get hydrate(){return T()},set theme(e){b=e},get theme(){return b||""},get size(){return A},set size(e){A=e},get time(){return N},set time(e){N=e},get angle(){return w},set angle(e){w=e},get settings(){return{bp:z,vars:_,off:[...F],makers:M.makers,palette:O}},set settings(e){({bp:z,vars:_,palette:O}=e)},resolve:C,use:D,usePublic:e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[e,D(t,e)]))),usePrivate:e=>e.map((e=>D(e))),css:()=>"",key:q,status:e=>{const t=q(e);return!!t&&!F.has(t)},on:(...e)=>e.map(q).reduce(((e,t)=>e&&!!t&&F.delete(t)),!0),off:(...e)=>e.map(q).reduce(((e,t)=>e&&!!t&&!!F.add(t)),!0),stylesheets:()=>[],toString(){const e=M.makers;delete e[B.base];const t=Object.entries({is:m,prefix:E(),mode:P(),hydrate:T(),theme:b,size:null!==A&&String(A),time:null!==N&&String(N),angle:null!==w&&String(w)}).map((([e,t])=>t?`${e}="${t}"`:""===t?e:"")).filter(Boolean).join(" "),r=`document.currentScript.settings = {makers: {${e?Object.entries(e).reduce(((e,[t,r])=>e+`${e?",":""}${t}: ${r.toString().replaceAll(/\s+/g," ")}`),""):""}},${_?` vars: ${_},`:""}${z?` bp: ${z},`:""}${O?` palette: ${O},`:""}${F.size?` off: [${[...F]}]`:""}}`;return`<script ${t}>${r}<\/script>`}}};export{b as createConsumer};
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* EffCSS v3.
|
|
2
|
+
* EffCSS v3.5.1
|
|
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",i="@keyframes",r="@layer",n="@scope",a="@supports",l=(e,s)=>{const i=t+` ${s||""}${s?" and ":""}(${e})`;return{s:i,q:e,t:s,toString:()=>i}};l.toString=()=>t;const c=t=>t+"px",o=t=>t+"vh",h=t=>t+"vw",u=t=>t+"vmin",g=t=>t+"vmax",d=t=>t+"rem",p=t=>t+"deg",m=t=>t+"ms",b=t=>t+"%",f=t=>t+"cqw",v=t=>t+"cqh",$=t=>t+"cqi",y=t=>t+"cqb",j=t=>t+"cqmin",x=t=>t+"cqmax",O=Object.fromEntries,k=Object.entries,_=":first-",w=":last-",S=":only-",q="child",A=":nth-",E="of-type",z=A+q,P=":focus",N={r:":root",h:":hover",f:P,fv:P+"-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:_+q,lc:w+q,oc:S+q,odd:z+"(odd)",even:z+"(even)",ft:_+E,lt:w+E,ot:S+E,bef:"::before",aft:"::after",bd:"::backdrop"},C={has:":has",not:":not",is:":is",wh:":where",st:":state",nthc:z,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:i}=this.state;return W(`${t} ${e} ${s} / ${i}`)}}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:i,mpart:r})=>`color-mix(in ${s||I}, ${t}${void 0!==i?` ${i}%`:""}, ${e}${void 0!==r?` ${r}%`:""})`,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 i,r,n;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===(i=s.startsWith)||void 0===i?void 0:i.call(s,"@"))||(null===(r=a.startsWith)||void 0===r?void 0:r.call(a,"&"))||(null===(n=a.startsWith)||void 0===n?void 0:n.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:i,a:r,m:n}=this.state;return`oklch(${t(X,"l",n,e)} ${t(X,"c",n,s)} ${i} / ${r})`}}return new s},tt=Object.assign,et=Object.entries,st=Array.isArray,it=(t,...e)=>e.length?e.reduce(((t,e)=>(et(e).forEach((([e,s])=>{s&&"object"==typeof s&&t[e]?st(t[e])&&st(s)?t[e]=[...t[e],...s]:it(t[e],s||{}):t[e]=s})),t)),t):t,rt={dash:(...t)=>t.join("-"),comma:(...t)=>t.join(),space:(...t)=>t.join(" "),range:(t,e)=>Array.from(Array(t).entries()).reduce(((t,[s])=>tt(t,e(s+1))),{}),each:(t,e)=>et(t).reduce(((t,[s,i])=>tt(t,e(s,i))),{}),merge:it,when:(t,e,s={})=>t?e:s},nt="width: ",at=t=>{const{scope:_,globalKey:w="",bp:S={}}=t,q=_(w),A=t=>q.varExp(...t.split(".")),E=(t=1)=>`calc(${t} * ${A("rtime")})`;return{compile:({key:t,maker:w})=>{const z=_(t),P=(t=>{const c={cp:1,lay:1,kf:1,cq:1},o=(s,i)=>{const r="string"==typeof i?i:t.name("cq",c.cq++),n=e+` ${r?r+" ":""}(${s})`;return{c:r,q:s,s:n,toString:()=>n}};o.toString=()=>e;const h=(e,i)=>{const r="--"+(e||t.name("cp",c.cp++)),n=s+" "+r;return{k:r,v:`var(${r})`,s:n,r:{[n]:{syntax:(null==i?void 0:i.syn)||'"*"',inherits:(null==i?void 0:i.inh)||!1,initialValue:null==i?void 0:i.ini}},toString:()=>n}};h.toString=()=>s;const u=e=>{const s=e||t.name("kf",c.kf++),r=i+" "+s;return{k:s,s:r,toString:()=>r}};u.toString=()=>i;const g=e=>{const s=e||t.name("lay",c.lay++),i=r+" "+s;return{k:s,s:i,toString:()=>i}};g.toString=()=>r,g.toString=()=>n;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:h,kf:u,mq:l,cq:o,lay:g,sc:(t="",e="")=>{const s=n+` ${t?`(${t})`:""}${t&&e?" ":""}${e?`to (${e})`:""}`;return{r:t,l:e,s:s,toString:()=>s}},sup:d}})(z),I=t=>{const e=S[t]||t;return"number"==typeof e?e+"rem":""},W=t=>"min-"+nt+I(t),F=t=>"max-"+nt+I(t),K=(t,e)=>"string"==typeof e?P.cq(t,e):P.mq(t),M=(t,e,s)=>""+K(W(t)+") and ("+F(e),s),B={up:(t,e)=>""+K(W(t),e),down:(t,e)=>""+K(F(t),e),between:M,only:(t,e)=>M(t,t,e)};return L=w(Object.assign(rt,{key:t,vars:A,time:E,bem:z.selector,pseudo:Object.assign(O(k(N).map((([t,e])=>{function s(t=""){return t+e}return s.toString=()=>e,[t,s]}))),O(k(C).map((([t,e])=>{function s(t,s=""){return s+e+`(${t})`}return s.toString=()=>e,[t,s]})))),color:G(q.varExp),palette:Y(q.varExp),units:{px:c,vh:o,vw:h,vmin:u,vmax:g,rem:d,deg:p,ms:m,pc:b,cqw:f,cqh:v,cqb:y,cqi:$,cqmin:j,cqmax:x},at:P,limit:B})),J(L,((t,e)=>t+U(...e)),"");var L}}};const lt=void 0,ct=Object.entries,ot=Object.assign,ht=Object.defineProperties,ut=t=>`data-${t}`,gt=t=>"string"==typeof t,dt=t=>null!==t&&"object"==typeof t,pt=(t,e)=>`${t}${e?"__"+e:""}`,mt=t=>t.split("."),bt=(t,e)=>ct(t).reduce(((t,[s,i])=>{if(dt(i)){const r=ct(i);r.length?t.push(...r.reduce(((t,[i,r])=>{if((t=>null!==t&&t!==lt)(i)&&e&&t.push([s,i,lt,lt]),dt(r)){const e=ct(r);e.length&&t.push(...e.reduce(((t,[e,r])=>{const n=typeof r;return"string"!==n&&"number"!==n||t.push([s,i,e,r]),t}),[]))}return t}),[])):t.push([s,lt,lt,lt])}return t}),[]),ft=(t,e,s,i)=>""+(pt(t,e)+(s?"_"+s:"")+(s&&i?"_"+i:"")),vt=(t,e,s,i)=>"."+ft(t,e,s,i),$t=(t,e,s,i)=>`[${ut(pt(t,e))}${s&&i?`~="${s}_${i}"`:s?`~="${s}"`:""}]`,yt={def:.75,c:.05,s:.65,m:.75,l:.85,n:.9},jt="effcss-provider",xt={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null},Ot={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))}},kt=(t,e)=>{var s,i,r,n,a,l,c,o,h,u,g,d,p,m,b,f;return e?{l:{dark:{bg:ot(t.l.dark.bg,null===(i=null===(s=null==e?void 0:e.l)||void 0===s?void 0:s.dark)||void 0===i?void 0:i.bg),fg:ot(t.l.dark.fg,null===(n=null===(r=null==e?void 0:e.l)||void 0===r?void 0:r.dark)||void 0===n?void 0:n.fg)},light:{bg:ot(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:ot(t.l.light.fg,null===(o=null===(c=null==e?void 0:e.l)||void 0===c?void 0:c.light)||void 0===o?void 0:o.fg)}},c:{dark:{bg:ot(t.c.dark.bg,null===(u=null===(h=null==e?void 0:e.c)||void 0===h?void 0:h.dark)||void 0===u?void 0:u.bg),fg:ot(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:ot(t.c.light.bg,null===(m=null===(p=null==e?void 0:e.c)||void 0===p?void 0:p.light)||void 0===m?void 0:m.bg),fg:ot(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:ot(t.h,null==e?void 0:e.h)}:t},_t={bp:{"3xs":18,"2xs":24,xs:30,sm:40,md:48,lg:64,xl:80,"2xl":96},vars:{"":{rtime:"200ms",rem:"16px",l:yt,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:yt},dark:{l:{def:.4,n:.25,s:.3,m:.4,l:.5,c:.95}}},palette:Ot},wt=({prefix:t})=>{let e=1;return{get base(){return t+0},get current(){return t+e},next(){return e++,this.current},reset(){e=1}}},St=()=>{const t=new Set,e=new Map;return{use(s,i){const r=e.get(s);return r||(t.add(i),e.set(s,i),i)},useMany(t){return ct(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])))}}},qt="theme",At="palette",Et=Object.assign,zt=Object.entries,Pt=Object.fromEntries,Nt=(t,e)=>t.getAttribute(e)||xt[e];function Ct(t={}){const e=window.document,s=window.customElements;if(null==s?void 0:s.get(jt))return!1;{class i extends HTMLScriptElement{constructor(){super(...arguments),this._c=St(),this._m=function(){let t={},e={},s=[],i=[];const r=(t,e)=>(e.toString=()=>"effcss-"+t,e),n=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=()=>{i=i.reduce(((t,e)=>{const s=e.deref();return s&&(n(s),t.push(e)),t}),[])},l=t=>s.findIndex((e=>e===t)),c=e=>e?t[e]:void 0,o=(e,i)=>{if(!t[e])return t[e]=r(e,i),s.push(t[e]),a(),!0},h=t=>{const e=c(t);return!!e&&-1!==l(e)};return{apply:n,notify:a,getIndex:l,get:c,has:t=>!!t&&!!c(t),getAll:()=>t,add:o,status:h,on:(...t)=>{const e=t.reduce(((t,e)=>{const i=c(e);return!(!i||h(e))&&(s.push(i),t)}),!0);return a(),e},off:(...t)=>{const e=t.reduce(((t,e)=>{const i=c(e);if(i&&h(e)){const e=l(i);return s.splice(e,1),t}return!1}),!0);return a(),e},remove:i=>{const r=c(i);if(!r)return;const n=l(r);return n>-1&&(s.splice(n,1),delete t[i],delete e[i]),a(),!0},removeAll:()=>(s.splice(0),t={},e={},a(),!0),pack:(e,s)=>{let i=t[e]||new CSSStyleSheet;return i.replaceSync(s),i=r(e,i),!!i.cssRules.length&&o(e,i)},replace:(e,s)=>{const i=t[e];if(i)return i.replaceSync(s),a(),!0},register:t=>{i.findIndex((e=>e.deref()===t))>=0||(i.push(new WeakRef(t)),n(t))},unregister:t=>{const e=i.findIndex((e=>e.deref()===t));e>=0&&i.splice(e,1)}}}(),this._settings=_t,this._cust=()=>{var t;const e=null===(t=this._settings)||void 0===t?void 0:t.vars,{varName:s}=this._s(this._k.base);function i(t,e){return zt(t).reduce(((t,[r,n])=>n&&"object"==typeof n?Et(t,i(n,[...e,r])):(t[s(...e,r)]=n,t)),{})}const r=Pt(zt(e||{}).map((([t,e])=>[t,i(e,[])]))),{"":n={},dark:a,light:l}=r,c=function(t,e){var s={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(s[i[r]]=t[i[r]])}return s}(r,["","dark","light"]),o=this.size,h=this.time,{l:u,c:g,h:d}=this._settings.palette,p=["xs","s","m","l","xl"],m=["pale","base","rich"];this._=({bem:t,each:e,when:i,vars:a,merge:l,at:{mq:b},units:{px:f,ms:v,pc:$}})=>{const y="prefers-color-scheme",j={light:`${y}: light`,dark:`${y}: dark`};return l({[`:root:has(script[is=${jt}])`]:l({fontSize:a("rem")},n,e(d,((t,e)=>({[s(At,"h",t)]:e}))),{[s(At,"c","bg","gray")]:0,[s(At,"c","fg","gray")]:0},e(j,((t,i)=>({[b(i).s]:l(r[t]||{},e(p,((e,i)=>({[s(At,"l","bg",i)]:u[t].bg[i],[s(At,"l","fg",i)]:u[t].fg[i]}))),e(m,((e,i)=>({[s(At,"c","bg",i)]:g[t].bg[i],[s(At,"c","fg",i)]:g[t].fg[i]}))))}))))},e(c,((e,s)=>({[`:root:has(script[is=${jt}][${qt}=${e}])`]:s,[t(`..theme.${e}`)]:s}))),i(!!o,{[`:root:has(script[is=${jt}][size])`]:{[s("","rem")]:f(o)}}),i(!!h,{[`:root:has(script[is=${jt}][time])`]:{[s("","rtime")]:v(h)}}))},this.use(this._,this._k.base,!0)},this.use=(t,e,s)=>{const i=e||this._k.current;let r=this._c.use(t,i);return(s||this._m&&!this._m.has(e))&&this._m.pack(r,this.css(t,r)),e||this._k.next(),this.resolve(r)},this.usePublic=t=>Pt(zt(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["size","time"]}get prefix(){return Nt(this,"prefix")||""}get mode(){return Nt(this,"mode")}get hydrate(){return""===this.getAttribute("hydrate")}get settings(){return this._settings}set settings(t){var e,s,i,r,n;const a=Et({},this._settings,t,{palette:kt(this._settings.palette,null==t?void 0:t.palette)}),{makers:l,vars:c,bp:o,off:h,palette:u}=a;(o&&(null===(e=this._settings)||void 0===e?void 0:e.bp)!==o||!this._p)&&(this._p=at({scope:this._s,globalKey:this._k.base,bp:o})),l&&(null===(s=this._settings)||void 0===s?void 0:s.makers)!==l&&(this._c.useMany(l),this.usePublic(l),(null==h?void 0:h.length)&&this._settings.off!==h&&this.off(...h),this.hydrate&&this._k.reset()),this._settings=a,(!(null===(i=this._m)||void 0===i?void 0:i.has(this._k.base))||c&&(null===(r=this._settings)||void 0===r?void 0:r.vars)!==c||u&&(null===(n=this._settings)||void 0===n?void 0:n.palette)!==u)&&this._cust()}set theme(t){t?this.setAttribute(qt,t):this.removeAttribute(qt)}get theme(){return Nt(this,qt)||""}set size(t){null===t?this.removeAttribute("size"):this.setAttribute("size",t+"")}get size(){const t=this.getAttribute("size");return null!==t?Number(t):null}set time(t){null===t?this.removeAttribute("time"):this.setAttribute("time",t+"")}get time(){const t=this.getAttribute("time");return null!==t?Number(t):null}attributeChangedCallback(){this._k&&this._cust()}connectedCallback(){this._k=wt({prefix:this.prefix}),this._s=((t={})=>{const{mode:e}=t;let s,i;return t=>{const r=(...e)=>""+e.filter(Boolean).reduce(((t,e)=>`${t}-${e}`),t),n=(...t)=>"--"+r(...t);return"c"===e?(s=t=>{let e,s,i,n;return gt(t)?([e,s,i,n]=mt(t),vt(r(e),s,i,n)):t&&bt(t).map((([t,e,s,i])=>vt(r(t),e,s,i))).join(",")},i=t=>{let e,s,i,n;const a="class";let l="";return Array.isArray(t)?l=[...t.reduce(((t,a)=>([e,s,i,n]=mt(a),t.add(ft(r(e),s)),i&&t.add(ft(r(e),s,i,n)),t)),new Set).values()].join(" "):gt(t)?([e,s,i,n]=mt(t),l=ft(r(e),s,i,n)):l=t&&bt(t,!0).map((([t,e,s,i])=>ft(r(t),e,s,i))).join(" "),ht({[a]:l},{toString:{value:()=>`${a}="${l}"`}})}):(s=t=>{let e,s,i,n;return gt(t)?([e,s,i,n]=mt(t),$t(r(e),s,i,n)):t&&bt(t).map((([t,e,s,i])=>$t(r(t),e,s,i))).join(",")},i=t=>{let e,s,i,n,a,l,c="";if(Array.isArray(t))l=t.reduce(((t,l)=>{[e,s,i,n]=mt(l);const o=pt(r(e),s);return a=ut(o),c=i?n?`${i}_${n}`:`${i}`:"",t[a]&&c?t[a]=t[a]+" "+c:t[a]=c,t}),{});else if(gt(t)){[e,s,i,n]=mt(t);const o=pt(r(e),s);a=ut(o),c=i?n?`${i}_${n}`:`${i}`:"",l={[a]:c}}else l=t&&bt(t,!0).reduce(((t,[e,s,i,n])=>{const l=pt(r(e),s);a=ut(l);const o=i?n?`${i}_${n}`:`${i}`:"";return c=t[a]?t[a]+" "+o:o,t[a]=c,t}),{});return ht(l,{toString:{value:()=>ct(l).map((([t,e])=>`${t}="${e}"`)).join(" ")}}),l}),{selector:s,attr:i,name:r,varName:n,varExp:(...t)=>`var(${n(...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(jt,i,{extends:"script"}),!0}}export{Ct 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=>{const e={pri:t($t,"h","pri"),sec:t($t,"h","sec"),ter:t($t,"h","ter"),suc:t($t,"h","suc"),inf:t($t,"h","inf"),war:t($t,"h","war"),dan:t($t,"h","dan")};class s{constructor(t={}){this.state={l:"l",c:"base",h:e.pri,a:1,m:"bg"},Object.assign(this,{[ft]:!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($t,"l",i,e)} ${t($t,"c",i,s)} ${r} / ${n})`}}return new s},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 {};
|
|
@@ -0,0 +1,135 @@
|
|
|
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
|
+
* Main range dictionary
|
|
119
|
+
*/
|
|
120
|
+
readonly main: {
|
|
121
|
+
min: string;
|
|
122
|
+
m: string;
|
|
123
|
+
max: string;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Sparse range dictionary
|
|
127
|
+
*/
|
|
128
|
+
readonly sparse: {
|
|
129
|
+
min: string;
|
|
130
|
+
xs: string;
|
|
131
|
+
m: string;
|
|
132
|
+
xl: string;
|
|
133
|
+
max: string;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
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';
|
|
5
6
|
import { resolveColor } from './_process/color';
|
|
6
7
|
import { resolvePalette } from './_process/palette';
|
|
8
|
+
import { resolveCoef } from './_process/coef';
|
|
7
9
|
import { getBaseHandlers } from './_process/base';
|
|
8
10
|
type Leaves<T> = T extends object ? {
|
|
9
11
|
[K in keyof T]: `${Exclude<K, symbol>}${Leaves<T[K]> extends never ? '' : `.${Leaves<T[K]>}`}`;
|
|
@@ -37,14 +39,26 @@ interface IMakerParams extends ReturnType<typeof getBaseHandlers> {
|
|
|
37
39
|
* Color palette
|
|
38
40
|
*/
|
|
39
41
|
palette: ReturnType<typeof resolvePalette>;
|
|
42
|
+
/**
|
|
43
|
+
* Coefficient
|
|
44
|
+
*/
|
|
45
|
+
coef: ReturnType<typeof resolveCoef>;
|
|
40
46
|
/**
|
|
41
47
|
* Global vars
|
|
42
48
|
*/
|
|
43
49
|
vars: <G>(val: Leaves<G>) => string;
|
|
50
|
+
/**
|
|
51
|
+
* Scalable size value
|
|
52
|
+
*/
|
|
53
|
+
size: (coef?: number | string) => string;
|
|
44
54
|
/**
|
|
45
55
|
* Scalable time value
|
|
46
56
|
*/
|
|
47
|
-
time: (coef?: number) => string;
|
|
57
|
+
time: (coef?: number | string) => string;
|
|
58
|
+
/**
|
|
59
|
+
* Scalable angle value
|
|
60
|
+
*/
|
|
61
|
+
angle: (coef?: number | string) => string;
|
|
48
62
|
/**
|
|
49
63
|
* Width limit queries
|
|
50
64
|
*/
|
|
@@ -75,6 +89,10 @@ interface IMakerParams extends ReturnType<typeof getBaseHandlers> {
|
|
|
75
89
|
*/
|
|
76
90
|
only: <T = TDeafultBreakpoints>(val: Exclude<keyof T, Symbol> | number, scope?: string) => string;
|
|
77
91
|
};
|
|
92
|
+
/**
|
|
93
|
+
* Merge
|
|
94
|
+
*/
|
|
95
|
+
merge: typeof merge;
|
|
78
96
|
}
|
|
79
97
|
type TCreateProcessor = (params: {
|
|
80
98
|
scope: ReturnType<TCreateScope>;
|
|
@@ -96,7 +114,6 @@ export declare const baseHandlers: {
|
|
|
96
114
|
space: (...val: (string | number)[]) => string;
|
|
97
115
|
range: (size: number, handler: (k: number) => object) => object;
|
|
98
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;
|
|
99
|
-
merge: (target: Record<string, any>, ...sources: Record<string, any>[]) => Record<string, any>;
|
|
100
117
|
when: (condition: boolean | undefined, rules: object, otherwise?: object) => object;
|
|
101
118
|
};
|
|
102
119
|
/**
|
|
@@ -23,6 +23,20 @@ export type TPalette = {
|
|
|
23
23
|
h: TPaletteHue;
|
|
24
24
|
};
|
|
25
25
|
export type TPaletteConfig = RecursivePartial<TPalette>;
|
|
26
|
+
export type TCoefShortRange = 's' | 'm' | 'l';
|
|
27
|
+
export type TCoefMainRange = 'min' | 'm' | 'max';
|
|
28
|
+
export type TCoefBaseRange = 'xs' | TCoefShortRange | 'xl';
|
|
29
|
+
export type TCoefLongRange = 'xxs' | TCoefBaseRange | 'xxl';
|
|
30
|
+
export type TCoefFullRange = 'min' | TCoefLongRange | 'max';
|
|
31
|
+
export type TCoefSparseRange = 'min' | 'xs' | 'm' | 'xl' | 'max';
|
|
32
|
+
export type TCoefRangeConfig = Record<'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxl', number>;
|
|
33
|
+
export type TCoef = {
|
|
34
|
+
$0_: TCoefRangeConfig;
|
|
35
|
+
$1_: TCoefRangeConfig;
|
|
36
|
+
$2_: TCoefRangeConfig;
|
|
37
|
+
$16_: TCoefRangeConfig;
|
|
38
|
+
max: number;
|
|
39
|
+
};
|
|
26
40
|
/**
|
|
27
41
|
* Provider attributes
|
|
28
42
|
*/
|
|
@@ -54,6 +68,10 @@ export type TProviderAttrs = {
|
|
|
54
68
|
* Root time in ms
|
|
55
69
|
*/
|
|
56
70
|
time: string | null;
|
|
71
|
+
/**
|
|
72
|
+
* Root angle in deg
|
|
73
|
+
*/
|
|
74
|
+
angle: string | null;
|
|
57
75
|
};
|
|
58
76
|
/**
|
|
59
77
|
* Provider settings
|
|
@@ -79,6 +97,10 @@ export type TProviderSettings = {
|
|
|
79
97
|
* Palette
|
|
80
98
|
*/
|
|
81
99
|
palette: TPalette;
|
|
100
|
+
/**
|
|
101
|
+
* Coefficients
|
|
102
|
+
*/
|
|
103
|
+
coef: TCoef;
|
|
82
104
|
};
|
|
83
105
|
export type TProviderSettingsPartial = RecursivePartial<TProviderSettings>;
|
|
84
106
|
type TStrDict = Record<string, string>;
|
|
@@ -132,9 +154,9 @@ type TScopeResolver = (key: string) => TScope;
|
|
|
132
154
|
export type TCreateScope = (params?: {
|
|
133
155
|
mode?: string | null;
|
|
134
156
|
}) => TScopeResolver;
|
|
157
|
+
export declare const merge: (target: Record<string, any>, ...sources: Record<string, any>[]) => Record<string, any>;
|
|
135
158
|
export declare const TAG_NAME = "effcss-provider";
|
|
136
159
|
export declare const DEFAULT_ATTRS: TProviderAttrs;
|
|
137
|
-
export declare const mixPalette: (prev: TPalette, next?: TPaletteConfig) => TPalette;
|
|
138
160
|
export declare const DEFAULT_BREAKPOINTS: {
|
|
139
161
|
'3xs': number;
|
|
140
162
|
'2xs': number;
|
|
@@ -52,9 +52,18 @@ export interface IStyleProvider {
|
|
|
52
52
|
get time(): number | null;
|
|
53
53
|
/**
|
|
54
54
|
* Set root time value
|
|
55
|
-
* @param val -
|
|
55
|
+
* @param val - time value in ms
|
|
56
56
|
*/
|
|
57
57
|
set time(val: number | null);
|
|
58
|
+
/**
|
|
59
|
+
* Get root angle value
|
|
60
|
+
*/
|
|
61
|
+
get angle(): number | null;
|
|
62
|
+
/**
|
|
63
|
+
* Set root angle value
|
|
64
|
+
* @param val - angle value in ms
|
|
65
|
+
*/
|
|
66
|
+
set angle(val: number | null);
|
|
58
67
|
/**
|
|
59
68
|
* Get provider settings
|
|
60
69
|
*/
|