UNPKG

@rws-aoa/react-library

Version:

RWS AOA Design System

101 lines (100 loc) 3.77 kB
import { jsx as n, jsxs as y } from "react/jsx-runtime"; import { c as B } from "../../../chunks/compiler-runtime.hDcrsMwn.js"; import { Box as R, AppBar as W, Toolbar as A } from "@mui/material"; import { l as I } from "../../../chunks/lodash.CA_K01A9.js"; import { useState as M, useEffect as S } from "react"; import { FontNormalSxProps as P } from "../../../_constants.js"; import { AoaMenuItem as p } from "../../atoms/_menu/menu-item/MenuItem.js"; import { AoaUserMenu as T } from "../../atoms/_menu/user-menu/UserMenu.js"; function U(t) { const e = B.c(28), [o, k] = M(0); let m, b; e[0] === Symbol.for("react.memo_cache_sentinel") ? (m = () => { const r = window.sessionStorage.getItem("activeMenuTab"); r && k(JSON.parse(r)); }, b = [], e[0] = m, e[1] = b) : (m = e[0], b = e[1]), S(m, b); let f, d; e[2] !== o ? (f = () => { window.sessionStorage.setItem("activeMenuTab", o.toString()); }, d = [o], e[2] = o, e[3] = f, e[4] = d) : (f = e[3], d = e[4]), S(f, d); let g; e[5] === Symbol.for("react.memo_cache_sentinel") ? (g = I.merge({ color: "var(--color-text)", backgroundColor: "var(--color-rijks-yellow)", height: "70px", boxShadow: "none" }, P), e[5] = g) : g = e[5]; let u; e[6] === Symbol.for("react.memo_cache_sentinel") ? (u = { height: "100%", overflowX: "scroll", scrollbarWidth: "thin", scrollbarColor: "#c5c5c5 #f6f6f6", "::-webkit-scrollbar": { overflow: "visible", borderRadius: "4px", width: "6px", height: "6px", WebkitBorderRadius: "4px" }, "::-webkit-scrollbar:hover": { background: "#c5c5c5;" }, "::-webkit-scrollbar-corner": { background: "rgba(0,0,0,0.5)" }, "::-webkit-scrollbar-track": { opacity: 0, transition: "all 0.5s", WebkitTransition: "all .5s" }, "::-webkit-scrollbar-thumb": { overflow: "visible", backgroundColor: "#c5c5c5;", borderRadius: "4px", border: "3px solid #f6f6f6" }, "::-webkit-scrollbar-thumb:vertical": { background: "rgba(100, 100, 100, .5)", WebkitBorderRadius: "100px" }, "::-webkit-scrollbar-thumb:vertical:active": { background: "rgba(100, 100, 100, .61)", WebkitBorderRadius: "100px" } }, e[6] = u) : u = e[6]; const w = t.homePath ?? "/"; let l; e[7] !== t.name || e[8] !== w ? (l = { label: t.name, to: w }, e[7] = t.name, e[8] = w, e[9] = l) : l = e[9]; let i; e[10] !== o || e[11] !== l ? (i = /* @__PURE__ */ n(p, { index: 0, page: l, selectedPage: o, setSelectedPage: k }), e[10] = o, e[11] = l, e[12] = i) : i = e[12]; let h; e[13] === Symbol.for("react.memo_cache_sentinel") ? (h = { flexGrow: 1, display: "flex", height: "100%" }, e[13] = h) : h = e[13]; let a; if (e[14] !== t.pages || e[15] !== o) { let r; e[17] !== o ? (r = (_, v) => /* @__PURE__ */ n(p, { index: v + 1, page: _, selectedPage: o, setSelectedPage: k }, v), e[17] = o, e[18] = r) : r = e[18], a = t.pages.map(r), e[14] = t.pages, e[15] = o, e[16] = a; } else a = e[16]; let s; e[19] !== a ? (s = /* @__PURE__ */ n(R, { sx: h, children: a }), e[19] = a, e[20] = s) : s = e[20]; let c; e[21] !== t.settings || e[22] !== t.username ? (c = /* @__PURE__ */ n(T, { settings: t.settings, username: t.username }), e[21] = t.settings, e[22] = t.username, e[23] = c) : c = e[23]; let x; return e[24] !== s || e[25] !== c || e[26] !== i ? (x = /* @__PURE__ */ n(W, { position: "static", sx: g, children: /* @__PURE__ */ y(A, { role: "menu", sx: u, tabIndex: 0, children: [ i, s, c ] }) }), e[24] = s, e[25] = c, e[26] = i, e[27] = x) : x = e[27], x; } export { U as AoaNavigationBar }; //# sourceMappingURL=NavigationBar.js.map