@blakesteve/roster 5.1.0 → 5.2.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 (30) hide show
  1. package/README.md +57 -3
  2. package/dist/components/atoms/Input/Input.cjs +1 -1
  3. package/dist/components/atoms/Input/Input.js +46 -41
  4. package/dist/components/atoms/Spinner/Spinner.cjs +1 -1
  5. package/dist/components/atoms/Spinner/Spinner.d.ts +6 -1
  6. package/dist/components/atoms/Spinner/Spinner.js +9 -8
  7. package/dist/components/molecules/Carousel/Carousel.cjs +1 -0
  8. package/dist/components/molecules/Carousel/Carousel.d.ts +146 -0
  9. package/dist/components/molecules/Carousel/Carousel.js +363 -0
  10. package/dist/components/molecules/Carousel/carousel-layout.cjs +1 -0
  11. package/dist/components/molecules/Carousel/carousel-layout.d.ts +23 -0
  12. package/dist/components/molecules/Carousel/carousel-layout.js +22 -0
  13. package/dist/components/molecules/Carousel/carousel-math.cjs +1 -0
  14. package/dist/components/molecules/Carousel/carousel-math.d.ts +60 -0
  15. package/dist/components/molecules/Carousel/carousel-math.js +58 -0
  16. package/dist/components/molecules/EmptyState/EmptyState.cjs +1 -1
  17. package/dist/components/molecules/EmptyState/EmptyState.d.ts +7 -1
  18. package/dist/components/molecules/EmptyState/EmptyState.js +18 -14
  19. package/dist/components/organisms/Sheet/Sheet.cjs +1 -1
  20. package/dist/components/organisms/Sheet/Sheet.d.ts +8 -5
  21. package/dist/components/organisms/Sheet/Sheet.js +122 -121
  22. package/dist/components/organisms/Sheet/sheet-title.cjs +1 -0
  23. package/dist/components/organisms/Sheet/sheet-title.d.ts +10 -0
  24. package/dist/components/organisms/Sheet/sheet-title.js +17 -0
  25. package/dist/index.d.ts +1 -0
  26. package/dist/meta.json +3 -3
  27. package/dist/roster.cjs +1 -1
  28. package/dist/roster.css +1 -1
  29. package/dist/roster.js +55 -53
  30. package/package.json +1 -1
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),K=require("react"),H=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),x=require("../../../node_modules/@headlessui/react/dist/components/dialog/dialog.cjs"),J=require("../../../node_modules/@headlessui/react/dist/components/transition/transition.cjs"),f=require("../../../lib/utils.cjs"),Q=require("../../../internal/popup.cjs"),Z=require("../../../internal/motion.cjs"),W=require("../../../internal/page-inert.cjs"),k=require("./sheet-drag.cjs");function O(r){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const u in r)if(u!=="default"){const i=Object.getOwnPropertyDescriptor(r,u);Object.defineProperty(c,u,i.get?i:{enumerable:!0,get:()=>r[u]})}}return c.default=r,Object.freeze(c)}const n=O(K),tt="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",et="rst:transition-opacity rst:duration-(--roster-sheet-fade-duration) rst:ease-out rst:data-closed:opacity-0",rt="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",st="rst:transition-opacity rst:duration-(--roster-sheet-fade-duration) rst:ease-out rst:data-closed:opacity-0",nt=["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 ot(r){return r?"current"in r?r.current:r:null}function at({target:r}){const c=n.useRef(r),u=n.useRef(!1);return n.useEffect(()=>{c.current=r}),n.useEffect(()=>(u.current=!1,()=>{u.current=!0,queueMicrotask(()=>{if(!u.current)return;const i=ot(c.current);i?.isConnected&&i.focus()})}),[]),null}function it(){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 ct=({isOpen:r,onClose:c,onAfterClose:u,title:i,hideTitle:F=!1,description:D,actions:N,maxWidth:y=560,initialFocus:b,returnFocus:_,busy:p=!1,dragToDismiss:v=!0,contentKey:h,className:T,children:z})=>{const{ref:j,inDarkScope:Y}=Q.useDarkScope(),S=Z.useReducedMotion();n.useLayoutEffect(()=>{if(r)return W.lockPage(j.current)},[r,j]);const l=n.useRef(null),C=n.useRef(null),I=n.useRef(null),R=n.useRef(null),E=n.useRef(null),L=n.useId(),P=n.useRef({title:i,contentKey:h,open:r,busy:p});n.useEffect(()=>{const t=P.current;if(P.current={title:i,contentKey:h,open:r,busy:p},!t.open||!r)return;const e=t.contentKey!==h,o=t.title!==i&&!t.busy;!e&&!o||(I.current?.focus(),E.current&&(E.current.scrollTop=0))},[i,h,r,p]),n.useEffect(()=>{if(!r)return;const t=requestAnimationFrame(()=>{const e=l.current,o=document.activeElement;!e||o&&e.contains(o)||(b?.current??R.current)?.focus()});return()=>cancelAnimationFrame(t)},[r,b]);const[w,q]=n.useState(null);n.useEffect(()=>{if(!r)return;const t=window.visualViewport;if(!t)return;const e=()=>{const o=document.activeElement,d=!!o&&!!l.current?.contains(o)&&o.matches(nt);q(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),q(null)}},[r]);const a=n.useRef(null),g=n.useRef(!1),M=n.useRef(r);n.useEffect(()=>{M.current=r},[r]);const m=t=>{l.current?.style.setProperty("--rst-sheet-drag",`${t}px`)},A=t=>{const e=l.current;a.current=null,e&&(delete e.dataset.dragging,t==="close"?(c(),requestAnimationFrame(()=>{M.current&&!a.current&&m(0)})):m(0))};n.useEffect(()=>{!r&&a.current&&(a.current=null,l.current&&delete l.current.dataset.dragging),r&&!a.current&&m(0)},[r]);const B=t=>{a.current||(g.current=!1,!(!v||!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}]})))},U=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(!k.exceedsSheetTapSlop(o,d))return;if(Math.abs(o)>Math.abs(d)){e.phase="ignored";return}e.phase="dragging",g.current=!0;try{t.currentTarget.setPointerCapture(t.pointerId)}catch{}l.current&&(l.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(),m(Math.max(0,d)))},V=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=l.current?.getBoundingClientRect().height??0;A(k.sheetDragOutcome(o,d,k.sheetReleaseVelocity(e.samples)))},X=t=>{const e=a.current;!e||t.pointerId!==e.pointerId||(e.phase==="dragging"?A("stay"):a.current=null)},$=t=>{!g.current||t.detail===0||(g.current=!1,t.preventDefault(),t.stopPropagation())},G={"--rst-sheet-max-width":typeof y=="number"?`${y}px`:y,...w!==null&&{"--rst-sheet-keyboard-cap":`${w}px`}};return s.jsxs(s.Fragment,{children:[s.jsx("span",{ref:j,hidden:!0}),s.jsxs(x.Dialog,{open:r,as:"div",onClose:c,initialFocus:b??R,className:f.cn("rst:font-ui rst:relative rst:z-50 rst:focus:outline-hidden",Y&&"dark"),children:[s.jsx(x.DialogBackdrop,{transition:!0,"data-testid":"sheet-backdrop",className:f.cn("rst:fixed rst:inset-0 rst:bg-(--roster-sheet-backdrop)",S?st:rt)}),s.jsx("div",{className:"rst:fixed rst:inset-0 rst:flex rst:items-end rst:justify-center",children:s.jsx(J.TransitionChild,{afterLeave:u,children:s.jsxs(x.DialogPanel,{ref:l,style:G,"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)]",S?et:tt,"rst:data-dragging:transition-none",T),children:[s.jsxs("div",{"data-testid":"sheet-drag-zone",className:f.cn("rst:shrink-0",v&&"rst:touch-none"),onPointerDown:B,onPointerMove:U,onPointerUp:V,onPointerCancel:X,onClickCapture:$,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",v&&"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:L,ref:I,tabIndex:-1,className:f.cn("rst:text-lg rst:font-semibold rst:text-inherit rst:focus:outline-hidden",F&&"rst:sr-only"),children:i}),D&&s.jsx(H.Description,{as:"p",className:"rst:mt-1 rst:text-sm rst:text-inherit rst:opacity-75",children:D})]}),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:R,type:"button",onClick:c,"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(it,{})})]})]}),s.jsx("div",{ref:E,role:"region","aria-labelledby":L,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:z}),s.jsx(at,{target:_})]})})})]})]})};exports.Sheet=ct;
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-(--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;
@@ -14,12 +14,15 @@ export interface SheetProps {
14
14
  * The sheet's accessible name, rendered as an `h2`. Required, because a
15
15
  * dialog without a name is announced as "dialog" and nothing else.
16
16
  *
17
- * Changing it while the sheet is open counts as a content swap: focus moves
18
- * to the new title so a screen reader announces it. Not while `busy`: a
19
- * title that changes during loading is a provisional one being refined, and
20
- * the reader keeps their place.
17
+ * A node rather than only a string, so a title can carry markup (a date in
18
+ * a `<time>`, a word in another style); the name is its text either way.
19
+ *
20
+ * Changing its text while the sheet is open counts as a content swap: focus
21
+ * moves to the new title so a screen reader announces it. Not while `busy`:
22
+ * a title that changes during loading is a provisional one being refined,
23
+ * and the reader keeps their place.
21
24
  */
22
- title: string;
25
+ title: React.ReactNode;
23
26
  /** Hides the title visually. It stays the accessible name. */
24
27
  hideTitle?: boolean;
25
28
  /** Wired to the dialog's `aria-describedby`. */
@@ -1,36 +1,37 @@
1
1
  "use client";
2
- import { jsxs as d, Fragment as G, jsx as n } from "react/jsx-runtime";
2
+ import { jsxs as l, Fragment as K, jsx as n } from "react/jsx-runtime";
3
3
  import * as s from "react";
4
- import { Description as K } from "../../../node_modules/@headlessui/react/dist/components/description/description.js";
5
- import { Dialog as Q, DialogBackdrop as H, DialogPanel as J, DialogTitle as Z } from "../../../node_modules/@headlessui/react/dist/components/dialog/dialog.js";
6
- import { TransitionChild as W } from "../../../node_modules/@headlessui/react/dist/components/transition/transition.js";
7
- import { cn as f } from "../../../lib/utils.js";
8
- import { useDarkScope as O } from "../../../internal/popup.js";
9
- import { useReducedMotion as tt } from "../../../internal/motion.js";
10
- import { lockPage as et } from "../../../internal/page-inert.js";
11
- import { sheetDragOutcome as rt, sheetReleaseVelocity as st, exceedsSheetTapSlop as nt } from "./sheet-drag.js";
12
- const ot = "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", at = "rst:transition-opacity rst:duration-(--roster-sheet-fade-duration) rst:ease-out rst:data-closed:opacity-0", it = "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", ct = "rst:transition-opacity rst:duration-(--roster-sheet-fade-duration) rst:ease-out rst:data-closed:opacity-0", ut = [
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";
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 = [
13
14
  "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])",
14
15
  "textarea",
15
16
  "select",
16
17
  "[contenteditable]:not([contenteditable=false])"
17
18
  ].join(",");
18
- function lt(r) {
19
+ function ft(r) {
19
20
  return r ? "current" in r ? r.current : r : null;
20
21
  }
21
- function dt({ target: r }) {
22
- const l = s.useRef(r), p = s.useRef(!1);
22
+ function pt({ target: r }) {
23
+ const u = s.useRef(r), f = s.useRef(!1);
23
24
  return s.useEffect(() => {
24
- l.current = r;
25
- }), s.useEffect(() => (p.current = !1, () => {
26
- p.current = !0, queueMicrotask(() => {
27
- if (!p.current) return;
28
- const c = lt(l.current);
29
- c?.isConnected && c.focus();
25
+ u.current = r;
26
+ }), s.useEffect(() => (f.current = !1, () => {
27
+ f.current = !0, queueMicrotask(() => {
28
+ if (!f.current) return;
29
+ const p = ft(u.current);
30
+ p?.isConnected && p.focus();
30
31
  });
31
32
  }), []), null;
32
33
  }
33
- function ft() {
34
+ function ht() {
34
35
  return /* @__PURE__ */ n(
35
36
  "svg",
36
37
  {
@@ -46,72 +47,72 @@ function ft() {
46
47
  }
47
48
  );
48
49
  }
49
- const Rt = ({
50
+ const Lt = ({
50
51
  isOpen: r,
51
- onClose: l,
52
- onAfterClose: p,
53
- title: c,
54
- hideTitle: j = !1,
55
- description: C,
56
- actions: L,
57
- maxWidth: b = 560,
58
- initialFocus: v,
59
- returnFocus: z,
52
+ onClose: u,
53
+ onAfterClose: f,
54
+ title: p,
55
+ hideTitle: z = !1,
56
+ description: L,
57
+ actions: N,
58
+ maxWidth: v = 560,
59
+ initialFocus: x,
60
+ returnFocus: Y,
60
61
  busy: h = !1,
61
- dragToDismiss: x = !0,
62
+ dragToDismiss: E = !0,
62
63
  contentKey: m,
63
- className: Y,
64
- children: B
64
+ className: B,
65
+ children: T
65
66
  }) => {
66
- const { ref: E, inDarkScope: T } = O(), N = tt();
67
+ const { ref: R, inDarkScope: _ } = tt(), D = et();
67
68
  s.useLayoutEffect(() => {
68
69
  if (r)
69
- return et(E.current);
70
- }, [r, E]);
71
- const i = s.useRef(null), D = s.useRef(null), I = s.useRef(null), R = s.useRef(null), k = s.useRef(null), w = s.useId(), P = s.useRef({ title: c, contentKey: m, open: r, busy: h });
70
+ return rt(R.current);
71
+ }, [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 });
72
73
  s.useEffect(() => {
73
74
  const t = P.current;
74
- if (P.current = { title: c, contentKey: m, open: r, busy: h }, !t.open || !r) return;
75
- const e = t.contentKey !== m, o = t.title !== c && !t.busy;
76
- !e && !o || (I.current?.focus(), k.current && (k.current.scrollTop = 0));
77
- }, [c, m, r, h]), s.useEffect(() => {
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(() => {
78
79
  if (!r) return;
79
80
  const t = requestAnimationFrame(() => {
80
81
  const e = i.current, o = document.activeElement;
81
- !e || o && e.contains(o) || (v?.current ?? R.current)?.focus();
82
+ !e || o && e.contains(o) || (x?.current ?? k.current)?.focus();
82
83
  });
83
84
  return () => cancelAnimationFrame(t);
84
- }, [r, v]);
85
- const [S, M] = s.useState(null);
85
+ }, [r, x]);
86
+ const [M, A] = s.useState(null);
86
87
  s.useEffect(() => {
87
88
  if (!r) return;
88
89
  const t = window.visualViewport;
89
90
  if (!t) return;
90
91
  const e = () => {
91
- const o = document.activeElement, u = !!o && !!i.current?.contains(o) && o.matches(ut);
92
- M(u ? Math.round(t.height) : null);
92
+ const o = document.activeElement, c = !!o && !!i.current?.contains(o) && o.matches(dt);
93
+ A(c ? Math.round(t.height) : null);
93
94
  };
94
95
  return t.addEventListener("resize", e), document.addEventListener("focusin", e), document.addEventListener("focusout", e), () => {
95
- t.removeEventListener("resize", e), document.removeEventListener("focusin", e), document.removeEventListener("focusout", e), M(null);
96
+ t.removeEventListener("resize", e), document.removeEventListener("focusin", e), document.removeEventListener("focusout", e), A(null);
96
97
  };
97
98
  }, [r]);
98
- const a = s.useRef(null), g = s.useRef(!1), A = s.useRef(r);
99
+ const a = s.useRef(null), y = s.useRef(!1), F = s.useRef(r);
99
100
  s.useEffect(() => {
100
- A.current = r;
101
+ F.current = r;
101
102
  }, [r]);
102
- const y = (t) => {
103
+ const b = (t) => {
103
104
  i.current?.style.setProperty("--rst-sheet-drag", `${t}px`);
104
- }, F = (t) => {
105
+ }, j = (t) => {
105
106
  const e = i.current;
106
- a.current = null, e && (delete e.dataset.dragging, t === "close" ? (l(), requestAnimationFrame(() => {
107
- A.current && !a.current && y(0);
108
- })) : y(0));
107
+ a.current = null, e && (delete e.dataset.dragging, t === "close" ? (u(), requestAnimationFrame(() => {
108
+ F.current && !a.current && b(0);
109
+ })) : b(0));
109
110
  };
110
111
  s.useEffect(() => {
111
- !r && a.current && (a.current = null, i.current && delete i.current.dataset.dragging), r && !a.current && y(0);
112
+ !r && a.current && (a.current = null, i.current && delete i.current.dataset.dragging), r && !a.current && b(0);
112
113
  }, [r]);
113
- const _ = (t) => {
114
- a.current || (g.current = !1, !(!x || !r) && (t.pointerType === "mouse" && (t.button !== 0 || !D.current?.contains(t.target)) || (a.current = {
114
+ const q = (t) => {
115
+ a.current || (y.current = !1, !(!E || !r) && (t.pointerType === "mouse" && (t.button !== 0 || !I.current?.contains(t.target)) || (a.current = {
115
116
  pointerId: t.pointerId,
116
117
  x0: t.clientX,
117
118
  y0: t.clientY,
@@ -119,25 +120,25 @@ const Rt = ({
119
120
  phase: "pending",
120
121
  samples: [{ t: t.timeStamp, y: t.clientY }]
121
122
  })));
122
- }, q = (t) => {
123
+ }, $ = (t) => {
123
124
  const e = a.current;
124
125
  if (!e || t.pointerId !== e.pointerId) return;
125
- const o = t.clientX - e.x0, u = t.clientY - e.y0;
126
+ const o = t.clientX - e.x0, c = t.clientY - e.y0;
126
127
  if (e.phase === "pending") {
127
- if (!nt(o, u)) return;
128
- if (Math.abs(o) > Math.abs(u)) {
128
+ if (!ot(o, c)) return;
129
+ if (Math.abs(o) > Math.abs(c)) {
129
130
  e.phase = "ignored";
130
131
  return;
131
132
  }
132
- e.phase = "dragging", g.current = !0;
133
+ e.phase = "dragging", y.current = !0;
133
134
  try {
134
135
  t.currentTarget.setPointerCapture(t.pointerId);
135
136
  } catch {
136
137
  }
137
138
  i.current && (i.current.dataset.dragging = "");
138
139
  }
139
- e.phase === "dragging" && (e.dy = u, e.samples.push({ t: t.timeStamp, y: t.clientY }), e.samples.length > 32 && e.samples.shift(), y(Math.max(0, u)));
140
- }, $ = (t) => {
140
+ 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) => {
141
142
  const e = a.current;
142
143
  if (!e || t.pointerId !== e.pointerId) return;
143
144
  if (e.phase !== "dragging") {
@@ -145,49 +146,49 @@ const Rt = ({
145
146
  return;
146
147
  }
147
148
  e.samples.push({ t: t.timeStamp, y: t.clientY });
148
- const o = t.clientY - e.y0, u = i.current?.getBoundingClientRect().height ?? 0;
149
- F(rt(o, u, st(e.samples)));
150
- }, U = (t) => {
151
- const e = a.current;
152
- !e || t.pointerId !== e.pointerId || (e.phase === "dragging" ? F("stay") : a.current = null);
149
+ const o = t.clientY - e.y0, c = i.current?.getBoundingClientRect().height ?? 0;
150
+ j(st(o, c, nt(e.samples)));
153
151
  }, V = (t) => {
154
- !g.current || t.detail === 0 || (g.current = !1, t.preventDefault(), t.stopPropagation());
155
- }, X = {
156
- "--rst-sheet-max-width": typeof b == "number" ? `${b}px` : b,
157
- ...S !== null && { "--rst-sheet-keyboard-cap": `${S}px` }
152
+ const e = a.current;
153
+ !e || t.pointerId !== e.pointerId || (e.phase === "dragging" ? j("stay") : a.current = null);
154
+ }, X = (t) => {
155
+ !y.current || t.detail === 0 || (y.current = !1, t.preventDefault(), t.stopPropagation());
156
+ }, G = {
157
+ "--rst-sheet-max-width": typeof v == "number" ? `${v}px` : v,
158
+ ...M !== null && { "--rst-sheet-keyboard-cap": `${M}px` }
158
159
  };
159
- return /* @__PURE__ */ d(G, { children: [
160
- /* @__PURE__ */ n("span", { ref: E, hidden: !0 }),
161
- /* @__PURE__ */ d(
162
- Q,
160
+ return /* @__PURE__ */ l(K, { children: [
161
+ /* @__PURE__ */ n("span", { ref: R, hidden: !0 }),
162
+ /* @__PURE__ */ l(
163
+ H,
163
164
  {
164
165
  open: r,
165
166
  as: "div",
166
- onClose: l,
167
- initialFocus: v ?? R,
168
- className: f(
167
+ onClose: u,
168
+ initialFocus: x ?? k,
169
+ className: d(
169
170
  "rst:font-ui rst:relative rst:z-50 rst:focus:outline-hidden",
170
- T && "dark"
171
+ _ && "dark"
171
172
  ),
172
173
  children: [
173
174
  /* @__PURE__ */ n(
174
- H,
175
+ J,
175
176
  {
176
177
  transition: !0,
177
178
  "data-testid": "sheet-backdrop",
178
- className: f(
179
+ className: d(
179
180
  "rst:fixed rst:inset-0 rst:bg-(--roster-sheet-backdrop)",
180
- N ? ct : it
181
+ D ? lt : ut
181
182
  )
182
183
  }
183
184
  ),
184
- /* @__PURE__ */ n("div", { className: "rst:fixed rst:inset-0 rst:flex rst:items-end rst:justify-center", children: /* @__PURE__ */ n(W, { afterLeave: p, children: /* @__PURE__ */ d(
185
- J,
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,
186
187
  {
187
188
  ref: i,
188
- style: X,
189
+ style: G,
189
190
  "data-testid": "sheet-panel",
190
- className: f(
191
+ className: d(
191
192
  /* 92dvh, or the visual viewport while the keyboard is up,
192
193
  whichever is shorter. */
193
194
  "rst:relative rst:flex rst:max-h-[min(92dvh,var(--rst-sheet-keyboard-cap,92dvh))] rst:w-full rst:flex-col",
@@ -199,77 +200,77 @@ const Rt = ({
199
200
  "rst:[--roster-ring-offset:var(--roster-popover-bg)]",
200
201
  "rst:pb-[env(safe-area-inset-bottom)]",
201
202
  "rst:translate-y-[var(--rst-sheet-drag,0px)]",
202
- N ? at : ot,
203
+ D ? ct : it,
203
204
  "rst:data-dragging:transition-none",
204
- Y
205
+ B
205
206
  ),
206
207
  children: [
207
- /* @__PURE__ */ d(
208
+ /* @__PURE__ */ l(
208
209
  "div",
209
210
  {
210
211
  "data-testid": "sheet-drag-zone",
211
- className: f("rst:shrink-0", x && "rst:touch-none"),
212
- onPointerDown: _,
213
- onPointerMove: q,
214
- onPointerUp: $,
215
- onPointerCancel: U,
216
- onClickCapture: V,
212
+ className: d("rst:shrink-0", E && "rst:touch-none"),
213
+ onPointerDown: q,
214
+ onPointerMove: $,
215
+ onPointerUp: U,
216
+ onPointerCancel: V,
217
+ onClickCapture: X,
217
218
  children: [
218
219
  /* @__PURE__ */ n(
219
220
  "div",
220
221
  {
221
- ref: D,
222
+ ref: I,
222
223
  "aria-hidden": "true",
223
224
  "data-testid": "sheet-handle",
224
- className: f(
225
+ className: d(
225
226
  /* The grip sits near the top edge, where a sheet's grabber
226
227
  is expected, inside a 44px strip. The header below pulls
227
228
  up over the strip's lower part, so a touch there drags
228
229
  too (the header is a drag zone) and a mouse drags from
229
230
  the 32px above it, the full width of the sheet. */
230
231
  "rst:flex rst:h-11 rst:items-start rst:justify-center rst:pt-2",
231
- x && "rst:cursor-grab rst:active:cursor-grabbing"
232
+ E && "rst:cursor-grab rst:active:cursor-grabbing"
232
233
  ),
233
234
  children: /* @__PURE__ */ n("span", { className: "rst:h-1 rst:w-10 rst:rounded-full rst:bg-current rst:opacity-30" })
234
235
  }
235
236
  ),
236
- /* @__PURE__ */ d("div", { className: "rst:-mt-3 rst:flex rst:items-start rst:gap-2 rst:px-5 rst:pb-4", children: [
237
- /* @__PURE__ */ d("div", { className: "rst:min-w-0 rst:flex-1 rst:pt-2", children: [
237
+ /* @__PURE__ */ l("div", { className: "rst:-mt-3 rst:flex rst:items-start rst:gap-2 rst:px-5 rst:pb-4", children: [
238
+ /* @__PURE__ */ l("div", { className: "rst:min-w-0 rst:flex-1 rst:pt-2", children: [
238
239
  /* @__PURE__ */ n(
239
- Z,
240
+ W,
240
241
  {
241
242
  as: "h2",
242
- id: w,
243
- ref: I,
243
+ id: S,
244
+ ref: w,
244
245
  tabIndex: -1,
245
- className: f(
246
+ className: d(
246
247
  "rst:text-lg rst:font-semibold rst:text-inherit rst:focus:outline-hidden",
247
- j && "rst:sr-only"
248
+ z && "rst:sr-only"
248
249
  ),
249
- children: c
250
+ children: p
250
251
  }
251
252
  ),
252
- C && /* @__PURE__ */ n(
253
- K,
253
+ L && /* @__PURE__ */ n(
254
+ Q,
254
255
  {
255
256
  as: "p",
256
257
  className: "rst:mt-1 rst:text-sm rst:text-inherit rst:opacity-75",
257
- children: C
258
+ children: L
258
259
  }
259
260
  )
260
261
  ] }),
261
- L && /* 44px tall like the close button, so actions of any
262
+ N && /* 44px tall like the close button, so actions of any
262
263
  height center on the same line as it. */
263
- /* @__PURE__ */ n("div", { className: "rst:flex rst:h-11 rst:shrink-0 rst:items-center rst:gap-1", children: L }),
264
+ /* @__PURE__ */ n("div", { className: "rst:flex rst:h-11 rst:shrink-0 rst:items-center rst:gap-1", children: N }),
264
265
  /* @__PURE__ */ n(
265
266
  "button",
266
267
  {
267
- ref: R,
268
+ ref: k,
268
269
  type: "button",
269
- onClick: l,
270
+ onClick: u,
270
271
  "aria-label": "Close",
271
272
  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",
272
- children: /* @__PURE__ */ n(ft, {})
273
+ children: /* @__PURE__ */ n(ht, {})
273
274
  }
274
275
  )
275
276
  ] })
@@ -279,17 +280,17 @@ const Rt = ({
279
280
  /* @__PURE__ */ n(
280
281
  "div",
281
282
  {
282
- ref: k,
283
+ ref: C,
283
284
  role: "region",
284
- "aria-labelledby": w,
285
+ "aria-labelledby": S,
285
286
  tabIndex: 0,
286
287
  "data-testid": "sheet-content",
287
288
  "aria-busy": h || void 0,
288
289
  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",
289
- children: B
290
+ children: T
290
291
  }
291
292
  ),
292
- /* @__PURE__ */ n(dt, { target: z })
293
+ /* @__PURE__ */ n(pt, { target: Y })
293
294
  ]
294
295
  }
295
296
  ) }) })
@@ -299,5 +300,5 @@ const Rt = ({
299
300
  ] });
300
301
  };
301
302
  export {
302
- Rt as Sheet
303
+ Lt as Sheet
303
304
  };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react");function l(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const s=l(c);function a(t){if(t==null||typeof t=="boolean")return"";if(typeof t=="string"||typeof t=="number"||typeof t=="bigint")return String(t);if(Array.isArray(t))return t.map(a).join("");if(s.isValidElement(t)){const{children:e,...r}=t.props;if(typeof t.type=="string")return a(e);const n=t.type,u=Object.entries(r).filter(([i])=>i!=="className"&&i!=="style").map(([i,o])=>o instanceof Date?`${i}=${o.toISOString()}`:["string","number","boolean","bigint"].includes(typeof o)?`${i}=${String(o)}`:null).filter(Boolean).join(",");return`<${n.displayName??n.name??"?"}${u?` ${u}`:""}>`+a(e)}return""}exports.titleSignature=a;
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ /**
3
+ * What a title says, for telling whether it changed: its text, and for a
4
+ * component inside it, the component's name and its plain props (a date
5
+ * included), so `<NightDate date={d} />` says something even with no
6
+ * children. Styling is not content: `className` and `style` never count, on a
7
+ * component or an element. A component whose words change with nothing in its
8
+ * props (it reads a context, say) is invisible here; pass `contentKey`.
9
+ */
10
+ export declare function titleSignature(node: React.ReactNode): string;
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import * as a from "react";
3
+ function n(t) {
4
+ if (t == null || typeof t == "boolean") return "";
5
+ if (typeof t == "string" || typeof t == "number" || typeof t == "bigint") return String(t);
6
+ if (Array.isArray(t)) return t.map(n).join("");
7
+ if (a.isValidElement(t)) {
8
+ const { children: e, ...p } = t.props;
9
+ if (typeof t.type == "string") return n(e);
10
+ const s = t.type, f = Object.entries(p).filter(([r]) => r !== "className" && r !== "style").map(([r, i]) => i instanceof Date ? `${r}=${i.toISOString()}` : ["string", "number", "boolean", "bigint"].includes(typeof i) ? `${r}=${String(i)}` : null).filter(Boolean).join(",");
11
+ return `<${s.displayName ?? s.name ?? "?"}${f ? ` ${f}` : ""}>` + n(e);
12
+ }
13
+ return "";
14
+ }
15
+ export {
16
+ n as titleSignature
17
+ };
package/dist/index.d.ts CHANGED
@@ -60,6 +60,7 @@ export * from './components/molecules/Breadcrumbs/breadcrumb-variants';
60
60
  export * from './components/molecules/LiquidTabs/LiquidTabs';
61
61
  export * from './components/molecules/LiquidTabs/LiquidNav';
62
62
  export * from './components/molecules/LiquidTabs/liquid-tab-id';
63
+ export * from './components/molecules/Carousel/Carousel';
63
64
  export * from './components/molecules/CallToAction/CallToAction';
64
65
  export * from './components/molecules/CallToAction/call-to-action-variants';
65
66
  export * from './components/molecules/EmptyState/EmptyState';
package/dist/meta.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.1.0",
3
- "tests": 1684,
4
- "testFiles": 172
2
+ "version": "5.2.0",
3
+ "tests": 1759,
4
+ "testFiles": 236
5
5
  }
package/dist/roster.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const V=require("./components/atoms/Avatar/Avatar.cjs"),q=require("./components/atoms/Avatar/avatar-variants.cjs"),b=require("./components/atoms/Badge/Badge.cjs"),d=require("./components/atoms/Badge/badge-variants.cjs"),p=require("./components/atoms/Button/Button.cjs"),T=require("./components/atoms/Button/button-variants.cjs"),C=require("./components/atoms/Card/Card.cjs"),S=require("./components/atoms/Card/card-variants.cjs"),h=require("./components/atoms/Checkbox/Checkbox.cjs"),g=require("./components/atoms/Checkbox/checkbox-variants.cjs"),w=require("./components/atoms/Disclosure/Disclosure.cjs"),t=require("./components/atoms/Disclosure/disclosure-variants.cjs"),m=require("./components/atoms/Input/Input.cjs"),i=require("./components/atoms/Input/input-variants.cjs"),x=require("./components/atoms/Link/Link.cjs"),k=require("./components/atoms/Link/link-variants.cjs"),v=require("./components/atoms/PasswordInput/PasswordInput.cjs"),A=require("./components/atoms/Combobox/Combobox.cjs"),B=require("./components/atoms/Chip/Chip.cjs"),y=require("./components/atoms/Chip/chip-variants.cjs"),D=require("./components/atoms/Pill/Pill.cjs"),n=require("./components/atoms/Pill/pill-variants.cjs"),L=require("./components/atoms/Eyebrow/Eyebrow.cjs"),I=require("./components/atoms/Eyebrow/eyebrow-variants.cjs"),E=require("./components/atoms/InlineCode/InlineCode.cjs"),O=require("./components/atoms/InlineCode/inline-code-variants.cjs"),G=require("./components/atoms/LabeledDivider/LabeledDivider.cjs"),P=require("./components/atoms/Stat/Stat.cjs"),N=require("./components/atoms/Stat/stat-variants.cjs"),M=require("./components/atoms/ThemeToggle/ThemeToggle.cjs"),R=require("./components/atoms/MultiSelect/MultiSelect.cjs"),H=require("./components/atoms/Select/Select.cjs"),o=require("./components/atoms/Select/select-variants.cjs"),F=require("./components/atoms/Spinner/Spinner.cjs"),K=require("./components/atoms/Switch/Switch.cjs"),s=require("./components/atoms/Switch/switch-variants.cjs"),_=require("./components/atoms/Textarea/Textarea.cjs"),W=require("./components/atoms/Textarea/textarea-variants.cjs"),X=require("./components/atoms/AvatarStrip/AvatarStrip.cjs"),f=require("./components/atoms/Tooltip/Tooltip.cjs"),j=require("./components/atoms/CollapsibleSection/CollapsibleSection.cjs"),z=require("./components/atoms/SegmentBar/SegmentBar.cjs"),J=require("./components/molecules/Toast/Toast.cjs"),Q=require("./components/molecules/Toast/toast-variants.cjs"),U=require("./components/molecules/Toast/Toaster.cjs"),c=require("./components/molecules/Toast/toast-api.cjs"),Y=require("./components/molecules/Alert/Alert.cjs"),Z=require("./components/molecules/Alert/alert-variants.cjs"),$=require("./components/molecules/Accordion/Accordion.cjs"),rr=require("./components/molecules/DescriptionList/DescriptionList.cjs"),ar=require("./components/molecules/DescriptionList/description-list-variants.cjs"),er=require("./components/molecules/Pullquote/Pullquote.cjs"),tr=require("./components/molecules/Pullquote/pullquote-variants.cjs"),ir=require("./components/molecules/CheckboxGroup/CheckboxGroup.cjs"),u=require("./components/molecules/CheckboxGroup/checkbox-group-variants.cjs"),nr=require("./components/molecules/RadioGroup/RadioGroup.cjs"),e=require("./components/molecules/RadioGroup/radio-group-variants.cjs"),or=require("./components/molecules/Breadcrumbs/Breadcrumbs.cjs"),sr=require("./components/molecules/Breadcrumbs/breadcrumb-variants.cjs"),cr=require("./components/molecules/LiquidTabs/LiquidTabs.cjs"),ur=require("./components/molecules/LiquidTabs/LiquidNav.cjs"),lr=require("./components/molecules/LiquidTabs/liquid-tab-id.cjs"),Vr=require("./components/molecules/CallToAction/CallToAction.cjs"),qr=require("./components/molecules/CallToAction/call-to-action-variants.cjs"),br=require("./components/molecules/EmptyState/EmptyState.cjs"),dr=require("./components/molecules/EmptyState/empty-state-variants.cjs"),pr=require("./components/molecules/ErrorState/ErrorState.cjs"),Tr=require("./components/molecules/ErrorState/error-state-variants.cjs"),Cr=require("./components/molecules/MatchupCard/MatchupCard.cjs"),Sr=require("./components/organisms/ActionBar/ActionBar.cjs"),hr=require("./components/organisms/ActionBar/action-bar-variants.cjs"),gr=require("./components/organisms/Countdown/Countdown.cjs"),wr=require("./components/organisms/Dialog/Dialog.cjs"),mr=require("./components/organisms/Footer/Footer.cjs"),xr=require("./components/organisms/Navbar/Navbar.cjs"),kr=require("./components/organisms/Navbar/navbar-variants.cjs"),vr=require("./components/organisms/Sheet/Sheet.cjs"),r=require("./components/organisms/Table/Table.cjs"),a=require("./components/organisms/Table/table-variants.cjs"),Ar=require("./hooks/useCountdown.cjs"),l=require("./hooks/useKeySequence.cjs"),Br=require("./lib/utils.cjs");exports.Avatar=V.Avatar;exports.avatarVariants=q.avatarVariants;exports.Badge=b.Badge;exports.badgeVariants=d.badgeVariants;exports.Button=p.Button;exports.buttonVariants=T.buttonVariants;exports.Card=C.Card;exports.cardVariants=S.cardVariants;exports.Checkbox=h.Checkbox;exports.checkboxVariants=g.checkboxVariants;exports.Disclosure=w.Disclosure;exports.disclosureContentVariants=t.disclosureContentVariants;exports.disclosureTriggerVariants=t.disclosureTriggerVariants;exports.Input=m.Input;exports.iconVariants=i.iconVariants;exports.inputVariants=i.inputVariants;exports.Link=x.Link;exports.linkVariants=k.linkVariants;exports.PasswordInput=v.PasswordInput;exports.Combobox=A.Combobox;exports.Chip=B.Chip;exports.chipVariants=y.chipVariants;exports.Pill=D.Pill;exports.pillDotVariants=n.pillDotVariants;exports.pillVariants=n.pillVariants;exports.Eyebrow=L.Eyebrow;exports.eyebrowVariants=I.eyebrowVariants;exports.InlineCode=E.InlineCode;exports.inlineCodeVariants=O.inlineCodeVariants;exports.LabeledDivider=G.LabeledDivider;exports.Stat=P.Stat;exports.statValueVariants=N.statValueVariants;exports.ThemeToggle=M.ThemeToggle;exports.MultiSelect=R.MultiSelect;exports.Select=H.Select;exports.selectOptionVariants=o.selectOptionVariants;exports.selectTriggerVariants=o.selectTriggerVariants;exports.Spinner=F.Spinner;exports.Switch=K.Switch;exports.switchThumbVariants=s.switchThumbVariants;exports.switchTrackVariants=s.switchTrackVariants;exports.Textarea=_.Textarea;exports.textareaVariants=W.textareaVariants;exports.AvatarStrip=X.AvatarStrip;exports.Tooltip=f.Tooltip;exports.CollapsibleSection=j.CollapsibleSection;exports.SegmentBar=z.SegmentBar;exports.Toast=J.Toast;exports.toastVariants=Q.toastVariants;exports.Toaster=U.Toaster;exports.TONE_PREFIX=c.TONE_PREFIX;exports.toast=c.toast;exports.Alert=Y.Alert;exports.alertVariants=Z.alertVariants;exports.Accordion=$.Accordion;exports.DescriptionList=rr.DescriptionList;exports.descriptionListVariants=ar.descriptionListVariants;exports.Pullquote=er.Pullquote;exports.pullquoteVariants=tr.pullquoteVariants;exports.CheckboxGroup=ir.CheckboxGroup;exports.checkboxGroupOptionsVariants=u.checkboxGroupOptionsVariants;exports.checkboxGroupPanelVariants=u.checkboxGroupPanelVariants;exports.RadioGroup=nr.RadioGroup;exports.radioDotVariants=e.radioDotVariants;exports.radioGroupOptionsVariants=e.radioGroupOptionsVariants;exports.radioOptionVariants=e.radioOptionVariants;exports.radioVariants=e.radioVariants;exports.Breadcrumbs=or.Breadcrumbs;exports.breadcrumbVariants=sr.breadcrumbVariants;exports.LiquidTabs=cr.LiquidTabs;exports.LiquidNav=ur.LiquidNav;exports.liquidTabId=lr.liquidTabId;exports.CallToAction=Vr.CallToAction;exports.ctaVariants=qr.ctaVariants;exports.EmptyState=br.EmptyState;exports.emptyStateVariants=dr.emptyStateVariants;exports.ErrorState=pr.ErrorState;exports.errorStateVariants=Tr.errorStateVariants;exports.MatchupCard=Cr.MatchupCard;exports.ActionBar=Sr.ActionBar;exports.actionBarVariants=hr.actionBarVariants;exports.Countdown=gr.Countdown;exports.Dialog=wr.Dialog;exports.Footer=mr.Footer;exports.Navbar=xr.Navbar;exports.navbarVariants=kr.navbarVariants;exports.Sheet=vr.Sheet;exports.Table=r.Table;exports.TableBody=r.TableBody;exports.TableCaption=r.TableCaption;exports.TableCell=r.TableCell;exports.TableFooter=r.TableFooter;exports.TableHead=r.TableHead;exports.TableHeader=r.TableHeader;exports.TableRow=r.TableRow;exports.tableCellVariants=a.tableCellVariants;exports.tableHeadVariants=a.tableHeadVariants;exports.tableHeaderVariants=a.tableHeaderVariants;exports.tableRowVariants=a.tableRowVariants;exports.tableVariants=a.tableVariants;exports.tableWrapperVariants=a.tableWrapperVariants;exports.useCountdown=Ar.useCountdown;exports.KONAMI_CODE=l.KONAMI_CODE;exports.useKeySequence=l.useKeySequence;exports.cn=Br.cn;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const V=require("./components/atoms/Avatar/Avatar.cjs"),q=require("./components/atoms/Avatar/avatar-variants.cjs"),b=require("./components/atoms/Badge/Badge.cjs"),d=require("./components/atoms/Badge/badge-variants.cjs"),p=require("./components/atoms/Button/Button.cjs"),T=require("./components/atoms/Button/button-variants.cjs"),C=require("./components/atoms/Card/Card.cjs"),S=require("./components/atoms/Card/card-variants.cjs"),h=require("./components/atoms/Checkbox/Checkbox.cjs"),g=require("./components/atoms/Checkbox/checkbox-variants.cjs"),w=require("./components/atoms/Disclosure/Disclosure.cjs"),t=require("./components/atoms/Disclosure/disclosure-variants.cjs"),m=require("./components/atoms/Input/Input.cjs"),i=require("./components/atoms/Input/input-variants.cjs"),x=require("./components/atoms/Link/Link.cjs"),k=require("./components/atoms/Link/link-variants.cjs"),v=require("./components/atoms/PasswordInput/PasswordInput.cjs"),A=require("./components/atoms/Combobox/Combobox.cjs"),B=require("./components/atoms/Chip/Chip.cjs"),y=require("./components/atoms/Chip/chip-variants.cjs"),D=require("./components/atoms/Pill/Pill.cjs"),n=require("./components/atoms/Pill/pill-variants.cjs"),L=require("./components/atoms/Eyebrow/Eyebrow.cjs"),I=require("./components/atoms/Eyebrow/eyebrow-variants.cjs"),E=require("./components/atoms/InlineCode/InlineCode.cjs"),O=require("./components/atoms/InlineCode/inline-code-variants.cjs"),G=require("./components/atoms/LabeledDivider/LabeledDivider.cjs"),P=require("./components/atoms/Stat/Stat.cjs"),N=require("./components/atoms/Stat/stat-variants.cjs"),M=require("./components/atoms/ThemeToggle/ThemeToggle.cjs"),R=require("./components/atoms/MultiSelect/MultiSelect.cjs"),H=require("./components/atoms/Select/Select.cjs"),o=require("./components/atoms/Select/select-variants.cjs"),F=require("./components/atoms/Spinner/Spinner.cjs"),K=require("./components/atoms/Switch/Switch.cjs"),s=require("./components/atoms/Switch/switch-variants.cjs"),_=require("./components/atoms/Textarea/Textarea.cjs"),W=require("./components/atoms/Textarea/textarea-variants.cjs"),X=require("./components/atoms/AvatarStrip/AvatarStrip.cjs"),f=require("./components/atoms/Tooltip/Tooltip.cjs"),j=require("./components/atoms/CollapsibleSection/CollapsibleSection.cjs"),z=require("./components/atoms/SegmentBar/SegmentBar.cjs"),J=require("./components/molecules/Toast/Toast.cjs"),Q=require("./components/molecules/Toast/toast-variants.cjs"),U=require("./components/molecules/Toast/Toaster.cjs"),c=require("./components/molecules/Toast/toast-api.cjs"),Y=require("./components/molecules/Alert/Alert.cjs"),Z=require("./components/molecules/Alert/alert-variants.cjs"),$=require("./components/molecules/Accordion/Accordion.cjs"),rr=require("./components/molecules/DescriptionList/DescriptionList.cjs"),ar=require("./components/molecules/DescriptionList/description-list-variants.cjs"),er=require("./components/molecules/Pullquote/Pullquote.cjs"),tr=require("./components/molecules/Pullquote/pullquote-variants.cjs"),ir=require("./components/molecules/CheckboxGroup/CheckboxGroup.cjs"),u=require("./components/molecules/CheckboxGroup/checkbox-group-variants.cjs"),nr=require("./components/molecules/RadioGroup/RadioGroup.cjs"),e=require("./components/molecules/RadioGroup/radio-group-variants.cjs"),or=require("./components/molecules/Breadcrumbs/Breadcrumbs.cjs"),sr=require("./components/molecules/Breadcrumbs/breadcrumb-variants.cjs"),cr=require("./components/molecules/LiquidTabs/LiquidTabs.cjs"),ur=require("./components/molecules/LiquidTabs/LiquidNav.cjs"),lr=require("./components/molecules/LiquidTabs/liquid-tab-id.cjs"),Vr=require("./components/molecules/Carousel/Carousel.cjs"),qr=require("./components/molecules/CallToAction/CallToAction.cjs"),br=require("./components/molecules/CallToAction/call-to-action-variants.cjs"),dr=require("./components/molecules/EmptyState/EmptyState.cjs"),pr=require("./components/molecules/EmptyState/empty-state-variants.cjs"),Tr=require("./components/molecules/ErrorState/ErrorState.cjs"),Cr=require("./components/molecules/ErrorState/error-state-variants.cjs"),Sr=require("./components/molecules/MatchupCard/MatchupCard.cjs"),hr=require("./components/organisms/ActionBar/ActionBar.cjs"),gr=require("./components/organisms/ActionBar/action-bar-variants.cjs"),wr=require("./components/organisms/Countdown/Countdown.cjs"),mr=require("./components/organisms/Dialog/Dialog.cjs"),xr=require("./components/organisms/Footer/Footer.cjs"),kr=require("./components/organisms/Navbar/Navbar.cjs"),vr=require("./components/organisms/Navbar/navbar-variants.cjs"),Ar=require("./components/organisms/Sheet/Sheet.cjs"),r=require("./components/organisms/Table/Table.cjs"),a=require("./components/organisms/Table/table-variants.cjs"),Br=require("./hooks/useCountdown.cjs"),l=require("./hooks/useKeySequence.cjs"),yr=require("./lib/utils.cjs");exports.Avatar=V.Avatar;exports.avatarVariants=q.avatarVariants;exports.Badge=b.Badge;exports.badgeVariants=d.badgeVariants;exports.Button=p.Button;exports.buttonVariants=T.buttonVariants;exports.Card=C.Card;exports.cardVariants=S.cardVariants;exports.Checkbox=h.Checkbox;exports.checkboxVariants=g.checkboxVariants;exports.Disclosure=w.Disclosure;exports.disclosureContentVariants=t.disclosureContentVariants;exports.disclosureTriggerVariants=t.disclosureTriggerVariants;exports.Input=m.Input;exports.iconVariants=i.iconVariants;exports.inputVariants=i.inputVariants;exports.Link=x.Link;exports.linkVariants=k.linkVariants;exports.PasswordInput=v.PasswordInput;exports.Combobox=A.Combobox;exports.Chip=B.Chip;exports.chipVariants=y.chipVariants;exports.Pill=D.Pill;exports.pillDotVariants=n.pillDotVariants;exports.pillVariants=n.pillVariants;exports.Eyebrow=L.Eyebrow;exports.eyebrowVariants=I.eyebrowVariants;exports.InlineCode=E.InlineCode;exports.inlineCodeVariants=O.inlineCodeVariants;exports.LabeledDivider=G.LabeledDivider;exports.Stat=P.Stat;exports.statValueVariants=N.statValueVariants;exports.ThemeToggle=M.ThemeToggle;exports.MultiSelect=R.MultiSelect;exports.Select=H.Select;exports.selectOptionVariants=o.selectOptionVariants;exports.selectTriggerVariants=o.selectTriggerVariants;exports.Spinner=F.Spinner;exports.Switch=K.Switch;exports.switchThumbVariants=s.switchThumbVariants;exports.switchTrackVariants=s.switchTrackVariants;exports.Textarea=_.Textarea;exports.textareaVariants=W.textareaVariants;exports.AvatarStrip=X.AvatarStrip;exports.Tooltip=f.Tooltip;exports.CollapsibleSection=j.CollapsibleSection;exports.SegmentBar=z.SegmentBar;exports.Toast=J.Toast;exports.toastVariants=Q.toastVariants;exports.Toaster=U.Toaster;exports.TONE_PREFIX=c.TONE_PREFIX;exports.toast=c.toast;exports.Alert=Y.Alert;exports.alertVariants=Z.alertVariants;exports.Accordion=$.Accordion;exports.DescriptionList=rr.DescriptionList;exports.descriptionListVariants=ar.descriptionListVariants;exports.Pullquote=er.Pullquote;exports.pullquoteVariants=tr.pullquoteVariants;exports.CheckboxGroup=ir.CheckboxGroup;exports.checkboxGroupOptionsVariants=u.checkboxGroupOptionsVariants;exports.checkboxGroupPanelVariants=u.checkboxGroupPanelVariants;exports.RadioGroup=nr.RadioGroup;exports.radioDotVariants=e.radioDotVariants;exports.radioGroupOptionsVariants=e.radioGroupOptionsVariants;exports.radioOptionVariants=e.radioOptionVariants;exports.radioVariants=e.radioVariants;exports.Breadcrumbs=or.Breadcrumbs;exports.breadcrumbVariants=sr.breadcrumbVariants;exports.LiquidTabs=cr.LiquidTabs;exports.LiquidNav=ur.LiquidNav;exports.liquidTabId=lr.liquidTabId;exports.Carousel=Vr.Carousel;exports.CallToAction=qr.CallToAction;exports.ctaVariants=br.ctaVariants;exports.EmptyState=dr.EmptyState;exports.emptyStateVariants=pr.emptyStateVariants;exports.ErrorState=Tr.ErrorState;exports.errorStateVariants=Cr.errorStateVariants;exports.MatchupCard=Sr.MatchupCard;exports.ActionBar=hr.ActionBar;exports.actionBarVariants=gr.actionBarVariants;exports.Countdown=wr.Countdown;exports.Dialog=mr.Dialog;exports.Footer=xr.Footer;exports.Navbar=kr.Navbar;exports.navbarVariants=vr.navbarVariants;exports.Sheet=Ar.Sheet;exports.Table=r.Table;exports.TableBody=r.TableBody;exports.TableCaption=r.TableCaption;exports.TableCell=r.TableCell;exports.TableFooter=r.TableFooter;exports.TableHead=r.TableHead;exports.TableHeader=r.TableHeader;exports.TableRow=r.TableRow;exports.tableCellVariants=a.tableCellVariants;exports.tableHeadVariants=a.tableHeadVariants;exports.tableHeaderVariants=a.tableHeaderVariants;exports.tableRowVariants=a.tableRowVariants;exports.tableVariants=a.tableVariants;exports.tableWrapperVariants=a.tableWrapperVariants;exports.useCountdown=Br.useCountdown;exports.KONAMI_CODE=l.KONAMI_CODE;exports.useKeySequence=l.useKeySequence;exports.cn=yr.cn;