@blakesteve/roster 5.8.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.
Files changed (44) hide show
  1. package/README.md +126 -23
  2. package/dist/components/atoms/Button/button-variants.js +1 -1
  3. package/dist/components/atoms/Eyebrow/eyebrow-variants.d.ts +2 -2
  4. package/dist/components/atoms/Input/input-variants.js +1 -1
  5. package/dist/components/atoms/Skeleton/Skeleton.cjs +1 -1
  6. package/dist/components/atoms/Skeleton/Skeleton.d.ts +19 -3
  7. package/dist/components/atoms/Skeleton/Skeleton.js +38 -33
  8. package/dist/components/atoms/ThemeToggle/ThemeToggle.d.ts +1 -1
  9. package/dist/components/molecules/CheckboxGroup/CheckboxGroup.d.ts +1 -1
  10. package/dist/components/molecules/CheckboxGroup/checkbox-group-variants.d.ts +1 -1
  11. package/dist/components/molecules/Menu/Menu.cjs +1 -0
  12. package/dist/components/molecules/Menu/Menu.d.ts +169 -0
  13. package/dist/components/molecules/Menu/Menu.js +577 -0
  14. package/dist/components/molecules/Menu/menu-typeahead.cjs +1 -0
  15. package/dist/components/molecules/Menu/menu-typeahead.d.ts +7 -0
  16. package/dist/components/molecules/Menu/menu-typeahead.js +13 -0
  17. package/dist/components/molecules/SkeletonPresets/SkeletonPresets.cjs +1 -1
  18. package/dist/components/molecules/SkeletonPresets/SkeletonPresets.d.ts +13 -4
  19. package/dist/components/molecules/SkeletonPresets/SkeletonPresets.js +35 -35
  20. package/dist/components/molecules/Toast/Toaster.d.ts +1 -1
  21. package/dist/components/organisms/Navbar/Navbar.cjs +1 -1
  22. package/dist/components/organisms/Navbar/Navbar.d.ts +1 -1
  23. package/dist/components/organisms/Navbar/Navbar.js +275 -302
  24. package/dist/index.d.ts +1 -0
  25. package/dist/lib/utils.cjs +1 -1
  26. package/dist/lib/utils.js +4 -1
  27. package/dist/meta.json +3 -3
  28. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +7 -7
  29. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +2 -2
  30. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +5 -5
  31. package/dist/node_modules/@headlessui/react/dist/components/portal/portal.js +6 -6
  32. package/dist/node_modules/@headlessui/react/dist/utils/focus-management.cjs +1 -1
  33. package/dist/node_modules/@headlessui/react/dist/utils/focus-management.js +52 -61
  34. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +6 -6
  35. package/dist/roster.cjs +1 -1
  36. package/dist/roster.css +1 -1
  37. package/dist/roster.js +127 -116
  38. package/package.json +2 -1
  39. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine-glue.cjs +0 -1
  40. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine-glue.js +0 -21
  41. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine.cjs +0 -1
  42. package/dist/node_modules/@headlessui/react/dist/components/menu/menu-machine.js +0 -120
  43. package/dist/node_modules/@headlessui/react/dist/components/menu/menu.cjs +0 -1
  44. package/dist/node_modules/@headlessui/react/dist/components/menu/menu.js +0 -197
@@ -1,34 +1,44 @@
1
1
  "use client";
2
- import { jsx as r, jsxs as s, Fragment as L } from "react/jsx-runtime";
3
- import nr, { Fragment as _, useEffect as Z, useRef as ir } from "react";
4
- import { FontAwesomeIcon as u } from "../../../node_modules/@fortawesome/react-fontawesome/dist/index.js";
5
- import { faInbox as or, faMoon as T, faRightFromBracket as lr, faXmark as X, faBars as dr } from "../../../node_modules/@fortawesome/free-solid-svg-icons/index.js";
6
- import { cn as a } from "../../../lib/utils.js";
7
- import { withLabels as cr } from "../../../lib/labels.js";
8
- import { Button as p } from "../../atoms/Button/Button.js";
9
- import { Link as k } from "../../atoms/Link/Link.js";
10
- import { Badge as G } from "../../atoms/Badge/Badge.js";
11
- import { Avatar as mr } from "../../atoms/Avatar/Avatar.js";
12
- import { switchThumbVariants as hr, switchTrackVariants as gr } from "../../atoms/Switch/switch-variants.js";
13
- import { navbarVariants as ur } from "./navbar-variants.js";
14
- import { Menu as pr, MenuButton as yr, MenuItems as fr, MenuItem as F } from "../../../node_modules/@headlessui/react/dist/components/menu/menu.js";
15
- import { Popover as xr, PopoverButton as J, PopoverPanel as vr } from "../../../node_modules/@headlessui/react/dist/components/popover/popover.js";
16
- import { Transition as P } from "../../../node_modules/@headlessui/react/dist/components/transition/transition.js";
17
- function Q({ on: e, size: n }) {
2
+ import { jsx as r, jsxs as a, Fragment as U } from "react/jsx-runtime";
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
+ 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
+ import { cn as i } from "../../../lib/utils.js";
7
+ import { withLabels as pr } from "../../../lib/labels.js";
8
+ import { Button as j } from "../../atoms/Button/Button.js";
9
+ import { Link as A } from "../../atoms/Link/Link.js";
10
+ import { Badge as Z } from "../../atoms/Badge/Badge.js";
11
+ import { Avatar as xr } from "../../atoms/Avatar/Avatar.js";
12
+ import { switchThumbVariants as vr, switchTrackVariants as br } from "../../atoms/Switch/switch-variants.js";
13
+ import { Menu as kr, MenuButton as Nr, MenuItems as wr, MenuGroup as D, MenuItem as _, MenuCheckboxItem as Mr } from "../../molecules/Menu/Menu.js";
14
+ import { navbarVariants as Sr } from "./navbar-variants.js";
15
+ import { Popover as Cr, PopoverButton as T, PopoverPanel as Er } from "../../../node_modules/@headlessui/react/dist/components/popover/popover.js";
16
+ import { Transition as Fr } from "../../../node_modules/@headlessui/react/dist/components/transition/transition.js";
17
+ function H({ on: e, size: s }) {
18
18
  return /* @__PURE__ */ r(
19
19
  "span",
20
20
  {
21
21
  "aria-hidden": "true",
22
22
  "data-testid": "navbar-theme-track",
23
23
  "data-checked": e ? "" : void 0,
24
- className: a(gr({ size: n, variant: "neutral" }), "rst:pointer-events-none"),
25
- children: /* @__PURE__ */ r("span", { className: a(hr({ size: n })) })
24
+ className: i(br({ size: s, variant: "neutral" }), "rst:pointer-events-none"),
25
+ children: /* @__PURE__ */ r("span", { className: i(vr({ size: s })) })
26
26
  }
27
27
  );
28
28
  }
29
- const kr = (e) => {
30
- e?.setAttribute("role", "menuitemcheckbox");
31
- }, Y = (e, n) => typeof e == "function" ? e({ close: n }) : e, br = {
29
+ const K = "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", Or = /* @__PURE__ */ i(
30
+ K,
31
+ "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"
32
+ ), rr = /* @__PURE__ */ new WeakMap();
33
+ function jr(e) {
34
+ if (!e || typeof e == "string") return;
35
+ let s = rr.get(e);
36
+ return s || (s = (n) => /* @__PURE__ */ r(e, { ...n }), rr.set(e, s)), s;
37
+ }
38
+ const tr = /* @__PURE__ */ i(
39
+ K,
40
+ "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"
41
+ ), er = (e, s) => typeof e == "function" ? e({ close: s }) : e, Ar = {
32
42
  openMainMenu: "Open main menu",
33
43
  closeMainMenu: "Close menu",
34
44
  openUserMenu: "Open user menu",
@@ -38,71 +48,90 @@ const kr = (e) => {
38
48
  pendingInvitations: "Pending Invitations",
39
49
  inbox: (e) => `Inbox (${e})`
40
50
  };
41
- function Nr(e) {
42
- return nr.useSyncExternalStore(
43
- (n) => {
51
+ function Br(e) {
52
+ return ur.useSyncExternalStore(
53
+ (s) => {
44
54
  if (!e || typeof document > "u") return () => {
45
55
  };
46
- const i = new MutationObserver(n);
47
- return i.observe(document.documentElement, {
56
+ const n = new MutationObserver(s);
57
+ return n.observe(document.documentElement, {
48
58
  attributes: !0,
49
59
  attributeFilter: ["class"]
50
- }), () => i.disconnect();
60
+ }), () => n.disconnect();
51
61
  },
52
62
  () => e && document.documentElement.classList.contains("dark"),
53
63
  () => !1
54
64
  );
55
65
  }
56
- function wr({ close: e }) {
57
- return Z(() => {
58
- const n = (i) => {
59
- const y = document.querySelector("[data-roster-mobile-panel]"), b = document.querySelector("[data-roster-hamburger]"), f = i.target;
60
- !y?.contains(f) && !b?.contains(f) && e();
66
+ function sr(e, s) {
67
+ if (!s || !e) return !1;
68
+ if (e.contains(s)) return !0;
69
+ const n = s.closest?.("[data-menu-panel]")?.getAttribute("data-menu-tree");
70
+ return !!n && !!e.querySelector(`[data-menu-tree="${CSS.escape(n)}"]`);
71
+ }
72
+ const Ir = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
73
+ function Lr({ close: e, panel: s, hamburger: n }) {
74
+ return z(() => {
75
+ const u = (g) => {
76
+ const x = g.target;
77
+ !sr(s.current, x) && !n.current?.contains(x) && e();
78
+ };
79
+ return document.addEventListener("pointerdown", u, { capture: !0 }), () => document.removeEventListener("pointerdown", u, { capture: !0 });
80
+ }, [e, s, n]), null;
81
+ }
82
+ function Ur({ close: e, panel: s }) {
83
+ return z(() => {
84
+ const n = (g) => {
85
+ g.target !== s.current?.parentElement && (sr(s.current, g.target) || e());
86
+ }, u = requestAnimationFrame(() => {
87
+ s.current?.querySelector(Ir)?.focus(), document.addEventListener("focusin", n);
88
+ });
89
+ return () => {
90
+ cancelAnimationFrame(u), document.removeEventListener("focusin", n);
61
91
  };
62
- return document.addEventListener("pointerdown", n, { capture: !0 }), () => document.removeEventListener("pointerdown", n, { capture: !0 });
63
- }, [e]), null;
92
+ }, [e, s]), null;
64
93
  }
65
- function Mr({
94
+ function Dr({
66
95
  activePath: e,
67
- close: n
96
+ close: s
68
97
  }) {
69
- const i = ir(e);
70
- return Z(() => {
71
- i.current !== e && (i.current = e, n());
72
- }, [e, n]), null;
98
+ const n = R(e);
99
+ return z(() => {
100
+ n.current !== e && (n.current = e, s());
101
+ }, [e, s]), null;
73
102
  }
74
- const Ur = ({
103
+ const Hr = ({
75
104
  logoSrc: e,
76
- logoSize: n = "2rem",
77
- logoHeight: i,
78
- logoWidth: y,
79
- logoClassName: b,
80
- brandName: f,
81
- items: E,
105
+ logoSize: s = "2rem",
106
+ logoHeight: n,
107
+ logoWidth: u,
108
+ logoClassName: g,
109
+ brandName: x,
110
+ items: $,
82
111
  activePath: N,
83
- routerElement: x,
112
+ routerElement: v,
84
113
  user: o,
85
114
  onLogin: w,
86
115
  onLogout: M,
87
- onInboxClick: j,
88
- onThemeToggle: v,
89
- actions: H,
90
- brandElement: R,
91
- navActions: W,
92
- userMenuItems: C = [],
93
- className: rr,
94
- variant: c = "default",
95
- position: tr = "sticky",
96
- themeMode: z,
97
- labels: sr,
98
- notificationVariant: $ = "error",
99
- notificationFill: q = "solid",
100
- ...er
116
+ onInboxClick: b,
117
+ onThemeToggle: p,
118
+ actions: ar,
119
+ brandElement: q,
120
+ navActions: nr,
121
+ userMenuItems: S = [],
122
+ className: ir,
123
+ variant: l = "default",
124
+ position: or = "sticky",
125
+ themeMode: B,
126
+ labels: cr,
127
+ notificationVariant: P = "error",
128
+ notificationFill: V = "solid",
129
+ ...dr
101
130
  }) => {
102
- const l = cr(br, sr), S = (o?.notificationCount || 0) > 0, A = (g) => typeof g == "number" ? `${g}px` : g, K = i !== void 0 || y !== void 0, U = K ? {
103
- width: y === void 0 ? "auto" : A(y),
104
- height: i === void 0 ? "auto" : A(i)
105
- } : { width: A(n), height: A(n) }, V = K && "rst:object-contain rst:object-left rst:rtl:object-right", ar = Nr(z === "auto"), m = (z === "auto" ? ar ? "dark" : "light" : z ?? (c === "white" || c === "default" ? "light" : "dark")) === "dark", B = c === "slate" || c === "primary" || c === "default" && m || c === "white" && m || c === "transparent" && m, I = c === "primary" ? {
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
+ height: n === void 0 ? "auto" : C(n)
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" ? {
106
135
  // On primary-700, text is that fill's ink (the dimmer links at 80%),
107
136
  // so a light primary gets dark text. The dark fill is primary-950,
108
137
  // which the ink doesn't describe: there it stays the dark surface's
@@ -112,32 +141,32 @@ const Ur = ({
112
141
  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",
113
142
  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"
114
143
  } : {
115
- brand: B ? "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",
116
- linkBase: B ? "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",
117
- linkActive: B ? "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",
118
- hamburger: B ? "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"
119
- };
144
+ brand: E ? "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",
145
+ linkBase: E ? "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",
146
+ linkActive: E ? "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",
147
+ hamburger: E ? "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"
148
+ }, I = R(null), Q = R(null);
120
149
  return /* @__PURE__ */ r(
121
- xr,
150
+ Cr,
122
151
  {
123
152
  as: "nav",
124
- className: a("rst:z-50", ur({ variant: c, position: tr }), rr),
125
- ...er,
126
- children: ({ open: g, close: h }) => {
127
- const D = Y(H, h), O = Y(W, h);
128
- return /* @__PURE__ */ s(L, { children: [
129
- /* @__PURE__ */ s("div", { className: "rst:container rst:mx-auto rst:flex rst:items-center rst:justify-between rst:px-4 rst:h-16", children: [
130
- /* @__PURE__ */ s(
131
- k,
153
+ className: i("rst:z-50", Sr({ variant: l, position: or }), ir),
154
+ ...dr,
155
+ children: ({ open: h, close: d }) => {
156
+ const O = er(ar, d), L = er(nr, d);
157
+ return /* @__PURE__ */ a(U, { children: [
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: [
159
+ /* @__PURE__ */ a(
160
+ A,
132
161
  {
133
- as: x,
162
+ as: v,
134
163
  href: "/",
135
164
  to: "/",
136
165
  variant: "neutral",
137
166
  underline: "none",
138
- className: a(
167
+ className: i(
139
168
  "rst:flex rst:items-center rst:gap-3 rst:transition-opacity",
140
- I.brand
169
+ F.brand
141
170
  ),
142
171
  children: [
143
172
  /* @__PURE__ */ r(
@@ -145,28 +174,28 @@ const Ur = ({
145
174
  {
146
175
  src: e,
147
176
  alt: "",
148
- style: U,
149
- className: a("rst:shrink-0", V, b ?? "rst:rounded-md")
177
+ style: X,
178
+ className: i("rst:shrink-0", J, g ?? "rst:rounded-md")
150
179
  }
151
180
  ),
152
- R ?? /* @__PURE__ */ r("span", { className: "rst:text-xl rst:font-bold rst:tracking-tight", children: f })
181
+ q ?? /* @__PURE__ */ r("span", { className: "rst:text-xl rst:font-bold rst:tracking-tight", children: x })
153
182
  ]
154
183
  }
155
184
  ),
156
- /* @__PURE__ */ s("div", { className: "rst:hidden rst:md:flex rst:items-center rst:gap-8", children: [
157
- /* @__PURE__ */ r("div", { className: "rst:flex rst:items-center rst:gap-6", children: E.map((t) => {
158
- const d = N === t.path;
159
- return /* @__PURE__ */ s(
160
- k,
185
+ /* @__PURE__ */ a("div", { className: "rst:hidden rst:md:flex rst:items-center rst:gap-8", children: [
186
+ /* @__PURE__ */ r("div", { className: "rst:flex rst:items-center rst:gap-6", children: $.map((t) => {
187
+ const f = N === t.path;
188
+ return /* @__PURE__ */ a(
189
+ A,
161
190
  {
162
- as: x,
191
+ as: v,
163
192
  href: t.path,
164
193
  to: t.path,
165
194
  variant: "neutral",
166
195
  underline: "none",
167
- className: a(
196
+ className: i(
168
197
  "rst:inline-flex rst:items-center rst:gap-1.5 rst:text-sm rst:transition-colors rst:duration-200",
169
- d ? I.linkActive : I.linkBase
198
+ f ? F.linkActive : F.linkBase
170
199
  ),
171
200
  children: [
172
201
  t.label,
@@ -176,184 +205,129 @@ const Ur = ({
176
205
  t.path
177
206
  );
178
207
  }) }),
179
- O,
180
- D ?? (o ? /* @__PURE__ */ s(pr, { as: "div", className: "rst:relative rst:ml-2", children: [
181
- /* @__PURE__ */ s(yr, { 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: [
182
- /* @__PURE__ */ r("span", { className: "rst:sr-only", children: l.openUserMenu }),
183
- /* @__PURE__ */ r(
184
- mr,
185
- {
186
- "aria-hidden": "true",
187
- alt: "",
188
- initials: o.initials,
189
- src: o.avatarSrc,
190
- size: "sm",
191
- shape: "circle",
192
- colorScheme: o.avatarColor ?? "primary"
193
- }
194
- ),
195
- S && /* @__PURE__ */ r("div", { className: "rst:absolute rst:-top-1 rst:-right-2", children: /* @__PURE__ */ r(
196
- G,
197
- {
198
- fill: q,
199
- size: "xs",
200
- statusBadge: !0,
201
- variant: $,
202
- children: o.notificationCount
203
- }
204
- ) })
205
- ] }),
206
- /* @__PURE__ */ r(
207
- P,
208
+ L,
209
+ O ?? (o ? /* @__PURE__ */ r("div", { className: "rst:relative rst:ml-2", children: /* @__PURE__ */ a(kr, { linkComponent: lr, children: [
210
+ /* @__PURE__ */ a(
211
+ Nr,
208
212
  {
209
- as: _,
210
- enter: "rst:transition rst:ease-out rst:duration-100",
211
- enterFrom: "rst:transform rst:opacity-0 rst:scale-95",
212
- enterTo: "rst:transform rst:opacity-100 rst:scale-100",
213
- leave: "rst:transition rst:ease-in rst:duration-75",
214
- leaveFrom: "rst:transform rst:opacity-100 rst:scale-100",
215
- leaveTo: "rst:transform rst:opacity-0 rst:scale-95",
216
- children: /* @__PURE__ */ s(fr, { className: "rst:absolute rst:right-0 rst:z-50 rst:mt-2 rst:w-48 rst:origin-top-right rst:rounded-md rst:bg-white rst:dark:bg-gray-800 rst:py-1 rst:elevation-anchored rst:ring rst:ring-black/5 rst:dark:ring-white/10 rst:focus:outline-hidden rst:divide-y rst:divide-gray-100 rst:dark:divide-gray-700", children: [
217
- /* @__PURE__ */ s("div", { className: "rst:py-1", children: [
218
- S && j && /* @__PURE__ */ r(F, { children: ({ focus: t }) => /* @__PURE__ */ r(
219
- p,
213
+ plain: !0,
214
+ 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-['']",
215
+ children: [
216
+ /* @__PURE__ */ r("span", { className: "rst:sr-only", children: c.openUserMenu }),
217
+ /* @__PURE__ */ r(
218
+ xr,
219
+ {
220
+ "aria-hidden": "true",
221
+ alt: "",
222
+ initials: o.initials,
223
+ src: o.avatarSrc,
224
+ size: "sm",
225
+ shape: "circle",
226
+ colorScheme: o.avatarColor ?? "primary"
227
+ }
228
+ ),
229
+ k && /* @__PURE__ */ r("div", { className: "rst:absolute rst:-top-1 rst:-right-2", children: /* @__PURE__ */ r(
230
+ Z,
231
+ {
232
+ fill: V,
233
+ size: "xs",
234
+ statusBadge: !0,
235
+ variant: P,
236
+ children: o.notificationCount
237
+ }
238
+ ) })
239
+ ]
240
+ }
241
+ ),
242
+ /* @__PURE__ */ a(
243
+ wr,
244
+ {
245
+ align: "end",
246
+ offset: 8,
247
+ 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",
248
+ children: [
249
+ (k && b || p) && /* @__PURE__ */ a(D, { className: "rst:py-1", children: [
250
+ k && b && /* @__PURE__ */ r(
251
+ _,
220
252
  {
221
- variant: "ghost",
222
- colorScheme: "neutral",
223
- size: "sm",
224
- onClick: j,
225
- className: a(
226
- "rst:w-full rst:justify-start rst:rounded-none rst:px-4",
227
- t && "rst:bg-gray-50 rst:dark:bg-gray-700"
228
- ),
229
- startIcon: /* @__PURE__ */ r(
230
- u,
253
+ onSelect: b,
254
+ className: tr,
255
+ icon: /* @__PURE__ */ r(y, { icon: gr, className: "rst:text-primary-500 rst:w-4" }),
256
+ children: c.inbox(o.notificationCount ?? 0)
257
+ }
258
+ ),
259
+ p && /* @__PURE__ */ r(
260
+ Mr,
261
+ {
262
+ checked: m,
263
+ onCheckedChange: () => p(),
264
+ closeOnSelect: !1,
265
+ className: K,
266
+ icon: /* @__PURE__ */ r(
267
+ y,
231
268
  {
232
- icon: or,
233
- className: "rst:text-primary-500 rst:w-4"
269
+ icon: W,
270
+ className: i("rst:w-4 rst:transition-colors", m ? "rst:text-amber-500" : "rst:text-gray-400")
234
271
  }
235
272
  ),
236
- children: l.inbox(o.notificationCount ?? 0)
273
+ indicator: /* @__PURE__ */ r(H, { on: m, size: "xs" }),
274
+ children: /* @__PURE__ */ r("span", { className: "rst:font-medium", children: c.darkMode })
237
275
  }
238
- ) }),
239
- v && /* @__PURE__ */ r(F, { children: ({ focus: t }) => (
240
- /* The row is the control. Headless UI keeps
241
- focus on the menu and clicks the active item
242
- on Enter or Space, so the row needs no key
243
- handler of its own. */
244
- /* @__PURE__ */ s(
245
- "div",
246
- {
247
- ref: kr,
248
- "aria-checked": m,
249
- onClick: (d) => {
250
- d.preventDefault(), v();
251
- },
252
- className: a(
253
- "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",
254
- t && "rst:bg-gray-50 rst:dark:bg-gray-700"
255
- ),
256
- children: [
257
- /* @__PURE__ */ s("div", { className: "rst:flex rst:items-center rst:gap-2", children: [
258
- /* @__PURE__ */ r(
259
- u,
260
- {
261
- icon: T,
262
- className: a(
263
- "rst:w-4 rst:transition-colors",
264
- m ? "rst:text-amber-500" : "rst:text-gray-400"
265
- )
266
- }
267
- ),
268
- /* @__PURE__ */ r("span", { className: "rst:font-medium", children: l.darkMode })
269
- ] }),
270
- /* @__PURE__ */ r(Q, { on: m, size: "xs" })
271
- ]
272
- }
273
- )
274
- ) })
276
+ )
275
277
  ] }),
276
- C.length > 0 && /* @__PURE__ */ r("div", { className: "rst:py-1", children: C.map((t) => /* @__PURE__ */ r(F, { children: ({ focus: d }) => /* @__PURE__ */ s(
277
- k,
278
- {
279
- as: x,
280
- href: t.path,
281
- to: t.path,
282
- variant: "neutral",
283
- underline: "none",
284
- className: a(
285
- "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",
286
- d && "rst:bg-gray-50 rst:dark:bg-gray-700"
287
- ),
288
- children: [
289
- t.label,
290
- t.badge && /* @__PURE__ */ r("span", { className: "rst:inline-flex", children: t.badge })
291
- ]
292
- }
293
- ) }, t.path)) }),
294
- M && /* @__PURE__ */ r("div", { className: "rst:py-1", children: /* @__PURE__ */ r(F, { children: ({ focus: t }) => /* @__PURE__ */ r(
295
- p,
278
+ S.length > 0 && /* @__PURE__ */ r(D, { className: "rst:py-1", children: S.map((t) => /* @__PURE__ */ r(_, { href: t.path, badge: t.badge, className: Or, children: t.label }, t.path)) }),
279
+ M && /* @__PURE__ */ r(D, { className: "rst:py-1", children: /* @__PURE__ */ r(
280
+ _,
296
281
  {
297
- variant: "ghost",
298
- colorScheme: "neutral",
299
- size: "sm",
300
- onClick: M,
301
- className: a(
302
- "rst:w-full rst:justify-start rst:rounded-none rst:px-4",
303
- t && "rst:bg-gray-50 rst:dark:bg-gray-700"
304
- ),
305
- startIcon: /* @__PURE__ */ r(
306
- u,
307
- {
308
- icon: lr,
309
- className: "rst:text-gray-400 rst:dark:text-gray-500 rst:w-4"
310
- }
311
- ),
312
- children: l.logOut
282
+ onSelect: M,
283
+ className: tr,
284
+ icon: /* @__PURE__ */ r(y, { icon: fr, className: "rst:text-gray-400 rst:dark:text-gray-500 rst:w-4" }),
285
+ children: c.logOut
313
286
  }
314
- ) }) })
315
- ] })
287
+ ) })
288
+ ]
316
289
  }
317
290
  )
318
- ] }) : /* @__PURE__ */ r(p, { size: "sm", variant: "solid", colorScheme: "primary", onClick: w, children: l.logIn }))
291
+ ] }) }) : /* @__PURE__ */ r(j, { size: "sm", variant: "solid", colorScheme: "primary", onClick: w, children: c.logIn }))
319
292
  ] }),
320
- /* @__PURE__ */ r("div", { "data-roster-hamburger": !0, className: "rst:flex rst:md:hidden", children: /* @__PURE__ */ s(
321
- J,
293
+ /* @__PURE__ */ r("div", { ref: Q, "data-roster-hamburger": !0, className: "rst:flex rst:md:hidden", children: /* @__PURE__ */ a(
294
+ T,
322
295
  {
323
- className: a(
296
+ className: i(
324
297
  "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",
325
- I.hamburger
298
+ F.hamburger
326
299
  ),
327
300
  children: [
328
- /* @__PURE__ */ r("span", { className: "rst:sr-only", children: l.openMainMenu }),
329
- g ? /* @__PURE__ */ r(
330
- u,
301
+ /* @__PURE__ */ r("span", { className: "rst:sr-only", children: c.openMainMenu }),
302
+ h ? /* @__PURE__ */ r(
303
+ y,
331
304
  {
332
- icon: X,
305
+ icon: Y,
333
306
  className: "rst:block rst:h-6 rst:w-6",
334
307
  "aria-hidden": "true"
335
308
  }
336
- ) : /* @__PURE__ */ s("div", { className: "rst:relative", children: [
309
+ ) : /* @__PURE__ */ a("div", { className: "rst:relative", children: [
337
310
  /* @__PURE__ */ r(
338
- u,
311
+ y,
339
312
  {
340
- icon: dr,
313
+ icon: yr,
341
314
  className: "rst:block rst:h-6 rst:w-6",
342
315
  "aria-hidden": "true"
343
316
  }
344
317
  ),
345
- S && /* @__PURE__ */ r("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" })
318
+ k && /* @__PURE__ */ r("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" })
346
319
  ] })
347
320
  ]
348
321
  }
349
322
  ) })
350
323
  ] }),
351
- g && /* @__PURE__ */ r(wr, { close: h }),
352
- g && /* @__PURE__ */ r(Mr, { activePath: N, close: h }),
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 }),
353
327
  /* @__PURE__ */ r(
354
- P,
328
+ Fr,
355
329
  {
356
- as: _,
330
+ as: hr,
357
331
  enter: "rst:duration-200 rst:ease-out",
358
332
  enterFrom: "rst:opacity-0 rst:scale-95",
359
333
  enterTo: "rst:opacity-100 rst:scale-100",
@@ -361,62 +335,61 @@ const Ur = ({
361
335
  leaveFrom: "rst:opacity-100 rst:scale-100",
362
336
  leaveTo: "rst:opacity-0 rst:scale-95",
363
337
  children: /* @__PURE__ */ r(
364
- vr,
338
+ Er,
365
339
  {
366
- focus: !0,
367
340
  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",
368
- children: /* @__PURE__ */ s("div", { "data-roster-mobile-panel": !0, className: "rst:rounded-lg rst:elevation-anchored rst:ring rst:ring-black/5 rst:dark:ring-white/10 rst:divide-y rst:divide-gray-100 rst:dark:divide-gray-700 rst:bg-white rst:dark:bg-gray-800", children: [
369
- /* @__PURE__ */ s("div", { className: "rst:px-5 rst:pt-5 rst:pb-6", children: [
370
- /* @__PURE__ */ s("div", { className: "rst:flex rst:items-center rst:justify-between", children: [
371
- /* @__PURE__ */ s("div", { className: "rst:flex rst:items-center rst:gap-3", children: [
341
+ children: /* @__PURE__ */ a("div", { ref: I, "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: [
342
+ /* @__PURE__ */ a("div", { className: "rst:px-5 rst:pt-5 rst:pb-6", children: [
343
+ /* @__PURE__ */ a("div", { className: "rst:flex rst:items-center rst:justify-between", children: [
344
+ /* @__PURE__ */ a("div", { className: "rst:flex rst:items-center rst:gap-3", children: [
372
345
  /* @__PURE__ */ r(
373
346
  "img",
374
347
  {
375
348
  src: e,
376
349
  alt: "",
377
- style: U,
378
- className: a("rst:shrink-0", V, b ?? "rst:rounded-md")
350
+ style: X,
351
+ className: i("rst:shrink-0", J, g ?? "rst:rounded-md")
379
352
  }
380
353
  ),
381
- R ?? /* @__PURE__ */ r("span", { className: "rst:font-bold rst:text-gray-900 rst:dark:text-white", children: f })
354
+ q ?? /* @__PURE__ */ r("span", { className: "rst:font-bold rst:text-gray-900 rst:dark:text-white", children: x })
382
355
  ] }),
383
- /* @__PURE__ */ r("div", { className: "rst:-mr-2", children: /* @__PURE__ */ s(J, { 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: [
384
- /* @__PURE__ */ r("span", { className: "rst:sr-only", children: l.closeMainMenu }),
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
+ /* @__PURE__ */ r("span", { className: "rst:sr-only", children: c.closeMainMenu }),
385
358
  /* @__PURE__ */ r(
386
- u,
359
+ y,
387
360
  {
388
- icon: X,
361
+ icon: Y,
389
362
  className: "rst:h-6 rst:w-6",
390
363
  "aria-hidden": "true"
391
364
  }
392
365
  )
393
366
  ] }) })
394
367
  ] }),
395
- /* @__PURE__ */ s("div", { className: "rst:mt-6", children: [
396
- O && /* @__PURE__ */ r("div", { className: "rst:mb-4", children: O }),
397
- /* @__PURE__ */ s("nav", { className: "rst:grid rst:gap-y-4", children: [
398
- E.map((t) => {
399
- const d = N === t.path;
368
+ /* @__PURE__ */ a("div", { className: "rst:mt-6", children: [
369
+ L && /* @__PURE__ */ r("div", { className: "rst:mb-4", children: L }),
370
+ /* @__PURE__ */ a("nav", { className: "rst:grid rst:gap-y-4", children: [
371
+ $.map((t) => {
372
+ const f = N === t.path;
400
373
  return /* @__PURE__ */ r(
401
- k,
374
+ A,
402
375
  {
403
- as: x,
376
+ as: v,
404
377
  href: t.path,
405
378
  to: t.path,
406
- onClick: () => h(),
379
+ onClick: () => d(),
407
380
  variant: "neutral",
408
381
  underline: "none",
409
- className: a(
382
+ className: i(
410
383
  "rst:-m-3 rst:flex rst:items-center rst:rounded-md rst:p-3 rst:transition-colors",
411
384
  "rst:hover:bg-gray-50 rst:dark:hover:bg-gray-700",
412
- d ? "rst:bg-gray-50 rst:dark:bg-gray-700" : "rst:text-gray-900 rst:dark:text-gray-100"
385
+ f ? "rst:bg-gray-50 rst:dark:bg-gray-700" : "rst:text-gray-900 rst:dark:text-gray-100"
413
386
  ),
414
- children: /* @__PURE__ */ s(
387
+ children: /* @__PURE__ */ a(
415
388
  "span",
416
389
  {
417
- className: a(
390
+ className: i(
418
391
  "rst:ml-3 rst:inline-flex rst:items-center rst:gap-1.5 rst:text-base rst:font-medium",
419
- d ? "rst:text-primary-600 rst:dark:text-primary-400 rst:font-bold" : "rst:text-gray-900 rst:dark:text-gray-100"
392
+ f ? "rst:text-primary-600 rst:dark:text-primary-400 rst:font-bold" : "rst:text-gray-900 rst:dark:text-gray-100"
420
393
  ),
421
394
  children: [
422
395
  t.label,
@@ -428,31 +401,31 @@ const Ur = ({
428
401
  t.path
429
402
  );
430
403
  }),
431
- o && C.length > 0 && /* @__PURE__ */ s(L, { children: [
404
+ o && S.length > 0 && /* @__PURE__ */ a(U, { children: [
432
405
  /* @__PURE__ */ r("hr", { className: "rst:border-gray-100 rst:dark:border-gray-700" }),
433
- C.map((t) => {
434
- const d = N === t.path;
435
- return /* @__PURE__ */ s(
436
- k,
406
+ S.map((t) => {
407
+ const f = N === t.path;
408
+ return /* @__PURE__ */ a(
409
+ A,
437
410
  {
438
- as: x,
411
+ as: v,
439
412
  href: t.path,
440
413
  to: t.path,
441
- onClick: () => h(),
414
+ onClick: () => d(),
442
415
  variant: "neutral",
443
416
  underline: "none",
444
- className: a(
417
+ className: i(
445
418
  "rst:-m-3 rst:flex rst:items-center rst:rounded-md rst:p-3 rst:transition-colors",
446
419
  "rst:hover:bg-gray-50 rst:dark:hover:bg-gray-700",
447
- d ? "rst:bg-gray-50 rst:dark:bg-gray-700" : "rst:text-gray-900 rst:dark:text-gray-100"
420
+ f ? "rst:bg-gray-50 rst:dark:bg-gray-700" : "rst:text-gray-900 rst:dark:text-gray-100"
448
421
  ),
449
422
  children: [
450
423
  /* @__PURE__ */ r(
451
424
  "span",
452
425
  {
453
- className: a(
426
+ className: i(
454
427
  "rst:ml-3 rst:text-base rst:font-medium",
455
- d ? "rst:text-primary-600 rst:dark:text-primary-400 rst:font-bold" : "rst:text-gray-900 rst:dark:text-gray-100"
428
+ f ? "rst:text-primary-600 rst:dark:text-primary-400 rst:font-bold" : "rst:text-gray-900 rst:dark:text-gray-100"
456
429
  ),
457
430
  children: t.label
458
431
  }
@@ -467,83 +440,83 @@ const Ur = ({
467
440
  ] })
468
441
  ] })
469
442
  ] }),
470
- (o || D || w) && /* @__PURE__ */ r("div", { className: "rst:py-6 rst:px-5 rst:space-y-4", children: D || (!o && w ? /* @__PURE__ */ r(
471
- p,
443
+ (o || O || w) && /* @__PURE__ */ r("div", { className: "rst:py-6 rst:px-5 rst:space-y-4", children: O || (!o && w ? /* @__PURE__ */ r(
444
+ j,
472
445
  {
473
446
  variant: "solid",
474
447
  colorScheme: "primary",
475
448
  className: "rst:w-full rst:justify-center",
476
449
  onClick: () => {
477
- w(), h();
450
+ w(), d();
478
451
  },
479
- children: l.logIn
452
+ children: c.logIn
480
453
  }
481
- ) : /* @__PURE__ */ s(L, { children: [
482
- S && j && /* @__PURE__ */ r(
483
- p,
454
+ ) : /* @__PURE__ */ a(U, { children: [
455
+ k && b && /* @__PURE__ */ r(
456
+ j,
484
457
  {
485
458
  variant: "ghost",
486
459
  colorScheme: "neutral",
487
460
  onClick: () => {
488
- j?.(), h();
461
+ b?.(), d();
489
462
  },
490
463
  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",
491
464
  endIcon: /* @__PURE__ */ r(
492
- G,
465
+ Z,
493
466
  {
494
- fill: q,
467
+ fill: V,
495
468
  size: "xs",
496
469
  statusBadge: !0,
497
- variant: $,
470
+ variant: P,
498
471
  children: o?.notificationCount
499
472
  }
500
473
  ),
501
- children: l.pendingInvitations
474
+ children: c.pendingInvitations
502
475
  }
503
476
  ),
504
- v && /* The row is the switch: one tab stop, its
477
+ p && /* The row is the switch: one tab stop, its
505
478
  state in `aria-checked`, its name from its text. */
506
- /* @__PURE__ */ s(
479
+ /* @__PURE__ */ a(
507
480
  "div",
508
481
  {
509
482
  onClick: (t) => {
510
- t.preventDefault(), v();
483
+ t.preventDefault(), p();
511
484
  },
512
485
  role: "switch",
513
486
  "aria-checked": m,
514
487
  tabIndex: 0,
515
488
  onKeyDown: (t) => {
516
- t.repeat || (t.key === "Enter" || t.key === " ") && (t.preventDefault(), v());
489
+ t.repeat || (t.key === "Enter" || t.key === " ") && (t.preventDefault(), p());
517
490
  },
518
491
  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",
519
492
  children: [
520
- /* @__PURE__ */ s("div", { className: "rst:flex rst:items-center rst:gap-3 rst:font-medium", children: [
493
+ /* @__PURE__ */ a("div", { className: "rst:flex rst:items-center rst:gap-3 rst:font-medium", children: [
521
494
  /* @__PURE__ */ r(
522
- u,
495
+ y,
523
496
  {
524
- icon: T,
525
- className: a(
497
+ icon: W,
498
+ className: i(
526
499
  "rst:w-5 rst:transition-colors",
527
500
  m ? "rst:text-amber-500" : "rst:text-gray-400"
528
501
  )
529
502
  }
530
503
  ),
531
- /* @__PURE__ */ r("span", { children: l.darkMode })
504
+ /* @__PURE__ */ r("span", { children: c.darkMode })
532
505
  ] }),
533
- /* @__PURE__ */ r(Q, { on: m, size: "sm" })
506
+ /* @__PURE__ */ r(H, { on: m, size: "sm" })
534
507
  ]
535
508
  }
536
509
  ),
537
510
  M && /* @__PURE__ */ r(
538
- p,
511
+ j,
539
512
  {
540
513
  variant: "outline",
541
514
  colorScheme: "error",
542
515
  className: "rst:w-full rst:justify-center",
543
516
  onClick: () => {
544
- M?.(), h();
517
+ M?.(), d();
545
518
  },
546
- children: l.logOut
519
+ children: c.logOut
547
520
  }
548
521
  )
549
522
  ] })) })
@@ -558,5 +531,5 @@ const Ur = ({
558
531
  );
559
532
  };
560
533
  export {
561
- Ur as Navbar
534
+ Hr as Navbar
562
535
  };