@raxrai/stylelab-ui 0.4.0 → 0.4.1

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/dist/index.d.mts CHANGED
@@ -336,6 +336,8 @@ type NavbarProps = {
336
336
  items?: NavbarItem[];
337
337
  /** Optional slot for right side (e.g. theme switcher, user menu). Shown after nav items on desktop, in header row on mobile. */
338
338
  right?: ReactNode;
339
+ /** Optional content shown only in the mobile hamburger menu (e.g. Log out button). Rendered at the bottom of the overlay; clicking it closes the menu. */
340
+ mobileMenuExtra?: ReactNode;
339
341
  className?: string;
340
342
  style?: React.CSSProperties;
341
343
  };
package/dist/index.d.ts CHANGED
@@ -336,6 +336,8 @@ type NavbarProps = {
336
336
  items?: NavbarItem[];
337
337
  /** Optional slot for right side (e.g. theme switcher, user menu). Shown after nav items on desktop, in header row on mobile. */
338
338
  right?: ReactNode;
339
+ /** Optional content shown only in the mobile hamburger menu (e.g. Log out button). Rendered at the bottom of the overlay; clicking it closes the menu. */
340
+ mobileMenuExtra?: ReactNode;
339
341
  className?: string;
340
342
  style?: React.CSSProperties;
341
343
  };
package/dist/index.mjs CHANGED
@@ -13238,21 +13238,28 @@ var Modal = forwardRef20(function Modal2({
13238
13238
  // components/Navbar.tsx
13239
13239
  import { forwardRef as forwardRef21, useCallback as useCallback11, useRef as useRef7, useState as useState8 } from "react";
13240
13240
  import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
13241
- var Navbar = forwardRef21(function Navbar2({ children, logo, items, right, className, style }, ref) {
13241
+ var DARK_PANEL_THEMES = ["night", "glass", "cyberpunk"];
13242
+ function mobilePanelOpaqueClasses(theme) {
13243
+ if (DARK_PANEL_THEMES.includes(theme)) {
13244
+ return "bg-zinc-900 text-zinc-100 border-zinc-700";
13245
+ }
13246
+ return "bg-white text-zinc-900 border-zinc-200";
13247
+ }
13248
+ var Navbar = forwardRef21(function Navbar2({ children, logo, items, right, mobileMenuExtra, className, style }, ref) {
13242
13249
  const [mobileOpen, setMobileOpen] = useState8(false);
13243
13250
  const navRef = useRef7(null);
13251
+ const wrapperRef = useRef7(null);
13244
13252
  const mergedNavRef = mergeRefs(ref, navRef);
13245
13253
  const { theme } = useTheme();
13246
13254
  const themeClass = getThemeClass(theme, "navbar", "default");
13247
- const mobilePanelBgOverride = theme === "glass" ? "bg-white/95 backdrop-blur-xl" : theme === "clay" ? "bg-white/95" : null;
13248
13255
  useClickOutside(
13249
- navRef,
13256
+ wrapperRef,
13250
13257
  useCallback11(() => setMobileOpen(false), []),
13251
13258
  { enabled: mobileOpen }
13252
13259
  );
13253
13260
  const hasResponsiveNav = items != null && items.length > 0;
13254
13261
  if (hasResponsiveNav) {
13255
- return /* @__PURE__ */ jsxs19(
13262
+ return /* @__PURE__ */ jsx22(
13256
13263
  "nav",
13257
13264
  {
13258
13265
  ref: mergedNavRef,
@@ -13262,7 +13269,7 @@ var Navbar = forwardRef21(function Navbar2({ children, logo, items, right, class
13262
13269
  className
13263
13270
  ),
13264
13271
  style,
13265
- children: [
13272
+ children: /* @__PURE__ */ jsxs19("div", { ref: wrapperRef, className: "flex min-h-14 w-full flex-col", children: [
13266
13273
  /* @__PURE__ */ jsxs19("div", { className: "flex h-14 w-full min-w-0 shrink-0 items-center justify-between gap-2", children: [
13267
13274
  logo != null ? /* @__PURE__ */ jsx22("div", { className: "flex min-w-0 shrink-0 items-center overflow-hidden", children: logo }) : null,
13268
13275
  /* @__PURE__ */ jsxs19("div", { className: "hidden flex-1 items-center justify-end gap-4 sm:flex", children: [
@@ -13292,29 +13299,39 @@ var Navbar = forwardRef21(function Navbar2({ children, logo, items, right, class
13292
13299
  )
13293
13300
  ] })
13294
13301
  ] }),
13295
- mobileOpen && /* @__PURE__ */ jsx22(
13302
+ mobileOpen && /* @__PURE__ */ jsxs19(
13296
13303
  "div",
13297
13304
  {
13298
13305
  className: cn(
13299
- "absolute left-0 right-0 top-14 z-10 flex flex-col gap-1 border-t border-inherit px-3 py-3 shadow-lg sm:hidden",
13300
- themeClass,
13301
- mobilePanelBgOverride
13306
+ "absolute left-0 right-0 top-14 z-10 flex flex-col gap-1 border-t px-3 py-3 shadow-lg sm:hidden",
13307
+ mobilePanelOpaqueClasses(theme)
13302
13308
  ),
13303
13309
  role: "dialog",
13304
13310
  "aria-label": "Navigation menu",
13305
- children: items.map((item) => /* @__PURE__ */ jsx22(
13306
- "a",
13307
- {
13308
- href: item.href,
13309
- className: "block rounded-lg px-3 py-2.5 text-sm font-medium text-inherit opacity-90 transition-opacity hover:opacity-100",
13310
- onClick: () => setMobileOpen(false),
13311
- children: item.label
13312
- },
13313
- item.href
13314
- ))
13311
+ children: [
13312
+ items.map((item) => /* @__PURE__ */ jsx22(
13313
+ "a",
13314
+ {
13315
+ href: item.href,
13316
+ className: "block rounded-lg px-3 py-2.5 text-sm font-medium text-inherit opacity-90 transition-opacity hover:opacity-100",
13317
+ onClick: () => setMobileOpen(false),
13318
+ children: item.label
13319
+ },
13320
+ item.href
13321
+ )),
13322
+ mobileMenuExtra != null ? /* @__PURE__ */ jsx22(
13323
+ "div",
13324
+ {
13325
+ className: "mt-2 border-t border-inherit pt-3",
13326
+ onClick: () => setMobileOpen(false),
13327
+ role: "presentation",
13328
+ children: mobileMenuExtra
13329
+ }
13330
+ ) : null
13331
+ ]
13315
13332
  }
13316
13333
  )
13317
- ]
13334
+ ] })
13318
13335
  }
13319
13336
  );
13320
13337
  }