@marwes-ui/core
v0.0.4
Published
Framework-agnostic Marwes core: theme system, typed component recipes, and a11y mapping.
Readme
@marwes-ui/core
Framework-agnostic Marwes core: theme system, typed component recipes, and a11y mapping.
Responsibilities
- Define and normalize the
Themecontract. - Build component render kits (
tag,className,vars,a11y). - Centralize a11y behavior so adapters stay consistent.
- Stay independent from DOM and framework runtime.
Non-Responsibilities
- No React/Vue rendering.
- No preset CSS authoring.
- No runtime styling engine.
Public API
Theme and system:
defaultThememergeThemenormalizeThemecreateSystem- Types:
Theme,ThemeOverrides,Preset,System,CssVars
Atoms (recipes + types):
createButtonRecipecreateInputRecipecheckboxRecipecreateIconRecipecreateHeadingRecipecreateParagraphRecipe
Molecules:
checkboxFieldRecipe
RenderKit Contract
Core recipes return typed render data consumed by adapters:
tag: target HTML tagclassName: stable.mw-*classesvars:Record<--mw-*, string>CSS variablesa11y: explicit typed accessibility fields- optional control fields per component (for example
blockClick,indeterminate)
File Layout
src/theme/*- theme types/defaults/merge/normalize/systemsrc/components/atoms/*- atomic component contracts + recipessrc/components/molecules/*- composed component contracts + recipessrc/shared/css-vars.ts- CSS variable type contract
Engineering Rules
- Keep core framework-agnostic.
- Do not use
any. - Put accessibility mapping in
*.a11y.ts. - Put visual decisions in presets, not in adapters.
- Only emit CSS variables and stable classnames from recipes.
Figma Mapping
When implementing design changes from Figma, map tokens into theme keys and recipe vars as documented in:
../../docs/FIGMA_TO_MARWES.md
Scripts
pnpm --filter @marwes-ui/core devpnpm --filter @marwes-ui/core buildpnpm --filter @marwes-ui/core typecheck
Related Docs
../../docs/PROJECT.md../../docs/ARCHITECTURE.md../../docs/ENGINEERING.md
