This page is for OFFER-HUB contributors working on the documentation site itself. It is not part of the public marketplace-integration guidance for teams consuming the Orchestrator API or SDK.
Internal contributor documentation for the OFFER-HUB documentation site's design system.
This page is for OFFER-HUB contributors working on the documentation site itself. It is not part of the public marketplace-integration guidance for teams consuming the Orchestrator API or SDK.
This guide documents the OFFER-HUB design system, including colors, typography, and component styling for both light and dark modes.
Use ParamTable for request parameters and ResponseSchema for response fields. Both use the shared Table exported from src/components/docs/ParamTable.tsx, as do MDX tables and the roadmap table. The table keeps wide content inside a labelled, keyboard-focusable scroll region so narrow viewports never widen the page. Nested fields start expanded and can be collapsed; field metadata supports defaults, enums, nullable values, and deprecation notes.
All code samples render through the single CodeBlock in src/components/docs/CodeBlock.tsx: fenced MDX blocks, CodeTabs, CommandLine (terminal mode), the API explorer, ResponseSchema, the MCP dialog and the use-case showcase. Shiki uses palette CSS variables so tokens follow light and dark themes; the shared header carries the language/label, optional tabs and the copy button. Use Callout in src/components/docs/Callout.tsx for notices instead of local alert markup.
The example below is reviewed against the checked-in Orchestrator contract at public/openapi.json: the /balances operation (get-user-balances) and its response example. In the orchestrator source, keep the corresponding controller and DTO references alongside the contract when updating a schema page.
OFFER-HUB uses CSS variables for theme-aware colors. All colors automatically adapt when switching between light and dark modes.
Use these Tailwind classes for theme-aware styling:
OFFER-HUB uses Inter as the primary font:
Use size="sm", size="md" (the default), or size="lg" for the shared
36px, 44px, and 48px control heights. Pass href to render a Next.js link,
and use leadingIcon, trailingIcon, or loading for the corresponding
button affordances.
Show the same request in multiple languages with the internal CodeTabs
component (registered in src/components/docs/mdx-components.tsx and
implemented in src/components/docs/CodeTabs.tsx):
Rules and behaviour:
tablist / tab / tabpanel roles with
roving tabindex. ArrowLeft / ArrowRight move between tabs, Home / End
jump to the first / last tab, and only the selected tab is in the tab order.
Panels are wired with aria-controls / aria-labelledby.CodeBlock header button copies the selected
panel's code and announces the result in a polite live region; inactive panels
are hidden from view and the accessibility tree.localStorage under offer-hub-docs-code-tab and re-applied on every docs
page. All CodeTabs instances on a page stay in sync (custom storage /
offer-hub-code-tab-change events), so a reader who picks TypeScript once
gets TypeScript preselected wherever a matching tab exists.bg-bg-elevated, bg-bg-sunken,
shadow-neu-raised, shadow-neu-sunken-subtle, shadow-neu-raised-sm,
text-content-*). No hardcoded colors, no colored borders — light and dark
mode come from the token system automatically.Tabs are matched by label, not index. Reuse the same labels across pages
(e.g. always cURL, TypeScript, Python) so the remembered choice
carries over.
All generated diagrams (Mermaid today — the same token contract is designed to carry over to a future static/offline pipeline) share one neumorphic theme module: src/lib/diagram-theme.ts. It reads colors directly from the CSS custom properties documented above — never hardcoded hex values — so every diagram matches the current site in both light and dark mode automatically, with no per-diagram theme code.
readDiagramColorTokens() reads --color-bg-elevated, --color-bg-sunken, --color-text-primary, --color-text-secondary, --color-border, --shadow-dark, and --shadow-light from whichever scope (:root or .dark) is active.getMermaidThemeVariables() maps those tokens onto Mermaid's themeVariables (node fill, text, line color, cluster background). Node and cluster borders use the neutral --color-border token — never --color-primary — so diagram structure reads through soft shadow depth, not a colored outline.getNeumorphicDiagramCSS() applies the same dual drop-shadow used by shadow-neu-raised (dark shadow bottom-right, light highlight top-left — the 135° light source from docs/design/neumorphism.md) directly to every node shape, via Mermaid's themeCSS hook.src/components/shared/MermaidDiagram.tsx is the single rendering component; import it from @/components/shared/MermaidDiagram. Every fenced mermaid code block in MDX renders through it automatically via src/components/docs/mdx-components.tsx, so it already produces a correct light and a correct dark rendering of each diagram, with no separate -light/-dark source files to maintain until the static diagram pipeline (tracked separately) lands.--color-text-primary, documented in docs/design/color-palette.md at 15.83:1 contrast against --color-bg-elevated — well past the 4.5:1 WCAG AA requirement for text.lineColor) use --color-text-secondary, documented at 4.12:1 against the base background — past the 3:1 AA requirement for non-text graphical elements.border-l-4-style accent bar. Contribute new diagram styling through diagram-theme.ts only.Every shape below renders through the shared theme. State names are taken from the Orchestrator's real order lifecycle (docs/architecture/state-machines.md, "Order States", in the OFFER-HUB/OFFER-HUB repo) instead of placeholder labels.
Ensure content cards have a higher z-index than background effects (like the dot grid) to prevent visual overlap.
The theme can be toggled using the useTheme hook:
Theme preference is automatically saved to localStorage under the key offer-hub-theme and persists across sessions.
When set to "system", the theme automatically follows the user's OS preference and updates in real-time if changed.
When migrating components to support dark mode, replace hardcoded colors with theme-aware alternatives:
Always test components in both light and dark modes after migration to ensure proper contrast and visibility.