UNPKG

@intility/bifrost-react

Version:

React library for Intility's design system, Bifrost.

45 lines (44 loc) 1.02 kB
"use client"; import { c as _c } from "react-compiler-runtime"; import { createContext, useContext } from "react"; import { jsx as _jsx } from "react/jsx-runtime"; const NavLocationContext = /*#__PURE__*/createContext({}); NavLocationContext.displayName = "NavLocationContext"; const useNavLocation = () => { return useContext(NavLocationContext); }; const NavLocationProvider = t0 => { const $ = _c(6); const { where, sideExpandedOrMobile, children } = t0; let t1; if ($[0] !== sideExpandedOrMobile || $[1] !== where) { t1 = { where, sideExpandedOrMobile }; $[0] = sideExpandedOrMobile; $[1] = where; $[2] = t1; } else { t1 = $[2]; } let t2; if ($[3] !== children || $[4] !== t1) { t2 = /*#__PURE__*/_jsx(NavLocationContext.Provider, { value: t1, children: children }); $[3] = children; $[4] = t1; $[5] = t2; } else { t2 = $[5]; } return t2; }; export { useNavLocation }; export default NavLocationProvider;