diff --git a/docs/src/components/layout.tsx b/docs/src/components/layout.tsx
index 0c58a87..eb59e62 100644
--- a/docs/src/components/layout.tsx
+++ b/docs/src/components/layout.tsx
@@ -1,9 +1,10 @@
import { Icon } from "@icones/react"
import { cn } from "../lib/utils"
-import { useTranslate } from "../lib/locale"
+import { useLocale, useTranslate } from "../lib/locale"
import React from "react"
import { SearchTrigger } from "./search-trigger"
import { SettingsLink } from "./settings-link"
+import { getDocsHomeHref } from "../content/registry"
export const rootCSSVariables = {
"--cw": "60rem",
@@ -83,11 +84,110 @@ export function SlashLine({ className }: { className?: string }) {
)
}
-export function Actions({ className }: { className?: string }) {
+export function Actions() {
return (
-
+ <>
-
+ >
+ )
+}
+
+export function SiteHeader({
+ banner,
+ bottom,
+ leading,
+ subleading,
+ actions,
+ locale,
+ ...rest
+}: React.ComponentProps<"header"> & {
+ banner?: React.ReactNode
+ bottom?: React.ReactNode
+ leading?: React.ReactNode
+ subleading?: React.ReactNode
+ actions?: React.ReactNode
+ locale?: string
+}) {
+ return (
+
+ {banner}
+
+ {bottom}
+
+ )
+}
+
+function HeaderInner({
+ leading,
+ subleading,
+ actions,
+ locale,
+}: {
+ leading?: React.ReactNode
+ subleading?: React.ReactNode
+ actions?: React.ReactNode
+ locale?: string
+}) {
+ const resolvedLocale = useLocale() ?? locale
+ const hasLeading = React.Children.count(leading) > 0
+ const hasSubleading = React.Children.count(subleading) > 0
+
+ const children = []
+ if (hasLeading || hasSubleading) {
+ children.push(
+ hasLeading ? (
+ leading
+ ) : hasSubleading ? (
+
+ ) : null,
+ hasSubleading && ,
+ subleading
+ )
+ } else {
+ children.push(
+
+ S
+ imple
+
+ R
+ eact
+
+ A
+ pp
+
+ K
+ it
+
+ )
+ }
+
+ if (actions != null) {
+ children.push(
+
+ {actions}
+
+ )
+ }
+
+ return (
+
+ {children}
+
+ )
+}
+
+export function SiteFooter({ className, ...rest }: React.ComponentProps<"footer">) {
+ return (
+
)
}
diff --git a/docs/src/pages/article.tsx b/docs/src/pages/article.tsx
index ceb98c0..9037637 100644
--- a/docs/src/pages/article.tsx
+++ b/docs/src/pages/article.tsx
@@ -5,11 +5,14 @@ import {
getDocHref,
getDocPackages,
getDocSectionLabel,
- getDocsHomeHref,
resolveDocLocation,
} from "../content/registry"
import type { DocLocation, DocPage, DocTocItem } from "../content/types"
-import { Actions, Container, HomeButton, SlashLine } from "../components/layout"
+import {
+ Actions,
+ SiteFooter,
+ SiteHeader,
+} from "../components/layout"
import { mdxComponents } from "../components/mdx"
import { useLocale, useTranslate } from "../lib/locale"
@@ -113,17 +116,12 @@ export default function ArticlePage({ pathname }: { pathname: string }) {
return (
<>
-
-
-
-
- {docLocation.package.label}
-
-
-
+ subleading={{docLocation.package.label}
}
+ actions={}
+ />
-
+
>
)
}
diff --git a/docs/src/pages/index.tsx b/docs/src/pages/index.tsx
index 2613520..f4614de 100644
--- a/docs/src/pages/index.tsx
+++ b/docs/src/pages/index.tsx
@@ -1,4 +1,9 @@
-import { Actions, Container } from "../components/layout"
+import {
+ Actions,
+ Container,
+ SiteFooter,
+ SiteHeader,
+} from "../components/layout"
import { getDocHref, getDocPackages } from "../content/registry"
import { useLocale, useTranslate } from "../lib/locale"
@@ -9,23 +14,10 @@ export default function IndexPage() {
return (
<>
-
-
- S
- imple
-
- R
- eact
-
- A
- pp
-
- K
- it
-
- alpha
-
-
+ }
+ />
))}
-
+
>
)
}
diff --git a/docs/src/pages/settings.tsx b/docs/src/pages/settings.tsx
index 9267816..13283eb 100644
--- a/docs/src/pages/settings.tsx
+++ b/docs/src/pages/settings.tsx
@@ -1,7 +1,11 @@
import { Icon } from "@icones/react"
import { usePreference } from "@workspace/preferences"
-import { BackButton, Container, SlashLine } from "../components/layout"
+import {
+ Container,
+ SiteFooter,
+ SiteHeader,
+} from "../components/layout"
import { LocaleFlag } from "../components/locale-flag"
import { SearchTrigger } from "../components/search-trigger"
import { Swatch } from "../components/swatch"
@@ -80,19 +84,16 @@ export default function SettingsPage() {
return (
<>
-
-
-
-
+ {t(messages.settings)}
-
-
-
-
-
+ }
+ className="h-16 border-b bg-white/70 backdrop-blur-sm dark:border-slate-800 dark:bg-slate-950/80"
+ actions={}
+ />
-
+
{t(messages.appearance)}
@@ -271,6 +272,7 @@ export default function SettingsPage() {
+
>
)
}