@joralvmel/cosmos-mcp 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data/docs.json +1 -1
- package/dist/data/llms/angular.md +30 -0
- package/dist/data/llms/core.md +30 -0
- package/dist/data/llms/elements.md +27 -0
- package/dist/data/llms/icons.md +1 -0
- package/dist/data/llms/native.md +26 -0
- package/dist/data/llms/react.md +26 -0
- package/dist/data/status.json +1 -1
- package/package.json +2 -2
package/dist/data/docs.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"slug":"ai/mcp","title":"MCP server","markdown":"# MCP server\n\n> Connect AI assistants to the Cosmos UI MCP server to query components, themes, tokens and setup.\n\n`@joralvmel/cosmos-mcp` is a [Model Context Protocol](https://modelcontextprotocol.io/) server\n(stdio). It ships the contracts, snippets, status, themes and docs of its version, so the answers match\nwhat you install.\n\n## Connect\n\n**VS Code**\n`npx @joralvmel/cosmos-cli init-ai` does it for you, or add to `.vscode/mcp.json`:\n\n```json\n{\n \"servers\": {\n \"cosmos-ui\": { \"type\": \"stdio\", \"command\": \"npx\", \"args\": [\"-y\", \"@joralvmel/cosmos-mcp\"] }\n }\n}\n```\n**Claude Code**\n```bash\nclaude mcp add cosmos-ui -- npx -y @joralvmel/cosmos-mcp\n```\n**Other clients**\nRun the command `npx -y @joralvmel/cosmos-mcp` as a stdio server in your client configuration.\n\n## Tools\n\n| Tool | Arguments | Returns |\n| --- | --- | --- |\n| `list_components` | `status?` (`planned`, `in-progress`, `stable`) | Every catalog component with category, platforms, dependencies and status. |\n| `get_component` | `name` | Contract (props, events per platform, slots, parts, keyboard), API table, snippets for HTML, React, Angular and React Native, imports and status. |\n| `list_themes` | — | Built-in themes and their modes. |\n| `get_tokens` | `theme?`, `mode?` | Semantic color tokens and radii of a theme and mode. |\n| `get_setup` | `framework` (`react`, `next`, `angular`, `html`, `react-native`, `tailwind`) | Install commands, setup code and rules. |\n| `search_docs` | `query`, `limit?` | Matching docs pages and package references with an excerpt. |\n\nResources: `cosmos://llms/<package>` returns the `llms.md` of each package.\n\n## Example questions\n\n- \"Which Cosmos components are stable, and which ones can I use for a form?\"\n- \"Show me the Angular code for a danger outline button that is loading.\"\n- \"What are the dark-mode tokens of the nebula theme?\"\n"},{"slug":"ai/overview","title":"Use Cosmos UI with AI","markdown":"# Use Cosmos UI with AI\n\n> Give AI assistants the real Cosmos API with init-ai, llms.txt, Markdown pages and the MCP server.\n\nAI assistants write better UI code when they know the real components, props, events and tokens. Cosmos\ngives them that knowledge in three ways, all generated from the component contracts.\n\n## 1. Prepare your project with `init-ai`\n\n1. Run it in your project folder with your stack (`react`, `next`, `angular`, `html` or `react-native`):\n\n ```bash\n npx @joralvmel/cosmos-cli init-ai --stack react\n ```\n\n2. It writes a marked block with the Cosmos rules into `.github/copilot-instructions.md` and\n `AGENTS.md` (add `--claude` for `CLAUDE.md`), registers the MCP server in `.vscode/mcp.json` and\n prints the installation steps. Run it again at any time: only the marked block is replaced.\n\n3. Ask your assistant to install Cosmos UI (see the [ready-made prompts](../prompts/)).\n\n## 2. Reference files\n\n| Resource | Use |\n| --- | --- |\n| [`/llms.txt`](../../llms.txt) | Index of every package reference and page, for assistants that read `llms.txt`. |\n| [`/llms-full.txt`](../../llms-full.txt) | The whole documentation and every package reference in one file. |\n| `/<page>.md` | Every page as Markdown (button **Copy page for AI** below each title). |\n| `node_modules/@joralvmel/cosmos-*/llms.md` | Reference of each installed package: setup, components with props, events and examples, themes and rules. |\n\n## 3. MCP server\n\nThe [MCP server](../mcp/) answers questions about components, themes, tokens and setup with data that\nmatches the installed version.\n\n## Install with AI (copy and paste)\n\n```text\nInstall Cosmos UI in this project. First run `npx @joralvmel/cosmos-cli init-ai --stack <my stack>`,\nthen follow the steps it prints. Use the cosmos-ui MCP server (get_setup, list_components,\nget_component) or https://joralvmel.github.io/cosmos-ui/llms.txt to check every component and prop\nbefore using it. Style only with Cosmos tokens or the Cosmos Tailwind theme.\n```\n"},{"slug":"ai/prompts","title":"Ready-made prompts","markdown":"# Ready-made prompts\n\n> Copyable prompts to build UI with Cosmos in React, Next.js, Angular, HTML and React Native.\n\nCopy a prompt, replace the part in angle brackets and paste it in your assistant. They assume you ran\n[`init-ai`](../overview/) or that the assistant can read `llms.txt` or the MCP server.\n\n**React**\n```text\nUsing Cosmos UI (@joralvmel/cosmos-react) in this React + Vite app, build <a settings page with a\nform and a save button>. Check each component with the cosmos-ui MCP server (get_component) before\nusing it, handle events through event.detail, style the layout with Cosmos tokens or the Cosmos\nTailwind theme, support light and dark mode and keep keyboard access.\n```\n**Next.js**\n```text\nUsing Cosmos UI (@joralvmel/cosmos-react) in this Next.js App Router project, build <a dashboard\nheader with actions>. Put Cosmos components in Client Components ('use client'), keep pages as\nServer Components, load @joralvmel/cosmos-tokens/tokens.css in app/layout.tsx and use\nthemeInitScript() to avoid a theme flash. Check props with the cosmos-ui MCP server.\n```\n**Angular**\n```text\nUsing Cosmos UI (@joralvmel/cosmos-angular) in this standalone Angular app, build <a profile form>.\nImport the Cosmos standalone components you need, bind inputs with signals, listen to outputs with\n$event.detail and keep forms accessible. Check each component with the cosmos-ui MCP server.\n```\n**HTML**\n```text\nBuild <a landing page section> in plain HTML with Cosmos UI Web Components from a CDN\n(@joralvmel/cosmos-elements and @joralvmel/cosmos-tokens). Use <cosm-*> elements, listen to cosm-*\nevents, set data-theme and data-mode on <html> and use only var(--cosm-*) tokens in custom CSS.\n```\n**React Native**\n```text\nUsing Cosmos UI (@joralvmel/cosmos-native) in this Expo app, build <a login screen>. Wrap the app in\nCosmosThemeProvider with mode=\"system\", use useTheme() for custom styles, keep touch targets of at\nleast 44 points and accessibility labels. Check each component with the cosmos-ui MCP server.\n```\n\n## Prompts for the component library itself\n\nTo add or change components in the Cosmos repository, use the agents and prompts of the repository\n(`/create-component`, `/component-status`…): see [Working with agents](../../contribute/working-with-agents/).\n"},{"slug":"components/button","title":"Button","markdown":"# Button\n\n> Triggers an action or submits a form. Web Component, React, Angular and React Native.\n\nStatus: **stable** (web, react, angular, native).\n\n`<cosm-button>` triggers an action. It follows the\n[WAI-ARIA button pattern](https://www.w3.org/WAI/ARIA/apg/patterns/button/), renders a native\n`<button>` and takes part in forms (`type=\"submit\"` / `type=\"reset\"`). Use it for actions; use a link\nfor navigation.\n\n## Playground\n\n**HTML / Web Component**\n\n```html\n<cosm-button>Save changes</cosm-button>\n\n<script type=\"module\">\n import '@joralvmel/cosmos-elements/button';\n\n const element = document.querySelector('cosm-button');\n element.addEventListener('cosm-press', event => console.log(event.detail));\n</script>\n```\n\n**React**\n\n```tsx\nimport { Button } from '@joralvmel/cosmos-react';\n\nexport function Example() {\n return (\n <Button onPress={event => console.log(event.detail)}>Save changes</Button>\n );\n}\n```\n\n**Angular**\n\n```ts\nimport { Component } from '@angular/core';\nimport { CosmButtonComponent } from '@joralvmel/cosmos-angular';\nimport type { ButtonPressDetail } from '@joralvmel/cosmos-core';\n\n@Component({\n selector: 'app-example',\n imports: [CosmButtonComponent],\n template: `<cosm-button (press)=\"onPress($event.detail)\">Save changes</cosm-button>`,\n})\nexport class ExampleComponent {\n onPress(detail: ButtonPressDetail) {\n console.log(detail);\n }\n}\n```\n\n**React Native**\n\n```tsx\nimport { Button } from '@joralvmel/cosmos-native';\n\nexport function Example() {\n return (\n <Button onPress={detail => console.log(detail)}>Save changes</Button>\n );\n}\n```\n\n## Variants\n\n`variant` sets the emphasis and `tone` the color role. Use one `solid` button per view for the main\naction.\n\n```html\n<cosm-button>Solid</cosm-button>\n<cosm-button variant=\"soft\">Soft</cosm-button>\n<cosm-button variant=\"outline\">Outline</cosm-button>\n<cosm-button variant=\"ghost\">Ghost</cosm-button>\n<cosm-button tone=\"neutral\">Neutral</cosm-button>\n<cosm-button tone=\"danger\">Delete</cosm-button>\n```\n\n```html\n<cosm-button size=\"sm\">Small</cosm-button>\n<cosm-button>Medium</cosm-button>\n<cosm-button size=\"lg\">Large</cosm-button>\n```\n\n## States\n\n```html\n<cosm-button loading>Saving</cosm-button>\n<cosm-button disabled>Disabled</cosm-button>\n```\n\n- `loading` keeps the button focusable, sets `aria-busy` and ignores presses.\n- `disabled` removes it from the tab order and ignores presses.\n- Hover, active and `:focus-visible` states use the theme tokens of the selected tone.\n\n## Accessibility\n\n- Native `<button>` semantics: <kbd>Enter</kbd> and <kbd>Space</kbd> activate it.\n- Give icon-only buttons a `label`; it becomes the accessible name.\n- Use `tone=\"danger\"` together with explicit text for destructive actions; color is never the only cue.\n- On React Native, small buttons extend their touch area to 44 points.\n\n## API\n\n| Prop | Type | Default | Description |\n| --- | --- | --- | --- |\n| `variant` | 'solid' \\| 'soft' \\| 'outline' \\| 'ghost' | `solid` | Visual emphasis, from highest (solid) to lowest (ghost). |\n| `tone` | 'primary' \\| 'neutral' \\| 'danger' | `primary` | Color role. Use danger for destructive actions. |\n| `size` | 'sm' \\| 'md' \\| 'lg' | `md` | Control height and padding. |\n| `disabled` | boolean | `false` | Prevents interaction and removes the button from the tab order. |\n| `loading` | boolean | `false` | Shows a spinner, sets aria-busy and ignores presses while keeping focus. |\n| `fullWidth` | boolean | `false` | Stretches the button to the width of its container. |\n| `type` | 'button' \\| 'submit' \\| 'reset' | `button` | Form behavior of the button. |\n| `label` | string | — | Accessible name when the visible content is not descriptive (icon-only buttons). |\n\n**Slots**\n\n| Name | Description |\n| --- | --- |\n| `(default)` | Button label. |\n| `start` | Content before the label, usually an icon. |\n| `end` | Content after the label, usually an icon. |\n\n**CSS parts**\n\n| Name | Description |\n| --- | --- |\n| `base` | The native button element. |\n| `label` | Wrapper of the label slot. |\n| `spinner` | Loading indicator. |\n\n**CSS custom properties**\n\n| Name | Description |\n| --- | --- |\n| `--cosm-button-radius` | Corner radius. |\n| `--cosm-button-gap` | Space between icon and label. |\n| `--cosm-button-font-weight` | Label font weight. |\n\n**Keyboard**\n\n| Keys | Action |\n| --- | --- |\n| `Enter`, `Space` | Activates the button. |\n\n## Events by platform\n\n| DOM | React | Angular | React Native | Detail | Description |\n| --- | --- | --- | --- | --- | --- |\n| `cosm-press` | `onPress` | `(press)` | `onPress` | `ButtonPressDetail` | The button was activated by pointer, keyboard or programmatically. |\n"},{"slug":"components/status","title":"Component status","markdown":"# Component status\n\n> Inventory of every planned Cosmos component, with what exists on each platform.\n\nThis page is generated from the repository on every build: the canonical list lives in\n`packages/core/src/catalog.ts` and `npm run status` detects which pieces exist for each component\n(contract, scenarios, each platform, tests, docs, AI reference and changeset).\n\n- **Stable**: every piece exists for every platform of the component.\n- **In progress**: some pieces exist.\n- **Planned**: nothing exists yet. A planned component can start when its dependencies are stable.\n\n1 stable · 0 in progress · 37 planned (38 total)\n\nNext: `icon`, `badge`, `avatar`, `divider`, `listbox`\n\n| Component | Status | Priority | Contract | Scenarios | Web Component | React | Angular | React Native | Native demo | Tests | Docs (EN) | Docs (ES) | llms.md | Changeset | Depends on |\n| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |\n| button | stable | 1 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — |\n| icon | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| icon-button | planned | 2 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | button, icon |\n| badge | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| spinner | planned | 2 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| avatar | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| divider | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| listbox | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| calendar | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | button |\n| text-field | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | icon |\n| textarea | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| checkbox | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | icon |\n| radio-group | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| switch | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| number-field | planned | 2 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | text-field, icon-button |\n| select | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | popover, listbox, icon |\n| combobox | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | popover, listbox, text-field |\n| multi-select | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | popover, listbox, badge, checkbox |\n| slider | planned | 2 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| popover | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| tooltip | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | popover |\n| dialog | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | button, icon-button |\n| drawer | planned | 2 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | dialog |\n| toast | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | icon, icon-button |\n| menu | planned | 2 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | popover |\n| split-button | planned | 3 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | button, menu |\n| tabs | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| accordion | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | icon |\n| pagination | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | button, icon-button |\n| steps | planned | 2 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | icon |\n| breadcrumb | planned | 2 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | icon |\n| card | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| table | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | checkbox, pagination, icon-button |\n| date-picker | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | popover, calendar, text-field |\n| date-range-picker | planned | 3 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | date-picker |\n| bottom-sheet | planned | 3 | ✗ | ✗ | — | — | — | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| skeleton | planned | 3 | ✗ | ✗ | — | — | — | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| list-item | planned | 3 | ✗ | ✗ | — | — | — | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | icon |\n\nRun it locally:\n\n```bash\nnpm run status # table\nnpm run status -- --markdown\nnpm run status -- --json\n```\n"},{"slug":"contribute/example-switch","title":"Example: from issue to release","markdown":"# Example: from issue to release\n\n> A complete walkthrough that creates the cosm-switch component with the agents and skills, from the issue to the npm release.\n\nThis walkthrough adds `cosm-switch` (WAI-ARIA switch) on every platform. Each step names the skill to\nrun (as a `/prompt` in VS Code or by asking the agent) and shows the commands it runs and the expected\noutput.\n\n## 1. Check the inventory — `component-status`\n\n```bash\nnpm run status\n```\n\n```text\nComponents: 38 · stable 1 · in progress 0 · planned 37\n…\nplanned 1 switch\n…\nNext suggested: icon, badge, avatar, divider, listbox\n```\n\n`switch` is planned, priority 1 and has no dependencies, so it can start now.\n\n## 2. Issue and branch — `start-work`\n\n```bash\ngh issue create --template component_request.yml --title \"Component: switch\"\n# → https://github.com/joralvmel/cosmos-ui/issues/12\ngh issue develop 12 --base develop --name feat/elements-switch --checkout\n```\n\n```text\ngithub.com/joralvmel/cosmos-ui/tree/feat/elements-switch\nSwitched to a new branch 'feat/elements-switch'\n```\n\n## 3. Research — `research-reference`\n\nThe `researcher` agent summarizes the\n[APG switch pattern](https://www.w3.org/WAI/ARIA/apg/patterns/switch/): role `switch`,\n`aria-checked`, <kbd>Space</kbd> toggles, visible label, and recommends a native\n`<input type=\"checkbox\" role=\"switch\">` inside the Web Component (form participation for free).\n\n## 4. Contract — `define-contract`\n\nThe `architect` agent writes `packages/core/src/specs/switch.ts` (props `checked`, `disabled`,\n`required`, `name`, `value`, `label`; event `change` → DOM `cosm-change`, React `onChange`, Angular\n`(checkedChange)`, React Native `onCheckedChange`; state `checked` with `defaultChecked`) and the shared\nscenarios (toggle by pointer and keyboard, disabled, controlled proposal without commit).\n\n## 5. Visual spec — `design-component`\n\nThe `design-system` agent writes `docs/design/switch.md`: track and thumb sizes per `size`, states\n(hover, focus-visible, checked, disabled, invalid), tokens (`--cosm-primary`, `--cosm-border-strong`,\n`--cosm-surface`), motion with `prefers-reduced-motion`, and checks contrast in every theme.\n\n## 6. Generate — `create-component`\n\n```bash\nnpm run generate -- component switch\n```\n\n```text\nWrote 21 files:\n packages/core/src/specs/switch.ts\n packages/core/src/specs/switch.scenarios.ts\n packages/core/src/index.ts\n packages/elements/src/components/switch/cosm-switch.ts\n …\n apps/docs/src/content/docs/es/components/switch.mdx\n .changeset/add-switch.md\n\nNext: resolve every TODO(generator) marker, then run\n npx biome ci . && npx turbo run typecheck test build\n```\n\n`component-builder` replaces the generated placeholders with the real contract, the Lit\nimplementation (anatomy order: imports, types, styles, class, registration), the React events map and\nthe Angular inputs and `(checkedChange)` output with a `ControlValueAccessor`.\n\n## 7. React Native — `create-native-component`\n\n`native-expert` implements `Switch` with `Pressable`, `accessibilityRole=\"switch\"`,\n`accessibilityState={{ checked, disabled }}`, a 44-point touch area and `useTheme()` colors, and\nfinishes the demo screen `apps/native-demo/app/switch.tsx`.\n\n## 8. Tests — `add-contract-tests`\n\n```bash\nnpx turbo run test --filter=...@joralvmel/cosmos-core\ncd tools && npx vitest run test/structure.test.mjs test/status.test.mjs\n```\n\n```text\n Tasks: N successful, N total\n ✓ test/structure.test.mjs\n ✓ test/status.test.mjs\n```\n\n## 9. Docs and AI references — `add-docs-page`, `add-playground`, `update-ai-references`\n\nThe pages follow the anatomy order (status, Playground, variants, states, accessibility, API, events by\nplatform) in English and Spanish. The Playground already shows HTML, React, Angular and React Native\ncode from the contract.\n\n```bash\nnpm run llms\nnpm run status\n```\n\n```text\nstable 1 switch\n```\n\nWhen every piece exists, `component-builder` sets `status: 'stable'` in the catalog entry.\n\n## 10. Changeset — `add-changeset`\n\n```md\n---\n'@joralvmel/cosmos-core': minor\n'@joralvmel/cosmos-elements': minor\n'@joralvmel/cosmos-react': minor\n'@joralvmel/cosmos-angular': minor\n'@joralvmel/cosmos-native': minor\n---\n\nAdd the Switch component (`cosm-switch`) on every platform.\n```\n\n## 11. Pull request — `finish-work`\n\n```bash\nnpx biome ci . && npx turbo run typecheck test build && npm run check-terms\ngit push -u origin HEAD\ngh pr create --base develop --title \"feat(elements): add cosm-switch\" --body-file pr.md --label type:component\n```\n\n```text\nhttps://github.com/joralvmel/cosmos-ui/pull/13\n```\n\nCI runs lint, terms, typecheck, tests and build, the docs build (preview artifact), the changeset check\nand commit hygiene; the labeler adds `pkg:core`, `pkg:elements`, `pkg:react`, `pkg:angular`,\n`pkg:native`, `app:docs` and `app:native-demo`.\n\n## 12. Review and merge\n\nAsk the `reviewer` agent for a review, address the comments and wait for the code owner approval. Merge\nwith **Squash and merge** (the PR title becomes the commit message); the branch is deleted\nautomatically.\n\n## 13. Back to develop — `sync-after-merge`\n\n```bash\ngit switch develop && git pull --prune --ff-only && git branch -D feat/elements-switch\n```\n\n## 14. Release pull request — `release-pr`\n\n```bash\nnpx changeset status --since=origin/main\ngh pr create --base main --head develop --title \"chore(release): switch\" --label release\n```\n\nMerge it with **Create a merge commit**.\n\n## 15. Publish — `release`\n\nThe `Release` workflow opens **Version Packages** on main (versions `0.2.0`, changelogs). Merging it\npublishes to npm with provenance and creates the GitHub Releases:\n\n```bash\nnpm view @joralvmel/cosmos-elements version\n```\n\n```text\n0.2.0\n```\n"},{"slug":"contribute/getting-started","title":"Getting started","markdown":"# Getting started\n\n> Set up the Cosmos UI repository, run the docs and the native demo, and solve common problems.\n\n## Requirements\n\n- **Node.js 24** (see `.nvmrc`; `nvm use` or `fnm use`) and **npm 11**.\n- Git, and the [GitHub CLI](https://cli.github.com/) (`gh`) for the branch and pull request skills.\n- VS Code with GitHub Copilot to use the [agents](../working-with-agents/) (optional).\n- For the native demo: the Expo Go app on a phone, Android Studio (emulator) or Xcode (iOS simulator,\n macOS only).\n\n## First run\n\n1. Clone and install. `npm ci` also points Git to the hooks in `.githooks`:\n\n ```bash\n git clone https://github.com/joralvmel/cosmos-ui.git\n cd cosmos-ui\n npm ci\n ```\n\n2. Build, test and check everything (the same commands as CI):\n\n ```bash\n npx biome ci . && npx turbo run typecheck test build\n ```\n\n Turborepo caches results: a second run takes seconds.\n\n3. Open the docs site at http://localhost:4321:\n\n ```bash\n npm run docs\n ```\n\n4. See what exists and what is next:\n\n ```bash\n npm run status\n ```\n\n## Native demo\n\nThe Expo Router app in `apps/native-demo` has one screen per React Native component and a theme and\nmode switcher.\n\n```bash\nnpm run build # the demo uses the built packages\nnpm run dev --workspace=@joralvmel/cosmos-native-demo\n```\n\n- **Expo Go** (any OS): scan the QR code with the Expo Go app (Android) or the camera (iOS). The phone\n and the computer must be on the same network.\n- **Android emulator**: install Android Studio, create a virtual device, start it, then press `a` in\n the Expo terminal.\n- **iOS simulator** (macOS): install Xcode and its command line tools, then press `i`.\n\n## Repository structure\n\n| Folder | Contents |\n| --- | --- |\n| `packages/*` | Publishable packages (`tokens`, `tailwind`, `core`, `elements`, `react`, `angular`, `native`, charts, `icons`, `i18n`, `mcp`, `cli`) |\n| `apps/docs` | This site (Astro + Starlight, English and Spanish) |\n| `apps/native-demo` | Expo demo app |\n| `tools/` | Generator, component status, AI references, Git and GitHub checks, release helpers |\n| `docs/adr`, `docs/conventions` | Architecture decisions and the component anatomy |\n| `.github/` | Workflows, agents, skills, prompts and path-specific instructions |\n\n## Browser tests\n\nUnit and behavior tests run in Vitest with happy-dom, so no browser is needed. Browser checks\n(Playwright with axe) are planned for keyboard behavior and accessibility; when they land they will\nneed `npx playwright install` once.\n\n## Troubleshooting\n\n| Problem | Fix |\n| --- | --- |\n| `EBADENGINE` / unsupported engine | Use Node.js 24 (`nvm use`). |\n| `EBUSY: resource busy or locked` on Windows during `npm ci` | An editor or language server holds a file in `node_modules`; close the project in other IDEs and run it again. |\n| `File content differs from formatting output` | `npm run lint:fix` (Biome formats with LF line endings). |\n| Hooks do not run | `npm ci` with `ignore-scripts` skips `prepare`: run `node tools/git/install-hooks.mjs`. |\n| `Commit blocked: the Git identity does not match` | Your `.local/git-identity.json` expects another identity; fix `git config --local user.*` or the file. |\n| `llms.md files are outdated` | `npm run llms` (the AI references are generated from the contracts). |\n| Strange cached results | `npx turbo run build --force`. |\n"},{"slug":"contribute/git-workflow","title":"Git workflow","markdown":"# Git workflow\n\n> Branches, commits, pull requests, reviews and releases in Cosmos UI.\n\n## Branches\n\n| Branch | Purpose | How changes arrive |\n| --- | --- | --- |\n| `main` | Released code; every push runs the release and docs deployment | Merge commit from `develop` (release pull request) |\n| `develop` | Integration, default branch | Squash merge of work branches |\n| `<type>/<scope>-<description>` | One task | Created from `develop`, deleted after merge |\n\nTypes: `feat`, `fix`, `docs`, `chore`, `refactor`, `test`. Scope: package or area (`elements`, `tokens`,\n`docs`…). Example: `feat/elements-switch`. Contributors without write access fork the repository and\nopen the pull request from their fork.\n\n## Commits\n\n- [Conventional Commits](https://www.conventionalcommits.org/): `type(scope): summary`, several scopes\n separated by commas (`feat(mcp,cli): …`). The `commit-msg` hook checks it.\n- Use your own Git identity; prefer your GitHub noreply email. Sign off with `git commit -s`\n ([DCO](https://developercertificate.org/)) if you can.\n- Never use `--no-verify`.\n\n## Pull requests\n\n1. `start-work` → work → `finish-work` (validates, pushes and opens the pull request to `develop`).\n2. Required: green checks (lint, terms, typecheck, tests, build, packs, docs build, changeset, commit\n hygiene) and resolution of review conversations. Approvals are optional.\n3. Squash merge: the pull request title must be a Conventional Commit (checked by CI).\n4. `sync-after-merge` cleans up the local branch.\n\nApprovals are optional on `main` and `develop` so a sole maintainer can merge their own pull requests.\nThis policy applies to all contributors: classic branch protection on a personal repository does not\nsupport individual review exemptions. Pull requests, required checks and conversation resolution\nremain mandatory. Copilot reviews are advisory, not approving reviews.\n\n## Releases\n\n`release-pr` opens `develop → main` with the pending changesets; merge it with a merge commit. The\n[Release and publishing](../publishing/) page explains the rest.\n\n## Repository settings\n\nBranch protection, merge options and labels are code: `npm run setup-repo` shows the changes and\n`npm run setup-repo -- --apply` applies them with the GitHub CLI. Settings that only exist in the\nGitHub UI are printed at the end of the command.\n\n## Personal safeguards (optional)\n\nOn a computer with several GitHub accounts, create `.local/git-identity.json` (ignored by Git) with\nyour name, email and GitHub login: the `pre-commit` hook and the `verify-identity` skill then block\ncommits and pushes with another identity. On a computer with a single personal account nothing is\nneeded.\n"},{"slug":"contribute/publishing","title":"Release and publishing","markdown":"# Release and publishing\n\n> How Cosmos UI is versioned and published to npm, and the one-time setup for maintainers.\n\nCosmos UI uses [Changesets](https://github.com/changesets/changesets) for versions and changelogs and\npublishes to the public npm registry with\n[trusted publishing](https://docs.npmjs.com/trusted-publishers) (OIDC, no npm token) and\n[provenance](https://docs.npmjs.com/generating-provenance-statements).\n\n## How releases work\n\n1. Every pull request that changes `packages/*` adds a changeset (`npm run changeset`).\n2. When `develop` is ready, a maintainer opens the release pull request `develop → main`\n (skill `release-pr`) and merges it with a **merge commit**.\n3. On `main`, the `Release` workflow opens or updates the **Version Packages** pull request: it bumps\n versions and writes the changelogs.\n4. Merging **Version Packages** runs `changeset publish`: new versions go to npm with provenance, Git\n tags are pushed and a GitHub Release is created per package.\n5. The `Docs` workflow deploys the documentation site from `main`.\n\nPrereleases: run the `Release` workflow manually on `develop` (Actions → Release → Run workflow). It\npublishes a snapshot such as `0.2.0-next-20261110120000` with the dist-tag `next`:\n\n```bash\nnpm install @joralvmel/cosmos-react@next\n```\n\n## One-time setup (maintainers)\n\nThe skill `publish-setup` walks an agent through the same checklist.\n\n1. **npm account.** Create an account on [npmjs.com](https://www.npmjs.com/signup), verify the email\n and enable two-factor authentication (Account → Two-Factor Authentication, \"Authorization and\n writes\"). The scope `@joralvmel` is the account's user scope.\n\n2. **Check the packages.**\n\n ```bash\n npm ci\n npm run check-packs # builds, validates manifests and runs npm pack --dry-run\n npm run publish-order # dependencies first\n ```\n\n3. **First publication by hand.** Trusted publishing can only be configured for packages that exist.\n Publish the current version of every package once, in the order printed above:\n\n ```bash\n npm login\n cd packages/core && npm publish --access public --otp <code> && cd ../..\n # …repeat for each package in publish order\n ```\n\n The first version is a placeholder (`0.0.0`); you can mark it with\n `npm deprecate @joralvmel/cosmos-core@0.0.0 \"placeholder\"`.\n\n4. **Trusted publisher per package.** On npmjs.com open each package → Settings → Trusted Publisher →\n GitHub Actions and enter: owner `joralvmel`, repository `cosmos-ui`, workflow `release.yml`,\n environment `npm`. Then, under \"Publishing access\", choose\n \"Require two-factor authentication and disallow tokens\".\n\n5. **GitHub.** In the repository settings:\n - Environments → create `npm` (optionally with required reviewers).\n - Secrets and variables → Actions → Variables: `COSMOS_PUBLISH_ENABLED` = `true`.\n - For the docs site: Pages → Source \"GitHub Actions\" and the variable `COSMOS_DOCS_ENABLED` = `true`.\n\n6. **Verify** after the first automated release:\n\n ```bash\n npm view @joralvmel/cosmos-core versions dist-tags\n npm audit signatures # inside a project that installed the packages\n ```\n\n The package page on npmjs.com shows the provenance badge linking to the workflow run.\n\n## Troubleshooting\n\n| Symptom | Fix |\n| --- | --- |\n| `E404` / `ENEEDAUTH` on publish | The trusted publisher does not match: check owner, repository, workflow file name and environment. |\n| No \"Version Packages\" pull request | Allow GitHub Actions to create pull requests (`npm run setup-repo -- --apply` does it). |\n| Workflow skipped | `COSMOS_PUBLISH_ENABLED` is not `true`. |\n| `check-packs` fails | A manifest misses `publishConfig.access`, `files`, `exports`, `repository`, `license` or `llms.md`. |\n"},{"slug":"contribute/recipes","title":"Recipes","markdown":"# Recipes\n\n> Short guides to create a theme, add a token, build a component from Figma, change a component and create a chart.\n\nEach recipe names the skill that automates it (run it as a `/prompt` or ask its agent).\n\n## Create a theme — `add-theme`\n\n```bash\nnpm run generate -- theme aurora --seed \"oklch(0.58 0.14 165)\"\nnpx turbo run test build --filter=@joralvmel/cosmos-tokens...\n```\n\n1. Tune the definition in `packages/tokens/src/themes.ts`: seeds (OKLCH), `harmony`, neutral tint and\n `radius`. Add mode overrides only when unavoidable.\n2. The tokens tests check WCAG 2.2 AA and color vision deficiencies in light and dark. Never lower the\n thresholds; change the seeds instead.\n3. The theme appears in the theme gallery, the header picker, Tailwind (`theme-aurora:`) and\n `CosmosThemeProvider`.\n\n## Add a token — `add-token`\n\n1. Semantic color: add it to `semanticColors` (`packages/tokens/src/types.ts`), derive it in\n `generate.ts` and add contrast pairs in `validate.ts` when it carries text or UI.\n2. Base token (spacing, radius, motion…): add it to `base.ts`; map it in `toTailwindTheme` / `toNative`.\n3. Update the tokens and Tailwind tests, then `npm run llms`.\n\n## Component from Figma — `component-from-design`\n\n1. Share the Figma link of the frame (`?node-id=`) or a screenshot with the `design-system` agent.\n2. It extracts anatomy, variants and states and maps every value to existing tokens; a new token goes\n through `add-token`.\n3. `architect` writes the contract and `component-builder` runs `create-component`.\n\n## Change a component — `modify-component`\n\n1. `component-status` for the component and for any component it will use.\n2. Change the contract and scenarios first; decide the semver bump with `architect`.\n3. Update every platform, tests and docs; keep the anatomy (the structure test checks it).\n4. `npm run llms` and a changeset (`major` with a migration note when breaking).\n\n## Create a chart — `create-chart`\n\n```bash\nnpm run generate -- chart sparkline\n```\n\n1. Implement the pure layout in `packages/charts-core/src/sparkline-layout.ts` and test it without DOM.\n2. Render SVG in `packages/charts` and React Native in `packages/charts-native` with the same layout.\n3. Use theme chart colors (`--cosm-chart-1..8`), add a text description and a data table alternative.\n"},{"slug":"contribute/working-with-agents","title":"Working with agents","markdown":"# Working with agents\n\n> What each AI agent and skill of the repository does, how to use them in VS Code and what to ask.\n\nThe repository ships a team of specialized agents (`.github/agents/`) and step-by-step skills\n(`.github/skills/`, each with a prompt in `.github/prompts/`). They follow `AGENTS.md`, the rules in\n`.github/instructions/` and the [component anatomy](https://github.com/joralvmel/cosmos-ui/blob/develop/docs/conventions/component-anatomy.md).\n\n## How to use them in VS Code\n\n1. Open the repository in VS Code with GitHub Copilot and open the **Chat** view.\n2. **Agents**: pick one in the agent selector of the chat (for example `component-builder`), then\n describe the task. The agent loads its rules and uses its skills.\n3. **Prompts**: type `/` and the skill name, e.g. `/create-component`, `/component-status`,\n `/start-work`. The prompt asks for its inputs and runs the skill with the right agent.\n4. Attach context with `#` (a file, a folder or a Figma link) when it helps.\n\nOther assistants (Codex, Claude Code, Cursor…) read `AGENTS.md`; point them to a skill file, e.g.\n\"follow `.github/skills/create-component/SKILL.md` for `switch`\".\n\n## Agents\n\n| Agent | What it does | Skills |\n| --- | --- | --- |\n| `ai-tooling` | Maintains the AI tooling for consumers: MCP server, `cosmos init-ai`, consumer instructions and drift tests of llms.md against contracts. | `update-ai-references` |\n| `angular-expert` | Angular specialist: standalone proxy components, ControlValueAccessors for form controls, signals and zoneless apps, Angular examples. | `modify-component` |\n| `architect` | Owns architecture and patterns: package boundaries, component contracts in core, ADRs, new dependencies, performance, public API and breaking changes. Use before adding a component, a package, a dependency or changing a public API. | `write-adr`, `define-contract`, `component-status`, `research-reference` |\n| `chart-builder` | Builds charts: pure layout in charts-core, SVG rendering as Web Components, interaction and accessibility, and coordinates native rendering with native-expert. | `create-chart` |\n| `component-builder` | Builds or extends Cosmos web components end-to-end with the generator: contract, Lit Web Component, form association, React and Angular wrappers, React Native stub, tests and docs pages. Use for any \"create/add/extend a component\" task. | `component-status`, `create-component`, `modify-component` |\n| `design-system` | Design and layout specialist with deep color theory and visual accessibility knowledge: themes, palettes, light/dark modes, typography, spacing, motion, component anatomy and states, responsive layout, Tailwind theme and translation of Figma designs into tokens. | `design-component`, `component-from-design`, `add-theme`, `add-token` |\n| `devops` | GitHub Actions, Turborepo caching, docs and demo deployments (GitHub Pages), Expo EAS, workflow security, SBOM and license reports. | `setup-ci`, `deploy-docs`, `publish-setup` |\n| `docs-writer` | Writes the English and Spanish documentation site, playgrounds, theme gallery, icon catalog, READMEs and the llms.md / llms.txt AI references. | `add-docs-page`, `add-playground` |\n| `github-ops` | Handles branches, commits, pull requests, issues, labels and GitHub releases. Verifies the collaborator identity (verify-identity) before any commit or push. | `verify-identity`, `start-work`, `commit`, `finish-work`, `sync-after-merge`, `open-pr` |\n| `native-expert` | React Native and Expo specialist: native components on the shared contracts and themes, gestures, mobile accessibility, native charts with charts-core and the Expo Router demo app. | `component-status`, `create-native-component`, `modify-component` |\n| `react-expert` | React specialist: React 19 custom elements and @lit/react wrappers, SSR/Next.js compatibility, React examples and the portfolio demo app. | `modify-component` |\n| `release-manager` | Owns Changesets, semantic versioning, changelogs, deprecations and npm publishing. | `add-changeset`, `release-pr`, `release`, `publish-setup` |\n| `researcher` | Read-only researcher: studies specifications (WAI-ARIA APG, HTML, Open UI) and public libraries for a feature, compares behavior, accessibility, APIs and licenses, and recommends using a dependency or implementing it in Cosmos. | `research-reference` |\n| `reviewer` | Read-only reviewer: conventions, contract parity across platforms, accessibility, security, blocked terms, third-party licenses and changesets. Use before merging. | — |\n| `test-engineer` | Test strategy owner: shared contract scenarios, drift tests, Playwright and axe accessibility checks, coverage and flaky tests. | `add-contract-tests` |\n\n## Skills\n\n| Skill (prompt) | Main agent | What it does |\n| --- | --- | --- |\n| `/add-changeset` | `release-manager` | Writes a Changesets release note for every publishable package changed in the branch. |\n| `/add-contract-tests` | `test-engineer` | Adds shared behavior scenarios to a contract and runs them on the web, React, Angular and React Native through drivers. |\n| `/add-docs-page` | `docs-writer` | Adds a documentation page in English and Spanish with Playground, examples per framework, API table and accessibility notes. |\n| `/add-playground` | `docs-writer` | Adds the interactive Playground to a component page: controls generated from the contract, code tabs for HTML, React, Angular and React Native, copy button, theme/mode pickers and the native demo link. |\n| `/add-theme` | `design-system` | Adds a theme with defineTheme (seeds, harmony, light/dark), validates contrast and color vision deficiencies, and shows it in the docs gallery and in React Native. |\n| `/add-token` | `design-system` | Adds a token to every output (CSS variables, Tailwind theme, React Native values, JSON) with tests. |\n| `/audit-a11y` | `test-engineer` | Audits accessibility on web and React Native: axe, keyboard, focus, screen readers, contrast and motion. |\n| `/commit` | `github-ops` | Creates a Conventional Commit on a work branch after verifying identity, running validation and the blocked-terms check. |\n| `/component-from-design` | `design-system` | Turns a Figma URL (via Figma MCP), screenshot or image into a contract, a visual spec mapped to Cosmos tokens and a generated component. |\n| `/component-status` | `architect` | Reports the component inventory (npm run status), explains gaps and proposes or creates the next components according to their dependencies. Run it before creating, modifying or composing components. |\n| `/create-chart` | `chart-builder` | Creates a chart: pure layout in charts-core, SVG rendering on the web, React Native rendering, accessibility and docs. |\n| `/create-component` | `component-builder` | Creates a new Cosmos component end-to-end following docs/conventions/component-anatomy.md: contract and scenarios, Lit Web Component, React and Angular wrappers, React Native component and demo, tests, docs pages (EN/ES), llms.md and changeset. |\n| `/create-native-component` | `native-expert` | Creates a React Native component on a contract, core logic and tokens, with shared scenarios, drift test, demo screen and docs, following the component anatomy. |\n| `/define-contract` | `architect` | Creates or updates a component contract (props, events, states, slots, parts, keyboard, ARIA) and its shared scenarios in core, with the DOM/React/Angular/React Native mapping. |\n| `/deploy-docs` | `devops` | Deploys the docs site (and demos) to GitHub Pages once enabled. |\n| `/design-component` | `design-system` | Writes the visual spec of a component: anatomy, sizes, variants, states, tokens used, responsive behavior and light/dark notes, then styles it with tokens only. |\n| `/finish-work` | `github-ops` | Finishes a task: validates, pushes the branch and opens a pull request to develop with the template filled, labels and reviewers; optionally requests a Copilot review. |\n| `/modify-component` | `component-builder` | Changes the API or behavior of an existing component while keeping parity and the anatomy: contract → Lit → wrappers → React Native → scenarios → docs → llms.md → changeset. |\n| `/open-pr` | `github-ops` | Opens a pull request for an existing pushed branch (develop for work branches, main only for release PRs). Prefer finish-work, which validates first. |\n| `/publish-setup` | `release-manager` | One-time checklist to start publishing to npm: npm account with 2FA, first manual publication in dependency order, trusted publishers, GitHub environment and variables, verification. |\n| `/release` | `release-manager` | Runs the release flow: release PR develop → main, the Changesets \"Version Packages\" PR, npm publish with provenance and GitHub Releases; also snapshot prereleases with the next dist-tag. |\n| `/release-pr` | `release-manager` | Opens the release pull request develop → main with the summary of pending changesets. |\n| `/research-reference` | `researcher` | Researches specifications and public libraries for a feature, compares behavior, accessibility, APIs and licenses, and recommends a dependency or an own implementation. |\n| `/setup-ci` | `devops` | Creates or updates GitHub Actions workflows (CI, identity, release, docs) following the workflow rules. |\n| `/start-work` | `github-ops` | Starts a task: syncs develop, creates a work branch with a normalized name and optionally links it to an issue. |\n| `/sync-after-merge` | `github-ops` | After a pull request is merged: returns to develop, pulls with prune and deletes the local work branch. |\n| `/sync-icons` | `component-builder` | Updates the Lucide version, regenerates the icon definitions and catalog, and refreshes the license notice. |\n| `/update-ai-references` | `ai-tooling` | Keeps every AI reference in sync with the code: llms.md blocks (npm run llms), docs .md pages, /llms.txt, /llms-full.txt, the MCP server data and tools, and cosmos init-ai. |\n| `/verify-identity` | `github-ops` | Checks the Git and GitHub identity before a commit or push. Enforces .local/git-identity.json when it exists; otherwise reports the current identity and asks for confirmation. |\n| `/write-adr` | `architect` | Writes an architecture decision record NNNN-title.md (context → decision → consequences). |\n\n## What to ask\n\n- **One task at a time**, with the outcome you expect: \"Create the `switch` component for all\n platforms\" rather than \"work on forms\".\n- **Give references**: an issue number, a Figma link, a pattern of the WAI-ARIA APG.\n- **Let them validate**: every skill ends with tests and `npx biome ci . && npx turbo run typecheck test\n build`; ask for the output when in doubt.\n- **Review before merging**: ask `reviewer` for a review of the branch.\n\n## Copyable prompts\n\n```text\n/component-status all — and tell me which three components I should build next and why.\n```\n\n```text\n/start-work feat elements switch, linked to issue #12\n```\n\n```text\nUse the component-builder agent: create the \"switch\" component (WAI-ARIA switch pattern) for web,\nReact, Angular and React Native, with controlled and uncontrolled `checked` state and a `cosm-change`\nevent. Follow the create-component skill and finish with the structure test.\n```\n\n```text\n/component-from-design https://www.figma.com/design/<file>?node-id=<node> as \"chip\"\n```\n\n```text\nUse the design-system agent: add a theme called \"aurora\" with a teal primary and a triadic harmony;\nit must pass the accessibility validation in light and dark.\n```\n\n```text\nUse the reviewer agent: review the current branch against develop and list only high-confidence\nproblems.\n```\n\n```text\n/finish-work \"feat(elements): add cosm-switch\" closes #12\n```\n"},{"slug":"getting-started/installation","title":"Installation","markdown":"# Installation\n\n> Install Cosmos UI for the web, React, Angular, React Native and Tailwind CSS.\n\nCosmos UI is not published yet. Once released, packages are installed from npm. Each framework has a\ncomplete guide: [React](../../guides/react-vite/), [Next.js](../../guides/nextjs/),\n[Angular](../../guides/angular/), [HTML / CDN](../../guides/html-cdn/),\n[React Native](../../guides/react-native/) and [Tailwind CSS](../../guides/tailwind/). To let an AI\nassistant do it, see [Use with AI](../../ai/overview/).\n\n**Web Components**\n```bash\nnpm install @joralvmel/cosmos-elements @joralvmel/cosmos-tokens\n```\n\n```js\nimport '@joralvmel/cosmos-tokens/tokens.css';\nimport '@joralvmel/cosmos-elements/button';\n```\n\n**React**\n```bash\nnpm install @joralvmel/cosmos-react @joralvmel/cosmos-tokens\n```\n\n```tsx\nimport '@joralvmel/cosmos-tokens/tokens.css';\n\nexport const Save = () => <Button onPress={event => console.log(event.detail.source)}>Save</Button>;\n```\n\n**Angular**\n```bash\nnpm install @joralvmel/cosmos-angular @joralvmel/cosmos-tokens\n```\n\n```ts\n\n@Component({\n selector: 'app-save',\n imports: [CosmButtonComponent],\n template: `<cosm-button (press)=\"save()\">Save</cosm-button>`,\n})\nexport class SaveComponent {\n save() {}\n}\n```\n\n**React Native**\n```bash\nnpm install @joralvmel/cosmos-native\n```\n\n```tsx\n\nexport default function App() {\n return (\n <CosmosThemeProvider theme=\"nebula\" mode=\"system\">\n <Button onPress={({ source }) => console.log(source)}>Save</Button>\n </CosmosThemeProvider>\n );\n}\n```\n\n## Theme and mode\n\nSet the theme and mode on any element (usually `<html>`). `data-mode=\"system\"` follows the operating\nsystem; without `data-mode` the light mode is used.\n\n```html\n<html data-theme=\"nebula\" data-mode=\"system\"></html>\n```\n\n## Tailwind CSS v4 (optional)\n\n```css\n@import \"tailwindcss\";\n@import \"@joralvmel/cosmos-tailwind\";\n```\n\nUtilities such as `bg-primary`, `text-fg-muted`, `rounded-md`, `dark:bg-surface` or\n`theme-nebula:text-accent` use the Cosmos tokens.\n"},{"slug":"getting-started/introduction","title":"Introduction","markdown":"# Introduction\n\n> What Cosmos UI is and how its packages fit together.\n\nCosmos UI is a design system that ships the same components to the web (Web Components, React,\nAngular) and to React Native. Each component is defined once as a **contract** in\n`@joralvmel/cosmos-core`; every platform implementation is tested against that contract and its shared\nbehavior scenarios.\n\n## Packages\n\n| Package | Purpose |\n| --- | --- |\n| `@joralvmel/cosmos-tokens` | Theme engine and design tokens (CSS variables, JSON, React Native values) |\n| `@joralvmel/cosmos-tailwind` | Tailwind CSS v4 theme mapped to the tokens |\n| `@joralvmel/cosmos-core` | Contracts, shared scenarios and headless logic |\n| `@joralvmel/cosmos-elements` | Web Components built with Lit |\n| `@joralvmel/cosmos-react` | React wrappers |\n| `@joralvmel/cosmos-angular` | Angular standalone components |\n| `@joralvmel/cosmos-native` | React Native components |\n\nCharts, icons, i18n, the MCP server and the CLI are in early development.\n\n## Principles\n\n- **Contracts first**: props, events, slots, keyboard support and ARIA roles are decided before code.\n- **Tokens only**: components are styled with `--cosm-*` variables, so every theme and mode works.\n- **Accessible by default**: WAI-ARIA patterns, visible focus, reduced motion and verified contrast.\n"},{"slug":"guides/angular","title":"Angular","markdown":"# Angular\n\n> Use Cosmos UI in Angular with standalone components, signals and forms.\n\n`@joralvmel/cosmos-angular` provides one standalone component per Web Component, with the same\nselector (`cosm-button`…). Inputs set element properties; outputs re-emit the original `CustomEvent`.\n\n## Setup\n\n```bash\nnpm install @joralvmel/cosmos-angular @joralvmel/cosmos-tokens\n```\n\n**Load the tokens** (`angular.json`)\n\n```json\n\"styles\": [\"node_modules/@joralvmel/cosmos-tokens/dist/tokens.css\", \"src/styles.css\"]\n```\n\n**Choose theme and mode** (`src/index.html`)\n\n```html\n<html data-theme=\"cosmos\" data-mode=\"system\">\n```\n\n**Import components** (`src/app/app.component.ts`)\n\n```ts\nimport { Component } from '@angular/core';\nimport { CosmButtonComponent } from '@joralvmel/cosmos-angular';\n\n@Component({\n selector: 'app-root',\n imports: [CosmButtonComponent],\n template: `<cosm-button (press)=\"save($event.detail.source)\">Save</cosm-button>`,\n})\nexport class AppComponent {\n save(source: string) {}\n}\n```\n\n- Components are standalone; import them individually or spread `COSMOS_COMPONENTS`.\n- Outputs re-emit the original CustomEvent: use `$event.detail`. Form controls provide ControlValueAccessors.\n\nGuide: https://joralvmel.github.io/cosmos-ui/guides/angular/\n\n## Inputs, outputs and signals\n\n```ts\n\n@Component({\n selector: 'app-save',\n imports: [CosmButtonComponent],\n template: `\n <cosm-button [loading]=\"saving()\" variant=\"soft\" (press)=\"save()\">Save</cosm-button>\n `,\n})\nexport class SaveComponent {\n readonly saving = signal(false);\n\n save() {\n this.saving.set(true);\n }\n}\n```\n\n- Boolean inputs accept attributes (`loading`, `fullWidth`) and bindings (`[loading]=\"saving()\"`).\n- Outputs use the contract names: `(press)`, `(valueChange)`, `(openChange)`… Read `$event.detail`.\n- The components work in zoneless applications.\n\n## Forms\n\n`<cosm-button type=\"submit\">` submits the surrounding `<form>`. Form controls (text field, checkbox…)\nship `ControlValueAccessor`s so they work with `formControlName` and `[(ngModel)]` as they become\navailable (see the [component status](../../components/status/)).\n\n## All components at once\n\n```ts\n\n@Component({ imports: [...COSMOS_COMPONENTS], template: '…' })\nexport class Page {}\n```\n"},{"slug":"guides/html-cdn","title":"HTML and CDN","markdown":"# HTML and CDN\n\n> Use Cosmos UI Web Components in plain HTML, from a CDN or with any bundler.\n\nThe Web Components of `@joralvmel/cosmos-elements` work in any page: no framework needed.\n\n## Setup\n\n**Load tokens and components from a CDN** (`index.html`)\n\n```html\n<!doctype html>\n<html lang=\"en\" data-theme=\"cosmos\" data-mode=\"system\">\n <head>\n <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/@joralvmel/cosmos-tokens/dist/tokens.css\" />\n <script type=\"module\" src=\"https://esm.sh/@joralvmel/cosmos-elements/button\"></script>\n </head>\n <body>\n <cosm-button variant=\"soft\">Save</cosm-button>\n <script type=\"module\">\n document.querySelector('cosm-button').addEventListener('cosm-press', event => {\n console.log(event.detail.source);\n });\n </script>\n </body>\n</html>\n```\n\n- With a bundler, `npm install @joralvmel/cosmos-elements @joralvmel/cosmos-tokens` and import `@joralvmel/cosmos-elements/<component>`.\n- DOM events are `cosm-*` CustomEvents that bubble and cross shadow roots.\n\nGuide: https://joralvmel.github.io/cosmos-ui/guides/html-cdn/\n\n## With a bundler\n\n```bash\nnpm install @joralvmel/cosmos-elements @joralvmel/cosmos-tokens\n```\n\n```js\nimport '@joralvmel/cosmos-tokens/tokens.css';\nimport '@joralvmel/cosmos-elements/button'; // one import per component\n```\n\n## Properties, attributes and events\n\n- Styling props are attributes in kebab-case (`full-width`, `variant=\"soft\"`); every prop is also a\n JavaScript property (`button.fullWidth = true`).\n- Events are `cosm-*` `CustomEvent`s that bubble and cross shadow roots, so you can listen on a parent.\n- Theme hooks: `--cosm-<component>-*` custom properties and `::part()` selectors (see each component API).\n\n```html\n<form>\n <cosm-button type=\"submit\">Send</cosm-button>\n</form>\n<script type=\"module\">\n document.addEventListener('cosm-press', event => console.log(event.target, event.detail));\n</script>\n```\n\n## Switching theme and mode\n\n```html\n<script type=\"module\">\n setTheme('nebula');\n setMode('dark');\n</script>\n```\n"},{"slug":"guides/nextjs","title":"Next.js","markdown":"# Next.js\n\n> Use Cosmos UI with the Next.js App Router, Server and Client Components.\n\nCosmos components are Web Components wrapped for React. They work with the App Router as long as they\nare rendered from **Client Components**.\n\n## Setup\n\n```bash\nnpm install @joralvmel/cosmos-react @joralvmel/cosmos-tokens\n```\n\n**Load the tokens and avoid a theme flash** (`app/layout.tsx`)\n\n```tsx\nimport '@joralvmel/cosmos-tokens/tokens.css';\nimport { themeInitScript } from '@joralvmel/cosmos-tokens/runtime';\nimport Script from 'next/script';\n\nexport default function RootLayout({ children }: { children: React.ReactNode }) {\n return (\n <html lang=\"en\" data-theme=\"cosmos\" data-mode=\"system\" suppressHydrationWarning>\n <body>\n <Script id=\"cosmos-theme\" strategy=\"beforeInteractive\">\n {themeInitScript()}\n </Script>\n {children}\n </body>\n </html>\n );\n}\n```\n\n**Use components in Client Components** (`app/save-button.tsx`)\n\n```tsx\n'use client';\n\nimport { Button } from '@joralvmel/cosmos-react';\n\nexport function SaveButton() {\n return <Button onPress={() => console.log('saved')}>Save</Button>;\n}\n```\n\n- Cosmos components are Web Components: render them from Client Components (`'use client'`). Server Components can render the Client Component that wraps them.\n- The server HTML contains the custom element tag; it upgrades in the browser.\n\nGuide: https://joralvmel.github.io/cosmos-ui/guides/nextjs/\n\n## Server and Client Components\n\n- The wrappers set element properties and listen to events in effects, so the file that imports\n `@joralvmel/cosmos-react` must start with `'use client'`.\n- Server Components can render those Client Components and pass serializable props (strings,\n numbers, booleans). Handlers stay inside the Client Component.\n- The server HTML contains the custom element tag and its text; the element upgrades in the browser.\n\n```tsx\n// app/page.tsx (Server Component)\n\nexport default function Page() {\n return <SaveButton />;\n}\n```\n\n## Avoiding a theme flash\n\n`themeInitScript()` returns a small, validated inline script that restores the theme and mode stored by\n`setTheme()` / `setMode()` before the first paint. Load it with `next/script` and\n`strategy=\"beforeInteractive\"` as shown above, and keep `suppressHydrationWarning` on `<html>` because\nthe script may change `data-theme` / `data-mode` before hydration.\n\n## Tailwind\n\nUse `@tailwindcss/postcss` with the [Cosmos Tailwind theme](../tailwind/).\n"},{"slug":"guides/react-native","title":"React Native and Expo","markdown":"# React Native and Expo\n\n> Use Cosmos UI components and themes in React Native apps with Expo.\n\n`@joralvmel/cosmos-native` implements the same component contracts with React Native primitives and\nuses the same themes as the web.\n\n## Setup\n\n```bash\nnpx expo install @joralvmel/cosmos-native\n```\n\n**Provide a theme** (`app/_layout.tsx`)\n\n```tsx\nimport { CosmosThemeProvider } from '@joralvmel/cosmos-native';\nimport { Stack } from 'expo-router';\n\nexport default function Layout() {\n return (\n <CosmosThemeProvider theme=\"cosmos\" mode=\"system\">\n <Stack />\n </CosmosThemeProvider>\n );\n}\n```\n\n**Use components** (`app/index.tsx`)\n\n```tsx\nimport { Button } from '@joralvmel/cosmos-native';\n\nexport default function Home() {\n return <Button onPress={({ source }) => console.log(source)}>Save</Button>;\n}\n```\n\n- Callbacks receive the event detail directly (`onPress(detail)`).\n- `useTheme()` returns colors, spacing, radius and typography as numbers for your own styles.\n\nGuide: https://joralvmel.github.io/cosmos-ui/guides/react-native/\n\n## Theme and mode\n\n`CosmosThemeProvider` accepts `theme` (`cosmos`, `nebula`…) and `mode` (`light`, `dark` or `system`,\nwhich follows the device appearance).\n\n## Your own styles with the theme\n\n```tsx\n\nexport function Card({ title }: { title: string }) {\n const theme = useTheme();\n return (\n <View style={{ backgroundColor: theme.colors.surface, borderRadius: theme.radius.lg, padding: theme.space.lg }}>\n <Text style={{ color: theme.colors.fg, fontSize: theme.text.lg }}>{title}</Text>\n </View>\n );\n}\n```\n\n## Accessibility\n\nComponents set `accessibilityRole`, `accessibilityState` and labels, and small controls extend their\ntouch area to 44 points. Test with TalkBack and VoiceOver.\n\n## Demo app\n\nThe repository includes an Expo Router app with a screen per component: see\n[Contribute → Getting started](../../contribute/getting-started/#native-demo).\n"},{"slug":"guides/react-vite","title":"React (Vite)","markdown":"# React (Vite)\n\n> Use Cosmos UI in a React 19 app built with Vite.\n\n`@joralvmel/cosmos-react` wraps the Cosmos Web Components for React 19. Props are set as element\nproperties and event props receive the original `CustomEvent`.\n\n## Setup\n\n```bash\nnpm install @joralvmel/cosmos-react @joralvmel/cosmos-tokens\n```\n\n**Load the tokens once** (`src/main.tsx`)\n\n```tsx\nimport '@joralvmel/cosmos-tokens/tokens.css';\n```\n\n**Choose theme and mode** (`index.html`)\n\n```html\n<html data-theme=\"cosmos\" data-mode=\"system\">\n```\n\n**Use components** (`src/App.tsx`)\n\n```tsx\nimport { Button } from '@joralvmel/cosmos-react';\n\nexport default function App() {\n return <Button onPress={event => console.log(event.detail.source)}>Save</Button>;\n}\n```\n\n- Event props (`onPress`, `onChange`…) receive the original CustomEvent: read `event.detail`.\n- Change theme and mode at runtime with `setTheme()` / `setMode()` from `@joralvmel/cosmos-tokens/runtime`.\n\nGuide: https://joralvmel.github.io/cosmos-ui/guides/react-vite/\n\n## Events\n\nEvent props follow the contract names (`onPress`, `onChange`, `onOpenChange`…). Read the payload from\n`event.detail`; its type is exported by `@joralvmel/cosmos-core`.\n\n```tsx\n\nfunction Save() {\n const onPress = (event: CustomEvent<ButtonPressDetail>) => console.log(event.detail.source);\n return <Button onPress={onPress}>Save</Button>;\n}\n```\n\n## Controlled and uncontrolled state\n\nStateful components (value, open, selected tab…) work uncontrolled by default. Pass the state prop to\ncontrol it: the component then proposes changes through its event and waits for your new prop value\n([ADR 0003](https://github.com/joralvmel/cosmos-ui/blob/develop/docs/adr/0003-state-ownership-and-events.md)).\n\n## Switching theme and mode\n\n```tsx\n\nsetTheme('nebula');\nsetMode('dark'); // 'light' | 'dark' | 'system'\n```\n\nThe choice is stored in `localStorage`. To restore it before the first paint, add the script returned\nby `themeInitScript()` to `<head>` (see the [Next.js guide](../nextjs/)).\n\n## Next steps\n\n- Style your own UI with tokens or the [Tailwind theme](../tailwind/).\n- Browse the [components](../../components/status/) and their playgrounds.\n"},{"slug":"guides/tailwind","title":"Tailwind CSS","markdown":"# Tailwind CSS\n\n> Style your app with Tailwind CSS v4 utilities mapped to Cosmos tokens and themes.\n\n`@joralvmel/cosmos-tailwind` turns the Cosmos tokens into a Tailwind CSS v4 theme. Every utility follows\nthe active theme and mode, and Cosmos components keep working without Tailwind.\n\n## Setup\n\n```bash\nnpm install @joralvmel/cosmos-tailwind && npm install -D tailwindcss @tailwindcss/vite\n```\n\n**Import the Cosmos theme after Tailwind** (`src/styles.css`)\n\n```css\n@import \"tailwindcss\";\n@import \"@joralvmel/cosmos-tailwind\";\n```\n\n**Use token utilities**\n\n```html\n<div class=\"bg-surface text-fg rounded-lg shadow-md p-4 dark:bg-surface-raised\">\n <p class=\"text-fg-muted\">Uses Cosmos tokens in every theme and mode.</p>\n</div>\n```\n\n- Default Tailwind colors are disabled: use semantic colors (`bg-primary`, `text-danger-text`…).\n- `dark:` follows `data-mode` (including `system`); `theme-<name>:` targets one theme.\n\nGuide: https://joralvmel.github.io/cosmos-ui/guides/tailwind/\n\nPlugins: Vite uses `@tailwindcss/vite`; Next.js and Angular use `@tailwindcss/postcss`.\n\n## Utilities\n\n| Group | Examples |\n| --- | --- |\n| Colors | `bg-bg`, `bg-surface`, `text-fg`, `text-fg-muted`, `bg-primary text-primary-fg`, `bg-danger-subtle text-danger-text`, `border-border`, `ring-focus-ring` |\n| Scales | `bg-primary-3`, `text-neutral-11` (steps 1–12) |\n| Spacing | `p-4` (= 4 × `--cosm-space-unit`), `gap-sm`, `px-lg` |\n| Shape | `rounded-sm` … `rounded-xl`, `rounded-full`, `shadow-sm` / `shadow-md` / `shadow-lg` |\n| Typography | `text-xs` … `text-4xl`, `font-semibold`, `leading-tight` |\n\nDefault Tailwind colors (`bg-blue-500`…) are disabled so only theme colors are used.\n\n## Variants\n\n- `dark:` applies in dark mode, including `data-mode=\"system\"` when the OS is dark.\n- `theme-<name>:` targets one theme, e.g. `theme-nebula:rounded-none`.\n"},{"slug":"","title":"Cosmos UI","markdown":"# Cosmos UI\n\n> Themeable design system with Web Components, React, Angular and React Native built from one contract per component.\n\n### Contracts first\n Every component starts as a typed contract: props, events, slots, keyboard and ARIA. Web, React,\n Angular and React Native implementations are tested against it.\n### Themes you can generate\n Pick seed colors and a harmony; Cosmos builds light and dark palettes in OKLCH and verifies WCAG\n contrast and color vision deficiencies.\n### Tailwind friendly\n Utilities like `bg-primary` or `rounded-md` map to Cosmos tokens through a Tailwind CSS v4 theme.\n### AI ready\n Machine-readable references (`llms.txt`) and an MCP server keep assistants aligned with the real API.\n"},{"slug":"theming/themes","title":"Themes","markdown":"# Themes\n\n> Built-in Cosmos themes in light and dark mode, with their accessibility report.\n\nEach theme is generated from seed colors and a color harmony with `defineTheme`. The engine builds\n12-step OKLCH scales, a dark mode with its own lightness curve, status colors that keep their meaning and\nan 8-color chart palette. Every theme is validated against WCAG 2.2 AA (normative), APCA (informative)\nand simulated protanopia, deuteranopia and tritanopia.\n\n- **Cosmos** (`data-theme=\"cosmos\"`), light and dark.\n- **Nebula** (`data-theme=\"nebula\"`), light and dark.\n\n## Create a theme\n\n```ts\n\nconst aurora = defineTheme({\n name: 'aurora',\n seeds: { primary: 'oklch(0.56 0.15 165)' },\n harmony: 'triadic',\n radius: 'pill',\n});\n\nconst resolved = resolveTheme(aurora);\nconsole.log(validateTheme(resolved).pass);\nconst css = toCss([resolved]);\n```\n\nTheme names cannot be `light`, `dark` or `system`; those are mode names.\n"}]
|
|
1
|
+
[{"slug":"ai/mcp","title":"MCP server","markdown":"# MCP server\n\n> Connect AI assistants to the Cosmos UI MCP server to query components, themes, tokens and setup.\n\n`@joralvmel/cosmos-mcp` is a [Model Context Protocol](https://modelcontextprotocol.io/) server\n(stdio). It ships the contracts, snippets, status, themes and docs of its version, so the answers match\nwhat you install.\n\n## Connect\n\n**VS Code**\n`npx @joralvmel/cosmos-cli init-ai` does it for you, or add to `.vscode/mcp.json`:\n\n```json\n{\n \"servers\": {\n \"cosmos-ui\": { \"type\": \"stdio\", \"command\": \"npx\", \"args\": [\"-y\", \"@joralvmel/cosmos-mcp\"] }\n }\n}\n```\n**Claude Code**\n```bash\nclaude mcp add cosmos-ui -- npx -y @joralvmel/cosmos-mcp\n```\n**Other clients**\nRun the command `npx -y @joralvmel/cosmos-mcp` as a stdio server in your client configuration.\n\n## Tools\n\n| Tool | Arguments | Returns |\n| --- | --- | --- |\n| `list_components` | `status?` (`planned`, `in-progress`, `stable`) | Every catalog component with category, platforms, dependencies and status. |\n| `get_component` | `name` | Contract (props, events per platform, slots, parts, keyboard), API table, snippets for HTML, React, Angular and React Native, imports and status. |\n| `list_themes` | — | Built-in themes and their modes. |\n| `get_tokens` | `theme?`, `mode?` | Semantic color tokens and radii of a theme and mode. |\n| `get_setup` | `framework` (`react`, `next`, `angular`, `html`, `react-native`, `tailwind`) | Install commands, setup code and rules. |\n| `search_docs` | `query`, `limit?` | Matching docs pages and package references with an excerpt. |\n\nResources: `cosmos://llms/<package>` returns the `llms.md` of each package.\n\n## Example questions\n\n- \"Which Cosmos components are stable, and which ones can I use for a form?\"\n- \"Show me the Angular code for a danger outline button that is loading.\"\n- \"What are the dark-mode tokens of the nebula theme?\"\n"},{"slug":"ai/overview","title":"Use Cosmos UI with AI","markdown":"# Use Cosmos UI with AI\n\n> Give AI assistants the real Cosmos API with init-ai, llms.txt, Markdown pages and the MCP server.\n\nAI assistants write better UI code when they know the real components, props, events and tokens. Cosmos\ngives them that knowledge in three ways, all generated from the component contracts.\n\n## 1. Prepare your project with `init-ai`\n\n1. Run it in your project folder with your stack (`react`, `next`, `angular`, `html` or `react-native`):\n\n ```bash\n npx @joralvmel/cosmos-cli init-ai --stack react\n ```\n\n2. It writes a marked block with the Cosmos rules into `.github/copilot-instructions.md` and\n `AGENTS.md` (add `--claude` for `CLAUDE.md`), registers the MCP server in `.vscode/mcp.json` and\n prints the installation steps. Run it again at any time: only the marked block is replaced.\n\n3. Ask your assistant to install Cosmos UI (see the [ready-made prompts](../prompts/)).\n\n## 2. Reference files\n\n| Resource | Use |\n| --- | --- |\n| [`/llms.txt`](../../llms.txt) | Index of every package reference and page, for assistants that read `llms.txt`. |\n| [`/llms-full.txt`](../../llms-full.txt) | The whole documentation and every package reference in one file. |\n| `/<page>.md` | Every page as Markdown (button **Copy page for AI** below each title). |\n| `node_modules/@joralvmel/cosmos-*/llms.md` | Reference of each installed package: setup, components with props, events and examples, themes and rules. |\n\n## 3. MCP server\n\nThe [MCP server](../mcp/) answers questions about components, themes, tokens and setup with data that\nmatches the installed version.\n\n## Install with AI (copy and paste)\n\n```text\nInstall Cosmos UI in this project. First run `npx @joralvmel/cosmos-cli init-ai --stack <my stack>`,\nthen follow the steps it prints. Use the cosmos-ui MCP server (get_setup, list_components,\nget_component) or https://joralvmel.github.io/cosmos-ui/llms.txt to check every component and prop\nbefore using it. Style only with Cosmos tokens or the Cosmos Tailwind theme.\n```\n"},{"slug":"ai/prompts","title":"Ready-made prompts","markdown":"# Ready-made prompts\n\n> Copyable prompts to build UI with Cosmos in React, Next.js, Angular, HTML and React Native.\n\nCopy a prompt, replace the part in angle brackets and paste it in your assistant. They assume you ran\n[`init-ai`](../overview/) or that the assistant can read `llms.txt` or the MCP server.\n\n**React**\n```text\nUsing Cosmos UI (@joralvmel/cosmos-react) in this React + Vite app, build <a settings page with a\nform and a save button>. Check each component with the cosmos-ui MCP server (get_component) before\nusing it, handle events through event.detail, style the layout with Cosmos tokens or the Cosmos\nTailwind theme, support light and dark mode and keep keyboard access.\n```\n**Next.js**\n```text\nUsing Cosmos UI (@joralvmel/cosmos-react) in this Next.js App Router project, build <a dashboard\nheader with actions>. Put Cosmos components in Client Components ('use client'), keep pages as\nServer Components, load @joralvmel/cosmos-tokens/tokens.css in app/layout.tsx and use\nthemeInitScript() to avoid a theme flash. Check props with the cosmos-ui MCP server.\n```\n**Angular**\n```text\nUsing Cosmos UI (@joralvmel/cosmos-angular) in this standalone Angular app, build <a profile form>.\nImport the Cosmos standalone components you need, bind inputs with signals, listen to outputs with\n$event.detail and keep forms accessible. Check each component with the cosmos-ui MCP server.\n```\n**HTML**\n```text\nBuild <a landing page section> in plain HTML with Cosmos UI Web Components from a CDN\n(@joralvmel/cosmos-elements and @joralvmel/cosmos-tokens). Use <cosm-*> elements, listen to cosm-*\nevents, set data-theme and data-mode on <html> and use only var(--cosm-*) tokens in custom CSS.\n```\n**React Native**\n```text\nUsing Cosmos UI (@joralvmel/cosmos-native) in this Expo app, build <a login screen>. Wrap the app in\nCosmosThemeProvider with mode=\"system\", use useTheme() for custom styles, keep touch targets of at\nleast 44 points and accessibility labels. Check each component with the cosmos-ui MCP server.\n```\n\n## Prompts for the component library itself\n\nTo add or change components in the Cosmos repository, use the agents and prompts of the repository\n(`/create-component`, `/component-status`…): see [Working with agents](../../contribute/working-with-agents/).\n"},{"slug":"components/button","title":"Button","markdown":"# Button\n\n> Triggers an action or submits a form. Web Component, React, Angular and React Native.\n\nStatus: **stable** (web, react, angular, native).\n\n`<cosm-button>` triggers an action. It follows the\n[WAI-ARIA button pattern](https://www.w3.org/WAI/ARIA/apg/patterns/button/), renders a native\n`<button>` and takes part in forms (`type=\"submit\"` / `type=\"reset\"`). Use it for actions; use a link\nfor navigation.\n\n## Playground\n\n**HTML / Web Component**\n\n```html\n<cosm-button>Save changes</cosm-button>\n\n<script type=\"module\">\n import '@joralvmel/cosmos-elements/button';\n\n const element = document.querySelector('cosm-button');\n element.addEventListener('cosm-press', event => console.log(event.detail));\n</script>\n```\n\n**React**\n\n```tsx\nimport { Button } from '@joralvmel/cosmos-react';\n\nexport function Example() {\n return (\n <Button onPress={event => console.log(event.detail)}>Save changes</Button>\n );\n}\n```\n\n**Angular**\n\n```ts\nimport { Component } from '@angular/core';\nimport { CosmButtonComponent } from '@joralvmel/cosmos-angular';\nimport type { ButtonPressDetail } from '@joralvmel/cosmos-core';\n\n@Component({\n selector: 'app-example',\n imports: [CosmButtonComponent],\n template: `<cosm-button (press)=\"onPress($event.detail)\">Save changes</cosm-button>`,\n})\nexport class ExampleComponent {\n onPress(detail: ButtonPressDetail) {\n console.log(detail);\n }\n}\n```\n\n**React Native**\n\n```tsx\nimport { Button } from '@joralvmel/cosmos-native';\n\nexport function Example() {\n return (\n <Button onPress={detail => console.log(detail)}>Save changes</Button>\n );\n}\n```\n\n## Variants\n\n`variant` sets the emphasis and `tone` the color role. Use one `solid` button per view for the main\naction.\n\n```html\n<cosm-button>Solid</cosm-button>\n<cosm-button variant=\"soft\">Soft</cosm-button>\n<cosm-button variant=\"outline\">Outline</cosm-button>\n<cosm-button variant=\"ghost\">Ghost</cosm-button>\n<cosm-button tone=\"neutral\">Neutral</cosm-button>\n<cosm-button tone=\"danger\">Delete</cosm-button>\n```\n\n```html\n<cosm-button size=\"sm\">Small</cosm-button>\n<cosm-button>Medium</cosm-button>\n<cosm-button size=\"lg\">Large</cosm-button>\n```\n\n## States\n\n```html\n<cosm-button loading>Saving</cosm-button>\n<cosm-button disabled>Disabled</cosm-button>\n```\n\n- `loading` keeps the button focusable, sets `aria-busy` and ignores presses.\n- `disabled` removes it from the tab order and ignores presses.\n- Hover, active and `:focus-visible` states use the theme tokens of the selected tone.\n\n## Accessibility\n\n- Native `<button>` semantics: <kbd>Enter</kbd> and <kbd>Space</kbd> activate it.\n- Give icon-only buttons a `label`; it becomes the accessible name.\n- Use `tone=\"danger\"` together with explicit text for destructive actions; color is never the only cue.\n- On React Native, small buttons extend their touch area to 44 points.\n\n## API\n\n| Prop | Type | Default | Description |\n| --- | --- | --- | --- |\n| `variant` | 'solid' \\| 'soft' \\| 'outline' \\| 'ghost' | `solid` | Visual emphasis, from highest (solid) to lowest (ghost). |\n| `tone` | 'primary' \\| 'neutral' \\| 'danger' | `primary` | Color role. Use danger for destructive actions. |\n| `size` | 'sm' \\| 'md' \\| 'lg' | `md` | Control height and padding. |\n| `disabled` | boolean | `false` | Prevents interaction and removes the button from the tab order. |\n| `loading` | boolean | `false` | Shows a spinner, sets aria-busy and ignores presses while keeping focus. |\n| `fullWidth` | boolean | `false` | Stretches the button to the width of its container. |\n| `type` | 'button' \\| 'submit' \\| 'reset' | `button` | Form behavior of the button. |\n| `label` | string | — | Accessible name when the visible content is not descriptive (icon-only buttons). |\n\n**Slots**\n\n| Name | Description |\n| --- | --- |\n| `(default)` | Button label. |\n| `start` | Content before the label, usually an icon. |\n| `end` | Content after the label, usually an icon. |\n\n**CSS parts**\n\n| Name | Description |\n| --- | --- |\n| `base` | The native button element. |\n| `label` | Wrapper of the label slot. |\n| `spinner` | Loading indicator. |\n\n**CSS custom properties**\n\n| Name | Description |\n| --- | --- |\n| `--cosm-button-radius` | Corner radius. |\n| `--cosm-button-gap` | Space between icon and label. |\n| `--cosm-button-font-weight` | Label font weight. |\n\n**Keyboard**\n\n| Keys | Action |\n| --- | --- |\n| `Enter`, `Space` | Activates the button. |\n\n## Events by platform\n\n| DOM | React | Angular | React Native | Detail | Description |\n| --- | --- | --- | --- | --- | --- |\n| `cosm-press` | `onPress` | `(press)` | `onPress` | `ButtonPressDetail` | The button was activated by pointer, keyboard or programmatically. |\n"},{"slug":"components/icon","title":"Icon","markdown":"# Icon\n\n> Render a Lucide-based SVG as a decorative or informative image.\n\nStatus: **stable** (web, react, angular, native).\n\n`<cosm-icon>` renders a structured SVG definition. Import only the glyphs you use from\n`@joralvmel/cosmos-icons`; per-icon modules keep application bundles tree-shakeable.\n\n## Playground\n\n**HTML / Web Component**\n\n```html\n<cosm-icon></cosm-icon>\n\n<script type=\"module\">\n import '@joralvmel/cosmos-elements/icon';\n import { house } from '@joralvmel/cosmos-icons/house';\n\n const element = document.querySelector('cosm-icon');\n element.icon = house;\n</script>\n```\n\n**React**\n\n```tsx\nimport { Icon } from '@joralvmel/cosmos-react';\nimport { house } from '@joralvmel/cosmos-icons/house';\n\nexport function Example() {\n return (\n <Icon icon={house}></Icon>\n );\n}\n```\n\n**Angular**\n\n```ts\nimport { Component } from '@angular/core';\nimport { CosmIconComponent } from '@joralvmel/cosmos-angular';\nimport { house } from '@joralvmel/cosmos-icons/house';\n\n@Component({\n selector: 'app-example',\n imports: [CosmIconComponent],\n template: `<cosm-icon [icon]=\"house\"></cosm-icon>`,\n})\nexport class ExampleComponent {\n readonly house = house;\n}\n```\n\n**React Native**\n\n```tsx\nimport { Icon } from '@joralvmel/cosmos-native';\nimport { house } from '@joralvmel/cosmos-icons/house';\n\nexport function Example() {\n return (\n <Icon icon={house}></Icon>\n );\n}\n```\n\nSearch all 2,052 icons by name, category or tag. The gallery loads thumbnails in batches;\nselect one to update the preview and code. Edit `stroke`, `fill`, `strokeWidth`, and `size`\nindependently. On the production site, the catalog and its module map load only on the Icon\nplayground.\n\n## Variants\n\nChoose `sm` (16), `md` (20, default), `lg` (24), or a positive finite number. Numbers are CSS\npixels on the web and logical units on native. On the web `--cosm-icon-size` takes precedence,\nincluding `em` and `rem` values; it does not apply to native.\n\n```tsx\n\n<Icon icon={house} size=\"lg\" />;\n```\n\n`stroke` defaults to `currentColor` (inherited on web, `theme.colors.fg` on native), `fill` to\n`none`, and `strokeWidth` to `2` SVG viewBox units. Stroke width scales with the icon. Use\nnonnegative finite widths. Paints must be supported by the platform; URL paints are rejected.\nCSS custom-property paints work on the web, while native requires React Native color strings.\n\n```tsx\n\n<Icon icon={circle} size={32} stroke=\"var(--cosm-fg)\" fill=\"var(--cosm-primary)\" strokeWidth={1.5} />;\n```\n\n### Fill is not a solid variant\n\n`fill` works with every definition; it is not exclusive to particular icon names. The result\ndepends on the SVG geometry:\n\n- Closed contours, such as `circle` and `star`, can produce useful filled shapes.\n- SVG fills open paths as if their endpoints were joined. For example, filling `arrow-right`\n creates a triangle in its open arrowhead, not a purpose-designed solid arrow.\n- Multi-part outlines can lose details when filled. An explicit node fill, including `none`,\n takes precedence over the root fill.\n\nEach pair below shows `fill=\"none\"` on the left and `fill=\"var(--cosm-primary)\"` on the right.\nThe same generic property is used in all three pairs; there is no special-case rendering.\n\n<IconFillExamples label=\"Closed and open paths with and without fill\" />\n\nLucide is an outline set. Changing its fill does not provide a complete set of designed solid\nvariants; keep `fill=\"none\"` unless the selected geometry gives the intended result.\n\nIn React Native use `const theme = useTheme()` and pass `stroke={theme.colors.fg}` and\n`fill={theme.colors.primary}` instead. On native, a definition node\nwhose fill is `currentColor` (for example the dots of `brain-circuit`) also uses\n`theme.colors.fg`, independently of `stroke`. The Playground accepts `none`, `currentColor`, Cosmos\ncolor tokens such as `var(--cosm-primary)` and hex/rgb/hsl/named colors so every tab is valid; its\nReact Native tab turns token paints into `theme.colors` values from `useTheme()`.\n\n### Catalog versus application bundle\n\nThe package includes the full catalog, but application code should import individual glyphs, not\nthe demo's catalog loader. Web bundlers can discard unused modules. The native demo deliberately\nreferences every icon so its explorer can display any result: Metro includes those modules in the\nAndroid/iOS production bundle even though the loader uses `import()`. That demo is not a minimal\napplication bundle. Import only the icons your native application uses.\n\n## States\n\nIcons are non-interactive and have no state or events. They are decorative by default. To convey\nmeaning, set `decorative={false}` and provide a concise `label`.\n\n```tsx\n<Icon icon={house} decorative={false} label=\"Home\" />;\n```\n\n## Accessibility\n\n- Decorative icons are hidden from assistive technology and are not focusable.\n- Informative icons expose one image role and the provided accessible name.\n- `decorative={false}` without a non-empty `label` is an error; add a label or keep the icon\n decorative.\n- Do not use an icon alone as an interactive control. Put it inside a separately labeled button.\n\n## API\n\n| Prop | Type | Default | Description |\n| --- | --- | --- | --- |\n| `icon` | IconDefinition | Required | Structured icon definition, commonly imported from @joralvmel/cosmos-icons. |\n| `size` | 'sm' \\| 'md' \\| 'lg' \\| number | `md` | Semantic size (16, 20 or 24) or a positive finite number in pixels / native units. |\n| `stroke` | string | `currentColor` | Stroke paint; currentColor inherits on web and resolves to the theme foreground on native. |\n| `fill` | string | `none` | Root fill paint. Explicit node fills take precedence. |\n| `strokeWidth` | number | `2` | Finite nonnegative stroke width in SVG viewBox units. |\n| `label` | string | — | Accessible name required when decorative is false. |\n| `decorative` | boolean | `true` | Hides the icon from assistive technology when true. |\n\n**CSS parts**\n\n| Name | Description |\n| --- | --- |\n| `icon` | Rendered SVG image. |\n\n**CSS custom properties**\n\n| Name | Description |\n| --- | --- |\n| `--cosm-icon-size` | Override the rendered icon width and height. |\n\n## Events by platform\n\nNo events.\n"},{"slug":"components/status","title":"Component status","markdown":"# Component status\n\n> Inventory of every planned Cosmos component, with what exists on each platform.\n\nThis page is generated from the repository on every build: the canonical list lives in\n`packages/core/src/catalog.ts` and `npm run status` detects which pieces exist for each component\n(contract, scenarios, each platform, tests, docs, AI reference and changeset).\n\n- **Stable**: every piece exists for every platform of the component.\n- **In progress**: some pieces exist.\n- **Planned**: nothing exists yet. A planned component can start when its dependencies are stable.\n\n2 stable · 0 in progress · 36 planned (38 total)\n\nNext: `badge`, `avatar`, `divider`, `listbox`, `calendar`\n\n| Component | Status | Priority | Contract | Scenarios | Web Component | React | Angular | React Native | Native demo | Tests | Docs (EN) | Docs (ES) | llms.md | Changeset | Depends on |\n| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |\n| button | stable | 1 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — |\n| icon | stable | 1 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | — |\n| icon-button | planned | 2 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | button, icon |\n| badge | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| spinner | planned | 2 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| avatar | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| divider | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| listbox | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| calendar | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | button |\n| text-field | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | icon |\n| textarea | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| checkbox | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | icon |\n| radio-group | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| switch | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| number-field | planned | 2 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | text-field, icon-button |\n| select | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | popover, listbox, icon |\n| combobox | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | popover, listbox, text-field |\n| multi-select | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | popover, listbox, badge, checkbox |\n| slider | planned | 2 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| popover | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| tooltip | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | popover |\n| dialog | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | button, icon-button |\n| drawer | planned | 2 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | dialog |\n| toast | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | icon, icon-button |\n| menu | planned | 2 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | popover |\n| split-button | planned | 3 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | button, menu |\n| tabs | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| accordion | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | icon |\n| pagination | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | button, icon-button |\n| steps | planned | 2 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | icon |\n| breadcrumb | planned | 2 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | icon |\n| card | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| table | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | checkbox, pagination, icon-button |\n| date-picker | planned | 1 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | popover, calendar, text-field |\n| date-range-picker | planned | 3 | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | date-picker |\n| bottom-sheet | planned | 3 | ✗ | ✗ | — | — | — | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| skeleton | planned | 3 | ✗ | ✗ | — | — | — | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | — |\n| list-item | planned | 3 | ✗ | ✗ | — | — | — | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | icon |\n\nRun it locally:\n\n```bash\nnpm run status # table\nnpm run status -- --markdown\nnpm run status -- --json\n```\n"},{"slug":"contribute/example-switch","title":"Example: from issue to release","markdown":"# Example: from issue to release\n\n> A complete walkthrough that creates the cosm-switch component with the agents and skills, from the issue to the npm release.\n\nThis walkthrough adds `cosm-switch` (WAI-ARIA switch) on every platform. Each step names the skill to\nrun (as a `/prompt` in VS Code or by asking the agent) and shows the commands it runs and the expected\noutput.\n\n## 1. Check the inventory — `component-status`\n\n```bash\nnpm run status\n```\n\n```text\nComponents: 38 · stable 1 · in progress 0 · planned 37\n…\nplanned 1 switch\n…\nNext suggested: icon, badge, avatar, divider, listbox\n```\n\n`switch` is planned, priority 1 and has no dependencies, so it can start now.\n\n## 2. Issue and branch — `start-work`\n\n```bash\ngit fetch origin\ngit switch develop\ngit pull --ff-only\ngit switch -c feat/elements-switch\n```\n\n```text\nSwitched to a new branch 'feat/elements-switch'\n```\n\nAn optional existing issue (for example #12) is linked in the eventual PR. The work branch stays\nlocal until the implementation review is accepted.\n\n## 3. Research — `research-reference`\n\nThe `researcher` agent summarizes the\n[APG switch pattern](https://www.w3.org/WAI/ARIA/apg/patterns/switch/): role `switch`,\n`aria-checked`, <kbd>Space</kbd> toggles, visible label, and recommends a native\n`<input type=\"checkbox\" role=\"switch\">` inside the Web Component (form participation for free).\n\nIt also compares public implementations and returns required behavior separately from suggested\nsizes, states and customization. The main chat asks what to include or defer, presents tradeoffs\nand summarizes the proposed scope and web/native acceptance scenarios. **It waits for your scope\nand design approval before generating files or editing the contract.**\n\n## 4. Accepted API plan — `define-contract`\n\nAfter acceptance, `architect` outlines the contract (for example props `checked`, `disabled`,\n`required`, `name`, `value`, `label`; event `change` → DOM `cosm-change`, React `onChange`, Angular\n`(checkedChange)`, React Native `onCheckedChange`; state `checked` with `defaultChecked`) and the shared\nscenarios (toggle by pointer and keyboard, disabled, controlled proposal without commit). These are\nillustrative decisions, not a feature list to assume. The contract files are finalized after the\nscaffold in step 6 and before platform behavior.\n\n## 5. Visual spec — `design-component`\n\nThe `design-system` agent writes `docs/design/switch.md`: track and thumb sizes per `size`, states\n(hover, focus-visible, checked, disabled, invalid), tokens (`--cosm-primary`, `--cosm-border-strong`,\n`--cosm-surface`), motion with `prefers-reduced-motion`, and checks contrast in every theme.\n\n## 6. Generate — `create-component`\n\n```bash\nnpm run generate -- component switch\n```\n\n```text\nWrote 21 files:\n packages/core/src/specs/switch.ts\n packages/core/src/specs/switch.scenarios.ts\n packages/core/src/index.ts\n packages/elements/src/components/switch/cosm-switch.ts\n …\n apps/docs/src/content/docs/es/components/switch.mdx\n .changeset/add-switch.md\n\nNext: resolve every TODO(generator) marker, then run\n npx biome ci . && npx turbo run typecheck test build\n```\n\n`component-builder` replaces the generated placeholders with the real contract, the Lit\nimplementation (anatomy order: imports, types, styles, class, registration), the React events map and\nthe Angular inputs and `(checkedChange)` output with a `ControlValueAccessor`.\n\n## 7. React Native — `create-native-component`\n\n`native-expert` implements `Switch` with `Pressable`, `accessibilityRole=\"switch\"`,\n`accessibilityState={{ checked, disabled }}`, a 44-point touch area and `useTheme()` colors, and\nfinishes the demo screen `apps/native-demo/app/switch.tsx`.\n\n## 8. Tests — `add-contract-tests`\n\n```bash\nnpx turbo run test --filter=...@joralvmel/cosmos-core\ncd tools && npx vitest run test/structure.test.mjs test/status.test.mjs\n```\n\n```text\n Tasks: N successful, N total\n ✓ test/structure.test.mjs\n ✓ test/status.test.mjs\n```\n\n## 9. Docs and AI references — `add-docs-page`, `add-playground`, `update-ai-references`\n\nThe pages follow the anatomy order (status, Playground, variants, states, accessibility, API, events by\nplatform) in English and Spanish. The Playground already shows HTML, React, Angular and React Native\ncode from the contract.\n\n```bash\nnpm run llms\nnpm run status\n```\n\n```text\nstable 1 switch\n```\n\nThe inventory checks structural completeness. Only mark the component `stable` when the accepted\nscope and required checks are complete, or the user explicitly deferred unavailable checks that\nremain disclosed. File presence does not prove runtime readiness.\n\n## 10. Changeset — `add-changeset`\n\n```md\n---\n'@joralvmel/cosmos-core': minor\n'@joralvmel/cosmos-elements': minor\n'@joralvmel/cosmos-react': minor\n'@joralvmel/cosmos-angular': minor\n'@joralvmel/cosmos-native': minor\n---\n\nAdd the Switch component (`cosm-switch`) on every platform.\n```\n\n## 11. Local review, then pull request — `finish-work`, `open-pr`\n\n```text\n/finish-work \"feat(elements): add cosm-switch\" closes #12\n```\n\nThe agent runs repository checks and the relevant browser/wrapper/native scenarios, then verifies\nidentity and automatically commits only the task files locally. It reports the branch, SHA,\nvalidation matrix and how to try the component. **It stops without pushing or opening a PR.**\nMocks and exports are not native runtime evidence; unavailable devices/checks stay visible.\n\nTry that commit. If you request changes, the agent validates and creates a new commit, then waits\nagain. It does not amend the previous commit by default.\n\nOnly after you accept the current reviewed SHA does `open-pr` verify the unchanged HEAD, push the\nbranch and open the PR to `develop` (or reuse its existing open PR). For example:\n\n```text\nI approve the reviewed commit <SHA>. Push it and open the PR to develop.\n```\n\nCI runs lint, terms, typecheck, tests and build, the docs build (preview artifact), the changeset check\nand commit hygiene; the labeler adds `pkg:core`, `pkg:elements`, `pkg:react`, `pkg:angular`,\n`pkg:native`, `app:docs` and `app:native-demo`.\n\n## 12. Review and merge\n\nAsk `reviewer` for a review and address findings; fixes get another local commit and acceptance\nbefore pushing. GitHub approvals are optional, but checks and conversation resolution are required.\nThe maintainer merges with **Squash and merge** (the PR title becomes the commit message); the\nbranch is deleted automatically. Local acceptance does not authorize an automatic merge/release.\n\n## 13. Back to develop — `sync-after-merge`\n\n```bash\ngit switch develop && git pull --prune --ff-only && git branch -D feat/elements-switch\n```\n\n## 14. Release pull request — `release-pr`\n\n```bash\nnpx changeset status --since=origin/main\ngh pr create --base main --head develop --title \"chore(release): switch\" --label release\n```\n\nMerge it with **Create a merge commit**.\n\n## 15. Publish — `release`\n\nThe `Release` workflow opens **Version Packages** on main (versions `0.2.0`, changelogs). Merging it\npublishes to npm with provenance and creates the GitHub Releases:\n\n```bash\nnpm view @joralvmel/cosmos-elements version\n```\n\n```text\n0.2.0\n```\n"},{"slug":"contribute/getting-started","title":"Getting started","markdown":"# Getting started\n\n> Set up the Cosmos UI repository, run the docs and the native demo, and solve common problems.\n\n## Requirements\n\n- **Node.js 24** (see `.nvmrc`; `nvm use` or `fnm use`) and **npm 11**.\n- Git, and the [GitHub CLI](https://cli.github.com/) (`gh`) for the branch and pull request skills.\n- VS Code with GitHub Copilot to use the [agents](../working-with-agents/) (optional).\n- For the native demo: the Expo Go app on a phone, Android Studio (emulator) or Xcode (iOS simulator,\n macOS only).\n\n## First run\n\n1. Clone and install. `npm ci` also points Git to the hooks in `.githooks`:\n\n ```bash\n git clone https://github.com/joralvmel/cosmos-ui.git\n cd cosmos-ui\n npm ci\n ```\n\n2. Build, test and check everything (the same commands as CI):\n\n ```bash\n npx biome ci . && npx turbo run typecheck test build\n ```\n\n Turborepo caches results: a second run takes seconds.\n\n3. Open the docs site at http://localhost:4321:\n\n ```bash\n npm run docs\n ```\n\n4. See what exists and what is next:\n\n ```bash\n npm run status\n ```\n\n## Native demo\n\nThe Expo Router app in `apps/native-demo` has one screen per React Native component and a theme and\nmode switcher.\n\n```bash\nnpm run build # the demo uses the built packages\nnpm run dev --workspace=@joralvmel/cosmos-native-demo\n```\n\n- **Expo Go** (any OS): scan the QR code with the Expo Go app (Android) or the camera (iOS). The phone\n and the computer must be on the same network.\n- **Android emulator**: install Android Studio, create a virtual device, start it, then press `a` in\n the Expo terminal.\n- **iOS simulator** (macOS): install Xcode and its command line tools, then press `i`.\n- **Web preview**: press `w` in the Expo terminal, or run\n `npm run dev --workspace=@joralvmel/cosmos-native-demo -- --web`. This renders the native components\n with React Native Web; it does not replace testing on Android or iOS.\n\n`npm run build --workspace=@joralvmel/cosmos-native-demo` exports the web preview to\n`apps/native-demo/dist` after the library dependencies have been built. The monorepo build also runs\nthis export, so CI checks that the demo bundles for the browser.\n\n## Repository structure\n\n| Folder | Contents |\n| --- | --- |\n| `packages/*` | Publishable packages (`tokens`, `tailwind`, `core`, `elements`, `react`, `angular`, `native`, charts, `icons`, `i18n`, `mcp`, `cli`) |\n| `apps/docs` | This site (Astro + Starlight, English and Spanish) |\n| `apps/native-demo` | Expo demo app |\n| `tools/` | Generator, component status, AI references, Git and GitHub checks, release helpers |\n| `docs/adr`, `docs/conventions` | Architecture decisions and the component anatomy |\n| `.github/` | Workflows, agents, skills, prompts and path-specific instructions |\n\n## Browser tests\n\nUnit and behavior tests run in Vitest with happy-dom, so no browser is needed. Browser checks\n(Playwright with axe) are planned for keyboard behavior and accessibility; when they land they will\nneed `npx playwright install` once.\n\n## Troubleshooting\n\n| Problem | Fix |\n| --- | --- |\n| `EBADENGINE` / unsupported engine | Use Node.js 24 (`nvm use`). |\n| `EBUSY: resource busy or locked` on Windows during `npm ci` | An editor or language server holds a file in `node_modules`; close the project in other IDEs and run it again. |\n| `File content differs from formatting output` | `npm run lint:fix` (Biome formats with LF line endings). |\n| Hooks do not run | `npm ci` with `ignore-scripts` skips `prepare`: run `node tools/git/install-hooks.mjs`. |\n| `Commit blocked: the Git identity does not match` | Your `.local/git-identity.json` expects another identity; fix `git config --local user.*` or the file. |\n| `llms.md files are outdated` | `npm run llms` (the AI references are generated from the contracts). |\n| Strange cached results | `npx turbo run build --force`. |\n"},{"slug":"contribute/git-workflow","title":"Git workflow","markdown":"# Git workflow\n\n> Branches, commits, pull requests, reviews and releases in Cosmos UI.\n\n## Branches\n\n| Branch | Purpose | How changes arrive |\n| --- | --- | --- |\n| `main` | Released code; every push runs the release and docs deployment | Merge commit from `develop` (release pull request) |\n| `develop` | Integration, default branch | Squash work PRs; merge commit for main synchronization |\n| `<type>/<scope>-<description>` | One task | Created from `develop`, deleted after merge |\n\nTypes: `feat`, `fix`, `docs`, `chore`, `refactor`, `test`. Scope: package or area (`elements`, `tokens`,\n`docs`…). Example: `feat/elements-switch`. Contributors without write access fork the repository and\nopen the pull request from their fork.\n\n## Commits\n\n- [Conventional Commits](https://www.conventionalcommits.org/): `type(scope): summary`, several scopes\n separated by commas (`feat(mcp,cli): …`). The `commit-msg` hook checks it.\n- Use your own Git identity; prefer your GitHub noreply email. Sign off with `git commit -s`\n ([DCO](https://developercertificate.org/)) if you can.\n- Never use `--no-verify`.\n\n## Pull requests\n\n1. `start-work` creates a local branch from synchronized `develop`. Component work follows the\n [research and scope approval workflow](../working-with-agents/#research-decisions-and-local-review).\n2. `finish-work` validates, automatically commits locally, reports the SHA and local test steps,\n then **waits without push or PR**. Requested changes get a new commit and another review pause;\n previous commits are not amended by default.\n3. Explicit acceptance of that unchanged HEAD authorizes `open-pr` to verify identity, push and\n open/reuse the PR to `develop`. Initial task or scope approval does not accept unseen changes.\n New commits on an already open PR require the same local review before push.\n4. Required: green checks (lint, terms, typecheck, tests, build, packs, docs build, changeset, commit\n hygiene) and resolution of review conversations. Approvals are optional.\n5. Squash work PRs; the pull request title must be a Conventional Commit (checked by CI).\n Synchronization from main, including repair branches, uses a merge commit instead.\n6. `sync-after-merge` cleans up the local branch.\n\nApprovals are optional on `main` and `develop` so a sole maintainer can merge their own pull requests.\nThis policy applies to all contributors: classic branch protection on a personal repository does not\nsupport individual review exemptions. Pull requests, required checks and conversation resolution\nremain mandatory. Copilot reviews are advisory, not approving reviews.\nThe agent's local review pause is separate from GitHub review requirements; it changes no branch\nprotection settings. Agents never merge or publish just because local changes were accepted.\n\n## Releases\n\n`release-pr` opens `develop → main` with the pending changesets; merge it with a merge commit. The\n[Release and publishing](../publishing/) page explains the rest.\nAfter publication, synchronize main back into develop with a merge commit, never squash/rebase.\nVerify main is an ancestor of develop; never delete either long-lived branch.\n\n## Repository settings\n\nBranch protection, merge options and labels are code: `npm run setup-repo` shows the changes and\n`npm run setup-repo -- --apply` applies them with the GitHub CLI. Settings that only exist in the\nGitHub UI are printed at the end of the command.\n\n## Personal safeguards (optional)\n\nOn a computer with several GitHub accounts, create `.local/git-identity.json` (ignored by Git) with\nyour name, email and GitHub login: the `pre-commit` hook and the `verify-identity` skill then block\ncommits and pushes with another identity. On a computer with a single personal account nothing is\nneeded.\n"},{"slug":"contribute/prompt-cookbook","title":"Prompt cookbook","markdown":"# Prompt cookbook\n\n> Copyable prompts organized by task, from researching and creating components to fixes, tests and local review.\n\nUse these prompts in the **main chat opened in this repository**. It coordinates the specialists;\nyou do not need to switch agents for each step. Natural-language prompts work without a slash\ncommand. Names such as `create-component` refer to existing skills, not new commands.\n\nReplace the values in `[brackets]` and attach relevant files, screenshots, issue links or logs.\nRemove anything that does not apply; never paste credentials or private data into a prompt.\n\n## Choose your task\n\n| I want to… | Start here | Skill or role |\n| --- | --- | --- |\n| Choose what to build next | [Explore the backlog](#explore-the-backlog) | `component-status`, `researcher` |\n| Create a component | [Create from a need](#create-from-a-need) | `create-component` |\n| Use a Figma design | [Create from a design](#create-from-a-design) | `component-from-design` |\n| Copy a palette or imitate another project | [Use a reference](#use-a-reference) | `use-reference` |\n| Add a feature or change an API | [Extend behavior](#extend-behavior) | `modify-component` |\n| Polish an existing component | [Improve appearance](#improve-appearance) | `modify-component`, `design-system` |\n| Fix an error | [Reproduce and fix a bug](#reproduce-and-fix-a-bug) | `modify-component`, `test-engineer` |\n| Fix a platform-specific difference | [Restore platform parity](#restore-platform-parity) | Framework/native specialist |\n| Improve examples or controls | [Update documentation and demos](#update-documentation-and-demos) | `add-playground`, `docs-writer` |\n| Check quality without edits | [Review without changing files](#review-without-changing-files) | `reviewer`, `test-engineer` |\n| Cover a missing behavior with tests | [Add focused tests](#add-focused-tests) | `add-contract-tests` |\n| Add a theme, token or chart | [Other library work](#other-library-work) | `add-theme`, `add-token`, `create-chart` |\n| Review and deliver the result | [Continue the conversation](#continue-the-conversation) | `finish-work`, `open-pr` |\n| Prepare or verify a release | [Release and maintenance](#release-and-maintenance) | `release-pr`, `release`, `sync-after-merge` |\n| Update dependencies or fix a vulnerability | [Keep dependencies up to date](#keep-dependencies-up-to-date) | `upgrade-stack`, `devops` |\n\n### What every implementation includes\n\nThe [component workflow](https://github.com/joralvmel/cosmos-ui/blob/develop/docs/conventions/component-workflow.md)\nalready requires research-led scope approval for new behavior, contract/platform parity,\nappropriate tests, EN/ES docs, AI references and changesets for changed publishable packages.\nAn exact bug fix within the accepted contract does not need another feature interview.\n\nImplementation ends with a validated **local commit and a pause**. Neither the initial prompt nor\nscope approval authorizes push, PR, merge or release. Read-only research/review does not authorize\nedits or commits. If a browser, device or tool is unavailable, the agent must report it rather than\ncall the check passed.\n\n## Start a component\n\n### Explore the backlog\n\nUse this when you want advice, not implementation yet.\n\n```text\nCheck the current component inventory and its dependencies. Recommend three candidates to build\nnext, ordered by usefulness, effort and what they unblock. Research the most promising candidate\nand distinguish required, recommended and optional features, with sources and platform differences.\nPresent the decisions I should make next. This is read-only: do not generate files, commit or push.\n```\n\n### Create from a need\n\nCopy this template and fill in the brackets. Leave out the optional lines you do not need. The\nagent researches and asks before deciding, so you do not have to know every feature up front.\n\n```text\nCreate the [component] component using create-component and ADR 0005. The goal is [user need]\nin web, React, Angular and React Native.\n[Optional: Use use-reference only for this component: imitate [behavior or style] from [path or\nlink]; the reference is read-only.]\n\nCheck the inventory and research first. Recommend a useful initial scope, then ask me about\nvariants, sizes, customization, content, accessibility and platform differences in small batches.\nExplain what should be included, excluded or deferred; wait for my approval before generation\nor contract edits.\n\nAfter approval, implement and validate the agreement end-to-end, including representative demo\ncontrols. Create a local commit, show its SHA and how to try it, then wait without push or PR.\n```\n\nNot sure which component? Start with [Explore the backlog](#explore-the-backlog).\n\n### Create from a design\n\nA screenshot does not specify keyboard behavior, state ownership or all native interactions.\n\n```text\nUse component-from-design for [component] with this reference: [Figma frame link or screenshot].\nThe intended use is [user need]. Check whether an existing component already solves it.\n\nResearch the interaction pattern and map the design to current tokens. Show what the reference\ndefines, what is missing and which platform differences need a decision. Ask me before choosing\nunseen behavior or adding tokens/dependencies. Wait for scope/design approval, then complete the\naccepted component on every applicable platform. Validate, commit locally and pause for my review.\n```\n\n## Use a reference\n\nCosmos owns its components: another project is **evidence for one decision at a time**, never a\nlibrary to port. The [reference convention](https://github.com/joralvmel/cosmos-ui/blob/develop/docs/conventions/reference-projects.md)\nkeeps sources read-only and their identity out of the repository. `use-reference` has three modes.\n\n### Copy a palette into a theme\n\nYour own colors can be copied directly into a **new named theme**; the built-in themes stay as they are.\n\n```text\nUse use-reference in palette mode with [theme file of the other project]. Inspect it read-only.\nCreate a Cosmos theme named [name] with add-theme that keeps those colors in light and dark mode:\nbrand colors as seeds and the exact values per semantic role with mode overrides.\nShow the role mapping and the validation first. If a copied pair fails WCAG AA or the color-vision\nchecks, explain it and propose the nearest passing value; do not lower thresholds. Report what the\ntheme cannot express (fonts, spacing, motion). Wait for my approval, then implement, validate on\nweb and native, commit locally and pause without push or PR.\n```\n\n### Imitate a behavior or style in one component\n\nAdd the reference to a normal create or modify request; the Cosmos contract still decides the API.\n\n```text\nUse modify-component for [component]. As a reference, look read-only at [file, screenshot or link]:\nI want [the swipe-to-dismiss behavior / the compact density / the animation] it has.\nDescribe what the reference does (states, interaction, accessibility, platforms) and what Cosmos\nalready covers. Recommend how to bring that aspect into the current contract, ask the open\ndecisions and wait for my approval. Do not copy its props, code or text. After approval implement\non every platform, validate, commit locally and pause.\n```\n\n### Plan replacing an app's components with Cosmos\n\nRun this **in the app's repository**. Replace one component at a time in separate, authorized steps.\n\n```text\nUsing Cosmos's use-reference (replacement plan mode), plan how this app adopts Cosmos.\nInspect the app read-only: installed versions, providers, theme, imports and the UI components it\ndefines. List each one with its Cosmos equivalent (stable, in progress, planned or absent), the\ngaps and a replacement order with acceptance checks and rollback.\nMissing capabilities become Cosmos requests, not app code inside Cosmos. Do not edit the app,\ninstall packages, commit or push. Ask me which first replacement to implement.\n```\n\n## Evolve an existing component\n\n### Extend behavior\n\nDescribe the user outcome before prescribing a prop name. If the capability already exists,\nthe agent should explain how to use it instead of creating another API.\n\n```text\nUse modify-component for [component]. I need users to be able to [desired outcome].\nExample scenario: [input, interaction and expected result].\n\nCheck the current API, scenarios and docs first. If this is already supported, show me how and\ndo not make unnecessary changes. Otherwise research alternatives, recommend an API and explain\ncompatibility, accessibility and web/native trade-offs. Ask me to approve the scope before edits.\nAfter approval, update the contract, affected platforms, controls, tests and docs. State the\nversioning impact and add the required changeset. Commit locally and wait without push or PR.\n```\n\n### Improve appearance\n\nSeparate a visual adjustment from a new public customization API.\n\n```text\nPolish the appearance of [component]. Current issue: [what looks wrong].\nDesired result: [description or attached reference]. Keep its existing behavior and public API.\n\nInspect the current tokens and styling hooks; propose the smallest coherent adjustment. If it\nrequires a new prop, token, dependency or behavior, explain it and ask before expanding the scope.\nCheck light/dark, at least two themes, narrow/wide layouts and relevant focus/disabled states\nin the affected web and native demos. Update visual examples as needed, validate and create\na new local review commit. Do not push.\n```\n\n### Plan a breaking change\n\n```text\nI am considering changing [current API] to [desired API] in [component].\nResearch the alternatives and report affected consumers/platforms, migration steps, versioning\nimpact and a compatible option if one exists. Do not edit files yet. Ask me to choose the approach\nbefore implementing a breaking change.\n```\n\n## Diagnose and fix\n\n### Reproduce and fix a bug\n\nGive observable facts; a suspected cause is a hypothesis, not a constraint on the fix.\n\n```text\nFix this bug in [component] without redesigning its API.\nEnvironment: [framework/platform, relevant versions, browser or device].\nReproduction: [minimal numbered steps or attached example].\nExpected: [observable behavior].\nActual: [observable behavior and relevant error/log].\nFrequency: [always, intermittent or known conditions].\n\nReproduce it first and find the root cause. If you cannot reproduce it, explain the missing\ninformation rather than guessing. Add a focused regression that fails before the fix and passes\nafter it, preserve existing behavior and check the affected platform integration/console.\nIf the fix requires an API or scope change, ask first. Validate, commit locally and show me\nthe evidence and retry steps. Wait without push or PR.\n```\n\n### Restore platform parity\n\n```text\n[Component] behaves differently between [platform A] and [platform B].\nThe shared contract says [expected rule]. Reproduce using [steps or example].\n\nCompare both implementations and their wrapper/event integration. Fix the platform-specific\ncause without duplicating behavior in adapters. If the difference is intentional or the contract\ndoes not resolve it, explain the options and ask me before changing it. Test the affected\nintegration, controls and console. Separate React Native Web, mocked tests, native builds and\nactual device results; disclose unavailable environments. Commit locally and pause for review.\n```\n\n## Improve evidence and examples\n\n### Update documentation and demos\n\n```text\nImprove the docs and demos for [component] without adding new component behavior.\nUse case to explain: [user task]. Missing or confusing examples/controls: [observations].\n\nCheck the real contract first. Keep generated API tables/snippets tied to it; show normal use,\nrelevant states, customization and limitations rather than only the default appearance.\nUpdate EN/ES pages and applicable Playground/native demo controls. Try the examples and controls\nin the available environments, checking keyboard, state changes and console diagnostics.\nReport any contract/control gap instead of silently inventing an API. Validate the affected\nfiles, create a local commit and wait for my review.\n```\n\n### Review without changing files\n\n```text\nUse reviewer to inspect [component or current branch] against develop and the accepted scope.\nFocus on correctness, accessibility, API/platform parity, representative controls, bundle impact\nand missing runtime evidence. Report only actionable, high-confidence findings with file locations,\nseverity and reproduction steps where possible. Separate actual failures from unavailable checks.\nDo not edit files, commit, push or open a PR.\n```\n\nFor an accessibility-focused review, add the relevant keyboard, labeling, focus, motion or\nscreen-reader scenario. Automated checks alone do not prove accessibility.\n\n### Add focused tests\n\n```text\nAdd focused coverage for [component] using add-contract-tests where applicable.\nMissing behavior: [scenario and expected result from the accepted contract].\nCover relevant platform integration and edge cases, not implementation details or trivial getters.\nDo not change the API or chase a coverage percentage. If the tests expose a behavior bug, report it\nand agree the fix scope before expanding this task. Run the tests and required checks, distinguish\nmocks from runtime evidence, commit locally and pause without push or PR.\n```\n\n## Other library work\n\n### Add a theme or token\n\n```text\nUse design-system with add-theme/add-token as appropriate. I need [visual goal and affected uses].\nFirst check whether current themes/tokens already solve it. Recommend options for light/dark,\nsemantic roles, web/native parity and accessibility; ask me before adding public tokens or choosing\nthe design. After approval, use the generator for a new theme, validate contrast without lowering\nthresholds, update galleries/docs and add the required changeset. Commit locally and pause for review.\n```\n\n### Create a chart\n\n```text\nCreate [chart type] using create-chart for [data shape and user question].\nResearch accessible representations, interactions, data limits and web/native trade-offs first.\nRecommend an initial scope and ask me about axes, labels, empty/error states, customization,\nalternative text/table and any interaction before generation.\nAfter approval, implement the pure shared layout and applicable renderers, examples and tests.\nReport bundle costs and actual runtime evidence separately from builds. Commit locally and wait\nwithout push or PR.\n```\n\n## Release and maintenance\n\nA work PR goes to `develop`; releasing is a separate decision. The usual flow is\n`develop → main` (merge commit), then the generated **Version Packages** PR, then publication.\n`release-pr` decides which kind of release fits the current state (none, snapshot, patch/minor or\nmajor) and explains why; you approve before anything is opened or published.\nSee [release and publishing](../publishing/) for setup and commands. These prompts do not authorize\nautomatic merges, changes to publishing permissions, or a release while work is still unmerged.\n\n### Plan the next release\n\nUse this for advice only. To have the agent do the preparation, use the next prompt instead.\n\n```text\nUse release-pr to recommend the next release. This is read-only.\nCheck the remote state, merged work, CI, pending changesets and uncovered dependency updates\nagainst origin/main. Decide which kind of release fits (none, snapshot, patch/minor or major) and\nexplain why, with affected packages, resulting versions, migration notes and missing evidence.\nDo not change versions/changelogs, dispatch workflows, open or merge PRs, push tags or publish.\n```\n\n### Prepare and open the release PR\n\nThis includes local prerequisite repairs, not automatic publication. If no repair is needed,\nthe agent opens the release PR directly. Otherwise it prepares the repair and pauses at the\nlocal review gate; after acceptance and the prerequisite PR's approved merge, it resumes.\n\n```text\nPrepare the next release using release-pr, recommending the appropriate type from the current\nrepository state. I authorize opening/reusing the release PR once its prerequisites are met.\nVerify identity, fresh remote state, exact-SHA checks, changesets, dependency coverage and ancestry.\nIf synchronization, a dependency changeset or conflict repair is needed, prepare it on a dedicated\nwork branch, resolve only evidence-backed conflicts, regenerate the lockfile through npm and\nvalidate. Create a local commit and pause for my review before pushing prerequisite changes.\nAsk only about unresolved semantic decisions; do not stop at merely listing conflicts.\nAfter I accept the commit, open/reuse the prerequisite PR. Explain the required merge method and\nwait for merge approval; once merged, recheck and resume the release preparation.\nUse merge commits for main/develop synchronization and release promotion, never squash.\nReport packages, resulting versions, migration notes, limitations and the exact next approval.\nDo not merge PRs, change versions/changelogs manually, dispatch publication or publish.\n```\n\n### Review Version Packages\n\n```text\nReview the generated Version Packages PR [URL] without editing or merging.\nCompare its versions, dependency updates and changelogs with the accepted changesets and current\nrelease history. Check CI and identify missing/unexpected packages, bumps or migration notes.\nExplain what merging it will publish and which approvals remain. Do not publish, dispatch workflows\nor alter generated files; report blockers and wait for my decision.\n```\n\n### Verify publication and try it as a consumer\n\n```text\nVerify the release [version or workflow URL] without changing the repository.\nCheck actual workflow results, npm versions/dist-tags and provenance, Git tags/GitHub Releases,\nand the docs deployment. Separate published, pending and failed packages; green CI alone is not\nproof that npm publication succeeded.\nGive exact install/version and smoke-test steps for [React/Angular/web/React Native] using published\npackages in an isolated consumer, not workspace links. Do not install or modify that consumer yet.\nReport remaining compatibility/runtime checks rather than claiming they passed.\n```\n\n### Diagnose a failed publication\n\n```text\nDiagnose the failed release [workflow URL and relevant error]. Inspect the run and package state\nread-only first. Identify the root cause and whether some packages/tags were already published.\nDo not blindly rerun, delete/reuse published versions, weaken permissions, change registry settings\nor expose credentials. Propose the smallest recovery and ask for approval before changes or retry.\nAny code fix needs validation, a new local review commit and a pause before push.\n```\n\n### Try a snapshot before releasing\n\n```text\nAssess a next-tag snapshot for [merged scope] using release. Check workflow inputs, current branch,\nCI and package state first. Explain the exact dispatch, expected versions/dist-tag and install\ncommands; distinguish snapshot publication from a latest release.\nDo not dispatch or publish until I explicitly approve that operation. Do not move latest or create\nrelease tags. Report unavailable checks and the cleanup/migration plan for test consumers.\n```\n\n### Synchronize after merge or release\n\n```text\nSynchronize after [merged work/release PR URL] using sync-after-merge.\nCheck identity, remote state and local changes first; preserve unrelated work and never force-push.\nConfirm the PR really merged before removing its work branch. If Version Packages left main ahead\nof develop, use a synchronization PR with a merge commit, never squash. Prepare evidence-backed\nconflict repairs on a dedicated branch, validate and commit locally, then pause before push.\nAsk about unresolved semantic decisions. Do not merge automatically or delete main/develop.\nReport final branch/HEAD and anything still pending. Do not start another component or release.\n```\n\n## Keep dependencies up to date\n\nDependabot opens weekly minor/patch pull requests into `develop`, CI classifies them and the\nscheduled workflows keep a **security** issue and a **dependency report** issue up to date. See\n[release and publishing](../publishing/#dependency-maintenance) for what is automatic.\n\n### Review a Dependabot pull request\n\n```text\nReview Dependabot PR [URL] read-only. Read the CI classification, the dependency review and the\nrelease notes of each update. Tell me whether it is development-only, a runtime update deferred\nto the release, or a change that needs a decision and a changeset (major, peer range, pinned stack).\nCheck the failed checks if any. Recommend merge, changes or upgrade-stack; do not merge or push.\n```\n\n### Upgrade the stack or a major dependency\n\n```text\nUse upgrade-stack for [TypeScript 6.1 / Expo SDK 59 / React 20 / the open dependency report].\nResearch the release notes, migration guides and compatibility matrix first, and tell me the\nconsumer impact and the Cosmos semver of each package. Wait for my approval before changing\nmanifests. Then upgrade with npm, migrate the code, update the pinned versions and Dependabot\nrules, validate every platform and add changesets with migration notes. Commit locally and pause.\n```\n\n### Fix a vulnerability\n\n```text\nInvestigate the security issue [URL or advisory]. Say whether it reaches consumers (runtime of a\npublished package), the apps or only development tooling, and whether a compatible fix exists.\nIf the fix is a patch, apply it with npm, add a patch changeset for affected packages, validate,\ncommit locally and pause. If it needs a major or the pinned stack, propose an upgrade-stack plan\nand wait. Never disable the audit or the dependency review to get green checks.\n```\n\n## Continue the conversation\n\nThese are **separate messages at the appropriate stage**, not lines to append to the initial prompt.\nReplace `[SHA]` with the exact commit presented for local review.\n\n### Accept the proposed scope\n\n```text\nI approve the scope you just summarized, including its exclusions and deferred checks.\nImplement that agreement and run the checks. If a meaningful API, design or dependency decision\nchanges, ask me again. Finish with a local commit and pause; this does not authorize push or PR.\n```\n\n### Request another iteration\n\n```text\nI tried commit [SHA]. Change [specific observation] to [expected result].\nKeep the rest of the accepted scope. Validate the adjustment, create a new commit on this work\nbranch without amending earlier commits, and wait for me to review the new SHA. Do not push yet.\n```\n\n### Push the accepted commit and open the PR\n\nUse this only after checking the implementation and its reported limitations.\n\n```text\nI approve the reviewed commit [SHA] and its disclosed limitations. Use open-pr to verify identity,\nunchanged HEAD and validation evidence, push it and open or update its PR to develop.\nReport the URL and actual check status. Do not merge or publish.\n```\n\n### Resume in another chat\n\n```text\nResume [task] on branch [branch] at commit [SHA]. Read the accepted design, current diff and\nvalidation evidence: [file locations or previous handoff].\nSummarize what is done, pending and unverified before continuing. Do not infer scope or push\napproval from this message; ask again if the previous agreement/evidence cannot be recovered.\n```\n\nFor the complete delivery process, see [Git workflow](../git-workflow/) and\n[release and publishing](../publishing/). Opening a work PR is not a request to create a release.\n"},{"slug":"contribute/publishing","title":"Release and publishing","markdown":"# Release and publishing\n\n> How Cosmos UI is versioned and published to npm, and the one-time setup for maintainers.\n\nCosmos UI uses [Changesets](https://github.com/changesets/changesets) for versions and changelogs and\npublishes to the public npm registry with\n[trusted publishing](https://docs.npmjs.com/trusted-publishers) (OIDC, no npm token) and\n[provenance](https://docs.npmjs.com/generating-provenance-statements).\n\n## How releases work\n\nFor copyable prompts covering release planning, PR review, verification, recovery and branch\nsynchronization, see [release and maintenance](../prompt-cookbook/#release-and-maintenance).\n\n1. Every pull request that changes `packages/*` adds a changeset (`npm run changeset`).\n2. When `develop` is ready, a maintainer runs `npm run deps:changeset` (patch changesets for\n runtime dependency updates merged from Dependabot), then opens the release pull request\n `develop → main` (skill `release-pr`) and merges it with a **merge commit**.\n3. On `main`, the `Release` workflow opens or updates the **Version Packages** pull request: it bumps\n versions and writes the changelogs.\n4. Merging **Version Packages** runs `changeset publish`: new versions go to npm with provenance, Git\n tags are pushed and a GitHub Release is created per package.\n5. The `Docs` workflow deploys the documentation site from `main`.\n6. Synchronize published `main` back into `develop` through a PR using a **merge commit**, never\n squash/rebase. Verify `git merge-base --is-ancestor origin/main origin/develop` succeeds after\n fetching. Matching files alone are not enough: preserving ancestry prevents repeated conflicts.\n\n`release-pr` distinguishes a read-only assessment from preparation. Preparation includes safe\nlocal repairs for synchronization, dependency changesets and conflicts, with validation and a\nlocal review commit before push. It resumes after prerequisite PRs merge; merge and publication\nstill need explicit approval. Use [the preparation prompt](../prompt-cookbook/#prepare-and-open-the-release-pr).\n\nPrereleases: run the `Release` workflow manually on `develop` (Actions → Release → Run workflow). It\npublishes a snapshot such as `0.2.0-next-20261110120000` with the dist-tag `next`:\n\n```bash\nnpm install @joralvmel/cosmos-react@next\n```\n\n## One-time setup (maintainers)\n\nThe skill `publish-setup` walks an agent through the same checklist.\n\n1. **npm account.** Create an account on [npmjs.com](https://www.npmjs.com/signup), verify the email\n and enable two-factor authentication (Account → Two-Factor Authentication, \"Authorization and\n writes\"). The scope `@joralvmel` is the account's user scope.\n\n2. **Check the packages.**\n\n ```bash\n npm ci\n npm run check-packs # builds, validates manifests and runs npm pack --dry-run\n npm run publish-order # dependencies first\n ```\n\n3. **First publication by hand.** Trusted publishing can only be configured for packages that exist.\n Publish the current version of every package once, in the order printed above:\n\n ```bash\n npm login\n cd packages/core && npm publish --access public --otp <code> && cd ../..\n # …repeat for each package in publish order\n ```\n\n The first version is a placeholder (`0.0.0`); you can mark it with\n `npm deprecate @joralvmel/cosmos-core@0.0.0 \"placeholder\"`.\n\n4. **Trusted publisher per package.** On npmjs.com open each package → Settings → Trusted Publisher →\n GitHub Actions and enter: owner `joralvmel`, repository `cosmos-ui`, workflow `release.yml`,\n environment `npm`. Then, under \"Publishing access\", choose\n \"Require two-factor authentication and disallow tokens\".\n\n5. **GitHub.** In the repository settings:\n - Environments → create `npm` (optionally with required reviewers).\n - Secrets and variables → Actions → Variables: `COSMOS_PUBLISH_ENABLED` = `true`.\n - For the docs site: Pages → Source \"GitHub Actions\" and the variable `COSMOS_DOCS_ENABLED` = `true`.\n\n6. **Verify** after the first automated release:\n\n ```bash\n npm view @joralvmel/cosmos-core versions dist-tags\n npm audit signatures # inside a project that installed the packages\n ```\n\n The package page on npmjs.com shows the provenance badge linking to the workflow run.\n\n## Dependency maintenance\n\n| What | Automation | Your part |\n| --- | --- | --- |\n| Minor/patch updates | Dependabot opens grouped PRs into `develop` every Monday (pinned stack: patches only) | Review and merge them |\n| Classification | CI (`Changeset present`) labels each update as development, runtime or needing a decision | Majors, peer ranges and the pinned stack need a changeset in the PR, usually through `upgrade-stack` |\n| Runtime updates | Deferred to the release; the release PR fails until they are covered | `npm run deps:changeset` on `develop` before `release-pr` |\n| New dependencies | `Dependency review` blocks high/critical vulnerabilities and licenses outside the allow list | Choose another package or discuss an exception |\n| Vulnerabilities | Dependabot alerts and security PRs; weekly `Security audit` keeps one `security` issue | Fix with a patch or plan an `upgrade-stack` |\n| Majors and pinned stack | Monthly `Dependency report` keeps one `dependencies` issue | Plan the upgrade with `upgrade-stack` |\n| Tooling auto-merge | Optional: with the variable `COSMOS_DEPENDABOT_AUTOMERGE` = `true`, minor/patch updates of development tooling merge themselves once checks pass | Nothing, or leave it off to review everything |\n\nRun the reports locally with `npm run deps:audit` and `npm run deps:outdated`. Merges made by the\nauto-merge use the workflow token, so they do not trigger workflows on `develop`; the next pull\nrequest or release runs the full checks. Prompts: [keep dependencies up to date](../prompt-cookbook/#keep-dependencies-up-to-date).\n\n## Troubleshooting\n\n| Symptom | Fix |\n| --- | --- |\n| Release promotion conflicts after an earlier synchronization | Check ancestry, not only file equality. Prepare a reviewed synchronization repair with `release-pr`; preserve published metadata and newer develop work, regenerate the lockfile with npm, and merge the synchronization with a merge commit. |\n| Synchronization merge commit is blocked by linear-history protection | Apply the reviewed `setup-repo` policy with maintainer approval. It allows merge commits while retaining PRs, required checks and force-push/deletion protections. Do not squash synchronization as a workaround. |\n| Release PR fails \"Released runtime dependency updates have changesets\" | Run `npm run deps:changeset` on a `develop` work branch and merge it before the release. |\n| Dependabot PR fails \"Classify dependency updates\" | It needs a decision: review it with `upgrade-stack` and add a changeset to the PR. |\n| `E404` / `ENEEDAUTH` on publish | The trusted publisher does not match: check owner, repository, workflow file name and environment. |\n| No \"Version Packages\" pull request | Allow GitHub Actions to create pull requests (`npm run setup-repo -- --apply` does it). |\n| Workflow skipped | `COSMOS_PUBLISH_ENABLED` is not `true`. |\n| `check-packs` fails | A manifest misses `publishConfig.access`, `files`, `exports`, `repository`, `license` or `llms.md`. |\n"},{"slug":"contribute/recipes","title":"Recipes","markdown":"# Recipes\n\n> Short guides to create a theme, add a token, build a component from Figma, change a component and create a chart.\n\nEach recipe names the skill that automates it (run it as a `/prompt` or ask its agent).\n\nFor ready-to-copy task requests, use the [prompt cookbook](../prompt-cookbook/).\nThese are technical recipes, not permission to skip research or scope approval: agree new\ncomponent/API/design decisions before generation or contract edits, following the\n[agent workflow](../working-with-agents/#research-decisions-and-local-review).\nImplementation ends at the local commit/review pause, not an automatic push or PR.\n\n## Create a theme — `add-theme`\n\n```bash\nnpm run generate -- theme aurora --seed \"oklch(0.58 0.14 165)\"\nnpx turbo run test build --filter=@joralvmel/cosmos-tokens...\n```\n\n1. Tune the definition in `packages/tokens/src/themes.ts`: seeds (OKLCH), `harmony`, neutral tint and\n `radius`. Add mode overrides only when unavoidable.\n2. The tokens tests check WCAG 2.2 AA and color vision deficiencies in light and dark. Never lower the\n thresholds; change the seeds instead.\n3. The theme appears in the theme gallery, the header picker, Tailwind (`theme-aurora:`) and\n `CosmosThemeProvider`.\n\n## Add a token — `add-token`\n\n1. Semantic color: add it to `semanticColors` (`packages/tokens/src/types.ts`), derive it in\n `generate.ts` and add contrast pairs in `validate.ts` when it carries text or UI.\n2. Base token (spacing, radius, motion…): add it to `base.ts`; map it in `toTailwindTheme` / `toNative`.\n3. Update the tokens and Tailwind tests, then `npm run llms`.\n\n## Component from Figma — `component-from-design`\n\n1. Share the Figma link of the frame (`?node-id=`) or a screenshot with the `design-system` agent.\n2. It extracts anatomy, variants and states and maps every value to existing tokens; a new token goes\n through `add-token`.\n3. After research and scope/design approval, `component-builder` runs the generator through\n `create-component`; `architect` finalizes the contract before platform behavior.\n\n## Change a component — `modify-component`\n\n1. `component-status` for the component and for any component it will use.\n2. Research new behavior and approve its scope first (exact fixes can reuse accepted decisions).\n Then update the contract and scenarios; decide the semver bump with `architect`.\n3. Update every platform, tests and docs; keep the anatomy (the structure test checks it).\n4. `npm run llms` and a changeset (`major` with a migration note when breaking).\n\n## Create a chart — `create-chart`\n\n```bash\nnpm run generate -- chart sparkline\n```\n\n1. Implement the pure layout in `packages/charts-core/src/sparkline-layout.ts` and test it without DOM.\n2. Render SVG in `packages/charts` and React Native in `packages/charts-native` with the same layout.\n3. Use theme chart colors (`--cosm-chart-1..8`), add a text description and a data table alternative.\n"},{"slug":"contribute/working-with-agents","title":"Working with agents","markdown":"# Working with agents\n\n> What each AI agent and skill of the repository does, how to use them in VS Code and what to ask.\n\nThe repository ships a team of specialized agents (`.github/agents/`) and step-by-step skills\n(`.github/skills/`, each with a prompt in `.github/prompts/`). They follow `AGENTS.md`, the rules in\n`.github/instructions/` and the [component anatomy](https://github.com/joralvmel/cosmos-ui/blob/develop/docs/conventions/component-anatomy.md).\n\n## How to use them in VS Code\n\n1. Open the repository in VS Code with GitHub Copilot and open the **Chat** view.\n2. **Agents**: pick one in the agent selector of the chat (for example `component-builder`), then\n describe the task. The agent loads its rules and uses its skills.\n3. **Prompts**: type `/` and the skill name, e.g. `/create-component`, `/component-status`,\n `/start-work`. The prompt asks for its inputs and runs the skill with the right agent.\n4. Attach context with `#` (a file, a folder or a Figma link) when it helps.\n\nOther assistants (Codex, Claude Code, Cursor…) read `AGENTS.md`; point them to a skill file, e.g.\n\"follow `.github/skills/create-component/SKILL.md` for `switch`\".\n\n## Research, decisions and local review\n\nFollow the [component workflow](https://github.com/joralvmel/cosmos-ui/blob/develop/docs/conventions/component-workflow.md).\nThe main chat coordinates specialists and keeps the conversation with you:\n\n1. The researcher compares standards and public implementations, with licenses, platform\n differences and costs. Its recommendation is not permission to implement everything.\n2. Copilot presents required, recommended and optional features, then asks small batches of\n design/API questions. You approve what is included, excluded or deferred **before generation\n or contract edits**. Examples do not silently become special cases or exclusive feature lists.\n3. Agents implement the accepted scope and run checks themselves. The evidence report distinguishes\n actual browser/wrapper checks, React Native Web, mocked tests, builds and Android/iOS runtime.\n Unavailable tools, devices and screen-reader checks must be reported, not marked passed.\n4. `finish-work` validates and automatically creates a **local commit**, reports its SHA and how\n to try it, then **waits without push or PR**. Request changes for another commit and review\n pause, or accept that exact commit to authorize `open-pr` to push and create/reuse the PR.\n\nAn initial request to implement and eventually open a PR is not approval of unseen changes.\nApproving the feature scope is different from accepting the implementation. A changed HEAD needs\nanother review; agents do not amend earlier commits by default.\n\nThe test and native agents include browser tools, and coordinating roles can delegate and ask\ninteractive questions. Availability still depends on your harness and enabled tools. The workflow\ndoes not bypass editor permissions or add a new GitHub approval requirement.\n\n## Agents\n\n| Agent | What it does | Skills |\n| --- | --- | --- |\n| `ai-tooling` | Maintains the AI tooling for consumers: MCP server, `cosmos init-ai`, consumer instructions and drift tests of llms.md against contracts. | `update-ai-references` |\n| `angular-expert` | Angular specialist: standalone proxy components, ControlValueAccessors for form controls, signals and zoneless apps, Angular examples. | `modify-component` |\n| `architect` | Owns architecture and patterns: package boundaries, component contracts in core, ADRs, new dependencies, performance, public API and breaking changes. Use before adding a component, a package, a dependency or changing a public API. | `write-adr`, `define-contract`, `component-status`, `research-reference`, `upgrade-stack` |\n| `chart-builder` | Builds charts: pure layout in charts-core, SVG rendering as Web Components, interaction and accessibility, and coordinates native rendering with native-expert. | `create-chart` |\n| `component-builder` | Builds or extends Cosmos web components end-to-end with the generator: contract, Lit Web Component, form association, React and Angular wrappers, React Native stub, tests and docs pages. Use for any \"create/add/extend a component\" task. | `component-status`, `create-component`, `modify-component` |\n| `design-system` | Design and layout specialist with deep color theory and visual accessibility knowledge: themes, palettes, light/dark modes, typography, spacing, motion, component anatomy and states, responsive layout, Tailwind theme and translation of Figma designs into tokens. | `design-component`, `component-from-design`, `use-reference`, `add-theme`, `add-token` |\n| `devops` | GitHub Actions, Turborepo caching, docs and demo deployments (GitHub Pages), Expo EAS, workflow security, SBOM and license reports. | `setup-ci`, `deploy-docs`, `publish-setup`, `upgrade-stack` |\n| `docs-writer` | Writes the English and Spanish documentation site, playgrounds, theme gallery, icon catalog, READMEs and the llms.md / llms.txt AI references. | `add-docs-page`, `add-playground` |\n| `github-ops` | Handles branches, commits, pull requests, issues, labels and GitHub releases. Verifies the collaborator identity (verify-identity) before any commit or push. | `verify-identity`, `start-work`, `commit`, `finish-work`, `sync-after-merge`, `open-pr` |\n| `native-expert` | React Native and Expo specialist: native components on the shared contracts and themes, gestures, mobile accessibility, native charts with charts-core and the Expo Router demo app. | `component-status`, `create-native-component`, `modify-component` |\n| `react-expert` | React specialist: React 19 custom elements and @lit/react wrappers, SSR/Next.js compatibility, React examples and the portfolio demo app. | `modify-component` |\n| `release-manager` | Owns Changesets, semantic versioning, changelogs, deprecations and npm publishing. | `add-changeset`, `release-pr`, `release`, `sync-after-merge`, `finish-work` |\n| `researcher` | Read-only researcher: studies specifications (WAI-ARIA APG, HTML, Open UI) and public libraries for a feature, compares behavior, accessibility, APIs and licenses, and recommends using a dependency or implementing it in Cosmos. | `research-reference`, `use-reference` |\n| `reviewer` | Read-only reviewer: conventions, contract parity across platforms, accessibility, security, blocked terms, third-party licenses and changesets. Use before merging. | — |\n| `test-engineer` | Test strategy owner: shared contract scenarios, drift tests, Playwright and axe accessibility checks, coverage and flaky tests. | `add-contract-tests` |\n\n## Skills\n\n| Skill (prompt) | Main agent | What it does |\n| --- | --- | --- |\n| `/add-changeset` | `release-manager` | Writes a Changesets release note for every publishable package changed in the branch. |\n| `/add-contract-tests` | `test-engineer` | Adds shared behavior scenarios to a contract and runs them on the web, React, Angular and React Native through drivers. |\n| `/add-docs-page` | `docs-writer` | Adds a documentation page in English and Spanish with Playground, examples per framework, API table and accessibility notes. |\n| `/add-playground` | `docs-writer` | Adds the interactive Playground to a component page: controls generated from the contract, code tabs for HTML, React, Angular and React Native, copy button, theme/mode pickers and the native demo link. |\n| `/add-theme` | `design-system` | Adds a theme with defineTheme (seeds, harmony, light/dark), validates contrast and color vision deficiencies, and shows it in the docs gallery and in React Native. |\n| `/add-token` | `design-system` | Adds a token to every output (CSS variables, Tailwind theme, React Native values, JSON) with tests. |\n| `/audit-a11y` | `test-engineer` | Audits accessibility on web and React Native: axe, keyboard, focus, screen readers, contrast and motion. |\n| `/commit` | `github-ops` | Creates a local Conventional Commit after identity and validation checks, then pauses for user review without pushing. Revisions use new commits, not amendments. |\n| `/component-from-design` | `design-system` | Turns a Figma URL (via Figma MCP), screenshot or image into a contract, a visual spec mapped to Cosmos tokens and a generated component. |\n| `/component-status` | `architect` | Reports the component inventory (npm run status), explains gaps and proposes or creates the next components according to their dependencies. Run it before creating, modifying or composing components. |\n| `/create-chart` | `chart-builder` | Creates a chart: pure layout in charts-core, SVG rendering on the web, React Native rendering, accessibility and docs. |\n| `/create-component` | `component-builder` | Creates a new Cosmos component end-to-end following docs/conventions/component-anatomy.md: contract and scenarios, Lit Web Component, React and Angular wrappers, React Native component and demo, tests, docs pages (EN/ES), llms.md and changeset. |\n| `/create-native-component` | `native-expert` | Creates a React Native component on a contract, core logic and tokens, with shared scenarios, drift test, demo screen and docs, following the component anatomy. |\n| `/define-contract` | `architect` | Creates or updates a component contract (props, events, states, slots, parts, keyboard, ARIA) and its shared scenarios in core, with the DOM/React/Angular/React Native mapping. |\n| `/deploy-docs` | `devops` | Deploys the docs site (and demos) to GitHub Pages once enabled. |\n| `/design-component` | `design-system` | Writes the visual spec of a component: anatomy, sizes, variants, states, tokens used, responsive behavior and light/dark notes, then styles it with tokens only. |\n| `/finish-work` | `github-ops` | Validates implementation work, automatically creates a local commit and pauses for user testing. Push and PR creation resume only after approval of the reviewed HEAD. |\n| `/modify-component` | `component-builder` | Changes the API or behavior of an existing component while keeping parity and the anatomy: contract → Lit → wrappers → React Native → scenarios → docs → llms.md → changeset. |\n| `/open-pr` | `github-ops` | After explicit acceptance of the current local review commit, pushes the branch and opens or updates its PR to develop. Without that approval, returns to local review. |\n| `/publish-setup` | `release-manager` | One-time checklist to start publishing to npm: npm account with 2FA, first manual publication in dependency order, trusted publishers, GitHub environment and variables, verification. |\n| `/release` | `release-manager` | Runs the release flow: release PR develop → main, the Changesets \"Version Packages\" PR, npm publish with provenance and GitHub Releases; also snapshot prereleases with the next dist-tag. |\n| `/release-pr` | `release-manager` | Recommends the release type (none, snapshot, patch/minor, major) and opens the release pull request develop → main with the summary of pending changesets. |\n| `/research-reference` | `researcher` | Researches specifications and public libraries for a feature, compares behavior, accessibility, APIs and licenses, and recommends a dependency or an own implementation. |\n| `/setup-ci` | `devops` | Creates or updates GitHub Actions workflows (CI, identity, release, docs) following the workflow rules. |\n| `/start-work` | `github-ops` | Starts a task: syncs develop, creates a work branch with a normalized name and optionally links it to an issue. |\n| `/sync-after-merge` | `github-ops` | After a pull request is merged: returns to develop, pulls with prune and deletes the local work branch. |\n| `/sync-icons` | `component-builder` | Updates the Lucide version, regenerates the icon definitions and catalog, and refreshes the license notice. |\n| `/update-ai-references` | `ai-tooling` | Keeps every AI reference in sync with the code: llms.md blocks (npm run llms), docs .md pages, /llms.txt, /llms-full.txt, the MCP server data and tools, and cosmos init-ai. |\n| `/upgrade-stack` | `devops` | Use when upgrading the pinned stack or a major dependency (TypeScript, React, Angular, Expo/React Native, Lit, Vitest, Astro...), fixing a vulnerability that needs more than a Dependabot patch, or acting on the monthly dependency report. Researches compatibility and migration guides, asks for approval, upgrades with npm, validates every platform and commits locally. |\n| `/use-reference` | `` | Use when another project should inform Cosmos: copy its color palette into a named Cosmos theme, imitate one behavior or style while creating or modifying a single Cosmos component, or plan replacing an app's own components with Cosmos one at a time. Sources stay read-only; never batch-create components from a reference. |\n| `/verify-identity` | `github-ops` | Checks the Git and GitHub identity before a commit or push. Enforces .local/git-identity.json when it exists; otherwise reports the current identity and asks for confirmation. |\n| `/write-adr` | `architect` | Writes an architecture decision record NNNN-title.md (context → decision → consequences). |\n\n## What to ask\n\n- **One task at a time**, with the outcome you expect: \"Create the `switch` component for all\n platforms\" rather than \"work on forms\".\n- **Give references**: an issue number, a Figma link, a pattern of the WAI-ARIA APG.\n- **Let them validate**: implementation work includes tests and\n `npx biome ci . && npx turbo run typecheck test build`. Research-only work returns sources, not\n invented test results. Ask for the evidence and unavailable checks.\n- **Review before merging**: ask `reviewer` for a review of the branch.\n\n## Copyable prompts\n\nThe [prompt cookbook](../prompt-cookbook/) organizes ready-to-copy examples by task:\n\n- [Create a component or start from Figma](../prompt-cookbook/#start-a-component).\n- [Extend behavior, polish visuals or plan an API change](../prompt-cookbook/#evolve-an-existing-component).\n- [Reproduce a bug or restore platform parity](../prompt-cookbook/#diagnose-and-fix).\n- [Improve docs, demos, tests or a read-only review](../prompt-cookbook/#improve-evidence-and-examples).\n- [Add themes, tokens or charts](../prompt-cookbook/#other-library-work).\n- [Accept scope, request revisions, approve a PR or resume a chat](../prompt-cookbook/#continue-the-conversation).\n\nUse the [end-to-end example](../example-switch/) to follow a whole component through delivery;\nthe [technical recipes](../recipes/) explain the implementation steps behind individual tasks.\n"},{"slug":"getting-started/installation","title":"Installation","markdown":"# Installation\n\n> Install Cosmos UI for the web, React, Angular, React Native and Tailwind CSS.\n\nCosmos UI is not published yet. Once released, packages are installed from npm. Each framework has a\ncomplete guide: [React](../../guides/react-vite/), [Next.js](../../guides/nextjs/),\n[Angular](../../guides/angular/), [HTML / CDN](../../guides/html-cdn/),\n[React Native](../../guides/react-native/) and [Tailwind CSS](../../guides/tailwind/). To let an AI\nassistant do it, see [Use with AI](../../ai/overview/).\n\n**Web Components**\n```bash\nnpm install @joralvmel/cosmos-elements @joralvmel/cosmos-tokens\n```\n\n```js\nimport '@joralvmel/cosmos-tokens/tokens.css';\nimport '@joralvmel/cosmos-elements/button';\n```\n\n**React**\n```bash\nnpm install @joralvmel/cosmos-react @joralvmel/cosmos-tokens\n```\n\n```tsx\nimport '@joralvmel/cosmos-tokens/tokens.css';\n\nexport const Save = () => <Button onPress={event => console.log(event.detail.source)}>Save</Button>;\n```\n\n**Angular**\n```bash\nnpm install @joralvmel/cosmos-angular @joralvmel/cosmos-tokens\n```\n\n```ts\n\n@Component({\n selector: 'app-save',\n imports: [CosmButtonComponent],\n template: `<cosm-button (press)=\"save()\">Save</cosm-button>`,\n})\nexport class SaveComponent {\n save() {}\n}\n```\n\n**React Native**\n```bash\nnpm install @joralvmel/cosmos-native\n```\n\n```tsx\n\nexport default function App() {\n return (\n <CosmosThemeProvider theme=\"nebula\" mode=\"system\">\n <Button onPress={({ source }) => console.log(source)}>Save</Button>\n </CosmosThemeProvider>\n );\n}\n```\n\n## Theme and mode\n\nSet the theme and mode on any element (usually `<html>`). `data-mode=\"system\"` follows the operating\nsystem; without `data-mode` the light mode is used.\n\n```html\n<html data-theme=\"nebula\" data-mode=\"system\"></html>\n```\n\n## Tailwind CSS v4 (optional)\n\n```css\n@import \"tailwindcss\";\n@import \"@joralvmel/cosmos-tailwind\";\n```\n\nUtilities such as `bg-primary`, `text-fg-muted`, `rounded-md`, `dark:bg-surface` or\n`theme-nebula:text-accent` use the Cosmos tokens.\n\n## Stay up to date\n\nCosmos packages are released together through Changesets; while versions are `0.x`, a **minor**\nrelease may contain breaking changes. Read the package changelogs (GitHub Releases) before\nupdating and follow their migration notes. To get update pull requests in your app, group the\nCosmos packages in its Dependabot configuration so they move together:\n\n```yaml\nversion: 2\nupdates:\n - package-ecosystem: npm\n directory: /\n schedule:\n interval: weekly\n groups:\n cosmos:\n patterns: ['@joralvmel/cosmos-*']\n```\n\n## Adopt Cosmos in an existing app\n\nReplace one component at a time and keep the old one until the new one passes your checks. An\nassistant can plan the order for you from the app's repository: see\n[plan replacing an app's components](../../contribute/prompt-cookbook/#plan-replacing-an-apps-components-with-cosmos).\nTo keep your current colors, create a [theme from your palette](../../theming/themes/#keep-an-existing-palette).\n"},{"slug":"getting-started/introduction","title":"Introduction","markdown":"# Introduction\n\n> What Cosmos UI is and how its packages fit together.\n\nCosmos UI is a design system that ships the same components to the web (Web Components, React,\nAngular) and to React Native. Each component is defined once as a **contract** in\n`@joralvmel/cosmos-core`; every platform implementation is tested against that contract and its shared\nbehavior scenarios.\n\n## Packages\n\n| Package | Purpose |\n| --- | --- |\n| `@joralvmel/cosmos-tokens` | Theme engine and design tokens (CSS variables, JSON, React Native values) |\n| `@joralvmel/cosmos-tailwind` | Tailwind CSS v4 theme mapped to the tokens |\n| `@joralvmel/cosmos-core` | Contracts, shared scenarios and headless logic |\n| `@joralvmel/cosmos-elements` | Web Components built with Lit |\n| `@joralvmel/cosmos-react` | React wrappers |\n| `@joralvmel/cosmos-angular` | Angular standalone components |\n| `@joralvmel/cosmos-native` | React Native components |\n\nCharts, icons, i18n, the MCP server and the CLI are in early development.\n\n## Principles\n\n- **Contracts first**: props, events, slots, keyboard support and ARIA roles are decided before code.\n- **Tokens only**: components are styled with `--cosm-*` variables, so every theme and mode works.\n- **Accessible by default**: WAI-ARIA patterns, visible focus, reduced motion and verified contrast.\n"},{"slug":"guides/angular","title":"Angular","markdown":"# Angular\n\n> Use Cosmos UI in Angular with standalone components, signals and forms.\n\n`@joralvmel/cosmos-angular` provides one standalone component per Web Component, with the same\nselector (`cosm-button`…). Inputs set element properties; outputs re-emit the original `CustomEvent`.\n\n## Setup\n\n```bash\nnpm install @joralvmel/cosmos-angular @joralvmel/cosmos-tokens\n```\n\n**Load the tokens** (`angular.json`)\n\n```json\n\"styles\": [\"node_modules/@joralvmel/cosmos-tokens/dist/tokens.css\", \"src/styles.css\"]\n```\n\n**Choose theme and mode** (`src/index.html`)\n\n```html\n<html data-theme=\"cosmos\" data-mode=\"system\">\n```\n\n**Import components** (`src/app/app.component.ts`)\n\n```ts\nimport { Component } from '@angular/core';\nimport { CosmButtonComponent } from '@joralvmel/cosmos-angular';\n\n@Component({\n selector: 'app-root',\n imports: [CosmButtonComponent],\n template: `<cosm-button (press)=\"save($event.detail.source)\">Save</cosm-button>`,\n})\nexport class AppComponent {\n save(source: string) {}\n}\n```\n\n- Components are standalone; import them individually or spread `COSMOS_COMPONENTS`.\n- Outputs re-emit the original CustomEvent: use `$event.detail`. Form controls provide ControlValueAccessors.\n\nGuide: https://joralvmel.github.io/cosmos-ui/guides/angular/\n\n## Inputs, outputs and signals\n\n```ts\n\n@Component({\n selector: 'app-save',\n imports: [CosmButtonComponent],\n template: `\n <cosm-button [loading]=\"saving()\" variant=\"soft\" (press)=\"save()\">Save</cosm-button>\n `,\n})\nexport class SaveComponent {\n readonly saving = signal(false);\n\n save() {\n this.saving.set(true);\n }\n}\n```\n\n- Boolean inputs accept attributes (`loading`, `fullWidth`) and bindings (`[loading]=\"saving()\"`).\n- Outputs use the contract names: `(press)`, `(valueChange)`, `(openChange)`… Read `$event.detail`.\n- The components work in zoneless applications.\n\n## Forms\n\n`<cosm-button type=\"submit\">` submits the surrounding `<form>`. Form controls (text field, checkbox…)\nship `ControlValueAccessor`s so they work with `formControlName` and `[(ngModel)]` as they become\navailable (see the [component status](../../components/status/)).\n\n## All components at once\n\n```ts\n\n@Component({ imports: [...COSMOS_COMPONENTS], template: '…' })\nexport class Page {}\n```\n"},{"slug":"guides/html-cdn","title":"HTML and CDN","markdown":"# HTML and CDN\n\n> Use Cosmos UI Web Components in plain HTML, from a CDN or with any bundler.\n\nThe Web Components of `@joralvmel/cosmos-elements` work in any page: no framework needed.\n\n## Setup\n\n**Load tokens and components from a CDN** (`index.html`)\n\n```html\n<!doctype html>\n<html lang=\"en\" data-theme=\"cosmos\" data-mode=\"system\">\n <head>\n <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/@joralvmel/cosmos-tokens/dist/tokens.css\" />\n <script type=\"module\" src=\"https://esm.sh/@joralvmel/cosmos-elements/button\"></script>\n </head>\n <body>\n <cosm-button variant=\"soft\">Save</cosm-button>\n <script type=\"module\">\n document.querySelector('cosm-button').addEventListener('cosm-press', event => {\n console.log(event.detail.source);\n });\n </script>\n </body>\n</html>\n```\n\n- With a bundler, `npm install @joralvmel/cosmos-elements @joralvmel/cosmos-tokens` and import `@joralvmel/cosmos-elements/<component>`.\n- DOM events are `cosm-*` CustomEvents that bubble and cross shadow roots.\n\nGuide: https://joralvmel.github.io/cosmos-ui/guides/html-cdn/\n\n## With a bundler\n\n```bash\nnpm install @joralvmel/cosmos-elements @joralvmel/cosmos-tokens\n```\n\n```js\nimport '@joralvmel/cosmos-tokens/tokens.css';\nimport '@joralvmel/cosmos-elements/button'; // one import per component\n```\n\n## Properties, attributes and events\n\n- Styling props are attributes in kebab-case (`full-width`, `variant=\"soft\"`); every prop is also a\n JavaScript property (`button.fullWidth = true`).\n- Events are `cosm-*` `CustomEvent`s that bubble and cross shadow roots, so you can listen on a parent.\n- Theme hooks: `--cosm-<component>-*` custom properties and `::part()` selectors (see each component API).\n\n```html\n<form>\n <cosm-button type=\"submit\">Send</cosm-button>\n</form>\n<script type=\"module\">\n document.addEventListener('cosm-press', event => console.log(event.target, event.detail));\n</script>\n```\n\n## Switching theme and mode\n\n```html\n<script type=\"module\">\n setTheme('nebula');\n setMode('dark');\n</script>\n```\n"},{"slug":"guides/nextjs","title":"Next.js","markdown":"# Next.js\n\n> Use Cosmos UI with the Next.js App Router, Server and Client Components.\n\nCosmos components are Web Components wrapped for React. They work with the App Router as long as they\nare rendered from **Client Components**.\n\n## Setup\n\n```bash\nnpm install @joralvmel/cosmos-react @joralvmel/cosmos-tokens\n```\n\n**Load the tokens and avoid a theme flash** (`app/layout.tsx`)\n\n```tsx\nimport '@joralvmel/cosmos-tokens/tokens.css';\nimport { themeInitScript } from '@joralvmel/cosmos-tokens/runtime';\nimport Script from 'next/script';\n\nexport default function RootLayout({ children }: { children: React.ReactNode }) {\n return (\n <html lang=\"en\" data-theme=\"cosmos\" data-mode=\"system\" suppressHydrationWarning>\n <body>\n <Script id=\"cosmos-theme\" strategy=\"beforeInteractive\">\n {themeInitScript()}\n </Script>\n {children}\n </body>\n </html>\n );\n}\n```\n\n**Use components in Client Components** (`app/save-button.tsx`)\n\n```tsx\n'use client';\n\nimport { Button } from '@joralvmel/cosmos-react';\n\nexport function SaveButton() {\n return <Button onPress={() => console.log('saved')}>Save</Button>;\n}\n```\n\n- Cosmos components are Web Components: render them from Client Components (`'use client'`). Server Components can render the Client Component that wraps them.\n- The server HTML contains the custom element tag; it upgrades in the browser.\n\nGuide: https://joralvmel.github.io/cosmos-ui/guides/nextjs/\n\n## Server and Client Components\n\n- The wrappers set element properties and listen to events in effects, so the file that imports\n `@joralvmel/cosmos-react` must start with `'use client'`.\n- Server Components can render those Client Components and pass serializable props (strings,\n numbers, booleans). Handlers stay inside the Client Component.\n- The server HTML contains the custom element tag and its text; the element upgrades in the browser.\n\n```tsx\n// app/page.tsx (Server Component)\n\nexport default function Page() {\n return <SaveButton />;\n}\n```\n\n## Avoiding a theme flash\n\n`themeInitScript()` returns a small, validated inline script that restores the theme and mode stored by\n`setTheme()` / `setMode()` before the first paint. Load it with `next/script` and\n`strategy=\"beforeInteractive\"` as shown above, and keep `suppressHydrationWarning` on `<html>` because\nthe script may change `data-theme` / `data-mode` before hydration.\n\n## Tailwind\n\nUse `@tailwindcss/postcss` with the [Cosmos Tailwind theme](../tailwind/).\n"},{"slug":"guides/react-native","title":"React Native and Expo","markdown":"# React Native and Expo\n\n> Use Cosmos UI components and themes in React Native apps with Expo.\n\n`@joralvmel/cosmos-native` implements the same component contracts with React Native primitives and\nuses the same themes as the web.\n\n## Setup\n\n```bash\nnpx expo install @joralvmel/cosmos-native\n```\n\n**Provide a theme** (`app/_layout.tsx`)\n\n```tsx\nimport { CosmosThemeProvider } from '@joralvmel/cosmos-native';\nimport { Stack } from 'expo-router';\n\nexport default function Layout() {\n return (\n <CosmosThemeProvider theme=\"cosmos\" mode=\"system\">\n <Stack />\n </CosmosThemeProvider>\n );\n}\n```\n\n**Use components** (`app/index.tsx`)\n\n```tsx\nimport { Button } from '@joralvmel/cosmos-native';\n\nexport default function Home() {\n return <Button onPress={({ source }) => console.log(source)}>Save</Button>;\n}\n```\n\n- Callbacks receive the event detail directly (`onPress(detail)`).\n- `useTheme()` returns colors, spacing, radius and typography as numbers for your own styles.\n\nGuide: https://joralvmel.github.io/cosmos-ui/guides/react-native/\n\n## Theme and mode\n\n`CosmosThemeProvider` accepts `theme` (`cosmos`, `nebula`…) and `mode` (`light`, `dark` or `system`,\nwhich follows the device appearance).\n\n## Your own styles with the theme\n\n```tsx\n\nexport function Card({ title }: { title: string }) {\n const theme = useTheme();\n return (\n <View style={{ backgroundColor: theme.colors.surface, borderRadius: theme.radius.lg, padding: theme.space.lg }}>\n <Text style={{ color: theme.colors.fg, fontSize: theme.text.lg }}>{title}</Text>\n </View>\n );\n}\n```\n\n## Accessibility\n\nComponents set `accessibilityRole`, `accessibilityState` and labels, and small controls extend their\ntouch area to 44 points. Test with TalkBack and VoiceOver.\n\n## Demo app\n\nThe repository includes an Expo Router app with a screen per component: see\n[Contribute → Getting started](../../contribute/getting-started/#native-demo).\n"},{"slug":"guides/react-vite","title":"React (Vite)","markdown":"# React (Vite)\n\n> Use Cosmos UI in a React 19 app built with Vite.\n\n`@joralvmel/cosmos-react` wraps the Cosmos Web Components for React 19. Props are set as element\nproperties and event props receive the original `CustomEvent`.\n\n## Setup\n\n```bash\nnpm install @joralvmel/cosmos-react @joralvmel/cosmos-tokens\n```\n\n**Load the tokens once** (`src/main.tsx`)\n\n```tsx\nimport '@joralvmel/cosmos-tokens/tokens.css';\n```\n\n**Choose theme and mode** (`index.html`)\n\n```html\n<html data-theme=\"cosmos\" data-mode=\"system\">\n```\n\n**Use components** (`src/App.tsx`)\n\n```tsx\nimport { Button } from '@joralvmel/cosmos-react';\n\nexport default function App() {\n return <Button onPress={event => console.log(event.detail.source)}>Save</Button>;\n}\n```\n\n- Event props (`onPress`, `onChange`…) receive the original CustomEvent: read `event.detail`.\n- Change theme and mode at runtime with `setTheme()` / `setMode()` from `@joralvmel/cosmos-tokens/runtime`.\n\nGuide: https://joralvmel.github.io/cosmos-ui/guides/react-vite/\n\n## Events\n\nEvent props follow the contract names (`onPress`, `onChange`, `onOpenChange`…). Read the payload from\n`event.detail`; its type is exported by `@joralvmel/cosmos-core`.\n\n```tsx\n\nfunction Save() {\n const onPress = (event: CustomEvent<ButtonPressDetail>) => console.log(event.detail.source);\n return <Button onPress={onPress}>Save</Button>;\n}\n```\n\n## Controlled and uncontrolled state\n\nStateful components (value, open, selected tab…) work uncontrolled by default. Pass the state prop to\ncontrol it: the component then proposes changes through its event and waits for your new prop value\n([ADR 0003](https://github.com/joralvmel/cosmos-ui/blob/develop/docs/adr/0003-state-ownership-and-events.md)).\n\n## Switching theme and mode\n\n```tsx\n\nsetTheme('nebula');\nsetMode('dark'); // 'light' | 'dark' | 'system'\n```\n\nThe choice is stored in `localStorage`. To restore it before the first paint, add the script returned\nby `themeInitScript()` to `<head>` (see the [Next.js guide](../nextjs/)).\n\n## Next steps\n\n- Style your own UI with tokens or the [Tailwind theme](../tailwind/).\n- Browse the [components](../../components/status/) and their playgrounds.\n"},{"slug":"guides/tailwind","title":"Tailwind CSS","markdown":"# Tailwind CSS\n\n> Style your app with Tailwind CSS v4 utilities mapped to Cosmos tokens and themes.\n\n`@joralvmel/cosmos-tailwind` turns the Cosmos tokens into a Tailwind CSS v4 theme. Every utility follows\nthe active theme and mode, and Cosmos components keep working without Tailwind.\n\n## Setup\n\n```bash\nnpm install @joralvmel/cosmos-tailwind && npm install -D tailwindcss @tailwindcss/vite\n```\n\n**Import the Cosmos theme after Tailwind** (`src/styles.css`)\n\n```css\n@import \"tailwindcss\";\n@import \"@joralvmel/cosmos-tailwind\";\n```\n\n**Use token utilities**\n\n```html\n<div class=\"bg-surface text-fg rounded-lg shadow-md p-4 dark:bg-surface-raised\">\n <p class=\"text-fg-muted\">Uses Cosmos tokens in every theme and mode.</p>\n</div>\n```\n\n- Default Tailwind colors are disabled: use semantic colors (`bg-primary`, `text-danger-text`…).\n- `dark:` follows `data-mode` (including `system`); `theme-<name>:` targets one theme.\n\nGuide: https://joralvmel.github.io/cosmos-ui/guides/tailwind/\n\nPlugins: Vite uses `@tailwindcss/vite`; Next.js and Angular use `@tailwindcss/postcss`.\n\n## Utilities\n\n| Group | Examples |\n| --- | --- |\n| Colors | `bg-bg`, `bg-surface`, `text-fg`, `text-fg-muted`, `bg-primary text-primary-fg`, `bg-danger-subtle text-danger-text`, `border-border`, `ring-focus-ring` |\n| Scales | `bg-primary-3`, `text-neutral-11` (steps 1–12) |\n| Spacing | `p-4` (= 4 × `--cosm-space-unit`), `gap-sm`, `px-lg` |\n| Shape | `rounded-sm` … `rounded-xl`, `rounded-full`, `shadow-sm` / `shadow-md` / `shadow-lg` |\n| Typography | `text-xs` … `text-4xl`, `font-semibold`, `leading-tight` |\n\nDefault Tailwind colors (`bg-blue-500`…) are disabled so only theme colors are used.\n\n## Variants\n\n- `dark:` applies in dark mode, including `data-mode=\"system\"` when the OS is dark.\n- `theme-<name>:` targets one theme, e.g. `theme-nebula:rounded-none`.\n"},{"slug":"","title":"Cosmos UI","markdown":"# Cosmos UI\n\n> Themeable design system with Web Components, React, Angular and React Native built from one contract per component.\n\n### Contracts first\n Every component starts as a typed contract: props, events, slots, keyboard and ARIA. Web, React,\n Angular and React Native implementations are tested against it.\n### Themes you can generate\n Pick seed colors and a harmony; Cosmos builds light and dark palettes in OKLCH and verifies WCAG\n contrast and color vision deficiencies.\n### Tailwind friendly\n Utilities like `bg-primary` or `rounded-md` map to Cosmos tokens through a Tailwind CSS v4 theme.\n### AI ready\n Machine-readable references (`llms.txt`) and an MCP server keep assistants aligned with the real API.\n"},{"slug":"theming/themes","title":"Themes","markdown":"# Themes\n\n> Built-in Cosmos themes in light and dark mode, with their accessibility report.\n\nEach theme is generated from seed colors and a color harmony with `defineTheme`. The engine builds\n12-step OKLCH scales, a dark mode with its own lightness curve, status colors that keep their meaning and\nan 8-color chart palette. Every theme is validated against WCAG 2.2 AA (normative), APCA (informative)\nand simulated protanopia, deuteranopia and tritanopia.\n\n- **Cosmos** (`data-theme=\"cosmos\"`), light and dark.\n- **Nebula** (`data-theme=\"nebula\"`), light and dark.\n\n## Create a theme\n\n```ts\n\nconst aurora = defineTheme({\n name: 'aurora',\n seeds: { primary: 'oklch(0.56 0.15 165)' },\n harmony: 'triadic',\n radius: 'pill',\n});\n\nconst resolved = resolveTheme(aurora);\nconsole.log(validateTheme(resolved).pass);\nconst css = toCss([resolved]);\n```\n\nTheme names cannot be `light`, `dark` or `system`; those are mode names.\n\n## Keep an existing palette\n\nTo reuse the colors of an existing product, use them as seeds and set the exact values per\nsemantic role and mode. `validateTheme` still checks every pair; when one fails, adjust that value\ninstead of lowering the requirement.\n\n```ts\nconst brand = defineTheme({\n name: 'brand',\n seeds: { primary: '#2f6fed', accent: '#f59e0b' },\n modes: {\n light: { primary: '#2f6fed', bg: '#ffffff', surface: '#f6f7f9', fg: '#111827' },\n dark: { primary: '#7aa2ff', bg: '#0b1020', surface: '#151b2e', fg: '#e5e7eb' },\n },\n});\n\nconsole.log(validateTheme(resolveTheme(brand)).pass);\n```\n\nTypography, spacing and motion are not theme inputs. To have an assistant map a palette for you,\nsee [use a reference](../../contribute/prompt-cookbook/#use-a-reference).\n"}]
|
|
@@ -80,6 +80,36 @@ export class ExampleComponent {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
```
|
|
83
|
+
### `CosmIconComponent` (`<cosm-icon>`)
|
|
84
|
+
|
|
85
|
+
Renders a structured SVG icon. Decorative icons are hidden from assistive technology; informative icons require a text label.
|
|
86
|
+
|
|
87
|
+
| Prop | Type | Default | Description |
|
|
88
|
+
| --- | --- | --- | --- |
|
|
89
|
+
| `icon` | IconDefinition | Required | Structured icon definition, commonly imported from @joralvmel/cosmos-icons. |
|
|
90
|
+
| `size` | 'sm' \| 'md' \| 'lg' \| number | `md` | Semantic size (16, 20 or 24) or a positive finite number in pixels / native units. |
|
|
91
|
+
| `stroke` | string | `currentColor` | Stroke paint; currentColor inherits on web and resolves to the theme foreground on native. |
|
|
92
|
+
| `fill` | string | `none` | Root fill paint. Explicit node fills take precedence. |
|
|
93
|
+
| `strokeWidth` | number | `2` | Finite nonnegative stroke width in SVG viewBox units. |
|
|
94
|
+
| `label` | string | — | Accessible name required when decorative is false. |
|
|
95
|
+
| `decorative` | boolean | `true` | Hides the icon from assistive technology when true. |
|
|
96
|
+
|
|
97
|
+
Events: none.
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
import { Component } from '@angular/core';
|
|
101
|
+
import { CosmIconComponent } from '@joralvmel/cosmos-angular';
|
|
102
|
+
import { house } from '@joralvmel/cosmos-icons/house';
|
|
103
|
+
|
|
104
|
+
@Component({
|
|
105
|
+
selector: 'app-example',
|
|
106
|
+
imports: [CosmIconComponent],
|
|
107
|
+
template: `<cosm-icon [icon]="house"></cosm-icon>`,
|
|
108
|
+
})
|
|
109
|
+
export class ExampleComponent {
|
|
110
|
+
readonly house = house;
|
|
111
|
+
}
|
|
112
|
+
```
|
|
83
113
|
|
|
84
114
|
## Themes
|
|
85
115
|
|
package/dist/data/llms/core.md
CHANGED
|
@@ -65,6 +65,36 @@ Triggers an action or submits a form.
|
|
|
65
65
|
| --- | --- |
|
|
66
66
|
| `Enter`, `Space` | Activates the button. |
|
|
67
67
|
|
|
68
|
+
### `icon` (`<cosm-icon>`)
|
|
69
|
+
|
|
70
|
+
Renders a structured SVG icon. Decorative icons are hidden from assistive technology; informative icons require a text label.
|
|
71
|
+
|
|
72
|
+
| Prop | Type | Default | Description |
|
|
73
|
+
| --- | --- | --- | --- |
|
|
74
|
+
| `icon` | IconDefinition | Required | Structured icon definition, commonly imported from @joralvmel/cosmos-icons. |
|
|
75
|
+
| `size` | 'sm' \| 'md' \| 'lg' \| number | `md` | Semantic size (16, 20 or 24) or a positive finite number in pixels / native units. |
|
|
76
|
+
| `stroke` | string | `currentColor` | Stroke paint; currentColor inherits on web and resolves to the theme foreground on native. |
|
|
77
|
+
| `fill` | string | `none` | Root fill paint. Explicit node fills take precedence. |
|
|
78
|
+
| `strokeWidth` | number | `2` | Finite nonnegative stroke width in SVG viewBox units. |
|
|
79
|
+
| `label` | string | — | Accessible name required when decorative is false. |
|
|
80
|
+
| `decorative` | boolean | `true` | Hides the icon from assistive technology when true. |
|
|
81
|
+
|
|
82
|
+
**Events**
|
|
83
|
+
|
|
84
|
+
No events.
|
|
85
|
+
|
|
86
|
+
**CSS parts**
|
|
87
|
+
|
|
88
|
+
| Name | Description |
|
|
89
|
+
| --- | --- |
|
|
90
|
+
| `icon` | Rendered SVG image. |
|
|
91
|
+
|
|
92
|
+
**CSS custom properties**
|
|
93
|
+
|
|
94
|
+
| Name | Description |
|
|
95
|
+
| --- | --- |
|
|
96
|
+
| `--cosm-icon-size` | Override the rendered icon width and height. |
|
|
97
|
+
|
|
68
98
|
|
|
69
99
|
## Rules for AI assistants
|
|
70
100
|
|
|
@@ -62,6 +62,33 @@ Events: `cosm-press` → `ButtonPressDetail`.
|
|
|
62
62
|
element.addEventListener('cosm-press', event => console.log(event.detail));
|
|
63
63
|
</script>
|
|
64
64
|
```
|
|
65
|
+
### `<cosm-icon>`
|
|
66
|
+
|
|
67
|
+
Renders a structured SVG icon. Decorative icons are hidden from assistive technology; informative icons require a text label.
|
|
68
|
+
|
|
69
|
+
| Prop | Type | Default | Description |
|
|
70
|
+
| --- | --- | --- | --- |
|
|
71
|
+
| `icon` | IconDefinition | Required | Structured icon definition, commonly imported from @joralvmel/cosmos-icons. |
|
|
72
|
+
| `size` | 'sm' \| 'md' \| 'lg' \| number | `md` | Semantic size (16, 20 or 24) or a positive finite number in pixels / native units. |
|
|
73
|
+
| `stroke` | string | `currentColor` | Stroke paint; currentColor inherits on web and resolves to the theme foreground on native. |
|
|
74
|
+
| `fill` | string | `none` | Root fill paint. Explicit node fills take precedence. |
|
|
75
|
+
| `strokeWidth` (`stroke-width`) | number | `2` | Finite nonnegative stroke width in SVG viewBox units. |
|
|
76
|
+
| `label` | string | — | Accessible name required when decorative is false. |
|
|
77
|
+
| `decorative` | boolean | `true` | Hides the icon from assistive technology when true. |
|
|
78
|
+
|
|
79
|
+
Events: none.
|
|
80
|
+
|
|
81
|
+
```html
|
|
82
|
+
<cosm-icon></cosm-icon>
|
|
83
|
+
|
|
84
|
+
<script type="module">
|
|
85
|
+
import '@joralvmel/cosmos-elements/icon';
|
|
86
|
+
import { house } from '@joralvmel/cosmos-icons/house';
|
|
87
|
+
|
|
88
|
+
const element = document.querySelector('cosm-icon');
|
|
89
|
+
element.icon = house;
|
|
90
|
+
</script>
|
|
91
|
+
```
|
|
65
92
|
|
|
66
93
|
## Themes
|
|
67
94
|
|
package/dist/data/llms/icons.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# @joralvmel/cosmos-icons
|
|
2
2
|
|
|
3
3
|
Structured, framework-neutral icon definitions; validate untrusted data with `isIconDefinition()`.
|
|
4
|
+
Search metadata with `searchIconCatalog(iconCatalog, query)`; import artwork by individual icon path.
|
|
4
5
|
|
|
5
6
|
<!-- generated:start (npm run llms, do not edit this block by hand) -->
|
|
6
7
|
|
package/dist/data/llms/native.md
CHANGED
|
@@ -69,6 +69,32 @@ export function Example() {
|
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
71
|
```
|
|
72
|
+
### `Icon`
|
|
73
|
+
|
|
74
|
+
Renders a structured SVG icon. Decorative icons are hidden from assistive technology; informative icons require a text label.
|
|
75
|
+
|
|
76
|
+
| Prop | Type | Default | Description |
|
|
77
|
+
| --- | --- | --- | --- |
|
|
78
|
+
| `icon` | IconDefinition | Required | Structured icon definition, commonly imported from @joralvmel/cosmos-icons. |
|
|
79
|
+
| `size` | 'sm' \| 'md' \| 'lg' \| number | `md` | Semantic size (16, 20 or 24) or a positive finite number in pixels / native units. |
|
|
80
|
+
| `stroke` | string | `currentColor` | Stroke paint; currentColor inherits on web and resolves to the theme foreground on native. |
|
|
81
|
+
| `fill` | string | `none` | Root fill paint. Explicit node fills take precedence. |
|
|
82
|
+
| `strokeWidth` | number | `2` | Finite nonnegative stroke width in SVG viewBox units. |
|
|
83
|
+
| `label` | string | — | Accessible name required when decorative is false. |
|
|
84
|
+
| `decorative` | boolean | `true` | Hides the icon from assistive technology when true. |
|
|
85
|
+
|
|
86
|
+
Events: none.
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
import { Icon } from '@joralvmel/cosmos-native';
|
|
90
|
+
import { house } from '@joralvmel/cosmos-icons/house';
|
|
91
|
+
|
|
92
|
+
export function Example() {
|
|
93
|
+
return (
|
|
94
|
+
<Icon icon={house}></Icon>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
```
|
|
72
98
|
|
|
73
99
|
## Themes
|
|
74
100
|
|
package/dist/data/llms/react.md
CHANGED
|
@@ -111,6 +111,32 @@ export function Example() {
|
|
|
111
111
|
);
|
|
112
112
|
}
|
|
113
113
|
```
|
|
114
|
+
### `Icon`
|
|
115
|
+
|
|
116
|
+
Renders a structured SVG icon. Decorative icons are hidden from assistive technology; informative icons require a text label.
|
|
117
|
+
|
|
118
|
+
| Prop | Type | Default | Description |
|
|
119
|
+
| --- | --- | --- | --- |
|
|
120
|
+
| `icon` | IconDefinition | Required | Structured icon definition, commonly imported from @joralvmel/cosmos-icons. |
|
|
121
|
+
| `size` | 'sm' \| 'md' \| 'lg' \| number | `md` | Semantic size (16, 20 or 24) or a positive finite number in pixels / native units. |
|
|
122
|
+
| `stroke` | string | `currentColor` | Stroke paint; currentColor inherits on web and resolves to the theme foreground on native. |
|
|
123
|
+
| `fill` | string | `none` | Root fill paint. Explicit node fills take precedence. |
|
|
124
|
+
| `strokeWidth` | number | `2` | Finite nonnegative stroke width in SVG viewBox units. |
|
|
125
|
+
| `label` | string | — | Accessible name required when decorative is false. |
|
|
126
|
+
| `decorative` | boolean | `true` | Hides the icon from assistive technology when true. |
|
|
127
|
+
|
|
128
|
+
Events: none.
|
|
129
|
+
|
|
130
|
+
```tsx
|
|
131
|
+
import { Icon } from '@joralvmel/cosmos-react';
|
|
132
|
+
import { house } from '@joralvmel/cosmos-icons/house';
|
|
133
|
+
|
|
134
|
+
export function Example() {
|
|
135
|
+
return (
|
|
136
|
+
<Icon icon={house}></Icon>
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
```
|
|
114
140
|
|
|
115
141
|
## Themes
|
|
116
142
|
|
package/dist/data/status.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"summary":{"total":38,"stable":1,"inProgress":0,"planned":37},"next":["icon","badge","avatar","divider","listbox"],"gaps":[{"name":"icon","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"badge","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"avatar","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"divider","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"listbox","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"calendar","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"text-field","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon"]},{"name":"textarea","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"checkbox","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon"]},{"name":"radio-group","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"switch","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"select","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover","listbox","icon"]},{"name":"combobox","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover","listbox","text-field"]},{"name":"multi-select","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover","listbox","badge","checkbox"]},{"name":"popover","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"tooltip","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover"]},{"name":"dialog","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon-button"]},{"name":"toast","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon","icon-button"]},{"name":"tabs","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"accordion","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon"]},{"name":"pagination","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon-button"]},{"name":"card","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"table","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["checkbox","pagination","icon-button"]},{"name":"date-picker","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover","calendar","text-field"]}],"components":[{"name":"button","title":"Button","category":"action","batch":"A","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/button/","target":"stable","claimed":"stable","notes":[],"status":"stable","pieces":{"contract":true,"scenarios":true,"web":true,"react":true,"angular":true,"native":true,"nativeDemo":true,"tests":true,"docsEn":true,"docsEs":true,"llms":true,"changeset":true},"todos":[],"missing":[],"blockedBy":[]},{"name":"icon","title":"Icon","category":"data-display","batch":"A","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA24","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"icon-button","title":"Icon button","category":"action","batch":"A","priority":2,"platforms":["web","react","angular","native"],"dependsOn":["button","icon"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/button/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon"]},{"name":"badge","title":"Badge","category":"data-display","batch":"A","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://html.spec.whatwg.org/multipage/text-level-semantics.html","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"spinner","title":"Spinner","category":"feedback","batch":"A","priority":2,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/meter/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"avatar","title":"Avatar","category":"data-display","batch":"A","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://html.spec.whatwg.org/multipage/embedded-content.html","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"divider","title":"Divider","category":"layout","batch":"A","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://www.w3.org/TR/wai-aria-1.2/#separator","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"listbox","title":"Listbox","category":"primitive","batch":"internal","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/listbox/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"calendar","title":"Calendar","category":"primitive","batch":"internal","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["button"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/datepicker-dialog/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"text-field","title":"Text field","category":"form","batch":"B","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["icon"],"pattern":"https://html.spec.whatwg.org/multipage/input.html","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon"]},{"name":"textarea","title":"Textarea","category":"form","batch":"B","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"checkbox","title":"Checkbox","category":"form","batch":"B","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["icon"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon"]},{"name":"radio-group","title":"Radio group","category":"form","batch":"B","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/radio/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"switch","title":"Switch","category":"form","batch":"B","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/switch/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"number-field","title":"Number field","category":"form","batch":"B","priority":2,"platforms":["web","react","angular","native"],"dependsOn":["text-field","icon-button"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/spinbutton/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["text-field","icon-button"]},{"name":"select","title":"Select","category":"form","batch":"B","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["popover","listbox","icon"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover","listbox","icon"]},{"name":"combobox","title":"Combobox","category":"form","batch":"B","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["popover","listbox","text-field"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/combobox/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover","listbox","text-field"]},{"name":"multi-select","title":"Multi-select","category":"form","batch":"B","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["popover","listbox","badge","checkbox"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/listbox/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover","listbox","badge","checkbox"]},{"name":"slider","title":"Slider","category":"form","batch":"B","priority":2,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/slider/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"popover","title":"Popover","category":"overlay","batch":"C","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://open-ui.org/components/popover.research.explainer/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"tooltip","title":"Tooltip","category":"overlay","batch":"C","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["popover"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover"]},{"name":"dialog","title":"Dialog","category":"overlay","batch":"C","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["button","icon-button"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon-button"]},{"name":"drawer","title":"Drawer","category":"overlay","batch":"C","priority":2,"platforms":["web","react","angular","native"],"dependsOn":["dialog"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["dialog"]},{"name":"toast","title":"Toast","category":"feedback","batch":"C","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["icon","icon-button"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/alert/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon","icon-button"]},{"name":"menu","title":"Menu","category":"overlay","batch":"C","priority":2,"platforms":["web","react","angular","native"],"dependsOn":["popover"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover"]},{"name":"split-button","title":"Split button","category":"action","batch":"C","priority":3,"platforms":["web","react","angular","native"],"dependsOn":["button","menu"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["menu"]},{"name":"tabs","title":"Tabs","category":"navigation","batch":"D","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/tabs/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"accordion","title":"Accordion","category":"navigation","batch":"D","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["icon"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/accordion/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon"]},{"name":"pagination","title":"Pagination","category":"navigation","batch":"D","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["button","icon-button"],"pattern":"https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon-button"]},{"name":"steps","title":"Steps","category":"navigation","batch":"D","priority":2,"platforms":["web","react","angular","native"],"dependsOn":["icon"],"pattern":"https://www.w3.org/WAI/tutorials/forms/multi-page/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon"]},{"name":"breadcrumb","title":"Breadcrumb","category":"navigation","batch":"D","priority":2,"platforms":["web","react","angular","native"],"dependsOn":["icon"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/breadcrumb/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon"]},{"name":"card","title":"Card","category":"layout","batch":"D","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://html.spec.whatwg.org/multipage/sections.html#the-article-element","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"table","title":"Table","category":"data-display","batch":"E","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["checkbox","pagination","icon-button"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/table/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["checkbox","pagination","icon-button"]},{"name":"date-picker","title":"Date picker","category":"form","batch":"E","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["popover","calendar","text-field"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/datepicker-dialog/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover","calendar","text-field"]},{"name":"date-range-picker","title":"Date range picker","category":"form","batch":"E","priority":3,"platforms":["web","react","angular","native"],"dependsOn":["date-picker"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/datepicker-dialog/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["date-picker"]},{"name":"bottom-sheet","title":"Bottom sheet","category":"mobile","batch":"mobile","priority":3,"platforms":["native"],"dependsOn":[],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"skeleton","title":"Skeleton","category":"mobile","batch":"mobile","priority":3,"platforms":["native"],"dependsOn":[],"pattern":"https://www.w3.org/TR/wai-aria-1.2/#aria-busy","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"list-item","title":"List item","category":"mobile","batch":"mobile","priority":3,"platforms":["native"],"dependsOn":["icon"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/listbox/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon"]}]}
|
|
1
|
+
{"summary":{"total":38,"stable":2,"inProgress":0,"planned":36},"next":["badge","avatar","divider","listbox","calendar"],"gaps":[{"name":"badge","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"avatar","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"divider","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"listbox","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"calendar","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"text-field","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"textarea","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"checkbox","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"radio-group","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"switch","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"select","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover","listbox"]},{"name":"combobox","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover","listbox","text-field"]},{"name":"multi-select","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover","listbox","badge","checkbox"]},{"name":"popover","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"tooltip","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover"]},{"name":"dialog","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon-button"]},{"name":"toast","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon-button"]},{"name":"tabs","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"accordion","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"pagination","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon-button"]},{"name":"card","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"table","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["checkbox","pagination","icon-button"]},{"name":"date-picker","missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover","calendar","text-field"]}],"components":[{"name":"button","title":"Button","category":"action","batch":"A","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/button/","target":"stable","claimed":"stable","notes":[],"status":"stable","pieces":{"contract":true,"scenarios":true,"web":true,"react":true,"angular":true,"native":true,"nativeDemo":true,"tests":true,"docsEn":true,"docsEs":true,"llms":true,"changeset":true},"todos":[],"missing":[],"blockedBy":[]},{"name":"icon","title":"Icon","category":"data-display","batch":"A","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA24","target":"stable","claimed":"stable","notes":[],"status":"stable","pieces":{"contract":true,"scenarios":true,"web":true,"react":true,"angular":true,"native":true,"nativeDemo":true,"tests":true,"docsEn":true,"docsEs":true,"llms":true,"changeset":true},"todos":[],"missing":[],"blockedBy":[]},{"name":"icon-button","title":"Icon button","category":"action","batch":"A","priority":2,"platforms":["web","react","angular","native"],"dependsOn":["button","icon"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/button/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"badge","title":"Badge","category":"data-display","batch":"A","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://html.spec.whatwg.org/multipage/text-level-semantics.html","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"spinner","title":"Spinner","category":"feedback","batch":"A","priority":2,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/meter/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"avatar","title":"Avatar","category":"data-display","batch":"A","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://html.spec.whatwg.org/multipage/embedded-content.html","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"divider","title":"Divider","category":"layout","batch":"A","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://www.w3.org/TR/wai-aria-1.2/#separator","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"listbox","title":"Listbox","category":"primitive","batch":"internal","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/listbox/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"calendar","title":"Calendar","category":"primitive","batch":"internal","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["button"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/datepicker-dialog/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"text-field","title":"Text field","category":"form","batch":"B","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["icon"],"pattern":"https://html.spec.whatwg.org/multipage/input.html","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"textarea","title":"Textarea","category":"form","batch":"B","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"checkbox","title":"Checkbox","category":"form","batch":"B","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["icon"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"radio-group","title":"Radio group","category":"form","batch":"B","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/radio/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"switch","title":"Switch","category":"form","batch":"B","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/switch/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"number-field","title":"Number field","category":"form","batch":"B","priority":2,"platforms":["web","react","angular","native"],"dependsOn":["text-field","icon-button"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/spinbutton/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["text-field","icon-button"]},{"name":"select","title":"Select","category":"form","batch":"B","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["popover","listbox","icon"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover","listbox"]},{"name":"combobox","title":"Combobox","category":"form","batch":"B","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["popover","listbox","text-field"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/combobox/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover","listbox","text-field"]},{"name":"multi-select","title":"Multi-select","category":"form","batch":"B","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["popover","listbox","badge","checkbox"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/listbox/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover","listbox","badge","checkbox"]},{"name":"slider","title":"Slider","category":"form","batch":"B","priority":2,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/slider/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"popover","title":"Popover","category":"overlay","batch":"C","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://open-ui.org/components/popover.research.explainer/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"tooltip","title":"Tooltip","category":"overlay","batch":"C","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["popover"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover"]},{"name":"dialog","title":"Dialog","category":"overlay","batch":"C","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["button","icon-button"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon-button"]},{"name":"drawer","title":"Drawer","category":"overlay","batch":"C","priority":2,"platforms":["web","react","angular","native"],"dependsOn":["dialog"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["dialog"]},{"name":"toast","title":"Toast","category":"feedback","batch":"C","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["icon","icon-button"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/alert/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon-button"]},{"name":"menu","title":"Menu","category":"overlay","batch":"C","priority":2,"platforms":["web","react","angular","native"],"dependsOn":["popover"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover"]},{"name":"split-button","title":"Split button","category":"action","batch":"C","priority":3,"platforms":["web","react","angular","native"],"dependsOn":["button","menu"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["menu"]},{"name":"tabs","title":"Tabs","category":"navigation","batch":"D","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/tabs/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"accordion","title":"Accordion","category":"navigation","batch":"D","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["icon"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/accordion/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"pagination","title":"Pagination","category":"navigation","batch":"D","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["button","icon-button"],"pattern":"https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["icon-button"]},{"name":"steps","title":"Steps","category":"navigation","batch":"D","priority":2,"platforms":["web","react","angular","native"],"dependsOn":["icon"],"pattern":"https://www.w3.org/WAI/tutorials/forms/multi-page/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"breadcrumb","title":"Breadcrumb","category":"navigation","batch":"D","priority":2,"platforms":["web","react","angular","native"],"dependsOn":["icon"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/breadcrumb/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"card","title":"Card","category":"layout","batch":"D","priority":1,"platforms":["web","react","angular","native"],"dependsOn":[],"pattern":"https://html.spec.whatwg.org/multipage/sections.html#the-article-element","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"table","title":"Table","category":"data-display","batch":"E","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["checkbox","pagination","icon-button"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/table/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["checkbox","pagination","icon-button"]},{"name":"date-picker","title":"Date picker","category":"form","batch":"E","priority":1,"platforms":["web","react","angular","native"],"dependsOn":["popover","calendar","text-field"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/datepicker-dialog/","target":"stable","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["popover","calendar","text-field"]},{"name":"date-range-picker","title":"Date range picker","category":"form","batch":"E","priority":3,"platforms":["web","react","angular","native"],"dependsOn":["date-picker"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/examples/datepicker-dialog/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"web":false,"react":false,"angular":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","web","react","angular","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":["date-picker"]},{"name":"bottom-sheet","title":"Bottom sheet","category":"mobile","batch":"mobile","priority":3,"platforms":["native"],"dependsOn":[],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"skeleton","title":"Skeleton","category":"mobile","batch":"mobile","priority":3,"platforms":["native"],"dependsOn":[],"pattern":"https://www.w3.org/TR/wai-aria-1.2/#aria-busy","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]},{"name":"list-item","title":"List item","category":"mobile","batch":"mobile","priority":3,"platforms":["native"],"dependsOn":["icon"],"pattern":"https://www.w3.org/WAI/ARIA/apg/patterns/listbox/","target":"planned","notes":[],"status":"planned","pieces":{"contract":false,"scenarios":false,"native":false,"nativeDemo":false,"tests":false,"docsEn":false,"docsEs":false,"llms":false,"changeset":false},"todos":[],"missing":["contract","scenarios","native","nativeDemo","tests","docsEn","docsEs","llms","changeset"],"blockedBy":[]}]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@joralvmel/cosmos-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Model Context Protocol server exposing Cosmos UI components, snippets, status, themes, tokens, setup guides and docs to AI assistants.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\""
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@joralvmel/cosmos-core": "^0.
|
|
52
|
+
"@joralvmel/cosmos-core": "^0.2.0",
|
|
53
53
|
"@joralvmel/cosmos-tokens": "^0.1.0",
|
|
54
54
|
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
55
55
|
"zod": "^4.6.7"
|