@caratlogic/design-system 0.1.2 → 0.1.4

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,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import * as SlideOutPrimitive from '@radix-ui/react-dialog';
3
- declare const SlideOut: React.FC<SlideOutPrimitive.DialogProps>;
3
+ declare const SlideOut: ({ open, onOpenChange, ...props }: React.ComponentProps<typeof SlideOutPrimitive.Root>) => React.ReactElement;
4
4
  declare const SlideOutTrigger: React.ForwardRefExoticComponent<SlideOutPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
5
  declare const SlideOutClose: React.ForwardRefExoticComponent<SlideOutPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
6
6
  declare const SlideOutPortal: React.FC<SlideOutPrimitive.DialogPortalProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"SlideOut.parts.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/SlideOut/SlideOut.parts.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAC;AAG5D,QAAA,MAAM,QAAQ,yCAAyB,CAAC;AACxC,QAAA,MAAM,eAAe,gHAA4B,CAAC;AAClD,QAAA,MAAM,aAAa,8GAA0B,CAAC;AAC9C,QAAA,MAAM,cAAc,+CAA2B,CAAC;AAGhD,QAAA,MAAM,eAAe,gKASnB,CAAC;AAiBH,QAAA,MAAM,eAAe;uBAGE,MAAM;WAClB,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ;wCAiB5C,CAAC;AAIH,QAAA,MAAM,cAAc;8BAGjB,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAQtC,CAAC;AAIF,QAAA,MAAM,aAAa,sKASjB,CAAC;AAIH,QAAA,MAAM,mBAAmB,gLASvB,CAAC;AAGH,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa,EACb,cAAc,EACd,eAAe,EACf,eAAe,EACf,cAAc,EACd,aAAa,EACb,mBAAmB,GACpB,CAAC"}
1
+ {"version":3,"file":"SlideOut.parts.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/SlideOut/SlideOut.parts.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAC;AAI5D,QAAA,MAAM,QAAQ,GAAI,kCAIf,KAAK,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,KAAG,KAAK,CAAC,YAY9D,CAAC;AACF,QAAA,MAAM,eAAe,gHAA4B,CAAC;AAClD,QAAA,MAAM,aAAa,8GAA0B,CAAC;AAC9C,QAAA,MAAM,cAAc,+CAA2B,CAAC;AAGhD,QAAA,MAAM,eAAe,gKASnB,CAAC;AAiBH,QAAA,MAAM,eAAe;uBAGE,MAAM;WAClB,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ;wCAiB5C,CAAC;AAIH,QAAA,MAAM,cAAc;8BAGjB,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAQtC,CAAC;AAIF,QAAA,MAAM,aAAa,sKASjB,CAAC;AAIH,QAAA,MAAM,mBAAmB,gLASvB,CAAC;AAGH,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa,EACb,cAAc,EACd,eAAe,EACf,eAAe,EACf,cAAc,EACd,aAAa,EACb,mBAAmB,GACpB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import * as DialogPrimitive from '@radix-ui/react-dialog';
3
- declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
3
+ declare function Dialog({ open, onOpenChange, ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.ReactElement;
4
4
  declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
5
  declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
6
6
  declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAM1D,iBAAS,MAAM,CAAC,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CAEnD;AAGD,iBAAS,aAAa,CAAC,EACrB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,2CAEtD;AAGD,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,2CAErD;AAGD,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAEpD;AAGD,QAAA,MAAM,aAAa,8JAejB,CAAC;AAIH,UAAU,kBAAmB,SAAQ,KAAK,CAAC,wBAAwB,CACjE,OAAO,eAAe,CAAC,OAAO,CAC/B;IACC,iFAAiF;IACjF,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,QAAA,MAAM,aAAa,2FAqCjB,CAAC;AAIH,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQzE;AAGD,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWzE;AAGD,QAAA,MAAM,WAAW,oKAUf,CAAC;AAIH,QAAA,MAAM,iBAAiB,8KAUrB,CAAC;AAIH,OAAO,EACL,MAAM,EACN,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa,EACb,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,CAAC"}
1
+ {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAO1D,iBAAS,MAAM,CAAC,EACd,IAAI,EACJ,YAAY,EACZ,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,YAAY,CAaxE;AAGD,iBAAS,aAAa,CAAC,EACrB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,2CAEtD;AAGD,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,2CAErD;AAGD,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAEpD;AAGD,QAAA,MAAM,aAAa,8JAejB,CAAC;AAIH,UAAU,kBAAmB,SAAQ,KAAK,CAAC,wBAAwB,CACjE,OAAO,eAAe,CAAC,OAAO,CAC/B;IACC,iFAAiF;IACjF,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,QAAA,MAAM,aAAa,2FAqCjB,CAAC;AAIH,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQzE;AAGD,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWzE;AAGD,QAAA,MAAM,WAAW,oKAUf,CAAC;AAIH,QAAA,MAAM,iBAAiB,8KAUrB,CAAC;AAIH,OAAO,EACL,MAAM,EACN,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa,EACb,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Clears a leaked Radix `<body>` lock after an overlay closes or unmounts.
3
+ * Returns a scheduler for overlays that are uncontrolled (no `open` prop), so
4
+ * their `onOpenChange(false)` can trigger the same check.
5
+ *
6
+ * @see releaseStaleOverlayBodyLock for why the lock leaks.
7
+ */
8
+ export declare function useOverlayBodyLockRelease(open?: boolean): () => void;
9
+ //# sourceMappingURL=useOverlayBodyLockRelease.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOverlayBodyLockRelease.d.ts","sourceRoot":"","sources":["../../src/hooks/useOverlayBodyLockRelease.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,IAAI,CA0BpE"}
package/dist/index.cjs.js CHANGED
@@ -4356,6 +4356,40 @@ const notify = {
4356
4356
  promise: sonner.toast.promise.bind(sonner.toast),
4357
4357
  };
4358
4358
 
4359
+ const OVERLAY_CONTENT_SELECTOR = [
4360
+ '[data-slot="dialog-content"]',
4361
+ '[role="dialog"]',
4362
+ '[role="alertdialog"]',
4363
+ '[role="menu"]',
4364
+ '[role="listbox"]',
4365
+ '[data-radix-popper-content-wrapper]',
4366
+ ].join(',');
4367
+ /**
4368
+ * `@radix-ui/react-dismissable-layer` keeps the value it must restore to
4369
+ * `<body>` in a single module-level variable shared by every layer. When two
4370
+ * layers overlap — a modal menu whose item opens a dialog, a select inside a
4371
+ * dialog — the second layer saves `pointer-events: none` and its close writes
4372
+ * that back instead of clearing it, leaving the page unclickable until reload.
4373
+ *
4374
+ * Clearing is only safe once nothing is on screen, so this is a no-op while any
4375
+ * overlay content is still mounted.
4376
+ */
4377
+ function releaseStaleOverlayBodyLock() {
4378
+ if (typeof document === 'undefined')
4379
+ return;
4380
+ if (document.querySelector(OVERLAY_CONTENT_SELECTOR))
4381
+ return;
4382
+ const { body } = document;
4383
+ if (body.style.pointerEvents === 'none') {
4384
+ body.style.pointerEvents = '';
4385
+ }
4386
+ if (body.hasAttribute('data-scroll-locked')) {
4387
+ body.removeAttribute('data-scroll-locked');
4388
+ body.style.overflow = '';
4389
+ body.style.paddingRight = '';
4390
+ }
4391
+ }
4392
+
4359
4393
  const TooltipProvider = ({ children, delayDuration = 200, }) => (jsxRuntime.jsx(TooltipPrimitive__namespace.Provider, { delayDuration: delayDuration, children: children }));
4360
4394
  const Tooltip = TooltipPrimitive__namespace.Root;
4361
4395
  const TooltipTrigger = TooltipPrimitive__namespace.Trigger;
@@ -5721,10 +5755,50 @@ var U=1,Y$1=.9,H$1=.8,J=.17,p=.1,u=.999,$$1=.9999;var k$2=.99,m$1=/[\\\/_+.#"@\[
5721
5755
 
5722
5756
  var N$1='[cmdk-group=""]',Y='[cmdk-group-items=""]',be='[cmdk-group-heading=""]',le='[cmdk-item=""]',ce=`${le}:not([aria-disabled="true"])`,Z="cmdk-item-select",T="data-value",Re=(r,o,n)=>W(r,o,n),ue=React__namespace.createContext(void 0),K=()=>React__namespace.useContext(ue),de=React__namespace.createContext(void 0),ee=()=>React__namespace.useContext(de),fe=React__namespace.createContext(void 0),me=React__namespace.forwardRef((r,o)=>{let n=L$1(()=>{var e,a;return {search:"",value:(a=(e=r.value)!=null?e:r.defaultValue)!=null?a:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),u=L$1(()=>new Set),c=L$1(()=>new Map),d=L$1(()=>new Map),f=L$1(()=>new Set),p=pe(r),{label:b,children:m,value:R,onValueChange:x,filter:C,shouldFilter:S,loop:A,disablePointerSelection:ge=false,vimBindings:j=true,...O}=r,$=reactId.useId(),q=reactId.useId(),_=reactId.useId(),I=React__namespace.useRef(null),v=ke();k$1(()=>{if(R!==void 0){let e=R.trim();n.current.value=e,E.emit();}},[R]),k$1(()=>{v(6,ne);},[]);let E=React__namespace.useMemo(()=>({subscribe:e=>(f.current.add(e),()=>f.current.delete(e)),snapshot:()=>n.current,setState:(e,a,s)=>{var i,l,g,y;if(!Object.is(n.current[e],a)){if(n.current[e]=a,e==="search")J(),z(),v(1,W);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let h=document.getElementById(_);h?h.focus():(i=document.getElementById($))==null||i.focus();}if(v(7,()=>{var h;n.current.selectedItemId=(h=M())==null?void 0:h.id,E.emit();}),s||v(5,ne),((l=p.current)==null?void 0:l.value)!==void 0){let h=a!=null?a:"";(y=(g=p.current).onValueChange)==null||y.call(g,h);return}}E.emit();}},emit:()=>{f.current.forEach(e=>e());}}),[]),U=React__namespace.useMemo(()=>({value:(e,a,s)=>{var i;a!==((i=d.current.get(e))==null?void 0:i.value)&&(d.current.set(e,{value:a,keywords:s}),n.current.filtered.items.set(e,te(a,s)),v(2,()=>{z(),E.emit();}));},item:(e,a)=>(u.current.add(e),a&&(c.current.has(a)?c.current.get(a).add(e):c.current.set(a,new Set([e]))),v(3,()=>{J(),z(),n.current.value||W(),E.emit();}),()=>{d.current.delete(e),u.current.delete(e),n.current.filtered.items.delete(e);let s=M();v(4,()=>{J(),(s==null?void 0:s.getAttribute("id"))===e&&W(),E.emit();});}),group:e=>(c.current.has(e)||c.current.set(e,new Set),()=>{d.current.delete(e),c.current.delete(e);}),filter:()=>p.current.shouldFilter,label:b||r["aria-label"],getDisablePointerSelection:()=>p.current.disablePointerSelection,listId:$,inputId:_,labelId:q,listInnerRef:I}),[]);function te(e,a){var i,l;let s=(l=(i=p.current)==null?void 0:i.filter)!=null?l:Re;return e?s(e,n.current.search,a):0}function z(){if(!n.current.search||p.current.shouldFilter===false)return;let e=n.current.filtered.items,a=[];n.current.filtered.groups.forEach(i=>{let l=c.current.get(i),g=0;l.forEach(y=>{let h=e.get(y);g=Math.max(h,g);}),a.push([i,g]);});let s=I.current;V().sort((i,l)=>{var h,F;let g=i.getAttribute("id"),y=l.getAttribute("id");return ((h=e.get(y))!=null?h:0)-((F=e.get(g))!=null?F:0)}).forEach(i=>{let l=i.closest(Y);l?l.appendChild(i.parentElement===l?i:i.closest(`${Y} > *`)):s.appendChild(i.parentElement===s?i:i.closest(`${Y} > *`));}),a.sort((i,l)=>l[1]-i[1]).forEach(i=>{var g;let l=(g=I.current)==null?void 0:g.querySelector(`${N$1}[${T}="${encodeURIComponent(i[0])}"]`);l==null||l.parentElement.appendChild(l);});}function W(){let e=V().find(s=>s.getAttribute("aria-disabled")!=="true"),a=e==null?void 0:e.getAttribute(T);E.setState("value",a||void 0);}function J(){var a,s,i,l;if(!n.current.search||p.current.shouldFilter===false){n.current.filtered.count=u.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let g of u.current){let y=(s=(a=d.current.get(g))==null?void 0:a.value)!=null?s:"",h=(l=(i=d.current.get(g))==null?void 0:i.keywords)!=null?l:[],F=te(y,h);n.current.filtered.items.set(g,F),F>0&&e++;}for(let[g,y]of c.current)for(let h of y)if(n.current.filtered.items.get(h)>0){n.current.filtered.groups.add(g);break}n.current.filtered.count=e;}function ne(){var a,s,i;let e=M();e&&(((a=e.parentElement)==null?void 0:a.firstChild)===e&&((i=(s=e.closest(N$1))==null?void 0:s.querySelector(be))==null||i.scrollIntoView({block:"nearest"})),e.scrollIntoView({block:"nearest"}));}function M(){var e;return (e=I.current)==null?void 0:e.querySelector(`${le}[aria-selected="true"]`)}function V(){var e;return Array.from(((e=I.current)==null?void 0:e.querySelectorAll(ce))||[])}function X(e){let s=V()[e];s&&E.setState("value",s.getAttribute(T));}function Q(e){var g;let a=M(),s=V(),i=s.findIndex(y=>y===a),l=s[i+e];(g=p.current)!=null&&g.loop&&(l=i+e<0?s[s.length-1]:i+e===s.length?s[0]:s[i+e]),l&&E.setState("value",l.getAttribute(T));}function re(e){let a=M(),s=a==null?void 0:a.closest(N$1),i;for(;s&&!i;)s=e>0?we(s,N$1):De(s,N$1),i=s==null?void 0:s.querySelector(ce);i?E.setState("value",i.getAttribute(T)):Q(e);}let oe=()=>X(V().length-1),ie=e=>{e.preventDefault(),e.metaKey?oe():e.altKey?re(1):Q(1);},se=e=>{e.preventDefault(),e.metaKey?X(0):e.altKey?re(-1):Q(-1);};return React__namespace.createElement(reactPrimitive.Primitive.div,{ref:o,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var s;(s=O.onKeyDown)==null||s.call(O,e);let a=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||a))switch(e.key){case "n":case "j":{j&&e.ctrlKey&&ie(e);break}case "ArrowDown":{ie(e);break}case "p":case "k":{j&&e.ctrlKey&&se(e);break}case "ArrowUp":{se(e);break}case "Home":{e.preventDefault(),X(0);break}case "End":{e.preventDefault(),oe();break}case "Enter":{e.preventDefault();let i=M();if(i){let l=new Event(Z);i.dispatchEvent(l);}}}}},React__namespace.createElement("label",{"cmdk-label":"",htmlFor:U.inputId,id:U.labelId,style:Te},b),B$1(r,e=>React__namespace.createElement(de.Provider,{value:E},React__namespace.createElement(ue.Provider,{value:U},e))))}),he=React__namespace.forwardRef((r,o)=>{var _,I;let n=reactId.useId(),u=React__namespace.useRef(null),c=React__namespace.useContext(fe),d=K(),f=pe(r),p=(I=(_=f.current)==null?void 0:_.forceMount)!=null?I:c==null?void 0:c.forceMount;k$1(()=>{if(!p)return d.item(n,c==null?void 0:c.id)},[p]);let b=ve(n,u,[r.value,r.children,u],r.keywords),m=ee(),R=P(v=>v.value&&v.value===b.current),x=P(v=>p||d.filter()===false?true:v.search?v.filtered.items.get(n)>0:true);React__namespace.useEffect(()=>{let v=u.current;if(!(!v||r.disabled))return v.addEventListener(Z,C),()=>v.removeEventListener(Z,C)},[x,r.onSelect,r.disabled]);function C(){var v,E;S(),(E=(v=f.current).onSelect)==null||E.call(v,b.current);}function S(){m.setState("value",b.current,true);}if(!x)return null;let{disabled:A,value:ge,onSelect:j,forceMount:O,keywords:$,...q}=r;return React__namespace.createElement(reactPrimitive.Primitive.div,{ref:reactComposeRefs.composeRefs(u,o),...q,id:n,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!R,"data-disabled":!!A,"data-selected":!!R,onPointerMove:A||d.getDisablePointerSelection()?void 0:S,onClick:A?void 0:C},r.children)}),Ee=React__namespace.forwardRef((r,o)=>{let{heading:n,children:u,forceMount:c,...d}=r,f=reactId.useId(),p=React__namespace.useRef(null),b=React__namespace.useRef(null),m=reactId.useId(),R=K(),x=P(S=>c||R.filter()===false?true:S.search?S.filtered.groups.has(f):true);k$1(()=>R.group(f),[]),ve(f,p,[r.value,r.heading,b]);let C=React__namespace.useMemo(()=>({id:f,forceMount:c}),[c]);return React__namespace.createElement(reactPrimitive.Primitive.div,{ref:reactComposeRefs.composeRefs(p,o),...d,"cmdk-group":"",role:"presentation",hidden:x?void 0:true},n&&React__namespace.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":true,id:m},n),B$1(r,S=>React__namespace.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?m:void 0},React__namespace.createElement(fe.Provider,{value:C},S))))}),ye=React__namespace.forwardRef((r,o)=>{let{alwaysRender:n,...u}=r,c=React__namespace.useRef(null),d=P(f=>!f.search);return !n&&!d?null:React__namespace.createElement(reactPrimitive.Primitive.div,{ref:reactComposeRefs.composeRefs(c,o),...u,"cmdk-separator":"",role:"separator"})}),Se=React__namespace.forwardRef((r,o)=>{let{onValueChange:n,...u}=r,c=r.value!=null,d=ee(),f=P(m=>m.search),p=P(m=>m.selectedItemId),b=K();return React__namespace.useEffect(()=>{r.value!=null&&d.setState("search",r.value);},[r.value]),React__namespace.createElement(reactPrimitive.Primitive.input,{ref:o,...u,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:false,"aria-autocomplete":"list",role:"combobox","aria-expanded":true,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":p,id:b.inputId,type:"text",value:c?r.value:f,onChange:m=>{c||d.setState("search",m.target.value),n==null||n(m.target.value);}})}),Ce=React__namespace.forwardRef((r,o)=>{let{children:n,label:u="Suggestions",...c}=r,d=React__namespace.useRef(null),f=React__namespace.useRef(null),p=P(m=>m.selectedItemId),b=K();return React__namespace.useEffect(()=>{if(f.current&&d.current){let m=f.current,R=d.current,x,C=new ResizeObserver(()=>{x=requestAnimationFrame(()=>{let S=m.offsetHeight;R.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px");});});return C.observe(m),()=>{cancelAnimationFrame(x),C.unobserve(m);}}},[]),React__namespace.createElement(reactPrimitive.Primitive.div,{ref:reactComposeRefs.composeRefs(d,o),...c,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":p,"aria-label":u,id:b.listId},B$1(r,m=>React__namespace.createElement("div",{ref:reactComposeRefs.composeRefs(f,b.listInnerRef),"cmdk-list-sizer":""},m)))}),xe=React__namespace.forwardRef((r,o)=>{let{open:n,onOpenChange:u,overlayClassName:c,contentClassName:d,container:f,...p}=r;return React__namespace.createElement(DialogPrimitive__namespace.Root,{open:n,onOpenChange:u},React__namespace.createElement(DialogPrimitive__namespace.Portal,{container:f},React__namespace.createElement(DialogPrimitive__namespace.Overlay,{"cmdk-overlay":"",className:c}),React__namespace.createElement(DialogPrimitive__namespace.Content,{"aria-label":r.label,"cmdk-dialog":"",className:d},React__namespace.createElement(me,{ref:o,...p}))))}),Ie=React__namespace.forwardRef((r,o)=>P(u=>u.filtered.count===0)?React__namespace.createElement(reactPrimitive.Primitive.div,{ref:o,...r,"cmdk-empty":"",role:"presentation"}):null),Pe=React__namespace.forwardRef((r,o)=>{let{progress:n,children:u,label:c="Loading...",...d}=r;return React__namespace.createElement(reactPrimitive.Primitive.div,{ref:o,...d,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":c},B$1(r,f=>React__namespace.createElement("div",{"aria-hidden":true},f)))}),_e=Object.assign(me,{List:Ce,Item:he,Input:Se,Group:Ee,Separator:ye,Dialog:xe,Empty:Ie,Loading:Pe});function we(r,o){let n=r.nextElementSibling;for(;n;){if(n.matches(o))return n;n=n.nextElementSibling;}}function De(r,o){let n=r.previousElementSibling;for(;n;){if(n.matches(o))return n;n=n.previousElementSibling;}}function pe(r){let o=React__namespace.useRef(r);return k$1(()=>{o.current=r;}),o}var k$1=typeof window=="undefined"?React__namespace.useEffect:React__namespace.useLayoutEffect;function L$1(r){let o=React__namespace.useRef();return o.current===void 0&&(o.current=r()),o}function P(r){let o=ee(),n=()=>r(o.snapshot());return React__namespace.useSyncExternalStore(o.subscribe,n,n)}function ve(r,o,n,u=[]){let c=React__namespace.useRef(),d=K();return k$1(()=>{var b;let f=(()=>{var m;for(let R of n){if(typeof R=="string")return R.trim();if(typeof R=="object"&&"current"in R)return R.current?(m=R.current.textContent)==null?void 0:m.trim():c.current}})(),p=u.map(m=>m.trim());d.value(r,f,p),(b=o.current)==null||b.setAttribute(T,f),c.current=f;}),c}var ke=()=>{let[r,o]=React__namespace.useState(),n=L$1(()=>new Map);return k$1(()=>{n.current.forEach(u=>u()),n.current=new Map;},[r]),(u,c)=>{n.current.set(u,c),o({});}};function Me(r){let o=r.type;return typeof o=="function"?o(r.props):"render"in o?o.render(r.props):r}function B$1({asChild:r,children:o},n){return r&&React__namespace.isValidElement(o)?React__namespace.cloneElement(Me(o),{ref:o.ref},n(o.props.children)):n(o)}var Te={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};
5723
5757
 
5758
+ /** Long enough for the overlay exit animation (200ms) plus a margin. */
5759
+ const EXIT_GRACE_MS = 400;
5760
+ /**
5761
+ * Clears a leaked Radix `<body>` lock after an overlay closes or unmounts.
5762
+ * Returns a scheduler for overlays that are uncontrolled (no `open` prop), so
5763
+ * their `onOpenChange(false)` can trigger the same check.
5764
+ *
5765
+ * @see releaseStaleOverlayBodyLock for why the lock leaks.
5766
+ */
5767
+ function useOverlayBodyLockRelease(open) {
5768
+ const scheduleRelease = React__namespace.useCallback(() => {
5769
+ requestAnimationFrame(() => releaseStaleOverlayBodyLock());
5770
+ window.setTimeout(() => releaseStaleOverlayBodyLock(), EXIT_GRACE_MS);
5771
+ }, []);
5772
+ const wasOpen = React__namespace.useRef(false);
5773
+ React__namespace.useEffect(() => {
5774
+ if (open) {
5775
+ wasOpen.current = true;
5776
+ return;
5777
+ }
5778
+ if (!wasOpen.current)
5779
+ return;
5780
+ wasOpen.current = false;
5781
+ scheduleRelease();
5782
+ }, [open, scheduleRelease]);
5783
+ // Unmounting while open (route change, parent re-render) skips Radix's own
5784
+ // close path entirely, so the check has to outlive this component.
5785
+ React__namespace.useEffect(() => {
5786
+ return () => {
5787
+ window.setTimeout(() => releaseStaleOverlayBodyLock(), EXIT_GRACE_MS);
5788
+ };
5789
+ }, []);
5790
+ return scheduleRelease;
5791
+ }
5792
+
5724
5793
  // Utility to merge classes
5725
5794
  // Root
5726
- function Dialog({ ...props }) {
5727
- return jsxRuntime.jsx(DialogPrimitive__namespace.Root, { "data-slot": "dialog", ...props });
5795
+ function Dialog({ open, onOpenChange, ...props }) {
5796
+ const scheduleLockRelease = useOverlayBodyLockRelease(open);
5797
+ return (jsxRuntime.jsx(DialogPrimitive__namespace.Root, { "data-slot": "dialog", ...props, open: open, onOpenChange: (next) => {
5798
+ onOpenChange?.(next);
5799
+ if (!next)
5800
+ scheduleLockRelease();
5801
+ } }));
5728
5802
  }
5729
5803
  // Portal
5730
5804
  function DialogPortal({ ...props }) {
@@ -57470,7 +57544,14 @@ function DetailPageSkeleton({ sections = 3, }) {
57470
57544
  return (jsxRuntime.jsxs("div", { className: "space-y-5", children: [jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-4", children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [jsxRuntime.jsx(SquareSkeleton, { height: 32, width: 32, rounded: "md" }), jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [jsxRuntime.jsx(SquareSkeleton, { height: 20, width: 192, rounded: "full" }), jsxRuntime.jsx(SquareSkeleton, { height: 12, width: 128, rounded: "full" })] })] }), jsxRuntime.jsx(SquareSkeleton, { height: 36, width: 128, rounded: "md" })] }), Array.from({ length: sections }).map((_, s) => (jsxRuntime.jsxs("div", { className: "overflow-hidden rounded-xl border border-border bg-card", children: [jsxRuntime.jsxs("div", { className: "flex items-center gap-3 border-b border-border bg-secondary px-5 py-4", children: [jsxRuntime.jsx(SquareSkeleton, { height: 32, width: 32, rounded: "lg" }), jsxRuntime.jsx(SquareSkeleton, { height: 16, width: 160, rounded: "full" })] }), jsxRuntime.jsx("div", { className: "grid grid-cols-1 gap-5 p-5 md:grid-cols-3", children: Array.from({ length: 6 }).map((_, i) => (jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [jsxRuntime.jsx(SquareSkeleton, { height: 10, width: 80, rounded: "full" }), jsxRuntime.jsx(SquareSkeleton, { height: 14, width: 128, rounded: "full" })] }, i))) })] }, s)))] }));
57471
57545
  }
57472
57546
 
57473
- const SlideOut = DialogPrimitive__namespace.Root;
57547
+ const SlideOut = ({ open, onOpenChange, ...props }) => {
57548
+ const scheduleLockRelease = useOverlayBodyLockRelease(open);
57549
+ return (jsxRuntime.jsx(DialogPrimitive__namespace.Root, { ...props, open: open, onOpenChange: (next) => {
57550
+ onOpenChange?.(next);
57551
+ if (!next)
57552
+ scheduleLockRelease();
57553
+ } }));
57554
+ };
57474
57555
  const SlideOutTrigger = DialogPrimitive__namespace.Trigger;
57475
57556
  const SlideOutClose = DialogPrimitive__namespace.Close;
57476
57557
  const SlideOutPortal = DialogPrimitive__namespace.Portal;
@@ -65542,7 +65623,7 @@ const ShellHeader = ({ pageMeta, breadcrumbLeafOverride, user, profileMenuItems,
65542
65623
  const breadcrumb = resolveBreadcrumb(pageMeta, breadcrumbLeafOverride);
65543
65624
  return (jsxRuntime.jsxs(Navbar, { "aria-label": "Top navigation", children: [jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [isMobile && jsxRuntime.jsx(SidebarTrigger, {}), breadcrumb ? (jsxRuntime.jsx(NavbarTitle, { items: breadcrumb })) : (pageMeta?.title && jsxRuntime.jsx(NavbarTitle, { title: pageMeta.title }))] }), jsxRuntime.jsxs(NavbarActions, { gap: "lg", children: [headerActionsSlot, showThemeToggle && (jsxRuntime.jsx(NavbarIconButton, { "aria-label": isDark ? 'Switch to light theme' : 'Switch to dark theme', size: "md", onClick: onToggleTheme, children: isDark ? jsxRuntime.jsx(Sun, { size: 20 }) : jsxRuntime.jsx(Moon, { size: 20 }) })), showNotifications && (jsxRuntime.jsx(NavbarIconButton, { "aria-label": "Notifications", size: "md", indicator: notificationsIndicator || undefined, onClick: onNotificationsClick, children: jsxRuntime.jsx(Bell, { size: 20 }) })), jsxRuntime.jsx(ProfileMenu, { user: user, profileMenuItems: profileMenuItems, onLogout: onLogout })] })] }));
65544
65625
  };
65545
- const DashboardShell = ({ brand, navGroups, currentPath, onNavigate, pageMeta, breadcrumbLeafOverride, user, profileMenuItems, onLogout, showThemeToggle, isDark, onToggleTheme, showNotifications, notificationsIndicator, onNotificationsClick, headerActionsSlot, sidebarWidth, children, }) => (jsxRuntime.jsxs(SidebarProvider, { className: "h-screen min-h-0", style: { '--sidebar-width': sidebarWidth ?? DEFAULT_SIDEBAR_WIDTH }, children: [jsxRuntime.jsx(ShellSidebar, { brand: brand, navGroups: navGroups, currentPath: currentPath, onNavigate: onNavigate }), jsxRuntime.jsxs(SidebarInset, { className: "flex h-screen flex-col overflow-hidden bg-background", children: [jsxRuntime.jsx(ShellHeader, { pageMeta: pageMeta, breadcrumbLeafOverride: breadcrumbLeafOverride, user: user, profileMenuItems: profileMenuItems, onLogout: onLogout, showThemeToggle: showThemeToggle, isDark: isDark, onToggleTheme: onToggleTheme, showNotifications: showNotifications, notificationsIndicator: notificationsIndicator, onNotificationsClick: onNotificationsClick, headerActionsSlot: headerActionsSlot }), jsxRuntime.jsx("main", { className: "flex-1 min-h-0 overflow-y-auto", children: children })] })] }));
65626
+ const DashboardShell = ({ brand, navGroups, currentPath, onNavigate, pageMeta, breadcrumbLeafOverride, user, profileMenuItems, onLogout, showThemeToggle, isDark, onToggleTheme, showNotifications, notificationsIndicator, onNotificationsClick, headerActionsSlot, sidebarWidth, children, }) => (jsxRuntime.jsxs(SidebarProvider, { className: "h-screen min-h-0", style: { '--sidebar-width': sidebarWidth ?? DEFAULT_SIDEBAR_WIDTH }, children: [jsxRuntime.jsx(ShellSidebar, { brand: brand, navGroups: navGroups, currentPath: currentPath, onNavigate: onNavigate }), jsxRuntime.jsxs(SidebarInset, { className: "flex h-screen flex-col overflow-hidden bg-background", children: [jsxRuntime.jsx(ShellHeader, { pageMeta: pageMeta, breadcrumbLeafOverride: breadcrumbLeafOverride, user: user, profileMenuItems: profileMenuItems, onLogout: onLogout, showThemeToggle: showThemeToggle, isDark: isDark, onToggleTheme: onToggleTheme, showNotifications: showNotifications, notificationsIndicator: notificationsIndicator, onNotificationsClick: onNotificationsClick, headerActionsSlot: headerActionsSlot }), jsxRuntime.jsx("main", { className: "flex min-h-0 flex-1 flex-col overflow-y-auto", children: children })] })] }));
65546
65627
 
65547
65628
  function CreateFormPageHeader({ title, onBack, backLabel = 'Go back', }) {
65548
65629
  return (jsxRuntime.jsxs("div", { className: "mb-4 flex items-center justify-between gap-4", children: [jsxRuntime.jsx("h1", { className: "min-w-0 text-xl font-semibold leading-7 text-foreground", children: title }), jsxRuntime.jsx("div", { className: "flex shrink-0 items-center gap-2", children: jsxRuntime.jsxs(Button$1, { type: "button", variant: "ghost", onClick: onBack, className: "h-8 shrink-0 gap-1.5 rounded-lg px-3 py-1.5 text-sm font-medium text-secondary-foreground hover:text-secondary-foreground", children: [jsxRuntime.jsx(ChevronLeft, { className: "h-4 w-4", "aria-hidden": true }), backLabel] }) })] }));
@@ -67739,6 +67820,7 @@ exports.getInitials = getInitials;
67739
67820
  exports.iconButtonVariants = iconButtonVariants;
67740
67821
  exports.isPathActive = isPathActive;
67741
67822
  exports.notify = notify;
67823
+ exports.releaseStaleOverlayBodyLock = releaseStaleOverlayBodyLock;
67742
67824
  exports.renderBadge = renderBadge;
67743
67825
  exports.useAuditShowMore = useAuditShowMore;
67744
67826
  exports.useBadge = useBadge;