Skip to documentation

Design system / Sources & standards

Current repository source

documentation-navigation.tsx

src/components/navigation/instances/documentation-navigation.tsx

This view contains the escaped source read during the deployment build. Code and policy text are unchanged. Markdown is shown as source, not rendered as a document. A new deployment refreshes the content.

import {
  sections,
  sectionHref,
} from "@/app/(public)/design-system/_lib/catalog";
import { SectionNavigation } from "../section-navigation";
import {
  organismGroups,
  organismGroupHref,
} from "@/app/(public)/design-system/_lib/organisms";

/** Cross-documentation-route instance: binds catalogue, numbering and copy.
 * DocsShell supplies URL-derived IDs; the organism owns layout/disclosure. */
export function DocumentationNavigation({
  currentSectionId,
  currentMoleculeId,
  moleculeEntries = [],
  className,
}: {
  currentSectionId: string;
  currentMoleculeId?: string;
  moleculeEntries?: readonly { id: string; name: string }[];
  className?: string;
}) {
  const items = sections.map((section, index) => ({
    id: section.id,
    label: section.title,
    href: sectionHref(section.id),
    prefix: String(index).padStart(2, "0"),
    children:
      section.id === "larger"
        ? organismGroups.map((group) => ({
            id: group.id,
            label: group.title,
            href: organismGroupHref(group.id),
          }))
        : section.id === "molecules"
          ? moleculeEntries.map((entry) => ({
              id: entry.id,
              label: entry.name,
              href: `/design-system/molecules/${entry.id}`,
            }))
          : undefined,
  }));
  return (
    <SectionNavigation
      aria-label="Design-system pages"
      items={items}
      activeId={currentSectionId}
      activeChildId={
        currentSectionId === "molecules" ? currentMoleculeId : undefined
      }
      orientation="responsive"
      className={className}
    />
  );
}
All sources and standards
Current components and theme tokens. Fictional example data. Source views refresh on deployment; authors maintain contract notes.