@nqlib/nqui 0.4.4 → 0.4.5

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.
@@ -4290,12 +4290,7 @@ function tu({
4290
4290
  borderRadius: t = 0,
4291
4291
  className: n
4292
4292
  }) {
4293
- const r = `frostyGlassMask-${l.useId().replace(/:/g, "-")}`;
4294
- l.useEffect(() => {
4295
- fetch("http://127.0.0.1:7242/ingest/4df26b36-056f-4f25-87e5-cdd927efe4db", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ location: "frosted-glass.tsx:39", message: "FrostedGlass rendered", data: { blur: e, borderRadius: t, useSvgMask: t > 0 }, timestamp: Date.now(), sessionId: "debug-session", runId: "run1", hypothesisId: "A" }) }).catch(() => {
4296
- });
4297
- }, [e, t]);
4298
- const a = t > 0;
4293
+ const r = `frostyGlassMask-${l.useId().replace(/:/g, "-")}`, a = t > 0;
4299
4294
  return /* @__PURE__ */ x(Me, { children: [
4300
4295
  a && /* @__PURE__ */ i(
4301
4296
  "svg",
package/dist/debug.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./debug-panel-DHBfAc1V.cjs");exports.Crosshair=e.Crosshair;exports.DebugPanel=e.DebugPanel;exports.Magnifier=e.Magnifier;exports.UITester=e.UITester;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./debug-panel-CNKk-No5.cjs");exports.Crosshair=e.Crosshair;exports.DebugPanel=e.DebugPanel;exports.Magnifier=e.Magnifier;exports.UITester=e.UITester;
package/dist/debug.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as e, D as r, M as i, U as o } from "./debug-panel-CG-vAN0L.js";
1
+ import { C as e, D as r, M as i, U as o } from "./debug-panel-pg39-6xw.js";
2
2
  export {
3
3
  e as Crosshair,
4
4
  r as DebugPanel,
package/dist/nqui.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),h=require("./utils-IjLH3w2e.cjs"),He=require("./sortable-Cj3cdxGc.cjs"),Te=require("./keyboard-BapbM2wb.cjs"),bt=require("./enhanced-calendar-C7EQIr6i.cjs"),xt=require("./sonner-nE9hIalJ.cjs"),r=require("react/jsx-runtime"),g=require("./index-CI756mSv.cjs"),y=require("./debug-panel-DHBfAc1V.cjs"),te=require("class-variance-authority"),be=require("@radix-ui/react-slot"),pe=require("./button-R304rhsj.cjs"),q=require("@hugeicons/react"),U=require("@hugeicons/core-free-icons"),H=require("./command-palette-MHc03bBf.cjs"),Q=require("@base-ui/react"),Ke=require("./carousel-D1FMVglR.cjs"),xe=require("./drawer-DVarEy65.cjs"),Bc=require("react-dom"),Zt=require("react-resizable-panels");function Gr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const i=Gr(k),Qt=Gr(be);function Vc(e,t={}){if(!e)return"";try{return new Intl.DateTimeFormat("en-US",{month:t.month??"long",day:t.day??"numeric",year:t.year??"numeric",...t}).format(new Date(e))}catch{return""}}const Cr=e=>{const t=e.tagName.match(/^H(\d)$/i);return t?parseInt(t[1],10):0};function Br({selector:e="h1, h2, h3, h4, h5, h6",rootMargin:t="-100px 0px -66%",threshold:o=0,offset:n=0,enabled:a=!0,container:s=null}={}){const[l,c]=k.useState(null),[d,f]=k.useState([]),[u,p]=k.useState(null),m=k.useRef(null),b=k.useRef(null),v=k.useRef(null),x=k.useRef(new Map),w=k.useRef(new Map),C=k.useRef(new Set),S=k.useRef(new Set),M=k.useCallback(R=>{p(R),c(R)},[]);return k.useEffect(()=>{if(!a)return;const N=Array.from((s||document).querySelectorAll(e));if(N.length===0)return;x.current.clear(),w.current.clear(),N.forEach((_,A)=>{const L=_.id||_.getAttribute("data-id")||_.textContent?.trim().toLowerCase().replace(/\s+/g,"-")||"";if(L){x.current.set(L,_),!_.id&&!_.getAttribute("data-id")&&(_.id=L);const $=Cr(_);let B=null;for(let P=A+1;P<N.length;P++){const V=N[P],O=Cr(V);if(O>0&&O<=$){B=V;break}}if(B){let P=document.querySelector(`[data-content-section="${L}"]`);P||(P=document.createElement("div"),P.setAttribute("data-content-section",L),P.style.position="absolute",P.style.width="1px",P.style.height="1px",P.style.pointerEvents="none",P.style.visibility="hidden",B.parentElement?.insertBefore(P,B)),w.current.set(L,P)}else{let P=document.querySelector(`[data-content-section="${L}"]`);P||(P=document.createElement("div"),P.setAttribute("data-content-section",L),P.style.position="absolute",P.style.width="1px",P.style.height="1px",P.style.pointerEvents="none",P.style.visibility="hidden",document.body.appendChild(P)),w.current.set(L,P)}}}),m.current=new IntersectionObserver(_=>{if(u!==null)return;let A=-1,L=null;for(const $ of _)$.intersectionRatio>A&&(A=$.intersectionRatio,L=$);if(L&&L.isIntersecting){const $=L.target.id||L.target.getAttribute("data-id")||"";$&&c($)}else{const $=s?s.getBoundingClientRect().top:0,B=Array.from(x.current.entries()).map(([P,V])=>({id:P,el:V,rect:V.getBoundingClientRect()})).filter(({rect:P})=>(s?P.top-$:P.top)<=n+100).sort((P,V)=>{const O=s?P.rect.top-$:P.rect.top;return(s?V.rect.top-$:V.rect.top)-O});B.length>0&&c(B[0].id)}},{root:s||null,rootMargin:t,threshold:o}),b.current=new IntersectionObserver(_=>{if(u!==null)return;const A=C.current;_.forEach(B=>{const P=B.target.id||B.target.getAttribute("data-id")||"";P&&(B.isIntersecting?A.add(P):A.delete(P))});const L=new Set(A);S.current.forEach(B=>L.add(B));const $=Array.from(L);f($),$.length>0&&!l&&c($[0])},{root:s||null,rootMargin:"0px",threshold:.98}),v.current=new IntersectionObserver(_=>{if(u!==null)return;const A=S.current;_.forEach(P=>{const V=P.target.getAttribute("data-content-section");if(!V)return;if(C.current.has(V)){A.delete(V);return}const W=P.target.getBoundingClientRect(),K=s?s.getBoundingClientRect():null,Y=s?K.top:0,J=s?K.bottom:window.innerHeight,ee=x.current.get(V),oe=ee?ee.getBoundingClientRect():null,ie=oe?oe.bottom<Y:!1,X=W.top>Y,ve=W.top<J;ie&&X&&ve?A.add(V):A.delete(V)});const L=C.current,$=new Set(L);S.current.forEach(P=>$.add(P));const B=Array.from($);f(B)},{root:s||null,rootMargin:"0px",threshold:0}),N.forEach(_=>{m.current&&m.current.observe(_),b.current&&b.current.observe(_)}),w.current.forEach(_=>{v.current&&v.current.observe(_)});const T=setTimeout(()=>{if(u!==null)return;const _=s?s.getBoundingClientRect():null,A=s?s.clientHeight:window.innerHeight,L=s?_.top:0,$=s?_.bottom:window.innerHeight,B=Array.from(x.current.entries()).map(([W,K])=>({id:W,el:K,rect:K.getBoundingClientRect()})).filter(({rect:W})=>(s?W.top-L:W.top)<=A/2).sort((W,K)=>{const Y=s?W.rect.top-L:W.rect.top;return(s?K.rect.top-L:K.rect.top)-Y});B.length>0&&c(B[0].id);const P=[];x.current.forEach((W,K)=>{const Y=W.getBoundingClientRect();Y.top<$&&Y.bottom>L&&P.push(K)});const V=[];w.current.forEach((W,K)=>{if(P.includes(K))return;const Y=x.current.get(K),J=Y?Y.getBoundingClientRect():null,ee=W.getBoundingClientRect(),oe=J?J.bottom<L:!1,ie=ee.top>L,X=ee.top<$;oe&&ie&&X&&V.push(K)});const O=new Set([...P,...V]);O.size>0&&(f(Array.from(O)),C.current=new Set(P),S.current=new Set(V))},100),I=()=>{if(u!==null)return;const _=s?s.getBoundingClientRect():null,A=s?_.top:0,L=s?_.bottom:window.innerHeight;let $=!1;if(w.current.forEach((O,W)=>{if(C.current.has(W)){S.current.has(W)&&(S.current.delete(W),$=!0);return}const K=x.current.get(W),Y=K?K.getBoundingClientRect():null,J=O.getBoundingClientRect(),ee=Y?Y.bottom<A:!1,oe=J.top>A,ie=J.top<L,X=ee&&oe&&ie,ve=S.current.has(W);X&&!ve?(S.current.add(W),$=!0):!X&&ve&&(S.current.delete(W),$=!0)}),!$)return;const B=C.current,P=new Set(B);S.current.forEach(O=>P.add(O));const V=Array.from(P);f(V)};let E=null;const z=()=>{E&&clearTimeout(E),E=setTimeout(()=>{I()},16)};return(s||window).addEventListener("scroll",z,{passive:!0}),()=>{clearTimeout(T),E&&clearTimeout(E),(s||window).removeEventListener("scroll",z),m.current&&m.current.disconnect(),b.current&&b.current.disconnect(),v.current&&v.current.disconnect(),w.current.forEach(A=>{A.remove()}),x.current.clear(),w.current.clear(),C.current.clear(),S.current.clear()}},[e,t,o,n,a,u,s]),k.useEffect(()=>{if(u!==null){let R;const N=()=>{clearTimeout(R),R=setTimeout(()=>{p(null)},150)},j=s||window;j.addEventListener("scroll",N,{passive:!0});const T=setTimeout(()=>{p(null)},500);return()=>{clearTimeout(T),j.removeEventListener("scroll",N),clearTimeout(R)}}},[u,s]),{activeId:u!==null?u:l,visibleIds:u!==null?[u]:d,setActiveId:M}}const Dt=768;function Vr(){const[e,t]=i.useState(void 0);return i.useEffect(()=>{const o=window.matchMedia(`(max-width: ${Dt-1}px)`),n=()=>{t(window.innerWidth<Dt)};return o.addEventListener("change",n),t(window.innerWidth<Dt),()=>o.removeEventListener("change",n)},[]),!!e}function Wc(){const{resolvedTheme:e}=xt.z();return k.useMemo(()=>e==="dark"||e==="light"?e:typeof document<"u"&&document.documentElement.classList.contains("dark")?"dark":"light",[e])}function Kc(e,t){const[o,n]=i.useState(!1);return i.useEffect(()=>{const a=e.current;if(!a)return;const s=new IntersectionObserver(([l])=>{l?.isIntersecting&&(n(!0),t?.once&&s.disconnect())},{rootMargin:t?.margin});return s.observe(a),()=>s.disconnect()},[e,t?.once,t?.margin]),{isInView:o}}const Wr=typeof window<"u"?i.useLayoutEffect:i.useEffect;function qc(e){const t=i.useRef(e);return Wr(()=>{t.current=e}),t}function Uc(e){const t=i.useRef(null);return t.current===null&&(t.current=e()),t}function Yc(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>((...o)=>t.current?.(...o)),[])}function Xc(e,t){const o=Yc(e),n=i.useRef(0);return i.useEffect(()=>()=>window.clearTimeout(n.current),[]),i.useCallback((...s)=>{window.clearTimeout(n.current),n.current=window.setTimeout(()=>o(...s),t)},[o,t])}const yr=new Map,Zc=16,Qc=4,Jc=40;function ed({label:e,cacheKey:t,iconSize:o,maxWidth:n,className:a}){const s=yr.get(t);if(s!==void 0)return s;const l=document.createElement("div");if(l.className=`inline-flex items-center rounded-md border px-1.5 text-xs font-semibold h-5 gap-1 shrink-0 absolute invisible pointer-events-none ${a??""}`,l.style.whiteSpace="nowrap",o){const d=document.createElement("span");d.className="shrink-0",d.style.width=`${o}px`,d.style.height=`${o}px`,l.appendChild(d)}if(n){const d=document.createElement("span");d.className="truncate",d.style.maxWidth=`${n}px`,d.textContent=e,l.appendChild(d)}else l.textContent=e;document.body.appendChild(l);const c=l.offsetWidth;return document.body.removeChild(l),yr.set(t,c),c}function td({items:e,getLabel:t,containerRef:o,lineCount:n,cacheKeyPrefix:a="",containerPadding:s=Zc,badgeGap:l=Qc,overflowBadgeWidth:c=Jc,iconSize:d,maxWidth:f,className:u}){const[p,m]=i.useState(0);return i.useEffect(()=>{if(!o.current)return;function v(){if(o.current){const w=o.current.clientWidth-s;m(w)}}v();const x=new ResizeObserver(v);return x.observe(o.current),()=>{x.disconnect()}},[o,s]),i.useMemo(()=>{if(!p||e.length===0)return{visibleItems:e,hiddenCount:0,containerWidth:p};let v=0,x=1;const w=[];for(const C of e){const S=t(C),M=a?`${a}:${S}`:S,N=ed({label:S,cacheKey:M,iconSize:d,maxWidth:f,className:u})+l;if(v+N<=p)v+=N,w.push(C);else if(x<n)x++,v=N,w.push(C);else{v+c>p&&w.length>0&&w.pop();break}}return{visibleItems:w,hiddenCount:Math.max(0,e.length-w.length),containerWidth:p}},[e,t,p,n,a,d,f,u,l,c])}var he="Accordion",od=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Jt,rd,nd]=y.createCollection(he),[wt]=g.createContextScope(he,[nd,y.createCollapsibleScope]),eo=y.createCollapsibleScope(),Kr=k.forwardRef((e,t)=>{const{type:o,...n}=e,a=n,s=n;return r.jsx(Jt.Provider,{scope:e.__scopeAccordion,children:o==="multiple"?r.jsx(ld,{...s,ref:t}):r.jsx(id,{...a,ref:t})})});Kr.displayName=he;var[qr,ad]=wt(he),[Ur,sd]=wt(he,{collapsible:!1}),id=k.forwardRef((e,t)=>{const{value:o,defaultValue:n,onValueChange:a=()=>{},collapsible:s=!1,...l}=e,[c,d]=g.useControllableState({prop:o,defaultProp:n??"",onChange:a,caller:he});return r.jsx(qr,{scope:e.__scopeAccordion,value:k.useMemo(()=>c?[c]:[],[c]),onItemOpen:d,onItemClose:k.useCallback(()=>s&&d(""),[s,d]),children:r.jsx(Ur,{scope:e.__scopeAccordion,collapsible:s,children:r.jsx(Yr,{...l,ref:t})})})}),ld=k.forwardRef((e,t)=>{const{value:o,defaultValue:n,onValueChange:a=()=>{},...s}=e,[l,c]=g.useControllableState({prop:o,defaultProp:n??[],onChange:a,caller:he}),d=k.useCallback(u=>c((p=[])=>[...p,u]),[c]),f=k.useCallback(u=>c((p=[])=>p.filter(m=>m!==u)),[c]);return r.jsx(qr,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:f,children:r.jsx(Ur,{scope:e.__scopeAccordion,collapsible:!0,children:r.jsx(Yr,{...s,ref:t})})})}),[cd,Ct]=wt(he),Yr=k.forwardRef((e,t)=>{const{__scopeAccordion:o,disabled:n,dir:a,orientation:s="vertical",...l}=e,c=k.useRef(null),d=g.useComposedRefs(c,t),f=rd(o),p=y.useDirection(a)==="ltr",m=g.composeEventHandlers(e.onKeyDown,b=>{if(!od.includes(b.key))return;const v=b.target,x=f().filter(I=>!I.ref.current?.disabled),w=x.findIndex(I=>I.ref.current===v),C=x.length;if(w===-1)return;b.preventDefault();let S=w;const M=0,R=C-1,N=()=>{S=w+1,S>R&&(S=M)},j=()=>{S=w-1,S<M&&(S=R)};switch(b.key){case"Home":S=M;break;case"End":S=R;break;case"ArrowRight":s==="horizontal"&&(p?N():j());break;case"ArrowDown":s==="vertical"&&N();break;case"ArrowLeft":s==="horizontal"&&(p?j():N());break;case"ArrowUp":s==="vertical"&&j();break}const T=S%C;x[T].ref.current?.focus()});return r.jsx(cd,{scope:o,disabled:n,direction:a,orientation:s,children:r.jsx(Jt.Slot,{scope:o,children:r.jsx(g.Primitive.div,{...l,"data-orientation":s,ref:d,onKeyDown:n?void 0:m})})})}),it="AccordionItem",[dd,to]=wt(it),Xr=k.forwardRef((e,t)=>{const{__scopeAccordion:o,value:n,...a}=e,s=Ct(it,o),l=ad(it,o),c=eo(o),d=g.useId(),f=n&&l.value.includes(n)||!1,u=s.disabled||e.disabled;return r.jsx(dd,{scope:o,open:f,disabled:u,triggerId:d,children:r.jsx(y.Root,{"data-orientation":s.orientation,"data-state":on(f),...c,...a,ref:t,disabled:u,open:f,onOpenChange:p=>{p?l.onItemOpen(n):l.onItemClose(n)}})})});Xr.displayName=it;var Zr="AccordionHeader",Qr=k.forwardRef((e,t)=>{const{__scopeAccordion:o,...n}=e,a=Ct(he,o),s=to(Zr,o);return r.jsx(g.Primitive.h3,{"data-orientation":a.orientation,"data-state":on(s.open),"data-disabled":s.disabled?"":void 0,...n,ref:t})});Qr.displayName=Zr;var zt="AccordionTrigger",Jr=k.forwardRef((e,t)=>{const{__scopeAccordion:o,...n}=e,a=Ct(he,o),s=to(zt,o),l=sd(zt,o),c=eo(o);return r.jsx(Jt.ItemSlot,{scope:o,children:r.jsx(y.Trigger,{"aria-disabled":s.open&&!l.collapsible||void 0,"data-orientation":a.orientation,id:s.triggerId,...c,...n,ref:t})})});Jr.displayName=zt;var en="AccordionContent",tn=k.forwardRef((e,t)=>{const{__scopeAccordion:o,...n}=e,a=Ct(he,o),s=to(en,o),l=eo(o);return r.jsx(y.Content,{role:"region","aria-labelledby":s.triggerId,"data-orientation":a.orientation,...l,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});tn.displayName=en;function on(e){return e?"open":"closed"}var ud=Kr,pd=Xr,fd=Qr,md=Jr,gd=tn,rn="AlertDialog",[hd]=g.createContextScope(rn,[H.createDialogScope]),ye=H.createDialogScope(),nn=e=>{const{__scopeAlertDialog:t,...o}=e,n=ye(t);return r.jsx(H.Root,{...n,...o,modal:!0})};nn.displayName=rn;var vd="AlertDialogTrigger",an=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,a=ye(o);return r.jsx(H.Trigger,{...a,...n,ref:t})});an.displayName=vd;var bd="AlertDialogPortal",sn=e=>{const{__scopeAlertDialog:t,...o}=e,n=ye(t);return r.jsx(H.Portal,{...n,...o})};sn.displayName=bd;var xd="AlertDialogOverlay",ln=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,a=ye(o);return r.jsx(H.Overlay,{...a,...n,ref:t})});ln.displayName=xd;var $e="AlertDialogContent",[wd,Cd]=hd($e),yd=be.createSlottable("AlertDialogContent"),cn=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,children:n,...a}=e,s=ye(o),l=i.useRef(null),c=g.useComposedRefs(t,l),d=i.useRef(null);return r.jsx(H.WarningProvider,{contentName:$e,titleName:dn,docsSlug:"alert-dialog",children:r.jsx(wd,{scope:o,cancelRef:d,children:r.jsxs(H.Content,{role:"alertdialog",...s,...a,ref:c,onOpenAutoFocus:g.composeEventHandlers(a.onOpenAutoFocus,f=>{f.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[r.jsx(yd,{children:n}),r.jsx(Md,{contentRef:l})]})})})});cn.displayName=$e;var dn="AlertDialogTitle",un=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,a=ye(o);return r.jsx(H.Title,{...a,...n,ref:t})});un.displayName=dn;var pn="AlertDialogDescription",fn=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,a=ye(o);return r.jsx(H.Description,{...a,...n,ref:t})});fn.displayName=pn;var Sd="AlertDialogAction",mn=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,a=ye(o);return r.jsx(H.Close,{...a,...n,ref:t})});mn.displayName=Sd;var gn="AlertDialogCancel",hn=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,{cancelRef:a}=Cd(gn,o),s=ye(o),l=g.useComposedRefs(t,a);return r.jsx(H.Close,{...s,...n,ref:l})});hn.displayName=gn;var Md=({contentRef:e})=>{const t=`\`${$e}\` requires a description for the component to be accessible for screen reader users.
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),h=require("./utils-IjLH3w2e.cjs"),He=require("./sortable-Cj3cdxGc.cjs"),Te=require("./keyboard-BapbM2wb.cjs"),bt=require("./enhanced-calendar-C7EQIr6i.cjs"),xt=require("./sonner-nE9hIalJ.cjs"),r=require("react/jsx-runtime"),g=require("./index-CI756mSv.cjs"),y=require("./debug-panel-CNKk-No5.cjs"),te=require("class-variance-authority"),be=require("@radix-ui/react-slot"),pe=require("./button-R304rhsj.cjs"),q=require("@hugeicons/react"),U=require("@hugeicons/core-free-icons"),H=require("./command-palette-MHc03bBf.cjs"),Q=require("@base-ui/react"),Ke=require("./carousel-D1FMVglR.cjs"),xe=require("./drawer-DVarEy65.cjs"),Bc=require("react-dom"),Zt=require("react-resizable-panels");function Gr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const i=Gr(k),Qt=Gr(be);function Vc(e,t={}){if(!e)return"";try{return new Intl.DateTimeFormat("en-US",{month:t.month??"long",day:t.day??"numeric",year:t.year??"numeric",...t}).format(new Date(e))}catch{return""}}const Cr=e=>{const t=e.tagName.match(/^H(\d)$/i);return t?parseInt(t[1],10):0};function Br({selector:e="h1, h2, h3, h4, h5, h6",rootMargin:t="-100px 0px -66%",threshold:o=0,offset:n=0,enabled:a=!0,container:s=null}={}){const[l,c]=k.useState(null),[d,f]=k.useState([]),[u,p]=k.useState(null),m=k.useRef(null),b=k.useRef(null),v=k.useRef(null),x=k.useRef(new Map),w=k.useRef(new Map),C=k.useRef(new Set),S=k.useRef(new Set),M=k.useCallback(R=>{p(R),c(R)},[]);return k.useEffect(()=>{if(!a)return;const N=Array.from((s||document).querySelectorAll(e));if(N.length===0)return;x.current.clear(),w.current.clear(),N.forEach((_,A)=>{const L=_.id||_.getAttribute("data-id")||_.textContent?.trim().toLowerCase().replace(/\s+/g,"-")||"";if(L){x.current.set(L,_),!_.id&&!_.getAttribute("data-id")&&(_.id=L);const $=Cr(_);let B=null;for(let P=A+1;P<N.length;P++){const V=N[P],O=Cr(V);if(O>0&&O<=$){B=V;break}}if(B){let P=document.querySelector(`[data-content-section="${L}"]`);P||(P=document.createElement("div"),P.setAttribute("data-content-section",L),P.style.position="absolute",P.style.width="1px",P.style.height="1px",P.style.pointerEvents="none",P.style.visibility="hidden",B.parentElement?.insertBefore(P,B)),w.current.set(L,P)}else{let P=document.querySelector(`[data-content-section="${L}"]`);P||(P=document.createElement("div"),P.setAttribute("data-content-section",L),P.style.position="absolute",P.style.width="1px",P.style.height="1px",P.style.pointerEvents="none",P.style.visibility="hidden",document.body.appendChild(P)),w.current.set(L,P)}}}),m.current=new IntersectionObserver(_=>{if(u!==null)return;let A=-1,L=null;for(const $ of _)$.intersectionRatio>A&&(A=$.intersectionRatio,L=$);if(L&&L.isIntersecting){const $=L.target.id||L.target.getAttribute("data-id")||"";$&&c($)}else{const $=s?s.getBoundingClientRect().top:0,B=Array.from(x.current.entries()).map(([P,V])=>({id:P,el:V,rect:V.getBoundingClientRect()})).filter(({rect:P})=>(s?P.top-$:P.top)<=n+100).sort((P,V)=>{const O=s?P.rect.top-$:P.rect.top;return(s?V.rect.top-$:V.rect.top)-O});B.length>0&&c(B[0].id)}},{root:s||null,rootMargin:t,threshold:o}),b.current=new IntersectionObserver(_=>{if(u!==null)return;const A=C.current;_.forEach(B=>{const P=B.target.id||B.target.getAttribute("data-id")||"";P&&(B.isIntersecting?A.add(P):A.delete(P))});const L=new Set(A);S.current.forEach(B=>L.add(B));const $=Array.from(L);f($),$.length>0&&!l&&c($[0])},{root:s||null,rootMargin:"0px",threshold:.98}),v.current=new IntersectionObserver(_=>{if(u!==null)return;const A=S.current;_.forEach(P=>{const V=P.target.getAttribute("data-content-section");if(!V)return;if(C.current.has(V)){A.delete(V);return}const W=P.target.getBoundingClientRect(),K=s?s.getBoundingClientRect():null,Y=s?K.top:0,J=s?K.bottom:window.innerHeight,ee=x.current.get(V),oe=ee?ee.getBoundingClientRect():null,ie=oe?oe.bottom<Y:!1,X=W.top>Y,ve=W.top<J;ie&&X&&ve?A.add(V):A.delete(V)});const L=C.current,$=new Set(L);S.current.forEach(P=>$.add(P));const B=Array.from($);f(B)},{root:s||null,rootMargin:"0px",threshold:0}),N.forEach(_=>{m.current&&m.current.observe(_),b.current&&b.current.observe(_)}),w.current.forEach(_=>{v.current&&v.current.observe(_)});const T=setTimeout(()=>{if(u!==null)return;const _=s?s.getBoundingClientRect():null,A=s?s.clientHeight:window.innerHeight,L=s?_.top:0,$=s?_.bottom:window.innerHeight,B=Array.from(x.current.entries()).map(([W,K])=>({id:W,el:K,rect:K.getBoundingClientRect()})).filter(({rect:W})=>(s?W.top-L:W.top)<=A/2).sort((W,K)=>{const Y=s?W.rect.top-L:W.rect.top;return(s?K.rect.top-L:K.rect.top)-Y});B.length>0&&c(B[0].id);const P=[];x.current.forEach((W,K)=>{const Y=W.getBoundingClientRect();Y.top<$&&Y.bottom>L&&P.push(K)});const V=[];w.current.forEach((W,K)=>{if(P.includes(K))return;const Y=x.current.get(K),J=Y?Y.getBoundingClientRect():null,ee=W.getBoundingClientRect(),oe=J?J.bottom<L:!1,ie=ee.top>L,X=ee.top<$;oe&&ie&&X&&V.push(K)});const O=new Set([...P,...V]);O.size>0&&(f(Array.from(O)),C.current=new Set(P),S.current=new Set(V))},100),I=()=>{if(u!==null)return;const _=s?s.getBoundingClientRect():null,A=s?_.top:0,L=s?_.bottom:window.innerHeight;let $=!1;if(w.current.forEach((O,W)=>{if(C.current.has(W)){S.current.has(W)&&(S.current.delete(W),$=!0);return}const K=x.current.get(W),Y=K?K.getBoundingClientRect():null,J=O.getBoundingClientRect(),ee=Y?Y.bottom<A:!1,oe=J.top>A,ie=J.top<L,X=ee&&oe&&ie,ve=S.current.has(W);X&&!ve?(S.current.add(W),$=!0):!X&&ve&&(S.current.delete(W),$=!0)}),!$)return;const B=C.current,P=new Set(B);S.current.forEach(O=>P.add(O));const V=Array.from(P);f(V)};let E=null;const z=()=>{E&&clearTimeout(E),E=setTimeout(()=>{I()},16)};return(s||window).addEventListener("scroll",z,{passive:!0}),()=>{clearTimeout(T),E&&clearTimeout(E),(s||window).removeEventListener("scroll",z),m.current&&m.current.disconnect(),b.current&&b.current.disconnect(),v.current&&v.current.disconnect(),w.current.forEach(A=>{A.remove()}),x.current.clear(),w.current.clear(),C.current.clear(),S.current.clear()}},[e,t,o,n,a,u,s]),k.useEffect(()=>{if(u!==null){let R;const N=()=>{clearTimeout(R),R=setTimeout(()=>{p(null)},150)},j=s||window;j.addEventListener("scroll",N,{passive:!0});const T=setTimeout(()=>{p(null)},500);return()=>{clearTimeout(T),j.removeEventListener("scroll",N),clearTimeout(R)}}},[u,s]),{activeId:u!==null?u:l,visibleIds:u!==null?[u]:d,setActiveId:M}}const Dt=768;function Vr(){const[e,t]=i.useState(void 0);return i.useEffect(()=>{const o=window.matchMedia(`(max-width: ${Dt-1}px)`),n=()=>{t(window.innerWidth<Dt)};return o.addEventListener("change",n),t(window.innerWidth<Dt),()=>o.removeEventListener("change",n)},[]),!!e}function Wc(){const{resolvedTheme:e}=xt.z();return k.useMemo(()=>e==="dark"||e==="light"?e:typeof document<"u"&&document.documentElement.classList.contains("dark")?"dark":"light",[e])}function Kc(e,t){const[o,n]=i.useState(!1);return i.useEffect(()=>{const a=e.current;if(!a)return;const s=new IntersectionObserver(([l])=>{l?.isIntersecting&&(n(!0),t?.once&&s.disconnect())},{rootMargin:t?.margin});return s.observe(a),()=>s.disconnect()},[e,t?.once,t?.margin]),{isInView:o}}const Wr=typeof window<"u"?i.useLayoutEffect:i.useEffect;function qc(e){const t=i.useRef(e);return Wr(()=>{t.current=e}),t}function Uc(e){const t=i.useRef(null);return t.current===null&&(t.current=e()),t}function Yc(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>((...o)=>t.current?.(...o)),[])}function Xc(e,t){const o=Yc(e),n=i.useRef(0);return i.useEffect(()=>()=>window.clearTimeout(n.current),[]),i.useCallback((...s)=>{window.clearTimeout(n.current),n.current=window.setTimeout(()=>o(...s),t)},[o,t])}const yr=new Map,Zc=16,Qc=4,Jc=40;function ed({label:e,cacheKey:t,iconSize:o,maxWidth:n,className:a}){const s=yr.get(t);if(s!==void 0)return s;const l=document.createElement("div");if(l.className=`inline-flex items-center rounded-md border px-1.5 text-xs font-semibold h-5 gap-1 shrink-0 absolute invisible pointer-events-none ${a??""}`,l.style.whiteSpace="nowrap",o){const d=document.createElement("span");d.className="shrink-0",d.style.width=`${o}px`,d.style.height=`${o}px`,l.appendChild(d)}if(n){const d=document.createElement("span");d.className="truncate",d.style.maxWidth=`${n}px`,d.textContent=e,l.appendChild(d)}else l.textContent=e;document.body.appendChild(l);const c=l.offsetWidth;return document.body.removeChild(l),yr.set(t,c),c}function td({items:e,getLabel:t,containerRef:o,lineCount:n,cacheKeyPrefix:a="",containerPadding:s=Zc,badgeGap:l=Qc,overflowBadgeWidth:c=Jc,iconSize:d,maxWidth:f,className:u}){const[p,m]=i.useState(0);return i.useEffect(()=>{if(!o.current)return;function v(){if(o.current){const w=o.current.clientWidth-s;m(w)}}v();const x=new ResizeObserver(v);return x.observe(o.current),()=>{x.disconnect()}},[o,s]),i.useMemo(()=>{if(!p||e.length===0)return{visibleItems:e,hiddenCount:0,containerWidth:p};let v=0,x=1;const w=[];for(const C of e){const S=t(C),M=a?`${a}:${S}`:S,N=ed({label:S,cacheKey:M,iconSize:d,maxWidth:f,className:u})+l;if(v+N<=p)v+=N,w.push(C);else if(x<n)x++,v=N,w.push(C);else{v+c>p&&w.length>0&&w.pop();break}}return{visibleItems:w,hiddenCount:Math.max(0,e.length-w.length),containerWidth:p}},[e,t,p,n,a,d,f,u,l,c])}var he="Accordion",od=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Jt,rd,nd]=y.createCollection(he),[wt]=g.createContextScope(he,[nd,y.createCollapsibleScope]),eo=y.createCollapsibleScope(),Kr=k.forwardRef((e,t)=>{const{type:o,...n}=e,a=n,s=n;return r.jsx(Jt.Provider,{scope:e.__scopeAccordion,children:o==="multiple"?r.jsx(ld,{...s,ref:t}):r.jsx(id,{...a,ref:t})})});Kr.displayName=he;var[qr,ad]=wt(he),[Ur,sd]=wt(he,{collapsible:!1}),id=k.forwardRef((e,t)=>{const{value:o,defaultValue:n,onValueChange:a=()=>{},collapsible:s=!1,...l}=e,[c,d]=g.useControllableState({prop:o,defaultProp:n??"",onChange:a,caller:he});return r.jsx(qr,{scope:e.__scopeAccordion,value:k.useMemo(()=>c?[c]:[],[c]),onItemOpen:d,onItemClose:k.useCallback(()=>s&&d(""),[s,d]),children:r.jsx(Ur,{scope:e.__scopeAccordion,collapsible:s,children:r.jsx(Yr,{...l,ref:t})})})}),ld=k.forwardRef((e,t)=>{const{value:o,defaultValue:n,onValueChange:a=()=>{},...s}=e,[l,c]=g.useControllableState({prop:o,defaultProp:n??[],onChange:a,caller:he}),d=k.useCallback(u=>c((p=[])=>[...p,u]),[c]),f=k.useCallback(u=>c((p=[])=>p.filter(m=>m!==u)),[c]);return r.jsx(qr,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:f,children:r.jsx(Ur,{scope:e.__scopeAccordion,collapsible:!0,children:r.jsx(Yr,{...s,ref:t})})})}),[cd,Ct]=wt(he),Yr=k.forwardRef((e,t)=>{const{__scopeAccordion:o,disabled:n,dir:a,orientation:s="vertical",...l}=e,c=k.useRef(null),d=g.useComposedRefs(c,t),f=rd(o),p=y.useDirection(a)==="ltr",m=g.composeEventHandlers(e.onKeyDown,b=>{if(!od.includes(b.key))return;const v=b.target,x=f().filter(I=>!I.ref.current?.disabled),w=x.findIndex(I=>I.ref.current===v),C=x.length;if(w===-1)return;b.preventDefault();let S=w;const M=0,R=C-1,N=()=>{S=w+1,S>R&&(S=M)},j=()=>{S=w-1,S<M&&(S=R)};switch(b.key){case"Home":S=M;break;case"End":S=R;break;case"ArrowRight":s==="horizontal"&&(p?N():j());break;case"ArrowDown":s==="vertical"&&N();break;case"ArrowLeft":s==="horizontal"&&(p?j():N());break;case"ArrowUp":s==="vertical"&&j();break}const T=S%C;x[T].ref.current?.focus()});return r.jsx(cd,{scope:o,disabled:n,direction:a,orientation:s,children:r.jsx(Jt.Slot,{scope:o,children:r.jsx(g.Primitive.div,{...l,"data-orientation":s,ref:d,onKeyDown:n?void 0:m})})})}),it="AccordionItem",[dd,to]=wt(it),Xr=k.forwardRef((e,t)=>{const{__scopeAccordion:o,value:n,...a}=e,s=Ct(it,o),l=ad(it,o),c=eo(o),d=g.useId(),f=n&&l.value.includes(n)||!1,u=s.disabled||e.disabled;return r.jsx(dd,{scope:o,open:f,disabled:u,triggerId:d,children:r.jsx(y.Root,{"data-orientation":s.orientation,"data-state":on(f),...c,...a,ref:t,disabled:u,open:f,onOpenChange:p=>{p?l.onItemOpen(n):l.onItemClose(n)}})})});Xr.displayName=it;var Zr="AccordionHeader",Qr=k.forwardRef((e,t)=>{const{__scopeAccordion:o,...n}=e,a=Ct(he,o),s=to(Zr,o);return r.jsx(g.Primitive.h3,{"data-orientation":a.orientation,"data-state":on(s.open),"data-disabled":s.disabled?"":void 0,...n,ref:t})});Qr.displayName=Zr;var zt="AccordionTrigger",Jr=k.forwardRef((e,t)=>{const{__scopeAccordion:o,...n}=e,a=Ct(he,o),s=to(zt,o),l=sd(zt,o),c=eo(o);return r.jsx(Jt.ItemSlot,{scope:o,children:r.jsx(y.Trigger,{"aria-disabled":s.open&&!l.collapsible||void 0,"data-orientation":a.orientation,id:s.triggerId,...c,...n,ref:t})})});Jr.displayName=zt;var en="AccordionContent",tn=k.forwardRef((e,t)=>{const{__scopeAccordion:o,...n}=e,a=Ct(he,o),s=to(en,o),l=eo(o);return r.jsx(y.Content,{role:"region","aria-labelledby":s.triggerId,"data-orientation":a.orientation,...l,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});tn.displayName=en;function on(e){return e?"open":"closed"}var ud=Kr,pd=Xr,fd=Qr,md=Jr,gd=tn,rn="AlertDialog",[hd]=g.createContextScope(rn,[H.createDialogScope]),ye=H.createDialogScope(),nn=e=>{const{__scopeAlertDialog:t,...o}=e,n=ye(t);return r.jsx(H.Root,{...n,...o,modal:!0})};nn.displayName=rn;var vd="AlertDialogTrigger",an=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,a=ye(o);return r.jsx(H.Trigger,{...a,...n,ref:t})});an.displayName=vd;var bd="AlertDialogPortal",sn=e=>{const{__scopeAlertDialog:t,...o}=e,n=ye(t);return r.jsx(H.Portal,{...n,...o})};sn.displayName=bd;var xd="AlertDialogOverlay",ln=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,a=ye(o);return r.jsx(H.Overlay,{...a,...n,ref:t})});ln.displayName=xd;var $e="AlertDialogContent",[wd,Cd]=hd($e),yd=be.createSlottable("AlertDialogContent"),cn=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,children:n,...a}=e,s=ye(o),l=i.useRef(null),c=g.useComposedRefs(t,l),d=i.useRef(null);return r.jsx(H.WarningProvider,{contentName:$e,titleName:dn,docsSlug:"alert-dialog",children:r.jsx(wd,{scope:o,cancelRef:d,children:r.jsxs(H.Content,{role:"alertdialog",...s,...a,ref:c,onOpenAutoFocus:g.composeEventHandlers(a.onOpenAutoFocus,f=>{f.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[r.jsx(yd,{children:n}),r.jsx(Md,{contentRef:l})]})})})});cn.displayName=$e;var dn="AlertDialogTitle",un=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,a=ye(o);return r.jsx(H.Title,{...a,...n,ref:t})});un.displayName=dn;var pn="AlertDialogDescription",fn=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,a=ye(o);return r.jsx(H.Description,{...a,...n,ref:t})});fn.displayName=pn;var Sd="AlertDialogAction",mn=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,a=ye(o);return r.jsx(H.Close,{...a,...n,ref:t})});mn.displayName=Sd;var gn="AlertDialogCancel",hn=i.forwardRef((e,t)=>{const{__scopeAlertDialog:o,...n}=e,{cancelRef:a}=Cd(gn,o),s=ye(o),l=g.useComposedRefs(t,a);return r.jsx(H.Close,{...s,...n,ref:l})});hn.displayName=gn;var Md=({contentRef:e})=>{const t=`\`${$e}\` requires a description for the component to be accessible for screen reader users.
2
2
 
3
3
  You can add a description to the \`${$e}\` by passing a \`${pn}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
4
4
 
@@ -351,7 +351,7 @@ Defaulting to \`null\`.`}var Pf=Rs,Af=ks,Yo="Radio",[Df,Is]=g.createContextScope
351
351
  .progress-block-hover:hover {
352
352
  opacity: 0.5;
353
353
  }
354
- `,vm=50,Or=20,$r=100,bm=8,qi=te.cva("",{variants:{variant:{default:"bg-primary",success:"bg-success",warning:"bg-warning",error:"bg-destructive",neutral:"bg-muted-foreground"}},defaultVariants:{variant:"default"}}),Ui=te.cva("",{variants:{variant:{default:"bg-blue-200 dark:bg-blue-500/30",success:"bg-emerald-200 dark:bg-emerald-500/30",warning:"bg-yellow-200 dark:bg-yellow-500/30",error:"bg-red-200 dark:bg-red-500/30",neutral:"bg-gray-200 dark:bg-gray-500/40"}},defaultVariants:{variant:"default"}}),Yi=({filled:e,isFirst:t,isLast:o,variant:n,hoverEffect:a})=>r.jsx("div",{className:h.cn("size-full overflow-hidden px-[0.5px] transition sm:px-px",t&&"rounded-l-[4px] pl-0",o&&"rounded-r-[4px] pr-0"),style:{minWidth:"4px"},children:r.jsx("div",{className:h.cn("progress-block size-full",e?qi({variant:n}):Ui({variant:n}),a&&"progress-block-hover")})});Yi.displayName="ProgressBlock";const Xi=i.forwardRef(({value:e,max:t=100,style:o="dash",blocks:n,variant:a="default",showTooltip:s=!1,hoverEffect:l=!1,showAnimation:c=!1,label:d,height:f,className:u,...p},m)=>{const b=k.useRef(null),[v,x]=k.useState(null),w=i.useCallback(I=>{typeof m=="function"?m(I):m&&(m.current=I),b.current=I},[m]),C=Math.max(0,Math.min(100,e/t*100));k.useEffect(()=>{if(o!=="dash"||n!==void 0||!b.current)return;const I=()=>{b.current&&x(b.current.offsetWidth)};if(I(),typeof ResizeObserver<"u"){const E=new ResizeObserver(I);return E.observe(b.current),()=>{E.disconnect()}}else return window.addEventListener("resize",I),()=>{window.removeEventListener("resize",I)}},[n,o]);const S=k.useMemo(()=>{if(o!=="dash")return 0;if(n!==void 0)return Math.max(Or,Math.min($r,n));if(v!==null){const I=Math.floor(v/bm);return Math.max(Or,Math.min($r,I))}return vm},[n,v,o]),M=k.useMemo(()=>o!=="dash"?0:Math.round(C/100*S),[C,S,o]),R=k.useMemo(()=>o!=="dash"?[]:Array.from({length:S},(I,E)=>({filled:E<M,isFirst:E===0,isLast:E===S-1})),[S,M,o]),N=qi({variant:a}),j=Ui({variant:a});if(o==="solid"){const I=r.jsxs("div",{ref:m,role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":d||`Progress: ${Math.round(C)}%`,className:h.cn("flex w-full items-center",u),...p,children:[r.jsx("div",{className:h.cn("relative flex w-full items-center rounded-full",j,f||"h-2"),children:r.jsx("div",{className:h.cn("h-full rounded-full",N,c&&"transform-gpu transition-all duration-300 ease-in-out"),style:{width:`${C}%`}})}),d&&r.jsx("span",{className:h.cn("ml-2 whitespace-nowrap text-sm font-medium leading-none","text-foreground"),children:d})]});return s?r.jsxs(y.Tooltip,{children:[r.jsx(y.TooltipTrigger,{asChild:!0,children:I}),r.jsxs(y.TooltipContent,{side:"top",sideOffset:10,align:"center",children:[Math.round(C),"%"]})]}):I}const T=r.jsx("div",{ref:w,role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":`Progress: ${Math.round(C)}%`,className:h.cn("group flex w-full items-center",f||"h-8",u),...p,children:R.map((I,E)=>r.jsx(Yi,{filled:I.filled,isFirst:I.isFirst,isLast:I.isLast,variant:a||"default",hoverEffect:l},E))});return s?r.jsxs(r.Fragment,{children:[r.jsx("style",{children:Dr}),r.jsxs(y.Tooltip,{children:[r.jsx(y.TooltipTrigger,{asChild:!0,children:T}),r.jsxs(y.TooltipContent,{side:"top",sideOffset:10,align:"center",children:[Math.round(C),"%"]})]})]}):r.jsxs(r.Fragment,{children:[r.jsx("style",{children:Dr}),T]})});Xi.displayName="EnhancedProgress";const xm=te.cva("size-full flex-1 transition-all",{variants:{variant:{default:"bg-primary",neutral:"bg-muted-foreground",success:"bg-success",warning:"bg-warning",error:"bg-destructive"}},defaultVariants:{variant:"default"}});function wm({className:e,value:t,variant:o,...n}){return r.jsx(Pf,{"data-slot":"progress",className:h.cn("bg-muted h-1 rounded-md relative flex w-full items-center overflow-x-hidden",e),...n,children:r.jsx(Af,{"data-slot":"progress-indicator",className:h.cn(xm({variant:o})),style:{transform:`translateX(-${100-(t||0)}%)`}})})}const Zi=k.createContext(void 0),Qi=i.forwardRef(({className:e,variant:t="animated",disabled:o,gap:n=3,children:a,...s},l)=>{const c=i.useRef(null),[d,f]=i.useState({}),[u,p]=i.useState(!1),[m,b]=i.useState(s.value||s.defaultValue||""),v=i.useCallback(M=>{b(M),s.onValueChange?.(M)},[s,m,t]);i.useEffect(()=>{s.value!==void 0&&s.value!==null&&b(s.value)},[s.value,m,t]);const x=i.useCallback(M=>{typeof l=="function"?l(M):l&&(l.current=M),c.current=M},[l]),w=i.useCallback(()=>{if(t!=="sliding"||!c.current){p(!1);return}if(!m){p(!1);return}let M=m;if(!M&&c.current){const D=c.current.querySelector('[data-slot="radio-group-item"][data-state="checked"]');if(D){const _=D.querySelector('input[type="radio"]');_&&(M=_.value)}else{const _=c.current.querySelector('input[type="radio"]:checked');_&&(M=_.value)}}if(!M){p(!1);return}const R=c.current.querySelector('[data-slot="radio-group-item"][data-state="checked"]');let N=null;if(R){const D=R.id;D&&(N=c.current.querySelector(`label[for="${D}"]`),N||(N=R.parentElement?.querySelector("label")))}else{const D=Array.from(c.current.querySelectorAll("label.sliding-indicator-target"));for(const _ of D){const A=_.htmlFor;if(A){const $=c.current.querySelector(`#${A}`)?.querySelector('input[type="radio"]');if($&&$.value===M&&$.checked){N=_;break}}}}if(!N){p(!1);return}const j=c.current.getBoundingClientRect(),T=N.getBoundingClientRect(),I=c.current.scrollLeft||0,E=c.current.scrollTop||0,z={left:`${T.left-j.left+I}px`,top:`${T.top-j.top+E}px`,width:`${T.width}px`,height:`${T.height}px`};f(z),p(!0)},[t,m]);i.useEffect(()=>{if(t!=="sliding")return;const M=requestAnimationFrame(()=>{requestAnimationFrame(w)}),R=new ResizeObserver(()=>{requestAnimationFrame(()=>{requestAnimationFrame(w)})}),N=new MutationObserver(()=>{requestAnimationFrame(()=>{requestAnimationFrame(w)})}),j=()=>{requestAnimationFrame(()=>{requestAnimationFrame(w)})};return c.current&&(R.observe(c.current),N.observe(c.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-state","class","checked"]})),window.addEventListener("resize",j),()=>{cancelAnimationFrame(M),R.disconnect(),N.disconnect(),window.removeEventListener("resize",j)}},[t,w,m,a]);const C=typeof n=="number"?`gap-${n}`:n,S=h.cn(t==="sliding"?"sliding-indicator-container flex flex-row gap-0 relative p-1 box-border bg-muted rounded-lg overflow-x-auto":`grid ${C} w-full`,e);return r.jsx(Zi.Provider,{value:{variant:t,disabled:o,value:m},children:r.jsxs(Gs,{ref:x,"data-slot":"radio-group",className:S,disabled:o,value:s.value,defaultValue:s.defaultValue,onValueChange:v,...Object.fromEntries(Object.entries(s).filter(([M])=>!["value","defaultValue","onValueChange","disabled"].includes(M))),children:[t==="sliding"&&u&&r.jsx("div",{className:h.cn("sliding-indicator rounded-md box-border","bg-background dark:bg-input/30","border border-input","shadow-sm dark:shadow-sm","text-foreground"),style:d,"aria-hidden":"true"}),a]})})});Qi.displayName="EnhancedRadioGroup";const Ji=i.forwardRef(({className:e,children:t,spacing:o="default",...n},a)=>{const s=k.useContext(Zi);if(!s)throw new Error("EnhancedRadioGroupItem must be used within EnhancedRadioGroup");const{variant:l,disabled:c,value:d}=s,f=c||n.disabled,u=k.useId(),p=d===n.value;if(l==="animated"){const b={compact:"gap-2",default:"gap-3",comfortable:"gap-4"};return r.jsxs("label",{className:h.cn("flex items-center w-full cursor-pointer relative",b[o],"group/radio-item",f&&"cursor-not-allowed opacity-50"),"data-disabled":f,children:[r.jsx(at,{ref:a,"data-slot":"radio-group-item",className:h.cn("border-input text-primary dark:data-[state=unchecked]:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 data-[state=checked]:bg-primary dark:data-[state=checked]:bg-primary data-[state=checked]:border-transparent flex size-4 rounded-full transition-none focus-visible:ring-[2px] aria-invalid:ring-[2px] peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:animate-[radio-pulse_0.7s_forwards]",e),disabled:f,...n,children:r.jsx(Yt,{"data-slot":"radio-group-indicator",className:"group-aria-invalid/radio-group-item:text-destructive flex size-4 items-center justify-center text-primary-foreground",children:r.jsx(q.HugeiconsIcon,{icon:U.CircleIcon,strokeWidth:2,className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-current"})})}),t&&r.jsx("span",{className:"text-sm font-medium leading-normal text-foreground select-none",children:t})]})}if(l==="sliding"){const b=i.Children.toArray(t).some(x=>{if(!i.isValidElement(x))return!1;const w=x.props;return w?.className?.includes("h-")||w?.className?.includes("w-")}),v=n.id||`radio-sliding-${n.value}-${u.replace(/:/g,"-")}`;return r.jsxs("div",{className:"relative",children:[r.jsx(at,{ref:a,"data-slot":"radio-group-item",id:v,className:"sr-only",disabled:f,...n}),r.jsx("label",{htmlFor:v,className:h.cn("flex items-center justify-center text-sm font-medium leading-normal cursor-pointer rounded-md relative z-[var(--z-content)] transition-all duration-200","sliding-indicator-target",b?"h-8 w-8 p-0":"gap-4 px-5 py-0 w-full min-h-[2.5rem]",p?"text-foreground":"text-muted-foreground hover:text-foreground",f&&"cursor-not-allowed opacity-50"),children:t&&r.jsx("span",{children:t})})]})}const m={compact:"gap-2",default:"gap-3",comfortable:"gap-4"};return r.jsxs("label",{className:h.cn("flex items-center w-full cursor-pointer relative",m[o],f&&"cursor-not-allowed opacity-50"),children:[r.jsx(at,{ref:a,"data-slot":"radio-group-item",className:h.cn("border-input text-primary dark:data-[state=unchecked]:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 data-[state=checked]:bg-primary dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary flex size-4 rounded-full transition-none focus-visible:ring-[2px] aria-invalid:ring-[2px] peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50",e),disabled:f,...n,children:r.jsx(Yt,{"data-slot":"radio-group-indicator",className:"group-aria-invalid/radio-group-item:text-destructive flex size-4 items-center justify-center text-primary-foreground",children:r.jsx(q.HugeiconsIcon,{icon:U.CircleIcon,strokeWidth:2,className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-current"})})}),t&&r.jsx("span",{className:"text-sm font-medium leading-normal text-foreground select-none",children:t})]})});Ji.displayName="EnhancedRadioGroupItem";function Cm({className:e,...t}){return r.jsx(Gs,{"data-slot":"radio-group",className:h.cn("grid gap-3 w-full",e),...t})}function ym({className:e,children:t,id:o,...n}){const a=k.useId(),s=o||a,l=r.jsx(at,{"data-slot":"radio-group-item",id:s,className:h.cn("border-input text-primary dark:data-[state=unchecked]:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 data-[state=checked]:bg-primary dark:data-[state=checked]:bg-primary data-[state=checked]:border-transparent flex size-4 rounded-full transition-none focus-visible:ring-[2px] aria-invalid:ring-[2px] group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:r.jsx(Yt,{"data-slot":"radio-group-indicator",className:"group-aria-invalid/radio-group-item:text-destructive flex size-4 items-center justify-center text-primary-foreground",children:r.jsx(q.HugeiconsIcon,{icon:U.CircleIcon,strokeWidth:2,className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-current"})})});return t?r.jsxs("label",{htmlFor:s,className:"flex items-center gap-3 cursor-pointer text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:[l,t]}):l}const Lr=`
354
+ `,vm=50,Or=20,$r=100,bm=8,qi=te.cva("",{variants:{variant:{default:"bg-primary",success:"bg-success",warning:"bg-warning",error:"bg-destructive",neutral:"bg-muted-foreground"}},defaultVariants:{variant:"default"}}),Ui=te.cva("",{variants:{variant:{default:"bg-blue-200 dark:bg-blue-500/30",success:"bg-emerald-200 dark:bg-emerald-500/30",warning:"bg-yellow-200 dark:bg-yellow-500/30",error:"bg-red-200 dark:bg-red-500/30",neutral:"bg-gray-200 dark:bg-gray-500/40"}},defaultVariants:{variant:"default"}}),Yi=({filled:e,isFirst:t,isLast:o,variant:n,hoverEffect:a})=>r.jsx("div",{className:h.cn("size-full overflow-hidden px-[0.5px] transition sm:px-px",t&&"rounded-l-[4px] pl-0",o&&"rounded-r-[4px] pr-0"),style:{minWidth:"4px"},children:r.jsx("div",{className:h.cn("progress-block size-full",e?qi({variant:n}):Ui({variant:n}),a&&"progress-block-hover")})});Yi.displayName="ProgressBlock";const Xi=i.forwardRef(({value:e,max:t=100,style:o="dash",blocks:n,variant:a="default",showTooltip:s=!1,hoverEffect:l=!1,showAnimation:c=!1,label:d,height:f,className:u,...p},m)=>{const b=k.useRef(null),[v,x]=k.useState(null),w=i.useCallback(I=>{typeof m=="function"?m(I):m&&(m.current=I),b.current=I},[m]),C=Math.max(0,Math.min(100,e/t*100));k.useEffect(()=>{if(o!=="dash"||n!==void 0||!b.current)return;const I=()=>{b.current&&x(b.current.offsetWidth)};if(I(),typeof ResizeObserver<"u"){const E=new ResizeObserver(I);return E.observe(b.current),()=>{E.disconnect()}}else return window.addEventListener("resize",I),()=>{window.removeEventListener("resize",I)}},[n,o]);const S=k.useMemo(()=>{if(o!=="dash")return 0;if(n!==void 0)return Math.max(Or,Math.min($r,n));if(v!==null){const I=Math.floor(v/bm);return Math.max(Or,Math.min($r,I))}return vm},[n,v,o]),M=k.useMemo(()=>o!=="dash"?0:Math.round(C/100*S),[C,S,o]),R=k.useMemo(()=>o!=="dash"?[]:Array.from({length:S},(I,E)=>({filled:E<M,isFirst:E===0,isLast:E===S-1})),[S,M,o]),N=qi({variant:a}),j=Ui({variant:a});if(o==="solid"){const I=r.jsxs("div",{ref:m,role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":d||`Progress: ${Math.round(C)}%`,className:h.cn("flex w-full items-center",u),...p,children:[r.jsx("div",{className:h.cn("relative flex w-full items-center rounded-full",j,f||"h-2"),children:r.jsx("div",{className:h.cn("h-full rounded-full",N,c&&"transform-gpu transition-all duration-300 ease-in-out"),style:{width:`${C}%`}})}),d&&r.jsx("span",{className:h.cn("ml-2 whitespace-nowrap text-sm font-medium leading-none","text-foreground"),children:d})]});return s?r.jsxs(y.Tooltip,{children:[r.jsx(y.TooltipTrigger,{asChild:!0,children:I}),r.jsxs(y.TooltipContent,{side:"top",sideOffset:10,align:"center",children:[Math.round(C),"%"]})]}):I}const T=r.jsx("div",{ref:w,role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":t,"aria-label":`Progress: ${Math.round(C)}%`,className:h.cn("group flex w-full items-center",f||"h-8",u),...p,children:R.map((I,E)=>r.jsx(Yi,{filled:I.filled,isFirst:I.isFirst,isLast:I.isLast,variant:a||"default",hoverEffect:l},E))});return s?r.jsxs(r.Fragment,{children:[r.jsx("style",{children:Dr}),r.jsxs(y.Tooltip,{children:[r.jsx(y.TooltipTrigger,{asChild:!0,children:T}),r.jsxs(y.TooltipContent,{side:"top",sideOffset:10,align:"center",children:[Math.round(C),"%"]})]})]}):r.jsxs(r.Fragment,{children:[r.jsx("style",{children:Dr}),T]})});Xi.displayName="EnhancedProgress";const xm=te.cva("size-full flex-1 transition-all",{variants:{variant:{default:"bg-primary",neutral:"bg-muted-foreground",success:"bg-success",warning:"bg-warning",error:"bg-destructive"}},defaultVariants:{variant:"default"}});function wm({className:e,value:t,variant:o,...n}){return r.jsx(Pf,{"data-slot":"progress",className:h.cn("bg-muted h-1 rounded-md relative flex w-full items-center overflow-x-hidden",e),...n,children:r.jsx(Af,{"data-slot":"progress-indicator",className:h.cn(xm({variant:o})),style:{transform:`translateX(-${100-(t||0)}%)`}})})}const Zi=k.createContext(void 0),Qi=i.forwardRef(({className:e,variant:t="animated",disabled:o,gap:n=3,children:a,...s},l)=>{const c=i.useRef(null),[d,f]=i.useState({}),[u,p]=i.useState(!1),[m,b]=i.useState(s.value||s.defaultValue||""),v=i.useCallback(M=>{b(M),s.onValueChange?.(M)},[s,m,t]);i.useEffect(()=>{s.value!==void 0&&s.value!==null&&b(s.value)},[s.value,m,t]);const x=i.useCallback(M=>{typeof l=="function"?l(M):l&&(l.current=M),c.current=M},[l]),w=i.useCallback(()=>{if(t!=="sliding"||!c.current){p(!1);return}if(!m){p(!1);return}let M=m;if(!M&&c.current){const D=c.current.querySelector('[data-slot="radio-group-item"][data-state="checked"]');if(D){const _=D.querySelector('input[type="radio"]');_&&(M=_.value)}else{const _=c.current.querySelector('input[type="radio"]:checked');_&&(M=_.value)}}if(!M){p(!1);return}const R=c.current.querySelector('[data-slot="radio-group-item"][data-state="checked"]');let N=null;if(R){const D=R.id;D&&(N=c.current.querySelector(`label[for="${D}"]`),N||(N=R.parentElement?.querySelector("label")))}else{const D=Array.from(c.current.querySelectorAll("label.sliding-indicator-target"));for(const _ of D){const A=_.htmlFor;if(A){const $=c.current.querySelector(`#${A}`)?.querySelector('input[type="radio"]');if($&&$.value===M&&$.checked){N=_;break}}}}if(!N){p(!1);return}const j=c.current.getBoundingClientRect(),T=N.getBoundingClientRect(),I=c.current.scrollLeft||0,E=c.current.scrollTop||0,z={left:`${T.left-j.left+I}px`,top:`${T.top-j.top+E}px`,width:`${T.width}px`,height:`${T.height}px`};f(z),p(!0)},[t,m]);i.useEffect(()=>{if(t!=="sliding")return;const M=requestAnimationFrame(()=>{requestAnimationFrame(w)}),R=new ResizeObserver(()=>{requestAnimationFrame(()=>{requestAnimationFrame(w)})}),N=new MutationObserver(()=>{requestAnimationFrame(()=>{requestAnimationFrame(w)})}),j=()=>{requestAnimationFrame(()=>{requestAnimationFrame(w)})};return c.current&&(R.observe(c.current),N.observe(c.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-state","class","checked"]})),window.addEventListener("resize",j),()=>{cancelAnimationFrame(M),R.disconnect(),N.disconnect(),window.removeEventListener("resize",j)}},[t,w,m,a]);const C=typeof n=="number"?`gap-${n}`:n,S=h.cn(t==="sliding"?"sliding-indicator-container flex flex-row gap-0 relative p-1 box-border bg-muted rounded-lg overflow-x-auto":`grid ${C} w-full`,e);return r.jsx(Zi.Provider,{value:{variant:t,disabled:o,value:m},children:r.jsxs(Gs,{ref:x,"data-slot":"radio-group",className:S,disabled:o,value:s.value,defaultValue:s.defaultValue,onValueChange:v,...Object.fromEntries(Object.entries(s).filter(([M])=>!["value","defaultValue","onValueChange","disabled"].includes(M))),children:[t==="sliding"&&u&&r.jsx("div",{className:h.cn("sliding-indicator rounded-md box-border","bg-background dark:bg-input/30","border border-input","shadow-sm dark:shadow-sm","text-foreground"),style:d,"aria-hidden":"true"}),a]})})});Qi.displayName="EnhancedRadioGroup";const Ji=i.forwardRef(({className:e,children:t,spacing:o="default",...n},a)=>{const s=k.useContext(Zi);if(!s)throw new Error("EnhancedRadioGroupItem must be used within EnhancedRadioGroup");const{variant:l,disabled:c,value:d}=s,f=c||n.disabled,u=k.useId(),p=d===n.value;if(l==="animated"){const b={compact:"gap-2",default:"gap-3",comfortable:"gap-4"};return r.jsxs("label",{className:h.cn("flex items-center cursor-pointer relative",t?"w-full":"inline-flex w-auto max-w-full",b[o],"group/radio-item",f&&"cursor-not-allowed opacity-50"),"data-disabled":f,children:[r.jsx(at,{ref:a,"data-slot":"radio-group-item",className:h.cn("border-input text-primary dark:data-[state=unchecked]:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 data-[state=checked]:bg-primary dark:data-[state=checked]:bg-primary data-[state=checked]:border-transparent flex size-4 rounded-full transition-none focus-visible:ring-[2px] aria-invalid:ring-[2px] peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:animate-[radio-pulse_0.7s_forwards]",e),disabled:f,...n,children:r.jsx(Yt,{"data-slot":"radio-group-indicator",className:"group-aria-invalid/radio-group-item:text-destructive flex size-4 items-center justify-center text-primary-foreground",children:r.jsx(q.HugeiconsIcon,{icon:U.CircleIcon,strokeWidth:2,className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-current"})})}),t&&r.jsx("span",{className:"text-sm font-medium leading-normal text-foreground select-none",children:t})]})}if(l==="sliding"){const b=i.Children.toArray(t).some(x=>{if(!i.isValidElement(x))return!1;const w=x.props;return w?.className?.includes("h-")||w?.className?.includes("w-")}),v=n.id||`radio-sliding-${n.value}-${u.replace(/:/g,"-")}`;return r.jsxs("div",{className:"relative",children:[r.jsx(at,{ref:a,"data-slot":"radio-group-item",id:v,className:"sr-only",disabled:f,...n}),r.jsx("label",{htmlFor:v,className:h.cn("flex items-center justify-center text-sm font-medium leading-normal cursor-pointer rounded-md relative z-[var(--z-content)] transition-all duration-200","sliding-indicator-target",b?"h-8 w-8 p-0":"gap-4 px-5 py-0 w-full min-h-[2.5rem]",p?"text-foreground":"text-muted-foreground hover:text-foreground",f&&"cursor-not-allowed opacity-50"),children:t&&r.jsx("span",{children:t})})]})}const m={compact:"gap-2",default:"gap-3",comfortable:"gap-4"};return r.jsxs("label",{className:h.cn("flex items-center cursor-pointer relative",t?"w-full":"inline-flex w-auto max-w-full",m[o],f&&"cursor-not-allowed opacity-50"),children:[r.jsx(at,{ref:a,"data-slot":"radio-group-item",className:h.cn("border-input text-primary dark:data-[state=unchecked]:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 data-[state=checked]:bg-primary dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary flex size-4 rounded-full transition-none focus-visible:ring-[2px] aria-invalid:ring-[2px] peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50",e),disabled:f,...n,children:r.jsx(Yt,{"data-slot":"radio-group-indicator",className:"group-aria-invalid/radio-group-item:text-destructive flex size-4 items-center justify-center text-primary-foreground",children:r.jsx(q.HugeiconsIcon,{icon:U.CircleIcon,strokeWidth:2,className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-current"})})}),t&&r.jsx("span",{className:"text-sm font-medium leading-normal text-foreground select-none",children:t})]})});Ji.displayName="EnhancedRadioGroupItem";function Cm({className:e,...t}){return r.jsx(Gs,{"data-slot":"radio-group",className:h.cn("grid gap-3 w-full",e),...t})}function ym({className:e,children:t,id:o,...n}){const a=k.useId(),s=o||a,l=r.jsx(at,{"data-slot":"radio-group-item",id:s,className:h.cn("border-input text-primary dark:data-[state=unchecked]:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 data-[state=checked]:bg-primary dark:data-[state=checked]:bg-primary data-[state=checked]:border-transparent flex size-4 rounded-full transition-none focus-visible:ring-[2px] aria-invalid:ring-[2px] group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:r.jsx(Yt,{"data-slot":"radio-group-indicator",className:"group-aria-invalid/radio-group-item:text-destructive flex size-4 items-center justify-center text-primary-foreground",children:r.jsx(q.HugeiconsIcon,{icon:U.CircleIcon,strokeWidth:2,className:"absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-current"})})});return t?r.jsxs("label",{htmlFor:s,className:"flex items-center gap-3 cursor-pointer text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:[l,t]}):l}const Lr=`
355
355
  .rating-wrapper {
356
356
  display: inline-flex;
357
357
  flex-direction: row-reverse;
package/dist/nqui.es.js CHANGED
@@ -9,8 +9,8 @@ import { z as Fl } from "./sonner-CpmECDBk.js";
9
9
  import { T as Sx, E as Nx, T as Mx } from "./sonner-CpmECDBk.js";
10
10
  import { jsx as o, jsxs as k, Fragment as te } from "react/jsx-runtime";
11
11
  import { c as me, b as Ne, P as G, u as pe, d as j, e as R, f as se, k as ee, g as on, l as wr, h as Gl, m as sr, i as Bl, R as Vl, F as Hl, D as Cr, j as Ge } from "./index-CgfzsUO6.js";
12
- import { c as nt, a as nn, R as Wl, T as Kl, b as Ul, u as Be, d as yr, e as an, f as At, g as Sr, A as sn, h as De, I as Dt, i as Ot, j as ln, k as cn, l as ql, m as jl, n as Je, o as et, p as tt, P as $t, F as Xl, L as Yl, q as Zl, r as Ql } from "./debug-panel-CG-vAN0L.js";
13
- import { Y as Rx, _ as _x, Z as Ex, s as Tx, t as Ix, S as Px, y as Ax, v as Dx, B as Ox, z as $x, H as Lx, G as zx, E as Fx, x as Gx, w as Bx, Q as Vx, X as Hx, V as Wx, W as Kx, C as Ux, D as qx, M as jx, $ as Xx, a0 as Yx, a1 as Zx, a2 as Qx, S as Jx, y as e0, v as t0, B as r0, z as o0, H as n0, G as a0, E as i0, x as s0, w as l0, a3 as c0, a6 as d0, J as u0, O as p0, K as f0, N as m0, a9 as g0, U as h0, a5 as v0, a4 as b0, a8 as x0, a7 as w0 } from "./debug-panel-CG-vAN0L.js";
12
+ import { c as nt, a as nn, R as Wl, T as Kl, b as Ul, u as Be, d as yr, e as an, f as At, g as Sr, A as sn, h as De, I as Dt, i as Ot, j as ln, k as cn, l as ql, m as jl, n as Je, o as et, p as tt, P as $t, F as Xl, L as Yl, q as Zl, r as Ql } from "./debug-panel-pg39-6xw.js";
13
+ import { Y as Rx, _ as _x, Z as Ex, s as Tx, t as Ix, S as Px, y as Ax, v as Dx, B as Ox, z as $x, H as Lx, G as zx, E as Fx, x as Gx, w as Bx, Q as Vx, X as Hx, V as Wx, W as Kx, C as Ux, D as qx, M as jx, $ as Xx, a0 as Yx, a1 as Zx, a2 as Qx, S as Jx, y as e0, v as t0, B as r0, z as o0, H as n0, G as a0, E as i0, x as s0, w as l0, a3 as c0, a6 as d0, J as u0, O as p0, K as f0, N as m0, a9 as g0, U as h0, a5 as v0, a4 as b0, a8 as x0, a7 as w0 } from "./debug-panel-pg39-6xw.js";
14
14
  import { cva as ne } from "class-variance-authority";
15
15
  import * as Nr from "@radix-ui/react-slot";
16
16
  import { createSlottable as Jl, createSlot as ec, Slot as Ve } from "@radix-ui/react-slot";
@@ -5499,7 +5499,9 @@ const im = s.forwardRef(({ className: e, children: t, spacing: r = "default", ..
5499
5499
  "label",
5500
5500
  {
5501
5501
  className: g(
5502
- "flex items-center w-full cursor-pointer relative",
5502
+ // Without children, avoid w-full so a sibling Label/htmlFor row does not gap to the far edge.
5503
+ "flex items-center cursor-pointer relative",
5504
+ t ? "w-full" : "inline-flex w-auto max-w-full",
5503
5505
  {
5504
5506
  compact: "gap-2",
5505
5507
  default: "gap-3",
@@ -5585,7 +5587,8 @@ const im = s.forwardRef(({ className: e, children: t, spacing: r = "default", ..
5585
5587
  "label",
5586
5588
  {
5587
5589
  className: g(
5588
- "flex items-center w-full cursor-pointer relative",
5590
+ "flex items-center cursor-pointer relative",
5591
+ t ? "w-full" : "inline-flex w-auto max-w-full",
5589
5592
  {
5590
5593
  compact: "gap-2",
5591
5594
  default: "gap-3",
package/dist/styles.css CHANGED
@@ -37,13 +37,13 @@
37
37
  @source inline("border border-primary border-secondary border-destructive border-success border-warning border-info border-border border-input border-ring rounded-md rounded-lg rounded-full");
38
38
 
39
39
  /* Background color utilities */
40
- @source inline("bg-primary bg-secondary bg-destructive bg-success bg-warning bg-info bg-background bg-accent bg-transparent bg-none bg-muted bg-input bg-input/20 dark:bg-input/30");
40
+ @source inline("bg-primary bg-secondary bg-destructive bg-success bg-warning bg-info bg-background bg-accent bg-transparent bg-none bg-muted bg-input bg-input/20 dark:bg-input/30 mid:bg-input/30");
41
41
 
42
42
  /* Text color utilities */
43
43
  @source inline("text-primary-foreground text-secondary-foreground text-destructive-foreground text-success-foreground text-warning-foreground text-info-foreground text-accent-foreground text-muted-foreground text-foreground");
44
44
 
45
45
  /* Hover state utilities */
46
- @source inline("hover:opacity-100 hover:bg-primary/90 hover:bg-secondary/90 hover:bg-destructive/90 hover:bg-success/90 hover:bg-warning/90 hover:bg-info/90 hover:bg-accent hover:bg-muted hover:border-primary/90 hover:border-secondary/90 hover:border-destructive/90 hover:border-success/90 hover:border-warning/90 hover:border-info/90 hover:border-border hover:text-accent-foreground hover:text-muted-foreground hover:underline dark:hover:bg-muted/50");
46
+ @source inline("hover:opacity-100 hover:bg-primary/90 hover:bg-secondary/90 hover:bg-destructive/90 hover:bg-success/90 hover:bg-warning/90 hover:bg-info/90 hover:bg-accent hover:bg-muted hover:border-primary/90 hover:border-secondary/90 hover:border-destructive/90 hover:border-success/90 hover:border-warning/90 hover:border-info/90 hover:border-border hover:text-accent-foreground hover:text-muted-foreground hover:underline dark:hover:bg-muted/50 mid:hover:bg-muted/50");
47
47
 
48
48
  /* Focus state utilities */
49
49
  @source inline("focus:bg-primary/80 focus:bg-secondary/80 focus:bg-destructive/80 focus:bg-success/80 focus:bg-warning/80 focus:bg-info/80 focus:border-primary/80 focus:border-secondary/80 focus:border-destructive/80 focus:border-success/80 focus:border-warning/80 focus:border-info/80 focus:border-border focus:outline-0 focus-visible:outline-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]");
@@ -64,7 +64,7 @@
64
64
  @source inline("[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&>svg]:size-2.5");
65
65
 
66
66
  /* Group & State utilities */
67
- @source inline("group/badge has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive");
67
+ @source inline("group/badge has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 mid:aria-invalid:ring-destructive/40 aria-invalid:border-destructive");
68
68
 
69
69
  /* Z-index elevation utilities */
70
70
  @source inline("z-[var(--z-debug)] z-[var(--z-sticky-page)] z-[var(--z-background)] z-[var(--z-content)] z-[var(--z-popover)] z-[var(--z-modal-backdrop)] z-[var(--z-modal)] z-[var(--z-tooltip)] z-[var(--z-sticky-content)] z-[var(--z-floating)]");
@@ -75,6 +75,7 @@
75
75
 
76
76
 
77
77
  /* Custom dark mode variant - matches when .dark class is on element or ancestor */
78
+ /* Mid theme (warm paper) — matches when .mid class is on element or ancestor; palette from mind-canvas */
78
79
  /* Hit-area — https://bazza.dev/craft/2026/hit-area */
79
80
  /* Bazza hit-area utilities — https://bazza.dev/craft/2026/hit-area */
80
81
 
@@ -1023,13 +1024,13 @@
1023
1024
  /* System UI colors (unique to index.css) */
1024
1025
  --background: oklch(1 0 0);
1025
1026
  --foreground: oklch(0.145 0 0);
1026
- --card: oklch(0.99 0 0);
1027
+ --card: oklch(0.98 0 0);
1027
1028
  --card-foreground: oklch(0.145 0 0);
1028
1029
  --popover: oklch(1 0 0);
1029
1030
  --popover-foreground: oklch(0.145 0 0);
1030
1031
  --secondary: oklch(0.967 0.001 286.375);
1031
1032
  --secondary-foreground: oklch(0.21 0.006 285.885);
1032
- --muted: oklch(0.97 0 0);
1033
+ --muted: oklch(0.95 0 0);
1033
1034
  --muted-foreground: oklch(0.556 0 0);
1034
1035
  --accent: oklch(0.96 0 0);
1035
1036
  --accent-foreground: oklch(0.205 0 0);
@@ -1047,7 +1048,7 @@
1047
1048
  --radius: 0.45rem;
1048
1049
 
1049
1050
  /* Sidebar */
1050
- --sidebar: oklch(0.985 0 0);
1051
+ --sidebar: oklch(0.98 0 0);
1051
1052
  --sidebar-foreground: oklch(0.145 0 0);
1052
1053
  --sidebar-primary: var(--primary);
1053
1054
  --sidebar-primary-foreground: var(--primary-foreground);
@@ -1133,7 +1134,7 @@
1133
1134
  /* Additional variables from index.css */
1134
1135
  /* System UI colors for dark mode (unique to index.css)
1135
1136
  Softened foreground (oklch 0.92 ≈ #e6e6e6) for reduced eye strain vs near-pure white */
1136
- --background: oklch(0.145 0 0);
1137
+ --background: oklch(0.16 0 0);
1137
1138
  --foreground: oklch(0.92 0 0);
1138
1139
  --card: oklch(0.205 0 0);
1139
1140
  --card-foreground: oklch(0.92 0 0);
@@ -1141,12 +1142,12 @@
1141
1142
  --popover-foreground: oklch(0.92 0 0);
1142
1143
  --secondary: oklch(0.274 0.006 286.033);
1143
1144
  --secondary-foreground: oklch(0.92 0 0);
1144
- --muted: oklch(0.269 0 0);
1145
+ --muted: oklch(0.24 0 0);
1145
1146
  --muted-foreground: oklch(0.708 0 0);
1146
- --accent: oklch(0.371 0 0);
1147
+ --accent: oklch(0.27 0 0);
1147
1148
  --accent-foreground: oklch(0.92 0 0);
1148
1149
  --border: oklch(1 0 0 / 10%);
1149
- --input: oklch(1 0 0 / 15%);
1150
+ --input: oklch(1 0 0 / 0.07);
1150
1151
 
1151
1152
  /* Chart colors (same for both modes) */
1152
1153
  --chart-1: oklch(0.809 0.105 251.813);
@@ -1164,4 +1165,45 @@
1164
1165
  --sidebar-accent-foreground: oklch(0.92 0 0);
1165
1166
  --sidebar-border: oklch(1 0 0 / 10%);
1166
1167
  --sidebar-ring: oklch(0.556 0 0);
1168
+ }
1169
+
1170
+ /*
1171
+ * Mid theme — light-mode layout (same token roles as :root), with warm paper chroma
1172
+ * (mind-canvas–inspired oklch). Use class="mid" on <html> or an ancestor; do not
1173
+ * combine with .dark on the same root. Destructive/success/warning/info come from
1174
+ * colors.css like default light.
1175
+ */
1176
+ .mid {
1177
+ /* Surfaces: parallel to :root — slightly lower L and mild hue vs neutral light */
1178
+ --background: oklch(0.9574 0.0081 73.16);
1179
+ --foreground: oklch(0.2416 0.0219 57);
1180
+ --card: oklch(0.9792 0.0042 78.3);
1181
+ --card-foreground: oklch(0.2416 0.0219 57);
1182
+ --popover: oklch(0.9792 0.0042 78.3);
1183
+ --popover-foreground: oklch(0.2416 0.0219 57);
1184
+ --secondary: oklch(0.927 0.009 73.15);
1185
+ --secondary-foreground: oklch(0.3067 0.0309 56.81);
1186
+ --muted: oklch(0.9111 0.0082 73.15);
1187
+ --muted-foreground: oklch(0.5576 0.0222 57.81);
1188
+ --accent: oklch(0.4789 0.0623 56.16);
1189
+ --accent-foreground: oklch(0.9792 0.0042 78.3);
1190
+ --border: oklch(0.89 0.0137 73.1);
1191
+ --input: oklch(0.89 0.0137 73.1);
1192
+
1193
+ /* Charts: same as light (:root) */
1194
+ --chart-1: oklch(0.809 0.105 251.813);
1195
+ --chart-2: oklch(0.623 0.214 259.815);
1196
+ --chart-3: oklch(0.546 0.245 262.881);
1197
+ --chart-4: oklch(0.488 0.243 264.376);
1198
+ --chart-5: oklch(0.424 0.199 265.638);
1199
+
1200
+ /* Sidebar: same structure as :root (light) — primary via semantic tokens, ring follows focus */
1201
+ --sidebar: oklch(0.985 0.002 78);
1202
+ --sidebar-foreground: oklch(0.2416 0.0219 57);
1203
+ --sidebar-primary: var(--primary);
1204
+ --sidebar-primary-foreground: var(--primary-foreground);
1205
+ --sidebar-accent: oklch(0.96 0.004 75);
1206
+ --sidebar-accent-foreground: oklch(0.205 0.015 55);
1207
+ --sidebar-border: oklch(0.89 0.0137 73.1);
1208
+ --sidebar-ring: var(--ring);
1167
1209
  }
@@ -257,7 +257,7 @@ Use these rules to choose the right component. **Selection** = user picks from o
257
257
  | List row (avatar + title + actions) | **Item** |
258
258
  | Show keyboard shortcut | **Kbd** |
259
259
  | Activity blocks (e.g. heatmap) | **Tracker** |
260
- | Glass effect | **FrostedGlass** |
260
+ | Glass effect (blur + tint row; scroll behind) | **FrostedGlass** |
261
261
 
262
262
  ---
263
263
 
@@ -277,7 +277,7 @@ Use these rules to choose the right component. **Selection** = user picks from o
277
277
  | Item | [nqui-item.md](./nqui-item.md) | List row: media + title + description + actions. |
278
278
  | Kbd | [nqui-kbd.md](./nqui-kbd.md) | Keyboard shortcut display. |
279
279
  | Tracker | [nqui-tracker.md](./nqui-tracker.md) | Activity blocks (heatmap). |
280
- | FrostedGlass | [nqui-frosted-glass.md](./nqui-frosted-glass.md) | Glass effect. |
280
+ | FrostedGlass | [nqui-frosted-glass.md](./nqui-frosted-glass.md) | Glass blur; use with second tint row + scroll behind (see doc). |
281
281
  | NquiLogo | [nqui-logo.md](./nqui-logo.md) | Theme-aware logo. |
282
282
 
283
283
  ---
@@ -1,6 +1,8 @@
1
1
  # nqui FrostedGlass
2
2
 
3
- > Frosted glass blur effect. For sticky headers, overlays.
3
+ > Apple-style frosted glass using `backdrop-filter`, extended backdrop, and masks. **Do not use `FrostedGlass` alone** in headers—pair it with a second row that carries the tint and controls stacking.
4
+
5
+ **Background:** [Josh Comeau — `backdrop-filter`](https://www.joshwcomeau.com/css/backdrop-filter/)
4
6
 
5
7
  ## Import
6
8
 
@@ -8,12 +10,88 @@
8
10
  import { FrostedGlass } from "@nqlib/nqui"
9
11
  ```
10
12
 
11
- ## Basic
13
+ ## Props
14
+
15
+ | Prop | Type | Default | Notes |
16
+ |------|------|---------|--------|
17
+ | `blur` | `number` | `16` | Blur radius in pixels (`backdrop-filter`). |
18
+ | `borderRadius` | `number` | `0` | Pixels. `> 0` enables an SVG corner mask; `0` uses a linear gradient mask (flat header edge). |
19
+ | `className` | `string` | — | Extra classes on the backdrop layer (e.g. z-index). |
20
+
21
+ There is **no `opacity` prop**—tint comes from the sibling bar (see below). The backdrop layer uses a very light `bg-background/3` internally so the blur reads clearly.
22
+
23
+ ## Why two layers?
24
+
25
+ `FrostedGlass` renders an **absolute** backdrop layer (`pointer-events-none`, extended height for sampling). Your **toolbar/title row** must be a **sibling** on top with:
26
+
27
+ - `relative z-[var(--z-content)]`
28
+ - A semi-opaque surface, e.g. `bg-background/40` (tint + readability)
29
+ - Optional `border-b`, transitions, flex layout
30
+
31
+ Without that second row, you only get blur with almost no “glass” read and no interactive chrome.
32
+
33
+ ## Z-index (elevation)
34
+
35
+ Use variables from `styles/elevation.css` (never raw `z-10` / `z-50`).
36
+
37
+ | Layer | Typical class | Role |
38
+ |-------|----------------|------|
39
+ | Sticky container | `z-[var(--z-sticky-page)]` or `z-[var(--z-sticky-content)]` | Page header vs sticky **inside** a card/panel. |
40
+ | `FrostedGlass` | `className="z-[var(--z-background)]"` | Blur sits **below** the bar content. |
41
+ | Bar / controls | `relative z-[var(--z-content)]` | Text, buttons, borders. |
42
+
43
+ **Rule:** `--z-sticky-content` (15) &lt; `--z-sticky-page` (20). Use `--z-sticky-page` for app chrome; `--z-sticky-content` for a **Card** with `stickyHeader` so page nav stays above card headers.
44
+
45
+ ## Scroll requirement
46
+
47
+ `backdrop-filter` blurs **what is painted behind** the element. For a sticky header:
48
+
49
+ 1. Put the header and the main content in the **same scroll container** (or ensure content scrolls under the sticky region).
50
+ 2. Content must **move behind** the header while scrolling. If nothing scrolls behind the bar, you will see a flat tint with little or no visible blur.
51
+
52
+ Reference: `AppLayout` wraps header + main in `overflow-y-auto` so the main area scrolls under the sticky header.
53
+
54
+ ## Page sticky header (canonical)
55
+
56
+ Same structure as `packages/nqui/src/components/AppLayout.tsx`:
12
57
 
13
58
  ```tsx
14
- <FrostedGlass blur={16} borderRadius={0} />
59
+ <div className="flex-1 min-h-0 flex flex-col overflow-y-auto overflow-x-hidden">
60
+ <header className="sticky top-0 z-[var(--z-sticky-page)] flex-shrink-0 relative">
61
+ <FrostedGlass blur={16} borderRadius={0} className="z-[var(--z-background)]" />
62
+ <div className="relative z-[var(--z-content)] border-b bg-background/40 flex h-12 items-center gap-2 px-4">
63
+ {/* title, nav, actions */}
64
+ </div>
65
+ </header>
66
+ <main>{/* scrolls behind header */}</main>
67
+ </div>
15
68
  ```
16
69
 
17
- ## Props
70
+ - Outer `header`: `sticky` + `relative` + page-level z-index.
71
+ - `FrostedGlass`: `borderRadius={0}` for a straight top edge; increase if the header has rounded corners.
72
+ - Inner bar: `bg-background/40` (adjust opacity to taste).
73
+
74
+ ## Card with sticky header
75
+
76
+ **Card** `stickyHeader` wires this pattern for you: `FrostedGlass` with `borderRadius={8}` under **CardHeader**, scrollable **CardContent** below. See `ComponentShowcase` and `packages/nqui/src/components/ui/card.tsx`.
77
+
78
+ Use `--z-sticky-content` on the sticky region when the glass sits inside a card, not the full page.
79
+
80
+ ## Troubleshooting
81
+
82
+ | Symptom | Likely cause |
83
+ |---------|----------------|
84
+ | Solid bar, almost no blur | No content scrolling behind the sticky region, or header not in the scrolling ancestor. |
85
+ | Blur but unreadable text | Add / raise `bg-background/40` (or similar) on the **content row**, not only on `FrostedGlass`. |
86
+ | Wrong stacking vs sidebar/modals | Check elevation: floating sidebars use `--z-floating`; modals/popovers sit above—see `elevation.css`. |
87
+ | Rounded header corners | Set `borderRadius` to match; `> 0` switches to the SVG mask path. |
88
+
89
+ ## Vite / Tailwind
90
+
91
+ Consumer apps must import nqui styles **and** add Tailwind `@source` for the library (see **INSTALLATION.md** §2c). Missing sources can strip utilities used around the header (`bg-background/40`, z-index arbitrary values, etc.).
92
+
93
+ ## Related
18
94
 
19
- blur, borderRadius, opacity. Use in sticky header with z-index.
95
+ - **AppLayout** full app shell with frosted page header.
96
+ - **Card** `stickyHeader` — frosted sticky card header.
97
+ - **Select** — popover row uses the same backdrop layering pattern.
@@ -29,6 +29,8 @@ const [value, setValue] = useState("a")
29
29
  </RadioGroup>
30
30
  ```
31
31
 
32
+ **Do not** pair an empty `RadioGroupItem` with a separate `Label` in the same row: the item’s outer wrapper is meant to include the text (as children) or stand alone without a sibling label. Putting `Label` beside a control-only item can create a wide empty flex region and push the label to the far edge. Prefer the pattern above; if you must use a separate label, use `CoreRadioGroupItem` from `@nqlib/nqui` (see package exports) or ensure the item is not wrapped in a full-width row that fights the layout.
33
+
32
34
  ## With Complex Content
33
35
 
34
36
  ```tsx
@@ -58,6 +58,10 @@ Always use CSS variables from elevation.css:
58
58
  - `--z-popover` (60)
59
59
  - `--z-tooltip` (70)
60
60
 
61
+ ### FrostedGlass (sticky glass headers)
62
+
63
+ `FrostedGlass` is only the blur layer. Implementations need a **second row** with `bg-background/40`, `relative z-[var(--z-content)]`, and content that **scrolls behind** the sticky header. Full checklist, props, and troubleshooting: **`packages/nqui/docs/components/nqui-frosted-glass.md`**. Canonical page header: `AppLayout`; card: **Card** `stickyHeader`.
64
+
61
65
  ### Component Naming
62
66
  - Default exports are the enhanced/polished variants; use **Core\*** for plain primitives
63
67
  - Implementations are consolidated under **`ui/`** (not separate `custom/enhanced-*` per component for Button, Badge, Checkbox, Select, Combobox, Sonner)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nqlib/nqui",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "A React component library with enhanced UI components and developer tools",
5
5
  "type": "module",
6
6
  "main": "./dist/nqui.cjs.js",
@@ -53,6 +53,8 @@ export function generateSetupContent(framework, nquiCssPath, useLibraryImport =
53
53
  `,
54
54
  vite: `
55
55
  @import "tw-animate-css";
56
+
57
+ @custom-variant dark (&:is(.dark *));
56
58
  `,
57
59
  'create-react-app': `
58
60
  @import "tw-animate-css";
@@ -67,6 +69,16 @@ export function generateSetupContent(framework, nquiCssPath, useLibraryImport =
67
69
 
68
70
  const finalImport = `\n/* Import nqui design tokens */\n@import "${relativeImport}";\n`;
69
71
 
70
- return base + (extras[framework] || extras.generic) + finalImport;
72
+ const viteTailwindSources =
73
+ framework === 'vite'
74
+ ? `
75
+ /* Tailwind v4: scan app + nqui dist when utilities from the package are missing (see INSTALLATION.md §2c) */
76
+ @source "./**/*.{js,ts,jsx,tsx,mdx}";
77
+ @source "../components/**/*.{js,ts,jsx,tsx,mdx}";
78
+ @source "../node_modules/@nqlib/nqui/dist/**/*.js";
79
+ `
80
+ : '';
81
+
82
+ return base + (extras[framework] || extras.generic) + finalImport + viteTailwindSources;
71
83
  }
72
84