@blakesteve/roster 5.9.0 → 5.10.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 +41 -22
- package/dist/components/atoms/Button/button-variants.js +1 -1
- package/dist/components/atoms/Eyebrow/eyebrow-variants.d.ts +2 -2
- package/dist/components/atoms/Input/input-variants.js +1 -1
- package/dist/components/atoms/Skeleton/Skeleton.cjs +1 -1
- package/dist/components/atoms/Skeleton/Skeleton.d.ts +19 -3
- package/dist/components/atoms/Skeleton/Skeleton.js +38 -33
- package/dist/components/atoms/ThemeToggle/ThemeToggle.d.ts +1 -1
- package/dist/components/molecules/CheckboxGroup/CheckboxGroup.d.ts +1 -1
- package/dist/components/molecules/CheckboxGroup/checkbox-group-variants.d.ts +1 -1
- package/dist/components/molecules/SkeletonPresets/SkeletonPresets.cjs +1 -1
- package/dist/components/molecules/SkeletonPresets/SkeletonPresets.d.ts +13 -4
- package/dist/components/molecules/SkeletonPresets/SkeletonPresets.js +35 -35
- package/dist/components/molecules/Toast/Toaster.d.ts +1 -1
- package/dist/components/organisms/Navbar/Navbar.cjs +1 -1
- package/dist/components/organisms/Navbar/Navbar.js +37 -37
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.js +4 -1
- package/dist/meta.json +3 -3
- package/dist/roster.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),m=require("react"),y=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),f=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),n=require("../../../lib/utils.cjs"),cr=require("../../../lib/labels.cjs"),q=require("../../atoms/Button/Button.cjs"),E=require("../../atoms/Link/Link.cjs"),J=require("../../atoms/Badge/Badge.cjs"),dr=require("../../atoms/Avatar/Avatar.cjs"),Q=require("../../atoms/Switch/switch-variants.cjs"),d=require("../../molecules/Menu/Menu.cjs"),lr=require("./navbar-variants.cjs"),L=require("../../../node_modules/@headlessui/react/dist/components/popover/popover.cjs"),ur=require("../../../node_modules/@headlessui/react/dist/components/transition/transition.cjs");function T({on:s,size:e}){return r.jsx("span",{"aria-hidden":"true","data-testid":"navbar-theme-track","data-checked":s?"":void 0,className:n.cn(Q.switchTrackVariants({size:e,variant:"neutral"}),"rst:pointer-events-none"),children:r.jsx("span",{className:n.cn(Q.switchThumbVariants({size:e}))})})}const D="rst:gap-2 rst:px-4 rst:[&>[data-menu-lead]]:w-auto rst:text-gray-700 rst:dark:text-gray-200 rst:focus:bg-gray-50 rst:focus:text-gray-700 rst:dark:focus:bg-gray-700 rst:dark:focus:text-gray-200",xr=n.cn(D,"rst:font-semibold rst:rounded-sm rst:hover:text-gray-900 rst:dark:hover:text-gray-100 rst:hover:focus:text-gray-900 rst:dark:hover:focus:text-gray-100"),W=new WeakMap;function hr(s){if(!s||typeof s=="string")return;let e=W.get(s);return e||(e=a=>r.jsx(s,{...a}),W.set(s,e)),e}const Y=n.cn(D,"rst:border rst:border-transparent rst:font-medium rst:text-gray-600 rst:dark:text-gray-400 rst:focus:text-gray-600 rst:dark:focus:text-gray-400 rst:hover:bg-gray-500/10 rst:dark:hover:bg-gray-400/15 rst:hover:focus:bg-gray-500/10 rst:dark:hover:focus:bg-gray-400/15"),Z=(s,e)=>typeof s=="function"?s({close:e}):s,mr={openMainMenu:"Open main menu",closeMainMenu:"Close menu",openUserMenu:"Open user menu",logIn:"Log In",logOut:"Log Out",darkMode:"Dark Mode",pendingInvitations:"Pending Invitations",inbox:s=>`Inbox (${s})`};function gr(s){return m.useSyncExternalStore(e=>{if(!s||typeof document>"u")return()=>{};const a=new MutationObserver(e);return a.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>a.disconnect()},()=>s&&document.documentElement.classList.contains("dark"),()=>!1)}function H(s,e){if(!e||!s)return!1;if(s.contains(e))return!0;const a=e.closest?.("[data-menu-panel]")?.getAttribute("data-menu-tree");return!!a&&!!s.querySelector(`[data-menu-tree="${CSS.escape(a)}"]`)}const yr='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function fr({close:s,panel:e,hamburger:a}){return m.useEffect(()=>{const x=p=>{const b=p.target;!H(e.current,b)&&!a.current?.contains(b)&&s()};return document.addEventListener("pointerdown",x,{capture:!0}),()=>document.removeEventListener("pointerdown",x,{capture:!0})},[s,e,a]),null}function pr({close:s,panel:e}){return m.useEffect(()=>{const a=p=>{H(e.current,p.target)||s()},x=requestAnimationFrame(()=>{e.current?.querySelector(yr)?.focus(),document.addEventListener("focusin",a)});return()=>{cancelAnimationFrame(x),document.removeEventListener("focusin",a)}},[s,e]),null}function vr({activePath:s,close:e}){const a=m.useRef(s);return m.useEffect(()=>{a.current!==s&&(a.current=s,e())},[s,e]),null}const br=({logoSrc:s,logoSize:e="2rem",logoHeight:a,logoWidth:x,logoClassName:p,brandName:b,items:_,activePath:w,routerElement:k,user:i,onLogin:M,onLogout:S,onInboxClick:j,onThemeToggle:v,actions:rr,brandElement:z,navActions:tr,userMenuItems:F=[],className:sr,variant:l="default",position:er="sticky",themeMode:O,labels:ar,notificationVariant:P="error",notificationFill:V="solid",...nr})=>{const o=cr.withLabels(mr,ar),ir=hr(k),N=(i?.notificationCount||0)>0,I=h=>typeof h=="number"?`${h}px`:h,$=a!==void 0||x!==void 0,G=$?{width:x===void 0?"auto":I(x),height:a===void 0?"auto":I(a)}:{width:I(e),height:I(e)},K=$&&"rst:object-contain rst:object-left rst:rtl:object-right",or=gr(O==="auto"),u=(O==="auto"?or?"dark":"light":O??(l==="white"||l==="default"?"light":"dark"))==="dark",A=l==="slate"||l==="primary"||l==="default"&&u||l==="white"&&u||l==="transparent"&&u,B=l==="primary"?{brand:"rst:text-primary-700-ink rst:hover:text-primary-700-ink/80 rst:dark:text-white rst:dark:hover:text-gray-200",linkBase:"rst:text-primary-700-ink/80 rst:hover:text-primary-700-ink rst:dark:text-gray-300 rst:dark:hover:text-white",linkActive:"rst:text-primary-700-ink rst:font-semibold rst:hover:text-primary-700-ink/80 rst:dark:text-primary-400 rst:dark:hover:text-primary-300",hamburger:"rst:text-primary-700-ink/80 rst:hover:bg-primary-700-ink/10 rst:hover:text-primary-700-ink rst:dark:text-gray-300 rst:dark:hover:bg-white/10 rst:dark:hover:text-white"}:{brand:A?"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:A?"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:A?"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:A?"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"},R=m.useRef(null),X=m.useRef(null);return r.jsx(L.Popover,{as:"nav",className:n.cn("rst:z-50",lr.navbarVariants({variant:l,position:er}),sr),...nr,children:({open:h,close:c})=>{const C=Z(rr,c),U=Z(tr,c);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(E.Link,{as:k,href:"/",to:"/",variant:"neutral",underline:"none",className:n.cn("rst:flex rst:items-center rst:gap-3 rst:transition-opacity",B.brand),children:[r.jsx("img",{src:s,alt:"",style:G,className:n.cn("rst:shrink-0",K,p??"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:_.map(t=>{const g=w===t.path;return r.jsxs(E.Link,{as:k,href:t.path,to:t.path,variant:"neutral",underline:"none",className:n.cn("rst:inline-flex rst:items-center rst:gap-1.5 rst:text-sm rst:transition-colors rst:duration-200",g?B.linkActive:B.linkBase),children:[t.label,t.badge&&r.jsx("span",{className:"rst:inline-flex",children:t.badge})]},t.path)})}),U,C??(i?r.jsx("div",{className:"rst:relative rst:ml-2",children:r.jsxs(d.Menu,{linkComponent:ir,children:[r.jsxs(d.MenuButton,{plain:!0,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 rst:before:absolute rst:before:-inset-1.5 rst:before:content-['']",children:[r.jsx("span",{className:"rst:sr-only",children:o.openUserMenu}),r.jsx(dr.Avatar,{"aria-hidden":"true",alt:"",initials:i.initials,src:i.avatarSrc,size:"sm",shape:"circle",colorScheme:i.avatarColor??"primary"}),N&&r.jsx("div",{className:"rst:absolute rst:-top-1 rst:-right-2",children:r.jsx(J.Badge,{fill:V,size:"xs",statusBadge:!0,variant:P,children:i.notificationCount})})]}),r.jsxs(d.MenuItems,{align:"end",offset:8,className:"rst:w-48 rst:min-w-0 rst:bg-white rst:dark:bg-gray-800 rst:ring-black/5 rst:dark:ring-white/10 rst:divide-y rst:divide-gray-100 rst:dark:divide-gray-700",children:[(N&&j||v)&&r.jsxs(d.MenuGroup,{className:"rst:py-1",children:[N&&j&&r.jsx(d.MenuItem,{onSelect:j,className:Y,icon:r.jsx(y.FontAwesomeIcon,{icon:f.faInbox,className:"rst:text-primary-500 rst:w-4"}),children:o.inbox(i.notificationCount??0)}),v&&r.jsx(d.MenuCheckboxItem,{checked:u,onCheckedChange:()=>v(),closeOnSelect:!1,className:D,icon:r.jsx(y.FontAwesomeIcon,{icon:f.faMoon,className:n.cn("rst:w-4 rst:transition-colors",u?"rst:text-amber-500":"rst:text-gray-400")}),indicator:r.jsx(T,{on:u,size:"xs"}),children:r.jsx("span",{className:"rst:font-medium",children:o.darkMode})})]}),F.length>0&&r.jsx(d.MenuGroup,{className:"rst:py-1",children:F.map(t=>r.jsx(d.MenuItem,{href:t.path,badge:t.badge,className:xr,children:t.label},t.path))}),S&&r.jsx(d.MenuGroup,{className:"rst:py-1",children:r.jsx(d.MenuItem,{onSelect:S,className:Y,icon:r.jsx(y.FontAwesomeIcon,{icon:f.faRightFromBracket,className:"rst:text-gray-400 rst:dark:text-gray-500 rst:w-4"}),children:o.logOut})})]})]})}):r.jsx(q.Button,{size:"sm",variant:"solid",colorScheme:"primary",onClick:M,children:o.logIn}))]}),r.jsx("div",{ref:X,"data-roster-hamburger":!0,className:"rst:flex rst:md:hidden",children:r.jsxs(L.PopoverButton,{className:n.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",B.hamburger),children:[r.jsx("span",{className:"rst:sr-only",children:o.openMainMenu}),h?r.jsx(y.FontAwesomeIcon,{icon:f.faXmark,className:"rst:block rst:h-6 rst:w-6","aria-hidden":"true"}):r.jsxs("div",{className:"rst:relative",children:[r.jsx(y.FontAwesomeIcon,{icon:f.faBars,className:"rst:block rst:h-6 rst:w-6","aria-hidden":"true"}),N&&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"})]})]})})]}),h&&r.jsx(fr,{close:c,panel:R,hamburger:X}),h&&r.jsx(pr,{close:c,panel:R}),h&&r.jsx(vr,{activePath:w,close:c}),r.jsx(ur.Transition,{as:m.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(L.PopoverPanel,{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",{ref:R,"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:G,className:n.cn("rst:shrink-0",K,p??"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(L.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:o.closeMainMenu}),r.jsx(y.FontAwesomeIcon,{icon:f.faXmark,className:"rst:h-6 rst:w-6","aria-hidden":"true"})]})})]}),r.jsxs("div",{className:"rst:mt-6",children:[U&&r.jsx("div",{className:"rst:mb-4",children:U}),r.jsxs("nav",{className:"rst:grid rst:gap-y-4",children:[_.map(t=>{const g=w===t.path;return r.jsx(E.Link,{as:k,href:t.path,to:t.path,onClick:()=>c(),variant:"neutral",underline:"none",className:n.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",g?"rst:bg-gray-50 rst:dark:bg-gray-700":"rst:text-gray-900 rst:dark:text-gray-100"),children:r.jsxs("span",{className:n.cn("rst:ml-3 rst:inline-flex rst:items-center rst:gap-1.5 rst:text-base rst:font-medium",g?"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)}),i&&F.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("hr",{className:"rst:border-gray-100 rst:dark:border-gray-700"}),F.map(t=>{const g=w===t.path;return r.jsxs(E.Link,{as:k,href:t.path,to:t.path,onClick:()=>c(),variant:"neutral",underline:"none",className:n.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",g?"rst:bg-gray-50 rst:dark:bg-gray-700":"rst:text-gray-900 rst:dark:text-gray-100"),children:[r.jsx("span",{className:n.cn("rst:ml-3 rst:text-base rst:font-medium",g?"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)})]})]})]})]}),(i||C||M)&&r.jsx("div",{className:"rst:py-6 rst:px-5 rst:space-y-4",children:C||(!i&&M?r.jsx(q.Button,{variant:"solid",colorScheme:"primary",className:"rst:w-full rst:justify-center",onClick:()=>{M(),c()},children:o.logIn}):r.jsxs(r.Fragment,{children:[N&&j&&r.jsx(q.Button,{variant:"ghost",colorScheme:"neutral",onClick:()=>{j?.(),c()},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(J.Badge,{fill:V,size:"xs",statusBadge:!0,variant:P,children:i?.notificationCount}),children:o.pendingInvitations}),v&&r.jsxs("div",{onClick:t=>{t.preventDefault(),v()},role:"switch","aria-checked":u,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(y.FontAwesomeIcon,{icon:f.faMoon,className:n.cn("rst:w-5 rst:transition-colors",u?"rst:text-amber-500":"rst:text-gray-400")}),r.jsx("span",{children:o.darkMode})]}),r.jsx(T,{on:u,size:"sm"})]}),S&&r.jsx(q.Button,{variant:"outline",colorScheme:"error",className:"rst:w-full rst:justify-center",onClick:()=>{S?.(),c()},children:o.logOut})]}))})]})})})]})}})};exports.Navbar=br;
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),m=require("react"),f=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),p=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),n=require("../../../lib/utils.cjs"),cr=require("../../../lib/labels.cjs"),q=require("../../atoms/Button/Button.cjs"),E=require("../../atoms/Link/Link.cjs"),J=require("../../atoms/Badge/Badge.cjs"),dr=require("../../atoms/Avatar/Avatar.cjs"),Q=require("../../atoms/Switch/switch-variants.cjs"),d=require("../../molecules/Menu/Menu.cjs"),lr=require("./navbar-variants.cjs"),L=require("../../../node_modules/@headlessui/react/dist/components/popover/popover.cjs"),ur=require("../../../node_modules/@headlessui/react/dist/components/transition/transition.cjs");function T({on:s,size:e}){return r.jsx("span",{"aria-hidden":"true","data-testid":"navbar-theme-track","data-checked":s?"":void 0,className:n.cn(Q.switchTrackVariants({size:e,variant:"neutral"}),"rst:pointer-events-none"),children:r.jsx("span",{className:n.cn(Q.switchThumbVariants({size:e}))})})}const D="rst:gap-2 rst:px-4 rst:[&>[data-menu-lead]]:w-auto rst:text-gray-700 rst:dark:text-gray-200 rst:focus:bg-gray-50 rst:focus:text-gray-700 rst:dark:focus:bg-gray-700 rst:dark:focus:text-gray-200",xr=n.cn(D,"rst:font-semibold rst:rounded-sm rst:hover:text-gray-900 rst:dark:hover:text-gray-100 rst:hover:focus:text-gray-900 rst:dark:hover:focus:text-gray-100"),W=new WeakMap;function hr(s){if(!s||typeof s=="string")return;let e=W.get(s);return e||(e=a=>r.jsx(s,{...a}),W.set(s,e)),e}const Y=n.cn(D,"rst:border rst:border-transparent rst:font-medium rst:text-gray-600 rst:dark:text-gray-400 rst:focus:text-gray-600 rst:dark:focus:text-gray-400 rst:hover:bg-gray-500/10 rst:dark:hover:bg-gray-400/15 rst:hover:focus:bg-gray-500/10 rst:dark:hover:focus:bg-gray-400/15"),Z=(s,e)=>typeof s=="function"?s({close:e}):s,mr={openMainMenu:"Open main menu",closeMainMenu:"Close menu",openUserMenu:"Open user menu",logIn:"Log In",logOut:"Log Out",darkMode:"Dark Mode",pendingInvitations:"Pending Invitations",inbox:s=>`Inbox (${s})`};function gr(s){return m.useSyncExternalStore(e=>{if(!s||typeof document>"u")return()=>{};const a=new MutationObserver(e);return a.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>a.disconnect()},()=>s&&document.documentElement.classList.contains("dark"),()=>!1)}function H(s,e){if(!e||!s)return!1;if(s.contains(e))return!0;const a=e.closest?.("[data-menu-panel]")?.getAttribute("data-menu-tree");return!!a&&!!s.querySelector(`[data-menu-tree="${CSS.escape(a)}"]`)}const yr='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function fr({close:s,panel:e,hamburger:a}){return m.useEffect(()=>{const x=g=>{const b=g.target;!H(e.current,b)&&!a.current?.contains(b)&&s()};return document.addEventListener("pointerdown",x,{capture:!0}),()=>document.removeEventListener("pointerdown",x,{capture:!0})},[s,e,a]),null}function pr({close:s,panel:e}){return m.useEffect(()=>{const a=g=>{g.target!==e.current?.parentElement&&(H(e.current,g.target)||s())},x=requestAnimationFrame(()=>{e.current?.querySelector(yr)?.focus(),document.addEventListener("focusin",a)});return()=>{cancelAnimationFrame(x),document.removeEventListener("focusin",a)}},[s,e]),null}function vr({activePath:s,close:e}){const a=m.useRef(s);return m.useEffect(()=>{a.current!==s&&(a.current=s,e())},[s,e]),null}const br=({logoSrc:s,logoSize:e="2rem",logoHeight:a,logoWidth:x,logoClassName:g,brandName:b,items:_,activePath:w,routerElement:k,user:i,onLogin:M,onLogout:S,onInboxClick:j,onThemeToggle:v,actions:rr,brandElement:z,navActions:tr,userMenuItems:F=[],className:sr,variant:l="default",position:er="sticky",themeMode:O,labels:ar,notificationVariant:P="error",notificationFill:V="solid",...nr})=>{const o=cr.withLabels(mr,ar),ir=hr(k),N=(i?.notificationCount||0)>0,I=h=>typeof h=="number"?`${h}px`:h,$=a!==void 0||x!==void 0,G=$?{width:x===void 0?"auto":I(x),height:a===void 0?"auto":I(a)}:{width:I(e),height:I(e)},K=$&&"rst:object-contain rst:object-left rst:rtl:object-right",or=gr(O==="auto"),u=(O==="auto"?or?"dark":"light":O??(l==="white"||l==="default"?"light":"dark"))==="dark",A=l==="slate"||l==="primary"||l==="default"&&u||l==="white"&&u||l==="transparent"&&u,B=l==="primary"?{brand:"rst:text-primary-700-ink rst:hover:text-primary-700-ink/80 rst:dark:text-white rst:dark:hover:text-gray-200",linkBase:"rst:text-primary-700-ink/80 rst:hover:text-primary-700-ink rst:dark:text-gray-300 rst:dark:hover:text-white",linkActive:"rst:text-primary-700-ink rst:font-semibold rst:hover:text-primary-700-ink/80 rst:dark:text-primary-400 rst:dark:hover:text-primary-300",hamburger:"rst:text-primary-700-ink/80 rst:hover:bg-primary-700-ink/10 rst:hover:text-primary-700-ink rst:dark:text-gray-300 rst:dark:hover:bg-white/10 rst:dark:hover:text-white"}:{brand:A?"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:A?"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:A?"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:A?"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"},R=m.useRef(null),X=m.useRef(null);return r.jsx(L.Popover,{as:"nav",className:n.cn("rst:z-50",lr.navbarVariants({variant:l,position:er}),sr),...nr,children:({open:h,close:c})=>{const C=Z(rr,c),U=Z(tr,c);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(E.Link,{as:k,href:"/",to:"/",variant:"neutral",underline:"none",className:n.cn("rst:flex rst:items-center rst:gap-3 rst:transition-opacity",B.brand),children:[r.jsx("img",{src:s,alt:"",style:G,className:n.cn("rst:shrink-0",K,g??"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:_.map(t=>{const y=w===t.path;return r.jsxs(E.Link,{as:k,href:t.path,to:t.path,variant:"neutral",underline:"none",className:n.cn("rst:inline-flex rst:items-center rst:gap-1.5 rst:text-sm rst:transition-colors rst:duration-200",y?B.linkActive:B.linkBase),children:[t.label,t.badge&&r.jsx("span",{className:"rst:inline-flex",children:t.badge})]},t.path)})}),U,C??(i?r.jsx("div",{className:"rst:relative rst:ml-2",children:r.jsxs(d.Menu,{linkComponent:ir,children:[r.jsxs(d.MenuButton,{plain:!0,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 rst:before:absolute rst:before:-inset-1.5 rst:before:content-['']",children:[r.jsx("span",{className:"rst:sr-only",children:o.openUserMenu}),r.jsx(dr.Avatar,{"aria-hidden":"true",alt:"",initials:i.initials,src:i.avatarSrc,size:"sm",shape:"circle",colorScheme:i.avatarColor??"primary"}),N&&r.jsx("div",{className:"rst:absolute rst:-top-1 rst:-right-2",children:r.jsx(J.Badge,{fill:V,size:"xs",statusBadge:!0,variant:P,children:i.notificationCount})})]}),r.jsxs(d.MenuItems,{align:"end",offset:8,className:"rst:w-48 rst:min-w-0 rst:bg-white rst:dark:bg-gray-800 rst:ring-black/5 rst:dark:ring-white/10 rst:divide-y rst:divide-gray-100 rst:dark:divide-gray-700",children:[(N&&j||v)&&r.jsxs(d.MenuGroup,{className:"rst:py-1",children:[N&&j&&r.jsx(d.MenuItem,{onSelect:j,className:Y,icon:r.jsx(f.FontAwesomeIcon,{icon:p.faInbox,className:"rst:text-primary-500 rst:w-4"}),children:o.inbox(i.notificationCount??0)}),v&&r.jsx(d.MenuCheckboxItem,{checked:u,onCheckedChange:()=>v(),closeOnSelect:!1,className:D,icon:r.jsx(f.FontAwesomeIcon,{icon:p.faMoon,className:n.cn("rst:w-4 rst:transition-colors",u?"rst:text-amber-500":"rst:text-gray-400")}),indicator:r.jsx(T,{on:u,size:"xs"}),children:r.jsx("span",{className:"rst:font-medium",children:o.darkMode})})]}),F.length>0&&r.jsx(d.MenuGroup,{className:"rst:py-1",children:F.map(t=>r.jsx(d.MenuItem,{href:t.path,badge:t.badge,className:xr,children:t.label},t.path))}),S&&r.jsx(d.MenuGroup,{className:"rst:py-1",children:r.jsx(d.MenuItem,{onSelect:S,className:Y,icon:r.jsx(f.FontAwesomeIcon,{icon:p.faRightFromBracket,className:"rst:text-gray-400 rst:dark:text-gray-500 rst:w-4"}),children:o.logOut})})]})]})}):r.jsx(q.Button,{size:"sm",variant:"solid",colorScheme:"primary",onClick:M,children:o.logIn}))]}),r.jsx("div",{ref:X,"data-roster-hamburger":!0,className:"rst:flex rst:md:hidden",children:r.jsxs(L.PopoverButton,{className:n.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",B.hamburger),children:[r.jsx("span",{className:"rst:sr-only",children:o.openMainMenu}),h?r.jsx(f.FontAwesomeIcon,{icon:p.faXmark,className:"rst:block rst:h-6 rst:w-6","aria-hidden":"true"}):r.jsxs("div",{className:"rst:relative",children:[r.jsx(f.FontAwesomeIcon,{icon:p.faBars,className:"rst:block rst:h-6 rst:w-6","aria-hidden":"true"}),N&&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"})]})]})})]}),h&&r.jsx(fr,{close:c,panel:R,hamburger:X}),h&&r.jsx(pr,{close:c,panel:R}),h&&r.jsx(vr,{activePath:w,close:c}),r.jsx(ur.Transition,{as:m.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(L.PopoverPanel,{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",{ref:R,"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:G,className:n.cn("rst:shrink-0",K,g??"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(L.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:o.closeMainMenu}),r.jsx(f.FontAwesomeIcon,{icon:p.faXmark,className:"rst:h-6 rst:w-6","aria-hidden":"true"})]})})]}),r.jsxs("div",{className:"rst:mt-6",children:[U&&r.jsx("div",{className:"rst:mb-4",children:U}),r.jsxs("nav",{className:"rst:grid rst:gap-y-4",children:[_.map(t=>{const y=w===t.path;return r.jsx(E.Link,{as:k,href:t.path,to:t.path,onClick:()=>c(),variant:"neutral",underline:"none",className:n.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",y?"rst:bg-gray-50 rst:dark:bg-gray-700":"rst:text-gray-900 rst:dark:text-gray-100"),children:r.jsxs("span",{className:n.cn("rst:ml-3 rst:inline-flex rst:items-center rst:gap-1.5 rst:text-base rst:font-medium",y?"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)}),i&&F.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("hr",{className:"rst:border-gray-100 rst:dark:border-gray-700"}),F.map(t=>{const y=w===t.path;return r.jsxs(E.Link,{as:k,href:t.path,to:t.path,onClick:()=>c(),variant:"neutral",underline:"none",className:n.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",y?"rst:bg-gray-50 rst:dark:bg-gray-700":"rst:text-gray-900 rst:dark:text-gray-100"),children:[r.jsx("span",{className:n.cn("rst:ml-3 rst:text-base rst:font-medium",y?"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)})]})]})]})]}),(i||C||M)&&r.jsx("div",{className:"rst:py-6 rst:px-5 rst:space-y-4",children:C||(!i&&M?r.jsx(q.Button,{variant:"solid",colorScheme:"primary",className:"rst:w-full rst:justify-center",onClick:()=>{M(),c()},children:o.logIn}):r.jsxs(r.Fragment,{children:[N&&j&&r.jsx(q.Button,{variant:"ghost",colorScheme:"neutral",onClick:()=>{j?.(),c()},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(J.Badge,{fill:V,size:"xs",statusBadge:!0,variant:P,children:i?.notificationCount}),children:o.pendingInvitations}),v&&r.jsxs("div",{onClick:t=>{t.preventDefault(),v()},role:"switch","aria-checked":u,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(f.FontAwesomeIcon,{icon:p.faMoon,className:n.cn("rst:w-5 rst:transition-colors",u?"rst:text-amber-500":"rst:text-gray-400")}),r.jsx("span",{children:o.darkMode})]}),r.jsx(T,{on:u,size:"sm"})]}),S&&r.jsx(q.Button,{variant:"outline",colorScheme:"error",className:"rst:w-full rst:justify-center",onClick:()=>{S?.(),c()},children:o.logOut})]}))})]})})})]})}})};exports.Navbar=br;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r, jsxs as a, Fragment as U } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { FontAwesomeIcon as
|
|
3
|
+
import ur, { useRef as R, Fragment as hr, useEffect as z } from "react";
|
|
4
|
+
import { FontAwesomeIcon as y } from "../../../node_modules/@fortawesome/react-fontawesome/dist/index.js";
|
|
5
5
|
import { faInbox as gr, faMoon as W, faRightFromBracket as fr, faXmark as Y, faBars as yr } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
|
|
6
6
|
import { cn as i } from "../../../lib/utils.js";
|
|
7
7
|
import { withLabels as pr } from "../../../lib/labels.js";
|
|
@@ -49,7 +49,7 @@ const tr = /* @__PURE__ */ i(
|
|
|
49
49
|
inbox: (e) => `Inbox (${e})`
|
|
50
50
|
};
|
|
51
51
|
function Br(e) {
|
|
52
|
-
return
|
|
52
|
+
return ur.useSyncExternalStore(
|
|
53
53
|
(s) => {
|
|
54
54
|
if (!e || typeof document > "u") return () => {
|
|
55
55
|
};
|
|
@@ -72,22 +72,22 @@ function sr(e, s) {
|
|
|
72
72
|
const Ir = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
73
73
|
function Lr({ close: e, panel: s, hamburger: n }) {
|
|
74
74
|
return z(() => {
|
|
75
|
-
const
|
|
76
|
-
const x =
|
|
75
|
+
const u = (g) => {
|
|
76
|
+
const x = g.target;
|
|
77
77
|
!sr(s.current, x) && !n.current?.contains(x) && e();
|
|
78
78
|
};
|
|
79
|
-
return document.addEventListener("pointerdown",
|
|
79
|
+
return document.addEventListener("pointerdown", u, { capture: !0 }), () => document.removeEventListener("pointerdown", u, { capture: !0 });
|
|
80
80
|
}, [e, s, n]), null;
|
|
81
81
|
}
|
|
82
82
|
function Ur({ close: e, panel: s }) {
|
|
83
83
|
return z(() => {
|
|
84
|
-
const n = (
|
|
85
|
-
sr(s.current,
|
|
86
|
-
},
|
|
84
|
+
const n = (g) => {
|
|
85
|
+
g.target !== s.current?.parentElement && (sr(s.current, g.target) || e());
|
|
86
|
+
}, u = requestAnimationFrame(() => {
|
|
87
87
|
s.current?.querySelector(Ir)?.focus(), document.addEventListener("focusin", n);
|
|
88
88
|
});
|
|
89
89
|
return () => {
|
|
90
|
-
cancelAnimationFrame(
|
|
90
|
+
cancelAnimationFrame(u), document.removeEventListener("focusin", n);
|
|
91
91
|
};
|
|
92
92
|
}, [e, s]), null;
|
|
93
93
|
}
|
|
@@ -104,8 +104,8 @@ const Hr = ({
|
|
|
104
104
|
logoSrc: e,
|
|
105
105
|
logoSize: s = "2rem",
|
|
106
106
|
logoHeight: n,
|
|
107
|
-
logoWidth:
|
|
108
|
-
logoClassName:
|
|
107
|
+
logoWidth: u,
|
|
108
|
+
logoClassName: g,
|
|
109
109
|
brandName: x,
|
|
110
110
|
items: $,
|
|
111
111
|
activePath: N,
|
|
@@ -128,8 +128,8 @@ const Hr = ({
|
|
|
128
128
|
notificationFill: V = "solid",
|
|
129
129
|
...dr
|
|
130
130
|
}) => {
|
|
131
|
-
const c = pr(Ar, cr), lr = jr(v), k = (o?.notificationCount || 0) > 0, C = (
|
|
132
|
-
width:
|
|
131
|
+
const c = pr(Ar, cr), lr = jr(v), k = (o?.notificationCount || 0) > 0, C = (h) => typeof h == "number" ? `${h}px` : h, G = n !== void 0 || u !== void 0, X = G ? {
|
|
132
|
+
width: u === void 0 ? "auto" : C(u),
|
|
133
133
|
height: n === void 0 ? "auto" : C(n)
|
|
134
134
|
} : { width: C(s), height: C(s) }, J = G && "rst:object-contain rst:object-left rst:rtl:object-right", mr = Br(B === "auto"), m = (B === "auto" ? mr ? "dark" : "light" : B ?? (l === "white" || l === "default" ? "light" : "dark")) === "dark", E = l === "slate" || l === "primary" || l === "default" && m || l === "white" && m || l === "transparent" && m, F = l === "primary" ? {
|
|
135
135
|
// On primary-700, text is that fill's ink (the dimmer links at 80%),
|
|
@@ -152,7 +152,7 @@ const Hr = ({
|
|
|
152
152
|
as: "nav",
|
|
153
153
|
className: i("rst:z-50", Sr({ variant: l, position: or }), ir),
|
|
154
154
|
...dr,
|
|
155
|
-
children: ({ open:
|
|
155
|
+
children: ({ open: h, close: d }) => {
|
|
156
156
|
const O = er(ar, d), L = er(nr, d);
|
|
157
157
|
return /* @__PURE__ */ a(U, { children: [
|
|
158
158
|
/* @__PURE__ */ a("div", { className: "rst:container rst:mx-auto rst:flex rst:items-center rst:justify-between rst:px-4 rst:h-16", children: [
|
|
@@ -175,7 +175,7 @@ const Hr = ({
|
|
|
175
175
|
src: e,
|
|
176
176
|
alt: "",
|
|
177
177
|
style: X,
|
|
178
|
-
className: i("rst:shrink-0", J,
|
|
178
|
+
className: i("rst:shrink-0", J, g ?? "rst:rounded-md")
|
|
179
179
|
}
|
|
180
180
|
),
|
|
181
181
|
q ?? /* @__PURE__ */ r("span", { className: "rst:text-xl rst:font-bold rst:tracking-tight", children: x })
|
|
@@ -184,7 +184,7 @@ const Hr = ({
|
|
|
184
184
|
),
|
|
185
185
|
/* @__PURE__ */ a("div", { className: "rst:hidden rst:md:flex rst:items-center rst:gap-8", children: [
|
|
186
186
|
/* @__PURE__ */ r("div", { className: "rst:flex rst:items-center rst:gap-6", children: $.map((t) => {
|
|
187
|
-
const
|
|
187
|
+
const f = N === t.path;
|
|
188
188
|
return /* @__PURE__ */ a(
|
|
189
189
|
A,
|
|
190
190
|
{
|
|
@@ -195,7 +195,7 @@ const Hr = ({
|
|
|
195
195
|
underline: "none",
|
|
196
196
|
className: i(
|
|
197
197
|
"rst:inline-flex rst:items-center rst:gap-1.5 rst:text-sm rst:transition-colors rst:duration-200",
|
|
198
|
-
|
|
198
|
+
f ? F.linkActive : F.linkBase
|
|
199
199
|
),
|
|
200
200
|
children: [
|
|
201
201
|
t.label,
|
|
@@ -252,7 +252,7 @@ const Hr = ({
|
|
|
252
252
|
{
|
|
253
253
|
onSelect: b,
|
|
254
254
|
className: tr,
|
|
255
|
-
icon: /* @__PURE__ */ r(
|
|
255
|
+
icon: /* @__PURE__ */ r(y, { icon: gr, className: "rst:text-primary-500 rst:w-4" }),
|
|
256
256
|
children: c.inbox(o.notificationCount ?? 0)
|
|
257
257
|
}
|
|
258
258
|
),
|
|
@@ -264,7 +264,7 @@ const Hr = ({
|
|
|
264
264
|
closeOnSelect: !1,
|
|
265
265
|
className: K,
|
|
266
266
|
icon: /* @__PURE__ */ r(
|
|
267
|
-
|
|
267
|
+
y,
|
|
268
268
|
{
|
|
269
269
|
icon: W,
|
|
270
270
|
className: i("rst:w-4 rst:transition-colors", m ? "rst:text-amber-500" : "rst:text-gray-400")
|
|
@@ -281,7 +281,7 @@ const Hr = ({
|
|
|
281
281
|
{
|
|
282
282
|
onSelect: M,
|
|
283
283
|
className: tr,
|
|
284
|
-
icon: /* @__PURE__ */ r(
|
|
284
|
+
icon: /* @__PURE__ */ r(y, { icon: fr, className: "rst:text-gray-400 rst:dark:text-gray-500 rst:w-4" }),
|
|
285
285
|
children: c.logOut
|
|
286
286
|
}
|
|
287
287
|
) })
|
|
@@ -299,8 +299,8 @@ const Hr = ({
|
|
|
299
299
|
),
|
|
300
300
|
children: [
|
|
301
301
|
/* @__PURE__ */ r("span", { className: "rst:sr-only", children: c.openMainMenu }),
|
|
302
|
-
|
|
303
|
-
|
|
302
|
+
h ? /* @__PURE__ */ r(
|
|
303
|
+
y,
|
|
304
304
|
{
|
|
305
305
|
icon: Y,
|
|
306
306
|
className: "rst:block rst:h-6 rst:w-6",
|
|
@@ -308,7 +308,7 @@ const Hr = ({
|
|
|
308
308
|
}
|
|
309
309
|
) : /* @__PURE__ */ a("div", { className: "rst:relative", children: [
|
|
310
310
|
/* @__PURE__ */ r(
|
|
311
|
-
|
|
311
|
+
y,
|
|
312
312
|
{
|
|
313
313
|
icon: yr,
|
|
314
314
|
className: "rst:block rst:h-6 rst:w-6",
|
|
@@ -321,13 +321,13 @@ const Hr = ({
|
|
|
321
321
|
}
|
|
322
322
|
) })
|
|
323
323
|
] }),
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
324
|
+
h && /* @__PURE__ */ r(Lr, { close: d, panel: I, hamburger: Q }),
|
|
325
|
+
h && /* @__PURE__ */ r(Ur, { close: d, panel: I }),
|
|
326
|
+
h && /* @__PURE__ */ r(Dr, { activePath: N, close: d }),
|
|
327
327
|
/* @__PURE__ */ r(
|
|
328
328
|
Fr,
|
|
329
329
|
{
|
|
330
|
-
as:
|
|
330
|
+
as: hr,
|
|
331
331
|
enter: "rst:duration-200 rst:ease-out",
|
|
332
332
|
enterFrom: "rst:opacity-0 rst:scale-95",
|
|
333
333
|
enterTo: "rst:opacity-100 rst:scale-100",
|
|
@@ -348,7 +348,7 @@ const Hr = ({
|
|
|
348
348
|
src: e,
|
|
349
349
|
alt: "",
|
|
350
350
|
style: X,
|
|
351
|
-
className: i("rst:shrink-0", J,
|
|
351
|
+
className: i("rst:shrink-0", J, g ?? "rst:rounded-md")
|
|
352
352
|
}
|
|
353
353
|
),
|
|
354
354
|
q ?? /* @__PURE__ */ r("span", { className: "rst:font-bold rst:text-gray-900 rst:dark:text-white", children: x })
|
|
@@ -356,7 +356,7 @@ const Hr = ({
|
|
|
356
356
|
/* @__PURE__ */ r("div", { className: "rst:-mr-2", children: /* @__PURE__ */ a(T, { 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: [
|
|
357
357
|
/* @__PURE__ */ r("span", { className: "rst:sr-only", children: c.closeMainMenu }),
|
|
358
358
|
/* @__PURE__ */ r(
|
|
359
|
-
|
|
359
|
+
y,
|
|
360
360
|
{
|
|
361
361
|
icon: Y,
|
|
362
362
|
className: "rst:h-6 rst:w-6",
|
|
@@ -369,7 +369,7 @@ const Hr = ({
|
|
|
369
369
|
L && /* @__PURE__ */ r("div", { className: "rst:mb-4", children: L }),
|
|
370
370
|
/* @__PURE__ */ a("nav", { className: "rst:grid rst:gap-y-4", children: [
|
|
371
371
|
$.map((t) => {
|
|
372
|
-
const
|
|
372
|
+
const f = N === t.path;
|
|
373
373
|
return /* @__PURE__ */ r(
|
|
374
374
|
A,
|
|
375
375
|
{
|
|
@@ -382,14 +382,14 @@ const Hr = ({
|
|
|
382
382
|
className: i(
|
|
383
383
|
"rst:-m-3 rst:flex rst:items-center rst:rounded-md rst:p-3 rst:transition-colors",
|
|
384
384
|
"rst:hover:bg-gray-50 rst:dark:hover:bg-gray-700",
|
|
385
|
-
|
|
385
|
+
f ? "rst:bg-gray-50 rst:dark:bg-gray-700" : "rst:text-gray-900 rst:dark:text-gray-100"
|
|
386
386
|
),
|
|
387
387
|
children: /* @__PURE__ */ a(
|
|
388
388
|
"span",
|
|
389
389
|
{
|
|
390
390
|
className: i(
|
|
391
391
|
"rst:ml-3 rst:inline-flex rst:items-center rst:gap-1.5 rst:text-base rst:font-medium",
|
|
392
|
-
|
|
392
|
+
f ? "rst:text-primary-600 rst:dark:text-primary-400 rst:font-bold" : "rst:text-gray-900 rst:dark:text-gray-100"
|
|
393
393
|
),
|
|
394
394
|
children: [
|
|
395
395
|
t.label,
|
|
@@ -404,7 +404,7 @@ const Hr = ({
|
|
|
404
404
|
o && S.length > 0 && /* @__PURE__ */ a(U, { children: [
|
|
405
405
|
/* @__PURE__ */ r("hr", { className: "rst:border-gray-100 rst:dark:border-gray-700" }),
|
|
406
406
|
S.map((t) => {
|
|
407
|
-
const
|
|
407
|
+
const f = N === t.path;
|
|
408
408
|
return /* @__PURE__ */ a(
|
|
409
409
|
A,
|
|
410
410
|
{
|
|
@@ -417,7 +417,7 @@ const Hr = ({
|
|
|
417
417
|
className: i(
|
|
418
418
|
"rst:-m-3 rst:flex rst:items-center rst:rounded-md rst:p-3 rst:transition-colors",
|
|
419
419
|
"rst:hover:bg-gray-50 rst:dark:hover:bg-gray-700",
|
|
420
|
-
|
|
420
|
+
f ? "rst:bg-gray-50 rst:dark:bg-gray-700" : "rst:text-gray-900 rst:dark:text-gray-100"
|
|
421
421
|
),
|
|
422
422
|
children: [
|
|
423
423
|
/* @__PURE__ */ r(
|
|
@@ -425,7 +425,7 @@ const Hr = ({
|
|
|
425
425
|
{
|
|
426
426
|
className: i(
|
|
427
427
|
"rst:ml-3 rst:text-base rst:font-medium",
|
|
428
|
-
|
|
428
|
+
f ? "rst:text-primary-600 rst:dark:text-primary-400 rst:font-bold" : "rst:text-gray-900 rst:dark:text-gray-100"
|
|
429
429
|
),
|
|
430
430
|
children: t.label
|
|
431
431
|
}
|
|
@@ -492,7 +492,7 @@ const Hr = ({
|
|
|
492
492
|
children: [
|
|
493
493
|
/* @__PURE__ */ a("div", { className: "rst:flex rst:items-center rst:gap-3 rst:font-medium", children: [
|
|
494
494
|
/* @__PURE__ */ r(
|
|
495
|
-
|
|
495
|
+
y,
|
|
496
496
|
{
|
|
497
497
|
icon: W,
|
|
498
498
|
className: i(
|
package/dist/lib/utils.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../node_modules/clsx/dist/clsx.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../node_modules/clsx/dist/clsx.cjs"),o=require("../node_modules/tailwind-merge/dist/bundle-mjs.cjs"),r=o.extendTailwindMerge({prefix:"rst",extend:{classGroups:{shadow:["elevation-raised","elevation-anchored","elevation-overlay","elevation-control"],rounded:["rounded-skeleton"]}}});function t(...e){return r(n.clsx(e))}exports.cn=t;
|
package/dist/lib/utils.js
CHANGED
|
@@ -20,7 +20,10 @@ const n = /* @__PURE__ */ r({
|
|
|
20
20
|
"elevation-anchored",
|
|
21
21
|
"elevation-overlay",
|
|
22
22
|
"elevation-control"
|
|
23
|
-
]
|
|
23
|
+
],
|
|
24
|
+
/* A skeleton block's corners, read from its own token. Same reason: a
|
|
25
|
+
caller's `rounded-*` has to replace it, not sit beside it. */
|
|
26
|
+
rounded: ["rounded-skeleton"]
|
|
24
27
|
}
|
|
25
28
|
}
|
|
26
29
|
});
|
package/dist/meta.json
CHANGED