@nqlib/nqui 0.5.0 → 0.5.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.
@@ -1,8 +1,7 @@
1
1
  export type ResolvedTheme = "light" | "dark";
2
2
  /**
3
3
  * Returns the visual mode for light-vs-dark logic (e.g. status colors).
4
- * Only two theme classes exist (mid | dark); mid maps to "light" for non-dark buckets.
5
- * Legacy stored "light" still resolves to the light bucket until migration runs.
4
+ * Non-dark theme ids (`light`, `mid`) resolve to "light"; `dark` resolves to "dark".
6
5
  */
7
6
  export declare function useResolvedTheme(): ResolvedTheme;
8
7
  //# sourceMappingURL=use-resolved-theme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-resolved-theme.d.ts","sourceRoot":"","sources":["../../src/hooks/use-resolved-theme.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,CAAA;AAE5C;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,CAYhD"}
1
+ {"version":3,"file":"use-resolved-theme.d.ts","sourceRoot":"","sources":["../../src/hooks/use-resolved-theme.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,CAAA;AAE5C;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,CAYhD"}
package/dist/nqui.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react"),h=require("./utils-IjLH3w2e.cjs"),Fe=require("./sortable-Cj3cdxGc.cjs"),Te=require("./keyboard-BapbM2wb.cjs"),xt=require("./enhanced-calendar-BEIfybRx.cjs"),wt=require("./sonner-CEx2-yKh.cjs"),o=require("react/jsx-runtime"),g=require("./index-CI756mSv.cjs"),S=require("./debug-panel-R2ZLkucO.cjs"),re=require("class-variance-authority"),ve=require("@radix-ui/react-slot"),ue=require("./button-CrLihxcE.cjs"),U=require("@hugeicons/react"),Y=require("@hugeicons/core-free-icons"),O=require("./command-palette-4Sv4QjZ2.cjs"),Ke=require("./carousel-VldrniuT.cjs"),be=require("./drawer-DVarEy65.cjs"),qc=require("react-dom"),Jt=require("react-resizable-panels");function Vo(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const i=Vo(E),er=Vo(ve);function Uc(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 So=e=>{const t=e.tagName.match(/^H(\d)$/i);return t?parseInt(t[1],10):0};function Wo({selector:e="h1, h2, h3, h4, h5, h6",rootMargin:t="-100px 0px -66%",threshold:r=0,offset:n=0,enabled:a=!0,container:s=null}={}){const[l,c]=E.useState(null),[d,f]=E.useState([]),[u,p]=E.useState(null),m=E.useRef(null),b=E.useRef(null),v=E.useRef(null),x=E.useRef(new Map),w=E.useRef(new Map),C=E.useRef(new Set),N=E.useRef(new Set),y=E.useCallback(R=>{p(R),c(R)},[]);return E.useEffect(()=>{if(!a)return;const M=Array.from((s||document).querySelectorAll(e));if(M.length===0)return;x.current.clear(),w.current.clear(),M.forEach((_,D)=>{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 z=So(_);let V=null;for(let P=D+1;P<M.length;P++){const W=M[P],$=So(W);if($>0&&$<=z){V=W;break}}if(V){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",V.parentElement?.insertBefore(P,V)),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 D=-1,L=null;for(const z of _)z.intersectionRatio>D&&(D=z.intersectionRatio,L=z);if(L&&L.isIntersecting){const z=L.target.id||L.target.getAttribute("data-id")||"";z&&c(z)}else{const z=s?s.getBoundingClientRect().top:0,V=Array.from(x.current.entries()).map(([P,W])=>({id:P,el:W,rect:W.getBoundingClientRect()})).filter(({rect:P})=>(s?P.top-z:P.top)<=n+100).sort((P,W)=>{const $=s?P.rect.top-z:P.rect.top;return(s?W.rect.top-z:W.rect.top)-$});V.length>0&&c(V[0].id)}},{root:s||null,rootMargin:t,threshold:r}),b.current=new IntersectionObserver(_=>{if(u!==null)return;const D=C.current;_.forEach(V=>{const P=V.target.id||V.target.getAttribute("data-id")||"";P&&(V.isIntersecting?D.add(P):D.delete(P))});const L=new Set(D);N.current.forEach(V=>L.add(V));const z=Array.from(L);f(z),z.length>0&&!l&&c(z[0])},{root:s||null,rootMargin:"0px",threshold:.98}),v.current=new IntersectionObserver(_=>{if(u!==null)return;const D=N.current;_.forEach(P=>{const W=P.target.getAttribute("data-content-section");if(!W)return;if(C.current.has(W)){D.delete(W);return}const K=P.target.getBoundingClientRect(),q=s?s.getBoundingClientRect():null,X=s?q.top:0,H=s?q.bottom:window.innerHeight,Q=x.current.get(W),Z=Q?Q.getBoundingClientRect():null,te=Z?Z.bottom<X:!1,J=K.top>X,he=K.top<H;te&&J&&he?D.add(W):D.delete(W)});const L=C.current,z=new Set(L);N.current.forEach(P=>z.add(P));const V=Array.from(z);f(V)},{root:s||null,rootMargin:"0px",threshold:0}),M.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,D=s?s.clientHeight:window.innerHeight,L=s?_.top:0,z=s?_.bottom:window.innerHeight,V=Array.from(x.current.entries()).map(([K,q])=>({id:K,el:q,rect:q.getBoundingClientRect()})).filter(({rect:K})=>(s?K.top-L:K.top)<=D/2).sort((K,q)=>{const X=s?K.rect.top-L:K.rect.top;return(s?q.rect.top-L:q.rect.top)-X});V.length>0&&c(V[0].id);const P=[];x.current.forEach((K,q)=>{const X=K.getBoundingClientRect();X.top<z&&X.bottom>L&&P.push(q)});const W=[];w.current.forEach((K,q)=>{if(P.includes(q))return;const X=x.current.get(q),H=X?X.getBoundingClientRect():null,Q=K.getBoundingClientRect(),Z=H?H.bottom<L:!1,te=Q.top>L,J=Q.top<z;Z&&te&&J&&W.push(q)});const $=new Set([...P,...W]);$.size>0&&(f(Array.from($)),C.current=new Set(P),N.current=new Set(W))},100),j=()=>{if(u!==null)return;const _=s?s.getBoundingClientRect():null,D=s?_.top:0,L=s?_.bottom:window.innerHeight;let z=!1;if(w.current.forEach(($,K)=>{if(C.current.has(K)){N.current.has(K)&&(N.current.delete(K),z=!0);return}const q=x.current.get(K),X=q?q.getBoundingClientRect():null,H=$.getBoundingClientRect(),Q=X?X.bottom<D:!1,Z=H.top>D,te=H.top<L,J=Q&&Z&&te,he=N.current.has(K);J&&!he?(N.current.add(K),z=!0):!J&&he&&(N.current.delete(K),z=!0)}),!z)return;const V=C.current,P=new Set(V);N.current.forEach($=>P.add($));const W=Array.from(P);f(W)};let k=null;const F=()=>{k&&clearTimeout(k),k=setTimeout(()=>{j()},16)};return(s||window).addEventListener("scroll",F,{passive:!0}),()=>{clearTimeout(T),k&&clearTimeout(k),(s||window).removeEventListener("scroll",F),m.current&&m.current.disconnect(),b.current&&b.current.disconnect(),v.current&&v.current.disconnect(),w.current.forEach(D=>{D.remove()}),x.current.clear(),w.current.clear(),C.current.clear(),N.current.clear()}},[e,t,r,n,a,u,s]),E.useEffect(()=>{if(u!==null){let R;const M=()=>{clearTimeout(R),R=setTimeout(()=>{p(null)},150)},I=s||window;I.addEventListener("scroll",M,{passive:!0});const T=setTimeout(()=>{p(null)},500);return()=>{clearTimeout(T),I.removeEventListener("scroll",M),clearTimeout(R)}}},[u,s]),{activeId:u!==null?u:l,visibleIds:u!==null?[u]:d,setActiveId:y}}const Ot=768;function Ko(){const[e,t]=i.useState(void 0);return i.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Ot-1}px)`),n=()=>{t(window.innerWidth<Ot)};return r.addEventListener("change",n),t(window.innerWidth<Ot),()=>r.removeEventListener("change",n)},[]),!!e}function Yc(){const{resolvedTheme:e}=wt.z();return E.useMemo(()=>e==="dark"||typeof document<"u"&&document.documentElement.classList.contains("dark")?"dark":"light",[e])}function Xc(e,t){const[r,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:r}}const qo=typeof window<"u"?i.useLayoutEffect:i.useEffect;function Zc(e){const t=i.useRef(e);return qo(()=>{t.current=e}),t}function Qc(e){const t=i.useRef(null);return t.current===null&&(t.current=e()),t}function Jc(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>((...r)=>t.current?.(...r)),[])}function ed(e,t){const r=Jc(e),n=i.useRef(0);return i.useEffect(()=>()=>window.clearTimeout(n.current),[]),i.useCallback((...s)=>{window.clearTimeout(n.current),n.current=window.setTimeout(()=>r(...s),t)},[r,t])}const Mo=new Map,td=16,rd=4,od=40;function nd({label:e,cacheKey:t,iconSize:r,maxWidth:n,className:a}){const s=Mo.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",r){const d=document.createElement("span");d.className="shrink-0",d.style.width=`${r}px`,d.style.height=`${r}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),Mo.set(t,c),c}function ad({items:e,getLabel:t,containerRef:r,lineCount:n,cacheKeyPrefix:a="",containerPadding:s=td,badgeGap:l=rd,overflowBadgeWidth:c=od,iconSize:d,maxWidth:f,className:u}){const[p,m]=i.useState(0);return i.useEffect(()=>{if(!r.current)return;function v(){if(r.current){const w=r.current.clientWidth-s;m(w)}}v();const x=new ResizeObserver(v);return x.observe(r.current),()=>{x.disconnect()}},[r,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 N=t(C),y=a?`${a}:${N}`:N,M=nd({label:N,cacheKey:y,iconSize:d,maxWidth:f,className:u})+l;if(v+M<=p)v+=M,w.push(C);else if(x<n)x++,v=M,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 ge="Accordion",sd=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[tr,id,ld]=S.createCollection(ge),[Ct]=g.createContextScope(ge,[ld,S.createCollapsibleScope]),rr=S.createCollapsibleScope(),Uo=E.forwardRef((e,t)=>{const{type:r,...n}=e,a=n,s=n;return o.jsx(tr.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?o.jsx(pd,{...s,ref:t}):o.jsx(ud,{...a,ref:t})})});Uo.displayName=ge;var[Yo,cd]=Ct(ge),[Xo,dd]=Ct(ge,{collapsible:!1}),ud=E.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},collapsible:s=!1,...l}=e,[c,d]=g.useControllableState({prop:r,defaultProp:n??"",onChange:a,caller:ge});return o.jsx(Yo,{scope:e.__scopeAccordion,value:E.useMemo(()=>c?[c]:[],[c]),onItemOpen:d,onItemClose:E.useCallback(()=>s&&d(""),[s,d]),children:o.jsx(Xo,{scope:e.__scopeAccordion,collapsible:s,children:o.jsx(Zo,{...l,ref:t})})})}),pd=E.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...s}=e,[l,c]=g.useControllableState({prop:r,defaultProp:n??[],onChange:a,caller:ge}),d=E.useCallback(u=>c((p=[])=>[...p,u]),[c]),f=E.useCallback(u=>c((p=[])=>p.filter(m=>m!==u)),[c]);return o.jsx(Yo,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:f,children:o.jsx(Xo,{scope:e.__scopeAccordion,collapsible:!0,children:o.jsx(Zo,{...s,ref:t})})})}),[fd,yt]=Ct(ge),Zo=E.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:n,dir:a,orientation:s="vertical",...l}=e,c=E.useRef(null),d=g.useComposedRefs(c,t),f=id(r),p=S.useDirection(a)==="ltr",m=g.composeEventHandlers(e.onKeyDown,b=>{if(!sd.includes(b.key))return;const v=b.target,x=f().filter(j=>!j.ref.current?.disabled),w=x.findIndex(j=>j.ref.current===v),C=x.length;if(w===-1)return;b.preventDefault();let N=w;const y=0,R=C-1,M=()=>{N=w+1,N>R&&(N=y)},I=()=>{N=w-1,N<y&&(N=R)};switch(b.key){case"Home":N=y;break;case"End":N=R;break;case"ArrowRight":s==="horizontal"&&(p?M():I());break;case"ArrowDown":s==="vertical"&&M();break;case"ArrowLeft":s==="horizontal"&&(p?I():M());break;case"ArrowUp":s==="vertical"&&I();break}const T=N%C;x[T].ref.current?.focus()});return o.jsx(fd,{scope:r,disabled:n,direction:a,orientation:s,children:o.jsx(tr.Slot,{scope:r,children:o.jsx(g.Primitive.div,{...l,"data-orientation":s,ref:d,onKeyDown:n?void 0:m})})})}),it="AccordionItem",[md,or]=Ct(it),Qo=E.forwardRef((e,t)=>{const{__scopeAccordion:r,value:n,...a}=e,s=yt(it,r),l=cd(it,r),c=rr(r),d=g.useId(),f=n&&l.value.includes(n)||!1,u=s.disabled||e.disabled;return o.jsx(md,{scope:r,open:f,disabled:u,triggerId:d,children:o.jsx(S.Root,{"data-orientation":s.orientation,"data-state":nn(f),...c,...a,ref:t,disabled:u,open:f,onOpenChange:p=>{p?l.onItemOpen(n):l.onItemClose(n)}})})});Qo.displayName=it;var Jo="AccordionHeader",en=E.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,a=yt(ge,r),s=or(Jo,r);return o.jsx(g.Primitive.h3,{"data-orientation":a.orientation,"data-state":nn(s.open),"data-disabled":s.disabled?"":void 0,...n,ref:t})});en.displayName=Jo;var Ft="AccordionTrigger",tn=E.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,a=yt(ge,r),s=or(Ft,r),l=dd(Ft,r),c=rr(r);return o.jsx(tr.ItemSlot,{scope:r,children:o.jsx(S.Trigger,{"aria-disabled":s.open&&!l.collapsible||void 0,"data-orientation":a.orientation,id:s.triggerId,...c,...n,ref:t})})});tn.displayName=Ft;var rn="AccordionContent",on=E.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,a=yt(ge,r),s=or(rn,r),l=rr(r);return o.jsx(S.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}})});on.displayName=rn;function nn(e){return e?"open":"closed"}var gd=Uo,hd=Qo,vd=en,bd=tn,xd=on,an="AlertDialog",[wd]=g.createContextScope(an,[O.createDialogScope]),ye=O.createDialogScope(),sn=e=>{const{__scopeAlertDialog:t,...r}=e,n=ye(t);return o.jsx(O.Root,{...n,...r,modal:!0})};sn.displayName=an;var Cd="AlertDialogTrigger",ln=i.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=ye(r);return o.jsx(O.Trigger,{...a,...n,ref:t})});ln.displayName=Cd;var yd="AlertDialogPortal",cn=e=>{const{__scopeAlertDialog:t,...r}=e,n=ye(t);return o.jsx(O.Portal,{...n,...r})};cn.displayName=yd;var Sd="AlertDialogOverlay",dn=i.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=ye(r);return o.jsx(O.Overlay,{...a,...n,ref:t})});dn.displayName=Sd;var $e="AlertDialogContent",[Md,Nd]=wd($e),Rd=ve.createSlottable("AlertDialogContent"),un=i.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...a}=e,s=ye(r),l=i.useRef(null),c=g.useComposedRefs(t,l),d=i.useRef(null);return o.jsx(O.WarningProvider,{contentName:$e,titleName:pn,docsSlug:"alert-dialog",children:o.jsx(Md,{scope:r,cancelRef:d,children:o.jsxs(O.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:[o.jsx(Rd,{children:n}),o.jsx(Ed,{contentRef:l})]})})})});un.displayName=$e;var pn="AlertDialogTitle",fn=i.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=ye(r);return o.jsx(O.Title,{...a,...n,ref:t})});fn.displayName=pn;var mn="AlertDialogDescription",gn=i.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=ye(r);return o.jsx(O.Description,{...a,...n,ref:t})});gn.displayName=mn;var kd="AlertDialogAction",hn=i.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=ye(r);return o.jsx(O.Close,{...a,...n,ref:t})});hn.displayName=kd;var vn="AlertDialogCancel",bn=i.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:a}=Nd(vn,r),s=ye(r),l=g.useComposedRefs(t,a);return o.jsx(O.Close,{...s,...n,ref:l})});bn.displayName=vn;var Ed=({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 E=require("react"),h=require("./utils-IjLH3w2e.cjs"),Fe=require("./sortable-Cj3cdxGc.cjs"),Te=require("./keyboard-BapbM2wb.cjs"),xt=require("./enhanced-calendar-BEIfybRx.cjs"),wt=require("./sonner-CP8np0BP.cjs"),o=require("react/jsx-runtime"),g=require("./index-CI756mSv.cjs"),S=require("./debug-panel-R2ZLkucO.cjs"),re=require("class-variance-authority"),ve=require("@radix-ui/react-slot"),ue=require("./button-CrLihxcE.cjs"),U=require("@hugeicons/react"),Y=require("@hugeicons/core-free-icons"),O=require("./command-palette-4Sv4QjZ2.cjs"),Ke=require("./carousel-VldrniuT.cjs"),be=require("./drawer-DVarEy65.cjs"),qc=require("react-dom"),Jt=require("react-resizable-panels");function Vo(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const i=Vo(E),er=Vo(ve);function Uc(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 So=e=>{const t=e.tagName.match(/^H(\d)$/i);return t?parseInt(t[1],10):0};function Wo({selector:e="h1, h2, h3, h4, h5, h6",rootMargin:t="-100px 0px -66%",threshold:r=0,offset:n=0,enabled:a=!0,container:s=null}={}){const[l,c]=E.useState(null),[d,f]=E.useState([]),[u,p]=E.useState(null),m=E.useRef(null),b=E.useRef(null),v=E.useRef(null),x=E.useRef(new Map),w=E.useRef(new Map),C=E.useRef(new Set),N=E.useRef(new Set),y=E.useCallback(R=>{p(R),c(R)},[]);return E.useEffect(()=>{if(!a)return;const M=Array.from((s||document).querySelectorAll(e));if(M.length===0)return;x.current.clear(),w.current.clear(),M.forEach((_,D)=>{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 z=So(_);let V=null;for(let P=D+1;P<M.length;P++){const W=M[P],$=So(W);if($>0&&$<=z){V=W;break}}if(V){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",V.parentElement?.insertBefore(P,V)),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 D=-1,L=null;for(const z of _)z.intersectionRatio>D&&(D=z.intersectionRatio,L=z);if(L&&L.isIntersecting){const z=L.target.id||L.target.getAttribute("data-id")||"";z&&c(z)}else{const z=s?s.getBoundingClientRect().top:0,V=Array.from(x.current.entries()).map(([P,W])=>({id:P,el:W,rect:W.getBoundingClientRect()})).filter(({rect:P})=>(s?P.top-z:P.top)<=n+100).sort((P,W)=>{const $=s?P.rect.top-z:P.rect.top;return(s?W.rect.top-z:W.rect.top)-$});V.length>0&&c(V[0].id)}},{root:s||null,rootMargin:t,threshold:r}),b.current=new IntersectionObserver(_=>{if(u!==null)return;const D=C.current;_.forEach(V=>{const P=V.target.id||V.target.getAttribute("data-id")||"";P&&(V.isIntersecting?D.add(P):D.delete(P))});const L=new Set(D);N.current.forEach(V=>L.add(V));const z=Array.from(L);f(z),z.length>0&&!l&&c(z[0])},{root:s||null,rootMargin:"0px",threshold:.98}),v.current=new IntersectionObserver(_=>{if(u!==null)return;const D=N.current;_.forEach(P=>{const W=P.target.getAttribute("data-content-section");if(!W)return;if(C.current.has(W)){D.delete(W);return}const K=P.target.getBoundingClientRect(),q=s?s.getBoundingClientRect():null,X=s?q.top:0,H=s?q.bottom:window.innerHeight,Q=x.current.get(W),Z=Q?Q.getBoundingClientRect():null,te=Z?Z.bottom<X:!1,J=K.top>X,he=K.top<H;te&&J&&he?D.add(W):D.delete(W)});const L=C.current,z=new Set(L);N.current.forEach(P=>z.add(P));const V=Array.from(z);f(V)},{root:s||null,rootMargin:"0px",threshold:0}),M.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,D=s?s.clientHeight:window.innerHeight,L=s?_.top:0,z=s?_.bottom:window.innerHeight,V=Array.from(x.current.entries()).map(([K,q])=>({id:K,el:q,rect:q.getBoundingClientRect()})).filter(({rect:K})=>(s?K.top-L:K.top)<=D/2).sort((K,q)=>{const X=s?K.rect.top-L:K.rect.top;return(s?q.rect.top-L:q.rect.top)-X});V.length>0&&c(V[0].id);const P=[];x.current.forEach((K,q)=>{const X=K.getBoundingClientRect();X.top<z&&X.bottom>L&&P.push(q)});const W=[];w.current.forEach((K,q)=>{if(P.includes(q))return;const X=x.current.get(q),H=X?X.getBoundingClientRect():null,Q=K.getBoundingClientRect(),Z=H?H.bottom<L:!1,te=Q.top>L,J=Q.top<z;Z&&te&&J&&W.push(q)});const $=new Set([...P,...W]);$.size>0&&(f(Array.from($)),C.current=new Set(P),N.current=new Set(W))},100),j=()=>{if(u!==null)return;const _=s?s.getBoundingClientRect():null,D=s?_.top:0,L=s?_.bottom:window.innerHeight;let z=!1;if(w.current.forEach(($,K)=>{if(C.current.has(K)){N.current.has(K)&&(N.current.delete(K),z=!0);return}const q=x.current.get(K),X=q?q.getBoundingClientRect():null,H=$.getBoundingClientRect(),Q=X?X.bottom<D:!1,Z=H.top>D,te=H.top<L,J=Q&&Z&&te,he=N.current.has(K);J&&!he?(N.current.add(K),z=!0):!J&&he&&(N.current.delete(K),z=!0)}),!z)return;const V=C.current,P=new Set(V);N.current.forEach($=>P.add($));const W=Array.from(P);f(W)};let k=null;const F=()=>{k&&clearTimeout(k),k=setTimeout(()=>{j()},16)};return(s||window).addEventListener("scroll",F,{passive:!0}),()=>{clearTimeout(T),k&&clearTimeout(k),(s||window).removeEventListener("scroll",F),m.current&&m.current.disconnect(),b.current&&b.current.disconnect(),v.current&&v.current.disconnect(),w.current.forEach(D=>{D.remove()}),x.current.clear(),w.current.clear(),C.current.clear(),N.current.clear()}},[e,t,r,n,a,u,s]),E.useEffect(()=>{if(u!==null){let R;const M=()=>{clearTimeout(R),R=setTimeout(()=>{p(null)},150)},I=s||window;I.addEventListener("scroll",M,{passive:!0});const T=setTimeout(()=>{p(null)},500);return()=>{clearTimeout(T),I.removeEventListener("scroll",M),clearTimeout(R)}}},[u,s]),{activeId:u!==null?u:l,visibleIds:u!==null?[u]:d,setActiveId:y}}const Ot=768;function Ko(){const[e,t]=i.useState(void 0);return i.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Ot-1}px)`),n=()=>{t(window.innerWidth<Ot)};return r.addEventListener("change",n),t(window.innerWidth<Ot),()=>r.removeEventListener("change",n)},[]),!!e}function Yc(){const{resolvedTheme:e}=wt.z();return E.useMemo(()=>e==="dark"||typeof document<"u"&&document.documentElement.classList.contains("dark")?"dark":"light",[e])}function Xc(e,t){const[r,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:r}}const qo=typeof window<"u"?i.useLayoutEffect:i.useEffect;function Zc(e){const t=i.useRef(e);return qo(()=>{t.current=e}),t}function Qc(e){const t=i.useRef(null);return t.current===null&&(t.current=e()),t}function Jc(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>((...r)=>t.current?.(...r)),[])}function ed(e,t){const r=Jc(e),n=i.useRef(0);return i.useEffect(()=>()=>window.clearTimeout(n.current),[]),i.useCallback((...s)=>{window.clearTimeout(n.current),n.current=window.setTimeout(()=>r(...s),t)},[r,t])}const Mo=new Map,td=16,rd=4,od=40;function nd({label:e,cacheKey:t,iconSize:r,maxWidth:n,className:a}){const s=Mo.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",r){const d=document.createElement("span");d.className="shrink-0",d.style.width=`${r}px`,d.style.height=`${r}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),Mo.set(t,c),c}function ad({items:e,getLabel:t,containerRef:r,lineCount:n,cacheKeyPrefix:a="",containerPadding:s=td,badgeGap:l=rd,overflowBadgeWidth:c=od,iconSize:d,maxWidth:f,className:u}){const[p,m]=i.useState(0);return i.useEffect(()=>{if(!r.current)return;function v(){if(r.current){const w=r.current.clientWidth-s;m(w)}}v();const x=new ResizeObserver(v);return x.observe(r.current),()=>{x.disconnect()}},[r,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 N=t(C),y=a?`${a}:${N}`:N,M=nd({label:N,cacheKey:y,iconSize:d,maxWidth:f,className:u})+l;if(v+M<=p)v+=M,w.push(C);else if(x<n)x++,v=M,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 ge="Accordion",sd=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[tr,id,ld]=S.createCollection(ge),[Ct]=g.createContextScope(ge,[ld,S.createCollapsibleScope]),rr=S.createCollapsibleScope(),Uo=E.forwardRef((e,t)=>{const{type:r,...n}=e,a=n,s=n;return o.jsx(tr.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?o.jsx(pd,{...s,ref:t}):o.jsx(ud,{...a,ref:t})})});Uo.displayName=ge;var[Yo,cd]=Ct(ge),[Xo,dd]=Ct(ge,{collapsible:!1}),ud=E.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},collapsible:s=!1,...l}=e,[c,d]=g.useControllableState({prop:r,defaultProp:n??"",onChange:a,caller:ge});return o.jsx(Yo,{scope:e.__scopeAccordion,value:E.useMemo(()=>c?[c]:[],[c]),onItemOpen:d,onItemClose:E.useCallback(()=>s&&d(""),[s,d]),children:o.jsx(Xo,{scope:e.__scopeAccordion,collapsible:s,children:o.jsx(Zo,{...l,ref:t})})})}),pd=E.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...s}=e,[l,c]=g.useControllableState({prop:r,defaultProp:n??[],onChange:a,caller:ge}),d=E.useCallback(u=>c((p=[])=>[...p,u]),[c]),f=E.useCallback(u=>c((p=[])=>p.filter(m=>m!==u)),[c]);return o.jsx(Yo,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:f,children:o.jsx(Xo,{scope:e.__scopeAccordion,collapsible:!0,children:o.jsx(Zo,{...s,ref:t})})})}),[fd,yt]=Ct(ge),Zo=E.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:n,dir:a,orientation:s="vertical",...l}=e,c=E.useRef(null),d=g.useComposedRefs(c,t),f=id(r),p=S.useDirection(a)==="ltr",m=g.composeEventHandlers(e.onKeyDown,b=>{if(!sd.includes(b.key))return;const v=b.target,x=f().filter(j=>!j.ref.current?.disabled),w=x.findIndex(j=>j.ref.current===v),C=x.length;if(w===-1)return;b.preventDefault();let N=w;const y=0,R=C-1,M=()=>{N=w+1,N>R&&(N=y)},I=()=>{N=w-1,N<y&&(N=R)};switch(b.key){case"Home":N=y;break;case"End":N=R;break;case"ArrowRight":s==="horizontal"&&(p?M():I());break;case"ArrowDown":s==="vertical"&&M();break;case"ArrowLeft":s==="horizontal"&&(p?I():M());break;case"ArrowUp":s==="vertical"&&I();break}const T=N%C;x[T].ref.current?.focus()});return o.jsx(fd,{scope:r,disabled:n,direction:a,orientation:s,children:o.jsx(tr.Slot,{scope:r,children:o.jsx(g.Primitive.div,{...l,"data-orientation":s,ref:d,onKeyDown:n?void 0:m})})})}),it="AccordionItem",[md,or]=Ct(it),Qo=E.forwardRef((e,t)=>{const{__scopeAccordion:r,value:n,...a}=e,s=yt(it,r),l=cd(it,r),c=rr(r),d=g.useId(),f=n&&l.value.includes(n)||!1,u=s.disabled||e.disabled;return o.jsx(md,{scope:r,open:f,disabled:u,triggerId:d,children:o.jsx(S.Root,{"data-orientation":s.orientation,"data-state":nn(f),...c,...a,ref:t,disabled:u,open:f,onOpenChange:p=>{p?l.onItemOpen(n):l.onItemClose(n)}})})});Qo.displayName=it;var Jo="AccordionHeader",en=E.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,a=yt(ge,r),s=or(Jo,r);return o.jsx(g.Primitive.h3,{"data-orientation":a.orientation,"data-state":nn(s.open),"data-disabled":s.disabled?"":void 0,...n,ref:t})});en.displayName=Jo;var Ft="AccordionTrigger",tn=E.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,a=yt(ge,r),s=or(Ft,r),l=dd(Ft,r),c=rr(r);return o.jsx(tr.ItemSlot,{scope:r,children:o.jsx(S.Trigger,{"aria-disabled":s.open&&!l.collapsible||void 0,"data-orientation":a.orientation,id:s.triggerId,...c,...n,ref:t})})});tn.displayName=Ft;var rn="AccordionContent",on=E.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,a=yt(ge,r),s=or(rn,r),l=rr(r);return o.jsx(S.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}})});on.displayName=rn;function nn(e){return e?"open":"closed"}var gd=Uo,hd=Qo,vd=en,bd=tn,xd=on,an="AlertDialog",[wd]=g.createContextScope(an,[O.createDialogScope]),ye=O.createDialogScope(),sn=e=>{const{__scopeAlertDialog:t,...r}=e,n=ye(t);return o.jsx(O.Root,{...n,...r,modal:!0})};sn.displayName=an;var Cd="AlertDialogTrigger",ln=i.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=ye(r);return o.jsx(O.Trigger,{...a,...n,ref:t})});ln.displayName=Cd;var yd="AlertDialogPortal",cn=e=>{const{__scopeAlertDialog:t,...r}=e,n=ye(t);return o.jsx(O.Portal,{...n,...r})};cn.displayName=yd;var Sd="AlertDialogOverlay",dn=i.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=ye(r);return o.jsx(O.Overlay,{...a,...n,ref:t})});dn.displayName=Sd;var $e="AlertDialogContent",[Md,Nd]=wd($e),Rd=ve.createSlottable("AlertDialogContent"),un=i.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...a}=e,s=ye(r),l=i.useRef(null),c=g.useComposedRefs(t,l),d=i.useRef(null);return o.jsx(O.WarningProvider,{contentName:$e,titleName:pn,docsSlug:"alert-dialog",children:o.jsx(Md,{scope:r,cancelRef:d,children:o.jsxs(O.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:[o.jsx(Rd,{children:n}),o.jsx(Ed,{contentRef:l})]})})})});un.displayName=$e;var pn="AlertDialogTitle",fn=i.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=ye(r);return o.jsx(O.Title,{...a,...n,ref:t})});fn.displayName=pn;var mn="AlertDialogDescription",gn=i.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=ye(r);return o.jsx(O.Description,{...a,...n,ref:t})});gn.displayName=mn;var kd="AlertDialogAction",hn=i.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,a=ye(r);return o.jsx(O.Close,{...a,...n,ref:t})});hn.displayName=kd;var vn="AlertDialogCancel",bn=i.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:a}=Nd(vn,r),s=ye(r),l=g.useComposedRefs(t,a);return o.jsx(O.Close,{...s,...n,ref:l})});bn.displayName=vn;var Ed=({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 \`${mn}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
4
4
 
package/dist/nqui.es.js CHANGED
@@ -5,8 +5,8 @@ import { S as yx, a as Sx, b as Nx, c as kx, d as Mx, u as Rx } from "./sortable
5
5
  import { S as Ul, i as ql } from "./keyboard-pkY42Y3a.js";
6
6
  import { K as Ex, R as Ix, s as Tx } from "./keyboard-pkY42Y3a.js";
7
7
  import { E as Px, a as Dx, C as Ox, u as $x } from "./enhanced-calendar-Cj-4xhqf.js";
8
- import { z as jl } from "./sonner-FXwPWWq8.js";
9
- import { T as zx, E as Fx, T as Gx } from "./sonner-FXwPWWq8.js";
8
+ import { z as jl } from "./sonner-C1ndgVQY.js";
9
+ import { T as zx, E as Fx, T as Gx } from "./sonner-C1ndgVQY.js";
10
10
  import { jsx as n, jsxs as M, Fragment as re } from "react/jsx-runtime";
11
11
  import { c as fe, b as Se, P as B, u as pe, d as Z, e as I, f as se, k as te, g as an, l as Sr, h as Xl, m as lr, i as Yl, R as Zl, F as Ql, D as Nr, j as Ge } from "./index-CgfzsUO6.js";
12
12
  import { c as nt, a as sn, R as Jl, T as ec, b as tc, u as Be, d as kr, e as ln, f as Pt, g as Mr, A as cn, h as De, I as Dt, i as Ot, j as dn, k as un, l as rc, m as oc, n as nc, o as pn, P as ac, p as ic, q as Je, r as et, s as tt, t as $t, F as sc, L as lc, v as cc, w as dc } from "./debug-panel-BnZDhlaR.js";
@@ -3,11 +3,11 @@ import * as c from "react";
3
3
  import { Toaster as T } from "sonner";
4
4
  import { HugeiconsIcon as i } from "@hugeicons/react";
5
5
  import { Loading03Icon as S, MultiplicationSignCircleIcon as I, Alert02Icon as E, InformationCircleIcon as C, CheckmarkCircle02Icon as N } from "@hugeicons/core-free-icons";
6
- var z = (t, n, s, d, l, r, u, f) => {
6
+ var z = (t, n, s, l, d, r, u, f) => {
7
7
  let e = document.documentElement, g = ["light", "dark"];
8
8
  function m(o) {
9
9
  (Array.isArray(t) ? t : [t]).forEach((p) => {
10
- let v = p === "class", y = v && r ? l.map((x) => r[x] || x) : l;
10
+ let v = p === "class", y = v && r ? d.map((x) => r[x] || x) : d;
11
11
  v ? (e.classList.remove(...y), e.classList.add(r && r[o] ? r[o] : o)) : e.setAttribute(p, o);
12
12
  }), w(o);
13
13
  }
@@ -17,7 +17,7 @@ var z = (t, n, s, d, l, r, u, f) => {
17
17
  function k() {
18
18
  return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
19
19
  }
20
- if (d) m(d);
20
+ if (l) m(l);
21
21
  else try {
22
22
  let o = localStorage.getItem(n) || s, p = u && o === "system" ? k() : o;
23
23
  m(p);
@@ -28,8 +28,8 @@ var z = (t, n, s, d, l, r, u, f) => {
28
28
  var t;
29
29
  return (t = c.useContext(W)) != null ? t : A;
30
30
  };
31
- c.memo(({ forcedTheme: t, storageKey: n, attribute: s, enableSystem: d, enableColorScheme: l, defaultTheme: r, value: u, themes: f, nonce: e, scriptProps: g }) => {
32
- let m = JSON.stringify([s, n, r, t, f, u, d, l]).slice(1, -1);
31
+ c.memo(({ forcedTheme: t, storageKey: n, attribute: s, enableSystem: l, enableColorScheme: d, defaultTheme: r, value: u, themes: f, nonce: e, scriptProps: g }) => {
32
+ let m = JSON.stringify([s, n, r, t, f, u, l, d]).slice(1, -1);
33
33
  return c.createElement("script", { ...g, suppressHydrationWarning: !0, nonce: typeof window > "u" ? e : "", dangerouslySetInnerHTML: { __html: `(${z.toString()})(${m})` } });
34
34
  });
35
35
  const b = "nqui-toast-styles-v2";
@@ -86,7 +86,7 @@ function M() {
86
86
  `, document.head.appendChild(t);
87
87
  }
88
88
  const h = ({ ...t }) => {
89
- const { theme: n = "mid" } = L(), s = n === "dark" ? "dark" : "light";
89
+ const { theme: n = "light" } = L(), s = n === "dark" ? "dark" : "light";
90
90
  return c.useEffect(() => {
91
91
  M();
92
92
  }, []), /* @__PURE__ */ a(
@@ -1,4 +1,4 @@
1
- "use strict";const c=require("react/jsx-runtime"),T=require("react"),j=require("sonner"),i=require("@hugeicons/react"),l=require("@hugeicons/core-free-icons");function E(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(r,o,n.get?n:{enumerable:!0,get:()=>t[o]})}}return r.default=t,Object.freeze(r)}const d=E(T);var N=(t,r,o,n,u,a,f,h)=>{let s=document.documentElement,x=["light","dark"];function m(e){(Array.isArray(t)?t:[t]).forEach(p=>{let v=p==="class",S=v&&a?u.map(b=>a[b]||b):u;v?(s.classList.remove(...S),s.classList.add(a&&a[e]?a[e]:e)):s.setAttribute(p,e)}),y(e)}function y(e){h&&x.includes(e)&&(s.style.colorScheme=e)}function I(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(n)m(n);else try{let e=localStorage.getItem(r)||o,p=f&&e==="system"?I():e;m(p)}catch{}},C=d.createContext(void 0),O={setTheme:t=>{},themes:[]},k=()=>{var t;return(t=d.useContext(C))!=null?t:O};d.memo(({forcedTheme:t,storageKey:r,attribute:o,enableSystem:n,enableColorScheme:u,defaultTheme:a,value:f,themes:h,nonce:s,scriptProps:x})=>{let m=JSON.stringify([o,r,a,t,h,f,n,u]).slice(1,-1);return d.createElement("script",{...x,suppressHydrationWarning:!0,nonce:typeof window>"u"?s:"",dangerouslySetInnerHTML:{__html:`(${N.toString()})(${m})`}})});const w="nqui-toast-styles-v2";function z(){if(typeof document>"u"||document.getElementById(w))return;const t=document.createElement("style");t.id=w,t.textContent=`
1
+ "use strict";const c=require("react/jsx-runtime"),T=require("react"),j=require("sonner"),i=require("@hugeicons/react"),l=require("@hugeicons/core-free-icons");function E(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(r,o,n.get?n:{enumerable:!0,get:()=>t[o]})}}return r.default=t,Object.freeze(r)}const d=E(T);var N=(t,r,o,n,u,a,f,h)=>{let s=document.documentElement,x=["light","dark"];function m(e){(Array.isArray(t)?t:[t]).forEach(g=>{let v=g==="class",S=v&&a?u.map(b=>a[b]||b):u;v?(s.classList.remove(...S),s.classList.add(a&&a[e]?a[e]:e)):s.setAttribute(g,e)}),y(e)}function y(e){h&&x.includes(e)&&(s.style.colorScheme=e)}function I(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(n)m(n);else try{let e=localStorage.getItem(r)||o,g=f&&e==="system"?I():e;m(g)}catch{}},C=d.createContext(void 0),O={setTheme:t=>{},themes:[]},k=()=>{var t;return(t=d.useContext(C))!=null?t:O};d.memo(({forcedTheme:t,storageKey:r,attribute:o,enableSystem:n,enableColorScheme:u,defaultTheme:a,value:f,themes:h,nonce:s,scriptProps:x})=>{let m=JSON.stringify([o,r,a,t,h,f,n,u]).slice(1,-1);return d.createElement("script",{...x,suppressHydrationWarning:!0,nonce:typeof window>"u"?s:"",dangerouslySetInnerHTML:{__html:`(${N.toString()})(${m})`}})});const w="nqui-toast-styles-v2";function z(){if(typeof document>"u"||document.getElementById(w))return;const t=document.createElement("style");t.id=w,t.textContent=`
2
2
  /* Pill toast — inverted surface: dark-on-light app, light-on-dark app */
3
3
  [data-sonner-toast] .cn-toast {
4
4
  border: 1px solid color-mix(in oklch, var(--normal-text) 18%, transparent) !important;
@@ -45,4 +45,4 @@
45
45
  .cn-toast .toast-icon-warning { color: var(--warning); }
46
46
  .cn-toast .toast-icon-info { color: var(--info); }
47
47
  .cn-toast .toast-icon-loading { color: var(--primary); }
48
- `,document.head.appendChild(t)}const g=({...t})=>{const{theme:r="mid"}=k(),o=r==="dark"?"dark":"light";return d.useEffect(()=>{z()},[]),c.jsx(j.Toaster,{theme:o,className:"toaster group",icons:{success:c.jsx(i.HugeiconsIcon,{icon:l.CheckmarkCircle02Icon,strokeWidth:2,className:"size-4 text-success toast-icon-success"}),info:c.jsx(i.HugeiconsIcon,{icon:l.InformationCircleIcon,strokeWidth:2,className:"size-4 text-info toast-icon-info"}),warning:c.jsx(i.HugeiconsIcon,{icon:l.Alert02Icon,strokeWidth:2,className:"size-4 text-warning toast-icon-warning"}),error:c.jsx(i.HugeiconsIcon,{icon:l.MultiplicationSignCircleIcon,strokeWidth:2,className:"size-4 text-destructive toast-icon-error"}),loading:c.jsx(i.HugeiconsIcon,{icon:l.Loading03Icon,strokeWidth:2,className:"size-4 text-primary toast-icon-loading animate-spin"})},style:{"--normal-bg":"var(--foreground)","--normal-text":"var(--background)","--normal-border":"color-mix(in oklch, var(--background) 25%, transparent)","--border-radius":"9999px","--success-bg":"var(--success)","--success-text":"var(--success-foreground)","--success-border":"var(--success-400)","--error-bg":"var(--destructive)","--error-text":"var(--destructive-foreground)","--error-border":"var(--danger-400)","--warning-bg":"var(--warning)","--warning-text":"var(--warning-foreground)","--warning-border":"var(--warning-400)","--info-bg":"var(--info)","--info-text":"var(--info-foreground)","--info-border":"var(--info-400)"},toastOptions:{classNames:{toast:"cn-toast",success:"toast-success",error:"toast-error",warning:"toast-warning",info:"toast-info",loading:"toast-loading"}},...t})};g.displayName="Toaster";const H=g,_=g;exports.EnhancedSonner=_;exports.EnhancedToaster=H;exports.Toaster=g;exports.z=k;
48
+ `,document.head.appendChild(t)}const p=({...t})=>{const{theme:r="light"}=k(),o=r==="dark"?"dark":"light";return d.useEffect(()=>{z()},[]),c.jsx(j.Toaster,{theme:o,className:"toaster group",icons:{success:c.jsx(i.HugeiconsIcon,{icon:l.CheckmarkCircle02Icon,strokeWidth:2,className:"size-4 text-success toast-icon-success"}),info:c.jsx(i.HugeiconsIcon,{icon:l.InformationCircleIcon,strokeWidth:2,className:"size-4 text-info toast-icon-info"}),warning:c.jsx(i.HugeiconsIcon,{icon:l.Alert02Icon,strokeWidth:2,className:"size-4 text-warning toast-icon-warning"}),error:c.jsx(i.HugeiconsIcon,{icon:l.MultiplicationSignCircleIcon,strokeWidth:2,className:"size-4 text-destructive toast-icon-error"}),loading:c.jsx(i.HugeiconsIcon,{icon:l.Loading03Icon,strokeWidth:2,className:"size-4 text-primary toast-icon-loading animate-spin"})},style:{"--normal-bg":"var(--foreground)","--normal-text":"var(--background)","--normal-border":"color-mix(in oklch, var(--background) 25%, transparent)","--border-radius":"9999px","--success-bg":"var(--success)","--success-text":"var(--success-foreground)","--success-border":"var(--success-400)","--error-bg":"var(--destructive)","--error-text":"var(--destructive-foreground)","--error-border":"var(--danger-400)","--warning-bg":"var(--warning)","--warning-text":"var(--warning-foreground)","--warning-border":"var(--warning-400)","--info-bg":"var(--info)","--info-text":"var(--info-foreground)","--info-border":"var(--info-400)"},toastOptions:{classNames:{toast:"cn-toast",success:"toast-success",error:"toast-error",warning:"toast-warning",info:"toast-info",loading:"toast-loading"}},...t})};p.displayName="Toaster";const H=p,_=p;exports.EnhancedSonner=_;exports.EnhancedToaster=H;exports.Toaster=p;exports.z=k;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./sonner-CEx2-yKh.cjs");exports.CoreToaster=e.Toaster;exports.EnhancedSonner=e.EnhancedSonner;exports.EnhancedToaster=e.EnhancedToaster;exports.Toaster=e.Toaster;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./sonner-CP8np0BP.cjs");exports.CoreToaster=e.Toaster;exports.EnhancedSonner=e.EnhancedSonner;exports.EnhancedToaster=e.EnhancedToaster;exports.Toaster=e.Toaster;
package/dist/sonner.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { T as o, E as r, a as s, T as n } from "./sonner-FXwPWWq8.js";
1
+ import { T as o, E as r, a as s, T as n } from "./sonner-C1ndgVQY.js";
2
2
  export {
3
3
  o as CoreToaster,
4
4
  r as EnhancedSonner,
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 mid: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 light: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 mid: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 light: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 mid: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 light: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,7 +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
+ /* Non-dark themes — .light (warm paper) and .mid (dimmer neutral); both use light: utilities */
79
79
  /* Hit-area — https://bazza.dev/craft/2026/hit-area */
80
80
  /* Bazza hit-area utilities — https://bazza.dev/craft/2026/hit-area */
81
81
 
@@ -785,12 +785,12 @@
785
785
  ============================================ */
786
786
 
787
787
  /*
788
- * Non-dark surfaces = /* ============================================
788
+ * Non-dark surfaces: /* ============================================
789
789
  nqui Color System & Design Tokens
790
790
  ============================================ */
791
791
 
792
- :root (mid / warm paper). Dark = .dark. Two theme classes only: mid | dark.
793
- * The .mid class matches :root tokens and enables the mid: Tailwind variant.
792
+ :root + html.light = warm paper; html.mid = separate token block (showcase / comparison).
793
+ * Dark = .dark. Showcase app uses next-themes classes light | mid | dark.
794
794
  */
795
795
  :root {
796
796
  /* ============================================
@@ -952,7 +952,7 @@
952
952
  --z-debug: 9999;
953
953
 
954
954
  /* Color system variables from colors.css */
955
- /* Primary scale — midpoint between classic light and dark (former .mid-only override) */
955
+ /* Primary scale — midpoint between classic light and dark (blue hue 240) */
956
956
  --primary-100: oklch(0.675 0.115 240);
957
957
  --primary-200: oklch(0.675 0.14 240);
958
958
  --primary-300: oklch(0.675 0.16 240);
@@ -961,7 +961,7 @@
961
961
  --primary-600: oklch(0.6 0.25 240);
962
962
 
963
963
  /* ============================================
964
- Semantic Color Scales — classic light (same as before when .mid only changed primary)
964
+ Semantic Color Scales — classic light (success / warning / danger / info)
965
965
  ============================================ */
966
966
 
967
967
  /* Success Color Scale (Light Mode) - Green (Hue 142) */
@@ -997,7 +997,7 @@
997
997
  --info-600: oklch(0.50 0.18 200);
998
998
 
999
999
  /* ============================================
1000
- System Color Mappings — system default uses mid primary + light semantic scales
1000
+ System Color Mappings — system default uses primary scale + light semantic scales
1001
1001
  ============================================ */
1002
1002
 
1003
1003
  --primary: var(--primary-500);
@@ -1018,7 +1018,7 @@
1018
1018
  --info-foreground: oklch(0.98 0 0);
1019
1019
 
1020
1020
  /* Additional variables from index.css */
1021
- /* Mid / system UI — warm paper (former .mid block) */
1021
+ /* Light / system UI — warm paper */
1022
1022
  --background: oklch(0.985 0.002 78);
1023
1023
  --foreground: oklch(0.2416 0.0219 57);
1024
1024
  --card: oklch(0.9792 0.0042 78.3);
@@ -1055,6 +1055,41 @@
1055
1055
  --sidebar-ring: var(--ring);
1056
1056
  }
1057
1057
 
1058
+ /* Mid — between warm paper and dark (neutral, slightly dimmer than light) */
1059
+ .mid {
1060
+ --background: oklch(0.915 0.01 78);
1061
+ --foreground: oklch(0.28 0.022 57);
1062
+ --card: oklch(0.895 0.012 78);
1063
+ --card-foreground: oklch(0.28 0.022 57);
1064
+ --popover: oklch(0.895 0.012 78);
1065
+ --popover-foreground: oklch(0.28 0.022 57);
1066
+ --secondary: oklch(0.88 0.012 73);
1067
+ --secondary-foreground: oklch(0.32 0.028 57);
1068
+ --muted: oklch(0.855 0.012 73);
1069
+ --muted-foreground: oklch(0.48 0.024 58);
1070
+ --accent: oklch(0.87 0.014 73);
1071
+ --accent-foreground: oklch(0.28 0.022 57);
1072
+ --border: oklch(0.82 0.016 73);
1073
+ --input: oklch(0.82 0.016 73);
1074
+
1075
+ --chart-1: oklch(0.809 0.105 251.813);
1076
+ --chart-2: oklch(0.623 0.214 259.815);
1077
+ --chart-3: oklch(0.546 0.245 262.881);
1078
+ --chart-4: oklch(0.488 0.243 264.376);
1079
+ --chart-5: oklch(0.424 0.199 265.638);
1080
+
1081
+ --radius: 0.45rem;
1082
+
1083
+ --sidebar: oklch(0.9 0.01 78);
1084
+ --sidebar-foreground: oklch(0.28 0.022 57);
1085
+ --sidebar-primary: var(--primary);
1086
+ --sidebar-primary-foreground: var(--primary-foreground);
1087
+ --sidebar-accent: oklch(0.875 0.012 75);
1088
+ --sidebar-accent-foreground: oklch(0.26 0.018 55);
1089
+ --sidebar-border: oklch(0.82 0.016 73);
1090
+ --sidebar-ring: var(--ring);
1091
+ }
1092
+
1058
1093
  .dark {
1059
1094
  /* ============================================
1060
1095
  Primary Color Scale - Dark Mode
@@ -1165,6 +1200,6 @@
1165
1200
  }
1166
1201
 
1167
1202
  /*
1168
- * .midsame token values as :root (system default). Kept for next-themes
1169
- * (theme="mid") and the mid: Tailwind variant; no duplicate variable definitions.
1203
+ * html.lightnext-themes; surface tokens match :root (warm paper).
1204
+ * html.mid next-themes; surfaces use .mid block above (distinct from light).
1170
1205
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nqlib/nqui",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
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",
@@ -33,9 +33,9 @@ export default function RootLayout({
33
33
  <body>
34
34
  <ThemeProvider
35
35
  attribute="class"
36
- defaultTheme="mid"
36
+ defaultTheme="light"
37
37
  enableSystem={false}
38
- themes={["mid", "dark"]}
38
+ themes={["light", "dark"]}
39
39
  disableTransitionOnChange
40
40
  >
41
41
  <SidebarProvider defaultOpen>
@@ -19,9 +19,9 @@ export default function RootLayout({
19
19
  <body>
20
20
  <ThemeProvider
21
21
  attribute="class"
22
- defaultTheme="mid"
22
+ defaultTheme="light"
23
23
  enableSystem={false}
24
- themes={["mid", "dark"]}
24
+ themes={["light", "dark"]}
25
25
  disableTransitionOnChange
26
26
  >
27
27
  {children}
@@ -10,9 +10,9 @@ createRoot(document.getElementById("root")!).render(
10
10
  <StrictMode>
11
11
  <ThemeProvider
12
12
  attribute="class"
13
- defaultTheme="mid"
13
+ defaultTheme="light"
14
14
  enableSystem={false}
15
- themes={["mid", "dark"]}
15
+ themes={["light", "dark"]}
16
16
  disableTransitionOnChange
17
17
  >
18
18
  <BrowserRouter>