For humans and for models
Contributing
A component is one folder with exactly four files, and a set of tests that refuse what the rules refuse. Read the package's README first, then llms.txt, then the folder you need.
Adding or changing a component
- Pick the level (atom, molecule, organism, view) and an English, singular, PascalCase name.
- Create
packages/design/components/Name/with the four files. Nothing else goes in the folder. Name.svelte: a header comment that says why the component exists, aninterface Propswith a JSDoc line on every prop,rl-classes, tokens only, scoped CSS, no utility class, no literal colour, nodark:variant.Name.stories.svelte: one exported snippet per state that changes markup or ARIA, and anotesmap for the non-obvious ones.Name.md: the front matter (name, slug, level, status, surfaces, since, criteria with a why each) and the eleven sections in order: Purpose, When to use and when not, Anatomy, Props, States, Accessibility contract, Content rules, Do and don't, Examples, Surfaces, Related, Decisions.Name.test.ts: mount every story and assert the accessibility contract, name, role, keyboard, focus.pnpm --filter @rgaa-dev/design build:tokensregenerates the manifest, the inventory and the icon paths; thentestandtypecheck; then look at the page here in both themes.- A story that writes an id or a group name takes a
scopeargument and suffixes it, since this site shows every story several times on one page; the test harness passes none. pnpm --filter @rgaa-dev/design-site build, thencaptures: the forced-colours pictures are committed with the component, and a test refuses a capture older than its sources.run audit(the word alone goes to pnpm's own audit command) andkeyboardrun the engine and a Tab walk over every page; both must pass before a deploy.- A changelog line. If the component retires a hand-built pattern somewhere, list it under
replacesand remove the copy in the same branch.
What the tests refuse
- A folder without its four files, or with a fifth.
- A component that writes a utility class, a literal colour or a
dark:variant. - A doc whose sections are out of order, that claims a criterion the referential does not have, that relates to a component that does not exist, or that annotates a story that does not exist.
- A generated file that does not match its source, in the package and in CI.
- A colour pair below its contrast floor, in any of the light, dark and print sets.
- An em dash, in code, docs or generated files.
- On this site: a forced-colours capture missing or older than its component, a page list that differs between the sitemap and the scripts, a page the engine fails on a mapped criterion, a Tab stop with no name or no visible focus.
Machine-readable
manifest.json lists every component with its level, status, surfaces, props, snippets, stories, classes and criteria. tokens.json holds the resolved value of every role in the light, dark and print sets. llms.txt is the same inventory as a page of text.