ネイティブ要素による React 用アクセシブル UI:フィールド、ボタン、表、タブ、ダイアログ、通知、AA 準拠トークン
インストール
genpm add @core/ui含まれるもの
- src/lib/ui/ にソースコード(5 ファイル)。 (19.2 KB)
- src/lib/ui/AGENTS.md に AI ルール、加えて IDE 用のルールファイル。
README
このパッケージには README がありません。
これは AI が src/lib/ui で作業するときに読む内容そのものです。それ以外はコンテキストに追加されません。
@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.
.genpmignore 適用後に組み込まれる正確なツリーです。固定先:
このパッケージは MCP サーバーを宣言していません。
| バージョン | コミット | 公開日 | スキャン |
|---|---|---|---|
| 1.0.1 | 9955ea1 | 3 時間前 | スキャン合格 |
- genpm
- なし
- 提案
- GenPM は npm コマンドを提案し、あなたが承認した場合にのみ実行します。
- スキャン
- スキャン合格 · 指摘 0 件
- コミット
- v1.0.1 → 9955ea1d72f43b5cecdc5f3d244507c8bc2e4bc9 · 取得後に検証済み
- スクリプト
- なし。GenPM はパッケージのコードを実行しません。
- ライセンス
- MIT
- 品質
- 100/100
- 認識されたライセンス達成
- AGENTS.md に目的の説明がある達成
- AGENTS.md に統合手順がある達成
- AGENTS.md に規約や禁止事項がある達成
- テストを含む達成
- セキュリティスキャンに合格達成
- 過去 6 か月以内に公開達成
- 認証済みの公開者達成
- 概要とキーワード達成
- 報告
- 問題を見つけましたか?