How supertypeai/foundations works
Foundations is a reusable React/Tailwind design system for typography, content blocks, and long-form essays, with supporting content metadata and consumer diagnostics. The principal workflow is a consuming app composing typography and blocks into pages or essays, styled by the package’s shared tokens and theme. The README documents additional SEO, Open Graph, MDX, lint, contrast, and CLI capabilities. Some of those implementations are unsampled; their presence is documented, but uncertain internal connections are omitted.
Main entry points: paragraph.tsx Typography · cn.ts Class utilities · tabs.tsx Tabs · essay.tsx Essay shell
Components 21
Shared foundations
- Class utilities
src/cn.ts - Tone system
src/tone.ts - Link resolution
src/href.ts - Tokens and themes
UI components
- Typography
src/typography/paragraph.tsx - Headings
src/typography/header.tsx - Content blocks
src/blocks - Tabs
src/blocks/tabs.tsx
Essay experience
- Essay shell
src/essay/essay.tsx - Essay layout
src/essay/layout.tsx - Reading tools
src/essay/reading.tsx - Scroll tracking
src/essay/scroll.ts - TOC and reading time
src/essay/toc.ts
Content and metadata
- MDX components
src/mdx.tsx - Rehype plugin
src/rehype.ts - SEO metadata
src/seo.ts - Open Graph cards
src/og.tsx - Contrast checks
src/contrast.ts - Lint rules
src/eslint.ts
Consumer tooling
- Foundations CLI
bin/foundations.mjs
Other components
- Consuming app
Connections 27
- Consuming app → Typography: composes
README.md - Consuming app → Content blocks: composes
README.md - Consuming app → Essay shell: builds essays
README.md - Consuming app → Tokens and themes: imports styles
README.md - Typography → Class utilities: merges classes
src/typography/paragraph.tsx - Typography → Tone system: applies tone
src/typography/paragraph.tsx - Typography → Link resolution: resolves links
src/typography/paragraph.tsx - Typography → Headings: shares primitives
- Content blocks → Class utilities: uses classes
src/blocks/tabs.tsx - Tabs → Class utilities: merges classes
src/blocks/tabs.tsx - Tabs → Tone system: applies tone
src/blocks/tabs.tsx - Tabs → Content blocks: specializes blocks
src/blocks/tabs.tsx - Essay shell → Class utilities: merges classes
src/essay/essay.tsx - Essay layout → TOC and reading time: uses TOC
src/essay/layout.tsx - Reading tools → Scroll tracking: uses tracking
src/essay/reading.tsx - Reading tools → TOC and reading time: uses TOC
src/essay/reading.tsx - Essay shell → Essay layout: pairs with layout
- MDX components → Class utilities: merges classes
src/mdx.tsx - Consuming app → MDX components: renders content
README.md - Consuming app → Rehype plugin: configures plugin
- Consuming app → SEO metadata: adds metadata
- Consuming app → Open Graph cards: generates cards
- Consuming app → Contrast checks: checks contrast
- Consuming app → Lint rules: uses lint rules
- Consuming app → Foundations CLI: runs diagnostics
README.md - Foundations CLI → Consuming app: checks app wiring
README.md - Contrast checks → Tone system: reads tones
src/contrast.ts