@cobalt-ui/core
Advanced tools
Comparing version 0.6.1 to 0.6.2
# @cobalt-ui/core | ||
## 0.6.2 | ||
### Patch Changes | ||
- Updated dependencies [9e80004] | ||
- @cobalt-ui/utils@0.5.0 | ||
## 0.6.1 | ||
@@ -4,0 +11,0 @@ |
@@ -1,6 +0,6 @@ | ||
function M(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function dr(r){return r==null?!0:typeof r=="string"||Array.isArray(r)?r.length===0:M(r)?Object.keys(r).length===0:!1}function X(r,e){if(r==null&&e.undefined)return e.undefined(r);if(typeof r=="string"&&e.string)return e.string(r);if(typeof r=="number"&&e.number)return e.number(r);if(Array.isArray(r)&&e.array)return e.array(r);if(M(r)&&e.object)return e.object(r);if(e.default)return e.default(r)}function N(r,e=2){let t=r;for(;t.length<e;)t=`0${t}`;return t}function Br(r){return r*(Math.PI/180)}function Sr(r){return r*(180/Math.PI)}function m(r,e,t){return Math.min(Math.max(r,e),t)}function _(r,e){let[t,o,n,a]=e,s=a<1?`/${A(a,5)}`:"";switch(r){case"rgb":case"rgba":return a<1?`rgba(${Math.round(t*255)}, ${Math.round(o*255)}, ${Math.round(n*255)}, ${A(a,5)})`:`rgb(${Math.round(t*255)}, ${Math.round(o*255)}, ${Math.round(n*255)})`;case"oklab":case"oklch":return`${r}(${A(t*100,6)}% ${A(o,6)} ${A(n,6)}${s})`;default:return`color(${r} ${A(t,6)} ${A(o,6)} ${A(n,6)}${s})`}}function G(r,e){let t=[...r];for(let o=0;o<e.length;o++){let n=0;for(let a=0;a<e[o].length;a++)n+=r[a]*e[o][a];t[o]=n}return t}function A(r,e=2){let t=10**e;return Math.round(r*t)/t}var Dr=[[.4123907992659593,.357584339383878,.1804807884018343],[.2126390058715102,.715168678767756,.0721923153607337],[.0193308187155918,.11919477979462,.9505321522496607]],Tr=[[3.240969941904522,-1.537383177570094,-.4986107602930034],[-.9692436362808793,1.8759675015077202,.0415550574071756],[.0556300796969937,-.2039769588889766,1.0569715142428782]],Ir=[[.2104542553,.793617785,-.0040720468],[1.9779984951,-2.428592205,.4505937099],[.0259040371,.7827717662,-.808675766]],b=[[4.0767416621,-3.3077115913,.2309699292],[-1.2684380046,2.6097574011,-.3413193965],[-.0041960863,-.7034186147,1.707614701]],Fr=[[.4122214708,.5363325363,.0514459929],[.2119034982,.6806995451,.1073969566],[.0883024619,.2817188376,.6299787005]],qr=[[1,.39633779217376774,.2158037580607588],[1,-.10556134232365633,-.0638541747717059],[1,-.08948418209496574,-1.2914855378640917]];function Nr(r,e){let t=[1/0,1/0,1/0,1/0,1/0],o=1/0,n=1/0,a=1/0;-1.88170328*r-.80936493*e>1?(t=[1.19086277,1.76576728,.59662641,.75515197,.56771245],o=4.0767416621,n=-3.3077115913,a=.2309699292):1.81444104*r-1.19445276*e>1?(t=[.73956515,-.45954404,.08285427,.1254107,.14503204],o=-1.2684380046,n=2.6097574011,a=-.3413193965):(t=[1.35733652,-.00915799,-1.1513021,-.50559606,.00692167],o=-.0041960863,n=-.7034186147,a=1.707614701);let s=t[0]+t[1]*r+t[2]*e+t[3]*r*r+t[4]*r*e,h=.3963377774*r+.2158037573*e,l=-.1055613458*r-.0638541728*e,u=-.0894841775*r-1.291485548*e;{let p=1+s*h,i=1+s*l,g=1+s*u,f=p**3,d=i**3,y=g**3,w=3*h*p**2,O=3*l*i**2,$=3*u*g**2,k=6*h**2*p,c=6*l**2*i,x=6*u**2*g,C=o*f+n*d+a*y,S=o*w+n*O+a*$,q=o*k+n*c+a*x;s=s-C*S/(S*S-.5*C*q)}return s}function vr(r,e){let t=Nr(r,e),o=v(Z([1,t*r,t*e,1])),n=Math.cbrt(1/Math.max(o[0],o[1],o[3])),a=n*t;return{L:n,C:a}}function Ur(r,e,t,o,n){let a=vr(r,e);if((t-n)*a.C-(a.L-n)*o<=0)return a.C*n/(o*a.L+a.C*(n-t));let s=a.C*(n-1)/(o*(a.L-1)+a.C*(n-t)),h=t-n,l=o,u=.3963377774*r+.2158037573*e,p=-.1055613458*r-.0638541728*e,i=-.0894841775*r-1.291485548*e,g=h+l*u,f=h+l*p,d=h+l*i,y=n*(1-s)+s*t,w=s*o,O=y+w*u,$=y+w*p,k=y+w*i,c=[[O**3,$**3,k**3],[3*g*O**2,3*f*$**2,3*d*k**2],[6*g**2*O,6*f**2*$,6*d**2*k]],x=b[0][0]*c[0][0]+b[0][1]*c[0][1]+b[0][2]*c[0][2]-1,C=b[0][0]*c[1][0]+b[0][1]*c[1][1]+b[0][2]*c[1][2],S=b[0][0]*c[2][0]+b[0][1]*c[2][1]+b[0][2]*c[2][2],q=C/(C*C-.5*x*S),_r=q>=0?-x*q:1/0,fr=b[1][0]*c[0][0]+b[1][1]*c[0][1]+b[1][2]*c[0][2]-1,K=b[1][0]*c[1][0]+b[1][1]*c[1][1]+b[1][2]*c[1][2],jr=b[1][0]*c[2][0]+b[1][1]*c[2][1]+b[1][2]*c[2][2],mr=K/(K*K-.5*fr*jr),Rr=mr>=0?-fr*mr:1/0,hr=b[2][0]*c[0][0]+b[2][1]*c[0][1]+b[2][2]*c[0][2]-1,P=b[2][0]*c[1][0]+b[2][1]*c[1][1]+b[2][2]*c[1][2],Cr=b[2][0]*c[2][0]+b[2][1]*c[2][1]+b[2][2]*c[2][2],pr=P/(P*P-.5*hr*Cr),Gr=pr>=0?-hr*pr:1/0;return s+Math.min(_r,Rr,Gr)}function H(r){let[e,t,o,n]=r;e=Math.abs(e%360);let a=t*(1-Math.abs(2*o-1)),s=a*(1-Math.abs(e/60%2-1)),h=0,l=0,u=0;0<=e&&e<60?(h=a,l=s):60<=e&&e<120?(h=s,l=a):120<=e&&e<180?(l=a,u=s):180<=e&&e<240?(l=s,u=a):240<=e&&e<300?(h=s,u=a):300<=e&&e<360&&(h=a,u=s);let p=o-a/2;return[h+p,l+p,u+p,n]}function br(r){let[e,t,o,n]=r;if(t+o>=1){let s=t/(t+o);return[s,s,s,n]}let a=H([e,100,50,n]);for(let s=0;s<3;s++)a[s]*=1-t-o,a[s]+=t;return a}function Wr(r,e=2e-4){let[t,o,n,a]=r,s=Math.abs(o)<e&&Math.abs(n)<e?0:Sr(Math.atan2(n,o));for(;s<0;)s+=360;for(;s>=360;)s-=360;return[t,Math.sqrt(o**2+n**2),s,a]}function Yr(r){let[e,t,o,n]=r;if(e===0)return[0,0,0,r[3]];for(;o<0;)o+=360;for(;o>=360;)o-=360;let a=Br(o);return[e,Math.cos(a)*t,Math.sin(a)*t,n]}function Kr(r){return G(r,Ir)}function v(r){let[e,t,o,n]=G([r[0]**3,r[1]**3,r[2]**3,r[3]],b);return[e,t,o,n]}function R(r,e=2.4){let t=Math.abs(r[0]),o=Math.abs(r[1]),n=Math.abs(r[2]);return[t<.0031308?r[0]*12.92:1.055*Math.pow(t,1/e)-.055,o<.0031308?r[1]*12.92:1.055*Math.pow(o,1/e)-.055,n<.0031308?r[2]*12.92:1.055*Math.pow(n,1/e)-.055,r[3]]}function kr(r){let e=G(r,Fr);return[Math.cbrt(e[0]),Math.cbrt(e[1]),Math.cbrt(e[2]),e[3]]}function gr(r){return G(r,Dr)}function Z(r){return G(r,qr)}function U(r){let e=R(v(Z(r)));if(e[0]>1.001||e[0]<-.001||e[1]>1.001||e[1]<-.001||e[2]>1.001||e[2]<-.001){let[t,o,n,a]=r,s=Math.max(1e-5,Math.sqrt(o**2+n**2)),h=m(t,0,1),l=o/s,u=n/s,p=Ur(l,u,t,s,h);return R(v(Z([h*(1-p)+p*t,l*(p*s),u*(p*s),a])))}return e}function J(r){return U(Yr(r))}function j(r,e=2.4){let t=Math.abs(r[0]),o=Math.abs(r[1]),n=Math.abs(r[2]);return[t<.04045?r[0]/12.92:((t+.055)/1.055)**e,o<.04045?r[1]/12.92:((o+.055)/1.055)**e,n<.04045?r[2]/12.92:((n+.055)/1.055)**e,r[3]]}function W(r){return Kr(kr(j(r)))}function Q(r){return Wr(W(r))}function yr(r){return G(r,Tr)}var Pr={black:0,silver:12632256,gray:8421504,white:16777215,maroon:8388608,red:16711680,purple:8388736,fuchsia:16711935,green:32768,lime:65280,olive:8421376,yellow:16776960,navy:128,blue:255,teal:32896,aqua:65535,orange:16753920,aliceblue:15792383,antiquewhite:16444375,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,blanchedalmond:16772045,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,limegreen:3329330,linen:16445670,magenta:16711935,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,oldlace:16643558,olivedrab:7048739,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,whitesmoke:16119285,yellowgreen:10145074,rebeccapurple:6697881},wr=Pr,Xr=/-?[0-9.]+%?/g,Hr=/^#?[0-9a-f]{3,8}$/i,Zr=16**6,rr=16**4,er=16**2;function V(r){let e=Jr(r),t={get hex(){let o="#";return o+=N(Math.round(m(e[0]*255,0,255)).toString(16),2),o+=N(Math.round(m(e[1]*255,0,255)).toString(16),2),o+=N(Math.round(m(e[2]*255,0,255)).toString(16),2),e[3]<1&&(o+=N(Math.round(e[3]*255).toString(16),2)),o},get hexVal(){e[3]<1&&console.warn(`hexVal converted a semi-transparent color (${e[3]*100}%) to fully opaque`);let o=Math.round(m(e[0]*255,0,255)),n=Math.round(m(e[1]*255,0,255)),a=Math.round(m(e[2]*255,0,255));return o*rr+n*er+a},get rgb(){return _("rgb",e)},rgbVal:e,get rgba(){return _("rgb",e)},rgbaVal:e,get linearRGB(){return _("srgb-linear",j(e))},get linearRGBVal(){return j(e)},get p3(){return _("display-p3",e)},p3Val:e,get oklab(){return _("oklab",W(e))},get oklabVal(){return W(e)},get oklch(){return _("oklch",Q(e))},get oklchVal(){return Q(e)},get xyz(){return _("xyz-d65",gr(j(e)))},get xyzVal(){return gr(j(e))}};return t.toString=()=>t.hex,t}function $r(r){if(r>Zr)throw new Error("8-digit hex values (with transparency) aren\u2019t supported");let e=r,t=Math.floor(e/rr);e-=t*rr;let o=Math.floor(e/er);e-=o*er;let n=e;return[t/255,o/255,n/255,1]}function L(r,e){let t=r.match(Xr);if(!t)throw new Error(`Unexpected color format: ${r}`);let o=[0,0,0,1];return t.forEach((n,a)=>{n.includes("%")?o[a]=parseFloat(n)/100:e[a]===1/0||e[a]===0||e[a]===1?o[a]=parseFloat(n):o[a]=parseFloat(n)/e[a]}),o}function Jr(r){let e=new Error(`Unable to parse color "${r}"`);if(r==null||r==null)throw e;if(Array.isArray(r)){if(typeof r[0]!="number"||typeof r[1]!="number"||typeof r[2]!="number")throw new Error(`Color array must be numbers, received ${r}`);if(r.length<3||r.length>4)throw new Error(`Expected [R, G, B, A?], received ${r}`);return[m(r[0],0,1),m(r[1],0,1),m(r[2],0,1),typeof r[3]=="number"?m(r[3],0,1):1]}if(typeof r=="object"){let t={...r},o=1;for(let n of Object.keys(t))n==="alpha"?o=m(t[n],0,1):t[n.toLowerCase()]=t[n];if("r"in t&&"g"in t&&"b"in t)return[m(t.r||t.R,0,1),m(t.r||t.R,0,1),m(t.r||t.R,0,1),o];if("h"in t&&"s"in t&&"l"in t)return H([t.h,m(t.s,0,1),m(t.l,0,1),o]);if("h"in t&&"w"in t&&"b"in t)return br([t.h,m(t.w,0,1),m(t.b,0,1),o]);if("l"in t&&"a"in t&&"b"in t)return U([t.l,t.a,t.b,o]);if("l"in t&&"c"in t&&"h"in t)return J([t.l,t.c,t.h,o]);if("x"in t&&"y"in t&&"z"in t)return R(yr([t.x,t.y,t.z,o]));throw e}if(typeof r=="number")return $r(r);if(typeof r=="string"){let t=r.trim();if(!t)throw new Error("Expected color, received empty string");let o=t.toLowerCase();if(typeof wr[o]=="number")return $r(wr[o]);if(Hr.test(t)){let s=t.replace("#",""),h=[0,0,0,1];if(s.length>=6)for(let l=0;l<s.length/2;l++){let u=l*2,p=u+2,i=s.substring(u,p);h[l]=parseInt(i,16)/255}else for(let l=0;l<s.length;l++){let u=s.charAt(l);h[l]=parseInt(`${u}${u}`,16)/255}return h}let[n,a]=t.split("(");if(n==="color"){let s=a.indexOf(" ");n=a.substring(0,s),a=a.substring(s)}switch(n){case"rgb":case"rgba":case"srgb":{let[s,h,l,u]=L(a,[255,255,255,1]);return[m(s,0,1),m(h,0,1),m(l,0,1),m(u,0,1)]}case"linear-rgb":case"linear-srgb":case"rgb-linear":case"srgb-linear":{let s=L(a,[255,255,255,1]);return R(s)}case"hsl":case"hsla":{let[s,h,l,u]=L(a,[1,1,1,1]);return H([s,m(h,0,1),m(l,0,1),m(u,0,1)])}case"hwb":case"hwba":{let[s,h,l,u]=L(a,[1,1,1,1]);return br([s,m(h,0,1),m(l,0,1),m(u,0,1)])}case"p3":case"display-p3":{let[s,h,l,u]=L(a,[1,1,1,1]);return[m(s,0,1),m(h,0,1),m(l,0,1),m(u,0,1)]}case"oklab":return U(L(a,[1,1,1,1]));case"oklch":return J(L(a,[1,1,1,1]));case"xyz":case"xyz-d65":return R(yr(L(a,[1,1,1,1])))}}throw e}function tr(r,e,t=.5,o="oklab"){let n=m(t,0,1);if(t===0)return V(r);if(t===1)return V(e);let a=1-n,s=n,h={oklch:Q,oklab:W,lms:x=>j(kr(x)),linearRGB:j,sRGB:x=>x},l={oklch:J,oklab:U,lms:x=>v(R(x)),linearRGB:R,sRGB:x=>x},u=h[o],p=l[o];if(!u)throw new Error(`Unknown color space "${o}", try "oklab", "oklch", "linearRGB", or "sRGB"`);let i=V(r).rgbVal,g=V(e).rgbVal;o==="oklch"&&(i[0]===i[1]&&i[1]===i[2]||g[0]===g[1]&&g[1]===g[2])&&(u=h.oklab,p=l.oklab);let[f,d,y,w]=u(i),[O,$,k,c]=u(g);return o==="oklch"&&Math.abs(k-y)>180&&(Math.max(y,k)===k?k-=360:y-=360),V(p([f*a+O*s,d*a+$*s,y*a+k*s,w*a+c*s]))}function xr(r,e,t="oklab"){let o=m(e,-1,1);return o>=0?tr(r,"black",o,t):Er(r,-o)}function Er(r,e,t="oklab"){let o=m(e,-1,1);return o>=0?tr(r,"white",o,t):xr(r,-o)}function Y(r){return V(r).xyzVal[1]}function Qr(r){return A(V(r).oklabVal[0],5)}function re(r){return Y(r)<.36?"dark":"light"}function ee(r,e){let t=Y(r),o=Y(e),n=Math.max(t,o),a=Math.min(t,o),s=(n+.05)/(a+.05);return{ratio:s,AA:s>=4.5,AAA:s>=7}}var Mr={contrastRatio:ee,darken:xr,from:V,lighten:Er,lightness:Qr,lightOrDark:re,luminance:Y,mix:tr};function z(r){if(!r)throw new Error("missing value");if(typeof r=="string"||typeof r=="number")try{return Mr.from(r).hex}catch{throw new Error(`invalid color "${r}"`)}throw new Error(`expected string, received ${typeof r}`)}function D(r){if(!r)throw new Error("missing value");if(typeof r=="string")return[r];if(Array.isArray(r)){if(r.every(e=>!!e&&typeof e=="string"))return r;throw new Error("expected array of strings")}throw new Error(`expected string or array of strings, received ${typeof r}`)}var te=/^\d+(\.\d+)?(ms|s)$/;function B(r){if(typeof r=="number")return`${r}ms`;if(typeof r=="string"){if(parseFloat(r)===0)return"0ms";if(te.test(r))return r;throw new Error(`invalid duration "${r}"`)}throw new Error(`expected string, received ${typeof r}`)}function E(r){if(typeof r=="number"){if(r===0)return"0";throw new Error("missing units")}if(typeof r=="string")return parseFloat(r)===0?"0":r;throw new Error(`expected string, received ${typeof r}`)}function T(r){if(!r)throw new Error("missing value");if(!Array.isArray(r)||r.length!==4||r.some(e=>typeof e!="number"))throw new Error(`expected [\u{1D465}1, \u{1D466}1, \u{1D465}2, \u{1D466}2], received ${r}`);return[Math.max(0,Math.min(1,r[0])),r[1],Math.max(0,Math.min(1,r[2])),r[3]]}function or(r){if(!r)throw new Error("missing value");if(typeof r=="string")return r;throw new Error(`expected string, received ${typeof r}`)}var Ar=new Set(["solid","dashed","dotted","double","groove","ridge","outset","inset"]);function I(r){if(!Ar.has(r))throw new Error(`Unsupported stroke type "${r}", must be one of: | ||
- ${[...Ar].join(` | ||
- `)}`);return r}function nr(r){if(!M(r))throw new Error(`Expected object, received ${Array.isArray(r)?"array":typeof r}`);let e={};if(!Object.keys(r).length)throw new Error("Must specify at least 1 property for border");for(let t of Object.keys(r))switch(t){case"color":{e.color=z(r.color);break}case"width":{e.width=E(r.width);break}case"style":{e.style=I(r.style);break}default:throw new Error(`Unknown property "${t}" on border token`)}return e}var oe=[.25,.1,.25,1];function ir(r){if(!r)throw new Error("missing value");if(typeof r!="object"||Array.isArray(r))throw new Error("invalid transition format, e");if(!Object.keys(r).length)throw new Error("At least 1 transition property is required");let e=r;return{duration:B(e.duration||"0"),delay:B(e.delay||"0"),timingFunction:T(e.timingFunction||oe)}}function ar(r){if(!r)throw new Error("missing value");if(typeof r!="object"||Array.isArray(r))throw new Error("invalid shadow");let e=r;return["offsetX","offsetX","blur","spread","color"].forEach(t=>{if(typeof e[t]=="number"&&e[t]>0)throw new Error(`${t} missing units`);if((t==="offsetX"||t==="offsetY")&&typeof e[t]!="string"&&e[t]!==0)throw new Error(`missing ${t}`)}),{offsetX:E(e.offsetX||"0"),offsetY:E(e.offsetY||"0"),blur:E(e.blur||"0"),spread:E(e.spread||"0"),color:z(e.color)}}function sr(r){if(!r)throw new Error("missing value");if(!Array.isArray(r))throw new Error(`expected array of gradient stops, received ${typeof r}`);if(r.some(e=>!e||!e.color))throw new Error("all gradient stops must have color");return r.map(e=>({color:z(e.color),position:typeof e.position=="number"?Math.max(0,Math.min(1,e.position)):void 0}))}var Le=!process.env.NODE_DISABLE_COLORS&&(!process.env.NO_COLOR||process.env.NO_COLOR=="0");var ne=/[^-_\.\s][-_\.\s]+[^-_\.\s]/g;function zr(r){return r.replace(ne,e=>`${e[0].toLocaleLowerCase()}${e[e.length-1].toLocaleUpperCase()}`)}var Or=new Map([["thin",100],["hairline",100],["extra-light",200],["ultra-light",200],["light",300],["normal",400],["regular",400],["book",400],["medium",500],["semi-bold",600],["demi-bold",600],["bold",700],["extra-bold",800],["ultra-bold",800],["black",900],["heavy",900],["extra-black",950],["ultra-black",950]]);function lr(r){if(!r)throw new Error("missing value");if(typeof r!="object"||Array.isArray(r))throw new Error(`expected object, received ${Array.isArray(r)?"array":typeof r}`);if(!Object.keys(r).length)throw new Error("must specify at least 1 font property");let e={};for(let[t,o]of Object.entries(r)){let n=zr(t);switch(n){case"fontName":case"fontFamily":{e.fontFamily=D(o);break}case"fontWeight":{if(typeof o=="string"){let a=Or.get(o);if(a)e.fontWeight=a;else throw new Error(`invalid font weight "${o}", use number (1-999) or any of: | ||
function A(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function dr(r){return r==null?!0:typeof r=="string"||Array.isArray(r)?r.length===0:A(r)?Object.keys(r).length===0:!1}function P(r,e){if(r==null&&e.undefined)return e.undefined(r);if(typeof r=="string"&&e.string)return e.string(r);if(typeof r=="number"&&e.number)return e.number(r);if(Array.isArray(r)&&e.array)return e.array(r);if(A(r)&&e.object)return e.object(r);if(e.default)return e.default(r)}function N(r,e=2){let t=r;for(;t.length<e;)t=`0${t}`;return t}function Gr(r){return r*(Math.PI/180)}function Br(r){return r*(180/Math.PI)}function m(r,e,t){return Math.min(Math.max(r,e),t)}function F(r,e){let[t,o,n,a]=e,s=a<1?`/${M(a,5)}`:"";switch(r){case"rgb":case"rgba":return a<1?`rgba(${Math.round(t*255)}, ${Math.round(o*255)}, ${Math.round(n*255)}, ${M(a,5)})`:`rgb(${Math.round(t*255)}, ${Math.round(o*255)}, ${Math.round(n*255)})`;case"oklab":case"oklch":return`${r}(${M(t*100,6)}% ${M(o,6)} ${M(n,6)}${s})`;default:return`color(${r} ${M(t,6)} ${M(o,6)} ${M(n,6)}${s})`}}function C(r,e){let t=[...r];for(let o=0;o<e.length;o++){let n=0;for(let a=0;a<e[o].length;a++)n+=r[a]*e[o][a];t[o]=n}return t}function M(r,e=2){let t=10**e;return Math.round(r*t)/t}var Dr=[[.4123907992659593,.357584339383878,.1804807884018343],[.2126390058715102,.715168678767756,.0721923153607337],[.0193308187155918,.11919477979462,.9505321522496607]],Sr=[[3.240969941904522,-1.537383177570094,-.4986107602930034],[-.9692436362808793,1.8759675015077202,.0415550574071756],[.0556300796969937,-.2039769588889766,1.0569715142428782]],Tr=[[.2104542553,.793617785,-.0040720468],[1.9779984951,-2.428592205,.4505937099],[.0259040371,.7827717662,-.808675766]],b=[[4.0767416621,-3.3077115913,.2309699292],[-1.2684380046,2.6097574011,-.3413193965],[-.0041960863,-.7034186147,1.707614701]],Ir=[[.4122214708,.5363325363,.0514459929],[.2119034982,.6806995451,.1073969566],[.0883024619,.2817188376,.6299787005]],qr=[[1,.39633779217376774,.2158037580607588],[1,-.10556134232365633,-.0638541747717059],[1,-.08948418209496574,-1.2914855378640917]];function Nr(r,e){let t=[1/0,1/0,1/0,1/0,1/0],o=1/0,n=1/0,a=1/0;-1.88170328*r-.80936493*e>1?(t=[1.19086277,1.76576728,.59662641,.75515197,.56771245],o=4.0767416621,n=-3.3077115913,a=.2309699292):1.81444104*r-1.19445276*e>1?(t=[.73956515,-.45954404,.08285427,.1254107,.14503204],o=-1.2684380046,n=2.6097574011,a=-.3413193965):(t=[1.35733652,-.00915799,-1.1513021,-.50559606,.00692167],o=-.0041960863,n=-.7034186147,a=1.707614701);let s=t[0]+t[1]*r+t[2]*e+t[3]*r*r+t[4]*r*e,h=.3963377774*r+.2158037573*e,l=-.1055613458*r-.0638541728*e,c=-.0894841775*r-1.291485548*e;{let p=1+s*h,i=1+s*l,g=1+s*c,f=p**3,d=i**3,y=g**3,w=3*h*p**2,O=3*l*i**2,$=3*c*g**2,x=6*h**2*p,u=6*l**2*i,k=6*c**2*g,R=o*f+n*d+a*y,B=o*w+n*O+a*$,q=o*x+n*u+a*k;s=s-R*B/(B*B-.5*R*q)}return s}function vr(r,e){let t=Nr(r,e),o=v(Z([1,t*r,t*e,1])),n=Math.cbrt(1/Math.max(o[0],o[1],o[3])),a=n*t;return{L:n,C:a}}function Ur(r,e,t,o,n){let a=vr(r,e);if((t-n)*a.C-(a.L-n)*o<=0)return a.C*n/(o*a.L+a.C*(n-t));let s=a.C*(n-1)/(o*(a.L-1)+a.C*(n-t)),h=t-n,l=o,c=.3963377774*r+.2158037573*e,p=-.1055613458*r-.0638541728*e,i=-.0894841775*r-1.291485548*e,g=h+l*c,f=h+l*p,d=h+l*i,y=n*(1-s)+s*t,w=s*o,O=y+w*c,$=y+w*p,x=y+w*i,u=[[O**3,$**3,x**3],[3*g*O**2,3*f*$**2,3*d*x**2],[6*g**2*O,6*f**2*$,6*d**2*x]],k=b[0][0]*u[0][0]+b[0][1]*u[0][1]+b[0][2]*u[0][2]-1,R=b[0][0]*u[1][0]+b[0][1]*u[1][1]+b[0][2]*u[1][2],B=b[0][0]*u[2][0]+b[0][1]*u[2][1]+b[0][2]*u[2][2],q=R/(R*R-.5*k*B),Fr=q>=0?-k*q:1/0,fr=b[1][0]*u[0][0]+b[1][1]*u[0][1]+b[1][2]*u[0][2]-1,K=b[1][0]*u[1][0]+b[1][1]*u[1][1]+b[1][2]*u[1][2],_r=b[1][0]*u[2][0]+b[1][1]*u[2][1]+b[1][2]*u[2][2],mr=K/(K*K-.5*fr*_r),jr=mr>=0?-fr*mr:1/0,hr=b[2][0]*u[0][0]+b[2][1]*u[0][1]+b[2][2]*u[0][2]-1,H=b[2][0]*u[1][0]+b[2][1]*u[1][1]+b[2][2]*u[1][2],Rr=b[2][0]*u[2][0]+b[2][1]*u[2][1]+b[2][2]*u[2][2],pr=H/(H*H-.5*hr*Rr),Cr=pr>=0?-hr*pr:1/0;return s+Math.min(Fr,jr,Cr)}function X(r){let[e,t,o,n]=r;e=Math.abs(e%360);let a=t*(1-Math.abs(2*o-1)),s=a*(1-Math.abs(e/60%2-1)),h=0,l=0,c=0;0<=e&&e<60?(h=a,l=s):60<=e&&e<120?(h=s,l=a):120<=e&&e<180?(l=a,c=s):180<=e&&e<240?(l=s,c=a):240<=e&&e<300?(h=s,c=a):300<=e&&e<360&&(h=a,c=s);let p=o-a/2;return[h+p,l+p,c+p,n]}function br(r){let[e,t,o,n]=r;if(t+o>=1){let s=t/(t+o);return[s,s,s,n]}let a=X([e,100,50,n]);for(let s=0;s<3;s++)a[s]*=1-t-o,a[s]+=t;return a}function Wr(r,e=2e-4){let[t,o,n,a]=r,s=Math.abs(o)<e&&Math.abs(n)<e?0:Br(Math.atan2(n,o));for(;s<0;)s+=360;for(;s>=360;)s-=360;return[t,Math.sqrt(o**2+n**2),s,a]}function Yr(r){let[e,t,o,n]=r;if(e===0)return[0,0,0,r[3]];for(;o<0;)o+=360;for(;o>=360;)o-=360;let a=Gr(o);return[e,Math.cos(a)*t,Math.sin(a)*t,n]}function Kr(r){return C(r,Tr)}function v(r){let[e,t,o,n]=C([r[0]**3,r[1]**3,r[2]**3,r[3]],b);return[e,t,o,n]}function j(r,e=2.4){let t=Math.abs(r[0]),o=Math.abs(r[1]),n=Math.abs(r[2]);return[t<.0031308?r[0]*12.92:1.055*Math.pow(t,1/e)-.055,o<.0031308?r[1]*12.92:1.055*Math.pow(o,1/e)-.055,n<.0031308?r[2]*12.92:1.055*Math.pow(n,1/e)-.055,r[3]]}function xr(r){let e=C(r,Ir);return[Math.cbrt(e[0]),Math.cbrt(e[1]),Math.cbrt(e[2]),e[3]]}function gr(r){return C(r,Dr)}function Z(r){return C(r,qr)}function U(r){let e=j(v(Z(r)));if(e[0]>1.001||e[0]<-.001||e[1]>1.001||e[1]<-.001||e[2]>1.001||e[2]<-.001){let[t,o,n,a]=r,s=Math.max(1e-5,Math.sqrt(o**2+n**2)),h=m(t,0,1),l=o/s,c=n/s,p=Ur(l,c,t,s,h);return j(v(Z([h*(1-p)+p*t,l*(p*s),c*(p*s),a])))}return e}function J(r){return U(Yr(r))}function _(r,e=2.4){let t=Math.abs(r[0]),o=Math.abs(r[1]),n=Math.abs(r[2]);return[t<.04045?r[0]/12.92:((t+.055)/1.055)**e,o<.04045?r[1]/12.92:((o+.055)/1.055)**e,n<.04045?r[2]/12.92:((n+.055)/1.055)**e,r[3]]}function W(r){return Kr(xr(_(r)))}function Q(r){return Wr(W(r))}function yr(r){return C(r,Sr)}var Hr={black:0,silver:12632256,gray:8421504,white:16777215,maroon:8388608,red:16711680,purple:8388736,fuchsia:16711935,green:32768,lime:65280,olive:8421376,yellow:16776960,navy:128,blue:255,teal:32896,aqua:65535,orange:16753920,aliceblue:15792383,antiquewhite:16444375,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,blanchedalmond:16772045,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,limegreen:3329330,linen:16445670,magenta:16711935,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,oldlace:16643558,olivedrab:7048739,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,whitesmoke:16119285,yellowgreen:10145074,rebeccapurple:6697881},wr=Hr,Pr=/-?[0-9.]+%?/g,Xr=/^#?[0-9a-f]{3,8}$/i,Zr=16**6,rr=16**4,er=16**2;function V(r){let e=Jr(r),t={get hex(){let o="#";return o+=N(Math.round(m(e[0]*255,0,255)).toString(16),2),o+=N(Math.round(m(e[1]*255,0,255)).toString(16),2),o+=N(Math.round(m(e[2]*255,0,255)).toString(16),2),e[3]<1&&(o+=N(Math.round(e[3]*255).toString(16),2)),o},get hexVal(){e[3]<1&&console.warn(`hexVal converted a semi-transparent color (${e[3]*100}%) to fully opaque`);let o=Math.round(m(e[0]*255,0,255)),n=Math.round(m(e[1]*255,0,255)),a=Math.round(m(e[2]*255,0,255));return o*rr+n*er+a},get rgb(){return F("rgb",e)},rgbVal:e,get rgba(){return F("rgb",e)},rgbaVal:e,get linearRGB(){return F("srgb-linear",_(e))},get linearRGBVal(){return _(e)},get p3(){return F("display-p3",e)},p3Val:e,get oklab(){return F("oklab",W(e))},get oklabVal(){return W(e)},get oklch(){return F("oklch",Q(e))},get oklchVal(){return Q(e)},get xyz(){return F("xyz-d65",gr(_(e)))},get xyzVal(){return gr(_(e))}};return t.toString=()=>t.hex,t}function $r(r){if(r>Zr)throw new Error("8-digit hex values (with transparency) aren\u2019t supported");let e=r,t=Math.floor(e/rr);e-=t*rr;let o=Math.floor(e/er);e-=o*er;let n=e;return[t/255,o/255,n/255,1]}function L(r,e){let t=r.match(Pr);if(!t)throw new Error(`Unexpected color format: ${r}`);let o=[0,0,0,1];return t.forEach((n,a)=>{n.includes("%")?o[a]=parseFloat(n)/100:e[a]===1/0||e[a]===0||e[a]===1?o[a]=parseFloat(n):o[a]=parseFloat(n)/e[a]}),o}function Jr(r){let e=new Error(`Unable to parse color "${r}"`);if(r==null||r==null)throw e;if(Array.isArray(r)){if(typeof r[0]!="number"||typeof r[1]!="number"||typeof r[2]!="number")throw new Error(`Color array must be numbers, received ${r}`);if(r.length<3||r.length>4)throw new Error(`Expected [R, G, B, A?], received ${r}`);return[m(r[0],0,1),m(r[1],0,1),m(r[2],0,1),typeof r[3]=="number"?m(r[3],0,1):1]}if(typeof r=="object"){let t={...r},o=1;for(let n of Object.keys(t))n==="alpha"?o=m(t[n],0,1):t[n.toLowerCase()]=t[n];if("r"in t&&"g"in t&&"b"in t)return[m(t.r||t.R,0,1),m(t.r||t.R,0,1),m(t.r||t.R,0,1),o];if("h"in t&&"s"in t&&"l"in t)return X([t.h,m(t.s,0,1),m(t.l,0,1),o]);if("h"in t&&"w"in t&&"b"in t)return br([t.h,m(t.w,0,1),m(t.b,0,1),o]);if("l"in t&&"a"in t&&"b"in t)return U([t.l,t.a,t.b,o]);if("l"in t&&"c"in t&&"h"in t)return J([t.l,t.c,t.h,o]);if("x"in t&&"y"in t&&"z"in t)return j(yr([t.x,t.y,t.z,o]));throw e}if(typeof r=="number")return $r(r);if(typeof r=="string"){let t=r.trim();if(!t)throw new Error("Expected color, received empty string");let o=t.toLowerCase();if(typeof wr[o]=="number")return $r(wr[o]);if(Xr.test(t)){let s=t.replace("#",""),h=[0,0,0,1];if(s.length>=6)for(let l=0;l<s.length/2;l++){let c=l*2,p=c+2,i=s.substring(c,p);h[l]=parseInt(i,16)/255}else for(let l=0;l<s.length;l++){let c=s.charAt(l);h[l]=parseInt(`${c}${c}`,16)/255}return h}let[n,a]=t.split("(");if(n==="color"){let s=a.indexOf(" ");n=a.substring(0,s),a=a.substring(s)}switch(n){case"rgb":case"rgba":case"srgb":{let[s,h,l,c]=L(a,[255,255,255,1]);return[m(s,0,1),m(h,0,1),m(l,0,1),m(c,0,1)]}case"linear-rgb":case"linear-srgb":case"rgb-linear":case"srgb-linear":{let s=L(a,[255,255,255,1]);return j(s)}case"hsl":case"hsla":{let[s,h,l,c]=L(a,[1,1,1,1]);return X([s,m(h,0,1),m(l,0,1),m(c,0,1)])}case"hwb":case"hwba":{let[s,h,l,c]=L(a,[1,1,1,1]);return br([s,m(h,0,1),m(l,0,1),m(c,0,1)])}case"p3":case"display-p3":{let[s,h,l,c]=L(a,[1,1,1,1]);return[m(s,0,1),m(h,0,1),m(l,0,1),m(c,0,1)]}case"oklab":return U(L(a,[1,1,1,1]));case"oklch":return J(L(a,[1,1,1,1]));case"xyz":case"xyz-d65":return j(yr(L(a,[1,1,1,1])))}}throw e}function tr(r,e,t=.5,o="oklab"){let n=m(t,0,1);if(t===0)return V(r);if(t===1)return V(e);let a=1-n,s=n,h={oklch:Q,oklab:W,lms:k=>_(xr(k)),linearRGB:_,sRGB:k=>k},l={oklch:J,oklab:U,lms:k=>v(j(k)),linearRGB:j,sRGB:k=>k},c=h[o],p=l[o];if(!c)throw new Error(`Unknown color space "${o}", try "oklab", "oklch", "linearRGB", or "sRGB"`);let i=V(r).rgbVal,g=V(e).rgbVal;o==="oklch"&&(i[0]===i[1]&&i[1]===i[2]||g[0]===g[1]&&g[1]===g[2])&&(c=h.oklab,p=l.oklab);let[f,d,y,w]=c(i),[O,$,x,u]=c(g);return o==="oklch"&&Math.abs(x-y)>180&&(Math.max(y,x)===x?x-=360:y-=360),V(p([f*a+O*s,d*a+$*s,y*a+x*s,w*a+u*s]))}function kr(r,e,t="oklab"){let o=m(e,-1,1);return o>=0?tr(r,"black",o,t):Er(r,-o)}function Er(r,e,t="oklab"){let o=m(e,-1,1);return o>=0?tr(r,"white",o,t):kr(r,-o)}function Y(r){return V(r).xyzVal[1]}function Qr(r){return M(V(r).oklabVal[0],5)}function re(r){return Y(r)<.36?"dark":"light"}function ee(r,e){let t=Y(r),o=Y(e),n=Math.max(t,o),a=Math.min(t,o),s=(n+.05)/(a+.05);return{ratio:s,AA:s>=4.5,AAA:s>=7}}var Ar={contrastRatio:ee,darken:kr,from:V,lighten:Er,lightness:Qr,lightOrDark:re,luminance:Y,mix:tr};function z(r){if(!r)throw new Error("missing value");if(typeof r=="string"||typeof r=="number")try{return Ar.from(r).hex}catch{throw new Error(`invalid color "${r}"`)}throw new Error(`expected string, received ${typeof r}`)}function D(r){if(!r)throw new Error("missing value");if(typeof r=="string")return[r];if(Array.isArray(r)){if(r.every(e=>!!e&&typeof e=="string"))return r;throw new Error("expected array of strings")}throw new Error(`expected string or array of strings, received ${typeof r}`)}var te=/^\d+(\.\d+)?(ms|s)$/;function G(r){if(typeof r=="number")return`${r}ms`;if(typeof r=="string"){if(parseFloat(r)===0)return"0ms";if(te.test(r))return r;throw new Error(`invalid duration "${r}"`)}throw new Error(`expected string, received ${typeof r}`)}function E(r){if(typeof r=="number"){if(r===0)return"0";throw new Error("missing units")}if(typeof r=="string")return parseFloat(r)===0?"0":r;throw new Error(`expected string, received ${typeof r}`)}function S(r){if(!r)throw new Error("missing value");if(!Array.isArray(r)||r.length!==4||r.some(e=>typeof e!="number"))throw new Error(`expected [\u{1D465}1, \u{1D466}1, \u{1D465}2, \u{1D466}2], received ${r}`);return[Math.max(0,Math.min(1,r[0])),r[1],Math.max(0,Math.min(1,r[2])),r[3]]}function or(r){if(!r)throw new Error("missing value");if(typeof r=="string")return r;throw new Error(`expected string, received ${typeof r}`)}var Mr=new Set(["solid","dashed","dotted","double","groove","ridge","outset","inset"]);function T(r){if(!Mr.has(r))throw new Error(`Unsupported stroke type "${r}", must be one of: | ||
- ${[...Mr].join(` | ||
- `)}`);return r}function nr(r){if(!A(r))throw new Error(`Expected object, received ${Array.isArray(r)?"array":typeof r}`);let e={};if(!Object.keys(r).length)throw new Error("Must specify at least 1 property for border");for(let t of Object.keys(r))switch(t){case"color":{e.color=z(r.color);break}case"width":{e.width=E(r.width);break}case"style":{e.style=T(r.style);break}default:throw new Error(`Unknown property "${t}" on border token`)}return e}var oe=[.25,.1,.25,1];function ir(r){if(!r)throw new Error("missing value");if(typeof r!="object"||Array.isArray(r))throw new Error("invalid transition format, e");if(!Object.keys(r).length)throw new Error("At least 1 transition property is required");let e=r;return{duration:G(e.duration||"0"),delay:G(e.delay||"0"),timingFunction:S(e.timingFunction||oe)}}function ar(r){if(!r)throw new Error("missing value");if(typeof r!="object"||Array.isArray(r))throw new Error("invalid shadow");let e=r;return["offsetX","offsetX","blur","spread","color"].forEach(t=>{if(typeof e[t]=="number"&&e[t]>0)throw new Error(`${t} missing units`);if((t==="offsetX"||t==="offsetY")&&typeof e[t]!="string"&&e[t]!==0)throw new Error(`missing ${t}`)}),{offsetX:E(e.offsetX||"0"),offsetY:E(e.offsetY||"0"),blur:E(e.blur||"0"),spread:E(e.spread||"0"),color:z(e.color)}}function sr(r){if(!r)throw new Error("missing value");if(!Array.isArray(r))throw new Error(`expected array of gradient stops, received ${typeof r}`);if(r.some(e=>!e||!e.color))throw new Error("all gradient stops must have color");return r.map(e=>({color:z(e.color),position:typeof e.position=="number"?Math.max(0,Math.min(1,e.position)):void 0}))}var Ve=!process.env.NODE_DISABLE_COLORS&&(!process.env.NO_COLOR||process.env.NO_COLOR=="0");var ne=["0-9","A-Za-z","\xC0-\xFF","\u0100-\u017F","\u0180-\u024F","\u0370-\u03FF","\u0400-\u04FF","\u0530-\u058F","\u0590-\u05FF","\u0600-\u06FF","\u0900-\u097F","\u1100-\u11FF","\u3040-\u309F","\u30A0-\u30FF","\u3400-\u4DBF","\u4E00-\u9FFF"];var ie=/[^-_.\s][-_.\s]+[^-_.\s]/g,je=new RegExp(`^[${ne.join("")}]+$`);function zr(r){return r.replace(ie,e=>`${e[0].toLocaleLowerCase()}${e[e.length-1].toLocaleUpperCase()}`)}var Or=new Map([["thin",100],["hairline",100],["extra-light",200],["ultra-light",200],["light",300],["normal",400],["regular",400],["book",400],["medium",500],["semi-bold",600],["demi-bold",600],["bold",700],["extra-bold",800],["ultra-bold",800],["black",900],["heavy",900],["extra-black",950],["ultra-black",950]]);function lr(r){if(!r)throw new Error("missing value");if(typeof r!="object"||Array.isArray(r))throw new Error(`expected object, received ${Array.isArray(r)?"array":typeof r}`);if(!Object.keys(r).length)throw new Error("must specify at least 1 font property");let e={};for(let[t,o]of Object.entries(r)){let n=zr(t);switch(n){case"fontName":case"fontFamily":{e.fontFamily=D(o);break}case"fontWeight":{if(typeof o=="string"){let a=Or.get(o);if(a)e.fontWeight=a;else throw new Error(`invalid font weight "${o}", use number (1-999) or any of: | ||
- ${[...Or.values()].join(` | ||
- `)}`)}else typeof o=="number"&&(e.fontWeight=Math.max(1,Math.min(999,o)));break}default:{e[n]=typeof o=="string"&&parseFloat(o)>=0?E(o):o;break}}}return e}var F=/^\{([^}]+)\}$/,Lr=new Set(["$description","$name","$type","$value","$extensions"]);function ur(r){let e=[],t=[],o={result:{metadata:{},tokens:[]}};if(!r||typeof r!="object"||Array.isArray(r))return e.push(`Invalid schema type. Expected object, received "${Array.isArray(r)?"Array":typeof r}"`),o.errors=e,o;let n={};function a(i,g=[],f={$extensions:{requiredModes:[]}}){if(!(!i||!M(i)))for(let[d,y]of Object.entries(i)){if(!y||!M(y)){e.push(`${d}: unexpected token format "${y}"`);continue}if(d.includes(".")||d.includes("{")||d.includes("}")||d.includes("#")){e.push(`${d}: IDs can\u2019t include any of the following: .{}#`);continue}Object.keys(y).length||e.push(`${d}: groups can\u2019t be empty`);let w={_original:{...y},_group:{id:g.join(".")||".",...f||{}},id:g.concat(d).join("."),$type:y.$type||f.$type,...y};if(w.hasOwnProperty("$value")){if(d.startsWith("$")){e.push(`${d}: token ID can\u2019t start with the $ character`);continue}if(dr(w.$value)){e.push(`${w.id}: missing "$value"`);continue}if(!!w.$extensions&&w.$extensions.mode&&!M(w.$extensions.mode)&&e.push(`${w.id}: "mode" must be an object`),f.$extensions.requiredModes.length)for(let $ of f.$extensions.requiredModes)(!w.$extensions||!w.$extensions.mode||!w.$extensions.mode[$])&&e.push(`${w.id}: missing mode "${$}" required from parent group`);n[w.id]=w}else{let $={...f},k={};for(let c of Object.keys(y))c.startsWith("$")?(c==="$extensions"?$.$extensions={...$.$extensions,...y.$extensions}:$[c]=y[c],Lr.has(c)||(o.warnings||(o.warnings=[]),o.warnings.push(`Unknown property "${c}"`))):k[c]=y[c];if(Object.values(k).every(c=>M(c)))a(k,[...g,d],$);else throw new Error(`${d}: missing $type`)}}}let s={$extensions:{requiredModes:[]}},h={};for(let i of Object.keys(r))i.startsWith("$")?(i==="$extensions"?s.$extensions={...s.$extensions,...r.$extensions}:s[i]=r[i],Lr.has(i)||(o.warnings||(o.warnings=[]),o.warnings.push(`Unknown property "${i}"`)),o.result.metadata[i]=r[i]):h[i]=r[i];if(a(h,[],s),e.length)return o.errors=e,o;let l={};for(let i of Object.values(n))if(l[i.id]=i.$value,i.$extensions&&i.$extensions.mode)for(let[g,f]of Object.entries(i.$extensions.mode||{}))l[`${i.id}#${g}`]=f;function u(i,g){return X(g,{default(f){return f},string(f){if(!F.test(f))return f;let d=Vr(f);if(!l[d])throw new Error(`${i}: can\u2019t find ${f}`);let y=l[d];if(typeof y=="string"&&F.test(y)&&i===Vr(y))throw new Error(`${i}: can\u2019t reference circular alias ${f}`);return l[d]},array(f){return f.map(d=>u(i,d))},object(f){for(let d of Object.keys(f))f[d]=u(i,f[d]);return f}})}for(;cr(l);)try{for(let[i,g]of Object.entries(l))l[i]=u(i,g)}catch(i){e.push(i.message||i);break}if(e.length)return o.errors=e,o;function p(i,g){let f=n[i];if(!(!f.$extensions||!f.$extensions.mode))for(let d of Object.keys(f.$extensions.mode||{}))n[i].$extensions.mode[d]=g(l[`${i}#${d}`])}for(let[i,g]of Object.entries(n))try{switch(g.$type){case"color":n[i].$value=z(l[i]),p(i,z);break;case"dimension":n[i].$value=E(l[i]),p(i,E);break;case"font":n[i].$value=D(l[i]),p(i,D);break;case"duration":n[i].$value=B(l[i]),p(i,B);break;case"cubicBezier":n[i].$value=T(l[i]),p(i,T);break;case"link":n[i].$value=or(l[i]),p(i,or);break;case"strokeStyle":n[i].$value=I(l[i]),p(i,I);break;case"border":n[i].$value=nr(l[i]),p(i,nr);break;case"transition":n[i].$value=ir(l[i]),p(i,ir);break;case"shadow":n[i].$value=ar(l[i]),p(i,ar);break;case"gradient":n[i].$value=sr(l[i]),p(i,sr);break;case"typography":n[i].$value=lr(l[i]),p(i,lr);break;default:n[i].value=l[i],p(i,f=>f);break}}catch(f){e.push(`${i}: ${f.message||f}`)}return e.length&&(o.errors=e),t.length&&(o.warnings=t),o.result.tokens=Object.values(n),o}function cr(r){return Object.values(r).some(e=>X(e,{default:()=>!1,string:t=>F.test(t),array:t=>t.some(o=>typeof o=="string"?F.test(o):M(o)?cr(o):!1),object:t=>cr(t)}))}function Vr(r){let e=r.match(F);return e?e[1]:r}var et={parse:ur};export{et as default,ur as parse}; | ||
- `)}`)}else typeof o=="number"&&(e.fontWeight=Math.max(1,Math.min(999,o)));break}default:{e[n]=typeof o=="string"&&parseFloat(o)>=0?E(o):o;break}}}return e}var I=/^\{([^}]+)\}$/,Lr=new Set(["$description","$name","$type","$value","$extensions"]);function cr(r){let e=[],t=[],o={result:{metadata:{},tokens:[]}};if(!r||typeof r!="object"||Array.isArray(r))return e.push(`Invalid schema type. Expected object, received "${Array.isArray(r)?"Array":typeof r}"`),o.errors=e,o;let n={};function a(i,g=[],f={$extensions:{requiredModes:[]}}){if(!(!i||!A(i)))for(let[d,y]of Object.entries(i)){if(!y||!A(y)){e.push(`${d}: unexpected token format "${y}"`);continue}if(d.includes(".")||d.includes("{")||d.includes("}")||d.includes("#")){e.push(`${d}: IDs can\u2019t include any of the following: .{}#`);continue}Object.keys(y).length||e.push(`${d}: groups can\u2019t be empty`);let w={_original:{...y},_group:{id:g.join(".")||".",...f||{}},id:g.concat(d).join("."),$type:y.$type||f.$type,...y};if(w.hasOwnProperty("$value")){if(d.startsWith("$")){e.push(`${d}: token ID can\u2019t start with the $ character`);continue}if(dr(w.$value)){e.push(`${w.id}: missing "$value"`);continue}if(!!w.$extensions&&w.$extensions.mode&&!A(w.$extensions.mode)&&e.push(`${w.id}: "mode" must be an object`),f.$extensions.requiredModes.length)for(let $ of f.$extensions.requiredModes)(!w.$extensions||!w.$extensions.mode||!w.$extensions.mode[$])&&e.push(`${w.id}: missing mode "${$}" required from parent group`);n[w.id]=w}else{let $={...f},x={};for(let u of Object.keys(y))u.startsWith("$")?(u==="$extensions"?$.$extensions={...$.$extensions,...y.$extensions}:$[u]=y[u],Lr.has(u)||(o.warnings||(o.warnings=[]),o.warnings.push(`Unknown property "${u}"`))):x[u]=y[u];if(Object.values(x).every(u=>A(u)))a(x,[...g,d],$);else throw new Error(`${d}: missing $type`)}}}let s={$extensions:{requiredModes:[]}},h={};for(let i of Object.keys(r))i.startsWith("$")?(i==="$extensions"?s.$extensions={...s.$extensions,...r.$extensions}:s[i]=r[i],Lr.has(i)||(o.warnings||(o.warnings=[]),o.warnings.push(`Unknown property "${i}"`)),o.result.metadata[i]=r[i]):h[i]=r[i];if(a(h,[],s),e.length)return o.errors=e,o;let l={};for(let i of Object.values(n))if(l[i.id]=i.$value,i.$extensions&&i.$extensions.mode)for(let[g,f]of Object.entries(i.$extensions.mode||{}))l[`${i.id}#${g}`]=f;function c(i,g){return P(g,{default(f){return f},string(f){if(!I.test(f))return f;let d=Vr(f);if(!l[d])throw new Error(`${i}: can\u2019t find ${f}`);let y=l[d];if(typeof y=="string"&&I.test(y)&&i===Vr(y))throw new Error(`${i}: can\u2019t reference circular alias ${f}`);return l[d]},array(f){return f.map(d=>c(i,d))},object(f){for(let d of Object.keys(f))f[d]=c(i,f[d]);return f}})}for(;ur(l);)try{for(let[i,g]of Object.entries(l))l[i]=c(i,g)}catch(i){e.push(i.message||i);break}if(e.length)return o.errors=e,o;function p(i,g){let f=n[i];if(!(!f.$extensions||!f.$extensions.mode))for(let d of Object.keys(f.$extensions.mode||{}))n[i].$extensions.mode[d]=g(l[`${i}#${d}`])}for(let[i,g]of Object.entries(n))try{switch(g.$type){case"color":n[i].$value=z(l[i]),p(i,z);break;case"dimension":n[i].$value=E(l[i]),p(i,E);break;case"font":n[i].$value=D(l[i]),p(i,D);break;case"duration":n[i].$value=G(l[i]),p(i,G);break;case"cubicBezier":n[i].$value=S(l[i]),p(i,S);break;case"link":n[i].$value=or(l[i]),p(i,or);break;case"strokeStyle":n[i].$value=T(l[i]),p(i,T);break;case"border":n[i].$value=nr(l[i]),p(i,nr);break;case"transition":n[i].$value=ir(l[i]),p(i,ir);break;case"shadow":n[i].$value=ar(l[i]),p(i,ar);break;case"gradient":n[i].$value=sr(l[i]),p(i,sr);break;case"typography":n[i].$value=lr(l[i]),p(i,lr);break;default:n[i].value=l[i],p(i,f=>f);break}}catch(f){e.push(`${i}: ${f.message||f}`)}return e.length&&(o.errors=e),t.length&&(o.warnings=t),o.result.tokens=Object.values(n),o}function ur(r){return Object.values(r).some(e=>P(e,{default:()=>!1,string:t=>I.test(t),array:t=>t.some(o=>typeof o=="string"?I.test(o):A(o)?ur(o):!1),object:t=>ur(t)}))}function Vr(r){let e=r.match(I);return e?e[1]:r}var ot={parse:cr};export{ot as default,cr as parse}; | ||
//# sourceMappingURL=index.min.js.map |
@@ -8,4 +8,4 @@ import type { ParsedGradientToken } from '../../@types/token'; | ||
* "$value": [ | ||
* { "color": "blue", "position": 0 }, | ||
* { "color": "lime", "position": 1 } | ||
* {"color": "blue", "position": 0}, | ||
* {"color": "lime", "position": 1} | ||
* ] | ||
@@ -12,0 +12,0 @@ * } |
@@ -8,4 +8,4 @@ import { normalizeColorValue } from './color.js'; | ||
* "$value": [ | ||
* { "color": "blue", "position": 0 }, | ||
* { "color": "lime", "position": 1 } | ||
* {"color": "blue", "position": 0}, | ||
* {"color": "lime", "position": 1} | ||
* ] | ||
@@ -12,0 +12,0 @@ * } |
{ | ||
"name": "@cobalt-ui/core", | ||
"description": "CLI for using the W3C design token format", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"author": { | ||
@@ -21,3 +21,3 @@ "name": "Drew Powers", | ||
"dependencies": { | ||
"@cobalt-ui/utils": "^0.4.0", | ||
"@cobalt-ui/utils": "^0.5.0", | ||
"better-color-tools": "^0.9.1" | ||
@@ -27,5 +27,4 @@ }, | ||
"@types/node": "^17.0.45", | ||
"@types/svgo": "^2.6.3", | ||
"chai": "^4.3.6", | ||
"mocha": "^10.0.0" | ||
"@types/svgo": "^2.6.4", | ||
"vitest": "^0.24.0" | ||
}, | ||
@@ -38,4 +37,4 @@ "scripts": { | ||
"bundle": "esbuild --format=esm --bundle --minify dist/index.js --outfile=dist/index.min.js --sourcemap", | ||
"test": "mocha --parallel" | ||
"test": "vitest run" | ||
} | ||
} |
@@ -20,2 +20,3 @@ # @cobalt-ui/core | ||
<!-- prettier-ignore --> | ||
```js | ||
@@ -26,9 +27,9 @@ import co from '@cobalt-ui/core'; | ||
color: { | ||
red: { type: 'color', value: '#e34850' }, | ||
green: { type: 'color', value: '#2d9d78' }, | ||
blue: { type: 'color', value: '#2680eb' }, | ||
red: {type: 'color', value: '#e34850'}, | ||
green: {type: 'color', value: '#2d9d78'}, | ||
blue: {type: 'color', value: '#2680eb'}, | ||
}, | ||
}; | ||
const { errors, warnings, result } = co.parse(designTokens); | ||
const {errors, warnings, result} = co.parse(designTokens); | ||
``` | ||
@@ -35,0 +36,0 @@ |
import type SVGO from 'svgo'; | ||
import type { Group, ParsedToken } from './@types/token'; | ||
import type {Group, ParsedToken} from './@types/token'; | ||
export type { | ||
@@ -40,4 +40,4 @@ BorderToken, | ||
import { parse } from './parse/index.js'; | ||
export { parse, ParseResult } from './parse/index.js'; | ||
import {parse} from './parse/index.js'; | ||
export {parse, ParseResult} from './parse/index.js'; | ||
@@ -90,3 +90,3 @@ export interface BuildResult { | ||
/** main build fn */ | ||
build(options: { tokens: ParsedToken[]; metadata: Record<string, unknown>; rawSchema: Group }): Promise<BuildResult[]>; | ||
build(options: {tokens: ParsedToken[]; metadata: Record<string, unknown>; rawSchema: Group}): Promise<BuildResult[]>; | ||
} | ||
@@ -93,0 +93,0 @@ |
@@ -1,15 +0,15 @@ | ||
import type { Group, ParsedToken, TokenType, TokenOrGroup } from '../@types/token'; | ||
import { isEmpty, isObj, splitType } from '../util.js'; | ||
import { normalizeColorValue } from './tokens/color.js'; | ||
import { normalizeFontValue } from './tokens/font.js'; | ||
import { normalizeDurationValue } from './tokens/duration.js'; | ||
import { normalizeDimensionValue } from './tokens/dimension.js'; | ||
import { normalizeCubicBezierValue } from './tokens/cubic-bezier.js'; | ||
import { normalizeLinkValue } from './tokens/link.js'; | ||
import { normalizeStrokeStyleValue } from './tokens/stroke-style.js'; | ||
import { normalizeBorderValue } from './tokens/border.js'; | ||
import { normalizeTransitionValue } from './tokens/transition.js'; | ||
import { normalizeShadowValue } from './tokens/shadow.js'; | ||
import { normalizeGradientValue } from './tokens/gradient.js'; | ||
import { normalizeTypographyValue } from './tokens/typography.js'; | ||
import type {Group, ParsedToken, TokenType, TokenOrGroup} from '../@types/token'; | ||
import {isEmpty, isObj, splitType} from '../util.js'; | ||
import {normalizeColorValue} from './tokens/color.js'; | ||
import {normalizeFontValue} from './tokens/font.js'; | ||
import {normalizeDurationValue} from './tokens/duration.js'; | ||
import {normalizeDimensionValue} from './tokens/dimension.js'; | ||
import {normalizeCubicBezierValue} from './tokens/cubic-bezier.js'; | ||
import {normalizeLinkValue} from './tokens/link.js'; | ||
import {normalizeStrokeStyleValue} from './tokens/stroke-style.js'; | ||
import {normalizeBorderValue} from './tokens/border.js'; | ||
import {normalizeTransitionValue} from './tokens/transition.js'; | ||
import {normalizeShadowValue} from './tokens/shadow.js'; | ||
import {normalizeGradientValue} from './tokens/gradient.js'; | ||
import {normalizeTypographyValue} from './tokens/typography.js'; | ||
@@ -32,3 +32,3 @@ export interface ParseResult { | ||
const warnings: string[] = []; | ||
const result: ParseResult = { result: { metadata: {}, tokens: [] } }; | ||
const result: ParseResult = {result: {metadata: {}, tokens: []}}; | ||
if (!schema || typeof schema !== 'object' || Array.isArray(schema)) { | ||
@@ -49,3 +49,3 @@ errors.push(`Invalid schema type. Expected object, received "${Array.isArray(schema) ? 'Array' : typeof schema}"`); | ||
const tokens: Record<string, ParsedToken> = {}; | ||
function walk(node: TokenOrGroup, chain: string[] = [], group: InheritedGroup = { $extensions: { requiredModes: [] } }): void { | ||
function walk(node: TokenOrGroup, chain: string[] = [], group: InheritedGroup = {$extensions: {requiredModes: []}}): void { | ||
if (!node || !isObj(node)) return; | ||
@@ -67,3 +67,3 @@ for (const [k, v] of Object.entries(node)) { | ||
const token = { | ||
_original: { ...v }, | ||
_original: {...v}, | ||
_group: { | ||
@@ -92,4 +92,3 @@ id: chain.join('.') || '.', | ||
for (const modeID of group.$extensions.requiredModes) { | ||
if (!token.$extensions || !token.$extensions.mode || !token.$extensions.mode[modeID]) | ||
errors.push(`${token.id}: missing mode "${modeID}" required from parent group`); | ||
if (!token.$extensions || !token.$extensions.mode || !token.$extensions.mode[modeID]) errors.push(`${token.id}: missing mode "${modeID}" required from parent group`); | ||
} | ||
@@ -101,3 +100,3 @@ } | ||
else { | ||
const nextGroup = { ...group }; | ||
const nextGroup = {...group}; | ||
@@ -109,3 +108,3 @@ const groupTokens: Record<string, TokenOrGroup> = {}; | ||
// merge $extensions; don’t overwrite them | ||
if (propertyKey === '$extensions') nextGroup.$extensions = { ...nextGroup.$extensions, ...v.$extensions }; | ||
if (propertyKey === '$extensions') nextGroup.$extensions = {...nextGroup.$extensions, ...v.$extensions}; | ||
else (nextGroup as any)[propertyKey] = v[propertyKey]; | ||
@@ -135,7 +134,7 @@ if (!RESERVED_KEYS.has(propertyKey)) { | ||
const group: InheritedGroup = { $extensions: { requiredModes: [] } }; | ||
const group: InheritedGroup = {$extensions: {requiredModes: []}}; | ||
const topNodes: Record<string, TokenOrGroup> = {}; | ||
for (const k of Object.keys(schema)) { | ||
if (k.startsWith('$')) { | ||
if (k === '$extensions') group.$extensions = { ...group.$extensions, ...schema.$extensions }; | ||
if (k === '$extensions') group.$extensions = {...group.$extensions, ...schema.$extensions}; | ||
else (group as any)[k] = schema[k]; | ||
@@ -346,3 +345,3 @@ if (!RESERVED_KEYS.has(k)) { | ||
object: (value) => unaliasedValues(value as Record<string, unknown>), | ||
}) | ||
}), | ||
); | ||
@@ -349,0 +348,0 @@ } |
@@ -1,6 +0,6 @@ | ||
import type { ParsedBorderToken } from '../../@types/token'; | ||
import { isObj } from '../../util.js'; | ||
import { normalizeColorValue } from './color.js'; | ||
import { normalizeDimensionValue } from './dimension.js'; | ||
import { normalizeStrokeStyleValue } from './stroke-style.js'; | ||
import type {ParsedBorderToken} from '../../@types/token'; | ||
import {isObj} from '../../util.js'; | ||
import {normalizeColorValue} from './color.js'; | ||
import {normalizeDimensionValue} from './dimension.js'; | ||
import {normalizeStrokeStyleValue} from './stroke-style.js'; | ||
@@ -7,0 +7,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import type { ParsedColorToken } from '../../@types/token'; | ||
import type {ParsedColorToken} from '../../@types/token'; | ||
import color from 'better-color-tools'; | ||
@@ -3,0 +3,0 @@ |
@@ -1,2 +0,2 @@ | ||
import type { ParsedCubicBezierToken } from '../../@types/token'; | ||
import type {ParsedCubicBezierToken} from '../../@types/token'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import type { ParsedDimensionToken } from '../../@types/token'; | ||
import type {ParsedDimensionToken} from '../../@types/token'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import type { ParsedDurationToken } from '../../@types/token'; | ||
import type {ParsedDurationToken} from '../../@types/token'; | ||
@@ -3,0 +3,0 @@ const DURATION_RE = /^\d+(\.\d+)?(ms|s)$/; |
@@ -1,2 +0,2 @@ | ||
import type { ParsedFontToken } from '../../@types/token'; | ||
import type {ParsedFontToken} from '../../@types/token'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,3 +0,3 @@ | ||
import type { GradientStop, ParsedGradientToken } from '../../@types/token'; | ||
import { normalizeColorValue } from './color.js'; | ||
import type {GradientStop, ParsedGradientToken} from '../../@types/token'; | ||
import {normalizeColorValue} from './color.js'; | ||
@@ -10,4 +10,4 @@ /** | ||
* "$value": [ | ||
* { "color": "blue", "position": 0 }, | ||
* { "color": "lime", "position": 1 } | ||
* {"color": "blue", "position": 0}, | ||
* {"color": "lime", "position": 1} | ||
* ] | ||
@@ -14,0 +14,0 @@ * } |
@@ -1,2 +0,2 @@ | ||
import type { ParsedLinkToken } from '../../@types/token'; | ||
import type {ParsedLinkToken} from '../../@types/token'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,4 +0,4 @@ | ||
import type { ShadowValue } from '../../@types/token'; | ||
import { normalizeColorValue } from './color.js'; | ||
import { normalizeDimensionValue } from './dimension.js'; | ||
import type {ShadowValue} from '../../@types/token'; | ||
import {normalizeColorValue} from './color.js'; | ||
import {normalizeDimensionValue} from './dimension.js'; | ||
@@ -5,0 +5,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import type { ParsedStrokeStyleToken } from '../../@types/token'; | ||
import type {ParsedStrokeStyleToken} from '../../@types/token'; | ||
@@ -26,5 +26,4 @@ const VALID_STROKE_STYLES = new Set(['solid', 'dashed', 'dotted', 'double', 'groove', 'ridge', 'outset', 'inset']); | ||
export function normalizeStrokeStyleValue(value: unknown): ParsedStrokeStyleToken['$value'] { | ||
if (!VALID_STROKE_STYLES.has(value as any)) | ||
throw new Error(`Unsupported stroke type "${value}", must be one of: \n - ${[...VALID_STROKE_STYLES].join('\n - ')}`); | ||
if (!VALID_STROKE_STYLES.has(value as any)) throw new Error(`Unsupported stroke type "${value}", must be one of: \n - ${[...VALID_STROKE_STYLES].join('\n - ')}`); | ||
return value as string; | ||
} |
@@ -1,4 +0,4 @@ | ||
import type { CubicBezierToken, ParsedTransitionToken } from '../../@types/token'; | ||
import { normalizeDurationValue } from './duration.js'; | ||
import { normalizeCubicBezierValue } from './cubic-bezier.js'; | ||
import type {CubicBezierToken, ParsedTransitionToken} from '../../@types/token'; | ||
import {normalizeDurationValue} from './duration.js'; | ||
import {normalizeCubicBezierValue} from './cubic-bezier.js'; | ||
@@ -5,0 +5,0 @@ const EASE: CubicBezierToken['$value'] = [0.25, 0.1, 0.25, 1]; |
@@ -1,5 +0,5 @@ | ||
import type { ParsedTypographyValue, FontWeightName } from '../../@types/token'; | ||
import { camelize } from '@cobalt-ui/utils'; | ||
import { normalizeFontValue } from './font.js'; | ||
import { normalizeDimensionValue } from './dimension.js'; | ||
import type {ParsedTypographyValue, FontWeightName} from '../../@types/token'; | ||
import {camelize} from '@cobalt-ui/utils'; | ||
import {normalizeFontValue} from './font.js'; | ||
import {normalizeDimensionValue} from './dimension.js'; | ||
@@ -6,0 +6,0 @@ const VALID_WEIGHT_NAMES = new Map<FontWeightName, number>([ |
@@ -24,3 +24,3 @@ export function isObj(value: unknown): boolean { | ||
array?: (value: Array<unknown>) => any; | ||
} | ||
}, | ||
): any { | ||
@@ -27,0 +27,0 @@ if ((input === undefined || input === null) && ops.undefined) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
3
40
163541
67
2108
+ Added@cobalt-ui/utils@0.5.3(transitive)
- Removed@cobalt-ui/utils@0.4.0(transitive)
Updated@cobalt-ui/utils@^0.5.0