"use client"; import "./components/ui/tidal.css"; import { useState } from "react"; import { BookOpen, Braces, CreditCard, FolderOpen, Keyboard, LockKeyhole, Palette, RefreshCw, Users } from "lucide-react"; import { TidalFaqSection, type TidalFaqGroup } from "./components/ui/faq-section"; import "./components/ui/faq-section.css"; import "./components/ui/accordion.css"; const tidalExampleStyles = ".tidal-scope .faq-section-demo,\n.tidal-scope .faq-section-demo * {\n box-sizing: border-box;\n}\n\n.tidal-scope .faq-section-demo {\n width: 100%;\n min-width: 0;\n padding: clamp(10px, 3.2vw, 36px);\n color: var(--t-ink);\n background:\n linear-gradient(var(--t-border) 1px, transparent 1px),\n linear-gradient(90deg, var(--t-border) 1px, transparent 1px),\n var(--t-subtle);\n background-size: 27px 27px;\n border-radius: 24px;\n container: faq-demo / inline-size;\n}\n\n.tidal-scope .faq-section-demo-shell {\n display: grid;\n width: 100%;\n max-width: 1180px;\n min-width: 0;\n gap: 12px;\n margin: 0 auto;\n}\n\n.tidal-scope .faq-section-demo-status {\n min-height: 16px;\n margin: 0;\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.55;\n text-align: center;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .faq-section-demo-note {\n width: 100%;\n max-width: 1120px;\n min-width: 0;\n margin: 0 auto;\n padding: 15px 17px;\n color: var(--t-ink);\n background: var(--t-surface);\n border: 1px solid var(--t-border);\n border-radius: 18px;\n scroll-margin-top: 16px;\n}\n\n.tidal-scope .faq-section-demo-note > * {\n display: block;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .faq-section-demo-note > span {\n color: var(--t-muted);\n font-size: 11px;\n font-weight: 690;\n letter-spacing: 0.11em;\n}\n\n.tidal-scope .faq-section-demo-note > strong {\n margin-top: 5px;\n font-size: 13px;\n line-height: 1.4;\n}\n\n.tidal-scope .faq-section-demo-note > p {\n margin: 4px 0 0;\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.6;\n}\n\n@container faq-demo (max-width: 440px) {\n .tidal-scope .faq-section-demo {\n padding: 6px;\n background-size: 18px 18px;\n border-radius: 18px;\n }\n}\n.tidal-scope .faq-section-demo-link {\n display: inline-flex;\n min-width: 44px;\n min-height: 44px;\n max-width: 100%;\n align-items: center;\n padding-block: 8px;\n color: var(--t-ink);\n text-decoration: underline;\n text-underline-offset: 4px;\n overflow-wrap: anywhere;\n}"; type CategoryId = "all" | "starting" | "workflow" | "access"; const GROUPS: readonly TidalFaqGroup[] = [ { id: "starting", label: "Getting started", description: "Install, style, and test the first sample component.", questions: [ { value: "install", title: "How do I install a component?", searchText: "registry command files css styles dependency", icon: Braces, answer: (
Copy the registry command from the component page and import its listed stylesheets.
View installation noteYes. TidalUI demos use clearly labelled fictional data and local React state. Replace the supplied records and handlers with your own application data when you integrate a component.
), }, { value: "keyboard", title: "What keyboard checks should I run?", searchText: "accessibility arrows home end tab enter space focus", icon: Keyboard, answer: (Test Tab order, visible focus, Enter and Space activation, then the arrow, Home, and End behavior documented for the primitive. Repeat the flow at a narrow width and with reduced motion enabled.
), }, ], }, { id: "workflow", label: "Project workflow", description: "Keep component changes legible inside a product codebase.", questions: [ { value: "tokens", title: "Can I change the visual tokens?", searchText: "theme color radius typography monochrome css", icon: Palette, answer: (Yes. Apply your values through the documented Tidal scope tokens so focus, contrast, and light or dark surfaces stay coordinated. Keep the component's state selectors intact.
), }, { value: "updates", title: "How should I review an update?", searchText: "upgrade diff source behavior regression", icon: BookOpen, answer: (Read the source diff, repeat the component's native interaction path, and verify the widths your product actually supports. Treat a demo screenshot as visual evidence, not proof of your integration.
), }, { value: "state", title: "Who owns requests and saved state?", searchText: "network persistence storage server handlers controlled", icon: RefreshCw, answer: (Your application does. Reusable TidalUI components expose native events and controlled values; consumers connect those requests, persistence rules, and result messages.
), }, ], }, { id: "access", label: "Access and plans", description: "Understand source access without implying a transaction.", questions: [ { value: "free-pro", title: "What is the difference between Free and Pro items?", searchText: "license registry source plan access", icon: CreditCard, answer: (Free items expose their public registry source. Pro pages show the component contract and preview, while source access depends on the product plan selected by the consumer. This sample does not sell or unlock anything.
), }, { value: "team-use", title: "Can a team share the installed source?", searchText: "members workspace organization license", icon: Users, answer: (Follow the license attached to the source package and your own repository access policy. This fictional FAQ does not grant or change a license.
), }, { value: "credentials", title: "Do the components need account credentials?", searchText: "secret token password api authentication", icon: LockKeyhole, answer: (No credential is required to render a component. If your product connects a service, keep secrets on your backend and pass only the safe state and actions the interface needs.
), }, ], }, ] as const; const CATEGORY_OPTIONS = [ { id: "all", label: "All" }, { id: "starting", label: "Start" }, { id: "workflow", label: "Workflow" }, { id: "access", label: "Access" }, ] as const; export function FaqSectionDemo() { const [query, setQuery] = useState(""); const [category, setCategory] = useState{message}