@rws-aoa/react-library
Version:
RWS AOA Design System
98 lines (97 loc) • 3.79 kB
JavaScript
import { jsx as f, jsxs as y } from "react/jsx-runtime";
import { c as B } from "../../../chunks/compiler-runtime.CrLvXwKf.js";
import { Box as S, AppBar as W, Toolbar as R } from "@mui/material";
import { useLocation as _ } from "@tanstack/react-router";
import { l as P } from "../../../chunks/lodash.DPVO3Hgf.js";
import { useState as A, useEffect as I } from "react";
import { FontNormalSxProps as j } from "../../../_constants.js";
import { AoaMenuItem as p } from "../../atoms/_menu/menu-item/MenuItem.js";
import { AoaUserMenu as C } from "../../atoms/_menu/user-menu/UserMenu.js";
function $(t) {
const e = B.c(27), [o, w] = A(null), c = _();
let d, h;
e[0] !== c.pathname || e[1] !== t.pages ? (d = () => {
const a = t.pages.findIndex((m) => m.to && c.pathname.startsWith(m.to) || m.subItems?.some((b) => b.to && c.pathname.startsWith(b.to)));
w(a >= 0 ? a + 1 : 0);
}, h = [c.pathname, t.pages], e[0] = c.pathname, e[1] = t.pages, e[2] = d, e[3] = h) : (d = e[2], h = e[3]), I(d, h);
let g;
e[4] === Symbol.for("react.memo_cache_sentinel") ? (g = P.merge({
color: "var(--color-text)",
backgroundColor: "var(--color-rijks-yellow)",
height: "70px",
boxShadow: "none"
}, j), e[4] = g) : g = e[4];
let u;
e[5] === 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[5] = u) : u = e[5];
const v = t.homePath ?? "/";
let r;
e[6] !== t.name || e[7] !== v ? (r = {
label: t.name,
to: v
}, e[6] = t.name, e[7] = v, e[8] = r) : r = e[8];
let l;
e[9] !== o || e[10] !== r ? (l = /* @__PURE__ */ f(p, { index: 0, page: r, selectedPage: o, setSelectedPage: w }), e[9] = o, e[10] = r, e[11] = l) : l = e[11];
let x;
e[12] === Symbol.for("react.memo_cache_sentinel") ? (x = {
flexGrow: 1,
display: "flex",
height: "100%"
}, e[12] = x) : x = e[12];
let i;
if (e[13] !== t.pages || e[14] !== o) {
let a;
e[16] !== o ? (a = (m, b) => /* @__PURE__ */ f(p, { index: b + 1, page: m, selectedPage: o, setSelectedPage: w }, b), e[16] = o, e[17] = a) : a = e[17], i = t.pages.map(a), e[13] = t.pages, e[14] = o, e[15] = i;
} else
i = e[15];
let s;
e[18] !== i ? (s = /* @__PURE__ */ f(S, { sx: x, children: i }), e[18] = i, e[19] = s) : s = e[19];
let n;
e[20] !== t.settings || e[21] !== t.username ? (n = /* @__PURE__ */ f(C, { settings: t.settings, username: t.username }), e[20] = t.settings, e[21] = t.username, e[22] = n) : n = e[22];
let k;
return e[23] !== n || e[24] !== l || e[25] !== s ? (k = /* @__PURE__ */ f(W, { position: "static", sx: g, children: /* @__PURE__ */ y(R, { role: "menu", sx: u, tabIndex: 0, children: [
l,
s,
n
] }) }), e[23] = n, e[24] = l, e[25] = s, e[26] = k) : k = e[26], k;
}
export {
$ as AoaNavigationBar
};
//# sourceMappingURL=NavigationBar.js.map