@ngrok/mantle 0.85.2 → 0.86.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.
Files changed (53) hide show
  1. package/README.md +5 -5
  2. package/dist/agent.json +1 -1
  3. package/dist/alert-center.d.ts +13 -0
  4. package/dist/alert-center.js +1 -1
  5. package/dist/area-chart.d.ts +21 -0
  6. package/dist/area-chart.js +1 -1
  7. package/dist/bar-chart.d.ts +21 -0
  8. package/dist/bar-chart.js +1 -1
  9. package/dist/breadcrumb.d.ts +11 -0
  10. package/dist/{chart-2rorgvW0.js → chart-aZLMj4xx.js} +1 -1
  11. package/dist/command.d.ts +1 -1
  12. package/dist/command.js +1 -1
  13. package/dist/data-table.d.ts +56 -0
  14. package/dist/data-table.js +1 -1
  15. package/dist/dropdown-menu-BSOdApBD.d.ts +1 -0
  16. package/dist/dropdown-menu-Bir-GKUs.js +1 -0
  17. package/dist/{dropdown-menu-BYapTV0f.d.ts → dropdown-menu-DhwzMnoH.d.ts} +147 -4
  18. package/dist/dropdown-menu.d.ts +2 -2
  19. package/dist/dropdown-menu.js +1 -1
  20. package/dist/line-chart.d.ts +21 -0
  21. package/dist/line-chart.js +1 -1
  22. package/dist/llms.txt +1 -1
  23. package/dist/multi-select.d.ts +43 -0
  24. package/dist/multi-select.js +1 -1
  25. package/dist/pagination.d.ts +1 -1
  26. package/dist/pagination.js +1 -1
  27. package/dist/scatter-plot.d.ts +21 -0
  28. package/dist/scatter-plot.js +1 -1
  29. package/dist/{select-CKAiBEGt.d.ts → select-DMlziWUZ.d.ts} +54 -1
  30. package/dist/select-DX72zQN2.js +1 -0
  31. package/dist/select.d.ts +1 -1
  32. package/dist/select.js +1 -1
  33. package/dist/selectable-list.d.ts +52 -0
  34. package/dist/selectable-list.js +1 -1
  35. package/dist/sidebar.d.ts +28 -1
  36. package/dist/sidebar.js +1 -1
  37. package/dist/split-button.d.ts +1 -1
  38. package/dist/split-button.js +1 -1
  39. package/dist/tabs.d.ts +38 -0
  40. package/dist/tabs.js +1 -1
  41. package/dist/theme-switcher.d.ts +2 -2
  42. package/dist/theme-switcher.js +1 -1
  43. package/dist/toast.d.ts +34 -1
  44. package/dist/toast.js +1 -1
  45. package/dist/tooltip-CHgJAU6j.js +1 -0
  46. package/dist/{tooltip-DA41fxe5.d.ts → tooltip-CfsA_JPe.d.ts} +42 -6
  47. package/dist/tooltip.d.ts +1 -1
  48. package/dist/tooltip.js +1 -1
  49. package/package.json +3 -3
  50. package/dist/dropdown-menu-BkPBh_8y.d.ts +0 -1
  51. package/dist/dropdown-menu-WydWB9lo.js +0 -1
  52. package/dist/select-DCni0ZwA.js +0 -1
  53. package/dist/tooltip-DikKOzqN.js +0 -1
@@ -1 +1 @@
1
- import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./button-pwkdtR3U.js";import{t as n}from"./button-BFpCB99R.js";import{n as r}from"./separator-D98be0gY.js";import{t as i}from"./select-DCni0ZwA.js";import{c as a}from"react/compiler-runtime";import{createContext as o,useContext as s,useEffect as c,useRef as l,useState as u}from"react";import d from"tiny-invariant";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{CaretRightIcon as m}from"@phosphor-icons/react/CaretRight";import{CaretLeftIcon as h}from"@phosphor-icons/react/CaretLeft";const g=o(void 0),_=t=>{let n=a(24),r,i,o,s,c,l,p;n[0]===t?(r=n[1],i=n[2],o=n[3],s=n[4],c=n[5],l=n[6],p=n[7]):({className:i,children:r,defaultPageSize:o,onChangePageSize:s,pageSize:c,ref:p,...l}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=o,n[4]=s,n[5]=c,n[6]=l,n[7]=p);let m=c!=null,[h,_]=u(o),v=m?c:h;d(v!=null,"CursorPagination.Root requires either `defaultPageSize` or `pageSize`");let y;n[8]!==m||n[9]!==s?(y=e=>{m||_(e),s?.(e)},n[8]=m,n[9]=s,n[10]=y):y=n[10];let b;n[11]!==v||n[12]!==y?(b={pageSize:v,setPageSize:y},n[11]=v,n[12]=y,n[13]=b):b=n[13];let x=b,S;n[14]===i?S=n[15]:(S=e(`inline-flex items-center justify-between gap-2`,i),n[14]=i,n[15]=S);let C;n[16]!==r||n[17]!==l||n[18]!==p||n[19]!==S?(C=f(`div`,{"data-slot":`cursor-pagination`,className:S,ref:p,...l,children:r}),n[16]=r,n[17]=l,n[18]=p,n[19]=S,n[20]=C):C=n[20];let w;return n[21]!==x||n[22]!==C?(w=f(g.Provider,{value:x,children:C}),n[21]=x,n[22]=C,n[23]=w):w=n[23],w},v=e=>{let i=a(21),o,s,c,l,u,d;i[0]===e?(o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6]):({hasNextPage:o,hasPreviousPage:s,onNextPage:c,onPreviousPage:l,ref:d,...u}=e,i[0]=e,i[1]=o,i[2]=s,i[3]=c,i[4]=l,i[5]=u,i[6]=d);let g=!s,_;i[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=f(h,{}),i[7]=_):_=i[7];let v;i[8]!==l||i[9]!==g?(v=f(t,{"data-slot":`cursor-pagination-previous`,appearance:`ghost`,disabled:g,icon:_,intent:`neutral`,label:`Previous page`,onClick:l,size:`sm`,type:`button`}),i[8]=l,i[9]=g,i[10]=v):v=i[10];let y;i[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=f(r,{"data-slot":`cursor-pagination-separator`,orientation:`vertical`,className:`min-h-5`}),i[11]=y):y=i[11];let b=!o,x;i[12]===Symbol.for(`react.memo_cache_sentinel`)?(x=f(m,{}),i[12]=x):x=i[12];let S;i[13]!==c||i[14]!==b?(S=f(t,{"data-slot":`cursor-pagination-next`,appearance:`ghost`,disabled:b,icon:x,intent:`neutral`,label:`Next page`,onClick:c,size:`sm`,type:`button`}),i[13]=c,i[14]=b,i[15]=S):S=i[15];let C;return i[16]!==u||i[17]!==d||i[18]!==v||i[19]!==S?(C=p(n,{"data-slot":`cursor-pagination-buttons`,appearance:`panel`,ref:d,...u,children:[v,y,S]}),i[16]=u,i[17]=d,i[18]=v,i[19]=S,i[20]=C):C=i[20],C},y=[5,10,20,50,100],b=t=>{let n=a(27),r,o,c,l,u;n[0]===t?(r=n[1],o=n[2],c=n[3],l=n[4],u=n[5]):({className:r,pageSizes:u,onChangePageSize:o,ref:c,...l}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=c,n[4]=l,n[5]=u);let m=u===void 0?y:u,h=s(g);d(h,`CursorPageSizeSelect must be used as a child of a CursorPagination component`),d(m.includes(h.pageSize),`CursorPagination.pageSize must be included in CursorPageSizeSelect.pageSizes`);let _=`${h.pageSize}`,v;n[6]!==h||n[7]!==o?(v=e=>{let t=Number.parseInt(e,10);d(!Number.isNaN(t),`CursorPageSizeSelect.pageSizes must contain only numbers`),h.setPageSize(t),o?.(t)},n[6]=h,n[7]=o,n[8]=v):v=n[8];let b;n[9]===r?b=n[10]:(b=e(`w-auto min-w-36`,r),n[9]=r,n[10]=b);let x;n[11]===h.pageSize?x=n[12]:(x=p(i.Value,{children:[h.pageSize,` per page`]}),n[11]=h.pageSize,n[12]=x);let S;n[13]!==c||n[14]!==l||n[15]!==b||n[16]!==x?(S=f(i.Trigger,{ref:c,"aria-label":`Items per page`,"data-slot":`cursor-pagination-page-size-select`,className:b,...l,children:x}),n[13]=c,n[14]=l,n[15]=b,n[16]=x,n[17]=S):S=n[17];let w;n[18]===m?w=n[19]:(w=m.map(C),n[18]=m,n[19]=w);let T;n[20]===w?T=n[21]:(T=f(i.Content,{width:`trigger`,children:w}),n[20]=w,n[21]=T);let E;return n[22]!==_||n[23]!==v||n[24]!==S||n[25]!==T?(E=p(i.Root,{value:_,onValueChange:v,children:[S,T]}),n[22]=_,n[23]=v,n[24]=S,n[25]=T,n[26]=E):E=n[26],E};function x(t){let n=a(9),r,i;n[0]===t?(r=n[1],i=n[2]):({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i);let o=s(g);d(o,`CursorPageSizeValue must be used as a child of a CursorPagination component`);let c;n[3]===r?c=n[4]:(c=e(`text-muted text-sm font-normal`,r),n[3]=r,n[4]=c);let l;return n[5]!==o.pageSize||n[6]!==i||n[7]!==c?(l=p(`span`,{"data-slot":`cursor-pagination-page-size-value`,className:c,...i,children:[o.pageSize,` per page`]}),n[5]=o.pageSize,n[6]=i,n[7]=c,n[8]=l):l=n[8],l}const S={Root:_,Buttons:v,PageSizeSelect:b,PageSizeValue:x};function C(e){return p(i.Item,{value:`${e}`,children:[e,` per page`]},e)}function w(e,t){return Math.max(1,Math.min(Number.isNaN(e)?1:Math.floor(e),t))}function T(e){let t=a(41),{defaultPage:n,listSize:r,onPageChange:i,page:o,pageSize:s,resetPageOnListSizeChange:d}=e,f=n===void 0?1:n,p=d===void 0||d,m=o!=null,[h,g]=u(f),[_,v]=u(s),y=Math.ceil(r/_),b=m?o:h,x=w(b,y),S=(x-1)*_,C=x>1,T=x<y,E;t[0]!==m||t[1]!==i||t[2]!==b?(E=e=>{e!==b&&(m||g(e),i?.(e))},t[0]=m,t[1]=i,t[2]=b,t[3]=E):E=t[3];let D=E,O=l(s),k=l(r),A,j;t[4]!==r||t[5]!==s||t[6]!==p||t[7]!==D?(A=()=>{let e=O.current!==s,t=k.current!==r;O.current=s,k.current=r,e&&v(s),(e||t&&p)&&D(1)},j=[r,s,p,D],t[4]=r,t[5]=s,t[6]=p,t[7]=D,t[8]=A,t[9]=j):(A=t[8],j=t[9]),c(A,j);let M;t[10]!==D||t[11]!==y?(M=function(e){D(w(e,y))},t[10]=D,t[11]=y,t[12]=M):M=t[12];let N=M,P;t[13]!==x||t[14]!==T||t[15]!==D?(P=function(){T&&D(x+1)},t[13]=x,t[14]=T,t[15]=D,t[16]=P):P=t[16];let F=P,I;t[17]!==x||t[18]!==C||t[19]!==D?(I=function(){C&&D(x-1)},t[17]=x,t[18]=C,t[19]=D,t[20]=I):I=t[20];let L=I,R;t[21]===D?R=t[22]:(R=function(e){v(e),D(1)},t[21]=D,t[22]=R);let z=R,B;t[23]!==D||t[24]!==y?(B=function(){D(w(y,y))},t[23]=D,t[24]=y,t[25]=B):B=t[25];let V=B,H;t[26]===D?H=t[27]:(H=function(){D(1)},t[26]=D,t[27]=H);let U=H,W;return t[28]!==x||t[29]!==_||t[30]!==U||t[31]!==V||t[32]!==N||t[33]!==T||t[34]!==C||t[35]!==F||t[36]!==S||t[37]!==L||t[38]!==z||t[39]!==y?(W={currentPage:x,goToFirstPage:U,goToLastPage:V,goToPage:N,hasNextPage:T,hasPreviousPage:C,nextPage:F,offset:S,pageSize:_,previousPage:L,setPageSize:z,totalPages:y},t[28]=x,t[29]=_,t[30]=U,t[31]=V,t[32]=N,t[33]=T,t[34]=C,t[35]=F,t[36]=S,t[37]=L,t[38]=z,t[39]=y,t[40]=W):W=t[40],W}function E(e,t){return e.slice(t.offset,t.offset+t.pageSize)}export{S as CursorPagination,E as getOffsetPaginatedSlice,T as useOffsetPagination};
1
+ import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./button-pwkdtR3U.js";import{t as n}from"./button-BFpCB99R.js";import{n as r}from"./separator-D98be0gY.js";import{t as i}from"./select-DX72zQN2.js";import{c as a}from"react/compiler-runtime";import{createContext as o,useContext as s,useEffect as c,useRef as l,useState as u}from"react";import d from"tiny-invariant";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{CaretRightIcon as m}from"@phosphor-icons/react/CaretRight";import{CaretLeftIcon as h}from"@phosphor-icons/react/CaretLeft";const g=o(void 0),_=t=>{let n=a(24),r,i,o,s,c,l,p;n[0]===t?(r=n[1],i=n[2],o=n[3],s=n[4],c=n[5],l=n[6],p=n[7]):({className:i,children:r,defaultPageSize:o,onChangePageSize:s,pageSize:c,ref:p,...l}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=o,n[4]=s,n[5]=c,n[6]=l,n[7]=p);let m=c!=null,[h,_]=u(o),v=m?c:h;d(v!=null,"CursorPagination.Root requires either `defaultPageSize` or `pageSize`");let y;n[8]!==m||n[9]!==s?(y=e=>{m||_(e),s?.(e)},n[8]=m,n[9]=s,n[10]=y):y=n[10];let b;n[11]!==v||n[12]!==y?(b={pageSize:v,setPageSize:y},n[11]=v,n[12]=y,n[13]=b):b=n[13];let x=b,S;n[14]===i?S=n[15]:(S=e(`inline-flex items-center justify-between gap-2`,i),n[14]=i,n[15]=S);let C;n[16]!==r||n[17]!==l||n[18]!==p||n[19]!==S?(C=f(`div`,{"data-slot":`cursor-pagination`,className:S,ref:p,...l,children:r}),n[16]=r,n[17]=l,n[18]=p,n[19]=S,n[20]=C):C=n[20];let w;return n[21]!==x||n[22]!==C?(w=f(g.Provider,{value:x,children:C}),n[21]=x,n[22]=C,n[23]=w):w=n[23],w},v=e=>{let i=a(21),o,s,c,l,u,d;i[0]===e?(o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6]):({hasNextPage:o,hasPreviousPage:s,onNextPage:c,onPreviousPage:l,ref:d,...u}=e,i[0]=e,i[1]=o,i[2]=s,i[3]=c,i[4]=l,i[5]=u,i[6]=d);let g=!s,_;i[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=f(h,{}),i[7]=_):_=i[7];let v;i[8]!==l||i[9]!==g?(v=f(t,{"data-slot":`cursor-pagination-previous`,appearance:`ghost`,disabled:g,icon:_,intent:`neutral`,label:`Previous page`,onClick:l,size:`sm`,type:`button`}),i[8]=l,i[9]=g,i[10]=v):v=i[10];let y;i[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=f(r,{"data-slot":`cursor-pagination-separator`,orientation:`vertical`,className:`min-h-5`}),i[11]=y):y=i[11];let b=!o,x;i[12]===Symbol.for(`react.memo_cache_sentinel`)?(x=f(m,{}),i[12]=x):x=i[12];let S;i[13]!==c||i[14]!==b?(S=f(t,{"data-slot":`cursor-pagination-next`,appearance:`ghost`,disabled:b,icon:x,intent:`neutral`,label:`Next page`,onClick:c,size:`sm`,type:`button`}),i[13]=c,i[14]=b,i[15]=S):S=i[15];let C;return i[16]!==u||i[17]!==d||i[18]!==v||i[19]!==S?(C=p(n,{"data-slot":`cursor-pagination-buttons`,appearance:`panel`,ref:d,...u,children:[v,y,S]}),i[16]=u,i[17]=d,i[18]=v,i[19]=S,i[20]=C):C=i[20],C},y=[5,10,20,50,100],b=t=>{let n=a(27),r,o,c,l,u;n[0]===t?(r=n[1],o=n[2],c=n[3],l=n[4],u=n[5]):({className:r,pageSizes:u,onChangePageSize:o,ref:c,...l}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=c,n[4]=l,n[5]=u);let m=u===void 0?y:u,h=s(g);d(h,`CursorPageSizeSelect must be used as a child of a CursorPagination component`),d(m.includes(h.pageSize),`CursorPagination.pageSize must be included in CursorPageSizeSelect.pageSizes`);let _=`${h.pageSize}`,v;n[6]!==h||n[7]!==o?(v=e=>{let t=Number.parseInt(e,10);d(!Number.isNaN(t),`CursorPageSizeSelect.pageSizes must contain only numbers`),h.setPageSize(t),o?.(t)},n[6]=h,n[7]=o,n[8]=v):v=n[8];let b;n[9]===r?b=n[10]:(b=e(`w-auto min-w-36`,r),n[9]=r,n[10]=b);let x;n[11]===h.pageSize?x=n[12]:(x=p(i.Value,{children:[h.pageSize,` per page`]}),n[11]=h.pageSize,n[12]=x);let S;n[13]!==c||n[14]!==l||n[15]!==b||n[16]!==x?(S=f(i.Trigger,{ref:c,"aria-label":`Items per page`,"data-slot":`cursor-pagination-page-size-select`,className:b,...l,children:x}),n[13]=c,n[14]=l,n[15]=b,n[16]=x,n[17]=S):S=n[17];let w;n[18]===m?w=n[19]:(w=m.map(C),n[18]=m,n[19]=w);let T;n[20]===w?T=n[21]:(T=f(i.Content,{width:`trigger`,children:w}),n[20]=w,n[21]=T);let E;return n[22]!==_||n[23]!==v||n[24]!==S||n[25]!==T?(E=p(i.Root,{value:_,onValueChange:v,children:[S,T]}),n[22]=_,n[23]=v,n[24]=S,n[25]=T,n[26]=E):E=n[26],E};function x(t){let n=a(9),r,i;n[0]===t?(r=n[1],i=n[2]):({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i);let o=s(g);d(o,`CursorPageSizeValue must be used as a child of a CursorPagination component`);let c;n[3]===r?c=n[4]:(c=e(`text-muted text-sm font-normal`,r),n[3]=r,n[4]=c);let l;return n[5]!==o.pageSize||n[6]!==i||n[7]!==c?(l=p(`span`,{"data-slot":`cursor-pagination-page-size-value`,className:c,...i,children:[o.pageSize,` per page`]}),n[5]=o.pageSize,n[6]=i,n[7]=c,n[8]=l):l=n[8],l}const S={Root:_,Buttons:v,PageSizeSelect:b,PageSizeValue:x};function C(e){return p(i.Item,{value:`${e}`,children:[e,` per page`]},e)}function w(e,t){return Math.max(1,Math.min(Number.isNaN(e)?1:Math.floor(e),t))}function T(e){let t=a(41),{defaultPage:n,listSize:r,onPageChange:i,page:o,pageSize:s,resetPageOnListSizeChange:d}=e,f=n===void 0?1:n,p=d===void 0||d,m=o!=null,[h,g]=u(f),[_,v]=u(s),y=Math.ceil(r/_),b=m?o:h,x=w(b,y),S=(x-1)*_,C=x>1,T=x<y,E;t[0]!==m||t[1]!==i||t[2]!==b?(E=e=>{e!==b&&(m||g(e),i?.(e))},t[0]=m,t[1]=i,t[2]=b,t[3]=E):E=t[3];let D=E,O=l(s),k=l(r),A,j;t[4]!==r||t[5]!==s||t[6]!==p||t[7]!==D?(A=()=>{let e=O.current!==s,t=k.current!==r;O.current=s,k.current=r,e&&v(s),(e||t&&p)&&D(1)},j=[r,s,p,D],t[4]=r,t[5]=s,t[6]=p,t[7]=D,t[8]=A,t[9]=j):(A=t[8],j=t[9]),c(A,j);let M;t[10]!==D||t[11]!==y?(M=function(e){D(w(e,y))},t[10]=D,t[11]=y,t[12]=M):M=t[12];let N=M,P;t[13]!==x||t[14]!==T||t[15]!==D?(P=function(){T&&D(x+1)},t[13]=x,t[14]=T,t[15]=D,t[16]=P):P=t[16];let F=P,I;t[17]!==x||t[18]!==C||t[19]!==D?(I=function(){C&&D(x-1)},t[17]=x,t[18]=C,t[19]=D,t[20]=I):I=t[20];let L=I,R;t[21]===D?R=t[22]:(R=function(e){v(e),D(1)},t[21]=D,t[22]=R);let z=R,B;t[23]!==D||t[24]!==y?(B=function(){D(w(y,y))},t[23]=D,t[24]=y,t[25]=B):B=t[25];let V=B,H;t[26]===D?H=t[27]:(H=function(){D(1)},t[26]=D,t[27]=H);let U=H,W;return t[28]!==x||t[29]!==_||t[30]!==U||t[31]!==V||t[32]!==N||t[33]!==T||t[34]!==C||t[35]!==F||t[36]!==S||t[37]!==L||t[38]!==z||t[39]!==y?(W={currentPage:x,goToFirstPage:U,goToLastPage:V,goToPage:N,hasNextPage:T,hasPreviousPage:C,nextPage:F,offset:S,pageSize:_,previousPage:L,setPageSize:z,totalPages:y},t[28]=x,t[29]=_,t[30]=U,t[31]=V,t[32]=N,t[33]=T,t[34]=C,t[35]=F,t[36]=S,t[37]=L,t[38]=z,t[39]=y,t[40]=W):W=t[40],W}function E(e,t){return e.slice(t.offset,t.offset+t.pageSize)}export{S as CursorPagination,E as getOffsetPaginatedSlice,T as useOffsetPagination};
@@ -252,6 +252,19 @@ declare const ReferenceLine: (props: ScatterPlotReferenceLineProps) => null;
252
252
  * or replace the content entirely via the render-prop `children`.
253
253
  * In 3D the readout also carries the point's z value.
254
254
  *
255
+ * **Structure.** A `children` readout renders inside a
256
+ * `<div data-slot="scatter-plot-tooltip-label">`. When it goes away, React removes
257
+ * that div instead of your own text nodes: a browser translation engine
258
+ * reparents a text node, and a removal aimed at one throws. The div is
259
+ * `display: contents`, so it lays out nothing of its own. To style it as a box,
260
+ * set a display of your own on it first.
261
+ *
262
+ * **Data attributes:**
263
+ *
264
+ * | Data Attribute | Value | Description |
265
+ * | --- | --- | --- |
266
+ * | `data-slot` | `"scatter-plot-tooltip-label"` | On the `<div>` wrapping a `children` readout. The default readout has none. |
267
+ *
255
268
  * @see https://mantle.ngrok.com/components/charts/scatter-plot#scatterplottooltip
256
269
  *
257
270
  * @example
@@ -270,11 +283,19 @@ declare const Tooltip: (props: ScatterPlotTooltipProps) => null;
270
283
  * never rely on color-matching alone. It renders nothing for a single series
271
284
  * (the chart's title already names it).
272
285
  *
286
+ * **Structure.** A `children` render prop renders inside a
287
+ * `<div data-slot="scatter-plot-legend-label">`. When it goes away, React removes
288
+ * that div instead of your own text nodes: a browser translation engine
289
+ * reparents a text node, and a removal aimed at one throws. The div is
290
+ * `display: contents`, so it lays out nothing of its own. To style it as a box,
291
+ * set a display of your own on it first.
292
+ *
273
293
  * **Data attributes:**
274
294
  *
275
295
  * | Data Attribute | Value | Description |
276
296
  * | --- | --- | --- |
277
297
  * | `data-slot` | `"scatter-plot-legend"` | The legend list. `ScatterPlot.Legend` renders it in flow below the plot. |
298
+ * | `data-slot` | `"scatter-plot-legend-label"` | On the `<div>` wrapping a `children` render prop. The default legend has none. |
278
299
  * | `data-shape` | `"circle"` \| `"square"` \| `"triangle"` \| `"diamond"` \| `"triangle-down"` \| `"plus"` \| `"cross"` \| `"star"` | On each series' swatch, naming the glyph its `ScatterPlot.Point` wears — the `shape` it set, else the one paired to its series slot. The swatch clips itself to that glyph, so target this only to restyle a key. |
279
300
  *
280
301
  * @see https://mantle.ngrok.com/components/charts/scatter-plot#scatterplotlegend
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-2rorgvW0.js";import{c as l}from"react/compiler-runtime";import{jsx as u}from"react/jsx-runtime";const d={Root:e=>{let t=l(2),n;return t[0]===e?n=t[1]:(n=u(o,{kind:`scatter`,componentName:`ScatterPlot`,slotName:`scatter-plot`,...e}),t[0]=e,t[1]=n),n},Point:e=>a(`ScatterPlot.Point`,`scatter`,e),Grid:e=>n(`ScatterPlot.Grid`,e),XAxis:e=>t(`ScatterPlot.XAxis`,e),YAxis:e=>r(`ScatterPlot.YAxis`,e),ReferenceLine:t=>e(`ScatterPlot.ReferenceLine`,t),Tooltip:e=>s(`ScatterPlot.Tooltip`,e),Legend:e=>{let t=l(2),n;return t[0]===e?n=t[1]:(n=u(i,{partName:`ScatterPlot.Legend`,slotName:`scatter-plot`,...e}),t[0]=e,t[1]=n),n},CopyButton:e=>{let t=l(2),n;return t[0]===e?n=t[1]:(n=u(c,{partName:`ScatterPlot.CopyButton`,slotName:`scatter-plot`,...e}),t[0]=e,t[1]=n),n}};export{d as ScatterPlot};
1
+ import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-aZLMj4xx.js";import{c as l}from"react/compiler-runtime";import{jsx as u}from"react/jsx-runtime";const d={Root:e=>{let t=l(2),n;return t[0]===e?n=t[1]:(n=u(o,{kind:`scatter`,componentName:`ScatterPlot`,slotName:`scatter-plot`,...e}),t[0]=e,t[1]=n),n},Point:e=>a(`ScatterPlot.Point`,`scatter`,e),Grid:e=>n(`ScatterPlot.Grid`,e),XAxis:e=>t(`ScatterPlot.XAxis`,e),YAxis:e=>r(`ScatterPlot.YAxis`,e),ReferenceLine:t=>e(`ScatterPlot.ReferenceLine`,t),Tooltip:e=>s(`ScatterPlot.Tooltip`,e),Legend:e=>{let t=l(2),n;return t[0]===e?n=t[1]:(n=u(i,{partName:`ScatterPlot.Legend`,slotName:`scatter-plot`,...e}),t[0]=e,t[1]=n),n},CopyButton:e=>{let t=l(2),n;return t[0]===e?n=t[1]:(n=u(c,{partName:`ScatterPlot.CopyButton`,slotName:`scatter-plot`,...e}),t[0]=e,t[1]=n),n}};export{d as ScatterPlot};
@@ -212,6 +212,9 @@ type SelectValueProps = ComponentProps<typeof SelectPrimitive.Value> & WithDataS
212
212
  * ```
213
213
  */
214
214
  declare const Value: ({ asChild, children, "data-slot": dataSlot, placeholder, ref, ...props }: SelectValueProps) => import("react").JSX.Element;
215
+ /**
216
+ * Props for `Select.Trigger`.
217
+ */
215
218
  type SelectTriggerProps = ComponentProps<typeof SelectPrimitive.Trigger> & WithAriaInvalid & WithDataSlot & WithValidation;
216
219
  /**
217
220
  * The button that toggles the select. The Select.Content will position itself adjacent to the trigger.
@@ -220,9 +223,23 @@ type SelectTriggerProps = ComponentProps<typeof SelectPrimitive.Trigger> & WithA
220
223
  * the hidden form input gets the field name), and the trigger reads
221
224
  * `aria-describedby` / `aria-errormessage` from `FieldControlContext`.
222
225
  *
226
+ * **Structure.** `children` render inside a
227
+ * `<span data-slot="select-trigger-label">`. The caret is a permanent element
228
+ * sibling, so without the span a bare text child is never a lone child: a
229
+ * browser translation engine reparents that text node, and the removal React
230
+ * runs when the child changes shape or goes away throws. The span is
231
+ * `display: contents`, so `Select.Value` stays a flex item of the trigger and
232
+ * keeps its `gap`. A `[&>span]` class of your own now reaches the wrapper, not
233
+ * `Select.Value`. Match the part's own variant instead:
234
+ * `[&>[data-slot=select-trigger-label]>span]:line-clamp-none`.
235
+ *
236
+ * **`asChild`.** Radix clones your single child as the trigger element. The label
237
+ * span and the caret move inside it, so the guarantee above holds on both paths.
238
+ *
223
239
  * | Data Attribute | Value | Description |
224
240
  * | ------------------ | --------------------------------------- | -------------------------------------------------------------------- |
225
241
  * | `data-slot` | `"select-trigger"` | On the trigger button. |
242
+ * | `data-slot` | `"select-trigger-label"` | On the `<span>` wrapping `children`. |
226
243
  * | `data-state` | `"open"` \| `"closed"` | Whether the list is open. |
227
244
  * | `data-placeholder` | present when there is no value | Presence-only. Style the placeholder text with `data-placeholder:`. |
228
245
  * | `data-disabled` | present when disabled | Presence-only. The `disabled` prop on `Select.Root`. |
@@ -254,7 +271,12 @@ type SelectTriggerProps = ComponentProps<typeof SelectPrimitive.Trigger> & WithA
254
271
  * ```
255
272
  */
256
273
  declare const Trigger: ({ "aria-invalid": ariaInValidProp, className, children, "data-slot": dataSlot, id: propId, onBlur, ref, validation: propValidation, ...props }: SelectTriggerProps) => import("react").JSX.Element;
257
- type SelectContentProps = ComponentProps<typeof SelectPrimitive.Content> & WithDataSlot & {
274
+ /**
275
+ * Props for `Select.Content`. `asChild` is omitted: the content renders its
276
+ * scroll buttons and viewport around `children`, so a slot would receive more
277
+ * than one element and throw.
278
+ */
279
+ type SelectContentProps = Omit<ComponentProps<typeof SelectPrimitive.Content>, "asChild"> & WithDataSlot & {
258
280
  /**
259
281
  * The width of the content. Defaults to the width of the trigger.
260
282
  * If set to "content", the content takes its intrinsic width: the width of the widest item.
@@ -275,6 +297,10 @@ type SelectContentProps = ComponentProps<typeof SelectPrimitive.Content> & WithD
275
297
  * (`z-60`). When sibling floats share a container, the most recently mounted
276
298
  * float paints on top.
277
299
  *
300
+ * **Why no `asChild`:** the scroll buttons and the viewport sit around
301
+ * `children`, so `Slot` would receive more than one element and throw. The
302
+ * prop is omitted from the props type.
303
+ *
278
304
  * | Data Attribute | Value | Description |
279
305
  * | -------------- | ---------------------------------------------- | ---------------------------------------------------------------------- |
280
306
  * | `data-slot` | `"select-content"` | On the content element. |
@@ -341,6 +367,9 @@ declare const Content: ({ className, children, "data-slot": dataSlot, position,
341
367
  * ```
342
368
  */
343
369
  declare const Label: ({ className, "data-slot": dataSlot, ref, ...props }: ComponentProps<typeof SelectPrimitive.Label> & WithDataSlot) => import("react").JSX.Element;
370
+ /**
371
+ * Props for `Select.Item`.
372
+ */
344
373
  type SelectItemProps = ComponentProps<typeof SelectPrimitive.Item> & WithDataSlot & {
345
374
  /**
346
375
  * An optional icon rendered before the item text.
@@ -366,6 +395,9 @@ type SelectItemProps = ComponentProps<typeof SelectPrimitive.Item> & WithDataSlo
366
395
  * key, set `translate="no"` on the item. The attribute also rides on the label
367
396
  * span, so the copy the trigger shows stays untranslated too.
368
397
  *
398
+ * **`asChild`.** Radix clones your single child as the option element. The label
399
+ * span and the indicator move inside it, so the guarantee above holds on both paths.
400
+ *
369
401
  * | Data Attribute | Value | Description |
370
402
  * | ------------------ | ---------------------------- | -------------------------------------------------------------------- |
371
403
  * | `data-slot` | `"select-item"` | On the option element. |
@@ -547,6 +579,10 @@ declare const Select: {
547
579
  * (`z-60`). When sibling floats share a container, the most recently mounted
548
580
  * float paints on top.
549
581
  *
582
+ * **Why no `asChild`:** the scroll buttons and the viewport sit around
583
+ * `children`, so `Slot` would receive more than one element and throw. The
584
+ * prop is omitted from the props type.
585
+ *
550
586
  * | Data Attribute | Value | Description |
551
587
  * | -------------- | ---------------------------------------------- | ---------------------------------------------------------------------- |
552
588
  * | `data-slot` | `"select-content"` | On the content element. |
@@ -633,6 +669,9 @@ declare const Select: {
633
669
  * key, set `translate="no"` on the item. The attribute also rides on the label
634
670
  * span, so the copy the trigger shows stays untranslated too.
635
671
  *
672
+ * **`asChild`.** Radix clones your single child as the option element. The label
673
+ * span and the indicator move inside it, so the guarantee above holds on both paths.
674
+ *
636
675
  * | Data Attribute | Value | Description |
637
676
  * | ------------------ | ---------------------------- | -------------------------------------------------------------------- |
638
677
  * | `data-slot` | `"select-item"` | On the option element. |
@@ -740,9 +779,23 @@ declare const Select: {
740
779
  * the hidden form input gets the field name), and the trigger reads
741
780
  * `aria-describedby` / `aria-errormessage` from `FieldControlContext`.
742
781
  *
782
+ * **Structure.** `children` render inside a
783
+ * `<span data-slot="select-trigger-label">`. The caret is a permanent element
784
+ * sibling, so without the span a bare text child is never a lone child: a
785
+ * browser translation engine reparents that text node, and the removal React
786
+ * runs when the child changes shape or goes away throws. The span is
787
+ * `display: contents`, so `Select.Value` stays a flex item of the trigger and
788
+ * keeps its `gap`. A `[&>span]` class of your own now reaches the wrapper, not
789
+ * `Select.Value`. Match the part's own variant instead:
790
+ * `[&>[data-slot=select-trigger-label]>span]:line-clamp-none`.
791
+ *
792
+ * **`asChild`.** Radix clones your single child as the trigger element. The label
793
+ * span and the caret move inside it, so the guarantee above holds on both paths.
794
+ *
743
795
  * | Data Attribute | Value | Description |
744
796
  * | ------------------ | --------------------------------------- | -------------------------------------------------------------------- |
745
797
  * | `data-slot` | `"select-trigger"` | On the trigger button. |
798
+ * | `data-slot` | `"select-trigger-label"` | On the `<span>` wrapping `children`. |
746
799
  * | `data-state` | `"open"` \| `"closed"` | Whether the list is open. |
747
800
  * | `data-placeholder` | present when there is no value | Presence-only. Style the placeholder text with `data-placeholder:`. |
748
801
  * | `data-disabled` | present when disabled | Presence-only. The `disabled` prop on `Select.Root`. |
@@ -0,0 +1 @@
1
+ import{n as e}from"./compose-refs-sFdxsL7k.js";import{t}from"./cx-0HCjnNv1.js";import{t as n}from"./icon-BT8FnkkJ.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{r as i}from"./layer-container-R7aux3n8.js";import{a,r as o}from"./field-Bpptk_9t.js";import{t as s}from"./field-B1wqeZr4.js";import{n as c}from"./separator-D98be0gY.js";import{c as l}from"react/compiler-runtime";import{CaretDownIcon as u}from"@phosphor-icons/react/CaretDown";import{createContext as d,useContext as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{Slottable as h}from"@radix-ui/react-slot";import{CheckIcon as g}from"@phosphor-icons/react/Check";import{CaretUpIcon as _}from"@phosphor-icons/react/CaretUp";import*as v from"@radix-ui/react-select";const y=d({}),b=e=>{let t=l(26),n,r,i,a,o,s,c,u,d;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],u=t[8],d=t[9]):({"aria-invalid":n,children:r,id:i,validation:d,onBlur:a,onValueChange:s,onChange:o,ref:u,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=u,t[9]=d);let f;t[10]!==n||t[11]!==i||t[12]!==a||t[13]!==u||t[14]!==d?(f={"aria-invalid":n,id:i,validation:d,onBlur:a,ref:u},t[10]=n,t[11]=i,t[12]=a,t[13]=u,t[14]=d,t[15]=f):f=t[15];let m=f,h;t[16]!==o||t[17]!==s?(h=e=>{o?.(e),s?.(e)},t[16]=o,t[17]=s,t[18]=h):h=t[18];let g;t[19]!==r||t[20]!==m?(g=p(y.Provider,{value:m,children:r}),t[19]=r,t[20]=m,t[21]=g):g=t[21];let _;return t[22]!==c||t[23]!==h||t[24]!==g?(_=p(v.Root,{...c,onValueChange:h,children:g}),t[22]=c,t[23]=h,t[24]=g,t[25]=_):_=t[25],_},x=e=>{let n=l(14),i,a,o,s;n[0]===e?(i=n[1],a=n[2],o=n[3],s=n[4]):({className:i,"data-slot":a,ref:s,...o}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=o,n[4]=s);let c;n[5]===a?c=n[6]:(c=r(a,`select-group`),n[5]=a,n[6]=c);let u;n[7]===i?u=n[8]:(u=t(`space-y-px`,i),n[7]=i,n[8]=u);let d;return n[9]!==o||n[10]!==s||n[11]!==c||n[12]!==u?(d=p(v.Group,{ref:s,"data-slot":c,className:u,...o}),n[9]=o,n[10]=s,n[11]=c,n[12]=u,n[13]=d):d=n[13],d},S=e=>{let t=l(21),n,i,a,o,s,c;t[0]===e?(n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6]):({asChild:n,children:i,"data-slot":a,placeholder:o,ref:c,...s}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c);let u;t[7]===a?u=t[8]:(u=r(a,`select-value`),t[7]=a,t[8]=u);let d;t[9]===o?d=t[10]:(d=o!=null&&p(`span`,{"data-slot":`select-placeholder`,className:`contents`,children:o}),t[9]=o,t[10]=d);let f;t[11]!==n||t[12]!==i?(f=n||i==null?i:p(`span`,{"data-slot":`select-value-label`,className:`contents`,children:i}),t[11]=n,t[12]=i,t[13]=f):f=t[13];let m;return t[14]!==n||t[15]!==s||t[16]!==c||t[17]!==u||t[18]!==d||t[19]!==f?(m=p(v.Value,{ref:c,asChild:n,"data-slot":u,placeholder:d,...s,children:f}),t[14]=n,t[15]=s,t[16]=c,t[17]=u,t[18]=d,t[19]=f,t[20]=m):m=t[20],m},C=i=>{let c=l(36),d,g,_,b,x,S,C,w,T;c[0]===i?(d=c[1],g=c[2],_=c[3],b=c[4],x=c[5],S=c[6],C=c[7],w=c[8],T=c[9]):({"aria-invalid":d,className:_,children:g,"data-slot":b,id:S,onBlur:x,ref:T,validation:C,...w}=i,c[0]=i,c[1]=d,c[2]=g,c[3]=_,c[4]=b,c[5]=x,c[6]=S,c[7]=C,c[8]=w,c[9]=T);let E=f(y),O=f(s),k=e(T,E.ref),A=a(),j=O?O[`aria-invalid`]:E[`aria-invalid`]??d,M=E.validation??C??A,N;c[10]!==j||c[11]!==M?(N=o({"aria-invalid":j,validation:M}),c[10]=j,c[11]=M,c[12]=N):N=c[12];let{ariaInvalid:P,validation:F}=N,I=O?O.id:E.id??S,L;c[13]===b?L=c[14]:(L=r(b,`select-trigger`),c[13]=b,c[14]=L);let R;c[15]===_?R=c[16]:(R=t(`h-9 text-sm`,`border-form bg-form text-strong font-sans placeholder:text-placeholder hover:bg-form-hover hover:text-strong flex w-full items-center justify-between gap-1.5 rounded-md border px-3 py-2 disabled:pointer-events-none disabled:opacity-50`,`[&>[data-slot=select-trigger-label]>span]:line-clamp-1 [&>[data-slot=select-trigger-label]>span]:text-left`,`hover:border-neutral-400`,`focus:outline-hidden focus:ring-4 aria-expanded:ring-4`,`focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent`,`data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success`,`data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning`,`data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger`,_),c[15]=_,c[16]=R);let z=F||void 0,B;c[17]!==E||c[18]!==x?(B=e=>{x?.(e),E.onBlur?.(e)},c[17]=E,c[18]=x,c[19]=B):B=c[19];let V;c[20]===O?V=c[21]:(V=O?{"aria-describedby":O[`aria-describedby`],"aria-errormessage":O[`aria-errormessage`]}:void 0,c[20]=O,c[21]=V);let H;c[22]===g?H=c[23]:(H=p(h,{child:g,children:D}),c[22]=g,c[23]=H);let U;c[24]===Symbol.for(`react.memo_cache_sentinel`)?(U=p(v.Icon,{asChild:!0,children:p(n,{svg:p(u,{weight:`bold`}),className:`size-4`})}),c[24]=U):U=c[24];let W;return c[25]!==P||c[26]!==I||c[27]!==w||c[28]!==L||c[29]!==R||c[30]!==z||c[31]!==B||c[32]!==V||c[33]!==H||c[34]!==k?(W=m(v.Trigger,{"data-slot":L,className:R,"data-validation":z,id:I,ref:k,...w,onBlur:B,...V,"aria-invalid":P,children:[H,U]}),c[25]=P,c[26]=I,c[27]=w,c[28]=L,c[29]=R,c[30]=z,c[31]=B,c[32]=V,c[33]=H,c[34]=k,c[35]=W):W=c[35],W},w=e=>{let r=l(11),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({className:i,ref:o,...a}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===i?s=r[5]:(s=t(`flex cursor-default items-center justify-center py-1`,i),r[4]=i,r[5]=s);let c;r[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=p(n,{svg:p(_,{weight:`bold`}),className:`size-4`}),r[6]=c):c=r[6];let u;return r[7]!==a||r[8]!==o||r[9]!==s?(u=p(v.ScrollUpButton,{ref:o,className:s,...a,children:c}),r[7]=a,r[8]=o,r[9]=s,r[10]=u):u=r[10],u},T=e=>{let r=l(11),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({className:i,ref:o,...a}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===i?s=r[5]:(s=t(`flex cursor-default items-center justify-center py-1`,i),r[4]=i,r[5]=s);let c;r[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=p(n,{svg:p(u,{weight:`bold`}),className:`size-4`}),r[6]=c):c=r[6];let d;return r[7]!==a||r[8]!==o||r[9]!==s?(d=p(v.ScrollDownButton,{ref:o,className:s,...a,children:c}),r[7]=a,r[8]=o,r[9]=s,r[10]=d):d=r[10],d},E={Root:b,Content:e=>{let n=l(31),a,o,s,c,u,d,f;n[0]===e?(a=n[1],o=n[2],s=n[3],c=n[4],u=n[5],d=n[6],f=n[7]):({className:o,children:a,"data-slot":s,position:d,ref:u,width:f,...c}=e,n[0]=e,n[1]=a,n[2]=o,n[3]=s,n[4]=c,n[5]=u,n[6]=d,n[7]=f);let h=d===void 0?`popper`:d,g=f===void 0?`trigger`:f,_=i(),y;n[8]===s?y=n[9]:(y=r(s,`select-content`),n[8]=s,n[9]=y);let b=h===`popper`&&`data-side-bottom:translate-y-2 data-side-left:-translate-x-2 data-side-right:translate-x-2 data-side-top:-translate-y-2 max-h-(--radix-select-content-available-height)`,x=g===`trigger`&&`w-(--radix-select-trigger-width)`,S;n[10]!==o||n[11]!==b||n[12]!==x?(S=t(`border-popover data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 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 motion-reduce:animate-none relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md`,`bg-popover font-sans`,b,x,o),n[10]=o,n[11]=b,n[12]=x,n[13]=S):S=n[13];let C;n[14]===Symbol.for(`react.memo_cache_sentinel`)?(C=p(w,{}),n[14]=C):C=n[14];let E=h===`popper`&&`h-(--radix-select-trigger-height) w-full`,D;n[15]===E?D=n[16]:(D=t(`p-1 space-y-px`,E),n[15]=E,n[16]=D);let O;n[17]!==a||n[18]!==D?(O=p(v.Viewport,{className:D,children:a}),n[17]=a,n[18]=D,n[19]=O):O=n[19];let k;n[20]===Symbol.for(`react.memo_cache_sentinel`)?(k=p(T,{}),n[20]=k):k=n[20];let A;n[21]!==h||n[22]!==c||n[23]!==u||n[24]!==O||n[25]!==y||n[26]!==S?(A=m(v.Content,{ref:u,"data-slot":y,className:S,position:h,...c,children:[C,O,k]}),n[21]=h,n[22]=c,n[23]=u,n[24]=O,n[25]=y,n[26]=S,n[27]=A):A=n[27];let j;return n[28]!==_||n[29]!==A?(j=p(v.Portal,{container:_,children:A}),n[28]=_,n[29]=A,n[30]=j):j=n[30],j},Group:x,Item:e=>{let i=l(28),a,o,s,c,u,d,f;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],u=i[5],d=i[6],f=i[7]):({className:o,children:a,"data-slot":s,icon:c,ref:d,translate:f,...u}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=u,i[6]=d,i[7]=f);let _;i[8]===s?_=i[9]:(_=r(s,`select-item`),i[8]=s,i[9]=_);let y;i[10]===o?y=i[11]:(y=t(`relative flex gap-2 w-full cursor-pointer select-none items-center rounded-md py-1.5 pl-2 pr-8 text-strong text-sm outline-hidden`,`focus:bg-active-menu-item`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`data-state-checked:bg-selected-menu-item`,`focus:data-state-checked:bg-active-selected-menu-item`,o),i[10]=o,i[11]=y);let b;i[12]===c?b=i[13]:(b=c&&p(n,{svg:c}),i[12]=c,i[13]=b);let x;i[14]===f?x=i[15]:(x=e=>p(v.ItemText,{children:p(`span`,{"data-slot":`select-item-label`,className:`contents`,translate:f,children:e})}),i[14]=f,i[15]=x);let S;i[16]!==a||i[17]!==x?(S=p(h,{child:a,children:x}),i[16]=a,i[17]=x,i[18]=S):S=i[18];let C;i[19]===Symbol.for(`react.memo_cache_sentinel`)?(C=p(v.ItemIndicator,{className:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`,children:p(n,{svg:p(g,{weight:`bold`}),className:`size-4 text-accent-600`})}),i[19]=C):C=i[19];let w;return i[20]!==u||i[21]!==d||i[22]!==_||i[23]!==y||i[24]!==b||i[25]!==S||i[26]!==f?(w=m(v.Item,{ref:d,"data-slot":_,translate:f,className:y,...u,children:[b,S,C]}),i[20]=u,i[21]=d,i[22]=_,i[23]=y,i[24]=b,i[25]=S,i[26]=f,i[27]=w):w=i[27],w},Label:e=>{let n=l(14),i,a,o,s;n[0]===e?(i=n[1],a=n[2],o=n[3],s=n[4]):({className:i,"data-slot":a,ref:s,...o}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=o,n[4]=s);let c;n[5]===a?c=n[6]:(c=r(a,`select-label`),n[5]=a,n[6]=c);let u;n[7]===i?u=n[8]:(u=t(`px-2 py-1.5 text-sm font-medium`,i),n[7]=i,n[8]=u);let d;return n[9]!==o||n[10]!==s||n[11]!==c||n[12]!==u?(d=p(v.Label,{ref:s,"data-slot":c,className:u,...o}),n[9]=o,n[10]=s,n[11]=c,n[12]=u,n[13]=d):d=n[13],d},Separator:e=>{let n=l(14),i,a,o,s;n[0]===e?(i=n[1],a=n[2],o=n[3],s=n[4]):({className:i,"data-slot":a,ref:s,...o}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=o,n[4]=s);let u;n[5]===a?u=n[6]:(u=r(a,`select-separator`),n[5]=a,n[6]=u);let d;n[7]===i?d=n[8]:(d=t(`-mx-1 my-1 h-px w-auto`,i),n[7]=i,n[8]=d);let f;return n[9]!==o||n[10]!==s||n[11]!==u||n[12]!==d?(f=p(c,{ref:s,"data-slot":u,className:d,...o}),n[9]=o,n[10]=s,n[11]=u,n[12]=d,n[13]=f):f=n[13],f},Trigger:C,Value:S};function D(e){return p(`span`,{"data-slot":`select-trigger-label`,className:`contents`,children:e})}export{E as t};
package/dist/select.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { t as Select } from "./select-CKAiBEGt.js";
1
+ import { t as Select } from "./select-DMlziWUZ.js";
2
2
  export { Select };
package/dist/select.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./select-DCni0ZwA.js";export{e as Select};
1
+ import{t as e}from"./select-DX72zQN2.js";export{e as Select};
@@ -213,6 +213,19 @@ declare const Filter: ({ "aria-label": ariaLabel, ref, ...props }: Omit<Componen
213
213
  * indeterminate when only some are, unchecked when none are — and toggling it
214
214
  * selects or clears that filtered set. Optional. Children are the visible label.
215
215
  *
216
+ * **Structure.** `children` render inside a
217
+ * `<span data-slot="selectable-list-select-all-label">`. The checkbox is a
218
+ * permanent element sibling, so without the span a bare text label is never a
219
+ * lone child: a browser translation engine reparents that text node, and the
220
+ * removal React runs when a count-aware label swaps to an element throws. The
221
+ * span is `display: contents`, so the checkbox and the label stay flex items of
222
+ * the header and keep its `gap`.
223
+ *
224
+ * | Data Attribute | Value | Description |
225
+ * | -------------- | ------------------------------------ | ------------------------------------ |
226
+ * | `data-slot` | `"selectable-list-select-all"` | On the header `<label>`. |
227
+ * | `data-slot` | `"selectable-list-select-all-label"` | On the `<span>` wrapping `children`. |
228
+ *
216
229
  * @see https://mantle.ngrok.com/components/data-display/selectable-list
217
230
  *
218
231
  * @example
@@ -422,6 +435,19 @@ declare const VirtualViewport: ({ children, ref, ...props }: SelectableListVirtu
422
435
  * hidden while there are matches), so screen-reader users hear the message
423
436
  * when their filter empties the list instead of the grid silently vanishing.
424
437
  *
438
+ * **Structure.** The message renders inside a
439
+ * `<span data-slot="selectable-list-empty-label">`. The live region stays
440
+ * mounted, so React removes that span when options match again. The span
441
+ * exists so the node React removes is an element: a browser translation
442
+ * engine reparents text nodes, and a removal aimed at one throws. The span is
443
+ * `display: contents`, so it adds no box and the message stays a direct child
444
+ * of the centered region.
445
+ *
446
+ * | Data Attribute | Value | Description |
447
+ * | -------------- | ------------------------------- | -------------------------------------------------------------------------- |
448
+ * | `data-slot` | `"selectable-list-empty"` | On the live-region element. |
449
+ * | `data-slot` | `"selectable-list-empty-label"` | On the `<span>` wrapping `children`. Present only while the message shows. |
450
+ *
425
451
  * @see https://mantle.ngrok.com/components/data-display/selectable-list
426
452
  *
427
453
  * @example
@@ -532,6 +558,19 @@ declare const SelectableList: {
532
558
  * indeterminate when only some are, unchecked when none are. Toggling it
533
559
  * selects or clears that filtered set. Optional. Children are the visible label.
534
560
  *
561
+ * **Structure.** `children` render inside a
562
+ * `<span data-slot="selectable-list-select-all-label">`. The checkbox is a
563
+ * permanent element sibling, so without the span a bare text label is never a
564
+ * lone child: a browser translation engine reparents that text node, and the
565
+ * removal React runs when a count-aware label swaps to an element throws. The
566
+ * span is `display: contents`, so the checkbox and the label stay flex items of
567
+ * the header and keep its `gap`.
568
+ *
569
+ * | Data Attribute | Value | Description |
570
+ * | -------------- | ------------------------------------ | ------------------------------------ |
571
+ * | `data-slot` | `"selectable-list-select-all"` | On the header `<label>`. |
572
+ * | `data-slot` | `"selectable-list-select-all-label"` | On the `<span>` wrapping `children`. |
573
+ *
535
574
  * @see https://mantle.ngrok.com/components/data-display/selectable-list
536
575
  *
537
576
  * @example
@@ -678,6 +717,19 @@ declare const SelectableList: {
678
717
  * hidden while there are matches), so screen-reader users hear the message
679
718
  * when their filter empties the list instead of the grid silently vanishing.
680
719
  *
720
+ * **Structure.** The message renders inside a
721
+ * `<span data-slot="selectable-list-empty-label">`. The live region stays
722
+ * mounted, so React removes that span when options match again. The span
723
+ * exists so the node React removes is an element: a browser translation
724
+ * engine reparents text nodes, and a removal aimed at one throws. The span is
725
+ * `display: contents`, so it adds no box and the message stays a direct child
726
+ * of the centered region.
727
+ *
728
+ * | Data Attribute | Value | Description |
729
+ * | -------------- | ------------------------------- | -------------------------------------------------------------------------- |
730
+ * | `data-slot` | `"selectable-list-empty"` | On the live-region element. |
731
+ * | `data-slot` | `"selectable-list-empty-label"` | On the `<span>` wrapping `children`. Present only while the message shows. |
732
+ *
681
733
  * @see https://mantle.ngrok.com/components/data-display/selectable-list
682
734
  *
683
735
  * @example
@@ -1 +1 @@
1
- import{t as e}from"./cx-0HCjnNv1.js";import{n as t,t as n}from"./checkbox-DbJSqSNN.js";import{t as r}from"./choice-SRyLguqU.js";import{t as i}from"./use-callback-ref-BvVyI5K1.js";import{n as a,t as o}from"./input-yq0jLE4e.js";import{n as s,r as c,t as l}from"./list-BleZ-43e.js";import{c as u}from"react/compiler-runtime";import{cloneElement as d,createContext as f,isValidElement as p,useContext as m,useId 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";function x(e){return e.labelText==null?typeof e.label==`string`?e.label:``:e.labelText}function S(e,t){let n=t.trim().toLowerCase();return n===``?e:e.filter(e=>x(e).toLowerCase().includes(n))}function C(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}function w(e,t){let n=0,r=0;for(let i of e)i.disabled||(n+=1,t.has(i.value)&&(r+=1));return n===0?{allSelected:!1,someSelected:!1}:{allSelected:r===n,someSelected:r>0}}const T=f(null);function E(e){let t=m(T);return _(t,`SelectableList.${e} must be rendered inside SelectableList.Root.`),t}const D=[],O=t=>{let n=u(49),r,a,o,s,c,l,d,f,p,m,_;n[0]===t?(r=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],d=n[7],f=n[8],p=n[9],m=n[10],_=n[11]):({className:r,defaultQuery:a,defaultValue:o,filter:s,onQueryChange:c,onValueChange:l,options:d,query:p,ref:m,value:_,...f}=t,n[0]=t,n[1]=r,n[2]=a,n[3]=o,n[4]=s,n[5]=c,n[6]=l,n[7]=d,n[8]=f,n[9]=p,n[10]=m,n[11]=_);let y=h(),b=_!=null,[x,w]=g(o??D),E=b?_:x,O=p!=null,[k,A]=g(a??``),j=O?p:k,M=i(l),N=i(c),P;n[12]!==b||n[13]!==M?(P=e=>{b||w(e),M(e)},n[12]=b,n[13]=M,n[14]=P):P=n[14];let F=P,I;n[15]!==O||n[16]!==N?(I=e=>{O||A(e),N(e)},n[15]=O,n[16]=N,n[17]=I):I=n[17];let L=I,R;n[18]===E?R=n[19]:(R=new Set(E),n[18]=E,n[19]=R);let V=R,H;n[20]===d?H=n[21]:(H=new Set(d.filter(z).map(B)),n[20]=d,n[21]=H);let U=H,W;n[22]!==s||n[23]!==d||n[24]!==j?(W=s==null?S(d,j):d.filter(e=>s(e,j)),n[22]=s,n[23]=d,n[24]=j,n[25]=W):W=n[25];let G=W,K;n[26]!==F||n[27]!==U||n[28]!==E?(K=e=>{U.has(e)||F(C(E,e))},n[26]=F,n[27]=U,n[28]=E,n[29]=K):K=n[29];let q;n[30]!==F||n[31]!==U||n[32]!==G||n[33]!==y||n[34]!==j||n[35]!==V||n[36]!==E||n[37]!==L||n[38]!==K?(q={listId:y,filteredOptions:G,query:j,setQuery:L,selectedValues:E,selectedSet:V,disabledSet:U,toggle:K,setSelection:F},n[30]=F,n[31]=U,n[32]=G,n[33]=y,n[34]=j,n[35]=V,n[36]=E,n[37]=L,n[38]=K,n[39]=q):q=n[39];let J=q,Y;n[40]===r?Y=n[41]:(Y=e(`flex w-full flex-col gap-3`,r),n[40]=r,n[41]=Y);let X;n[42]!==f||n[43]!==m||n[44]!==Y?(X=v(`div`,{ref:m,"data-slot":`selectable-list`,className:Y,...f}),n[42]=f,n[43]=m,n[44]=Y,n[45]=X):X=n[45];let Z;return n[46]!==J||n[47]!==X?(Z=v(T.Provider,{value:J,children:X}),n[46]=J,n[47]=X,n[48]=Z):Z=n[48],Z},k=e=>{let t=u(14),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({"aria-label":i,ref:r,...n}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let s=i===void 0?`Filter`:i,{query:c,setQuery:l}=E(`Filter`),d;t[4]===l?d=t[5]:(d=e=>l(e.target.value),t[4]=l,t[5]=d);let f,p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(f=v(b,{"aria-hidden":!0}),p=v(a,{}),t[6]=f,t[7]=p):(f=t[6],p=t[7]);let m;return t[8]!==s||t[9]!==n||t[10]!==c||t[11]!==r||t[12]!==d?(m=y(o,{ref:r,type:`text`,"data-slot":`selectable-list-filter`,"aria-label":s,value:c,onChange:d,...n,children:[f,p]}),t[8]=s,t[9]=n,t[10]=c,t[11]=r,t[12]=d,t[13]=m):m=t[13],m},A=r=>{let i=u(30),a,o,s,c;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4]):({children:a,className:o,ref:c,...s}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c);let{filteredOptions:l,selectedValues:d,selectedSet:f,setSelection:p}=E(`SelectAll`),m=h(),g,_;if(i[5]!==l||i[6]!==f){let{allSelected:e,someSelected:n}=w(l,f);g=e,_=t({allSelected:g,someSelected:n}),i[5]=l,i[6]=f,i[7]=g,i[8]=_}else g=i[7],_=i[8];let b=_,x;i[9]===l?x=i[10]:(x=l.some(V),i[9]=l,i[10]=x);let S=x,C;i[11]!==g||i[12]!==l||i[13]!==d||i[14]!==p?(C=()=>{let e=l.filter(H).map(U);if(g){let t=new Set(e);p(d.filter(e=>!t.has(e)));return}p([...new Set([...d,...e])])},i[11]=g,i[12]=l,i[13]=d,i[14]=p,i[15]=C):C=i[15];let T=C,D;i[16]===o?D=i[17]:(D=e(`text-strong flex cursor-pointer items-center gap-2 text-sm font-medium font-sans`,o),i[16]=o,i[17]=D);let O=!S,k;i[18]!==b||i[19]!==m||i[20]!==T||i[21]!==O?(k=v(n,{id:m,checked:b,onChange:T,disabled:O}),i[18]=b,i[19]=m,i[20]=T,i[21]=O,i[22]=k):k=i[22];let A;return i[23]!==a||i[24]!==m||i[25]!==s||i[26]!==c||i[27]!==D||i[28]!==k?(A=y(`label`,{ref:c,htmlFor:m,"data-slot":`selectable-list-select-all`,className:D,...s,children:[k,a]}),i[23]=a,i[24]=m,i[25]=s,i[26]=c,i[27]=D,i[28]=k,i[29]=A):A=i[29],A};function j(e,t){return`${e}-control-${encodeURIComponent(t)}`}const M=t=>{let i=u(38),a,o,c,l,d;i[0]===t?(a=i[1],o=i[2],c=i[3],l=i[4],d=i[5]):({children:a,className:o,ref:l,value:d,...c}=t,i[0]=t,i[1]=a,i[2]=o,i[3]=c,i[4]=l,i[5]=d);let{listId:f,selectedSet:p,disabledSet:m,toggle:h}=E(`Item`),g;i[6]!==f||i[7]!==d?(g=j(f,d),i[6]=f,i[7]=d,i[8]=g):g=i[8];let _=g,b;i[9]!==p||i[10]!==d?(b=p.has(d),i[9]=p,i[10]=d,i[11]=b):b=i[11];let x=b,S;i[12]!==m||i[13]!==d?(S=m.has(d),i[12]=m,i[13]=d,i[14]=S):S=i[14];let C=S,w;i[15]===o?w=i[16]:(w=e(`px-2 py-1.5 text-sm`,`cursor-pointer aria-disabled:cursor-default`,o),i[15]=o,i[16]=w);let T;i[17]!==h||i[18]!==d?(T=()=>h(d),i[17]=h,i[18]=d,i[19]=T):T=i[19];let D;i[20]!==x||i[21]!==T?(D=v(r.Indicator,{role:`gridcell`,children:v(n,{checked:x,onChange:T,tabIndex:-1})}),i[20]=x,i[21]=T,i[22]=D):D=i[22];let O;i[23]===a?O=i[24]:(O=v(r.Content,{role:`gridcell`,children:a}),i[23]=a,i[24]=O);let k;i[25]!==_||i[26]!==C||i[27]!==D||i[28]!==O?(k=y(r.Root,{id:_,disabled:C,children:[D,O]}),i[25]=_,i[26]=C,i[27]=D,i[28]=O,i[29]=k):k=i[29];let A;return i[30]!==C||i[31]!==c||i[32]!==l||i[33]!==x||i[34]!==w||i[35]!==k||i[36]!==d?(A=v(s,{ref:l,asChild:!0,selected:x,disabled:C,className:w,...c,"data-slot":`selectable-list-item`,"data-value":d,children:k}),i[30]=C,i[31]=c,i[32]=l,i[33]=x,i[34]=w,i[35]=k,i[36]=d,i[37]=A):A=i[37],A},N=e=>{let t=u(2),n;return t[0]===e?n=t[1]:(n=v(r.Label,{"data-slot":`selectable-list-item-title`,...e}),t[0]=e,t[1]=n),n},P=e=>{let t=u(2),n;return t[0]===e?n=t[1]:(n=v(r.Description,{"data-slot":`selectable-list-item-description`,...e}),t[0]=e,t[1]=n),n};function F(e){return y(M,{value:e.value,children:[v(N,{children:e.label}),e.description!=null&&v(P,{children:e.description})]})}function I(e,t){let n=[],r=[];for(let i of e){let e=t(i);p(e)&&(n.push(d(e,{key:i.value})),r.push(i))}return{items:n,options:r}}function L(e,t){let n=u(17),{filteredOptions:r,listId:i,toggle:a}=E(e),o=t??F,s;n[0]!==r||n[1]!==o?(s=I(r,o),n[0]=r,n[1]=o,n[2]=s):s=n[2];let{items:c,options:l}=s,d;n[3]!==l||n[4]!==a?(d=e=>{let t=l[e];t!=null&&a(t.value)},n[3]=l,n[4]=a,n[5]=d):d=n[5];let f=d,p;n[6]!==l||n[7]!==i?(p=e=>{let t=l[e];return t==null?``:j(i,t.value)},n[6]=l,n[7]=i,n[8]=p):p=n[8];let m=p,h;n[9]===l?h=n[10]:(h=e=>l[e]?.disabled===!0,n[9]=l,n[10]=h);let g=h,_=c.length===0,v;return n[11]!==g||n[12]!==m||n[13]!==c||n[14]!==f||n[15]!==_?(v={isEmpty:_,isItemDisabled:g,onActivate:f,itemId:m,items:c},n[11]=g,n[12]=m,n[13]=c,n[14]=f,n[15]=_,n[16]=v):v=n[16],v}const R={Root:O,Filter:k,SelectAll:A,Viewport:e=>{let t=u(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,ref:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{isEmpty:a,isItemDisabled:o,onActivate:s,itemId:l,items:d}=L(`Viewport`,n);if(a)return null;let f;return t[4]!==o||t[5]!==l||t[6]!==d||t[7]!==s||t[8]!==r||t[9]!==i?(f=v(c,{ref:i,"data-slot":`selectable-list-viewport`,semantics:`grid`,...r,"aria-multiselectable":!0,isItemDisabled:o,onActivate:s,itemId:l,children:d}),t[4]=o,t[5]=l,t[6]=d,t[7]=s,t[8]=r,t[9]=i,t[10]=f):f=t[10],f},VirtualViewport:e=>{let t=u(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,ref:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{isEmpty:a,isItemDisabled:o,onActivate:s,itemId:c,items:d}=L(`VirtualViewport`,n);if(a)return null;let f;return t[4]!==o||t[5]!==c||t[6]!==d||t[7]!==s||t[8]!==r||t[9]!==i?(f=v(l,{ref:i,"data-slot":`selectable-list-viewport`,semantics:`grid`,...r,"aria-multiselectable":!0,isItemDisabled:o,onActivate:s,itemId:c,children:d}),t[4]=o,t[5]=c,t[6]=d,t[7]=s,t[8]=r,t[9]=i,t[10]=f):f=t[10],f},Item:M,ItemTitle:N,ItemDescription:P,Empty:t=>{let n=u(14),r,i,a,o;n[0]===t?(r=n[1],i=n[2],a=n[3],o=n[4]):({children:r,className:i,ref:o,...a}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let{filteredOptions:s}=E(`Empty`),c=s.length===0,l=!c&&`sr-only`,d=c&&`text-muted border-popover bg-popover flex items-center justify-center rounded-md border px-3 py-8 text-center text-sm`,f;n[5]!==i||n[6]!==l||n[7]!==d?(f=e(l,d,i),n[5]=i,n[6]=l,n[7]=d,n[8]=f):f=n[8];let p=c?r:null,m;return n[9]!==a||n[10]!==o||n[11]!==f||n[12]!==p?(m=v(`div`,{ref:o,"data-slot":`selectable-list-empty`,role:`status`,className:f,...a,children:p}),n[9]=a,n[10]=o,n[11]=f,n[12]=p,n[13]=m):m=n[13],m}};function z(e){return e.disabled}function B(e){return e.value}function V(e){return!e.disabled}function H(e){return!e.disabled}function U(e){return e.value}export{R as SelectableList,S as filterSelectableOptions,x as optionLabelText,w as summarizeSelection,C as toggleSelectionValue};
1
+ import{t as e}from"./cx-0HCjnNv1.js";import{n as t,t as n}from"./checkbox-DbJSqSNN.js";import{t as r}from"./choice-SRyLguqU.js";import{t as i}from"./use-callback-ref-BvVyI5K1.js";import{n as a,t as o}from"./input-yq0jLE4e.js";import{n as s,r as c,t as l}from"./list-BleZ-43e.js";import{c as u}from"react/compiler-runtime";import{cloneElement as d,createContext as f,isValidElement as p,useContext as m,useId 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";function x(e){return e.labelText==null?typeof e.label==`string`?e.label:``:e.labelText}function S(e,t){let n=t.trim().toLowerCase();return n===``?e:e.filter(e=>x(e).toLowerCase().includes(n))}function C(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}function w(e,t){let n=0,r=0;for(let i of e)i.disabled||(n+=1,t.has(i.value)&&(r+=1));return n===0?{allSelected:!1,someSelected:!1}:{allSelected:r===n,someSelected:r>0}}const T=f(null);function E(e){let t=m(T);return _(t,`SelectableList.${e} must be rendered inside SelectableList.Root.`),t}const D=[],O=t=>{let n=u(49),r,a,o,s,c,l,d,f,p,m,_;n[0]===t?(r=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],d=n[7],f=n[8],p=n[9],m=n[10],_=n[11]):({className:r,defaultQuery:a,defaultValue:o,filter:s,onQueryChange:c,onValueChange:l,options:d,query:p,ref:m,value:_,...f}=t,n[0]=t,n[1]=r,n[2]=a,n[3]=o,n[4]=s,n[5]=c,n[6]=l,n[7]=d,n[8]=f,n[9]=p,n[10]=m,n[11]=_);let y=h(),b=_!=null,[x,w]=g(o??D),E=b?_:x,O=p!=null,[k,A]=g(a??``),j=O?p:k,M=i(l),N=i(c),P;n[12]!==b||n[13]!==M?(P=e=>{b||w(e),M(e)},n[12]=b,n[13]=M,n[14]=P):P=n[14];let F=P,I;n[15]!==O||n[16]!==N?(I=e=>{O||A(e),N(e)},n[15]=O,n[16]=N,n[17]=I):I=n[17];let L=I,R;n[18]===E?R=n[19]:(R=new Set(E),n[18]=E,n[19]=R);let V=R,H;n[20]===d?H=n[21]:(H=new Set(d.filter(z).map(B)),n[20]=d,n[21]=H);let U=H,W;n[22]!==s||n[23]!==d||n[24]!==j?(W=s==null?S(d,j):d.filter(e=>s(e,j)),n[22]=s,n[23]=d,n[24]=j,n[25]=W):W=n[25];let G=W,K;n[26]!==F||n[27]!==U||n[28]!==E?(K=e=>{U.has(e)||F(C(E,e))},n[26]=F,n[27]=U,n[28]=E,n[29]=K):K=n[29];let q;n[30]!==F||n[31]!==U||n[32]!==G||n[33]!==y||n[34]!==j||n[35]!==V||n[36]!==E||n[37]!==L||n[38]!==K?(q={listId:y,filteredOptions:G,query:j,setQuery:L,selectedValues:E,selectedSet:V,disabledSet:U,toggle:K,setSelection:F},n[30]=F,n[31]=U,n[32]=G,n[33]=y,n[34]=j,n[35]=V,n[36]=E,n[37]=L,n[38]=K,n[39]=q):q=n[39];let J=q,Y;n[40]===r?Y=n[41]:(Y=e(`flex w-full flex-col gap-3`,r),n[40]=r,n[41]=Y);let X;n[42]!==f||n[43]!==m||n[44]!==Y?(X=v(`div`,{ref:m,"data-slot":`selectable-list`,className:Y,...f}),n[42]=f,n[43]=m,n[44]=Y,n[45]=X):X=n[45];let Z;return n[46]!==J||n[47]!==X?(Z=v(T.Provider,{value:J,children:X}),n[46]=J,n[47]=X,n[48]=Z):Z=n[48],Z},k=e=>{let t=u(14),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({"aria-label":i,ref:r,...n}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let s=i===void 0?`Filter`:i,{query:c,setQuery:l}=E(`Filter`),d;t[4]===l?d=t[5]:(d=e=>l(e.target.value),t[4]=l,t[5]=d);let f,p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(f=v(b,{"aria-hidden":!0}),p=v(a,{}),t[6]=f,t[7]=p):(f=t[6],p=t[7]);let m;return t[8]!==s||t[9]!==n||t[10]!==c||t[11]!==r||t[12]!==d?(m=y(o,{ref:r,type:`text`,"data-slot":`selectable-list-filter`,"aria-label":s,value:c,onChange:d,...n,children:[f,p]}),t[8]=s,t[9]=n,t[10]=c,t[11]=r,t[12]=d,t[13]=m):m=t[13],m},A=r=>{let i=u(32),a,o,s,c;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4]):({children:a,className:o,ref:c,...s}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c);let{filteredOptions:l,selectedValues:d,selectedSet:f,setSelection:p}=E(`SelectAll`),m=h(),g,_;if(i[5]!==l||i[6]!==f){let{allSelected:e,someSelected:n}=w(l,f);g=e,_=t({allSelected:g,someSelected:n}),i[5]=l,i[6]=f,i[7]=g,i[8]=_}else g=i[7],_=i[8];let b=_,x;i[9]===l?x=i[10]:(x=l.some(V),i[9]=l,i[10]=x);let S=x,C;i[11]!==g||i[12]!==l||i[13]!==d||i[14]!==p?(C=()=>{let e=l.filter(H).map(U);if(g){let t=new Set(e);p(d.filter(e=>!t.has(e)));return}p([...new Set([...d,...e])])},i[11]=g,i[12]=l,i[13]=d,i[14]=p,i[15]=C):C=i[15];let T=C,D;i[16]===o?D=i[17]:(D=e(`text-strong flex cursor-pointer items-center gap-2 text-sm font-medium font-sans`,o),i[16]=o,i[17]=D);let O=!S,k;i[18]!==b||i[19]!==m||i[20]!==T||i[21]!==O?(k=v(n,{id:m,checked:b,onChange:T,disabled:O}),i[18]=b,i[19]=m,i[20]=T,i[21]=O,i[22]=k):k=i[22];let A;i[23]===a?A=i[24]:(A=v(`span`,{"data-slot":`selectable-list-select-all-label`,className:`contents`,children:a}),i[23]=a,i[24]=A);let j;return i[25]!==m||i[26]!==s||i[27]!==c||i[28]!==D||i[29]!==k||i[30]!==A?(j=y(`label`,{ref:c,htmlFor:m,"data-slot":`selectable-list-select-all`,className:D,...s,children:[k,A]}),i[25]=m,i[26]=s,i[27]=c,i[28]=D,i[29]=k,i[30]=A,i[31]=j):j=i[31],j};function j(e,t){return`${e}-control-${encodeURIComponent(t)}`}const M=t=>{let i=u(38),a,o,c,l,d;i[0]===t?(a=i[1],o=i[2],c=i[3],l=i[4],d=i[5]):({children:a,className:o,ref:l,value:d,...c}=t,i[0]=t,i[1]=a,i[2]=o,i[3]=c,i[4]=l,i[5]=d);let{listId:f,selectedSet:p,disabledSet:m,toggle:h}=E(`Item`),g;i[6]!==f||i[7]!==d?(g=j(f,d),i[6]=f,i[7]=d,i[8]=g):g=i[8];let _=g,b;i[9]!==p||i[10]!==d?(b=p.has(d),i[9]=p,i[10]=d,i[11]=b):b=i[11];let x=b,S;i[12]!==m||i[13]!==d?(S=m.has(d),i[12]=m,i[13]=d,i[14]=S):S=i[14];let C=S,w;i[15]===o?w=i[16]:(w=e(`px-2 py-1.5 text-sm`,`cursor-pointer aria-disabled:cursor-default`,o),i[15]=o,i[16]=w);let T;i[17]!==h||i[18]!==d?(T=()=>h(d),i[17]=h,i[18]=d,i[19]=T):T=i[19];let D;i[20]!==x||i[21]!==T?(D=v(r.Indicator,{role:`gridcell`,children:v(n,{checked:x,onChange:T,tabIndex:-1})}),i[20]=x,i[21]=T,i[22]=D):D=i[22];let O;i[23]===a?O=i[24]:(O=v(r.Content,{role:`gridcell`,children:a}),i[23]=a,i[24]=O);let k;i[25]!==_||i[26]!==C||i[27]!==D||i[28]!==O?(k=y(r.Root,{id:_,disabled:C,children:[D,O]}),i[25]=_,i[26]=C,i[27]=D,i[28]=O,i[29]=k):k=i[29];let A;return i[30]!==C||i[31]!==c||i[32]!==l||i[33]!==x||i[34]!==w||i[35]!==k||i[36]!==d?(A=v(s,{ref:l,asChild:!0,selected:x,disabled:C,className:w,...c,"data-slot":`selectable-list-item`,"data-value":d,children:k}),i[30]=C,i[31]=c,i[32]=l,i[33]=x,i[34]=w,i[35]=k,i[36]=d,i[37]=A):A=i[37],A},N=e=>{let t=u(2),n;return t[0]===e?n=t[1]:(n=v(r.Label,{"data-slot":`selectable-list-item-title`,...e}),t[0]=e,t[1]=n),n},P=e=>{let t=u(2),n;return t[0]===e?n=t[1]:(n=v(r.Description,{"data-slot":`selectable-list-item-description`,...e}),t[0]=e,t[1]=n),n};function F(e){return y(M,{value:e.value,children:[v(N,{children:e.label}),e.description!=null&&v(P,{children:e.description})]})}function I(e,t){let n=[],r=[];for(let i of e){let e=t(i);p(e)&&(n.push(d(e,{key:i.value})),r.push(i))}return{items:n,options:r}}function L(e,t){let n=u(17),{filteredOptions:r,listId:i,toggle:a}=E(e),o=t??F,s;n[0]!==r||n[1]!==o?(s=I(r,o),n[0]=r,n[1]=o,n[2]=s):s=n[2];let{items:c,options:l}=s,d;n[3]!==l||n[4]!==a?(d=e=>{let t=l[e];t!=null&&a(t.value)},n[3]=l,n[4]=a,n[5]=d):d=n[5];let f=d,p;n[6]!==l||n[7]!==i?(p=e=>{let t=l[e];return t==null?``:j(i,t.value)},n[6]=l,n[7]=i,n[8]=p):p=n[8];let m=p,h;n[9]===l?h=n[10]:(h=e=>l[e]?.disabled===!0,n[9]=l,n[10]=h);let g=h,_=c.length===0,v;return n[11]!==g||n[12]!==m||n[13]!==c||n[14]!==f||n[15]!==_?(v={isEmpty:_,isItemDisabled:g,onActivate:f,itemId:m,items:c},n[11]=g,n[12]=m,n[13]=c,n[14]=f,n[15]=_,n[16]=v):v=n[16],v}const R={Root:O,Filter:k,SelectAll:A,Viewport:e=>{let t=u(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,ref:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{isEmpty:a,isItemDisabled:o,onActivate:s,itemId:l,items:d}=L(`Viewport`,n);if(a)return null;let f;return t[4]!==o||t[5]!==l||t[6]!==d||t[7]!==s||t[8]!==r||t[9]!==i?(f=v(c,{ref:i,"data-slot":`selectable-list-viewport`,semantics:`grid`,...r,"aria-multiselectable":!0,isItemDisabled:o,onActivate:s,itemId:l,children:d}),t[4]=o,t[5]=l,t[6]=d,t[7]=s,t[8]=r,t[9]=i,t[10]=f):f=t[10],f},VirtualViewport:e=>{let t=u(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,ref:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{isEmpty:a,isItemDisabled:o,onActivate:s,itemId:c,items:d}=L(`VirtualViewport`,n);if(a)return null;let f;return t[4]!==o||t[5]!==c||t[6]!==d||t[7]!==s||t[8]!==r||t[9]!==i?(f=v(l,{ref:i,"data-slot":`selectable-list-viewport`,semantics:`grid`,...r,"aria-multiselectable":!0,isItemDisabled:o,onActivate:s,itemId:c,children:d}),t[4]=o,t[5]=c,t[6]=d,t[7]=s,t[8]=r,t[9]=i,t[10]=f):f=t[10],f},Item:M,ItemTitle:N,ItemDescription:P,Empty:t=>{let n=u(17),r,i,a,o;n[0]===t?(r=n[1],i=n[2],a=n[3],o=n[4]):({children:r,className:i,ref:o,...a}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let{filteredOptions:s}=E(`Empty`),c=s.length===0,l=!c&&`sr-only`,d=c&&`text-muted border-popover bg-popover flex items-center justify-center rounded-md border px-3 py-8 text-center text-sm`,f;n[5]!==i||n[6]!==l||n[7]!==d?(f=e(l,d,i),n[5]=i,n[6]=l,n[7]=d,n[8]=f):f=n[8];let p;n[9]!==r||n[10]!==c?(p=c&&v(`span`,{"data-slot":`selectable-list-empty-label`,className:`contents`,children:r}),n[9]=r,n[10]=c,n[11]=p):p=n[11];let m;return n[12]!==a||n[13]!==o||n[14]!==f||n[15]!==p?(m=v(`div`,{ref:o,"data-slot":`selectable-list-empty`,role:`status`,className:f,...a,children:p}),n[12]=a,n[13]=o,n[14]=f,n[15]=p,n[16]=m):m=n[16],m}};function z(e){return e.disabled}function B(e){return e.value}function V(e){return!e.disabled}function H(e){return!e.disabled}function U(e){return e.value}export{R as SelectableList,S as filterSelectableOptions,x as optionLabelText,w as summarizeSelection,C as toggleSelectionValue};
package/dist/sidebar.d.ts CHANGED
@@ -2,7 +2,7 @@ import { n as WithAsChild } from "./as-child-D23mGo4f.js";
2
2
  import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
3
3
  import { n as IconButtonProps } from "./button-crUf0hbR.js";
4
4
  import { n as Separator } from "./separator-Bo4nY_3M.js";
5
- import { t as Tooltip } from "./tooltip-DA41fxe5.js";
5
+ import { t as Tooltip } from "./tooltip-CfsA_JPe.js";
6
6
  import { ComponentProps, ReactElement, ReactNode } from "react";
7
7
  //#region src/components/sidebar/sidebar.d.ts
8
8
  /**
@@ -401,6 +401,9 @@ type SidebarTriggerProps = Omit<IconButtonProps, "appearance" | "asChild" | "chi
401
401
  * | --- | --- | --- |
402
402
  * | `data-state` | `"expanded"` \| `"collapsed"` | Mirrors what the trigger toggles: the mobile sheet below the root's `mobileBreakpoint`, the desktop panel otherwise. Pairs with `aria-expanded`. |
403
403
  * | `data-slot` | `"sidebar-trigger-tooltip"` | On the tooltip surface, not the button — the styling hook for the label-and-chord popup this part renders. |
404
+ * | `data-slot` | `"sidebar-tooltip-row"` | Inside that surface, on the flex row holding the label and the optional chord chips. Nested inside `Tooltip.Content`'s own `tooltip-label` div. Always present. |
405
+ * | `data-slot` | `"sidebar-tooltip-label"` | On the `<span>` wrapping `label` inside that row. Always present, and `display: contents`, so the label stays a flex item of the row. |
406
+ * | `data-slot` | `"sidebar-tooltip-shortcut"` | On the chord chips. Present only while `shortcut` holds something. |
404
407
  * | `data-appearance` | `"filled"` \| `"ghost"` \| `"outlined"` | Read, not stamped: the underlying `IconButton` reflects its `appearance`, which this part defaults to `"ghost"`. |
405
408
  * | `data-intent` | `"neutral"` | Read, not stamped: the underlying `IconButton` reflects its `intent`, and it draws the neutral tone only. |
406
409
  * | `data-size` | `"xs"` \| `"sm"` \| `"md"` \| `"lg"` \| `"xl"` | Read, not stamped: the underlying `IconButton` reflects its `size` and its own `"md"` default. |
@@ -1086,6 +1089,9 @@ type SidebarSearchTriggerProps = ComponentProps<"button"> & WithDataSlot & ({
1086
1089
  *
1087
1090
  * | Data Attribute | Value | Description |
1088
1091
  * | --- | --- | --- |
1092
+ * | `data-slot` | `"sidebar-search-trigger"` | On the row element. |
1093
+ * | `data-slot` | `"sidebar-search-trigger-label"` | On the `<span>` wrapping `children` on the default `button` path. Absent under `asChild`, which renders no sibling. |
1094
+ * | `data-slot` | `"sidebar-search-trigger-shortcut"` | On the chord chips. Always present on the default `button` path, and `display: none` while it is empty. Absent under `asChild`, where the props union forbids `shortcut`. |
1089
1095
  * | `data-state` | `"open"` \| `"closed"` | **Read, not stamped** — supplied by the composing `Command.SearchTrigger` / `Dialog.Trigger`. The row stays highlighted while its palette is open. |
1090
1096
  *
1091
1097
  * @see https://mantle.ngrok.com/components/navigation/sidebar#sidebarsearchtrigger
@@ -1308,6 +1314,15 @@ type SidebarTooltipProps = Omit<ComponentProps<typeof Tooltip.Content>, "childre
1308
1314
  * `asChild`, which Radix's `Tooltip.Content` implements itself. `side` defaults
1309
1315
  * to `"right"` so the tooltip opens away from the rail.
1310
1316
  *
1317
+ * **Data attributes:**
1318
+ *
1319
+ * | Data Attribute | Value | Description |
1320
+ * | --- | --- | --- |
1321
+ * | `data-slot` | `"sidebar-tooltip"` | On the tooltip surface. |
1322
+ * | `data-slot` | `"sidebar-tooltip-row"` | Inside that surface, on the flex row holding the label and the optional chord chips. Nested inside `Tooltip.Content`'s own `tooltip-label` div. Always present, so a chord that arrives later appends instead of replacing the label. |
1323
+ * | `data-slot` | `"sidebar-tooltip-label"` | On the `<span>` wrapping `label` inside that row. Always present, and `display: contents`, so the label stays a flex item of the row. |
1324
+ * | `data-slot` | `"sidebar-tooltip-shortcut"` | On the chord chips. Present only while `shortcut` holds something. |
1325
+ *
1311
1326
  * @see https://mantle.ngrok.com/components/navigation/sidebar#sidebartooltip
1312
1327
  *
1313
1328
  * @example
@@ -2168,6 +2183,9 @@ declare const Sidebar: {
2168
2183
  *
2169
2184
  * | Data Attribute | Value | Description |
2170
2185
  * | --- | --- | --- |
2186
+ * | `data-slot` | `"sidebar-search-trigger"` | On the row element. |
2187
+ * | `data-slot` | `"sidebar-search-trigger-label"` | On the `<span>` wrapping `children` on the default `button` path. Absent under `asChild`, which renders no sibling. |
2188
+ * | `data-slot` | `"sidebar-search-trigger-shortcut"` | On the chord chips. Always present on the default `button` path, and `display: none` while it is empty. Absent under `asChild`, where the props union forbids `shortcut`. |
2171
2189
  * | `data-state` | `"open"` \| `"closed"` | **Read, not stamped** — supplied by the composing `Command.SearchTrigger` / `Dialog.Trigger`. Style the row while its palette is open with `data-state-open:`. |
2172
2190
  *
2173
2191
  * @see https://mantle.ngrok.com/components/navigation/sidebar#sidebarsearchtrigger
@@ -2295,6 +2313,15 @@ declare const Sidebar: {
2295
2313
  * `TooltipProvider` ancestor. Takes `Tooltip.Content`'s props (including
2296
2314
  * `asChild`) on the tooltip surface; `side` defaults to `"right"`.
2297
2315
  *
2316
+ * **Data attributes:**
2317
+ *
2318
+ * | Data Attribute | Value | Description |
2319
+ * | --- | --- | --- |
2320
+ * | `data-slot` | `"sidebar-tooltip"` | On the tooltip surface. |
2321
+ * | `data-slot` | `"sidebar-tooltip-row"` | Inside that surface, on the flex row holding the label and the optional chord chips. Nested inside `Tooltip.Content`'s own `tooltip-label` div. Always present, so a chord that arrives later appends instead of replacing the label. |
2322
+ * | `data-slot` | `"sidebar-tooltip-label"` | On the `<span>` wrapping `label` inside that row. Always present, and `display: contents`, so the label stays a flex item of the row. |
2323
+ * | `data-slot` | `"sidebar-tooltip-shortcut"` | On the chord chips. Present only while `shortcut` holds something. |
2324
+ *
2298
2325
  * @see https://mantle.ngrok.com/components/navigation/sidebar#sidebartooltip
2299
2326
  *
2300
2327
  * @example
package/dist/sidebar.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-BsvE2ntj.js";import{t as r}from"./button-pwkdtR3U.js";import{t as i}from"./use-is-hydrated-DDCqXmju.js";import{n as a}from"./separator-D98be0gY.js";import{n as o,t as s}from"./use-is-apple-platform-CMPzIYjz.js";import{t as c}from"./use-callback-ref-BvVyI5K1.js";import{n as l}from"./cookie-ca4g5CKp.js";import{t as u}from"./sheet-D8KGX4q1.js";import{r as d}from"./use-breakpoint-CjyNk0fi.js";import{t as f}from"./tooltip-DikKOzqN.js";import{c as p}from"react/compiler-runtime";import{createContext as m,useContext as h,useEffect as g,useId as _,useRef as v,useState as y}from"react";import b from"tiny-invariant";import{Fragment as x,jsx as S,jsxs as C}from"react/jsx-runtime";import{SidebarSimpleIcon as w}from"@phosphor-icons/react/SidebarSimple";const T={sm:`hidden sm:block`,md:`hidden md:block`,lg:`hidden lg:block`},E=m(null);function D(){let e=h(E);return b(e,`useSidebar must be used within Sidebar.Root.`),e}function O(e){let t=h(E);return b(t,`Sidebar.${e} must be rendered inside Sidebar.Root.`),t}const k=[];function A(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`:!1}function j(){let e=Symbol(`sidebar-keyboard-shortcut`);return k.push(e),{isOwner:()=>k[0]===e,release:()=>{let t=k.indexOf(e);t!==-1&&k.splice(t,1)}}}const M=e=>{let t=p(34),{children:n,defaultOpen:r,keyboardShortcut:i,mobileBreakpoint:a,onOpenChange:s,onOpenMobileChange:l,open:u,openMobile:f}=e,m=r===void 0||r,h=i===void 0||i,b=a===void 0?`lg`:a,x=d(b),C=_(),w=u!=null,[T,D]=y(m),O=w?u:T,k;t[0]!==w||t[1]!==s?(k=e=>{w||D(e),s?.(e)},t[0]=w,t[1]=s,t[2]=k):k=t[2];let M=k,N=f!=null,[P,F]=y(!1),I=N?f:P,L;t[3]!==N||t[4]!==l?(L=e=>{N||F(e),l?.(e)},t[3]=N,t[4]=l,t[5]=L):L=t[5];let R=L,z=v(x),B,V;t[6]!==x||t[7]!==I||t[8]!==R?(B=()=>{let e=z.current&&!x;z.current=x,e&&I&&R(!1)},V=[x,I,R],t[6]=x,t[7]=I,t[8]=R,t[9]=B,t[10]=V):(B=t[9],V=t[10]),g(B,V);let H;t[11]!==x||t[12]!==O||t[13]!==I||t[14]!==M||t[15]!==R?(H=()=>{x?R(!I):M(!O)},t[11]=x,t[12]=O,t[13]=I,t[14]=M,t[15]=R,t[16]=H):H=t[16];let U=H,W=c(U),G,K;t[17]!==h||t[18]!==W?(K=()=>{if(!h)return;let e=j(),t=o(),n=n=>{if(!e.isOwner()||A(n.target))return;let r=t?n.metaKey:n.ctrlKey,i=t?n.ctrlKey:n.metaKey;n.key.toLowerCase()===`b`&&r&&!i&&!n.altKey&&!n.shiftKey&&(n.preventDefault(),W())};return window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`keydown`,n),e.release()}},G=[h,W],t[17]=h,t[18]=W,t[19]=G,t[20]=K):(G=t[19],K=t[20]),g(K,G);let q;t[21]!==x||t[22]!==h||t[23]!==b||t[24]!==C||t[25]!==O||t[26]!==I||t[27]!==M||t[28]!==R||t[29]!==U?(q={isMobile:x,keyboardShortcut:h,mobileBreakpoint:b,navId:C,open:O,openMobile:I,setOpen:M,setOpenMobile:R,toggle:U},t[21]=x,t[22]=h,t[23]=b,t[24]=C,t[25]=O,t[26]=I,t[27]=M,t[28]=R,t[29]=U,t[30]=q):q=t[30];let J=q,Y;return t[31]!==n||t[32]!==J?(Y=S(E.Provider,{value:J,children:n}),t[31]=n,t[32]=J,t[33]=Y):Y=t[33],Y},N=n=>{let r=p(49),a,o,s,c,l,d;r[0]===n?(a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],d=r[6]):({"aria-label":a,"aria-labelledby":o,children:s,className:c,"data-slot":l,...d}=n,r[0]=n,r[1]=a,r[2]=o,r[3]=s,r[4]=c,r[5]=l,r[6]=d);let{isMobile:f,mobileBreakpoint:m,navId:h,open:g,openMobile:_,setOpenMobile:v}=O(`Nav`),y=i(),b=a??(o==null?`Main`:void 0);if(f){let n;r[7]===l?n=r[8]:(n=t(l,`sidebar-nav`),r[7]=l,r[8]=n);let i;r[9]===o?i=r[10]:(i=o==null?null:{"aria-labelledby":o},r[9]=o,r[10]=i);let a;r[11]===c?a=r[12]:(a=e(`bg-base w-(--sidebar-width-mobile,18rem) max-w-full p-0`,c),r[11]=c,r[12]=a);let f=b??`Sidebar`,p;r[13]===f?p=r[14]:(p=S(u.Title,{className:`sr-only`,children:f}),r[13]=f,r[14]=p);let m;r[15]!==b||r[16]!==o||r[17]!==s||r[18]!==h?(m=S(`nav`,{id:h,"aria-label":b,"aria-labelledby":o,className:`flex h-full w-full min-w-0 flex-col text-sm`,children:s}),r[15]=b,r[16]=o,r[17]=s,r[18]=h,r[19]=m):m=r[19];let g;r[20]!==d||r[21]!==n||r[22]!==i||r[23]!==a||r[24]!==p||r[25]!==m?(g=C(u.Content,{side:`left`,preferredWidth:`sm:max-w-(--sidebar-width-mobile,18rem)`,"data-slot":n,"data-mobile":``,...i,className:a,...d,children:[p,m]}),r[20]=d,r[21]=n,r[22]=i,r[23]=a,r[24]=p,r[25]=m,r[26]=g):g=r[26];let y;return r[27]!==_||r[28]!==v||r[29]!==g?(y=S(u.Root,{open:_,onOpenChange:v,children:g}),r[27]=_,r[28]=v,r[29]=g,r[30]=y):y=r[30],y}let x;r[31]===l?x=r[32]:(x=t(l,`sidebar-nav`),r[31]=l,r[32]=x);let w=g?`expanded`:`collapsed`,E=y?``:void 0,D=!y&&T[m],k=y&&`transition-[width] duration-200 ease-linear motion-reduce:transition-none`,A;r[33]!==c||r[34]!==D||r[35]!==k?(A=e(`group/sidebar-nav bg-base relative h-full w-(--sidebar-width,13rem) shrink-0 overflow-hidden`,`data-[state=collapsed]:w-(--sidebar-width-icon,3.25rem)`,D,k,c),r[33]=c,r[34]=D,r[35]=k,r[36]=A):A=r[36];let j;r[37]!==b||r[38]!==o||r[39]!==s||r[40]!==h?(j=S(`nav`,{id:h,"aria-label":b,"aria-labelledby":o,className:`absolute inset-y-0 left-0 flex w-full min-w-0 flex-col text-sm`,children:s}),r[37]=b,r[38]=o,r[39]=s,r[40]=h,r[41]=j):j=r[41];let M;return r[42]!==d||r[43]!==x||r[44]!==w||r[45]!==E||r[46]!==A||r[47]!==j?(M=S(`div`,{"data-slot":x,"data-state":w,"data-hydrated":E,className:A,...d,children:j}),r[42]=d,r[43]=x,r[44]=w,r[45]=E,r[46]=A,r[47]=j,r[48]=M):M=r[48],M},P=S(w,{}),F=e=>{let t=p(5),{label:n,shortcut:r}=e;if(r==null)return n;let i;t[0]===r?i=t[1]:(i=S(`span`,{"aria-hidden":!0,className:`inline-flex shrink-0 items-center gap-0.5 [&_kbd]:h-4 [&_kbd]:min-w-4 [&_kbd]:bg-neutral-500/25 [&_kbd]:px-0.5 [&_kbd]:text-xs`,children:r}),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=C(`span`,{className:`flex items-center gap-1.5`,children:[n,i]}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a},I=e=>{let n=p(32),i,a,o,c,l,u,d,m;n[0]===e?(i=n[1],a=n[2],o=n[3],c=n[4],l=n[5],u=n[6],d=n[7],m=n[8]):({appearance:l,"data-slot":i,icon:u,intent:d,label:m,onClick:a,shortcut:c,...o}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=o,n[4]=c,n[5]=l,n[6]=u,n[7]=d,n[8]=m);let h=l===void 0?`ghost`:l,g=u===void 0?P:u,_=d===void 0?`neutral`:d,v=m===void 0?`Toggle Sidebar`:m,{isMobile:y,keyboardShortcut:b,navId:x,open:w,openMobile:T,toggle:E}=O(`Trigger`),D=s(),k=y?T:w,A=!y||T,j=b?c:void 0,M=D?`Meta+B`:`Control+B`,N=A?x:void 0,I=b?M:void 0,L;n[9]===i?L=n[10]:(L=t(i,`sidebar-trigger`),n[9]=i,n[10]=L);let R=k?`expanded`:`collapsed`,z;n[11]!==a||n[12]!==E?(z=e=>{a?.(e),e.defaultPrevented||E()},n[11]=a,n[12]=E,n[13]=z):z=n[13];let B;n[14]!==h||n[15]!==k||n[16]!==g||n[17]!==_||n[18]!==v||n[19]!==o||n[20]!==N||n[21]!==I||n[22]!==L||n[23]!==R||n[24]!==z?(B=S(f.Trigger,{asChild:!0,children:S(r,{appearance:h,"aria-controls":N,"aria-expanded":k,"aria-keyshortcuts":I,"data-slot":L,"data-state":R,icon:g,intent:_,label:v,onClick:z,...o})}),n[14]=h,n[15]=k,n[16]=g,n[17]=_,n[18]=v,n[19]=o,n[20]=N,n[21]=I,n[22]=L,n[23]=R,n[24]=z,n[25]=B):B=n[25];let V;n[26]!==j||n[27]!==v?(V=S(f.Content,{"data-slot":`sidebar-trigger-tooltip`,children:S(F,{label:v,shortcut:j})}),n[26]=j,n[27]=v,n[28]=V):V=n[28];let H;return n[29]!==B||n[30]!==V?(H=C(f.Root,{children:[B,V]}),n[29]=B,n[30]=V,n[31]=H):H=n[31],H},L=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(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}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-header`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`grid grid-cols-1 grid-rows-(--sidebar-header-height,4.5rem) shrink-0 items-center px-3`,`group-data-[state=expanded]/sidebar-nav:pr-1`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(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]=m):m=i[15],m},R=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(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}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-body`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`scrollbar scrollbar-gutter-stable scroll-fade-y flex-1 scroll-py-6 space-y-2 overflow-y-auto overflow-x-hidden px-3 pt-1.5 pb-4`,`group-data-[state=expanded]/sidebar-nav:pr-1`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-none`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-gutter-auto`,`group-data-[state=collapsed]/sidebar-nav:[&::-webkit-scrollbar]:hidden`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(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]=m):m=i[15],m},z=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(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}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-footer`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`shrink-0 px-3 pt-3 pb-3.5`,`group-data-[state=expanded]/sidebar-nav:pr-1`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(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]=m):m=i[15],m},B=m(null),V=r=>{let i=p(21),a,o,s,c,l;i[0]===r?(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}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let[u,d]=y(null),f;i[6]===u?f=i[7]:(f={mountedLabelId:u,setMountedLabelId:d},i[6]=u,i[7]=f);let m=f,h=a?n:`div`,g;i[8]===c?g=i[9]:(g=t(c,`sidebar-group`),i[8]=c,i[9]=g);let _;i[10]===s?_=i[11]:(_=e(`pt-0.5`,s),i[10]=s,i[11]=_);let v;i[12]!==h||i[13]!==o||i[14]!==l||i[15]!==g||i[16]!==_?(v=S(h,{"data-slot":g,className:_,...l,children:o}),i[12]=h,i[13]=o,i[14]=l,i[15]=g,i[16]=_,i[17]=v):v=i[17];let b;return i[18]!==m||i[19]!==v?(b=S(B.Provider,{value:m,children:v}),i[18]=m,i[19]=v,i[20]=b):b=i[20],b},H=r=>{let i=p(22),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({asChild:a,children:o,className:s,"data-slot":c,id:l,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=h(B),f=_(),m=l??(d==null?void 0:f),v=d?.setMountedLabelId,y,b;i[7]!==m||i[8]!==v?(y=()=>{if(v!=null&&m!=null)return v(m),()=>{v(null)}},b=[v,m],i[7]=m,i[8]=v,i[9]=y,i[10]=b):(y=i[9],b=i[10]),g(y,b);let x=a?n:`div`,C;i[11]===c?C=i[12]:(C=t(c,`sidebar-group-label`),i[11]=c,i[12]=C);let w;i[13]===s?w=i[14]:(w=e(`text-muted flex min-w-0 items-center gap-2 truncate px-2 py-1 text-xs font-medium`,`group-data-[state=collapsed]/sidebar-nav:opacity-0`,`group-data-[state=collapsed]/sidebar-nav:pointer-events-none`,`group-data-hydrated/sidebar-nav:transition-opacity group-data-hydrated/sidebar-nav:duration-200 group-data-hydrated/sidebar-nav:ease-linear group-data-hydrated/sidebar-nav:motion-reduce:transition-none`,s),i[13]=s,i[14]=w);let T;return i[15]!==x||i[16]!==o||i[17]!==m||i[18]!==u||i[19]!==C||i[20]!==w?(T=S(x,{id:m,"data-slot":C,className:w,...u,children:o}),i[15]=x,i[16]=o,i[17]=m,i[18]=u,i[19]=C,i[20]=w,i[21]=T):T=i[21],T},U=r=>{let i=p(18),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({"aria-labelledby":a,asChild:o,children:s,className:c,"data-slot":l,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=h(B),f=o?n:`ul`,m=a??d?.mountedLabelId??void 0,g;i[7]===l?g=i[8]:(g=t(l,`sidebar-list`),i[7]=l,i[8]=g);let _;i[9]===c?_=i[10]:(_=e(`mb-2 space-y-px`,c),i[9]=c,i[10]=_);let v;return i[11]!==f||i[12]!==s||i[13]!==u||i[14]!==m||i[15]!==g||i[16]!==_?(v=S(f,{"aria-labelledby":m,"data-slot":g,className:_,...u,children:s}),i[11]=f,i[12]=s,i[13]=u,i[14]=m,i[15]=g,i[16]=_,i[17]=v):v=i[17],v},W=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(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}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`li`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-item`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`list-none`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(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]=m):m=i[15],m},G=[`ring-focus-accent flex w-full min-w-0 items-center gap-2 truncate rounded-md px-2 py-1 text-left font-normal transition-none focus:outline-hidden focus-visible:ring-4`,`text-body hover:text-strong hover:bg-neutral-500/10`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`group-data-[state=collapsed]/sidebar-nav:ml-1`,`group-data-[state=collapsed]/sidebar-nav:w-7`,`group-data-[state=collapsed]/sidebar-nav:p-1`].join(` `),K={Root:M,Nav:N,Trigger:I,Header:L,Body:R,Footer:z,Group:V,GroupLabel:H,List:U,Item:W,ItemButton:r=>{let i=p(21),a,o,s,c,l,u,d;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6],d=i[7]):({asChild:a,children:o,className:s,current:c,"data-slot":l,type:d,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u,i[7]=d);let f=a?n:`button`,m;i[8]===l?m=i[9]:(m=t(l,`sidebar-item-button`),i[8]=l,i[9]=m);let h=c?``:void 0,g=c?`page`:void 0,_=a?d:d??`button`,v;i[10]===s?v=i[11]:(v=e(G,`data-current:bg-neutral-500/15 data-current:text-strong`,`aria-[current=page]:bg-neutral-500/15 aria-[current=page]:text-strong`,`[&>svg]:text-muted hover:[&>svg]:text-strong data-current:[&>svg]:text-strong aria-[current=page]:[&>svg]:text-strong [&>svg:first-child]:size-5 [&>svg]:shrink-0`,s),i[10]=s,i[11]=v);let y;return i[12]!==f||i[13]!==o||i[14]!==u||i[15]!==m||i[16]!==h||i[17]!==g||i[18]!==_||i[19]!==v?(y=S(f,{"data-slot":m,"data-current":h,"aria-current":g,type:_,className:v,...u,children:o}),i[12]=f,i[13]=o,i[14]=u,i[15]=m,i[16]=h,i[17]=g,i[18]=_,i[19]=v,i[20]=y):y=i[20],y},SearchTrigger:r=>{let i=p(22),a,o,s,c,l,u,d;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6],d=i[7]):({asChild:a,children:o,className:s,"data-slot":c,shortcut:u,type:d,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u,i[7]=d);let f=a?n:`button`,m;i[8]!==o||i[9]!==u?(m=u==null?o:C(x,{children:[o,S(`span`,{"aria-hidden":!0,className:e(`pointer-events-none -mr-1 ml-auto inline-flex shrink-0 items-center gap-0.5 opacity-0 select-none`,`group-hover:opacity-100 group-focus-visible:opacity-100`,`group-data-[state=collapsed]/sidebar-nav:hidden`,`[&_kbd]:text-body [&_kbd]:h-5 [&_kbd]:min-w-5 [&_kbd]:bg-neutral-500/20 [&_kbd]:px-1 [&_kbd]:text-xs [&_kbd]:font-normal`),children:u})]}),i[8]=o,i[9]=u,i[10]=m):m=i[10];let h=m,g;i[11]===c?g=i[12]:(g=t(c,`sidebar-search-trigger`),i[11]=c,i[12]=g);let _=a?d:d??`button`,v;i[13]===s?v=i[14]:(v=e(`group`,G,`[&>svg:first-child]:text-muted hover:[&>svg:first-child]:text-strong [&>svg:first-child]:size-5 [&>svg]:shrink-0`,s),i[13]=s,i[14]=v);let y;return i[15]!==f||i[16]!==h||i[17]!==l||i[18]!==g||i[19]!==_||i[20]!==v?(y=S(f,{"data-slot":g,type:_,className:v,...l,children:h}),i[15]=f,i[16]=h,i[17]=l,i[18]=g,i[19]=_,i[20]=v,i[21]=y):y=i[21],y},SwitcherTrigger:r=>{let i=p(18),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({asChild:a,children:o,className:s,"data-slot":c,type:u,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=a?n:`button`,f;i[7]===c?f=i[8]:(f=t(c,`sidebar-switcher-trigger`),i[7]=c,i[8]=f);let m=a?u:u??`button`,h;i[9]===s?h=i[10]:(h=e(`text-body hover:text-strong hover:bg-neutral-500/10 flex w-full min-w-0 items-center gap-2 rounded-[0.625rem] py-1 pr-1.5 pl-1 text-left font-medium transition-none`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`ring-focus-accent focus:outline-hidden focus-visible:ring-4`,`*:first:size-7`,`group-data-[state=collapsed]/sidebar-nav:w-9`,`group-data-[state=collapsed]/sidebar-nav:p-1`,`group-data-[state=collapsed]/sidebar-nav:[&>:not(:first-child)]:sr-only`,s),i[9]=s,i[10]=h);let g;return i[11]!==d||i[12]!==o||i[13]!==l||i[14]!==f||i[15]!==m||i[16]!==h?(g=S(d,{"data-slot":f,type:m,className:h,...l,children:o}),i[11]=d,i[12]=o,i[13]=l,i[14]=f,i[15]=m,i[16]=h,i[17]=g):g=i[17],g},Tooltip:e=>{let n=p(26),r,i,a,o,s,c;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6]):({children:r,"data-slot":i,label:a,shortcut:s,side:c,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c);let l=c===void 0?`right`:c,{isMobile:u,open:d}=O(`Tooltip`),m=!u&&!d,[h,g]=y(!1),[_,v]=y(m);_!==m&&(v(m),g(!1));let b;n[7]===m?b=n[8]:(b=e=>{g(e&&m)},n[7]=m,n[8]=b);let x=b,w=m&&h,T;n[9]===r?T=n[10]:(T=S(f.Trigger,{asChild:!0,children:r}),n[9]=r,n[10]=T);let E;n[11]===i?E=n[12]:(E=t(i,`sidebar-tooltip`),n[11]=i,n[12]=E);let D;n[13]!==a||n[14]!==s?(D=S(F,{label:a,shortcut:s}),n[13]=a,n[14]=s,n[15]=D):D=n[15];let k;n[16]!==o||n[17]!==l||n[18]!==E||n[19]!==D?(k=S(f.Content,{"data-slot":E,side:l,...o,children:D}),n[16]=o,n[17]=l,n[18]=E,n[19]=D,n[20]=k):k=n[20];let A;return n[21]!==x||n[22]!==w||n[23]!==T||n[24]!==k?(A=C(f.Root,{disableHoverableContent:!0,onOpenChange:x,open:w,children:[T,k]}),n[21]=x,n[22]=w,n[23]=T,n[24]=k,n[25]=A):A=n[25],A},Separator:n=>{let r=p(12),i,o,s;r[0]===n?(i=r[1],o=r[2],s=r[3]):({className:i,"data-slot":o,...s}=n,r[0]=n,r[1]=i,r[2]=o,r[3]=s);let c;r[4]===o?c=r[5]:(c=t(o,`sidebar-separator`),r[4]=o,r[5]=c);let l;r[6]===i?l=r[7]:(l=e(`my-3`,`group-data-[state=collapsed]/sidebar-nav:w-9`,i),r[6]=i,r[7]=l);let u;return r[8]!==s||r[9]!==c||r[10]!==l?(u=S(a,{"data-slot":c,className:l,...s}),r[8]=s,r[9]=c,r[10]=l,r[11]=u):u=r[11],u}},q=`mantle-sidebar-state`,J={collapsed:`collapsed`,expanded:`expanded`};function Y(e){let t=l(e,q);if(t===J.expanded)return!0;if(t===J.collapsed)return!1}function X(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?J.expanded:J.collapsed,c=[`${q}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{q as SIDEBAR_STATE_COOKIE_NAME,K as Sidebar,Y as extractSidebarStateCookie,X as serializeSidebarStateCookie,D as useSidebar};
1
+ import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-BsvE2ntj.js";import{t as r}from"./button-pwkdtR3U.js";import{t as i}from"./use-is-hydrated-DDCqXmju.js";import{n as a}from"./separator-D98be0gY.js";import{n as o,t as s}from"./use-is-apple-platform-CMPzIYjz.js";import{t as c}from"./use-callback-ref-BvVyI5K1.js";import{n as l}from"./cookie-ca4g5CKp.js";import{t as u}from"./sheet-D8KGX4q1.js";import{r as d}from"./use-breakpoint-CjyNk0fi.js";import{t as f}from"./tooltip-CHgJAU6j.js";import{c as p}from"react/compiler-runtime";import{createContext as m,useContext as h,useEffect as g,useId as _,useRef as v,useState as y}from"react";import b from"tiny-invariant";import{Fragment as x,jsx as S,jsxs as C}from"react/jsx-runtime";import{SidebarSimpleIcon as w}from"@phosphor-icons/react/SidebarSimple";const T={sm:`hidden sm:block`,md:`hidden md:block`,lg:`hidden lg:block`},E=m(null);function D(){let e=h(E);return b(e,`useSidebar must be used within Sidebar.Root.`),e}function O(e){let t=h(E);return b(t,`Sidebar.${e} must be rendered inside Sidebar.Root.`),t}const k=[];function A(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`:!1}function j(){let e=Symbol(`sidebar-keyboard-shortcut`);return k.push(e),{isOwner:()=>k[0]===e,release:()=>{let t=k.indexOf(e);t!==-1&&k.splice(t,1)}}}const M=e=>{let t=p(34),{children:n,defaultOpen:r,keyboardShortcut:i,mobileBreakpoint:a,onOpenChange:s,onOpenMobileChange:l,open:u,openMobile:f}=e,m=r===void 0||r,h=i===void 0||i,b=a===void 0?`lg`:a,x=d(b),C=_(),w=u!=null,[T,D]=y(m),O=w?u:T,k;t[0]!==w||t[1]!==s?(k=e=>{w||D(e),s?.(e)},t[0]=w,t[1]=s,t[2]=k):k=t[2];let M=k,N=f!=null,[P,F]=y(!1),I=N?f:P,L;t[3]!==N||t[4]!==l?(L=e=>{N||F(e),l?.(e)},t[3]=N,t[4]=l,t[5]=L):L=t[5];let R=L,z=v(x),B,V;t[6]!==x||t[7]!==I||t[8]!==R?(B=()=>{let e=z.current&&!x;z.current=x,e&&I&&R(!1)},V=[x,I,R],t[6]=x,t[7]=I,t[8]=R,t[9]=B,t[10]=V):(B=t[9],V=t[10]),g(B,V);let H;t[11]!==x||t[12]!==O||t[13]!==I||t[14]!==M||t[15]!==R?(H=()=>{x?R(!I):M(!O)},t[11]=x,t[12]=O,t[13]=I,t[14]=M,t[15]=R,t[16]=H):H=t[16];let U=H,W=c(U),G,K;t[17]!==h||t[18]!==W?(K=()=>{if(!h)return;let e=j(),t=o(),n=n=>{if(!e.isOwner()||A(n.target))return;let r=t?n.metaKey:n.ctrlKey,i=t?n.ctrlKey:n.metaKey;n.key?.toLowerCase()===`b`&&r&&!i&&!n.altKey&&!n.shiftKey&&(n.preventDefault(),W())};return window.addEventListener(`keydown`,n),()=>{window.removeEventListener(`keydown`,n),e.release()}},G=[h,W],t[17]=h,t[18]=W,t[19]=G,t[20]=K):(G=t[19],K=t[20]),g(K,G);let q;t[21]!==x||t[22]!==h||t[23]!==b||t[24]!==C||t[25]!==O||t[26]!==I||t[27]!==M||t[28]!==R||t[29]!==U?(q={isMobile:x,keyboardShortcut:h,mobileBreakpoint:b,navId:C,open:O,openMobile:I,setOpen:M,setOpenMobile:R,toggle:U},t[21]=x,t[22]=h,t[23]=b,t[24]=C,t[25]=O,t[26]=I,t[27]=M,t[28]=R,t[29]=U,t[30]=q):q=t[30];let J=q,Y;return t[31]!==n||t[32]!==J?(Y=S(E.Provider,{value:J,children:n}),t[31]=n,t[32]=J,t[33]=Y):Y=t[33],Y},N=n=>{let r=p(49),a,o,s,c,l,d;r[0]===n?(a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],d=r[6]):({"aria-label":a,"aria-labelledby":o,children:s,className:c,"data-slot":l,...d}=n,r[0]=n,r[1]=a,r[2]=o,r[3]=s,r[4]=c,r[5]=l,r[6]=d);let{isMobile:f,mobileBreakpoint:m,navId:h,open:g,openMobile:_,setOpenMobile:v}=O(`Nav`),y=i(),b=a??(o==null?`Main`:void 0);if(f){let n;r[7]===l?n=r[8]:(n=t(l,`sidebar-nav`),r[7]=l,r[8]=n);let i;r[9]===o?i=r[10]:(i=o==null?null:{"aria-labelledby":o},r[9]=o,r[10]=i);let a;r[11]===c?a=r[12]:(a=e(`bg-base w-(--sidebar-width-mobile,18rem) max-w-full p-0`,c),r[11]=c,r[12]=a);let f=b??`Sidebar`,p;r[13]===f?p=r[14]:(p=S(u.Title,{className:`sr-only`,children:f}),r[13]=f,r[14]=p);let m;r[15]!==b||r[16]!==o||r[17]!==s||r[18]!==h?(m=S(`nav`,{id:h,"aria-label":b,"aria-labelledby":o,className:`flex h-full w-full min-w-0 flex-col text-sm`,children:s}),r[15]=b,r[16]=o,r[17]=s,r[18]=h,r[19]=m):m=r[19];let g;r[20]!==d||r[21]!==n||r[22]!==i||r[23]!==a||r[24]!==p||r[25]!==m?(g=C(u.Content,{side:`left`,preferredWidth:`sm:max-w-(--sidebar-width-mobile,18rem)`,"data-slot":n,"data-mobile":``,...i,className:a,...d,children:[p,m]}),r[20]=d,r[21]=n,r[22]=i,r[23]=a,r[24]=p,r[25]=m,r[26]=g):g=r[26];let y;return r[27]!==_||r[28]!==v||r[29]!==g?(y=S(u.Root,{open:_,onOpenChange:v,children:g}),r[27]=_,r[28]=v,r[29]=g,r[30]=y):y=r[30],y}let x;r[31]===l?x=r[32]:(x=t(l,`sidebar-nav`),r[31]=l,r[32]=x);let w=g?`expanded`:`collapsed`,E=y?``:void 0,D=!y&&T[m],k=y&&`transition-[width] duration-200 ease-linear motion-reduce:transition-none`,A;r[33]!==c||r[34]!==D||r[35]!==k?(A=e(`group/sidebar-nav bg-base relative h-full w-(--sidebar-width,13rem) shrink-0 overflow-hidden`,`data-[state=collapsed]:w-(--sidebar-width-icon,3.25rem)`,D,k,c),r[33]=c,r[34]=D,r[35]=k,r[36]=A):A=r[36];let j;r[37]!==b||r[38]!==o||r[39]!==s||r[40]!==h?(j=S(`nav`,{id:h,"aria-label":b,"aria-labelledby":o,className:`absolute inset-y-0 left-0 flex w-full min-w-0 flex-col text-sm`,children:s}),r[37]=b,r[38]=o,r[39]=s,r[40]=h,r[41]=j):j=r[41];let M;return r[42]!==d||r[43]!==x||r[44]!==w||r[45]!==E||r[46]!==A||r[47]!==j?(M=S(`div`,{"data-slot":x,"data-state":w,"data-hydrated":E,className:A,...d,children:j}),r[42]=d,r[43]=x,r[44]=w,r[45]=E,r[46]=A,r[47]=j,r[48]=M):M=r[48],M},P=S(w,{}),F=e=>{let t=p(7),{label:n,shortcut:r}=e,i;t[0]===n?i=t[1]:(i=S(`span`,{"data-slot":`sidebar-tooltip-label`,className:`contents`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r!=null&&S(`span`,{"aria-hidden":!0,"data-slot":`sidebar-tooltip-shortcut`,className:`inline-flex shrink-0 items-center gap-0.5 [&_kbd]:h-4 [&_kbd]:min-w-4 [&_kbd]:bg-neutral-500/25 [&_kbd]:px-0.5 [&_kbd]:text-xs`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=C(`span`,{"data-slot":`sidebar-tooltip-row`,className:`flex items-center gap-1.5`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o},I=e=>{let n=p(32),i,a,o,c,l,u,d,m;n[0]===e?(i=n[1],a=n[2],o=n[3],c=n[4],l=n[5],u=n[6],d=n[7],m=n[8]):({appearance:l,"data-slot":i,icon:u,intent:d,label:m,onClick:a,shortcut:c,...o}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=o,n[4]=c,n[5]=l,n[6]=u,n[7]=d,n[8]=m);let h=l===void 0?`ghost`:l,g=u===void 0?P:u,_=d===void 0?`neutral`:d,v=m===void 0?`Toggle Sidebar`:m,{isMobile:y,keyboardShortcut:b,navId:x,open:w,openMobile:T,toggle:E}=O(`Trigger`),D=s(),k=y?T:w,A=!y||T,j=b?c:void 0,M=D?`Meta+B`:`Control+B`,N=A?x:void 0,I=b?M:void 0,L;n[9]===i?L=n[10]:(L=t(i,`sidebar-trigger`),n[9]=i,n[10]=L);let R=k?`expanded`:`collapsed`,z;n[11]!==a||n[12]!==E?(z=e=>{a?.(e),e.defaultPrevented||E()},n[11]=a,n[12]=E,n[13]=z):z=n[13];let B;n[14]!==h||n[15]!==k||n[16]!==g||n[17]!==_||n[18]!==v||n[19]!==o||n[20]!==N||n[21]!==I||n[22]!==L||n[23]!==R||n[24]!==z?(B=S(f.Trigger,{asChild:!0,children:S(r,{appearance:h,"aria-controls":N,"aria-expanded":k,"aria-keyshortcuts":I,"data-slot":L,"data-state":R,icon:g,intent:_,label:v,onClick:z,...o})}),n[14]=h,n[15]=k,n[16]=g,n[17]=_,n[18]=v,n[19]=o,n[20]=N,n[21]=I,n[22]=L,n[23]=R,n[24]=z,n[25]=B):B=n[25];let V;n[26]!==j||n[27]!==v?(V=S(f.Content,{"data-slot":`sidebar-trigger-tooltip`,children:S(F,{label:v,shortcut:j})}),n[26]=j,n[27]=v,n[28]=V):V=n[28];let H;return n[29]!==B||n[30]!==V?(H=C(f.Root,{children:[B,V]}),n[29]=B,n[30]=V,n[31]=H):H=n[31],H},L=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(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}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-header`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`grid grid-cols-1 grid-rows-(--sidebar-header-height,4.5rem) shrink-0 items-center px-3`,`group-data-[state=expanded]/sidebar-nav:pr-1`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(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]=m):m=i[15],m},R=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(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}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-body`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`scrollbar scrollbar-gutter-stable scroll-fade-y flex-1 scroll-py-6 space-y-2 overflow-y-auto overflow-x-hidden px-3 pt-1.5 pb-4`,`group-data-[state=expanded]/sidebar-nav:pr-1`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-none`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-gutter-auto`,`group-data-[state=collapsed]/sidebar-nav:[&::-webkit-scrollbar]:hidden`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(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]=m):m=i[15],m},z=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(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}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`div`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-footer`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`shrink-0 px-3 pt-3 pb-3.5`,`group-data-[state=expanded]/sidebar-nav:pr-1`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(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]=m):m=i[15],m},B=m(null),V=r=>{let i=p(21),a,o,s,c,l;i[0]===r?(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}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let[u,d]=y(null),f;i[6]===u?f=i[7]:(f={mountedLabelId:u,setMountedLabelId:d},i[6]=u,i[7]=f);let m=f,h=a?n:`div`,g;i[8]===c?g=i[9]:(g=t(c,`sidebar-group`),i[8]=c,i[9]=g);let _;i[10]===s?_=i[11]:(_=e(`pt-0.5`,s),i[10]=s,i[11]=_);let v;i[12]!==h||i[13]!==o||i[14]!==l||i[15]!==g||i[16]!==_?(v=S(h,{"data-slot":g,className:_,...l,children:o}),i[12]=h,i[13]=o,i[14]=l,i[15]=g,i[16]=_,i[17]=v):v=i[17];let b;return i[18]!==m||i[19]!==v?(b=S(B.Provider,{value:m,children:v}),i[18]=m,i[19]=v,i[20]=b):b=i[20],b},H=r=>{let i=p(22),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({asChild:a,children:o,className:s,"data-slot":c,id:l,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=h(B),f=_(),m=l??(d==null?void 0:f),v=d?.setMountedLabelId,y,b;i[7]!==m||i[8]!==v?(y=()=>{if(v!=null&&m!=null)return v(m),()=>{v(null)}},b=[v,m],i[7]=m,i[8]=v,i[9]=y,i[10]=b):(y=i[9],b=i[10]),g(y,b);let x=a?n:`div`,C;i[11]===c?C=i[12]:(C=t(c,`sidebar-group-label`),i[11]=c,i[12]=C);let w;i[13]===s?w=i[14]:(w=e(`text-muted flex min-w-0 items-center gap-2 truncate px-2 py-1 text-xs font-medium`,`group-data-[state=collapsed]/sidebar-nav:opacity-0`,`group-data-[state=collapsed]/sidebar-nav:pointer-events-none`,`group-data-hydrated/sidebar-nav:transition-opacity group-data-hydrated/sidebar-nav:duration-200 group-data-hydrated/sidebar-nav:ease-linear group-data-hydrated/sidebar-nav:motion-reduce:transition-none`,s),i[13]=s,i[14]=w);let T;return i[15]!==x||i[16]!==o||i[17]!==m||i[18]!==u||i[19]!==C||i[20]!==w?(T=S(x,{id:m,"data-slot":C,className:w,...u,children:o}),i[15]=x,i[16]=o,i[17]=m,i[18]=u,i[19]=C,i[20]=w,i[21]=T):T=i[21],T},U=r=>{let i=p(18),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({"aria-labelledby":a,asChild:o,children:s,className:c,"data-slot":l,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=h(B),f=o?n:`ul`,m=a??d?.mountedLabelId??void 0,g;i[7]===l?g=i[8]:(g=t(l,`sidebar-list`),i[7]=l,i[8]=g);let _;i[9]===c?_=i[10]:(_=e(`mb-2 space-y-px`,c),i[9]=c,i[10]=_);let v;return i[11]!==f||i[12]!==s||i[13]!==u||i[14]!==m||i[15]!==g||i[16]!==_?(v=S(f,{"aria-labelledby":m,"data-slot":g,className:_,...u,children:s}),i[11]=f,i[12]=s,i[13]=u,i[14]=m,i[15]=g,i[16]=_,i[17]=v):v=i[17],v},W=r=>{let i=p(16),a,o,s,c,l;i[0]===r?(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}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?n:`li`,d;i[6]===c?d=i[7]:(d=t(c,`sidebar-item`),i[6]=c,i[7]=d);let f;i[8]===s?f=i[9]:(f=e(`list-none`,s),i[8]=s,i[9]=f);let m;return i[10]!==u||i[11]!==o||i[12]!==l||i[13]!==d||i[14]!==f?(m=S(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]=m):m=i[15],m},G=[`ring-focus-accent flex w-full min-w-0 items-center gap-2 truncate rounded-md px-2 py-1 text-left font-normal transition-none focus:outline-hidden focus-visible:ring-4`,`text-body hover:text-strong hover:bg-neutral-500/10`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`group-data-[state=collapsed]/sidebar-nav:ml-1`,`group-data-[state=collapsed]/sidebar-nav:w-7`,`group-data-[state=collapsed]/sidebar-nav:p-1`].join(` `),K={Root:M,Nav:N,Trigger:I,Header:L,Body:R,Footer:z,Group:V,GroupLabel:H,List:U,Item:W,ItemButton:r=>{let i=p(21),a,o,s,c,l,u,d;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6],d=i[7]):({asChild:a,children:o,className:s,current:c,"data-slot":l,type:d,...u}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u,i[7]=d);let f=a?n:`button`,m;i[8]===l?m=i[9]:(m=t(l,`sidebar-item-button`),i[8]=l,i[9]=m);let h=c?``:void 0,g=c?`page`:void 0,_=a?d:d??`button`,v;i[10]===s?v=i[11]:(v=e(G,`data-current:bg-neutral-500/15 data-current:text-strong`,`aria-[current=page]:bg-neutral-500/15 aria-[current=page]:text-strong`,`[&>svg]:text-muted hover:[&>svg]:text-strong data-current:[&>svg]:text-strong aria-[current=page]:[&>svg]:text-strong [&>svg:first-child]:size-5 [&>svg]:shrink-0`,s),i[10]=s,i[11]=v);let y;return i[12]!==f||i[13]!==o||i[14]!==u||i[15]!==m||i[16]!==h||i[17]!==g||i[18]!==_||i[19]!==v?(y=S(f,{"data-slot":m,"data-current":h,"aria-current":g,type:_,className:v,...u,children:o}),i[12]=f,i[13]=o,i[14]=u,i[15]=m,i[16]=h,i[17]=g,i[18]=_,i[19]=v,i[20]=y):y=i[20],y},SearchTrigger:r=>{let i=p(23),a,o,s,c,l,u,d;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6],d=i[7]):({asChild:a,children:o,className:s,"data-slot":c,shortcut:u,type:d,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u,i[7]=d);let f=a?n:`button`,m;i[8]!==a||i[9]!==o||i[10]!==u?(m=a?o:C(x,{children:[S(`span`,{"data-slot":`sidebar-search-trigger-label`,className:`contents`,children:o}),S(`span`,{"aria-hidden":!0,"data-slot":`sidebar-search-trigger-shortcut`,className:e(`pointer-events-none -mr-1 ml-auto inline-flex shrink-0 items-center gap-0.5 opacity-0 select-none`,`group-hover:opacity-100 group-focus-visible:opacity-100`,`group-data-[state=collapsed]/sidebar-nav:hidden`,`[&_kbd]:text-body [&_kbd]:h-5 [&_kbd]:min-w-5 [&_kbd]:bg-neutral-500/20 [&_kbd]:px-1 [&_kbd]:text-xs [&_kbd]:font-normal`,`empty:hidden`),children:u})]}),i[8]=a,i[9]=o,i[10]=u,i[11]=m):m=i[11];let h=m,g;i[12]===c?g=i[13]:(g=t(c,`sidebar-search-trigger`),i[12]=c,i[13]=g);let _=a?d:d??`button`,v;i[14]===s?v=i[15]:(v=e(`group`,G,`[&>svg:first-child]:text-muted hover:[&>svg:first-child]:text-strong`,`[&>svg:first-child]:size-5`,`[&>[data-slot=sidebar-search-trigger-label]>svg:first-child]:text-muted`,`hover:[&>[data-slot=sidebar-search-trigger-label]>svg:first-child]:text-strong`,`[&>[data-slot=sidebar-search-trigger-label]>svg:first-child]:size-5`,`[&_svg]:shrink-0`,s),i[14]=s,i[15]=v);let y;return i[16]!==f||i[17]!==h||i[18]!==l||i[19]!==g||i[20]!==_||i[21]!==v?(y=S(f,{"data-slot":g,type:_,className:v,...l,children:h}),i[16]=f,i[17]=h,i[18]=l,i[19]=g,i[20]=_,i[21]=v,i[22]=y):y=i[22],y},SwitcherTrigger:r=>{let i=p(18),a,o,s,c,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({asChild:a,children:o,className:s,"data-slot":c,type:u,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=a?n:`button`,f;i[7]===c?f=i[8]:(f=t(c,`sidebar-switcher-trigger`),i[7]=c,i[8]=f);let m=a?u:u??`button`,h;i[9]===s?h=i[10]:(h=e(`text-body hover:text-strong hover:bg-neutral-500/10 flex w-full min-w-0 items-center gap-2 rounded-[0.625rem] py-1 pr-1.5 pl-1 text-left font-medium transition-none`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`ring-focus-accent focus:outline-hidden focus-visible:ring-4`,`*:first:size-7`,`group-data-[state=collapsed]/sidebar-nav:w-9`,`group-data-[state=collapsed]/sidebar-nav:p-1`,`group-data-[state=collapsed]/sidebar-nav:[&>:not(:first-child)]:sr-only`,s),i[9]=s,i[10]=h);let g;return i[11]!==d||i[12]!==o||i[13]!==l||i[14]!==f||i[15]!==m||i[16]!==h?(g=S(d,{"data-slot":f,type:m,className:h,...l,children:o}),i[11]=d,i[12]=o,i[13]=l,i[14]=f,i[15]=m,i[16]=h,i[17]=g):g=i[17],g},Tooltip:e=>{let n=p(26),r,i,a,o,s,c;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6]):({children:r,"data-slot":i,label:a,shortcut:s,side:c,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c);let l=c===void 0?`right`:c,{isMobile:u,open:d}=O(`Tooltip`),m=!u&&!d,[h,g]=y(!1),[_,v]=y(m);_!==m&&(v(m),g(!1));let b;n[7]===m?b=n[8]:(b=e=>{g(e&&m)},n[7]=m,n[8]=b);let x=b,w=m&&h,T;n[9]===r?T=n[10]:(T=S(f.Trigger,{asChild:!0,children:r}),n[9]=r,n[10]=T);let E;n[11]===i?E=n[12]:(E=t(i,`sidebar-tooltip`),n[11]=i,n[12]=E);let D;n[13]!==a||n[14]!==s?(D=S(F,{label:a,shortcut:s}),n[13]=a,n[14]=s,n[15]=D):D=n[15];let k;n[16]!==o||n[17]!==l||n[18]!==E||n[19]!==D?(k=S(f.Content,{"data-slot":E,side:l,...o,children:D}),n[16]=o,n[17]=l,n[18]=E,n[19]=D,n[20]=k):k=n[20];let A;return n[21]!==x||n[22]!==w||n[23]!==T||n[24]!==k?(A=C(f.Root,{disableHoverableContent:!0,onOpenChange:x,open:w,children:[T,k]}),n[21]=x,n[22]=w,n[23]=T,n[24]=k,n[25]=A):A=n[25],A},Separator:n=>{let r=p(12),i,o,s;r[0]===n?(i=r[1],o=r[2],s=r[3]):({className:i,"data-slot":o,...s}=n,r[0]=n,r[1]=i,r[2]=o,r[3]=s);let c;r[4]===o?c=r[5]:(c=t(o,`sidebar-separator`),r[4]=o,r[5]=c);let l;r[6]===i?l=r[7]:(l=e(`my-3`,`group-data-[state=collapsed]/sidebar-nav:w-9`,i),r[6]=i,r[7]=l);let u;return r[8]!==s||r[9]!==c||r[10]!==l?(u=S(a,{"data-slot":c,className:l,...s}),r[8]=s,r[9]=c,r[10]=l,r[11]=u):u=r[11],u}},q=`mantle-sidebar-state`,J={collapsed:`collapsed`,expanded:`expanded`};function Y(e){let t=l(e,q);if(t===J.expanded)return!0;if(t===J.collapsed)return!1}function X(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?J.expanded:J.collapsed,c=[`${q}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{q as SIDEBAR_STATE_COOKIE_NAME,K as Sidebar,Y as extractSidebarStateCookie,X as serializeSidebarStateCookie,D as useSidebar};
@@ -1,7 +1,7 @@
1
1
  import { t as Button } from "./button-B5i9n7Qp.js";
2
2
  import { t as IconButton } from "./button-crUf0hbR.js";
3
3
  import { t as ButtonSize } from "./button-BCoI4bhP.js";
4
- import { t as DropdownMenu } from "./dropdown-menu-BYapTV0f.js";
4
+ import { t as DropdownMenu } from "./dropdown-menu-DhwzMnoH.js";
5
5
  import { ComponentProps, ReactNode } from "react";
6
6
  //#region src/components/split-button/split-button.d.ts
7
7
  type RootProps = ComponentProps<typeof DropdownMenu.Root> & ComponentProps<"div"> & {
@@ -1 +1 @@
1
- import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./icon-BT8FnkkJ.js";import{t as n}from"./button-Dij5vCQG.js";import{t as r}from"./button-pwkdtR3U.js";import{t as i}from"./dropdown-menu-WydWB9lo.js";import{c as a}from"react/compiler-runtime";import{CaretDownIcon as o}from"@phosphor-icons/react/CaretDown";import{createContext as s,useContext as c}from"react";import{jsx as l}from"react/jsx-runtime";const u=s({size:`md`}),d={Root:t=>{let n=a(31),r,o,s,c,d,f,p,m,h,g;n[0]===t?(r=n[1],o=n[2],s=n[3],c=n[4],d=n[5],f=n[6],p=n[7],m=n[8],h=n[9],g=n[10]):({className:o,children:r,dir:c,open:p,defaultOpen:s,onOpenChange:f,modal:d,size:g,ref:h,...m}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=s,n[4]=c,n[5]=d,n[6]=f,n[7]=p,n[8]=m,n[9]=h,n[10]=g);let _=g===void 0?`md`:g,v;n[11]===_?v=n[12]:(v={size:_},n[11]=_,n[12]=v);let y=v,b;n[13]===o?b=n[14]:(b=e(`flex flex-row [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:not(:first-child)]:-ml-px [&>*:focus]:relative [&>*:focus]:z-10 [&>*:hover]:relative [&>*:hover]:z-10 *:active:scale-100!`,o),n[13]=o,n[14]=b);let x;n[15]!==r||n[16]!==m||n[17]!==h||n[18]!==_||n[19]!==b?(x=l(`div`,{"data-slot":`split-button`,"data-size":_,className:b,ref:h,...m,children:r}),n[15]=r,n[16]=m,n[17]=h,n[18]=_,n[19]=b,n[20]=x):x=n[20];let S;n[21]!==y||n[22]!==x?(S=l(u.Provider,{value:y,children:x}),n[21]=y,n[22]=x,n[23]=S):S=n[23];let C;return n[24]!==s||n[25]!==c||n[26]!==d||n[27]!==f||n[28]!==p||n[29]!==S?(C=l(i.Root,{dir:c,open:p,defaultOpen:s,onOpenChange:f,modal:d,children:S}),n[24]=s,n[25]=c,n[26]=d,n[27]=f,n[28]=p,n[29]=S,n[30]=C):C=n[30],C},PrimaryAction:e=>{let t=a(3),{size:r}=c(u),i;return t[0]!==e||t[1]!==r?(i=l(n,{appearance:`outlined`,intent:`neutral`,size:r,...e}),t[0]=e,t[1]=r,t[2]=i):i=t[2],i},MenuTrigger:e=>{let n=a(9),s,d;n[0]===e?(s=n[1],d=n[2]):({icon:s,...d}=e,n[0]=e,n[1]=s,n[2]=d);let{size:f}=c(u),p;n[3]===s?p=n[4]:(p=s??l(t,{svg:l(o,{weight:`bold`,className:`size-4 group-data-[state=open]:-rotate-180 transition-transform ease-out duration-150`})}),n[3]=s,n[4]=p);let m;return n[5]!==d||n[6]!==f||n[7]!==p?(m=l(i.Trigger,{asChild:!0,className:`group`,children:l(r,{icon:p,appearance:`outlined`,intent:`neutral`,size:f,...d})}),n[5]=d,n[6]=f,n[7]=p,n[8]=m):m=n[8],m},MenuContent:e=>{let t=a(6),n,r;t[0]===e?(n=t[1],r=t[2]):({align:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let o=r===void 0?`end`:r,s;return t[3]!==o||t[4]!==n?(s=l(i.Content,{align:o,...n}),t[3]=o,t[4]=n,t[5]=s):s=t[5],s},MenuItem:t=>{let n=a(8),r,o;n[0]===t?(r=n[1],o=n[2]):({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o);let s;n[3]===r?s=n[4]:(s=e(`gap-2`,r),n[3]=r,n[4]=s);let c;return n[5]!==o||n[6]!==s?(c=l(i.Item,{className:s,...o}),n[5]=o,n[6]=s,n[7]=c):c=n[7],c}};export{d as SplitButton};
1
+ import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./icon-BT8FnkkJ.js";import{t as n}from"./button-Dij5vCQG.js";import{t as r}from"./button-pwkdtR3U.js";import{t as i}from"./dropdown-menu-Bir-GKUs.js";import{c as a}from"react/compiler-runtime";import{CaretDownIcon as o}from"@phosphor-icons/react/CaretDown";import{createContext as s,useContext as c}from"react";import{jsx as l}from"react/jsx-runtime";const u=s({size:`md`}),d={Root:t=>{let n=a(31),r,o,s,c,d,f,p,m,h,g;n[0]===t?(r=n[1],o=n[2],s=n[3],c=n[4],d=n[5],f=n[6],p=n[7],m=n[8],h=n[9],g=n[10]):({className:o,children:r,dir:c,open:p,defaultOpen:s,onOpenChange:f,modal:d,size:g,ref:h,...m}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=s,n[4]=c,n[5]=d,n[6]=f,n[7]=p,n[8]=m,n[9]=h,n[10]=g);let _=g===void 0?`md`:g,v;n[11]===_?v=n[12]:(v={size:_},n[11]=_,n[12]=v);let y=v,b;n[13]===o?b=n[14]:(b=e(`flex flex-row [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:not(:first-child)]:-ml-px [&>*:focus]:relative [&>*:focus]:z-10 [&>*:hover]:relative [&>*:hover]:z-10 *:active:scale-100!`,o),n[13]=o,n[14]=b);let x;n[15]!==r||n[16]!==m||n[17]!==h||n[18]!==_||n[19]!==b?(x=l(`div`,{"data-slot":`split-button`,"data-size":_,className:b,ref:h,...m,children:r}),n[15]=r,n[16]=m,n[17]=h,n[18]=_,n[19]=b,n[20]=x):x=n[20];let S;n[21]!==y||n[22]!==x?(S=l(u.Provider,{value:y,children:x}),n[21]=y,n[22]=x,n[23]=S):S=n[23];let C;return n[24]!==s||n[25]!==c||n[26]!==d||n[27]!==f||n[28]!==p||n[29]!==S?(C=l(i.Root,{dir:c,open:p,defaultOpen:s,onOpenChange:f,modal:d,children:S}),n[24]=s,n[25]=c,n[26]=d,n[27]=f,n[28]=p,n[29]=S,n[30]=C):C=n[30],C},PrimaryAction:e=>{let t=a(3),{size:r}=c(u),i;return t[0]!==e||t[1]!==r?(i=l(n,{appearance:`outlined`,intent:`neutral`,size:r,...e}),t[0]=e,t[1]=r,t[2]=i):i=t[2],i},MenuTrigger:e=>{let n=a(9),s,d;n[0]===e?(s=n[1],d=n[2]):({icon:s,...d}=e,n[0]=e,n[1]=s,n[2]=d);let{size:f}=c(u),p;n[3]===s?p=n[4]:(p=s??l(t,{svg:l(o,{weight:`bold`,className:`size-4 group-data-[state=open]:-rotate-180 transition-transform ease-out duration-150`})}),n[3]=s,n[4]=p);let m;return n[5]!==d||n[6]!==f||n[7]!==p?(m=l(i.Trigger,{asChild:!0,className:`group`,children:l(r,{icon:p,appearance:`outlined`,intent:`neutral`,size:f,...d})}),n[5]=d,n[6]=f,n[7]=p,n[8]=m):m=n[8],m},MenuContent:e=>{let t=a(6),n,r;t[0]===e?(n=t[1],r=t[2]):({align:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let o=r===void 0?`end`:r,s;return t[3]!==o||t[4]!==n?(s=l(i.Content,{align:o,...n}),t[3]=o,t[4]=n,t[5]=s):s=t[5],s},MenuItem:t=>{let n=a(8),r,o;n[0]===t?(r=n[1],o=n[2]):({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o);let s;n[3]===r?s=n[4]:(s=e(`gap-2`,r),n[3]=r,n[4]=s);let c;return n[5]!==o||n[6]!==s?(c=l(i.Item,{className:s,...o}),n[5]=o,n[6]=s,n[7]=c):c=n[7],c}};export{d as SplitButton};
package/dist/tabs.d.ts CHANGED
@@ -78,6 +78,25 @@ type TabsTriggerProps = ComponentProps<typeof Trigger>;
78
78
  /**
79
79
  * The button that activates its associated content.
80
80
  *
81
+ * **Structure.** `children` render inside a
82
+ * `<span data-slot="tabs-trigger-label">`, on the plain path and the `asChild`
83
+ * path alike. The active-tab decoration is a permanent element sibling, so
84
+ * without the span a bare text label is never a lone child: a browser
85
+ * translation engine reparents that text node, and the removal React runs when
86
+ * the label changes shape or goes away throws. The span is `display: contents`,
87
+ * so the icon, the label, and `Tabs.Badge` stay flex items of the trigger and
88
+ * keep its `gap`. A `[&>svg]` class of your own no longer reaches an icon you
89
+ * pass as a child, because that icon is now a grandchild. Match the part's own
90
+ * variant instead — `[&>[data-slot=tabs-trigger-label]>svg]:size-4`. A `[&_svg]`
91
+ * or a class on the icon loses to the default, which is more specific.
92
+ *
93
+ * **Data attributes:**
94
+ *
95
+ * | Data Attribute | Value | Description |
96
+ * | -------------- | ------------------------ | ------------------------------------ |
97
+ * | `data-slot` | `"tabs-trigger"` | On the trigger element. |
98
+ * | `data-slot` | `"tabs-trigger-label"` | On the `<span>` wrapping `children`. |
99
+ *
81
100
  * @see https://mantle.ngrok.com/components/navigation/tabs#tabstrigger
82
101
  *
83
102
  * @example
@@ -230,6 +249,25 @@ declare const Tabs: {
230
249
  /**
231
250
  * The button that activates its associated content.
232
251
  *
252
+ * **Structure.** `children` render inside a
253
+ * `<span data-slot="tabs-trigger-label">`, on the plain path and the `asChild`
254
+ * path alike. The active-tab decoration is a permanent element sibling, so
255
+ * without the span a bare text label is never a lone child: a browser
256
+ * translation engine reparents that text node, and the removal React runs when
257
+ * the label changes shape or goes away throws. The span is `display: contents`,
258
+ * so the icon, the label, and `Tabs.Badge` stay flex items of the trigger and
259
+ * keep its `gap`. A `[&>svg]` class of your own no longer reaches an icon you
260
+ * pass as a child, because that icon is now a grandchild. Match the part's own
261
+ * variant instead — `[&>[data-slot=tabs-trigger-label]>svg]:size-4`. A `[&_svg]`
262
+ * or a class on the icon loses to the default, which is more specific.
263
+ *
264
+ * **Data attributes:**
265
+ *
266
+ * | Data Attribute | Value | Description |
267
+ * | -------------- | ------------------------ | ------------------------------------ |
268
+ * | `data-slot` | `"tabs-trigger"` | On the trigger element. |
269
+ * | `data-slot` | `"tabs-trigger-label"` | On the `<span>` wrapping `children`. |
270
+ *
233
271
  * @see https://mantle.ngrok.com/components/navigation/tabs#tabstrigger
234
272
  *
235
273
  * @example