import { useState } from "react"; import { CenteredShell, Flex, LegalDocumentShell, Topbar } from "@godxjp/ui/layout"; import { Button, Logo, Text } from "@godxjp/ui/general"; import { AppSettingPicker } from "@godxjp/ui/navigation"; import { TERMS_JA } from "./_data"; /** * LegalDocumentShell — the long-form legal/policy document surface (terms, privacy, DPA, cookie * policy, SLA) with a table of contents. * * This is the canonical hosted legal screen: a `CenteredShell` (brand bar + locale picker + page * footer) whose column holds the document. The shell owns the geometry AND the behaviour — sticky * contents rail at ≥56rem, scroll-spy `aria-current`, hash deep links with a token-driven scroll * offset, focus handoff into the target section, reduced-motion-aware scrolling. All legal text is * consumer-owned and arrives through `sections`. * * Shown here: controlled `activeSection` / `onActiveSectionChange`, `version` + ISO `effectiveDate` * (formatted with `Intl.DateTimeFormat`), `summary`, `contentsLabel`, the `documentNavigation` rail * slot and the `footerAction` slot. Composed only from real @godxjp/ui components — zero custom CSS. */ const DOCUMENTS = [ { id: "terms", label: "利用規約" }, { id: "privacy", label: "プライバシーポリシー" }, { id: "cookies", label: "Cookie ポリシー" }, ]; export default function Demo() { const [documentId, setDocumentId] = useState("terms"); const [activeSection, setActiveSection] = useState("acceptance"); return ( GodX ID } end={} /> } footer={ 2026 GodX 株式会社 } > ({ id: section.id, title: section.title, content: ( {section.paragraphs.map((paragraph) => ( {paragraph} ))} ), }))} activeSection={activeSection} onActiveSectionChange={setActiveSection} documentNavigation={ {DOCUMENTS.map((document) => ( ))} } footerAction={ } /> ); }