effcss 3.3.0 → 3.5.0
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 +7 -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/coef.d.ts +127 -0
- package/dist/types/src/_provider/_process/palette.d.ts +116 -0
- package/dist/types/src/_provider/_process/utils.d.ts +1 -0
- package/dist/types/src/_provider/process.d.ts +19 -1
- package/dist/types/src/common.d.ts +52 -0
- package/dist/types/src/index.d.ts +13 -4
- 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 }) = {
|
|
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
|
|
@@ -148,6 +148,7 @@ const myStyleSheetMaker: TStyleSheetMaker = ({ bem, pseudo, at: { kf }, merge })
|
|
|
148
148
|
}
|
|
149
149
|
}, {
|
|
150
150
|
border: 'none',
|
|
151
|
+
background: palette.pale.xl.alpha(0.8),
|
|
151
152
|
aspectRatio: 1,
|
|
152
153
|
[pseudo.h()]: {
|
|
153
154
|
opacity: 0.5
|
|
@@ -168,7 +169,11 @@ const myStyleSheetMaker: TStyleSheetMaker = ({ bem, pseudo, at: { kf }, merge })
|
|
|
168
169
|
[bem<ICardMaker>('card..h.full')]: { ... },
|
|
169
170
|
[bem<ICardMaker>('card.footer')]: { ... },
|
|
170
171
|
[bem<ICardMaker>('card.footer.visible')]: { ... },
|
|
171
|
-
|
|
172
|
+
...each(coef.short, (k, v) => ({
|
|
173
|
+
[bem<ICardMaker>(`card.footer.sz.${k}`)]: {
|
|
174
|
+
height: size(v)
|
|
175
|
+
}
|
|
176
|
+
}))
|
|
172
177
|
};
|
|
173
178
|
};
|
|
174
179
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* EffCSS v3.
|
|
2
|
+
* EffCSS v3.5.0
|
|
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",i="@layer",n="@scope",o="@supports",c=(e,s)=>{const r=t+` ${s||""}${s?" and ":""}(${e})`;return{s:r,q:e,t:s,toString:()=>r}};c.toString=()=>t;const a=t=>t+"px",l=t=>t+"vh",h=t=>t+"vw",u=t=>t+"vmin",m=t=>t+"vmax",d=t=>t+"rem",p=t=>t+"deg",g=t=>t+"ms",f=t=>t+"%",v=t=>t+"cqw",$=t=>t+"cqh",b=t=>t+"cqi",y=t=>t+"cqb",_=t=>t+"cqmin",k=t=>t+"cqmax",x=Object.fromEntries,S=Object.entries,j=":first-",w=":last-",A=":only-",q="child",O=":nth-",E="of-type",z=O+q,C=":focus",P={r:":root",h:":hover",f:C,fv:C+"-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:j+q,lc:w+q,oc:A+q,odd:z+"(odd)",even:z+"(even)",ft:j+E,lt:w+E,ot:A+E,bef:"::before",aft:"::after",bd:"::backdrop"},I={has:":has",not:":not",is:":is",wh:":where",st:":state",nthc:z,ntho:O+E,dir:":dir",lang:":lang"},W="oklch",K=t=>W+`(${t})`,M=t=>K(`from ${t}`),N="def",B=t=>{const e=(e,s)=>"string"==typeof s?t(e,s):s;class s{constructor(t={}){this.state={l:e("l",N),c:e("c",N),h:e("h",N),a:e("a",N)},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 K(`${t} ${e} ${s} / ${r}`)}}return t=>new s(t)},L=(t,e=.1)=>M(`${t} calc(l + ${e}) c h / alpha)`),R=(t,e=.1)=>M(`${t} calc(l - ${e}) c h / alpha)`),H=(t,e=.1)=>M(`${t} l c h / calc(alpha + ${e}))`),T=(t,e=.1)=>M(`${t} l c h / calc(alpha - ${e}))`),V=(t,e=.04)=>M(`${t} l calc(c + ${e}) h / alpha)`),Z=(t,e=.04)=>M(`${t} l calc(c - ${e}) h / alpha)`),D=(t,e=30)=>M(`${t} l c calc(h${"number"==typeof e?e>0?" + "+e:" - "+-e:e}) / alpha)`),F=({base:t,mixin:e,method:s,bpart:r,mpart:i})=>`color-mix(in ${s||W}, ${t}${void 0!==r?` ${r}%`:""}, ${e}${void 0!==i?` ${i}%`:""})`,G=t=>({create:B(t),oklch:K,lighten:L,darken:R,saturate:V,desaturate:Z,fadein:H,fadeout:T,spin:D,mix:F}),J=Object.assign,Q=Object.entries,U=Array.isArray,X=(t,...e)=>e.length?e.reduce(((t,e)=>(Q(e).forEach((([e,s])=>{s&&"object"==typeof s&&t[e]?U(t[e])&&U(s)?t[e]=[...t[e],...s]:X(t[e],s||{}):t[e]=s})),t)),t):t,Y=(t,e,s)=>Object.entries(t).reduce(e,s),tt=(t,e,s)=>{var r,i,n;let o=""+t;return null==e?"":"object"==typeof e?(!s||(null===(r=s.startsWith)||void 0===r?void 0:r.call(s,"@"))||(null===(i=o.startsWith)||void 0===i?void 0:i.call(o,"&"))||(null===(n=o.startsWith)||void 0===n?void 0:n.call(o,"@"))?"":"&")+o+`{${Y(e,((t,e)=>t+tt(...e,o)),"")}}`:`${c=o,c.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}:${""+e};`;var c},et={dash:(...t)=>t.join("-"),comma:(...t)=>t.join(),space:(...t)=>t.join(" "),range:(t,e)=>Array.from(Array(t).entries()).reduce(((t,[s])=>J(t,e(s+1))),{}),each:(t,e)=>Q(t).reduce(((t,[s,r])=>J(t,e(s,r))),{}),merge:X,when:(t,e,s={})=>t?e:s},st="width: ",rt=t=>{const{scope:j,globalKey:w="",bp:A={}}=t,q=j(w),O=t=>q.varExp(...t.split(".")),E=(t=1)=>`calc(${t} * ${O("rtime")})`;return{compile:({key:t,maker:w})=>{const z=j(t),C=(t=>{const a={cp:1,lay:1,kf:1,cq:1},l=(s,r)=>{const i="string"==typeof r?r:t.name("cq",a.cq++),n=e+` ${i?i+" ":""}(${s})`;return{c:i,q:s,s:n,toString:()=>n}};l.toString=()=>e;const h=(e,r)=>{const i="--"+(e||t.name("cp",a.cp++)),n=s+" "+i;return{k:i,v:`var(${i})`,s:n,r:{[n]:{syntax:(null==r?void 0:r.syn)||'"*"',inherits:(null==r?void 0:r.inh)||!1,initialValue:null==r?void 0:r.ini}},toString:()=>n}};h.toString=()=>s;const u=e=>{const s=e||t.name("kf",a.kf++),i=r+" "+s;return{k:s,s:i,toString:()=>i}};u.toString=()=>r;const m=e=>{const s=e||t.name("lay",a.lay++),r=i+" "+s;return{k:s,s:r,toString:()=>r}};m.toString=()=>i,m.toString=()=>n;const d=(t="",e=!1)=>{const s=o+` ${e?"not ":""}(${t})`;return{c:t,n:e,s:s,toString:()=>s}};return d.toString=()=>o,{pr:h,kf:u,mq:c,cq:l,lay:m,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),W=t=>{const e=A[t]||t;return"number"==typeof e?e+"rem":""},K=t=>"min-"+st+W(t),M=t=>"max-"+st+W(t),N=(t,e)=>"string"==typeof e?C.cq(t,e):C.mq(t),B=(t,e,s)=>""+N(K(t)+") and ("+M(e),s),L={up:(t,e)=>""+N(K(t),e),down:(t,e)=>""+N(M(t),e),between:B,only:(t,e)=>B(t,t,e)};return R=w(Object.assign(et,{key:t,vars:O,time:E,bem:z.selector,pseudo:Object.assign(x(S(P).map((([t,e])=>{function s(t=""){return t+e}return s.toString=()=>e,[t,s]}))),x(S(I).map((([t,e])=>{function s(t,s=""){return s+e+`(${t})`}return s.toString=()=>e,[t,s]})))),color:G(q.varExp),units:{px:a,vh:l,vw:h,vmin:u,vmax:m,rem:d,deg:p,ms:g,pc:f,cqw:v,cqh:$,cqb:y,cqi:b,cqmin:_,cqmax:k},at:C,limit:L})),Y(R,((t,e)=>t+tt(...e)),"");var R}}};const it=void 0,nt=Object.entries,ot=Object.defineProperties,ct=t=>`data-${t}`,at=t=>"string"==typeof t,lt=t=>null!==t&&"object"==typeof t,ht=(t,e)=>`${t}${e?"__"+e:""}`,ut=t=>t.split("."),mt=(t,e)=>nt(t).reduce(((t,[s,r])=>{if(lt(r)){const i=nt(r);i.length?t.push(...i.reduce(((t,[r,i])=>{if((t=>null!==t&&t!==it)(r)&&e&&t.push([s,r,it,it]),lt(i)){const e=nt(i);e.length&&t.push(...e.reduce(((t,[e,i])=>{const n=typeof i;return"string"!==n&&"number"!==n||t.push([s,r,e,i]),t}),[]))}return t}),[])):t.push([s,it,it,it])}return t}),[]),dt=(t,e,s,r)=>""+(ht(t,e)+(s?"_"+s:"")+(s&&r?"_"+r:"")),pt=(t,e,s,r)=>"."+dt(t,e,s,r),gt=(t,e,s,r)=>`[${ct(ht(t,e))}${s&&r?`~="${s}_${r}"`:s?`~="${s}"`:""}]`,ft={def:.75,c:.05,s:.65,m:.75,l:.85,n:.9},vt="effcss-provider",$t={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null},bt={bp:{"3xs":18,"2xs":24,xs:30,sm:40,md:48,lg:64,xl:80,"2xl":96},vars:{"":{rtime:"200ms",rem:"16px",l:ft,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:ft},dark:{l:{def:.4,n:.25,s:.3,m:.4,l:.5,c:.95}}}},yt=({prefix:t})=>{let e=1;return{get base(){return t+0},get current(){return t+e},next(){return e++,this.current},reset(){e=1}}},_t=()=>{const t=new Set,e=new Map;return{use(s,r){const i=e.get(s);return i||(t.add(r),e.set(s,r),r)},useMany(t){return nt(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])))}}},kt="theme",xt=Object.assign,St=Object.entries,jt=Object.fromEntries,wt=(t,e)=>t.getAttribute(e)||$t[e];!function(t={}){const e=window.document,s=window.customElements;if(null==s?void 0:s.get(vt))return!1;{class r extends HTMLScriptElement{constructor(){super(...arguments),this._c=_t(),this._m=function(){let t={},e={},s=[],r=[];const i=(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]},o=()=>{r=r.reduce(((t,e)=>{const s=e.deref();return s&&(n(s),t.push(e)),t}),[])},c=t=>s.findIndex((e=>e===t)),a=e=>e?t[e]:void 0,l=(e,r)=>{if(!t[e])return t[e]=i(e,r),s.push(t[e]),o(),!0},h=t=>{const e=a(t);return!!e&&-1!==c(e)};return{apply:n,notify:o,getIndex:c,get:a,has:t=>!!t&&!!a(t),getAll:()=>t,add:l,status:h,on:(...t)=>{const e=t.reduce(((t,e)=>{const r=a(e);return!(!r||h(e))&&(s.push(r),t)}),!0);return o(),e},off:(...t)=>{const e=t.reduce(((t,e)=>{const r=a(e);if(r&&h(e)){const e=c(r);return s.splice(e,1),t}return!1}),!0);return o(),e},remove:r=>{const i=a(r);if(!i)return;const n=c(i);return n>-1&&(s.splice(n,1),delete t[r],delete e[r]),o(),!0},removeAll:()=>(s.splice(0),t={},e={},o(),!0),pack:(e,s)=>{let r=t[e]||new CSSStyleSheet;return r.replaceSync(s),r=i(e,r),!!r.cssRules.length&&l(e,r)},replace:(e,s)=>{const r=t[e];if(r)return r.replaceSync(s),o(),!0},register:t=>{r.findIndex((e=>e.deref()===t))>=0||(r.push(new WeakRef(t)),n(t))},unregister:t=>{const e=r.findIndex((e=>e.deref()===t));e>=0&&r.splice(e,1)}}}(),this._cust=(t={})=>{const{varName:e}=this._s(this._k.base);function s(t,r){return St(t).reduce(((t,[i,n])=>n&&"object"==typeof n?xt(t,s(n,[...r,i])):(t[e(...r,i)]=n,t)),{})}const r=jt(St(t||{}).map((([t,e])=>[t,s(e,[])]))),{"":i={},dark:n,light:o}=r,c=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 i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(s[r[i]]=t[r[i]])}return s}(r,["","dark","light"]),a=this.getAttribute("size"),l=this.getAttribute("time");this._=({bem:t,each:s,when:r,vars:h,merge:u,at:{mq:m},units:{px:d,ms:p}})=>{const g="prefers-color-scheme",f={light:`${g}: light`,dark:`${g}: dark`};return u({[`:root:has(script[is=${vt}])`]:u({fontSize:h("rem")},i)},r(!!n,{[m(f.dark).s]:n}),r(!!o,{[m(f.light).s]:o}),s(c,((e,s)=>({[`:root:has(script[is=${vt}][${kt}=${e}])`]:s,[t(`..theme.${e}`)]:s}))),r(!!a,{[`:root:has(script[is=${vt}][size])`]:{[e("","rem")]:d(a)}}),r(!!l,{[`:root:has(script[is=${vt}][time])`]:{[e("","rtime")]:p(l)}}))},this.use(this._,this._k.base,!0)},this.use=(t,e,s)=>{const r=e||this._k.current;let i=this._c.use(t,r);return(s||this._m&&!this._m.has(e))&&this._m.pack(i,this.css(t,i)),e||this._k.next(),this.resolve(i)},this.usePublic=t=>jt(St(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 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 i=xt({},this._settings,t),{makers:n,vars:o,bp:c,off:a}=i;c&&(null===(e=this._settings)||void 0===e?void 0:e.bp)!==c&&(this._p=rt({scope:this._s,globalKey:this._k.base,bp:c})),o&&(null===(s=this._settings)||void 0===s?void 0:s.vars)!==o&&this._cust(o),n&&(null===(r=this._settings)||void 0===r?void 0:r.makers)!==n&&(this._c.useMany(n),this.usePublic(n),(null==a?void 0:a.length)&&this._settings.off!==a&&this.off(...a),this.hydrate&&this._k.reset()),this._settings=i}set theme(t){t?this.setAttribute(kt,t):this.removeAttribute(kt)}get theme(){return wt(this,kt)||""}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(){var t;this._k&&this._cust(null===(t=this._settings)||void 0===t?void 0:t.vars)}connectedCallback(){this._k=yt({prefix:this.prefix}),this._s=((t={})=>{const{mode:e}=t;let s,r;return t=>{const i=(...e)=>""+e.filter(Boolean).reduce(((t,e)=>`${t}-${e}`),t),n=(...t)=>"--"+i(...t);return"c"===e?(s=t=>{let e,s,r,n;return at(t)?([e,s,r,n]=ut(t),pt(i(e),s,r,n)):t&&mt(t).map((([t,e,s,r])=>pt(i(t),e,s,r))).join(",")},r=t=>{let e,s,r,n;const o="class";let c="";return Array.isArray(t)?c=[...t.reduce(((t,o)=>([e,s,r,n]=ut(o),t.add(dt(i(e),s)),r&&t.add(dt(i(e),s,r,n)),t)),new Set).values()].join(" "):at(t)?([e,s,r,n]=ut(t),c=dt(i(e),s,r,n)):c=t&&mt(t,!0).map((([t,e,s,r])=>dt(i(t),e,s,r))).join(" "),ot({[o]:c},{toString:{value:()=>`${o}="${c}"`}})}):(s=t=>{let e,s,r,n;return at(t)?([e,s,r,n]=ut(t),gt(i(e),s,r,n)):t&&mt(t).map((([t,e,s,r])=>gt(i(t),e,s,r))).join(",")},r=t=>{let e,s,r,n,o,c,a="";if(Array.isArray(t))c=t.reduce(((t,c)=>{[e,s,r,n]=ut(c);const l=ht(i(e),s);return o=ct(l),a=r?n?`${r}_${n}`:`${r}`:"",t[o]&&a?t[o]=t[o]+" "+a:t[o]=a,t}),{});else if(at(t)){[e,s,r,n]=ut(t);const l=ht(i(e),s);o=ct(l),a=r?n?`${r}_${n}`:`${r}`:"",c={[o]:a}}else c=t&&mt(t,!0).reduce(((t,[e,s,r,n])=>{const c=ht(i(e),s);o=ct(c);const l=r?n?`${r}_${n}`:`${r}`:"";return a=t[o]?t[o]+" "+l:l,t[o]=a,t}),{});return ot(c,{toString:{value:()=>nt(c).map((([t,e])=>`${t}="${e}"`)).join(" ")}}),c}),{selector:s,attr:r,name:i,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=xt({},bt,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(vt,r,{extends:"script"})}}();
|
|
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"})}}();
|
package/dist/consumer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* EffCSS v3.
|
|
2
|
+
* EffCSS v3.5.0
|
|
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.0
|
|
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",i="@layer",n="@scope",o="@supports",c=(e,s)=>{const r=t+` ${s||""}${s?" and ":""}(${e})`;return{s:r,q:e,t:s,toString:()=>r}};c.toString=()=>t;const a=t=>t+"px",l=t=>t+"vh",h=t=>t+"vw",u=t=>t+"vmin",m=t=>t+"vmax",d=t=>t+"rem",p=t=>t+"deg",g=t=>t+"ms",f=t=>t+"%",v=t=>t+"cqw",$=t=>t+"cqh",b=t=>t+"cqi",y=t=>t+"cqb",_=t=>t+"cqmin",k=t=>t+"cqmax",x=Object.fromEntries,S=Object.entries,j=":first-",w=":last-",A=":only-",q="child",O=":nth-",E="of-type",z=O+q,C=":focus",P={r:":root",h:":hover",f:C,fv:C+"-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:j+q,lc:w+q,oc:A+q,odd:z+"(odd)",even:z+"(even)",ft:j+E,lt:w+E,ot:A+E,bef:"::before",aft:"::after",bd:"::backdrop"},I={has:":has",not:":not",is:":is",wh:":where",st:":state",nthc:z,ntho:O+E,dir:":dir",lang:":lang"},W="oklch",K=t=>W+`(${t})`,M=t=>K(`from ${t}`),N="def",B=t=>{const e=(e,s)=>"string"==typeof s?t(e,s):s;class s{constructor(t={}){this.state={l:e("l",N),c:e("c",N),h:e("h",N),a:e("a",N)},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 K(`${t} ${e} ${s} / ${r}`)}}return t=>new s(t)},L=(t,e=.1)=>M(`${t} calc(l + ${e}) c h / alpha)`),R=(t,e=.1)=>M(`${t} calc(l - ${e}) c h / alpha)`),H=(t,e=.1)=>M(`${t} l c h / calc(alpha + ${e}))`),T=(t,e=.1)=>M(`${t} l c h / calc(alpha - ${e}))`),V=(t,e=.04)=>M(`${t} l calc(c + ${e}) h / alpha)`),Z=(t,e=.04)=>M(`${t} l calc(c - ${e}) h / alpha)`),D=(t,e=30)=>M(`${t} l c calc(h${"number"==typeof e?e>0?" + "+e:" - "+-e:e}) / alpha)`),F=({base:t,mixin:e,method:s,bpart:r,mpart:i})=>`color-mix(in ${s||W}, ${t}${void 0!==r?` ${r}%`:""}, ${e}${void 0!==i?` ${i}%`:""})`,G=t=>({create:B(t),oklch:K,lighten:L,darken:R,saturate:V,desaturate:Z,fadein:H,fadeout:T,spin:D,mix:F}),J=Object.assign,Q=Object.entries,U=Array.isArray,X=(t,...e)=>e.length?e.reduce(((t,e)=>(Q(e).forEach((([e,s])=>{s&&"object"==typeof s&&t[e]?U(t[e])&&U(s)?t[e]=[...t[e],...s]:X(t[e],s||{}):t[e]=s})),t)),t):t,Y=(t,e,s)=>Object.entries(t).reduce(e,s),tt=(t,e,s)=>{var r,i,n;let o=""+t;return null==e?"":"object"==typeof e?(!s||(null===(r=s.startsWith)||void 0===r?void 0:r.call(s,"@"))||(null===(i=o.startsWith)||void 0===i?void 0:i.call(o,"&"))||(null===(n=o.startsWith)||void 0===n?void 0:n.call(o,"@"))?"":"&")+o+`{${Y(e,((t,e)=>t+tt(...e,o)),"")}}`:`${c=o,c.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}:${""+e};`;var c},et={dash:(...t)=>t.join("-"),comma:(...t)=>t.join(),space:(...t)=>t.join(" "),range:(t,e)=>Array.from(Array(t).entries()).reduce(((t,[s])=>J(t,e(s+1))),{}),each:(t,e)=>Q(t).reduce(((t,[s,r])=>J(t,e(s,r))),{}),merge:X,when:(t,e,s={})=>t?e:s},st="width: ",rt=t=>{const{scope:j,globalKey:w="",bp:A={}}=t,q=j(w),O=t=>q.varExp(...t.split(".")),E=(t=1)=>`calc(${t} * ${O("rtime")})`;return{compile:({key:t,maker:w})=>{const z=j(t),C=(t=>{const a={cp:1,lay:1,kf:1,cq:1},l=(s,r)=>{const i="string"==typeof r?r:t.name("cq",a.cq++),n=e+` ${i?i+" ":""}(${s})`;return{c:i,q:s,s:n,toString:()=>n}};l.toString=()=>e;const h=(e,r)=>{const i="--"+(e||t.name("cp",a.cp++)),n=s+" "+i;return{k:i,v:`var(${i})`,s:n,r:{[n]:{syntax:(null==r?void 0:r.syn)||'"*"',inherits:(null==r?void 0:r.inh)||!1,initialValue:null==r?void 0:r.ini}},toString:()=>n}};h.toString=()=>s;const u=e=>{const s=e||t.name("kf",a.kf++),i=r+" "+s;return{k:s,s:i,toString:()=>i}};u.toString=()=>r;const m=e=>{const s=e||t.name("lay",a.lay++),r=i+" "+s;return{k:s,s:r,toString:()=>r}};m.toString=()=>i,m.toString=()=>n;const d=(t="",e=!1)=>{const s=o+` ${e?"not ":""}(${t})`;return{c:t,n:e,s:s,toString:()=>s}};return d.toString=()=>o,{pr:h,kf:u,mq:c,cq:l,lay:m,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),W=t=>{const e=A[t]||t;return"number"==typeof e?e+"rem":""},K=t=>"min-"+st+W(t),M=t=>"max-"+st+W(t),N=(t,e)=>"string"==typeof e?C.cq(t,e):C.mq(t),B=(t,e,s)=>""+N(K(t)+") and ("+M(e),s),L={up:(t,e)=>""+N(K(t),e),down:(t,e)=>""+N(M(t),e),between:B,only:(t,e)=>B(t,t,e)};return R=w(Object.assign(et,{key:t,vars:O,time:E,bem:z.selector,pseudo:Object.assign(x(S(P).map((([t,e])=>{function s(t=""){return t+e}return s.toString=()=>e,[t,s]}))),x(S(I).map((([t,e])=>{function s(t,s=""){return s+e+`(${t})`}return s.toString=()=>e,[t,s]})))),color:G(q.varExp),units:{px:a,vh:l,vw:h,vmin:u,vmax:m,rem:d,deg:p,ms:g,pc:f,cqw:v,cqh:$,cqb:y,cqi:b,cqmin:_,cqmax:k},at:C,limit:L})),Y(R,((t,e)=>t+tt(...e)),"");var R}}};const it=void 0,nt=Object.entries,ot=Object.defineProperties,ct=t=>`data-${t}`,at=t=>"string"==typeof t,lt=t=>null!==t&&"object"==typeof t,ht=(t,e)=>`${t}${e?"__"+e:""}`,ut=t=>t.split("."),mt=(t,e)=>nt(t).reduce(((t,[s,r])=>{if(lt(r)){const i=nt(r);i.length?t.push(...i.reduce(((t,[r,i])=>{if((t=>null!==t&&t!==it)(r)&&e&&t.push([s,r,it,it]),lt(i)){const e=nt(i);e.length&&t.push(...e.reduce(((t,[e,i])=>{const n=typeof i;return"string"!==n&&"number"!==n||t.push([s,r,e,i]),t}),[]))}return t}),[])):t.push([s,it,it,it])}return t}),[]),dt=(t,e,s,r)=>""+(ht(t,e)+(s?"_"+s:"")+(s&&r?"_"+r:"")),pt=(t,e,s,r)=>"."+dt(t,e,s,r),gt=(t,e,s,r)=>`[${ct(ht(t,e))}${s&&r?`~="${s}_${r}"`:s?`~="${s}"`:""}]`,ft={def:.75,c:.05,s:.65,m:.75,l:.85,n:.9},vt="effcss-provider",$t={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null},bt={bp:{"3xs":18,"2xs":24,xs:30,sm:40,md:48,lg:64,xl:80,"2xl":96},vars:{"":{rtime:"200ms",rem:"16px",l:ft,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:ft},dark:{l:{def:.4,n:.25,s:.3,m:.4,l:.5,c:.95}}}},yt=({prefix:t})=>{let e=1;return{get base(){return t+0},get current(){return t+e},next(){return e++,this.current},reset(){e=1}}},_t=()=>{const t=new Set,e=new Map;return{use(s,r){const i=e.get(s);return i||(t.add(r),e.set(s,r),r)},useMany(t){return nt(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])))}}},kt="theme",xt=Object.assign,St=Object.entries,jt=Object.fromEntries,wt=(t,e)=>t.getAttribute(e)||$t[e];function At(t={}){const e=window.document,s=window.customElements;if(null==s?void 0:s.get(vt))return!1;{class r extends HTMLScriptElement{constructor(){super(...arguments),this._c=_t(),this._m=function(){let t={},e={},s=[],r=[];const i=(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]},o=()=>{r=r.reduce(((t,e)=>{const s=e.deref();return s&&(n(s),t.push(e)),t}),[])},c=t=>s.findIndex((e=>e===t)),a=e=>e?t[e]:void 0,l=(e,r)=>{if(!t[e])return t[e]=i(e,r),s.push(t[e]),o(),!0},h=t=>{const e=a(t);return!!e&&-1!==c(e)};return{apply:n,notify:o,getIndex:c,get:a,has:t=>!!t&&!!a(t),getAll:()=>t,add:l,status:h,on:(...t)=>{const e=t.reduce(((t,e)=>{const r=a(e);return!(!r||h(e))&&(s.push(r),t)}),!0);return o(),e},off:(...t)=>{const e=t.reduce(((t,e)=>{const r=a(e);if(r&&h(e)){const e=c(r);return s.splice(e,1),t}return!1}),!0);return o(),e},remove:r=>{const i=a(r);if(!i)return;const n=c(i);return n>-1&&(s.splice(n,1),delete t[r],delete e[r]),o(),!0},removeAll:()=>(s.splice(0),t={},e={},o(),!0),pack:(e,s)=>{let r=t[e]||new CSSStyleSheet;return r.replaceSync(s),r=i(e,r),!!r.cssRules.length&&l(e,r)},replace:(e,s)=>{const r=t[e];if(r)return r.replaceSync(s),o(),!0},register:t=>{r.findIndex((e=>e.deref()===t))>=0||(r.push(new WeakRef(t)),n(t))},unregister:t=>{const e=r.findIndex((e=>e.deref()===t));e>=0&&r.splice(e,1)}}}(),this._cust=(t={})=>{const{varName:e}=this._s(this._k.base);function s(t,r){return St(t).reduce(((t,[i,n])=>n&&"object"==typeof n?xt(t,s(n,[...r,i])):(t[e(...r,i)]=n,t)),{})}const r=jt(St(t||{}).map((([t,e])=>[t,s(e,[])]))),{"":i={},dark:n,light:o}=r,c=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 i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(s[r[i]]=t[r[i]])}return s}(r,["","dark","light"]),a=this.getAttribute("size"),l=this.getAttribute("time");this._=({bem:t,each:s,when:r,vars:h,merge:u,at:{mq:m},units:{px:d,ms:p}})=>{const g="prefers-color-scheme",f={light:`${g}: light`,dark:`${g}: dark`};return u({[`:root:has(script[is=${vt}])`]:u({fontSize:h("rem")},i)},r(!!n,{[m(f.dark).s]:n}),r(!!o,{[m(f.light).s]:o}),s(c,((e,s)=>({[`:root:has(script[is=${vt}][${kt}=${e}])`]:s,[t(`..theme.${e}`)]:s}))),r(!!a,{[`:root:has(script[is=${vt}][size])`]:{[e("","rem")]:d(a)}}),r(!!l,{[`:root:has(script[is=${vt}][time])`]:{[e("","rtime")]:p(l)}}))},this.use(this._,this._k.base,!0)},this.use=(t,e,s)=>{const r=e||this._k.current;let i=this._c.use(t,r);return(s||this._m&&!this._m.has(e))&&this._m.pack(i,this.css(t,i)),e||this._k.next(),this.resolve(i)},this.usePublic=t=>jt(St(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 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 i=xt({},this._settings,t),{makers:n,vars:o,bp:c,off:a}=i;c&&(null===(e=this._settings)||void 0===e?void 0:e.bp)!==c&&(this._p=rt({scope:this._s,globalKey:this._k.base,bp:c})),o&&(null===(s=this._settings)||void 0===s?void 0:s.vars)!==o&&this._cust(o),n&&(null===(r=this._settings)||void 0===r?void 0:r.makers)!==n&&(this._c.useMany(n),this.usePublic(n),(null==a?void 0:a.length)&&this._settings.off!==a&&this.off(...a),this.hydrate&&this._k.reset()),this._settings=i}set theme(t){t?this.setAttribute(kt,t):this.removeAttribute(kt)}get theme(){return wt(this,kt)||""}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(){var t;this._k&&this._cust(null===(t=this._settings)||void 0===t?void 0:t.vars)}connectedCallback(){this._k=yt({prefix:this.prefix}),this._s=((t={})=>{const{mode:e}=t;let s,r;return t=>{const i=(...e)=>""+e.filter(Boolean).reduce(((t,e)=>`${t}-${e}`),t),n=(...t)=>"--"+i(...t);return"c"===e?(s=t=>{let e,s,r,n;return at(t)?([e,s,r,n]=ut(t),pt(i(e),s,r,n)):t&&mt(t).map((([t,e,s,r])=>pt(i(t),e,s,r))).join(",")},r=t=>{let e,s,r,n;const o="class";let c="";return Array.isArray(t)?c=[...t.reduce(((t,o)=>([e,s,r,n]=ut(o),t.add(dt(i(e),s)),r&&t.add(dt(i(e),s,r,n)),t)),new Set).values()].join(" "):at(t)?([e,s,r,n]=ut(t),c=dt(i(e),s,r,n)):c=t&&mt(t,!0).map((([t,e,s,r])=>dt(i(t),e,s,r))).join(" "),ot({[o]:c},{toString:{value:()=>`${o}="${c}"`}})}):(s=t=>{let e,s,r,n;return at(t)?([e,s,r,n]=ut(t),gt(i(e),s,r,n)):t&&mt(t).map((([t,e,s,r])=>gt(i(t),e,s,r))).join(",")},r=t=>{let e,s,r,n,o,c,a="";if(Array.isArray(t))c=t.reduce(((t,c)=>{[e,s,r,n]=ut(c);const l=ht(i(e),s);return o=ct(l),a=r?n?`${r}_${n}`:`${r}`:"",t[o]&&a?t[o]=t[o]+" "+a:t[o]=a,t}),{});else if(at(t)){[e,s,r,n]=ut(t);const l=ht(i(e),s);o=ct(l),a=r?n?`${r}_${n}`:`${r}`:"",c={[o]:a}}else c=t&&mt(t,!0).reduce(((t,[e,s,r,n])=>{const c=ht(i(e),s);o=ct(c);const l=r?n?`${r}_${n}`:`${r}`:"";return a=t[o]?t[o]+" "+l:l,t[o]=a,t}),{});return ot(c,{toString:{value:()=>nt(c).map((([t,e])=>`${t}="${e}"`)).join(" ")}}),c}),{selector:s,attr:r,name:i,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=xt({},bt,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(vt,r,{extends:"script"}),!0}}export{At as defineProvider};
|
|
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};
|
|
@@ -0,0 +1,127 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
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
|
+
};
|
|
@@ -3,6 +3,8 @@ import { resolveAtRules } from './_process/atrules';
|
|
|
3
3
|
import { resolveUnits } from './_process/units';
|
|
4
4
|
import { resolvePseudo } from './_process/pseudo';
|
|
5
5
|
import { resolveColor } from './_process/color';
|
|
6
|
+
import { resolvePalette } from './_process/palette';
|
|
7
|
+
import { resolveCoef } from './_process/coef';
|
|
6
8
|
import { getBaseHandlers } from './_process/base';
|
|
7
9
|
type Leaves<T> = T extends object ? {
|
|
8
10
|
[K in keyof T]: `${Exclude<K, symbol>}${Leaves<T[K]> extends never ? '' : `.${Leaves<T[K]>}`}`;
|
|
@@ -32,14 +34,30 @@ interface IMakerParams extends ReturnType<typeof getBaseHandlers> {
|
|
|
32
34
|
* Colors
|
|
33
35
|
*/
|
|
34
36
|
color: ReturnType<typeof resolveColor>;
|
|
37
|
+
/**
|
|
38
|
+
* Color palette
|
|
39
|
+
*/
|
|
40
|
+
palette: ReturnType<typeof resolvePalette>;
|
|
41
|
+
/**
|
|
42
|
+
* Coefficient
|
|
43
|
+
*/
|
|
44
|
+
coef: ReturnType<typeof resolveCoef>;
|
|
35
45
|
/**
|
|
36
46
|
* Global vars
|
|
37
47
|
*/
|
|
38
48
|
vars: <G>(val: Leaves<G>) => string;
|
|
49
|
+
/**
|
|
50
|
+
* Scalable size value
|
|
51
|
+
*/
|
|
52
|
+
size: (coef?: number | string) => string;
|
|
39
53
|
/**
|
|
40
54
|
* Scalable time value
|
|
41
55
|
*/
|
|
42
|
-
time: (coef?: number) => string;
|
|
56
|
+
time: (coef?: number | string) => string;
|
|
57
|
+
/**
|
|
58
|
+
* Scalable angle value
|
|
59
|
+
*/
|
|
60
|
+
angle: (coef?: number | string) => string;
|
|
43
61
|
/**
|
|
44
62
|
* Width limit queries
|
|
45
63
|
*/
|
|
@@ -1,3 +1,41 @@
|
|
|
1
|
+
type THueToken = 'pri' | 'sec' | 'suc' | 'inf' | 'war' | 'dan';
|
|
2
|
+
type TLightnessToken = 'xs' | 's' | 'm' | 'l' | 'xl';
|
|
3
|
+
type TChromaToken = 'pale' | 'base' | 'rich';
|
|
4
|
+
type TPaletteDict<T extends string> = {
|
|
5
|
+
dark: {
|
|
6
|
+
bg: Record<T, number>;
|
|
7
|
+
fg: Record<T, number>;
|
|
8
|
+
};
|
|
9
|
+
light: {
|
|
10
|
+
bg: Record<T, number>;
|
|
11
|
+
fg: Record<T, number>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
type RecursivePartial<T> = {
|
|
15
|
+
[P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial<U>[] : T[P] extends object | undefined ? RecursivePartial<T[P]> : T[P];
|
|
16
|
+
};
|
|
17
|
+
export type TPaletteHue = Record<THueToken, number>;
|
|
18
|
+
export type TPaletteLightness = TPaletteDict<TLightnessToken>;
|
|
19
|
+
export type TPaletteChroma = TPaletteDict<TChromaToken>;
|
|
20
|
+
export type TPalette = {
|
|
21
|
+
l: TPaletteLightness;
|
|
22
|
+
c: TPaletteChroma;
|
|
23
|
+
h: TPaletteHue;
|
|
24
|
+
};
|
|
25
|
+
export type TPaletteConfig = RecursivePartial<TPalette>;
|
|
26
|
+
export type TCoefShortRange = 's' | 'm' | 'l';
|
|
27
|
+
export type TCoefBaseRange = 'xs' | TCoefShortRange | 'xl';
|
|
28
|
+
export type TCoefLongRange = 'xxs' | TCoefBaseRange | 'xxl';
|
|
29
|
+
export type TCoefFullRange = 'min' | TCoefLongRange | 'max';
|
|
30
|
+
export type TCoefSparseRange = 'min' | 'xs' | 'm' | 'xl' | 'max';
|
|
31
|
+
export type TCoefRangeConfig = Record<'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxl', number>;
|
|
32
|
+
export type TCoef = {
|
|
33
|
+
$0_: TCoefRangeConfig;
|
|
34
|
+
$1_: TCoefRangeConfig;
|
|
35
|
+
$2_: TCoefRangeConfig;
|
|
36
|
+
$16_: TCoefRangeConfig;
|
|
37
|
+
max: number;
|
|
38
|
+
};
|
|
1
39
|
/**
|
|
2
40
|
* Provider attributes
|
|
3
41
|
*/
|
|
@@ -29,6 +67,10 @@ export type TProviderAttrs = {
|
|
|
29
67
|
* Root time in ms
|
|
30
68
|
*/
|
|
31
69
|
time: string | null;
|
|
70
|
+
/**
|
|
71
|
+
* Root angle in deg
|
|
72
|
+
*/
|
|
73
|
+
angle: string | null;
|
|
32
74
|
};
|
|
33
75
|
/**
|
|
34
76
|
* Provider settings
|
|
@@ -50,7 +92,16 @@ export type TProviderSettings = {
|
|
|
50
92
|
* Switched off stylesheets
|
|
51
93
|
*/
|
|
52
94
|
off: string[];
|
|
95
|
+
/**
|
|
96
|
+
* Palette
|
|
97
|
+
*/
|
|
98
|
+
palette: TPalette;
|
|
99
|
+
/**
|
|
100
|
+
* Coefficients
|
|
101
|
+
*/
|
|
102
|
+
coef: TCoef;
|
|
53
103
|
};
|
|
104
|
+
export type TProviderSettingsPartial = RecursivePartial<TProviderSettings>;
|
|
54
105
|
type TStrDict = Record<string, string>;
|
|
55
106
|
type Paths<T> = T extends object ? {
|
|
56
107
|
[K in keyof T]: `${Exclude<K, symbol>}${'' | Paths<T[K]> extends '' ? '' : `.${Paths<T[K]>}`}`;
|
|
@@ -104,6 +155,7 @@ export type TCreateScope = (params?: {
|
|
|
104
155
|
}) => TScopeResolver;
|
|
105
156
|
export declare const TAG_NAME = "effcss-provider";
|
|
106
157
|
export declare const DEFAULT_ATTRS: TProviderAttrs;
|
|
158
|
+
export declare const mixPalette: (prev: TPalette, next?: TPaletteConfig) => TPalette;
|
|
107
159
|
export declare const DEFAULT_BREAKPOINTS: {
|
|
108
160
|
'3xs': number;
|
|
109
161
|
'2xs': number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createProcessor } from './_provider/process';
|
|
2
|
-
import type { TProviderSettings } from './common';
|
|
2
|
+
import type { TProviderSettings, TProviderSettingsPartial } from './common';
|
|
3
3
|
import { createScope } from './common';
|
|
4
4
|
type TResolveAttr = ReturnType<ReturnType<typeof createScope>>['attr'];
|
|
5
5
|
/**
|
|
@@ -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
|
*/
|
|
@@ -62,7 +71,7 @@ export interface IStyleProvider {
|
|
|
62
71
|
/**
|
|
63
72
|
* Set provider settings
|
|
64
73
|
*/
|
|
65
|
-
set settings(val:
|
|
74
|
+
set settings(val: TProviderSettingsPartial);
|
|
66
75
|
/**
|
|
67
76
|
* Use stylesheet maker
|
|
68
77
|
* @param maker - stylesheet maker
|
|
@@ -142,5 +151,5 @@ export type TBaseStyleSheet = {
|
|
|
142
151
|
/**
|
|
143
152
|
* Define style provider custom element
|
|
144
153
|
*/
|
|
145
|
-
export declare function defineProvider(settings?:
|
|
154
|
+
export declare function defineProvider(settings?: TProviderSettingsPartial): boolean;
|
|
146
155
|
export {};
|