48 lines
1.6 KiB
Plaintext
48 lines
1.6 KiB
Plaintext
"use client";
|
|
import {
|
|
navbar_menu_default
|
|
} from "./chunk-BKQISTKS.mjs";
|
|
import {
|
|
hideOnScrollVariants
|
|
} from "./chunk-RRUQIZLR.mjs";
|
|
import {
|
|
useNavbar
|
|
} from "./chunk-LTNGAWBY.mjs";
|
|
import {
|
|
NavbarProvider
|
|
} from "./chunk-IGERPFKH.mjs";
|
|
|
|
// src/navbar.tsx
|
|
import { forwardRef } from "@heroui/system";
|
|
import { pickChildren } from "@heroui/react-utils";
|
|
import { LazyMotion, m } from "framer-motion";
|
|
import { mergeProps } from "@react-aria/utils";
|
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
var domAnimation = () => import("@heroui/dom-animation").then((res) => res.default);
|
|
var Navbar = forwardRef((props, ref) => {
|
|
const { children, ...otherProps } = props;
|
|
const context = useNavbar({ ...otherProps, ref });
|
|
const Component = context.Component;
|
|
const [childrenWithoutMenu, menu] = pickChildren(children, navbar_menu_default);
|
|
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
/* @__PURE__ */ jsx("header", { ...context.getWrapperProps(), children: childrenWithoutMenu }),
|
|
menu
|
|
] });
|
|
return /* @__PURE__ */ jsx(NavbarProvider, { value: context, children: context.shouldHideOnScroll ? /* @__PURE__ */ jsx(LazyMotion, { features: domAnimation, children: /* @__PURE__ */ jsx(
|
|
m.nav,
|
|
{
|
|
animate: context.isHidden ? "hidden" : "visible",
|
|
initial: false,
|
|
variants: hideOnScrollVariants,
|
|
...mergeProps(context.getBaseProps(), context.motionProps),
|
|
children: content
|
|
}
|
|
) }) : /* @__PURE__ */ jsx(Component, { ...context.getBaseProps(), children: content }) });
|
|
});
|
|
Navbar.displayName = "HeroUI.Navbar";
|
|
var navbar_default = Navbar;
|
|
|
|
export {
|
|
navbar_default
|
|
};
|