@sig-ui/core
v0.1.2
Published
Pure math, color science, design tokens, and state machines for SigUI
Maintainers
Readme
@sig-ui/core
Foundation package for SigUI. This package contains pure primitives and no browser/runtime side effects.
What this package is for
Use @sig-ui/core for:
- perceptual color operations and palette generation
- APCA/WCAG contrast checks
- spacing, typography, elevation, and motion calculations
- accessibility heuristics and interaction state machines
- DTCG-compatible token export helpers
How it fits in SigUI
core -> theme -> (dom, components)
@sig-ui/themedepends on this package.@sig-ui/domand@sig-ui/componentsrely on values derived from this layer.@sig-ui/cliuses this package for generation and validation workflows.
Install
bun add @sig-ui/coreQuick examples
import { generatePalette } from "@sig-ui/core/palette";
const palette = generatePalette("#6366f1", { background: "#ffffff" });
console.log(palette.formatted[500]);import { apcaContrast } from "@sig-ui/core/contrast";
const lc = Math.abs(apcaContrast("#312e81", "#ffffff"));
if (lc < 60) throw new Error("Not enough body-text contrast");Main entry points
@sig-ui/core@sig-ui/core/color@sig-ui/core/contrast@sig-ui/core/palette@sig-ui/core/tokens@sig-ui/core/typography@sig-ui/core/spacing@sig-ui/core/motion@sig-ui/core/elevation@sig-ui/core/accessibility@sig-ui/core/machines
Full docs
docs/ARCHITECTURE_OVERVIEW.mddocs/CORE.mddocs/THEME.md(next layer)
