@blakesteve/roster 5.4.0 → 5.5.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.
- package/README.md +93 -0
- package/dist/components/atoms/Button/Button.cjs +1 -1
- package/dist/components/atoms/Button/Button.d.ts +11 -0
- package/dist/components/atoms/Button/Button.js +42 -32
- package/dist/components/atoms/Button/button-variants.cjs +1 -1
- package/dist/components/atoms/Button/button-variants.js +3 -1
- package/dist/components/molecules/FileUpload/FileUpload.cjs +1 -0
- package/dist/components/molecules/FileUpload/FileUpload.d.ts +111 -0
- package/dist/components/molecules/FileUpload/FileUpload.js +403 -0
- package/dist/components/molecules/FileUpload/file-rules.cjs +1 -0
- package/dist/components/molecules/FileUpload/file-rules.d.ts +22 -0
- package/dist/components/molecules/FileUpload/file-rules.js +43 -0
- package/dist/components/organisms/ModerationQueue/ModerationQueue.cjs +1 -1
- package/dist/components/organisms/ModerationQueue/ModerationQueue.js +190 -192
- package/dist/components/organisms/Navbar/Navbar.cjs +1 -1
- package/dist/components/organisms/Navbar/Navbar.d.ts +2 -0
- package/dist/components/organisms/Navbar/Navbar.js +49 -49
- package/dist/index.d.ts +1 -0
- package/dist/meta.json +3 -3
- package/dist/roster.cjs +1 -1
- package/dist/roster.css +1 -1
- package/dist/roster.js +86 -84
- package/package.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),p=require("react"),u=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),h=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),e=require("../../../lib/utils.cjs"),y=require("../../atoms/Button/Button.cjs"),b=require("../../atoms/Link/Link.cjs"),E=require("../../atoms/Badge/Badge.cjs"),W=require("../../atoms/Avatar/Avatar.cjs"),T=require("../../atoms/Switch/switch-variants.cjs"),Y=require("./navbar-variants.cjs"),m=require("../../../node_modules/@headlessui/react/dist/components/menu/menu.cjs"),q=require("../../../node_modules/@headlessui/react/dist/components/popover/popover.cjs"),$=require("../../../node_modules/@headlessui/react/dist/components/transition/transition.cjs");function P({on:s,size:a}){return r.jsx("span",{"aria-hidden":"true","data-testid":"navbar-theme-track","data-checked":s?"":void 0,className:e.cn(T.switchTrackVariants({size:a,variant:"neutral"}),"rst:pointer-events-none"),children:r.jsx("span",{className:e.cn(T.switchThumbVariants({size:a}))})})}const Z=s=>{s?.setAttribute("role","menuitemcheckbox")},X=(s,a)=>typeof s=="function"?s({close:a}):s;function _(s){return p.useSyncExternalStore(a=>{if(!s||typeof document>"u")return()=>{};const o=new MutationObserver(a);return o.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>o.disconnect()},()=>s&&document.documentElement.classList.contains("dark"),()=>!1)}function rr({close:s}){return p.useEffect(()=>{const a=o=>{const g=document.querySelector("[data-roster-mobile-panel]"),k=document.querySelector("[data-roster-hamburger]"),x=o.target;!g?.contains(x)&&!k?.contains(x)&&s()};return document.addEventListener("pointerdown",a,{capture:!0}),()=>document.removeEventListener("pointerdown",a,{capture:!0})},[s]),null}function tr({activePath:s,close:a}){const o=p.useRef(s);return p.useEffect(()=>{o.current!==s&&(o.current=s,a())},[s,a]),null}const sr=({logoSrc:s,logoSize:a="2rem",logoClassName:o,brandName:g,items:k,activePath:x,routerElement:f,user:n,onLogin:j,onLogout:N,onInboxClick:w,onThemeToggle:v,actions:K,brandElement:L,navActions:G,userMenuItems:B=[],className:H,variant:d="default",position:J="sticky",themeMode:S,notificationVariant:z="error",notificationFill:O="solid",...Q})=>{const A=(n?.notificationCount||0)>0,R=typeof a=="number"?`${a}px`:a,V={width:R,height:R},U=_(S==="auto"),c=(S==="auto"?U?"dark":"light":S??(d==="white"||d==="default"?"light":"dark"))==="dark",C=d==="slate"||d==="primary"||d==="default"&&c||d==="white"&&c||d==="transparent"&&c,F={brand:C?"rst:text-white rst:dark:text-white rst:hover:text-gray-200 rst:dark:hover:text-gray-200":"rst:text-gray-900 rst:dark:text-gray-900 rst:hover:text-gray-600 rst:dark:hover:text-gray-600",linkBase:C?"rst:text-gray-300 rst:dark:text-gray-300 rst:hover:text-white rst:dark:hover:text-white":"rst:text-gray-600 rst:dark:text-gray-600 rst:hover:text-gray-900 rst:dark:hover:text-gray-900",linkActive:C?"rst:text-primary-400 rst:dark:text-primary-400 rst:font-semibold rst:hover:text-primary-300 rst:dark:hover:text-primary-300":"rst:text-primary-600 rst:dark:text-primary-600 rst:font-semibold rst:hover:text-primary-700 rst:dark:hover:text-primary-700",hamburger:C?"rst:text-gray-300 rst:dark:text-gray-300 rst:hover:bg-white/10 rst:dark:hover:bg-white/10 rst:hover:text-white rst:dark:hover:text-white":"rst:text-gray-500 rst:dark:text-gray-500 rst:hover:bg-gray-100 rst:dark:hover:bg-gray-100 rst:hover:text-gray-700 rst:dark:hover:text-gray-700"};return r.jsx(q.Popover,{as:"nav",className:e.cn("rst:z-50",Y.navbarVariants({variant:d,position:J}),H),...Q,children:({open:M,close:l})=>{const I=X(K,l),D=X(G,l);return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"rst:container rst:mx-auto rst:flex rst:items-center rst:justify-between rst:px-4 rst:h-16",children:[r.jsxs(b.Link,{as:f,href:"/",to:"/",variant:"neutral",underline:"none",className:e.cn("rst:flex rst:items-center rst:gap-3 rst:transition-opacity",F.brand),children:[r.jsx("img",{src:s,alt:`${g} Logo`,style:V,className:e.cn("rst:shrink-0",o??"rst:rounded-md")}),L??r.jsx("span",{className:"rst:text-xl rst:font-bold rst:tracking-tight",children:g})]}),r.jsxs("div",{className:"rst:hidden rst:md:flex rst:items-center rst:gap-8",children:[r.jsx("div",{className:"rst:flex rst:items-center rst:gap-6",children:k.map(t=>{const i=x===t.path;return r.jsxs(b.Link,{as:f,href:t.path,to:t.path,variant:"neutral",underline:"none",className:e.cn("rst:inline-flex rst:items-center rst:gap-1.5 rst:text-sm rst:transition-colors rst:duration-200",i?F.linkActive:F.linkBase),children:[t.label,t.badge&&r.jsx("span",{className:"rst:inline-flex",children:t.badge})]},t.path)})}),D,I??(n?r.jsxs(m.Menu,{as:"div",className:"rst:relative rst:ml-2",children:[r.jsxs(m.MenuButton,{className:"rst:relative rst:flex rst:rounded-full rst:text-sm rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background",children:[r.jsx("span",{className:"rst:sr-only",children:"Open user menu"}),r.jsx(W.Avatar,{initials:n.initials,src:n.avatarSrc,size:"sm",shape:"circle",colorScheme:n.avatarColor??"primary"}),A&&r.jsx("div",{className:"rst:absolute rst:-top-1 rst:-right-2",children:r.jsx(E.Badge,{fill:O,size:"xs",statusBadge:!0,variant:z,children:n.notificationCount})})]}),r.jsx($.Transition,{as:p.Fragment,enter:"rst:transition rst:ease-out rst:duration-100",enterFrom:"rst:transform rst:opacity-0 rst:scale-95",enterTo:"rst:transform rst:opacity-100 rst:scale-100",leave:"rst:transition rst:ease-in rst:duration-75",leaveFrom:"rst:transform rst:opacity-100 rst:scale-100",leaveTo:"rst:transform rst:opacity-0 rst:scale-95",children:r.jsxs(m.MenuItems,{className:"rst:absolute rst:right-0 rst:z-50 rst:mt-2 rst:w-48 rst:origin-top-right rst:rounded-md rst:bg-white rst:dark:bg-gray-800 rst:py-1 rst:elevation-anchored rst:ring rst:ring-black/5 rst:dark:ring-white/10 rst:focus:outline-hidden rst:divide-y rst:divide-gray-100 rst:dark:divide-gray-700",children:[r.jsxs("div",{className:"rst:py-1",children:[A&&w&&r.jsx(m.MenuItem,{children:({focus:t})=>r.jsxs(y.Button,{variant:"ghost",colorScheme:"neutral",size:"sm",onClick:w,className:e.cn("rst:w-full rst:justify-start rst:rounded-none rst:px-4",t&&"rst:bg-gray-50 rst:dark:bg-gray-700"),startIcon:r.jsx(u.FontAwesomeIcon,{icon:h.faInbox,className:"rst:text-primary-500 rst:w-4"}),children:["Inbox (",n.notificationCount,")"]})}),v&&r.jsx(m.MenuItem,{children:({focus:t})=>r.jsxs("div",{ref:Z,"aria-checked":c,onClick:i=>{i.preventDefault(),v()},className:e.cn("rst:flex rst:w-full rst:items-center rst:justify-between rst:px-4 rst:py-2 rst:text-sm rst:text-gray-700 rst:dark:text-gray-200 rst:cursor-pointer rst:transition-colors",t&&"rst:bg-gray-50 rst:dark:bg-gray-700"),children:[r.jsxs("div",{className:"rst:flex rst:items-center rst:gap-2",children:[r.jsx(u.FontAwesomeIcon,{icon:h.faMoon,className:e.cn("rst:w-4 rst:transition-colors",c?"rst:text-amber-500":"rst:text-gray-400")}),r.jsx("span",{className:"rst:font-medium",children:"Dark Mode"})]}),r.jsx(P,{on:c,size:"xs"})]})})]}),B.length>0&&r.jsx("div",{className:"rst:py-1",children:B.map(t=>r.jsx(m.MenuItem,{children:({focus:i})=>r.jsxs(b.Link,{as:f,href:t.path,to:t.path,variant:"neutral",underline:"none",className:e.cn("rst:flex rst:w-full rst:items-center rst:justify-between rst:gap-2 rst:px-4 rst:py-2 rst:text-sm rst:text-gray-700 rst:dark:text-gray-200 rst:transition-colors",i&&"rst:bg-gray-50 rst:dark:bg-gray-700"),children:[t.label,t.badge&&r.jsx("span",{className:"rst:inline-flex",children:t.badge})]})},t.path))}),N&&r.jsx("div",{className:"rst:py-1",children:r.jsx(m.MenuItem,{children:({focus:t})=>r.jsx(y.Button,{variant:"ghost",colorScheme:"neutral",size:"sm",onClick:N,className:e.cn("rst:w-full rst:justify-start rst:rounded-none rst:px-4",t&&"rst:bg-gray-50 rst:dark:bg-gray-700"),startIcon:r.jsx(u.FontAwesomeIcon,{icon:h.faRightFromBracket,className:"rst:text-gray-400 rst:dark:text-gray-500 rst:w-4"}),children:"Log Out"})})})]})})]}):r.jsx(y.Button,{size:"sm",variant:"solid",colorScheme:"primary",onClick:j,children:"Log In"}))]}),r.jsx("div",{"data-roster-hamburger":!0,className:"rst:flex rst:md:hidden",children:r.jsxs(q.PopoverButton,{className:e.cn("rst:inline-flex rst:items-center rst:justify-center rst:rounded-md rst:p-2 rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background",F.hamburger),children:[r.jsx("span",{className:"rst:sr-only",children:"Open main menu"}),M?r.jsx(u.FontAwesomeIcon,{icon:h.faXmark,className:"rst:block rst:h-6 rst:w-6","aria-hidden":"true"}):r.jsxs("div",{className:"rst:relative",children:[r.jsx(u.FontAwesomeIcon,{icon:h.faBars,className:"rst:block rst:h-6 rst:w-6","aria-hidden":"true"}),A&&r.jsx("span",{className:"rst:absolute rst:top-0 rst:right-0 rst:block rst:h-2.5 rst:w-2.5 rst:rounded-full rst:bg-error-500 rst:ring-2 rst:ring-transparent rst:transform rst:translate-x-1/4 rst:-translate-y-1/4"})]})]})})]}),M&&r.jsx(rr,{close:l}),M&&r.jsx(tr,{activePath:x,close:l}),r.jsx($.Transition,{as:p.Fragment,enter:"rst:duration-200 rst:ease-out",enterFrom:"rst:opacity-0 rst:scale-95",enterTo:"rst:opacity-100 rst:scale-100",leave:"rst:duration-100 rst:ease-in",leaveFrom:"rst:opacity-100 rst:scale-100",leaveTo:"rst:opacity-0 rst:scale-95",children:r.jsx(q.PopoverPanel,{focus:!0,className:"rst:absolute rst:top-0 rst:inset-x-0 rst:z-50 rst:origin-top-right rst:transform rst:p-2 rst:transition rst:md:hidden",children:r.jsxs("div",{"data-roster-mobile-panel":!0,className:"rst:rounded-lg rst:elevation-anchored rst:ring rst:ring-black/5 rst:dark:ring-white/10 rst:divide-y rst:divide-gray-100 rst:dark:divide-gray-700 rst:bg-white rst:dark:bg-gray-800",children:[r.jsxs("div",{className:"rst:px-5 rst:pt-5 rst:pb-6",children:[r.jsxs("div",{className:"rst:flex rst:items-center rst:justify-between",children:[r.jsxs("div",{className:"rst:flex rst:items-center rst:gap-3",children:[r.jsx("img",{src:s,alt:g,style:V,className:e.cn("rst:shrink-0",o??"rst:rounded-md")}),L??r.jsx("span",{className:"rst:font-bold rst:text-gray-900 rst:dark:text-white",children:g})]}),r.jsx("div",{className:"rst:-mr-2",children:r.jsxs(q.PopoverButton,{className:"rst:inline-flex rst:items-center rst:justify-center rst:rounded-md rst:p-2 rst:text-gray-400 rst:hover:bg-gray-100 rst:dark:hover:bg-gray-700 rst:hover:text-gray-500 rst:dark:hover:text-white rst:focus:outline-hidden",children:[r.jsx("span",{className:"rst:sr-only",children:"Close menu"}),r.jsx(u.FontAwesomeIcon,{icon:h.faXmark,className:"rst:h-6 rst:w-6","aria-hidden":"true"})]})})]}),r.jsxs("div",{className:"rst:mt-6",children:[D&&r.jsx("div",{className:"rst:mb-4",children:D}),r.jsxs("nav",{className:"rst:grid rst:gap-y-4",children:[k.map(t=>{const i=x===t.path;return r.jsx(b.Link,{as:f,href:t.path,to:t.path,onClick:()=>l(),variant:"neutral",underline:"none",className:e.cn("rst:-m-3 rst:flex rst:items-center rst:rounded-md rst:p-3 rst:transition-colors","rst:hover:bg-gray-50 rst:dark:hover:bg-gray-700",i?"rst:bg-gray-50 rst:dark:bg-gray-700":"rst:text-gray-900 rst:dark:text-gray-100"),children:r.jsxs("span",{className:e.cn("rst:ml-3 rst:inline-flex rst:items-center rst:gap-1.5 rst:text-base rst:font-medium",i?"rst:text-primary-600 rst:dark:text-primary-400 rst:font-bold":"rst:text-gray-900 rst:dark:text-gray-100"),children:[t.label,t.badge&&r.jsx("span",{className:"rst:inline-flex",children:t.badge})]})},t.path)}),n&&B.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("hr",{className:"rst:border-gray-100 rst:dark:border-gray-700"}),B.map(t=>{const i=x===t.path;return r.jsxs(b.Link,{as:f,href:t.path,to:t.path,onClick:()=>l(),variant:"neutral",underline:"none",className:e.cn("rst:-m-3 rst:flex rst:items-center rst:rounded-md rst:p-3 rst:transition-colors","rst:hover:bg-gray-50 rst:dark:hover:bg-gray-700",i?"rst:bg-gray-50 rst:dark:bg-gray-700":"rst:text-gray-900 rst:dark:text-gray-100"),children:[r.jsx("span",{className:e.cn("rst:ml-3 rst:text-base rst:font-medium",i?"rst:text-primary-600 rst:dark:text-primary-400 rst:font-bold":"rst:text-gray-900 rst:dark:text-gray-100"),children:t.label}),t.badge&&r.jsx("span",{className:"rst:ml-2 rst:inline-flex",children:t.badge})]},t.path)})]})]})]})]}),(n||I||j)&&r.jsx("div",{className:"rst:py-6 rst:px-5 rst:space-y-4",children:I||(!n&&j?r.jsx(y.Button,{variant:"solid",colorScheme:"primary",className:"rst:w-full rst:justify-center",onClick:()=>{j(),l()},children:"Log In"}):r.jsxs(r.Fragment,{children:[A&&w&&r.jsx(y.Button,{variant:"ghost",colorScheme:"neutral",onClick:()=>{w?.(),l()},className:"rst:w-full rst:justify-between rst:px-4 rst:text-base rst:font-medium rst:hover:bg-gray-50 rst:dark:hover:bg-gray-700 rst:text-gray-900 rst:dark:text-gray-100",endIcon:r.jsx(E.Badge,{fill:O,size:"xs",statusBadge:!0,variant:z,children:n?.notificationCount}),children:"Pending Invitations"}),v&&r.jsxs("div",{onClick:t=>{t.preventDefault(),v()},role:"switch","aria-checked":c,tabIndex:0,onKeyDown:t=>{t.repeat||(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),v())},className:"rst:flex rst:w-full rst:items-center rst:justify-between rst:rounded-md rst:px-4 rst:py-2 rst:text-base rst:transition-colors rst:cursor-pointer rst:hover:bg-gray-50 rst:dark:hover:bg-gray-700 rst:text-gray-900 rst:dark:text-gray-100",children:[r.jsxs("div",{className:"rst:flex rst:items-center rst:gap-3 rst:font-medium",children:[r.jsx(u.FontAwesomeIcon,{icon:h.faMoon,className:e.cn("rst:w-5 rst:transition-colors",c?"rst:text-amber-500":"rst:text-gray-400")}),r.jsx("span",{children:"Dark Mode"})]}),r.jsx(P,{on:c,size:"sm"})]}),N&&r.jsx(y.Button,{variant:"outline",colorScheme:"error",className:"rst:w-full rst:justify-center",onClick:()=>{N?.(),l()},children:"Log Out"})]}))})]})})})]})}})};exports.Navbar=sr;
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),y=require("react"),u=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),h=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),e=require("../../../lib/utils.cjs"),g=require("../../atoms/Button/Button.cjs"),v=require("../../atoms/Link/Link.cjs"),E=require("../../atoms/Badge/Badge.cjs"),W=require("../../atoms/Avatar/Avatar.cjs"),T=require("../../atoms/Switch/switch-variants.cjs"),Y=require("./navbar-variants.cjs"),m=require("../../../node_modules/@headlessui/react/dist/components/menu/menu.cjs"),q=require("../../../node_modules/@headlessui/react/dist/components/popover/popover.cjs"),P=require("../../../node_modules/@headlessui/react/dist/components/transition/transition.cjs");function X({on:s,size:a}){return r.jsx("span",{"aria-hidden":"true","data-testid":"navbar-theme-track","data-checked":s?"":void 0,className:e.cn(T.switchTrackVariants({size:a,variant:"neutral"}),"rst:pointer-events-none"),children:r.jsx("span",{className:e.cn(T.switchThumbVariants({size:a}))})})}const Z=s=>{s?.setAttribute("role","menuitemcheckbox")},$=(s,a)=>typeof s=="function"?s({close:a}):s;function _(s){return y.useSyncExternalStore(a=>{if(!s||typeof document>"u")return()=>{};const o=new MutationObserver(a);return o.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>o.disconnect()},()=>s&&document.documentElement.classList.contains("dark"),()=>!1)}function rr({close:s}){return y.useEffect(()=>{const a=o=>{const b=document.querySelector("[data-roster-mobile-panel]"),k=document.querySelector("[data-roster-hamburger]"),x=o.target;!b?.contains(x)&&!k?.contains(x)&&s()};return document.addEventListener("pointerdown",a,{capture:!0}),()=>document.removeEventListener("pointerdown",a,{capture:!0})},[s]),null}function tr({activePath:s,close:a}){const o=y.useRef(s);return y.useEffect(()=>{o.current!==s&&(o.current=s,a())},[s,a]),null}const sr=({logoSrc:s,logoSize:a="2rem",logoClassName:o,brandName:b,items:k,activePath:x,routerElement:p,user:n,onLogin:j,onLogout:N,onInboxClick:w,onThemeToggle:f,actions:K,brandElement:z,navActions:G,userMenuItems:B=[],className:H,variant:d="default",position:J="sticky",themeMode:S,notificationVariant:L="error",notificationFill:O="solid",...Q})=>{const A=(n?.notificationCount||0)>0,R=typeof a=="number"?`${a}px`:a,V={width:R,height:R},U=_(S==="auto"),c=(S==="auto"?U?"dark":"light":S??(d==="white"||d==="default"?"light":"dark"))==="dark",C=d==="slate"||d==="primary"||d==="default"&&c||d==="white"&&c||d==="transparent"&&c,F={brand:C?"rst:text-white rst:dark:text-white rst:hover:text-gray-200 rst:dark:hover:text-gray-200":"rst:text-gray-900 rst:dark:text-gray-900 rst:hover:text-gray-600 rst:dark:hover:text-gray-600",linkBase:C?"rst:text-gray-300 rst:dark:text-gray-300 rst:hover:text-white rst:dark:hover:text-white":"rst:text-gray-600 rst:dark:text-gray-600 rst:hover:text-gray-900 rst:dark:hover:text-gray-900",linkActive:C?"rst:text-primary-400 rst:dark:text-primary-400 rst:font-semibold rst:hover:text-primary-300 rst:dark:hover:text-primary-300":"rst:text-primary-600 rst:dark:text-primary-600 rst:font-semibold rst:hover:text-primary-700 rst:dark:hover:text-primary-700",hamburger:C?"rst:text-gray-300 rst:dark:text-gray-300 rst:hover:bg-white/10 rst:dark:hover:bg-white/10 rst:hover:text-white rst:dark:hover:text-white":"rst:text-gray-500 rst:dark:text-gray-500 rst:hover:bg-gray-100 rst:dark:hover:bg-gray-100 rst:hover:text-gray-700 rst:dark:hover:text-gray-700"};return r.jsx(q.Popover,{as:"nav",className:e.cn("rst:z-50",Y.navbarVariants({variant:d,position:J}),H),...Q,children:({open:M,close:l})=>{const I=$(K,l),D=$(G,l);return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"rst:container rst:mx-auto rst:flex rst:items-center rst:justify-between rst:px-4 rst:h-16",children:[r.jsxs(v.Link,{as:p,href:"/",to:"/",variant:"neutral",underline:"none",className:e.cn("rst:flex rst:items-center rst:gap-3 rst:transition-opacity",F.brand),children:[r.jsx("img",{src:s,alt:"",style:V,className:e.cn("rst:shrink-0",o??"rst:rounded-md")}),z??r.jsx("span",{className:"rst:text-xl rst:font-bold rst:tracking-tight",children:b})]}),r.jsxs("div",{className:"rst:hidden rst:md:flex rst:items-center rst:gap-8",children:[r.jsx("div",{className:"rst:flex rst:items-center rst:gap-6",children:k.map(t=>{const i=x===t.path;return r.jsxs(v.Link,{as:p,href:t.path,to:t.path,variant:"neutral",underline:"none",className:e.cn("rst:inline-flex rst:items-center rst:gap-1.5 rst:text-sm rst:transition-colors rst:duration-200",i?F.linkActive:F.linkBase),children:[t.label,t.badge&&r.jsx("span",{className:"rst:inline-flex",children:t.badge})]},t.path)})}),D,I??(n?r.jsxs(m.Menu,{as:"div",className:"rst:relative rst:ml-2",children:[r.jsxs(m.MenuButton,{className:"rst:relative rst:flex rst:rounded-full rst:text-sm rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background",children:[r.jsx("span",{className:"rst:sr-only",children:"Open user menu"}),r.jsx(W.Avatar,{initials:n.initials,src:n.avatarSrc,size:"sm",shape:"circle",colorScheme:n.avatarColor??"primary"}),A&&r.jsx("div",{className:"rst:absolute rst:-top-1 rst:-right-2",children:r.jsx(E.Badge,{fill:O,size:"xs",statusBadge:!0,variant:L,children:n.notificationCount})})]}),r.jsx(P.Transition,{as:y.Fragment,enter:"rst:transition rst:ease-out rst:duration-100",enterFrom:"rst:transform rst:opacity-0 rst:scale-95",enterTo:"rst:transform rst:opacity-100 rst:scale-100",leave:"rst:transition rst:ease-in rst:duration-75",leaveFrom:"rst:transform rst:opacity-100 rst:scale-100",leaveTo:"rst:transform rst:opacity-0 rst:scale-95",children:r.jsxs(m.MenuItems,{className:"rst:absolute rst:right-0 rst:z-50 rst:mt-2 rst:w-48 rst:origin-top-right rst:rounded-md rst:bg-white rst:dark:bg-gray-800 rst:py-1 rst:elevation-anchored rst:ring rst:ring-black/5 rst:dark:ring-white/10 rst:focus:outline-hidden rst:divide-y rst:divide-gray-100 rst:dark:divide-gray-700",children:[r.jsxs("div",{className:"rst:py-1",children:[A&&w&&r.jsx(m.MenuItem,{children:({focus:t})=>r.jsxs(g.Button,{variant:"ghost",colorScheme:"neutral",size:"sm",onClick:w,className:e.cn("rst:w-full rst:justify-start rst:rounded-none rst:px-4",t&&"rst:bg-gray-50 rst:dark:bg-gray-700"),startIcon:r.jsx(u.FontAwesomeIcon,{icon:h.faInbox,className:"rst:text-primary-500 rst:w-4"}),children:["Inbox (",n.notificationCount,")"]})}),f&&r.jsx(m.MenuItem,{children:({focus:t})=>r.jsxs("div",{ref:Z,"aria-checked":c,onClick:i=>{i.preventDefault(),f()},className:e.cn("rst:flex rst:w-full rst:items-center rst:justify-between rst:px-4 rst:py-2 rst:text-sm rst:text-gray-700 rst:dark:text-gray-200 rst:cursor-pointer rst:transition-colors",t&&"rst:bg-gray-50 rst:dark:bg-gray-700"),children:[r.jsxs("div",{className:"rst:flex rst:items-center rst:gap-2",children:[r.jsx(u.FontAwesomeIcon,{icon:h.faMoon,className:e.cn("rst:w-4 rst:transition-colors",c?"rst:text-amber-500":"rst:text-gray-400")}),r.jsx("span",{className:"rst:font-medium",children:"Dark Mode"})]}),r.jsx(X,{on:c,size:"xs"})]})})]}),B.length>0&&r.jsx("div",{className:"rst:py-1",children:B.map(t=>r.jsx(m.MenuItem,{children:({focus:i})=>r.jsxs(v.Link,{as:p,href:t.path,to:t.path,variant:"neutral",underline:"none",className:e.cn("rst:flex rst:w-full rst:items-center rst:justify-between rst:gap-2 rst:px-4 rst:py-2 rst:text-sm rst:text-gray-700 rst:dark:text-gray-200 rst:transition-colors",i&&"rst:bg-gray-50 rst:dark:bg-gray-700"),children:[t.label,t.badge&&r.jsx("span",{className:"rst:inline-flex",children:t.badge})]})},t.path))}),N&&r.jsx("div",{className:"rst:py-1",children:r.jsx(m.MenuItem,{children:({focus:t})=>r.jsx(g.Button,{variant:"ghost",colorScheme:"neutral",size:"sm",onClick:N,className:e.cn("rst:w-full rst:justify-start rst:rounded-none rst:px-4",t&&"rst:bg-gray-50 rst:dark:bg-gray-700"),startIcon:r.jsx(u.FontAwesomeIcon,{icon:h.faRightFromBracket,className:"rst:text-gray-400 rst:dark:text-gray-500 rst:w-4"}),children:"Log Out"})})})]})})]}):r.jsx(g.Button,{size:"sm",variant:"solid",colorScheme:"primary",onClick:j,children:"Log In"}))]}),r.jsx("div",{"data-roster-hamburger":!0,className:"rst:flex rst:md:hidden",children:r.jsxs(q.PopoverButton,{className:e.cn("rst:inline-flex rst:items-center rst:justify-center rst:rounded-md rst:p-2 rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background",F.hamburger),children:[r.jsx("span",{className:"rst:sr-only",children:"Open main menu"}),M?r.jsx(u.FontAwesomeIcon,{icon:h.faXmark,className:"rst:block rst:h-6 rst:w-6","aria-hidden":"true"}):r.jsxs("div",{className:"rst:relative",children:[r.jsx(u.FontAwesomeIcon,{icon:h.faBars,className:"rst:block rst:h-6 rst:w-6","aria-hidden":"true"}),A&&r.jsx("span",{className:"rst:absolute rst:top-0 rst:right-0 rst:block rst:h-2.5 rst:w-2.5 rst:rounded-full rst:bg-error-500 rst:ring-2 rst:ring-transparent rst:transform rst:translate-x-1/4 rst:-translate-y-1/4"})]})]})})]}),M&&r.jsx(rr,{close:l}),M&&r.jsx(tr,{activePath:x,close:l}),r.jsx(P.Transition,{as:y.Fragment,enter:"rst:duration-200 rst:ease-out",enterFrom:"rst:opacity-0 rst:scale-95",enterTo:"rst:opacity-100 rst:scale-100",leave:"rst:duration-100 rst:ease-in",leaveFrom:"rst:opacity-100 rst:scale-100",leaveTo:"rst:opacity-0 rst:scale-95",children:r.jsx(q.PopoverPanel,{focus:!0,className:"rst:absolute rst:top-0 rst:inset-x-0 rst:z-50 rst:origin-top-right rst:transform rst:p-2 rst:transition rst:md:hidden",children:r.jsxs("div",{"data-roster-mobile-panel":!0,className:"rst:rounded-lg rst:elevation-anchored rst:ring rst:ring-black/5 rst:dark:ring-white/10 rst:divide-y rst:divide-gray-100 rst:dark:divide-gray-700 rst:bg-white rst:dark:bg-gray-800",children:[r.jsxs("div",{className:"rst:px-5 rst:pt-5 rst:pb-6",children:[r.jsxs("div",{className:"rst:flex rst:items-center rst:justify-between",children:[r.jsxs("div",{className:"rst:flex rst:items-center rst:gap-3",children:[r.jsx("img",{src:s,alt:"",style:V,className:e.cn("rst:shrink-0",o??"rst:rounded-md")}),z??r.jsx("span",{className:"rst:font-bold rst:text-gray-900 rst:dark:text-white",children:b})]}),r.jsx("div",{className:"rst:-mr-2",children:r.jsxs(q.PopoverButton,{className:"rst:inline-flex rst:items-center rst:justify-center rst:rounded-md rst:p-2 rst:text-gray-400 rst:hover:bg-gray-100 rst:dark:hover:bg-gray-700 rst:hover:text-gray-500 rst:dark:hover:text-white rst:focus:outline-hidden",children:[r.jsx("span",{className:"rst:sr-only",children:"Close menu"}),r.jsx(u.FontAwesomeIcon,{icon:h.faXmark,className:"rst:h-6 rst:w-6","aria-hidden":"true"})]})})]}),r.jsxs("div",{className:"rst:mt-6",children:[D&&r.jsx("div",{className:"rst:mb-4",children:D}),r.jsxs("nav",{className:"rst:grid rst:gap-y-4",children:[k.map(t=>{const i=x===t.path;return r.jsx(v.Link,{as:p,href:t.path,to:t.path,onClick:()=>l(),variant:"neutral",underline:"none",className:e.cn("rst:-m-3 rst:flex rst:items-center rst:rounded-md rst:p-3 rst:transition-colors","rst:hover:bg-gray-50 rst:dark:hover:bg-gray-700",i?"rst:bg-gray-50 rst:dark:bg-gray-700":"rst:text-gray-900 rst:dark:text-gray-100"),children:r.jsxs("span",{className:e.cn("rst:ml-3 rst:inline-flex rst:items-center rst:gap-1.5 rst:text-base rst:font-medium",i?"rst:text-primary-600 rst:dark:text-primary-400 rst:font-bold":"rst:text-gray-900 rst:dark:text-gray-100"),children:[t.label,t.badge&&r.jsx("span",{className:"rst:inline-flex",children:t.badge})]})},t.path)}),n&&B.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("hr",{className:"rst:border-gray-100 rst:dark:border-gray-700"}),B.map(t=>{const i=x===t.path;return r.jsxs(v.Link,{as:p,href:t.path,to:t.path,onClick:()=>l(),variant:"neutral",underline:"none",className:e.cn("rst:-m-3 rst:flex rst:items-center rst:rounded-md rst:p-3 rst:transition-colors","rst:hover:bg-gray-50 rst:dark:hover:bg-gray-700",i?"rst:bg-gray-50 rst:dark:bg-gray-700":"rst:text-gray-900 rst:dark:text-gray-100"),children:[r.jsx("span",{className:e.cn("rst:ml-3 rst:text-base rst:font-medium",i?"rst:text-primary-600 rst:dark:text-primary-400 rst:font-bold":"rst:text-gray-900 rst:dark:text-gray-100"),children:t.label}),t.badge&&r.jsx("span",{className:"rst:ml-2 rst:inline-flex",children:t.badge})]},t.path)})]})]})]})]}),(n||I||j)&&r.jsx("div",{className:"rst:py-6 rst:px-5 rst:space-y-4",children:I||(!n&&j?r.jsx(g.Button,{variant:"solid",colorScheme:"primary",className:"rst:w-full rst:justify-center",onClick:()=>{j(),l()},children:"Log In"}):r.jsxs(r.Fragment,{children:[A&&w&&r.jsx(g.Button,{variant:"ghost",colorScheme:"neutral",onClick:()=>{w?.(),l()},className:"rst:w-full rst:justify-between rst:px-4 rst:text-base rst:font-medium rst:hover:bg-gray-50 rst:dark:hover:bg-gray-700 rst:text-gray-900 rst:dark:text-gray-100",endIcon:r.jsx(E.Badge,{fill:O,size:"xs",statusBadge:!0,variant:L,children:n?.notificationCount}),children:"Pending Invitations"}),f&&r.jsxs("div",{onClick:t=>{t.preventDefault(),f()},role:"switch","aria-checked":c,tabIndex:0,onKeyDown:t=>{t.repeat||(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),f())},className:"rst:flex rst:w-full rst:items-center rst:justify-between rst:rounded-md rst:px-4 rst:py-2 rst:text-base rst:transition-colors rst:cursor-pointer rst:hover:bg-gray-50 rst:dark:hover:bg-gray-700 rst:text-gray-900 rst:dark:text-gray-100",children:[r.jsxs("div",{className:"rst:flex rst:items-center rst:gap-3 rst:font-medium",children:[r.jsx(u.FontAwesomeIcon,{icon:h.faMoon,className:e.cn("rst:w-5 rst:transition-colors",c?"rst:text-amber-500":"rst:text-gray-400")}),r.jsx("span",{children:"Dark Mode"})]}),r.jsx(X,{on:c,size:"sm"})]}),N&&r.jsx(g.Button,{variant:"outline",colorScheme:"error",className:"rst:w-full rst:justify-center",onClick:()=>{N?.(),l()},children:"Log Out"})]}))})]})})})]})}})};exports.Navbar=sr;
|
|
@@ -74,6 +74,8 @@ export interface NavbarProps extends React.HTMLAttributes<HTMLElement>, VariantP
|
|
|
74
74
|
* when you need mixed weights, colors, or other rich styling that a plain
|
|
75
75
|
* string cannot express (e.g. bold "GAME" + thin "VERDICT").
|
|
76
76
|
* The logo image is always rendered; this only affects the text element.
|
|
77
|
+
* The logo is decorative (empty alt) because this or the brand name names
|
|
78
|
+
* the link, so give it text a screen reader can read, visible or not.
|
|
77
79
|
*/
|
|
78
80
|
brandElement?: React.ReactNode;
|
|
79
81
|
/**
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r, jsxs as s, Fragment as I } from "react/jsx-runtime";
|
|
3
|
-
import Z, { Fragment as
|
|
3
|
+
import Z, { Fragment as E, useEffect as H, useRef as rr } from "react";
|
|
4
4
|
import { FontAwesomeIcon as g } from "../../../node_modules/@fortawesome/react-fontawesome/dist/index.js";
|
|
5
|
-
import { faInbox as tr, faMoon as
|
|
5
|
+
import { faInbox as tr, faMoon as K, faRightFromBracket as sr, faXmark as V, faBars as er } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
|
|
6
6
|
import { cn as a } from "../../../lib/utils.js";
|
|
7
|
-
import { Button as
|
|
8
|
-
import { Link as
|
|
9
|
-
import { Badge as
|
|
7
|
+
import { Button as u } from "../../atoms/Button/Button.js";
|
|
8
|
+
import { Link as f } from "../../atoms/Link/Link.js";
|
|
9
|
+
import { Badge as _ } from "../../atoms/Badge/Badge.js";
|
|
10
10
|
import { Avatar as ar } from "../../atoms/Avatar/Avatar.js";
|
|
11
11
|
import { switchThumbVariants as nr, switchTrackVariants as ir } from "../../atoms/Switch/switch-variants.js";
|
|
12
12
|
import { navbarVariants as or } from "./navbar-variants.js";
|
|
13
13
|
import { Menu as lr, MenuButton as cr, MenuItems as dr, MenuItem as A } from "../../../node_modules/@headlessui/react/dist/components/menu/menu.js";
|
|
14
|
-
import { Popover as mr, PopoverButton as
|
|
14
|
+
import { Popover as mr, PopoverButton as $, PopoverPanel as hr } from "../../../node_modules/@headlessui/react/dist/components/popover/popover.js";
|
|
15
15
|
import { Transition as T } from "../../../node_modules/@headlessui/react/dist/components/transition/transition.js";
|
|
16
16
|
function X({ on: e, size: n }) {
|
|
17
17
|
return /* @__PURE__ */ r(
|
|
@@ -46,8 +46,8 @@ function ur(e) {
|
|
|
46
46
|
function pr({ close: e }) {
|
|
47
47
|
return H(() => {
|
|
48
48
|
const n = (l) => {
|
|
49
|
-
const
|
|
50
|
-
!
|
|
49
|
+
const x = document.querySelector("[data-roster-mobile-panel]"), v = document.querySelector("[data-roster-hamburger]"), h = l.target;
|
|
50
|
+
!x?.contains(h) && !v?.contains(h) && e();
|
|
51
51
|
};
|
|
52
52
|
return document.addEventListener("pointerdown", n, { capture: !0 }), () => document.removeEventListener("pointerdown", n, { capture: !0 });
|
|
53
53
|
}, [e]), null;
|
|
@@ -65,15 +65,15 @@ const Ir = ({
|
|
|
65
65
|
logoSrc: e,
|
|
66
66
|
logoSize: n = "2rem",
|
|
67
67
|
logoClassName: l,
|
|
68
|
-
brandName:
|
|
68
|
+
brandName: x,
|
|
69
69
|
items: v,
|
|
70
70
|
activePath: h,
|
|
71
|
-
routerElement:
|
|
71
|
+
routerElement: p,
|
|
72
72
|
user: i,
|
|
73
73
|
onLogin: b,
|
|
74
74
|
onLogout: k,
|
|
75
75
|
onInboxClick: N,
|
|
76
|
-
onThemeToggle:
|
|
76
|
+
onThemeToggle: y,
|
|
77
77
|
actions: J,
|
|
78
78
|
brandElement: M,
|
|
79
79
|
navActions: P,
|
|
@@ -86,7 +86,7 @@ const Ir = ({
|
|
|
86
86
|
notificationFill: L = "solid",
|
|
87
87
|
...W
|
|
88
88
|
}) => {
|
|
89
|
-
const C = (i?.notificationCount || 0) > 0, R = typeof n == "number" ? `${n}px` : n,
|
|
89
|
+
const C = (i?.notificationCount || 0) > 0, R = typeof n == "number" ? `${n}px` : n, q = { width: R, height: R }, Y = ur(B === "auto"), c = (B === "auto" ? Y ? "dark" : "light" : B ?? (m === "white" || m === "default" ? "light" : "dark")) === "dark", j = m === "slate" || m === "primary" || m === "default" && c || m === "white" && c || m === "transparent" && c, D = {
|
|
90
90
|
brand: j ? "rst:text-white rst:dark:text-white rst:hover:text-gray-200 rst:dark:hover:text-gray-200" : "rst:text-gray-900 rst:dark:text-gray-900 rst:hover:text-gray-600 rst:dark:hover:text-gray-600",
|
|
91
91
|
linkBase: j ? "rst:text-gray-300 rst:dark:text-gray-300 rst:hover:text-white rst:dark:hover:text-white" : "rst:text-gray-600 rst:dark:text-gray-600 rst:hover:text-gray-900 rst:dark:hover:text-gray-900",
|
|
92
92
|
linkActive: j ? "rst:text-primary-400 rst:dark:text-primary-400 rst:font-semibold rst:hover:text-primary-300 rst:dark:hover:text-primary-300" : "rst:text-primary-600 rst:dark:text-primary-600 rst:font-semibold rst:hover:text-primary-700 rst:dark:hover:text-primary-700",
|
|
@@ -103,9 +103,9 @@ const Ir = ({
|
|
|
103
103
|
return /* @__PURE__ */ s(I, { children: [
|
|
104
104
|
/* @__PURE__ */ s("div", { className: "rst:container rst:mx-auto rst:flex rst:items-center rst:justify-between rst:px-4 rst:h-16", children: [
|
|
105
105
|
/* @__PURE__ */ s(
|
|
106
|
-
|
|
106
|
+
f,
|
|
107
107
|
{
|
|
108
|
-
as:
|
|
108
|
+
as: p,
|
|
109
109
|
href: "/",
|
|
110
110
|
to: "/",
|
|
111
111
|
variant: "neutral",
|
|
@@ -119,12 +119,12 @@ const Ir = ({
|
|
|
119
119
|
"img",
|
|
120
120
|
{
|
|
121
121
|
src: e,
|
|
122
|
-
alt:
|
|
123
|
-
style:
|
|
122
|
+
alt: "",
|
|
123
|
+
style: q,
|
|
124
124
|
className: a("rst:shrink-0", l ?? "rst:rounded-md")
|
|
125
125
|
}
|
|
126
126
|
),
|
|
127
|
-
M ?? /* @__PURE__ */ r("span", { className: "rst:text-xl rst:font-bold rst:tracking-tight", children:
|
|
127
|
+
M ?? /* @__PURE__ */ r("span", { className: "rst:text-xl rst:font-bold rst:tracking-tight", children: x })
|
|
128
128
|
]
|
|
129
129
|
}
|
|
130
130
|
),
|
|
@@ -132,9 +132,9 @@ const Ir = ({
|
|
|
132
132
|
/* @__PURE__ */ r("div", { className: "rst:flex rst:items-center rst:gap-6", children: v.map((t) => {
|
|
133
133
|
const o = h === t.path;
|
|
134
134
|
return /* @__PURE__ */ s(
|
|
135
|
-
|
|
135
|
+
f,
|
|
136
136
|
{
|
|
137
|
-
as:
|
|
137
|
+
as: p,
|
|
138
138
|
href: t.path,
|
|
139
139
|
to: t.path,
|
|
140
140
|
variant: "neutral",
|
|
@@ -166,7 +166,7 @@ const Ir = ({
|
|
|
166
166
|
}
|
|
167
167
|
),
|
|
168
168
|
C && /* @__PURE__ */ r("div", { className: "rst:absolute rst:-top-1 rst:-right-2", children: /* @__PURE__ */ r(
|
|
169
|
-
|
|
169
|
+
_,
|
|
170
170
|
{
|
|
171
171
|
fill: L,
|
|
172
172
|
size: "xs",
|
|
@@ -179,7 +179,7 @@ const Ir = ({
|
|
|
179
179
|
/* @__PURE__ */ r(
|
|
180
180
|
T,
|
|
181
181
|
{
|
|
182
|
-
as:
|
|
182
|
+
as: E,
|
|
183
183
|
enter: "rst:transition rst:ease-out rst:duration-100",
|
|
184
184
|
enterFrom: "rst:transform rst:opacity-0 rst:scale-95",
|
|
185
185
|
enterTo: "rst:transform rst:opacity-100 rst:scale-100",
|
|
@@ -189,7 +189,7 @@ const Ir = ({
|
|
|
189
189
|
children: /* @__PURE__ */ s(dr, { className: "rst:absolute rst:right-0 rst:z-50 rst:mt-2 rst:w-48 rst:origin-top-right rst:rounded-md rst:bg-white rst:dark:bg-gray-800 rst:py-1 rst:elevation-anchored rst:ring rst:ring-black/5 rst:dark:ring-white/10 rst:focus:outline-hidden rst:divide-y rst:divide-gray-100 rst:dark:divide-gray-700", children: [
|
|
190
190
|
/* @__PURE__ */ s("div", { className: "rst:py-1", children: [
|
|
191
191
|
C && N && /* @__PURE__ */ r(A, { children: ({ focus: t }) => /* @__PURE__ */ s(
|
|
192
|
-
|
|
192
|
+
u,
|
|
193
193
|
{
|
|
194
194
|
variant: "ghost",
|
|
195
195
|
colorScheme: "neutral",
|
|
@@ -213,7 +213,7 @@ const Ir = ({
|
|
|
213
213
|
]
|
|
214
214
|
}
|
|
215
215
|
) }),
|
|
216
|
-
|
|
216
|
+
y && /* @__PURE__ */ r(A, { children: ({ focus: t }) => (
|
|
217
217
|
/* The row is the control. Headless UI keeps
|
|
218
218
|
focus on the menu and clicks the active item
|
|
219
219
|
on Enter or Space, so the row needs no key
|
|
@@ -224,7 +224,7 @@ const Ir = ({
|
|
|
224
224
|
ref: gr,
|
|
225
225
|
"aria-checked": c,
|
|
226
226
|
onClick: (o) => {
|
|
227
|
-
o.preventDefault(),
|
|
227
|
+
o.preventDefault(), y();
|
|
228
228
|
},
|
|
229
229
|
className: a(
|
|
230
230
|
"rst:flex rst:w-full rst:items-center rst:justify-between rst:px-4 rst:py-2 rst:text-sm rst:text-gray-700 rst:dark:text-gray-200 rst:cursor-pointer rst:transition-colors",
|
|
@@ -235,7 +235,7 @@ const Ir = ({
|
|
|
235
235
|
/* @__PURE__ */ r(
|
|
236
236
|
g,
|
|
237
237
|
{
|
|
238
|
-
icon:
|
|
238
|
+
icon: K,
|
|
239
239
|
className: a(
|
|
240
240
|
"rst:w-4 rst:transition-colors",
|
|
241
241
|
c ? "rst:text-amber-500" : "rst:text-gray-400"
|
|
@@ -251,9 +251,9 @@ const Ir = ({
|
|
|
251
251
|
) })
|
|
252
252
|
] }),
|
|
253
253
|
w.length > 0 && /* @__PURE__ */ r("div", { className: "rst:py-1", children: w.map((t) => /* @__PURE__ */ r(A, { children: ({ focus: o }) => /* @__PURE__ */ s(
|
|
254
|
-
|
|
254
|
+
f,
|
|
255
255
|
{
|
|
256
|
-
as:
|
|
256
|
+
as: p,
|
|
257
257
|
href: t.path,
|
|
258
258
|
to: t.path,
|
|
259
259
|
variant: "neutral",
|
|
@@ -269,7 +269,7 @@ const Ir = ({
|
|
|
269
269
|
}
|
|
270
270
|
) }, t.path)) }),
|
|
271
271
|
k && /* @__PURE__ */ r("div", { className: "rst:py-1", children: /* @__PURE__ */ r(A, { children: ({ focus: t }) => /* @__PURE__ */ r(
|
|
272
|
-
|
|
272
|
+
u,
|
|
273
273
|
{
|
|
274
274
|
variant: "ghost",
|
|
275
275
|
colorScheme: "neutral",
|
|
@@ -292,10 +292,10 @@ const Ir = ({
|
|
|
292
292
|
] })
|
|
293
293
|
}
|
|
294
294
|
)
|
|
295
|
-
] }) : /* @__PURE__ */ r(
|
|
295
|
+
] }) : /* @__PURE__ */ r(u, { size: "sm", variant: "solid", colorScheme: "primary", onClick: b, children: "Log In" }))
|
|
296
296
|
] }),
|
|
297
297
|
/* @__PURE__ */ r("div", { "data-roster-hamburger": !0, className: "rst:flex rst:md:hidden", children: /* @__PURE__ */ s(
|
|
298
|
-
|
|
298
|
+
$,
|
|
299
299
|
{
|
|
300
300
|
className: a(
|
|
301
301
|
"rst:inline-flex rst:items-center rst:justify-center rst:rounded-md rst:p-2 rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background",
|
|
@@ -306,7 +306,7 @@ const Ir = ({
|
|
|
306
306
|
F ? /* @__PURE__ */ r(
|
|
307
307
|
g,
|
|
308
308
|
{
|
|
309
|
-
icon:
|
|
309
|
+
icon: V,
|
|
310
310
|
className: "rst:block rst:h-6 rst:w-6",
|
|
311
311
|
"aria-hidden": "true"
|
|
312
312
|
}
|
|
@@ -330,7 +330,7 @@ const Ir = ({
|
|
|
330
330
|
/* @__PURE__ */ r(
|
|
331
331
|
T,
|
|
332
332
|
{
|
|
333
|
-
as:
|
|
333
|
+
as: E,
|
|
334
334
|
enter: "rst:duration-200 rst:ease-out",
|
|
335
335
|
enterFrom: "rst:opacity-0 rst:scale-95",
|
|
336
336
|
enterTo: "rst:opacity-100 rst:scale-100",
|
|
@@ -350,19 +350,19 @@ const Ir = ({
|
|
|
350
350
|
"img",
|
|
351
351
|
{
|
|
352
352
|
src: e,
|
|
353
|
-
alt:
|
|
354
|
-
style:
|
|
353
|
+
alt: "",
|
|
354
|
+
style: q,
|
|
355
355
|
className: a("rst:shrink-0", l ?? "rst:rounded-md")
|
|
356
356
|
}
|
|
357
357
|
),
|
|
358
|
-
M ?? /* @__PURE__ */ r("span", { className: "rst:font-bold rst:text-gray-900 rst:dark:text-white", children:
|
|
358
|
+
M ?? /* @__PURE__ */ r("span", { className: "rst:font-bold rst:text-gray-900 rst:dark:text-white", children: x })
|
|
359
359
|
] }),
|
|
360
|
-
/* @__PURE__ */ r("div", { className: "rst:-mr-2", children: /* @__PURE__ */ s(
|
|
360
|
+
/* @__PURE__ */ r("div", { className: "rst:-mr-2", children: /* @__PURE__ */ s($, { className: "rst:inline-flex rst:items-center rst:justify-center rst:rounded-md rst:p-2 rst:text-gray-400 rst:hover:bg-gray-100 rst:dark:hover:bg-gray-700 rst:hover:text-gray-500 rst:dark:hover:text-white rst:focus:outline-hidden", children: [
|
|
361
361
|
/* @__PURE__ */ r("span", { className: "rst:sr-only", children: "Close menu" }),
|
|
362
362
|
/* @__PURE__ */ r(
|
|
363
363
|
g,
|
|
364
364
|
{
|
|
365
|
-
icon:
|
|
365
|
+
icon: V,
|
|
366
366
|
className: "rst:h-6 rst:w-6",
|
|
367
367
|
"aria-hidden": "true"
|
|
368
368
|
}
|
|
@@ -375,9 +375,9 @@ const Ir = ({
|
|
|
375
375
|
v.map((t) => {
|
|
376
376
|
const o = h === t.path;
|
|
377
377
|
return /* @__PURE__ */ r(
|
|
378
|
-
|
|
378
|
+
f,
|
|
379
379
|
{
|
|
380
|
-
as:
|
|
380
|
+
as: p,
|
|
381
381
|
href: t.path,
|
|
382
382
|
to: t.path,
|
|
383
383
|
onClick: () => d(),
|
|
@@ -410,9 +410,9 @@ const Ir = ({
|
|
|
410
410
|
w.map((t) => {
|
|
411
411
|
const o = h === t.path;
|
|
412
412
|
return /* @__PURE__ */ s(
|
|
413
|
-
|
|
413
|
+
f,
|
|
414
414
|
{
|
|
415
|
-
as:
|
|
415
|
+
as: p,
|
|
416
416
|
href: t.path,
|
|
417
417
|
to: t.path,
|
|
418
418
|
onClick: () => d(),
|
|
@@ -445,7 +445,7 @@ const Ir = ({
|
|
|
445
445
|
] })
|
|
446
446
|
] }),
|
|
447
447
|
(i || S || b) && /* @__PURE__ */ r("div", { className: "rst:py-6 rst:px-5 rst:space-y-4", children: S || (!i && b ? /* @__PURE__ */ r(
|
|
448
|
-
|
|
448
|
+
u,
|
|
449
449
|
{
|
|
450
450
|
variant: "solid",
|
|
451
451
|
colorScheme: "primary",
|
|
@@ -457,7 +457,7 @@ const Ir = ({
|
|
|
457
457
|
}
|
|
458
458
|
) : /* @__PURE__ */ s(I, { children: [
|
|
459
459
|
C && N && /* @__PURE__ */ r(
|
|
460
|
-
|
|
460
|
+
u,
|
|
461
461
|
{
|
|
462
462
|
variant: "ghost",
|
|
463
463
|
colorScheme: "neutral",
|
|
@@ -466,7 +466,7 @@ const Ir = ({
|
|
|
466
466
|
},
|
|
467
467
|
className: "rst:w-full rst:justify-between rst:px-4 rst:text-base rst:font-medium rst:hover:bg-gray-50 rst:dark:hover:bg-gray-700 rst:text-gray-900 rst:dark:text-gray-100",
|
|
468
468
|
endIcon: /* @__PURE__ */ r(
|
|
469
|
-
|
|
469
|
+
_,
|
|
470
470
|
{
|
|
471
471
|
fill: L,
|
|
472
472
|
size: "xs",
|
|
@@ -478,19 +478,19 @@ const Ir = ({
|
|
|
478
478
|
children: "Pending Invitations"
|
|
479
479
|
}
|
|
480
480
|
),
|
|
481
|
-
|
|
481
|
+
y && /* The row is the switch: one tab stop, its
|
|
482
482
|
state in `aria-checked`, its name from its text. */
|
|
483
483
|
/* @__PURE__ */ s(
|
|
484
484
|
"div",
|
|
485
485
|
{
|
|
486
486
|
onClick: (t) => {
|
|
487
|
-
t.preventDefault(),
|
|
487
|
+
t.preventDefault(), y();
|
|
488
488
|
},
|
|
489
489
|
role: "switch",
|
|
490
490
|
"aria-checked": c,
|
|
491
491
|
tabIndex: 0,
|
|
492
492
|
onKeyDown: (t) => {
|
|
493
|
-
t.repeat || (t.key === "Enter" || t.key === " ") && (t.preventDefault(),
|
|
493
|
+
t.repeat || (t.key === "Enter" || t.key === " ") && (t.preventDefault(), y());
|
|
494
494
|
},
|
|
495
495
|
className: "rst:flex rst:w-full rst:items-center rst:justify-between rst:rounded-md rst:px-4 rst:py-2 rst:text-base rst:transition-colors rst:cursor-pointer rst:hover:bg-gray-50 rst:dark:hover:bg-gray-700 rst:text-gray-900 rst:dark:text-gray-100",
|
|
496
496
|
children: [
|
|
@@ -498,7 +498,7 @@ const Ir = ({
|
|
|
498
498
|
/* @__PURE__ */ r(
|
|
499
499
|
g,
|
|
500
500
|
{
|
|
501
|
-
icon:
|
|
501
|
+
icon: K,
|
|
502
502
|
className: a(
|
|
503
503
|
"rst:w-5 rst:transition-colors",
|
|
504
504
|
c ? "rst:text-amber-500" : "rst:text-gray-400"
|
|
@@ -512,7 +512,7 @@ const Ir = ({
|
|
|
512
512
|
}
|
|
513
513
|
),
|
|
514
514
|
k && /* @__PURE__ */ r(
|
|
515
|
-
|
|
515
|
+
u,
|
|
516
516
|
{
|
|
517
517
|
variant: "outline",
|
|
518
518
|
colorScheme: "error",
|
package/dist/index.d.ts
CHANGED
|
@@ -66,6 +66,7 @@ export * from './components/molecules/CallToAction/call-to-action-variants';
|
|
|
66
66
|
export * from './components/molecules/EmptyState/EmptyState';
|
|
67
67
|
export * from './components/molecules/EmptyState/empty-state-variants';
|
|
68
68
|
export * from './components/molecules/MediaPreview/MediaPreview';
|
|
69
|
+
export * from './components/molecules/FileUpload/FileUpload';
|
|
69
70
|
export * from './components/molecules/ErrorState/ErrorState';
|
|
70
71
|
export * from './components/molecules/ErrorState/error-state-variants';
|
|
71
72
|
export * from './components/molecules/MatchupCard/MatchupCard';
|
package/dist/meta.json
CHANGED
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"),d=require("./components/atoms/Badge/Badge.cjs"),b=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"),v=require("./components/atoms/Input/Input.cjs"),i=require("./components/atoms/Input/input-variants.cjs"),A=require("./components/atoms/Link/Link.cjs"),m=require("./components/atoms/Link/link-variants.cjs"),x=require("./components/atoms/PasswordInput/PasswordInput.cjs"),k=require("./components/atoms/Combobox/Combobox.cjs"),D=require("./components/atoms/Chip/Chip.cjs"),E=require("./components/atoms/Chip/chip-variants.cjs"),B=require("./components/atoms/Pill/Pill.cjs"),n=require("./components/atoms/Pill/pill-variants.cjs"),y=require("./components/atoms/Eyebrow/Eyebrow.cjs"),L=require("./components/atoms/Eyebrow/eyebrow-variants.cjs"),P=require("./components/atoms/InlineCode/InlineCode.cjs"),I=require("./components/atoms/InlineCode/inline-code-variants.cjs"),M=require("./components/atoms/LabeledDivider/LabeledDivider.cjs"),O=require("./components/atoms/Stat/Stat.cjs"),G=require("./components/atoms/Stat/stat-variants.cjs"),
|
|
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"),d=require("./components/atoms/Badge/Badge.cjs"),b=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"),v=require("./components/atoms/Input/Input.cjs"),i=require("./components/atoms/Input/input-variants.cjs"),A=require("./components/atoms/Link/Link.cjs"),m=require("./components/atoms/Link/link-variants.cjs"),x=require("./components/atoms/PasswordInput/PasswordInput.cjs"),k=require("./components/atoms/Combobox/Combobox.cjs"),D=require("./components/atoms/Chip/Chip.cjs"),E=require("./components/atoms/Chip/chip-variants.cjs"),B=require("./components/atoms/Pill/Pill.cjs"),n=require("./components/atoms/Pill/pill-variants.cjs"),y=require("./components/atoms/Eyebrow/Eyebrow.cjs"),L=require("./components/atoms/Eyebrow/eyebrow-variants.cjs"),P=require("./components/atoms/InlineCode/InlineCode.cjs"),I=require("./components/atoms/InlineCode/inline-code-variants.cjs"),M=require("./components/atoms/LabeledDivider/LabeledDivider.cjs"),O=require("./components/atoms/Stat/Stat.cjs"),G=require("./components/atoms/Stat/stat-variants.cjs"),F=require("./components/atoms/ThemeToggle/ThemeToggle.cjs"),N=require("./components/atoms/MultiSelect/MultiSelect.cjs"),Q=require("./components/atoms/Select/Select.cjs"),o=require("./components/atoms/Select/select-variants.cjs"),R=require("./components/atoms/Spinner/Spinner.cjs"),H=require("./components/atoms/Switch/Switch.cjs"),s=require("./components/atoms/Switch/switch-variants.cjs"),K=require("./components/atoms/Textarea/Textarea.cjs"),_=require("./components/atoms/Textarea/textarea-variants.cjs"),U=require("./components/atoms/AvatarStrip/AvatarStrip.cjs"),W=require("./components/atoms/Tooltip/Tooltip.cjs"),X=require("./components/atoms/CollapsibleSection/CollapsibleSection.cjs"),f=require("./components/atoms/SegmentBar/SegmentBar.cjs"),j=require("./components/molecules/Toast/Toast.cjs"),z=require("./components/molecules/Toast/toast-variants.cjs"),J=require("./components/molecules/Toast/Toaster.cjs"),u=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"),ee=require("./components/molecules/DescriptionList/DescriptionList.cjs"),re=require("./components/molecules/DescriptionList/description-list-variants.cjs"),ae=require("./components/molecules/Pullquote/Pullquote.cjs"),te=require("./components/molecules/Pullquote/pullquote-variants.cjs"),ie=require("./components/molecules/CheckboxGroup/CheckboxGroup.cjs"),c=require("./components/molecules/CheckboxGroup/checkbox-group-variants.cjs"),ne=require("./components/molecules/RadioGroup/RadioGroup.cjs"),a=require("./components/molecules/RadioGroup/radio-group-variants.cjs"),oe=require("./components/molecules/Breadcrumbs/Breadcrumbs.cjs"),se=require("./components/molecules/Breadcrumbs/breadcrumb-variants.cjs"),ue=require("./components/molecules/LiquidTabs/LiquidTabs.cjs"),ce=require("./components/molecules/LiquidTabs/LiquidNav.cjs"),le=require("./components/molecules/LiquidTabs/liquid-tab-id.cjs"),Ve=require("./components/molecules/Carousel/Carousel.cjs"),qe=require("./components/molecules/CallToAction/CallToAction.cjs"),de=require("./components/molecules/CallToAction/call-to-action-variants.cjs"),be=require("./components/molecules/EmptyState/EmptyState.cjs"),pe=require("./components/molecules/EmptyState/empty-state-variants.cjs"),Te=require("./components/molecules/MediaPreview/MediaPreview.cjs"),Ce=require("./components/molecules/FileUpload/FileUpload.cjs"),Se=require("./components/molecules/ErrorState/ErrorState.cjs"),he=require("./components/molecules/ErrorState/error-state-variants.cjs"),ge=require("./components/molecules/MatchupCard/MatchupCard.cjs"),we=require("./components/organisms/ActionBar/ActionBar.cjs"),ve=require("./components/organisms/ActionBar/action-bar-variants.cjs"),Ae=require("./components/organisms/Countdown/Countdown.cjs"),me=require("./components/organisms/Dialog/Dialog.cjs"),xe=require("./components/organisms/Footer/Footer.cjs"),ke=require("./components/organisms/Navbar/Navbar.cjs"),De=require("./components/organisms/Navbar/navbar-variants.cjs"),Ee=require("./components/organisms/Sheet/Sheet.cjs"),Be=require("./components/organisms/ModerationQueue/ModerationQueue.cjs"),ye=require("./components/organisms/ModerationQueue/queue-actions.cjs"),Le=require("./components/organisms/ModerationQueue/QueueEditDialog.cjs"),Pe=require("./components/organisms/ModerationQueue/QueueEditSheet.cjs"),e=require("./components/organisms/Table/Table.cjs"),r=require("./components/organisms/Table/table-variants.cjs"),Ie=require("./hooks/useCountdown.cjs"),l=require("./hooks/useKeySequence.cjs"),Me=require("./lib/utils.cjs");exports.Avatar=V.Avatar;exports.avatarVariants=q.avatarVariants;exports.Badge=d.Badge;exports.badgeVariants=b.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=v.Input;exports.iconVariants=i.iconVariants;exports.inputVariants=i.inputVariants;exports.Link=A.Link;exports.linkVariants=m.linkVariants;exports.PasswordInput=x.PasswordInput;exports.Combobox=k.Combobox;exports.Chip=D.Chip;exports.chipVariants=E.chipVariants;exports.Pill=B.Pill;exports.pillDotVariants=n.pillDotVariants;exports.pillVariants=n.pillVariants;exports.Eyebrow=y.Eyebrow;exports.eyebrowVariants=L.eyebrowVariants;exports.InlineCode=P.InlineCode;exports.inlineCodeVariants=I.inlineCodeVariants;exports.LabeledDivider=M.LabeledDivider;exports.Stat=O.Stat;exports.statValueVariants=G.statValueVariants;exports.ThemeToggle=F.ThemeToggle;exports.MultiSelect=N.MultiSelect;exports.Select=Q.Select;exports.selectOptionVariants=o.selectOptionVariants;exports.selectTriggerVariants=o.selectTriggerVariants;exports.Spinner=R.Spinner;exports.Switch=H.Switch;exports.switchThumbVariants=s.switchThumbVariants;exports.switchTrackVariants=s.switchTrackVariants;exports.Textarea=K.Textarea;exports.textareaVariants=_.textareaVariants;exports.AvatarStrip=U.AvatarStrip;exports.Tooltip=W.Tooltip;exports.CollapsibleSection=X.CollapsibleSection;exports.SegmentBar=f.SegmentBar;exports.Toast=j.Toast;exports.toastVariants=z.toastVariants;exports.Toaster=J.Toaster;exports.TONE_PREFIX=u.TONE_PREFIX;exports.toast=u.toast;exports.Alert=Y.Alert;exports.alertVariants=Z.alertVariants;exports.Accordion=$.Accordion;exports.DescriptionList=ee.DescriptionList;exports.descriptionListVariants=re.descriptionListVariants;exports.Pullquote=ae.Pullquote;exports.pullquoteVariants=te.pullquoteVariants;exports.CheckboxGroup=ie.CheckboxGroup;exports.checkboxGroupOptionsVariants=c.checkboxGroupOptionsVariants;exports.checkboxGroupPanelVariants=c.checkboxGroupPanelVariants;exports.RadioGroup=ne.RadioGroup;exports.radioDotVariants=a.radioDotVariants;exports.radioGroupOptionsVariants=a.radioGroupOptionsVariants;exports.radioOptionVariants=a.radioOptionVariants;exports.radioVariants=a.radioVariants;exports.Breadcrumbs=oe.Breadcrumbs;exports.breadcrumbVariants=se.breadcrumbVariants;exports.LiquidTabs=ue.LiquidTabs;exports.LiquidNav=ce.LiquidNav;exports.liquidTabId=le.liquidTabId;exports.Carousel=Ve.Carousel;exports.CallToAction=qe.CallToAction;exports.ctaVariants=de.ctaVariants;exports.EmptyState=be.EmptyState;exports.emptyStateVariants=pe.emptyStateVariants;exports.MediaPreview=Te.MediaPreview;exports.FileUpload=Ce.FileUpload;exports.ErrorState=Se.ErrorState;exports.errorStateVariants=he.errorStateVariants;exports.MatchupCard=ge.MatchupCard;exports.ActionBar=we.ActionBar;exports.actionBarVariants=ve.actionBarVariants;exports.Countdown=Ae.Countdown;exports.Dialog=me.Dialog;exports.Footer=xe.Footer;exports.Navbar=ke.Navbar;exports.navbarVariants=De.navbarVariants;exports.Sheet=Ee.Sheet;exports.ModerationQueue=Be.ModerationQueue;exports.editAction=ye.editAction;exports.QueueEditDialog=Le.QueueEditDialog;exports.QueueEditSheet=Pe.QueueEditSheet;exports.Table=e.Table;exports.TableBody=e.TableBody;exports.TableCaption=e.TableCaption;exports.TableCell=e.TableCell;exports.TableFooter=e.TableFooter;exports.TableHead=e.TableHead;exports.TableHeader=e.TableHeader;exports.TableRow=e.TableRow;exports.tableCellVariants=r.tableCellVariants;exports.tableHeadVariants=r.tableHeadVariants;exports.tableHeaderVariants=r.tableHeaderVariants;exports.tableRowVariants=r.tableRowVariants;exports.tableVariants=r.tableVariants;exports.tableWrapperVariants=r.tableWrapperVariants;exports.useCountdown=Ie.useCountdown;exports.KONAMI_CODE=l.KONAMI_CODE;exports.useKeySequence=l.useKeySequence;exports.cn=Me.cn;
|