@blakesteve/roster 5.7.0 → 5.9.0

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 (106) hide show
  1. package/README.md +169 -5
  2. package/dist/components/atoms/Avatar/Avatar.cjs +1 -1
  3. package/dist/components/atoms/Avatar/Avatar.d.ts +4 -0
  4. package/dist/components/atoms/Avatar/Avatar.js +1 -1
  5. package/dist/components/atoms/AvatarStrip/AvatarStrip.cjs +1 -1
  6. package/dist/components/atoms/AvatarStrip/AvatarStrip.d.ts +10 -1
  7. package/dist/components/atoms/AvatarStrip/AvatarStrip.js +34 -30
  8. package/dist/components/atoms/Button/button-variants.cjs +1 -1
  9. package/dist/components/atoms/Button/button-variants.js +5 -3
  10. package/dist/components/atoms/Eyebrow/eyebrow-variants.cjs +1 -1
  11. package/dist/components/atoms/Eyebrow/eyebrow-variants.js +8 -4
  12. package/dist/components/atoms/MultiSelect/MultiSelect.cjs +1 -1
  13. package/dist/components/atoms/MultiSelect/MultiSelect.d.ts +3 -1
  14. package/dist/components/atoms/MultiSelect/MultiSelect.js +87 -89
  15. package/dist/components/atoms/Progress/Progress.cjs +1 -1
  16. package/dist/components/atoms/Progress/Progress.d.ts +1 -0
  17. package/dist/components/atoms/Progress/Progress.js +28 -27
  18. package/dist/components/atoms/Stat/Stat.cjs +1 -1
  19. package/dist/components/atoms/Stat/Stat.js +5 -5
  20. package/dist/components/atoms/Stat/stat-variants.cjs +1 -1
  21. package/dist/components/atoms/Stat/stat-variants.js +10 -8
  22. package/dist/components/molecules/Breadcrumbs/Breadcrumbs.cjs +1 -1
  23. package/dist/components/molecules/Breadcrumbs/Breadcrumbs.d.ts +10 -1
  24. package/dist/components/molecules/Breadcrumbs/Breadcrumbs.js +31 -29
  25. package/dist/components/molecules/CallToAction/CallToAction.cjs +1 -1
  26. package/dist/components/molecules/CallToAction/CallToAction.d.ts +8 -1
  27. package/dist/components/molecules/CallToAction/CallToAction.js +34 -29
  28. package/dist/components/molecules/Carousel/Carousel.cjs +1 -1
  29. package/dist/components/molecules/Carousel/Carousel.d.ts +7 -0
  30. package/dist/components/molecules/Carousel/Carousel.js +155 -155
  31. package/dist/components/molecules/ErrorState/ErrorState.cjs +1 -1
  32. package/dist/components/molecules/ErrorState/ErrorState.d.ts +8 -1
  33. package/dist/components/molecules/ErrorState/ErrorState.js +44 -39
  34. package/dist/components/molecules/FileUpload/FileUpload.cjs +1 -1
  35. package/dist/components/molecules/FileUpload/FileUpload.js +23 -22
  36. package/dist/components/molecules/MediaPreview/MediaPreview.cjs +1 -1
  37. package/dist/components/molecules/MediaPreview/MediaPreview.d.ts +3 -1
  38. package/dist/components/molecules/MediaPreview/MediaPreview.js +13 -12
  39. package/dist/components/molecules/Menu/Menu.cjs +1 -0
  40. package/dist/components/molecules/Menu/Menu.d.ts +169 -0
  41. package/dist/components/molecules/Menu/Menu.js +577 -0
  42. package/dist/components/molecules/Menu/menu-typeahead.cjs +1 -0
  43. package/dist/components/molecules/Menu/menu-typeahead.d.ts +7 -0
  44. package/dist/components/molecules/Menu/menu-typeahead.js +13 -0
  45. package/dist/components/molecules/Pagination/Pagination.cjs +1 -1
  46. package/dist/components/molecules/Pagination/Pagination.d.ts +1 -0
  47. package/dist/components/molecules/Pagination/Pagination.js +47 -46
  48. package/dist/components/molecules/ProgressField/ProgressField.d.ts +1 -0
  49. package/dist/components/molecules/SkeletonPresets/SkeletonPresets.cjs +1 -1
  50. package/dist/components/molecules/SkeletonPresets/SkeletonPresets.d.ts +2 -2
  51. package/dist/components/molecules/SkeletonPresets/SkeletonPresets.js +17 -17
  52. package/dist/components/molecules/StepProgress/StepProgress.cjs +1 -1
  53. package/dist/components/molecules/StepProgress/StepProgress.d.ts +1 -0
  54. package/dist/components/molecules/StepProgress/StepProgress.js +9 -8
  55. package/dist/components/organisms/Countdown/Countdown.cjs +1 -1
  56. package/dist/components/organisms/Countdown/Countdown.d.ts +13 -0
  57. package/dist/components/organisms/Countdown/Countdown.js +54 -47
  58. package/dist/components/organisms/DataTable/DataTable.cjs +1 -1
  59. package/dist/components/organisms/DataTable/DataTable.d.ts +5 -3
  60. package/dist/components/organisms/DataTable/DataTable.js +27 -26
  61. package/dist/components/organisms/Dialog/Dialog.cjs +1 -1
  62. package/dist/components/organisms/Dialog/Dialog.d.ts +8 -1
  63. package/dist/components/organisms/Dialog/Dialog.js +25 -23
  64. package/dist/components/organisms/Footer/Footer.cjs +1 -1
  65. package/dist/components/organisms/Footer/Footer.d.ts +9 -0
  66. package/dist/components/organisms/Footer/Footer.js +21 -23
  67. package/dist/components/organisms/ModerationQueue/ModerationQueue.cjs +1 -1
  68. package/dist/components/organisms/ModerationQueue/ModerationQueue.d.ts +40 -1
  69. package/dist/components/organisms/ModerationQueue/ModerationQueue.js +262 -237
  70. package/dist/components/organisms/ModerationQueue/QueueEditDialog.cjs +1 -1
  71. package/dist/components/organisms/ModerationQueue/QueueEditDialog.d.ts +1 -1
  72. package/dist/components/organisms/ModerationQueue/QueueEditDialog.js +23 -21
  73. package/dist/components/organisms/ModerationQueue/QueueEditSheet.cjs +1 -1
  74. package/dist/components/organisms/ModerationQueue/QueueEditSheet.d.ts +1 -1
  75. package/dist/components/organisms/ModerationQueue/QueueEditSheet.js +22 -20
  76. package/dist/components/organisms/ModerationQueue/queue-actions.d.ts +29 -10
  77. package/dist/components/organisms/Navbar/Navbar.cjs +1 -1
  78. package/dist/components/organisms/Navbar/Navbar.d.ts +39 -4
  79. package/dist/components/organisms/Navbar/Navbar.js +297 -301
  80. package/dist/components/organisms/Navbar/navbar-variants.cjs +1 -1
  81. package/dist/components/organisms/Navbar/navbar-variants.js +4 -2
  82. package/dist/components/organisms/Sheet/Sheet.cjs +1 -1
  83. package/dist/components/organisms/Sheet/Sheet.d.ts +8 -1
  84. package/dist/components/organisms/Sheet/Sheet.js +65 -63
  85. package/dist/index.d.ts +1 -0
  86. package/dist/lib/labels.cjs +1 -0
  87. package/dist/lib/labels.d.ts +7 -0
  88. package/dist/lib/labels.js +12 -0
  89. package/dist/meta.json +3 -3
  90. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +7 -7
  91. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +2 -2
  92. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +5 -5
  93. package/dist/node_modules/@headlessui/react/dist/components/portal/portal.js +6 -6
  94. package/dist/node_modules/@headlessui/react/dist/utils/focus-management.cjs +1 -1
  95. package/dist/node_modules/@headlessui/react/dist/utils/focus-management.js +52 -61
  96. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +6 -6
  97. package/dist/roster.cjs +1 -1
  98. package/dist/roster.css +1 -1
  99. package/dist/roster.js +127 -116
  100. package/package.json +2 -1
  101. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine-glue.cjs +0 -1
  102. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine-glue.js +0 -21
  103. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine.cjs +0 -1
  104. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine.js +0 -120
  105. package/dist/node_modules/@headlessui/react/dist/components/menu/menu.cjs +0 -1
  106. package/dist/node_modules/@headlessui/react/dist/components/menu/menu.js +0 -197
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../node_modules/class-variance-authority/dist/index.cjs"),t=r.cva("rst:font-ui rst:w-full rst:z-30 rst:border-b rst:transition-colors rst:duration-200",{variants:{variant:{default:"rst:bg-[var(--roster-nav-bg)] rst:border-[var(--roster-nav-border)] rst:text-[var(--roster-nav-text)]",slate:"rst:bg-gray-700 rst:border-gray-600 rst:text-gray-100 rst:dark:bg-gray-900 rst:dark:border-gray-800",primary:"rst:bg-primary-700 rst:border-primary-600 rst:text-white rst:dark:bg-primary-950 rst:dark:border-primary-900",white:"rst:bg-white rst:border-gray-200 rst:text-gray-900 rst:dark:bg-gray-600 rst:dark:border-gray-700 rst:dark:text-gray-100",transparent:"rst:bg-transparent rst:border-transparent rst:text-gray-900 rst:dark:text-white"},position:{fixed:"rst:fixed rst:top-0 rst:left-0 rst:right-0",sticky:"rst:sticky rst:top-0",static:"rst:static"}},defaultVariants:{variant:"default",position:"sticky"}});exports.navbarVariants=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../node_modules/class-variance-authority/dist/index.cjs"),t=r.cva("rst:font-ui rst:w-full rst:z-30 rst:border-b rst:transition-colors rst:duration-200",{variants:{variant:{default:"rst:bg-[var(--roster-nav-bg)] rst:border-[var(--roster-nav-border)] rst:text-[var(--roster-nav-text)]",slate:"rst:bg-gray-700 rst:border-gray-600 rst:text-gray-100 rst:dark:bg-gray-900 rst:dark:border-gray-800",primary:"rst:bg-primary-700 rst:border-primary-600 rst:text-primary-700-ink rst:dark:bg-primary-950 rst:dark:border-primary-900 rst:dark:text-white",white:"rst:bg-white rst:border-gray-200 rst:text-gray-900 rst:dark:bg-gray-600 rst:dark:border-gray-700 rst:dark:text-gray-100",transparent:"rst:bg-transparent rst:border-transparent rst:text-gray-900 rst:dark:text-white"},position:{fixed:"rst:fixed rst:top-0 rst:left-0 rst:right-0",sticky:"rst:sticky rst:top-0",static:"rst:static"}},defaultVariants:{variant:"default",position:"sticky"}});exports.navbarVariants=t;
@@ -11,8 +11,10 @@ const a = /* @__PURE__ */ r(
11
11
  default: "rst:bg-[var(--roster-nav-bg)] rst:border-[var(--roster-nav-border)] rst:text-[var(--roster-nav-text)]",
12
12
  // Slate: A solid mid-dark gray in light mode, drops to a moody gray in dark mode
13
13
  slate: "rst:bg-gray-700 rst:border-gray-600 rst:text-gray-100 rst:dark:bg-gray-900 rst:dark:border-gray-800",
14
- // Primary: Bold brand color in light mode, deep rich brand color in dark mode
15
- primary: "rst:bg-primary-700 rst:border-primary-600 rst:text-white rst:dark:bg-primary-950 rst:dark:border-primary-900",
14
+ // Primary: Bold brand color in light mode, deep rich brand color in dark mode.
15
+ // Light text is primary-700's ink, as on every other solid fill, so an
16
+ // app with a light primary can make it dark; the dark fill keeps white.
17
+ primary: "rst:bg-primary-700 rst:border-primary-600 rst:text-primary-700-ink rst:dark:bg-primary-950 rst:dark:border-primary-900 rst:dark:text-white",
16
18
  // White: Crisp white in light mode, elevated surface gray in dark mode
17
19
  white: "rst:bg-white rst:border-gray-200 rst:text-gray-900 rst:dark:bg-gray-600 rst:dark:border-gray-700 rst:dark:text-gray-100",
18
20
  // Transparent: Stays invisible, adapts text for standard readability
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),H=require("react"),J=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),y=require("../../../node_modules/@headlessui/react/dist/components/dialog/dialog.cjs"),Q=require("../../../node_modules/@headlessui/react/dist/components/transition/transition.cjs"),f=require("../../../lib/utils.cjs"),Z=require("../../../internal/popup.cjs"),W=require("../../../internal/motion.cjs"),O=require("../../../internal/page-inert.cjs"),D=require("./sheet-drag.cjs"),tt=require("./sheet-title.cjs");function et(r){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const c in r)if(c!=="default"){const l=Object.getOwnPropertyDescriptor(r,c);Object.defineProperty(i,c,l.get?l:{enumerable:!0,get:()=>r[c]})}}return i.default=r,Object.freeze(i)}const n=et(H),rt="rst:transition-transform rst:duration-(--roster-sheet-enter-duration) rst:ease-(--roster-sheet-enter-easing) rst:data-leave:duration-(--roster-sheet-leave-duration) rst:data-leave:ease-(--roster-sheet-leave-easing) rst:data-closed:translate-y-full",st="rst:transition-opacity rst:duration-(--roster-sheet-fade-duration) rst:ease-out rst:data-closed:opacity-0",nt="rst:transition-opacity rst:duration-(--roster-sheet-enter-duration) rst:ease-out rst:data-leave:duration-(--roster-sheet-leave-duration) rst:data-closed:opacity-0",ot="rst:transition-opacity rst:duration-(--roster-sheet-fade-duration) rst:ease-out rst:data-closed:opacity-0",at=["input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=range]):not([type=color]):not([type=file]):not([type=image])","textarea","select","[contenteditable]:not([contenteditable=false])"].join(",");function it(r){return r?"current"in r?r.current:r:null}function ct({target:r}){const i=n.useRef(r),c=n.useRef(!1);return n.useEffect(()=>{i.current=r}),n.useEffect(()=>(c.current=!1,()=>{c.current=!0,queueMicrotask(()=>{if(!c.current)return;const l=it(i.current);l?.isConnected&&l.focus()})}),[]),null}function ut(){return s.jsx("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 20 20",className:"rst:h-5 rst:w-5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:s.jsx("path",{d:"M5 5l10 10M15 5L5 15"})})}const lt=({isOpen:r,onClose:i,onAfterClose:c,title:l,hideTitle:T=!1,description:S,actions:N,maxWidth:b=560,initialFocus:v,returnFocus:_,busy:p=!1,dragToDismiss:j=!0,contentKey:h,className:z,children:Y})=>{const{ref:R,inDarkScope:B}=Z.useDarkScope(),C=W.useReducedMotion();n.useLayoutEffect(()=>{if(r)return O.lockPage(R.current)},[r,R]);const u=n.useRef(null),I=n.useRef(null),L=n.useRef(null),E=n.useRef(null),k=n.useRef(null),P=n.useId(),g=tt.titleSignature(l),w=n.useRef({signature:g,contentKey:h,open:r,busy:p});n.useEffect(()=>{const t=w.current;if(w.current={signature:g,contentKey:h,open:r,busy:p},!t.open||!r)return;const e=t.contentKey!==h,o=t.signature!==g&&!t.busy;!e&&!o||(L.current?.focus(),k.current&&(k.current.scrollTop=0))},[g,h,r,p]),n.useEffect(()=>{if(!r)return;const t=requestAnimationFrame(()=>{const e=u.current,o=document.activeElement;!e||o&&e.contains(o)||(v?.current??E.current)?.focus()});return()=>cancelAnimationFrame(t)},[r,v]);const[q,M]=n.useState(null);n.useEffect(()=>{if(!r)return;const t=window.visualViewport;if(!t)return;const e=()=>{const o=document.activeElement,d=!!o&&!!u.current?.contains(o)&&o.matches(at);M(d?Math.round(t.height):null)};return t.addEventListener("resize",e),document.addEventListener("focusin",e),document.addEventListener("focusout",e),()=>{t.removeEventListener("resize",e),document.removeEventListener("focusin",e),document.removeEventListener("focusout",e),M(null)}},[r]);const a=n.useRef(null),m=n.useRef(!1),A=n.useRef(r);n.useEffect(()=>{A.current=r},[r]);const x=t=>{u.current?.style.setProperty("--rst-sheet-drag",`${t}px`)},F=t=>{const e=u.current;a.current=null,e&&(delete e.dataset.dragging,t==="close"?(i(),requestAnimationFrame(()=>{A.current&&!a.current&&x(0)})):x(0))};n.useEffect(()=>{!r&&a.current&&(a.current=null,u.current&&delete u.current.dataset.dragging),r&&!a.current&&x(0)},[r]);const U=t=>{a.current||(m.current=!1,!(!j||!r)&&(t.pointerType==="mouse"&&(t.button!==0||!I.current?.contains(t.target))||(a.current={pointerId:t.pointerId,x0:t.clientX,y0:t.clientY,dy:0,phase:"pending",samples:[{t:t.timeStamp,y:t.clientY}]})))},V=t=>{const e=a.current;if(!e||t.pointerId!==e.pointerId)return;const o=t.clientX-e.x0,d=t.clientY-e.y0;if(e.phase==="pending"){if(!D.exceedsSheetTapSlop(o,d))return;if(Math.abs(o)>Math.abs(d)){e.phase="ignored";return}e.phase="dragging",m.current=!0;try{t.currentTarget.setPointerCapture(t.pointerId)}catch{}u.current&&(u.current.dataset.dragging="")}e.phase==="dragging"&&(e.dy=d,e.samples.push({t:t.timeStamp,y:t.clientY}),e.samples.length>32&&e.samples.shift(),x(Math.max(0,d)))},X=t=>{const e=a.current;if(!e||t.pointerId!==e.pointerId)return;if(e.phase!=="dragging"){a.current=null;return}e.samples.push({t:t.timeStamp,y:t.clientY});const o=t.clientY-e.y0,d=u.current?.getBoundingClientRect().height??0;F(D.sheetDragOutcome(o,d,D.sheetReleaseVelocity(e.samples)))},$=t=>{const e=a.current;!e||t.pointerId!==e.pointerId||(e.phase==="dragging"?F("stay"):a.current=null)},G=t=>{!m.current||t.detail===0||(m.current=!1,t.preventDefault(),t.stopPropagation())},K={"--rst-sheet-max-width":typeof b=="number"?`${b}px`:b,...q!==null&&{"--rst-sheet-keyboard-cap":`${q}px`}};return s.jsxs(s.Fragment,{children:[s.jsx("span",{ref:R,hidden:!0}),s.jsxs(y.Dialog,{open:r,as:"div",onClose:i,initialFocus:v??E,className:f.cn("rst:font-ui rst:relative rst:z-50 rst:focus:outline-hidden",B&&"dark"),children:[s.jsx(y.DialogBackdrop,{transition:!0,"data-testid":"sheet-backdrop",className:f.cn("rst:fixed rst:inset-0 rst:bg-[var(--roster-backdrop,var(--roster-sheet-backdrop))]",C?ot:nt)}),s.jsx("div",{className:"rst:fixed rst:inset-0 rst:flex rst:items-end rst:justify-center",children:s.jsx(Q.TransitionChild,{afterLeave:c,children:s.jsxs(y.DialogPanel,{ref:u,style:K,"data-testid":"sheet-panel",className:f.cn("rst:relative rst:flex rst:max-h-[min(92dvh,var(--rst-sheet-keyboard-cap,92dvh))] rst:w-full rst:flex-col","rst:md:max-w-(--rst-sheet-max-width)","rst:rounded-t-2xl rst:border rst:border-b-0 rst:elevation-overlay","rst:bg-[var(--roster-popover-bg)] rst:border-[var(--roster-popover-border)] rst:text-[var(--roster-popover-text)]","rst:[--roster-ring-offset:var(--roster-popover-bg)]","rst:pb-[env(safe-area-inset-bottom)]","rst:translate-y-[var(--rst-sheet-drag,0px)]",C?st:rt,"rst:data-dragging:transition-none",z),children:[s.jsxs("div",{"data-testid":"sheet-drag-zone",className:f.cn("rst:shrink-0",j&&"rst:touch-none"),onPointerDown:U,onPointerMove:V,onPointerUp:X,onPointerCancel:$,onClickCapture:G,children:[s.jsx("div",{ref:I,"aria-hidden":"true","data-testid":"sheet-handle",className:f.cn("rst:flex rst:h-11 rst:items-start rst:justify-center rst:pt-2",j&&"rst:cursor-grab rst:active:cursor-grabbing"),children:s.jsx("span",{className:"rst:h-1 rst:w-10 rst:rounded-full rst:bg-current rst:opacity-30"})}),s.jsxs("div",{className:"rst:-mt-3 rst:flex rst:items-start rst:gap-2 rst:px-5 rst:pb-4",children:[s.jsxs("div",{className:"rst:min-w-0 rst:flex-1 rst:pt-2",children:[s.jsx(y.DialogTitle,{as:"h2",id:P,ref:L,tabIndex:-1,className:f.cn("rst:text-lg rst:font-semibold rst:text-inherit rst:focus:outline-hidden",T&&"rst:sr-only"),children:l}),S&&s.jsx(J.Description,{as:"p",className:"rst:mt-1 rst:text-sm rst:text-inherit rst:opacity-75",children:S})]}),N&&s.jsx("div",{className:"rst:flex rst:h-11 rst:shrink-0 rst:items-center rst:gap-1",children:N}),s.jsx("button",{ref:E,type:"button",onClick:i,"aria-label":"Close",className:"rst:inline-flex rst:size-11 rst:shrink-0 rst:-mr-2 rst:cursor-pointer rst:items-center rst:justify-center rst:rounded-md rst:bg-transparent rst:text-inherit rst:opacity-60 rst:transition-opacity rst:hover:opacity-100 rst:focus:outline-hidden rst:focus-visible:opacity-100 rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background",children:s.jsx(ut,{})})]})]}),s.jsx("div",{ref:k,role:"region","aria-labelledby":P,tabIndex:0,"data-testid":"sheet-content","aria-busy":p||void 0,className:"rst:min-h-0 rst:flex-1 rst:overflow-y-auto rst:overscroll-contain rst:px-5 rst:pb-4 rst:focus:outline-hidden rst:ring-inset rst:focus-visible:ring-2 rst:focus-visible:ring-ring",children:Y}),s.jsx(ct,{target:_})]})})})]})]})};exports.Sheet=lt;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),Q=require("react"),Z=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),x=require("../../../node_modules/@headlessui/react/dist/components/dialog/dialog.cjs"),W=require("../../../node_modules/@headlessui/react/dist/components/transition/transition.cjs"),f=require("../../../lib/utils.cjs"),O=require("../../../lib/labels.cjs"),tt=require("../../../internal/popup.cjs"),et=require("../../../internal/motion.cjs"),rt=require("../../../internal/page-inert.cjs"),S=require("./sheet-drag.cjs"),st=require("./sheet-title.cjs");function nt(r){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const c in r)if(c!=="default"){const l=Object.getOwnPropertyDescriptor(r,c);Object.defineProperty(i,c,l.get?l:{enumerable:!0,get:()=>r[c]})}}return i.default=r,Object.freeze(i)}const n=nt(Q),ot={close:"Close"},at="rst:transition-transform rst:duration-(--roster-sheet-enter-duration) rst:ease-(--roster-sheet-enter-easing) rst:data-leave:duration-(--roster-sheet-leave-duration) rst:data-leave:ease-(--roster-sheet-leave-easing) rst:data-closed:translate-y-full",it="rst:transition-opacity rst:duration-(--roster-sheet-fade-duration) rst:ease-out rst:data-closed:opacity-0",ct="rst:transition-opacity rst:duration-(--roster-sheet-enter-duration) rst:ease-out rst:data-leave:duration-(--roster-sheet-leave-duration) rst:data-closed:opacity-0",ut="rst:transition-opacity rst:duration-(--roster-sheet-fade-duration) rst:ease-out rst:data-closed:opacity-0",lt=["input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=range]):not([type=color]):not([type=file]):not([type=image])","textarea","select","[contenteditable]:not([contenteditable=false])"].join(",");function dt(r){return r?"current"in r?r.current:r:null}function ft({target:r}){const i=n.useRef(r),c=n.useRef(!1);return n.useEffect(()=>{i.current=r}),n.useEffect(()=>(c.current=!1,()=>{c.current=!0,queueMicrotask(()=>{if(!c.current)return;const l=dt(i.current);l?.isConnected&&l.focus()})}),[]),null}function pt(){return s.jsx("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 20 20",className:"rst:h-5 rst:w-5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:s.jsx("path",{d:"M5 5l10 10M15 5L5 15"})})}const ht=({isOpen:r,onClose:i,onAfterClose:c,title:l,hideTitle:T=!1,description:D,actions:L,maxWidth:y=560,initialFocus:v,returnFocus:_,busy:p=!1,dragToDismiss:j=!0,contentKey:h,labels:z,className:B,children:Y})=>{const U=O.withLabels(ot,z),{ref:R,inDarkScope:V}=tt.useDarkScope(),N=et.useReducedMotion();n.useLayoutEffect(()=>{if(r)return rt.lockPage(R.current)},[r,R]);const u=n.useRef(null),C=n.useRef(null),I=n.useRef(null),E=n.useRef(null),k=n.useRef(null),w=n.useId(),g=st.titleSignature(l),P=n.useRef({signature:g,contentKey:h,open:r,busy:p});n.useEffect(()=>{const t=P.current;if(P.current={signature:g,contentKey:h,open:r,busy:p},!t.open||!r)return;const e=t.contentKey!==h,o=t.signature!==g&&!t.busy;!e&&!o||(I.current?.focus(),k.current&&(k.current.scrollTop=0))},[g,h,r,p]),n.useEffect(()=>{if(!r)return;const t=requestAnimationFrame(()=>{const e=u.current,o=document.activeElement;!e||o&&e.contains(o)||(v?.current??E.current)?.focus()});return()=>cancelAnimationFrame(t)},[r,v]);const[q,M]=n.useState(null);n.useEffect(()=>{if(!r)return;const t=window.visualViewport;if(!t)return;const e=()=>{const o=document.activeElement,d=!!o&&!!u.current?.contains(o)&&o.matches(lt);M(d?Math.round(t.height):null)};return t.addEventListener("resize",e),document.addEventListener("focusin",e),document.addEventListener("focusout",e),()=>{t.removeEventListener("resize",e),document.removeEventListener("focusin",e),document.removeEventListener("focusout",e),M(null)}},[r]);const a=n.useRef(null),m=n.useRef(!1),A=n.useRef(r);n.useEffect(()=>{A.current=r},[r]);const b=t=>{u.current?.style.setProperty("--rst-sheet-drag",`${t}px`)},F=t=>{const e=u.current;a.current=null,e&&(delete e.dataset.dragging,t==="close"?(i(),requestAnimationFrame(()=>{A.current&&!a.current&&b(0)})):b(0))};n.useEffect(()=>{!r&&a.current&&(a.current=null,u.current&&delete u.current.dataset.dragging),r&&!a.current&&b(0)},[r]);const X=t=>{a.current||(m.current=!1,!(!j||!r)&&(t.pointerType==="mouse"&&(t.button!==0||!C.current?.contains(t.target))||(a.current={pointerId:t.pointerId,x0:t.clientX,y0:t.clientY,dy:0,phase:"pending",samples:[{t:t.timeStamp,y:t.clientY}]})))},$=t=>{const e=a.current;if(!e||t.pointerId!==e.pointerId)return;const o=t.clientX-e.x0,d=t.clientY-e.y0;if(e.phase==="pending"){if(!S.exceedsSheetTapSlop(o,d))return;if(Math.abs(o)>Math.abs(d)){e.phase="ignored";return}e.phase="dragging",m.current=!0;try{t.currentTarget.setPointerCapture(t.pointerId)}catch{}u.current&&(u.current.dataset.dragging="")}e.phase==="dragging"&&(e.dy=d,e.samples.push({t:t.timeStamp,y:t.clientY}),e.samples.length>32&&e.samples.shift(),b(Math.max(0,d)))},G=t=>{const e=a.current;if(!e||t.pointerId!==e.pointerId)return;if(e.phase!=="dragging"){a.current=null;return}e.samples.push({t:t.timeStamp,y:t.clientY});const o=t.clientY-e.y0,d=u.current?.getBoundingClientRect().height??0;F(S.sheetDragOutcome(o,d,S.sheetReleaseVelocity(e.samples)))},K=t=>{const e=a.current;!e||t.pointerId!==e.pointerId||(e.phase==="dragging"?F("stay"):a.current=null)},H=t=>{!m.current||t.detail===0||(m.current=!1,t.preventDefault(),t.stopPropagation())},J={"--rst-sheet-max-width":typeof y=="number"?`${y}px`:y,...q!==null&&{"--rst-sheet-keyboard-cap":`${q}px`}};return s.jsxs(s.Fragment,{children:[s.jsx("span",{ref:R,hidden:!0}),s.jsxs(x.Dialog,{open:r,as:"div",onClose:i,initialFocus:v??E,className:f.cn("rst:font-ui rst:relative rst:z-50 rst:focus:outline-hidden",V&&"dark"),children:[s.jsx(x.DialogBackdrop,{transition:!0,"data-testid":"sheet-backdrop",className:f.cn("rst:fixed rst:inset-0 rst:bg-[var(--roster-backdrop,var(--roster-sheet-backdrop))]",N?ut:ct)}),s.jsx("div",{className:"rst:fixed rst:inset-0 rst:flex rst:items-end rst:justify-center",children:s.jsx(W.TransitionChild,{afterLeave:c,children:s.jsxs(x.DialogPanel,{ref:u,style:J,"data-testid":"sheet-panel",className:f.cn("rst:relative rst:flex rst:max-h-[min(92dvh,var(--rst-sheet-keyboard-cap,92dvh))] rst:w-full rst:flex-col","rst:md:max-w-(--rst-sheet-max-width)","rst:rounded-t-2xl rst:border rst:border-b-0 rst:elevation-overlay","rst:bg-[var(--roster-popover-bg)] rst:border-[var(--roster-popover-border)] rst:text-[var(--roster-popover-text)]","rst:[--roster-ring-offset:var(--roster-popover-bg)]","rst:pb-[env(safe-area-inset-bottom)]","rst:translate-y-[var(--rst-sheet-drag,0px)]",N?it:at,"rst:data-dragging:transition-none",B),children:[s.jsxs("div",{"data-testid":"sheet-drag-zone",className:f.cn("rst:shrink-0",j&&"rst:touch-none"),onPointerDown:X,onPointerMove:$,onPointerUp:G,onPointerCancel:K,onClickCapture:H,children:[s.jsx("div",{ref:C,"aria-hidden":"true","data-testid":"sheet-handle",className:f.cn("rst:flex rst:h-11 rst:items-start rst:justify-center rst:pt-2",j&&"rst:cursor-grab rst:active:cursor-grabbing"),children:s.jsx("span",{className:"rst:h-1 rst:w-10 rst:rounded-full rst:bg-current rst:opacity-30"})}),s.jsxs("div",{className:"rst:-mt-3 rst:flex rst:items-start rst:gap-2 rst:px-5 rst:pb-4",children:[s.jsxs("div",{className:"rst:min-w-0 rst:flex-1 rst:pt-2",children:[s.jsx(x.DialogTitle,{as:"h2",id:w,ref:I,tabIndex:-1,className:f.cn("rst:text-lg rst:font-semibold rst:text-inherit rst:focus:outline-hidden",T&&"rst:sr-only"),children:l}),D&&s.jsx(Z.Description,{as:"p",className:"rst:mt-1 rst:text-sm rst:text-inherit rst:opacity-75",children:D})]}),L&&s.jsx("div",{className:"rst:flex rst:h-11 rst:shrink-0 rst:items-center rst:gap-1",children:L}),s.jsx("button",{ref:E,type:"button",onClick:i,"aria-label":U.close,className:"rst:inline-flex rst:size-11 rst:shrink-0 rst:-mr-2 rst:cursor-pointer rst:items-center rst:justify-center rst:rounded-md rst:bg-transparent rst:text-inherit rst:opacity-60 rst:transition-opacity rst:hover:opacity-100 rst:focus:outline-hidden rst:focus-visible:opacity-100 rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background",children:s.jsx(pt,{})})]})]}),s.jsx("div",{ref:k,role:"region","aria-labelledby":w,tabIndex:0,"data-testid":"sheet-content","aria-busy":p||void 0,className:"rst:min-h-0 rst:flex-1 rst:overflow-y-auto rst:overscroll-contain rst:px-5 rst:pb-4 rst:focus:outline-hidden rst:ring-inset rst:focus-visible:ring-2 rst:focus-visible:ring-ring",children:Y}),s.jsx(ft,{target:_})]})})})]})]})};exports.Sheet=ht;
@@ -1,4 +1,9 @@
1
1
  import * as React from "react";
2
+ /** Every word Sheet says of its own. Pass any of them in `labels` to replace it. */
3
+ export interface SheetLabels {
4
+ /** The close button's name. */
5
+ close: string;
6
+ }
2
7
  export interface SheetProps {
3
8
  isOpen: boolean;
4
9
  /** Called by Escape, a backdrop click, the close button and a dismissing drag. */
@@ -52,6 +57,8 @@ export interface SheetProps {
52
57
  * that changes under an unchanged title.
53
58
  */
54
59
  contentKey?: React.Key;
60
+ /** The component's own words, replaced; any left out stay English. */
61
+ labels?: Partial<SheetLabels>;
55
62
  /** Applied to the panel. */
56
63
  className?: string;
57
64
  children: React.ReactNode;
@@ -81,5 +88,5 @@ export interface SheetProps {
81
88
  * The bottom padding includes `env(safe-area-inset-bottom)`, which is 0 unless
82
89
  * the page's viewport meta sets `viewport-fit=cover`.
83
90
  */
84
- declare const Sheet: ({ isOpen, onClose, onAfterClose, title, hideTitle, description, actions, maxWidth, initialFocus, returnFocus, busy, dragToDismiss, contentKey, className, children, }: SheetProps) => import("react/jsx-runtime").JSX.Element;
91
+ declare const Sheet: ({ isOpen, onClose, onAfterClose, title, hideTitle, description, actions, maxWidth, initialFocus, returnFocus, busy, dragToDismiss, contentKey, labels, className, children, }: SheetProps) => import("react/jsx-runtime").JSX.Element;
85
92
  export { Sheet };
@@ -1,37 +1,38 @@
1
1
  "use client";
2
- import { jsxs as l, Fragment as K, jsx as n } from "react/jsx-runtime";
2
+ import { jsxs as l, Fragment as H, jsx as n } from "react/jsx-runtime";
3
3
  import * as s from "react";
4
- import { Description as Q } from "../../../node_modules/@headlessui/react/dist/components/description/description.js";
5
- import { Dialog as H, DialogBackdrop as J, DialogPanel as Z, DialogTitle as W } from "../../../node_modules/@headlessui/react/dist/components/dialog/dialog.js";
6
- import { TransitionChild as O } from "../../../node_modules/@headlessui/react/dist/components/transition/transition.js";
4
+ import { Description as J } from "../../../node_modules/@headlessui/react/dist/components/description/description.js";
5
+ import { Dialog as Z, DialogBackdrop as W, DialogPanel as O, DialogTitle as tt } from "../../../node_modules/@headlessui/react/dist/components/dialog/dialog.js";
6
+ import { TransitionChild as et } from "../../../node_modules/@headlessui/react/dist/components/transition/transition.js";
7
7
  import { cn as d } from "../../../lib/utils.js";
8
- import { useDarkScope as tt } from "../../../internal/popup.js";
9
- import { useReducedMotion as et } from "../../../internal/motion.js";
10
- import { lockPage as rt } from "../../../internal/page-inert.js";
11
- import { sheetDragOutcome as st, sheetReleaseVelocity as nt, exceedsSheetTapSlop as ot } from "./sheet-drag.js";
12
- import { titleSignature as at } from "./sheet-title.js";
13
- const it = "rst:transition-transform rst:duration-(--roster-sheet-enter-duration) rst:ease-(--roster-sheet-enter-easing) rst:data-leave:duration-(--roster-sheet-leave-duration) rst:data-leave:ease-(--roster-sheet-leave-easing) rst:data-closed:translate-y-full", ct = "rst:transition-opacity rst:duration-(--roster-sheet-fade-duration) rst:ease-out rst:data-closed:opacity-0", ut = "rst:transition-opacity rst:duration-(--roster-sheet-enter-duration) rst:ease-out rst:data-leave:duration-(--roster-sheet-leave-duration) rst:data-closed:opacity-0", lt = "rst:transition-opacity rst:duration-(--roster-sheet-fade-duration) rst:ease-out rst:data-closed:opacity-0", dt = [
8
+ import { withLabels as rt } from "../../../lib/labels.js";
9
+ import { useDarkScope as st } from "../../../internal/popup.js";
10
+ import { useReducedMotion as nt } from "../../../internal/motion.js";
11
+ import { lockPage as ot } from "../../../internal/page-inert.js";
12
+ import { sheetDragOutcome as at, sheetReleaseVelocity as it, exceedsSheetTapSlop as ct } from "./sheet-drag.js";
13
+ import { titleSignature as ut } from "./sheet-title.js";
14
+ const lt = { close: "Close" }, dt = "rst:transition-transform rst:duration-(--roster-sheet-enter-duration) rst:ease-(--roster-sheet-enter-easing) rst:data-leave:duration-(--roster-sheet-leave-duration) rst:data-leave:ease-(--roster-sheet-leave-easing) rst:data-closed:translate-y-full", ft = "rst:transition-opacity rst:duration-(--roster-sheet-fade-duration) rst:ease-out rst:data-closed:opacity-0", pt = "rst:transition-opacity rst:duration-(--roster-sheet-enter-duration) rst:ease-out rst:data-leave:duration-(--roster-sheet-leave-duration) rst:data-closed:opacity-0", mt = "rst:transition-opacity rst:duration-(--roster-sheet-fade-duration) rst:ease-out rst:data-closed:opacity-0", ht = [
14
15
  "input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=range]):not([type=color]):not([type=file]):not([type=image])",
15
16
  "textarea",
16
17
  "select",
17
18
  "[contenteditable]:not([contenteditable=false])"
18
19
  ].join(",");
19
- function ft(r) {
20
+ function gt(r) {
20
21
  return r ? "current" in r ? r.current : r : null;
21
22
  }
22
- function pt({ target: r }) {
23
+ function yt({ target: r }) {
23
24
  const u = s.useRef(r), f = s.useRef(!1);
24
25
  return s.useEffect(() => {
25
26
  u.current = r;
26
27
  }), s.useEffect(() => (f.current = !1, () => {
27
28
  f.current = !0, queueMicrotask(() => {
28
29
  if (!f.current) return;
29
- const p = ft(u.current);
30
+ const p = gt(u.current);
30
31
  p?.isConnected && p.focus();
31
32
  });
32
33
  }), []), null;
33
34
  }
34
- function ht() {
35
+ function bt() {
35
36
  return /* @__PURE__ */ n(
36
37
  "svg",
37
38
  {
@@ -47,35 +48,36 @@ function ht() {
47
48
  }
48
49
  );
49
50
  }
50
- const Lt = ({
51
+ const St = ({
51
52
  isOpen: r,
52
53
  onClose: u,
53
54
  onAfterClose: f,
54
55
  title: p,
55
56
  hideTitle: z = !1,
56
- description: L,
57
+ description: C,
57
58
  actions: N,
58
59
  maxWidth: v = 560,
59
60
  initialFocus: x,
60
- returnFocus: Y,
61
- busy: h = !1,
61
+ returnFocus: B,
62
+ busy: m = !1,
62
63
  dragToDismiss: E = !0,
63
- contentKey: m,
64
- className: B,
65
- children: T
64
+ contentKey: h,
65
+ labels: Y,
66
+ className: T,
67
+ children: _
66
68
  }) => {
67
- const { ref: R, inDarkScope: _ } = tt(), D = et();
69
+ const q = rt(lt, Y), { ref: R, inDarkScope: $ } = st(), D = nt();
68
70
  s.useLayoutEffect(() => {
69
71
  if (r)
70
- return rt(R.current);
72
+ return ot(R.current);
71
73
  }, [r, R]);
72
- const i = s.useRef(null), I = s.useRef(null), w = s.useRef(null), k = s.useRef(null), C = s.useRef(null), S = s.useId(), g = at(p), P = s.useRef({ signature: g, contentKey: m, open: r, busy: h });
74
+ const i = s.useRef(null), I = s.useRef(null), w = s.useRef(null), k = s.useRef(null), L = s.useRef(null), S = s.useId(), g = ut(p), P = s.useRef({ signature: g, contentKey: h, open: r, busy: m });
73
75
  s.useEffect(() => {
74
76
  const t = P.current;
75
- if (P.current = { signature: g, contentKey: m, open: r, busy: h }, !t.open || !r) return;
76
- const e = t.contentKey !== m, o = t.signature !== g && !t.busy;
77
- !e && !o || (w.current?.focus(), C.current && (C.current.scrollTop = 0));
78
- }, [g, m, r, h]), s.useEffect(() => {
77
+ if (P.current = { signature: g, contentKey: h, open: r, busy: m }, !t.open || !r) return;
78
+ const e = t.contentKey !== h, o = t.signature !== g && !t.busy;
79
+ !e && !o || (w.current?.focus(), L.current && (L.current.scrollTop = 0));
80
+ }, [g, h, r, m]), s.useEffect(() => {
79
81
  if (!r) return;
80
82
  const t = requestAnimationFrame(() => {
81
83
  const e = i.current, o = document.activeElement;
@@ -89,7 +91,7 @@ const Lt = ({
89
91
  const t = window.visualViewport;
90
92
  if (!t) return;
91
93
  const e = () => {
92
- const o = document.activeElement, c = !!o && !!i.current?.contains(o) && o.matches(dt);
94
+ const o = document.activeElement, c = !!o && !!i.current?.contains(o) && o.matches(ht);
93
95
  A(c ? Math.round(t.height) : null);
94
96
  };
95
97
  return t.addEventListener("resize", e), document.addEventListener("focusin", e), document.addEventListener("focusout", e), () => {
@@ -111,7 +113,7 @@ const Lt = ({
111
113
  s.useEffect(() => {
112
114
  !r && a.current && (a.current = null, i.current && delete i.current.dataset.dragging), r && !a.current && b(0);
113
115
  }, [r]);
114
- const q = (t) => {
116
+ const U = (t) => {
115
117
  a.current || (y.current = !1, !(!E || !r) && (t.pointerType === "mouse" && (t.button !== 0 || !I.current?.contains(t.target)) || (a.current = {
116
118
  pointerId: t.pointerId,
117
119
  x0: t.clientX,
@@ -120,12 +122,12 @@ const Lt = ({
120
122
  phase: "pending",
121
123
  samples: [{ t: t.timeStamp, y: t.clientY }]
122
124
  })));
123
- }, $ = (t) => {
125
+ }, V = (t) => {
124
126
  const e = a.current;
125
127
  if (!e || t.pointerId !== e.pointerId) return;
126
128
  const o = t.clientX - e.x0, c = t.clientY - e.y0;
127
129
  if (e.phase === "pending") {
128
- if (!ot(o, c)) return;
130
+ if (!ct(o, c)) return;
129
131
  if (Math.abs(o) > Math.abs(c)) {
130
132
  e.phase = "ignored";
131
133
  return;
@@ -138,7 +140,7 @@ const Lt = ({
138
140
  i.current && (i.current.dataset.dragging = "");
139
141
  }
140
142
  e.phase === "dragging" && (e.dy = c, e.samples.push({ t: t.timeStamp, y: t.clientY }), e.samples.length > 32 && e.samples.shift(), b(Math.max(0, c)));
141
- }, U = (t) => {
143
+ }, X = (t) => {
142
144
  const e = a.current;
143
145
  if (!e || t.pointerId !== e.pointerId) return;
144
146
  if (e.phase !== "dragging") {
@@ -147,20 +149,20 @@ const Lt = ({
147
149
  }
148
150
  e.samples.push({ t: t.timeStamp, y: t.clientY });
149
151
  const o = t.clientY - e.y0, c = i.current?.getBoundingClientRect().height ?? 0;
150
- j(st(o, c, nt(e.samples)));
151
- }, V = (t) => {
152
+ j(at(o, c, it(e.samples)));
153
+ }, G = (t) => {
152
154
  const e = a.current;
153
155
  !e || t.pointerId !== e.pointerId || (e.phase === "dragging" ? j("stay") : a.current = null);
154
- }, X = (t) => {
156
+ }, K = (t) => {
155
157
  !y.current || t.detail === 0 || (y.current = !1, t.preventDefault(), t.stopPropagation());
156
- }, G = {
158
+ }, Q = {
157
159
  "--rst-sheet-max-width": typeof v == "number" ? `${v}px` : v,
158
160
  ...M !== null && { "--rst-sheet-keyboard-cap": `${M}px` }
159
161
  };
160
- return /* @__PURE__ */ l(K, { children: [
162
+ return /* @__PURE__ */ l(H, { children: [
161
163
  /* @__PURE__ */ n("span", { ref: R, hidden: !0 }),
162
164
  /* @__PURE__ */ l(
163
- H,
165
+ Z,
164
166
  {
165
167
  open: r,
166
168
  as: "div",
@@ -168,25 +170,25 @@ const Lt = ({
168
170
  initialFocus: x ?? k,
169
171
  className: d(
170
172
  "rst:font-ui rst:relative rst:z-50 rst:focus:outline-hidden",
171
- _ && "dark"
173
+ $ && "dark"
172
174
  ),
173
175
  children: [
174
176
  /* @__PURE__ */ n(
175
- J,
177
+ W,
176
178
  {
177
179
  transition: !0,
178
180
  "data-testid": "sheet-backdrop",
179
181
  className: d(
180
182
  "rst:fixed rst:inset-0 rst:bg-[var(--roster-backdrop,var(--roster-sheet-backdrop))]",
181
- D ? lt : ut
183
+ D ? mt : pt
182
184
  )
183
185
  }
184
186
  ),
185
- /* @__PURE__ */ n("div", { className: "rst:fixed rst:inset-0 rst:flex rst:items-end rst:justify-center", children: /* @__PURE__ */ n(O, { afterLeave: f, children: /* @__PURE__ */ l(
186
- Z,
187
+ /* @__PURE__ */ n("div", { className: "rst:fixed rst:inset-0 rst:flex rst:items-end rst:justify-center", children: /* @__PURE__ */ n(et, { afterLeave: f, children: /* @__PURE__ */ l(
188
+ O,
187
189
  {
188
190
  ref: i,
189
- style: G,
191
+ style: Q,
190
192
  "data-testid": "sheet-panel",
191
193
  className: d(
192
194
  /* 92dvh, or the visual viewport while the keyboard is up,
@@ -200,9 +202,9 @@ const Lt = ({
200
202
  "rst:[--roster-ring-offset:var(--roster-popover-bg)]",
201
203
  "rst:pb-[env(safe-area-inset-bottom)]",
202
204
  "rst:translate-y-[var(--rst-sheet-drag,0px)]",
203
- D ? ct : it,
205
+ D ? ft : dt,
204
206
  "rst:data-dragging:transition-none",
205
- B
207
+ T
206
208
  ),
207
209
  children: [
208
210
  /* @__PURE__ */ l(
@@ -210,11 +212,11 @@ const Lt = ({
210
212
  {
211
213
  "data-testid": "sheet-drag-zone",
212
214
  className: d("rst:shrink-0", E && "rst:touch-none"),
213
- onPointerDown: q,
214
- onPointerMove: $,
215
- onPointerUp: U,
216
- onPointerCancel: V,
217
- onClickCapture: X,
215
+ onPointerDown: U,
216
+ onPointerMove: V,
217
+ onPointerUp: X,
218
+ onPointerCancel: G,
219
+ onClickCapture: K,
218
220
  children: [
219
221
  /* @__PURE__ */ n(
220
222
  "div",
@@ -237,7 +239,7 @@ const Lt = ({
237
239
  /* @__PURE__ */ l("div", { className: "rst:-mt-3 rst:flex rst:items-start rst:gap-2 rst:px-5 rst:pb-4", children: [
238
240
  /* @__PURE__ */ l("div", { className: "rst:min-w-0 rst:flex-1 rst:pt-2", children: [
239
241
  /* @__PURE__ */ n(
240
- W,
242
+ tt,
241
243
  {
242
244
  as: "h2",
243
245
  id: S,
@@ -250,12 +252,12 @@ const Lt = ({
250
252
  children: p
251
253
  }
252
254
  ),
253
- L && /* @__PURE__ */ n(
254
- Q,
255
+ C && /* @__PURE__ */ n(
256
+ J,
255
257
  {
256
258
  as: "p",
257
259
  className: "rst:mt-1 rst:text-sm rst:text-inherit rst:opacity-75",
258
- children: L
260
+ children: C
259
261
  }
260
262
  )
261
263
  ] }),
@@ -268,9 +270,9 @@ const Lt = ({
268
270
  ref: k,
269
271
  type: "button",
270
272
  onClick: u,
271
- "aria-label": "Close",
273
+ "aria-label": q.close,
272
274
  className: "rst:inline-flex rst:size-11 rst:shrink-0 rst:-mr-2 rst:cursor-pointer rst:items-center rst:justify-center rst:rounded-md rst:bg-transparent rst:text-inherit rst:opacity-60 rst:transition-opacity rst:hover:opacity-100 rst:focus:outline-hidden rst:focus-visible:opacity-100 rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background",
273
- children: /* @__PURE__ */ n(ht, {})
275
+ children: /* @__PURE__ */ n(bt, {})
274
276
  }
275
277
  )
276
278
  ] })
@@ -280,17 +282,17 @@ const Lt = ({
280
282
  /* @__PURE__ */ n(
281
283
  "div",
282
284
  {
283
- ref: C,
285
+ ref: L,
284
286
  role: "region",
285
287
  "aria-labelledby": S,
286
288
  tabIndex: 0,
287
289
  "data-testid": "sheet-content",
288
- "aria-busy": h || void 0,
290
+ "aria-busy": m || void 0,
289
291
  className: "rst:min-h-0 rst:flex-1 rst:overflow-y-auto rst:overscroll-contain rst:px-5 rst:pb-4 rst:focus:outline-hidden rst:ring-inset rst:focus-visible:ring-2 rst:focus-visible:ring-ring",
290
- children: T
292
+ children: _
291
293
  }
292
294
  ),
293
- /* @__PURE__ */ n(pt, { target: Y })
295
+ /* @__PURE__ */ n(yt, { target: B })
294
296
  ]
295
297
  }
296
298
  ) }) })
@@ -300,5 +302,5 @@ const Lt = ({
300
302
  ] });
301
303
  };
302
304
  export {
303
- Lt as Sheet
305
+ St as Sheet
304
306
  };
package/dist/index.d.ts CHANGED
@@ -77,6 +77,7 @@ export * from './components/molecules/StepProgress/StepProgress';
77
77
  export * from './components/molecules/ErrorState/ErrorState';
78
78
  export * from './components/molecules/ErrorState/error-state-variants';
79
79
  export * from './components/molecules/MatchupCard/MatchupCard';
80
+ export * from './components/molecules/Menu/Menu';
80
81
  export * from './components/organisms/ActionBar/ActionBar';
81
82
  export * from './components/organisms/ActionBar/action-bar-variants';
82
83
  export * from './components/organisms/Countdown/Countdown';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function i(c,t){const e={...c};if(t)for(const o of Object.keys(t)){const n=t[o];n!==void 0&&(e[o]=n)}return e}exports.withLabels=i;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * A component's own words with an app's replacements laid over them. An entry
3
+ * passed as `undefined` (a translation catalog missing a key, say) keeps the
4
+ * default: a plain spread would let it through, leaving a control unnamed, or
5
+ * throwing where a function label is called.
6
+ */
7
+ export declare function withLabels<L extends object>(defaults: L, overrides?: Partial<L>): L;
@@ -0,0 +1,12 @@
1
+ function f(e, t) {
2
+ const n = { ...e };
3
+ if (t)
4
+ for (const o of Object.keys(t)) {
5
+ const c = t[o];
6
+ c !== void 0 && (n[o] = c);
7
+ }
8
+ return n;
9
+ }
10
+ export {
11
+ f as withLabels
12
+ };
package/dist/meta.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.7.0",
3
- "tests": 2112,
4
- "testFiles": 430
2
+ "version": "5.9.0",
3
+ "tests": 2220,
4
+ "testFiles": 455
5
5
  }
@@ -1,10 +1,10 @@
1
- import { evaluate as L, getSideAxis as T, getSide as j, clamp as $, getOppositePlacement as Z, getExpandedPlacements as ee, getOppositeAxisPlacements as te, getAlignmentSides as ne, getPaddingObject as G, rectToClientRect as X, getAlignment as z, min as Y, max as W, getAlignmentAxis as J, getOppositeAxis as K, getAxisLength as N, sides as ie } from "../../utils/dist/floating-ui.utils.js";
1
+ import { getSideAxis as T, getAlignmentAxis as G, getSide as j, getAlignment as z, evaluate as L, getPaddingObject as J, rectToClientRect as X, getOppositePlacement as Z, getExpandedPlacements as ee, getOppositeAxisPlacements as te, getAlignmentSides as ne, clamp as $, min as Y, max as W, getAxisLength as K, getOppositeAxis as N, sides as ie } from "../../utils/dist/floating-ui.utils.js";
2
2
  function I(t, e, d) {
3
3
  let {
4
4
  reference: a,
5
5
  floating: m
6
6
  } = t;
7
- const n = T(e), s = J(e), l = N(s), g = j(e), p = n === "y", r = a.x + a.width / 2 - m.width / 2, o = a.y + a.height / 2 - m.height / 2, f = a[l] / 2 - m[l] / 2;
7
+ const n = T(e), s = G(e), l = K(s), g = j(e), p = n === "y", r = a.x + a.width / 2 - m.width / 2, o = a.y + a.height / 2 - m.height / 2, f = a[l] / 2 - m[l] / 2;
8
8
  let i;
9
9
  switch (g) {
10
10
  case "top":
@@ -63,7 +63,7 @@ async function se(t, e) {
63
63
  elementContext: o = "floating",
64
64
  altBoundary: f = !1,
65
65
  padding: i = 0
66
- } = L(e, t), c = G(i), x = l[f ? o === "floating" ? "reference" : "floating" : o], v = X(await n.getClippingRect({
66
+ } = L(e, t), c = J(i), x = l[f ? o === "floating" ? "reference" : "floating" : o], v = X(await n.getClippingRect({
67
67
  element: (d = await (n.isElement == null ? void 0 : n.isElement(x))) == null || d ? x : x.contextElement || await (n.getDocumentElement == null ? void 0 : n.getDocumentElement(l.floating)),
68
68
  boundary: p,
69
69
  rootBoundary: r,
@@ -174,10 +174,10 @@ const le = async (t, e, d) => {
174
174
  } = L(t, e) || {};
175
175
  if (p == null)
176
176
  return {};
177
- const o = G(r), f = {
177
+ const o = J(r), f = {
178
178
  x: d,
179
179
  y: a
180
- }, i = J(m), c = N(i), u = await s.getDimensions(p), x = i === "y", v = x ? "top" : "left", y = x ? "bottom" : "right", w = x ? "clientHeight" : "clientWidth", h = n.reference[c] + n.reference[i] - f[i] - n.floating[c], A = f[i] - n.reference[i], b = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(p));
180
+ }, i = G(m), c = K(i), u = await s.getDimensions(p), x = i === "y", v = x ? "top" : "left", y = x ? "bottom" : "right", w = x ? "clientHeight" : "clientWidth", h = n.reference[c] + n.reference[i] - f[i] - n.floating[c], A = f[i] - n.reference[i], b = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(p));
181
181
  let C = b ? b[w] : 0;
182
182
  (!C || !await (s.isElement == null ? void 0 : s.isElement(b))) && (C = l.floating[w] || n.floating[c]);
183
183
  const M = h / 2 - A / 2, k = C / 2 - u[c] / 2 - 1, P = Y(o[v], k), H = Y(o[y], k), D = P, F = C - u[c] - H, O = C / 2 - u[c] / 2 + M, B = $(D, O, F), E = !g.arrow && z(m) != null && O !== B && n.reference[c] / 2 - (O < D ? P : H) - u[c] / 2 < 0, S = E ? O < D ? O - D : O - F : 0;
@@ -407,7 +407,7 @@ const me = function(t) {
407
407
  } = L(t, e), r = {
408
408
  x: d,
409
409
  y: a
410
- }, o = await n.detectOverflow(e, p), f = T(j(m)), i = K(f);
410
+ }, o = await n.detectOverflow(e, p), f = T(j(m)), i = N(f);
411
411
  let c = r[i], u = r[f];
412
412
  if (s) {
413
413
  const v = i === "y" ? "top" : "left", y = i === "y" ? "bottom" : "right", w = c + o[v], h = c - o[y];
@@ -452,7 +452,7 @@ const me = function(t) {
452
452
  } = L(t, e), r = {
453
453
  x: d,
454
454
  y: a
455
- }, o = T(m), f = K(o);
455
+ }, o = T(m), f = N(o);
456
456
  let i = r[f], c = r[o];
457
457
  const u = L(l, e), x = typeof u == "number" ? {
458
458
  mainAxis: u,
@@ -1,4 +1,4 @@
1
- import { computePosition as st, offset as rt, shift as ct, flip as lt, detectOverflow as ft, size as ut, hide as ht, arrow as at, limitShift as dt } from "../../core/dist/floating-ui.core.js";
1
+ import { computePosition as st, offset as rt, flip as ct, shift as lt, size as ft, limitShift as ut, hide as ht, detectOverflow as at, arrow as dt } from "../../core/dist/floating-ui.core.js";
2
2
  import { createCoords as y, round as D, max as E, min as M, rectToClientRect as J, floor as A } from "../../utils/dist/floating-ui.utils.js";
3
3
  import { isElement as x, getDocumentElement as R, getOverflowAncestors as N, getComputedStyle as b, isHTMLElement as O, getWindow as L, isTopLayer as V, getParentNode as S, isLastTraversableNode as z, isTableElement as gt, isContainingBlock as Q, getContainingBlock as pt, getNodeName as _, isOverflowElement as q, getNodeScroll as $, getFrameElement as U, isWebKit as Y } from "../../utils/dist/floating-ui.utils.dom.js";
4
4
  function Z(t) {
@@ -374,7 +374,7 @@ function $t(t, e, i, o) {
374
374
  }), h?.(), (g = a) == null || g.disconnect(), a = null, f && cancelAnimationFrame(w);
375
375
  };
376
376
  }
377
- const Ht = ft, It = rt, Mt = ct, Nt = lt, Vt = ut, _t = ht, qt = at, Xt = dt, kt = (t, e, i) => {
377
+ const Ht = at, It = rt, Mt = lt, Nt = ct, Vt = ft, _t = ht, qt = dt, Xt = ut, kt = (t, e, i) => {
378
378
  const o = /* @__PURE__ */ new Map(), n = {
379
379
  platform: Wt,
380
380
  ...i
@@ -1,4 +1,4 @@
1
- import { computePosition as I, offset as J, shift as K, flip as N, size as Q, hide as T, arrow as z, limitShift as X } from "../../dom/dist/floating-ui.dom.js";
1
+ import { computePosition as I, offset as J, flip as K, shift as N, size as Q, limitShift as T, hide as X, arrow as z } from "../../dom/dist/floating-ui.dom.js";
2
2
  import { autoUpdate as pe, detectOverflow as ge, platform as ye } from "../../dom/dist/floating-ui.dom.js";
3
3
  import * as o from "react";
4
4
  import { useLayoutEffect as Y } from "react";
@@ -175,19 +175,19 @@ const te = (e) => {
175
175
  ...J(e),
176
176
  options: [e, t]
177
177
  }), ie = (e, t) => ({
178
- ...K(e),
178
+ ...N(e),
179
179
  options: [e, t]
180
180
  }), se = (e, t) => ({
181
- ...X(e),
181
+ ...T(e),
182
182
  options: [e, t]
183
183
  }), ue = (e, t) => ({
184
- ...N(e),
184
+ ...K(e),
185
185
  options: [e, t]
186
186
  }), le = (e, t) => ({
187
187
  ...Q(e),
188
188
  options: [e, t]
189
189
  }), ce = (e, t) => ({
190
- ...T(e),
190
+ ...X(e),
191
191
  options: [e, t]
192
192
  }), ae = (e, t) => ({
193
193
  ...te(e),
@@ -1,4 +1,4 @@
1
- import p, { useContext as f, useRef as y, useMemo as h, createContext as R, Fragment as C, useState as x, useEffect as E } from "react";
1
+ import p, { Fragment as y, useRef as R, useContext as f, createContext as C, useMemo as h, useState as x, useEffect as E } from "react";
2
2
  import { createPortal as O } from "react-dom";
3
3
  import { useDisposables as S } from "../../hooks/use-disposables.js";
4
4
  import { useEvent as b } from "../../hooks/use-event.js";
@@ -25,8 +25,8 @@ function I(e) {
25
25
  t || n !== null && o(n.current);
26
26
  }, [n, o, t]), l;
27
27
  }
28
- let D = C, N = d(function(e, t) {
29
- let { ownerDocument: n = null, ...l } = e, o = y(null), r = c(_((s) => {
28
+ let D = y, N = d(function(e, t) {
29
+ let { ownerDocument: n = null, ...l } = e, o = R(null), r = c(_((s) => {
30
30
  o.current = s;
31
31
  }), t), u = G(o.current), i = n ?? u, a = I(i), v = f(m), g = S(), w = P();
32
32
  return T(() => {
@@ -40,14 +40,14 @@ function W(e, t) {
40
40
  let n = c(t), { enabled: l = !0, ownerDocument: o, ...r } = e, u = P();
41
41
  return l ? p.createElement(N, { ...r, ownerDocument: o, ref: n }) : u({ ourProps: { ref: n }, theirProps: r, slot: {}, defaultTag: D, name: "Portal" });
42
42
  }
43
- let B = C, $ = R(null);
43
+ let B = y, $ = C(null);
44
44
  function F(e, t) {
45
45
  let { target: n, ...l } = e, o = { ref: c(t) }, r = P();
46
46
  return p.createElement($.Provider, { value: n }, r({ ourProps: o, theirProps: l, defaultTag: B, name: "Popover.Group" }));
47
47
  }
48
- let m = R(null);
48
+ let m = C(null);
49
49
  function V() {
50
- let e = f(m), t = y([]), n = b((r) => (t.current.push(r), e && e.register(r), () => l(r))), l = b((r) => {
50
+ let e = f(m), t = R([]), n = b((r) => (t.current.push(r), e && e.register(r), () => l(r))), l = b((r) => {
51
51
  let u = t.current.indexOf(r);
52
52
  u !== -1 && t.current.splice(u, 1), e && e.unregister(r);
53
53
  }), o = h(() => ({ register: n, unregister: l, portals: t }), [n, l, t]);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("./disposables.cjs"),p=require("./dom.cjs"),w=require("./match.cjs"),s=require("./owner.cjs");let f=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),O=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var b=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(b||{}),F=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(F||{}),T=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(T||{});function E(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(f)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}function N(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(O)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var v=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(v||{});function y(e,t=0){var r;return e===((r=s.getOwnerDocument(e))==null?void 0:r.body)?!1:w.match(t,{0(){return e.matches(f)},1(){let o=e;for(;o!==null;){if(o.matches(f))return!0;o=o.parentElement}return!1}})}function _(e){I.disposables().nextFrame(()=>{let t=s.getActiveElement(e);t&&p.isHTMLorSVGElement(t)&&!y(t,0)&&A(e)})}var P=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(P||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function A(e){e?.focus({preventScroll:!0})}let L=["textarea","input"].join(",");function R(e){var t,r;return(r=(t=e?.matches)==null?void 0:t.call(e,L))!=null?r:!1}function h(e,t=r=>r){return e.slice().sort((r,o)=>{let i=t(r),a=t(o);if(i===null||a===null)return 0;let n=i.compareDocumentPosition(a);return n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function G(e,t,r=e===null?document.body:s.getRootNode(e)){return x(E(r),t,{relativeTo:e})}function x(e,t,{sorted:r=!0,relativeTo:o=null,skipElements:i=[]}={}){let a=Array.isArray(e)?e.length>0?s.getRootNode(e[0]):document:s.getRootNode(e),n=Array.isArray(e)?r?h(e):e:t&64?N(e):E(e);i.length>0&&n.length>1&&(n=n.filter(u=>!i.some(d=>d!=null&&"current"in d?d?.current===u:d===u))),o=o??a?.activeElement;let S=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),g=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,n.indexOf(o))-1;if(t&4)return Math.max(0,n.indexOf(o))+1;if(t&8)return n.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),M=t&32?{preventScroll:!0}:{},m=0,c=n.length,l;do{if(m>=c||m+c<=0)return 0;let u=g+m;if(t&16)u=(u+c)%c;else{if(u<0)return 3;if(u>=c)return 1}l=n[u],l?.focus(M),m+=S}while(l!==s.getActiveElement(l));return t&6&&R(l)&&l.select(),2}exports.Focus=b;exports.FocusResult=F;exports.FocusableMode=v;exports.focusElement=A;exports.focusFrom=G;exports.focusIn=x;exports.focusableSelector=f;exports.getAutoFocusableElements=N;exports.getFocusableElements=E;exports.isFocusableElement=y;exports.restoreFocusIfNecessary=_;exports.sortByDomNode=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./match.cjs"),d=require("./owner.cjs");let f=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),M=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var b=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(b||{}),F=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(F||{}),I=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(I||{});function E(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(f)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}function N(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(M)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var v=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(v||{});function w(e,t=0){var r;return e===((r=d.getOwnerDocument(e))==null?void 0:r.body)?!1:g.match(t,{0(){return e.matches(f)},1(){let o=e;for(;o!==null;){if(o.matches(f))return!0;o=o.parentElement}return!1}})}var O=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(O||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function p(e){e?.focus({preventScroll:!0})}let _=["textarea","input"].join(",");function P(e){var t,r;return(r=(t=e?.matches)==null?void 0:t.call(e,_))!=null?r:!1}function y(e,t=r=>r){return e.slice().sort((r,o)=>{let s=t(r),i=t(o);if(s===null||i===null)return 0;let u=s.compareDocumentPosition(i);return u&Node.DOCUMENT_POSITION_FOLLOWING?-1:u&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function T(e,t,r=e===null?document.body:d.getRootNode(e)){return h(E(r),t,{relativeTo:e})}function h(e,t,{sorted:r=!0,relativeTo:o=null,skipElements:s=[]}={}){let i=Array.isArray(e)?e.length>0?d.getRootNode(e[0]):document:d.getRootNode(e),u=Array.isArray(e)?r?y(e):e:t&64?N(e):E(e);s.length>0&&u.length>1&&(u=u.filter(n=>!s.some(c=>c!=null&&"current"in c?c?.current===n:c===n))),o=o??i?.activeElement;let A=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),x=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,u.indexOf(o))-1;if(t&4)return Math.max(0,u.indexOf(o))+1;if(t&8)return u.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),S=t&32?{preventScroll:!0}:{},m=0,a=u.length,l;do{if(m>=a||m+a<=0)return 0;let n=x+m;if(t&16)n=(n+a)%a;else{if(n<0)return 3;if(n>=a)return 1}l=u[n],l?.focus(S),m+=A}while(l!==d.getActiveElement(l));return t&6&&P(l)&&l.select(),2}exports.Focus=b;exports.FocusResult=F;exports.FocusableMode=v;exports.focusElement=p;exports.focusFrom=T;exports.focusIn=h;exports.focusableSelector=f;exports.getAutoFocusableElements=N;exports.getFocusableElements=E;exports.isFocusableElement=w;exports.sortByDomNode=y;