UNPKG

fui-fancyui

Version:
70 lines (69 loc) 2.17 kB
"use client"; import { jsx as t, Fragment as b } from "react/jsx-runtime"; import { useEffect as y } from "react"; import i from "./FancyHandyNav.store.js"; import x from "../../atoms/FancyBox/FancyBox.js"; import A from "../../atoms/RawNav/RawNav.js"; import B from "../../molecules/SwitchList/SwitchList.js"; import L from "../FancyBottomBarIcon/FancyBottomBarIcon.js"; import { fancyBarStyle as g, ButtonWrapper as F } from "./FancyHandyNav.style.js"; import N from "../../../design/designFunctions/getOpositMainThemeType/getOpositMainThemeType.js"; import f from "../../../utils/functions/clampLayer/clampLayer.js"; function R(d) { const { items: r, isVisible: a, wichIndexIsActive: n, themeType: s = "primary", themeTypeSwitchList: m = "accent", switchListLayer: c = 1, layer: u = 1, outlined: I, outlinedBackgroundStrength: S, externalStyle: v, ...w } = d, T = i((e) => e.isVisible), l = i((e) => e.setIsVisible), h = i((e) => e.whichIsActive), p = i((e) => e.setWhichIsActive); return y(() => { p(n ?? "0"); }, [n]), y(() => { l(a ?? !0); }, [a, l]), /* @__PURE__ */ t(b, { children: T && // The Navbar container /* @__PURE__ */ t(A, { $externalStyle: v, ...w, children: /* @__PURE__ */ t( x, { outlined: I, themeType: s, layer: u, outlinedBackgroundStrength: S, externalStyle: g, children: /* @__PURE__ */ t( B, { whichIndexIsSelected: Number(h), switchIndicator: { themeType: m, layer: f((c ?? 1) - 3), indicatorWidth: "70%" }, children: r == null ? void 0 : r.map((e, o) => /* @__PURE__ */ t(F, { children: /* @__PURE__ */ t( L, { activeThemeType: m, themeType: N(s), layer: c ?? 0, activeLayer: f((c ?? 1) + 3), isActive: Number(h) === o, ...e, onClick: () => { p(o.toString()), e.onClick && e.onClick(); } } ) }, o)) } ) } ) }) }); } export { R as default };