@kiefer-tek/sophea-design-system
v1.10.0
Published
Sophea design system: latest-shadcn components + theme.css CSS contract + icons.
Readme
@kiefer-tek/sophea-design-system
Tokens + React components for all Sophea products (Sophea Nous, Sophea Portal, and beyond).
Source of truth for design comes from Claude Design (handoff bundle at docs/). This package is the executable form — published as @kiefer-tek/sophea-design-system, consumed by sophea-nous/web and sophea-nous-portal.
Layout
design-system/
├── package.json, tsconfig.json, vite.v2.config.ts
├── .storybook/ Storybook 8 (React + Vite)
├── scripts/ icon pipeline, theme copy, style/contrast audits
├── src/
│ ├── theme.css hand-authored design tokens + @theme inline (the CSS contract)
│ ├── v2/ components, foundations, patterns, lib, styles
│ ├── icons/ SVGR icon set + generated registry (npm run icons:build)
│ ├── Introduction.mdx conventions/welcome doc
│ └── index.ts public surface
└── docs/
├── design-spec.md full spec (read first)
├── HANDOFF.md original Claude Design handoff README
├── SKILL.md, CHANGELOG.md
├── chats/ design conversation transcripts
└── reference/
├── preview/ 77 HTML prototype cards (visual spec)
├── ui_kits/ chat-surface recreation
└── scraps/ iteration screenshotsInstall (from GitHub Packages)
This package is published to GitHub Packages (Kiefer-Tek org, Internal visibility). Consumers
need a scoped registry entry and an auth token with read:packages.
Add a .npmrc in the consuming project:
@kiefer-tek:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}The committed .npmrc carries only the literal ${NODE_AUTH_TOKEN} placeholder — npm expands it
from the environment at install time, so no secret is committed. Then:
- CI (in-repo consumers): the repo's own
GITHUB_TOKENis exported asNODE_AUTH_TOKEN; no managed secret needed. - Local dev: export a GitHub PAT with
read:packagesasNODE_AUTH_TOKEN(e.g.export NODE_AUTH_TOKEN=$(gh auth token)), otherwisenpm installagainst an Internal package returns401.
npm install @kiefer-tek/sophea-design-systemBuilding this package locally
cd design-system
npm install
npm run buildUsage
Theme (CSS contract)
@import "tailwindcss";
@import "@kiefer-tek/sophea-design-system/theme.css";theme.css is the package's only CSS export (hand-authored src/theme.css, copied verbatim to dist/theme.css at build). It exposes all CSS variables in light + dark scope: --theme-primary-05, --text-04, --surface-s2, --elevation-2-shadow, etc., plus the Tailwind v4 @theme inline mapping and the dark custom variant — so no Tailwind preset is needed. Import it after @import "tailwindcss" so its Tailwind directives resolve in the host build. Dark mode flips via the .dark class or [data-theme="dark"] on <html> (drive it with ThemeProvider).
Components
import { Button, Input, Badge } from "@kiefer-tek/sophea-design-system";
<Button variant="primary">Send</Button>
<Input label="Workspace" placeholder="Acme" />
<Badge tone="success" dot>Indexed</Badge>Scripts
| Script | Purpose |
|---|---|
| npm run build | Build icons, bundle to dist/ via Vite (ESM + types), copy theme.css |
| npm run dev | Watch-mode Vite build |
| npm run icons:build | Regenerate the SVGR icon set + registry from src/icons/raw/ |
| npm run storybook | Storybook on :6006 |
| npm run build-storybook | Static Storybook |
| npm run typecheck | tsc --noEmit |
| npm run lint | ESLint |
| npm run format | Prettier write |
Roadmap
This package is implemented in waves. Each wave is a separate PR.
| Wave | Scope | Status |
|---|---|---|
| 0 — Infra | Tokens, build, Storybook, package skeleton | done |
| 1 — Proof | Button, Input, Badge | done |
| 2 — Controls | Checkbox, Radio, Switch, Select, Datepicker | done |
| 3 — Surface / feedback | Modal, Toast, Tooltip, Banner, Skeleton, Drawer | done |
| 4 — Layout / nav | Sidebar tab, Breadcrumbs, Tabs, Pagination | done |
| 5 — Data display | Table, Avatar, Code, Attachment | done |
| 6 — AI-specific | Message, AI anatomy, Citation, Empty | done |
| 7 — Patterns | EmptyHierarchy, ErrorRecovery, Filtering, Forms, LoadingStates (Login skipped) | done |
| 8 — Adoption | Gradual migration in sophea-nous/web + Portal | pending |
Component reference (77 cards) lives at docs/reference/preview/. Open the corresponding *.html to see the target visual for each component before implementing.
Design contract (read first)
Full contract at docs/design-spec.md. Highlights every contributor must respect:
- Tokens, not raw hex. Use
var(--text-04), not#475569. - Lucide icons only, stroke 1.5 (Send arrow 2.75).
- One primary CTA in view. Brand gradient is the signature.
- Glass is for chrome only. Never for body content. Never glass-on-glass.
- Drift motion language. 6 named patterns; never invent new ones.
- WCAG 2.2 floors. Focus ring ≥ 2 px + 2 px offset, target size ≥ 24 px, honour
prefers-reduced-*. - No emoji. Anywhere.
- Greek-first. Greek runs ~15% longer; design hit targets for it.
Sources
- Original design handoff: Claude Design bundle (see
docs/HANDOFF.md+docs/chats/) - Codebase parity:
sophea-nous/web/src/app/css/sophea_v1.css,web/lib/opal/src/,web/AGENTS.md - Workspace conventions:
../AGENTS.md(root)
