@aberhamm/liquid-glass-react 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),l=require("react/jsx-runtime"),sn={supportsBackdropFilter:!1,isChromium:!1,supportsSvgBackdropDisplacement:!1,isFirefox:!1,prefersReducedMotion:!1,prefersReducedTransparency:!1,prefersContrastMore:!1,canRefract:!1};function De(){return{...sn}}function rn(){return typeof window<"u"&&typeof document<"u"&&typeof navigator<"u"}function on(){return typeof CSS>"u"||typeof CSS.supports!="function"?!1:CSS.supports("backdrop-filter","blur(1px)")||CSS.supports("-webkit-backdrop-filter","blur(1px)")}function an(n){return/Firefox/i.test(n)}function cn(n,t){return t?!1:/Chrome|Chromium|Edg|OPR/i.test(n)}function ln(){return typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function un(){return typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-transparency: reduce)").matches}function dn(){return typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-contrast: more)").matches}function xt(){if(!rn())return De();const n=navigator.userAgent??"",t=on(),e=an(n),s=cn(n,e),r=s,o=ln(),a=un(),c=dn();return{supportsBackdropFilter:t,isChromium:s,supportsSvgBackdropDisplacement:r,isFirefox:e,prefersReducedMotion:o,prefersReducedTransparency:a,prefersContrastMore:c,canRefract:t&&r}}function yt(){const[n,t]=f.useState(De);return f.useEffect(()=>{t(xt())},[]),n}function J(n,t,e,s,r){const o=e/2,a=s/2,c=Math.max(0,Math.min(r,Math.min(o,a))),i=Math.abs(n)-(o-c),d=Math.abs(t)-(a-c),h=Math.max(i,0),x=Math.max(d,0),b=Math.sqrt(h*h+x*x),m=Math.min(Math.max(i,d),0);return b+m-c}function ee(n,t,e){if(n===t)return e<n?0:1;const s=Math.max(0,Math.min(1,(e-n)/(t-n)));return s*s*(3-2*s)}function et(n){const t=Math.round(128+n*127);return t<0?0:t>255?255:t}function fn(n,t,e){const s=new Uint8ClampedArray(t*e*4),r=t/2,o=e/2,a=Math.min(t,e)*.35;for(let c=0;c<e;c++)for(let i=0;i<t;i++){const d=i+.5-r,h=c+.5-o;let x=0,b=0;if(n==="polar"){const u=Math.sqrt(d*d+h*h),p=J(d,h,t,e,a),g=ee(-Math.min(t,e)*.5,0,p),S=u===0?0:d/u,R=u===0?0:h/u;x=S*g*.9,b=R*g*.9}else{let u,p,g;n==="standard"?(u=-Math.min(t,e)*.18,p=0,g=.7):n==="prominent"?(u=-Math.min(t,e)*.4,p=0,g=1):(u=-Math.min(t,e)*.1,p=Math.min(t,e)*.04,g=.85);const S=J(d-1,h,t,e,a),R=J(d+1,h,t,e,a),T=J(d,h-1,t,e,a),v=J(d,h+1,t,e,a),E=ee(u,p,S),te=ee(u,p,R),ne=ee(u,p,T),G=ee(u,p,v);x=(te-E)*.5*g,b=(G-ne)*.5*g}const m=(c*t+i)*4;s[m]=et(x),s[m+1]=0,s[m+2]=et(b),s[m+3]=255}return s}const mn=(()=>{const n=new Uint32Array(256);for(let t=0;t<256;t++){let e=t;for(let s=0;s<8;s++)e=e&1?3988292384^e>>>1:e>>>1;n[t]=e>>>0}return n})();function pn(n){let t=4294967295;for(let e=0;e<n.length;e++)t=mn[(t^n[e])&255]^t>>>8;return(t^4294967295)>>>0}function gn(n){let t=1,e=0;const s=65521;for(let r=0;r<n.length;r++)t=(t+n[r])%s,e=(e+t)%s;return(e<<16|t)>>>0}function hn(n){const e=Math.max(1,Math.ceil(n.length/65535)),s=new Uint8Array(2+e*5+n.length+4);let r=0;s[r++]=120,s[r++]=1;let o=0;do{const c=Math.min(n.length-o,65535),i=o+c>=n.length;s[r++]=i?1:0,s[r++]=c&255,s[r++]=c>>>8&255;const d=~c&65535;s[r++]=d&255,s[r++]=d>>>8&255,s.set(n.subarray(o,o+c),r),r+=c,o+=c}while(o<n.length);const a=gn(n);return s[r++]=a>>>24&255,s[r++]=a>>>16&255,s[r++]=a>>>8&255,s[r++]=a&255,s}function Te(n,t){const e=t.length,s=new Uint8Array(12+e);s[0]=e>>>24&255,s[1]=e>>>16&255,s[2]=e>>>8&255,s[3]=e&255,s[4]=n.charCodeAt(0),s[5]=n.charCodeAt(1),s[6]=n.charCodeAt(2),s[7]=n.charCodeAt(3),s.set(t,8);const r=pn(s.subarray(4,8+e));return s[8+e]=r>>>24&255,s[9+e]=r>>>16&255,s[10+e]=r>>>8&255,s[11+e]=r&255,s}function St(n,t,e){const s=t*4,r=new Uint8Array(e*(s+1));for(let u=0;u<e;u++){const p=u*(s+1);r[p]=0,r.set(n.subarray(u*s,u*s+s),p+1)}const o=hn(r),a=new Uint8Array(13);a[0]=t>>>24&255,a[1]=t>>>16&255,a[2]=t>>>8&255,a[3]=t&255,a[4]=e>>>24&255,a[5]=e>>>16&255,a[6]=e>>>8&255,a[7]=e&255,a[8]=8,a[9]=6,a[10]=0,a[11]=0,a[12]=0;const c=Uint8Array.from([137,80,78,71,13,10,26,10]),i=Te("IHDR",a),d=Te("IDAT",o),h=Te("IEND",new Uint8Array(0)),x=c.length+i.length+d.length+h.length,b=new Uint8Array(x);let m=0;for(const u of[c,i,d,h])b.set(u,m),m+=u.length;return b}const k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Rt(n){let t="",e=0;for(;e+2<n.length;e+=3){const r=n[e]<<16|n[e+1]<<8|n[e+2];t+=k.charAt(r>>>18&63)+k.charAt(r>>>12&63)+k.charAt(r>>>6&63)+k.charAt(r&63)}const s=n.length-e;if(s===1){const r=n[e]<<16;t+=`${k.charAt(r>>>18&63)}${k.charAt(r>>>12&63)}==`}else if(s===2){const r=n[e]<<16|n[e+1]<<8;t+=`${k.charAt(r>>>18&63)}${k.charAt(r>>>12&63)}${k.charAt(r>>>6&63)}=`}return t}function bn(){const n=new Uint8ClampedArray([0,0,0,0]);return`data:image/png;base64,${Rt(St(n,1,1))}`}const xn=32,Ne=16,Y=new Map;function tt(n){return Math.max(Ne,Math.round(n/Ne)*Ne)}function vt(n,t,e){if(!Number.isFinite(t)||!Number.isFinite(e)||t<=0||e<=0)return bn();const s=tt(t),r=tt(e),o=`${n}:${s}x${r}`,a=Y.get(o);if(a!==void 0)return Y.delete(o),Y.set(o,a),a;const c=fn(n,s,r),i=`data:image/png;base64,${Rt(St(c,s,r))}`;if(Y.set(o,i),Y.size>xn){const d=Y.keys().next().value;d!==void 0&&Y.delete(d)}return i}const At=["inset 0 1px 1px 0 rgba(255, 255, 255, 0.75)","inset 1px 0 1px 0 rgba(255, 255, 255, 0.4)","inset 0 -1px 2px 0 rgba(0, 0, 0, 0.18)","inset -1px 0 2px 0 rgba(0, 0, 0, 0.12)","inset 0 0 0 1px rgba(255, 255, 255, 0.22)"].join(", "),Ct=["inset 0 1px 1px 0 rgba(255, 255, 255, 0.35)","inset 1px 0 1px 0 rgba(255, 255, 255, 0.18)","inset 0 -1px 2px 0 rgba(0, 0, 0, 0.55)","inset -1px 0 2px 0 rgba(0, 0, 0, 0.45)","inset 0 0 0 1px rgba(255, 255, 255, 0.1)"].join(", ");function ie(n){return n==="dark"?Ct:At}const yn=200,Sn=300,nt=.3,st=.15,rt=.8,ot=.1;function Fe(n,t,e){return Math.min(e,Math.max(t,n))}function Et(n){return Number.isFinite(n)?Fe(1-n/yn,0,1):0}function wt(n,t,e,s,r){if(!(r>0))return{scaleX:1,scaleY:1};const o=n-e,a=t-s,c=Math.hypot(o,a);if(c===0||!Number.isFinite(c))return{scaleX:1,scaleY:1};const i=Et(c);if(i===0)return{scaleX:1,scaleY:1};const d=o/c,h=a/c,x=Math.abs(d),b=Math.abs(h),m=Math.min(c/Sn,1)*r*i,u=Fe(1+x*m*nt-b*m*st,rt,Number.POSITIVE_INFINITY),p=Fe(1+b*m*nt-x*m*st,rt,Number.POSITIVE_INFINITY);return{scaleX:u,scaleY:p}}function Mt(n,t,e,s,r){if(!(r>0))return{x:0,y:0};const o=n-e,a=t-s,c=Math.hypot(o,a);if(c===0||!Number.isFinite(c))return{x:0,y:0};const i=Et(c);return i===0?{x:0,y:0}:{x:o*r*ot*i,y:a*r*ot*i}}const j={displacementScale:70,blurAmount:.0625,saturation:140,aberrationIntensity:2,cornerRadius:999,mode:"standard",padding:"24px 32px",elasticity:.15},Rn=16,vn={light:"rgba(255, 255, 255, 0.75)",dark:"rgba(30, 30, 35, 0.75)"},An={light:"rgba(255, 255, 255, 0.92)",dark:"rgba(30, 30, 35, 0.92)"},Cn={light:"rgba(0, 0, 0, 0.92)",dark:"rgba(255, 255, 255, 0.92)"},En=2,wn={light:"rgba(255, 255, 255, 0.92)",dark:"rgba(22, 22, 26, 0.92)"},Mn=100,pe={light:"rgba(255, 255, 255, 0.96)",dark:"rgba(17, 17, 20, 0.96)"},at="50%",ct="0%",it={rest:.55,hover:.85},Tn="70%",lt=.5,Nn="60%",ut={static:1,dark:1.35,light:.7},dt={rest:[{y:8,blur:24,alpha:.22},{y:1,blur:4,alpha:.14}],hover:[{y:12,blur:32,alpha:.28},{y:2,blur:8,alpha:.18}]},Ln={regular:{saturationFactor:1,forceNonAdaptive:!1,scrim:null},clear:{saturationFactor:.7,forceNonAdaptive:!0,scrim:{light:"rgba(0, 0, 0, 0.18)",dark:"rgba(0, 0, 0, 0.28)"}}},In="rgba(255, 255, 255, 0.1)",ft={color:"rgba(255, 255, 255, 0.5)",width:1},F={luminance:null,scheme:null,sampled:!1},Tt=.5;function Le(n){const t=n/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function Nt(n,t,e){const s=Le(n),r=Le(t),o=Le(e);return .2126*s+.7152*r+.0722*o}function Lt(n){return n>=Tt?"light":"dark"}function je(n){const t=Nt(n.r,n.g,n.b);return{luminance:t,scheme:Lt(t),sampled:!0}}function It(n){if(!n)return{r:0,g:0,b:0,a:0};const t=n.trim().toLowerCase();if(t==="transparent"||t==="none")return{r:0,g:0,b:0,a:0};const e=t.match(/rgba?\(([^)]+)\)/);if(!(e!=null&&e[1]))return{r:0,g:0,b:0,a:0};const s=e[1].split(/[\s,/]+/).filter(Boolean);if(s.length<3)return{r:0,g:0,b:0,a:0};const r=Ie(Number.parseFloat(s[0])),o=Ie(Number.parseFloat(s[1])),a=Ie(Number.parseFloat(s[2]));let c=1;const i=s[3];return i!==void 0&&(c=i.endsWith("%")?Number.parseFloat(i)/100:Number.parseFloat(i),Number.isFinite(c)||(c=1)),{r,g:o,b:a,a:kn(c)}}function Ie(n){return Number.isFinite(n)?Math.max(0,Math.min(255,Math.round(n))):0}function kn(n){return Math.max(0,Math.min(1,n))}function Fn(n,t){const e=n.a;return{r:n.r*e+t.r*(1-e),g:n.g*e+t.g*(1-e),b:n.b*e+t.b*(1-e)}}function kt(n,t){try{return n(t)}catch{return F}}function Ft(n,t){if(typeof document>"u"||typeof document.elementsFromPoint!="function"||typeof getComputedStyle!="function")return F;const e=document.elementsFromPoint(n.x,n.y);if(!e||e.length===0)return F;let s={r:255,g:255,b:255};const r=[];for(const o of e){if(t&&(o===t||t.contains(o)))continue;const a=getComputedStyle(o),c=a.backgroundImage&&a.backgroundImage!=="none",i=It(a.backgroundColor);if(c){r.push({r:128,g:128,b:128,a:1});break}if(i.a>0&&(r.push(i),i.a>=1))break}for(let o=r.length-1;o>=0;o--){const a=r[o];a&&(s=Fn(a,s))}return je(s)}function _t(n,t={}){const{strategy:e,ignore:s}=t;return kt(e??(o=>Ft(o,s)),n)}function _n(n,t=8){return()=>{if(typeof document>"u"||typeof document.createElement!="function")return F;const e=document.createElement("canvas");e.width=t,e.height=t;const s=e.getContext("2d");if(!s)return F;n(s,t,t);const{data:r}=s.getImageData(0,0,t,t);let o=0,a=0,c=0,i=0;for(let d=0;d<r.length;d+=4)o+=r[d]??0,a+=r[d+1]??0,c+=r[d+2]??0,i++;return i===0?F:je({r:o/i,g:a/i,b:c/i})}}function Ge(n,t={}){const{strategy:e,resampleOnScroll:s=!0,resampleOnResize:r=!0,disabled:o=!1}=t,[a,c]=f.useState(F),i=f.useRef(e);return i.current=e,f.useEffect(()=>{if(o){c(m=>m.sampled?F:m);return}if(typeof window>"u"||typeof document>"u")return;let d=0,h=!1;const x=()=>{const m=n.current;if(!m)return;const u=m.getBoundingClientRect(),p={x:u.left+u.width/2,y:u.top+u.height/2},g=_t(p,{strategy:i.current,ignore:m});h||c(S=>S.sampled===g.sampled&&S.luminance===g.luminance&&S.scheme===g.scheme?S:g)},b=()=>{d||(d=requestAnimationFrame(()=>{d=0,x()}))};return b(),s&&window.addEventListener("scroll",b,{passive:!0,capture:!0}),r&&window.addEventListener("resize",b,{passive:!0}),()=>{h=!0,d&&cancelAnimationFrame(d),s&&window.removeEventListener("scroll",b,{capture:!0}),r&&window.removeEventListener("resize",b)}},[n,o,s,r]),a}function Oe(n){const[t,e]=f.useState(!1);return f.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const s=window.matchMedia(n);e(s.matches);const r=o=>{e(o.matches)};return typeof s.addEventListener=="function"?(s.addEventListener("change",r),()=>s.removeEventListener("change",r)):(s.addListener(r),()=>s.removeListener(r))},[n]),t}const Dn="(prefers-reduced-motion: reduce)";function ge(){return Oe(Dn)}const _e={x:0,y:0},mt={mousePos:_e,offset:_e,isActive:!1};function pt(n){return n?n instanceof HTMLElement?n:n.current??null:null}function jn(){return typeof window>"u"?!1:"ontouchstart"in window||((navigator==null?void 0:navigator.maxTouchPoints)??0)>0}function Dt(n={}){const{container:t,globalMousePos:e,mouseOffset:s,elementRef:r}=n,o=ge(),[a,c]=f.useState(!1),[i,d]=f.useState(mt),h=f.useRef({container:t,elementRef:r});h.current={container:t,elementRef:r},f.useEffect(()=>{c(jn())},[]);const x=o||a,b=e!==void 0;if(f.useEffect(()=>{if(b||x||typeof window>"u"||typeof document>"u")return;const m=u=>{const{container:p,elementRef:g}=h.current,S=pt(p)??(g==null?void 0:g.current)??null;if(!S)return;const R=S.getBoundingClientRect(),T=R.left+R.width/2,v=R.top+R.height/2;d({mousePos:{x:u.clientX,y:u.clientY},offset:{x:u.clientX-T,y:u.clientY-v},isActive:!0})};return document.addEventListener("mousemove",m),()=>document.removeEventListener("mousemove",m)},[b,x]),x)return mt;if(b){const m=e;let u=s;if(u===void 0){const p=pt(t)??(r==null?void 0:r.current)??null;if(p){const g=p.getBoundingClientRect();u={x:m.x-(g.left+g.width/2),y:m.y-(g.top+g.height/2)}}else u=_e}return{mousePos:m,offset:u,isActive:!0}}return i}const Gn="(prefers-contrast: more)";function jt(){return Oe(Gn)}const On="(prefers-reduced-transparency: reduce)";function Gt(){return Oe(On)}const ke=16,$n=.015;function Bn(n,t){return(n?dt.hover:dt.rest).map(s=>{const r=Math.round(s.y*t*100)/100,o=Math.round(s.blur*t*100)/100,a=Math.round(Math.min(s.alpha*t,.6)*1e3)/1e3;return`0 ${r}px ${o}px rgba(0, 0, 0, ${a})`}).join(", ")}function gt(n){return Math.max(ke,Math.round(n/ke)*ke)}function Pn(){const[n,t]=f.useState(!1);return f.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const e=window.matchMedia("(prefers-color-scheme: dark)");t(e.matches);const s=r=>t(r.matches);return typeof e.addEventListener=="function"?(e.addEventListener("change",s),()=>e.removeEventListener("change",s)):(e.addListener(s),()=>e.removeListener(s))},[]),n}function ht(n){return typeof n=="number"?`${n}px`:n}function Un(n,t,e){return e||`blur(${n}px) saturate(${t}%)`}function bt({filterId:n,mode:t,width:e,height:s,effectiveScale:r,aberrationIntensity:o,blurStdDeviation:a,saturation:c}){const i=t==="turbulence",d=r+o,h=r,x=r-o,b=i?l.jsxs(l.Fragment,{children:[l.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:$n,numOctaves:2,seed:1,result:"noise"}),l.jsx("feGaussianBlur",{in:"noise",stdDeviation:1.5,result:"dispSource"})]}):l.jsx("feImage",{href:vt(t,e,s),x:"0",y:"0",width:e,height:s,preserveAspectRatio:"none",result:"dispSource"}),m=(R,T,v)=>{const E=T==="R"?"1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0":T==="G"?"0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0":"0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0";return l.jsxs(l.Fragment,{children:[l.jsx("feDisplacementMap",{in:"SourceGraphic",in2:"dispSource",scale:R,xChannelSelector:"R",yChannelSelector:"B",result:`${v}_disp`}),l.jsx("feColorMatrix",{in:`${v}_disp`,type:"matrix",values:E,result:v})]})},u=Math.min(e,s)*.5,p=Math.min(Math.max(a,0),u),g=e*.5+p*3,S=s*.5+p*3;return l.jsx("svg",{"aria-hidden":"true",width:"0",height:"0",style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:l.jsx("defs",{children:l.jsxs("filter",{id:n,primitiveUnits:"userSpaceOnUse",x:-g,y:-S,width:e+g*2,height:s+S*2,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[b,m(d,"R","chanR"),m(h,"G","chanG"),m(x,"B","chanB"),l.jsx("feComposite",{in:"chanR",in2:"chanG",operator:"arithmetic",k1:"0",k2:"1",k3:"1",k4:"0",result:"chanRG"}),l.jsx("feComposite",{in:"chanRG",in2:"chanB",operator:"arithmetic",k1:"0",k2:"1",k3:"1",k4:"0",result:"aberrated"}),l.jsx("feGaussianBlur",{in:"aberrated",stdDeviation:.5,result:"softened"}),l.jsxs("radialGradient",{id:`${n}-edge`,cx:"50%",cy:"50%",r:"50%",children:[l.jsx("stop",{offset:"0%",stopColor:"#000000",stopOpacity:"0"}),l.jsx("stop",{offset:"70%",stopColor:"#000000",stopOpacity:"0"}),l.jsx("stop",{offset:"100%",stopColor:"#ffffff",stopOpacity:"1"})]}),l.jsx("feImage",{href:`#${n}-edge`,x:"0",y:"0",width:e,height:s,preserveAspectRatio:"none",result:"edgeMask"}),l.jsx("feComposite",{in:"softened",in2:"edgeMask",operator:"in",result:"edgeOnly"}),l.jsx("feComposite",{in:"edgeOnly",in2:"SourceGraphic",operator:"over",result:"refracted"}),l.jsx("feGaussianBlur",{in:"refracted",stdDeviation:p,result:"blurred"}),l.jsx("feColorMatrix",{in:"blurred",type:"saturate",values:`${c/100}`})]})})})}function Yn({targetRef:n,onScheme:t}){const{sampled:e,scheme:s}=Ge(n);return f.useEffect(()=>{t(e?s:null)},[e,s,t]),null}function Hn({targetRef:n,onScheme:t}){const{sampled:e,scheme:s}=Ge(n);return f.useEffect(()=>{t(e?s:null)},[e,s,t]),null}function he({children:n,displacement:t=!1,displacementScale:e=j.displacementScale,blurAmount:s=j.blurAmount,saturation:r=j.saturation,aberrationIntensity:o=j.aberrationIntensity,elasticity:a=j.elasticity,cornerRadius:c=j.cornerRadius,padding:i=j.padding,overLight:d,adaptiveTint:h=!1,scrollAwareShadow:x=!1,variant:b="regular",mode:m=j.mode,refract:u,size:p,center:g,behind:S,className:R,style:T,onClick:v,globalMousePos:E,mouseOffset:te,mouseContainer:ne}){const{canRefract:G,supportsBackdropFilter:O}=yt(),L=f.useRef(null),[w,H]=f.useState(null),$=ge(),X=Gt(),N=jt(),se=Pn(),[q,re]=f.useState(!1),[le,oe]=f.useState(!1),[V,y]=f.useState(null),[A,M]=f.useState(null),{offset:C,isActive:B}=Dt({container:ne,globalMousePos:E,mouseOffset:te,elementRef:L}),_=`lg-${f.useId().replace(/:/g,"")}`;f.useEffect(()=>{const ae=L.current;if(!ae)return;let U=0;const ce=()=>{const Z=ae.getBoundingClientRect();if(!Number.isFinite(Z.width)||!Number.isFinite(Z.height)||Z.width<=0||Z.height<=0)return;const Ze=gt(Z.width),Je=gt(Z.height);H(me=>me&&me.width===Ze&&me.height===Je?me:{width:Ze,height:Je})};if(ce(),typeof ResizeObserver>"u")return;const fe=new ResizeObserver(()=>{U||(U=requestAnimationFrame(()=>{U=0,ce()}))});return fe.observe(ae),()=>{U&&cancelAnimationFrame(U),fe.disconnect()}},[]);const I=Ln[b],ue=h&&!I.forceNonAdaptive,be=d??(ue&&V?V==="light":!1),Be=be?e/2:e,xe=N?Mn:r*I.saturationFactor,Pe=N?0:o,W=w!==null&&w.width>0&&w.height>0,ye=t&&G&&W&&!X,$t=ye?`url(#${_})`:null,Bt=u!==void 0||p!==void 0||g!==void 0,Se=(p==null?void 0:p.width)??(W?w.width:0),Re=(p==null?void 0:p.height)??(W?w.height:0),Ue=Bt&&!X&&Number.isFinite(Se)&&Number.isFinite(Re)&&Se>0&&Re>0,Ye=`${_}-copy`,Pt=u!==void 0?u:n,Ut=`${(((g==null?void 0:g.x)??.5)*100).toFixed(2)}% ${(((g==null?void 0:g.y)??.5)*100).toFixed(2)}%`,He=O&&!ye&&!X&&!N,ve=s*Rn*(be?1.5:1),Ae=O?Un(ve,xe,$t):void 0,D=ht(c),z=B&&!$,Xe=z?wt(C.x,C.y,0,0,a):{scaleX:1,scaleY:1},qe=z?Mt(C.x,C.y,0,0,a):{x:0,y:0},Ve=typeof v=="function"&&le?.96:1,P=`translate(${qe.x.toFixed(2)}px, ${qe.y.toFixed(2)}px) scale(${(Xe.scaleX*Ve).toFixed(4)}, ${(Xe.scaleY*Ve).toFixed(4)})`,Yt=135+(z?C.x*.15:0);let Ce=at,Ee=ct;if(z&&W){const ae=50+C.x/(w.width/2)*50,U=50+C.y/(w.height/2)*50,ce=fe=>Math.max(-20,Math.min(120,fe));Ce=`${ce(ae).toFixed(2)}%`,Ee=`${ce(U).toFixed(2)}%`}const Ht=le,Xt=z&&W?Ce:"50%",qt=z&&W?Ee:"50%",we=ie(se?"dark":"light");let Me=we;N?Me=`inset 0 0 0 ${En}px ${Cn[se?"dark":"light"]}, ${we}`:He&&(Me=`inset 0 0 0 ${ft.width}px ${ft.color}, ${we}`);const We=q?it.hover:it.rest,ze=q?.55:.35,Vt={position:"relative",display:"inline-block",padding:ht(i),borderRadius:D,...T},Wt=x?ut[A??"static"]:ut.static,zt={position:"absolute",inset:0,borderRadius:D,transform:P,transition:x&&$?"transform 120ms ease-out":"box-shadow 200ms ease, transform 120ms ease-out",boxShadow:Bn(q,Wt),zIndex:-1,pointerEvents:"none"},Q=se?"dark":"light";let K;N?K=wn[Q]:X?K=O?vn[Q]:An[Q]:O?He&&(K=In):K=Q==="dark"?"rgba(30, 30, 35, 0.55)":"rgba(255, 255, 255, 0.55)";const Qt={position:"absolute",inset:0,borderRadius:D,overflow:"hidden",...Ae?{backdropFilter:Ae,WebkitBackdropFilter:Ae}:{},...K?{background:K}:{},boxShadow:Me,transform:P,transition:"transform 120ms ease-out",zIndex:0,pointerEvents:"none"},Kt={position:"absolute",inset:0,borderRadius:D,transform:P,transition:$?"transform 120ms ease-out":"transform 120ms ease-out, background-position 120ms ease-out",mixBlendMode:"screen","--lg-spec-x":Ce,"--lg-spec-y":Ee,background:`radial-gradient(circle ${Tn} at var(--lg-spec-x, ${at}) var(--lg-spec-y, ${ct}), rgba(255,255,255,${We}) 0%, rgba(255,255,255,${(We*.4).toFixed(3)}) 30%, rgba(255,255,255,0) 65%)`,zIndex:0,pointerEvents:"none"},Zt={position:"absolute",inset:0,borderRadius:D,transform:P,mixBlendMode:"screen","--lg-spec-x":Xt,"--lg-spec-y":qt,background:`radial-gradient(circle ${Nn} at var(--lg-spec-x, 50%) var(--lg-spec-y, 50%), rgba(255,255,255,${lt}) 0%, rgba(255,255,255,${(lt*.5).toFixed(3)}) 25%, rgba(255,255,255,0) 55%)`,opacity:Ht?1:0,transition:$?"transform 120ms ease-out":"transform 120ms ease-out, opacity 360ms ease-out",zIndex:0,pointerEvents:"none"},Jt={position:"absolute",inset:0,borderRadius:D,transform:P,transition:"transform 120ms ease-out",mixBlendMode:"overlay",padding:"1px",background:`linear-gradient(${Yt}deg, rgba(255,255,255,${ze}) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,${ze*.6}) 100%)`,zIndex:0,pointerEvents:"none"};let de;ue&&N?de=Q==="light"?pe.dark:pe.light:ue&&V&&(de=be?pe.dark:pe.light);const en={position:"relative",zIndex:1,...de?{color:de}:{}},tn={position:"absolute",inset:0,borderRadius:D,overflow:"hidden",transform:P,transition:"transform 120ms ease-out",zIndex:0,pointerEvents:"none"},nn={position:"absolute",inset:0,filter:Ue?`url(#${Ye})`:void 0,transformOrigin:Ut,...S?{background:S}:{}},Qe=I.scrim?I.scrim[Q]:null,Ke=Qe?{position:"absolute",inset:0,borderRadius:D,transform:P,transition:"transform 120ms ease-out",background:Qe,zIndex:0,pointerEvents:"none"}:null;return l.jsxs("div",{ref:L,className:R,style:Vt,onClick:v,onMouseEnter:()=>re(!0),onMouseLeave:()=>{re(!1),oe(!1)},onMouseDown:()=>oe(!0),onMouseUp:()=>oe(!1),children:[l.jsx("div",{"data-lg-shadow":"",style:zt,"aria-hidden":"true"}),l.jsx("div",{"data-lg-surface":"",style:Qt,children:ye?l.jsx(bt,{filterId:_,mode:m,width:w.width,height:w.height,effectiveScale:Be,aberrationIntensity:Pe,blurStdDeviation:ve,saturation:xe}):null}),Ue?l.jsxs("div",{"data-lg-refraction":"",style:tn,"aria-hidden":"true",inert:"true",children:[l.jsx(bt,{filterId:Ye,mode:m,width:Se,height:Re,effectiveScale:Be,aberrationIntensity:Pe,blurStdDeviation:ve,saturation:xe}),l.jsx("div",{"data-lg-refraction-copy":"",style:nn,children:Pt})]}):null,l.jsx("span",{"data-lg-highlight":"",style:Kt,"aria-hidden":"true"}),l.jsx("span",{"data-lg-press-glow":"",style:Zt,"aria-hidden":"true"}),l.jsx("span",{"data-lg-border":"",style:Jt,"aria-hidden":"true"}),Ke?l.jsx("span",{"data-lg-scrim":"",style:Ke,"aria-hidden":"true"}):null,ue?l.jsx(Yn,{targetRef:L,onScheme:y}):null,x?l.jsx(Hn,{targetRef:L,onScheme:M}):null,l.jsx("div",{"data-lg-content":"",style:en,children:n})]})}function Xn(...n){return t=>{for(const e of n)e&&(typeof e=="function"?e(t):e.current=t)}}function qn(n,t){return n?t?(...e)=>{n(...e);const s=e[0];(!s||!s.defaultPrevented)&&t(...e)}:n:t}function Vn(n,t){const e={...t};for(const s in n){const r=n[s],o=t[s];s==="className"?e.className=[o,r].filter(Boolean).join(" "):s==="style"?e.style={...o,...r}:/^on[A-Z]/.test(s)?e[s]=qn(o,r):r!==void 0&&(e[s]=r)}return e}const Ot=f.forwardRef(function(t,e){const{children:s,...r}=t;if(!f.isValidElement(s)||f.Children.count(s)!==1)throw new Error('Slot (asChild) expects exactly one valid React element child. Pass a single element, e.g. <GlassButton asChild><a href="…">Link</a></GlassButton>.');const o=s,a=o.props,c=o.ref??a.ref,i=Vn(r,a);return i.ref=Xn(e,c),f.cloneElement(o,i)});function Wn(...n){return n.filter(Boolean).join(" ")}function $e(n){const{base:t,variants:e,defaultVariants:s}=n;return(r={})=>{var a;const o=[t];for(const c in e){const i=r[c]??(s==null?void 0:s[c]);i!==void 0&&o.push((a=e[c])==null?void 0:a[i])}return o.push(r.className),Wn(...o)}}const zn={primary:{displacementScale:80,blurAmount:.0625,saturation:160},secondary:{displacementScale:60,blurAmount:.0625,saturation:140},subtle:{displacementScale:40,blurAmount:.05,saturation:120}},Qn={sm:{cornerRadius:999,padding:"6px 14px"},md:{cornerRadius:999,padding:"10px 20px"},lg:{cornerRadius:999,padding:"14px 28px"},icon:{cornerRadius:999,padding:"10px"}},Kn=$e({base:"lg-button",variants:{variant:{primary:"lg-button--primary",secondary:"lg-button--secondary",subtle:"lg-button--subtle"},size:{sm:"lg-button--sm",md:"lg-button--md",lg:"lg-button--lg",icon:"lg-button--icon"}},defaultVariants:{variant:"primary",size:"md"}}),Zn=f.forwardRef(function({variant:t="primary",size:e="md",asChild:s=!1,shine:r=!0,contentClassName:o,glassProps:a,className:c,children:i,style:d,type:h,disabled:x,...b},m){const u=Kn({variant:t,size:e,className:c}),p={"--lg-edge-shadow":ie("light"),...d},g=l.jsx("span",{className:["lg-content",o].filter(Boolean).join(" "),children:i}),S=s?l.jsx(Ot,{ref:m,className:u,style:p,"data-shine":r?"true":"false",...b,children:i}):l.jsx("button",{ref:m,type:h??"button",disabled:x,className:u,style:p,"data-shine":r?"true":"false",...b,children:g}),R={...zn[t],...Qn[e]};return l.jsx(he,{...R,...a,children:S})}),Jn=$e({base:"lg-card",variants:{elevation:{flat:"lg-card--flat",raised:"lg-card--raised",floating:"lg-card--floating"}},defaultVariants:{elevation:"raised"}}),es={cornerRadius:28,padding:"24px 28px",displacementScale:50},ts=f.forwardRef(function({elevation:t="raised",asChild:e=!1,contentClassName:s,glassProps:r,className:o,children:a,style:c,...i},d){const h=Jn({elevation:t,className:o}),x={"--lg-edge-shadow":ie("light"),...c},b=l.jsx("div",{className:["lg-content",s].filter(Boolean).join(" "),children:a}),m=e?l.jsx(Ot,{ref:d,className:h,style:x,"data-elevation":t,...i,children:a}):l.jsx("div",{ref:d,className:h,style:x,"data-elevation":t,...i,children:b});return l.jsx(he,{...es,...r,children:m})}),ns=typeof window<"u"?f.useLayoutEffect:f.useEffect,ss={sm:{displacementScale:40,blurAmount:.05,saturation:130},md:{displacementScale:56,blurAmount:.0625,saturation:140},lg:{displacementScale:72,blurAmount:.0625,saturation:150}},rs=$e({base:"lg-segmented",variants:{size:{sm:"lg-segmented--sm",md:"lg-segmented--md",lg:"lg-segmented--lg"}},defaultVariants:{size:"md"}}),os=f.forwardRef(function({options:t,value:e,defaultValue:s,onValueChange:r,size:o="md",label:a,"aria-label":c,showLabel:i=!1,className:d,style:h,name:x,glassProps:b},m){var V;const u=f.useId(),p=x??`lg-seg-${u.replace(/:/g,"")}`,g=(V=t[0])==null?void 0:V.value,S=e!==void 0,[R,T]=f.useState(s??g),v=S?e:R,E=f.useMemo(()=>{const y=t.findIndex(A=>A.value===v);return y<0?0:y},[t,v]),te=t.length||1,ne=ge(),G=f.useRef(null),O=f.useRef([]),[L,w]=f.useState(null),H=f.useCallback(()=>{const y=G.current,A=O.current[E];if(!y||!A)return;const M=y.getBoundingClientRect(),C=A.getBoundingClientRect();if(!Number.isFinite(M.width)||M.width<=0)return;const B=C.left-M.left,_=C.width;!Number.isFinite(B)||!Number.isFinite(_)||_<=0||w(I=>I&&I.left===B&&I.width===_?I:{left:B,width:_})},[E]),$=f.useRef(H);$.current=H,ns(()=>{H()},[H]),f.useEffect(()=>{const y=G.current;if(!y||typeof ResizeObserver>"u")return;let A=0;const M=new ResizeObserver(()=>{A||(A=requestAnimationFrame(()=>{A=0,$.current()}))});return M.observe(y),()=>{A&&cancelAnimationFrame(A),M.disconnect()}},[]);const X=f.useCallback(y=>{S||T(y),r==null||r(y)},[S,r]),N=ss[o],se=ie("light"),q=L!==null,re=q?{width:`${L.width}px`,transform:`translateX(${L.left}px)`}:{width:`${100/te}%`,transform:`translateX(${E*100}%)`};re.transition=ne?"none":"transform 320ms cubic-bezier(0.32, 0.72, 0, 1), width 320ms cubic-bezier(0.32, 0.72, 0, 1)";const le={"--lg-edge-shadow":se,...h},oe=l.jsx("legend",{className:i?"lg-segmented-legend lg-segmented-legend--visible":"lg-segmented-legend",children:a??c??"Options"});return l.jsxs("fieldset",{ref:m,className:rs({size:o,className:d}),style:le,"aria-label":c,"data-selected-index":E,"data-measured":q?"true":"false",children:[oe,l.jsxs("div",{className:"lg-segmented-track",ref:G,children:[l.jsx("div",{className:"lg-segmented-indicator",style:re,"data-selected-index":E,"aria-hidden":"true",children:l.jsx(he,{cornerRadius:"inherit",padding:0,displacementScale:N.displacementScale,blurAmount:N.blurAmount,saturation:N.saturation,...b,className:"lg-segmented-glass",style:{width:"100%",height:"100%",display:"block"},children:l.jsx("span",{"aria-hidden":"true",className:"lg-segmented-glass-fill"})})}),t.map((y,A)=>{const M=y.value===v,C=`${p}-${y.value}`;return l.jsxs("label",{htmlFor:C,className:"lg-segmented-option","data-active":M?"true":"false","data-icon-only":y.icon!=null&&y.label==null?"true":"false",ref:B=>{O.current[A]=B},children:[l.jsx("input",{id:C,className:"lg-segmented-input",type:"radio",name:p,value:y.value,checked:M,disabled:y.disabled,onChange:()=>X(y.value)}),y.icon!=null?l.jsx("span",{className:"lg-segmented-icon","aria-hidden":"true",children:y.icon}):null,y.label!=null?l.jsx("span",{className:"lg-segmented-label",children:y.label}):null]},y.value)})]})]})}),as="0.0.0";exports.GLASS_EDGE_DARK=Ct;exports.GLASS_EDGE_LIGHT=At;exports.GlassButton=Zn;exports.GlassCard=ts;exports.GlassSegmentedControl=os;exports.LIGHT_DARK_THRESHOLD=Tt;exports.LiquidGlass=he;exports.UNSAMPLED=F;exports.VERSION=as;exports.averageColorToSample=je;exports.calculateDirectionalScale=wt;exports.calculateElasticTranslation=Mt;exports.createCanvasSnapshotStrategy=_n;exports.detectGlassCapabilities=xt;exports.domBackgroundStrategy=Ft;exports.getConservativeGlassCapabilities=De;exports.getDisplacementMap=vt;exports.getGlassEdgeShadow=ie;exports.luminanceToScheme=Lt;exports.parseCssColor=It;exports.relativeLuminance=Nt;exports.roundedRectSDF=J;exports.safeSample=kt;exports.sampleBackdropLuminance=_t;exports.smoothStep=ee;exports.useBackdropLuminance=Ge;exports.useGlassCapabilities=yt;exports.useMousePosition=Dt;exports.usePrefersContrast=jt;exports.useReducedMotion=ge;exports.useReducedTransparency=Gt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),l=require("react/jsx-runtime"),sn={supportsBackdropFilter:!1,isChromium:!1,supportsSvgBackdropDisplacement:!1,isFirefox:!1,prefersReducedMotion:!1,prefersReducedTransparency:!1,prefersContrastMore:!1,canRefract:!1};function De(){return{...sn}}function rn(){return typeof window<"u"&&typeof document<"u"&&typeof navigator<"u"}function on(){return typeof CSS>"u"||typeof CSS.supports!="function"?!1:CSS.supports("backdrop-filter","blur(1px)")||CSS.supports("-webkit-backdrop-filter","blur(1px)")}function an(n){return/Firefox/i.test(n)}function cn(n,t){return t?!1:/Chrome|Chromium|Edg|OPR/i.test(n)}function ln(){return typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function un(){return typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-transparency: reduce)").matches}function dn(){return typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-contrast: more)").matches}function xt(){if(!rn())return De();const n=navigator.userAgent??"",t=on(),e=an(n),s=cn(n,e),r=s,o=ln(),a=un(),i=dn();return{supportsBackdropFilter:t,isChromium:s,supportsSvgBackdropDisplacement:r,isFirefox:e,prefersReducedMotion:o,prefersReducedTransparency:a,prefersContrastMore:i,canRefract:t&&r}}function yt(){const[n,t]=f.useState(De);return f.useEffect(()=>{t(xt())},[]),n}function J(n,t,e,s,r){const o=e/2,a=s/2,i=Math.max(0,Math.min(r,Math.min(o,a))),c=Math.abs(n)-(o-i),d=Math.abs(t)-(a-i),h=Math.max(c,0),x=Math.max(d,0),b=Math.sqrt(h*h+x*x),m=Math.min(Math.max(c,d),0);return b+m-i}function ee(n,t,e){if(n===t)return e<n?0:1;const s=Math.max(0,Math.min(1,(e-n)/(t-n)));return s*s*(3-2*s)}function et(n){const t=Math.round(128+n*127);return t<0?0:t>255?255:t}function fn(n,t,e){const s=new Uint8ClampedArray(t*e*4),r=t/2,o=e/2,a=Math.min(t,e)*.35;for(let i=0;i<e;i++)for(let c=0;c<t;c++){const d=c+.5-r,h=i+.5-o;let x=0,b=0;if(n==="polar"){const u=Math.sqrt(d*d+h*h),p=J(d,h,t,e,a),g=ee(-Math.min(t,e)*.5,0,p),S=u===0?0:d/u,R=u===0?0:h/u;x=S*g*.9,b=R*g*.9}else{let u,p,g;n==="standard"?(u=-Math.min(t,e)*.18,p=0,g=.7):n==="prominent"?(u=-Math.min(t,e)*.4,p=0,g=1):(u=-Math.min(t,e)*.1,p=Math.min(t,e)*.04,g=.85);const S=J(d-1,h,t,e,a),R=J(d+1,h,t,e,a),N=J(d,h-1,t,e,a),v=J(d,h+1,t,e,a),E=ee(u,p,S),te=ee(u,p,R),ne=ee(u,p,N),G=ee(u,p,v);x=(te-E)*.5*g,b=(G-ne)*.5*g}const m=(i*t+c)*4;s[m]=et(x),s[m+1]=0,s[m+2]=et(b),s[m+3]=255}return s}const mn=(()=>{const n=new Uint32Array(256);for(let t=0;t<256;t++){let e=t;for(let s=0;s<8;s++)e=e&1?3988292384^e>>>1:e>>>1;n[t]=e>>>0}return n})();function pn(n){let t=4294967295;for(let e=0;e<n.length;e++)t=mn[(t^n[e])&255]^t>>>8;return(t^4294967295)>>>0}function gn(n){let t=1,e=0;const s=65521;for(let r=0;r<n.length;r++)t=(t+n[r])%s,e=(e+t)%s;return(e<<16|t)>>>0}function hn(n){const e=Math.max(1,Math.ceil(n.length/65535)),s=new Uint8Array(2+e*5+n.length+4);let r=0;s[r++]=120,s[r++]=1;let o=0;do{const i=Math.min(n.length-o,65535),c=o+i>=n.length;s[r++]=c?1:0,s[r++]=i&255,s[r++]=i>>>8&255;const d=~i&65535;s[r++]=d&255,s[r++]=d>>>8&255,s.set(n.subarray(o,o+i),r),r+=i,o+=i}while(o<n.length);const a=gn(n);return s[r++]=a>>>24&255,s[r++]=a>>>16&255,s[r++]=a>>>8&255,s[r++]=a&255,s}function Ne(n,t){const e=t.length,s=new Uint8Array(12+e);s[0]=e>>>24&255,s[1]=e>>>16&255,s[2]=e>>>8&255,s[3]=e&255,s[4]=n.charCodeAt(0),s[5]=n.charCodeAt(1),s[6]=n.charCodeAt(2),s[7]=n.charCodeAt(3),s.set(t,8);const r=pn(s.subarray(4,8+e));return s[8+e]=r>>>24&255,s[9+e]=r>>>16&255,s[10+e]=r>>>8&255,s[11+e]=r&255,s}function St(n,t,e){const s=t*4,r=new Uint8Array(e*(s+1));for(let u=0;u<e;u++){const p=u*(s+1);r[p]=0,r.set(n.subarray(u*s,u*s+s),p+1)}const o=hn(r),a=new Uint8Array(13);a[0]=t>>>24&255,a[1]=t>>>16&255,a[2]=t>>>8&255,a[3]=t&255,a[4]=e>>>24&255,a[5]=e>>>16&255,a[6]=e>>>8&255,a[7]=e&255,a[8]=8,a[9]=6,a[10]=0,a[11]=0,a[12]=0;const i=Uint8Array.from([137,80,78,71,13,10,26,10]),c=Ne("IHDR",a),d=Ne("IDAT",o),h=Ne("IEND",new Uint8Array(0)),x=i.length+c.length+d.length+h.length,b=new Uint8Array(x);let m=0;for(const u of[i,c,d,h])b.set(u,m),m+=u.length;return b}const _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Rt(n){let t="",e=0;for(;e+2<n.length;e+=3){const r=n[e]<<16|n[e+1]<<8|n[e+2];t+=_.charAt(r>>>18&63)+_.charAt(r>>>12&63)+_.charAt(r>>>6&63)+_.charAt(r&63)}const s=n.length-e;if(s===1){const r=n[e]<<16;t+=`${_.charAt(r>>>18&63)}${_.charAt(r>>>12&63)}==`}else if(s===2){const r=n[e]<<16|n[e+1]<<8;t+=`${_.charAt(r>>>18&63)}${_.charAt(r>>>12&63)}${_.charAt(r>>>6&63)}=`}return t}function bn(){const n=new Uint8ClampedArray([0,0,0,0]);return`data:image/png;base64,${Rt(St(n,1,1))}`}const xn=32,Te=16,Y=new Map;function tt(n){return Math.max(Te,Math.round(n/Te)*Te)}function vt(n,t,e){if(!Number.isFinite(t)||!Number.isFinite(e)||t<=0||e<=0)return bn();const s=tt(t),r=tt(e),o=`${n}:${s}x${r}`,a=Y.get(o);if(a!==void 0)return Y.delete(o),Y.set(o,a),a;const i=fn(n,s,r),c=`data:image/png;base64,${Rt(St(i,s,r))}`;if(Y.set(o,c),Y.size>xn){const d=Y.keys().next().value;d!==void 0&&Y.delete(d)}return c}const At=["inset 0 1px 1px 0 rgba(255, 255, 255, 0.75)","inset 1px 0 1px 0 rgba(255, 255, 255, 0.4)","inset 0 -1px 2px 0 rgba(0, 0, 0, 0.18)","inset -1px 0 2px 0 rgba(0, 0, 0, 0.12)","inset 0 0 0 1px rgba(255, 255, 255, 0.22)"].join(", "),Ct=["inset 0 1px 1px 0 rgba(255, 255, 255, 0.35)","inset 1px 0 1px 0 rgba(255, 255, 255, 0.18)","inset 0 -1px 2px 0 rgba(0, 0, 0, 0.55)","inset -1px 0 2px 0 rgba(0, 0, 0, 0.45)","inset 0 0 0 1px rgba(255, 255, 255, 0.1)"].join(", ");function le(n){return n==="dark"?Ct:At}const yn=200,Sn=300,nt=.3,st=.15,rt=.8,ot=.1;function Fe(n,t,e){return Math.min(e,Math.max(t,n))}function Et(n){return Number.isFinite(n)?Fe(1-n/yn,0,1):0}function wt(n,t,e,s,r){if(!(r>0))return{scaleX:1,scaleY:1};const o=n-e,a=t-s,i=Math.hypot(o,a);if(i===0||!Number.isFinite(i))return{scaleX:1,scaleY:1};const c=Et(i);if(c===0)return{scaleX:1,scaleY:1};const d=o/i,h=a/i,x=Math.abs(d),b=Math.abs(h),m=Math.min(i/Sn,1)*r*c,u=Fe(1+x*m*nt-b*m*st,rt,Number.POSITIVE_INFINITY),p=Fe(1+b*m*nt-x*m*st,rt,Number.POSITIVE_INFINITY);return{scaleX:u,scaleY:p}}function Mt(n,t,e,s,r){if(!(r>0))return{x:0,y:0};const o=n-e,a=t-s,i=Math.hypot(o,a);if(i===0||!Number.isFinite(i))return{x:0,y:0};const c=Et(i);return c===0?{x:0,y:0}:{x:o*r*ot*c,y:a*r*ot*c}}const j={displacementScale:70,blurAmount:.0625,saturation:140,aberrationIntensity:2,cornerRadius:999,mode:"standard",padding:"24px 32px",elasticity:.15},Rn=16,vn={light:"rgba(255, 255, 255, 0.75)",dark:"rgba(30, 30, 35, 0.75)"},An={light:"rgba(255, 255, 255, 0.92)",dark:"rgba(30, 30, 35, 0.92)"},Cn={light:"rgba(0, 0, 0, 0.92)",dark:"rgba(255, 255, 255, 0.92)"},En=2,wn={light:"rgba(255, 255, 255, 0.92)",dark:"rgba(22, 22, 26, 0.92)"},Mn=100,pe={light:"rgba(255, 255, 255, 0.96)",dark:"rgba(17, 17, 20, 0.96)"},at="50%",it="0%",ct={rest:.55,hover:.85},Nn="70%",lt=.5,Tn="60%",ut={static:1,dark:1.35,light:.7},dt={rest:[{y:8,blur:24,alpha:.22},{y:1,blur:4,alpha:.14}],hover:[{y:12,blur:32,alpha:.28},{y:2,blur:8,alpha:.18}]},Ln={regular:{saturationFactor:1,forceNonAdaptive:!1,scrim:null},clear:{saturationFactor:.7,forceNonAdaptive:!0,scrim:{light:"rgba(0, 0, 0, 0.18)",dark:"rgba(0, 0, 0, 0.28)"}}},In="rgba(255, 255, 255, 0.1)",ft={color:"rgba(255, 255, 255, 0.5)",width:1},D={luminance:null,scheme:null,sampled:!1},Nt=.5;function Le(n){const t=n/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function Tt(n,t,e){const s=Le(n),r=Le(t),o=Le(e);return .2126*s+.7152*r+.0722*o}function Lt(n){return n>=Nt?"light":"dark"}function je(n){const t=Tt(n.r,n.g,n.b);return{luminance:t,scheme:Lt(t),sampled:!0}}function It(n){if(!n)return{r:0,g:0,b:0,a:0};const t=n.trim().toLowerCase();if(t==="transparent"||t==="none")return{r:0,g:0,b:0,a:0};const e=t.match(/rgba?\(([^)]+)\)/);if(!(e!=null&&e[1]))return{r:0,g:0,b:0,a:0};const s=e[1].split(/[\s,/]+/).filter(Boolean);if(s.length<3)return{r:0,g:0,b:0,a:0};const r=Ie(Number.parseFloat(s[0])),o=Ie(Number.parseFloat(s[1])),a=Ie(Number.parseFloat(s[2]));let i=1;const c=s[3];return c!==void 0&&(i=c.endsWith("%")?Number.parseFloat(c)/100:Number.parseFloat(c),Number.isFinite(i)||(i=1)),{r,g:o,b:a,a:kn(i)}}function Ie(n){return Number.isFinite(n)?Math.max(0,Math.min(255,Math.round(n))):0}function kn(n){return Math.max(0,Math.min(1,n))}function Fn(n,t){const e=n.a;return{r:n.r*e+t.r*(1-e),g:n.g*e+t.g*(1-e),b:n.b*e+t.b*(1-e)}}function kt(n,t){try{return n(t)}catch{return D}}function Ft(n,t){if(typeof document>"u"||typeof document.elementsFromPoint!="function"||typeof getComputedStyle!="function")return D;const e=document.elementsFromPoint(n.x,n.y);if(!e||e.length===0)return D;let s={r:255,g:255,b:255};const r=[];for(const o of e){if(t&&(o===t||t.contains(o)))continue;const a=getComputedStyle(o),i=a.backgroundImage&&a.backgroundImage!=="none",c=It(a.backgroundColor);if(i){r.push({r:128,g:128,b:128,a:1});break}if(c.a>0&&(r.push(c),c.a>=1))break}for(let o=r.length-1;o>=0;o--){const a=r[o];a&&(s=Fn(a,s))}return je(s)}function _t(n,t={}){const{strategy:e,ignore:s}=t;return kt(e??(o=>Ft(o,s)),n)}function _n(n,t=8){return()=>{if(typeof document>"u"||typeof document.createElement!="function")return D;const e=document.createElement("canvas");e.width=t,e.height=t;const s=e.getContext("2d");if(!s)return D;n(s,t,t);const{data:r}=s.getImageData(0,0,t,t);let o=0,a=0,i=0,c=0;for(let d=0;d<r.length;d+=4)o+=r[d]??0,a+=r[d+1]??0,i+=r[d+2]??0,c++;return c===0?D:je({r:o/c,g:a/c,b:i/c})}}function Ge(n,t={}){const{strategy:e,resampleOnScroll:s=!0,resampleOnResize:r=!0,disabled:o=!1}=t,[a,i]=f.useState(D),c=f.useRef(e);return c.current=e,f.useEffect(()=>{if(o){i(m=>m.sampled?D:m);return}if(typeof window>"u"||typeof document>"u")return;let d=0,h=!1;const x=()=>{const m=n.current;if(!m)return;const u=m.getBoundingClientRect(),p={x:u.left+u.width/2,y:u.top+u.height/2},g=_t(p,{strategy:c.current,ignore:m});h||i(S=>S.sampled===g.sampled&&S.luminance===g.luminance&&S.scheme===g.scheme?S:g)},b=()=>{d||(d=requestAnimationFrame(()=>{d=0,x()}))};return b(),s&&window.addEventListener("scroll",b,{passive:!0,capture:!0}),r&&window.addEventListener("resize",b,{passive:!0}),()=>{h=!0,d&&cancelAnimationFrame(d),s&&window.removeEventListener("scroll",b,{capture:!0}),r&&window.removeEventListener("resize",b)}},[n,o,s,r]),a}function Oe(n){const[t,e]=f.useState(!1);return f.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const s=window.matchMedia(n);e(s.matches);const r=o=>{e(o.matches)};return typeof s.addEventListener=="function"?(s.addEventListener("change",r),()=>s.removeEventListener("change",r)):(s.addListener(r),()=>s.removeListener(r))},[n]),t}const Dn="(prefers-reduced-motion: reduce)";function ge(){return Oe(Dn)}const _e={x:0,y:0},mt={mousePos:_e,offset:_e,isActive:!1};function pt(n){return n?n instanceof HTMLElement?n:n.current??null:null}function jn(){return typeof window>"u"?!1:"ontouchstart"in window||((navigator==null?void 0:navigator.maxTouchPoints)??0)>0}function Dt(n={}){const{container:t,globalMousePos:e,mouseOffset:s,elementRef:r}=n,o=ge(),[a,i]=f.useState(!1),[c,d]=f.useState(mt),h=f.useRef({container:t,elementRef:r});h.current={container:t,elementRef:r},f.useEffect(()=>{i(jn())},[]);const x=o||a,b=e!==void 0;if(f.useEffect(()=>{if(b||x||typeof window>"u"||typeof document>"u")return;const m=u=>{const{container:p,elementRef:g}=h.current,S=pt(p)??(g==null?void 0:g.current)??null;if(!S)return;const R=S.getBoundingClientRect(),N=R.left+R.width/2,v=R.top+R.height/2;d({mousePos:{x:u.clientX,y:u.clientY},offset:{x:u.clientX-N,y:u.clientY-v},isActive:!0})};return document.addEventListener("mousemove",m),()=>document.removeEventListener("mousemove",m)},[b,x]),x)return mt;if(b){const m=e;let u=s;if(u===void 0){const p=pt(t)??(r==null?void 0:r.current)??null;if(p){const g=p.getBoundingClientRect();u={x:m.x-(g.left+g.width/2),y:m.y-(g.top+g.height/2)}}else u=_e}return{mousePos:m,offset:u,isActive:!0}}return c}const Gn="(prefers-contrast: more)";function jt(){return Oe(Gn)}const On="(prefers-reduced-transparency: reduce)";function Gt(){return Oe(On)}const ke=16,$n=.015;function Bn(n,t){return(n?dt.hover:dt.rest).map(s=>{const r=Math.round(s.y*t*100)/100,o=Math.round(s.blur*t*100)/100,a=Math.round(Math.min(s.alpha*t,.6)*1e3)/1e3;return`0 ${r}px ${o}px rgba(0, 0, 0, ${a})`}).join(", ")}function gt(n){return Math.max(ke,Math.round(n/ke)*ke)}function Pn(){const[n,t]=f.useState(!1);return f.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const e=window.matchMedia("(prefers-color-scheme: dark)");t(e.matches);const s=r=>t(r.matches);return typeof e.addEventListener=="function"?(e.addEventListener("change",s),()=>e.removeEventListener("change",s)):(e.addListener(s),()=>e.removeListener(s))},[]),n}function ht(n){return typeof n=="number"?`${n}px`:n}function Un(n,t,e){return e||`blur(${n}px) saturate(${t}%)`}function bt({filterId:n,mode:t,width:e,height:s,effectiveScale:r,aberrationIntensity:o,blurStdDeviation:a,saturation:i}){const c=t==="turbulence",d=r+o,h=r,x=r-o,b=c?l.jsxs(l.Fragment,{children:[l.jsx("feTurbulence",{type:"fractalNoise",baseFrequency:$n,numOctaves:2,seed:1,result:"noise"}),l.jsx("feGaussianBlur",{in:"noise",stdDeviation:1.5,result:"dispSource"})]}):l.jsx("feImage",{href:vt(t,e,s),x:"0",y:"0",width:e,height:s,preserveAspectRatio:"none",result:"dispSource"}),m=(R,N,v)=>{const E=N==="R"?"1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0":N==="G"?"0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0":"0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0";return l.jsxs(l.Fragment,{children:[l.jsx("feDisplacementMap",{in:"SourceGraphic",in2:"dispSource",scale:R,xChannelSelector:"R",yChannelSelector:"B",result:`${v}_disp`}),l.jsx("feColorMatrix",{in:`${v}_disp`,type:"matrix",values:E,result:v})]})},u=Math.min(e,s)*.5,p=Math.min(Math.max(a,0),u),g=e*.5+p*3,S=s*.5+p*3;return l.jsx("svg",{"aria-hidden":"true",width:"0",height:"0",style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:l.jsx("defs",{children:l.jsxs("filter",{id:n,primitiveUnits:"userSpaceOnUse",x:-g,y:-S,width:e+g*2,height:s+S*2,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[b,m(d,"R","chanR"),m(h,"G","chanG"),m(x,"B","chanB"),l.jsx("feComposite",{in:"chanR",in2:"chanG",operator:"arithmetic",k1:"0",k2:"1",k3:"1",k4:"0",result:"chanRG"}),l.jsx("feComposite",{in:"chanRG",in2:"chanB",operator:"arithmetic",k1:"0",k2:"1",k3:"1",k4:"0",result:"aberrated"}),l.jsx("feGaussianBlur",{in:"aberrated",stdDeviation:.5,result:"softened"}),l.jsxs("radialGradient",{id:`${n}-edge`,cx:"50%",cy:"50%",r:"50%",children:[l.jsx("stop",{offset:"0%",stopColor:"#000000",stopOpacity:"0"}),l.jsx("stop",{offset:"70%",stopColor:"#000000",stopOpacity:"0"}),l.jsx("stop",{offset:"100%",stopColor:"#ffffff",stopOpacity:"1"})]}),l.jsx("feImage",{href:`#${n}-edge`,x:"0",y:"0",width:e,height:s,preserveAspectRatio:"none",result:"edgeMask"}),l.jsx("feComposite",{in:"softened",in2:"edgeMask",operator:"in",result:"edgeOnly"}),l.jsx("feComposite",{in:"edgeOnly",in2:"SourceGraphic",operator:"over",result:"refracted"}),l.jsx("feGaussianBlur",{in:"refracted",stdDeviation:p,result:"blurred"}),l.jsx("feColorMatrix",{in:"blurred",type:"saturate",values:`${i/100}`})]})})})}function Yn({targetRef:n,onScheme:t}){const{sampled:e,scheme:s}=Ge(n);return f.useEffect(()=>{t(e?s:null)},[e,s,t]),null}function Hn({targetRef:n,onScheme:t}){const{sampled:e,scheme:s}=Ge(n);return f.useEffect(()=>{t(e?s:null)},[e,s,t]),null}function he({children:n,displacement:t=!1,displacementScale:e=j.displacementScale,blurAmount:s=j.blurAmount,saturation:r=j.saturation,aberrationIntensity:o=j.aberrationIntensity,elasticity:a=j.elasticity,cornerRadius:i=j.cornerRadius,padding:c=j.padding,overLight:d,adaptiveTint:h=!1,scrollAwareShadow:x=!1,variant:b="regular",mode:m=j.mode,refract:u,size:p,center:g,behind:S,className:R,style:N,onClick:v,globalMousePos:E,mouseOffset:te,mouseContainer:ne}){const{canRefract:G,supportsBackdropFilter:O}=yt(),L=f.useRef(null),[w,H]=f.useState(null),$=ge(),X=Gt(),T=jt(),se=Pn(),[q,re]=f.useState(!1),[ue,oe]=f.useState(!1),[V,y]=f.useState(null),[A,M]=f.useState(null),{offset:C,isActive:ae}=Dt({container:ne,globalMousePos:E,mouseOffset:te,elementRef:L}),B=`lg-${f.useId().replace(/:/g,"")}`;f.useEffect(()=>{const ie=L.current;if(!ie)return;let U=0;const ce=()=>{const Z=ie.getBoundingClientRect();if(!Number.isFinite(Z.width)||!Number.isFinite(Z.height)||Z.width<=0||Z.height<=0)return;const Ze=gt(Z.width),Je=gt(Z.height);H(me=>me&&me.width===Ze&&me.height===Je?me:{width:Ze,height:Je})};if(ce(),typeof ResizeObserver>"u")return;const fe=new ResizeObserver(()=>{U||(U=requestAnimationFrame(()=>{U=0,ce()}))});return fe.observe(ie),()=>{U&&cancelAnimationFrame(U),fe.disconnect()}},[]);const I=Ln[b],k=h&&!I.forceNonAdaptive,be=d??(k&&V?V==="light":!1),Be=be?e/2:e,xe=T?Mn:r*I.saturationFactor,Pe=T?0:o,W=w!==null&&w.width>0&&w.height>0,ye=t&&G&&W&&!X,$t=ye?`url(#${B})`:null,Bt=u!==void 0||p!==void 0||g!==void 0,Se=(p==null?void 0:p.width)??(W?w.width:0),Re=(p==null?void 0:p.height)??(W?w.height:0),Ue=Bt&&!X&&Number.isFinite(Se)&&Number.isFinite(Re)&&Se>0&&Re>0,Ye=`${B}-copy`,Pt=u!==void 0?u:n,Ut=`${(((g==null?void 0:g.x)??.5)*100).toFixed(2)}% ${(((g==null?void 0:g.y)??.5)*100).toFixed(2)}%`,He=O&&!ye&&!X&&!T,ve=s*Rn*(be?1.5:1),Ae=O?Un(ve,xe,$t):void 0,F=ht(i),z=ae&&!$,Xe=z?wt(C.x,C.y,0,0,a):{scaleX:1,scaleY:1},qe=z?Mt(C.x,C.y,0,0,a):{x:0,y:0},Ve=typeof v=="function"&&ue?.96:1,P=`translate(${qe.x.toFixed(2)}px, ${qe.y.toFixed(2)}px) scale(${(Xe.scaleX*Ve).toFixed(4)}, ${(Xe.scaleY*Ve).toFixed(4)})`,Yt=135+(z?C.x*.15:0);let Ce=at,Ee=it;if(z&&W){const ie=50+C.x/(w.width/2)*50,U=50+C.y/(w.height/2)*50,ce=fe=>Math.max(-20,Math.min(120,fe));Ce=`${ce(ie).toFixed(2)}%`,Ee=`${ce(U).toFixed(2)}%`}const Ht=ue,Xt=z&&W?Ce:"50%",qt=z&&W?Ee:"50%",we=le(se?"dark":"light");let Me=we;T?Me=`inset 0 0 0 ${En}px ${Cn[se?"dark":"light"]}, ${we}`:He&&(Me=`inset 0 0 0 ${ft.width}px ${ft.color}, ${we}`);const We=q?ct.hover:ct.rest,ze=q?.55:.35,Vt={position:"relative",display:"inline-block",padding:ht(c),borderRadius:F,...N},Wt=x?ut[A??"static"]:ut.static,zt={position:"absolute",inset:0,borderRadius:F,transform:P,transition:x&&$?"transform 120ms ease-out":"box-shadow 200ms ease, transform 120ms ease-out",boxShadow:Bn(q,Wt),zIndex:-1,pointerEvents:"none"},Q=se?"dark":"light";let K;T?K=wn[Q]:X?K=O?vn[Q]:An[Q]:O?He&&(K=In):K=Q==="dark"?"rgba(30, 30, 35, 0.55)":"rgba(255, 255, 255, 0.55)";const Qt={position:"absolute",inset:0,borderRadius:F,overflow:"hidden",...Ae?{backdropFilter:Ae,WebkitBackdropFilter:Ae}:{},...K?{background:K}:{},boxShadow:Me,transform:P,transition:"transform 120ms ease-out",zIndex:0,pointerEvents:"none"},Kt={position:"absolute",inset:0,borderRadius:F,transform:P,transition:$?"transform 120ms ease-out":"transform 120ms ease-out, background-position 120ms ease-out",mixBlendMode:"screen","--lg-spec-x":Ce,"--lg-spec-y":Ee,background:`radial-gradient(circle ${Nn} at var(--lg-spec-x, ${at}) var(--lg-spec-y, ${it}), rgba(255,255,255,${We}) 0%, rgba(255,255,255,${(We*.4).toFixed(3)}) 30%, rgba(255,255,255,0) 65%)`,zIndex:0,pointerEvents:"none"},Zt={position:"absolute",inset:0,borderRadius:F,transform:P,mixBlendMode:"screen","--lg-spec-x":Xt,"--lg-spec-y":qt,background:`radial-gradient(circle ${Tn} at var(--lg-spec-x, 50%) var(--lg-spec-y, 50%), rgba(255,255,255,${lt}) 0%, rgba(255,255,255,${(lt*.5).toFixed(3)}) 25%, rgba(255,255,255,0) 55%)`,opacity:Ht?1:0,transition:$?"transform 120ms ease-out":"transform 120ms ease-out, opacity 360ms ease-out",zIndex:0,pointerEvents:"none"},Jt={position:"absolute",inset:0,borderRadius:F,transform:P,transition:"transform 120ms ease-out",mixBlendMode:"overlay",padding:"1px",background:`linear-gradient(${Yt}deg, rgba(255,255,255,${ze}) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,${ze*.6}) 100%)`,zIndex:0,pointerEvents:"none"};let de;k&&T?de=Q==="light"?pe.dark:pe.light:k&&V&&(de=be?pe.dark:pe.light);const en={position:"relative",zIndex:1,borderRadius:F,...de?{color:de}:{}},tn={position:"absolute",inset:0,borderRadius:F,overflow:"hidden",transform:P,transition:"transform 120ms ease-out",zIndex:0,pointerEvents:"none"},nn={position:"absolute",inset:0,filter:Ue?`url(#${Ye})`:void 0,transformOrigin:Ut,...S?{background:S}:{}},Qe=I.scrim?I.scrim[Q]:null,Ke=Qe?{position:"absolute",inset:0,borderRadius:F,transform:P,transition:"transform 120ms ease-out",background:Qe,zIndex:0,pointerEvents:"none"}:null;return l.jsxs("div",{ref:L,className:R,style:Vt,onClick:v,onMouseEnter:()=>re(!0),onMouseLeave:()=>{re(!1),oe(!1)},onMouseDown:()=>oe(!0),onMouseUp:()=>oe(!1),children:[l.jsx("div",{"data-lg-shadow":"",style:zt,"aria-hidden":"true"}),l.jsx("div",{"data-lg-surface":"",style:Qt,children:ye?l.jsx(bt,{filterId:B,mode:m,width:w.width,height:w.height,effectiveScale:Be,aberrationIntensity:Pe,blurStdDeviation:ve,saturation:xe}):null}),Ue?l.jsxs("div",{"data-lg-refraction":"",style:tn,"aria-hidden":"true",inert:"true",children:[l.jsx(bt,{filterId:Ye,mode:m,width:Se,height:Re,effectiveScale:Be,aberrationIntensity:Pe,blurStdDeviation:ve,saturation:xe}),l.jsx("div",{"data-lg-refraction-copy":"",style:nn,children:Pt})]}):null,l.jsx("span",{"data-lg-highlight":"",style:Kt,"aria-hidden":"true"}),l.jsx("span",{"data-lg-press-glow":"",style:Zt,"aria-hidden":"true"}),l.jsx("span",{"data-lg-border":"",style:Jt,"aria-hidden":"true"}),Ke?l.jsx("span",{"data-lg-scrim":"",style:Ke,"aria-hidden":"true"}):null,k?l.jsx(Yn,{targetRef:L,onScheme:y}):null,x?l.jsx(Hn,{targetRef:L,onScheme:M}):null,l.jsx("div",{"data-lg-content":"",style:en,children:n})]})}function Xn(...n){return t=>{for(const e of n)e&&(typeof e=="function"?e(t):e.current=t)}}function qn(n,t){return n?t?(...e)=>{n(...e);const s=e[0];(!s||!s.defaultPrevented)&&t(...e)}:n:t}function Vn(n,t){const e={...t};for(const s in n){const r=n[s],o=t[s];s==="className"?e.className=[o,r].filter(Boolean).join(" "):s==="style"?e.style={...o,...r}:/^on[A-Z]/.test(s)?e[s]=qn(o,r):r!==void 0&&(e[s]=r)}return e}const Ot=f.forwardRef(function(t,e){const{children:s,...r}=t;if(!f.isValidElement(s)||f.Children.count(s)!==1)throw new Error('Slot (asChild) expects exactly one valid React element child. Pass a single element, e.g. <GlassButton asChild><a href="…">Link</a></GlassButton>.');const o=s,a=o.props,i=o.ref??a.ref,c=Vn(r,a);return c.ref=Xn(e,i),f.cloneElement(o,c)});function Wn(...n){return n.filter(Boolean).join(" ")}function $e(n){const{base:t,variants:e,defaultVariants:s}=n;return(r={})=>{var a;const o=[t];for(const i in e){const c=r[i]??(s==null?void 0:s[i]);c!==void 0&&o.push((a=e[i])==null?void 0:a[c])}return o.push(r.className),Wn(...o)}}const zn={primary:{displacementScale:80,blurAmount:.0625,saturation:160},secondary:{displacementScale:60,blurAmount:.0625,saturation:140},subtle:{displacementScale:40,blurAmount:.05,saturation:120}},Qn={sm:{cornerRadius:999,padding:0},md:{cornerRadius:999,padding:0},lg:{cornerRadius:999,padding:0},icon:{cornerRadius:999,padding:0}},Kn=$e({base:"lg-button",variants:{variant:{primary:"lg-button--primary",secondary:"lg-button--secondary",subtle:"lg-button--subtle"},size:{sm:"lg-button--sm",md:"lg-button--md",lg:"lg-button--lg",icon:"lg-button--icon"}},defaultVariants:{variant:"primary",size:"md"}}),Zn=f.forwardRef(function({variant:t="primary",size:e="md",asChild:s=!1,shine:r=!0,contentClassName:o,glassProps:a,className:i,children:c,style:d,type:h,disabled:x,...b},m){const u=Kn({variant:t,size:e,className:i}),p={"--lg-edge-shadow":le("light"),...d},g=l.jsx("span",{className:["lg-content",o].filter(Boolean).join(" "),children:c}),S=s?l.jsx(Ot,{ref:m,className:u,style:p,"data-shine":r?"true":"false",...b,children:c}):l.jsx("button",{ref:m,type:h??"button",disabled:x,className:u,style:p,"data-shine":r?"true":"false",...b,children:g}),R={...zn[t],...Qn[e]};return l.jsx(he,{...R,...a,children:S})}),Jn=$e({base:"lg-card",variants:{elevation:{flat:"lg-card--flat",raised:"lg-card--raised",floating:"lg-card--floating"}},defaultVariants:{elevation:"raised"}}),es={cornerRadius:28,padding:"24px 28px",displacementScale:50},ts=f.forwardRef(function({elevation:t="raised",asChild:e=!1,contentClassName:s,glassProps:r,className:o,children:a,style:i,...c},d){const h=Jn({elevation:t,className:o}),x={"--lg-edge-shadow":le("light"),...i},b=l.jsx("div",{className:["lg-content",s].filter(Boolean).join(" "),children:a}),m=e?l.jsx(Ot,{ref:d,className:h,style:x,"data-elevation":t,...c,children:a}):l.jsx("div",{ref:d,className:h,style:x,"data-elevation":t,...c,children:b});return l.jsx(he,{...es,...r,children:m})}),ns=typeof window<"u"?f.useLayoutEffect:f.useEffect,ss={sm:{displacementScale:40,blurAmount:.05,saturation:130},md:{displacementScale:56,blurAmount:.0625,saturation:140},lg:{displacementScale:72,blurAmount:.0625,saturation:150}},rs=$e({base:"lg-segmented",variants:{size:{sm:"lg-segmented--sm",md:"lg-segmented--md",lg:"lg-segmented--lg"}},defaultVariants:{size:"md"}}),os=f.forwardRef(function({options:t,value:e,defaultValue:s,onValueChange:r,size:o="md",label:a,"aria-label":i,showLabel:c=!1,className:d,style:h,name:x,glassProps:b},m){var V;const u=f.useId(),p=x??`lg-seg-${u.replace(/:/g,"")}`,g=(V=t[0])==null?void 0:V.value,S=e!==void 0,[R,N]=f.useState(s??g),v=S?e:R,E=f.useMemo(()=>{const y=t.findIndex(A=>A.value===v);return y<0?0:y},[t,v]),te=t.length||1,ne=ge(),G=f.useRef(null),O=f.useRef([]),[L,w]=f.useState(null),H=f.useCallback(()=>{const y=G.current,A=O.current[E];if(!y||!A)return;const M=y.getBoundingClientRect(),C=A.getBoundingClientRect();if(!Number.isFinite(M.width)||M.width<=0)return;const ae=Number.parseFloat(getComputedStyle(y).paddingLeft)||0,B=C.left-M.left-ae,I=C.width;!Number.isFinite(B)||!Number.isFinite(I)||I<=0||w(k=>k&&k.left===B&&k.width===I?k:{left:B,width:I})},[E]),$=f.useRef(H);$.current=H,ns(()=>{H()},[H]),f.useEffect(()=>{const y=G.current;if(!y||typeof ResizeObserver>"u")return;let A=0;const M=new ResizeObserver(()=>{A||(A=requestAnimationFrame(()=>{A=0,$.current()}))});return M.observe(y),()=>{A&&cancelAnimationFrame(A),M.disconnect()}},[]);const X=f.useCallback(y=>{S||N(y),r==null||r(y)},[S,r]),T=ss[o],se=le("light"),q=L!==null,re=q?{width:`${L.width}px`,transform:`translateX(${L.left}px)`}:{width:`${100/te}%`,transform:`translateX(${E*100}%)`};re.transition=ne?"none":"transform 320ms cubic-bezier(0.32, 0.72, 0, 1), width 320ms cubic-bezier(0.32, 0.72, 0, 1)";const ue={"--lg-edge-shadow":se,...h},oe=l.jsx("legend",{className:c?"lg-segmented-legend lg-segmented-legend--visible":"lg-segmented-legend",children:a??i??"Options"});return l.jsxs("fieldset",{ref:m,className:rs({size:o,className:d}),style:ue,"aria-label":i,"data-selected-index":E,"data-measured":q?"true":"false",children:[oe,l.jsxs("div",{className:"lg-segmented-track",ref:G,children:[l.jsx("div",{className:"lg-segmented-indicator",style:re,"data-selected-index":E,"aria-hidden":"true",children:l.jsx(he,{cornerRadius:"inherit",padding:0,displacementScale:T.displacementScale,blurAmount:T.blurAmount,saturation:T.saturation,...b,className:"lg-segmented-glass",style:{width:"100%",height:"100%",display:"block"},children:l.jsx("span",{"aria-hidden":"true",className:"lg-segmented-glass-fill"})})}),t.map((y,A)=>{const M=y.value===v,C=`${p}-${y.value}`;return l.jsxs("label",{htmlFor:C,className:"lg-segmented-option","data-active":M?"true":"false","data-icon-only":y.icon!=null&&y.label==null?"true":"false",ref:ae=>{O.current[A]=ae},children:[l.jsx("input",{id:C,className:"lg-segmented-input",type:"radio",name:p,value:y.value,checked:M,disabled:y.disabled,onChange:()=>X(y.value)}),y.icon!=null?l.jsx("span",{className:"lg-segmented-icon","aria-hidden":"true",children:y.icon}):null,y.label!=null?l.jsx("span",{className:"lg-segmented-label",children:y.label}):null]},y.value)})]})]})}),as="0.0.0";exports.GLASS_EDGE_DARK=Ct;exports.GLASS_EDGE_LIGHT=At;exports.GlassButton=Zn;exports.GlassCard=ts;exports.GlassSegmentedControl=os;exports.LIGHT_DARK_THRESHOLD=Nt;exports.LiquidGlass=he;exports.UNSAMPLED=D;exports.VERSION=as;exports.averageColorToSample=je;exports.calculateDirectionalScale=wt;exports.calculateElasticTranslation=Mt;exports.createCanvasSnapshotStrategy=_n;exports.detectGlassCapabilities=xt;exports.domBackgroundStrategy=Ft;exports.getConservativeGlassCapabilities=De;exports.getDisplacementMap=vt;exports.getGlassEdgeShadow=le;exports.luminanceToScheme=Lt;exports.parseCssColor=It;exports.relativeLuminance=Tt;exports.roundedRectSDF=J;exports.safeSample=kt;exports.sampleBackdropLuminance=_t;exports.smoothStep=ee;exports.useBackdropLuminance=Ge;exports.useGlassCapabilities=yt;exports.useMousePosition=Dt;exports.usePrefersContrast=jt;exports.useReducedMotion=ge;exports.useReducedTransparency=Gt;
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { useState as C, useEffect as N, useRef as te, useId as St, forwardRef as be, isValidElement as jt, Children as Wt, cloneElement as zt, useMemo as Qt, useCallback as tt, useLayoutEffect as Kt } from "react";
2
- import { jsxs as _, jsx as d, Fragment as nt } from "react/jsx-runtime";
1
+ import { useState as C, useEffect as N, useRef as te, useId as vt, forwardRef as be, isValidElement as jt, Children as Wt, cloneElement as zt, useMemo as Qt, useCallback as tt, useLayoutEffect as Kt } from "react";
2
+ import { jsxs as $, jsx as d, Fragment as nt } from "react/jsx-runtime";
3
3
  const Zt = {
4
4
  supportsBackdropFilter: !1,
5
5
  isChromium: !1,
@@ -10,7 +10,7 @@ const Zt = {
10
10
  prefersContrastMore: !1,
11
11
  canRefract: !1
12
12
  };
13
- function vt() {
13
+ function xt() {
14
14
  return { ...Zt };
15
15
  }
16
16
  function Jt() {
@@ -36,7 +36,7 @@ function on() {
36
36
  }
37
37
  function an() {
38
38
  if (!Jt())
39
- return vt();
39
+ return xt();
40
40
  const n = navigator.userAgent ?? "", t = en(), e = tn(n), r = nn(n, e), s = r, o = rn(), a = sn(), i = on();
41
41
  return {
42
42
  supportsBackdropFilter: t,
@@ -51,17 +51,17 @@ function an() {
51
51
  }
52
52
  function cn() {
53
53
  const [n, t] = C(
54
- vt
54
+ xt
55
55
  );
56
56
  return N(() => {
57
57
  t(an());
58
58
  }, []), n;
59
59
  }
60
- function le(n, t, e, r, s) {
60
+ function ue(n, t, e, r, s) {
61
61
  const o = e / 2, a = r / 2, i = Math.max(0, Math.min(s, Math.min(o, a))), c = Math.abs(n) - (o - i), u = Math.abs(t) - (a - i), g = Math.max(c, 0), b = Math.max(u, 0), h = Math.sqrt(g * g + b * b), f = Math.min(Math.max(c, u), 0);
62
62
  return h + f - i;
63
63
  }
64
- function ue(n, t, e) {
64
+ function de(n, t, e) {
65
65
  if (n === t) return e < n ? 0 : 1;
66
66
  const r = Math.max(0, Math.min(1, (e - n) / (t - n)));
67
67
  return r * r * (3 - 2 * r);
@@ -77,12 +77,12 @@ function ln(n, t, e) {
77
77
  const u = c + 0.5 - s, g = i + 0.5 - o;
78
78
  let b = 0, h = 0;
79
79
  if (n === "polar") {
80
- const l = Math.sqrt(u * u + g * g), m = le(u, g, t, e, a), p = ue(-Math.min(t, e) * 0.5, 0, m), R = l === 0 ? 0 : u / l, x = l === 0 ? 0 : g / l;
81
- b = R * p * 0.9, h = x * p * 0.9;
80
+ const l = Math.sqrt(u * u + g * g), m = ue(u, g, t, e, a), p = de(-Math.min(t, e) * 0.5, 0, m), R = l === 0 ? 0 : u / l, S = l === 0 ? 0 : g / l;
81
+ b = R * p * 0.9, h = S * p * 0.9;
82
82
  } else {
83
83
  let l, m, p;
84
84
  n === "standard" ? (l = -Math.min(t, e) * 0.18, m = 0, p = 0.7) : n === "prominent" ? (l = -Math.min(t, e) * 0.4, m = 0, p = 1) : (l = -Math.min(t, e) * 0.1, m = Math.min(t, e) * 0.04, p = 0.85);
85
- const R = le(u - 1, g, t, e, a), x = le(u + 1, g, t, e, a), T = le(u, g - 1, t, e, a), S = le(u, g + 1, t, e, a), E = ue(l, m, R), ne = ue(l, m, x), re = ue(l, m, T), G = ue(l, m, S);
85
+ const R = ue(u - 1, g, t, e, a), S = ue(u + 1, g, t, e, a), T = ue(u, g - 1, t, e, a), v = ue(u, g + 1, t, e, a), E = de(l, m, R), ne = de(l, m, S), re = de(l, m, T), G = de(l, m, v);
86
86
  b = (ne - E) * 0.5 * p, h = (G - re) * 0.5 * p;
87
87
  }
88
88
  const f = (i * t + c) * 4;
@@ -147,20 +147,20 @@ function At(n, t, e) {
147
147
  h.set(l, f), f += l.length;
148
148
  return h;
149
149
  }
150
- const L = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
150
+ const D = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
151
151
  function Ct(n) {
152
152
  let t = "", e = 0;
153
153
  for (; e + 2 < n.length; e += 3) {
154
154
  const s = n[e] << 16 | n[e + 1] << 8 | n[e + 2];
155
- t += L.charAt(s >>> 18 & 63) + L.charAt(s >>> 12 & 63) + L.charAt(s >>> 6 & 63) + L.charAt(s & 63);
155
+ t += D.charAt(s >>> 18 & 63) + D.charAt(s >>> 12 & 63) + D.charAt(s >>> 6 & 63) + D.charAt(s & 63);
156
156
  }
157
157
  const r = n.length - e;
158
158
  if (r === 1) {
159
159
  const s = n[e] << 16;
160
- t += `${L.charAt(s >>> 18 & 63)}${L.charAt(s >>> 12 & 63)}==`;
160
+ t += `${D.charAt(s >>> 18 & 63)}${D.charAt(s >>> 12 & 63)}==`;
161
161
  } else if (r === 2) {
162
162
  const s = n[e] << 16 | n[e + 1] << 8;
163
- t += `${L.charAt(s >>> 18 & 63)}${L.charAt(s >>> 12 & 63)}${L.charAt(s >>> 6 & 63)}=`;
163
+ t += `${D.charAt(s >>> 18 & 63)}${D.charAt(s >>> 12 & 63)}${D.charAt(s >>> 6 & 63)}=`;
164
164
  }
165
165
  return t;
166
166
  }
@@ -201,14 +201,14 @@ const bn = [
201
201
  function ye(n) {
202
202
  return n === "dark" ? yn : bn;
203
203
  }
204
- const Rn = 200, xn = 300, ot = 0.3, at = 0.15, it = 0.8, ct = 0.1;
204
+ const Rn = 200, Sn = 300, ot = 0.3, at = 0.15, it = 0.8, ct = 0.1;
205
205
  function De(n, t, e) {
206
206
  return Math.min(e, Math.max(t, n));
207
207
  }
208
208
  function Et(n) {
209
209
  return Number.isFinite(n) ? De(1 - n / Rn, 0, 1) : 0;
210
210
  }
211
- function Sn(n, t, e, r, s) {
211
+ function vn(n, t, e, r, s) {
212
212
  if (!(s > 0))
213
213
  return { scaleX: 1, scaleY: 1 };
214
214
  const o = n - e, a = t - r, i = Math.hypot(o, a);
@@ -217,7 +217,7 @@ function Sn(n, t, e, r, s) {
217
217
  const c = Et(i);
218
218
  if (c === 0)
219
219
  return { scaleX: 1, scaleY: 1 };
220
- const u = o / i, g = a / i, b = Math.abs(u), h = Math.abs(g), f = Math.min(i / xn, 1) * s * c, l = De(
220
+ const u = o / i, g = a / i, b = Math.abs(u), h = Math.abs(g), f = Math.min(i / Sn, 1) * s * c, l = De(
221
221
  1 + b * f * ot - h * f * at,
222
222
  it,
223
223
  Number.POSITIVE_INFINITY
@@ -228,7 +228,7 @@ function Sn(n, t, e, r, s) {
228
228
  );
229
229
  return { scaleX: l, scaleY: m };
230
230
  }
231
- function vn(n, t, e, r, s) {
231
+ function xn(n, t, e, r, s) {
232
232
  if (!(s > 0))
233
233
  return { x: 0, y: 0 };
234
234
  const o = n - e, a = t - r, i = Math.hypot(o, a);
@@ -280,7 +280,7 @@ const O = {
280
280
  { y: 12, blur: 32, alpha: 0.28 },
281
281
  { y: 2, blur: 8, alpha: 0.18 }
282
282
  ]
283
- }, Fn = {
283
+ }, Ln = {
284
284
  regular: {
285
285
  /** Multiplier on the requested `saturation` (1 = unchanged). */
286
286
  saturationFactor: 1,
@@ -302,7 +302,7 @@ const O = {
302
302
  dark: "rgba(0, 0, 0, 0.28)"
303
303
  }
304
304
  }
305
- }, Ln = "rgba(255, 255, 255, 0.1)", gt = {
305
+ }, Fn = "rgba(255, 255, 255, 0.1)", gt = {
306
306
  /** Inset ring color (translucent white). */
307
307
  color: "rgba(255, 255, 255, 0.5)",
308
308
  /** Ring width in px (hairline). */
@@ -312,12 +312,12 @@ const O = {
312
312
  scheme: null,
313
313
  sampled: !1
314
314
  }, _n = 0.5;
315
- function Fe(n) {
315
+ function Le(n) {
316
316
  const t = n / 255;
317
317
  return t <= 0.03928 ? t / 12.92 : ((t + 0.055) / 1.055) ** 2.4;
318
318
  }
319
319
  function Dn(n, t, e) {
320
- const r = Fe(n), s = Fe(t), o = Fe(e);
320
+ const r = Le(n), s = Le(t), o = Le(e);
321
321
  return 0.2126 * r + 0.7152 * s + 0.0722 * o;
322
322
  }
323
323
  function $n(n) {
@@ -343,12 +343,12 @@ function On(n) {
343
343
  const r = e[1].split(/[\s,/]+/).filter(Boolean);
344
344
  if (r.length < 3)
345
345
  return { r: 0, g: 0, b: 0, a: 0 };
346
- const s = Le(Number.parseFloat(r[0])), o = Le(Number.parseFloat(r[1])), a = Le(Number.parseFloat(r[2]));
346
+ const s = Fe(Number.parseFloat(r[0])), o = Fe(Number.parseFloat(r[1])), a = Fe(Number.parseFloat(r[2]));
347
347
  let i = 1;
348
348
  const c = r[3];
349
349
  return c !== void 0 && (i = c.endsWith("%") ? Number.parseFloat(c) / 100 : Number.parseFloat(c), Number.isFinite(i) || (i = 1)), { r: s, g: o, b: a, a: Bn(i) };
350
350
  }
351
- function Le(n) {
351
+ function Fe(n) {
352
352
  return Number.isFinite(n) ? Math.max(0, Math.min(255, Math.round(n))) : 0;
353
353
  }
354
354
  function Bn(n) {
@@ -490,10 +490,10 @@ function qn(n = {}) {
490
490
  const { container: m, elementRef: p } = g.current, R = bt(m) ?? (p == null ? void 0 : p.current) ?? null;
491
491
  if (!R)
492
492
  return;
493
- const x = R.getBoundingClientRect(), T = x.left + x.width / 2, S = x.top + x.height / 2;
493
+ const S = R.getBoundingClientRect(), T = S.left + S.width / 2, v = S.top + S.height / 2;
494
494
  u({
495
495
  mousePos: { x: l.clientX, y: l.clientY },
496
- offset: { x: l.clientX - T, y: l.clientY - S },
496
+ offset: { x: l.clientX - T, y: l.clientY - v },
497
497
  isActive: !0
498
498
  });
499
499
  };
@@ -553,7 +553,7 @@ function Rt(n) {
553
553
  function Jn(n, t, e) {
554
554
  return e || `blur(${n}px) saturate(${t}%)`;
555
555
  }
556
- function xt({
556
+ function St({
557
557
  filterId: n,
558
558
  mode: t,
559
559
  width: e,
@@ -563,7 +563,7 @@ function xt({
563
563
  blurStdDeviation: a,
564
564
  saturation: i
565
565
  }) {
566
- const c = t === "turbulence", u = s + o, g = s, b = s - o, h = c ? /* @__PURE__ */ _(nt, { children: [
566
+ const c = t === "turbulence", u = s + o, g = s, b = s - o, h = c ? /* @__PURE__ */ $(nt, { children: [
567
567
  /* @__PURE__ */ d(
568
568
  "feTurbulence",
569
569
  {
@@ -586,27 +586,27 @@ function xt({
586
586
  preserveAspectRatio: "none",
587
587
  result: "dispSource"
588
588
  }
589
- ), f = (x, T, S) => {
589
+ ), f = (S, T, v) => {
590
590
  const E = T === "R" ? "1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0" : T === "G" ? "0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0" : "0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0";
591
- return /* @__PURE__ */ _(nt, { children: [
591
+ return /* @__PURE__ */ $(nt, { children: [
592
592
  /* @__PURE__ */ d(
593
593
  "feDisplacementMap",
594
594
  {
595
595
  in: "SourceGraphic",
596
596
  in2: "dispSource",
597
- scale: x,
597
+ scale: S,
598
598
  xChannelSelector: "R",
599
599
  yChannelSelector: "B",
600
- result: `${S}_disp`
600
+ result: `${v}_disp`
601
601
  }
602
602
  ),
603
603
  /* @__PURE__ */ d(
604
604
  "feColorMatrix",
605
605
  {
606
- in: `${S}_disp`,
606
+ in: `${v}_disp`,
607
607
  type: "matrix",
608
608
  values: E,
609
- result: S
609
+ result: v
610
610
  }
611
611
  )
612
612
  ] });
@@ -618,7 +618,7 @@ function xt({
618
618
  width: "0",
619
619
  height: "0",
620
620
  style: { position: "absolute", width: 0, height: 0, overflow: "hidden" },
621
- children: /* @__PURE__ */ d("defs", { children: /* @__PURE__ */ _(
621
+ children: /* @__PURE__ */ d("defs", { children: /* @__PURE__ */ $(
622
622
  "filter",
623
623
  {
624
624
  id: n,
@@ -661,7 +661,7 @@ function xt({
661
661
  }
662
662
  ),
663
663
  /* @__PURE__ */ d("feGaussianBlur", { in: "aberrated", stdDeviation: 0.5, result: "softened" }),
664
- /* @__PURE__ */ _("radialGradient", { id: `${n}-edge`, cx: "50%", cy: "50%", r: "50%", children: [
664
+ /* @__PURE__ */ $("radialGradient", { id: `${n}-edge`, cx: "50%", cy: "50%", r: "50%", children: [
665
665
  /* @__PURE__ */ d("stop", { offset: "0%", stopColor: "#000000", stopOpacity: "0" }),
666
666
  /* @__PURE__ */ d("stop", { offset: "70%", stopColor: "#000000", stopOpacity: "0" }),
667
667
  /* @__PURE__ */ d("stop", { offset: "100%", stopColor: "#ffffff", stopOpacity: "1" })
@@ -719,25 +719,25 @@ function Ge({
719
719
  size: m,
720
720
  center: p,
721
721
  behind: R,
722
- className: x,
722
+ className: S,
723
723
  style: T,
724
- onClick: S,
724
+ onClick: v,
725
725
  globalMousePos: E,
726
726
  mouseOffset: ne,
727
727
  mouseContainer: re
728
728
  }) {
729
- const { canRefract: G, supportsBackdropFilter: P } = cn(), k = te(null), [w, V] = C(null), U = Be(), j = zn(), I = jn(), se = Zn(), [W, oe] = C(!1), [de, ae] = C(!1), [z, y] = C(null), [v, M] = C(null), { offset: A, isActive: Y } = qn({
729
+ const { canRefract: G, supportsBackdropFilter: P } = cn(), k = te(null), [w, V] = C(null), U = Be(), j = zn(), I = jn(), se = Zn(), [W, oe] = C(!1), [fe, ae] = C(!1), [z, y] = C(null), [x, M] = C(null), { offset: A, isActive: ie } = qn({
730
730
  container: re,
731
731
  globalMousePos: E,
732
732
  mouseOffset: ne,
733
733
  elementRef: k
734
- }), D = `lg-${St().replace(/:/g, "")}`;
734
+ }), Y = `lg-${vt().replace(/:/g, "")}`;
735
735
  N(() => {
736
- const ie = k.current;
737
- if (!ie) return;
736
+ const ce = k.current;
737
+ if (!ce) return;
738
738
  let H = 0;
739
- const ce = () => {
740
- const ee = ie.getBoundingClientRect();
739
+ const le = () => {
740
+ const ee = ce.getBoundingClientRect();
741
741
  if (!Number.isFinite(ee.width) || !Number.isFinite(ee.height) || ee.width <= 0 || ee.height <= 0)
742
742
  return;
743
743
  const Je = yt(ee.width), et = yt(ee.height);
@@ -745,38 +745,38 @@ function Ge({
745
745
  (ge) => ge && ge.width === Je && ge.height === et ? ge : { width: Je, height: et }
746
746
  );
747
747
  };
748
- if (ce(), typeof ResizeObserver > "u")
748
+ if (le(), typeof ResizeObserver > "u")
749
749
  return;
750
750
  const pe = new ResizeObserver(() => {
751
751
  H || (H = requestAnimationFrame(() => {
752
- H = 0, ce();
752
+ H = 0, le();
753
753
  }));
754
754
  });
755
- return pe.observe(ie), () => {
755
+ return pe.observe(ce), () => {
756
756
  H && cancelAnimationFrame(H), pe.disconnect();
757
757
  };
758
758
  }, []);
759
- const F = Fn[h], fe = g && !F.forceNonAdaptive, Re = u ?? (fe && z ? z === "light" : !1), Ue = Re ? e / 2 : e, xe = I ? Tn : s * F.saturationFactor, Ye = I ? 0 : o, Q = w !== null && w.width > 0 && w.height > 0, Se = t && G && Q && !j, Tt = Se ? `url(#${D})` : null, It = l !== void 0 || m !== void 0 || p !== void 0, ve = (m == null ? void 0 : m.width) ?? (Q ? w.width : 0), Ae = (m == null ? void 0 : m.height) ?? (Q ? w.height : 0), Xe = It && !j && Number.isFinite(ve) && Number.isFinite(Ae) && ve > 0 && Ae > 0, He = `${D}-copy`, kt = l !== void 0 ? l : n, Ft = `${(((p == null ? void 0 : p.x) ?? 0.5) * 100).toFixed(2)}% ${(((p == null ? void 0 : p.y) ?? 0.5) * 100).toFixed(2)}%`, qe = P && !Se && !j && !I, Ce = r * An * (Re ? 1.5 : 1), Ee = P ? Jn(Ce, xe, Tt) : void 0, $ = Rt(i), K = Y && !U, Ve = K ? Sn(A.x, A.y, 0, 0, a) : { scaleX: 1, scaleY: 1 }, je = K ? vn(A.x, A.y, 0, 0, a) : { x: 0, y: 0 }, We = typeof S == "function" && de ? 0.96 : 1, X = `translate(${je.x.toFixed(2)}px, ${je.y.toFixed(
759
+ const L = Ln[h], F = g && !L.forceNonAdaptive, Re = u ?? (F && z ? z === "light" : !1), Ue = Re ? e / 2 : e, Se = I ? Tn : s * L.saturationFactor, Ye = I ? 0 : o, Q = w !== null && w.width > 0 && w.height > 0, ve = t && G && Q && !j, Tt = ve ? `url(#${Y})` : null, It = l !== void 0 || m !== void 0 || p !== void 0, xe = (m == null ? void 0 : m.width) ?? (Q ? w.width : 0), Ae = (m == null ? void 0 : m.height) ?? (Q ? w.height : 0), Xe = It && !j && Number.isFinite(xe) && Number.isFinite(Ae) && xe > 0 && Ae > 0, He = `${Y}-copy`, kt = l !== void 0 ? l : n, Lt = `${(((p == null ? void 0 : p.x) ?? 0.5) * 100).toFixed(2)}% ${(((p == null ? void 0 : p.y) ?? 0.5) * 100).toFixed(2)}%`, qe = P && !ve && !j && !I, Ce = r * An * (Re ? 1.5 : 1), Ee = P ? Jn(Ce, Se, Tt) : void 0, _ = Rt(i), K = ie && !U, Ve = K ? vn(A.x, A.y, 0, 0, a) : { scaleX: 1, scaleY: 1 }, je = K ? xn(A.x, A.y, 0, 0, a) : { x: 0, y: 0 }, We = typeof v == "function" && fe ? 0.96 : 1, X = `translate(${je.x.toFixed(2)}px, ${je.y.toFixed(
760
760
  2
761
- )}px) scale(${(Ve.scaleX * We).toFixed(4)}, ${(Ve.scaleY * We).toFixed(4)})`, Lt = 135 + (K ? A.x * 0.15 : 0);
761
+ )}px) scale(${(Ve.scaleX * We).toFixed(4)}, ${(Ve.scaleY * We).toFixed(4)})`, Ft = 135 + (K ? A.x * 0.15 : 0);
762
762
  let we = lt, Me = ut;
763
763
  if (K && Q) {
764
- const ie = 50 + A.x / (w.width / 2) * 50, H = 50 + A.y / (w.height / 2) * 50, ce = (pe) => Math.max(-20, Math.min(120, pe));
765
- we = `${ce(ie).toFixed(2)}%`, Me = `${ce(H).toFixed(2)}%`;
764
+ const ce = 50 + A.x / (w.width / 2) * 50, H = 50 + A.y / (w.height / 2) * 50, le = (pe) => Math.max(-20, Math.min(120, pe));
765
+ we = `${le(ce).toFixed(2)}%`, Me = `${le(H).toFixed(2)}%`;
766
766
  }
767
- const _t = de, Dt = K && Q ? we : "50%", $t = K && Q ? Me : "50%", Ne = ye(se ? "dark" : "light");
767
+ const _t = fe, Dt = K && Q ? we : "50%", $t = K && Q ? Me : "50%", Ne = ye(se ? "dark" : "light");
768
768
  let Te = Ne;
769
769
  I ? Te = `inset 0 0 0 ${Mn}px ${wn[se ? "dark" : "light"]}, ${Ne}` : qe && (Te = `inset 0 0 0 ${gt.width}px ${gt.color}, ${Ne}`);
770
770
  const ze = W ? dt.hover : dt.rest, Qe = W ? 0.55 : 0.35, Ot = {
771
771
  position: "relative",
772
772
  display: "inline-block",
773
773
  padding: Rt(c),
774
- borderRadius: $,
774
+ borderRadius: _,
775
775
  ...T
776
- }, Bt = b ? mt[v ?? "static"] : mt.static, Gt = {
776
+ }, Bt = b ? mt[x ?? "static"] : mt.static, Gt = {
777
777
  position: "absolute",
778
778
  inset: 0,
779
- borderRadius: $,
779
+ borderRadius: _,
780
780
  transform: X,
781
781
  // Scroll-aware + reduced motion: drop the box-shadow transition so the depth
782
782
  // SNAPS between scroll-aware states instead of animating. Only applies on the
@@ -790,11 +790,11 @@ function Ge({
790
790
  pointerEvents: "none"
791
791
  }, Z = se ? "dark" : "light";
792
792
  let J;
793
- I ? J = Nn[Z] : j ? J = P ? Cn[Z] : En[Z] : P ? qe && (J = Ln) : J = Z === "dark" ? "rgba(30, 30, 35, 0.55)" : "rgba(255, 255, 255, 0.55)";
793
+ I ? J = Nn[Z] : j ? J = P ? Cn[Z] : En[Z] : P ? qe && (J = Fn) : J = Z === "dark" ? "rgba(30, 30, 35, 0.55)" : "rgba(255, 255, 255, 0.55)";
794
794
  const Pt = {
795
795
  position: "absolute",
796
796
  inset: 0,
797
- borderRadius: $,
797
+ borderRadius: _,
798
798
  overflow: "hidden",
799
799
  // Tiers 1/2 carry the frosted backdrop (with -webkit- prefix); tier 3 omits
800
800
  // the filter entirely (no orphaned/unsupported declaration). The `background`
@@ -815,7 +815,7 @@ function Ge({
815
815
  }, Ut = {
816
816
  position: "absolute",
817
817
  inset: 0,
818
- borderRadius: $,
818
+ borderRadius: _,
819
819
  transform: X,
820
820
  transition: U ? "transform 120ms ease-out" : "transform 120ms ease-out, background-position 120ms ease-out",
821
821
  mixBlendMode: "screen",
@@ -829,7 +829,7 @@ function Ge({
829
829
  }, Yt = {
830
830
  position: "absolute",
831
831
  inset: 0,
832
- borderRadius: $,
832
+ borderRadius: _,
833
833
  transform: X,
834
834
  mixBlendMode: "screen",
835
835
  "--lg-spec-x": Dt,
@@ -842,25 +842,31 @@ function Ge({
842
842
  }, Xt = {
843
843
  position: "absolute",
844
844
  inset: 0,
845
- borderRadius: $,
845
+ borderRadius: _,
846
846
  transform: X,
847
847
  transition: "transform 120ms ease-out",
848
848
  mixBlendMode: "overlay",
849
849
  padding: "1px",
850
- background: `linear-gradient(${Lt}deg, rgba(255,255,255,${Qe}) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,${Qe * 0.6}) 100%)`,
850
+ background: `linear-gradient(${Ft}deg, rgba(255,255,255,${Qe}) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,${Qe * 0.6}) 100%)`,
851
851
  zIndex: 0,
852
852
  pointerEvents: "none"
853
853
  };
854
854
  let me;
855
- fe && I ? me = Z === "light" ? he.dark : he.light : fe && z && (me = Re ? he.dark : he.light);
855
+ F && I ? me = Z === "light" ? he.dark : he.light : F && z && (me = Re ? he.dark : he.light);
856
856
  const Ht = {
857
857
  position: "relative",
858
858
  zIndex: 1,
859
+ // Carry the surface's rounded shape so children using `border-radius: inherit`
860
+ // (the GlassButton shell + its press-shine ::after, the GlassCard) actually
861
+ // pick up the glass corners instead of resolving to 0 (a rectangle). Purely
862
+ // for inheritance — there is no `overflow`, so this clips nothing and is
863
+ // visually inert on its own.
864
+ borderRadius: _,
859
865
  ...me ? { color: me } : {}
860
866
  }, qt = {
861
867
  position: "absolute",
862
868
  inset: 0,
863
- borderRadius: $,
869
+ borderRadius: _,
864
870
  overflow: "hidden",
865
871
  transform: X,
866
872
  transition: "transform 120ms ease-out",
@@ -870,12 +876,12 @@ function Ge({
870
876
  position: "absolute",
871
877
  inset: 0,
872
878
  filter: Xe ? `url(#${He})` : void 0,
873
- transformOrigin: Ft,
879
+ transformOrigin: Lt,
874
880
  ...R ? { background: R } : {}
875
- }, Ke = F.scrim ? F.scrim[Z] : null, Ze = Ke ? {
881
+ }, Ke = L.scrim ? L.scrim[Z] : null, Ze = Ke ? {
876
882
  position: "absolute",
877
883
  inset: 0,
878
- borderRadius: $,
884
+ borderRadius: _,
879
885
  transform: X,
880
886
  transition: "transform 120ms ease-out",
881
887
  background: Ke,
@@ -891,13 +897,13 @@ function Ge({
891
897
  // interactive (and keyboard-accessible) elements as children. Forcing
892
898
  // keyboard handlers here would invent semantics the consumer didn't request.
893
899
  // biome-ignore lint/a11y/useKeyWithClickEvents: presentational pass-through; children own interactivity
894
- /* @__PURE__ */ _(
900
+ /* @__PURE__ */ $(
895
901
  "div",
896
902
  {
897
903
  ref: k,
898
- className: x,
904
+ className: S,
899
905
  style: Ot,
900
- onClick: S,
906
+ onClick: v,
901
907
  onMouseEnter: () => oe(!0),
902
908
  onMouseLeave: () => {
903
909
  oe(!1), ae(!1);
@@ -906,20 +912,20 @@ function Ge({
906
912
  onMouseUp: () => ae(!1),
907
913
  children: [
908
914
  /* @__PURE__ */ d("div", { "data-lg-shadow": "", style: Gt, "aria-hidden": "true" }),
909
- /* @__PURE__ */ d("div", { "data-lg-surface": "", style: Pt, children: Se ? /* @__PURE__ */ d(
910
- xt,
915
+ /* @__PURE__ */ d("div", { "data-lg-surface": "", style: Pt, children: ve ? /* @__PURE__ */ d(
916
+ St,
911
917
  {
912
- filterId: D,
918
+ filterId: Y,
913
919
  mode: f,
914
920
  width: w.width,
915
921
  height: w.height,
916
922
  effectiveScale: Ue,
917
923
  aberrationIntensity: Ye,
918
924
  blurStdDeviation: Ce,
919
- saturation: xe
925
+ saturation: Se
920
926
  }
921
927
  ) : null }),
922
- Xe ? /* @__PURE__ */ _(
928
+ Xe ? /* @__PURE__ */ $(
923
929
  "div",
924
930
  {
925
931
  "data-lg-refraction": "",
@@ -928,16 +934,16 @@ function Ge({
928
934
  inert: "true",
929
935
  children: [
930
936
  /* @__PURE__ */ d(
931
- xt,
937
+ St,
932
938
  {
933
939
  filterId: He,
934
940
  mode: f,
935
- width: ve,
941
+ width: xe,
936
942
  height: Ae,
937
943
  effectiveScale: Ue,
938
944
  aberrationIntensity: Ye,
939
945
  blurStdDeviation: Ce,
940
- saturation: xe
946
+ saturation: Se
941
947
  }
942
948
  ),
943
949
  /* @__PURE__ */ d("div", { "data-lg-refraction-copy": "", style: Vt, children: kt })
@@ -948,7 +954,7 @@ function Ge({
948
954
  /* @__PURE__ */ d("span", { "data-lg-press-glow": "", style: Yt, "aria-hidden": "true" }),
949
955
  /* @__PURE__ */ d("span", { "data-lg-border": "", style: Xt, "aria-hidden": "true" }),
950
956
  Ze ? /* @__PURE__ */ d("span", { "data-lg-scrim": "", style: Ze, "aria-hidden": "true" }) : null,
951
- fe ? /* @__PURE__ */ d(er, { targetRef: k, onScheme: y }) : null,
957
+ F ? /* @__PURE__ */ d(er, { targetRef: k, onScheme: y }) : null,
952
958
  b ? /* @__PURE__ */ d(tr, { targetRef: k, onScheme: M }) : null,
953
959
  /* @__PURE__ */ d("div", { "data-lg-content": "", style: Ht, children: n })
954
960
  ]
@@ -1009,10 +1015,10 @@ const ar = {
1009
1015
  secondary: { displacementScale: 60, blurAmount: 0.0625, saturation: 140 },
1010
1016
  subtle: { displacementScale: 40, blurAmount: 0.05, saturation: 120 }
1011
1017
  }, ir = {
1012
- sm: { cornerRadius: 999, padding: "6px 14px" },
1013
- md: { cornerRadius: 999, padding: "10px 20px" },
1014
- lg: { cornerRadius: 999, padding: "14px 28px" },
1015
- icon: { cornerRadius: 999, padding: "10px" }
1018
+ sm: { cornerRadius: 999, padding: 0 },
1019
+ md: { cornerRadius: 999, padding: 0 },
1020
+ lg: { cornerRadius: 999, padding: 0 },
1021
+ icon: { cornerRadius: 999, padding: 0 }
1016
1022
  }, cr = Pe({
1017
1023
  base: "lg-button",
1018
1024
  variants: {
@@ -1068,11 +1074,11 @@ const ar = {
1068
1074
  ...h,
1069
1075
  children: p
1070
1076
  }
1071
- ), x = {
1077
+ ), S = {
1072
1078
  ...ar[t],
1073
1079
  ...ir[e]
1074
1080
  };
1075
- return /* @__PURE__ */ d(Ge, { ...x, ...a, children: R });
1081
+ return /* @__PURE__ */ d(Ge, { ...S, ...a, children: R });
1076
1082
  }), lr = Pe({
1077
1083
  base: "lg-card",
1078
1084
  variants: {
@@ -1136,7 +1142,7 @@ const ar = {
1136
1142
  }
1137
1143
  },
1138
1144
  defaultVariants: { size: "md" }
1139
- }), xr = be(
1145
+ }), Sr = be(
1140
1146
  function({
1141
1147
  options: t,
1142
1148
  value: e,
@@ -1152,19 +1158,19 @@ const ar = {
1152
1158
  glassProps: h
1153
1159
  }, f) {
1154
1160
  var z;
1155
- const l = St(), m = b ?? `lg-seg-${l.replace(/:/g, "")}`, p = (z = t[0]) == null ? void 0 : z.value, R = e !== void 0, [x, T] = C(
1161
+ const l = vt(), m = b ?? `lg-seg-${l.replace(/:/g, "")}`, p = (z = t[0]) == null ? void 0 : z.value, R = e !== void 0, [S, T] = C(
1156
1162
  r ?? p
1157
- ), S = R ? e : x, E = Qt(() => {
1158
- const y = t.findIndex((v) => v.value === S);
1163
+ ), v = R ? e : S, E = Qt(() => {
1164
+ const y = t.findIndex((x) => x.value === v);
1159
1165
  return y < 0 ? 0 : y;
1160
- }, [t, S]), ne = t.length || 1, re = Be(), G = te(null), P = te([]), [k, w] = C(null), V = tt(() => {
1161
- const y = G.current, v = P.current[E];
1162
- if (!y || !v) return;
1163
- const M = y.getBoundingClientRect(), A = v.getBoundingClientRect();
1166
+ }, [t, v]), ne = t.length || 1, re = Be(), G = te(null), P = te([]), [k, w] = C(null), V = tt(() => {
1167
+ const y = G.current, x = P.current[E];
1168
+ if (!y || !x) return;
1169
+ const M = y.getBoundingClientRect(), A = x.getBoundingClientRect();
1164
1170
  if (!Number.isFinite(M.width) || M.width <= 0) return;
1165
- const Y = A.left - M.left, D = A.width;
1166
- !Number.isFinite(Y) || !Number.isFinite(D) || D <= 0 || w(
1167
- (F) => F && F.left === Y && F.width === D ? F : { left: Y, width: D }
1171
+ const ie = Number.parseFloat(getComputedStyle(y).paddingLeft) || 0, Y = A.left - M.left - ie, L = A.width;
1172
+ !Number.isFinite(Y) || !Number.isFinite(L) || L <= 0 || w(
1173
+ (F) => F && F.left === Y && F.width === L ? F : { left: Y, width: L }
1168
1174
  );
1169
1175
  }, [E]), U = te(V);
1170
1176
  U.current = V, dr(() => {
@@ -1172,14 +1178,14 @@ const ar = {
1172
1178
  }, [V]), N(() => {
1173
1179
  const y = G.current;
1174
1180
  if (!y || typeof ResizeObserver > "u") return;
1175
- let v = 0;
1181
+ let x = 0;
1176
1182
  const M = new ResizeObserver(() => {
1177
- v || (v = requestAnimationFrame(() => {
1178
- v = 0, U.current();
1183
+ x || (x = requestAnimationFrame(() => {
1184
+ x = 0, U.current();
1179
1185
  }));
1180
1186
  });
1181
1187
  return M.observe(y), () => {
1182
- v && cancelAnimationFrame(v), M.disconnect();
1188
+ x && cancelAnimationFrame(x), M.disconnect();
1183
1189
  };
1184
1190
  }, []);
1185
1191
  const j = tt(
@@ -1195,7 +1201,7 @@ const ar = {
1195
1201
  transform: `translateX(${E * 100}%)`
1196
1202
  };
1197
1203
  oe.transition = re ? "none" : "transform 320ms cubic-bezier(0.32, 0.72, 0, 1), width 320ms cubic-bezier(0.32, 0.72, 0, 1)";
1198
- const de = {
1204
+ const fe = {
1199
1205
  "--lg-edge-shadow": se,
1200
1206
  ...g
1201
1207
  }, ae = /* @__PURE__ */ d(
@@ -1205,18 +1211,18 @@ const ar = {
1205
1211
  children: a ?? i ?? "Options"
1206
1212
  }
1207
1213
  );
1208
- return /* @__PURE__ */ _(
1214
+ return /* @__PURE__ */ $(
1209
1215
  "fieldset",
1210
1216
  {
1211
1217
  ref: f,
1212
1218
  className: mr({ size: o, className: u }),
1213
- style: de,
1219
+ style: fe,
1214
1220
  "aria-label": i,
1215
1221
  "data-selected-index": E,
1216
1222
  "data-measured": W ? "true" : "false",
1217
1223
  children: [
1218
1224
  ae,
1219
- /* @__PURE__ */ _("div", { className: "lg-segmented-track", ref: G, children: [
1225
+ /* @__PURE__ */ $("div", { className: "lg-segmented-track", ref: G, children: [
1220
1226
  /* @__PURE__ */ d(
1221
1227
  "div",
1222
1228
  {
@@ -1240,17 +1246,17 @@ const ar = {
1240
1246
  )
1241
1247
  }
1242
1248
  ),
1243
- t.map((y, v) => {
1244
- const M = y.value === S, A = `${m}-${y.value}`;
1245
- return /* @__PURE__ */ _(
1249
+ t.map((y, x) => {
1250
+ const M = y.value === v, A = `${m}-${y.value}`;
1251
+ return /* @__PURE__ */ $(
1246
1252
  "label",
1247
1253
  {
1248
1254
  htmlFor: A,
1249
1255
  className: "lg-segmented-option",
1250
1256
  "data-active": M ? "true" : "false",
1251
1257
  "data-icon-only": y.icon != null && y.label == null ? "true" : "false",
1252
- ref: (Y) => {
1253
- P.current[v] = Y;
1258
+ ref: (ie) => {
1259
+ P.current[x] = ie;
1254
1260
  },
1255
1261
  children: [
1256
1262
  /* @__PURE__ */ d(
@@ -1278,33 +1284,33 @@ const ar = {
1278
1284
  }
1279
1285
  );
1280
1286
  }
1281
- ), Sr = "0.0.0";
1287
+ ), vr = "0.0.0";
1282
1288
  export {
1283
1289
  yn as GLASS_EDGE_DARK,
1284
1290
  bn as GLASS_EDGE_LIGHT,
1285
1291
  yr as GlassButton,
1286
1292
  Rr as GlassCard,
1287
- xr as GlassSegmentedControl,
1293
+ Sr as GlassSegmentedControl,
1288
1294
  _n as LIGHT_DARK_THRESHOLD,
1289
1295
  Ge as LiquidGlass,
1290
1296
  B as UNSAMPLED,
1291
- Sr as VERSION,
1297
+ vr as VERSION,
1292
1298
  wt as averageColorToSample,
1293
- Sn as calculateDirectionalScale,
1294
- vn as calculateElasticTranslation,
1299
+ vn as calculateDirectionalScale,
1300
+ xn as calculateElasticTranslation,
1295
1301
  br as createCanvasSnapshotStrategy,
1296
1302
  an as detectGlassCapabilities,
1297
1303
  Un as domBackgroundStrategy,
1298
- vt as getConservativeGlassCapabilities,
1304
+ xt as getConservativeGlassCapabilities,
1299
1305
  hn as getDisplacementMap,
1300
1306
  ye as getGlassEdgeShadow,
1301
1307
  $n as luminanceToScheme,
1302
1308
  On as parseCssColor,
1303
1309
  Dn as relativeLuminance,
1304
- le as roundedRectSDF,
1310
+ ue as roundedRectSDF,
1305
1311
  Pn as safeSample,
1306
1312
  Yn as sampleBackdropLuminance,
1307
- ue as smoothStep,
1313
+ de as smoothStep,
1308
1314
  Mt as useBackdropLuminance,
1309
1315
  cn as useGlassCapabilities,
1310
1316
  qn as useMousePosition,
@@ -1 +1 @@
1
- .lg-content{display:inline-flex;align-items:center;justify-content:center;gap:.5em;color:var(--lg-fg, rgba(17, 17, 19, .92));text-shadow:0 1px 1px rgba(255,255,255,.45);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}@media(prefers-color-scheme:dark){.lg-content{color:var(--lg-fg, rgba(245, 245, 247, .94));text-shadow:0 1px 2px rgba(0,0,0,.55)}}.lg-button{position:relative;-moz-appearance:none;appearance:none;-webkit-appearance:none;border:0;margin:0;background:transparent;font:inherit;font-weight:600;line-height:1.2;letter-spacing:.01em;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;color:var(--lg-fg, rgba(17, 17, 19, .92));text-decoration:none;border-radius:inherit;transition:filter .16s ease,opacity .16s ease}.lg-button:hover:not(:disabled){filter:brightness(1.04)}.lg-button:focus-visible{outline:2px solid var(--lg-focus-ring, rgba(60, 130, 255, .9));outline-offset:2px;box-shadow:0 0 0 4px #3c82ff40}.lg-button:disabled{cursor:not-allowed;opacity:.5;filter:saturate(.7)}@media(prefers-contrast:more){.lg-content{color:var(--lg-fg, rgba(0, 0, 0, 1));text-shadow:none}.lg-button:focus-visible,.lg-segmented-option:has(.lg-segmented-input:focus-visible){outline:3px solid var(--lg-focus-ring, rgba(0, 90, 255, 1));outline-offset:2px;box-shadow:0 0 0 5px #ffffffe6}}@media(prefers-contrast:more)and (prefers-color-scheme:dark){.lg-content{color:var(--lg-fg, rgba(255, 255, 255, 1));text-shadow:none}.lg-button:focus-visible,.lg-segmented-option:has(.lg-segmented-input:focus-visible){box-shadow:0 0 0 5px #000000e6}}.lg-button[data-shine=true]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:inherit;pointer-events:none;background:linear-gradient(105deg,#fff0 30%,#ffffff8c,#fff0 70%);background-size:250% 100%;background-position:150% 0;opacity:0}.lg-button[data-shine=true]:active:not(:disabled):after{animation:lg-shine .48s ease-out}@keyframes lg-shine{0%{background-position:150% 0;opacity:0}20%{opacity:1}to{background-position:-50% 0;opacity:0}}@media(prefers-reduced-motion:reduce){.lg-button[data-shine=true]:active:not(:disabled):after{animation:none}}.lg-button--primary{--lg-fg: rgba(255, 255, 255, .98);text-shadow:0 1px 2px rgba(0,0,0,.35)}.lg-button--secondary{--lg-fg: rgba(20, 22, 28, .92)}.lg-button--subtle{--lg-fg: rgba(40, 42, 50, .82);font-weight:500}@media(prefers-color-scheme:dark){.lg-button--secondary{--lg-fg: rgba(240, 242, 248, .94)}.lg-button--subtle{--lg-fg: rgba(225, 227, 235, .85)}}.lg-button--sm{font-size:.8125rem}.lg-button--md{font-size:.9375rem}.lg-button--lg{font-size:1.0625rem}.lg-button--icon{font-size:1rem}.lg-button--icon .lg-content{width:1.25em;height:1.25em;gap:0}.lg-card{position:relative;display:block;border-radius:inherit}.lg-card .lg-content{display:block;text-align:left;text-shadow:none;color:var(--lg-fg, rgba(20, 22, 28, .9))}@media(prefers-color-scheme:dark){.lg-card .lg-content{color:var(--lg-fg, rgba(238, 240, 246, .92))}}.lg-card--flat{--lg-card-lift: none}.lg-card--raised{--lg-card-lift: 0 10px 30px rgba(0, 0, 0, .16)}.lg-card--floating{--lg-card-lift: 0 22px 60px rgba(0, 0, 0, .24)}.lg-card[data-elevation]:not(.lg-card--flat){filter:drop-shadow(var(--lg-card-lift, none))}.lg-segmented{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;margin:0;padding:0;min-inline-size:0;display:inline-flex;flex-direction:column;gap:.5rem;--lg-seg-pad: .25rem;--lg-seg-radius: 999px;font:inherit}.lg-segmented-legend{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.lg-segmented-legend--visible{position:static;width:auto;height:auto;margin:0;clip:auto;overflow:visible;white-space:normal;font-size:.8125rem;font-weight:600;letter-spacing:.02em;color:var(--lg-fg, rgba(20, 22, 28, .82))}@media(prefers-color-scheme:dark){.lg-segmented-legend--visible{color:var(--lg-fg, rgba(232, 234, 240, .86))}}.lg-segmented-track{position:relative;display:inline-flex;align-items:stretch;padding:var(--lg-seg-pad);border-radius:var(--lg-seg-radius);background:#ffffff1f;box-shadow:var(--lg-edge-shadow);isolation:isolate;-webkit-tap-highlight-color:transparent}@media(prefers-color-scheme:dark){.lg-segmented-track{background:#14161c38}}.lg-segmented-indicator{position:absolute;top:var(--lg-seg-pad);left:var(--lg-seg-pad);bottom:var(--lg-seg-pad);border-radius:var(--lg-seg-radius);z-index:0;pointer-events:none;will-change:transform,width}.lg-segmented-glass{border-radius:var(--lg-seg-radius)}.lg-segmented-glass-fill{display:block;width:100%;height:100%}.lg-segmented-option{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;gap:.4em;flex:1 1 auto;border-radius:var(--lg-seg-radius);cursor:pointer;-webkit-user-select:none;user-select:none;white-space:nowrap;font-weight:600;letter-spacing:.01em;color:var(--lg-fg, rgba(40, 42, 50, .7));transition:color .2s ease}.lg-segmented-option[data-active=true]{color:var(--lg-fg-active, rgba(17, 17, 19, .96))}@media(prefers-color-scheme:dark){.lg-segmented-option{color:var(--lg-fg, rgba(220, 222, 230, .72))}.lg-segmented-option[data-active=true]{color:var(--lg-fg-active, rgba(248, 249, 252, .98))}}.lg-segmented-input{position:absolute;width:1px;height:1px;padding:0;margin:0;opacity:0;pointer-events:none;clip:rect(0,0,0,0)}.lg-segmented-input:focus-visible+.lg-segmented-icon,.lg-segmented-input:focus-visible~.lg-segmented-label,.lg-segmented-option:focus-within{outline:none}.lg-segmented-option:has(.lg-segmented-input:focus-visible){outline:2px solid var(--lg-focus-ring, rgba(60, 130, 255, .9));outline-offset:2px;box-shadow:0 0 0 4px #3c82ff40}.lg-segmented-option:has(.lg-segmented-input:disabled){cursor:not-allowed;opacity:.45}.lg-segmented-icon{display:inline-flex;align-items:center;justify-content:center;line-height:0}.lg-segmented-option[data-icon-only=true]{aspect-ratio:1 / 1}.lg-segmented--sm{font-size:.8125rem}.lg-segmented--sm .lg-segmented-option{padding:.3rem .7rem}.lg-segmented--md{font-size:.9375rem}.lg-segmented--md .lg-segmented-option{padding:.45rem 1rem}.lg-segmented--lg{font-size:1.0625rem}.lg-segmented--lg .lg-segmented-option{padding:.6rem 1.35rem}
1
+ .lg-content{display:inline-flex;align-items:center;justify-content:center;gap:.5em;color:var(--lg-fg, rgba(17, 17, 19, .92));text-shadow:0 1px 1px rgba(255,255,255,.45);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}@media(prefers-color-scheme:dark){.lg-content{color:var(--lg-fg, rgba(245, 245, 247, .94));text-shadow:0 1px 2px rgba(0,0,0,.55)}}.lg-button{position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;-moz-appearance:none;appearance:none;-webkit-appearance:none;border:0;margin:0;background:transparent;font:inherit;font-weight:600;line-height:1.2;letter-spacing:.01em;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;color:var(--lg-fg, rgba(17, 17, 19, .92));text-decoration:none;border-radius:inherit;transition:filter .16s ease,opacity .16s ease}.lg-button:hover:not(:disabled){filter:brightness(1.04)}.lg-button:focus-visible{outline:2px solid var(--lg-focus-ring, rgba(60, 130, 255, .9));outline-offset:2px;box-shadow:0 0 0 4px #3c82ff40}.lg-button:disabled{cursor:not-allowed;opacity:.5;filter:saturate(.7)}@media(prefers-contrast:more){.lg-content{color:var(--lg-fg, rgba(0, 0, 0, 1));text-shadow:none}.lg-button:focus-visible,.lg-segmented-option:has(.lg-segmented-input:focus-visible){outline:3px solid var(--lg-focus-ring, rgba(0, 90, 255, 1));outline-offset:2px;box-shadow:0 0 0 5px #ffffffe6}}@media(prefers-contrast:more)and (prefers-color-scheme:dark){.lg-content{color:var(--lg-fg, rgba(255, 255, 255, 1));text-shadow:none}.lg-button:focus-visible,.lg-segmented-option:has(.lg-segmented-input:focus-visible){box-shadow:0 0 0 5px #000000e6}}.lg-button[data-shine=true]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:inherit;pointer-events:none;background:linear-gradient(105deg,#fff0 30%,#ffffff8c,#fff0 70%);background-size:250% 100%;background-position:150% 0;opacity:0}.lg-button[data-shine=true]:active:not(:disabled):after{animation:lg-shine .48s ease-out}@keyframes lg-shine{0%{background-position:150% 0;opacity:0}20%{opacity:1}to{background-position:-50% 0;opacity:0}}@media(prefers-reduced-motion:reduce){.lg-button[data-shine=true]:active:not(:disabled):after{animation:none}}.lg-button--primary{--lg-fg: rgba(255, 255, 255, .98);text-shadow:0 1px 2px rgba(0,0,0,.35)}.lg-button--secondary{--lg-fg: rgba(20, 22, 28, .92)}.lg-button--subtle{--lg-fg: rgba(40, 42, 50, .82);font-weight:500}@media(prefers-color-scheme:dark){.lg-button--secondary{--lg-fg: rgba(240, 242, 248, .94)}.lg-button--subtle{--lg-fg: rgba(225, 227, 235, .85)}}.lg-button--sm{font-size:.8125rem;padding:6px 14px}.lg-button--md{font-size:.9375rem;padding:10px 20px}.lg-button--lg{font-size:1.0625rem;padding:14px 28px}.lg-button--icon{font-size:1rem;padding:10px}.lg-button--icon .lg-content{width:1.25em;height:1.25em;gap:0}.lg-card{position:relative;display:block;border-radius:inherit}.lg-card .lg-content{display:block;text-align:left;text-shadow:none;color:var(--lg-fg, rgba(20, 22, 28, .9))}@media(prefers-color-scheme:dark){.lg-card .lg-content{color:var(--lg-fg, rgba(238, 240, 246, .92))}}.lg-card--flat{--lg-card-lift: none}.lg-card--raised{--lg-card-lift: 0 10px 30px rgba(0, 0, 0, .16)}.lg-card--floating{--lg-card-lift: 0 22px 60px rgba(0, 0, 0, .24)}.lg-card[data-elevation]:not(.lg-card--flat){filter:drop-shadow(var(--lg-card-lift, none))}.lg-segmented{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;margin:0;padding:0;min-inline-size:0;display:inline-flex;flex-direction:column;gap:.5rem;--lg-seg-pad: .25rem;--lg-seg-radius: 999px;font:inherit}.lg-segmented-legend{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.lg-segmented-legend--visible{position:static;width:auto;height:auto;margin:0;clip:auto;overflow:visible;white-space:normal;font-size:.8125rem;font-weight:600;letter-spacing:.02em;color:var(--lg-fg, rgba(20, 22, 28, .82))}@media(prefers-color-scheme:dark){.lg-segmented-legend--visible{color:var(--lg-fg, rgba(232, 234, 240, .86))}}.lg-segmented-track{position:relative;display:inline-flex;align-items:stretch;padding:var(--lg-seg-pad);border-radius:var(--lg-seg-radius);background:#ffffff1f;box-shadow:var(--lg-edge-shadow);isolation:isolate;-webkit-tap-highlight-color:transparent}@media(prefers-color-scheme:dark){.lg-segmented-track{background:#14161c38}}.lg-segmented-indicator{position:absolute;top:var(--lg-seg-pad);left:var(--lg-seg-pad);bottom:var(--lg-seg-pad);border-radius:var(--lg-seg-radius);z-index:0;pointer-events:none;will-change:transform,width}.lg-segmented-glass{border-radius:var(--lg-seg-radius)}.lg-segmented-glass-fill{display:block;width:100%;height:100%}.lg-segmented-option{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;gap:.4em;flex:1 1 auto;border-radius:var(--lg-seg-radius);cursor:pointer;-webkit-user-select:none;user-select:none;white-space:nowrap;font-weight:600;letter-spacing:.01em;color:var(--lg-fg, rgba(40, 42, 50, .7));transition:color .2s ease}.lg-segmented-option[data-active=true]{color:var(--lg-fg-active, rgba(17, 17, 19, .96))}@media(prefers-color-scheme:dark){.lg-segmented-option{color:var(--lg-fg, rgba(220, 222, 230, .72))}.lg-segmented-option[data-active=true]{color:var(--lg-fg-active, rgba(248, 249, 252, .98))}}.lg-segmented-input{position:absolute;width:1px;height:1px;padding:0;margin:0;opacity:0;pointer-events:none;clip:rect(0,0,0,0)}.lg-segmented-input:focus-visible+.lg-segmented-icon,.lg-segmented-input:focus-visible~.lg-segmented-label,.lg-segmented-option:focus-within{outline:none}.lg-segmented-option:has(.lg-segmented-input:focus-visible){outline:2px solid var(--lg-focus-ring, rgba(60, 130, 255, .9));outline-offset:2px;box-shadow:0 0 0 4px #3c82ff40}.lg-segmented-option:has(.lg-segmented-input:disabled){cursor:not-allowed;opacity:.45}.lg-segmented-icon{display:inline-flex;align-items:center;justify-content:center;line-height:0}.lg-segmented-option[data-icon-only=true]{aspect-ratio:1 / 1}.lg-segmented--sm{font-size:.8125rem}.lg-segmented--sm .lg-segmented-option{padding:.3rem .7rem}.lg-segmented--md{font-size:.9375rem}.lg-segmented--md .lg-segmented-option{padding:.45rem 1rem}.lg-segmented--lg{font-size:1.0625rem}.lg-segmented--lg .lg-segmented-option{padding:.6rem 1.35rem}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aberhamm/liquid-glass-react",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "An independent React reimplementation of a liquid-glass UI component library.",
5
5
  "type": "module",
6
6
  "license": "MIT",