ksk-design-system 1.46.1 → 1.48.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/AGENTS.md +12 -12
- package/CLAUDE.md +24 -11
- package/MIGRATION.md +3 -1
- package/RELEASE.md +2 -1
- package/bin/check-duplicates.js +20 -3
- package/bin/init.js +80 -1
- package/contracts/components.json +85 -3
- package/contracts/token-hex-cache.json +1 -1
- package/dist/index.js +4988 -4986
- package/dist/native/ui.js +1948 -1781
- package/dist/prompt-coordinator-sBFZKQIX.js +171 -0
- package/dist/types/components/patterns/prompt-coordinator.d.ts +2 -0
- package/dist/types/components/ui/card.d.ts +22 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/lib/prompt-coordinator.d.ts +46 -0
- package/dist/types/native/components/PromptCoordinator.d.ts +2 -0
- package/dist/types/native/components/index.d.ts +1 -0
- package/dist/types/native/modal-reveal-lifecycle.d.ts +29 -0
- package/dist/types/native/sheet-snap-gesture.d.ts +53 -0
- package/package.json +3 -2
- package/scripts/codemod/README.md +10 -2
- package/scripts/codemod/template.mjs +39 -4
- package/src/components/COMPONENT_LOOKUP.md +2 -1
- package/src/native/COMPONENT_LOOKUP.md +4 -1
- package/templates/AGENTS.md +1 -1
- package/templates/CLAUDE.md +1 -1
- package/dist/rolldown-runtime-Df-vAQej.js +0 -25
package/AGENTS.md
CHANGED
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
```
|
|
18
18
|
.claude/skills/ksk-design-system/SKILL.md # 判断Skill: 実装・レビューの判断基準(正本への索引)
|
|
19
|
-
contracts/rules.json #
|
|
20
|
-
contracts/components.json #
|
|
19
|
+
contracts/rules.json # 禁止パターン・AIアンチパターン・a11y要件(件数・内容は rules.json が正本)
|
|
20
|
+
contracts/components.json # 全コンポーネントの定義・バリアント・ルール
|
|
21
21
|
contracts/design-context.json # DESIGN.md と正本ファイルの関係・AI向け検査方針
|
|
22
22
|
tokens.json # カラー・スペーシング・シャドウトークン
|
|
23
23
|
contracts/token-hex-cache.json # semantic トークンのデフォルトテーマ解決済み hex(テーマ依存キーは meta.themeDependentKeys 参照・自動生成)
|
|
@@ -127,11 +127,11 @@ Brand色を差し替え(10行)→ Primitive Layer → Semantic Layer → Bri
|
|
|
127
127
|
| ファイル | 内容 |
|
|
128
128
|
|---------|------|
|
|
129
129
|
| **AGENTS.md**(本ファイル) | 概要・技術スタック・コマンド・クイックスタート |
|
|
130
|
-
| **contracts/components.json** |
|
|
131
|
-
| **contracts/rules.json** |
|
|
130
|
+
| **contracts/components.json** | 全コンポーネントの構造化定義(バリアント・アクセシビリティ要件。総数は meta.counts が正本) |
|
|
131
|
+
| **contracts/rules.json** | 禁止パターン・AIアンチパターン・アクセシビリティ要件(正本: rules.json) |
|
|
132
132
|
| **contracts/design-context.json** | `DESIGN.md` の役割・正本ファイル・外部 DESIGN.md 参照方針 |
|
|
133
133
|
| **tokens.json** | カラー・スペーシング・シャドウトークンの機械可読定義 |
|
|
134
|
-
| **src/components/COMPONENT_LOOKUP.md** |
|
|
134
|
+
| **src/components/COMPONENT_LOOKUP.md** | 全コンポーネントのバリアント・インポートパス(自動生成) |
|
|
135
135
|
| **DESIGN.md** | AI エージェント向け視覚言語サマリ(トークン+意図・voice・motion) |
|
|
136
136
|
| **contracts/screen-patterns.json** | 画面実装前にどのシェル/パターンを使うかを決める decisionTree・crudMatrix |
|
|
137
137
|
| **contracts/composition.json** | 選んだパターン内部の並べ方(骨格構造・余白リズム・カード階層・テキスト階層・CTA優先度) |
|
|
@@ -143,20 +143,20 @@ Brand色を差し替え(10行)→ Primitive Layer → Semantic Layer → Bri
|
|
|
143
143
|
```
|
|
144
144
|
src/
|
|
145
145
|
├── components/
|
|
146
|
-
│ ├── ui/ # 汎用UIコンポーネント
|
|
146
|
+
│ ├── ui/ # 汎用UIコンポーネント
|
|
147
147
|
│ ├── patterns/
|
|
148
|
-
│ │ ├── commerce/ # EC系
|
|
149
|
-
│ │ ├── admin/ # 管理画面系
|
|
150
|
-
│ │ ├── shells/ # レイアウトシェル
|
|
151
|
-
│ │ └── ... # 汎用パターン
|
|
148
|
+
│ │ ├── commerce/ # EC系
|
|
149
|
+
│ │ ├── admin/ # 管理画面系
|
|
150
|
+
│ │ ├── shells/ # レイアウトシェル
|
|
151
|
+
│ │ └── ... # 汎用パターン
|
|
152
152
|
│ └── icons/
|
|
153
153
|
├── styles/
|
|
154
154
|
│ ├── primitive.css # Layer 1: 原色パレット
|
|
155
155
|
│ ├── semantic.css # Layer 2: 用途別トークン
|
|
156
|
-
│ └── typography.css # typo-* ユーティリティ
|
|
156
|
+
│ └── typography.css # typo-* ユーティリティ
|
|
157
157
|
├── themes/ # default / orange / green / violet / blue
|
|
158
158
|
├── preset.css # 外部プロジェクト向けプリセット
|
|
159
|
-
└── index.ts # Public API
|
|
159
|
+
└── index.ts # Public API(全コンポーネント)
|
|
160
160
|
```
|
|
161
161
|
|
|
162
162
|
---
|
package/CLAUDE.md
CHANGED
|
@@ -54,18 +54,31 @@ Brand色を差し替え(10行)→ Primitive Layer → Semantic Layer → Bri
|
|
|
54
54
|
|
|
55
55
|
## AIモデルの使い分け方針
|
|
56
56
|
|
|
57
|
+
(同一モデルで実装と検証を兼ねない — 同じバイアスを共有し独立検証にならない)
|
|
58
|
+
|
|
59
|
+
### Fable 5 が使えるとき
|
|
60
|
+
|
|
57
61
|
| モデル | 用途 |
|
|
58
62
|
|--------|------|
|
|
59
63
|
| `claude-fable-5` | 最難関の設計・長時間エージェント作業のみ(高コストのため温存) |
|
|
60
64
|
| `claude-opus-4-8` | 通常のUI実装・レビュー・リファクタの既定 |
|
|
61
65
|
|
|
62
|
-
|
|
66
|
+
**検証ループ:** 実装 = Fable 5 / 検証 = Opus 4.8
|
|
63
67
|
|
|
64
68
|
**Fable 5 使用時の注意:**
|
|
65
69
|
- thinking は常時オン(パラメータ省略でデフォルトに任せる)
|
|
66
70
|
- refusal 時は `fallbacks` で Opus 4.8 に自動フォールバック
|
|
67
71
|
- 30日データ保持が必須
|
|
68
72
|
|
|
73
|
+
### Fable 5 が使えないとき(アクセス終了・休止期間)
|
|
74
|
+
|
|
75
|
+
| モデル | 用途 |
|
|
76
|
+
|--------|------|
|
|
77
|
+
| `claude-opus-4-8` | 設計・UI実装・レビュー・リファクタの既定 |
|
|
78
|
+
| `claude-sonnet-5` | 機械的な一括修正・定型作業(トークン節約) |
|
|
79
|
+
|
|
80
|
+
**検証ループ:** 実装 = Opus 4.8 / 検証 = Sonnet 5
|
|
81
|
+
|
|
69
82
|
---
|
|
70
83
|
|
|
71
84
|
## ドキュメント構成
|
|
@@ -74,12 +87,12 @@ Brand色を差し替え(10行)→ Primitive Layer → Semantic Layer → Bri
|
|
|
74
87
|
|---------|------|
|
|
75
88
|
| **CLAUDE.md**(本ファイル) | 概要・技術スタック・コマンド・クイックスタート(Claude Code用) |
|
|
76
89
|
| **AGENTS.md** | 同上(Codex用。セッション開始時の読み込み指示・編集後コマンドを明記) |
|
|
77
|
-
| **contracts/components.json** |
|
|
78
|
-
| **contracts/rules.json** |
|
|
90
|
+
| **contracts/components.json** | 全コンポーネントの構造化定義(バリアント・アクセシビリティ要件。総数は meta.counts が正本) |
|
|
91
|
+
| **contracts/rules.json** | 禁止パターン・AIアンチパターン・アクセシビリティ要件(正本: rules.json) |
|
|
79
92
|
| **contracts/design-context.json** | `DESIGN.md` の役割・正本ファイル・外部 DESIGN.md 参照方針 |
|
|
80
93
|
| **tokens.json** | カラー・スペーシング・シャドウトークンの機械可読定義 |
|
|
81
94
|
| **contracts/token-hex-cache.json** | semantic トークンのデフォルトテーマ解決済み hex(テーマ依存キーは meta.themeDependentKeys 参照・自動生成) |
|
|
82
|
-
| **src/components/COMPONENT_LOOKUP.md** |
|
|
95
|
+
| **src/components/COMPONENT_LOOKUP.md** | 全コンポーネントのバリアント・インポートパス一覧(自動生成) |
|
|
83
96
|
| **DESIGN.md** | AI エージェント向け視覚言語サマリ(トークン+意図・voice・motion) |
|
|
84
97
|
| **contracts/screen-patterns.json** | 画面実装前にどのシェル/パターンを使うかを決める decisionTree・crudMatrix |
|
|
85
98
|
| **contracts/composition.json** | 選んだパターン内部の並べ方(骨格構造・余白リズム・カード階層・テキスト階層・CTA優先度) |
|
|
@@ -110,20 +123,20 @@ Storybook 全体を横断で視覚監査する(定期監査・リリース前
|
|
|
110
123
|
```
|
|
111
124
|
src/
|
|
112
125
|
├── components/
|
|
113
|
-
│ ├── ui/ # 汎用UIコンポーネント
|
|
126
|
+
│ ├── ui/ # 汎用UIコンポーネント
|
|
114
127
|
│ ├── patterns/
|
|
115
|
-
│ │ ├── commerce/ # EC系
|
|
116
|
-
│ │ ├── admin/ # 管理画面系
|
|
117
|
-
│ │ ├── shells/ # レイアウトシェル
|
|
118
|
-
│ │ └── ... # 汎用パターン
|
|
128
|
+
│ │ ├── commerce/ # EC系
|
|
129
|
+
│ │ ├── admin/ # 管理画面系
|
|
130
|
+
│ │ ├── shells/ # レイアウトシェル
|
|
131
|
+
│ │ └── ... # 汎用パターン
|
|
119
132
|
│ └── icons/
|
|
120
133
|
├── styles/
|
|
121
134
|
│ ├── primitive.css # Layer 1: 原色パレット
|
|
122
135
|
│ ├── semantic.css # Layer 2: 用途別トークン
|
|
123
|
-
│ └── typography.css # typo-* ユーティリティ
|
|
136
|
+
│ └── typography.css # typo-* ユーティリティ
|
|
124
137
|
├── themes/ # default / orange / green / violet / blue
|
|
125
138
|
├── preset.css # 外部プロジェクト向けプリセット
|
|
126
|
-
└── index.ts # Public API
|
|
139
|
+
└── index.ts # Public API(全コンポーネント)
|
|
127
140
|
```
|
|
128
141
|
|
|
129
142
|
---
|
package/MIGRATION.md
CHANGED
|
@@ -10,7 +10,9 @@ patch / minor は原則破壊変更なし、自動アップグレード可(例
|
|
|
10
10
|
破壊変更を入れる際にはここに以下を書く:
|
|
11
11
|
1. 削除した識別子 / prop の一覧(rename テーブル)
|
|
12
12
|
2. before / after コード例
|
|
13
|
-
3. 自動移行コマンド: `npx ksk-design-system codemod
|
|
13
|
+
3. 自動移行コマンド: `npx ksk-design-system codemod <name> ./src`(`<name>` は
|
|
14
|
+
そのリリースで追加した `scripts/codemod/<name>.mjs`。利用できる名前は
|
|
15
|
+
`npx ksk-design-system codemod` で一覧できる)
|
|
14
16
|
4. 手動対応が必要な項目(codemod では拾えないケース)
|
|
15
17
|
|
|
16
18
|
---
|
package/RELEASE.md
CHANGED
|
@@ -41,6 +41,7 @@ T+1w 次の patch で旧 API を完全削除
|
|
|
41
41
|
|---|---|---|---|
|
|
42
42
|
| 2026-05-30 | v1.21.2 | Sheet (`side="bottom"` / `swipeToClose` / `bottom-glass`) が仮想キーボード表示時にシート上端を画面外へ出さないよう `visualViewport` 監視で修正(PR #12) | モバイルの入力付きボトムシートでタイトル/ドラッグハンドルが隠れる不具合を解消 |
|
|
43
43
|
| 2026-06-13 | v1.31.1 | `.glass-specular > *` が**絶対配置の子要素**の `position`/`z-index` を踏み潰す問題を `:not(.absolute):not(.fixed):not(.sticky)` 除外で修正 | glass 面に重ねた絶対配置オーバーレイ(閉じる × 等)が consumer 側の `absolute`/`z-*` を奪われ角からはみ出す不具合を解消 |
|
|
44
|
+
| 2026-07-27 | v1.48.1 | native の Modal 系オーバーレイ(Sheet plain/snap・Celebration overlay・emoji bounce)で、Modal 表示前に入口アニメーションを開始すると要素が不可視位置に残る問題を onShow 起点+二重 fallback で修正(#250)。併せて snap sheet の gesture 状態バグ 3 件(アニメ中の再ドラッグでパネルが飛ぶ/再オープン時に下スワイプが効かない/`dismissible`・`onClose` が初回 render のまま固定)を修正 | iOS 実機で「透明なオーバーレイだけが残り操作不能」になる進行不能バグを解消。#249 で snap sheet のみ対処した同一原因が plain sheet と Celebration に残っていた |
|
|
44
45
|
|
|
45
46
|
新しいホットフィックスがあれば追記する。
|
|
46
47
|
|
|
@@ -71,7 +72,7 @@ GitHub Releases にコピペできるテンプレ:
|
|
|
71
72
|
```md
|
|
72
73
|
### Breaking Changes
|
|
73
74
|
- `OldComponent` を削除。`NewComponent` を使ってください。<!-- docs-drift-ignore: OldComponent NewComponent -->
|
|
74
|
-
自動移行: `npx ksk-design-system codemod
|
|
75
|
+
自動移行: `npx ksk-design-system codemod vX-to-vY ./src`
|
|
75
76
|
- 詳細: [MIGRATION.md](./MIGRATION.md)
|
|
76
77
|
```
|
|
77
78
|
|
package/bin/check-duplicates.js
CHANGED
|
@@ -68,12 +68,29 @@ function loadComponentRegistry(contractsPath) {
|
|
|
68
68
|
const contracts = JSON.parse(readFileSync(contractsPath, "utf8"))
|
|
69
69
|
const registry = new Map()
|
|
70
70
|
|
|
71
|
+
const add = (name, tier, path) => {
|
|
72
|
+
if (typeof name !== "string" || name.length === 0) return
|
|
73
|
+
const matches = registry.get(name) ?? []
|
|
74
|
+
matches.push({ tier, path })
|
|
75
|
+
registry.set(name, matches)
|
|
76
|
+
}
|
|
77
|
+
|
|
71
78
|
for (const tier of ["ui", "patterns", "commerce", "admin", "shells"]) {
|
|
72
79
|
for (const component of contracts[tier] ?? []) {
|
|
73
80
|
if (typeof component?.name !== "string" || typeof component?.path !== "string") continue
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
81
|
+
|
|
82
|
+
// contracts の name は「import できる名前」とは限らない。
|
|
83
|
+
// `exported: false` は実装ファイル名 / グループ名 / 型のみの export で、
|
|
84
|
+
// その名前で import することはできない。ここに登録してしまうと、
|
|
85
|
+
// consumer のローカル実装を「DS にある」と誤検知し、存在しない export を
|
|
86
|
+
// import しろと案内してしまう。実際に import できる名前だけを登録する。
|
|
87
|
+
if (component.exported === false) {
|
|
88
|
+
for (const sub of component.subcomponents ?? []) add(sub, tier, component.path)
|
|
89
|
+
continue
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
add(component.exportedAs ?? component.name, tier, component.path)
|
|
93
|
+
for (const alias of component.deprecatedAliases ?? []) add(alias, tier, component.path)
|
|
77
94
|
}
|
|
78
95
|
}
|
|
79
96
|
|
package/bin/init.js
CHANGED
|
@@ -12,9 +12,10 @@
|
|
|
12
12
|
// npx ksk-design-system demo [dir] # DS リポを clone + setup(お試し用)
|
|
13
13
|
// npx ksk-ds lint src # contracts/rules.json に基づき consumer UI を検査
|
|
14
14
|
// npx ksk-ds check-duplicates src # DS と同名のローカル実装を検査
|
|
15
|
+
// npx ksk-ds codemod <name> ./src # scripts/codemod/<name>.mjs を実行
|
|
15
16
|
// npx ksk-design-system postinstall # npm postinstall から呼ばれる silent モード
|
|
16
17
|
|
|
17
|
-
import { copyFileSync, existsSync } from "node:fs"
|
|
18
|
+
import { copyFileSync, existsSync, readdirSync } from "node:fs"
|
|
18
19
|
import { dirname, join, resolve } from "node:path"
|
|
19
20
|
import { fileURLToPath } from "node:url"
|
|
20
21
|
import { spawnSync } from "node:child_process"
|
|
@@ -26,6 +27,9 @@ const args = process.argv.slice(2)
|
|
|
26
27
|
const cmd = args[0] || "init"
|
|
27
28
|
const force = args.includes("--force")
|
|
28
29
|
|
|
30
|
+
/** scripts/codemod/ 配下にあるが codemod として呼べないもの(雛形・読み取り専用スキャナ) */
|
|
31
|
+
const NON_CODEMOD = new Set(["template", "check-migration"])
|
|
32
|
+
|
|
29
33
|
if (cmd === "help" || cmd === "--help" || cmd === "-h") {
|
|
30
34
|
console.log(`ksk-design-system CLI
|
|
31
35
|
|
|
@@ -40,6 +44,9 @@ if (cmd === "help" || cmd === "--help" || cmd === "-h") {
|
|
|
40
44
|
npx ksk-ds check-migration ./src 非推奨 API の残存を検査(read-only)
|
|
41
45
|
npx ksk-ds check-duplicates [DIR] DS と同名のローカル実装を検査
|
|
42
46
|
npx ksk-ds check-duplicates --strict 検出時に exit 1(CI 向け)
|
|
47
|
+
npx ksk-ds codemod 利用できる codemod を一覧
|
|
48
|
+
npx ksk-ds codemod <name> [DIR] --dry 破壊変更の自動移行(事前確認)
|
|
49
|
+
npx ksk-ds codemod <name> [DIR] 破壊変更の自動移行(書き込み)
|
|
43
50
|
`)
|
|
44
51
|
process.exit(0)
|
|
45
52
|
}
|
|
@@ -65,6 +72,10 @@ if (cmd === "check-duplicates") {
|
|
|
65
72
|
process.exit(status)
|
|
66
73
|
}
|
|
67
74
|
|
|
75
|
+
if (cmd === "codemod") {
|
|
76
|
+
process.exit(runCodemod(args.slice(1)))
|
|
77
|
+
}
|
|
78
|
+
|
|
68
79
|
if (cmd === "demo") {
|
|
69
80
|
runDemo(args.slice(1))
|
|
70
81
|
process.exit(0)
|
|
@@ -76,6 +87,74 @@ if (cmd !== "init" && cmd !== "postinstall") {
|
|
|
76
87
|
process.exit(1)
|
|
77
88
|
}
|
|
78
89
|
|
|
90
|
+
// ─── codemod ────────────────────────────────────────────────
|
|
91
|
+
// MIGRATION.md / RELEASE.md / scripts/codemod/README.md が案内している
|
|
92
|
+
// `npx ksk-design-system codemod <name> ./src` の実体。
|
|
93
|
+
// `scripts/codemod/<name>.mjs` を解決して node で起動し、残りの引数
|
|
94
|
+
// (対象ディレクトリ・--dry)はそのまま渡す。
|
|
95
|
+
|
|
96
|
+
function codemodDir() {
|
|
97
|
+
return join(pkgRoot, "scripts", "codemod")
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function listCodemods() {
|
|
101
|
+
const dir = codemodDir()
|
|
102
|
+
if (!existsSync(dir)) return []
|
|
103
|
+
return readdirSync(dir)
|
|
104
|
+
.filter((f) => f.endsWith(".mjs"))
|
|
105
|
+
.map((f) => f.replace(/\.mjs$/, ""))
|
|
106
|
+
.filter((name) => !NON_CODEMOD.has(name))
|
|
107
|
+
.sort()
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function printAvailableCodemods() {
|
|
111
|
+
const available = listCodemods()
|
|
112
|
+
if (available.length === 0) {
|
|
113
|
+
console.error(`\n現在提供されている codemod はありません。`)
|
|
114
|
+
console.error(`破壊変更に対応する codemod はリリース時に追加され、`)
|
|
115
|
+
console.error(`MIGRATION.md に実行コマンドが記載されます。`)
|
|
116
|
+
console.error(`\n非推奨 API の残存を数えるだけなら:`)
|
|
117
|
+
console.error(` npx ksk-ds check-migration ./src`)
|
|
118
|
+
return
|
|
119
|
+
}
|
|
120
|
+
console.error(`\n利用できる codemod:`)
|
|
121
|
+
for (const name of available) console.error(` ${name}`)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function runCodemod(rest) {
|
|
125
|
+
const name = rest.find((a) => !a.startsWith("--"))
|
|
126
|
+
|
|
127
|
+
if (!name) {
|
|
128
|
+
console.error(`使い方: npx ksk-design-system codemod <name> [DIR] [--dry]`)
|
|
129
|
+
printAvailableCodemods()
|
|
130
|
+
return 1
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// pkgRoot の外へ抜ける名前・codemod ではないファイルを弾く
|
|
134
|
+
if (!/^[A-Za-z0-9._-]+$/.test(name) || NON_CODEMOD.has(name)) {
|
|
135
|
+
console.error(`✗ codemod 名が不正です: ${name}`)
|
|
136
|
+
printAvailableCodemods()
|
|
137
|
+
return 1
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const scriptPath = join(codemodDir(), `${name}.mjs`)
|
|
141
|
+
if (!existsSync(scriptPath)) {
|
|
142
|
+
console.error(`✗ codemod が見つかりません: ${name}`)
|
|
143
|
+
console.error(` 期待したパス: ${scriptPath}`)
|
|
144
|
+
printAvailableCodemods()
|
|
145
|
+
return 1
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// name だけ取り除いて残り(DIR / --dry 等)をそのまま渡す
|
|
149
|
+
const nameIndex = rest.indexOf(name)
|
|
150
|
+
const forwarded = rest.filter((_, i) => i !== nameIndex)
|
|
151
|
+
const res = spawnSync(process.execPath, [scriptPath, ...forwarded], {
|
|
152
|
+
stdio: "inherit",
|
|
153
|
+
cwd: process.cwd(),
|
|
154
|
+
})
|
|
155
|
+
return res.status ?? 1
|
|
156
|
+
}
|
|
157
|
+
|
|
79
158
|
function runDemo(rest) {
|
|
80
159
|
const consumerCwd = process.cwd()
|
|
81
160
|
const targetDir = rest.find((a) => !a.startsWith("--")) || "ksk-ds-demo"
|
|
@@ -1,15 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"name": "KSK Design System — Component Contracts",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.48.1",
|
|
5
5
|
"description": "全コンポーネントの構造化定義。バリアント・アクセシビリティ要件・使用ルールを機械可読形式で管理。",
|
|
6
6
|
"counts": {
|
|
7
7
|
"ui": 67,
|
|
8
|
-
"patterns":
|
|
8
|
+
"patterns": 57,
|
|
9
9
|
"commerce": 12,
|
|
10
10
|
"admin": 8,
|
|
11
11
|
"shells": 3,
|
|
12
|
-
"total":
|
|
12
|
+
"total": 147
|
|
13
|
+
},
|
|
14
|
+
"exportNaming": {
|
|
15
|
+
"_doc": "contracts の name が `import { name } from \"ksk-design-system\"` で解決できるかを示す。__tests__/contracts-export-integrity.test.ts が src/index.ts の実 export と突き合わせて固定する。",
|
|
16
|
+
"exported": "既定 true。false のとき name は実装ファイル名 / グループ名であり import できない。実際に import できる名前は subcomponents に列挙する。",
|
|
17
|
+
"exportedAs": "name とは別名で export される場合の実 export 名(例: FormField を KskFormField として出す等)。未使用なら省略する。",
|
|
18
|
+
"deprecatedAliases": "互換のために残している旧 export 名。新規利用は禁止。eslint/deprecated.js の DEPRECATED と同期させる(テストで固定)。",
|
|
19
|
+
"note": "型のみの export(`export type { Toast }`)は値として import できないため exported:false 扱いにする。"
|
|
20
|
+
},
|
|
21
|
+
"formBinding": {
|
|
22
|
+
"_doc": "react-hook-form との繋ぎ方。consumer と AI が「この部品は {...register()} を直接 spread できるのか」を判断するための機械可読フィールド。",
|
|
23
|
+
"register": "ネイティブ input/textarea を描画し props を素通し・ref を転送する。`<Input {...register(\"x\")} />` がそのまま動く(非制御。初期値は ref 経由で DOM に書かれ onChange は発火しない)。",
|
|
24
|
+
"controller": "value / onChange が独自シグネチャ、または Radix の onValueChange / onCheckedChange。`<Controller render={({field}) => ...} />` が必要。",
|
|
25
|
+
"layout": "値を持たないラベル / レイアウト用ラッパ。",
|
|
26
|
+
"none": "フォーム部品ではない。",
|
|
27
|
+
"rule": "register / controller を宣言したら __tests__/react-hook-form-integration.test.tsx に登場させること(defaultValues の初期表示 / reset() 追従 / 操作での値更新の 3 点)。__tests__/form-binding-contract.test.ts がこれを強制する。",
|
|
28
|
+
"rollout": "段階導入中。formBinding が未宣言のフォーム部品はまだ分類していないという意味であり、「フォーム部品ではない」という意味ではない。"
|
|
13
29
|
}
|
|
14
30
|
},
|
|
15
31
|
"ui": [
|
|
@@ -63,6 +79,7 @@
|
|
|
63
79
|
},
|
|
64
80
|
{
|
|
65
81
|
"name": "Input",
|
|
82
|
+
"formBinding": "register",
|
|
66
83
|
"path": "src/components/ui/input.tsx",
|
|
67
84
|
"description": "テキスト入力フィールド。h-12, rounded-sm, セマンティックトークン使用。必ずLabelとセットで使う。",
|
|
68
85
|
"variants": [],
|
|
@@ -169,6 +186,7 @@
|
|
|
169
186
|
},
|
|
170
187
|
{
|
|
171
188
|
"name": "DateField",
|
|
189
|
+
"formBinding": "controller",
|
|
172
190
|
"path": "src/components/ui/date-field.tsx",
|
|
173
191
|
"description": "DatePicker を \"YYYY-MM-DD\" ISO 文字列 API でラップする adapter。バックエンド/store が ISO date 文字列で日付を保持する場合に使う。value=\"\" が未選択を表す。",
|
|
174
192
|
"variants": [],
|
|
@@ -183,6 +201,7 @@
|
|
|
183
201
|
},
|
|
184
202
|
{
|
|
185
203
|
"name": "Textarea",
|
|
204
|
+
"formBinding": "register",
|
|
186
205
|
"path": "src/components/ui/textarea.tsx",
|
|
187
206
|
"description": "複数行テキスト入力。コメント・説明文など長文入力に使用。必ずLabelとセットで使う。",
|
|
188
207
|
"variants": [],
|
|
@@ -197,6 +216,7 @@
|
|
|
197
216
|
},
|
|
198
217
|
{
|
|
199
218
|
"name": "Label",
|
|
219
|
+
"formBinding": "layout",
|
|
200
220
|
"path": "src/components/ui/label.tsx",
|
|
201
221
|
"description": "フォームラベル。すべての入力コントロールに対して必須。htmlForで入力と紐付ける。",
|
|
202
222
|
"variants": [],
|
|
@@ -218,6 +238,7 @@
|
|
|
218
238
|
},
|
|
219
239
|
{
|
|
220
240
|
"name": "Checkbox",
|
|
241
|
+
"formBinding": "controller",
|
|
221
242
|
"path": "src/components/ui/checkbox.tsx",
|
|
222
243
|
"description": "チェックボックス。label/description/count を渡すと自動で行型レイアウトに(filter sidebar 型)。",
|
|
223
244
|
"variants": [],
|
|
@@ -231,6 +252,7 @@
|
|
|
231
252
|
},
|
|
232
253
|
{
|
|
233
254
|
"name": "RadioGroup",
|
|
255
|
+
"formBinding": "controller",
|
|
234
256
|
"path": "src/components/ui/radio-group.tsx",
|
|
235
257
|
"description": "ラジオボタングループ。単一選択に使用。各RadioGroupItemにLabelが必要。",
|
|
236
258
|
"variants": [],
|
|
@@ -240,6 +262,7 @@
|
|
|
240
262
|
},
|
|
241
263
|
{
|
|
242
264
|
"name": "Switch",
|
|
265
|
+
"formBinding": "controller",
|
|
243
266
|
"path": "src/components/ui/switch.tsx",
|
|
244
267
|
"description": "トグルスイッチ。設定のON/OFFなど即時反映するアクションに使用。",
|
|
245
268
|
"variants": [],
|
|
@@ -483,6 +506,7 @@
|
|
|
483
506
|
},
|
|
484
507
|
{
|
|
485
508
|
"name": "Toast",
|
|
509
|
+
"exported": false,
|
|
486
510
|
"path": "src/components/ui/toast.tsx",
|
|
487
511
|
"description": "トースト通知。操作結果フィードバックに使用。2 つの呼び出し方をサポート: (1) <Toaster> + useToast() の Provider モード、(2) sonner ライクな fire-and-forget API (`toast.success(...)` 等) — 後者は Toaster 不要で、初回呼び出し時に document.body 直下へ portal root を自動挿入する。",
|
|
488
512
|
"variants": [
|
|
@@ -499,6 +523,11 @@
|
|
|
499
523
|
"新規 action prop で右側に CTA ボタン (元に戻す / 再試行 等) を表示できる",
|
|
500
524
|
"保存完了・接続復旧・同期開始など一時的な操作結果は Banner ではなく toast.* helper を使う",
|
|
501
525
|
"connectionRestored / saveComplete / retryStarted / retryFailed helper を提供"
|
|
526
|
+
],
|
|
527
|
+
"subcomponents": [
|
|
528
|
+
"Toaster",
|
|
529
|
+
"useToast",
|
|
530
|
+
"toast"
|
|
502
531
|
]
|
|
503
532
|
},
|
|
504
533
|
{
|
|
@@ -517,6 +546,7 @@
|
|
|
517
546
|
},
|
|
518
547
|
{
|
|
519
548
|
"name": "NumberInput",
|
|
549
|
+
"formBinding": "controller",
|
|
520
550
|
"path": "src/components/ui/number-input.tsx",
|
|
521
551
|
"description": "数値入力コンポーネント。+/-ボタン付き。min/max/stepのガード・通貨フォーマット対応。<input type='number'>の代替。",
|
|
522
552
|
"features": [
|
|
@@ -756,6 +786,7 @@
|
|
|
756
786
|
},
|
|
757
787
|
{
|
|
758
788
|
"name": "Slider",
|
|
789
|
+
"formBinding": "controller",
|
|
759
790
|
"path": "src/components/ui/slider.tsx",
|
|
760
791
|
"description": "数値スライダー。価格帯フィルタ・音量など連続値の入力。範囲スライダー(2ハンドル)も対応。",
|
|
761
792
|
"accessibility": [
|
|
@@ -786,6 +817,7 @@
|
|
|
786
817
|
},
|
|
787
818
|
{
|
|
788
819
|
"name": "CheckboxCard",
|
|
820
|
+
"exported": false,
|
|
789
821
|
"path": "src/components/ui/checkbox-card.tsx",
|
|
790
822
|
"description": "カード型チェックボックス。複数選択のカード型UI。単一選択には RadioGroup を使用。",
|
|
791
823
|
"accessibility": [
|
|
@@ -796,6 +828,10 @@
|
|
|
796
828
|
"CheckboxCardGroup でグループ化",
|
|
797
829
|
"expandedContent で選択時展開",
|
|
798
830
|
"badge でタグ表示"
|
|
831
|
+
],
|
|
832
|
+
"subcomponents": [
|
|
833
|
+
"CheckboxCardGroup",
|
|
834
|
+
"CheckboxCardItem"
|
|
799
835
|
]
|
|
800
836
|
},
|
|
801
837
|
{
|
|
@@ -1234,6 +1270,7 @@
|
|
|
1234
1270
|
},
|
|
1235
1271
|
{
|
|
1236
1272
|
"name": "Form",
|
|
1273
|
+
"exported": false,
|
|
1237
1274
|
"path": "src/components/patterns/form.tsx",
|
|
1238
1275
|
"description": "フォームコンテナ。FormRoot/FormSection/FormActionsで構成。複数FormFieldをまとめる。",
|
|
1239
1276
|
"subcomponents": [
|
|
@@ -1774,6 +1811,31 @@
|
|
|
1774
1811
|
"対象要素が見つからない step は画面中央フォールバック"
|
|
1775
1812
|
]
|
|
1776
1813
|
},
|
|
1814
|
+
{
|
|
1815
|
+
"name": "PromptCoordinatorProvider/AutoPrompt",
|
|
1816
|
+
"exported": false,
|
|
1817
|
+
"path": "src/components/patterns/prompt-coordinator.tsx",
|
|
1818
|
+
"description": "自動表示プロンプトを排他制御する headless Provider。priority 降順 + FIFO、同一 id coalesce、表示間隔、全体抑制を提供。",
|
|
1819
|
+
"variants": [],
|
|
1820
|
+
"sizes": [],
|
|
1821
|
+
"accessibility": [
|
|
1822
|
+
"headless: rendered prompt owns dialog semantics and focus management"
|
|
1823
|
+
],
|
|
1824
|
+
"rules": [
|
|
1825
|
+
"表示条件・頻度・永続化・内容は consumer が管理する",
|
|
1826
|
+
"自動表示プロンプトだけを登録し、ユーザー操作起点の dialog は登録しない",
|
|
1827
|
+
"active prompt を閉じるときは release を必ず呼ぶ"
|
|
1828
|
+
],
|
|
1829
|
+
"subcomponents": [
|
|
1830
|
+
"PromptCoordinatorProvider",
|
|
1831
|
+
"AutoPrompt",
|
|
1832
|
+
"usePromptCoordinator",
|
|
1833
|
+
"usePromptSlot",
|
|
1834
|
+
"suppressAutoPrompts",
|
|
1835
|
+
"isAutoPromptSuppressed",
|
|
1836
|
+
"AUTO_PROMPT_SUPPRESSION_EVENT"
|
|
1837
|
+
]
|
|
1838
|
+
},
|
|
1777
1839
|
{
|
|
1778
1840
|
"name": "CookieConsent",
|
|
1779
1841
|
"path": "src/components/patterns/cookie-consent.tsx",
|
|
@@ -1793,6 +1855,7 @@
|
|
|
1793
1855
|
},
|
|
1794
1856
|
{
|
|
1795
1857
|
"name": "ListSkeleton / GridSkeleton",
|
|
1858
|
+
"exported": false,
|
|
1796
1859
|
"path": "src/components/patterns/list-skeletons.tsx",
|
|
1797
1860
|
"description": "リスト型 (上部フィルタ + N 行) / グリッド型 (M×N カード) の汎用 Skeleton レイアウト。同一ファイルに 2 component。",
|
|
1798
1861
|
"variants": [],
|
|
@@ -1806,6 +1869,10 @@
|
|
|
1806
1869
|
"ListSkeleton: rowHeight で 1 行高",
|
|
1807
1870
|
"GridSkeleton: columns 1-4 + cardHeight で調整",
|
|
1808
1871
|
"React Native consumer は ksk-design-system/native/ui の ListSkeleton / GridSkeleton alias を使う"
|
|
1872
|
+
],
|
|
1873
|
+
"subcomponents": [
|
|
1874
|
+
"ListSkeleton",
|
|
1875
|
+
"GridSkeleton"
|
|
1809
1876
|
]
|
|
1810
1877
|
},
|
|
1811
1878
|
{
|
|
@@ -1878,6 +1945,7 @@
|
|
|
1878
1945
|
},
|
|
1879
1946
|
{
|
|
1880
1947
|
"name": "SettingsSection / SettingsListRow",
|
|
1948
|
+
"exported": false,
|
|
1881
1949
|
"path": "src/components/patterns/settings-section.tsx",
|
|
1882
1950
|
"description": "設定画面の group/card/danger section と row。title / description / action / leading / rightSlot を持ち、switch / badge / button を安定配置する。",
|
|
1883
1951
|
"variants": [
|
|
@@ -1902,6 +1970,10 @@
|
|
|
1902
1970
|
"設定一覧で ad-hoc flex row を作らず SettingsListRow を使う",
|
|
1903
1971
|
"switch / badge / button は rightSlot に置く",
|
|
1904
1972
|
"danger variant は削除・ログアウトなど不可逆操作のグループに限定する"
|
|
1973
|
+
],
|
|
1974
|
+
"subcomponents": [
|
|
1975
|
+
"SettingsSection",
|
|
1976
|
+
"SettingsListRow"
|
|
1905
1977
|
]
|
|
1906
1978
|
},
|
|
1907
1979
|
{
|
|
@@ -1928,6 +2000,7 @@
|
|
|
1928
2000
|
},
|
|
1929
2001
|
{
|
|
1930
2002
|
"name": "CompactFilePicker / ImageAttachmentPicker",
|
|
2003
|
+
"exported": false,
|
|
1931
2004
|
"path": "src/components/patterns/compact-file-picker.tsx",
|
|
1932
2005
|
"description": "mobile sheet 内で使う compact file/image picker。hidden input trigger、preview、remove affordance、label、description、disabled/loading state を DS 化する。",
|
|
1933
2006
|
"features": [
|
|
@@ -1952,10 +2025,15 @@
|
|
|
1952
2025
|
"Native では DocumentPicker/ImagePicker を起動する onPress trigger として使う",
|
|
1953
2026
|
"object URL の生成/破棄は consumer state 側で管理し、DS には src と id を渡す",
|
|
1954
2027
|
"画像 preview/delete の row/grid boilerplate を consumer に置かない"
|
|
2028
|
+
],
|
|
2029
|
+
"subcomponents": [
|
|
2030
|
+
"CompactFilePicker",
|
|
2031
|
+
"ImageAttachmentPicker"
|
|
1955
2032
|
]
|
|
1956
2033
|
},
|
|
1957
2034
|
{
|
|
1958
2035
|
"name": "QuickActionGrid / ActionTile",
|
|
2036
|
+
"exported": false,
|
|
1959
2037
|
"path": "src/components/patterns/quick-action-grid.tsx",
|
|
1960
2038
|
"description": "ショートカット/絵文字 action の button tile と grid。icon/emoji、label、description、meta、selected/disabled/loading state、2/3/4 column または auto-fit を持つ。",
|
|
1961
2039
|
"variants": [
|
|
@@ -1976,6 +2054,10 @@
|
|
|
1976
2054
|
"shortcut row/grid の columns/gap を consumer 側で決め打ちしない",
|
|
1977
2055
|
"children には ActionTile を使う",
|
|
1978
2056
|
"選択状態は selected prop を使う"
|
|
2057
|
+
],
|
|
2058
|
+
"subcomponents": [
|
|
2059
|
+
"QuickActionGrid",
|
|
2060
|
+
"ActionTile"
|
|
1979
2061
|
]
|
|
1980
2062
|
}
|
|
1981
2063
|
],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"name": "KSK Design System — Semantic Token Hex Cache",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.48.1",
|
|
5
5
|
"description": "semantic / semanticDark トークン(var(--Primitive-*) 参照)を実 hex に解決したサイドカー生成物。hex はデフォルト(Blue)テーマでの解決値であり、Brand 系(meta.themeDependentKeys に列挙)はテーマ差し替え(orange/green/violet 等)で実色が変わる。テーマ別の完全解決値は `ksk-design-system/native` エクスポート(バンドル済み native トークンモジュール)の themes を参照。tokens.json 本体のスキーマは変更せず、AI がこのファイルだけで実色を把握できるようにし、primitive 値の変更による semantic 実色のドリフトを --check で機械検出する。",
|
|
6
6
|
"generatedBy": "scripts/generate-token-hex-cache.mjs",
|
|
7
7
|
"theme": "default",
|