UNPKG

@veracity/vui

Version:

Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.

34 lines (32 loc) 1.17 kB
import { cs } from "../utils/styles.js"; import { useStyleConfig } from "../core/theme.js"; import vui from "../core/vui.js"; import { List } from "../list/list.js"; import { useHeaderContext } from "./context.js"; import { HeaderLinkItem } from "./headerLinkItem.js"; import { jsx } from "react/jsx-runtime"; //#region src/header/headerMainLinks.tsx /** List of Header Links. */ const HeaderMainLinks = vui((props, ref) => { const { children, className, links, ...rest } = props; const { isMobile } = useHeaderContext() ?? {}; const styles = useStyleConfig("Header", useHeaderContext()); const screenStyles = isMobile ? { flexDirection: "column", mb: 1 } : { h: "100%" }; return /* @__PURE__ */ jsx(List, { className: cs("vui-headerMainLinks", className), display: "flex", ref, ...styles.mainLinks, ...screenStyles, ...rest, children: children ?? links?.map((link, index) => /* @__PURE__ */ jsx(HeaderLinkItem, { ...link }, index)) }); }); HeaderMainLinks.displayName = "HeaderMainLinks"; //#endregion export { HeaderMainLinks, HeaderMainLinks as default }; globalThis.__vuiVersion__ = "5.3.1" //# sourceMappingURL=headerMainLinks.js.map