mikeneko-ui 1.1.0 → 1.2.0
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/package.json +1 -1
- package/templates/CLAUDE.md +40 -5
- package/templates/prohibited.md +28 -0
package/package.json
CHANGED
package/templates/CLAUDE.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# melta UI — AI Quick Reference
|
|
2
2
|
|
|
3
3
|
> ShadCN/ui ベースのデザインシステム。Primary: Blue (#2b70ef)、日本語ファーストのタイポグラフィ。
|
|
4
4
|
|
|
@@ -150,15 +150,48 @@ Easing: ease-in-out (default)
|
|
|
150
150
|
| 色だけで情報伝達 | アイコン/テキストを併用 |
|
|
151
151
|
| 300ms超のアニメーション | 150〜300ms に制限 |
|
|
152
152
|
| `<th>` の `scope` 省略 | Table コンポーネント使用 |
|
|
153
|
+
| **Button** の右寄せ(`ml-auto` / `justify-end` / `text-right` 等)※ Button 以外の要素には適用しない。カードヘッダーの `justify-between` 等は許可 | 左寄せ(デフォルト)または中央寄せ |
|
|
154
|
+
| アイコンをテキストの **後** に配置(シェブロン・外部リンク等の Trailing 許可リスト以外) | アイコンはテキストの **前(Leading)** に配置する |
|
|
155
|
+
| `flex-row-reverse` でアイコン位置制御 | DOM順 = 視覚順にする |
|
|
156
|
+
| 定義外アイコンサイズ(`w-3 h-3` / `w-7 h-7` 等) | 4段階のみ: 16/20/24/32px |
|
|
153
157
|
|
|
154
|
-
>
|
|
158
|
+
> 全禁止パターン: `foundations/prohibited.md` 参照
|
|
159
|
+
> アイコン配置ルール詳細: `foundations/icons.md` 参照
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## HTML要素 → コンポーネント マッピング(必須)
|
|
164
|
+
|
|
165
|
+
> 素のHTML要素を使わず、必ず対応する shadcn/ui コンポーネントを使用すること。
|
|
166
|
+
> `components/ui/` 内のコンポーネント実装は例外。
|
|
167
|
+
> ESLint: `eslint-plugin-melta` の `melta/no-raw-html-elements` ルールで自動検出。
|
|
168
|
+
|
|
169
|
+
| HTML要素 | melta UI コンポーネント | インポート元 |
|
|
170
|
+
|----------|----------------------|-------------|
|
|
171
|
+
| `<button>` | `<Button>` | `@/components/ui/button` |
|
|
172
|
+
| `<input>` | `<Input>` | `@/components/ui/input` |
|
|
173
|
+
| `<input type="checkbox">` | `<Checkbox>` | `@/components/ui/checkbox` |
|
|
174
|
+
| `<input type="radio">` | `<RadioGroupItem>` | `@/components/ui/radio-group` |
|
|
175
|
+
| `<textarea>` | `<Textarea>` | `@/components/ui/textarea` |
|
|
176
|
+
| `<select>` | `<Select>` + `<SelectTrigger>` + `<SelectContent>` | `@/components/ui/select` |
|
|
177
|
+
| `<option>` | `<SelectItem>` | `@/components/ui/select` |
|
|
178
|
+
| `<label>` | `<Label>` | `@/components/ui/label` |
|
|
179
|
+
| `<table>` | `<Table>` | `@/components/ui/table` |
|
|
180
|
+
| `<thead>` | `<TableHeader>` | `@/components/ui/table` |
|
|
181
|
+
| `<tbody>` | `<TableBody>` | `@/components/ui/table` |
|
|
182
|
+
| `<tr>` | `<TableRow>` | `@/components/ui/table` |
|
|
183
|
+
| `<th>` | `<TableHead>` | `@/components/ui/table` |
|
|
184
|
+
| `<td>` | `<TableCell>` | `@/components/ui/table` |
|
|
185
|
+
| `<dialog>` | `<Dialog>` | `@/components/ui/dialog` |
|
|
186
|
+
| `<progress>` | `<Progress>` | `@/components/ui/progress` |
|
|
187
|
+
| `<hr>` | `<Separator>` | `@/components/ui/separator` |
|
|
155
188
|
|
|
156
189
|
---
|
|
157
190
|
|
|
158
191
|
## ファイル構成
|
|
159
192
|
|
|
160
193
|
```
|
|
161
|
-
|
|
194
|
+
melta-ui/
|
|
162
195
|
├── CLAUDE.md ← このファイル (AI Quick Reference)
|
|
163
196
|
├── tokens/
|
|
164
197
|
│ └── tokens.json ← デザイントークン (SSOT)
|
|
@@ -182,6 +215,8 @@ mikeneko-ui/
|
|
|
182
215
|
│ └── mcp/ ← MCP Server
|
|
183
216
|
│ ├── src/index.ts
|
|
184
217
|
│ └── dist/index.js
|
|
218
|
+
├── packages/
|
|
219
|
+
│ └── eslint-plugin-melta/ ← 素のHTML要素検出 ESLint プラグイン
|
|
185
220
|
├── app/ ← Next.js + shadcn/ui 実装
|
|
186
221
|
│ ├── src/
|
|
187
222
|
│ │ ├── app/globals.css ← テーマ (CSS変数)
|
|
@@ -208,7 +243,7 @@ mikeneko-ui/
|
|
|
208
243
|
```json
|
|
209
244
|
{
|
|
210
245
|
"mcpServers": {
|
|
211
|
-
"
|
|
246
|
+
"melta-ui": {
|
|
212
247
|
"command": "node",
|
|
213
248
|
"args": ["./ai/mcp/dist/index.js"]
|
|
214
249
|
}
|
|
@@ -227,7 +262,7 @@ mikeneko-ui/
|
|
|
227
262
|
| ダークモード対応 | + foundations/theme.md → foundations/color.md |
|
|
228
263
|
| フォーム画面 | + patterns/form.md → Input / Select / Checkbox / Button |
|
|
229
264
|
| データ一覧 | + Table → Pagination → Badge |
|
|
230
|
-
| ダッシュボード | + Card / Table / Progress / Chart / Badge |
|
|
265
|
+
| ダッシュボード | + **patterns/dashboard.md** → Card / Table / Progress / Chart / Badge |
|
|
231
266
|
| 設定画面 | + Tabs → Switch / Select / RadioGroup |
|
|
232
267
|
| モーダル / 確認 | + Dialog / AlertDialog → Button |
|
|
233
268
|
| Loading / 空状態 | + Skeleton → interaction-states.md |
|
package/templates/prohibited.md
CHANGED
|
@@ -79,6 +79,8 @@
|
|
|
79
79
|
|------|------|------|
|
|
80
80
|
| カード上部/左部のカラーバー(`border-t-4` や色付き `div`) | AI生成UIの典型パターン。装飾過剰で汎用性が低い | ボーダー(`border border-slate-200`)のみでカードを構成する |
|
|
81
81
|
| 左端/上端のカラーストライプ(`border-l-4 border-*-500`) | Alert含め全コンポーネントで禁止 | `border border-*-200 rounded-lg` で全周ボーダー |
|
|
82
|
+
| アイコンをタイトル/ラベルの **後(右側)** に配置 | AI が "Content First" を「テキストを先に書く」と解釈し、アイコンがタイトルの反対側に出る | アイコンはテキストの **前(Leading)** に配置。Trailing 許可はシェブロン・外部リンク等に限定(`foundations/icons.md` 参照) |
|
|
83
|
+
| `flex-row-reverse` でアイコン位置を調整 | DOM順と視覚順が逆転し、スクリーンリーダーの読み上げ順序が壊れる | DOM順をそのまま視覚順にする |
|
|
82
84
|
|
|
83
85
|
---
|
|
84
86
|
|
|
@@ -92,6 +94,9 @@
|
|
|
92
94
|
| Lighted Buttonの単独使用 | トグル状態の対比がないと意味不明 | Neutralとペアで使用する |
|
|
93
95
|
| `aria-label` なしのアイコンボタン | 操作内容がスクリーンリーダーに伝わらない | `aria-label="閉じる"` 等を付与 |
|
|
94
96
|
| 44px未満のタップ領域 | 操作困難(インラインテキストリンクを除く) | パディングでタップ領域を確保 |
|
|
97
|
+
| ボタンの右寄せ配置(`ml-auto` / `justify-end` / `text-right` / `self-end` / `float-right`) | 右端のボタンは視線動線(左→右の Z パターン)から外れやすく、特にモバイルでは親指が届きにくい。また右寄せは「補助的な操作」という暗黙の意味を持ち、主要アクションの発見性が低下する | ボタンは左寄せ(デフォルト)または中央寄せで配置する。フォーム送信ボタンはフォーム幅に合わせて `w-full` またはコンテンツ左寄せ |
|
|
98
|
+
|
|
99
|
+
> **注意**: この禁止は `<Button>` コンポーネントの配置のみが対象。カードヘッダーでタイトルとアイコンを `justify-between` で左右に配置するなど、ボタン以外の要素のレイアウトには適用しない。
|
|
95
100
|
|
|
96
101
|
### フォーム
|
|
97
102
|
|
|
@@ -185,6 +190,29 @@
|
|
|
185
190
|
|
|
186
191
|
---
|
|
187
192
|
|
|
193
|
+
## 素のHTML要素の使用禁止
|
|
194
|
+
|
|
195
|
+
> shadcn/ui コンポーネントが存在するHTML要素を素で使うことを禁止する。素のHTML要素はデザイントークン・アクセシビリティ・一貫したスタイリングが適用されず、melta UI の品質基準を満たせない。
|
|
196
|
+
|
|
197
|
+
| 禁止 | 理由 | 代替 |
|
|
198
|
+
|------|------|------|
|
|
199
|
+
| `<button>` | DSのスタイル・バリアント・サイズが適用されない | `<Button>` (`@/components/ui/button`) |
|
|
200
|
+
| `<input>` | ボーダー・フォーカスリング・エラー状態が未適用 | `<Input>` (`@/components/ui/input`) |
|
|
201
|
+
| `<input type="checkbox">` | チェックボックスのスタイル・アニメーションが未適用 | `<Checkbox>` (`@/components/ui/checkbox`) |
|
|
202
|
+
| `<input type="radio">` | ラジオボタンのスタイル・グループ制御が未適用 | `<RadioGroupItem>` (`@/components/ui/radio-group`) |
|
|
203
|
+
| `<textarea>` | フォーム入力のスタイル統一が崩れる | `<Textarea>` (`@/components/ui/textarea`) |
|
|
204
|
+
| `<select>` / `<option>` | ブラウザネイティブUIでスタイル制御不可 | `<Select>` + `<SelectItem>` (`@/components/ui/select`) |
|
|
205
|
+
| `<label>` | フォームラベルのスタイル・間隔が未適用 | `<Label>` (`@/components/ui/label`) |
|
|
206
|
+
| `<table>` / `<thead>` / `<tbody>` / `<tr>` / `<th>` / `<td>` | テーブルのスタイル・レスポンシブ対応が未適用 | `<Table>` / `<TableHeader>` / `<TableBody>` / `<TableRow>` / `<TableHead>` / `<TableCell>` (`@/components/ui/table`) |
|
|
207
|
+
| `<dialog>` | フォーカストラップ・オーバーレイ・アニメーションが未適用 | `<Dialog>` (`@/components/ui/dialog`) |
|
|
208
|
+
| `<progress>` | プログレスバーのスタイル・アニメーションが未適用 | `<Progress>` (`@/components/ui/progress`) |
|
|
209
|
+
| `<hr>` | 区切り線のスタイル・セマンティクスが未適用 | `<Separator>` (`@/components/ui/separator`) |
|
|
210
|
+
|
|
211
|
+
> **例外**: `components/ui/` 内の shadcn/ui コンポーネント実装では素のHTML要素を使用してよい。
|
|
212
|
+
> **ESLint**: `eslint-plugin-melta` の `melta/no-raw-html-elements` ルールで自動検出される。
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
188
216
|
## アクセシビリティ(全般)
|
|
189
217
|
|
|
190
218
|
| 禁止 | 理由 | 代替 |
|