@ngrok/mantle 0.89.0 → 0.90.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent.json +1529 -1
- package/dist/alert-DO00UiQe.js +1 -0
- package/dist/{alert-CZYYlx9q.js → alert-ZaUBtgno.js} +1 -1
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/app-layout.d.ts +68 -13
- package/dist/app-layout.js +1 -1
- package/dist/card.d.ts +7 -0
- package/dist/combobox.d.ts +1 -1
- package/dist/command.js +1 -1
- package/dist/{dialog-BDzapPLR.js → dialog-CaGJD02w.js} +1 -1
- package/dist/dialog.js +1 -1
- package/dist/{dropdown-menu-CpRsyt_F.d.ts → dropdown-menu-Cef0Cz2B.d.ts} +1 -1
- package/dist/dropdown-menu-DMA8dGxZ.d.ts +1 -0
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/empty.d.ts +7 -0
- package/dist/flag.d.ts +1 -1
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +251 -1
- package/dist/hooks.js +1 -1
- package/dist/{icons-BMZnm4hM.js → icons-CAtjMNti.js} +1 -1
- package/dist/icons.js +1 -1
- package/dist/input.js +1 -1
- package/dist/llms.txt +117 -2
- package/dist/mantle.css +9 -0
- package/dist/migrations/0002-data-table-action-header.yml +526 -0
- package/dist/migrations/0003-dialog-footer-dom-order.yml +271 -0
- package/dist/migrations/0004-priority-to-intent.yml +1728 -0
- package/dist/migrations/0005-field-item-owns-control-id.yml +234 -0
- package/dist/migrations/0006-data-table-tanstack-v9.yml +423 -0
- package/dist/migrations/0008-tabs-separator.yml +1212 -0
- package/dist/migrations/0009-chart-root-mode.yml +871 -0
- package/dist/multi-select.d.ts +1 -1
- package/dist/multi-select.js +1 -1
- package/dist/pagination.d.ts +1 -1
- package/dist/{primitive-B-6XILB2.js → primitive-AGoxSJBI.js} +1 -1
- package/dist/sandbar.js +1 -1
- package/dist/{select-CxXb3aiC.d.ts → select-DlohFa54.d.ts} +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/{separator-HzGvuD0B.d.ts → separator-BWGjCIl7.d.ts} +7 -0
- package/dist/separator.d.ts +1 -1
- package/dist/{sheet-DND_KjmS.js → sheet-H8zvhSuA.js} +1 -1
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +17 -10
- package/dist/sidebar.js +1 -1
- package/dist/split-button.d.ts +1 -1
- package/dist/strata.d.ts +548 -0
- package/dist/strata.js +1 -0
- package/dist/tabs.d.ts +12 -2
- package/dist/tabs.js +1 -1
- package/dist/theme-6Q65C1Rx.js +1 -0
- package/dist/theme-switcher.d.ts +2 -2
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/truncated-text.d.ts +9 -1
- package/dist/truncated-text.js +1 -1
- package/dist/use-prefers-reduced-motion-DimzRx-M.js +1 -0
- package/dist/use-swipe-to-dismiss-Cj-AayFd.js +1 -0
- package/dist/well.d.ts +7 -0
- package/package.json +4 -3
- package/dist/alert-vfeV_hso.js +0 -1
- package/dist/dropdown-menu-CWUzGFgf.d.ts +0 -1
- package/dist/theme-BlCZHClJ.js +0 -1
- package/dist/use-prefers-reduced-motion-Cj9tJ181.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=`a[href], area[href], button, input, select, textarea, iframe, summary, audio[controls], video[controls], [contenteditable]:not([contenteditable="false"]), [tabindex]`;function t(e){if(e.name===``)return!0;let t=Array.from(e.ownerDocument.querySelectorAll(`input`)).filter(t=>t.type===`radio`&&t.name===e.name&&t.form===e.form&&!t.disabled),n=t.find(e=>e.checked);return n==null?t[0]===e:n===e}function n(e){return!(!(e instanceof HTMLElement)||e.tabIndex<0||e.matches(`:disabled`)||e instanceof HTMLInputElement&&(e.type===`hidden`||e.type===`radio`&&!t(e))||e.closest(`[hidden], [inert]`)!=null||typeof e.checkVisibility==`function`&&!e.checkVisibility({visibilityProperty:!0}))}function r(t){let r=[],i=[];for(let a of t.ownerDocument.querySelectorAll(e))!t.contains(a)&&n(a)&&((t.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING)===0?i.push(a):r.push(a));return i.reverse(),[...r,...i]}function i(t){return Array.from(t.querySelectorAll(e)).filter(n)}export{r as n,n as r,i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./cx-CK7o_rVv.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{t as i}from"./icon-BudQMD2S.js";import{t as a}from"./slot-DdYN1L1C.js";import{t as o}from"./css-properties-D85fCNV3.js";import{t as s}from"./button-b2HKEIE2.js";import{t as c}from"./button-BMfUxs_j.js";import{n as l,
|
|
1
|
+
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./cx-CK7o_rVv.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{t as i}from"./icon-BudQMD2S.js";import{t as a}from"./slot-DdYN1L1C.js";import{t as o}from"./css-properties-D85fCNV3.js";import{t as s}from"./button-b2HKEIE2.js";import{t as c}from"./button-BMfUxs_j.js";import{n as l,r as u}from"./alert-DO00UiQe.js";import{c as d}from"react/compiler-runtime";import{CaretDownIcon as f}from"@phosphor-icons/react/CaretDown";import{createContext as p,useContext as m,useEffect as h,useRef as g}from"react";import _ from"tiny-invariant";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{CheckCircleIcon as b}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as x}from"@phosphor-icons/react/Info";import{MegaphoneIcon as S}from"@phosphor-icons/react/Megaphone";import{WarningIcon as C}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as w}from"@phosphor-icons/react/WarningDiamond";import{XIcon as T}from"@phosphor-icons/react/X";import{cva as E}from"class-variance-authority";const D=p(null),O=/* @__PURE__ */ v(T,{});function k(){let e=m(D);return _(e,`useAlertContext hook used outside of Alert parent!`),e}const A=e=>{let t=d(6),{children:n,intent:r,redirectDismissFocus:i}=e,a=i===void 0||i,o;t[0]!==r||t[1]!==a?(o={intent:r,redirectDismissFocus:a},t[0]=r,t[1]=a,t[2]=o):o=t[2];let s=o,c;return t[3]!==n||t[4]!==s?(c=/* @__PURE__ */ v(D.Provider,{value:s,children:n}),t[3]=n,t[4]=s,t[5]=c):c=t[5],c},j=E(`relative flex w-full gap-1.5 rounded-md border p-2.5 text-sm font-sans`,{variants:{intent:{danger:`border-danger-500/50 bg-danger-500/10 text-danger-700 [&_code]:bg-danger-500/10 [&_code]:border-danger-500/20 [&_code]:text-danger-900 [&_a:not([data-slot~=button])]:text-danger-700 [&_a:not([data-slot~=button])]:underline`,important:`border-important-500/50 bg-important-500/10 text-important-700 [&_code]:bg-important-500/10 [&_code]:border-important-500/20 [&_code]:text-important-900 [&_a:not([data-slot~=button])]:text-important-700 [&_a:not([data-slot~=button])]:underline`,info:`border-info-500/50 bg-info-500/10 text-info-700 [&_code]:bg-info-500/10 [&_code]:border-info-500/20 [&_code]:text-info-900 [&_a:not([data-slot~=button])]:text-info-700 [&_a:not([data-slot~=button])]:underline`,success:`border-success-500/50 bg-success-500/10 text-success-700 [&_code]:bg-success-500/10 [&_code]:border-success-500/20 [&_code]:text-success-900 [&_a:not([data-slot~=button])]:text-success-700 [&_a:not([data-slot~=button])]:underline`,warning:`border-warning-500/50 bg-warning-500/10 text-warning-700 [&_code]:bg-warning-500/10 [&_code]:border-warning-500/20 [&_code]:text-warning-900 [&_a:not([data-slot~=button])]:text-warning-700 [&_a:not([data-slot~=button])]:underline`},appearance:{banner:`border-x-0 border-t-0 rounded-none z-50 sticky`,default:``}}}),M=e=>{let t=d(26),i,a,s,c,l,u,f;t[0]===e?(i=t[1],a=t[2],s=t[3],c=t[4],l=t[5],u=t[6],f=t[7]):({"data-slot":a,appearance:f,className:i,intent:s,ref:l,style:u,...c}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=s,t[4]=c,t[5]=l,t[6]=u,t[7]=f);let p=f===void 0?`default`:f,m;t[8]===a?m=t[9]:(m=r(a,`alert`),t[8]=a,t[9]=m);let h;t[10]!==p||t[11]!==i||t[12]!==s?(h=n(j({appearance:p,intent:s}),`has-data-alert-dismiss:pr-10`,`has-data-alert-expand:[&_[data-slot~=alert-dismiss-icon-button]]:right-16`,`md:has-data-alert-expand:[&_[data-slot~=alert-dismiss-icon-button]]:right-24`,`has-data-alert-expand:[&_[data-slot~=alert-content]]:pr-12`,`md:has-data-alert-expand:[&_[data-slot~=alert-content]]:pr-[5.5rem]`,i),t[10]=p,t[11]=i,t[12]=s,t[13]=h):h=t[13];let g;t[14]!==s||t[15]!==u?(g=o({"--alert-control-color":R(s),"--alert-control-hover-color":z(s),"--alert-control-hover-bg":B(s),...u}),t[14]=s,t[15]=u,t[16]=g):g=t[16];let _;t[17]!==c||t[18]!==l||t[19]!==m||t[20]!==h||t[21]!==g?(_=/* @__PURE__ */ v(`div`,{ref:l,"data-slot":m,className:h,style:g,...c}),t[17]=c,t[18]=l,t[19]=m,t[20]=h,t[21]=g,t[22]=_):_=t[22];let y;return t[23]!==s||t[24]!==_?(y=/* @__PURE__ */ v(A,{intent:s,children:_}),t[23]=s,t[24]=_,t[25]=y):y=t[25],y},N={danger:/* @__PURE__ */ v(C,{}),important:/* @__PURE__ */ v(S,{mirrored:!0}),info:/* @__PURE__ */ v(x,{}),success:/* @__PURE__ */ v(b,{}),warning:/* @__PURE__ */ v(w,{})},P=e=>{let t=d(16),a,o,s,c,l;t[0]===e?(a=t[1],o=t[2],s=t[3],c=t[4],l=t[5]):({"data-slot":o,className:a,ref:c,svg:l,...s}=e,t[0]=e,t[1]=a,t[2]=o,t[3]=s,t[4]=c,t[5]=l);let u=k(),f=N[u.intent],p;t[6]===o?p=t[7]:(p=r(o,`alert-icon`),t[6]=o,t[7]=p);let m;t[8]===a?m=t[9]:(m=n(`size-5`,a),t[8]=a,t[9]=m);let h=l??f,g;return t[10]!==s||t[11]!==c||t[12]!==p||t[13]!==m||t[14]!==h?(g=/* @__PURE__ */ v(i,{ref:c,"data-slot":p,className:m,svg:h,...s}),t[10]=s,t[11]=c,t[12]=p,t[13]=m,t[14]=h,t[15]=g):g=t[15],g},F=e=>{let t=d(14),i,a,o,s;t[0]===e?(i=t[1],a=t[2],o=t[3],s=t[4]):({"data-slot":a,className:i,ref:s,...o}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=o,t[4]=s);let c;t[5]===a?c=t[6]:(c=r(a,`alert-content`),t[5]=a,t[6]=c);let l;t[7]===i?l=t[8]:(l=n(`min-w-0 flex-1 has-data-alert-dismiss:pr-6`,i),t[7]=i,t[8]=l);let u;return t[9]!==o||t[10]!==s||t[11]!==c||t[12]!==l?(u=/* @__PURE__ */ v(`div`,{ref:s,"data-slot":c,className:l,...o}),t[9]=o,t[10]=s,t[11]=c,t[12]=l,t[13]=u):u=t[13],u},I=e=>{let t=d(16),i,o,s,c,l;t[0]===e?(i=t[1],o=t[2],s=t[3],c=t[4],l=t[5]):({"data-slot":o,asChild:l,className:i,ref:c,...s}=e,t[0]=e,t[1]=i,t[2]=o,t[3]=s,t[4]=c,t[5]=l);let u=l!==void 0&&l?a:`h5`,f;t[6]===o?f=t[7]:(f=r(o,`alert-title`),t[6]=o,t[7]=f);let p;t[8]===i?p=t[9]:(p=n(`font-medium`,i),t[8]=i,t[9]=p);let m;return t[10]!==u||t[11]!==s||t[12]!==c||t[13]!==f||t[14]!==p?(m=/* @__PURE__ */ v(u,{ref:c,"data-slot":f,className:p,...s}),t[10]=u,t[11]=s,t[12]=c,t[13]=f,t[14]=p,t[15]=m):m=t[15],m},L=e=>{let t=d(16),i,o,s,c,l;t[0]===e?(i=t[1],o=t[2],s=t[3],c=t[4],l=t[5]):({"data-slot":o,asChild:l,className:i,ref:c,...s}=e,t[0]=e,t[1]=i,t[2]=o,t[3]=s,t[4]=c,t[5]=l);let u=l!==void 0&&l?a:`div`,f;t[6]===o?f=t[7]:(f=r(o,`alert-description`),t[6]=o,t[7]=f);let p;t[8]===i?p=t[9]:(p=n(`text-sm`,i),t[8]=i,t[9]=p);let m;return t[10]!==u||t[11]!==s||t[12]!==c||t[13]!==f||t[14]!==p?(m=/* @__PURE__ */ v(u,{ref:c,"data-slot":f,className:p,...s}),t[10]=u,t[11]=s,t[12]=c,t[13]=f,t[14]=p,t[15]=m):m=t[15],m},R=e=>`var(--color-${e}-700)`,z=e=>`var(--color-${e}-800)`,B=e=>`color-mix(in oklab, var(--color-${e}-500) 10%, transparent)`;function V(t){let n=d(8),{buttonRef:r,enabled:i}=t,a;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=[],n[0]=a):a=n[0];let o=g(a),s,c;n[1]!==r||n[2]!==i?(s=()=>{if(i)return()=>{let e=r.current;if(e==null||document.activeElement!==e)return;let t=e.closest(`[data-slot~="alert"]`)??e;o.current=l(t)}},c=[r,i],n[1]=r,n[2]=i,n[3]=s,n[4]=c):(s=n[3],c=n[4]),e(s,c);let f,p;n[5]===i?(f=n[6],p=n[7]):(f=()=>{if(i)return()=>{let e=o.current;if(o.current=[],e.length===0)return;let{activeElement:t}=document;if(t==null||t===document.body){for(let t of e)if(t.isConnected&&u(t)&&(t.focus(),document.activeElement===t))return}}},p=[i],n[5]=i,n[6]=f,n[7]=p),h(f,p)}const H={Root:M,Content:F,ExpandButton:e=>{let t=d(25),i,a,o,c,l;t[0]===e?(i=t[1],a=t[2],o=t[3],c=t[4],l=t[5]):({"data-slot":o,count:a,expanded:c,className:i,...l}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=o,t[4]=c,t[5]=l);let u=c?`Collapse additional alerts`:`Show ${a} more ${a===1?`alert`:`alerts`}`,p;t[6]===o?p=t[7]:(p=r(o,`alert-expand-button`),t[6]=o,t[7]=p);let m=c&&`-rotate-180`,h;t[8]===m?h=t[9]:(h=n(`size-4 transition-transform ease-out duration-150`,m),t[8]=m,t[9]=h);let g;t[10]===h?g=t[11]:(g=/* @__PURE__ */ v(f,{weight:`bold`,className:h}),t[10]=h,t[11]=g);let _;t[12]===i?_=t[13]:(_=n(`right-1.5 top-1.5 absolute gap-1 ps-1.5 pe-1`,`text-[var(--alert-control-color,currentColor)]`,`not-disabled:hover:bg-[var(--alert-control-hover-bg,transparent)] not-disabled:hover:text-[var(--alert-control-hover-color,currentColor)]`,i),t[12]=i,t[13]=_);let b;t[14]===a?b=t[15]:(b=/* @__PURE__ */ y(`span`,{className:`min-w-[2ch] text-center tabular-nums`,children:[`+`,a]}),t[14]=a,t[15]=b);let x;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(x=/* @__PURE__ */ v(`span`,{className:`hidden md:inline`,children:`more`}),t[16]=x):x=t[16];let S;return t[17]!==c||t[18]!==l||t[19]!==u||t[20]!==p||t[21]!==g||t[22]!==_||t[23]!==b?(S=/* @__PURE__ */ y(s,{type:`button`,appearance:`ghost`,intent:`neutral`,size:`sm`,"aria-expanded":c,"aria-label":u,"data-slot":p,"data-alert-expand":!0,icon:g,iconPlacement:`end`,className:_,...l,children:[b,x]}),t[17]=c,t[18]=l,t[19]=u,t[20]=p,t[21]=g,t[22]=_,t[23]=b,t[24]=S):S=t[24],S},Description:L,DismissIconButton:e=>{let i=d(26),a,o,s,l,u,f,p,h,_;i[0]===e?(a=i[1],o=i[2],s=i[3],l=i[4],u=i[5],f=i[6],p=i[7],h=i[8],_=i[9]):({"data-slot":o,size:u,type:f,label:p,appearance:h,className:a,icon:_,ref:l,...s}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=l,i[5]=u,i[6]=f,i[7]=p,i[8]=h,i[9]=_);let y=u===void 0?`sm`:u,b=f===void 0?`button`:f,x=p===void 0?`Dismiss Alert`:p,S=h===void 0?`ghost`:h,C=_===void 0?O:_,w=m(D),T=g(null),E=t(T,l),k=w?.redirectDismissFocus??!0,A;i[10]===k?A=i[11]:(A={buttonRef:T,enabled:k},i[10]=k,i[11]=A),V(A);let j;i[12]===o?j=i[13]:(j=r(o,`alert-dismiss-icon-button`),i[12]=o,i[13]=j);let M;i[14]===a?M=i[15]:(M=n(`right-1.5 top-1.5 absolute`,`text-[var(--alert-control-color,currentColor)]`,`not-disabled:hover:bg-[var(--alert-control-hover-bg,transparent)] not-disabled:hover:text-[var(--alert-control-hover-color,currentColor)]`,a),i[14]=a,i[15]=M);let N;return i[16]!==S||i[17]!==E||i[18]!==C||i[19]!==x||i[20]!==s||i[21]!==y||i[22]!==j||i[23]!==M||i[24]!==b?(N=/* @__PURE__ */ v(c,{ref:E,appearance:S,icon:C,intent:`neutral`,label:x,size:y,"data-slot":j,"data-alert-dismiss":!0,className:M,type:b,...s}),i[16]=S,i[17]=E,i[18]=C,i[19]=x,i[20]=s,i[21]=y,i[22]=j,i[23]=M,i[24]=b,i[25]=N):N=i[25],N},Icon:P,Title:I};export{A as n,H as t};
|
package/dist/alert-center.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./cx-CK7o_rVv.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{n as i,t as a}from"./alert-CZYYlx9q.js";import{c as o}from"react/compiler-runtime";import{createContext as s,useContext as c,useEffect as l,useId as u,useReducer as d,useRef as f,useState as p,useSyncExternalStore as m}from"react";import h from"tiny-invariant";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{createPortal as v}from"react-dom";const y={danger:5,warning:4,important:3,info:2,success:1};function b(e,t){if(t.parentElement===e)return!1;if(typeof e.moveBefore==`function`&&t.isConnected&&e.isConnected)try{return e.moveBefore(t,null),!0}catch{}return e.appendChild(t),!0}function x(e){return e.replace(/\s+/g,` `).trim()}function S(e){let t=e.querySelector(`[data-slot~="alert-title"]`);if(t==null)return``;let n=t.cloneNode(!0);if(!(n instanceof Element))return x(t.textContent??``);for(let e of n.querySelectorAll(`button`))e.remove();let r=x(n.textContent??``);for(let e of n.querySelectorAll(`a`))e.remove();let i=x(n.textContent??``);return i===``?r:i}function C(e){return e.toSorted((e,t)=>y[t.intent]-y[e.intent]||w(e.order,t.order)||e.sequence-t.sequence)}function w(e,t){return e===t?0:e==null?1:t==null||e<t?-1:1}function T(e,t){if(t===0)return``;if(e===``)return`${t} alert${t===1?``:`s`}`;let n=t-1;return n===0?e:`${e}, and ${n} more alert${n===1?``:`s`}`}const E=[];var D=class{#e=/* @__PURE__ */ new Set;#t=/* @__PURE__ */ new Map;#n=/* @__PURE__ */ new Map;#r=/* @__PURE__ */ new Map;#i=0;#a=E;#o=``;#s=!1;getHost(e){let t=this.#r.get(e);if(t!=null)return t;let n=document.createElement(`div`);return n.style.display=`contents`,n.setAttribute(`data-slot`,`alert-center-item-host`),n.setAttribute(`data-alert-host`,e),this.#r.set(e,n),n}#c=null;captureHostSnapshot(e){if(e!==this.#a[0]?.id)return;let t=this.#r.get(e);t!=null&&t.firstElementChild?.hasChildNodes()===!0&&(this.#c={id:e,content:t.cloneNode(!0)})}getHostSnapshot=e=>this.#c?.id===e?this.#c.content:null;subscribe=e=>(this.#e.add(e),()=>{this.#e.delete(e)});getSnapshot=()=>this.#a;hasAlert=e=>this.#t.has(e);getTopLabel=()=>this.#o;setTopLabel(e){this.#o!==e&&(this.#o=e,this.#p())}#l=null;requestFocusRestore(e){this.#l=e}flushFocusRestore(){let e=this.#l;e!=null&&e.isConnected&&(this.#l=null,document.activeElement!==e&&e.focus({preventScroll:!0}))}#u=null;#d=0;getPlacementVersion=()=>this.#d;notifyPlacementChange(){this.#d++,this.#p()}setBarElement(e){this.#u=e}getBarElement=()=>this.#u;getContentMounted=()=>this.#s;setContentMounted(e){this.#s!==e&&(this.#s=e,this.#p())}register(e){h(!this.#t.has(e.id),`AlertCenter.Item id "${e.id}" is already registered by another mounted item — ids must be unique under one <AlertCenter.Root>. Render one item per id, or give each alert its own id.`);let t=this.#n.get(e.id)??this.#i++;this.#n.set(e.id,t);let n={...e,sequence:t};return this.#t.set(e.id,n),this.#f(),()=>{this.#t.get(e.id)===n&&(this.#t.delete(e.id),this.#f())}}#f(){this.#a=C([...this.#t.values()]),this.#p()}#p(){for(let e of this.#e)e()}};const O=s(null),k=s(null);function A(e){let t=c(O);return h(t,`${e} must be rendered inside <AlertCenter.Root>.`),t}function ee(e){let t=c(k);return h(t,`${e} must be rendered inside <AlertCenter.Root>.`),t}const te=e=>m(e.subscribe,e.getSnapshot,e.getSnapshot),j=s(!1);function M(e){let t=o(5),{store:n}=e,r=te(n),i=m(n.subscribe,n.getTopLabel,n.getTopLabel),a;t[0]!==r.length||t[1]!==i?(a=T(i,r.length),t[0]=r.length,t[1]=i,t[2]=a):a=t[2];let s;return t[3]===a?s=t[4]:(s=/* @__PURE__ */ g(`div`,{"data-slot":`alert-center-announcer`,className:`sr-only`,role:`status`,"aria-live":`polite`,children:a}),t[3]=a,t[4]=s),s}const N=e=>{let t=o(18),{children:n,defaultOpen:r,onOpenChange:i,open:a}=e,[s]=p(U),c=u(),[l,d]=p(r??!1),f=a??l,m;t[0]!==i||t[1]!==a?(m=e=>{a??d(e),i?.(e)},t[0]=i,t[1]=a,t[2]=m):m=t[2];let h=m,v;t[3]!==c||t[4]!==s?(v={store:s,contentId:c},t[3]=c,t[4]=s,t[5]=v):v=t[5];let y=v,b;t[6]!==f||t[7]!==h?(b={isExpanded:f,setExpanded:h},t[6]=f,t[7]=h,t[8]=b):b=t[8];let x=b,S;t[9]!==n||t[10]!==x?(S=/* @__PURE__ */ g(k.Provider,{value:x,children:n}),t[9]=n,t[10]=x,t[11]=S):S=t[11];let C;t[12]===s?C=t[13]:(C=/* @__PURE__ */ g(M,{store:s}),t[12]=s,t[13]=C);let w;return t[14]!==y||t[15]!==S||t[16]!==C?(w=/* @__PURE__ */ _(O.Provider,{value:y,children:[S,C]}),t[14]=y,t[15]=S,t[16]=C,t[17]=w):w=t[17],w},P=t=>{let n=o(22),{children:r,className:a,id:s,intent:l,order:u}=t,{store:d}=A(`AlertCenter.Item`),f=c(j);h(!f,`AlertCenter.Item cannot be rendered inside another item's children.`);let[m,_]=p(null),y,b;n[0]!==s||n[1]!==d?(y=()=>{_(d.getHost(s))},b=[d,s],n[0]=s,n[1]=d,n[2]=y,n[3]=b):(y=n[2],b=n[3]),e(y,b);let x,S;n[4]!==a||n[5]!==s||n[6]!==l||n[7]!==u||n[8]!==d?(x=()=>d.register({id:s,intent:l,className:a,order:u}),S=[d,s,l,a,u],n[4]=a,n[5]=s,n[6]=l,n[7]=u,n[8]=d,n[9]=x,n[10]=S):(x=n[9],S=n[10]),e(x,S);let C;if(n[11]!==s||n[12]!==d?(C=()=>{d.captureHostSnapshot(s)},n[11]=s,n[12]=d,n[13]=C):C=n[13],e(C),m==null)return null;let w;n[14]===r?w=n[15]:(w=/* @__PURE__ */ g(j.Provider,{value:!0,children:/* @__PURE__ */ g(`div`,{className:`contents`,"data-slot":`alert-center-item-label`,children:r})}),n[14]=r,n[15]=w);let T;n[16]!==l||n[17]!==w?(T=/* @__PURE__ */ g(i,{intent:l,redirectDismissFocus:!1,children:w}),n[16]=l,n[17]=w,n[18]=T):T=n[18];let E;return n[19]!==m||n[20]!==T?(E=v(T,m),n[19]=m,n[20]=T,n[21]=E):E=n[21],E},F=n=>{let i=o(14),s,l,u,d;i[0]===n?(s=i[1],l=i[2],u=i[3],d=i[4]):({"data-slot":s,label:l,ref:d,...u}=n,i[0]=n,i[1]=s,i[2]=l,i[3]=u,i[4]=d);let _=c(j);h(_,`AlertCenter.DismissIconButton must be composed inside an <AlertCenter.Item>'s children.`);let{store:v}=A(`AlertCenter.DismissIconButton`);m(v.subscribe,v.getPlacementVersion,v.getPlacementVersion);let y=f(null),b=t(y,d),[x,C]=p(null),w;i[5]===l?w=i[6]:(w=()=>{if(l!=null)return;let e=y.current?.closest(`[data-alert-id]`),t=e==null?``:S(e);C(t===``?null:`Dismiss ${t}`)},i[5]=l,i[6]=w),e(w);let T=l??x??void 0,E;i[7]===s?E=i[8]:(E=r(s,`alert-center-dismiss-icon-button`),i[7]=s,i[8]=E);let D;return i[9]!==b||i[10]!==u||i[11]!==T||i[12]!==E?(D=/* @__PURE__ */ g(a.DismissIconButton,{ref:b,label:T,...u,"data-slot":E}),i[9]=b,i[10]=u,i[11]=T,i[12]=E,i[13]=D):D=i[13],D};function I(e,t){switch(t){case`show`:return`open`;case`hide`:return e===`closed`?`closed`:`closing`;case`exited`:return e===`closing`?`closed`:e}}function L(t){let n=o(10),{present:r}=t,[i,a]=d(I,r?`open`:`closed`),s,c;n[0]===r?(s=n[1],c=n[2]):(s=()=>{a(r?`show`:`hide`)},c=[r],n[0]=r,n[1]=s,n[2]=c),e(s,c);let u,f;n[3]===i?(u=n[4],f=n[5]):(u=()=>{if(i!==`closing`)return;let e=window.setTimeout(()=>a(`exited`),200);return()=>window.clearTimeout(e)},f=[i],n[3]=i,n[4]=u,n[5]=f),l(u,f);let p;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{e.target===e.currentTarget&&e.propertyName===`height`&&a(`exited`)},n[6]=p):p=n[6];let m=p,h=i!==`closed`,g=i===`open`?`open`:`closed`,_;return n[7]!==h||n[8]!==g?(_={isMounted:h,dataState:g,onExitTransitionEnd:m},n[7]=h,n[8]=g,n[9]=_):_=n[9],_}function R(t){let n=o(5),{containerRef:r,isAttached:i}=t,a=f(null),s,c;n[0]!==r||n[1]!==i?(s=()=>{let e=r.current;if(!i||e==null)return;let t=e=>{e.target instanceof Element&&(a.current=e.target)},n=t=>{t.relatedTarget instanceof Node&&!e.contains(t.relatedTarget)&&(a.current=null)};return e.addEventListener(`focusin`,t),e.addEventListener(`focusout`,n),()=>{e.removeEventListener(`focusin`,t),e.removeEventListener(`focusout`,n)}},c=[r,i],n[0]=r,n[1]=i,n[2]=s,n[3]=c):(s=n[2],c=n[3]),e(s,c);let l;return n[4]===Symbol.for(`react.memo_cache_sentinel`)?(l={lastFocusedWithinRef:a},n[4]=l):l=n[4],l}function z(){let e=document.querySelector(`main, [role="main"]`);e!=null&&(e.hasAttribute(`tabindex`)||(e.tabIndex=-1),e.focus({preventScroll:!0}))}function B(t){let n=o(10),{isMounted:r,store:i,topId:a}=t,s=f(null),c;n[0]===r?c=n[1]:(c={containerRef:s,isAttached:r},n[0]=r,n[1]=c);let{lastFocusedWithinRef:l}=R(c),u=f(a),d;n[2]!==l||n[3]!==i||n[4]!==a?(d=()=>{let e=u.current;if(u.current=a,e==null||a===e)return;let t=l.current;if(i.hasAlert(e)){t instanceof HTMLElement&&document.activeElement!==t&&i.requestFocusRestore(t);return}if(t==null||t.isConnected)return;l.current=null;let n=s.current;a==null?z():n!=null&&(n.querySelector(`[data-alert-dismiss], [data-alert-expand]`)??n).focus()},n[2]=l,n[3]=i,n[4]=a,n[5]=d):d=n[5];let p;n[6]!==i||n[7]!==a?(p=[i,a],n[6]=i,n[7]=a,n[8]=p):p=n[8],e(d,p);let m;return n[9]===Symbol.for(`react.memo_cache_sentinel`)?(m={wrapperRef:s},n[9]=m):m=n[9],m}const V=`gap-2 py-2 pr-2 [&_[data-slot~=alert-icon]]:shrink-0`,H={Root:N,Bar:t=>{let i=o(62),s,c,l,u;i[0]===t?(s=i[1],c=i[2],l=i[3],u=i[4]):({className:s,"data-slot":c,ref:u,...l}=t,i[0]=t,i[1]=s,i[2]=c,i[3]=l,i[4]=u);let{store:d,contentId:h}=A(`AlertCenter.Bar`),{isExpanded:v,setExpanded:y}=ee(`AlertCenter.Bar`),x=te(d),C=m(d.subscribe,d.getContentMounted,d.getContentMounted),w=x[0]??null,T=w!=null,E;i[5]===T?E=i[6]:(E={present:T},i[5]=T,i[6]=E);let{isMounted:D,dataState:O,onExitTransitionEnd:k}=L(E),[j,M]=p(w);w!=null&&w!==j&&M(w);let N=w??j,P=f(null),F;i[7]!==N||i[8]!==d||i[9]!==w?(F=()=>{let e=P.current;if(e==null)return;if(w!=null){let t=d.getHost(w.id);t.parentElement!==e&&e.childNodes.length>0&&e.replaceChildren(),b(e,t)&&d.notifyPlacementChange(),d.flushFocusRestore();return}let t=N==null?null:d.getHostSnapshot(N.id);t!=null&&t.parentNode!==e&&e.replaceChildren(t)},i[7]=N,i[8]=d,i[9]=w,i[10]=F):F=i[10],e(F);let I=w?.id,R;i[11]!==D||i[12]!==d||i[13]!==I?(R={isMounted:D,store:d,topId:I},i[11]=D,i[12]=d,i[13]=I,i[14]=R):R=i[14];let{wrapperRef:z}=B(R),H;i[15]!==T||i[16]!==d||i[17]!==z?(H=()=>{let e=z.current;d.setTopLabel(T&&e!=null?S(e):``)},i[15]=T,i[16]=d,i[17]=z,i[18]=H):H=i[18],e(H);let U;i[19]!==T||i[20]!==d||i[21]!==z?(U=()=>{let e=z.current;if(e==null)return;let t=new MutationObserver(()=>{d.setTopLabel(T?S(e):``)});return t.observe(e,{subtree:!0,childList:!0,characterData:!0}),()=>{t.disconnect()}},i[19]=T,i[20]=d,i[21]=z,i[22]=U):U=i[22];let W;i[23]!==D||i[24]!==T||i[25]!==d?(W=[d,T,D],i[23]=D,i[24]=T,i[25]=d,i[26]=W):W=i[26],e(U,W);let G,K;i[27]===d?(G=i[28],K=i[29]):(G=()=>()=>{d.setTopLabel(``)},K=[d],i[27]=d,i[28]=G,i[29]=K),e(G,K);let q;i[30]!==d||i[31]!==z?(q=()=>{d.setBarElement(z.current)},i[30]=d,i[31]=z,i[32]=q):q=i[32],e(q);let J,Y;if(i[33]===d?(J=i[34],Y=i[35]):(J=()=>()=>{d.setBarElement(null)},Y=[d],i[33]=d,i[34]=J,i[35]=Y),e(J,Y),!D||N==null)return null;let ne=T?x.length-1:0,re=!T,ie=N.intent,X;i[36]!==N.className||i[37]!==s?(X=n(V,`not-has-data-[slot=alert-description]:[&_[data-alert-dismiss],&_[data-alert-expand]]:top-1/2 not-has-data-[slot=alert-description]:[&_[data-alert-dismiss],&_[data-alert-expand]]:-translate-y-1/2`,`has-data-alert-expand:[&_[data-alert-dismiss]]:right-16 md:has-data-alert-expand:[&_[data-alert-dismiss]]:right-24`,s,N.className),i[36]=N.className,i[37]=s,i[38]=X):X=i[38];let Z;i[39]===c?Z=i[40]:(Z=r(c,`alert-center-bar`),i[39]=c,i[40]=Z);let ae;i[41]===Symbol.for(`react.memo_cache_sentinel`)?(ae=/* @__PURE__ */ g(`div`,{ref:P,className:`contents`,"data-slot":`alert-center-bar-mount`}),i[41]=ae):ae=i[41];let Q;i[42]!==h||i[43]!==C||i[44]!==v||i[45]!==ne||i[46]!==y?(Q=ne>0&&C&&/* @__PURE__ */ g(a.ExpandButton,{count:ne,expanded:v,"aria-controls":h,onClick:()=>y(!v)}),i[42]=h,i[43]=C,i[44]=v,i[45]=ne,i[46]=y,i[47]=Q):Q=i[47];let $;i[48]!==N.id||i[49]!==N.intent||i[50]!==l||i[51]!==u||i[52]!==X||i[53]!==Z||i[54]!==Q?($=/* @__PURE__ */ _(a.Root,{ref:u,appearance:`banner`,intent:ie,className:X,...l,"data-slot":Z,"data-placement":`bar`,"data-alert-id":N.id,children:[ae,Q]}),i[48]=N.id,i[49]=N.intent,i[50]=l,i[51]=u,i[52]=X,i[53]=Z,i[54]=Q,i[55]=$):$=i[55];let oe;return i[56]!==O||i[57]!==k||i[58]!==re||i[59]!==$||i[60]!==z?(oe=/* @__PURE__ */ g(`div`,{ref:z,"data-slot":`alert-center-bar-wrapper`,tabIndex:-1,inert:re,className:`shrink-0 overflow-hidden transition-[height,opacity] duration-200 ease-out [interpolate-size:allow-keywords] starting:h-0 starting:opacity-0 data-state-closed:h-0 data-state-closed:opacity-0 data-state-closed:duration-150 motion-reduce:transition-none`,"data-state":O,onTransitionEnd:k,children:$}),i[56]=O,i[57]=k,i[58]=re,i[59]=$,i[60]=z,i[61]=oe):oe=i[61],oe},Content:i=>{let a=o(38),s,c,l,u,d,p;a[0]===i?(s=a[1],c=a[2],l=a[3],u=a[4],d=a[5],p=a[6]):({"aria-label":p,"aria-labelledby":s,className:c,"data-slot":l,ref:d,...u}=i,a[0]=i,a[1]=s,a[2]=c,a[3]=l,a[4]=u,a[5]=d,a[6]=p);let m=p===void 0?`More alerts`:p,{store:h,contentId:_}=A(`AlertCenter.Content`),{isExpanded:v,setExpanded:y}=ee(`AlertCenter.Content`),x=te(h).slice(1),S=x.length>0,C,w;a[7]===h?(C=a[8],w=a[9]):(C=()=>(h.setContentMounted(!0),()=>{h.setContentMounted(!1)}),w=[h],a[7]=h,a[8]=C,a[9]=w),e(C,w);let T=f(S),E,D;a[10]!==S||a[11]!==v||a[12]!==y?(E=()=>{let e=T.current&&!S;T.current=S,e&&v&&y(!1)},D=[S,v,y],a[10]=S,a[11]=v,a[12]=y,a[13]=E,a[14]=D):(E=a[13],D=a[14]),e(E,D);let O=f(null),k=t(O,d),j;a[15]===S?j=a[16]:(j={containerRef:O,isAttached:S},a[15]=S,a[16]=j);let{lastFocusedWithinRef:M}=R(j),N=x.map(W).join(` `),P;a[17]===h?P=a[18]:(P=()=>{let e=O.current;if(e==null)return;let t=!1;for(let n of e.querySelectorAll(`[data-alert-mount]`)){let e=n.getAttribute(`data-alert-mount`);e!=null&&b(n,h.getHost(e))&&(t=!0)}t&&h.notifyPlacementChange(),h.flushFocusRestore()},a[17]=h,a[18]=P),e(P,[h,N]);let F;if(a[19]!==M||a[20]!==h?(F=()=>{let e=M.current;if(e==null)return;if(e.isConnected){let t=O.current;e instanceof HTMLElement&&document.activeElement!==e&&(t==null||!t.contains(e))&&(M.current=null,e.focus({preventScroll:!0}));return}M.current=null;let t=O.current?.querySelector(`[data-alert-dismiss]`);if(t!=null){t.focus();return}let n=h.getBarElement()?.querySelector(`[data-alert-dismiss], [data-alert-expand]`);n==null?z():n.focus()},a[19]=M,a[20]=h,a[21]=F):F=a[21],e(F,[h,N]),x.length===0)return null;let I;a[22]===l?I=a[23]:(I=r(l,`alert-center-content`),a[22]=l,a[23]=I);let L=v?`open`:`closed`,B;a[24]===c?B=a[25]:(B=n(`h-0 overflow-hidden invisible [content-visibility:hidden] transition-[height,visibility,content-visibility] transition-discrete duration-200 ease-out [interpolate-size:allow-keywords] data-state-open:h-auto data-state-open:visible data-state-open:[content-visibility:visible] motion-reduce:transition-none`,c),a[24]=c,a[25]=B);let V=s==null?m:void 0,H=x.map(G),U;a[26]!==s||a[27]!==V||a[28]!==H?(U=/* @__PURE__ */ g(`ul`,{"aria-label":V,"aria-labelledby":s,className:`flex w-full flex-col`,children:H}),a[26]=s,a[27]=V,a[28]=H,a[29]=U):U=a[29];let K;return a[30]!==k||a[31]!==_||a[32]!==u||a[33]!==L||a[34]!==B||a[35]!==U||a[36]!==I?(K=/* @__PURE__ */ g(`div`,{...u,ref:k,"data-slot":I,id:_,"data-state":L,className:B,children:U}),a[30]=k,a[31]=_,a[32]=u,a[33]=L,a[34]=B,a[35]=U,a[36]=I,a[37]=K):K=a[37],K},Item:P,DismissIconButton:F};function U(){return new D}function W(e){return e.id}function G(e){return/* @__PURE__ */ g(`li`,{children:/* @__PURE__ */ g(a.Root,{appearance:`banner`,intent:e.intent,className:n(V,e.className),"data-slot":`alert-center-item`,"data-placement":`list`,"data-alert-id":e.id,children:/* @__PURE__ */ g(`div`,{className:`contents`,"data-alert-mount":e.id})})},e.id)}export{H as AlertCenter};
|
|
1
|
+
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./cx-CK7o_rVv.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{n as i,t as a}from"./alert-ZaUBtgno.js";import{c as o}from"react/compiler-runtime";import{createContext as s,useContext as c,useEffect as l,useId as u,useReducer as d,useRef as f,useState as p,useSyncExternalStore as m}from"react";import h from"tiny-invariant";import{jsx as g,jsxs as _}from"react/jsx-runtime";import{createPortal as v}from"react-dom";const y={danger:5,warning:4,important:3,info:2,success:1};function b(e,t){if(t.parentElement===e)return!1;if(typeof e.moveBefore==`function`&&t.isConnected&&e.isConnected)try{return e.moveBefore(t,null),!0}catch{}return e.appendChild(t),!0}function x(e){return e.replace(/\s+/g,` `).trim()}function S(e){let t=e.querySelector(`[data-slot~="alert-title"]`);if(t==null)return``;let n=t.cloneNode(!0);if(!(n instanceof Element))return x(t.textContent??``);for(let e of n.querySelectorAll(`button`))e.remove();let r=x(n.textContent??``);for(let e of n.querySelectorAll(`a`))e.remove();let i=x(n.textContent??``);return i===``?r:i}function C(e){return e.toSorted((e,t)=>y[t.intent]-y[e.intent]||w(e.order,t.order)||e.sequence-t.sequence)}function w(e,t){return e===t?0:e==null?1:t==null||e<t?-1:1}function T(e,t){if(t===0)return``;if(e===``)return`${t} alert${t===1?``:`s`}`;let n=t-1;return n===0?e:`${e}, and ${n} more alert${n===1?``:`s`}`}const E=[];var D=class{#e=/* @__PURE__ */ new Set;#t=/* @__PURE__ */ new Map;#n=/* @__PURE__ */ new Map;#r=/* @__PURE__ */ new Map;#i=0;#a=E;#o=``;#s=!1;getHost(e){let t=this.#r.get(e);if(t!=null)return t;let n=document.createElement(`div`);return n.style.display=`contents`,n.setAttribute(`data-slot`,`alert-center-item-host`),n.setAttribute(`data-alert-host`,e),this.#r.set(e,n),n}#c=null;captureHostSnapshot(e){if(e!==this.#a[0]?.id)return;let t=this.#r.get(e);t!=null&&t.firstElementChild?.hasChildNodes()===!0&&(this.#c={id:e,content:t.cloneNode(!0)})}getHostSnapshot=e=>this.#c?.id===e?this.#c.content:null;subscribe=e=>(this.#e.add(e),()=>{this.#e.delete(e)});getSnapshot=()=>this.#a;hasAlert=e=>this.#t.has(e);getTopLabel=()=>this.#o;setTopLabel(e){this.#o!==e&&(this.#o=e,this.#p())}#l=null;requestFocusRestore(e){this.#l=e}flushFocusRestore(){let e=this.#l;e!=null&&e.isConnected&&(this.#l=null,document.activeElement!==e&&e.focus({preventScroll:!0}))}#u=null;#d=0;getPlacementVersion=()=>this.#d;notifyPlacementChange(){this.#d++,this.#p()}setBarElement(e){this.#u=e}getBarElement=()=>this.#u;getContentMounted=()=>this.#s;setContentMounted(e){this.#s!==e&&(this.#s=e,this.#p())}register(e){h(!this.#t.has(e.id),`AlertCenter.Item id "${e.id}" is already registered by another mounted item — ids must be unique under one <AlertCenter.Root>. Render one item per id, or give each alert its own id.`);let t=this.#n.get(e.id)??this.#i++;this.#n.set(e.id,t);let n={...e,sequence:t};return this.#t.set(e.id,n),this.#f(),()=>{this.#t.get(e.id)===n&&(this.#t.delete(e.id),this.#f())}}#f(){this.#a=C([...this.#t.values()]),this.#p()}#p(){for(let e of this.#e)e()}};const O=s(null),k=s(null);function A(e){let t=c(O);return h(t,`${e} must be rendered inside <AlertCenter.Root>.`),t}function ee(e){let t=c(k);return h(t,`${e} must be rendered inside <AlertCenter.Root>.`),t}const te=e=>m(e.subscribe,e.getSnapshot,e.getSnapshot),j=s(!1);function M(e){let t=o(5),{store:n}=e,r=te(n),i=m(n.subscribe,n.getTopLabel,n.getTopLabel),a;t[0]!==r.length||t[1]!==i?(a=T(i,r.length),t[0]=r.length,t[1]=i,t[2]=a):a=t[2];let s;return t[3]===a?s=t[4]:(s=/* @__PURE__ */ g(`div`,{"data-slot":`alert-center-announcer`,className:`sr-only`,role:`status`,"aria-live":`polite`,children:a}),t[3]=a,t[4]=s),s}const N=e=>{let t=o(18),{children:n,defaultOpen:r,onOpenChange:i,open:a}=e,[s]=p(U),c=u(),[l,d]=p(r??!1),f=a??l,m;t[0]!==i||t[1]!==a?(m=e=>{a??d(e),i?.(e)},t[0]=i,t[1]=a,t[2]=m):m=t[2];let h=m,v;t[3]!==c||t[4]!==s?(v={store:s,contentId:c},t[3]=c,t[4]=s,t[5]=v):v=t[5];let y=v,b;t[6]!==f||t[7]!==h?(b={isExpanded:f,setExpanded:h},t[6]=f,t[7]=h,t[8]=b):b=t[8];let x=b,S;t[9]!==n||t[10]!==x?(S=/* @__PURE__ */ g(k.Provider,{value:x,children:n}),t[9]=n,t[10]=x,t[11]=S):S=t[11];let C;t[12]===s?C=t[13]:(C=/* @__PURE__ */ g(M,{store:s}),t[12]=s,t[13]=C);let w;return t[14]!==y||t[15]!==S||t[16]!==C?(w=/* @__PURE__ */ _(O.Provider,{value:y,children:[S,C]}),t[14]=y,t[15]=S,t[16]=C,t[17]=w):w=t[17],w},P=t=>{let n=o(22),{children:r,className:a,id:s,intent:l,order:u}=t,{store:d}=A(`AlertCenter.Item`),f=c(j);h(!f,`AlertCenter.Item cannot be rendered inside another item's children.`);let[m,_]=p(null),y,b;n[0]!==s||n[1]!==d?(y=()=>{_(d.getHost(s))},b=[d,s],n[0]=s,n[1]=d,n[2]=y,n[3]=b):(y=n[2],b=n[3]),e(y,b);let x,S;n[4]!==a||n[5]!==s||n[6]!==l||n[7]!==u||n[8]!==d?(x=()=>d.register({id:s,intent:l,className:a,order:u}),S=[d,s,l,a,u],n[4]=a,n[5]=s,n[6]=l,n[7]=u,n[8]=d,n[9]=x,n[10]=S):(x=n[9],S=n[10]),e(x,S);let C;if(n[11]!==s||n[12]!==d?(C=()=>{d.captureHostSnapshot(s)},n[11]=s,n[12]=d,n[13]=C):C=n[13],e(C),m==null)return null;let w;n[14]===r?w=n[15]:(w=/* @__PURE__ */ g(j.Provider,{value:!0,children:/* @__PURE__ */ g(`div`,{className:`contents`,"data-slot":`alert-center-item-label`,children:r})}),n[14]=r,n[15]=w);let T;n[16]!==l||n[17]!==w?(T=/* @__PURE__ */ g(i,{intent:l,redirectDismissFocus:!1,children:w}),n[16]=l,n[17]=w,n[18]=T):T=n[18];let E;return n[19]!==m||n[20]!==T?(E=v(T,m),n[19]=m,n[20]=T,n[21]=E):E=n[21],E},F=n=>{let i=o(14),s,l,u,d;i[0]===n?(s=i[1],l=i[2],u=i[3],d=i[4]):({"data-slot":s,label:l,ref:d,...u}=n,i[0]=n,i[1]=s,i[2]=l,i[3]=u,i[4]=d);let _=c(j);h(_,`AlertCenter.DismissIconButton must be composed inside an <AlertCenter.Item>'s children.`);let{store:v}=A(`AlertCenter.DismissIconButton`);m(v.subscribe,v.getPlacementVersion,v.getPlacementVersion);let y=f(null),b=t(y,d),[x,C]=p(null),w;i[5]===l?w=i[6]:(w=()=>{if(l!=null)return;let e=y.current?.closest(`[data-alert-id]`),t=e==null?``:S(e);C(t===``?null:`Dismiss ${t}`)},i[5]=l,i[6]=w),e(w);let T=l??x??void 0,E;i[7]===s?E=i[8]:(E=r(s,`alert-center-dismiss-icon-button`),i[7]=s,i[8]=E);let D;return i[9]!==b||i[10]!==u||i[11]!==T||i[12]!==E?(D=/* @__PURE__ */ g(a.DismissIconButton,{ref:b,label:T,...u,"data-slot":E}),i[9]=b,i[10]=u,i[11]=T,i[12]=E,i[13]=D):D=i[13],D};function I(e,t){switch(t){case`show`:return`open`;case`hide`:return e===`closed`?`closed`:`closing`;case`exited`:return e===`closing`?`closed`:e}}function L(t){let n=o(10),{present:r}=t,[i,a]=d(I,r?`open`:`closed`),s,c;n[0]===r?(s=n[1],c=n[2]):(s=()=>{a(r?`show`:`hide`)},c=[r],n[0]=r,n[1]=s,n[2]=c),e(s,c);let u,f;n[3]===i?(u=n[4],f=n[5]):(u=()=>{if(i!==`closing`)return;let e=window.setTimeout(()=>a(`exited`),200);return()=>window.clearTimeout(e)},f=[i],n[3]=i,n[4]=u,n[5]=f),l(u,f);let p;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{e.target===e.currentTarget&&e.propertyName===`height`&&a(`exited`)},n[6]=p):p=n[6];let m=p,h=i!==`closed`,g=i===`open`?`open`:`closed`,_;return n[7]!==h||n[8]!==g?(_={isMounted:h,dataState:g,onExitTransitionEnd:m},n[7]=h,n[8]=g,n[9]=_):_=n[9],_}function R(t){let n=o(5),{containerRef:r,isAttached:i}=t,a=f(null),s,c;n[0]!==r||n[1]!==i?(s=()=>{let e=r.current;if(!i||e==null)return;let t=e=>{e.target instanceof Element&&(a.current=e.target)},n=t=>{t.relatedTarget instanceof Node&&!e.contains(t.relatedTarget)&&(a.current=null)};return e.addEventListener(`focusin`,t),e.addEventListener(`focusout`,n),()=>{e.removeEventListener(`focusin`,t),e.removeEventListener(`focusout`,n)}},c=[r,i],n[0]=r,n[1]=i,n[2]=s,n[3]=c):(s=n[2],c=n[3]),e(s,c);let l;return n[4]===Symbol.for(`react.memo_cache_sentinel`)?(l={lastFocusedWithinRef:a},n[4]=l):l=n[4],l}function z(){let e=document.querySelector(`main, [role="main"]`);e!=null&&(e.hasAttribute(`tabindex`)||(e.tabIndex=-1),e.focus({preventScroll:!0}))}function B(t){let n=o(10),{isMounted:r,store:i,topId:a}=t,s=f(null),c;n[0]===r?c=n[1]:(c={containerRef:s,isAttached:r},n[0]=r,n[1]=c);let{lastFocusedWithinRef:l}=R(c),u=f(a),d;n[2]!==l||n[3]!==i||n[4]!==a?(d=()=>{let e=u.current;if(u.current=a,e==null||a===e)return;let t=l.current;if(i.hasAlert(e)){t instanceof HTMLElement&&document.activeElement!==t&&i.requestFocusRestore(t);return}if(t==null||t.isConnected)return;l.current=null;let n=s.current;a==null?z():n!=null&&(n.querySelector(`[data-alert-dismiss], [data-alert-expand]`)??n).focus()},n[2]=l,n[3]=i,n[4]=a,n[5]=d):d=n[5];let p;n[6]!==i||n[7]!==a?(p=[i,a],n[6]=i,n[7]=a,n[8]=p):p=n[8],e(d,p);let m;return n[9]===Symbol.for(`react.memo_cache_sentinel`)?(m={wrapperRef:s},n[9]=m):m=n[9],m}const V=`gap-2 py-2 pr-2 [&_[data-slot~=alert-icon]]:shrink-0`,H={Root:N,Bar:t=>{let i=o(62),s,c,l,u;i[0]===t?(s=i[1],c=i[2],l=i[3],u=i[4]):({className:s,"data-slot":c,ref:u,...l}=t,i[0]=t,i[1]=s,i[2]=c,i[3]=l,i[4]=u);let{store:d,contentId:h}=A(`AlertCenter.Bar`),{isExpanded:v,setExpanded:y}=ee(`AlertCenter.Bar`),x=te(d),C=m(d.subscribe,d.getContentMounted,d.getContentMounted),w=x[0]??null,T=w!=null,E;i[5]===T?E=i[6]:(E={present:T},i[5]=T,i[6]=E);let{isMounted:D,dataState:O,onExitTransitionEnd:k}=L(E),[j,M]=p(w);w!=null&&w!==j&&M(w);let N=w??j,P=f(null),F;i[7]!==N||i[8]!==d||i[9]!==w?(F=()=>{let e=P.current;if(e==null)return;if(w!=null){let t=d.getHost(w.id);t.parentElement!==e&&e.childNodes.length>0&&e.replaceChildren(),b(e,t)&&d.notifyPlacementChange(),d.flushFocusRestore();return}let t=N==null?null:d.getHostSnapshot(N.id);t!=null&&t.parentNode!==e&&e.replaceChildren(t)},i[7]=N,i[8]=d,i[9]=w,i[10]=F):F=i[10],e(F);let I=w?.id,R;i[11]!==D||i[12]!==d||i[13]!==I?(R={isMounted:D,store:d,topId:I},i[11]=D,i[12]=d,i[13]=I,i[14]=R):R=i[14];let{wrapperRef:z}=B(R),H;i[15]!==T||i[16]!==d||i[17]!==z?(H=()=>{let e=z.current;d.setTopLabel(T&&e!=null?S(e):``)},i[15]=T,i[16]=d,i[17]=z,i[18]=H):H=i[18],e(H);let U;i[19]!==T||i[20]!==d||i[21]!==z?(U=()=>{let e=z.current;if(e==null)return;let t=new MutationObserver(()=>{d.setTopLabel(T?S(e):``)});return t.observe(e,{subtree:!0,childList:!0,characterData:!0}),()=>{t.disconnect()}},i[19]=T,i[20]=d,i[21]=z,i[22]=U):U=i[22];let W;i[23]!==D||i[24]!==T||i[25]!==d?(W=[d,T,D],i[23]=D,i[24]=T,i[25]=d,i[26]=W):W=i[26],e(U,W);let G,K;i[27]===d?(G=i[28],K=i[29]):(G=()=>()=>{d.setTopLabel(``)},K=[d],i[27]=d,i[28]=G,i[29]=K),e(G,K);let q;i[30]!==d||i[31]!==z?(q=()=>{d.setBarElement(z.current)},i[30]=d,i[31]=z,i[32]=q):q=i[32],e(q);let J,Y;if(i[33]===d?(J=i[34],Y=i[35]):(J=()=>()=>{d.setBarElement(null)},Y=[d],i[33]=d,i[34]=J,i[35]=Y),e(J,Y),!D||N==null)return null;let ne=T?x.length-1:0,re=!T,ie=N.intent,X;i[36]!==N.className||i[37]!==s?(X=n(V,`not-has-data-[slot=alert-description]:[&_[data-alert-dismiss],&_[data-alert-expand]]:top-1/2 not-has-data-[slot=alert-description]:[&_[data-alert-dismiss],&_[data-alert-expand]]:-translate-y-1/2`,`has-data-alert-expand:[&_[data-alert-dismiss]]:right-16 md:has-data-alert-expand:[&_[data-alert-dismiss]]:right-24`,s,N.className),i[36]=N.className,i[37]=s,i[38]=X):X=i[38];let Z;i[39]===c?Z=i[40]:(Z=r(c,`alert-center-bar`),i[39]=c,i[40]=Z);let ae;i[41]===Symbol.for(`react.memo_cache_sentinel`)?(ae=/* @__PURE__ */ g(`div`,{ref:P,className:`contents`,"data-slot":`alert-center-bar-mount`}),i[41]=ae):ae=i[41];let Q;i[42]!==h||i[43]!==C||i[44]!==v||i[45]!==ne||i[46]!==y?(Q=ne>0&&C&&/* @__PURE__ */ g(a.ExpandButton,{count:ne,expanded:v,"aria-controls":h,onClick:()=>y(!v)}),i[42]=h,i[43]=C,i[44]=v,i[45]=ne,i[46]=y,i[47]=Q):Q=i[47];let $;i[48]!==N.id||i[49]!==N.intent||i[50]!==l||i[51]!==u||i[52]!==X||i[53]!==Z||i[54]!==Q?($=/* @__PURE__ */ _(a.Root,{ref:u,appearance:`banner`,intent:ie,className:X,...l,"data-slot":Z,"data-placement":`bar`,"data-alert-id":N.id,children:[ae,Q]}),i[48]=N.id,i[49]=N.intent,i[50]=l,i[51]=u,i[52]=X,i[53]=Z,i[54]=Q,i[55]=$):$=i[55];let oe;return i[56]!==O||i[57]!==k||i[58]!==re||i[59]!==$||i[60]!==z?(oe=/* @__PURE__ */ g(`div`,{ref:z,"data-slot":`alert-center-bar-wrapper`,tabIndex:-1,inert:re,className:`shrink-0 overflow-hidden transition-[height,opacity] duration-200 ease-out [interpolate-size:allow-keywords] starting:h-0 starting:opacity-0 data-state-closed:h-0 data-state-closed:opacity-0 data-state-closed:duration-150 motion-reduce:transition-none`,"data-state":O,onTransitionEnd:k,children:$}),i[56]=O,i[57]=k,i[58]=re,i[59]=$,i[60]=z,i[61]=oe):oe=i[61],oe},Content:i=>{let a=o(38),s,c,l,u,d,p;a[0]===i?(s=a[1],c=a[2],l=a[3],u=a[4],d=a[5],p=a[6]):({"aria-label":p,"aria-labelledby":s,className:c,"data-slot":l,ref:d,...u}=i,a[0]=i,a[1]=s,a[2]=c,a[3]=l,a[4]=u,a[5]=d,a[6]=p);let m=p===void 0?`More alerts`:p,{store:h,contentId:_}=A(`AlertCenter.Content`),{isExpanded:v,setExpanded:y}=ee(`AlertCenter.Content`),x=te(h).slice(1),S=x.length>0,C,w;a[7]===h?(C=a[8],w=a[9]):(C=()=>(h.setContentMounted(!0),()=>{h.setContentMounted(!1)}),w=[h],a[7]=h,a[8]=C,a[9]=w),e(C,w);let T=f(S),E,D;a[10]!==S||a[11]!==v||a[12]!==y?(E=()=>{let e=T.current&&!S;T.current=S,e&&v&&y(!1)},D=[S,v,y],a[10]=S,a[11]=v,a[12]=y,a[13]=E,a[14]=D):(E=a[13],D=a[14]),e(E,D);let O=f(null),k=t(O,d),j;a[15]===S?j=a[16]:(j={containerRef:O,isAttached:S},a[15]=S,a[16]=j);let{lastFocusedWithinRef:M}=R(j),N=x.map(W).join(` `),P;a[17]===h?P=a[18]:(P=()=>{let e=O.current;if(e==null)return;let t=!1;for(let n of e.querySelectorAll(`[data-alert-mount]`)){let e=n.getAttribute(`data-alert-mount`);e!=null&&b(n,h.getHost(e))&&(t=!0)}t&&h.notifyPlacementChange(),h.flushFocusRestore()},a[17]=h,a[18]=P),e(P,[h,N]);let F;if(a[19]!==M||a[20]!==h?(F=()=>{let e=M.current;if(e==null)return;if(e.isConnected){let t=O.current;e instanceof HTMLElement&&document.activeElement!==e&&(t==null||!t.contains(e))&&(M.current=null,e.focus({preventScroll:!0}));return}M.current=null;let t=O.current?.querySelector(`[data-alert-dismiss]`);if(t!=null){t.focus();return}let n=h.getBarElement()?.querySelector(`[data-alert-dismiss], [data-alert-expand]`);n==null?z():n.focus()},a[19]=M,a[20]=h,a[21]=F):F=a[21],e(F,[h,N]),x.length===0)return null;let I;a[22]===l?I=a[23]:(I=r(l,`alert-center-content`),a[22]=l,a[23]=I);let L=v?`open`:`closed`,B;a[24]===c?B=a[25]:(B=n(`h-0 overflow-hidden invisible [content-visibility:hidden] transition-[height,visibility,content-visibility] transition-discrete duration-200 ease-out [interpolate-size:allow-keywords] data-state-open:h-auto data-state-open:visible data-state-open:[content-visibility:visible] motion-reduce:transition-none`,c),a[24]=c,a[25]=B);let V=s==null?m:void 0,H=x.map(G),U;a[26]!==s||a[27]!==V||a[28]!==H?(U=/* @__PURE__ */ g(`ul`,{"aria-label":V,"aria-labelledby":s,className:`flex w-full flex-col`,children:H}),a[26]=s,a[27]=V,a[28]=H,a[29]=U):U=a[29];let K;return a[30]!==k||a[31]!==_||a[32]!==u||a[33]!==L||a[34]!==B||a[35]!==U||a[36]!==I?(K=/* @__PURE__ */ g(`div`,{...u,ref:k,"data-slot":I,id:_,"data-state":L,className:B,children:U}),a[30]=k,a[31]=_,a[32]=u,a[33]=L,a[34]=B,a[35]=U,a[36]=I,a[37]=K):K=a[37],K},Item:P,DismissIconButton:F};function U(){return new D}function W(e){return e.id}function G(e){return/* @__PURE__ */ g(`li`,{children:/* @__PURE__ */ g(a.Root,{appearance:`banner`,intent:e.intent,className:n(V,e.className),"data-slot":`alert-center-item`,"data-placement":`list`,"data-alert-id":e.id,children:/* @__PURE__ */ g(`div`,{className:`contents`,"data-alert-mount":e.id})})},e.id)}export{H as AlertCenter};
|
package/dist/alert-dialog.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./icon-BudQMD2S.js";import{t as r}from"./slot-DdYN1L1C.js";import{t as i}from"./button-b2HKEIE2.js";import{t as a}from"./layer-container-DLf-6eBz.js";import{a as o,c as s,i as c,n as l,o as u,r as d,s as f,t as p}from"./primitive-
|
|
1
|
+
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./icon-BudQMD2S.js";import{t as r}from"./slot-DdYN1L1C.js";import{t as i}from"./button-b2HKEIE2.js";import{t as a}from"./layer-container-DLf-6eBz.js";import{a as o,c as s,i as c,n as l,o as u,r as d,s as f,t as p}from"./primitive-AGoxSJBI.js";import{c as m}from"react/compiler-runtime";import{createContext as h,useContext as g}from"react";import _ from"tiny-invariant";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{InfoIcon as b}from"@phosphor-icons/react/Info";import{WarningIcon as x}from"@phosphor-icons/react/Warning";const S=h(null);function C(){let e=g(S);return _(e,`AlertDialog child component used outside of AlertDialog parent!`),e}function w(e){let t=m(10),n,r;t[0]===e?(n=t[1],r=t[2]):({intent:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i={intent:n},t[3]=n,t[4]=i);let a=i,o;t[5]===r?o=t[6]:(o=/* @__PURE__ */ v(u,{...r}),t[5]=r,t[6]=o);let s;return t[7]!==a||t[8]!==o?(s=/* @__PURE__ */ v(S.Provider,{value:a,children:o}),t[7]=a,t[8]=o,t[9]=s):s=t[9],s}const T=e=>{let n=m(10),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({"data-slot":r,ref:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===r?o=n[5]:(o=t(r,`alert-dialog-trigger`),n[4]=r,n[5]=o);let c;return n[6]!==i||n[7]!==a||n[8]!==o?(c=/* @__PURE__ */ v(s,{ref:a,"data-slot":o,...i}),n[6]=i,n[7]=a,n[8]=o,n[9]=c):c=n[9],c},E=o,D=n=>{let r=m(14),i,a,o,s;r[0]===n?(i=r[1],a=r[2],o=r[3],s=r[4]):({"data-slot":a,className:i,ref:s,...o}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let l;r[5]===a?l=r[6]:(l=t(a,`alert-dialog-overlay`),r[5]=a,r[6]=l);let u;r[7]===i?u=r[8]:(u=e(`data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 bg-overlay fixed inset-0 z-60 backdrop-blur-xs`,i),r[7]=i,r[8]=u);let d;return r[9]!==o||r[10]!==s||r[11]!==l||r[12]!==u?(d=/* @__PURE__ */ v(c,{"data-slot":l,className:u,...o,ref:s}),r[9]=o,r[10]=s,r[11]=l,r[12]=u,r[13]=d):d=r[13],d},O=n=>{let r=m(21),i,o,s,c,u,d;r[0]===n?(i=r[1],o=r[2],s=r[3],c=r[4],u=r[5],d=r[6]):({"data-slot":o,className:i,onInteractOutside:s,preferredWidth:d,ref:u,...c}=n,r[0]=n,r[1]=i,r[2]=o,r[3]=s,r[4]=c,r[5]=u,r[6]=d);let f=d===void 0?`max-w-md`:d,p;r[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=/* @__PURE__ */ v(D,{}),r[7]=p):p=r[7];let h;r[8]===o?h=r[9]:(h=t(o,`alert-dialog-content`),r[8]=o,r[9]=h);let g;r[10]===s?g=r[11]:(g=e=>{s?.(e),e.preventDefault()},r[10]=s,r[11]=g);let _;r[12]!==i||r[13]!==f?(_=e(`flex w-full flex-1 flex-col items-center gap-4 sm:flex-row sm:items-start`,`outline-hidden focus-within:outline-hidden`,`p-6`,`border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200`,`data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95`,f,i),r[12]=i,r[13]=f,r[14]=_):_=r[14];let b;return r[15]!==c||r[16]!==u||r[17]!==h||r[18]!==g||r[19]!==_?(b=/* @__PURE__ */ y(E,{children:[p,/* @__PURE__ */ v(a,{"data-slot":`alert-dialog-positioner`,className:`fixed inset-4 z-60 flex items-center justify-center`,children:/* @__PURE__ */ v(l,{role:`alertdialog`,"data-slot":h,"data-mantle-modal-content":!0,ref:u,onInteractOutside:g,className:_,...c})})]}),r[15]=c,r[16]=u,r[17]=h,r[18]=g,r[19]=_,r[20]=b):b=r[20],b},k=n=>{let i=m(16),a,o,s,c,l;i[0]===n?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({"data-slot":o,asChild:l,className:a,ref:c,...s}=n,i[0]=n,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=l!==void 0&&l?r:`div`,d;i[6]===o?d=i[7]:(d=t(o,`alert-dialog-body`),i[6]=o,i[7]=d);let f;i[8]===a?f=i[9]:(f=e(`flex-1 space-y-4`,a),i[8]=a,i[9]=f);let p;return i[10]!==u||i[11]!==s||i[12]!==c||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ v(u,{"data-slot":d,className:f,ref:c,...s}),i[10]=u,i[11]=s,i[12]=c,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},A=n=>{let i=m(16),a,o,s,c,l;i[0]===n?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({"data-slot":o,asChild:l,className:a,ref:c,...s}=n,i[0]=n,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=l!==void 0&&l?r:`div`,d;i[6]===o?d=i[7]:(d=t(o,`alert-dialog-header`),i[6]=o,i[7]=d);let f;i[8]===a?f=i[9]:(f=e(`flex flex-col space-y-2 text-center sm:text-start`,a),i[8]=a,i[9]=f);let p;return i[10]!==u||i[11]!==s||i[12]!==c||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ v(u,{"data-slot":d,className:f,ref:c,...s}),i[10]=u,i[11]=s,i[12]=c,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},j=n=>{let i=m(16),a,o,s,c,l;i[0]===n?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({"data-slot":o,asChild:l,className:a,ref:c,...s}=n,i[0]=n,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=l!==void 0&&l?r:`div`,d;i[6]===o?d=i[7]:(d=t(o,`alert-dialog-footer`),i[6]=o,i[7]=d);let f;i[8]===a?f=i[9]:(f=e(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,a),i[8]=a,i[9]=f);let p;return i[10]!==u||i[11]!==s||i[12]!==c||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ v(u,{"data-slot":d,className:f,ref:c,...s}),i[10]=u,i[11]=s,i[12]=c,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},M=n=>{let r=m(14),i,a,o,s;r[0]===n?(i=r[1],a=r[2],o=r[3],s=r[4]):({"data-slot":a,className:i,ref:s,...o}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c;r[5]===a?c=r[6]:(c=t(a,`alert-dialog-title`),r[5]=a,r[6]=c);let l;r[7]===i?l=r[8]:(l=e(`text-strong text-center text-lg font-medium sm:text-start`,i),r[7]=i,r[8]=l);let u;return r[9]!==o||r[10]!==s||r[11]!==c||r[12]!==l?(u=/* @__PURE__ */ v(f,{ref:s,"data-slot":c,className:l,...o}),r[9]=o,r[10]=s,r[11]=c,r[12]=l,r[13]=u):u=r[13],u},N=n=>{let r=m(14),i,a,o,s;r[0]===n?(i=r[1],a=r[2],o=r[3],s=r[4]):({"data-slot":a,className:i,ref:s,...o}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c;r[5]===a?c=r[6]:(c=t(a,`alert-dialog-description`),r[5]=a,r[6]=c);let l;r[7]===i?l=r[8]:(l=e(`text-body text-center text-sm font-normal sm:text-start`,i),r[7]=i,r[8]=l);let u;return r[9]!==o||r[10]!==s||r[11]!==c||r[12]!==l?(u=/* @__PURE__ */ v(d,{ref:s,"data-slot":c,className:l,...o}),r[9]=o,r[10]=s,r[11]=c,r[12]=l,r[13]=u):u=r[13],u},P={danger:`danger`,info:`neutral`},F=e=>{let n=m(14),r,a,o,s,c;n[0]===e?(r=n[1],a=n[2],o=n[3],s=n[4],c=n[5]):({"data-slot":r,appearance:c,intent:a,ref:s,...o}=e,n[0]=e,n[1]=r,n[2]=a,n[3]=o,n[4]=s,n[5]=c);let l=c===void 0?`filled`:c,u=C(),d=P[u.intent],f;n[6]===r?f=n[7]:(f=t(r,`alert-dialog-action`),n[6]=r,n[7]=f);let p=a??d,h;return n[8]!==l||n[9]!==o||n[10]!==s||n[11]!==f||n[12]!==p?(h=/* @__PURE__ */ v(i,{appearance:l,"data-slot":f,intent:p,ref:s,...o}),n[8]=l,n[9]=o,n[10]=s,n[11]=f,n[12]=p,n[13]=h):h=n[13],h},I=n=>{let r=m(18),a,o,s,c,l,u;r[0]===n?(a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],u=r[6]):({"data-slot":o,appearance:l,className:a,intent:u,ref:c,...s}=n,r[0]=n,r[1]=a,r[2]=o,r[3]=s,r[4]=c,r[5]=l,r[6]=u);let d=l===void 0?`outlined`:l,f=u===void 0?`neutral`:u,h;r[7]===o?h=r[8]:(h=t(o,`alert-dialog-cancel`),r[7]=o,r[8]=h);let g;r[9]===a?g=r[10]:(g=e(`mt-2 sm:mt-0`,a),r[9]=a,r[10]=g);let _;return r[11]!==d||r[12]!==f||r[13]!==s||r[14]!==c||r[15]!==h||r[16]!==g?(_=/* @__PURE__ */ v(p,{asChild:!0,children:/* @__PURE__ */ v(i,{appearance:d,"data-slot":h,className:g,intent:f,ref:c,...s})}),r[11]=d,r[12]=f,r[13]=s,r[14]=c,r[15]=h,r[16]=g,r[17]=_):_=r[17],_},L={danger:/* @__PURE__ */ v(x,{}),info:/* @__PURE__ */ v(b,{})},R={danger:`text-danger-600`,info:`text-accent-600`},z={Root:w,Action:F,Body:k,Cancel:I,Close:e=>{let n=m(10),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({"data-slot":r,ref:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===r?o=n[5]:(o=t(r,`alert-dialog-close`),n[4]=r,n[5]=o);let s;return n[6]!==i||n[7]!==a||n[8]!==o?(s=/* @__PURE__ */ v(p,{ref:a,"data-slot":o,...i}),n[6]=i,n[7]=a,n[8]=o,n[9]=s):s=n[9],s},Content:O,Description:N,Footer:j,Header:A,Icon:r=>{let i=m(17),a,o,s,c,l;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({"data-slot":o,className:a,ref:c,svg:l,...s}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=C(),d=R[u.intent],f=L[u.intent],p;i[6]===o?p=i[7]:(p=t(o,`alert-dialog-icon`),i[6]=o,i[7]=p);let h;i[8]!==a||i[9]!==d?(h=e(`size-12 sm:size-7`,d,a),i[8]=a,i[9]=d,i[10]=h):h=i[10];let g=l??f,_;return i[11]!==s||i[12]!==c||i[13]!==p||i[14]!==h||i[15]!==g?(_=/* @__PURE__ */ v(n,{ref:c,"data-slot":p,className:h,svg:g,...s}),i[11]=s,i[12]=c,i[13]=p,i[14]=h,i[15]=g,i[16]=_):_=i[16],_},Title:M,Trigger:T};export{z as AlertDialog};
|
package/dist/alert.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{t as Alert}from"./alert-
|
|
1
|
+
export{t as Alert}from"./alert-ZaUBtgno.js";
|
package/dist/app-layout.d.ts
CHANGED
|
@@ -126,7 +126,12 @@ declare const Notice: ({ asChild, children, className, "data-slot": dataSlot, ..
|
|
|
126
126
|
* the variable to `none` to let the row fill any width.
|
|
127
127
|
*
|
|
128
128
|
* It is `relative`, so a floating `AppLayout.SidePanel` resolves against the row
|
|
129
|
-
* and covers the card, never the notice above it.
|
|
129
|
+
* and covers the card, never the notice above it. It is also the container
|
|
130
|
+
* named `app-layout-workspace`: the panel floats when the row is narrower than
|
|
131
|
+
* the lane it needs, so a page is never narrower than the panel beside it. The
|
|
132
|
+
* lane is `--container-side-panel-lane` while a direct child of the row is an
|
|
133
|
+
* expanded `Sidebar.Nav`, and `--container-side-panel-lane-icon-rail` with a
|
|
134
|
+
* collapsed rail or none.
|
|
130
135
|
*
|
|
131
136
|
* **CSS variables (public API):**
|
|
132
137
|
*
|
|
@@ -743,7 +748,8 @@ type AppLayoutSidePanelProps = Omit<ComponentProps<"aside">, "id"> & WithDataSlo
|
|
|
743
748
|
*
|
|
744
749
|
* Below `mobileBreakpoint` the panel floats over the card instead of taking
|
|
745
750
|
* width from it: `absolute`, pinned to the row's end edge inside the card
|
|
746
|
-
* gutter, `min(24rem,
|
|
751
|
+
* gutter, `min(24rem, 100cqw - 5rem)` wide (24rem, or the row less a 5rem
|
|
752
|
+
* strip of page when the row is narrower), with a larger shadow and `z-20` so
|
|
747
753
|
* it paints above a page's own sticky rows. Closed, it slides off the end edge
|
|
748
754
|
* instead of collapsing and goes `invisible` the instant the slide ends, so a
|
|
749
755
|
* row that `--app-layout-max-width` caps inside the frame has no panel strip
|
|
@@ -752,12 +758,41 @@ type AppLayoutSidePanelProps = Omit<ComponentProps<"aside">, "id"> & WithDataSlo
|
|
|
752
758
|
* With `"sm"` there is no lower breakpoint, so the panel covers the card as
|
|
753
759
|
* soon as it floats. Two cards side by side in 900px are two unusable cards.
|
|
754
760
|
*
|
|
761
|
+
* The panel also floats, with the same strip treatment, whenever the
|
|
762
|
+
* `AppLayout.Workspace` row is narrower than the lane it needs, whatever the
|
|
763
|
+
* viewport is. The row is the named container `app-layout-workspace`, and
|
|
764
|
+
* the lane depends on the rail beside the card: `--container-side-panel-lane`
|
|
765
|
+
* (56.5rem: the expanded rail, the card at the panel's floor, the panel, and
|
|
766
|
+
* the three gutters) while a direct child of the row is an expanded
|
|
767
|
+
* `Sidebar.Nav`, and `--container-side-panel-lane-icon-rail` (46.75rem: the
|
|
768
|
+
* same row with the icon rail) with a collapsed rail, no rail, or a rail that
|
|
769
|
+
* is a sheet. An expanded rail at a tablet width floats the panel instead of
|
|
770
|
+
* squeezing the page narrower than it, and collapsing the rail returns the
|
|
771
|
+
* panel to the lane. A wider rail or panel raises the tokens in `@theme`.
|
|
772
|
+
*
|
|
773
|
+
* A drag on `AppLayout.SidePanelHeader` toward the end edge swipes the panel
|
|
774
|
+
* away in every presentation: a floating panel slides, and a panel in the
|
|
775
|
+
* lane shrinks the way its close animation does. A floating panel is also an
|
|
776
|
+
* overlay: `Escape` closes it while focus is inside, after an open combobox
|
|
777
|
+
* or popover inside it has taken its own `Escape`. A panel in the lane is a
|
|
778
|
+
* docked pane and ignores `Escape`. The root returns focus to the trigger
|
|
779
|
+
* outside on every close.
|
|
780
|
+
*
|
|
781
|
+
* When the panel covers the row, it is modal. The row's other children (the
|
|
782
|
+
* card and the rail) go `inert` while it is open, so nothing beneath it is
|
|
783
|
+
* clickable or read; `useFocusTrap` wraps `Tab` inside it and moves focus
|
|
784
|
+
* into it on open. The one `<aside>` stays mounted across the lane, the
|
|
785
|
+
* float, and the cover, so a conversation keeps its DOM and the trap turns
|
|
786
|
+
* on and off with the viewport.
|
|
787
|
+
*
|
|
755
788
|
* **CSS variables (public API):**
|
|
756
789
|
*
|
|
757
790
|
* | CSS Variable | Default | Description |
|
|
758
791
|
* | --- | --- | --- |
|
|
759
|
-
* | `--app-layout-side-panel-width` | `clamp(21rem,
|
|
792
|
+
* | `--app-layout-side-panel-width` | `clamp(21rem, 24cqw, 27rem)` | The panel's width beside the card: a quarter of the `AppLayout.Workspace` row, never narrower than 336px and never wider than 432px. It reads the row, not the viewport, so a row that `--app-layout-max-width` caps on a wide screen holds the panel at its floor and the page keeps the rest. Set it on `AppLayout.Root` or on this part. |
|
|
760
793
|
* | `--app-layout-card-gutter` | `0.5rem` | Read, not owned: `AppLayout.Content` owns this token. The panel keeps it on its top, end, and bottom edges, and the floating panel insets itself by it. Set it on `AppLayout.Root` or another common ancestor of the card and the panel, not on `AppLayout.Content`: custom properties inherit downward only, so a value on the card never reaches the panel. |
|
|
794
|
+
* | `--container-side-panel-lane` | `56.5rem` | A theme token the row's container query reads: the narrowest `AppLayout.Workspace` row that holds an expanded `Sidebar.Nav` (13rem), the card at the panel's floor (21rem), the panel (21rem), and the three gutters. Below it the panel floats while a direct child of the row is an expanded rail. Set it in `@theme`, not on an element. |
|
|
795
|
+
* | `--container-side-panel-lane-icon-rail` | `46.75rem` | The same row with the icon rail (3.25rem) in place of the expanded one, or with no rail. Below it the panel floats whatever the rail is. Set it in `@theme`, not on an element. |
|
|
761
796
|
*
|
|
762
797
|
* **Data attributes (public API):**
|
|
763
798
|
*
|
|
@@ -811,13 +846,13 @@ type AppLayoutSidePanelProps = Omit<ComponentProps<"aside">, "id"> & WithDataSlo
|
|
|
811
846
|
* </Sidebar.Root>
|
|
812
847
|
* ```
|
|
813
848
|
*/
|
|
814
|
-
declare const SidePanel: ({ children, className, "data-slot": dataSlot, mobileBreakpoint, onBlur, onFocus, ...props }: AppLayoutSidePanelProps) => import("react").JSX.Element;
|
|
849
|
+
declare const SidePanel: ({ children, className, "data-slot": dataSlot, mobileBreakpoint, onBlur, onFocus, onKeyDown, ref, ...props }: AppLayoutSidePanelProps) => import("react").JSX.Element;
|
|
815
850
|
/**
|
|
816
851
|
* The props for `AppLayout.SidePanelTrigger`: `IconButton`'s props, except the
|
|
817
852
|
* parts the trigger owns. The type omits `asChild` and `children` (the trigger
|
|
818
853
|
* renders only its icon and `aria-label`; build a custom trigger with
|
|
819
|
-
* `useSidePanel` instead). `appearance`, `icon`, `intent`, and `
|
|
820
|
-
* optional with side panel defaults. `onClick` runs before the toggle; call
|
|
854
|
+
* `useSidePanel` instead). `appearance`, `icon`, `intent`, `label`, and `size`
|
|
855
|
+
* become optional with side panel defaults. `onClick` runs before the toggle; call
|
|
821
856
|
* `event.preventDefault()` in it to keep the panel where it is.
|
|
822
857
|
*
|
|
823
858
|
* @see https://mantle.ngrok.com/layouts/app-layout#applayoutsidepaneltrigger
|
|
@@ -827,7 +862,7 @@ declare const SidePanel: ({ children, className, "data-slot": dataSlot, mobileBr
|
|
|
827
862
|
* <AppLayout.SidePanelTrigger icon={<XIcon />} label="Close the assistant" />
|
|
828
863
|
* ```
|
|
829
864
|
*/
|
|
830
|
-
type AppLayoutSidePanelTriggerProps = Omit<IconButtonProps, "appearance" | "asChild" | "children" | "icon" | "intent" | "label"> & WithDataSlot & {
|
|
865
|
+
type AppLayoutSidePanelTriggerProps = Omit<IconButtonProps, "appearance" | "asChild" | "children" | "icon" | "intent" | "label" | "size"> & WithDataSlot & {
|
|
831
866
|
/**
|
|
832
867
|
* The visual style of the trigger `IconButton`.
|
|
833
868
|
*
|
|
@@ -852,10 +887,17 @@ type AppLayoutSidePanelTriggerProps = Omit<IconButtonProps, "appearance" | "asCh
|
|
|
852
887
|
* @default "Toggle side panel"
|
|
853
888
|
*/
|
|
854
889
|
label?: string;
|
|
890
|
+
/**
|
|
891
|
+
* The size of the trigger `IconButton`. Small, so it sits level with the
|
|
892
|
+
* other `size="sm"` controls in an `AppLayout.Header` row.
|
|
893
|
+
*
|
|
894
|
+
* @default "sm"
|
|
895
|
+
*/
|
|
896
|
+
size?: IconButtonProps["size"];
|
|
855
897
|
};
|
|
856
898
|
/**
|
|
857
899
|
* The button that toggles `AppLayout.SidePanel`, the way `Sidebar.Trigger`
|
|
858
|
-
* toggles the rail. Renders a ghost neutral `IconButton` with `aria-expanded`
|
|
900
|
+
* toggles the rail. Renders a small ghost neutral `IconButton` with `aria-expanded`
|
|
859
901
|
* and `aria-controls` wired to the panel's `<aside>`. Place one in
|
|
860
902
|
* `AppLayout.HeaderActions` to open the panel, and one more in
|
|
861
903
|
* `AppLayout.SidePanelHeader` with a close icon to close it from inside: when
|
|
@@ -877,7 +919,7 @@ type AppLayoutSidePanelTriggerProps = Omit<IconButtonProps, "appearance" | "asCh
|
|
|
877
919
|
* | `data-slot` | `"app-layout-side-panel-trigger-tooltip tooltip-content"` | On the tooltip surface, not the button: the styling hook for the label popup this part renders, joined ahead of `Tooltip.Content`'s own slot. |
|
|
878
920
|
* | `data-appearance` | `"filled"` \| `"ghost"` \| `"outlined"` | Read, not stamped: the underlying `IconButton` reflects its `appearance`, which this part defaults to `"ghost"`. |
|
|
879
921
|
* | `data-intent` | `"neutral"` | Read, not stamped: the underlying `IconButton` reflects its `intent`, which this part defaults to `"neutral"`. |
|
|
880
|
-
* | `data-size` | `"xs"` \| `"sm"` \| `"md"` \| `"lg"` \| `"xl"` | Read, not stamped: the underlying `IconButton` reflects its `size
|
|
922
|
+
* | `data-size` | `"xs"` \| `"sm"` \| `"md"` \| `"lg"` \| `"xl"` | Read, not stamped: the underlying `IconButton` reflects its `size`, which this part defaults to `"sm"`. |
|
|
881
923
|
* | `data-icon-button` | `"true"` | Read, not stamped: always present on the underlying `IconButton`. |
|
|
882
924
|
* | `data-loading` | present when `isLoading` | Read, not stamped: the underlying `IconButton` stamps it by presence, never `"false"`. |
|
|
883
925
|
* | `data-disabled` | present when disabled | Read, not stamped: the underlying `IconButton` stamps it by presence, never `"false"`, when it resolves disabled: `disabled`, `aria-disabled="true"`, or `isLoading` with no explicit `disabled`. |
|
|
@@ -927,7 +969,7 @@ type AppLayoutSidePanelTriggerProps = Omit<IconButtonProps, "appearance" | "asCh
|
|
|
927
969
|
* </Sidebar.Root>
|
|
928
970
|
* ```
|
|
929
971
|
*/
|
|
930
|
-
declare const SidePanelTrigger: ({ appearance, "data-slot": dataSlot, icon, intent, label, onClick, ...props }: AppLayoutSidePanelTriggerProps) => import("react").JSX.Element;
|
|
972
|
+
declare const SidePanelTrigger: ({ appearance, "data-slot": dataSlot, icon, intent, label, onClick, size, ...props }: AppLayoutSidePanelTriggerProps) => import("react").JSX.Element;
|
|
931
973
|
/**
|
|
932
974
|
* The toolbar row at the top of `AppLayout.SidePanel`: the panel's title at the
|
|
933
975
|
* start and its controls at the end, with the close control last. Render it as
|
|
@@ -944,6 +986,16 @@ declare const SidePanelTrigger: ({ appearance, "data-slot": dataSlot, icon, inte
|
|
|
944
986
|
* `<header>` inside the `<aside>` scopes to the panel and claims no landmark,
|
|
945
987
|
* so if the row introduces the panel, compose a `<header>` with `asChild`.
|
|
946
988
|
*
|
|
989
|
+
* The row is the panel's swipe handle, through `useSwipeToDismiss`, in every
|
|
990
|
+
* presentation. A drag toward the end edge follows the pointer one to one: a
|
|
991
|
+
* floating panel slides, and a panel in the lane shrinks its basis the way
|
|
992
|
+
* its own close animation does, so the page grows under the finger. A
|
|
993
|
+
* release past 25% of the panel's width, or a flick, closes it; a shorter
|
|
994
|
+
* drag springs back on the panel's own 200ms ease-out, so `motion-reduce:`
|
|
995
|
+
* turns it into a cut, and a drag the wrong way meets rubber-band
|
|
996
|
+
* resistance. The row is `touch-pan-y`, so a vertical swipe still scrolls,
|
|
997
|
+
* and a tap on a control in the row stays a tap.
|
|
998
|
+
*
|
|
947
999
|
* **CSS variables (public API):**
|
|
948
1000
|
*
|
|
949
1001
|
* | CSS Variable | Default | Description |
|
|
@@ -996,7 +1048,7 @@ declare const SidePanelTrigger: ({ appearance, "data-slot": dataSlot, icon, inte
|
|
|
996
1048
|
* </Sidebar.Root>
|
|
997
1049
|
* ```
|
|
998
1050
|
*/
|
|
999
|
-
declare const SidePanelHeader: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
1051
|
+
declare const SidePanelHeader: ({ asChild, children, className, "data-slot": dataSlot, ref, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
1000
1052
|
/**
|
|
1001
1053
|
* The scroll region of `AppLayout.SidePanel`, and the only part of the panel
|
|
1002
1054
|
* that scrolls (`scrollbar relative min-h-0 w-full flex-1 overflow-y-auto
|
|
@@ -1583,7 +1635,9 @@ declare const AppLayout: {
|
|
|
1583
1635
|
* A second card after `AppLayout.Content`, for an assistant or a details
|
|
1584
1636
|
* pane. Reads its open state from `AppLayout.SidePanelRoot`: it slides in at
|
|
1585
1637
|
* `--app-layout-side-panel-width`, collapses to nothing and goes `inert`
|
|
1586
|
-
* when closed,
|
|
1638
|
+
* when closed, floats over the card below `mobileBreakpoint` or when the
|
|
1639
|
+
* row is too narrow for the rail beside it, and covers the card as a modal
|
|
1640
|
+
* on a phone.
|
|
1587
1641
|
*
|
|
1588
1642
|
* @see https://mantle.ngrok.com/layouts/app-layout#applayoutsidepanel
|
|
1589
1643
|
*
|
|
@@ -1683,7 +1737,8 @@ declare const AppLayout: {
|
|
|
1683
1737
|
readonly SidePanelTrigger: typeof SidePanelTrigger;
|
|
1684
1738
|
/**
|
|
1685
1739
|
* The panel's toolbar row, its first child: the title at the start, the
|
|
1686
|
-
* close control at the end, on the same band as `AppLayout.Header`.
|
|
1740
|
+
* close control at the end, on the same band as `AppLayout.Header`. It is
|
|
1741
|
+
* the panel's swipe handle.
|
|
1687
1742
|
*
|
|
1688
1743
|
* @see https://mantle.ngrok.com/layouts/app-layout#applayoutsidepanelheader
|
|
1689
1744
|
*
|
package/dist/app-layout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-DdYN1L1C.js";import{t as r}from"./button-BMfUxs_j.js";import{n as i}from"./alert-vfeV_hso.js";import{t as a}from"./use-is-hydrated-after-paint-r9Cl2mGp.js";import{t as o}from"./main-CC1L9IsH.js";import{t as s}from"./tooltip-NhYXqStK.js";import{n as c}from"./cookie-ca4g5CKp.js";import{c as l}from"react/compiler-runtime";import{createContext as u,useContext as d,useId as f,useLayoutEffect as p,useRef as m,useState as h}from"react";import g from"tiny-invariant";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{SidebarSimpleIcon as y}from"@phosphor-icons/react/SidebarSimple";const b=r=>{let i=l(16),a,o,s,c,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],u=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=u);let d=a?n:`div`,f;i[6]===c?f=i[7]:(f=t(c,`app-layout`),i[6]=c,i[7]=f);let p;i[8]===s?p=i[9]:(p=e(`group/app-layout bg-base relative isolate flex h-full w-full flex-col`,`overflow-clip`,s),i[8]=s,i[9]=p);let m;return i[10]!==d||i[11]!==o||i[12]!==u||i[13]!==f||i[14]!==p?(m=/* @__PURE__ */ _(d,{"data-slot":f,className:p,...u,children:o}),i[10]=d,i[11]=o,i[12]=u,i[13]=f,i[14]=p,i[15]=m):m=i[15],m},x=r=>{let i=l(16),a,o,s,c,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],u=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=u);let d=a?n:`div`,f;i[6]===c?f=i[7]:(f=t(c,`app-layout-notice`),i[6]=c,i[7]=f);let p;i[8]===s?p=i[9]:(p=e(`flex w-full shrink-0 flex-col`,s),i[8]=s,i[9]=p);let m;return i[10]!==d||i[11]!==o||i[12]!==u||i[13]!==f||i[14]!==p?(m=/* @__PURE__ */ _(d,{"data-slot":f,className:p,...u,children:o}),i[10]=d,i[11]=o,i[12]=u,i[13]=f,i[14]=p,i[15]=m):m=i[15],m},S=r=>{let i=l(16),a,o,s,c,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],u=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=u);let d=a?n:`div`,f;i[6]===c?f=i[7]:(f=t(c,`app-layout-workspace`),i[6]=c,i[7]=f);let p;i[8]===s?p=i[9]:(p=e(`flex min-h-0 flex-1`,`min-w-0`,`relative`,`mx-auto w-full max-w-(--app-layout-max-width,128rem)`,s),i[8]=s,i[9]=p);let m;return i[10]!==d||i[11]!==o||i[12]!==u||i[13]!==f||i[14]!==p?(m=/* @__PURE__ */ _(d,{"data-slot":f,className:p,...u,children:o}),i[10]=d,i[11]=o,i[12]=u,i[13]=f,i[14]=p,i[15]=m):m=i[15],m},C=r=>{let i=l(16),a,o,s,c,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],u=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=u);let d=a?n:`div`,f;i[6]===c?f=i[7]:(f=t(c,`app-layout-content`),i[6]=c,i[7]=f);let p;i[8]===s?p=i[9]:(p=e(`bg-card border-card-muted relative flex min-w-0 flex-1 flex-col rounded-xl border shadow-sm`,`m-(--app-layout-card-gutter,0.5rem)`,`overflow-clip`,s),i[8]=s,i[9]=p);let m;return i[10]!==d||i[11]!==o||i[12]!==u||i[13]!==f||i[14]!==p?(m=/* @__PURE__ */ _(d,{"data-slot":f,className:p,...u,children:o}),i[10]=d,i[11]=o,i[12]=u,i[13]=f,i[14]=p,i[15]=m):m=i[15],m},w=`h-14 group-has-data-[slot~=sidebar-header]/app-layout:h-[calc(var(--sidebar-header-height,4.5rem)-2*var(--app-layout-card-gutter,0.5rem)-2px)]`,T=r=>{let i=l(16),a,o,s,c,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],u=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=u);let d=a?n:`div`,f;i[6]===c?f=i[7]:(f=t(c,`app-layout-header`),i[6]=c,i[7]=f);let p;i[8]===s?p=i[9]:(p=e(`border-card-muted flex shrink-0 items-center gap-2 border-b px-4`,w,s),i[8]=s,i[9]=p);let m;return i[10]!==d||i[11]!==o||i[12]!==u||i[13]!==f||i[14]!==p?(m=/* @__PURE__ */ _(d,{"data-slot":f,className:p,...u,children:o}),i[10]=d,i[11]=o,i[12]=u,i[13]=f,i[14]=p,i[15]=m):m=i[15],m},E=r=>{let i=l(16),a,o,s,c,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],u=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=u);let d=a?n:`div`,f;i[6]===c?f=i[7]:(f=t(c,`app-layout-header-start`),i[6]=c,i[7]=f);let p;i[8]===s?p=i[9]:(p=e(`flex shrink-0 items-center gap-2`,s),i[8]=s,i[9]=p);let m;return i[10]!==d||i[11]!==o||i[12]!==u||i[13]!==f||i[14]!==p?(m=/* @__PURE__ */ _(d,{"data-slot":f,className:p,...u,children:o}),i[10]=d,i[11]=o,i[12]=u,i[13]=f,i[14]=p,i[15]=m):m=i[15],m},D=r=>{let i=l(16),a,o,s,c,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],u=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=u);let d=a?n:`div`,f;i[6]===c?f=i[7]:(f=t(c,`app-layout-header-content`),i[6]=c,i[7]=f);let p;i[8]===s?p=i[9]:(p=e(`flex min-w-0 flex-1 items-center gap-2`,s),i[8]=s,i[9]=p);let m;return i[10]!==d||i[11]!==o||i[12]!==u||i[13]!==f||i[14]!==p?(m=/* @__PURE__ */ _(d,{"data-slot":f,className:p,...u,children:o}),i[10]=d,i[11]=o,i[12]=u,i[13]=f,i[14]=p,i[15]=m):m=i[15],m},O=r=>{let i=l(16),a,o,s,c,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],u=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=u);let d=a?n:`div`,f;i[6]===c?f=i[7]:(f=t(c,`app-layout-header-actions`),i[6]=c,i[7]=f);let p;i[8]===s?p=i[9]:(p=e(`ml-auto flex shrink-0 items-center gap-2`,s),i[8]=s,i[9]=p);let m;return i[10]!==d||i[11]!==o||i[12]!==u||i[13]!==f||i[14]!==p?(m=/* @__PURE__ */ _(d,{"data-slot":f,className:p,...u,children:o}),i[10]=d,i[11]=o,i[12]=u,i[13]=f,i[14]=p,i[15]=m):m=i[15],m},k=r=>{let i=l(16),a,s,c,u,d;i[0]===r?(a=i[1],s=i[2],c=i[3],u=i[4],d=i[5]):({asChild:a,children:s,className:c,"data-slot":u,...d}=r,i[0]=r,i[1]=a,i[2]=s,i[3]=c,i[4]=u,i[5]=d);let f=a?n:o,p;i[6]===u?p=i[7]:(p=t(u,`app-layout-body`),i[6]=u,i[7]=p);let m;i[8]===c?m=i[9]:(m=e(`scrollbar relative min-h-0 w-full flex-1 overflow-y-auto overscroll-none`,c),i[8]=c,i[9]=m);let h;return i[10]!==f||i[11]!==s||i[12]!==d||i[13]!==p||i[14]!==m?(h=/* @__PURE__ */ _(f,{"data-slot":p,className:m,...d,children:s}),i[10]=f,i[11]=s,i[12]=d,i[13]=p,i[14]=m,i[15]=h):h=i[15],h},A={sm:`sm:data-state-closed:basis-0 max-sm:absolute max-sm:inset-y-(--app-layout-card-gutter,0.5rem) max-sm:left-(--app-layout-card-gutter,0.5rem) max-sm:right-(--app-layout-card-gutter,0.5rem) max-sm:z-20 max-sm:my-0 max-sm:rounded-xl max-sm:shadow-lg max-sm:[--_side-panel-content-width:100%] max-sm:[--_side-panel-content-inset:0px] max-sm:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] max-sm:data-state-closed:invisible`,md:`md:data-state-closed:basis-0 max-md:absolute max-md:inset-y-(--app-layout-card-gutter,0.5rem) max-md:right-(--app-layout-card-gutter,0.5rem) max-md:z-20 max-md:my-0 max-md:w-[min(24rem,calc(100vw-5rem))] max-md:rounded-xl max-md:shadow-lg max-md:[--_side-panel-content-width:100%] max-md:[--_side-panel-content-inset:0px] max-md:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] max-md:data-state-closed:invisible max-sm:left-(--app-layout-card-gutter,0.5rem) max-sm:w-auto`,lg:`lg:data-state-closed:basis-0 max-lg:absolute max-lg:inset-y-(--app-layout-card-gutter,0.5rem) max-lg:right-(--app-layout-card-gutter,0.5rem) max-lg:z-20 max-lg:my-0 max-lg:w-[min(24rem,calc(100vw-5rem))] max-lg:rounded-xl max-lg:shadow-lg max-lg:[--_side-panel-content-width:100%] max-lg:[--_side-panel-content-inset:0px] max-lg:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] max-lg:data-state-closed:invisible max-md:left-(--app-layout-card-gutter,0.5rem) max-md:w-auto`},j=u(null);function M(){let e=d(j);return g(e,`useSidePanel must be used within AppLayout.SidePanelRoot.`),e.state}function N(e){let t=d(j);return g(t,`AppLayout.${e} must be rendered inside AppLayout.SidePanelRoot.`),t}const P=e=>{let t=l(19),{children:n,defaultOpen:r,onOpenChange:a,open:o}=e,s=r!==void 0&&r,c=f(),u=o!=null,[d,g]=h(s),v=u?o:d,y=m(a),b;t[0]===a?b=t[1]:(b=()=>{y.current=a},t[0]=a,t[1]=b),p(b);let x=m(null),S;t[2]===u?S=t[3]:(S=e=>{u||g(e),y.current?.(e)},t[2]=u,t[3]=S);let C=S,w;t[4]!==v||t[5]!==C?(w=()=>{C(!v)},t[4]=v,t[5]=C,t[6]=w):w=t[6];let T=w,E,D;t[7]!==v||t[8]!==c?(E=()=>{if(v)return;let e=x.current;if(x.current=null,e==null)return;let t=document.getElementById(c),n=document.activeElement,r=t!=null&&t.contains(n),a=n===document.body;if(!r&&!a)return;let o=document.querySelectorAll(`[aria-controls="${c}"]`);for(let e of o)if(!(t!=null&&t.contains(e)||!i(e))&&(e.focus(),document.activeElement===e))return},D=[v,c],t[7]=v,t[8]=c,t[9]=E,t[10]=D):(E=t[9],D=t[10]),p(E,D);let O;t[11]!==v||t[12]!==c||t[13]!==C||t[14]!==T?(O={lastFocusedInsideRef:x,state:{open:v,panelId:c,setOpen:C,toggle:T}},t[11]=v,t[12]=c,t[13]=C,t[14]=T,t[15]=O):O=t[15];let k=O,A;return t[16]!==n||t[17]!==k?(A=/* @__PURE__ */ _(j.Provider,{value:k,children:n}),t[16]=n,t[17]=k,t[18]=A):A=t[18],A},F=n=>{let r=l(33),i,o,s,c,u,d,f;r[0]===n?(i=r[1],o=r[2],s=r[3],c=r[4],u=r[5],d=r[6],f=r[7]):({children:i,className:o,"data-slot":s,mobileBreakpoint:f,onBlur:c,onFocus:u,...d}=n,r[0]=n,r[1]=i,r[2]=o,r[3]=s,r[4]=c,r[5]=u,r[6]=d,r[7]=f);let p=f===void 0?`lg`:f,{lastFocusedInsideRef:m,state:h}=N(`SidePanel`),{open:g,panelId:v}=h,y=a(),b;r[8]===s?b=r[9]:(b=t(s,`app-layout-side-panel`),r[8]=s,r[9]=b);let x=A[p],S;r[10]!==o||r[11]!==x?(S=e(`relative min-w-0`,`isolate`,`overflow-x-clip`,`[--_side-panel-content-width:var(--app-layout-side-panel-width,clamp(21rem,24vw,27rem))] [--_side-panel-content-inset:var(--app-layout-card-gutter,0.5rem)] [--_side-panel-box-width:calc(var(--app-layout-side-panel-width,clamp(21rem,24vw,27rem))+var(--app-layout-card-gutter,0.5rem))]`,`grow-0 shrink-0 basis-(--_side-panel-box-width)`,`my-(--app-layout-card-gutter,0.5rem) mr-0 ml-0`,`transition-[flex-basis,translate,visibility] duration-200 ease-out-strong motion-reduce:transition-none not-data-hydrated:transition-none`,`data-state-closed:pointer-events-none`,x,o),r[10]=o,r[11]=x,r[12]=S):S=r[12];let C;r[13]!==m||r[14]!==u?(C=e=>{u?.(e),m.current=e.target},r[13]=m,r[14]=u,r[15]=C):C=r[15];let w;r[16]!==m||r[17]!==c?(w=e=>{c?.(e),e.relatedTarget!=null&&!e.currentTarget.contains(e.relatedTarget)&&(m.current=null)},r[16]=m,r[17]=c,r[18]=w):w=r[18];let T=g?`open`:`closed`,E=y?``:void 0,D=!g,O;r[19]===Symbol.for(`react.memo_cache_sentinel`)?(O=e(`bg-card border-card-muted absolute inset-y-0 flex flex-col rounded-xl border shadow-sm`,`right-(--_side-panel-content-inset) w-(--_side-panel-content-width)`,`overflow-clip`),r[19]=O):O=r[19];let k;r[20]===i?k=r[21]:(k=/* @__PURE__ */ _(`div`,{className:O,children:i}),r[20]=i,r[21]=k);let j;return r[22]!==v||r[23]!==d||r[24]!==D||r[25]!==k||r[26]!==b||r[27]!==S||r[28]!==C||r[29]!==w||r[30]!==T||r[31]!==E?(j=/* @__PURE__ */ _(`aside`,{"data-slot":b,className:S,onFocus:C,onBlur:w,...d,id:v,"data-state":T,"data-hydrated":E,inert:D,children:k}),r[22]=v,r[23]=d,r[24]=D,r[25]=k,r[26]=b,r[27]=S,r[28]=C,r[29]=w,r[30]=T,r[31]=E,r[32]=j):j=r[32],j},I=/* @__PURE__ */ _(y,{mirrored:!0}),L={Root:b,Notice:x,Workspace:S,Content:C,Header:T,HeaderStart:E,HeaderContent:D,HeaderActions:O,Body:k,SidePanelRoot:P,SidePanel:F,SidePanelTrigger:e=>{let n=l(29),i,a,o,c,u,d,f;n[0]===e?(i=n[1],a=n[2],o=n[3],c=n[4],u=n[5],d=n[6],f=n[7]):({appearance:c,"data-slot":i,icon:u,intent:d,label:f,onClick:a,...o}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=o,n[4]=c,n[5]=u,n[6]=d,n[7]=f);let p=c===void 0?`ghost`:c,m=u===void 0?I:u,h=d===void 0?`neutral`:d,g=f===void 0?`Toggle side panel`:f,{open:y,panelId:b,toggle:x}=N(`SidePanelTrigger`).state,S;n[8]===i?S=n[9]:(S=t(i,`app-layout-side-panel-trigger`),n[8]=i,n[9]=S);let C=y?`open`:`closed`,w;n[10]!==a||n[11]!==x?(w=e=>{a?.(e),e.defaultPrevented||x()},n[10]=a,n[11]=x,n[12]=w):w=n[12];let T;n[13]!==p||n[14]!==m||n[15]!==h||n[16]!==g||n[17]!==y||n[18]!==b||n[19]!==o||n[20]!==S||n[21]!==C||n[22]!==w?(T=/* @__PURE__ */ _(s.Trigger,{asChild:!0,children:/* @__PURE__ */ _(r,{appearance:p,"aria-controls":b,"aria-expanded":y,"data-slot":S,"data-state":C,icon:m,intent:h,label:g,onClick:w,...o})}),n[13]=p,n[14]=m,n[15]=h,n[16]=g,n[17]=y,n[18]=b,n[19]=o,n[20]=S,n[21]=C,n[22]=w,n[23]=T):T=n[23];let E;n[24]===g?E=n[25]:(E=/* @__PURE__ */ _(s.Content,{"data-slot":`app-layout-side-panel-trigger-tooltip`,children:g}),n[24]=g,n[25]=E);let D;return n[26]!==T||n[27]!==E?(D=/* @__PURE__ */ v(s.Root,{children:[T,E]}),n[26]=T,n[27]=E,n[28]=D):D=n[28],D},SidePanelHeader:r=>{let i=l(16),a,o,s,c,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],u=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=u);let d=a?n:`div`,f;i[6]===c?f=i[7]:(f=t(c,`app-layout-side-panel-header`),i[6]=c,i[7]=f);let p;i[8]===s?p=i[9]:(p=e(`border-card-muted flex shrink-0 items-center gap-2 border-b px-4`,w,s),i[8]=s,i[9]=p);let m;return i[10]!==d||i[11]!==o||i[12]!==u||i[13]!==f||i[14]!==p?(m=/* @__PURE__ */ _(d,{"data-slot":f,className:p,...u,children:o}),i[10]=d,i[11]=o,i[12]=u,i[13]=f,i[14]=p,i[15]=m):m=i[15],m},SidePanelBody:r=>{let i=l(16),a,o,s,c,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],u=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=u);let d=a?n:`div`,f;i[6]===c?f=i[7]:(f=t(c,`app-layout-side-panel-body`),i[6]=c,i[7]=f);let p;i[8]===s?p=i[9]:(p=e(`scrollbar relative min-h-0 w-full flex-1 overflow-y-auto overscroll-none`,s),i[8]=s,i[9]=p);let m;return i[10]!==d||i[11]!==o||i[12]!==u||i[13]!==f||i[14]!==p?(m=/* @__PURE__ */ _(d,{"data-slot":f,className:p,...u,children:o}),i[10]=d,i[11]=o,i[12]=u,i[13]=f,i[14]=p,i[15]=m):m=i[15],m},SidePanelFooter:r=>{let i=l(16),a,o,s,c,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],u=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=u);let d=a?n:`div`,f;i[6]===c?f=i[7]:(f=t(c,`app-layout-side-panel-footer`),i[6]=c,i[7]=f);let p;i[8]===s?p=i[9]:(p=e(`flex shrink-0 flex-col gap-2 px-3 pb-3`,s),i[8]=s,i[9]=p);let m;return i[10]!==d||i[11]!==o||i[12]!==u||i[13]!==f||i[14]!==p?(m=/* @__PURE__ */ _(d,{"data-slot":f,className:p,...u,children:o}),i[10]=d,i[11]=o,i[12]=u,i[13]=f,i[14]=p,i[15]=m):m=i[15],m}},R=`mantle-side-panel-state`,z={closed:`closed`,open:`open`};function B(e){let t=c(e,R);if(t===z.open)return!0;if(t===z.closed)return!1}function V(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?z.open:z.closed,c=[`${R}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{L as AppLayout,R as SIDE_PANEL_STATE_COOKIE_NAME,B as extractSidePanelStateCookie,V as serializeSidePanelStateCookie,M as useSidePanel};
|
|
1
|
+
import{n as e}from"./compose-refs-sFdxsL7k.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./slot-DdYN1L1C.js";import{t as i}from"./button-BMfUxs_j.js";import{r as a}from"./alert-DO00UiQe.js";import{u as o}from"./primitive-AGoxSJBI.js";import{n as s,r as c,t as l}from"./use-swipe-to-dismiss-Cj-AayFd.js";import{t as u}from"./use-is-hydrated-after-paint-r9Cl2mGp.js";import{t as d}from"./use-matches-media-query-m860lols.js";import{t as f}from"./main-CC1L9IsH.js";import{t as p}from"./tooltip-NhYXqStK.js";import{n as m}from"./cookie-ca4g5CKp.js";import{c as h}from"react/compiler-runtime";import{createContext as g,useContext as _,useEffect as v,useId as y,useLayoutEffect as b,useRef as x,useState as S}from"react";import C from"tiny-invariant";import{jsx as w,jsxs as T}from"react/jsx-runtime";import{SidebarSimpleIcon as E}from"@phosphor-icons/react/SidebarSimple";const D=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`group/app-layout bg-base relative isolate flex h-full w-full flex-col`,`overflow-clip`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},O=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-notice`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`flex w-full shrink-0 flex-col`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},k=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-workspace`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`flex min-h-0 flex-1`,`min-w-0`,`relative`,`@container/app-layout-workspace`,`mx-auto w-full max-w-(--app-layout-max-width,128rem)`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},A=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-content`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`bg-card border-card-muted relative flex min-w-0 flex-1 flex-col rounded-xl border shadow-sm`,`m-(--app-layout-card-gutter,0.5rem)`,`overflow-clip`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},j=`h-14 group-has-data-[slot~=sidebar-header]/app-layout:h-[calc(var(--sidebar-header-height,4.5rem)-2*var(--app-layout-card-gutter,0.5rem)-2px)]`,M=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-header`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`border-card-muted flex shrink-0 items-center gap-2 border-b px-4`,j,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},N=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-header-start`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`flex shrink-0 items-center gap-2`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},P=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-header-content`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`flex min-w-0 flex-1 items-center gap-2`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},F=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-header-actions`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`ml-auto flex shrink-0 items-center gap-2`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},I=e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:f,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-body`),i[6]=c,i[7]=d);let p;i[8]===s?p=i[9]:(p=t(`scrollbar relative min-h-0 w-full flex-1 overflow-y-auto overscroll-none`,s),i[8]=s,i[9]=p);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==p?(m=/* @__PURE__ */ w(u,{"data-slot":d,className:p,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=p,i[15]=m):m=i[15],m},ee={sm:`sm:@min-side-panel-lane/app-layout-workspace:data-state-closed:basis-0 sm:[[data-slot~=app-layout-workspace]:not(:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed])))_&]:@min-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:basis-0 max-sm:absolute max-sm:inset-y-(--app-layout-card-gutter,0.5rem) max-sm:left-(--app-layout-card-gutter,0.5rem) max-sm:right-(--app-layout-card-gutter,0.5rem) max-sm:z-20 max-sm:my-0 max-sm:rounded-xl max-sm:shadow-lg max-sm:[--_side-panel-content-width:100%] max-sm:[--_side-panel-content-inset:0px] max-sm:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] max-sm:data-state-closed:invisible`,md:`md:@min-side-panel-lane/app-layout-workspace:data-state-closed:basis-0 md:[[data-slot~=app-layout-workspace]:not(:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed])))_&]:@min-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:basis-0 max-md:absolute max-md:inset-y-(--app-layout-card-gutter,0.5rem) max-md:right-(--app-layout-card-gutter,0.5rem) max-md:z-20 max-md:my-0 max-md:w-[min(24rem,calc(100cqw-5rem))] max-md:rounded-xl max-md:shadow-lg max-md:[--_side-panel-content-width:100%] max-md:[--_side-panel-content-inset:0px] max-md:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] max-md:data-state-closed:invisible max-sm:left-(--app-layout-card-gutter,0.5rem) max-sm:w-auto`,lg:`lg:@min-side-panel-lane/app-layout-workspace:data-state-closed:basis-0 lg:[[data-slot~=app-layout-workspace]:not(:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed])))_&]:@min-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:basis-0 max-lg:absolute max-lg:inset-y-(--app-layout-card-gutter,0.5rem) max-lg:right-(--app-layout-card-gutter,0.5rem) max-lg:z-20 max-lg:my-0 max-lg:w-[min(24rem,calc(100cqw-5rem))] max-lg:rounded-xl max-lg:shadow-lg max-lg:[--_side-panel-content-width:100%] max-lg:[--_side-panel-content-inset:0px] max-lg:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] max-lg:data-state-closed:invisible max-md:left-(--app-layout-card-gutter,0.5rem) max-md:w-auto`},te={sm:`sm:@max-side-panel-lane-icon-rail/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))] sm:[[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))]`,md:`sm:@max-side-panel-lane-icon-rail/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))] sm:[[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))]`,lg:`md:@max-side-panel-lane-icon-rail/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))] md:[[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:w-[min(24rem,calc(100cqw-5rem))]`},ne={sm:`(width < 40rem)`,md:`(width < 40rem)`,lg:`(width < 48rem)`};function L(e){return e!=null&&getComputedStyle(e).position===`absolute`}const R=g(null);function z(){let e=_(R);return C(e,`useSidePanel must be used within AppLayout.SidePanelRoot.`),e.state}function B(e){let t=_(R);return C(t,`AppLayout.${e} must be rendered inside AppLayout.SidePanelRoot.`),t}const V=e=>{let t=h(19),{children:n,defaultOpen:r,onOpenChange:i,open:o}=e,s=r!==void 0&&r,c=y(),l=o!=null,[u,d]=S(s),f=l?o:u,p=x(i),m;t[0]===i?m=t[1]:(m=()=>{p.current=i},t[0]=i,t[1]=m),b(m);let g=x(null),_=x(null),v;t[2]===l?v=t[3]:(v=e=>{l||d(e),p.current?.(e)},t[2]=l,t[3]=v);let C=v,T;t[4]!==f||t[5]!==C?(T=()=>{C(!f)},t[4]=f,t[5]=C,t[6]=T):T=t[6];let E=T,D,O;t[7]!==f||t[8]!==c?(D=()=>{if(f)return;let e=g.current;if(g.current=null,e==null)return;let t=document.getElementById(c),n=document.activeElement,r=t!=null&&t.contains(n),i=n===document.body;if(!r&&!i)return;let o=document.querySelectorAll(`[aria-controls="${c}"]`);for(let e of o)if(!(t!=null&&t.contains(e)||!a(e))&&(e.focus(),document.activeElement===e))return},O=[f,c],t[7]=f,t[8]=c,t[9]=D,t[10]=O):(D=t[9],O=t[10]),b(D,O);let k;t[11]!==f||t[12]!==c||t[13]!==C||t[14]!==E?(k={lastFocusedInsideRef:g,panelRef:_,state:{open:f,panelId:c,setOpen:C,toggle:E}},t[11]=f,t[12]=c,t[13]=C,t[14]=E,t[15]=k):k=t[15];let A=k,j;return t[16]!==n||t[17]!==A?(j=/* @__PURE__ */ w(R.Provider,{value:A,children:n}),t[16]=n,t[17]=A,t[18]=j):j=t[18],j},H=r=>{let i=h(48),a,l,f,p,m,g,_,y,b;i[0]===r?(a=i[1],l=i[2],f=i[3],p=i[4],m=i[5],g=i[6],_=i[7],y=i[8],b=i[9]):({children:a,className:l,"data-slot":f,mobileBreakpoint:b,onBlur:p,onFocus:m,onKeyDown:g,ref:y,..._}=r,i[0]=r,i[1]=a,i[2]=l,i[3]=f,i[4]=p,i[5]=m,i[6]=g,i[7]=_,i[8]=y,i[9]=b);let S=b===void 0?`lg`:b,{lastFocusedInsideRef:C,panelRef:T,state:E}=B(`SidePanel`),{open:D,panelId:O,setOpen:k}=E,A=u(),j=e(y,T),M=d(ne[S]),N=D&&M,P;i[10]===N?P=i[11]:(P={active:N},i[10]=N,i[11]=P),s(T,P);let F;i[12]===N?F=i[13]:(F={active:N},i[12]=N,i[13]=F),c(T,F);let I=x(!1),R,z;i[14]===T?(R=i[15],z=i[16]):(R=()=>{let e=T.current;if(e==null)return;let t=t=>{t.key===`Escape`&&(I.current=o(e,t.target))};return document.addEventListener(`keydown`,t,!0),()=>{document.removeEventListener(`keydown`,t,!0)}},z=[T],i[14]=T,i[15]=R,i[16]=z),v(R,z);let V;i[17]===f?V=i[18]:(V=n(f,`app-layout-side-panel`),i[17]=f,i[18]=V);let H=ee[S],U=te[S],W;i[19]!==l||i[20]!==H||i[21]!==U?(W=t(`relative min-w-0`,`isolate`,`overflow-x-clip`,`[--_side-panel-content-width:var(--app-layout-side-panel-width,clamp(21rem,24cqw,27rem))] [--_side-panel-content-inset:var(--app-layout-card-gutter,0.5rem)] [--_side-panel-box-width:calc(var(--app-layout-side-panel-width,clamp(21rem,24cqw,27rem))+var(--app-layout-card-gutter,0.5rem))]`,`grow-0 shrink-0 basis-(--_side-panel-box-width)`,`my-(--app-layout-card-gutter,0.5rem) mr-0 ml-0`,`transition-[flex-basis,translate,visibility] duration-200 ease-out-strong motion-reduce:transition-none not-data-hydrated:transition-none`,`data-state-closed:pointer-events-none`,H,`@max-side-panel-lane-icon-rail/app-layout-workspace:absolute @max-side-panel-lane-icon-rail/app-layout-workspace:inset-y-(--app-layout-card-gutter,0.5rem) @max-side-panel-lane-icon-rail/app-layout-workspace:right-(--app-layout-card-gutter,0.5rem) @max-side-panel-lane-icon-rail/app-layout-workspace:z-20 @max-side-panel-lane-icon-rail/app-layout-workspace:my-0 @max-side-panel-lane-icon-rail/app-layout-workspace:rounded-xl @max-side-panel-lane-icon-rail/app-layout-workspace:shadow-lg @max-side-panel-lane-icon-rail/app-layout-workspace:[--_side-panel-content-width:100%] @max-side-panel-lane-icon-rail/app-layout-workspace:[--_side-panel-content-inset:0px] @max-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] @max-side-panel-lane-icon-rail/app-layout-workspace:data-state-closed:invisible`,`[[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:absolute [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:inset-y-(--app-layout-card-gutter,0.5rem) [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:right-(--app-layout-card-gutter,0.5rem) [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:z-20 [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:my-0 [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:rounded-xl [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:shadow-lg [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:[--_side-panel-content-width:100%] [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:[--_side-panel-content-inset:0px] [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:data-state-closed:translate-x-[calc(100%+var(--app-layout-card-gutter,0.5rem))] [[data-slot~=app-layout-workspace]:has(>[data-slot~=sidebar-nav]:not([data-state~=collapsed]))_&]:@max-side-panel-lane/app-layout-workspace:data-state-closed:invisible`,U,l),i[19]=l,i[20]=H,i[21]=U,i[22]=W):W=i[22];let G;i[23]!==C||i[24]!==m?(G=e=>{m?.(e),C.current=e.target},i[23]=C,i[24]=m,i[25]=G):G=i[25];let K;i[26]!==C||i[27]!==p?(K=e=>{p?.(e),e.relatedTarget!=null&&!e.currentTarget.contains(e.relatedTarget)&&(C.current=null)},i[26]=C,i[27]=p,i[28]=K):K=i[28];let q;i[29]!==g||i[30]!==k?(q=e=>{g?.(e),!(e.defaultPrevented||e.key!==`Escape`)&&L(e.currentTarget)&&(I.current?I.current=!1:(e.preventDefault(),k(!1)))},i[29]=g,i[30]=k,i[31]=q):q=i[31];let J=D?`open`:`closed`,Y=A?``:void 0,X=!D,Z;i[32]===Symbol.for(`react.memo_cache_sentinel`)?(Z=t(`bg-card border-card-muted absolute inset-y-0 flex flex-col rounded-xl border shadow-sm`,`right-(--_side-panel-content-inset) w-(--_side-panel-content-width)`,`overflow-clip`),i[32]=Z):Z=i[32];let Q;i[33]===a?Q=i[34]:(Q=/* @__PURE__ */ w(`div`,{className:Z,children:a}),i[33]=a,i[34]=Q);let $;return i[35]!==j||i[36]!==O||i[37]!==_||i[38]!==W||i[39]!==G||i[40]!==K||i[41]!==q||i[42]!==J||i[43]!==Y||i[44]!==X||i[45]!==Q||i[46]!==V?($=/* @__PURE__ */ w(`aside`,{ref:j,"data-slot":V,className:W,onFocus:G,onBlur:K,onKeyDown:q,..._,id:O,"data-state":J,"data-hydrated":Y,inert:X,children:Q}),i[35]=j,i[36]=O,i[37]=_,i[38]=W,i[39]=G,i[40]=K,i[41]=q,i[42]=J,i[43]=Y,i[44]=X,i[45]=Q,i[46]=V,i[47]=$):$=i[47],$},U=/* @__PURE__ */ w(E,{mirrored:!0}),W={Root:D,Notice:O,Workspace:k,Content:A,Header:M,HeaderStart:N,HeaderContent:P,HeaderActions:F,Body:I,SidePanelRoot:V,SidePanel:H,SidePanelTrigger:e=>{let t=h(31),r,a,o,s,c,l,u,d;t[0]===e?(r=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8]):({appearance:s,"data-slot":r,icon:c,intent:l,label:u,onClick:a,size:d,...o}=e,t[0]=e,t[1]=r,t[2]=a,t[3]=o,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=d);let f=s===void 0?`ghost`:s,m=c===void 0?U:c,g=l===void 0?`neutral`:l,_=u===void 0?`Toggle side panel`:u,v=d===void 0?`sm`:d,{open:y,panelId:b,toggle:x}=B(`SidePanelTrigger`).state,S;t[9]===r?S=t[10]:(S=n(r,`app-layout-side-panel-trigger`),t[9]=r,t[10]=S);let C=y?`open`:`closed`,E;t[11]!==a||t[12]!==x?(E=e=>{a?.(e),e.defaultPrevented||x()},t[11]=a,t[12]=x,t[13]=E):E=t[13];let D;t[14]!==f||t[15]!==m||t[16]!==g||t[17]!==_||t[18]!==y||t[19]!==b||t[20]!==o||t[21]!==v||t[22]!==S||t[23]!==C||t[24]!==E?(D=/* @__PURE__ */ w(p.Trigger,{asChild:!0,children:/* @__PURE__ */ w(i,{appearance:f,"aria-controls":b,"aria-expanded":y,"data-slot":S,"data-state":C,icon:m,intent:g,label:_,onClick:E,size:v,...o})}),t[14]=f,t[15]=m,t[16]=g,t[17]=_,t[18]=y,t[19]=b,t[20]=o,t[21]=v,t[22]=S,t[23]=C,t[24]=E,t[25]=D):D=t[25];let O;t[26]===_?O=t[27]:(O=/* @__PURE__ */ w(p.Content,{"data-slot":`app-layout-side-panel-trigger-tooltip`,children:_}),t[26]=_,t[27]=O);let k;return t[28]!==O||t[29]!==D?(k=/* @__PURE__ */ T(p.Root,{children:[D,O]}),t[28]=O,t[29]=D,t[30]=k):k=t[30],k},SidePanelHeader:i=>{let a=h(27),o,s,c,u,d,f;a[0]===i?(o=a[1],s=a[2],c=a[3],u=a[4],d=a[5],f=a[6]):({asChild:o,children:s,className:c,"data-slot":u,ref:f,...d}=i,a[0]=i,a[1]=o,a[2]=s,a[3]=c,a[4]=u,a[5]=d,a[6]=f);let p=o?r:`div`,m=_(R),g=x(null),v=e(f,g),y=m?.panelRef,b=m?.state.setOpen,S=m!=null,C;a[7]===y?.current?C=a[8]:(C=()=>L(y?.current??null)?`translate`:`flex-basis`,a[7]=y?.current,a[8]=C);let T;a[9]===b?T=a[10]:(T=()=>{b?.(!1)},a[9]=b,a[10]=T);let E;a[11]!==y||a[12]!==S||a[13]!==C||a[14]!==T?(E={target:y,active:S,property:C,onDismiss:T},a[11]=y,a[12]=S,a[13]=C,a[14]=T,a[15]=E):E=a[15],l(g,E);let D;a[16]===u?D=a[17]:(D=n(u,`app-layout-side-panel-header`),a[16]=u,a[17]=D);let O;a[18]===c?O=a[19]:(O=t(`border-card-muted flex shrink-0 items-center gap-2 border-b px-4`,`touch-pan-y`,j,c),a[18]=c,a[19]=O);let k;return a[20]!==p||a[21]!==s||a[22]!==v||a[23]!==d||a[24]!==D||a[25]!==O?(k=/* @__PURE__ */ w(p,{ref:v,"data-slot":D,className:O,...d,children:s}),a[20]=p,a[21]=s,a[22]=v,a[23]=d,a[24]=D,a[25]=O,a[26]=k):k=a[26],k},SidePanelBody:e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-side-panel-body`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`scrollbar relative min-h-0 w-full flex-1 overflow-y-auto overscroll-none`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},SidePanelFooter:e=>{let i=h(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({asChild:a,children:o,className:s,"data-slot":c,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===c?d=i[7]:(d=n(c,`app-layout-side-panel-footer`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=t(`flex shrink-0 flex-col gap-2 px-3 pb-3`,s),i[8]=s,i[9]=f);let p;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ w(u,{"data-slot":d,className:f,...l,children:o}),i[10]=u,i[11]=o,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p}},G=`mantle-side-panel-state`,K={closed:`closed`,open:`open`};function q(e){let t=m(e,G);if(t===K.open)return!0;if(t===K.closed)return!1}function J(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?K.open:K.closed,c=[`${G}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{W as AppLayout,G as SIDE_PANEL_STATE_COOKIE_NAME,q as extractSidePanelStateCookie,J as serializeSidePanelStateCookie,z as useSidePanel};
|
package/dist/card.d.ts
CHANGED
|
@@ -130,6 +130,13 @@ declare const Title: ({ "data-slot": dataSlot, className, asChild, ref, ...props
|
|
|
130
130
|
/**
|
|
131
131
|
* A container that displays content in a box resembling a physical card.
|
|
132
132
|
*
|
|
133
|
+
* @useWhen Group related content in a raised box, with an optional header and footer.
|
|
134
|
+
*
|
|
135
|
+
* @siblings
|
|
136
|
+
* - `Well`: the content is secondary and sits inset in the page, such as a code sample, a note, or a read-only summary.
|
|
137
|
+
* - `Separator`: adjacent content needs a divider and no box.
|
|
138
|
+
* - `MediaObject`: an icon or a figure sits beside a block of text, with no border.
|
|
139
|
+
*
|
|
133
140
|
* @see https://mantle.ngrok.com/components/structure/card
|
|
134
141
|
*
|
|
135
142
|
* @example
|
package/dist/combobox.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
2
|
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
3
3
|
import { o as WithValidation } from "./field-7QeiTFwl.js";
|
|
4
|
-
import { n as Separator } from "./separator-
|
|
4
|
+
import { n as Separator } from "./separator-BWGjCIl7.js";
|
|
5
5
|
import { ComponentProps } from "react";
|
|
6
6
|
import { ComboboxGroupLabelProps, ComboboxGroupProps, ComboboxItemProps, ComboboxItemValueProps, ComboboxPopoverProps, ComboboxProps, ComboboxProviderProps } from "@ariakit/react/combobox";
|
|
7
7
|
//#region src/components/combobox/combobox.d.ts
|
package/dist/command.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./slot-DdYN1L1C.js";import{t as i}from"./use-is-hydrated-DDCqXmju.js";import{n as a}from"./separator-DvPe27fH.js";import{t as o}from"./dialog-BDzapPLR.js";import{n as s,t as c}from"./use-is-apple-platform-CMPzIYjz.js";import{t as l}from"./use-callback-ref-BvVyI5K1.js";import{t as u}from"./kbd-CLHsJ99p.js";import{c as d}from"react/compiler-runtime";import{createContext as f,useContext as p,useEffect as m,useRef as h,useState as g}from"react";import _ from"tiny-invariant";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{MagnifyingGlassIcon as b}from"@phosphor-icons/react/MagnifyingGlass";import{Command as x,useCommandState as S}from"cmdk";const C=f(null);function w(){let e=p(C);return _(e,`useCommandDialog must be used within Command.DialogRoot.`),e}function T(){return p(C)}function E(e){let t=p(C);return _(t,`Command.${e} must be rendered inside Command.DialogRoot.`),t}const D=/* @__PURE__ */ new Set([` `,`Enter`]);function O(e){return e.isComposing||e.key===`Process`||e.keyCode===229?{type:`open`}:e.metaKey||e.ctrlKey||e.altKey||D.has(e.key)?{type:`ignore`}:[...e.key].length===1?{type:`seed`,query:e.key}:{type:`ignore`}}function k(e){let t=(e.clipboardData?.getData(`text/plain`)??``).replace(/\s+/g,` `).trim();return t===``?{type:`open`}:{type:`seed`,query:t}}const A=e=>{let t=d(25),i,a,s,l,u,f;t[0]===e?(i=t[1],a=t[2],s=t[3],l=t[4],u=t[5],f=t[6]):({"aria-keyshortcuts":i,children:a,"data-slot":s,onKeyDown:l,onPaste:u,...f}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=s,t[4]=l,t[5]=u,t[6]=f);let{keyboardShortcut:p,open:m,openWithQuery:h}=E(`SearchTrigger`),g=c(),_;t[7]===h?_=t[8]:(_=e=>{e.type!==`ignore`&&h(e.type===`seed`?e.query:void 0)},t[7]=h,t[8]=_);let y=_,b=i??(p?g?`Meta+K`:`Control+K`:void 0),x;t[9]===s?x=t[10]:(x=n(s,`command-search-trigger`),t[9]=s,t[10]=x);let S=m?`open`:`closed`,C;t[11]!==y||t[12]!==l?(C=e=>{if(l?.(e),e.defaultPrevented)return;let t=O(e.nativeEvent);t.type===`seed`&&e.preventDefault(),y(t)},t[11]=y,t[12]=l,t[13]=C):C=t[13];let w;t[14]!==y||t[15]!==u?(w=e=>{u?.(e),!e.defaultPrevented&&y(k(e.nativeEvent))},t[14]=y,t[15]=u,t[16]=w):w=t[16];let T;return t[17]!==a||t[18]!==f||t[19]!==b||t[20]!==x||t[21]!==S||t[22]!==C||t[23]!==w?(T=/* @__PURE__ */ v(o.Trigger,{asChild:!0,children:/* @__PURE__ */ v(r,{...f,"aria-keyshortcuts":b,"data-slot":x,"data-state":S,onKeyDown:C,onPaste:w,children:a})}),t[17]=a,t[18]=f,t[19]=b,t[20]=x,t[21]=S,t[22]=C,t[23]=w,t[24]=T):T=t[24],T},j=[];function M(){let e=Symbol(`command-keyboard-shortcut`);return j.push(e),{isOwner:()=>j[0]===e,release:()=>{let t=j.indexOf(e);t!==-1&&j.splice(t,1)}}}function N(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`TEXTAREA`:!1}function P(e){let t=d(4),{enabled:n,onTrigger:r}=e,i=l(r),a,o;t[0]!==n||t[1]!==i?(a=()=>{if(!n)return;let e=M(),t=s(),r=n=>{if(!e.isOwner()||n.defaultPrevented||n.repeat||N(n.target))return;let r=t?n.metaKey:n.ctrlKey,a=t?n.ctrlKey:n.metaKey;n.key?.toLowerCase()===`k`&&r&&!a&&!n.altKey&&!n.shiftKey&&(n.preventDefault(),i())};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),e.release()}},o=[n,i],t[0]=n,t[1]=i,t[2]=a,t[3]=o):(a=t[2],o=t[3]),m(a,o)}const F=e=>{let r=d(12),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({"data-slot":a,className:i,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===a?s=r[5]:(s=n(a,`command`),r[4]=a,r[5]=s);let c;r[6]===i?c=r[7]:(c=t(`bg-popover flex h-full w-full flex-col overflow-hidden rounded-md`,i),r[6]=i,r[7]=c);let l;return r[8]!==o||r[9]!==s||r[10]!==c?(l=/* @__PURE__ */ v(x,{"data-slot":s,className:c,...o}),r[8]=o,r[9]=s,r[10]=c,r[11]=l):l=r[11],l},I={Root:F,DialogRoot:t=>{let n=d(36),r,i,a,s,c,l;n[0]===t?(r=n[1],i=n[2],a=n[3],s=n[4],c=n[5],l=n[6]):({children:r,defaultOpen:c,keyboardShortcut:l,onOpenChange:i,open:a,...s}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=a,n[4]=s,n[5]=c,n[6]=l);let u=c!==void 0&&c,f=l===void 0||l,p=a!=null,[m,_]=g(u),y=p?a:m,[b,x]=g(``),S=h(i),w;n[7]===i?w=n[8]:(w=()=>{S.current=i},n[7]=i,n[8]=w),e(w);let T;n[9]===p?T=n[10]:(T=(e,t)=>{e&&x(t??``),p||_(e),S.current?.(e)},n[9]=p,n[10]=T);let E=T,D;n[11]===E?D=n[12]:(D=e=>{E(e)},n[11]=E,n[12]=D);let O=D,k;n[13]===E?k=n[14]:(k=e=>{E(!0,e)},n[13]=E,n[14]=k);let A=k,j;n[15]!==E||n[16]!==y?(j=()=>{E(!y)},n[15]=E,n[16]=y,n[17]=j):j=n[17];let M=j,N;n[18]!==f||n[19]!==M?(N={enabled:f,onTrigger:M},n[18]=f,n[19]=M,n[20]=N):N=n[20],P(N);let F;n[21]!==f||n[22]!==y||n[23]!==A||n[24]!==b||n[25]!==O||n[26]!==M?(F={keyboardShortcut:f,open:y,openWithQuery:A,query:b,setOpen:O,setQuery:x,toggle:M},n[21]=f,n[22]=y,n[23]=A,n[24]=b,n[25]=O,n[26]=M,n[27]=F):F=n[27];let I=F,L;n[28]!==r||n[29]!==y||n[30]!==s||n[31]!==O?(L=/* @__PURE__ */ v(o.Root,{open:y,onOpenChange:O,...s,children:r}),n[28]=r,n[29]=y,n[30]=s,n[31]=O,n[32]=L):L=n[32];let R;return n[33]!==I||n[34]!==L?(R=/* @__PURE__ */ v(C.Provider,{value:I,children:L}),n[33]=I,n[34]=L,n[35]=R):R=n[35],R},SearchTrigger:A,DialogTrigger:o.Trigger,DialogContent:e=>{let n=d(21),{children:r,className:i,description:a,filter:s,shouldFilter:c,showCloseButton:l,title:u}=e,f=a===void 0?`Search for a command to run...`:a,p=l===void 0||l,m=u===void 0?`Command Palette`:u,g=h(null),_;n[0]===i?_=n[1]:(_=t(`overflow-hidden p-0 relative`,i),n[0]=i,n[1]=_);let b;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>{let t=g.current?.querySelector(`[data-slot~="command-input"]`);if(!(t instanceof HTMLInputElement)||t.disabled)return;e.preventDefault(),t.focus({preventScroll:!0});let n=t.value.length;t.setSelectionRange(n,n)},n[2]=b):b=n[2];let x;n[3]===m?x=n[4]:(x=/* @__PURE__ */ v(o.Title,{children:m}),n[3]=m,n[4]=x);let S;n[5]===f?S=n[6]:(S=/* @__PURE__ */ v(o.Description,{children:f}),n[5]=f,n[6]=S);let C;n[7]!==x||n[8]!==S?(C=/* @__PURE__ */ y(o.Header,{className:`sr-only absolute`,children:[x,S]}),n[7]=x,n[8]=S,n[9]=C):C=n[9];let w;n[10]!==r||n[11]!==s||n[12]!==c?(w=/* @__PURE__ */ v(F,{className:`**:data-[slot=command-input-wrapper]:h-12 **:[[cmdk-input]]:h-12 **:data-[slot=command-group]:px-2 **:data-[slot=command-list]:pb-1`,filter:s,shouldFilter:c,children:r}),n[10]=r,n[11]=s,n[12]=c,n[13]=w):w=n[13];let T;n[14]===p?T=n[15]:(T=p&&/* @__PURE__ */ v(`div`,{className:`absolute top-1.5 right-1.5`,children:/* @__PURE__ */ v(o.CloseIconButton,{})}),n[14]=p,n[15]=T);let E;return n[16]!==T||n[17]!==_||n[18]!==C||n[19]!==w?(E=/* @__PURE__ */ y(o.Content,{ref:g,className:_,onOpenAutoFocus:b,children:[C,w,T]}),n[16]=T,n[17]=_,n[18]=C,n[19]=w,n[20]=E):E=n[20],E},Input:e=>{let r=d(25),i,a,o,s,c,l;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4],c=r[5],l=r[6]):({className:i,"data-slot":a,onValueChange:o,ref:c,value:l,...s}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=c,r[6]=l);let u=T(),f=l!=null,p=f?l:u?.query,m;r[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=/* @__PURE__ */ v(b,{"aria-hidden":!0,className:`size-5 shrink-0 opacity-50`}),r[7]=m):m=r[7];let h;r[8]===i?h=r[9]:(h=t(`placeholder:text-muted flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,i),r[8]=i,r[9]=h);let g;r[10]!==u||r[11]!==f||r[12]!==o?(g=e=>{f||u?.setQuery(e),o?.(e)},r[10]=u,r[11]=f,r[12]=o,r[13]=g):g=r[13];let _;r[14]===a?_=r[15]:(_=n(a,`command-input`),r[14]=a,r[15]=_);let S;r[16]!==s||r[17]!==p||r[18]!==h||r[19]!==g||r[20]!==_?(S=/* @__PURE__ */ v(x.Input,{className:h,onValueChange:g,value:p,...s,"data-slot":_}),r[16]=s,r[17]=p,r[18]=h,r[19]=g,r[20]=_,r[21]=S):S=r[21];let C;return r[22]!==c||r[23]!==S?(C=/* @__PURE__ */ y(`div`,{ref:c,"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b border-popover px-3`,children:[m,S]}),r[22]=c,r[23]=S,r[24]=C):C=r[24],C},List:e=>{let r=d(12),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({"data-slot":a,className:i,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===a?s=r[5]:(s=n(a,`command-list`),r[4]=a,r[5]=s);let c;r[6]===i?c=r[7]:(c=t(`max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto scrollbar`,i),r[6]=i,r[7]=c);let l;return r[8]!==o||r[9]!==s||r[10]!==c?(l=/* @__PURE__ */ v(x.List,{"data-slot":s,className:c,...o}),r[8]=o,r[9]=s,r[10]=c,r[11]=l):l=r[11],l},Empty:e=>{let r=d(12),a,o,s;if(r[0]===e?(a=r[1],o=r[2],s=r[3]):({"data-slot":o,className:a,...s}=e,r[0]=e,r[1]=a,r[2]=o,r[3]=s),!i())return null;let c;r[4]===o?c=r[5]:(c=n(o,`command-empty`),r[4]=o,r[5]=c);let l;r[6]===a?l=r[7]:(l=t(`py-6 text-center text-sm`,a),r[6]=a,r[7]=l);let u;return r[8]!==s||r[9]!==c||r[10]!==l?(u=/* @__PURE__ */ v(x.Empty,{"data-slot":c,className:l,...s}),r[8]=s,r[9]=c,r[10]=l,r[11]=u):u=r[11],u},Group:e=>{let r=d(12),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({"data-slot":a,className:i,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===a?s=r[5]:(s=n(a,`command-group`),r[4]=a,r[5]=s);let c;r[6]===i?c=r[7]:(c=t(`[&>[cmdk-group-heading]]:text-muted overflow-hidden p-1 [&>[cmdk-group-heading]]:px-2 [&>[cmdk-group-heading]]:py-1.5 [&>[cmdk-group-heading]]:text-xs [&>[cmdk-group-heading]]:font-medium`,i),r[6]=i,r[7]=c);let l;return r[8]!==o||r[9]!==s||r[10]!==c?(l=/* @__PURE__ */ v(x.Group,{"data-slot":s,className:c,...o}),r[8]=o,r[9]=s,r[10]=c,r[11]=l):l=r[11],l},Item:e=>{let r=d(12),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({"data-slot":a,className:i,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===a?s=r[5]:(s=n(a,`command-item`),r[4]=a,r[5]=s);let c;r[6]===i?c=r[7]:(c=t(`data-[selected=true]:bg-active-menu-item [:where(&_svg)]:text-muted relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [:where(&_svg)]:size-5`,i),r[6]=i,r[7]=c);let l;return r[8]!==o||r[9]!==s||r[10]!==c?(l=/* @__PURE__ */ v(x.Item,{"data-slot":s,className:c,...o}),r[8]=o,r[9]=s,r[10]=c,r[11]=l):l=r[11],l},Shortcut:e=>{let r=d(12),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({"data-slot":a,className:i,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===a?s=r[5]:(s=n(a,`command-shortcut`),r[4]=a,r[5]=s);let c;r[6]===i?c=r[7]:(c=t(`text-muted ml-auto text-xs tracking-widest`,i),r[6]=i,r[7]=c);let l;return r[8]!==o||r[9]!==s||r[10]!==c?(l=/* @__PURE__ */ v(`span`,{"data-slot":s,className:c,...o,translate:`no`}),r[8]=o,r[9]=s,r[10]=c,r[11]=l):l=r[11],l},Separator:e=>{let r=d(14),i,o,s;r[0]===e?(i=r[1],o=r[2],s=r[3]):({"data-slot":o,className:i,...s}=e,r[0]=e,r[1]=i,r[2]=o,r[3]=s);let c;r[4]===o?c=r[5]:(c=n(o,`command-separator`),r[4]=o,r[5]=c);let l;r[6]===i?l=r[7]:(l=t(`-mx-1 my-1 w-auto`,i),r[6]=i,r[7]=l);let u;r[8]===l?u=r[9]:(u=/* @__PURE__ */ v(a,{className:l}),r[8]=l,r[9]=u);let f;return r[10]!==s||r[11]!==c||r[12]!==u?(f=/* @__PURE__ */ v(x.Separator,{"data-slot":c,asChild:!0,...s,children:u}),r[10]=s,r[11]=c,r[12]=u,r[13]=f):f=r[13],f}};function L(e){let r=d(19),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({"data-slot":a,className:i,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let s=c(),l=s?`⌘`:`⌃`,f=s?`Command`:`Control`,p;r[4]===a?p=r[5]:(p=n(a,`meta-key`),r[4]=a,r[5]=p);let m=l===`⌃`&&`font-medium`,h;r[6]!==i||r[7]!==m?(h=t(m,i),r[6]=i,r[7]=m,r[8]=h):h=r[8];let g;r[9]===f?g=r[10]:(g=/* @__PURE__ */ v(`span`,{className:`sr-only`,children:f}),r[9]=f,r[10]=g);let _;r[11]===l?_=r[12]:(_=/* @__PURE__ */ v(`span`,{"aria-hidden":!0,children:l}),r[11]=l,r[12]=_);let b;return r[13]!==o||r[14]!==p||r[15]!==h||r[16]!==g||r[17]!==_?(b=/* @__PURE__ */ y(u,{...o,suppressHydrationWarning:!0,"data-slot":p,className:h,children:[g,_]}),r[13]=o,r[14]=p,r[15]=h,r[16]=g,r[17]=_,r[18]=b):b=r[18],b}export{I as Command,L as MetaKey,O as searchActionFromKeyDown,k as searchActionFromPaste,w as useCommandDialog,S as useCommandState};
|
|
1
|
+
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./slot-DdYN1L1C.js";import{t as i}from"./use-is-hydrated-DDCqXmju.js";import{n as a}from"./separator-DvPe27fH.js";import{t as o}from"./dialog-CaGJD02w.js";import{n as s,t as c}from"./use-is-apple-platform-CMPzIYjz.js";import{t as l}from"./use-callback-ref-BvVyI5K1.js";import{t as u}from"./kbd-CLHsJ99p.js";import{c as d}from"react/compiler-runtime";import{createContext as f,useContext as p,useEffect as m,useRef as h,useState as g}from"react";import _ from"tiny-invariant";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{MagnifyingGlassIcon as b}from"@phosphor-icons/react/MagnifyingGlass";import{Command as x,useCommandState as S}from"cmdk";const C=f(null);function w(){let e=p(C);return _(e,`useCommandDialog must be used within Command.DialogRoot.`),e}function T(){return p(C)}function E(e){let t=p(C);return _(t,`Command.${e} must be rendered inside Command.DialogRoot.`),t}const D=/* @__PURE__ */ new Set([` `,`Enter`]);function O(e){return e.isComposing||e.key===`Process`||e.keyCode===229?{type:`open`}:e.metaKey||e.ctrlKey||e.altKey||D.has(e.key)?{type:`ignore`}:[...e.key].length===1?{type:`seed`,query:e.key}:{type:`ignore`}}function k(e){let t=(e.clipboardData?.getData(`text/plain`)??``).replace(/\s+/g,` `).trim();return t===``?{type:`open`}:{type:`seed`,query:t}}const A=e=>{let t=d(25),i,a,s,l,u,f;t[0]===e?(i=t[1],a=t[2],s=t[3],l=t[4],u=t[5],f=t[6]):({"aria-keyshortcuts":i,children:a,"data-slot":s,onKeyDown:l,onPaste:u,...f}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=s,t[4]=l,t[5]=u,t[6]=f);let{keyboardShortcut:p,open:m,openWithQuery:h}=E(`SearchTrigger`),g=c(),_;t[7]===h?_=t[8]:(_=e=>{e.type!==`ignore`&&h(e.type===`seed`?e.query:void 0)},t[7]=h,t[8]=_);let y=_,b=i??(p?g?`Meta+K`:`Control+K`:void 0),x;t[9]===s?x=t[10]:(x=n(s,`command-search-trigger`),t[9]=s,t[10]=x);let S=m?`open`:`closed`,C;t[11]!==y||t[12]!==l?(C=e=>{if(l?.(e),e.defaultPrevented)return;let t=O(e.nativeEvent);t.type===`seed`&&e.preventDefault(),y(t)},t[11]=y,t[12]=l,t[13]=C):C=t[13];let w;t[14]!==y||t[15]!==u?(w=e=>{u?.(e),!e.defaultPrevented&&y(k(e.nativeEvent))},t[14]=y,t[15]=u,t[16]=w):w=t[16];let T;return t[17]!==a||t[18]!==f||t[19]!==b||t[20]!==x||t[21]!==S||t[22]!==C||t[23]!==w?(T=/* @__PURE__ */ v(o.Trigger,{asChild:!0,children:/* @__PURE__ */ v(r,{...f,"aria-keyshortcuts":b,"data-slot":x,"data-state":S,onKeyDown:C,onPaste:w,children:a})}),t[17]=a,t[18]=f,t[19]=b,t[20]=x,t[21]=S,t[22]=C,t[23]=w,t[24]=T):T=t[24],T},j=[];function M(){let e=Symbol(`command-keyboard-shortcut`);return j.push(e),{isOwner:()=>j[0]===e,release:()=>{let t=j.indexOf(e);t!==-1&&j.splice(t,1)}}}function N(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`TEXTAREA`:!1}function P(e){let t=d(4),{enabled:n,onTrigger:r}=e,i=l(r),a,o;t[0]!==n||t[1]!==i?(a=()=>{if(!n)return;let e=M(),t=s(),r=n=>{if(!e.isOwner()||n.defaultPrevented||n.repeat||N(n.target))return;let r=t?n.metaKey:n.ctrlKey,a=t?n.ctrlKey:n.metaKey;n.key?.toLowerCase()===`k`&&r&&!a&&!n.altKey&&!n.shiftKey&&(n.preventDefault(),i())};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),e.release()}},o=[n,i],t[0]=n,t[1]=i,t[2]=a,t[3]=o):(a=t[2],o=t[3]),m(a,o)}const F=e=>{let r=d(12),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({"data-slot":a,className:i,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===a?s=r[5]:(s=n(a,`command`),r[4]=a,r[5]=s);let c;r[6]===i?c=r[7]:(c=t(`bg-popover flex h-full w-full flex-col overflow-hidden rounded-md`,i),r[6]=i,r[7]=c);let l;return r[8]!==o||r[9]!==s||r[10]!==c?(l=/* @__PURE__ */ v(x,{"data-slot":s,className:c,...o}),r[8]=o,r[9]=s,r[10]=c,r[11]=l):l=r[11],l},I={Root:F,DialogRoot:t=>{let n=d(36),r,i,a,s,c,l;n[0]===t?(r=n[1],i=n[2],a=n[3],s=n[4],c=n[5],l=n[6]):({children:r,defaultOpen:c,keyboardShortcut:l,onOpenChange:i,open:a,...s}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=a,n[4]=s,n[5]=c,n[6]=l);let u=c!==void 0&&c,f=l===void 0||l,p=a!=null,[m,_]=g(u),y=p?a:m,[b,x]=g(``),S=h(i),w;n[7]===i?w=n[8]:(w=()=>{S.current=i},n[7]=i,n[8]=w),e(w);let T;n[9]===p?T=n[10]:(T=(e,t)=>{e&&x(t??``),p||_(e),S.current?.(e)},n[9]=p,n[10]=T);let E=T,D;n[11]===E?D=n[12]:(D=e=>{E(e)},n[11]=E,n[12]=D);let O=D,k;n[13]===E?k=n[14]:(k=e=>{E(!0,e)},n[13]=E,n[14]=k);let A=k,j;n[15]!==E||n[16]!==y?(j=()=>{E(!y)},n[15]=E,n[16]=y,n[17]=j):j=n[17];let M=j,N;n[18]!==f||n[19]!==M?(N={enabled:f,onTrigger:M},n[18]=f,n[19]=M,n[20]=N):N=n[20],P(N);let F;n[21]!==f||n[22]!==y||n[23]!==A||n[24]!==b||n[25]!==O||n[26]!==M?(F={keyboardShortcut:f,open:y,openWithQuery:A,query:b,setOpen:O,setQuery:x,toggle:M},n[21]=f,n[22]=y,n[23]=A,n[24]=b,n[25]=O,n[26]=M,n[27]=F):F=n[27];let I=F,L;n[28]!==r||n[29]!==y||n[30]!==s||n[31]!==O?(L=/* @__PURE__ */ v(o.Root,{open:y,onOpenChange:O,...s,children:r}),n[28]=r,n[29]=y,n[30]=s,n[31]=O,n[32]=L):L=n[32];let R;return n[33]!==I||n[34]!==L?(R=/* @__PURE__ */ v(C.Provider,{value:I,children:L}),n[33]=I,n[34]=L,n[35]=R):R=n[35],R},SearchTrigger:A,DialogTrigger:o.Trigger,DialogContent:e=>{let n=d(21),{children:r,className:i,description:a,filter:s,shouldFilter:c,showCloseButton:l,title:u}=e,f=a===void 0?`Search for a command to run...`:a,p=l===void 0||l,m=u===void 0?`Command Palette`:u,g=h(null),_;n[0]===i?_=n[1]:(_=t(`overflow-hidden p-0 relative`,i),n[0]=i,n[1]=_);let b;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>{let t=g.current?.querySelector(`[data-slot~="command-input"]`);if(!(t instanceof HTMLInputElement)||t.disabled)return;e.preventDefault(),t.focus({preventScroll:!0});let n=t.value.length;t.setSelectionRange(n,n)},n[2]=b):b=n[2];let x;n[3]===m?x=n[4]:(x=/* @__PURE__ */ v(o.Title,{children:m}),n[3]=m,n[4]=x);let S;n[5]===f?S=n[6]:(S=/* @__PURE__ */ v(o.Description,{children:f}),n[5]=f,n[6]=S);let C;n[7]!==x||n[8]!==S?(C=/* @__PURE__ */ y(o.Header,{className:`sr-only absolute`,children:[x,S]}),n[7]=x,n[8]=S,n[9]=C):C=n[9];let w;n[10]!==r||n[11]!==s||n[12]!==c?(w=/* @__PURE__ */ v(F,{className:`**:data-[slot=command-input-wrapper]:h-12 **:[[cmdk-input]]:h-12 **:data-[slot=command-group]:px-2 **:data-[slot=command-list]:pb-1`,filter:s,shouldFilter:c,children:r}),n[10]=r,n[11]=s,n[12]=c,n[13]=w):w=n[13];let T;n[14]===p?T=n[15]:(T=p&&/* @__PURE__ */ v(`div`,{className:`absolute top-1.5 right-1.5`,children:/* @__PURE__ */ v(o.CloseIconButton,{})}),n[14]=p,n[15]=T);let E;return n[16]!==T||n[17]!==_||n[18]!==C||n[19]!==w?(E=/* @__PURE__ */ y(o.Content,{ref:g,className:_,onOpenAutoFocus:b,children:[C,w,T]}),n[16]=T,n[17]=_,n[18]=C,n[19]=w,n[20]=E):E=n[20],E},Input:e=>{let r=d(25),i,a,o,s,c,l;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4],c=r[5],l=r[6]):({className:i,"data-slot":a,onValueChange:o,ref:c,value:l,...s}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=c,r[6]=l);let u=T(),f=l!=null,p=f?l:u?.query,m;r[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=/* @__PURE__ */ v(b,{"aria-hidden":!0,className:`size-5 shrink-0 opacity-50`}),r[7]=m):m=r[7];let h;r[8]===i?h=r[9]:(h=t(`placeholder:text-muted flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,i),r[8]=i,r[9]=h);let g;r[10]!==u||r[11]!==f||r[12]!==o?(g=e=>{f||u?.setQuery(e),o?.(e)},r[10]=u,r[11]=f,r[12]=o,r[13]=g):g=r[13];let _;r[14]===a?_=r[15]:(_=n(a,`command-input`),r[14]=a,r[15]=_);let S;r[16]!==s||r[17]!==p||r[18]!==h||r[19]!==g||r[20]!==_?(S=/* @__PURE__ */ v(x.Input,{className:h,onValueChange:g,value:p,...s,"data-slot":_}),r[16]=s,r[17]=p,r[18]=h,r[19]=g,r[20]=_,r[21]=S):S=r[21];let C;return r[22]!==c||r[23]!==S?(C=/* @__PURE__ */ y(`div`,{ref:c,"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b border-popover px-3`,children:[m,S]}),r[22]=c,r[23]=S,r[24]=C):C=r[24],C},List:e=>{let r=d(12),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({"data-slot":a,className:i,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===a?s=r[5]:(s=n(a,`command-list`),r[4]=a,r[5]=s);let c;r[6]===i?c=r[7]:(c=t(`max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto scrollbar`,i),r[6]=i,r[7]=c);let l;return r[8]!==o||r[9]!==s||r[10]!==c?(l=/* @__PURE__ */ v(x.List,{"data-slot":s,className:c,...o}),r[8]=o,r[9]=s,r[10]=c,r[11]=l):l=r[11],l},Empty:e=>{let r=d(12),a,o,s;if(r[0]===e?(a=r[1],o=r[2],s=r[3]):({"data-slot":o,className:a,...s}=e,r[0]=e,r[1]=a,r[2]=o,r[3]=s),!i())return null;let c;r[4]===o?c=r[5]:(c=n(o,`command-empty`),r[4]=o,r[5]=c);let l;r[6]===a?l=r[7]:(l=t(`py-6 text-center text-sm`,a),r[6]=a,r[7]=l);let u;return r[8]!==s||r[9]!==c||r[10]!==l?(u=/* @__PURE__ */ v(x.Empty,{"data-slot":c,className:l,...s}),r[8]=s,r[9]=c,r[10]=l,r[11]=u):u=r[11],u},Group:e=>{let r=d(12),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({"data-slot":a,className:i,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===a?s=r[5]:(s=n(a,`command-group`),r[4]=a,r[5]=s);let c;r[6]===i?c=r[7]:(c=t(`[&>[cmdk-group-heading]]:text-muted overflow-hidden p-1 [&>[cmdk-group-heading]]:px-2 [&>[cmdk-group-heading]]:py-1.5 [&>[cmdk-group-heading]]:text-xs [&>[cmdk-group-heading]]:font-medium`,i),r[6]=i,r[7]=c);let l;return r[8]!==o||r[9]!==s||r[10]!==c?(l=/* @__PURE__ */ v(x.Group,{"data-slot":s,className:c,...o}),r[8]=o,r[9]=s,r[10]=c,r[11]=l):l=r[11],l},Item:e=>{let r=d(12),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({"data-slot":a,className:i,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===a?s=r[5]:(s=n(a,`command-item`),r[4]=a,r[5]=s);let c;r[6]===i?c=r[7]:(c=t(`data-[selected=true]:bg-active-menu-item [:where(&_svg)]:text-muted relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [:where(&_svg)]:size-5`,i),r[6]=i,r[7]=c);let l;return r[8]!==o||r[9]!==s||r[10]!==c?(l=/* @__PURE__ */ v(x.Item,{"data-slot":s,className:c,...o}),r[8]=o,r[9]=s,r[10]=c,r[11]=l):l=r[11],l},Shortcut:e=>{let r=d(12),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({"data-slot":a,className:i,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===a?s=r[5]:(s=n(a,`command-shortcut`),r[4]=a,r[5]=s);let c;r[6]===i?c=r[7]:(c=t(`text-muted ml-auto text-xs tracking-widest`,i),r[6]=i,r[7]=c);let l;return r[8]!==o||r[9]!==s||r[10]!==c?(l=/* @__PURE__ */ v(`span`,{"data-slot":s,className:c,...o,translate:`no`}),r[8]=o,r[9]=s,r[10]=c,r[11]=l):l=r[11],l},Separator:e=>{let r=d(14),i,o,s;r[0]===e?(i=r[1],o=r[2],s=r[3]):({"data-slot":o,className:i,...s}=e,r[0]=e,r[1]=i,r[2]=o,r[3]=s);let c;r[4]===o?c=r[5]:(c=n(o,`command-separator`),r[4]=o,r[5]=c);let l;r[6]===i?l=r[7]:(l=t(`-mx-1 my-1 w-auto`,i),r[6]=i,r[7]=l);let u;r[8]===l?u=r[9]:(u=/* @__PURE__ */ v(a,{className:l}),r[8]=l,r[9]=u);let f;return r[10]!==s||r[11]!==c||r[12]!==u?(f=/* @__PURE__ */ v(x.Separator,{"data-slot":c,asChild:!0,...s,children:u}),r[10]=s,r[11]=c,r[12]=u,r[13]=f):f=r[13],f}};function L(e){let r=d(19),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({"data-slot":a,className:i,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let s=c(),l=s?`⌘`:`⌃`,f=s?`Command`:`Control`,p;r[4]===a?p=r[5]:(p=n(a,`meta-key`),r[4]=a,r[5]=p);let m=l===`⌃`&&`font-medium`,h;r[6]!==i||r[7]!==m?(h=t(m,i),r[6]=i,r[7]=m,r[8]=h):h=r[8];let g;r[9]===f?g=r[10]:(g=/* @__PURE__ */ v(`span`,{className:`sr-only`,children:f}),r[9]=f,r[10]=g);let _;r[11]===l?_=r[12]:(_=/* @__PURE__ */ v(`span`,{"aria-hidden":!0,children:l}),r[11]=l,r[12]=_);let b;return r[13]!==o||r[14]!==p||r[15]!==h||r[16]!==g||r[17]!==_?(b=/* @__PURE__ */ y(u,{...o,suppressHydrationWarning:!0,"data-slot":p,className:h,children:[g,_]}),r[13]=o,r[14]=p,r[15]=h,r[16]=g,r[17]=_,r[18]=b):b=r[18],b}export{I as Command,L as MetaKey,O as searchActionFromKeyDown,k as searchActionFromPaste,w as useCommandDialog,S as useCommandState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./button-BMfUxs_j.js";import{t as r}from"./layer-container-DLf-6eBz.js";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u,t as d}from"./primitive-
|
|
1
|
+
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./button-BMfUxs_j.js";import{t as r}from"./layer-container-DLf-6eBz.js";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u,t as d}from"./primitive-AGoxSJBI.js";import{c as f}from"react/compiler-runtime";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{XIcon as h}from"@phosphor-icons/react/X";const g=c,_=e=>{let n=f(8),r,i;n[0]===e?(r=n[1],i=n[2]):({"data-slot":r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let o;n[3]===r?o=n[4]:(o=t(r,`dialog-trigger`),n[3]=r,n[4]=o);let s;return n[5]!==i||n[6]!==o?(s=/* @__PURE__ */ p(a,{"data-slot":o,...i}),n[5]=i,n[6]=o,n[7]=s):s=n[7],s},v=i,y=e=>{let n=f(8),r,i;n[0]===e?(r=n[1],i=n[2]):({"data-slot":r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=t(r,`dialog-close`),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==a?(o=/* @__PURE__ */ p(d,{"data-slot":a,...i}),n[5]=i,n[6]=a,n[7]=o):o=n[7],o},b=n=>{let r=f(14),i,a,s,c;r[0]===n?(i=r[1],a=r[2],s=r[3],c=r[4]):({"data-slot":a,className:i,ref:c,...s}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=s,r[4]=c);let l;r[5]===a?l=r[6]:(l=t(a,`dialog-overlay`),r[5]=a,r[6]=l);let u;r[7]===i?u=r[8]:(u=e(`bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-60 backdrop-blur-xs`,i),r[7]=i,r[8]=u);let d;return r[9]!==s||r[10]!==c||r[11]!==l||r[12]!==u?(d=/* @__PURE__ */ p(o,{ref:c,"data-slot":l,className:u,...s}),r[9]=s,r[10]=c,r[11]=l,r[12]=u,r[13]=d):d=r[13],d},x={centered:`inset-4`,"full-page":`inset-4`,"full-bleed":`inset-0`},S={centered:`border-dialog rounded-xl border`,"full-page":`border-dialog h-full max-w-none rounded-xl border`,"full-bleed":`h-full max-w-none`},C={Root:g,Body:n=>{let r=f(12),i,a,o;r[0]===n?(i=r[1],a=r[2],o=r[3]):({"data-slot":a,className:i,...o}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===a?s=r[5]:(s=t(a,`dialog-body`),r[4]=a,r[5]=s);let c;r[6]===i?c=r[7]:(c=e(`scrollbar scrollbar-gutter-stable text-body flex-1 overflow-y-auto p-6`,i),r[6]=i,r[7]=c);let l;return r[8]!==o||r[9]!==s||r[10]!==c?(l=/* @__PURE__ */ p(`div`,{"data-slot":s,className:c,...o}),r[8]=o,r[9]=s,r[10]=c,r[11]=l):l=r[11],l},Close:y,CloseIconButton:e=>{let r=f(19),i,a,o,s,c,l,u;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4],c=r[5],l=r[6],u=r[7]):({"data-slot":i,size:o,type:s,label:c,appearance:l,intent:u,...a}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=c,r[6]=l,r[7]=u);let m=o===void 0?`md`:o,g=s===void 0?`button`:s,_=c===void 0?`Close Dialog`:c,v=l===void 0?`ghost`:l,y=u===void 0?`neutral`:u,b;r[8]===i?b=r[9]:(b=t(i,`dialog-close-icon-button`),r[8]=i,r[9]=b);let x;r[10]===Symbol.for(`react.memo_cache_sentinel`)?(x=/* @__PURE__ */ p(h,{}),r[10]=x):x=r[10];let S;return r[11]!==v||r[12]!==y||r[13]!==_||r[14]!==a||r[15]!==m||r[16]!==b||r[17]!==g?(S=/* @__PURE__ */ p(d,{asChild:!0,children:/* @__PURE__ */ p(n,{appearance:v,"data-slot":b,icon:x,intent:y,label:_,size:m,type:g,...a})}),r[11]=v,r[12]=y,r[13]=_,r[14]=a,r[15]=m,r[16]=b,r[17]=g,r[18]=S):S=r[18],S},Content:n=>{let i=f(27),a,o,c,l,u,d,h;i[0]===n?(a=i[1],o=i[2],c=i[3],l=i[4],u=i[5],d=i[6],h=i[7]):({"data-slot":c,appearance:h,children:a,className:o,preferredWidth:l,ref:d,...u}=n,i[0]=n,i[1]=a,i[2]=o,i[3]=c,i[4]=l,i[5]=u,i[6]=d,i[7]=h);let g=h===void 0?`centered`:h,_;i[8]===Symbol.for(`react.memo_cache_sentinel`)?(_=/* @__PURE__ */ p(b,{}),i[8]=_):_=i[8];let y=x[g],C;i[9]===y?C=i[10]:(C=e(`fixed z-60 flex items-center justify-center`,y),i[9]=y,i[10]=C);let w;i[11]===c?w=i[12]:(w=t(c,`dialog-content`),i[11]=c,i[12]=w);let T=S[g],E=g===`centered`&&(l??`max-w-lg`),D;i[13]!==o||i[14]!==T||i[15]!==E?(D=e(`flex max-h-full w-full flex-1 flex-col`,`outline-hidden focus-within:outline-hidden`,`bg-dialog shadow-lg transition-transform duration-200`,`data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95`,T,E,o),i[13]=o,i[14]=T,i[15]=E,i[16]=D):D=i[16];let O;i[17]!==g||i[18]!==a||i[19]!==u||i[20]!==d||i[21]!==w||i[22]!==D?(O=/* @__PURE__ */ p(s,{"data-appearance":g,"data-mantle-modal-content":!0,"data-slot":w,className:D,ref:d,...u,children:a}),i[17]=g,i[18]=a,i[19]=u,i[20]=d,i[21]=w,i[22]=D,i[23]=O):O=i[23];let k;return i[24]!==C||i[25]!==O?(k=/* @__PURE__ */ m(v,{children:[_,/* @__PURE__ */ p(r,{"data-slot":`dialog-positioner`,className:C,children:O})]}),i[24]=C,i[25]=O,i[26]=k):k=i[26],k},Description:n=>{let r=f(14),i,a,o,s;r[0]===n?(i=r[1],a=r[2],o=r[3],s=r[4]):({"data-slot":a,className:i,ref:s,...o}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c;r[5]===a?c=r[6]:(c=t(a,`dialog-description`),r[5]=a,r[6]=c);let u;r[7]===i?u=r[8]:(u=e(`text-muted`,i),r[7]=i,r[8]=u);let d;return r[9]!==o||r[10]!==s||r[11]!==c||r[12]!==u?(d=/* @__PURE__ */ p(l,{ref:s,"data-slot":c,className:u,...o}),r[9]=o,r[10]=s,r[11]=c,r[12]=u,r[13]=d):d=r[13],d},Footer:n=>{let r=f(12),i,a,o;r[0]===n?(i=r[1],a=r[2],o=r[3]):({"data-slot":a,className:i,...o}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===a?s=r[5]:(s=t(a,`dialog-footer`),r[4]=a,r[5]=s);let c;r[6]===i?c=r[7]:(c=e(`border-dialog-muted flex shrink-0 justify-end gap-2 border-t px-6 py-4`,i),r[6]=i,r[7]=c);let l;return r[8]!==o||r[9]!==s||r[10]!==c?(l=/* @__PURE__ */ p(`div`,{"data-slot":s,className:c,...o}),r[8]=o,r[9]=s,r[10]=c,r[11]=l):l=r[11],l},Header:n=>{let r=f(14),i,a,o,s;r[0]===n?(i=r[1],a=r[2],o=r[3],s=r[4]):({"data-slot":o,className:a,children:i,...s}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c;r[5]===o?c=r[6]:(c=t(o,`dialog-header`),r[5]=o,r[6]=c);let l;r[7]===a?l=r[8]:(l=e(`border-dialog-muted text-strong relative flex shrink-0 flex-wrap items-center justify-between gap-2 border-b px-6 py-4`,`[&>[data-slot~=dialog-title]]:flex-1`,`[&>[data-slot~=dialog-description]]:order-last [&>[data-slot~=dialog-description]]:basis-full`,`has-[.icon-button]:pr-4`,a),r[7]=a,r[8]=l);let u;return r[9]!==i||r[10]!==s||r[11]!==c||r[12]!==l?(u=/* @__PURE__ */ p(`div`,{"data-slot":c,className:l,...s,children:i}),r[9]=i,r[10]=s,r[11]=c,r[12]=l,r[13]=u):u=r[13],u},Overlay:b,Portal:v,Title:n=>{let r=f(14),i,a,o,s;r[0]===n?(i=r[1],a=r[2],o=r[3],s=r[4]):({"data-slot":a,className:i,ref:s,...o}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c;r[5]===a?c=r[6]:(c=t(a,`dialog-title`),r[5]=a,r[6]=c);let l;r[7]===i?l=r[8]:(l=e(`text-strong truncate text-lg font-medium`,i),r[7]=i,r[8]=l);let d;return r[9]!==o||r[10]!==s||r[11]!==c||r[12]!==l?(d=/* @__PURE__ */ p(u,{ref:s,"data-slot":c,className:l,...o}),r[9]=o,r[10]=s,r[11]=c,r[12]=l,r[13]=d):d=r[13],d},Trigger:_};export{C as t};
|
package/dist/dialog.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d as e}from"./primitive-AGoxSJBI.js";import{t}from"./dialog-CaGJD02w.js";export{t as Dialog,e as isDialogOverlayTarget};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
2
|
-
import { n as Separator } from "./separator-
|
|
2
|
+
import { n as Separator } from "./separator-BWGjCIl7.js";
|
|
3
3
|
import { ComponentProps } from "react";
|
|
4
4
|
import { CheckboxItem, Content, Group, Item, Label, RadioGroup, RadioItem, SubContent, SubTrigger, Trigger } from "@radix-ui/react-dropdown-menu";
|
|
5
5
|
//#region src/components/dropdown-menu/dropdown-menu.d.ts
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./dropdown-menu-Cef0Cz2B.js";
|
package/dist/dropdown-menu.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as DropdownMenu } from "./dropdown-menu-
|
|
2
|
-
import "./dropdown-menu-
|
|
1
|
+
import { t as DropdownMenu } from "./dropdown-menu-Cef0Cz2B.js";
|
|
2
|
+
import "./dropdown-menu-DMA8dGxZ.js";
|
|
3
3
|
export { DropdownMenu };
|