@theguild/components
Version:
99 lines (93 loc) • 2.53 kB
JavaScript
import { jsx, jsxs } from "react/jsx-runtime";
import { Layout } from "nextra-theme-docs";
import { Head } from "nextra/components";
import { getPageMap } from "nextra/page-map";
import { cn } from "../cn";
import { Body } from "./body.client";
const HiveLayout = async ({
children,
head,
navbar,
footer,
className,
fontFamily,
lightOnlyPages,
bodyProps,
docsRepositoryBase,
...rest
}) => {
const pageMap = await getPageMap();
return /* @__PURE__ */ jsxs(
"html",
{
lang: "en",
dir: "ltr",
suppressHydrationWarning: true,
className: cn("font-sans", className),
...rest,
children: [
/* @__PURE__ */ jsxs(Head, { children: [
/* @__PURE__ */ jsx("style", {
/* css */
children: `
:root {
--font-sans: ${fontFamily};
}
:root.dark {
--nextra-primary-hue: 67.1deg;
--nextra-primary-saturation: 100%;
--nextra-primary-lightness: 55%;
--nextra-bg: 17, 17, 17;
}
:root.dark *::selection {
background-color: hsl(191deg 95% 72% / 0.25)
}
:root.light, :root.dark:has(body.light) {
--nextra-primary-hue: 191deg;
--nextra-primary-saturation: 40%;
--nextra-bg: 255, 255, 255;
}
.x\\:tracking-tight,
.nextra-steps :is(h2, h3, h4) {
letter-spacing: normal;
}
html:has(body.light) {
scroll-behavior: smooth;
background: #fff;
color-scheme: light !important;
}
html:has(body.light) .nextra-search-results mark {
background: oklch(0.611752 0.07807 214.47 / 0.8);
}
html:has(body.light) .nextra-sidebar-footer {
display: none;
}
#crisp-chatbox { z-index: 40 !important; }
`
}),
head
] }),
/* @__PURE__ */ jsx(Body, { lightOnlyPages, ...bodyProps, children: /* @__PURE__ */ jsx(
Layout,
{
editLink: "Edit this page on GitHub",
docsRepositoryBase,
pageMap,
feedback: {
labels: "kind/docs"
},
sidebar: {
defaultMenuCollapseLevel: 1
},
navbar,
footer,
children
}
) })
]
}
);
};
export {
HiveLayout
};