effcss 3.11.0 → 3.12.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 +12 -28
- 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/atrules.d.ts +6 -6
- package/dist/types/src/_provider/_process/coef.d.ts +2 -1
- package/dist/types/src/_provider/_process/color.d.ts +1 -1
- package/dist/types/src/_provider/_process/palette.d.ts +2 -1
- package/dist/types/src/_provider/collect.d.ts +30 -0
- package/dist/types/src/_provider/manage.d.ts +1 -1
- package/dist/types/src/_provider/name.d.ts +24 -0
- package/dist/types/src/_provider/process.d.ts +2 -1
- package/dist/types/src/_provider/scope.d.ts +84 -0
- package/dist/types/src/common.d.ts +211 -150
- package/dist/types/src/consumer.d.ts +4 -3
- package/dist/types/src/index.d.ts +31 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
|
|
16
16
|
</div>
|
|
17
17
|
|
|
18
|
-
EffCSS is a self-confident CSS-in-JS library based only on the browser APIs. Use the full power of JS
|
|
18
|
+
EffCSS is a self-confident CSS-in-JS library based only on the browser APIs. Use the full power of JS and TS to create styles.
|
|
19
19
|
|
|
20
20
|
## Some features
|
|
21
21
|
|
|
22
|
-
- zero-dependency
|
|
23
|
-
- framework agnostic
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
22
|
+
- zero-dependency,
|
|
23
|
+
- framework agnostic,
|
|
24
|
+
- selectors isolation and minification out of the box,
|
|
25
|
+
- BEM based stylesheet types,
|
|
26
|
+
- compatible with any rendering (CSR, SSR, SSG).
|
|
27
27
|
|
|
28
28
|
## Links
|
|
29
29
|
|
|
@@ -68,37 +68,20 @@ yarn add effcss
|
|
|
68
68
|
|
|
69
69
|
## Quick start
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
```html
|
|
74
|
-
<!DOCTYPE html>
|
|
75
|
-
<html lang="en">
|
|
76
|
-
<head>
|
|
77
|
-
<!-- define the style provider custom element -->
|
|
78
|
-
<script src="https://unpkg.com/effcss/dist/build/define-provider.min.js" crossorigin="anonymous"></script>
|
|
79
|
-
<!-- and create it -->
|
|
80
|
-
<script is="effcss-provider"></script>
|
|
81
|
-
</head>
|
|
82
|
-
<body>
|
|
83
|
-
<div id="root"></div>
|
|
84
|
-
</body>
|
|
85
|
-
</html>
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
Second, use `Style consumer` to operate styles in your code:
|
|
71
|
+
Just call `useStyleProvider` in your code:
|
|
89
72
|
|
|
90
73
|
**main.js**
|
|
91
74
|
|
|
92
75
|
```jsx
|
|
93
|
-
import {
|
|
76
|
+
import { useStyleProvider } from "effcss";
|
|
94
77
|
|
|
95
|
-
const consumer =
|
|
78
|
+
const consumer = useStyleProvider();
|
|
96
79
|
|
|
97
80
|
const root = createRoot(document.getElementById("root"));
|
|
98
81
|
root.render(<App css={consumer} />);
|
|
99
82
|
```
|
|
100
83
|
|
|
101
|
-
Each CSS stylesheet corresponds to a single `Stylesheet maker`. `Stylesheet maker` is a
|
|
84
|
+
Each CSS stylesheet corresponds to a single `Stylesheet maker`. `Stylesheet maker` is a JS function that should return object with style rules:
|
|
102
85
|
|
|
103
86
|
**App.tsx**
|
|
104
87
|
|
|
@@ -106,7 +89,8 @@ Each CSS stylesheet corresponds to a single `Stylesheet maker`. `Stylesheet make
|
|
|
106
89
|
import { useRef } from 'react';
|
|
107
90
|
import { IStyleProvider, TStyleSheetMaker } from 'effcss';
|
|
108
91
|
|
|
109
|
-
// describe your styles
|
|
92
|
+
// you can describe your styles using BEM notation
|
|
93
|
+
// so that other people can use them via TypeScript generics
|
|
110
94
|
export interface ICardMaker {
|
|
111
95
|
/**
|
|
112
96
|
* Card block
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* EffCSS v3.
|
|
2
|
+
* EffCSS v3.12.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=void 0,e=Object.entries,s=Array.isArray,r=Object.defineProperties,n=t=>"string"==typeof t,i=t=>null!==t&&"object"==typeof t,a=t=>t.split("."),l=(s,r)=>e(s).reduce(((s,[n,a])=>{if(i(a)){const l=e(a);l.length?s.push(...l.reduce(((s,[a,l])=>{if((e=>null!==e&&e!==t)(a)&&r&&s.push([n,a,t,t]),i(l)){const t=e(l);t.length&&s.push(...t.reduce(((t,[e,s])=>{const r=typeof s;return"string"!==r&&"number"!==r||t.push([n,a,e,s]),t}),[]))}return s}),[])):s.push([n,t,t,t])}return s}),[]),c=(t,e,s,r)=>""+(((t,e)=>`${t||""}${e?"__"+e:""}`)(t,e)+(s?"_"+s:"")+(s&&r?"_"+r:""))||"_",o=(t,e)=>"."+(e?t+(e.startsWith("_")?"":"-")+e:t),h=(t,e)=>`[data-${t}${e?`~="${e}"`:""}]`,u=(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]:u(t[e],r||{}):t[e]=r})),t)),t):t,g={def:.75,c:.05,s:.65,m:.75,l:.85,n:.9},m="effcss-provider",p={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null,angle:null,min:null},d=t=>Number((.1*184+.9*t).toFixed(2)),b={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:d(142),inf:d(264),war:d(109),dan:d(29)}},f={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:g,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:g},dark:{l:{def:.4,n:.25,s:.3,m:.4,l:.5,c:.95}}},palette:b,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}};const x=t=>t||"",v=({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])))}}},$=(t,e,s)=>Object.entries(t).reduce(e,s),j=Symbol("noParse"),O=(t,e,s)=>{var r,n,i;let a=""+t;return null==e?"":"object"!=typeof e||e.hasOwnProperty(j)?`${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+`{${$(e,((t,e)=>t+O(...e,a)),"")}}`;var l},k="@media",_="@container",w="@property",S="@keyframes",q="@layer",A="@scope",P="@supports",E="@starting-style",z=(t,e)=>{const s=k+` ${e||""}${e?" and ":""}(${t})`;return{s:s,q:t,t:e,toString:()=>s}};z.toString=()=>k;const C=t=>`(${t})`,W=t=>"string"==typeof t;function I(t){var e;if(!(null===(e=null==t?void 0:t.args)||void 0===e?void 0:e.length))return"";switch(t.key){case"or":return t.args.map((t=>W(t)?C(t):I(t))).join(" or ");case"and":return t.args.map((t=>{const e=!W(t);return e&&"or"===t.key?C(I(t)):e?I(t):C(t)})).join(" and ");case"not":const e=t.args[0];return"not "+(W(e)?C(e):C(I(e)))}}const N=(t,e)=>{let s="";return t.length&&(s=t.join(" ")),e&&(s=s+(s?" and ":"")+(s&&"or"===e.key?C(I(e)):I(e))),s},K=(t={})=>{const{type:e=[],state:s}=t;return Object.defineProperties((t=>{const r=N(e,s);return{[`${k}${r?" "+r:""}`]:t}}),{key:{value:null==s?void 0:s.key},args:{value:null==s?void 0:s.args},all:{get:()=>K({state:s,type:["all"]})},print:{get:()=>K({state:s,type:["print"]})},screen:{get:()=>K({state:s,type:["screen"]})},and:{value:(...t)=>K({type:e,state:{key:"and",args:s?[s,...t]:t}})},or:{value:(...t)=>K({type:e,state:{key:"or",args:s?[s,...t]:t}})},not:{get:()=>K(s?{type:e,state:W(s)||"not"!==(null==s?void 0:s.key)?{key:"not",args:[s]}:s.args[0]}:{type:2===e.length?[e[1]]:["not",e[0]||"all"],state:s})}})},M=t=>{const{root:e="",limit:s="",mode:r=[!1,!1]}=t;return Object.defineProperties((t=>({[A+` ${e?`(${e}${r[0]?" > *":""})`:""}${e&&s?" ":""}${s?`to (${s}${r[1]?" > *":""})`:""}`]:t})),{limit:{value:t=>M({root:e,limit:t,mode:r})},root:{value:t=>M({root:t,limit:s,mode:r})},both:{value:()=>M({root:e,limit:s,mode:[!1,!0]})},none:{value:()=>M({root:e,limit:s,mode:[!0,!1]})},low:{value:()=>M({root:e,limit:s,mode:[!0,!0]})},high:{value:()=>M({root:e,limit:s,mode:[!1,!1]})},toString:{value:()=>":scope"}})},B=t=>({[E]:t}),L=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=_+` ${n?n+" ":""}(${s})`;return{c:n,q:s,s:i,toString:()=>i}};s.toString=()=>_;const r=(s={})=>{const{scroll:n,type:i,name:a,state:l}=s;return Object.defineProperties((t=>{const e=N([],l);return{[`${_}${a?" "+a:""}${e?" "+e:""}`]:t}}),{container:{value:(a||"none")+" / "+(i&&n?`${i} scroll-state`:n?"scroll-state":i||"normal"),enumerable:!0},key:{value:null==l?void 0:l.key},args:{value:null==l?void 0:l.args},named:{get:()=>r({scroll:n,state:l,name:a||t.name("cq",e.cq++),type:i})},size:{get:()=>r({name:a,scroll:n,state:l,type:"size"})},isize:{get:()=>r({name:a,scroll:n,state:l,type:"inline-size"})},scroll:{get:()=>r({name:a,scroll:!0,state:l,type:i})},and:{value:(...t)=>r({name:a,scroll:n,type:i,state:{key:"and",args:l?[l,...t]:t}})},or:{value:(...t)=>r({name:a,scroll:n,type:i,state:{key:"or",args:l?[l,...t]:t}})},not:{value:t=>r({name:a,scroll:n,type:i,state:{key:"not",args:[t]}})},[j]:{value:!0}})},n=(s,r)=>{const n="--"+(s||t.name("cp",e.cp++)),i=w+" "+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}};n.toString=()=>w;const i=s=>{const r=s||t.name("kf",e.kf++),n=S+" "+r;return{k:r,s:n,toString:()=>n}};i.toString=()=>S;const a=s=>{const r=s||t.name("lay",e.lay++),n=q+" "+r;return{k:r,s:n,toString:()=>n}};a.toString=()=>q;a.toString=()=>A;const l=(t="",e=!1)=>{const s=P+` ${e?"not ":""}(${t})`;return{c:t,n:e,s:s,toString:()=>s}};return l.toString=()=>P,{pr:n,kf:i,mq:z,cq:s,lay:a,sc:(t="",e="")=>{const s=A+` ${t?`(${t})`:""}${t&&e?" ":""}${e?`to (${e})`:""}`;return{r:t,l:e,s:s,toString:()=>s}},sup:l,keyframes:s=>{const r=t.name("kf",e.kf++),n=S+" "+r;return Object.defineProperties((t=>{if(!t)return{animationName:r};const{dur:e,tf:s,del:n,ic:i,dir:a,ps:l,fm:c}=t;return{animation:[e,s,n,i,a,l,c,r].filter(Boolean).join(" ")}}),{[n]:{value:s,enumerable:!0},toString:{value:()=>r},[j]:{value:!0}})},property:(s={})=>{const{syn:r='"*"',inh:n=!0,ini:i,def:a}=s,l="--"+t.name("cp",e.cp++),c=`var(${l}${void 0!==a?","+a:""})`,o=w+" "+l;return Object.defineProperties((t=>({[l]:t})),{[o]:{value:{syntax:r,inherits:n,initialValue:i},enumerable:!0},toString:{value:()=>c},[j]:{value:!0}})},scope:M({}),media:K({}),container:r({}),startingStyle:B}},R=t=>t+"px",V=t=>t+"vh",F=t=>t+"vw",H=t=>t+"vmin",T=t=>t+"vmax",Z=t=>t+"em",D=t=>t+"rem",G=t=>t+"deg",J=t=>t+"rad",Q=t=>t+"rad",U=t=>t+"ms",X=t=>t+"s",Y=t=>t+"%",tt=t=>t+"cqw",et=t=>t+"cqh",st=t=>t+"cqi",rt=t=>t+"cqb",nt=t=>t+"cqmin",it=t=>t+"cqmax",at=Object.fromEntries,lt=Object.entries,ct=":first-",ot=":last-",ht=":only-",ut="child",gt=":nth-",mt="of-type",pt=gt+ut,dt=":focus",bt={r:":root",h:":hover",f:dt,fv:dt+"-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:ct+ut,lc:ot+ut,oc:ht+ut,odd:pt+"(odd)",even:pt+"(even)",ft:ct+mt,lt:ot+mt,ot:ht+mt,bef:"::before",aft:"::after",bd:"::backdrop"},ft={has:":has",not:":not",is:":is",wh:":where",st:":state",nthc:pt,ntho:gt+mt,dir:":dir",lang:":lang"},xt="oklch",vt=t=>xt+`(${t})`,yt=t=>vt(`from ${t}`),$t="def",jt=t=>{const e=(e,s)=>"string"==typeof s?t(e,s):s;class s{constructor(t={}){this.state={l:e("l",$t),c:e("c",$t),h:e("h",$t),a:e("a",$t)},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 vt(`${t} ${e} ${s} / ${r}`)}}return t=>new s(t)},Ot=(t,e=.1)=>yt(`${t} calc(l + ${e}) c h / alpha)`),kt=(t,e=.1)=>yt(`${t} calc(l - ${e}) c h / alpha)`),_t=(t,e=.1)=>yt(`${t} l c h / calc(alpha + ${e}))`),wt=(t,e=.1)=>yt(`${t} l c h / calc(alpha - ${e}))`),St=(t,e=.04)=>yt(`${t} l calc(c + ${e}) h / alpha)`),qt=(t,e=.04)=>yt(`${t} l calc(c - ${e}) h / alpha)`),At=(t,e=30)=>yt(`${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||xt}, ${t}${void 0!==r?` ${r}%`:""}, ${e}${void 0!==n?` ${n}%`:""})`,Et=t=>({create:jt(t),oklch:vt,lighten:Ot,darken:kt,saturate:St,desaturate:qt,fadein:_t,fadeout:wt,spin:At,mix:Pt}),zt="palette",Ct=t=>{class e{constructor(t={}){this.state={l:"l",c:"base",h:"pri",a:1,m:"bg"},Object.assign(this,{[j]:!0}),this.state=Object.assign(this.state,t)}get xs(){return new e(Object.assign(Object.assign({},this.state),{l:"xs"}))}get s(){return new e(Object.assign(Object.assign({},this.state),{l:"s"}))}get m(){return new e(Object.assign(Object.assign({},this.state),{l:"m"}))}get l(){return new e(Object.assign(Object.assign({},this.state),{l:"l"}))}get xl(){return new e(Object.assign(Object.assign({},this.state),{l:"xl"}))}get lightness(){return{xs:this.xs,s:this.s,m:this.m,l:this.l,xl:this.xl}}get gray(){return new e(Object.assign(Object.assign({},this.state),{c:"gray"}))}get pale(){return new e(Object.assign(Object.assign({},this.state),{c:"pale"}))}get base(){return new e(Object.assign(Object.assign({},this.state),{c:"base"}))}get rich(){return new e(Object.assign(Object.assign({},this.state),{c:"rich"}))}get chroma(){return{gray:this.gray,pale:this.pale,base:this.base,rich:this.rich}}get pri(){return new e(Object.assign(Object.assign({},this.state),{h:"pri"}))}get sec(){return new e(Object.assign(Object.assign({},this.state),{h:"sec"}))}get suc(){return new e(Object.assign(Object.assign({},this.state),{h:"suc"}))}get inf(){return new e(Object.assign(Object.assign({},this.state),{h:"inf"}))}get war(){return new e(Object.assign(Object.assign({},this.state),{h:"war"}))}get dan(){return new e(Object.assign(Object.assign({},this.state),{h:"dan"}))}get hue(){return{pri:this.pri,sec:this.sec,suc:this.suc,inf:this.inf,war:this.war,dan:this.dan}}alpha(t=1){return new e(Object.assign(Object.assign({},this.state),{a:t}))}get bg(){return new e(Object.assign(Object.assign({},this.state),{m:"bg"}))}get fg(){return new e(Object.assign(Object.assign({},this.state),{m:"fg"}))}toString(){const{l:e,c:s,h:r,a:n,m:i}=this.state;return`oklch(${t(zt,"l",i,e)} ${t(zt,"c",i,s)} ${t(zt,"h",r)} / ${n})`}}return new e},Wt="coef",It=t=>{class e{constructor(t={}){this.state={center:8},this.state=Object.assign(this.state,t)}get min(){return t(Wt,this.state.center-4)}get xxs(){return t(Wt,this.state.center-3)}get xs(){return t(Wt,this.state.center-2)}get s(){return t(Wt,this.state.center-1)}get m(){return t(Wt,this.state.center)}get l(){return t(Wt,this.state.center+1)}get xl(){return t(Wt,this.state.center+2)}get xxl(){return t(Wt,this.state.center+3)}get max(){return t(Wt,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},Nt=Object.assign,Kt=Object.entries,Mt={dash:(...t)=>t.join("-"),comma:(...t)=>t.join(),space:(...t)=>t.join(" "),range:(t,e)=>Array.from(Array(t).entries()).reduce(((t,[s])=>Nt(t,e(s+1))),{}),each:(t,e)=>Kt(t).reduce(((t,[s,r])=>Nt(t,e(s,r))),{}),when:(t,e,s={})=>t?e:s},Bt="width: ",Lt=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")})`,l=(t=1)=>`calc(${t} * ${i("rangle")})`,c=(t=1)=>`calc(${t} * 1rem)`;return{compile:({key:t,maker:s})=>{const o=e(t),h=L(o),g=t=>{const e=r[t]||t;return"number"==typeof e?e+"rem":""},m=t=>"min-"+Bt+g(t),p=t=>"max-"+Bt+g(t),d=(t,e)=>"string"==typeof e?h.cq(t,e):h.mq(t),b=(t,e,s)=>""+d(m(t)+") and ("+p(e),s),f={up:(t,e)=>""+d(m(t),e),down:(t,e)=>""+d(p(t),e),between:b,only:(t,e)=>b(t,t,e)};return x=s(Object.assign(Mt,{key:t,vars:i,size:c,time:a,angle:l,bem:o.selector,pseudo:Object.assign(at(lt(bt).map((([t,e])=>{function s(t=""){return t+e}return s.toString=()=>e,[t,s]}))),at(lt(ft).map((([t,e])=>{function s(t,s=""){return s+e+`(${t})`}return s.toString=()=>e,[t,s]})))),color:Et(n),palette:Ct(n),coef:It(n),units:{px:R,vh:V,vw:F,vmin:H,vmax:T,em:Z,rem:D,deg:G,rad:J,turn:Q,ms:U,s:X,pc:Y,cqw:tt,cqh:et,cqb:rt,cqi:st,cqmin:nt,cqmax:it},at:h,limit:f,merge:u})),$(x,((t,e)=>t+O(...e)),"");var x}}};const Rt="theme",Vt="size",Ft="time",Ht="angle",Tt="palette",Zt=Object.assign,Dt=Object.entries,Gt=Object.fromEntries,Jt=(t,e)=>t.getAttribute(e)||p[e],Qt=(t,e)=>{const s=Jt(t,e);return null!==s?Number(s):null},Ut=(t,e,s)=>null===s?t.removeAttribute(e):t.setAttribute(e,s+""),Xt=t=>`:root:has(script[is=${m}]${t?`[${t}]`:""})`,Yt=t=>[t.xxs,t.xs,t.s,t.m,t.l,t.xl,t.xxl],te=["xs","s","m","l","xl"],ee=["pale","base","rich"];!function(t={}){const e=window.document,s=window.customElements;if(null==s?void 0:s.get(m))return!1;{class i 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}),[])},l=t=>s.findIndex((e=>e===t)),c=e=>e?t[e]:void 0,o=(e,r)=>{if(!t[e])return t[e]=n(e,r),s.push(t[e]),a(),!0},h=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:o,status:h,on:(...t)=>{const e=t.reduce(((t,e)=>{const r=c(e);return!(!r||h(e))&&(s.push(r),t)}),!0);return a(),e},off:(...t)=>{const e=t.reduce(((t,e)=>{const r=c(e);if(r&&h(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&&o(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=f,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 Dt(t).reduce(((t,[r,i])=>i&&"object"==typeof i?Zt(t,n(i,[...e,r])):(t[s(...e,r)]=i,t)),{})}const i=Gt(Dt(e||{}).map((([t,e])=>[t,n(e,[])]))),{"":a={},dark:l,light:c}=i,o=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"]),h=this.size,u=this.time,g=this.angle,{l:m,c:p,h:d}=this._settings.palette,b=this._settings.coef,f=[0,...Yt(b.$0_),1,...Yt(b.$1_),2,...Yt(b.$2_),16,...Yt(b.$16_),b.max];this._=({bem:t,each:e,when:n,vars:l,merge:c,at:{media:b},units:{px:x,ms:v,deg:y}})=>{const $="prefers-color-scheme",j={light:`${$}: light`,dark:`${$}: dark`};return c({[Xt()]:c({fontSize:l("rem")},a,e(f,((t,e)=>({[s("coef",t)]:e}))),e(d,((t,e)=>({[s(Tt,"h",t)]:e}))),{[s(Tt,"c","bg","gray")]:0,[s(Tt,"c","fg","gray")]:0},e(j,((t,r)=>b.and(r)(c(i[t]||{},e(te,((e,r)=>({[s(Tt,"l","bg",r)]:m[t].bg[r],[s(Tt,"l","fg",r)]:m[t].fg[r]}))),e(ee,((e,r)=>({[s(Tt,"c","bg",r)]:p[t].bg[r],[s(Tt,"c","fg",r)]:p[t].fg[r]}))))))))},e(o,((e,s)=>({[Xt(`${Rt}=${e}`)]:s,[t(`..theme.${e}`)]:s}))),n(!!h,{[Xt(Vt)]:{[r("rem")]:x(h)}}),n(!!u,{[Xt(Ft)]:{[r("rtime")]:v(u)}}),n(!!g,{[Xt(Ht)]:{[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(n))&&(this._m.pack(n,this.css(t,n)),e||this._k.next()),this.resolve(n)},this.usePublic=t=>Gt(Dt(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)=>{let e;return e=t.length?1===t.length&&Array.isArray(t[0])?t[0]:t:this._c.keys,e.map((t=>this._m.get(this.key(t))))}}static get observedAttributes(){return[Vt,Ft,Ht]}get prefix(){return Jt(this,"prefix")||""}get mode(){return this.getAttribute("mode")||"a"}get min(){return"string"==typeof this.getAttribute("min")}get hydrate(){return""===this.getAttribute("hydrate")}get settings(){return this._settings}set settings(t){var e,s,r;const n=u({},this._settings,t),{makers:i,bp:a,off:l}=n;(a&&(null===(e=this._settings)||void 0===e?void 0:e.bp)!==a||!this._p)&&(this._p=Lt({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==l?void 0:l.length)&&this._settings.off!==l&&this.off(...l),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()}get makers(){return this._c.makers}set theme(t){Ut(this,Rt,t)}get theme(){return Jt(this,Rt)||""}set size(t){Ut(this,Vt,t)}get size(){return Qt(this,Vt)}set time(t){Ut(this,"time",t)}get time(){return Qt(this,Ft)}set angle(t){Ut(this,"angle",t)}get angle(){return Qt(this,Ht)}attributeChangedCallback(){this._k&&this._cust()}connectedCallback(){this._k=v({prefix:this.prefix}),this._s=((t={})=>{const{mode:e,min:s}=t;let i,u;return i="a"===e?h:o,s&&(u={}),t=>{let s=0,o=x,h=x;u&&(u[t]||(u[t]={}),o=e=>{var r;return null!==(r=u[t][e])&&void 0!==r?r:u[t][e]=(s++).toString(36)},h=e=>u[t][e]);let g=(...e)=>[t,...e].filter(Boolean).join("-"),m="class",p=e=>e?t+(e.startsWith("_")?"":"-")+e:void 0===e?void 0:t;"a"===e&&(m="data-"+t,p=x);const d=(...t)=>"--"+g(...t),b=t=>{if(void 0===t)return function(t){const e=({b:s,e:r,m:n})=>({b:t=>e({b:t,e:"",m:{}}),e:t=>e({b:s,e:t,m:{}}),m:(t={})=>e({b:s,e:r,m:t}),get $(){return t({[s]:{[r]:n}})}});return e({b:"",e:"",m:{}})}(b);let e,s,i,o,u="";const g=n(t);return u=g||Array.isArray(t)?[...(g?[t]:t).reduce(((t,r)=>([e,s,i,o]=a(r),t.add(p(h(c(e,s)))),i&&t.add(p(h(c(e,s,i,o)))),t)),new Set).values()].join(" "):t&&l(t,!0).map((([t,e,s,r])=>p(h(c(t,e,s,r))))).join(" "),r({[m]:u},{toString:{value:()=>`${m}="${u}"`},$:{value:u}})};return{selector:e=>{let s,r,h,u;return n(e)?([s,r,h,u]=a(e),i(t,o(c(s,r,h,u)))):e&&l(e).map((([e,s,r,n])=>i(t,o(c(e,s,r,n))))).join(",")},attr:b,name:g,varName:d,varExp:(...t)=>`var(${d(...t)})`}}})({mode:this.mode,min:this.min});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(m,i,{extends:"script"})}}();
|
|
7
|
+
"function"==typeof SuppressedError&&SuppressedError;const t=Object.entries,e=Array.isArray,s=(r,...n)=>n.length?n.reduce(((r,n)=>(t(n).forEach((([t,n])=>{n&&"object"==typeof n&&r[t]?e(r[t])&&e(n)?r[t]=[...r[t],...n]:s(r[t],n||{}):r[t]=n})),r)),r):r,r={def:.75,c:.05,s:.65,m:.75,l:.85,n:.9},n={mode:"a",prefix:"f"},i=t=>Number((.1*184+.9*t).toFixed(2)),a={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:i(142),inf:i(264),war:i(109),dan:i(29)}},c={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:r,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:r},dark:{l:{def:.4,n:.25,s:.3,m:.4,l:.5,c:.95}}},palette:a,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}},l=(t,e,s)=>Object.entries(t).reduce(e,s),o=Symbol("noParse"),u=(t,e,s)=>{var r,n,i;let a=""+t;return null==e?"":"object"!=typeof e||e.hasOwnProperty(o)?`${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+`{${l(e,((t,e)=>t+u(...e,a)),"")}}`;var c},h="@media",g="@container",m="@property",p="@keyframes",d="@layer",b="@scope",f="@supports",x="@starting-style",v=(t,e)=>{const s=h+` ${e||""}${e?" and ":""}(${t})`;return{s:s,q:t,t:e,toString:()=>s}};v.toString=()=>h;const y=t=>`(${t})`,$=t=>"string"==typeof t;function j(t){var e;if(!(null===(e=null==t?void 0:t.args)||void 0===e?void 0:e.length))return"";switch(t.key){case"or":return t.args.map((t=>$(t)?y(t):j(t))).join(" or ");case"and":return t.args.map((t=>{const e=!$(t);return e&&"or"===t.key?y(j(t)):e?j(t):y(t)})).join(" and ");case"not":const e=t.args[0];return"not "+($(e)?y(e):y(j(e)))}}const O=(t,e)=>{let s="";return t.length&&(s=t.join(" ")),e&&(s=s+(s?" and ":"")+(s&&"or"===e.key?y(j(e)):j(e))),s},k=(t={})=>{const{type:e=[],state:s}=t;return Object.defineProperties((t=>{const r=O(e,s);return{[`${h}${r?" "+r:""}`]:t}}),{key:{value:null==s?void 0:s.key},args:{value:null==s?void 0:s.args},all:{get:()=>k({state:s,type:["all"]})},print:{get:()=>k({state:s,type:["print"]})},screen:{get:()=>k({state:s,type:["screen"]})},and:{value:(...t)=>k({type:e,state:{key:"and",args:s?[s,...t]:t}})},or:{value:(...t)=>k({type:e,state:{key:"or",args:s?[s,...t]:t}})},not:{get:()=>k(s?{type:e,state:$(s)||"not"!==(null==s?void 0:s.key)?{key:"not",args:[s]}:s.args[0]}:{type:2===e.length?[e[1]]:["not",e[0]||"all"],state:s})}})},_=t=>{const{root:e="",limit:s="",mode:r=[!1,!1]}=t;return Object.defineProperties((t=>({[b+` ${e?`(${e}${r[0]?" > *":""})`:""}${e&&s?" ":""}${s?`to (${s}${r[1]?" > *":""})`:""}`]:t})),{limit:{value:t=>_({root:e,limit:t,mode:r})},root:{value:t=>_({root:t,limit:s,mode:r})},both:{value:()=>_({root:e,limit:s,mode:[!1,!0]})},none:{value:()=>_({root:e,limit:s,mode:[!0,!1]})},low:{value:()=>_({root:e,limit:s,mode:[!0,!0]})},high:{value:()=>_({root:e,limit:s,mode:[!1,!1]})},toString:{value:()=>":scope"}})},w=t=>({[x]:t}),S=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=g+` ${n?n+" ":""}(${s})`;return{c:n,q:s,s:i,toString:()=>i}};s.toString=()=>g;const r=(s={})=>{const{scroll:n,type:i,name:a,state:c}=s;return Object.defineProperties((t=>{const e=O([],c);return{[`${g}${a?" "+a:""}${e?" "+e:""}`]:t}}),{container:{value:(a||"none")+" / "+(i&&n?`${i} scroll-state`:n?"scroll-state":i||"normal"),enumerable:!0},key:{value:null==c?void 0:c.key},args:{value:null==c?void 0:c.args},named:{get:()=>r({scroll:n,state:c,name:a||t.name("cq",e.cq++),type:i})},size:{get:()=>r({name:a,scroll:n,state:c,type:"size"})},isize:{get:()=>r({name:a,scroll:n,state:c,type:"inline-size"})},scroll:{get:()=>r({name:a,scroll:!0,state:c,type:i})},and:{value:(...t)=>r({name:a,scroll:n,type:i,state:{key:"and",args:c?[c,...t]:t}})},or:{value:(...t)=>r({name:a,scroll:n,type:i,state:{key:"or",args:c?[c,...t]:t}})},not:{value:t=>r({name:a,scroll:n,type:i,state:{key:"not",args:[t]}})},[o]:{value:!0}})},n=(s,r)=>{const n="--"+(s||t.name("cp",e.cp++)),i=m+" "+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}};n.toString=()=>m;const i=s=>{const r=s||t.name("kf",e.kf++),n=p+" "+r;return{k:r,s:n,toString:()=>n}};i.toString=()=>p;const a=s=>{const r=s||t.name("lay",e.lay++),n=d+" "+r;return{k:r,s:n,toString:()=>n}};a.toString=()=>d;a.toString=()=>b;const c=(t="",e=!1)=>{const s=f+` ${e?"not ":""}(${t})`;return{c:t,n:e,s:s,toString:()=>s}};return c.toString=()=>f,{pr:n,kf:i,mq:v,cq:s,lay:a,sc:(t="",e="")=>{const s=b+` ${t?`(${t})`:""}${t&&e?" ":""}${e?`to (${e})`:""}`;return{r:t,l:e,s:s,toString:()=>s}},sup:c,keyframes:s=>{const r=t.name("kf",e.kf++),n=p+" "+r;return Object.defineProperties((t=>{if(!t)return{animationName:r};const{dur:e,tf:s,del:n,ic:i,dir:a,ps:c,fm:l}=t;return{animation:[e,s,n,i,a,c,l,r].filter(Boolean).join(" ")}}),{[n]:{value:s,enumerable:!0},toString:{value:()=>r},[o]:{value:!0}})},property:(s={})=>{const{syn:r='"*"',inh:n=!0,ini:i,def:a}=s,c="--"+t.name("cp",e.cp++),l=`var(${c}${void 0!==a?","+a:""})`,u=m+" "+c;return Object.defineProperties((t=>({[c]:t})),{[u]:{value:{syntax:r,inherits:n,initialValue:i},enumerable:!0},toString:{value:()=>l},[o]:{value:!0}})},scope:_({}),media:k({}),container:r({}),startingStyle:w}},q=t=>t+"px",A=t=>t+"vh",P=t=>t+"vw",E=t=>t+"vmin",z=t=>t+"vmax",C=t=>t+"em",M=t=>t+"rem",W=t=>t+"deg",N=t=>t+"rad",I=t=>t+"rad",K=t=>t+"ms",B=t=>t+"s",T=t=>t+"%",L=t=>t+"cqw",R=t=>t+"cqh",V=t=>t+"cqi",F=t=>t+"cqb",H=t=>t+"cqmin",J=t=>t+"cqmax",Z=Object.fromEntries,D=Object.entries,G=":first-",Q=":last-",U=":only-",X="child",Y=":nth-",tt="of-type",et=Y+X,st=":focus",rt={r:":root",h:":hover",f:st,fv:st+"-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:G+X,lc:Q+X,oc:U+X,odd:et+"(odd)",even:et+"(even)",ft:G+tt,lt:Q+tt,ot:U+tt,bef:"::before",aft:"::after",bd:"::backdrop"},nt={has:":has",not:":not",is:":is",wh:":where",st:":state",nthc:et,ntho:Y+tt,dir:":dir",lang:":lang"},it="oklch",at=t=>it+`(${t})`,ct=t=>at(`from ${t}`),lt="def",ot=t=>{const e=(e,s)=>"string"==typeof s?t(e,s):s;class s{constructor(t={}){this.state={l:e("l",lt),c:e("c",lt),h:e("h",lt),a:e("a",lt)},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 at(`${t} ${e} ${s} / ${r}`)}}return t=>new s(t)},ut=(t,e=.1)=>ct(`${t} calc(l + ${e}) c h / alpha)`),ht=(t,e=.1)=>ct(`${t} calc(l - ${e}) c h / alpha)`),gt=(t,e=.1)=>ct(`${t} l c h / calc(alpha + ${e}))`),mt=(t,e=.1)=>ct(`${t} l c h / calc(alpha - ${e}))`),pt=(t,e=.04)=>ct(`${t} l calc(c + ${e}) h / alpha)`),dt=(t,e=.04)=>ct(`${t} l calc(c - ${e}) h / alpha)`),bt=(t,e=30)=>ct(`${t} l c calc(h${"number"==typeof e?e>0?" + "+e:" - "+-e:e}) / alpha)`),ft=({base:t,mixin:e,method:s,bpart:r,mpart:n})=>`color-mix(in ${s||it}, ${t}${void 0!==r?` ${r}%`:""}, ${e}${void 0!==n?` ${n}%`:""})`,xt=t=>({create:ot(t),oklch:at,lighten:ut,darken:ht,saturate:pt,desaturate:dt,fadein:gt,fadeout:mt,spin:bt,mix:ft}),vt="palette",yt=t=>{class e{constructor(t={}){this.state={l:"l",c:"base",h:"pri",a:1,m:"bg"},Object.assign(this,{[o]:!0}),this.state=Object.assign(this.state,t)}get xs(){return new e(Object.assign(Object.assign({},this.state),{l:"xs"}))}get s(){return new e(Object.assign(Object.assign({},this.state),{l:"s"}))}get m(){return new e(Object.assign(Object.assign({},this.state),{l:"m"}))}get l(){return new e(Object.assign(Object.assign({},this.state),{l:"l"}))}get xl(){return new e(Object.assign(Object.assign({},this.state),{l:"xl"}))}get lightness(){return{xs:this.xs,s:this.s,m:this.m,l:this.l,xl:this.xl}}get gray(){return new e(Object.assign(Object.assign({},this.state),{c:"gray"}))}get pale(){return new e(Object.assign(Object.assign({},this.state),{c:"pale"}))}get base(){return new e(Object.assign(Object.assign({},this.state),{c:"base"}))}get rich(){return new e(Object.assign(Object.assign({},this.state),{c:"rich"}))}get chroma(){return{gray:this.gray,pale:this.pale,base:this.base,rich:this.rich}}get pri(){return new e(Object.assign(Object.assign({},this.state),{h:"pri"}))}get sec(){return new e(Object.assign(Object.assign({},this.state),{h:"sec"}))}get suc(){return new e(Object.assign(Object.assign({},this.state),{h:"suc"}))}get inf(){return new e(Object.assign(Object.assign({},this.state),{h:"inf"}))}get war(){return new e(Object.assign(Object.assign({},this.state),{h:"war"}))}get dan(){return new e(Object.assign(Object.assign({},this.state),{h:"dan"}))}get hue(){return{pri:this.pri,sec:this.sec,suc:this.suc,inf:this.inf,war:this.war,dan:this.dan}}alpha(t=1){return new e(Object.assign(Object.assign({},this.state),{a:t}))}get bg(){return new e(Object.assign(Object.assign({},this.state),{m:"bg"}))}get fg(){return new e(Object.assign(Object.assign({},this.state),{m:"fg"}))}toString(){const{l:e,c:s,h:r,a:n,m:i}=this.state;return`oklch(${t(vt,"l",i,e)} ${t(vt,"c",i,s)} ${t(vt,"h",r)} / ${n})`}}return new e},$t="coef",jt=t=>{class e{constructor(t={}){this.state={center:8},this.state=Object.assign(this.state,t)}get min(){return t($t,this.state.center-4)}get xxs(){return t($t,this.state.center-3)}get xs(){return t($t,this.state.center-2)}get s(){return t($t,this.state.center-1)}get m(){return t($t,this.state.center)}get l(){return t($t,this.state.center+1)}get xl(){return t($t,this.state.center+2)}get xxl(){return t($t,this.state.center+3)}get max(){return t($t,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,kt=Object.entries,_t={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)=>kt(t).reduce(((t,[s,r])=>Ot(t,e(s,r))),{}),when:(t,e,s={})=>t?e:s},wt="width: ",St=t=>{const{scope:e,globalKey:r="",bp:n={}}=t,i=e(r).varExp,a=t=>i(...t.split(".")),c=(t=1)=>`calc(${t} * ${a("rtime")})`,o=(t=1)=>`calc(${t} * ${a("rangle")})`,h=(t=1)=>`calc(${t} * 1rem)`;return{compile:({key:t,maker:r})=>{const g=e(t),m=S(g),p=t=>{const e=n[t]||t;return"number"==typeof e?e+"rem":""},d=t=>"min-"+wt+p(t),b=t=>"max-"+wt+p(t),f=(t,e)=>"string"==typeof e?m.cq(t,e):m.mq(t),x=(t,e,s)=>""+f(d(t)+") and ("+b(e),s),v={up:(t,e)=>""+f(d(t),e),down:(t,e)=>""+f(b(t),e),between:x,only:(t,e)=>x(t,t,e)};return y=r(Object.assign(_t,{key:t,vars:a,size:h,time:c,angle:o,bem:g.selector,pseudo:Object.assign(Z(D(rt).map((([t,e])=>{function s(t=""){return t+e}return s.toString=()=>e,[t,s]}))),Z(D(nt).map((([t,e])=>{function s(t,s=""){return s+e+`(${t})`}return s.toString=()=>e,[t,s]})))),color:xt(i),palette:yt(i),coef:jt(i),units:{px:q,vh:A,vw:P,vmin:E,vmax:z,em:C,rem:M,deg:W,rad:N,turn:I,ms:K,s:B,pc:T,cqw:L,cqh:R,cqb:F,cqi:V,cqmin:H,cqmax:J},at:m,limit:v,merge:s})),l(y,((t,e)=>t+u(...e)),"");var y}}};const qt=()=>{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 Object.entries(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])))}}},At=({prefix:t=n.prefix})=>{let e=1;return{get base(){return t+0},get current(){return t+e},next(){return e++,this.current},reset(){e=1}}},Pt=void 0,Et=Object.entries,zt=Object.defineProperties,Ct=t=>"string"==typeof t,Mt=t=>null!==t&&"object"==typeof t,Wt=t=>t.split("."),Nt=(t,e)=>Et(t).reduce(((t,[s,r])=>{if(Mt(r)){const n=Et(r);n.length?t.push(...n.reduce(((t,[r,n])=>{if((t=>null!==t&&t!==Pt)(r)&&e&&t.push([s,r,Pt,Pt]),Mt(n)){const e=Et(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,Pt,Pt,Pt])}return t}),[]),It=(t,e,s,r)=>""+(((t,e)=>`${t||""}${e?"__"+e:""}`)(t,e)+(s?"_"+s:"")+(s&&r?"_"+r:""))||"_",Kt=(t,e)=>"."+(e?t+(e.startsWith("_")?"":"-")+e:t),Bt=(t,e)=>`[data-${t}${e?`~="${e}"`:""}]`;const Tt=t=>t||"",Lt="effcss-provider",Rt="theme",Vt="size",Ft="time",Ht="angle",Jt="palette",Zt=Object.assign,Dt=Object.entries,Gt=Object.fromEntries,Qt=(t,e)=>t.getAttribute(e)||n[e],Ut=(t,e)=>(t=>null!==t?Number(t):null)(Qt(t,e)),Xt=(t,e,s)=>null===s?t.removeAttribute(e):t.setAttribute(e,s+""),Yt=t=>`:root:has(script[is=${Lt}]${t?`[${t}]`:""})`,te=t=>[t.xxs,t.xs,t.s,t.m,t.l,t.xl,t.xxl],ee=["xs","s","m","l","xl"],se=["pale","base","rich"],re=({scope:t,keyMaker:e,provider:s})=>{const r=s.settings,n=null==r?void 0:r.vars,{varName:i}=t(e.base),a=t=>i("",t);function c(t,e){return Dt(t).reduce(((t,[s,r])=>r&&"object"==typeof r?Zt(t,c(r,[...e,s])):(t[i(...e,s)]=r,t)),{})}const l=Gt(Dt(n||{}).map((([t,e])=>[t,c(e,[])]))),{"":o={},dark:u,light:h}=l,g=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}(l,["","dark","light"]),m=s.size,p=s.time,d=s.angle,{l:b,c:f,h:x}=r.palette,v=r.coef,y=[0,...te(v.$0_),1,...te(v.$1_),2,...te(v.$2_),16,...te(v.$16_),v.max];return({bem:t,each:e,when:s,vars:r,merge:n,at:{media:c},units:{px:u,ms:h,deg:v}})=>{const $="prefers-color-scheme",j={light:`${$}: light`,dark:`${$}: dark`};return n({[Yt()]:n({fontSize:r("rem")},o,e(y,((t,e)=>({[i("coef",t)]:e}))),e(x,((t,e)=>({[i(Jt,"h",t)]:e}))),{[i(Jt,"c","bg","gray")]:0,[i(Jt,"c","fg","gray")]:0},e(j,((t,s)=>c.and(s)(n(l[t]||{},e(ee,((e,s)=>({[i(Jt,"l","bg",s)]:b[t].bg[s],[i(Jt,"l","fg",s)]:b[t].fg[s]}))),e(se,((e,s)=>({[i(Jt,"c","bg",s)]:f[t].bg[s],[i(Jt,"c","fg",s)]:f[t].fg[s]}))))))))},e(g,((e,s)=>({[Yt(`${Rt}=${e}`)]:s,[t(`..theme.${e}`)]:s}))),s(!!m,{[Yt(Vt)]:{[a("rem")]:u(m)}}),s(!!p,{[Yt(Ft)]:{[a("rtime")]:h(p)}}),s(!!d,{[Yt(Ht)]:{[a("rangle")]:v(d)}}))}};!function(t={}){const e=globalThis.document,r=globalThis.customElements;if(null==r?void 0:r.get(Lt))return!1;{class n extends HTMLScriptElement{constructor(){super(...arguments),this._c=qt(),this._settings=c,this._cust=()=>{this._=re({scope:this._s,keyMaker:this._k,provider:this}),this.use(this._,this._k.base,!0)}}static get observedAttributes(){return[Vt,Ft,Ht]}get settings(){return this._settings}set settings(t){var e,r,n;const i=s({},this._settings,t),{makers:a,bp:c,off:l}=i;(c&&(null===(e=this._settings)||void 0===e?void 0:e.bp)!==c||!this._p)&&(this._p=St({scope:this._s,globalKey:this._k.base,bp:c})),a&&(null===(r=this._settings)||void 0===r?void 0:r.makers)!==a&&(this._c.useMany(a),this.usePublic(a),(null==l?void 0:l.length)&&this._settings.off!==l&&this.off(...l)),this._settings=i,(!(null===(n=this._m)||void 0===n?void 0:n.has(this._k.base))||t.vars||t.palette||t.coef)&&this._cust()}get makers(){return this._c.makers}attributeChangedCallback(){this._k&&this._cust()}connectedCallback(){var r;this.textContent?this._settings=s(this._settings,JSON.parse(this.textContent)):t&&(this._settings=s(this._settings,t)),r=this,Object.defineProperties(r,{prefix:{get:()=>r.getAttribute("prefix")||"f"},mode:{get:()=>r.getAttribute("mode")||"a"},min:{get:()=>""===r.getAttribute("min")},hydrate:{get:()=>""===r.getAttribute("hydrate")},theme:{set(t){Xt(r,Rt,t)},get:()=>Qt(r,Rt)||""},size:{set(t){Xt(r,Vt,t)},get:()=>Ut(r,Vt)},time:{set(t){Xt(r,Ft,t)},get:()=>Ut(r,Ft)},angle:{set(t){Xt(r,Ht,t)},get:()=>Ut(r,Ht)}}),this._k=At({prefix:this.prefix}),this._s=((t={})=>{const{mode:e,min:s}=t;let r,n;return r="a"===e?Bt:Kt,s&&(n={}),t=>{let s=0,i=Tt,a=Tt;n&&(n[t]||(n[t]={}),i=e=>{var r;return null!==(r=n[t][e])&&void 0!==r?r:n[t][e]=(s++).toString(36)},a=e=>n[t][e]);let c=(...e)=>[t,...e].filter(Boolean).join("-"),l="class",o=e=>e?t+(e.startsWith("_")?"":"-")+e:void 0===e?void 0:t;"a"===e&&(l="data-"+t,o=Tt);const u=(...t)=>"--"+c(...t),h=t=>{if(void 0===t)return function(t){const e=({b:s,e:r,m:n})=>({b:t=>e({b:t,e:"",m:{}}),e:t=>e({b:s,e:t,m:{}}),m:(t={})=>e({b:s,e:r,m:t}),get $(){return t({[s]:{[r]:n}})}});return e({b:"",e:"",m:{}})}(h);let e,s,r,n,i="";const c=Ct(t);return i=c||Array.isArray(t)?[...(c?[t]:t).reduce(((t,i)=>([e,s,r,n]=Wt(i),t.add(o(a(It(e,s)))),r&&t.add(o(a(It(e,s,r,n)))),t)),new Set).values()].join(" "):t&&Nt(t,!0).map((([t,e,s,r])=>o(a(It(t,e,s,r))))).join(" "),zt({[l]:i},{toString:{value:()=>`${l}="${i}"`},$:{value:i}})};return{selector:e=>{let s,n,a,c;return Ct(e)?([s,n,a,c]=Wt(e),r(t,i(It(s,n,a,c)))):e&&Nt(e).map((([e,s,n,a])=>r(t,i(It(e,s,n,a))))).join(",")},attr:h,name:c,varName:u,varExp:(...t)=>`var(${u(...t)})`}}})({mode:this.mode,min:this.min}),this._p=St({scope:this._s,globalKey:this._k.base,bp:t.bp||this.settings.bp}),this._m=function(t){const e={};null==t||t.forEach((t=>{const s=t.dataset.effcss;s&&(e[s]=t)}));let s={},r={},n=[],i=[];const a=(t,e)=>(e.toString=()=>"effcss-"+t,e),c=t=>{var e;return t.adoptedStyleSheets=[...(null===(e=t.adoptedStyleSheets)||void 0===e?void 0:e.length)?[...t.adoptedStyleSheets].filter((t=>!(t+"").startsWith("effcss-"))):[],...n]},l=()=>{i=i.reduce(((t,e)=>{const s=e.deref();return s&&(c(s),t.push(e)),t}),[])},o=t=>n.findIndex((e=>e===t)),u=t=>t?s[t]:void 0,h=(t,r)=>{if(!s[t]){s[t]=a(t,r),n.push(s[t]);const i=e[t];return i&&(i.disabled=!0),l(),!0}},g=t=>{const e=u(t);return!!e&&-1!==o(e)};return{apply:c,notify:l,getIndex:o,get:u,has:t=>!!t&&!!u(t),getAll:()=>s,add:h,status:g,on:(...t)=>{const e=t.reduce(((t,e)=>{const s=u(e);return!(!s||g(e))&&(n.push(s),t)}),!0);return l(),e},off:(...t)=>{const e=t.reduce(((t,e)=>{const s=u(e);if(s&&g(e)){const e=o(s);return n.splice(e,1),t}return!1}),!0);return l(),e},remove:t=>{const e=u(t);if(!e)return;const i=o(e);return i>-1&&(n.splice(i,1),delete s[t],delete r[t]),l(),!0},removeAll:()=>(n.splice(0),s={},r={},l(),!0),pack:(t,e)=>{let r=s[t]||new CSSStyleSheet;return r.replaceSync(e),r=a(t,r),!!r.cssRules.length&&h(t,r)},replace:(t,e)=>{const r=s[t];if(r)return r.replaceSync(e),l(),!0},register:t=>{i.findIndex((e=>e.deref()===t))>=0||(i.push(new WeakRef(t)),c(t))},unregister:t=>{const e=i.findIndex((e=>e.deref()===t));e>=0&&i.splice(e,1)}}}(e.querySelectorAll("[data-effcss]"));const n=(({scope:t,keyMaker:e,collector:s,manager:r,processor:n})=>{const i=t=>"string"==typeof t?t:s.getKey(t),a=s=>t(s||e.base).attr,c=(t,e)=>n.compile({key:e,maker:t}),l=(t,n,i)=>{const l=n||e.current;let o=s.use(t,l);return(i||r&&!r.has(o))&&(r.pack(o,c(t,o)),n||e.next()),a(o)};return{key:i,resolve:a,use:l,usePublic:t=>Gt(Dt(t).map((([t,e])=>[t,l(e,t)]))),usePrivate:t=>t.map((t=>l(t))),css:c,status:t=>{const e=i(t);return!!e&&r.status(e)},on:(...t)=>r.on(...t.map(i)),off:(...t)=>r.off(...t.map(i)),stylesheets:(...t)=>{let e;return e=t.length?1===t.length&&Array.isArray(t[0])?t[0]:t:s.keys,e.map((t=>r.get(i(t))))}}})({scope:this._s,processor:this._p,keyMaker:this._k,manager:this._m,collector:this._c});Object.assign(this,n),this._cust();const i=this;this._n={set adoptedStyleSheets(t){i.dispatchEvent(new CustomEvent("effcsschanges",{detail:{styles:t},bubbles:!0}))}},this._m.register(this._n),this._m.register(e)}toString(){return`<script ${[...this.attributes].map((t=>t.value?`${t.name}="${t.value}"`:""===t.value?t.name:"")).filter(Boolean).join(" ")}>${this.textContent}<\/script>`}}r.define(Lt,n,{extends:"script"})}}();
|
package/dist/consumer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* EffCSS v3.
|
|
2
|
+
* EffCSS v3.12.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=>"string"==typeof e,s=e=>null!==e&&"object"==typeof e,u=e=>e.split("."),i=(r,n)=>t(r).reduce(((r,[u,i])=>{if(s(i)){const l=t(i);l.length?r.push(...l.reduce(((r,[i,l])=>{if((t=>null!==t&&t!==e)(i)&&n&&r.push([u,i,e,e]),s(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([u,i,t,r]),e}),[]))}return r}),[])):r.push([u,e,e,e])}return r}),[]),l=(e,t,r,n)=>""+(((e,t)=>`${e||""}${t?"__"+t:""}`)(e,t)+(r?"_"+r:"")+(r&&n?"_"+n:""))||"_",a=(e,t)=>"."+(t?e+(t.startsWith("_")?"":"-")+t:e),o=(e,t)=>`[data-${e}${t?`~="${t}"`:""}]`,m="effcss-provider",c={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null,angle:null,min:null},d=e=>Number((.1*184+.9*e).toFixed(2));d(142),d(264),d(109),d(29);Array(12).keys();const g=e=>e||"",p=({prefix:e})=>{let t=1;return{get base(){return e+0},get current(){return e+t},next(){return t++,this.current},reset(){t=1}}},f=()=>{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])))}}},b=e=>null==e?null:Number(e),$=(e={})=>{var t;let s,d,$,h,v,y,j,x,S=null===(t=null===globalThis||void 0===globalThis?void 0:globalThis.document)||void 0===t?void 0:t.querySelector(`script[is=${m}]`);if(S)return S;({prefix:d,mode:$,hydrate:v,theme:s,size:y,time:j,angle:x,min:h}=Object.assign({},c,e));let k,O,_,z=b(y),w=b(j),A=b(x);const E=new Set,N=()=>d||c.prefix,P=()=>$||c.mode,T=()=>""===v,B=p({prefix:N()}),K=((e={})=>{const{mode:t,min:s}=e;let m,c;return m="a"===t?o:a,s&&(c={}),e=>{let s=0,a=g,o=g;c&&(c[e]||(c[e]={}),a=t=>{var r;return null!==(r=c[e][t])&&void 0!==r?r:c[e][t]=(s++).toString(36)},o=t=>c[e][t]);let d=(...t)=>[e,...t].filter(Boolean).join("-"),p="class",f=t=>t?e+(t.startsWith("_")?"":"-")+t:void 0===t?void 0:e;"a"===t&&(p="data-"+e,f=g);const b=(...e)=>"--"+d(...e),$=e=>{if(void 0===e)return function(e){const t=({b:r,e:n,m:s})=>({b:e=>t({b:e,e:"",m:{}}),e:e=>t({b:r,e:e,m:{}}),m:(e={})=>t({b:r,e:n,m:e}),get $(){return e({[r]:{[n]:s}})}});return t({b:"",e:"",m:{}})}($);let t,s,a,m,c="";const d=n(e);return c=d||Array.isArray(e)?[...(d?[e]:e).reduce(((e,r)=>([t,s,a,m]=u(r),e.add(f(o(l(t,s)))),a&&e.add(f(o(l(t,s,a,m)))),e)),new Set).values()].join(" "):e&&i(e,!0).map((([e,t,r,n])=>f(o(l(e,t,r,n))))).join(" "),r({[p]:c},{toString:{value:()=>`${p}="${c}"`},$:{value:c}})};return{selector:t=>{let r,s,o,c;return n(t)?([r,s,o,c]=u(t),m(e,a(l(r,s,o,c)))):t&&i(t).map((([t,r,n,s])=>m(e,a(l(t,r,n,s))))).join(",")},attr:$,name:d,varName:b,varExp:(...e)=>`var(${b(...e)})`}}})({mode:P()}),M=f(),W=e=>"string"==typeof e?e:M.getKey(e),q=e=>K(e||B.base).attr,F=(e,t)=>{const r=t||B.current;let n=M.use(e,r);return t||B.next(),q(n)};return{get makers(){return M.makers},get prefix(){return N()},get mode(){return P()},get min(){return""===h},get hydrate(){return T()},set theme(e){s=e},get theme(){return s||""},get size(){return z},set size(e){z=e},get time(){return w},set time(e){w=e},get angle(){return A},set angle(e){A=e},get settings(){return{bp:_,vars:O,off:[...E],makers:M.makers,palette:k}},set settings(e){({bp:_,vars:O,palette:k}=e)},resolve:q,use:F,usePublic:e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[e,F(t,e)]))),usePrivate:e=>e.map((e=>F(e))),css:()=>"",key:W,status:e=>{const t=W(e);return!!t&&!E.has(t)},on:(...e)=>e.map(W).reduce(((e,t)=>e&&!!t&&E.delete(t)),!0),off:(...e)=>e.map(W).reduce(((e,t)=>e&&!!t&&!!E.add(t)),!0),stylesheets:()=>[],toString(){const e=M.makers;delete e[B.base];const t=Object.entries({is:m,prefix:N(),mode:P(),hydrate:T(),theme:s,size:null!==z&&String(z),time:null!==w&&String(w),angle:null!==A&&String(A)}).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," ")}`),""):""}},${O?` vars: ${O},`:""}${_?` bp: ${_},`:""}${k?` palette: ${k},`:""}${E.size?` off: [${[...E]}]`:""}}`;return`<script ${t}>${r}<\/script>`}}};export{$ as createConsumer};
|
|
7
|
+
function t(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}"function"==typeof SuppressedError&&SuppressedError;const e=Object.entries,s=Array.isArray,r=(t,...n)=>n.length?n.reduce(((t,n)=>(e(n).forEach((([e,n])=>{n&&"object"==typeof n&&t[e]?s(t[e])&&s(n)?t[e]=[...t[e],...n]:r(t[e],n||{}):t[e]=n})),t)),t):t,n={def:.75,c:.05,s:.65,m:.75,l:.85,n:.9},i={mode:"a",prefix:"f"},a=t=>Number((.1*184+.9*t).toFixed(2)),c={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:a(142),inf:a(264),war:a(109),dan:a(29)}},o={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:n,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:n},dark:{l:{def:.4,n:.25,s:.3,m:.4,l:.5,c:.95}}},palette:c,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}},l=(t,e,s)=>Object.entries(t).reduce(e,s),u=Symbol("noParse"),h=(t,e,s)=>{var r,n,i;let a=""+t;return null==e?"":"object"!=typeof e||e.hasOwnProperty(u)?`${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+`{${l(e,((t,e)=>t+h(...e,a)),"")}}`;var c},g="@media",m="@container",p="@property",d="@keyframes",b="@layer",f="@scope",x="@supports",y="@starting-style",v=(t,e)=>{const s=g+` ${e||""}${e?" and ":""}(${t})`;return{s:s,q:t,t:e,toString:()=>s}};v.toString=()=>g;const $=t=>`(${t})`,j=t=>"string"==typeof t;function O(t){var e;if(!(null===(e=null==t?void 0:t.args)||void 0===e?void 0:e.length))return"";switch(t.key){case"or":return t.args.map((t=>j(t)?$(t):O(t))).join(" or ");case"and":return t.args.map((t=>{const e=!j(t);return e&&"or"===t.key?$(O(t)):e?O(t):$(t)})).join(" and ");case"not":const e=t.args[0];return"not "+(j(e)?$(e):$(O(e)))}}const k=(t,e)=>{let s="";return t.length&&(s=t.join(" ")),e&&(s=s+(s?" and ":"")+(s&&"or"===e.key?$(O(e)):O(e))),s},_=(t={})=>{const{type:e=[],state:s}=t;return Object.defineProperties((t=>{const r=k(e,s);return{[`${g}${r?" "+r:""}`]:t}}),{key:{value:null==s?void 0:s.key},args:{value:null==s?void 0:s.args},all:{get:()=>_({state:s,type:["all"]})},print:{get:()=>_({state:s,type:["print"]})},screen:{get:()=>_({state:s,type:["screen"]})},and:{value:(...t)=>_({type:e,state:{key:"and",args:s?[s,...t]:t}})},or:{value:(...t)=>_({type:e,state:{key:"or",args:s?[s,...t]:t}})},not:{get:()=>_(s?{type:e,state:j(s)||"not"!==(null==s?void 0:s.key)?{key:"not",args:[s]}:s.args[0]}:{type:2===e.length?[e[1]]:["not",e[0]||"all"],state:s})}})},w=t=>{const{root:e="",limit:s="",mode:r=[!1,!1]}=t;return Object.defineProperties((t=>({[f+` ${e?`(${e}${r[0]?" > *":""})`:""}${e&&s?" ":""}${s?`to (${s}${r[1]?" > *":""})`:""}`]:t})),{limit:{value:t=>w({root:e,limit:t,mode:r})},root:{value:t=>w({root:t,limit:s,mode:r})},both:{value:()=>w({root:e,limit:s,mode:[!1,!0]})},none:{value:()=>w({root:e,limit:s,mode:[!0,!1]})},low:{value:()=>w({root:e,limit:s,mode:[!0,!0]})},high:{value:()=>w({root:e,limit:s,mode:[!1,!1]})},toString:{value:()=>":scope"}})},S=t=>({[y]:t}),q=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=m+` ${n?n+" ":""}(${s})`;return{c:n,q:s,s:i,toString:()=>i}};s.toString=()=>m;const r=(s={})=>{const{scroll:n,type:i,name:a,state:c}=s;return Object.defineProperties((t=>{const e=k([],c);return{[`${m}${a?" "+a:""}${e?" "+e:""}`]:t}}),{container:{value:(a||"none")+" / "+(i&&n?`${i} scroll-state`:n?"scroll-state":i||"normal"),enumerable:!0},key:{value:null==c?void 0:c.key},args:{value:null==c?void 0:c.args},named:{get:()=>r({scroll:n,state:c,name:a||t.name("cq",e.cq++),type:i})},size:{get:()=>r({name:a,scroll:n,state:c,type:"size"})},isize:{get:()=>r({name:a,scroll:n,state:c,type:"inline-size"})},scroll:{get:()=>r({name:a,scroll:!0,state:c,type:i})},and:{value:(...t)=>r({name:a,scroll:n,type:i,state:{key:"and",args:c?[c,...t]:t}})},or:{value:(...t)=>r({name:a,scroll:n,type:i,state:{key:"or",args:c?[c,...t]:t}})},not:{value:t=>r({name:a,scroll:n,type:i,state:{key:"not",args:[t]}})},[u]:{value:!0}})},n=(s,r)=>{const n="--"+(s||t.name("cp",e.cp++)),i=p+" "+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}};n.toString=()=>p;const i=s=>{const r=s||t.name("kf",e.kf++),n=d+" "+r;return{k:r,s:n,toString:()=>n}};i.toString=()=>d;const a=s=>{const r=s||t.name("lay",e.lay++),n=b+" "+r;return{k:r,s:n,toString:()=>n}};a.toString=()=>b;a.toString=()=>f;const c=(t="",e=!1)=>{const s=x+` ${e?"not ":""}(${t})`;return{c:t,n:e,s:s,toString:()=>s}};return c.toString=()=>x,{pr:n,kf:i,mq:v,cq:s,lay:a,sc:(t="",e="")=>{const s=f+` ${t?`(${t})`:""}${t&&e?" ":""}${e?`to (${e})`:""}`;return{r:t,l:e,s:s,toString:()=>s}},sup:c,keyframes:s=>{const r=t.name("kf",e.kf++),n=d+" "+r;return Object.defineProperties((t=>{if(!t)return{animationName:r};const{dur:e,tf:s,del:n,ic:i,dir:a,ps:c,fm:o}=t;return{animation:[e,s,n,i,a,c,o,r].filter(Boolean).join(" ")}}),{[n]:{value:s,enumerable:!0},toString:{value:()=>r},[u]:{value:!0}})},property:(s={})=>{const{syn:r='"*"',inh:n=!0,ini:i,def:a}=s,c="--"+t.name("cp",e.cp++),o=`var(${c}${void 0!==a?","+a:""})`,l=p+" "+c;return Object.defineProperties((t=>({[c]:t})),{[l]:{value:{syntax:r,inherits:n,initialValue:i},enumerable:!0},toString:{value:()=>o},[u]:{value:!0}})},scope:w({}),media:_({}),container:r({}),startingStyle:S}},A=t=>t+"px",E=t=>t+"vh",P=t=>t+"vw",z=t=>t+"vmin",C=t=>t+"vmax",M=t=>t+"em",N=t=>t+"rem",W=t=>t+"deg",I=t=>t+"rad",K=t=>t+"rad",T=t=>t+"ms",B=t=>t+"s",D=t=>t+"%",J=t=>t+"cqw",L=t=>t+"cqh",R=t=>t+"cqi",V=t=>t+"cqb",F=t=>t+"cqmin",H=t=>t+"cqmax",Z=Object.fromEntries,G=Object.entries,Q=":first-",U=":last-",X=":only-",Y="child",tt=":nth-",et="of-type",st=tt+Y,rt=":focus",nt={r:":root",h:":hover",f:rt,fv:rt+"-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+Y,lc:U+Y,oc:X+Y,odd:st+"(odd)",even:st+"(even)",ft:Q+et,lt:U+et,ot:X+et,bef:"::before",aft:"::after",bd:"::backdrop"},it={has:":has",not:":not",is:":is",wh:":where",st:":state",nthc:st,ntho:tt+et,dir:":dir",lang:":lang"},at="oklch",ct=t=>at+`(${t})`,ot=t=>ct(`from ${t}`),lt="def",ut=t=>{const e=(e,s)=>"string"==typeof s?t(e,s):s;class s{constructor(t={}){this.state={l:e("l",lt),c:e("c",lt),h:e("h",lt),a:e("a",lt)},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 ct(`${t} ${e} ${s} / ${r}`)}}return t=>new s(t)},ht=(t,e=.1)=>ot(`${t} calc(l + ${e}) c h / alpha)`),gt=(t,e=.1)=>ot(`${t} calc(l - ${e}) c h / alpha)`),mt=(t,e=.1)=>ot(`${t} l c h / calc(alpha + ${e}))`),pt=(t,e=.1)=>ot(`${t} l c h / calc(alpha - ${e}))`),dt=(t,e=.04)=>ot(`${t} l calc(c + ${e}) h / alpha)`),bt=(t,e=.04)=>ot(`${t} l calc(c - ${e}) h / alpha)`),ft=(t,e=30)=>ot(`${t} l c calc(h${"number"==typeof e?e>0?" + "+e:" - "+-e:e}) / alpha)`),xt=({base:t,mixin:e,method:s,bpart:r,mpart:n})=>`color-mix(in ${s||at}, ${t}${void 0!==r?` ${r}%`:""}, ${e}${void 0!==n?` ${n}%`:""})`,yt=t=>({create:ut(t),oklch:ct,lighten:ht,darken:gt,saturate:dt,desaturate:bt,fadein:mt,fadeout:pt,spin:ft,mix:xt}),vt="palette",$t=t=>{class e{constructor(t={}){this.state={l:"l",c:"base",h:"pri",a:1,m:"bg"},Object.assign(this,{[u]:!0}),this.state=Object.assign(this.state,t)}get xs(){return new e(Object.assign(Object.assign({},this.state),{l:"xs"}))}get s(){return new e(Object.assign(Object.assign({},this.state),{l:"s"}))}get m(){return new e(Object.assign(Object.assign({},this.state),{l:"m"}))}get l(){return new e(Object.assign(Object.assign({},this.state),{l:"l"}))}get xl(){return new e(Object.assign(Object.assign({},this.state),{l:"xl"}))}get lightness(){return{xs:this.xs,s:this.s,m:this.m,l:this.l,xl:this.xl}}get gray(){return new e(Object.assign(Object.assign({},this.state),{c:"gray"}))}get pale(){return new e(Object.assign(Object.assign({},this.state),{c:"pale"}))}get base(){return new e(Object.assign(Object.assign({},this.state),{c:"base"}))}get rich(){return new e(Object.assign(Object.assign({},this.state),{c:"rich"}))}get chroma(){return{gray:this.gray,pale:this.pale,base:this.base,rich:this.rich}}get pri(){return new e(Object.assign(Object.assign({},this.state),{h:"pri"}))}get sec(){return new e(Object.assign(Object.assign({},this.state),{h:"sec"}))}get suc(){return new e(Object.assign(Object.assign({},this.state),{h:"suc"}))}get inf(){return new e(Object.assign(Object.assign({},this.state),{h:"inf"}))}get war(){return new e(Object.assign(Object.assign({},this.state),{h:"war"}))}get dan(){return new e(Object.assign(Object.assign({},this.state),{h:"dan"}))}get hue(){return{pri:this.pri,sec:this.sec,suc:this.suc,inf:this.inf,war:this.war,dan:this.dan}}alpha(t=1){return new e(Object.assign(Object.assign({},this.state),{a:t}))}get bg(){return new e(Object.assign(Object.assign({},this.state),{m:"bg"}))}get fg(){return new e(Object.assign(Object.assign({},this.state),{m:"fg"}))}toString(){const{l:e,c:s,h:r,a:n,m:i}=this.state;return`oklch(${t(vt,"l",i,e)} ${t(vt,"c",i,s)} ${t(vt,"h",r)} / ${n})`}}return new e},jt="coef",Ot=t=>{class e{constructor(t={}){this.state={center:8},this.state=Object.assign(this.state,t)}get min(){return t(jt,this.state.center-4)}get xxs(){return t(jt,this.state.center-3)}get xs(){return t(jt,this.state.center-2)}get s(){return t(jt,this.state.center-1)}get m(){return t(jt,this.state.center)}get l(){return t(jt,this.state.center+1)}get xl(){return t(jt,this.state.center+2)}get xxl(){return t(jt,this.state.center+3)}get max(){return t(jt,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},kt=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])=>kt(t,e(s+1))),{}),each:(t,e)=>_t(t).reduce(((t,[s,r])=>kt(t,e(s,r))),{}),when:(t,e,s={})=>t?e:s},St="width: ",qt=t=>{const{scope:e,globalKey:s="",bp:n={}}=t,i=e(s).varExp,a=t=>i(...t.split(".")),c=(t=1)=>`calc(${t} * ${a("rtime")})`,o=(t=1)=>`calc(${t} * ${a("rangle")})`,u=(t=1)=>`calc(${t} * 1rem)`;return{compile:({key:t,maker:s})=>{const g=e(t),m=q(g),p=t=>{const e=n[t]||t;return"number"==typeof e?e+"rem":""},d=t=>"min-"+St+p(t),b=t=>"max-"+St+p(t),f=(t,e)=>"string"==typeof e?m.cq(t,e):m.mq(t),x=(t,e,s)=>""+f(d(t)+") and ("+b(e),s),y={up:(t,e)=>""+f(d(t),e),down:(t,e)=>""+f(b(t),e),between:x,only:(t,e)=>x(t,t,e)};return v=s(Object.assign(wt,{key:t,vars:a,size:u,time:c,angle:o,bem:g.selector,pseudo:Object.assign(Z(G(nt).map((([t,e])=>{function s(t=""){return t+e}return s.toString=()=>e,[t,s]}))),Z(G(it).map((([t,e])=>{function s(t,s=""){return s+e+`(${t})`}return s.toString=()=>e,[t,s]})))),color:yt(i),palette:$t(i),coef:Ot(i),units:{px:A,vh:E,vw:P,vmin:z,vmax:C,em:M,rem:N,deg:W,rad:I,turn:K,ms:T,s:B,pc:D,cqw:J,cqh:L,cqb:V,cqi:R,cqmin:F,cqmax:H},at:m,limit:y,merge:r})),l(v,((t,e)=>t+h(...e)),"");var v}}};const 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 Object.entries(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=({prefix:t=i.prefix})=>{let e=1;return{get base(){return t+0},get current(){return t+e},next(){return e++,this.current},reset(){e=1}}},Pt=void 0,zt=Object.entries,Ct=Object.defineProperties,Mt=t=>"string"==typeof t,Nt=t=>null!==t&&"object"==typeof t,Wt=t=>t.split("."),It=(t,e)=>zt(t).reduce(((t,[s,r])=>{if(Nt(r)){const n=zt(r);n.length?t.push(...n.reduce(((t,[r,n])=>{if((t=>null!==t&&t!==Pt)(r)&&e&&t.push([s,r,Pt,Pt]),Nt(n)){const e=zt(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,Pt,Pt,Pt])}return t}),[]),Kt=(t,e,s,r)=>""+(((t,e)=>`${t||""}${e?"__"+e:""}`)(t,e)+(s?"_"+s:"")+(s&&r?"_"+r:""))||"_",Tt=(t,e)=>"."+(e?t+(e.startsWith("_")?"":"-")+e:t),Bt=(t,e)=>`[data-${t}${e?`~="${e}"`:""}]`;const Dt=t=>t||"",Jt=(t={})=>{const{mode:e,min:s}=t;let r,n;return r="a"===e?Bt:Tt,s&&(n={}),t=>{let s=0,i=Dt,a=Dt;n&&(n[t]||(n[t]={}),i=e=>{var r;return null!==(r=n[t][e])&&void 0!==r?r:n[t][e]=(s++).toString(36)},a=e=>n[t][e]);let c=(...e)=>[t,...e].filter(Boolean).join("-"),o="class",l=e=>e?t+(e.startsWith("_")?"":"-")+e:void 0===e?void 0:t;"a"===e&&(o="data-"+t,l=Dt);const u=(...t)=>"--"+c(...t),h=t=>{if(void 0===t)return function(t){const e=({b:s,e:r,m:n})=>({b:t=>e({b:t,e:"",m:{}}),e:t=>e({b:s,e:t,m:{}}),m:(t={})=>e({b:s,e:r,m:t}),get $(){return t({[s]:{[r]:n}})}});return e({b:"",e:"",m:{}})}(h);let e,s,r,n,i="";const c=Mt(t);return i=c||Array.isArray(t)?[...(c?[t]:t).reduce(((t,i)=>([e,s,r,n]=Wt(i),t.add(l(a(Kt(e,s)))),r&&t.add(l(a(Kt(e,s,r,n)))),t)),new Set).values()].join(" "):t&&It(t,!0).map((([t,e,s,r])=>l(a(Kt(t,e,s,r))))).join(" "),Ct({[o]:i},{toString:{value:()=>`${o}="${i}"`},$:{value:i}})};return{selector:e=>{let s,n,a,c;return Mt(e)?([s,n,a,c]=Wt(e),r(t,i(Kt(s,n,a,c)))):e&&It(e).map((([e,s,n,a])=>r(t,i(Kt(e,s,n,a))))).join(",")},attr:h,name:c,varName:u,varExp:(...t)=>`var(${u(...t)})`}}},Lt="effcss-provider",Rt="theme",Vt="size",Ft="time",Ht="angle",Zt="palette",Gt=Object.assign,Qt=Object.entries,Ut=Object.fromEntries,Xt=(t,e)=>t.getAttribute(e)||i[e],Yt=(t,e)=>(t=>null!==t?Number(t):null)(Xt(t,e)),te=(t,e,s)=>null===s?t.removeAttribute(e):t.setAttribute(e,s+""),ee=t=>`:root:has(script[is=${Lt}]${t?`[${t}]`:""})`,se=t=>[t.xxs,t.xs,t.s,t.m,t.l,t.xl,t.xxl],re=["xs","s","m","l","xl"],ne=["pale","base","rich"],ie=({scope:e,keyMaker:s,provider:r})=>{const n=r.settings,i=null==n?void 0:n.vars,{varName:a}=e(s.base),c=t=>a("",t);function o(t,e){return Qt(t).reduce(((t,[s,r])=>r&&"object"==typeof r?Gt(t,o(r,[...e,s])):(t[a(...e,s)]=r,t)),{})}const l=Ut(Qt(i||{}).map((([t,e])=>[t,o(e,[])]))),{"":u={},dark:h,light:g}=l,m=t(l,["","dark","light"]),p=r.size,d=r.time,b=r.angle,{l:f,c:x,h:y}=n.palette,v=n.coef,$=[0,...se(v.$0_),1,...se(v.$1_),2,...se(v.$2_),16,...se(v.$16_),v.max];return({bem:t,each:e,when:s,vars:r,merge:n,at:{media:i},units:{px:o,ms:h,deg:g}})=>{const v="prefers-color-scheme",j={light:`${v}: light`,dark:`${v}: dark`};return n({[ee()]:n({fontSize:r("rem")},u,e($,((t,e)=>({[a("coef",t)]:e}))),e(y,((t,e)=>({[a(Zt,"h",t)]:e}))),{[a(Zt,"c","bg","gray")]:0,[a(Zt,"c","fg","gray")]:0},e(j,((t,s)=>i.and(s)(n(l[t]||{},e(re,((e,s)=>({[a(Zt,"l","bg",s)]:f[t].bg[s],[a(Zt,"l","fg",s)]:f[t].fg[s]}))),e(ne,((e,s)=>({[a(Zt,"c","bg",s)]:x[t].bg[s],[a(Zt,"c","fg",s)]:x[t].fg[s]}))))))))},e(m,((e,s)=>({[ee(`${Rt}=${e}`)]:s,[t(`..theme.${e}`)]:s}))),s(!!p,{[ee(Vt)]:{[c("rem")]:o(p)}}),s(!!d,{[ee(Ft)]:{[c("rtime")]:h(d)}}),s(!!b,{[ee(Ht)]:{[c("rangle")]:g(b)}}))}},ae=({scope:t,keyMaker:e,collector:s,manager:r,processor:n})=>{const i=t=>"string"==typeof t?t:s.getKey(t),a=s=>t(s||e.base).attr,c=(t,e)=>n.compile({key:e,maker:t}),o=(t,n,i)=>{const o=n||e.current;let l=s.use(t,o);return(i||r&&!r.has(l))&&(r.pack(l,c(t,l)),n||e.next()),a(l)};return{key:i,resolve:a,use:o,usePublic:t=>Ut(Qt(t).map((([t,e])=>[t,o(e,t)]))),usePrivate:t=>t.map((t=>o(t))),css:c,status:t=>{const e=i(t);return!!e&&r.status(e)},on:(...t)=>r.on(...t.map(i)),off:(...t)=>r.off(...t.map(i)),stylesheets:(...t)=>{let e;return e=t.length?1===t.length&&Array.isArray(t[0])?t[0]:t:s.keys,e.map((t=>r.get(i(t))))}}},ce=t=>Object.defineProperties(t,{prefix:{get:()=>t.getAttribute("prefix")||"f"},mode:{get:()=>t.getAttribute("mode")||"a"},min:{get:()=>""===t.getAttribute("min")},hydrate:{get:()=>""===t.getAttribute("hydrate")},theme:{set(e){te(t,Rt,e)},get:()=>Xt(t,Rt)||""},size:{set(e){te(t,Vt,e)},get:()=>Yt(t,Vt)},time:{set(e){te(t,Ft,e)},get:()=>Yt(t,Ft)},angle:{set(e){te(t,Ht,e)},get:()=>Yt(t,Ht)}});function oe(t={}){const e=globalThis.document,s=globalThis.customElements;if(null==s?void 0:s.get(Lt))return!1;{class n extends HTMLScriptElement{constructor(){super(...arguments),this._c=At(),this._settings=o,this._cust=()=>{this._=ie({scope:this._s,keyMaker:this._k,provider:this}),this.use(this._,this._k.base,!0)}}static get observedAttributes(){return[Vt,Ft,Ht]}get settings(){return this._settings}set settings(t){var e,s,n;const i=r({},this._settings,t),{makers:a,bp:c,off:o}=i;(c&&(null===(e=this._settings)||void 0===e?void 0:e.bp)!==c||!this._p)&&(this._p=qt({scope:this._s,globalKey:this._k.base,bp:c})),a&&(null===(s=this._settings)||void 0===s?void 0:s.makers)!==a&&(this._c.useMany(a),this.usePublic(a),(null==o?void 0:o.length)&&this._settings.off!==o&&this.off(...o)),this._settings=i,(!(null===(n=this._m)||void 0===n?void 0:n.has(this._k.base))||t.vars||t.palette||t.coef)&&this._cust()}get makers(){return this._c.makers}attributeChangedCallback(){this._k&&this._cust()}connectedCallback(){this.textContent?this._settings=r(this._settings,JSON.parse(this.textContent)):t&&(this._settings=r(this._settings,t)),ce(this),this._k=Et({prefix:this.prefix}),this._s=Jt({mode:this.mode,min:this.min}),this._p=qt({scope:this._s,globalKey:this._k.base,bp:t.bp||this.settings.bp}),this._m=function(t){const e={};null==t||t.forEach((t=>{const s=t.dataset.effcss;s&&(e[s]=t)}));let s={},r={},n=[],i=[];const a=(t,e)=>(e.toString=()=>"effcss-"+t,e),c=t=>{var e;return t.adoptedStyleSheets=[...(null===(e=t.adoptedStyleSheets)||void 0===e?void 0:e.length)?[...t.adoptedStyleSheets].filter((t=>!(t+"").startsWith("effcss-"))):[],...n]},o=()=>{i=i.reduce(((t,e)=>{const s=e.deref();return s&&(c(s),t.push(e)),t}),[])},l=t=>n.findIndex((e=>e===t)),u=t=>t?s[t]:void 0,h=(t,r)=>{if(!s[t]){s[t]=a(t,r),n.push(s[t]);const i=e[t];return i&&(i.disabled=!0),o(),!0}},g=t=>{const e=u(t);return!!e&&-1!==l(e)};return{apply:c,notify:o,getIndex:l,get:u,has:t=>!!t&&!!u(t),getAll:()=>s,add:h,status:g,on:(...t)=>{const e=t.reduce(((t,e)=>{const s=u(e);return!(!s||g(e))&&(n.push(s),t)}),!0);return o(),e},off:(...t)=>{const e=t.reduce(((t,e)=>{const s=u(e);if(s&&g(e)){const e=l(s);return n.splice(e,1),t}return!1}),!0);return o(),e},remove:t=>{const e=u(t);if(!e)return;const i=l(e);return i>-1&&(n.splice(i,1),delete s[t],delete r[t]),o(),!0},removeAll:()=>(n.splice(0),s={},r={},o(),!0),pack:(t,e)=>{let r=s[t]||new CSSStyleSheet;return r.replaceSync(e),r=a(t,r),!!r.cssRules.length&&h(t,r)},replace:(t,e)=>{const r=s[t];if(r)return r.replaceSync(e),o(),!0},register:t=>{i.findIndex((e=>e.deref()===t))>=0||(i.push(new WeakRef(t)),c(t))},unregister:t=>{const e=i.findIndex((e=>e.deref()===t));e>=0&&i.splice(e,1)}}}(e.querySelectorAll("[data-effcss]"));const s=ae({scope:this._s,processor:this._p,keyMaker:this._k,manager:this._m,collector:this._c});Object.assign(this,s),this._cust();const n=this;this._n={set adoptedStyleSheets(t){n.dispatchEvent(new CustomEvent("effcsschanges",{detail:{styles:t},bubbles:!0}))}},this._m.register(this._n),this._m.register(e)}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(Lt,n,{extends:"script"}),!0}}const le=(e={})=>{let{noscript:s,attrs:n={}}=e,a=t(e,["noscript","attrs"]);const c=r(o,a);let{mode:l=i.mode,min:u,prefix:h=i.prefix,theme:g,hydrate:m,size:p,time:d,angle:b}=n;const f=Et({prefix:h}),x=Jt({mode:l,min:u}),y=qt({scope:x,globalKey:f.base,bp:c.bp}),v=At(),$={},j=[],O=t=>j.findIndex((e=>e===t)),k=ae({scope:x,processor:y,keyMaker:f,manager:{get:t=>t?$[t]:void 0,pack(t,e){const s=$[t]||{};if(!$[t])return $[t]=s,j.push(s),!0},has(t){return!!t&&!!this.get(t)},status(t){const e=this.get(t);return!!e&&-1!==O(e)},on(...t){return t.reduce(((t,e)=>{const s=this.get(e);return!(!s||this.status(e))&&(j.push(s),t)}),!0)},off(...t){return t.reduce(((t,e)=>{const s=this.get(e);if(s&&this.status(e)){const e=O(s);return j.splice(e,1),t}return!1}),!0)}},collector:v}),_=Object.assign(Object.assign({tagName:"",attributes:{prefix:h,mode:l,hydrate:m,min:u,theme:g,size:p,time:d,angle:b},getAttribute(t){const e=this.attributes[t];return e?"boolean"==typeof e?"":e:null},setAttribute(t,e){this.attributes[t]=e},removeAttribute(t){delete this.attributes[t]},get makers(){return v.makers},get settings(){return c},set settings(t){}},k),{toString(){const t=[[f.base,ie({scope:x,keyMaker:f,provider:this})],...Object.entries(v.makers)].map((([t,e])=>`<style data-effcss="${t}">${k.css(e,t)}</style>`)).join("");if(s)return t;const e=Object.keys(a).length?JSON.stringify(a):"";return t+`<script ${Object.entries(Object.assign({is:Lt,type:"application/json"},this.attributes)).map((([t,e])=>e&&e!==i[t]?"boolean"==typeof e?t:`${t}="${e}"`:"")).filter(Boolean).join(" ")}>${e}<\/script>`}});return ce(_)},ue=(e={})=>{const{emulate:s}=e,r=t(e,["emulate"]),n=null===globalThis||void 0===globalThis?void 0:globalThis.document;if(n&&!s){void 0===ue.isDefined&&(ue.isDefined=oe(r));const t=n.querySelector(`script[is=${Lt}]`);if(t)return t;const e=n.createElement("script",{is:Lt});e.setAttribute("is",Lt);const s=null==r?void 0:r.attrs;return s&&Object.entries(s).map((([t,s])=>s&&i[t]!==s&&e.setAttribute(t,"boolean"==typeof s?"":s+""))),n.head.appendChild(e),e}return le(r)},he=(t={})=>ue({attrs:t});export{he as createConsumer};
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* EffCSS v3.
|
|
2
|
+
* EffCSS v3.12.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=void 0,e=Object.entries,s=Array.isArray,r=Object.defineProperties,n=t=>"string"==typeof t,i=t=>null!==t&&"object"==typeof t,a=t=>t.split("."),l=(s,r)=>e(s).reduce(((s,[n,a])=>{if(i(a)){const l=e(a);l.length?s.push(...l.reduce(((s,[a,l])=>{if((e=>null!==e&&e!==t)(a)&&r&&s.push([n,a,t,t]),i(l)){const t=e(l);t.length&&s.push(...t.reduce(((t,[e,s])=>{const r=typeof s;return"string"!==r&&"number"!==r||t.push([n,a,e,s]),t}),[]))}return s}),[])):s.push([n,t,t,t])}return s}),[]),c=(t,e,s,r)=>""+(((t,e)=>`${t||""}${e?"__"+e:""}`)(t,e)+(s?"_"+s:"")+(s&&r?"_"+r:""))||"_",o=(t,e)=>"."+(e?t+(e.startsWith("_")?"":"-")+e:t),h=(t,e)=>`[data-${t}${e?`~="${e}"`:""}]`,u=(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]:u(t[e],r||{}):t[e]=r})),t)),t):t,g={def:.75,c:.05,s:.65,m:.75,l:.85,n:.9},m="effcss-provider",p={theme:null,hydrate:null,mode:"a",prefix:"f",size:null,time:null,angle:null,min:null},d=t=>Number((.1*184+.9*t).toFixed(2)),b={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:d(142),inf:d(264),war:d(109),dan:d(29)}},f={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:g,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:g},dark:{l:{def:.4,n:.25,s:.3,m:.4,l:.5,c:.95}}},palette:b,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}};const x=t=>t||"",v=({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])))}}},$=(t,e,s)=>Object.entries(t).reduce(e,s),j=Symbol("noParse"),O=(t,e,s)=>{var r,n,i;let a=""+t;return null==e?"":"object"!=typeof e||e.hasOwnProperty(j)?`${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+`{${$(e,((t,e)=>t+O(...e,a)),"")}}`;var l},k="@media",_="@container",w="@property",S="@keyframes",q="@layer",A="@scope",P="@supports",E="@starting-style",z=(t,e)=>{const s=k+` ${e||""}${e?" and ":""}(${t})`;return{s:s,q:t,t:e,toString:()=>s}};z.toString=()=>k;const C=t=>`(${t})`,W=t=>"string"==typeof t;function I(t){var e;if(!(null===(e=null==t?void 0:t.args)||void 0===e?void 0:e.length))return"";switch(t.key){case"or":return t.args.map((t=>W(t)?C(t):I(t))).join(" or ");case"and":return t.args.map((t=>{const e=!W(t);return e&&"or"===t.key?C(I(t)):e?I(t):C(t)})).join(" and ");case"not":const e=t.args[0];return"not "+(W(e)?C(e):C(I(e)))}}const N=(t,e)=>{let s="";return t.length&&(s=t.join(" ")),e&&(s=s+(s?" and ":"")+(s&&"or"===e.key?C(I(e)):I(e))),s},K=(t={})=>{const{type:e=[],state:s}=t;return Object.defineProperties((t=>{const r=N(e,s);return{[`${k}${r?" "+r:""}`]:t}}),{key:{value:null==s?void 0:s.key},args:{value:null==s?void 0:s.args},all:{get:()=>K({state:s,type:["all"]})},print:{get:()=>K({state:s,type:["print"]})},screen:{get:()=>K({state:s,type:["screen"]})},and:{value:(...t)=>K({type:e,state:{key:"and",args:s?[s,...t]:t}})},or:{value:(...t)=>K({type:e,state:{key:"or",args:s?[s,...t]:t}})},not:{get:()=>K(s?{type:e,state:W(s)||"not"!==(null==s?void 0:s.key)?{key:"not",args:[s]}:s.args[0]}:{type:2===e.length?[e[1]]:["not",e[0]||"all"],state:s})}})},M=t=>{const{root:e="",limit:s="",mode:r=[!1,!1]}=t;return Object.defineProperties((t=>({[A+` ${e?`(${e}${r[0]?" > *":""})`:""}${e&&s?" ":""}${s?`to (${s}${r[1]?" > *":""})`:""}`]:t})),{limit:{value:t=>M({root:e,limit:t,mode:r})},root:{value:t=>M({root:t,limit:s,mode:r})},both:{value:()=>M({root:e,limit:s,mode:[!1,!0]})},none:{value:()=>M({root:e,limit:s,mode:[!0,!1]})},low:{value:()=>M({root:e,limit:s,mode:[!0,!0]})},high:{value:()=>M({root:e,limit:s,mode:[!1,!1]})},toString:{value:()=>":scope"}})},B=t=>({[E]:t}),L=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=_+` ${n?n+" ":""}(${s})`;return{c:n,q:s,s:i,toString:()=>i}};s.toString=()=>_;const r=(s={})=>{const{scroll:n,type:i,name:a,state:l}=s;return Object.defineProperties((t=>{const e=N([],l);return{[`${_}${a?" "+a:""}${e?" "+e:""}`]:t}}),{container:{value:(a||"none")+" / "+(i&&n?`${i} scroll-state`:n?"scroll-state":i||"normal"),enumerable:!0},key:{value:null==l?void 0:l.key},args:{value:null==l?void 0:l.args},named:{get:()=>r({scroll:n,state:l,name:a||t.name("cq",e.cq++),type:i})},size:{get:()=>r({name:a,scroll:n,state:l,type:"size"})},isize:{get:()=>r({name:a,scroll:n,state:l,type:"inline-size"})},scroll:{get:()=>r({name:a,scroll:!0,state:l,type:i})},and:{value:(...t)=>r({name:a,scroll:n,type:i,state:{key:"and",args:l?[l,...t]:t}})},or:{value:(...t)=>r({name:a,scroll:n,type:i,state:{key:"or",args:l?[l,...t]:t}})},not:{value:t=>r({name:a,scroll:n,type:i,state:{key:"not",args:[t]}})},[j]:{value:!0}})},n=(s,r)=>{const n="--"+(s||t.name("cp",e.cp++)),i=w+" "+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}};n.toString=()=>w;const i=s=>{const r=s||t.name("kf",e.kf++),n=S+" "+r;return{k:r,s:n,toString:()=>n}};i.toString=()=>S;const a=s=>{const r=s||t.name("lay",e.lay++),n=q+" "+r;return{k:r,s:n,toString:()=>n}};a.toString=()=>q;a.toString=()=>A;const l=(t="",e=!1)=>{const s=P+` ${e?"not ":""}(${t})`;return{c:t,n:e,s:s,toString:()=>s}};return l.toString=()=>P,{pr:n,kf:i,mq:z,cq:s,lay:a,sc:(t="",e="")=>{const s=A+` ${t?`(${t})`:""}${t&&e?" ":""}${e?`to (${e})`:""}`;return{r:t,l:e,s:s,toString:()=>s}},sup:l,keyframes:s=>{const r=t.name("kf",e.kf++),n=S+" "+r;return Object.defineProperties((t=>{if(!t)return{animationName:r};const{dur:e,tf:s,del:n,ic:i,dir:a,ps:l,fm:c}=t;return{animation:[e,s,n,i,a,l,c,r].filter(Boolean).join(" ")}}),{[n]:{value:s,enumerable:!0},toString:{value:()=>r},[j]:{value:!0}})},property:(s={})=>{const{syn:r='"*"',inh:n=!0,ini:i,def:a}=s,l="--"+t.name("cp",e.cp++),c=`var(${l}${void 0!==a?","+a:""})`,o=w+" "+l;return Object.defineProperties((t=>({[l]:t})),{[o]:{value:{syntax:r,inherits:n,initialValue:i},enumerable:!0},toString:{value:()=>c},[j]:{value:!0}})},scope:M({}),media:K({}),container:r({}),startingStyle:B}},R=t=>t+"px",V=t=>t+"vh",F=t=>t+"vw",H=t=>t+"vmin",T=t=>t+"vmax",Z=t=>t+"em",D=t=>t+"rem",G=t=>t+"deg",J=t=>t+"rad",Q=t=>t+"rad",U=t=>t+"ms",X=t=>t+"s",Y=t=>t+"%",tt=t=>t+"cqw",et=t=>t+"cqh",st=t=>t+"cqi",rt=t=>t+"cqb",nt=t=>t+"cqmin",it=t=>t+"cqmax",at=Object.fromEntries,lt=Object.entries,ct=":first-",ot=":last-",ht=":only-",ut="child",gt=":nth-",mt="of-type",pt=gt+ut,dt=":focus",bt={r:":root",h:":hover",f:dt,fv:dt+"-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:ct+ut,lc:ot+ut,oc:ht+ut,odd:pt+"(odd)",even:pt+"(even)",ft:ct+mt,lt:ot+mt,ot:ht+mt,bef:"::before",aft:"::after",bd:"::backdrop"},ft={has:":has",not:":not",is:":is",wh:":where",st:":state",nthc:pt,ntho:gt+mt,dir:":dir",lang:":lang"},xt="oklch",vt=t=>xt+`(${t})`,yt=t=>vt(`from ${t}`),$t="def",jt=t=>{const e=(e,s)=>"string"==typeof s?t(e,s):s;class s{constructor(t={}){this.state={l:e("l",$t),c:e("c",$t),h:e("h",$t),a:e("a",$t)},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 vt(`${t} ${e} ${s} / ${r}`)}}return t=>new s(t)},Ot=(t,e=.1)=>yt(`${t} calc(l + ${e}) c h / alpha)`),kt=(t,e=.1)=>yt(`${t} calc(l - ${e}) c h / alpha)`),_t=(t,e=.1)=>yt(`${t} l c h / calc(alpha + ${e}))`),wt=(t,e=.1)=>yt(`${t} l c h / calc(alpha - ${e}))`),St=(t,e=.04)=>yt(`${t} l calc(c + ${e}) h / alpha)`),qt=(t,e=.04)=>yt(`${t} l calc(c - ${e}) h / alpha)`),At=(t,e=30)=>yt(`${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||xt}, ${t}${void 0!==r?` ${r}%`:""}, ${e}${void 0!==n?` ${n}%`:""})`,Et=t=>({create:jt(t),oklch:vt,lighten:Ot,darken:kt,saturate:St,desaturate:qt,fadein:_t,fadeout:wt,spin:At,mix:Pt}),zt="palette",Ct=t=>{class e{constructor(t={}){this.state={l:"l",c:"base",h:"pri",a:1,m:"bg"},Object.assign(this,{[j]:!0}),this.state=Object.assign(this.state,t)}get xs(){return new e(Object.assign(Object.assign({},this.state),{l:"xs"}))}get s(){return new e(Object.assign(Object.assign({},this.state),{l:"s"}))}get m(){return new e(Object.assign(Object.assign({},this.state),{l:"m"}))}get l(){return new e(Object.assign(Object.assign({},this.state),{l:"l"}))}get xl(){return new e(Object.assign(Object.assign({},this.state),{l:"xl"}))}get lightness(){return{xs:this.xs,s:this.s,m:this.m,l:this.l,xl:this.xl}}get gray(){return new e(Object.assign(Object.assign({},this.state),{c:"gray"}))}get pale(){return new e(Object.assign(Object.assign({},this.state),{c:"pale"}))}get base(){return new e(Object.assign(Object.assign({},this.state),{c:"base"}))}get rich(){return new e(Object.assign(Object.assign({},this.state),{c:"rich"}))}get chroma(){return{gray:this.gray,pale:this.pale,base:this.base,rich:this.rich}}get pri(){return new e(Object.assign(Object.assign({},this.state),{h:"pri"}))}get sec(){return new e(Object.assign(Object.assign({},this.state),{h:"sec"}))}get suc(){return new e(Object.assign(Object.assign({},this.state),{h:"suc"}))}get inf(){return new e(Object.assign(Object.assign({},this.state),{h:"inf"}))}get war(){return new e(Object.assign(Object.assign({},this.state),{h:"war"}))}get dan(){return new e(Object.assign(Object.assign({},this.state),{h:"dan"}))}get hue(){return{pri:this.pri,sec:this.sec,suc:this.suc,inf:this.inf,war:this.war,dan:this.dan}}alpha(t=1){return new e(Object.assign(Object.assign({},this.state),{a:t}))}get bg(){return new e(Object.assign(Object.assign({},this.state),{m:"bg"}))}get fg(){return new e(Object.assign(Object.assign({},this.state),{m:"fg"}))}toString(){const{l:e,c:s,h:r,a:n,m:i}=this.state;return`oklch(${t(zt,"l",i,e)} ${t(zt,"c",i,s)} ${t(zt,"h",r)} / ${n})`}}return new e},Wt="coef",It=t=>{class e{constructor(t={}){this.state={center:8},this.state=Object.assign(this.state,t)}get min(){return t(Wt,this.state.center-4)}get xxs(){return t(Wt,this.state.center-3)}get xs(){return t(Wt,this.state.center-2)}get s(){return t(Wt,this.state.center-1)}get m(){return t(Wt,this.state.center)}get l(){return t(Wt,this.state.center+1)}get xl(){return t(Wt,this.state.center+2)}get xxl(){return t(Wt,this.state.center+3)}get max(){return t(Wt,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},Nt=Object.assign,Kt=Object.entries,Mt={dash:(...t)=>t.join("-"),comma:(...t)=>t.join(),space:(...t)=>t.join(" "),range:(t,e)=>Array.from(Array(t).entries()).reduce(((t,[s])=>Nt(t,e(s+1))),{}),each:(t,e)=>Kt(t).reduce(((t,[s,r])=>Nt(t,e(s,r))),{}),when:(t,e,s={})=>t?e:s},Bt="width: ",Lt=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")})`,l=(t=1)=>`calc(${t} * ${i("rangle")})`,c=(t=1)=>`calc(${t} * 1rem)`;return{compile:({key:t,maker:s})=>{const o=e(t),h=L(o),g=t=>{const e=r[t]||t;return"number"==typeof e?e+"rem":""},m=t=>"min-"+Bt+g(t),p=t=>"max-"+Bt+g(t),d=(t,e)=>"string"==typeof e?h.cq(t,e):h.mq(t),b=(t,e,s)=>""+d(m(t)+") and ("+p(e),s),f={up:(t,e)=>""+d(m(t),e),down:(t,e)=>""+d(p(t),e),between:b,only:(t,e)=>b(t,t,e)};return x=s(Object.assign(Mt,{key:t,vars:i,size:c,time:a,angle:l,bem:o.selector,pseudo:Object.assign(at(lt(bt).map((([t,e])=>{function s(t=""){return t+e}return s.toString=()=>e,[t,s]}))),at(lt(ft).map((([t,e])=>{function s(t,s=""){return s+e+`(${t})`}return s.toString=()=>e,[t,s]})))),color:Et(n),palette:Ct(n),coef:It(n),units:{px:R,vh:V,vw:F,vmin:H,vmax:T,em:Z,rem:D,deg:G,rad:J,turn:Q,ms:U,s:X,pc:Y,cqw:tt,cqh:et,cqb:rt,cqi:st,cqmin:nt,cqmax:it},at:h,limit:f,merge:u})),$(x,((t,e)=>t+O(...e)),"");var x}}};const Rt="theme",Vt="size",Ft="time",Ht="angle",Tt="palette",Zt=Object.assign,Dt=Object.entries,Gt=Object.fromEntries,Jt=(t,e)=>t.getAttribute(e)||p[e],Qt=(t,e)=>{const s=Jt(t,e);return null!==s?Number(s):null},Ut=(t,e,s)=>null===s?t.removeAttribute(e):t.setAttribute(e,s+""),Xt=t=>`:root:has(script[is=${m}]${t?`[${t}]`:""})`,Yt=t=>[t.xxs,t.xs,t.s,t.m,t.l,t.xl,t.xxl],te=["xs","s","m","l","xl"],ee=["pale","base","rich"];function se(t={}){const e=window.document,s=window.customElements;if(null==s?void 0:s.get(m))return!1;{class i 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}),[])},l=t=>s.findIndex((e=>e===t)),c=e=>e?t[e]:void 0,o=(e,r)=>{if(!t[e])return t[e]=n(e,r),s.push(t[e]),a(),!0},h=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:o,status:h,on:(...t)=>{const e=t.reduce(((t,e)=>{const r=c(e);return!(!r||h(e))&&(s.push(r),t)}),!0);return a(),e},off:(...t)=>{const e=t.reduce(((t,e)=>{const r=c(e);if(r&&h(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&&o(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=f,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 Dt(t).reduce(((t,[r,i])=>i&&"object"==typeof i?Zt(t,n(i,[...e,r])):(t[s(...e,r)]=i,t)),{})}const i=Gt(Dt(e||{}).map((([t,e])=>[t,n(e,[])]))),{"":a={},dark:l,light:c}=i,o=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"]),h=this.size,u=this.time,g=this.angle,{l:m,c:p,h:d}=this._settings.palette,b=this._settings.coef,f=[0,...Yt(b.$0_),1,...Yt(b.$1_),2,...Yt(b.$2_),16,...Yt(b.$16_),b.max];this._=({bem:t,each:e,when:n,vars:l,merge:c,at:{media:b},units:{px:x,ms:v,deg:y}})=>{const $="prefers-color-scheme",j={light:`${$}: light`,dark:`${$}: dark`};return c({[Xt()]:c({fontSize:l("rem")},a,e(f,((t,e)=>({[s("coef",t)]:e}))),e(d,((t,e)=>({[s(Tt,"h",t)]:e}))),{[s(Tt,"c","bg","gray")]:0,[s(Tt,"c","fg","gray")]:0},e(j,((t,r)=>b.and(r)(c(i[t]||{},e(te,((e,r)=>({[s(Tt,"l","bg",r)]:m[t].bg[r],[s(Tt,"l","fg",r)]:m[t].fg[r]}))),e(ee,((e,r)=>({[s(Tt,"c","bg",r)]:p[t].bg[r],[s(Tt,"c","fg",r)]:p[t].fg[r]}))))))))},e(o,((e,s)=>({[Xt(`${Rt}=${e}`)]:s,[t(`..theme.${e}`)]:s}))),n(!!h,{[Xt(Vt)]:{[r("rem")]:x(h)}}),n(!!u,{[Xt(Ft)]:{[r("rtime")]:v(u)}}),n(!!g,{[Xt(Ht)]:{[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(n))&&(this._m.pack(n,this.css(t,n)),e||this._k.next()),this.resolve(n)},this.usePublic=t=>Gt(Dt(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)=>{let e;return e=t.length?1===t.length&&Array.isArray(t[0])?t[0]:t:this._c.keys,e.map((t=>this._m.get(this.key(t))))}}static get observedAttributes(){return[Vt,Ft,Ht]}get prefix(){return Jt(this,"prefix")||""}get mode(){return this.getAttribute("mode")||"a"}get min(){return"string"==typeof this.getAttribute("min")}get hydrate(){return""===this.getAttribute("hydrate")}get settings(){return this._settings}set settings(t){var e,s,r;const n=u({},this._settings,t),{makers:i,bp:a,off:l}=n;(a&&(null===(e=this._settings)||void 0===e?void 0:e.bp)!==a||!this._p)&&(this._p=Lt({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==l?void 0:l.length)&&this._settings.off!==l&&this.off(...l),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()}get makers(){return this._c.makers}set theme(t){Ut(this,Rt,t)}get theme(){return Jt(this,Rt)||""}set size(t){Ut(this,Vt,t)}get size(){return Qt(this,Vt)}set time(t){Ut(this,"time",t)}get time(){return Qt(this,Ft)}set angle(t){Ut(this,"angle",t)}get angle(){return Qt(this,Ht)}attributeChangedCallback(){this._k&&this._cust()}connectedCallback(){this._k=v({prefix:this.prefix}),this._s=((t={})=>{const{mode:e,min:s}=t;let i,u;return i="a"===e?h:o,s&&(u={}),t=>{let s=0,o=x,h=x;u&&(u[t]||(u[t]={}),o=e=>{var r;return null!==(r=u[t][e])&&void 0!==r?r:u[t][e]=(s++).toString(36)},h=e=>u[t][e]);let g=(...e)=>[t,...e].filter(Boolean).join("-"),m="class",p=e=>e?t+(e.startsWith("_")?"":"-")+e:void 0===e?void 0:t;"a"===e&&(m="data-"+t,p=x);const d=(...t)=>"--"+g(...t),b=t=>{if(void 0===t)return function(t){const e=({b:s,e:r,m:n})=>({b:t=>e({b:t,e:"",m:{}}),e:t=>e({b:s,e:t,m:{}}),m:(t={})=>e({b:s,e:r,m:t}),get $(){return t({[s]:{[r]:n}})}});return e({b:"",e:"",m:{}})}(b);let e,s,i,o,u="";const g=n(t);return u=g||Array.isArray(t)?[...(g?[t]:t).reduce(((t,r)=>([e,s,i,o]=a(r),t.add(p(h(c(e,s)))),i&&t.add(p(h(c(e,s,i,o)))),t)),new Set).values()].join(" "):t&&l(t,!0).map((([t,e,s,r])=>p(h(c(t,e,s,r))))).join(" "),r({[m]:u},{toString:{value:()=>`${m}="${u}"`},$:{value:u}})};return{selector:e=>{let s,r,h,u;return n(e)?([s,r,h,u]=a(e),i(t,o(c(s,r,h,u)))):e&&l(e).map((([e,s,r,n])=>i(t,o(c(e,s,r,n))))).join(",")},attr:b,name:g,varName:d,varExp:(...t)=>`var(${d(...t)})`}}})({mode:this.mode,min:this.min});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(m,i,{extends:"script"}),!0}}export{se as defineProvider};
|
|
7
|
+
function t(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}"function"==typeof SuppressedError&&SuppressedError;const e=Object.entries,s=Array.isArray,r=(t,...n)=>n.length?n.reduce(((t,n)=>(e(n).forEach((([e,n])=>{n&&"object"==typeof n&&t[e]?s(t[e])&&s(n)?t[e]=[...t[e],...n]:r(t[e],n||{}):t[e]=n})),t)),t):t,n={def:.75,c:.05,s:.65,m:.75,l:.85,n:.9},i={mode:"a",prefix:"f"},a=t=>Number((.1*184+.9*t).toFixed(2)),c={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:a(142),inf:a(264),war:a(109),dan:a(29)}},o={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:n,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:n},dark:{l:{def:.4,n:.25,s:.3,m:.4,l:.5,c:.95}}},palette:c,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}},l=(t,e,s)=>Object.entries(t).reduce(e,s),u=Symbol("noParse"),h=(t,e,s)=>{var r,n,i;let a=""+t;return null==e?"":"object"!=typeof e||e.hasOwnProperty(u)?`${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+`{${l(e,((t,e)=>t+h(...e,a)),"")}}`;var c},g="@media",m="@container",p="@property",d="@keyframes",b="@layer",f="@scope",x="@supports",y="@starting-style",v=(t,e)=>{const s=g+` ${e||""}${e?" and ":""}(${t})`;return{s:s,q:t,t:e,toString:()=>s}};v.toString=()=>g;const $=t=>`(${t})`,j=t=>"string"==typeof t;function O(t){var e;if(!(null===(e=null==t?void 0:t.args)||void 0===e?void 0:e.length))return"";switch(t.key){case"or":return t.args.map((t=>j(t)?$(t):O(t))).join(" or ");case"and":return t.args.map((t=>{const e=!j(t);return e&&"or"===t.key?$(O(t)):e?O(t):$(t)})).join(" and ");case"not":const e=t.args[0];return"not "+(j(e)?$(e):$(O(e)))}}const k=(t,e)=>{let s="";return t.length&&(s=t.join(" ")),e&&(s=s+(s?" and ":"")+(s&&"or"===e.key?$(O(e)):O(e))),s},_=(t={})=>{const{type:e=[],state:s}=t;return Object.defineProperties((t=>{const r=k(e,s);return{[`${g}${r?" "+r:""}`]:t}}),{key:{value:null==s?void 0:s.key},args:{value:null==s?void 0:s.args},all:{get:()=>_({state:s,type:["all"]})},print:{get:()=>_({state:s,type:["print"]})},screen:{get:()=>_({state:s,type:["screen"]})},and:{value:(...t)=>_({type:e,state:{key:"and",args:s?[s,...t]:t}})},or:{value:(...t)=>_({type:e,state:{key:"or",args:s?[s,...t]:t}})},not:{get:()=>_(s?{type:e,state:j(s)||"not"!==(null==s?void 0:s.key)?{key:"not",args:[s]}:s.args[0]}:{type:2===e.length?[e[1]]:["not",e[0]||"all"],state:s})}})},w=t=>{const{root:e="",limit:s="",mode:r=[!1,!1]}=t;return Object.defineProperties((t=>({[f+` ${e?`(${e}${r[0]?" > *":""})`:""}${e&&s?" ":""}${s?`to (${s}${r[1]?" > *":""})`:""}`]:t})),{limit:{value:t=>w({root:e,limit:t,mode:r})},root:{value:t=>w({root:t,limit:s,mode:r})},both:{value:()=>w({root:e,limit:s,mode:[!1,!0]})},none:{value:()=>w({root:e,limit:s,mode:[!0,!1]})},low:{value:()=>w({root:e,limit:s,mode:[!0,!0]})},high:{value:()=>w({root:e,limit:s,mode:[!1,!1]})},toString:{value:()=>":scope"}})},S=t=>({[y]:t}),q=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=m+` ${n?n+" ":""}(${s})`;return{c:n,q:s,s:i,toString:()=>i}};s.toString=()=>m;const r=(s={})=>{const{scroll:n,type:i,name:a,state:c}=s;return Object.defineProperties((t=>{const e=k([],c);return{[`${m}${a?" "+a:""}${e?" "+e:""}`]:t}}),{container:{value:(a||"none")+" / "+(i&&n?`${i} scroll-state`:n?"scroll-state":i||"normal"),enumerable:!0},key:{value:null==c?void 0:c.key},args:{value:null==c?void 0:c.args},named:{get:()=>r({scroll:n,state:c,name:a||t.name("cq",e.cq++),type:i})},size:{get:()=>r({name:a,scroll:n,state:c,type:"size"})},isize:{get:()=>r({name:a,scroll:n,state:c,type:"inline-size"})},scroll:{get:()=>r({name:a,scroll:!0,state:c,type:i})},and:{value:(...t)=>r({name:a,scroll:n,type:i,state:{key:"and",args:c?[c,...t]:t}})},or:{value:(...t)=>r({name:a,scroll:n,type:i,state:{key:"or",args:c?[c,...t]:t}})},not:{value:t=>r({name:a,scroll:n,type:i,state:{key:"not",args:[t]}})},[u]:{value:!0}})},n=(s,r)=>{const n="--"+(s||t.name("cp",e.cp++)),i=p+" "+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}};n.toString=()=>p;const i=s=>{const r=s||t.name("kf",e.kf++),n=d+" "+r;return{k:r,s:n,toString:()=>n}};i.toString=()=>d;const a=s=>{const r=s||t.name("lay",e.lay++),n=b+" "+r;return{k:r,s:n,toString:()=>n}};a.toString=()=>b;a.toString=()=>f;const c=(t="",e=!1)=>{const s=x+` ${e?"not ":""}(${t})`;return{c:t,n:e,s:s,toString:()=>s}};return c.toString=()=>x,{pr:n,kf:i,mq:v,cq:s,lay:a,sc:(t="",e="")=>{const s=f+` ${t?`(${t})`:""}${t&&e?" ":""}${e?`to (${e})`:""}`;return{r:t,l:e,s:s,toString:()=>s}},sup:c,keyframes:s=>{const r=t.name("kf",e.kf++),n=d+" "+r;return Object.defineProperties((t=>{if(!t)return{animationName:r};const{dur:e,tf:s,del:n,ic:i,dir:a,ps:c,fm:o}=t;return{animation:[e,s,n,i,a,c,o,r].filter(Boolean).join(" ")}}),{[n]:{value:s,enumerable:!0},toString:{value:()=>r},[u]:{value:!0}})},property:(s={})=>{const{syn:r='"*"',inh:n=!0,ini:i,def:a}=s,c="--"+t.name("cp",e.cp++),o=`var(${c}${void 0!==a?","+a:""})`,l=p+" "+c;return Object.defineProperties((t=>({[c]:t})),{[l]:{value:{syntax:r,inherits:n,initialValue:i},enumerable:!0},toString:{value:()=>o},[u]:{value:!0}})},scope:w({}),media:_({}),container:r({}),startingStyle:S}},A=t=>t+"px",E=t=>t+"vh",P=t=>t+"vw",z=t=>t+"vmin",C=t=>t+"vmax",M=t=>t+"em",N=t=>t+"rem",W=t=>t+"deg",I=t=>t+"rad",K=t=>t+"rad",T=t=>t+"ms",B=t=>t+"s",D=t=>t+"%",J=t=>t+"cqw",L=t=>t+"cqh",R=t=>t+"cqi",V=t=>t+"cqb",F=t=>t+"cqmin",H=t=>t+"cqmax",Z=Object.fromEntries,G=Object.entries,Q=":first-",U=":last-",X=":only-",Y="child",tt=":nth-",et="of-type",st=tt+Y,rt=":focus",nt={r:":root",h:":hover",f:rt,fv:rt+"-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+Y,lc:U+Y,oc:X+Y,odd:st+"(odd)",even:st+"(even)",ft:Q+et,lt:U+et,ot:X+et,bef:"::before",aft:"::after",bd:"::backdrop"},it={has:":has",not:":not",is:":is",wh:":where",st:":state",nthc:st,ntho:tt+et,dir:":dir",lang:":lang"},at="oklch",ct=t=>at+`(${t})`,ot=t=>ct(`from ${t}`),lt="def",ut=t=>{const e=(e,s)=>"string"==typeof s?t(e,s):s;class s{constructor(t={}){this.state={l:e("l",lt),c:e("c",lt),h:e("h",lt),a:e("a",lt)},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 ct(`${t} ${e} ${s} / ${r}`)}}return t=>new s(t)},ht=(t,e=.1)=>ot(`${t} calc(l + ${e}) c h / alpha)`),gt=(t,e=.1)=>ot(`${t} calc(l - ${e}) c h / alpha)`),mt=(t,e=.1)=>ot(`${t} l c h / calc(alpha + ${e}))`),pt=(t,e=.1)=>ot(`${t} l c h / calc(alpha - ${e}))`),dt=(t,e=.04)=>ot(`${t} l calc(c + ${e}) h / alpha)`),bt=(t,e=.04)=>ot(`${t} l calc(c - ${e}) h / alpha)`),ft=(t,e=30)=>ot(`${t} l c calc(h${"number"==typeof e?e>0?" + "+e:" - "+-e:e}) / alpha)`),xt=({base:t,mixin:e,method:s,bpart:r,mpart:n})=>`color-mix(in ${s||at}, ${t}${void 0!==r?` ${r}%`:""}, ${e}${void 0!==n?` ${n}%`:""})`,yt=t=>({create:ut(t),oklch:ct,lighten:ht,darken:gt,saturate:dt,desaturate:bt,fadein:mt,fadeout:pt,spin:ft,mix:xt}),vt="palette",$t=t=>{class e{constructor(t={}){this.state={l:"l",c:"base",h:"pri",a:1,m:"bg"},Object.assign(this,{[u]:!0}),this.state=Object.assign(this.state,t)}get xs(){return new e(Object.assign(Object.assign({},this.state),{l:"xs"}))}get s(){return new e(Object.assign(Object.assign({},this.state),{l:"s"}))}get m(){return new e(Object.assign(Object.assign({},this.state),{l:"m"}))}get l(){return new e(Object.assign(Object.assign({},this.state),{l:"l"}))}get xl(){return new e(Object.assign(Object.assign({},this.state),{l:"xl"}))}get lightness(){return{xs:this.xs,s:this.s,m:this.m,l:this.l,xl:this.xl}}get gray(){return new e(Object.assign(Object.assign({},this.state),{c:"gray"}))}get pale(){return new e(Object.assign(Object.assign({},this.state),{c:"pale"}))}get base(){return new e(Object.assign(Object.assign({},this.state),{c:"base"}))}get rich(){return new e(Object.assign(Object.assign({},this.state),{c:"rich"}))}get chroma(){return{gray:this.gray,pale:this.pale,base:this.base,rich:this.rich}}get pri(){return new e(Object.assign(Object.assign({},this.state),{h:"pri"}))}get sec(){return new e(Object.assign(Object.assign({},this.state),{h:"sec"}))}get suc(){return new e(Object.assign(Object.assign({},this.state),{h:"suc"}))}get inf(){return new e(Object.assign(Object.assign({},this.state),{h:"inf"}))}get war(){return new e(Object.assign(Object.assign({},this.state),{h:"war"}))}get dan(){return new e(Object.assign(Object.assign({},this.state),{h:"dan"}))}get hue(){return{pri:this.pri,sec:this.sec,suc:this.suc,inf:this.inf,war:this.war,dan:this.dan}}alpha(t=1){return new e(Object.assign(Object.assign({},this.state),{a:t}))}get bg(){return new e(Object.assign(Object.assign({},this.state),{m:"bg"}))}get fg(){return new e(Object.assign(Object.assign({},this.state),{m:"fg"}))}toString(){const{l:e,c:s,h:r,a:n,m:i}=this.state;return`oklch(${t(vt,"l",i,e)} ${t(vt,"c",i,s)} ${t(vt,"h",r)} / ${n})`}}return new e},jt="coef",Ot=t=>{class e{constructor(t={}){this.state={center:8},this.state=Object.assign(this.state,t)}get min(){return t(jt,this.state.center-4)}get xxs(){return t(jt,this.state.center-3)}get xs(){return t(jt,this.state.center-2)}get s(){return t(jt,this.state.center-1)}get m(){return t(jt,this.state.center)}get l(){return t(jt,this.state.center+1)}get xl(){return t(jt,this.state.center+2)}get xxl(){return t(jt,this.state.center+3)}get max(){return t(jt,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},kt=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])=>kt(t,e(s+1))),{}),each:(t,e)=>_t(t).reduce(((t,[s,r])=>kt(t,e(s,r))),{}),when:(t,e,s={})=>t?e:s},St="width: ",qt=t=>{const{scope:e,globalKey:s="",bp:n={}}=t,i=e(s).varExp,a=t=>i(...t.split(".")),c=(t=1)=>`calc(${t} * ${a("rtime")})`,o=(t=1)=>`calc(${t} * ${a("rangle")})`,u=(t=1)=>`calc(${t} * 1rem)`;return{compile:({key:t,maker:s})=>{const g=e(t),m=q(g),p=t=>{const e=n[t]||t;return"number"==typeof e?e+"rem":""},d=t=>"min-"+St+p(t),b=t=>"max-"+St+p(t),f=(t,e)=>"string"==typeof e?m.cq(t,e):m.mq(t),x=(t,e,s)=>""+f(d(t)+") and ("+b(e),s),y={up:(t,e)=>""+f(d(t),e),down:(t,e)=>""+f(b(t),e),between:x,only:(t,e)=>x(t,t,e)};return v=s(Object.assign(wt,{key:t,vars:a,size:u,time:c,angle:o,bem:g.selector,pseudo:Object.assign(Z(G(nt).map((([t,e])=>{function s(t=""){return t+e}return s.toString=()=>e,[t,s]}))),Z(G(it).map((([t,e])=>{function s(t,s=""){return s+e+`(${t})`}return s.toString=()=>e,[t,s]})))),color:yt(i),palette:$t(i),coef:Ot(i),units:{px:A,vh:E,vw:P,vmin:z,vmax:C,em:M,rem:N,deg:W,rad:I,turn:K,ms:T,s:B,pc:D,cqw:J,cqh:L,cqb:V,cqi:R,cqmin:F,cqmax:H},at:m,limit:y,merge:r})),l(v,((t,e)=>t+h(...e)),"");var v}}};const 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 Object.entries(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=({prefix:t=i.prefix})=>{let e=1;return{get base(){return t+0},get current(){return t+e},next(){return e++,this.current},reset(){e=1}}},Pt=void 0,zt=Object.entries,Ct=Object.defineProperties,Mt=t=>"string"==typeof t,Nt=t=>null!==t&&"object"==typeof t,Wt=t=>t.split("."),It=(t,e)=>zt(t).reduce(((t,[s,r])=>{if(Nt(r)){const n=zt(r);n.length?t.push(...n.reduce(((t,[r,n])=>{if((t=>null!==t&&t!==Pt)(r)&&e&&t.push([s,r,Pt,Pt]),Nt(n)){const e=zt(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,Pt,Pt,Pt])}return t}),[]),Kt=(t,e,s,r)=>""+(((t,e)=>`${t||""}${e?"__"+e:""}`)(t,e)+(s?"_"+s:"")+(s&&r?"_"+r:""))||"_",Tt=(t,e)=>"."+(e?t+(e.startsWith("_")?"":"-")+e:t),Bt=(t,e)=>`[data-${t}${e?`~="${e}"`:""}]`;const Dt=t=>t||"",Jt=(t={})=>{const{mode:e,min:s}=t;let r,n;return r="a"===e?Bt:Tt,s&&(n={}),t=>{let s=0,i=Dt,a=Dt;n&&(n[t]||(n[t]={}),i=e=>{var r;return null!==(r=n[t][e])&&void 0!==r?r:n[t][e]=(s++).toString(36)},a=e=>n[t][e]);let c=(...e)=>[t,...e].filter(Boolean).join("-"),o="class",l=e=>e?t+(e.startsWith("_")?"":"-")+e:void 0===e?void 0:t;"a"===e&&(o="data-"+t,l=Dt);const u=(...t)=>"--"+c(...t),h=t=>{if(void 0===t)return function(t){const e=({b:s,e:r,m:n})=>({b:t=>e({b:t,e:"",m:{}}),e:t=>e({b:s,e:t,m:{}}),m:(t={})=>e({b:s,e:r,m:t}),get $(){return t({[s]:{[r]:n}})}});return e({b:"",e:"",m:{}})}(h);let e,s,r,n,i="";const c=Mt(t);return i=c||Array.isArray(t)?[...(c?[t]:t).reduce(((t,i)=>([e,s,r,n]=Wt(i),t.add(l(a(Kt(e,s)))),r&&t.add(l(a(Kt(e,s,r,n)))),t)),new Set).values()].join(" "):t&&It(t,!0).map((([t,e,s,r])=>l(a(Kt(t,e,s,r))))).join(" "),Ct({[o]:i},{toString:{value:()=>`${o}="${i}"`},$:{value:i}})};return{selector:e=>{let s,n,a,c;return Mt(e)?([s,n,a,c]=Wt(e),r(t,i(Kt(s,n,a,c)))):e&&It(e).map((([e,s,n,a])=>r(t,i(Kt(e,s,n,a))))).join(",")},attr:h,name:c,varName:u,varExp:(...t)=>`var(${u(...t)})`}}},Lt="effcss-provider",Rt="theme",Vt="size",Ft="time",Ht="angle",Zt="palette",Gt=Object.assign,Qt=Object.entries,Ut=Object.fromEntries,Xt=(t,e)=>t.getAttribute(e)||i[e],Yt=(t,e)=>(t=>null!==t?Number(t):null)(Xt(t,e)),te=(t,e,s)=>null===s?t.removeAttribute(e):t.setAttribute(e,s+""),ee=t=>`:root:has(script[is=${Lt}]${t?`[${t}]`:""})`,se=t=>[t.xxs,t.xs,t.s,t.m,t.l,t.xl,t.xxl],re=["xs","s","m","l","xl"],ne=["pale","base","rich"],ie=({scope:e,keyMaker:s,provider:r})=>{const n=r.settings,i=null==n?void 0:n.vars,{varName:a}=e(s.base),c=t=>a("",t);function o(t,e){return Qt(t).reduce(((t,[s,r])=>r&&"object"==typeof r?Gt(t,o(r,[...e,s])):(t[a(...e,s)]=r,t)),{})}const l=Ut(Qt(i||{}).map((([t,e])=>[t,o(e,[])]))),{"":u={},dark:h,light:g}=l,m=t(l,["","dark","light"]),p=r.size,d=r.time,b=r.angle,{l:f,c:x,h:y}=n.palette,v=n.coef,$=[0,...se(v.$0_),1,...se(v.$1_),2,...se(v.$2_),16,...se(v.$16_),v.max];return({bem:t,each:e,when:s,vars:r,merge:n,at:{media:i},units:{px:o,ms:h,deg:g}})=>{const v="prefers-color-scheme",j={light:`${v}: light`,dark:`${v}: dark`};return n({[ee()]:n({fontSize:r("rem")},u,e($,((t,e)=>({[a("coef",t)]:e}))),e(y,((t,e)=>({[a(Zt,"h",t)]:e}))),{[a(Zt,"c","bg","gray")]:0,[a(Zt,"c","fg","gray")]:0},e(j,((t,s)=>i.and(s)(n(l[t]||{},e(re,((e,s)=>({[a(Zt,"l","bg",s)]:f[t].bg[s],[a(Zt,"l","fg",s)]:f[t].fg[s]}))),e(ne,((e,s)=>({[a(Zt,"c","bg",s)]:x[t].bg[s],[a(Zt,"c","fg",s)]:x[t].fg[s]}))))))))},e(m,((e,s)=>({[ee(`${Rt}=${e}`)]:s,[t(`..theme.${e}`)]:s}))),s(!!p,{[ee(Vt)]:{[c("rem")]:o(p)}}),s(!!d,{[ee(Ft)]:{[c("rtime")]:h(d)}}),s(!!b,{[ee(Ht)]:{[c("rangle")]:g(b)}}))}},ae=({scope:t,keyMaker:e,collector:s,manager:r,processor:n})=>{const i=t=>"string"==typeof t?t:s.getKey(t),a=s=>t(s||e.base).attr,c=(t,e)=>n.compile({key:e,maker:t}),o=(t,n,i)=>{const o=n||e.current;let l=s.use(t,o);return(i||r&&!r.has(l))&&(r.pack(l,c(t,l)),n||e.next()),a(l)};return{key:i,resolve:a,use:o,usePublic:t=>Ut(Qt(t).map((([t,e])=>[t,o(e,t)]))),usePrivate:t=>t.map((t=>o(t))),css:c,status:t=>{const e=i(t);return!!e&&r.status(e)},on:(...t)=>r.on(...t.map(i)),off:(...t)=>r.off(...t.map(i)),stylesheets:(...t)=>{let e;return e=t.length?1===t.length&&Array.isArray(t[0])?t[0]:t:s.keys,e.map((t=>r.get(i(t))))}}},ce=t=>Object.defineProperties(t,{prefix:{get:()=>t.getAttribute("prefix")||"f"},mode:{get:()=>t.getAttribute("mode")||"a"},min:{get:()=>""===t.getAttribute("min")},hydrate:{get:()=>""===t.getAttribute("hydrate")},theme:{set(e){te(t,Rt,e)},get:()=>Xt(t,Rt)||""},size:{set(e){te(t,Vt,e)},get:()=>Yt(t,Vt)},time:{set(e){te(t,Ft,e)},get:()=>Yt(t,Ft)},angle:{set(e){te(t,Ht,e)},get:()=>Yt(t,Ht)}});function oe(t={}){const e=globalThis.document,s=globalThis.customElements;if(null==s?void 0:s.get(Lt))return!1;{class n extends HTMLScriptElement{constructor(){super(...arguments),this._c=At(),this._settings=o,this._cust=()=>{this._=ie({scope:this._s,keyMaker:this._k,provider:this}),this.use(this._,this._k.base,!0)}}static get observedAttributes(){return[Vt,Ft,Ht]}get settings(){return this._settings}set settings(t){var e,s,n;const i=r({},this._settings,t),{makers:a,bp:c,off:o}=i;(c&&(null===(e=this._settings)||void 0===e?void 0:e.bp)!==c||!this._p)&&(this._p=qt({scope:this._s,globalKey:this._k.base,bp:c})),a&&(null===(s=this._settings)||void 0===s?void 0:s.makers)!==a&&(this._c.useMany(a),this.usePublic(a),(null==o?void 0:o.length)&&this._settings.off!==o&&this.off(...o)),this._settings=i,(!(null===(n=this._m)||void 0===n?void 0:n.has(this._k.base))||t.vars||t.palette||t.coef)&&this._cust()}get makers(){return this._c.makers}attributeChangedCallback(){this._k&&this._cust()}connectedCallback(){this.textContent?this._settings=r(this._settings,JSON.parse(this.textContent)):t&&(this._settings=r(this._settings,t)),ce(this),this._k=Et({prefix:this.prefix}),this._s=Jt({mode:this.mode,min:this.min}),this._p=qt({scope:this._s,globalKey:this._k.base,bp:t.bp||this.settings.bp}),this._m=function(t){const e={};null==t||t.forEach((t=>{const s=t.dataset.effcss;s&&(e[s]=t)}));let s={},r={},n=[],i=[];const a=(t,e)=>(e.toString=()=>"effcss-"+t,e),c=t=>{var e;return t.adoptedStyleSheets=[...(null===(e=t.adoptedStyleSheets)||void 0===e?void 0:e.length)?[...t.adoptedStyleSheets].filter((t=>!(t+"").startsWith("effcss-"))):[],...n]},o=()=>{i=i.reduce(((t,e)=>{const s=e.deref();return s&&(c(s),t.push(e)),t}),[])},l=t=>n.findIndex((e=>e===t)),u=t=>t?s[t]:void 0,h=(t,r)=>{if(!s[t]){s[t]=a(t,r),n.push(s[t]);const i=e[t];return i&&(i.disabled=!0),o(),!0}},g=t=>{const e=u(t);return!!e&&-1!==l(e)};return{apply:c,notify:o,getIndex:l,get:u,has:t=>!!t&&!!u(t),getAll:()=>s,add:h,status:g,on:(...t)=>{const e=t.reduce(((t,e)=>{const s=u(e);return!(!s||g(e))&&(n.push(s),t)}),!0);return o(),e},off:(...t)=>{const e=t.reduce(((t,e)=>{const s=u(e);if(s&&g(e)){const e=l(s);return n.splice(e,1),t}return!1}),!0);return o(),e},remove:t=>{const e=u(t);if(!e)return;const i=l(e);return i>-1&&(n.splice(i,1),delete s[t],delete r[t]),o(),!0},removeAll:()=>(n.splice(0),s={},r={},o(),!0),pack:(t,e)=>{let r=s[t]||new CSSStyleSheet;return r.replaceSync(e),r=a(t,r),!!r.cssRules.length&&h(t,r)},replace:(t,e)=>{const r=s[t];if(r)return r.replaceSync(e),o(),!0},register:t=>{i.findIndex((e=>e.deref()===t))>=0||(i.push(new WeakRef(t)),c(t))},unregister:t=>{const e=i.findIndex((e=>e.deref()===t));e>=0&&i.splice(e,1)}}}(e.querySelectorAll("[data-effcss]"));const s=ae({scope:this._s,processor:this._p,keyMaker:this._k,manager:this._m,collector:this._c});Object.assign(this,s),this._cust();const n=this;this._n={set adoptedStyleSheets(t){n.dispatchEvent(new CustomEvent("effcsschanges",{detail:{styles:t},bubbles:!0}))}},this._m.register(this._n),this._m.register(e)}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(Lt,n,{extends:"script"}),!0}}const le=(e={})=>{let{noscript:s,attrs:n={}}=e,a=t(e,["noscript","attrs"]);const c=r(o,a);let{mode:l=i.mode,min:u,prefix:h=i.prefix,theme:g,hydrate:m,size:p,time:d,angle:b}=n;const f=Et({prefix:h}),x=Jt({mode:l,min:u}),y=qt({scope:x,globalKey:f.base,bp:c.bp}),v=At(),$={},j=[],O=t=>j.findIndex((e=>e===t)),k=ae({scope:x,processor:y,keyMaker:f,manager:{get:t=>t?$[t]:void 0,pack(t,e){const s=$[t]||{};if(!$[t])return $[t]=s,j.push(s),!0},has(t){return!!t&&!!this.get(t)},status(t){const e=this.get(t);return!!e&&-1!==O(e)},on(...t){return t.reduce(((t,e)=>{const s=this.get(e);return!(!s||this.status(e))&&(j.push(s),t)}),!0)},off(...t){return t.reduce(((t,e)=>{const s=this.get(e);if(s&&this.status(e)){const e=O(s);return j.splice(e,1),t}return!1}),!0)}},collector:v}),_=Object.assign(Object.assign({tagName:"",attributes:{prefix:h,mode:l,hydrate:m,min:u,theme:g,size:p,time:d,angle:b},getAttribute(t){const e=this.attributes[t];return e?"boolean"==typeof e?"":e:null},setAttribute(t,e){this.attributes[t]=e},removeAttribute(t){delete this.attributes[t]},get makers(){return v.makers},get settings(){return c},set settings(t){}},k),{toString(){const t=[[f.base,ie({scope:x,keyMaker:f,provider:this})],...Object.entries(v.makers)].map((([t,e])=>`<style data-effcss="${t}">${k.css(e,t)}</style>`)).join("");if(s)return t;const e=Object.keys(a).length?JSON.stringify(a):"";return t+`<script ${Object.entries(Object.assign({is:Lt,type:"application/json"},this.attributes)).map((([t,e])=>e&&e!==i[t]?"boolean"==typeof e?t:`${t}="${e}"`:"")).filter(Boolean).join(" ")}>${e}<\/script>`}});return ce(_)},ue=(e={})=>{const{emulate:s}=e,r=t(e,["emulate"]),n=null===globalThis||void 0===globalThis?void 0:globalThis.document;if(n&&!s){void 0===ue.isDefined&&(ue.isDefined=oe(r));const t=n.querySelector(`script[is=${Lt}]`);if(t)return t;const e=n.createElement("script",{is:Lt});e.setAttribute("is",Lt);const s=null==r?void 0:r.attrs;return s&&Object.entries(s).map((([t,s])=>s&&i[t]!==s&&e.setAttribute(t,"boolean"==typeof s?"":s+""))),n.head.appendChild(e),e}return le(r)};export{Lt as TAG_NAME,oe as defineProvider,ue as useStyleProvider};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TCreateScope } from '
|
|
1
|
+
import type { TCreateScope } from '../scope';
|
|
2
2
|
type TProperty = {
|
|
3
3
|
(val: string | number | boolean): object;
|
|
4
4
|
};
|
|
@@ -126,7 +126,7 @@ export declare const resolveAtRules: (ctx: ReturnType<ReturnType<TCreateScope>>)
|
|
|
126
126
|
/**
|
|
127
127
|
* `@property` selector
|
|
128
128
|
* @param name - property name
|
|
129
|
-
* @deprecated It will be deleted in
|
|
129
|
+
* @deprecated It will be deleted in v4, use `property` instead
|
|
130
130
|
*/
|
|
131
131
|
pr: {
|
|
132
132
|
(n?: string | number, p?: {
|
|
@@ -161,7 +161,7 @@ export declare const resolveAtRules: (ctx: ReturnType<ReturnType<TCreateScope>>)
|
|
|
161
161
|
/**
|
|
162
162
|
* `@keyframes` selector
|
|
163
163
|
* @param name - keyframes name
|
|
164
|
-
* @deprecated It will be deleted in
|
|
164
|
+
* @deprecated It will be deleted in v4, use `keyframes` instead
|
|
165
165
|
*/
|
|
166
166
|
kf: {
|
|
167
167
|
(name?: string): {
|
|
@@ -179,7 +179,7 @@ export declare const resolveAtRules: (ctx: ReturnType<ReturnType<TCreateScope>>)
|
|
|
179
179
|
};
|
|
180
180
|
/**
|
|
181
181
|
* `@media` selector
|
|
182
|
-
* @deprecated It will be deleted in
|
|
182
|
+
* @deprecated It will be deleted in v4, use `media` instead
|
|
183
183
|
*/
|
|
184
184
|
mq: {
|
|
185
185
|
(q: string, t?: string): {
|
|
@@ -192,7 +192,7 @@ export declare const resolveAtRules: (ctx: ReturnType<ReturnType<TCreateScope>>)
|
|
|
192
192
|
};
|
|
193
193
|
/**
|
|
194
194
|
* `@container` selector
|
|
195
|
-
* @deprecated It will be deleted in
|
|
195
|
+
* @deprecated It will be deleted in v4, use `container` instead
|
|
196
196
|
*/
|
|
197
197
|
cq: {
|
|
198
198
|
(q: string, c?: string): {
|
|
@@ -233,7 +233,7 @@ export declare const resolveAtRules: (ctx: ReturnType<ReturnType<TCreateScope>>)
|
|
|
233
233
|
* `@scope` selector
|
|
234
234
|
* @param r - root
|
|
235
235
|
* @param l - limit
|
|
236
|
-
* @deprecated It will be deleted in
|
|
236
|
+
* @deprecated It will be deleted in v4, use `scope` instead
|
|
237
237
|
*/
|
|
238
238
|
sc: (r?: string, l?: string) => {
|
|
239
239
|
/**
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create stylesheet maker collector
|
|
3
|
+
* @param params - collector params
|
|
4
|
+
*/
|
|
5
|
+
export declare const createCollector: () => {
|
|
6
|
+
/**
|
|
7
|
+
* Collect maker
|
|
8
|
+
* @param maker - stylesheet maker
|
|
9
|
+
* @param key - stylesheet key
|
|
10
|
+
*/
|
|
11
|
+
use(maker: Function, key: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Collect makers
|
|
14
|
+
* @param makers - stylesheet makers dict
|
|
15
|
+
*/
|
|
16
|
+
useMany(makers: Record<string, Function>): string[];
|
|
17
|
+
/**
|
|
18
|
+
* Get key of collected maker
|
|
19
|
+
* @param maker - stylesheet maker
|
|
20
|
+
*/
|
|
21
|
+
getKey(maker: Function): string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Get all collected keys
|
|
24
|
+
*/
|
|
25
|
+
keys: string[];
|
|
26
|
+
/**
|
|
27
|
+
* Get all collected makers
|
|
28
|
+
*/
|
|
29
|
+
makers: Record<string, Function>;
|
|
30
|
+
};
|
|
@@ -96,5 +96,5 @@ interface IStyleManager {
|
|
|
96
96
|
* @param params - manager params
|
|
97
97
|
* @returns IStyleManager
|
|
98
98
|
*/
|
|
99
|
-
export declare function createManager(): IStyleManager;
|
|
99
|
+
export declare function createManager(initStyles?: NodeListOf<HTMLStyleElement>): IStyleManager;
|
|
100
100
|
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create stylesheet key maker
|
|
3
|
+
* @param params - collector params
|
|
4
|
+
*/
|
|
5
|
+
export declare const createKeyMaker: ({ prefix }: {
|
|
6
|
+
prefix: string;
|
|
7
|
+
}) => {
|
|
8
|
+
/**
|
|
9
|
+
* Base stylesheet key
|
|
10
|
+
*/
|
|
11
|
+
base: string;
|
|
12
|
+
/**
|
|
13
|
+
* Current stylesheet key
|
|
14
|
+
*/
|
|
15
|
+
current: string;
|
|
16
|
+
/**
|
|
17
|
+
* Create next key
|
|
18
|
+
*/
|
|
19
|
+
next(): string;
|
|
20
|
+
/**
|
|
21
|
+
* Reset current key
|
|
22
|
+
*/
|
|
23
|
+
reset(): void;
|
|
24
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { TDeafultBreakpoints
|
|
1
|
+
import type { TDeafultBreakpoints } from '../common';
|
|
2
|
+
import type { TCreateScope } from './scope';
|
|
2
3
|
import { merge } from '../common';
|
|
3
4
|
import { resolveAtRules } from './_process/atrules';
|
|
4
5
|
import { resolveUnits } from './_process/units';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
type Paths<T> = T extends object ? {
|
|
2
|
+
[K in keyof T]: `${Exclude<K, symbol>}${'' | Paths<T[K]> extends '' ? '' : `.${Paths<T[K]>}`}`;
|
|
3
|
+
}[keyof T] : T extends string ? T : never;
|
|
4
|
+
type TDeepPartial<T> = T extends object ? {
|
|
5
|
+
[P in keyof T]?: TDeepPartial<T[P]>;
|
|
6
|
+
} : T;
|
|
7
|
+
type TBlocks<T> = Exclude<keyof T, symbol | number>;
|
|
8
|
+
type TElems<T> = T extends object ? {
|
|
9
|
+
[K in keyof T]: `${Exclude<K, symbol>}${T[K] extends object ? `.${Exclude<keyof T[K], symbol | ''>}` : never}`;
|
|
10
|
+
}[keyof T] : never;
|
|
11
|
+
type TMods<T> = T extends object ? {
|
|
12
|
+
[K in keyof T]: `${Exclude<K, symbol>}${'' | Paths<T[K]> extends '' ? '' : `.${Paths<T[K]>}`}`;
|
|
13
|
+
}[keyof T] : T extends string ? T : never;
|
|
14
|
+
type TStringBEM<T> = TBlocks<T> | TMods<T> | TElems<T>;
|
|
15
|
+
type TBEM<T> = TDeepPartial<T> | TStringBEM<T> | TStringBEM<T>[];
|
|
16
|
+
type TStyleSheet = Record<string, Record<string, Record<string, string | number>>>;
|
|
17
|
+
export type TMonoResolver<T extends TStyleSheet, B extends keyof T, E extends keyof T[B]> = {
|
|
18
|
+
/**
|
|
19
|
+
* Specify block
|
|
20
|
+
* @param val - block name
|
|
21
|
+
*/
|
|
22
|
+
b<BL extends Exclude<keyof T, Symbol | number>>(val: BL): TMonoResolver<T, BL, ''>;
|
|
23
|
+
/**
|
|
24
|
+
* Specify element
|
|
25
|
+
* @param val - element name
|
|
26
|
+
*/
|
|
27
|
+
e<EL extends Exclude<keyof T[B], Symbol | number>>(val: EL): TMonoResolver<T, B, EL>;
|
|
28
|
+
/**
|
|
29
|
+
* Specify modifiers
|
|
30
|
+
* @param val - modifiers object
|
|
31
|
+
*/
|
|
32
|
+
m(val?: Partial<T[B][E]>): TMonoResolver<T, B, E>;
|
|
33
|
+
/**
|
|
34
|
+
* Result style attributes
|
|
35
|
+
*/
|
|
36
|
+
get $(): {
|
|
37
|
+
[key in string]: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
type TResolveSelector = <T extends TStyleSheet>(params: TBEM<T>) => string;
|
|
41
|
+
type TResolveAttr = {
|
|
42
|
+
<T extends TStyleSheet>(params: TBEM<T>): Record<string, string>;
|
|
43
|
+
<T extends TStyleSheet>(): TMonoResolver<T, "", "">;
|
|
44
|
+
};
|
|
45
|
+
type TParts = (string | number)[];
|
|
46
|
+
type TScope = {
|
|
47
|
+
/**
|
|
48
|
+
* BEM selector resolver
|
|
49
|
+
*/
|
|
50
|
+
selector: TResolveSelector;
|
|
51
|
+
/**
|
|
52
|
+
* BEM attribute resolver
|
|
53
|
+
*/
|
|
54
|
+
attr: TResolveAttr;
|
|
55
|
+
/**
|
|
56
|
+
* Name resolver
|
|
57
|
+
*/
|
|
58
|
+
name: (...parts: TParts) => string;
|
|
59
|
+
/**
|
|
60
|
+
* Var name
|
|
61
|
+
*/
|
|
62
|
+
varName: (...parts: TParts) => string;
|
|
63
|
+
/**
|
|
64
|
+
* Var expression
|
|
65
|
+
*/
|
|
66
|
+
varExp: (...parts: TParts) => string;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Style scope resolver
|
|
70
|
+
*/
|
|
71
|
+
type TScopeResolver = (key: string) => TScope;
|
|
72
|
+
/**
|
|
73
|
+
* Create stylesheet scope
|
|
74
|
+
*/
|
|
75
|
+
export type TCreateScope = (params?: {
|
|
76
|
+
mode?: string | null;
|
|
77
|
+
min?: boolean;
|
|
78
|
+
}) => TScopeResolver;
|
|
79
|
+
/**
|
|
80
|
+
* Create BEM resolver
|
|
81
|
+
* @param params - BEM resolver params
|
|
82
|
+
*/
|
|
83
|
+
export declare const createScope: TCreateScope;
|
|
84
|
+
export {};
|
|
@@ -243,38 +243,79 @@ export type TProviderAttrs = {
|
|
|
243
243
|
/**
|
|
244
244
|
* Hydratation flag
|
|
245
245
|
*/
|
|
246
|
-
hydrate:
|
|
246
|
+
hydrate: '';
|
|
247
247
|
/**
|
|
248
248
|
* Private stylesheet prefix
|
|
249
249
|
*/
|
|
250
|
-
prefix: string
|
|
250
|
+
prefix: string;
|
|
251
|
+
/**
|
|
252
|
+
* BEM selector generation mode
|
|
253
|
+
* @description
|
|
254
|
+
* `a` - data-attributes
|
|
255
|
+
* `c` - classes
|
|
256
|
+
*/
|
|
257
|
+
mode: 'a' | 'c';
|
|
258
|
+
/**
|
|
259
|
+
* BEM selectors minification
|
|
260
|
+
*/
|
|
261
|
+
min: '';
|
|
262
|
+
/**
|
|
263
|
+
* Theme
|
|
264
|
+
*/
|
|
265
|
+
theme: string;
|
|
266
|
+
/**
|
|
267
|
+
* Root font size in px
|
|
268
|
+
*/
|
|
269
|
+
size: string;
|
|
270
|
+
/**
|
|
271
|
+
* Root time in ms
|
|
272
|
+
*/
|
|
273
|
+
time: string;
|
|
274
|
+
/**
|
|
275
|
+
* Root angle in deg
|
|
276
|
+
*/
|
|
277
|
+
angle: string;
|
|
278
|
+
};
|
|
279
|
+
/**
|
|
280
|
+
* Provider attributes
|
|
281
|
+
*/
|
|
282
|
+
export type TProviderAttrParams = {
|
|
283
|
+
/**
|
|
284
|
+
* Hydratation flag
|
|
285
|
+
* @deprecated The hydration now turns on automatically
|
|
286
|
+
*/
|
|
287
|
+
hydrate: boolean;
|
|
288
|
+
/**
|
|
289
|
+
* Private stylesheet prefix
|
|
290
|
+
*/
|
|
291
|
+
prefix: string;
|
|
251
292
|
/**
|
|
252
293
|
* BEM selector generation mode
|
|
253
294
|
* @description
|
|
254
295
|
* `a` - data-attributes
|
|
255
296
|
* `c` - classes
|
|
256
297
|
*/
|
|
257
|
-
mode: 'a' | 'c'
|
|
298
|
+
mode: 'a' | 'c';
|
|
258
299
|
/**
|
|
259
300
|
* BEM selectors minification
|
|
260
301
|
*/
|
|
261
|
-
min:
|
|
302
|
+
min: boolean;
|
|
262
303
|
/**
|
|
263
304
|
* Theme
|
|
264
305
|
*/
|
|
265
|
-
theme: string
|
|
306
|
+
theme: string;
|
|
266
307
|
/**
|
|
267
308
|
* Root font size in px
|
|
268
309
|
*/
|
|
269
|
-
size:
|
|
310
|
+
size: number;
|
|
270
311
|
/**
|
|
271
312
|
* Root time in ms
|
|
272
313
|
*/
|
|
273
|
-
time:
|
|
314
|
+
time: number;
|
|
274
315
|
/**
|
|
275
316
|
* Root angle in deg
|
|
276
317
|
*/
|
|
277
|
-
angle:
|
|
318
|
+
angle: number;
|
|
278
319
|
};
|
|
279
320
|
/**
|
|
280
321
|
* Provider settings
|
|
@@ -290,103 +331,25 @@ export type TProviderSettings = {
|
|
|
290
331
|
vars: Record<string, object>;
|
|
291
332
|
/**
|
|
292
333
|
* Stylesheet makers
|
|
334
|
+
* @deprecated The parameter will be deleted in v4. Use stylesheet makers via `Style Provider` methods
|
|
293
335
|
*/
|
|
294
336
|
makers: Record<string, Function>;
|
|
295
337
|
/**
|
|
296
338
|
* Switched off stylesheets
|
|
339
|
+
* @deprecated The parameter will be deleted in v4. Switch stylesheet makers via `Style Provider` methods
|
|
297
340
|
*/
|
|
298
341
|
off: string[];
|
|
299
342
|
/**
|
|
300
343
|
* Palette
|
|
301
344
|
*/
|
|
302
|
-
palette: TPaletteConfig
|
|
345
|
+
palette: RecursivePartial<TPaletteConfig>;
|
|
303
346
|
/**
|
|
304
347
|
* Coefficients
|
|
305
348
|
*/
|
|
306
|
-
coef: TCoefConfig
|
|
307
|
-
};
|
|
308
|
-
export type TProviderSettingsPartial = RecursivePartial<TProviderSettings>;
|
|
309
|
-
type Paths<T> = T extends object ? {
|
|
310
|
-
[K in keyof T]: `${Exclude<K, symbol>}${'' | Paths<T[K]> extends '' ? '' : `.${Paths<T[K]>}`}`;
|
|
311
|
-
}[keyof T] : T extends string ? T : never;
|
|
312
|
-
type TDeepPartial<T> = T extends object ? {
|
|
313
|
-
[P in keyof T]?: TDeepPartial<T[P]>;
|
|
314
|
-
} : T;
|
|
315
|
-
type TBlocks<T> = Exclude<keyof T, symbol | number>;
|
|
316
|
-
type TElems<T> = T extends object ? {
|
|
317
|
-
[K in keyof T]: `${Exclude<K, symbol>}${T[K] extends object ? `.${Exclude<keyof T[K], symbol | ''>}` : never}`;
|
|
318
|
-
}[keyof T] : never;
|
|
319
|
-
type TMods<T> = T extends object ? {
|
|
320
|
-
[K in keyof T]: `${Exclude<K, symbol>}${'' | Paths<T[K]> extends '' ? '' : `.${Paths<T[K]>}`}`;
|
|
321
|
-
}[keyof T] : T extends string ? T : never;
|
|
322
|
-
type TStringBEM<T> = TBlocks<T> | TMods<T> | TElems<T>;
|
|
323
|
-
type TBEM<T> = TDeepPartial<T> | TStringBEM<T> | TStringBEM<T>[];
|
|
324
|
-
type TStyleSheet = Record<string, Record<string, Record<string, string | number>>>;
|
|
325
|
-
export type TMonoResolver<T extends TStyleSheet, B extends keyof T, E extends keyof T[B]> = {
|
|
326
|
-
/**
|
|
327
|
-
* Specify block
|
|
328
|
-
* @param val - block name
|
|
329
|
-
*/
|
|
330
|
-
b<BL extends Exclude<keyof T, Symbol | number>>(val: BL): TMonoResolver<T, BL, ''>;
|
|
331
|
-
/**
|
|
332
|
-
* Specify element
|
|
333
|
-
* @param val - element name
|
|
334
|
-
*/
|
|
335
|
-
e<EL extends Exclude<keyof T[B], Symbol | number>>(val: EL): TMonoResolver<T, B, EL>;
|
|
336
|
-
/**
|
|
337
|
-
* Specify modifiers
|
|
338
|
-
* @param val - modifiers object
|
|
339
|
-
*/
|
|
340
|
-
m(val?: Partial<T[B][E]>): TMonoResolver<T, B, E>;
|
|
341
|
-
/**
|
|
342
|
-
* Result style attributes
|
|
343
|
-
*/
|
|
344
|
-
get $(): {
|
|
345
|
-
[key in string]: string;
|
|
346
|
-
};
|
|
347
|
-
};
|
|
348
|
-
type TResolveSelector = <T extends TStyleSheet>(params: TBEM<T>) => string;
|
|
349
|
-
type TResolveAttr = {
|
|
350
|
-
<T extends TStyleSheet>(params: TBEM<T>): Record<string, string>;
|
|
351
|
-
<T extends TStyleSheet>(): TMonoResolver<T, "", "">;
|
|
352
|
-
};
|
|
353
|
-
type TParts = (string | number)[];
|
|
354
|
-
type TScope = {
|
|
355
|
-
/**
|
|
356
|
-
* BEM selector resolver
|
|
357
|
-
*/
|
|
358
|
-
selector: TResolveSelector;
|
|
359
|
-
/**
|
|
360
|
-
* BEM attribute resolver
|
|
361
|
-
*/
|
|
362
|
-
attr: TResolveAttr;
|
|
363
|
-
/**
|
|
364
|
-
* Name resolver
|
|
365
|
-
*/
|
|
366
|
-
name: (...parts: TParts) => string;
|
|
367
|
-
/**
|
|
368
|
-
* Var name
|
|
369
|
-
*/
|
|
370
|
-
varName: (...parts: TParts) => string;
|
|
371
|
-
/**
|
|
372
|
-
* Var expression
|
|
373
|
-
*/
|
|
374
|
-
varExp: (...parts: TParts) => string;
|
|
349
|
+
coef: RecursivePartial<TCoefConfig>;
|
|
375
350
|
};
|
|
376
|
-
/**
|
|
377
|
-
* Style scope resolver
|
|
378
|
-
*/
|
|
379
|
-
type TScopeResolver = (key: string) => TScope;
|
|
380
|
-
/**
|
|
381
|
-
* Create stylesheet scope
|
|
382
|
-
*/
|
|
383
|
-
export type TCreateScope = (params?: {
|
|
384
|
-
mode?: string | null;
|
|
385
|
-
min?: boolean;
|
|
386
|
-
}) => TScopeResolver;
|
|
387
351
|
export declare const merge: (target: Record<string, any>, ...sources: Record<string, any>[]) => Record<string, any>;
|
|
388
|
-
export declare const
|
|
389
|
-
export declare const DEFAULT_ATTRS: TProviderAttrs;
|
|
352
|
+
export declare const DEFAULT_ATTRS: Record<string, string>;
|
|
390
353
|
export declare const DEFAULT_BREAKPOINTS: {
|
|
391
354
|
'3xs': number;
|
|
392
355
|
'2xs': number;
|
|
@@ -401,64 +364,162 @@ export type TDeafultBreakpoints = typeof DEFAULT_BREAKPOINTS;
|
|
|
401
364
|
/**
|
|
402
365
|
* Default provider settings
|
|
403
366
|
*/
|
|
404
|
-
export declare const DEFAULT_SETTINGS:
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
367
|
+
export declare const DEFAULT_SETTINGS: {
|
|
368
|
+
bp: {
|
|
369
|
+
'3xs': number;
|
|
370
|
+
'2xs': number;
|
|
371
|
+
xs: number;
|
|
372
|
+
sm: number;
|
|
373
|
+
md: number;
|
|
374
|
+
lg: number;
|
|
375
|
+
xl: number;
|
|
376
|
+
'2xl': number;
|
|
377
|
+
};
|
|
378
|
+
vars: {
|
|
379
|
+
'': {
|
|
380
|
+
/**
|
|
381
|
+
* Root time
|
|
382
|
+
*/
|
|
383
|
+
rtime: string;
|
|
384
|
+
/**
|
|
385
|
+
* Root em
|
|
386
|
+
*/
|
|
387
|
+
rem: string;
|
|
388
|
+
/**
|
|
389
|
+
* Root angle
|
|
390
|
+
*/
|
|
391
|
+
rangle: string;
|
|
392
|
+
/**
|
|
393
|
+
* Lightness
|
|
394
|
+
*/
|
|
395
|
+
l: {
|
|
396
|
+
def: number;
|
|
397
|
+
c: number;
|
|
398
|
+
s: number;
|
|
399
|
+
m: number;
|
|
400
|
+
l: number;
|
|
401
|
+
n: number;
|
|
402
|
+
};
|
|
403
|
+
/**
|
|
404
|
+
* Hue
|
|
405
|
+
*/
|
|
406
|
+
h: {
|
|
407
|
+
def: number;
|
|
408
|
+
b: number;
|
|
409
|
+
i: number;
|
|
410
|
+
e: number;
|
|
411
|
+
w: number;
|
|
412
|
+
s: number;
|
|
413
|
+
};
|
|
414
|
+
/**
|
|
415
|
+
* Chroma
|
|
416
|
+
*/
|
|
417
|
+
c: {
|
|
418
|
+
def: number;
|
|
419
|
+
xs: number;
|
|
420
|
+
s: number;
|
|
421
|
+
m: number;
|
|
422
|
+
l: number;
|
|
423
|
+
xl: number;
|
|
424
|
+
};
|
|
425
|
+
/**
|
|
426
|
+
* Alpha
|
|
427
|
+
*/
|
|
428
|
+
a: {
|
|
429
|
+
def: number;
|
|
430
|
+
min: number;
|
|
431
|
+
xs: number;
|
|
432
|
+
s: number;
|
|
433
|
+
m: number;
|
|
434
|
+
l: number;
|
|
435
|
+
xl: number;
|
|
436
|
+
max: number;
|
|
437
|
+
};
|
|
438
|
+
/**
|
|
439
|
+
* Time
|
|
440
|
+
*/
|
|
441
|
+
t: {
|
|
442
|
+
def: number;
|
|
443
|
+
xs: number;
|
|
444
|
+
s: number;
|
|
445
|
+
m: number;
|
|
446
|
+
l: number;
|
|
447
|
+
xl: number;
|
|
448
|
+
no: number;
|
|
449
|
+
min: number;
|
|
450
|
+
max: number;
|
|
451
|
+
};
|
|
452
|
+
/**
|
|
453
|
+
* Integer coefficients
|
|
454
|
+
*/
|
|
455
|
+
int: number[];
|
|
456
|
+
/**
|
|
457
|
+
* Fractions
|
|
458
|
+
*/
|
|
459
|
+
fr: {
|
|
460
|
+
0: number;
|
|
461
|
+
'1/12': string;
|
|
462
|
+
'1/10': string;
|
|
463
|
+
'1/6': string;
|
|
464
|
+
'1/5': string;
|
|
465
|
+
'1/4': string;
|
|
466
|
+
'3/10': string;
|
|
467
|
+
'1/3': string;
|
|
468
|
+
'2/5': string;
|
|
469
|
+
'5/12': string;
|
|
470
|
+
'1/2': string;
|
|
471
|
+
'7/12': string;
|
|
472
|
+
'3/5': string;
|
|
473
|
+
'2/3': string;
|
|
474
|
+
'7/10': string;
|
|
475
|
+
'3/4': string;
|
|
476
|
+
'4/5': string;
|
|
477
|
+
'5/6': string;
|
|
478
|
+
'9/10': string;
|
|
479
|
+
'11/12': string;
|
|
480
|
+
1: string;
|
|
481
|
+
};
|
|
482
|
+
/**
|
|
483
|
+
* Aspect-ratio
|
|
484
|
+
*/
|
|
485
|
+
ar: {
|
|
486
|
+
1: number;
|
|
487
|
+
'2/1': number;
|
|
488
|
+
'1/2': number;
|
|
489
|
+
'4/3': number;
|
|
490
|
+
'3/4': number;
|
|
491
|
+
'9/16': number;
|
|
492
|
+
'16/9': number;
|
|
493
|
+
};
|
|
494
|
+
};
|
|
495
|
+
/**
|
|
496
|
+
* Light mode
|
|
497
|
+
*/
|
|
498
|
+
light: {
|
|
499
|
+
l: {
|
|
500
|
+
def: number;
|
|
501
|
+
c: number;
|
|
502
|
+
s: number;
|
|
503
|
+
m: number;
|
|
504
|
+
l: number;
|
|
505
|
+
n: number;
|
|
506
|
+
};
|
|
507
|
+
};
|
|
508
|
+
/**
|
|
509
|
+
* Dark mode
|
|
510
|
+
*/
|
|
511
|
+
dark: {
|
|
512
|
+
l: {
|
|
513
|
+
def: number;
|
|
514
|
+
n: number;
|
|
515
|
+
s: number;
|
|
516
|
+
m: number;
|
|
517
|
+
l: number;
|
|
518
|
+
c: number;
|
|
519
|
+
};
|
|
520
|
+
};
|
|
521
|
+
};
|
|
522
|
+
palette: TPaletteConfig;
|
|
523
|
+
coef: TCoefConfig;
|
|
463
524
|
};
|
|
464
525
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
1
|
+
import type { TProviderAttrParams } from './common';
|
|
2
|
+
import { useStyleProvider } from './index';
|
|
3
3
|
/**
|
|
4
4
|
* Create style dispatcher
|
|
5
5
|
* @param params - dispatcher params
|
|
6
|
+
* @deprecated The function will be deleted in v4. Use `useStyleProvider` from `effcss` instead
|
|
6
7
|
*/
|
|
7
|
-
export declare const createConsumer: (attrs?: Partial<
|
|
8
|
+
export declare const createConsumer: (attrs?: Partial<TProviderAttrParams>) => ReturnType<typeof useStyleProvider>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { createProcessor } from './_provider/process';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import { createCollector } from './_provider/collect';
|
|
3
|
+
import { createScope } from './_provider/scope';
|
|
4
|
+
import type { TProviderAttrParams, TProviderSettings } from './common';
|
|
5
|
+
export declare const TAG_NAME = "effcss-provider";
|
|
4
6
|
type TResolveAttr = ReturnType<ReturnType<typeof createScope>>['attr'];
|
|
5
7
|
/**
|
|
6
8
|
* StyleSheet maker
|
|
@@ -20,6 +22,7 @@ type TStyleTarget = string | TStyleSheetMaker;
|
|
|
20
22
|
* Basic interface for style provider component.
|
|
21
23
|
*/
|
|
22
24
|
export interface IStyleProvider {
|
|
25
|
+
get tagName(): string;
|
|
23
26
|
/**
|
|
24
27
|
* Get prefix
|
|
25
28
|
*/
|
|
@@ -33,7 +36,8 @@ export interface IStyleProvider {
|
|
|
33
36
|
*/
|
|
34
37
|
get min(): boolean;
|
|
35
38
|
/**
|
|
36
|
-
* Get hydrate
|
|
39
|
+
* Get hydrate flag
|
|
40
|
+
* @deprecated The flag will be removed in v4
|
|
37
41
|
*/
|
|
38
42
|
get hydrate(): boolean | null;
|
|
39
43
|
/**
|
|
@@ -83,7 +87,7 @@ export interface IStyleProvider {
|
|
|
83
87
|
/**
|
|
84
88
|
* Set provider settings
|
|
85
89
|
*/
|
|
86
|
-
set settings(val:
|
|
90
|
+
set settings(val: Partial<TProviderSettings>);
|
|
87
91
|
/**
|
|
88
92
|
* Use stylesheet maker
|
|
89
93
|
* @param maker - stylesheet maker
|
|
@@ -161,8 +165,30 @@ export type TBaseStyleSheet = {
|
|
|
161
165
|
};
|
|
162
166
|
};
|
|
163
167
|
};
|
|
168
|
+
type TUseStylePropviderParams = Partial<TProviderSettings & {
|
|
169
|
+
attrs?: Partial<TProviderAttrParams>;
|
|
170
|
+
/**
|
|
171
|
+
* Don`t send provider script tag from server-side
|
|
172
|
+
*/
|
|
173
|
+
noscript?: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Create Style Provider emulation
|
|
176
|
+
*/
|
|
177
|
+
emulate?: boolean;
|
|
178
|
+
}>;
|
|
179
|
+
type TUseStyleProvider = {
|
|
180
|
+
(settings?: TUseStylePropviderParams): IStyleProvider;
|
|
181
|
+
isDefined?: boolean;
|
|
182
|
+
};
|
|
164
183
|
/**
|
|
165
184
|
* Define style provider custom element
|
|
166
185
|
*/
|
|
167
|
-
export declare function defineProvider(settings?:
|
|
186
|
+
export declare function defineProvider(settings?: Partial<TProviderSettings>): boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Use Style Provider
|
|
189
|
+
* @description
|
|
190
|
+
* The function defines and creates a provider script in the browser and emulates the provider on the server.
|
|
191
|
+
* @param settings - provider settings
|
|
192
|
+
*/
|
|
193
|
+
export declare const useStyleProvider: TUseStyleProvider;
|
|
168
194
|
export {};
|