@blakesteve/roster 5.0.1 → 5.1.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 +54 -7
- package/dist/components/atoms/Chip/Chip.cjs +1 -1
- package/dist/components/atoms/Chip/Chip.js +27 -27
- package/dist/components/atoms/Disclosure/Disclosure.cjs +1 -1
- package/dist/components/atoms/Disclosure/Disclosure.js +42 -44
- package/dist/components/atoms/Stat/Stat.cjs +1 -1
- package/dist/components/atoms/Stat/Stat.d.ts +27 -2
- package/dist/components/atoms/Stat/Stat.js +38 -13
- package/dist/components/atoms/Switch/Switch.cjs +1 -1
- package/dist/components/atoms/Switch/Switch.d.ts +11 -1
- package/dist/components/atoms/Switch/Switch.js +38 -36
- package/dist/components/atoms/Switch/switch-variants.cjs +1 -1
- package/dist/components/atoms/Switch/switch-variants.js +1 -1
- package/dist/components/molecules/LiquidTabs/LiquidNav.cjs +1 -0
- package/dist/components/molecules/LiquidTabs/LiquidNav.d.ts +62 -0
- package/dist/components/molecules/LiquidTabs/LiquidNav.js +78 -0
- package/dist/components/molecules/LiquidTabs/LiquidTabs.cjs +1 -0
- package/dist/components/molecules/LiquidTabs/LiquidTabs.d.ts +69 -0
- package/dist/components/molecules/LiquidTabs/LiquidTabs.js +92 -0
- package/dist/components/molecules/LiquidTabs/liquid-pill.cjs +1 -0
- package/dist/components/molecules/LiquidTabs/liquid-pill.d.ts +56 -0
- package/dist/components/molecules/LiquidTabs/liquid-pill.js +129 -0
- package/dist/components/molecules/LiquidTabs/liquid-tab-id.cjs +1 -0
- package/dist/components/molecules/LiquidTabs/liquid-tab-id.d.ts +12 -0
- package/dist/components/molecules/LiquidTabs/liquid-tab-id.js +6 -0
- package/dist/components/molecules/Toast/Toaster.cjs +1 -1
- package/dist/components/molecules/Toast/Toaster.d.ts +7 -0
- package/dist/components/molecules/Toast/Toaster.js +67 -45
- package/dist/components/organisms/Dialog/Dialog.cjs +1 -1
- package/dist/components/organisms/Dialog/Dialog.js +102 -79
- package/dist/components/organisms/Navbar/Navbar.cjs +1 -1
- package/dist/components/organisms/Navbar/Navbar.js +157 -157
- package/dist/components/organisms/Sheet/Sheet.cjs +1 -0
- package/dist/components/organisms/Sheet/Sheet.d.ts +82 -0
- package/dist/components/organisms/Sheet/Sheet.js +303 -0
- package/dist/components/organisms/Sheet/sheet-drag.cjs +1 -0
- package/dist/components/organisms/Sheet/sheet-drag.d.ts +40 -0
- package/dist/components/organisms/Sheet/sheet-drag.js +22 -0
- package/dist/index.d.ts +4 -1
- package/dist/internal/motion.cjs +1 -0
- package/dist/internal/motion.d.ts +12 -0
- package/dist/internal/motion.js +21 -0
- package/dist/internal/page-inert.cjs +1 -0
- package/dist/internal/page-inert.d.ts +51 -0
- package/dist/internal/page-inert.js +36 -0
- package/dist/meta.json +3 -3
- package/dist/roster.cjs +1 -1
- package/dist/roster.css +1 -1
- package/dist/roster.js +128 -122
- package/package.json +1 -1
- package/dist/components/atoms/LiquidTabs/LiquidTabs.cjs +0 -1
- package/dist/components/atoms/LiquidTabs/LiquidTabs.d.ts +0 -39
- package/dist/components/atoms/LiquidTabs/LiquidTabs.js +0 -120
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),t=require("react-hot-toast"),E=require("react"),g=require("react-dom"),q=require("./Toast.cjs"),v=require("../../../internal/popup.cjs"),y=require("../../../internal/page-inert.cjs"),R=require("../../atoms/Spinner/Spinner.cjs"),h=require("./toast-api.cjs");function j({position:i="bottom-right",duration:r=4e3,dismissible:c=!0,variant:a="soft",gutter:u,reverseOrder:l,containerClassName:m}){const{ref:d,inDarkScope:p}=v.useDarkScope(),f=E.useSyncExternalStore(x,O,M),S=s.jsx(t.Toaster,{position:i,gutter:u,reverseOrder:l,containerClassName:m,toastOptions:{success:{duration:r},error:{duration:r},blank:{duration:r},custom:{duration:r}},children:e=>{const T=e.className?.split(/\s+/)??[],o=N.find(b=>T.includes(`${h.TONE_PREFIX}${b}`)),n=o?k[o]:A[e.type]??"neutral";return s.jsx(q.Toast,{colorScheme:n,variant:a,icon:e.icon??(e.type==="loading"?s.jsx(R.Spinner,{size:"sm"}):void 0),onDismiss:c?()=>t.toast.dismiss(e.id):void 0,...n==="error"?{role:"alert","aria-live":"assertive"}:e.ariaProps,className:D[e.visible?"in":"out"],children:t.resolveValue(e.message,e)})}});return s.jsxs(s.Fragment,{children:[s.jsx("span",{ref:d,hidden:!0}),f&&g.createPortal(s.jsx("div",{...y.TOASTER_MARKER,className:p?"dark":void 0,style:{display:"contents"},children:S}),document.body)]})}const x=()=>()=>{},O=()=>!0,M=()=>!1,N=["info","warning"],k={info:"info",warning:"amber"},A={success:"success",error:"error",loading:"neutral",blank:"neutral",custom:"neutral"},D={in:"rst:motion-safe:animate-in rst:motion-safe:fade-in-0 rst:motion-safe:slide-in-from-bottom-2",out:"rst:opacity-0 rst:transition-opacity rst:duration-200"};exports.Toaster=j;
|
|
@@ -29,5 +29,12 @@ export interface ToasterProps extends Pick<HotToasterProps, "position" | "gutter
|
|
|
29
29
|
* someone else's markup. That is what lets `Toast` be tested and viewed on its
|
|
30
30
|
* own, and what lets a toast carry a title, a dismiss control and the popover
|
|
31
31
|
* tokens.
|
|
32
|
+
*
|
|
33
|
+
* Rendered into `<body>` rather than where it is placed, carrying
|
|
34
|
+
* `data-roster-toaster`. An open `Dialog` or `Sheet` makes every other child of
|
|
35
|
+
* `<body>` inert and hidden from assistive technology, and a toast host inside
|
|
36
|
+
* one of them would go silent with it: a "Saved" or a failure fired from the
|
|
37
|
+
* dialog would be shown and never announced. Where it is placed, it leaves an
|
|
38
|
+
* empty `<span hidden>`, which is how it carries a scoped `.dark` across.
|
|
32
39
|
*/
|
|
33
40
|
export declare function Toaster({ position, duration, dismissible, variant, gutter, reverseOrder, containerClassName, }: ToasterProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,62 +1,84 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { Toaster as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import { jsxs as E, Fragment as b, jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import { Toaster as v, resolveValue as T, toast as h } from "react-hot-toast";
|
|
4
|
+
import { useSyncExternalStore as y } from "react";
|
|
5
|
+
import { createPortal as g } from "react-dom";
|
|
6
|
+
import { Toast as N } from "./Toast.js";
|
|
7
|
+
import { useDarkScope as R } from "../../../internal/popup.js";
|
|
8
|
+
import { TOASTER_MARKER as k } from "../../../internal/page-inert.js";
|
|
9
|
+
import { Spinner as O } from "../../atoms/Spinner/Spinner.js";
|
|
10
|
+
import { TONE_PREFIX as A } from "./toast-api.js";
|
|
11
|
+
function B({
|
|
12
|
+
position: n = "bottom-right",
|
|
13
|
+
duration: e = 4e3,
|
|
14
|
+
dismissible: i = !0,
|
|
11
15
|
variant: a = "soft",
|
|
12
16
|
gutter: c,
|
|
13
17
|
reverseOrder: m,
|
|
14
18
|
containerClassName: l
|
|
15
19
|
}) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
20
|
+
const { ref: u, inDarkScope: f } = R(), p = y(M, x, C);
|
|
21
|
+
return /* @__PURE__ */ E(b, { children: [
|
|
22
|
+
/* @__PURE__ */ s("span", { ref: u, hidden: !0 }),
|
|
23
|
+
p && g(
|
|
24
|
+
/* `display: contents`, so the wrapper adds no box to `<body>`: the
|
|
25
|
+
queue inside is `position: fixed` and lays itself out. */
|
|
26
|
+
/* @__PURE__ */ s(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
...k,
|
|
30
|
+
className: f ? "dark" : void 0,
|
|
31
|
+
style: { display: "contents" },
|
|
32
|
+
children: /* @__PURE__ */ s(
|
|
33
|
+
v,
|
|
34
|
+
{
|
|
35
|
+
position: n,
|
|
36
|
+
gutter: c,
|
|
37
|
+
reverseOrder: m,
|
|
38
|
+
containerClassName: l,
|
|
39
|
+
toastOptions: {
|
|
40
|
+
success: { duration: e },
|
|
41
|
+
error: { duration: e },
|
|
42
|
+
blank: { duration: e },
|
|
43
|
+
custom: { duration: e }
|
|
44
|
+
},
|
|
45
|
+
children: (o) => {
|
|
46
|
+
const d = o.className?.split(/\s+/) ?? [], r = D.find(
|
|
47
|
+
(S) => d.includes(`${A}${S}`)
|
|
48
|
+
), t = r ? _[r] : F[o.type] ?? "neutral";
|
|
49
|
+
return /* @__PURE__ */ s(
|
|
50
|
+
N,
|
|
51
|
+
{
|
|
52
|
+
colorScheme: t,
|
|
53
|
+
variant: a,
|
|
54
|
+
icon: o.icon ?? (o.type === "loading" ? /* @__PURE__ */ s(O, { size: "sm" }) : void 0),
|
|
55
|
+
onDismiss: i ? () => h.dismiss(o.id) : void 0,
|
|
56
|
+
...t === "error" ? { role: "alert", "aria-live": "assertive" } : o.ariaProps,
|
|
57
|
+
className: I[o.visible ? "in" : "out"],
|
|
58
|
+
children: T(o.message, o)
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
document.body
|
|
67
|
+
)
|
|
68
|
+
] });
|
|
48
69
|
}
|
|
49
|
-
const
|
|
70
|
+
const M = () => () => {
|
|
71
|
+
}, x = () => !0, C = () => !1, D = ["info", "warning"], _ = {
|
|
50
72
|
info: "info",
|
|
51
73
|
/* `amber` is the library's warning color; Alert names it the same way. */
|
|
52
74
|
warning: "amber"
|
|
53
|
-
},
|
|
75
|
+
}, F = {
|
|
54
76
|
success: "success",
|
|
55
77
|
error: "error",
|
|
56
78
|
loading: "neutral",
|
|
57
79
|
blank: "neutral",
|
|
58
80
|
custom: "neutral"
|
|
59
|
-
},
|
|
81
|
+
}, I = {
|
|
60
82
|
in: "rst:motion-safe:animate-in rst:motion-safe:fade-in-0 rst:motion-safe:slide-in-from-bottom-2",
|
|
61
83
|
/* Leaving is a transition rather than an `animate-out`: this build ships the
|
|
62
84
|
enter half of the animation utilities and not the exit half, which
|
|
@@ -66,5 +88,5 @@ const v = ["info", "warning"], N = {
|
|
|
66
88
|
out: "rst:opacity-0 rst:transition-opacity rst:duration-200"
|
|
67
89
|
};
|
|
68
90
|
export {
|
|
69
|
-
|
|
91
|
+
B as Toaster
|
|
70
92
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),p=require("../../../node_modules/@fortawesome/react-fontawesome/dist/index.cjs"),h=require("../../../node_modules/@fortawesome/free-solid-svg-icons/index.cjs"),o=require("../../../node_modules/class-variance-authority/dist/index.cjs"),s=require("../../../lib/utils.cjs"),j=require("../../../internal/page-inert.cjs"),a=require("../../../node_modules/@headlessui/react/dist/components/dialog/dialog.cjs"),d=require("../../../node_modules/@headlessui/react/dist/components/transition/transition.cjs"),k=o.cva("rst:relative rst:w-full rst:transform rst:overflow-hidden rst:rounded-2xl rst:p-6 rst:text-left rst:align-middle rst:elevation-overlay rst:transition-all rst:border",{variants:{size:{xs:"rst:max-w-xs",sm:"rst:max-w-sm",md:"rst:max-w-md",lg:"rst:max-w-lg",xl:"rst:max-w-xl","2xl":"rst:max-w-2xl","3xl":"rst:max-w-3xl",full:"rst:max-w-[95vw] rst:m-4"},variant:{white:"rst:bg-[var(--roster-popover-bg)] rst:border-[var(--roster-popover-border)] rst:text-[var(--roster-popover-text)]",slate:"rst:bg-gray-700 rst:border-gray-600 rst:text-gray-100 rst:dark:bg-gray-900 rst:dark:border-gray-800 rst:[--roster-ring:var(--roster-primary-400,#5ea3de)] rst:[--roster-ring-offset:var(--roster-gray-700,#44403c)] rst:dark:[--roster-ring-offset:var(--roster-gray-900,#1c1917)] rst:[--roster-control-text:var(--roster-gray-100,#f5f5f4)] rst:[--roster-control-border:var(--roster-gray-400,#a8a29e)] rst:[--roster-control-border-focus:var(--roster-primary-400,#5ea3de)]",primary:"rst:bg-primary-700 rst:border-primary-600 rst:text-white rst:dark:bg-primary-950 rst:dark:border-primary-900 rst:[--roster-ring:var(--roster-primary-400,#5ea3de)] rst:[--roster-ring-offset:var(--roster-primary-700,#084063)] rst:dark:[--roster-ring-offset:var(--roster-primary-950,#021724)] rst:[--roster-control-text:var(--roster-gray-100,#f5f5f4)] rst:[--roster-control-border:var(--roster-gray-400,#a8a29e)] rst:[--roster-control-border-focus:var(--roster-primary-400,#5ea3de)]",glass:"rst:bg-white/80 rst:border-white/20 rst:backdrop-blur-xl rst:text-gray-900 rst:dark:bg-slate-900/80 rst:dark:border-slate-700/50 rst:dark:text-white"},status:{default:"",destructive:"rst:border-t-4 rst:border-t-error-500",success:"rst:border-t-4 rst:border-t-success-500"}},defaultVariants:{size:"md",variant:"white",status:"default"}}),w=o.cva("rst:text-xl rst:font-bold rst:leading-6 rst:text-inherit"),N=o.cva("rst:mt-1 rst:text-sm rst:text-inherit rst:opacity-75"),q=o.cva("rst:inline-flex rst:size-11 rst:shrink-0 rst:items-center rst:justify-center rst:-m-3 rst:cursor-pointer rst:rounded-md rst:bg-transparent rst:text-inherit rst:opacity-50 rst:hover:opacity-100 rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background rst:transition-opacity"),F=({isOpen:u,onClose:i,title:m,description:n,size:x,variant:l,status:g,children:f,className:v})=>{const[b,y]=t.useState(!1);t.useLayoutEffect(()=>{y(!0)},[]);const e=u&&b,c=t.useRef(null);return t.useLayoutEffect(()=>{if(e)return j.lockPage(c.current)},[e]),r.jsxs(r.Fragment,{children:[e&&r.jsx("span",{ref:c,hidden:!0}),r.jsxs(a.Dialog,{open:e,as:"div",className:"rst:font-ui rst:relative rst:z-50",onClose:i,children:[r.jsx(d.TransitionChild,{as:t.Fragment,enter:"rst:ease-out rst:duration-300",enterFrom:"rst:opacity-0",enterTo:"rst:opacity-100",leave:"rst:ease-in rst:duration-200",leaveFrom:"rst:opacity-100",leaveTo:"rst:opacity-0",children:r.jsx(a.DialogBackdrop,{className:s.cn("rst:fixed rst:inset-0 rst:transition-opacity",l==="glass"?"rst:bg-slate-900/40 rst:dark:bg-black/60":"rst:bg-slate-900/60 rst:dark:bg-black/80 rst:backdrop-blur-sm")})}),r.jsx("div",{className:"rst:fixed rst:inset-0 rst:overflow-y-auto",children:r.jsx("div",{className:"rst:flex rst:min-h-full rst:items-center rst:justify-center rst:p-4 rst:text-center",children:r.jsx(d.TransitionChild,{as:t.Fragment,enter:"rst:ease-out rst:duration-300",enterFrom:"rst:opacity-0 rst:scale-95",enterTo:"rst:opacity-100 rst:scale-100",leave:"rst:ease-in rst:duration-200",leaveFrom:"rst:opacity-100 rst:scale-100",leaveTo:"rst:opacity-0 rst:scale-95",children:r.jsxs(a.DialogPanel,{className:s.cn(k({size:x,variant:l,status:g}),v),children:[r.jsxs("div",{className:"rst:flex rst:items-start rst:justify-between",children:[r.jsxs("div",{children:[r.jsx(a.DialogTitle,{as:"h2",className:s.cn(w()),children:m}),n&&r.jsx("p",{className:s.cn(N()),children:n})]}),r.jsx("div",{className:"rst:ml-4 rst:flex rst:shrink-0",children:r.jsx("button",{type:"button",onClick:i,className:s.cn(q()),"aria-label":"Close dialog",children:r.jsx(p.FontAwesomeIcon,{icon:h.faXmark,className:"rst:h-5 rst:w-5"})})})]}),r.jsx("div",{className:"rst:mt-6",children:f})]})})})})]})]})};exports.Dialog=F;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { Fragment as
|
|
4
|
-
import { FontAwesomeIcon as
|
|
5
|
-
import { faXmark as
|
|
6
|
-
import { cva as
|
|
7
|
-
import { cn as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
2
|
+
import { jsxs as t, Fragment as h, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { useState as k, useLayoutEffect as c, useRef as w, Fragment as d } from "react";
|
|
4
|
+
import { FontAwesomeIcon as N } from "../../../node_modules/@fortawesome/react-fontawesome/dist/index.js";
|
|
5
|
+
import { faXmark as F } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
|
|
6
|
+
import { cva as a } from "../../../node_modules/class-variance-authority/dist/index.js";
|
|
7
|
+
import { cn as s } from "../../../lib/utils.js";
|
|
8
|
+
import { lockPage as T } from "../../../internal/page-inert.js";
|
|
9
|
+
import { Dialog as j, DialogBackdrop as z, DialogPanel as D, DialogTitle as V } from "../../../node_modules/@headlessui/react/dist/components/dialog/dialog.js";
|
|
10
|
+
import { TransitionChild as m } from "../../../node_modules/@headlessui/react/dist/components/transition/transition.js";
|
|
11
|
+
const C = /* @__PURE__ */ a(
|
|
11
12
|
"rst:relative rst:w-full rst:transform rst:overflow-hidden rst:rounded-2xl rst:p-6 rst:text-left rst:align-middle rst:elevation-overlay rst:transition-all rst:border",
|
|
12
13
|
{
|
|
13
14
|
variants: {
|
|
@@ -72,81 +73,103 @@ const k = /* @__PURE__ */ e(
|
|
|
72
73
|
status: "default"
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
|
-
),
|
|
76
|
+
), L = /* @__PURE__ */ a("rst:text-xl rst:font-bold rst:leading-6 rst:text-inherit"), P = /* @__PURE__ */ a("rst:mt-1 rst:text-sm rst:text-inherit rst:opacity-75"), R = /* @__PURE__ */ a(
|
|
76
77
|
"rst:inline-flex rst:size-11 rst:shrink-0 rst:items-center rst:justify-center rst:-m-3 rst:cursor-pointer rst:rounded-md rst:bg-transparent rst:text-inherit rst:opacity-50 rst:hover:opacity-100 rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-offset-2 rst:ring-offset-background rst:transition-opacity"
|
|
77
|
-
),
|
|
78
|
-
isOpen:
|
|
78
|
+
), $ = ({
|
|
79
|
+
isOpen: f,
|
|
79
80
|
onClose: o,
|
|
80
|
-
title:
|
|
81
|
+
title: g,
|
|
81
82
|
description: i,
|
|
82
|
-
size:
|
|
83
|
-
variant:
|
|
84
|
-
status:
|
|
85
|
-
children:
|
|
86
|
-
className:
|
|
87
|
-
}) =>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
83
|
+
size: p,
|
|
84
|
+
variant: n,
|
|
85
|
+
status: u,
|
|
86
|
+
children: v,
|
|
87
|
+
className: b
|
|
88
|
+
}) => {
|
|
89
|
+
const [x, y] = k(!1);
|
|
90
|
+
c(() => {
|
|
91
|
+
y(!0);
|
|
92
|
+
}, []);
|
|
93
|
+
const e = f && x, l = w(null);
|
|
94
|
+
return c(() => {
|
|
95
|
+
if (e)
|
|
96
|
+
return T(l.current);
|
|
97
|
+
}, [e]), /* @__PURE__ */ t(h, { children: [
|
|
98
|
+
e && /* @__PURE__ */ r("span", { ref: l, hidden: !0 }),
|
|
99
|
+
/* @__PURE__ */ t(
|
|
100
|
+
j,
|
|
101
|
+
{
|
|
102
|
+
open: e,
|
|
103
|
+
as: "div",
|
|
104
|
+
className: "rst:font-ui rst:relative rst:z-50",
|
|
105
|
+
onClose: o,
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ r(
|
|
108
|
+
m,
|
|
109
|
+
{
|
|
110
|
+
as: d,
|
|
111
|
+
enter: "rst:ease-out rst:duration-300",
|
|
112
|
+
enterFrom: "rst:opacity-0",
|
|
113
|
+
enterTo: "rst:opacity-100",
|
|
114
|
+
leave: "rst:ease-in rst:duration-200",
|
|
115
|
+
leaveFrom: "rst:opacity-100",
|
|
116
|
+
leaveTo: "rst:opacity-0",
|
|
117
|
+
children: /* @__PURE__ */ r(
|
|
118
|
+
z,
|
|
119
|
+
{
|
|
120
|
+
className: s(
|
|
121
|
+
"rst:fixed rst:inset-0 rst:transition-opacity",
|
|
122
|
+
n === "glass" ? "rst:bg-slate-900/40 rst:dark:bg-black/60" : "rst:bg-slate-900/60 rst:dark:bg-black/80 rst:backdrop-blur-sm"
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
}
|
|
125
127
|
),
|
|
126
|
-
children:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
128
|
+
/* @__PURE__ */ r("div", { className: "rst:fixed rst:inset-0 rst:overflow-y-auto", children: /* @__PURE__ */ r("div", { className: "rst:flex rst:min-h-full rst:items-center rst:justify-center rst:p-4 rst:text-center", children: /* @__PURE__ */ r(
|
|
129
|
+
m,
|
|
130
|
+
{
|
|
131
|
+
as: d,
|
|
132
|
+
enter: "rst:ease-out rst:duration-300",
|
|
133
|
+
enterFrom: "rst:opacity-0 rst:scale-95",
|
|
134
|
+
enterTo: "rst:opacity-100 rst:scale-100",
|
|
135
|
+
leave: "rst:ease-in rst:duration-200",
|
|
136
|
+
leaveFrom: "rst:opacity-100 rst:scale-100",
|
|
137
|
+
leaveTo: "rst:opacity-0 rst:scale-95",
|
|
138
|
+
children: /* @__PURE__ */ t(
|
|
139
|
+
D,
|
|
134
140
|
{
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
children:
|
|
141
|
+
className: s(
|
|
142
|
+
C({ size: p, variant: n, status: u }),
|
|
143
|
+
b
|
|
144
|
+
),
|
|
145
|
+
children: [
|
|
146
|
+
/* @__PURE__ */ t("div", { className: "rst:flex rst:items-start rst:justify-between", children: [
|
|
147
|
+
/* @__PURE__ */ t("div", { children: [
|
|
148
|
+
/* @__PURE__ */ r(V, { as: "h2", className: s(L()), children: g }),
|
|
149
|
+
i && /* @__PURE__ */ r("p", { className: s(P()), children: i })
|
|
150
|
+
] }),
|
|
151
|
+
/* @__PURE__ */ r("div", { className: "rst:ml-4 rst:flex rst:shrink-0", children: /* @__PURE__ */ r(
|
|
152
|
+
"button",
|
|
153
|
+
{
|
|
154
|
+
type: "button",
|
|
155
|
+
onClick: o,
|
|
156
|
+
className: s(R()),
|
|
157
|
+
"aria-label": "Close dialog",
|
|
158
|
+
children: /* @__PURE__ */ r(N, { icon: F, className: "rst:h-5 rst:w-5" })
|
|
159
|
+
}
|
|
160
|
+
) })
|
|
161
|
+
] }),
|
|
162
|
+
/* @__PURE__ */ r("div", { className: "rst:mt-6", children: v })
|
|
163
|
+
]
|
|
140
164
|
}
|
|
141
|
-
)
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
] }) });
|
|
165
|
+
)
|
|
166
|
+
}
|
|
167
|
+
) }) })
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
] });
|
|
172
|
+
};
|
|
150
173
|
export {
|
|
151
|
-
|
|
174
|
+
$ as Dialog
|
|
152
175
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),f=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"),p=require("../../atoms/Button/Button.cjs"),b=require("../../atoms/Link/Link.cjs"),$=require("../../atoms/Badge/Badge.cjs"),W=require("../../atoms/Avatar/Avatar.cjs"),K=require("../../atoms/Switch/Switch.cjs"),Y=require("./navbar-variants.cjs"),m=require("../../../node_modules/@headlessui/react/dist/components/menu/menu.cjs"),S=require("../../../node_modules/@headlessui/react/dist/components/popover/popover.cjs"),P=require("../../../node_modules/@headlessui/react/dist/components/transition/transition.cjs"),X=(s,n)=>typeof s=="function"?s({close:n}):s;function Z(s){return f.useSyncExternalStore(n=>{if(!s||typeof document>"u")return()=>{};const o=new MutationObserver(n);return o.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>o.disconnect()},()=>s&&document.documentElement.classList.contains("dark"),()=>!1)}function _({close:s}){return f.useEffect(()=>{const n=o=>{const g=document.querySelector("[data-roster-mobile-panel]"),k=document.querySelector("[data-roster-hamburger]"),d=o.target;!g?.contains(d)&&!k?.contains(d)&&s()};return document.addEventListener("pointerdown",n,{capture:!0}),()=>document.removeEventListener("pointerdown",n,{capture:!0})},[s]),null}function T({activePath:s,close:n}){const o=f.useRef(s);return f.useEffect(()=>{o.current!==s&&(o.current=s,n())},[s,n]),null}const rr=({logoSrc:s,logoSize:n="2rem",logoClassName:o,brandName:g,items:k,activePath:d,routerElement:v,user:i,onLogin:j,onLogout:N,onInboxClick:w,onThemeToggle:y,actions:V,brandElement:z,navActions:G,userMenuItems:B=[],className:H,variant:l="default",position:J="sticky",themeMode:q,notificationVariant:L="error",notificationFill:O="solid",...Q})=>{const C=(i?.notificationCount||0)>0,E=typeof n=="number"?`${n}px`:n,R={width:E,height:E},U=Z(q==="auto"),x=(q==="auto"?U?"dark":"light":q??(l==="white"||l==="default"?"light":"dark"))==="dark",A=l==="slate"||l==="primary"||l==="default"&&x||l==="white"&&x||l==="transparent"&&x,F={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"};return r.jsx(S.Popover,{as:"nav",className:e.cn("rst:z-50",Y.navbarVariants({variant:l,position:J}),H),...Q,children:({open:D,close:c})=>{const I=X(V,c),M=X(G,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(b.Link,{as:v,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:R,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: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 a=d===t.path;return r.jsxs(b.Link,{as:v,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",a?F.linkActive:F.linkBase),children:[t.label,t.badge&&r.jsx("span",{className:"rst:inline-flex",children:t.badge})]},t.path)})}),M,I??(i?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:i.initials,src:i.avatarSrc,size:"sm",shape:"circle",colorScheme:i.avatarColor??"primary"}),C&&r.jsx("div",{className:"rst:absolute rst:-top-1 rst:-right-2",children:r.jsx($.Badge,{fill:O,size:"xs",statusBadge:!0,variant:L,children:i.notificationCount})})]}),r.jsx(P.Transition,{as:f.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-1 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:[C&&w&&r.jsx(m.MenuItem,{children:({focus:t})=>r.jsxs(p.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 (",i.notificationCount,")"]})}),y&&r.jsx(m.MenuItem,{children:({focus:t})=>r.jsxs("div",{onClick:a=>{a.preventDefault(),y()},role:"button",tabIndex:0,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"),onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),y())},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",x?"rst:text-amber-500":"rst:text-gray-400")}),r.jsx("span",{className:"rst:font-medium",children:"Dark Mode"})]}),r.jsx(K.Switch,{checked:x,onChange:()=>{},size:"xs",variant:"neutral",className:"rst:pointer-events-none rst:m-0"})]})})]}),B.length>0&&r.jsx("div",{className:"rst:py-1",children:B.map(t=>r.jsx(m.MenuItem,{children:({focus:a})=>r.jsxs(b.Link,{as:v,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",a&&"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(p.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(p.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(S.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"}),D?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"}),C&&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"})]})]})})]}),D&&r.jsx(_,{close:c}),D&&r.jsx(T,{activePath:d,close:c}),r.jsx(P.Transition,{as:f.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(S.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-1 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:R,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:g})]}),r.jsx("div",{className:"rst:-mr-2",children:r.jsxs(S.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:[M&&r.jsx("div",{className:"rst:mb-4",children:M}),r.jsxs("nav",{className:"rst:grid rst:gap-y-4",children:[k.map(t=>{const a=d===t.path;return r.jsx(b.Link,{as:v,href:t.path,to:t.path,onClick:()=>c(),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",a?"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",a?"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&&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 a=d===t.path;return r.jsxs(b.Link,{as:v,href:t.path,to:t.path,onClick:()=>c(),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",a?"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",a?"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||I||j)&&r.jsx("div",{className:"rst:py-6 rst:px-5 rst:space-y-4",children:I||(!i&&j?r.jsx(p.Button,{variant:"solid",colorScheme:"primary",className:"rst:w-full rst:justify-center",onClick:()=>{j(),c()},children:"Log In"}):r.jsxs(r.Fragment,{children:[C&&w&&r.jsx(p.Button,{variant:"ghost",colorScheme:"neutral",onClick:()=>{w?.(),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($.Badge,{fill:O,size:"xs",statusBadge:!0,variant:L,children:i?.notificationCount}),children:"Pending Invitations"}),y&&r.jsxs("div",{onClick:t=>{t.preventDefault(),y()},role:"button",tabIndex:0,onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),y())},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",x?"rst:text-amber-500":"rst:text-gray-400")}),r.jsx("span",{children:"Dark Mode"})]}),r.jsx(K.Switch,{checked:x,onChange:()=>{},size:"sm",variant:"neutral",className:"rst:pointer-events-none rst:m-0"})]}),N&&r.jsx(p.Button,{variant:"outline",colorScheme:"error",className:"rst:w-full rst:justify-center",onClick:()=>{N?.(),c()},children:"Log Out"})]}))})]})})})]})}})};exports.Navbar=rr;
|
|
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-1 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-1 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;
|