UI base acessível para React com elementos nativos: campos, botões, tabela, abas, diálogo, avisos e tokens AA claro/escuro
Instalar
genpm add @core/uiO que você recebe
- Código em src/lib/ui/, 5 arquivos. (19,2 kB)
- Regras de IA em src/lib/ui/AGENTS.md, mais arquivos de regras da IDE.
README
Este pacote não tem README.
Isto é exatamente o que sua IA lê quando trabalha em src/lib/ui. Nada mais é adicionado ao contexto dela.
@core/ui — rules for AI agents
Purpose
Small accessible component set for React built on native elements (no UI library): Button, TextField,
TextareaField, SelectField, Checkbox, Field (label + help + error wiring), DataTable (with aria-sort),
Pagination, Tabs (WAI-ARIA, arrow keys), Dialog (native <dialog>), Alert, Badge, Card, Toasts,
Spinner, Skeleton. Styling lives in ui.css as CSS variables (light/dark, WCAG AA contrast) and ui-* classes.
Used by @core/admin, @core/blocks and the kits.
Map
index.ts— all components andcx().components.ts— implementation.ui.css— tokens and styles.
Integration
- Import the stylesheet once in the root layout:
import '@/lib/ui/ui.css'and addclassName="ui-root"to<body>. - Use components:
<TextField label="Email" type="email" required error={errors.email} />,<Button variant="primary" loading={saving}>Save</Button>. - Theme: change
--ui-*variables in your CSS; force a theme with<html data-theme="dark">. - Verify: tab through a form; every control has a visible focus ring and a label.
Conventions
- Every field gets a visible label (use
hideLabelonly when context makes it obvious); errors go inerror, not in placeholders. - Interactive elements are real
<button>/<a>/inputs; don't add click handlers to<div>. - Pass translated
labelstoPaginationanddismissLabeltoToasts.
Don't
- Don't lower contrast below 4.5:1 when changing tokens, or remove the focus outline.
- Don't add app-specific components here; keep them in your app or kit.
# @core/ui — rules for AI agents
## Purpose
Small accessible component set for React built on native elements (no UI library): `Button`, `TextField`,
`TextareaField`, `SelectField`, `Checkbox`, `Field` (label + help + error wiring), `DataTable` (with `aria-sort`),
`Pagination`, `Tabs` (WAI-ARIA, arrow keys), `Dialog` (native `<dialog>`), `Alert`, `Badge`, `Card`, `Toasts`,
`Spinner`, `Skeleton`. Styling lives in `ui.css` as CSS variables (light/dark, WCAG AA contrast) and `ui-*` classes.
Used by @core/admin, @core/blocks and the kits.
## Map
- `index.ts` — all components and `cx()`.
- `components.ts` — implementation. `ui.css` — tokens and styles.
## Integration
1. Import the stylesheet once in the root layout: `import '@/lib/ui/ui.css'` and add `className="ui-root"` to `<body>`.
2. Use components: `<TextField label="Email" type="email" required error={errors.email} />`, `<Button variant="primary" loading={saving}>Save</Button>`.
3. Theme: change `--ui-*` variables in your CSS; force a theme with `<html data-theme="dark">`.
4. Verify: tab through a form; every control has a visible focus ring and a label.
## Conventions
- Every field gets a visible label (use `hideLabel` only when context makes it obvious); errors go in `error`, not in placeholders.
- Interactive elements are real `<button>`/`<a>`/inputs; don't add click handlers to `<div>`.
- Pass translated `labels` to `Pagination` and `dismissLabel` to `Toasts`.
## Don't
- Don't lower contrast below 4.5:1 when changing tokens, or remove the focus outline.
- Don't add app-specific components here; keep them in your app or kit.
A árvore exata que será injetada, após o .genpmignore. Fixada em
MIT License
Copyright (c) 2026 GenPM
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Este pacote não declara servidores MCP.
| Versão | Commit | Publicado | Análise |
|---|---|---|---|
| 1.0.1 | 9955ea1 | há 9 horas | análise aprovada |
- genpm
- nenhum
- proposto
- O GenPM propõe o comando npm e só o executa se você disser sim.
- Usado por (2)
- @core/admin ^1.0.0@core/blocks ^1.0.0
- análise
- análise aprovada · 0 achados
- commit
- v1.0.1 → 9955ea1d72f43b5cecdc5f3d244507c8bc2e4bc9 · verificado após o download
- scripts
- Nenhum. O GenPM nunca executa código de pacotes.
- licença
- MIT
- Qualidade
- 100/100
- Licença reconhecidacumprido
- AGENTS.md explica o propósitocumprido
- AGENTS.md tem passos de integraçãocumprido
- AGENTS.md lista convenções ou proibiçõescumprido
- Inclui testescumprido
- Escaneamento de segurança aprovadocumprido
- Publicado nos últimos 6 mesescumprido
- Publicador verificadocumprido
- Resumo e palavras-chavecumprido
- denúncia
- Viu algo errado?