@ngrok/mantle 0.83.9 → 0.84.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 (84) hide show
  1. package/README.md +4 -4
  2. package/dist/accordion.js +1 -1
  3. package/dist/agent.json +3 -1
  4. package/dist/{alert-DDjzRuGa.js → alert-D8StKSjK.js} +1 -1
  5. package/dist/alert-center.js +1 -1
  6. package/dist/alert-dialog.js +1 -1
  7. package/dist/alert.js +1 -1
  8. package/dist/{anchor-D2So_zuy.js → anchor-BjyGV6tB.js} +1 -1
  9. package/dist/anchor.js +1 -1
  10. package/dist/app-layout.js +1 -1
  11. package/dist/area-chart.js +1 -1
  12. package/dist/avatar.js +1 -1
  13. package/dist/badge.js +1 -1
  14. package/dist/bar-chart.js +1 -1
  15. package/dist/breadcrumb.js +1 -1
  16. package/dist/{button-CC10rP6X.js → button-BCk0KpWb.js} +1 -1
  17. package/dist/{button-Bc0lEOJ2.js → button-DwFvQWu4.js} +1 -1
  18. package/dist/{button-DmJkYfyl.js → button-YkYZ0ymH.js} +1 -1
  19. package/dist/button.js +1 -1
  20. package/dist/card.js +1 -1
  21. package/dist/centered-layout.js +1 -1
  22. package/dist/{chart-BDxpXPfo.js → chart-DVt4hvnu.js} +1 -1
  23. package/dist/choice-BKkfjjAd.js +1 -0
  24. package/dist/{choice-CVdQrs-m.d.ts → choice-zOjixuj7.d.ts} +12 -2
  25. package/dist/choice.d.ts +1 -1
  26. package/dist/choice.js +1 -1
  27. package/dist/code-block.js +1 -1
  28. package/dist/code.js +1 -1
  29. package/dist/combobox.js +1 -1
  30. package/dist/command.js +1 -1
  31. package/dist/data-table.js +1 -1
  32. package/dist/description-list.js +1 -1
  33. package/dist/{dialog-CnlaqHNh.js → dialog-CSUE-jw8.js} +1 -1
  34. package/dist/dialog.js +1 -1
  35. package/dist/{dropdown-menu-DJDrRzDU.js → dropdown-menu-Cy7mLIpJ.js} +1 -1
  36. package/dist/dropdown-menu.js +1 -1
  37. package/dist/empty.js +1 -1
  38. package/dist/field.js +1 -1
  39. package/dist/hooks.d.ts +13 -1
  40. package/dist/hooks.js +1 -1
  41. package/dist/in-view-T_AAYaaF.js +1 -0
  42. package/dist/interactive-target-BXScNeOr.js +1 -0
  43. package/dist/line-chart.js +1 -1
  44. package/dist/list-7w5k3HiN.js +1 -0
  45. package/dist/list.js +1 -1
  46. package/dist/live-region.d.ts +68 -0
  47. package/dist/live-region.js +1 -0
  48. package/dist/llms.txt +3 -1
  49. package/dist/media-object.js +1 -1
  50. package/dist/multi-select.js +1 -1
  51. package/dist/otp-input.js +1 -1
  52. package/dist/pagination.js +1 -1
  53. package/dist/{primitive-BWyxJnXn.js → primitive-BSBmlRyy.js} +1 -1
  54. package/dist/qr-code.js +1 -1
  55. package/dist/radio-group.js +1 -1
  56. package/dist/sandbar.js +1 -1
  57. package/dist/sandboxed-on-click.js +1 -1
  58. package/dist/scatter-plot.js +1 -1
  59. package/dist/{select-BK6n6OIK.js → select-B52tWHOB.js} +1 -1
  60. package/dist/select.js +1 -1
  61. package/dist/selectable-list.d.ts +1 -1
  62. package/dist/selectable-list.js +1 -1
  63. package/dist/{separator-D0D6VyyM.js → separator-D1K7DSTv.js} +1 -1
  64. package/dist/separator.js +1 -1
  65. package/dist/{sheet-BcfnKUit.js → sheet-2AQT0DNu.js} +1 -1
  66. package/dist/sheet.js +1 -1
  67. package/dist/sidebar.js +1 -1
  68. package/dist/{skeleton-BhcJMpem.js → skeleton-D86Gsflk.js} +1 -1
  69. package/dist/skeleton.js +1 -1
  70. package/dist/skip-to-main-link.js +1 -1
  71. package/dist/{slot-DpNWVci8.js → slot-CxM7jdFi.js} +1 -1
  72. package/dist/slot.js +1 -1
  73. package/dist/source-all.css +2 -7
  74. package/dist/split-button.js +1 -1
  75. package/dist/theme-switcher.js +1 -1
  76. package/dist/toast.js +1 -1
  77. package/dist/utils.js +1 -1
  78. package/dist/visually-hidden.d.ts +41 -0
  79. package/dist/visually-hidden.js +1 -0
  80. package/dist/well.js +1 -1
  81. package/package.json +4 -2
  82. package/dist/choice-CnwfjSEu.js +0 -1
  83. package/dist/in-view-C2DpZ6s0.js +0 -1
  84. package/dist/list-CwL23L_B.js +0 -1
package/dist/sidebar.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-DpNWVci8.js";import{t as r}from"./button-CC10rP6X.js";import{t as i}from"./use-is-hydrated-DDCqXmju.js";import{n as a}from"./separator-D0D6VyyM.js";import{n as o,t as s}from"./use-is-apple-platform-Cxwrb86L.js";import{t as c}from"./use-callback-ref-IYti9y7x.js";import{n as l}from"./cookie-ca4g5CKp.js";import{t as u}from"./sheet-BcfnKUit.js";import{r as d}from"./use-breakpoint-Dqu12Szq.js";import{t as f}from"./tooltip-BZRRJgpm.js";import{createContext as p,useCallback as m,useContext as h,useEffect as g,useId as _,useMemo as v,useRef as y,useState as b}from"react";import x from"tiny-invariant";import{Fragment as S,jsx as C,jsxs as w}from"react/jsx-runtime";import{SidebarSimpleIcon as T}from"@phosphor-icons/react/SidebarSimple";const E={sm:`hidden sm:block`,md:`hidden md:block`,lg:`hidden lg:block`},D=p(null);function O(){let e=h(D);return x(e,`useSidebar must be used within Sidebar.Root.`),e}function k(e){let t=h(D);return x(t,`Sidebar.${e} must be rendered inside Sidebar.Root.`),t}const A=[];function j(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`:!1}function M(){let e=Symbol(`sidebar-keyboard-shortcut`);return A.push(e),{isOwner:()=>A[0]===e,release:()=>{let t=A.indexOf(e);t!==-1&&A.splice(t,1)}}}const N=({children:e,defaultOpen:t=!0,keyboardShortcut:n=!0,mobileBreakpoint:r=`lg`,onOpenChange:i,onOpenMobileChange:a,open:s,openMobile:l})=>{let u=d(r),f=_(),p=s!=null,[h,x]=b(t),S=p?s:h,w=m(e=>{p||x(e),i?.(e)},[p,i]),T=l!=null,[E,O]=b(!1),k=T?l:E,A=m(e=>{T||O(e),a?.(e)},[T,a]),N=y(u);g(()=>{let e=N.current&&!u;N.current=u,e&&k&&A(!1)},[u,k,A]);let P=m(()=>{u?A(!k):w(!S)},[u,S,k,w,A]),F=c(P);g(()=>{if(!n)return;let e=M(),t=o(),r=n=>{if(!e.isOwner()||j(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(),F())};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),e.release()}},[n,F]);let I=v(()=>({isMobile:u,keyboardShortcut:n,mobileBreakpoint:r,navId:f,open:S,openMobile:k,setOpen:w,setOpenMobile:A,toggle:P}),[u,n,r,f,S,k,w,A,P]);return C(D.Provider,{value:I,children:e})},P=({"aria-label":n,"aria-labelledby":r,children:a,className:o,"data-slot":s,...c})=>{let{isMobile:l,mobileBreakpoint:d,navId:f,open:p,openMobile:m,setOpenMobile:h}=k(`Nav`),g=i(),_=n??(r==null?`Main`:void 0);return l?C(u.Root,{open:m,onOpenChange:h,children:w(u.Content,{side:`left`,preferredWidth:`sm:max-w-(--sidebar-width-mobile,18rem)`,"data-slot":t(s,`sidebar-nav`),"data-mobile":``,...r==null?null:{"aria-labelledby":r},className:e(`bg-base w-(--sidebar-width-mobile,18rem) max-w-full p-0`,o),...c,children:[C(u.Title,{className:`sr-only`,children:_??`Sidebar`}),C(`nav`,{id:f,"aria-label":_,"aria-labelledby":r,className:`flex h-full w-full min-w-0 flex-col text-sm`,children:a})]})}):C(`div`,{"data-slot":t(s,`sidebar-nav`),"data-state":p?`expanded`:`collapsed`,"data-hydrated":g?``:void 0,className: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)`,!g&&E[d],g&&[`transition-[width] duration-200 ease-linear motion-reduce:transition-none`],o),...c,children:C(`nav`,{id:f,"aria-label":_,"aria-labelledby":r,className:`absolute inset-y-0 left-0 flex w-full min-w-0 flex-col text-sm`,children:a})})},F=C(T,{}),I=({label:e,shortcut:t})=>t==null?e:w(`span`,{className:`flex items-center gap-1.5`,children:[e,C(`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:t})]}),L=({appearance:e=`ghost`,"data-slot":n,icon:i=F,intent:a=`neutral`,label:o=`Toggle Sidebar`,onClick:c,shortcut:l,...u})=>{let{isMobile:d,keyboardShortcut:p,navId:m,open:h,openMobile:g,toggle:_}=k(`Trigger`),v=s(),y=d?g:h,b=!d||g,x=p?l:void 0,S=v?`Meta+B`:`Control+B`;return w(f.Root,{children:[C(f.Trigger,{asChild:!0,children:C(r,{appearance:e,"aria-controls":b?m:void 0,"aria-expanded":y,"aria-keyshortcuts":p?S:void 0,"data-slot":t(n,`sidebar-trigger`),"data-state":y?`expanded`:`collapsed`,icon:i,intent:a,label:o,onClick:e=>{c?.(e),e.defaultPrevented||_()},...u})}),C(f.Content,{"data-slot":`sidebar-trigger-tooltip`,children:C(I,{label:o,shortcut:x})})]})},R=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`div`,{"data-slot":t(o,`sidebar-header`),className: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`,a),...s,children:i}),z=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`div`,{"data-slot":t(o,`sidebar-body`),className: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`,a),...s,children:i}),B=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`div`,{"data-slot":t(o,`sidebar-footer`),className:e(`shrink-0 px-3 pt-3 pb-3.5`,`group-data-[state=expanded]/sidebar-nav:pr-1`,a),...s,children:i}),V=p(null),H=({asChild:r,children:i,className:a,"data-slot":o,...s})=>{let[c,l]=b(null),u=v(()=>({mountedLabelId:c,setMountedLabelId:l}),[c]),d=r?n:`div`;return C(V.Provider,{value:u,children:C(d,{"data-slot":t(o,`sidebar-group`),className:e(`pt-0.5`,a),...s,children:i})})},U=({asChild:r,children:i,className:a,"data-slot":o,id:s,...c})=>{let l=h(V),u=_(),d=s??(l==null?void 0:u),f=l?.setMountedLabelId;return g(()=>{if(f!=null&&d!=null)return f(d),()=>{f(null)}},[f,d]),C(r?n:`div`,{id:d,"data-slot":t(o,`sidebar-group-label`),className: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`,a),...c,children:i})},W=({"aria-labelledby":r,asChild:i,children:a,className:o,"data-slot":s,...c})=>{let l=h(V);return C(i?n:`ul`,{"aria-labelledby":r??l?.mountedLabelId??void 0,"data-slot":t(s,`sidebar-list`),className:e(`mb-2 space-y-px`,o),...c,children:a})},G=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`li`,{"data-slot":t(o,`sidebar-item`),className:e(`list-none`,a),...s,children:i}),K=[`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`],q={Root:N,Nav:P,Trigger:L,Header:R,Body:z,Footer:B,Group:H,GroupLabel:U,List:W,Item:G,ItemButton:({asChild:r,children:i,className:a,current:o,"data-slot":s,type:c,...l})=>C(r?n:`button`,{"data-slot":t(s,`sidebar-item-button`),"data-current":o?``:void 0,"aria-current":o?`page`:void 0,type:r?c:c??`button`,className:e(K,`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`,a),...l,children:i}),SearchTrigger:({asChild:r,children:i,className:a,"data-slot":o,shortcut:s,type:c,...l})=>{let u=r?n:`button`,d=s==null?i:w(S,{children:[i,C(`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:s})]});return C(u,{"data-slot":t(o,`sidebar-search-trigger`),type:r?c:c??`button`,className:e(`group`,K,`[&>svg:first-child]:text-muted hover:[&>svg:first-child]:text-strong [&>svg:first-child]:size-5 [&>svg]:shrink-0`,a),...l,children:d})},SwitcherTrigger:({asChild:r,children:i,className:a,"data-slot":o,type:s,...c})=>C(r?n:`button`,{"data-slot":t(o,`sidebar-switcher-trigger`),type:r?s:s??`button`,className: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`,a),...c,children:i}),Tooltip:({children:e,"data-slot":n,label:r,shortcut:i,side:a=`right`,...o})=>{let{isMobile:s,open:c}=k(`Tooltip`),l=!s&&!c,[u,d]=b(!1),[p,m]=b(l);return p!==l&&(m(l),d(!1)),w(f.Root,{disableHoverableContent:!0,onOpenChange:e=>{d(e&&l)},open:l&&u,children:[C(f.Trigger,{asChild:!0,children:e}),C(f.Content,{"data-slot":t(n,`sidebar-tooltip`),side:a,...o,children:C(I,{label:r,shortcut:i})})]})},Separator:({className:n,"data-slot":r,...i})=>C(a,{"data-slot":t(r,`sidebar-separator`),className:e(`my-3`,`group-data-[state=collapsed]/sidebar-nav:w-9`,n),...i})},J=`mantle-sidebar-state`,Y={collapsed:`collapsed`,expanded:`expanded`};function X(e){let t=l(e,J);if(t===Y.expanded)return!0;if(t===Y.collapsed)return!1}function Z(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?Y.expanded:Y.collapsed,c=[`${J}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{J as SIDEBAR_STATE_COOKIE_NAME,q as Sidebar,X as extractSidebarStateCookie,Z as serializeSidebarStateCookie,O as useSidebar};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-CxM7jdFi.js";import{t as r}from"./button-BCk0KpWb.js";import{t as i}from"./use-is-hydrated-DDCqXmju.js";import{n as a}from"./separator-D1K7DSTv.js";import{n as o,t as s}from"./use-is-apple-platform-Cxwrb86L.js";import{t as c}from"./use-callback-ref-IYti9y7x.js";import{n as l}from"./cookie-ca4g5CKp.js";import{t as u}from"./sheet-2AQT0DNu.js";import{r as d}from"./use-breakpoint-Dqu12Szq.js";import{t as f}from"./tooltip-BZRRJgpm.js";import{createContext as p,useCallback as m,useContext as h,useEffect as g,useId as _,useMemo as v,useRef as y,useState as b}from"react";import x from"tiny-invariant";import{Fragment as S,jsx as C,jsxs as w}from"react/jsx-runtime";import{SidebarSimpleIcon as T}from"@phosphor-icons/react/SidebarSimple";const E={sm:`hidden sm:block`,md:`hidden md:block`,lg:`hidden lg:block`},D=p(null);function O(){let e=h(D);return x(e,`useSidebar must be used within Sidebar.Root.`),e}function k(e){let t=h(D);return x(t,`Sidebar.${e} must be rendered inside Sidebar.Root.`),t}const A=[];function j(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`:!1}function M(){let e=Symbol(`sidebar-keyboard-shortcut`);return A.push(e),{isOwner:()=>A[0]===e,release:()=>{let t=A.indexOf(e);t!==-1&&A.splice(t,1)}}}const N=({children:e,defaultOpen:t=!0,keyboardShortcut:n=!0,mobileBreakpoint:r=`lg`,onOpenChange:i,onOpenMobileChange:a,open:s,openMobile:l})=>{let u=d(r),f=_(),p=s!=null,[h,x]=b(t),S=p?s:h,w=m(e=>{p||x(e),i?.(e)},[p,i]),T=l!=null,[E,O]=b(!1),k=T?l:E,A=m(e=>{T||O(e),a?.(e)},[T,a]),N=y(u);g(()=>{let e=N.current&&!u;N.current=u,e&&k&&A(!1)},[u,k,A]);let P=m(()=>{u?A(!k):w(!S)},[u,S,k,w,A]),F=c(P);g(()=>{if(!n)return;let e=M(),t=o(),r=n=>{if(!e.isOwner()||j(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(),F())};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),e.release()}},[n,F]);let I=v(()=>({isMobile:u,keyboardShortcut:n,mobileBreakpoint:r,navId:f,open:S,openMobile:k,setOpen:w,setOpenMobile:A,toggle:P}),[u,n,r,f,S,k,w,A,P]);return C(D.Provider,{value:I,children:e})},P=({"aria-label":n,"aria-labelledby":r,children:a,className:o,"data-slot":s,...c})=>{let{isMobile:l,mobileBreakpoint:d,navId:f,open:p,openMobile:m,setOpenMobile:h}=k(`Nav`),g=i(),_=n??(r==null?`Main`:void 0);return l?C(u.Root,{open:m,onOpenChange:h,children:w(u.Content,{side:`left`,preferredWidth:`sm:max-w-(--sidebar-width-mobile,18rem)`,"data-slot":t(s,`sidebar-nav`),"data-mobile":``,...r==null?null:{"aria-labelledby":r},className:e(`bg-base w-(--sidebar-width-mobile,18rem) max-w-full p-0`,o),...c,children:[C(u.Title,{className:`sr-only`,children:_??`Sidebar`}),C(`nav`,{id:f,"aria-label":_,"aria-labelledby":r,className:`flex h-full w-full min-w-0 flex-col text-sm`,children:a})]})}):C(`div`,{"data-slot":t(s,`sidebar-nav`),"data-state":p?`expanded`:`collapsed`,"data-hydrated":g?``:void 0,className: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)`,!g&&E[d],g&&[`transition-[width] duration-200 ease-linear motion-reduce:transition-none`],o),...c,children:C(`nav`,{id:f,"aria-label":_,"aria-labelledby":r,className:`absolute inset-y-0 left-0 flex w-full min-w-0 flex-col text-sm`,children:a})})},F=C(T,{}),I=({label:e,shortcut:t})=>t==null?e:w(`span`,{className:`flex items-center gap-1.5`,children:[e,C(`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:t})]}),L=({appearance:e=`ghost`,"data-slot":n,icon:i=F,intent:a=`neutral`,label:o=`Toggle Sidebar`,onClick:c,shortcut:l,...u})=>{let{isMobile:d,keyboardShortcut:p,navId:m,open:h,openMobile:g,toggle:_}=k(`Trigger`),v=s(),y=d?g:h,b=!d||g,x=p?l:void 0,S=v?`Meta+B`:`Control+B`;return w(f.Root,{children:[C(f.Trigger,{asChild:!0,children:C(r,{appearance:e,"aria-controls":b?m:void 0,"aria-expanded":y,"aria-keyshortcuts":p?S:void 0,"data-slot":t(n,`sidebar-trigger`),"data-state":y?`expanded`:`collapsed`,icon:i,intent:a,label:o,onClick:e=>{c?.(e),e.defaultPrevented||_()},...u})}),C(f.Content,{"data-slot":`sidebar-trigger-tooltip`,children:C(I,{label:o,shortcut:x})})]})},R=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`div`,{"data-slot":t(o,`sidebar-header`),className: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`,a),...s,children:i}),z=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`div`,{"data-slot":t(o,`sidebar-body`),className: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`,a),...s,children:i}),B=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`div`,{"data-slot":t(o,`sidebar-footer`),className:e(`shrink-0 px-3 pt-3 pb-3.5`,`group-data-[state=expanded]/sidebar-nav:pr-1`,a),...s,children:i}),V=p(null),H=({asChild:r,children:i,className:a,"data-slot":o,...s})=>{let[c,l]=b(null),u=v(()=>({mountedLabelId:c,setMountedLabelId:l}),[c]),d=r?n:`div`;return C(V.Provider,{value:u,children:C(d,{"data-slot":t(o,`sidebar-group`),className:e(`pt-0.5`,a),...s,children:i})})},U=({asChild:r,children:i,className:a,"data-slot":o,id:s,...c})=>{let l=h(V),u=_(),d=s??(l==null?void 0:u),f=l?.setMountedLabelId;return g(()=>{if(f!=null&&d!=null)return f(d),()=>{f(null)}},[f,d]),C(r?n:`div`,{id:d,"data-slot":t(o,`sidebar-group-label`),className: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`,a),...c,children:i})},W=({"aria-labelledby":r,asChild:i,children:a,className:o,"data-slot":s,...c})=>{let l=h(V);return C(i?n:`ul`,{"aria-labelledby":r??l?.mountedLabelId??void 0,"data-slot":t(s,`sidebar-list`),className:e(`mb-2 space-y-px`,o),...c,children:a})},G=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`li`,{"data-slot":t(o,`sidebar-item`),className:e(`list-none`,a),...s,children:i}),K=[`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`],q={Root:N,Nav:P,Trigger:L,Header:R,Body:z,Footer:B,Group:H,GroupLabel:U,List:W,Item:G,ItemButton:({asChild:r,children:i,className:a,current:o,"data-slot":s,type:c,...l})=>C(r?n:`button`,{"data-slot":t(s,`sidebar-item-button`),"data-current":o?``:void 0,"aria-current":o?`page`:void 0,type:r?c:c??`button`,className:e(K,`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`,a),...l,children:i}),SearchTrigger:({asChild:r,children:i,className:a,"data-slot":o,shortcut:s,type:c,...l})=>{let u=r?n:`button`,d=s==null?i:w(S,{children:[i,C(`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:s})]});return C(u,{"data-slot":t(o,`sidebar-search-trigger`),type:r?c:c??`button`,className:e(`group`,K,`[&>svg:first-child]:text-muted hover:[&>svg:first-child]:text-strong [&>svg:first-child]:size-5 [&>svg]:shrink-0`,a),...l,children:d})},SwitcherTrigger:({asChild:r,children:i,className:a,"data-slot":o,type:s,...c})=>C(r?n:`button`,{"data-slot":t(o,`sidebar-switcher-trigger`),type:r?s:s??`button`,className: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`,a),...c,children:i}),Tooltip:({children:e,"data-slot":n,label:r,shortcut:i,side:a=`right`,...o})=>{let{isMobile:s,open:c}=k(`Tooltip`),l=!s&&!c,[u,d]=b(!1),[p,m]=b(l);return p!==l&&(m(l),d(!1)),w(f.Root,{disableHoverableContent:!0,onOpenChange:e=>{d(e&&l)},open:l&&u,children:[C(f.Trigger,{asChild:!0,children:e}),C(f.Content,{"data-slot":t(n,`sidebar-tooltip`),side:a,...o,children:C(I,{label:r,shortcut:i})})]})},Separator:({className:n,"data-slot":r,...i})=>C(a,{"data-slot":t(r,`sidebar-separator`),className:e(`my-3`,`group-data-[state=collapsed]/sidebar-nav:w-9`,n),...i})},J=`mantle-sidebar-state`,Y={collapsed:`collapsed`,expanded:`expanded`};function X(e){let t=l(e,J);if(t===Y.expanded)return!0;if(t===Y.collapsed)return!1}function Z(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?Y.expanded:Y.collapsed,c=[`${J}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{J as SIDEBAR_STATE_COOKIE_NAME,q as Sidebar,X as extractSidebarStateCookie,Z as serializeSidebarStateCookie,O as useSidebar};
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-DpNWVci8.js";import{jsx as n}from"react/jsx-runtime";const r=({asChild:r=!1,className:i,ref:a,...o})=>n(r?t:`div`,{"data-slot":`skeleton`,className:e(`dark-high-contrast:bg-black/30 high-contrast:bg-black/30 h-4 animate-pulse rounded-md bg-gray-300/25 dark:bg-gray-950/10`,i),ref:a,...o});export{r as t};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-CxM7jdFi.js";import{jsx as n}from"react/jsx-runtime";const r=({asChild:r=!1,className:i,ref:a,...o})=>n(r?t:`div`,{"data-slot":`skeleton`,className:e(`dark-high-contrast:bg-black/30 high-contrast:bg-black/30 h-4 animate-pulse rounded-md bg-gray-300/25 dark:bg-gray-950/10`,i),ref:a,...o});export{r as t};
package/dist/skeleton.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./skeleton-BhcJMpem.js";export{e as Skeleton};
1
+ import{t as e}from"./skeleton-D86Gsflk.js";export{e as Skeleton};
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./anchor-D2So_zuy.js";import{jsx as n}from"react/jsx-runtime";const r=({children:r=`Skip to main content`,className:i,onClick:a,targetId:o=`main`,...s})=>n(t,{...s,"data-slot":`skip-to-main-link`,href:`#${o}`,onClick:e=>{e.preventDefault(),window.history.replaceState(null,``,`#${o}`),document.getElementById(o)?.focus({preventScroll:!0}),a?.(e)},className:e(`not-focus:sr-only bg-card fixed top-2 left-2 z-max px-4 py-2 shadow-lg`,i),children:r});export{r as SkipToMainLink};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./anchor-BjyGV6tB.js";import{jsx as n}from"react/jsx-runtime";const r=({children:r=`Skip to main content`,className:i,onClick:a,targetId:o=`main`,...s})=>n(t,{...s,"data-slot":`skip-to-main-link`,href:`#${o}`,onClick:e=>{e.preventDefault(),window.history.replaceState(null,``,`#${o}`),document.getElementById(o)?.focus({preventScroll:!0}),a?.(e)},className:e(`not-focus:sr-only bg-card fixed top-2 left-2 z-max px-4 py-2 shadow-lg`,i),children:r});export{r as SkipToMainLink};
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./data-slot-EM6s2WEU.js";import{Children as n,createElement as r,isValidElement as i}from"react";import{jsx as a}from"react/jsx-runtime";import{createSlot as o}from"@radix-ui/react-slot";const s=o(`Slot`);function c(t,n){return typeof n==`function`?(...r)=>e(t,n(...r)):e(t,n)}function l(e,t){return typeof t==`function`?(...n)=>({...e,...t(...n)}):e==null?t:t==null?e:{...e,...t}}const u=({children:e,className:o,"data-slot":u,ref:d,style:f,...p})=>{if(!i(e))return n.only(e);let{className:m,style:h,"data-slot":g,..._}=e.props;return a(s,{ref:d,...p,className:c(o,m),style:l(f,h),children:r(e.type,{..._,"data-slot":t(u,g),key:e.key??void 0})})};export{u as t};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./data-slot-EM6s2WEU.js";import{Children as n,createElement as r,isValidElement as i}from"react";import{jsx as a}from"react/jsx-runtime";import{createSlot as o}from"@radix-ui/react-slot";const s=o(`Slot`);function c(t,n){return typeof n==`function`?(...r)=>e(t,n(...r)):e(t,n)}function l(e,t){return typeof t==`function`?(...n)=>({...e,...t(...n)}):e==null?t:t==null?e:{...e,...t}}const u=({children:e,className:o,"data-slot":u,ref:d,style:f,...p})=>{if(!i(e))return n.only(e);let{className:m,style:h,"data-slot":g,..._}=e.props,v=t(u,g);return a(s,{ref:d,...p,className:c(o,m),style:l(f,h),children:r(e.type,{..._,...v!=null&&{"data-slot":v},key:e.key??void 0})})};export{u as t};
package/dist/slot.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./slot-DpNWVci8.js";export{e as Slot};
1
+ import{t as e}from"./slot-CxM7jdFi.js";export{e as Slot};
@@ -2,13 +2,8 @@
2
2
  * @ngrok/mantle/source-all.css
3
3
  *
4
4
  * Import this alongside mantle.css to tell Tailwind to scan ALL mantle component
5
- * dist files for utility class names. This is equivalent to what mantle.css used
6
- * to do automatically and is the correct choice for apps that use most or all
7
- * mantle components (e.g. a dashboard).
8
- *
9
- * For apps that use a small subset of mantle (e.g. a marketing site), prefer the
10
- * @ngrok/mantle Vite plugin instead — it automatically injects @source directives
11
- * only for the components your app actually imports, reducing generated CSS size.
5
+ * dist files for utility class names. This is the supported way to register
6
+ * mantle's Tailwind sources.
12
7
  *
13
8
  * Usage:
14
9
  * @import "@ngrok/mantle/mantle.css";
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-lZ48P8Nn.js";import{t as n}from"./button-Bc0lEOJ2.js";import{t as r}from"./button-CC10rP6X.js";import{t as i}from"./dropdown-menu-DJDrRzDU.js";import{CaretDownIcon as a}from"@phosphor-icons/react/CaretDown";import{createContext as o,useContext as s,useMemo as c}from"react";import{jsx as l}from"react/jsx-runtime";const u=o({size:`md`}),d={Root:({className:t,children:n,dir:r,open:a,defaultOpen:o,onOpenChange:s,modal:d,size:f=`md`,ref:p,...m})=>{let h=c(()=>({size:f}),[f]);return l(i.Root,{dir:r,open:a,defaultOpen:o,onOpenChange:s,modal:d,children:l(u.Provider,{value:h,children:l(`div`,{"data-slot":`split-button`,"data-size":f,className: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!`,t),ref:p,...m,children:n})})})},PrimaryAction:e=>{let{size:t}=s(u);return l(n,{appearance:`outlined`,intent:`neutral`,size:t,...e})},MenuTrigger:({icon:e,...n})=>{let{size:o}=s(u);return l(i.Trigger,{asChild:!0,className:`group`,children:l(r,{icon:e??l(t,{svg:l(a,{weight:`bold`,className:`size-4 group-data-[state=open]:-rotate-180 transition-transform ease-out duration-150`})}),appearance:`outlined`,intent:`neutral`,size:o,...n})})},MenuContent:({align:e=`end`,...t})=>l(i.Content,{align:e,...t}),MenuItem:({className:t,...n})=>l(i.Item,{className:e(`gap-2`,t),...n})};export{d as SplitButton};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-lZ48P8Nn.js";import{t as n}from"./button-DwFvQWu4.js";import{t as r}from"./button-BCk0KpWb.js";import{t as i}from"./dropdown-menu-Cy7mLIpJ.js";import{CaretDownIcon as a}from"@phosphor-icons/react/CaretDown";import{createContext as o,useContext as s,useMemo as c}from"react";import{jsx as l}from"react/jsx-runtime";const u=o({size:`md`}),d={Root:({className:t,children:n,dir:r,open:a,defaultOpen:o,onOpenChange:s,modal:d,size:f=`md`,ref:p,...m})=>{let h=c(()=>({size:f}),[f]);return l(i.Root,{dir:r,open:a,defaultOpen:o,onOpenChange:s,modal:d,children:l(u.Provider,{value:h,children:l(`div`,{"data-slot":`split-button`,"data-size":f,className: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!`,t),ref:p,...m,children:n})})})},PrimaryAction:e=>{let{size:t}=s(u);return l(n,{appearance:`outlined`,intent:`neutral`,size:t,...e})},MenuTrigger:({icon:e,...n})=>{let{size:o}=s(u);return l(i.Trigger,{asChild:!0,className:`group`,children:l(r,{icon:e??l(t,{svg:l(a,{weight:`bold`,className:`size-4 group-data-[state=open]:-rotate-180 transition-transform ease-out duration-150`})}),appearance:`outlined`,intent:`neutral`,size:o,...n})})},MenuContent:({align:e=`end`,...t})=>l(i.Content,{align:e,...t}),MenuItem:({className:t,...n})=>l(i.Item,{className:e(`gap-2`,t),...n})};export{d as SplitButton};
@@ -1 +1 @@
1
- import{t as e}from"./icon-lZ48P8Nn.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./button-CC10rP6X.js";import{t as r}from"./browser-only-CmEEzfU3.js";import{t as i}from"./skeleton-BhcJMpem.js";import{t as a}from"./dropdown-menu-DJDrRzDU.js";import{d as o,h as s,l as c,p as l}from"./theme-CVfq037P.js";import{n as u,t as d}from"./icons-DEVx1oP9.js";import{jsx as f,jsxs as p}from"react/jsx-runtime";const m={system:`System Preference`,light:`Light Mode`,dark:`Dark Mode`,"light-high-contrast":`Light High Contrast`,"dark-high-contrast":`Dark High Contrast`},h=({className:t,style:n})=>{let[r,i]=c();return f(a.RadioGroup,{"data-slot":`theme-dropdown-menu-radio-group`,className:t,style:n,value:r,onValueChange:e=>{l(e)&&i(e)},children:s.map(t=>p(a.RadioItem,{value:o(t),children:[f(e,{svg:f(u,{theme:t})}),m[t]]},t))})},g={Root:e=>f(a.Root,{...e}),Trigger:({appearance:e=`ghost`,"data-slot":o,disabled:s,label:c=`Change Theme`,ref:l,...u})=>f(a.Trigger,{asChild:!0,disabled:s,children:f(n,{ref:l,appearance:e,disabled:s,"data-slot":t(o,`theme-switcher-trigger`),intent:`neutral`,icon:f(r,{fallback:f(i,{className:`rounded-full size-5`}),children:()=>f(d,{className:`size-5`})}),label:c,...u})}),Content:({children:e,"data-slot":n,...r})=>f(a.Content,{"data-slot":t(n,`theme-switcher-content`),...r,children:e??f(h,{})})};export{h as ThemeDropdownMenuRadioGroup,g as ThemeSwitcher};
1
+ import{t as e}from"./icon-lZ48P8Nn.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./button-BCk0KpWb.js";import{t as r}from"./browser-only-CmEEzfU3.js";import{t as i}from"./skeleton-D86Gsflk.js";import{t as a}from"./dropdown-menu-Cy7mLIpJ.js";import{d as o,h as s,l as c,p as l}from"./theme-CVfq037P.js";import{n as u,t as d}from"./icons-DEVx1oP9.js";import{jsx as f,jsxs as p}from"react/jsx-runtime";const m={system:`System Preference`,light:`Light Mode`,dark:`Dark Mode`,"light-high-contrast":`Light High Contrast`,"dark-high-contrast":`Dark High Contrast`},h=({className:t,style:n})=>{let[r,i]=c();return f(a.RadioGroup,{"data-slot":`theme-dropdown-menu-radio-group`,className:t,style:n,value:r,onValueChange:e=>{l(e)&&i(e)},children:s.map(t=>p(a.RadioItem,{value:o(t),children:[f(e,{svg:f(u,{theme:t})}),m[t]]},t))})},g={Root:e=>f(a.Root,{...e}),Trigger:({appearance:e=`ghost`,"data-slot":o,disabled:s,label:c=`Change Theme`,ref:l,...u})=>f(a.Trigger,{asChild:!0,disabled:s,children:f(n,{ref:l,appearance:e,disabled:s,"data-slot":t(o,`theme-switcher-trigger`),intent:`neutral`,icon:f(r,{fallback:f(i,{className:`rounded-full size-5`}),children:()=>f(d,{className:`size-5`})}),label:c,...u})}),Content:({children:e,"data-slot":n,...r})=>f(a.Content,{"data-slot":t(n,`theme-switcher-content`),...r,children:e??f(h,{})})};export{h as ThemeDropdownMenuRadioGroup,g as ThemeSwitcher};
package/dist/toast.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-lZ48P8Nn.js";import{t as n}from"./slot-DpNWVci8.js";import{s as r}from"./theme-CVfq037P.js";import{createContext as i,useContext as a,useMemo as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{CheckCircleIcon as l}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as u}from"@phosphor-icons/react/Info";import{WarningIcon as d}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as f}from"@phosphor-icons/react/WarningDiamond";import*as p from"sonner";const m=({className:t,containerAriaLabel:n,dir:i,duration_ms:a=4e3,position:o=`top-center`,style:c})=>{let l=r();return s(p.Toaster,{"data-slot":`toaster`,className:e(`toaster overlay-prompt pointer-events-auto *:duration-200`,t),containerAriaLabel:n,dir:i,duration:a,gap:12,position:o??`top-center`,style:c,theme:l,toastOptions:{unstyled:!0}})},h=i(``);function g(e,t){let n=t?.duration_ms;return typeof n==`number`&&n<=0&&(n=1/0),p.toast.custom(t=>s(h.Provider,{value:t,children:e}),{duration:n,...t?.id?{id:t.id}:{},unstyled:!0})}const _=i({intent:`info`}),v={Root:({asChild:t,children:r,className:i,intent:a,ref:l,...u})=>{let d=t?n:`div`,f=o(()=>({intent:a}),[a]);return s(_.Provider,{value:f,children:c(d,{"data-slot":`toast`,className:e(`relative flex items-start gap-2 text-sm font-sans`,`p-3 pl-3.75`,`bg-popover high-contrast:border-popover rounded rounded-r-[0.3125rem] border border-gray-500/35 shadow-lg`,i),ref:l,...u,children:[s(b,{intent:a}),r]})})},Action:({asChild:t,className:r,onClick:i,ref:o,...c})=>{let l=a(h);return s(t?n:`button`,{"data-slot":`toast-action`,className:e(`shrink-0`,`data-icon-button:-mr-0.5 data-icon-button:-mt-0.5 data-icon-button:rounded-xs`,r),onClick:e=>{i?.(e),!e.defaultPrevented&&p.toast.dismiss(l)},ref:o,...c})},Icon:({className:n,svg:r,ref:i,...o})=>{let c=a(_);switch(c.intent){case`danger`:return s(t,{"data-slot":`toast-icon`,className:e(`text-danger-600`,n),ref:i,svg:r??s(d,{weight:`fill`}),...o});case`warning`:return s(t,{"data-slot":`toast-icon`,className:e(`text-warning-600`,n),ref:i,svg:r??s(f,{weight:`fill`}),...o});case`success`:return s(t,{"data-slot":`toast-icon`,className:e(`text-success-600`,n),ref:i,svg:r??s(l,{weight:`fill`}),...o});case`info`:return s(t,{"data-slot":`toast-icon`,className:e(`text-accent-600`,n),ref:i,svg:s(u,{weight:`fill`}),...o});default:throw Error(`Unreachable Case: ${c.intent}`)}},Message:({asChild:t,className:r,ref:i,...a})=>s(t?n:`p`,{"data-slot":`toast-message`,className:e(`text-strong flex-1 text-sm font-body`,r),ref:i,...a})},y={info:`bg-accent-600`,warning:`bg-warning-600`,success:`bg-success-600`,danger:`bg-danger-600`};function b({className:t,intent:n,...r}){return s(`div`,{"aria-hidden":!0,className:e(`z-1 absolute -inset-px right-auto w-1.5 rounded-l`,y[n],t),...r})}export{v as Toast,m as Toaster,g as makeToast};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-lZ48P8Nn.js";import{t as n}from"./slot-CxM7jdFi.js";import{s as r}from"./theme-CVfq037P.js";import{createContext as i,useContext as a,useMemo as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{CheckCircleIcon as l}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as u}from"@phosphor-icons/react/Info";import{WarningIcon as d}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as f}from"@phosphor-icons/react/WarningDiamond";import*as p from"sonner";const m=({className:t,containerAriaLabel:n,dir:i,duration_ms:a=4e3,position:o=`top-center`,style:c})=>{let l=r();return s(p.Toaster,{"data-slot":`toaster`,className:e(`toaster overlay-prompt pointer-events-auto *:duration-200`,t),containerAriaLabel:n,dir:i,duration:a,gap:12,position:o??`top-center`,style:c,theme:l,toastOptions:{unstyled:!0}})},h=i(``);function g(e,t){let n=t?.duration_ms;return typeof n==`number`&&n<=0&&(n=1/0),p.toast.custom(t=>s(h.Provider,{value:t,children:e}),{duration:n,...t?.id?{id:t.id}:{},unstyled:!0})}const _=i({intent:`info`}),v={Root:({asChild:t,children:r,className:i,intent:a,ref:l,...u})=>{let d=t?n:`div`,f=o(()=>({intent:a}),[a]);return s(_.Provider,{value:f,children:c(d,{"data-slot":`toast`,className:e(`relative flex items-start gap-2 text-sm font-sans`,`p-3 pl-3.75`,`bg-popover high-contrast:border-popover rounded rounded-r-[0.3125rem] border border-gray-500/35 shadow-lg`,i),ref:l,...u,children:[s(b,{intent:a}),r]})})},Action:({asChild:t,className:r,onClick:i,ref:o,...c})=>{let l=a(h);return s(t?n:`button`,{"data-slot":`toast-action`,className:e(`shrink-0`,`data-icon-button:-mr-0.5 data-icon-button:-mt-0.5 data-icon-button:rounded-xs`,r),onClick:e=>{i?.(e),!e.defaultPrevented&&p.toast.dismiss(l)},ref:o,...c})},Icon:({className:n,svg:r,ref:i,...o})=>{let c=a(_);switch(c.intent){case`danger`:return s(t,{"data-slot":`toast-icon`,className:e(`text-danger-600`,n),ref:i,svg:r??s(d,{weight:`fill`}),...o});case`warning`:return s(t,{"data-slot":`toast-icon`,className:e(`text-warning-600`,n),ref:i,svg:r??s(f,{weight:`fill`}),...o});case`success`:return s(t,{"data-slot":`toast-icon`,className:e(`text-success-600`,n),ref:i,svg:r??s(l,{weight:`fill`}),...o});case`info`:return s(t,{"data-slot":`toast-icon`,className:e(`text-accent-600`,n),ref:i,svg:s(u,{weight:`fill`}),...o});default:throw Error(`Unreachable Case: ${c.intent}`)}},Message:({asChild:t,className:r,ref:i,...a})=>s(t?n:`p`,{"data-slot":`toast-message`,className:e(`text-strong flex-1 text-sm font-body`,r),ref:i,...a})},y={info:`bg-accent-600`,warning:`bg-warning-600`,success:`bg-success-600`,danger:`bg-danger-600`};function b({className:t,intent:n,...r}){return s(`div`,{"aria-hidden":!0,className:e(`z-1 absolute -inset-px right-auto w-1.5 rounded-l`,y[n],t),...r})}export{v as Toast,m as Toaster,g as makeToast};
package/dist/utils.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./compose-refs-BdBMM9ga.js";import{t}from"./copy-to-clipboard-B4UB6pts.js";import{a as n,c as r,d as i,f as a,i as o,l as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./direction-Wa9W2F61.js";import{t as h}from"./in-view-C2DpZ6s0.js";function g(e,t){return Math.sign(t.getTime()-e.getTime())}function _(e,t){return Math.sign(e.getTime()-t.getTime())}export{p as $alphanumericSortingDirection,c as $sortingDirection,d as $sortingMode,o as $timeSortingDirection,n as alphanumericSortingDirections,g as compareDatesNewestToOldest,_ as compareDatesOldestToNewest,e as composeRefs,t as copyToClipboard,h as inView,l as isAlphanumericSortingDirection,f as isSortingDirection,r as isSortingMode,s as isTimeSortingDirection,m as sortingDirections,i as sortingModes,a as timeSortingByDirection,u as timeSortingDirections};
1
+ import{t as e}from"./compose-refs-BdBMM9ga.js";import{t}from"./copy-to-clipboard-B4UB6pts.js";import{a as n,c as r,d as i,f as a,i as o,l as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./direction-Wa9W2F61.js";import{t as h}from"./in-view-T_AAYaaF.js";function g(e,t){return Math.sign(t.getTime()-e.getTime())}function _(e,t){return Math.sign(e.getTime()-t.getTime())}export{p as $alphanumericSortingDirection,c as $sortingDirection,d as $sortingMode,o as $timeSortingDirection,n as alphanumericSortingDirections,g as compareDatesNewestToOldest,_ as compareDatesOldestToNewest,e as composeRefs,t as copyToClipboard,h as inView,l as isAlphanumericSortingDirection,f as isSortingDirection,r as isSortingMode,s as isTimeSortingDirection,m as sortingDirections,i as sortingModes,a as timeSortingByDirection,u as timeSortingDirections};
@@ -0,0 +1,41 @@
1
+ import { n as WithAsChild } from "./as-child-D23mGo4f.js";
2
+ import { ComponentProps } from "react";
3
+ //#region src/components/visually-hidden/visually-hidden.d.ts
4
+ /**
5
+ * Content for assistive technology only. Renders a native `<span>` clipped to
6
+ * a one-pixel box (the `sr-only` technique, never `display: none`). Screen
7
+ * readers read the content; sighted users never see it.
8
+ *
9
+ * **When to use**
10
+ * - State context the visual design already carries: "(opens in a new tab)" on an external link, a caption on a layout table.
11
+ * - Give a screen reader a text alternative for content it cannot read, such as a decorative chart.
12
+ * - Style the message of a {@link https://mantle.ngrok.com/components/primitives/live-region LiveRegion}, which builds on the same technique.
13
+ *
14
+ * **When not to use**
15
+ * - To name an icon-only control. Voice-control software skips a control whose only label is hidden DOM text, so use `aria-label`, as {@link https://mantle.ngrok.com/components/actions/icon-button IconButton}'s required `label` prop does.
16
+ * - To hide content from assistive technology too. Use the `hidden` attribute or `aria-hidden`.
17
+ * - For a link that appears on focus. Use {@link https://mantle.ngrok.com/components/primitives/skip-to-main-link SkipToMainLink}.
18
+ *
19
+ * **Polymorphism.** Pass `asChild` to hide a more semantic element instead of
20
+ * the default `<span>` (a `<caption>`, a `<legend>`, a heading).
21
+ *
22
+ * | Data Attribute | Value | Description |
23
+ * | -------------- | ------------------- | ------------------------------------------------------------------------- |
24
+ * | `data-slot` | `"visually-hidden"` | Stamped on the rendered element, and joined onto the child via `asChild`. |
25
+ *
26
+ * @see https://mantle.ngrok.com/components/primitives/visually-hidden
27
+ * @see https://webaim.org/techniques/css/invisiblecontent/
28
+ *
29
+ * @example
30
+ * ```tsx
31
+ * import { VisuallyHidden } from "@ngrok/mantle/visually-hidden";
32
+ *
33
+ * <a href="https://status.ngrok.com" target="_blank" rel="noreferrer">
34
+ * ngrok status
35
+ * <VisuallyHidden> (opens in a new tab)</VisuallyHidden>
36
+ * </a>
37
+ * ```
38
+ */
39
+ declare const VisuallyHidden: ({ asChild, className, ref, ...props }: ComponentProps<"span"> & WithAsChild) => import("react").JSX.Element;
40
+ //#endregion
41
+ export { VisuallyHidden };
@@ -0,0 +1 @@
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-CxM7jdFi.js";import{jsx as n}from"react/jsx-runtime";const r=({asChild:r,className:i,ref:a,...o})=>n(r?t:`span`,{ref:a,"data-slot":`visually-hidden`,className:e(`sr-only`,i),...o});export{r as VisuallyHidden};
package/dist/well.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-DpNWVci8.js";import{jsx as n}from"react/jsx-runtime";const r=({asChild:r=!1,className:i,ref:a,...o})=>n(r?t:`div`,{ref:a,"data-slot":`well`,className:e(`border-card-muted bg-base relative rounded-md border shadow-inner`,i),...o});export{r as Well};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-CxM7jdFi.js";import{jsx as n}from"react/jsx-runtime";const r=({asChild:r=!1,className:i,ref:a,...o})=>n(r?t:`div`,{ref:a,"data-slot":`well`,className:e(`border-card-muted bg-base relative rounded-md border shadow-inner`,i),...o});export{r as Well};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngrok/mantle",
3
- "version": "0.83.9",
3
+ "version": "0.84.1",
4
4
  "description": "mantle is ngrok's UI library and design system.",
5
5
  "homepage": "https://mantle.ngrok.com",
6
6
  "license": "MIT",
@@ -82,6 +82,7 @@
82
82
  "./label": "./dist/label.js",
83
83
  "./line-chart": "./dist/line-chart.js",
84
84
  "./list": "./dist/list.js",
85
+ "./live-region": "./dist/live-region.js",
85
86
  "./main": "./dist/main.js",
86
87
  "./media-object": "./dist/media-object.js",
87
88
  "./multi-select": "./dist/multi-select.js",
@@ -114,10 +115,11 @@
114
115
  "./tooltip": "./dist/tooltip.js",
115
116
  "./types": "./dist/types.js",
116
117
  "./utils": "./dist/utils.js",
118
+ "./visually-hidden": "./dist/visually-hidden.js",
117
119
  "./well": "./dist/well.js"
118
120
  },
119
121
  "dependencies": {
120
- "@ariakit/react": "0.4.37",
122
+ "@ariakit/react": "0.4.38",
121
123
  "@headlessui/react": "2.2.10",
122
124
  "@radix-ui/react-dialog": "1.1.23",
123
125
  "@radix-ui/react-dropdown-menu": "2.1.24",
@@ -1 +0,0 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-DpNWVci8.js";import{t as n}from"./field-B1wqeZr4.js";import{t as r}from"./label-D-D11mlp.js";import{cloneElement as i,createContext as a,isValidElement as o,useContext as s,useId as c,useMemo as l}from"react";import u from"tiny-invariant";import{jsx as d}from"react/jsx-runtime";const f=a(null);function p(e){let t=s(f);return u(t,`Choice.${e} must be rendered inside Choice.Root.`),t}const m={Root:({"aria-describedby":t,"aria-errormessage":r,"aria-invalid":i,children:a,className:o,disabled:u=!1,id:p,name:m,ref:h,...g})=>{let _=s(n),v=_?.id,y=_?.name,b=_?.[`aria-describedby`],x=_?.[`aria-invalid`],S=_?.[`aria-errormessage`],C=c(),w=c(),T=v??p??C,E=[b??t,w].filter(Boolean).join(` `)||void 0,D=l(()=>({controlId:T,descriptionId:w,disabled:u,controlProps:{id:T,name:y??m,disabled:u,"aria-describedby":E,"aria-invalid":x??i,"aria-errormessage":S??r}}),[T,w,u,E,y,m,x,i,S,r]);return d(f.Provider,{value:D,children:d(`div`,{ref:h,"data-slot":`choice`,className:e(`flex w-full items-start gap-2`,o),...g,children:a})})},Indicator:({children:t,className:n,ref:r,...a})=>{let{controlProps:s}=p(`Indicator`),c=o(t)?i(t,{...s,disabled:s.disabled||t.props.disabled===!0,name:s.name??t.props.name,"aria-invalid":s[`aria-invalid`]??t.props[`aria-invalid`],"aria-errormessage":s[`aria-errormessage`]??t.props[`aria-errormessage`]}):t;return d(`span`,{ref:r,"data-slot":`choice-indicator`,className:e(`flex h-lh shrink-0 items-center text-sm`,n),...a,children:c})},Content:({asChild:n,className:r,ref:i,...a})=>d(n?t:`div`,{ref:i,"data-slot":`choice-content`,className:e(`flex min-w-0 flex-1 flex-col gap-0.5`,r),...a}),Label:({className:t,ref:n,...i})=>{let{controlId:a,disabled:o}=p(`Label`);return d(r,{ref:n,"data-slot":`choice-label`,className:e(o&&`opacity-50`,t),...i,htmlFor:a,disabled:o})},Title:({asChild:n,className:r,ref:i,...a})=>{let{disabled:o}=p(`Title`);return d(n?t:`p`,{ref:i,"data-slot":`choice-title`,className:e(`text-strong text-sm font-medium font-sans`,o&&`opacity-50`,r),...a})},Description:({asChild:n,className:r,ref:i,...a})=>{let{descriptionId:o,disabled:s}=p(`Description`);return d(n?t:`p`,{ref:i,id:o,"data-slot":`choice-description`,className:e(`text-body text-sm leading-4`,s&&`opacity-50`,r),...a})}};export{m as t};
@@ -1 +0,0 @@
1
- const e={some:0,all:1};function t(t,n,{root:r,margin:i,amount:a=`some`}={}){let o=new WeakMap,s=new IntersectionObserver(e=>{e.forEach(e=>{let t=o.get(e.target);if(e.isIntersecting!==!!t)if(e.isIntersecting){let t=n(e.target,e);typeof t==`function`?o.set(e.target,t):s.unobserve(e.target)}else typeof t==`function`&&(t(e),o.delete(e.target))})},{root:r,rootMargin:i,threshold:typeof a==`number`?a:e[a]});return s.observe(t),()=>{s.unobserve(t),s.disconnect()}}export{t};
@@ -1 +0,0 @@
1
- import{n as e}from"./compose-refs-BdBMM9ga.js";import{t}from"./cx-IiQEAKf5.js";import{t as n}from"./slot-DpNWVci8.js";import{Children as r,createContext as i,isValidElement as a,useCallback as o,useContext as s,useEffect as c,useId as l,useMemo as u,useRef as d,useState as f}from"react";import p from"tiny-invariant";import{jsx as m}from"react/jsx-runtime";import{useVirtualizer as h}from"@tanstack/react-virtual";const g=i(null);function _(e){let t=s(g);return p(t,`List.${e} must be composed inside List.Root / List.VirtualRoot (or a SelectableList viewport).`),t}const v=i(null),y=i(null);function b(e){return a(e)?e.props.disabled===!0:!1}function x({start:e,step:t,count:n,isItemDisabled:r}){for(let i=e;i>=0&&i<n;i+=t)if(!r(i))return i;return-1}const S=`a[href]:not([tabindex="-1"]), button:not(:disabled):not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])`;function C(e){let t=e.matches(S)?e:e.querySelector(S);return t instanceof HTMLElement?t:null}function w(e){let t=e instanceof Element?e.closest(`[data-index]`):null;if(t==null)return null;let n=Number(t.getAttribute(`data-index`));return!Number.isInteger(n)||n<0?null:{item:t,index:n}}function T(e,t){if(!(e instanceof Element))return!1;let n=e.closest(`a[href], button, input, select, textarea, label, [role="button"], [role="link"], [role="menuitem"], [contenteditable="true"]`);return n!=null&&t.contains(n)}function E({count:e,isItemDisabled:t,focusItemAt:n}){return{onKeyDown:r=>{if(r.target instanceof HTMLElement&&(r.target.isContentEditable||r.target.tagName===`INPUT`||r.target.tagName===`TEXTAREA`||r.target.tagName===`SELECT`)||r.altKey||r.ctrlKey||r.metaKey)return;let i=w(r.target);if(i==null)return;let a=-1,o=1;switch(r.key){case`ArrowDown`:o=1,a=x({start:i.index+1,step:o,count:e,isItemDisabled:t});break;case`ArrowUp`:o=-1,a=x({start:i.index-1,step:o,count:e,isItemDisabled:t});break;case`Home`:o=1,a=x({start:0,step:o,count:e,isItemDisabled:t});break;case`End`:o=-1,a=x({start:e-1,step:o,count:e,isItemDisabled:t});break;default:return}r.preventDefault(),a>=0&&a!==i.index&&n(a,o)}}}function D({count:e,enabled:t,isItemDisabled:n,onActivate:r,itemId:i,scrollToIndex:a}){let[o,s]=f(-1),l=d(!1),u=o>=e?e-1:o;if(c(()=>{o>=e&&s(e-1)},[o,e]),!t)return{activeIndex:-1,collectionProps:{}};let p=e=>n?.(e)??!1,m=(t,n)=>x({start:t,step:n,count:e,isItemDisabled:p}),h=e=>{e<0||(s(e),a(e))};return{activeIndex:u,collectionProps:{tabIndex:0,"aria-activedescendant":u>=0?i(u):void 0,onMouseDown:e=>{let t=w(e.target);if(t!=null&&!p(t.index)){s(t.index),l.current=!1;return}l.current=!0},onClick:e=>{if(e.defaultPrevented)return;let t=w(e.target);t==null||p(t.index)||T(e.target,t.item)||(s(t.index),r?.(t.index))},onFocus:t=>{if(t.target!==t.currentTarget){let e=w(t.target);e!=null&&!p(e.index)&&s(e.index),t.target instanceof HTMLElement&&t.target.tabIndex>=0||t.currentTarget.focus({preventScroll:!0}),l.current=!1;return}let n=l.current;l.current=!1,e>0&&!n&&s(e=>e<0?m(0,1):e)},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(s(-1),l.current=!1)},onKeyDown:t=>{if(t.target===t.currentTarget&&!(t.altKey||t.ctrlKey||t.metaKey))switch(l.current=!1,t.key){case`ArrowDown`:t.preventDefault(),h(m(u<0?0:u+1,1));break;case`ArrowUp`:t.preventDefault(),h(u<0?m(0,1):m(u-1,-1));break;case`Home`:t.preventDefault(),h(m(0,1));break;case`End`:t.preventDefault(),h(m(e-1,-1));break;case` `:case`Enter`:!t.repeat&&u>=0&&!p(u)&&(t.preventDefault(),r?.(u))}}}}}function O({count:e,focusItemAt:t,isItemDisabled:n,onActivate:r,itemId:i,scrollToIndex:a,semantics:o}){let s=l(),c=u(()=>({semantics:o}),[o]),d=u(()=>i??(e=>`${s}-item-${e}`),[i,s]),{activeIndex:f,collectionProps:p}=D({count:e,enabled:o===`grid`,isItemDisabled:n,onActivate:r,itemId:d,scrollToIndex:a}),m=u(()=>({activeIndex:f,stampItemId:i==null?d:null}),[f,d,i]);return{collectionProps:o===`list`?E({count:e,isItemDisabled:n,focusItemAt:t}):p,gridNav:m,listContext:c}}function k({"aria-label":e,"aria-labelledby":n,"aria-multiselectable":r,children:i,className:a,collectionProps:o,gridNav:s,listContext:c,viewportProps:l,ref:u}){return m(g.Provider,{value:c,children:m(y.Provider,{value:s,children:m(`div`,{ref:u,"data-slot":`list`,className:t(`border-popover bg-popover scrollbar overscroll-none overflow-x-hidden overflow-y-auto rounded-md border p-1`,a),...l,children:m(`div`,{"data-slot":`list-collection`,role:c.semantics===`grid`?`grid`:`list`,"aria-label":e,"aria-labelledby":n,"aria-multiselectable":r,className:`relative flex w-full flex-col gap-px outline-hidden`,...o,children:i})})})})}const A=({asChild:r,children:i,className:a,disabled:o=!1,ref:c,selected:l=!1,style:u,...d})=>{let{semantics:f}=_(`Item`),p=s(v),h=s(y),g=f===`grid`,b=r?n:`div`,x=p?.placement??null,S=p?.index,C=g&&h!=null&&S!=null&&h.activeIndex===S,w=x?.measureRef??null,T=e(c,w);return m(b,{ref:T,"data-slot":`list-item`,...d,id:g&&S!=null&&h?.stampItemId!=null?h.stampItemId(S):d.id,"data-index":S,"data-state":l?`selected`:`unselected`,"data-disabled":o||void 0,"data-active":C||void 0,role:g?`row`:`listitem`,"aria-selected":g?l:void 0,"aria-disabled":g&&o?!0:d[`aria-disabled`],"aria-rowindex":g?x?.posInSet:void 0,"aria-posinset":g?void 0:x?.posInSet,"aria-setsize":g?void 0:x?.setSize,className:t(`rounded-md data-[state=selected]:bg-selected-menu-item data-[active]:bg-active-menu-item data-[active]:data-[state=selected]:bg-active-selected-menu-item`,!o&&`hover:bg-active-menu-item hover:data-[state=selected]:bg-active-selected-menu-item`,!g&&!o&&`has-[:focus-visible]:bg-active-menu-item has-[:focus-visible]:data-[state=selected]:bg-active-selected-menu-item`,a),style:x?{...u,...x.style}:u,children:i})};function j({children:e,index:t}){let n=u(()=>({index:t,placement:null}),[t]);return m(v.Provider,{value:n,children:e})}const M=({"aria-label":t,"aria-labelledby":n,"aria-multiselectable":i,children:s,className:c,isItemDisabled:l,onActivate:f,itemId:p,ref:h,semantics:g=`list`,..._})=>{let v=d(null),y=e(v,h),x=u(()=>r.toArray(s).filter(a),[s]),S=o(e=>{v.current?.querySelector(`[data-index="${e}"]`)?.scrollIntoView({block:`nearest`})},[]),w=o((e,t)=>{let n=v.current;if(n!=null)for(let r=e;r>=0&&r<x.length;r+=t){let e=n.querySelector(`[data-index="${r}"]`);if(e==null)continue;let t=C(e);if(t!=null){t.focus({preventScroll:!0}),e.scrollIntoView({block:`nearest`});return}}},[x.length]),{collectionProps:T,gridNav:E,listContext:D}=O({count:x.length,focusItemAt:w,isItemDisabled:l??(e=>b(x[e])),onActivate:f,itemId:p,scrollToIndex:S,semantics:g});return m(k,{"aria-label":t,"aria-labelledby":n,"aria-multiselectable":i,className:c,collectionProps:T,gridNav:E,listContext:D,viewportProps:_,ref:y,children:x.map((e,t)=>m(j,{index:t,children:e},e.key??t))})};function N({virtualItem:e,count:t,measureRef:n}){return{posInSet:e.index+1,setSize:t,measureRef:n,style:{position:`absolute`,left:0,top:0,width:`100%`,transform:`translateY(${e.start}px)`}}}function P({children:e,count:t,measureRef:n,virtualItem:r}){let i=u(()=>({index:r.index,placement:N({virtualItem:r,count:t,measureRef:n})}),[r,t,n]);return m(v.Provider,{value:i,children:e})}const F=({"aria-label":t,"aria-labelledby":n,"aria-multiselectable":i,children:s,className:l,estimateItemHeight:f=44,isItemDisabled:p,onActivate:g,overscan:_=8,itemId:v,ref:y,semantics:x=`list`,...S})=>{let w=d(null),T=e(w,y),E=u(()=>r.toArray(s).filter(a),[s]),D=E.length,A=h({count:D,getScrollElement:()=>w.current,estimateSize:()=>f,getItemKey:e=>E[e]?.key??e,overscan:_,gap:1}),j=o(e=>A.scrollToIndex(e,{align:`auto`}),[A]),M=d(null);c(()=>()=>{M.current!=null&&cancelAnimationFrame(M.current)},[]);let{collectionProps:N,gridNav:F,listContext:I}=O({count:D,focusItemAt:o((e,t)=>{M.current!=null&&(cancelAnimationFrame(M.current),M.current=null);let n=e,r=0,i=()=>{M.current=null;let e=w.current;if(e==null||n<0||n>=D)return;A.scrollToIndex(n,{align:`auto`});let a=e.querySelector(`[data-index="${n}"]`);if(a!=null){let e=C(a);if(e!=null){e.focus({preventScroll:!0});return}n+=t,r=0}r+=1,r<10&&(M.current=requestAnimationFrame(i))};i()},[D,A]),isItemDisabled:p??(e=>b(E[e])),onActivate:g,itemId:v,scrollToIndex:j,semantics:x}),L=A.getVirtualItems(),R=L.some(e=>e.index===F.activeIndex);return m(k,{"aria-label":t,"aria-labelledby":n,"aria-multiselectable":i,className:l,collectionProps:{...N,"aria-activedescendant":R?N[`aria-activedescendant`]:void 0,"aria-rowcount":x===`grid`?D:void 0,style:{height:`${A.getTotalSize()}px`}},gridNav:F,listContext:I,viewportProps:S,ref:T,children:L.map(e=>{let t=E[e.index];return t==null?null:m(P,{virtualItem:e,count:D,measureRef:A.measureElement,children:t},e.key)})})};export{A as n,M as r,F as t};