@orc-tools/orc-design-system
v6.0.0
Published
Framework-neutral Orc design system foundations and Web Components.
Readme
Orc Design System is the single source of truth for Orc's restrained swamp identity: a 16-color semantic palette, type and motion rules, and a small set of standards-based Web Components. Everything ships as plain CSS, JSON, and custom elements, so any framework — or none — can consume it without copying color values around.
What it ships
- Semantic tokens — the
--orc-*CSS custom properties and a stable{ day, night }JSON schema. Green, yellow, red, orange, purple, and cyan keep the fixed meanings documented in.impeccable/design.json. - Automatic theming — the stylesheet follows system preference by default;
an explicit
data-theme="light"/data-theme="dark"on the root wins either way. A parser-timepreflight.jsavoids the first-paint flash for persisted choices. - Web Components —
<orc-button>,<orc-chip>,<orc-copy-button>,<orc-dialog>,<orc-icon-button>,<orc-input>,<orc-logomark>,<orc-navbar>,<orc-segmented>,<orc-select>,<orc-status-dot>,<orc-stepper>,<orc-tabs>,<orc-textarea>, and<orc-theme-toggle>, defined viadefineOrcElements()and driven by an exportedcreateThemeController(). - Utility CSS — opt-in
scrollbar.css(.orc-scrollbar),typography.css(--orc-type-*variables +.orc-type-*classes), andprose.css(.orc-prose, the Markdown typography block). - Fonts — opt-in Inter (body) and JetBrains Mono (code); the platform sans and mono stacks are the default so nothing is required.
- Preflight & assets — the theme preflight snippet plus the packaged 3D Orc
icon (
orc-icon.png).
Install
Bun is the project's package manager and script runner.
bun installUsage
Import the tokens before your application styles, then use the public roles:
@import "@orc-tools/orc-design-system/tokens.css";
.card {
background: var(--orc-panel);
color: var(--orc-text);
border: 1px solid var(--orc-border);
}Register the components and let the controller manage theme:
import { defineOrcElements } from "@orc-tools/orc-design-system/define";
defineOrcElements();
// <orc-navbar> and <orc-theme-toggle> are now usable in your markup.Non-CSS consumers can read the palette directly, including the derived roles resolved to hex per theme:
import tokens from "@orc-tools/orc-design-system/tokens.json";
const lightThemeColor = tokens.day.bg;
const darkThemeColor = tokens.night.bg;
const lightGate = tokens.derived.day.gate;See docs/theme-consumption.md for the full theming
contract and the list of derived roles.
Upgrading
Each breaking release ships a migration beside it. From a consumer project:
npx @orc-tools/orc-design-system@latest upgrade --dry-run # show what would change
npx @orc-tools/orc-design-system@latest upgrade # bump, install, migrateupgrade moves the dependency to the version of the CLI you ran, installs with
whichever package manager the lockfile names, then applies the migrations. Use
migrate instead when the dependency is already at the target version and you
only want the codemods.
Pin the CLI with @latest (or @5.0.0): a bare npx resolves the copy already
in node_modules, which neither knows about the new version nor ships its
migration.
Mechanical changes are applied; anything that is a design decision is reported
for you to settle. A new breaking release needs a matching
migrations/<version>-<slug>.mjs.
To move every consumer at once, list them in consumers.json and run from this
repo:
bun run rollout --dry-run # per-project report, no writes
bun run rollout # branch, bump, migrate, build, test, commit
bun run rollout --pr # ...and push + open PRsProjects with uncommitted changes are skipped, a failed build stops that project
only, and nothing is pushed without --pr.
Develop
bun run storybook # component workbench + docs at :6006
bun run test # unit + browser tests (Vitest)
bun run typecheck # type-only pass
bun run build # theme check → Vite build → static assets → verifybun run consumer:proof packs the library and builds a real Vite consumer to
prove the published package works end to end.
The palette is the API
Consumers import token surfaces instead of copying hex values, so the swamp
identity can evolve in one place. Ordinary UI color must always flow through the
semantic --orc-* roles — the logo and icon artwork keep their own first-party
colors and never define interface token meaning.
License
The code — tokens, components, styles, and scripts — is MIT. Fork it, ship it, sell it; keep the copyright notice.
The marks are not. The Orc name and the emblem, icon, and lockup artwork
(orc-icon.png, orc-mark.png, orc-design-system-logo.svg) are reserved — no
trademark or brand licence is granted here. Build on the system, but use your own
identity. See src/assets/ASSETS.md for their provenance.
The packaged fonts carry their own terms: Inter and JetBrains Mono are
distributed under the SIL Open Font License 1.1 (see
src/assets/fonts/PROVENANCE.md). They are
opt-in — the default stacks are the platform sans and mono.
