ksk-design-system 2.6.3 → 2.7.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/MIGRATION.md +16 -0
- package/README.md +27 -1
- package/UPDATING.md +5 -0
- package/bin/lint.js +1 -1
- package/bin/product-theme-override.js +1 -1
- package/contracts/component-docs-guidance.json +73 -0
- package/contracts/components.json +26 -3
- package/contracts/consumer-requests.json +20 -0
- package/contracts/native-device-verification.json +29 -0
- package/contracts/product-theme-overrides.json +9 -1
- package/contracts/token-hex-cache.json +1 -1
- package/dist/index.js +2532 -2491
- package/dist/native/ui.js +2006 -1864
- package/dist/{prompt-coordinator-DR5uqIaR.js → semantic-icons-CP9aRQ9C.js} +35 -1
- package/dist/types/components/ui/semantic-icon.d.ts +16 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/lib/semantic-icons.d.ts +34 -0
- package/dist/types/native/components/Alert.d.ts +4 -1
- package/dist/types/native/components/SemanticIcon.d.ts +12 -0
- package/dist/types/native/components/Sheet.d.ts +2 -0
- package/dist/types/native/components/StatCard.d.ts +8 -1
- package/dist/types/native/components/index.d.ts +2 -1
- package/dist/types/native/sheet-snap-gesture.d.ts +2 -0
- package/dist/types/native/sheet-viewport-layout.d.ts +9 -0
- package/package.json +18 -3
- package/src/components/COMPONENT_LOOKUP.md +2 -1
- package/src/native/COMPONENT_LOOKUP.md +3 -1
- package/src/preset-core.css +252 -0
- package/src/preset.css +7 -232
- package/src/styles/product-theme.css +8 -0
- package/src/styles/source-safelist.css +5 -1
package/MIGRATION.md
CHANGED
|
@@ -63,6 +63,22 @@ React 18 では `ref` が無言で無視されていた)。詳細は下の
|
|
|
63
63
|
**v2.0.0 では削除していません**。削除は「全消費リポで `check-migration` の
|
|
64
64
|
残件が 0」を条件に v3.0.0 で行います。
|
|
65
65
|
|
|
66
|
+
## v2 系内の追加(参考)
|
|
67
|
+
|
|
68
|
+
### v2.7.0 — CSS の入口 `preset-core` / `safelist` を追加(追加のみ・破壊的変更なし)
|
|
69
|
+
|
|
70
|
+
`ksk-design-system/preset` から DS 部品用の safelist(`src/styles/source-safelist.css`)だけを
|
|
71
|
+
除いた `ksk-design-system/preset-core` と、safelist 単体の `ksk-design-system/safelist` を
|
|
72
|
+
exports に足した。
|
|
73
|
+
|
|
74
|
+
- **既存 consumer: 対応不要**。`preset` は `preset-core` + `safelist` を読み込む形に組み替えたが、
|
|
75
|
+
生成される CSS は従来と同じ
|
|
76
|
+
- DS 部品を 1 つも使わない consumer は `preset` を `preset-core` に置き換えると、
|
|
77
|
+
部品用の utility(safelist 約 1,150 クラス分)が出力から消える。部品を使うルートが 1 つでもある
|
|
78
|
+
ビルドでは `preset` のままにする(詳細は README の「DS 部品を使わない consumer は `preset-core`」節)
|
|
79
|
+
- DS 本体の CSS を編集するときは、トークン・base layer 等は `src/preset-core.css` に書く
|
|
80
|
+
(`src/preset.css` は 2 つを読み込むだけの入口)
|
|
81
|
+
|
|
66
82
|
## v3.0 (未リリース)
|
|
67
83
|
|
|
68
84
|
破壊変更を入れる際にはここに以下を書く:
|
package/README.md
CHANGED
|
@@ -112,6 +112,32 @@ consumer 側の Tailwind と DS を同じビルドで処理するため、上記
|
|
|
112
112
|
DS のクラス CSS は生成されます(issue #258)。ただし consumer 自身のコードは
|
|
113
113
|
consumer 側の走査対象なので、`@source` は引き続き推奨構成です。
|
|
114
114
|
|
|
115
|
+
#### DS 部品を使わない consumer は `preset-core`
|
|
116
|
+
|
|
117
|
+
safelist は DS 部品(`Button` 等)が内部で使う Tailwind クラスを、consumer が 1 つも
|
|
118
|
+
部品を使っていなくても生成します(safelist は約 1,150 クラス。consumer のクラスが無い状態の
|
|
119
|
+
実測で、出力 CSS が `preset` 179KB → `preset-core` 54KB、gzip 25.8KB → 9.8KB)。**DS 部品を import しない
|
|
120
|
+
consumer**(`ksk-design-system/class-names` とトークンだけで UI を組む公開ページ等)は、
|
|
121
|
+
safelist だけを除いた `preset-core` を使えます。トークン・shadcn 互換の変数・アニメーション・
|
|
122
|
+
container 幅・`scrollbar-hide`・base layer のボーダー色の保険は `preset` と同じです。
|
|
123
|
+
|
|
124
|
+
```css
|
|
125
|
+
@import "tailwindcss";
|
|
126
|
+
@import "ksk-design-system/preset-core";
|
|
127
|
+
@import "ksk-design-system/themes/default";
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
| consumer | 使う入口 |
|
|
131
|
+
|---|---|
|
|
132
|
+
| DS 部品を 1 つでも使う(どこか 1 ルートでも) | `ksk-design-system/preset`(従来どおり。`preset-core` + `safelist` と同じ) |
|
|
133
|
+
| DS 部品を使わない(トークン・`class-names` だけ) | `ksk-design-system/preset-core` |
|
|
134
|
+
|
|
135
|
+
Tailwind は CSS を 1 本にまとめるため、DS 部品を使うルートが 1 つでもあるビルドでは
|
|
136
|
+
`preset` を使ってください(`preset-core` を選ぶと、そのルートで部品の見た目が崩れます)。
|
|
137
|
+
`preset-core` と safelist を分けて読みたい場合は
|
|
138
|
+
`@import "ksk-design-system/preset-core"; @import "ksk-design-system/safelist";` が
|
|
139
|
+
`preset` と同じ結果になります。
|
|
140
|
+
|
|
115
141
|
<!-- consumer-example:tsx:start -->
|
|
116
142
|
```tsx
|
|
117
143
|
import { Button, Input, Label } from "ksk-design-system"
|
|
@@ -334,7 +360,7 @@ module.exports = {
|
|
|
334
360
|
],
|
|
335
361
|
moduleNameMapper: {
|
|
336
362
|
"\\.(css|less|sass|scss)$": "<rootDir>/test/style-mock.cjs",
|
|
337
|
-
"^ksk-design-system/(preset|styles(?:\\.css)?|glass|tokens/(?:primitive|semantic|typography|categorical|motion)|themes/(?:default|blue|orange|green|violet|cobalt))$":
|
|
363
|
+
"^ksk-design-system/(preset(?:-core)?|safelist|styles(?:\\.css)?|glass|tokens/(?:primitive|semantic|typography|categorical|motion)|themes/(?:default|blue|orange|green|violet|cobalt))$":
|
|
338
364
|
"<rootDir>/test/style-mock.cjs",
|
|
339
365
|
},
|
|
340
366
|
}
|
package/UPDATING.md
CHANGED
|
@@ -103,6 +103,11 @@ consumer側Tailwindを重ねる二重ビルド方式にも切り替えないこ
|
|
|
103
103
|
DS 内部だけで使われるクラス(`pointer-events-auto` 等)については、preset に safelist
|
|
104
104
|
(`src/styles/source-safelist.css`・自動生成)が同梱されているため `@source` の有無に依存しない(issue #258)。
|
|
105
105
|
|
|
106
|
+
DS 部品を 1 つも使わない consumer(トークンと `ksk-design-system/class-names` だけで UI を組む構成)は、
|
|
107
|
+
`ksk-design-system/preset` の代わりに safelist だけを除いた `ksk-design-system/preset-core` を使える
|
|
108
|
+
(追加のみ・破壊的変更なし。`preset` の中身は `preset-core` + `safelist` で従来と同じ)。
|
|
109
|
+
使い分けは README の「DS 部品を使わない consumer は `preset-core`」節を参照。
|
|
110
|
+
|
|
106
111
|
> **必要な Tailwind バージョン**: この safelist は Tailwind 4.1 で導入された `@source inline()` を使う。
|
|
107
112
|
> このため次のリリース以降、peerDependencies は `tailwindcss@^4.1.0` となる。
|
|
108
113
|
> 4.0.x を使っている場合は、DS を上げる前に `npm install -D tailwindcss@^4.1` で Tailwind を先に上げること。
|
package/bin/lint.js
CHANGED
|
@@ -103,7 +103,7 @@ export function isAutoGeneratedSource(source) {
|
|
|
103
103
|
* トークンを**定義している側**の DS 自身の CSS に当ててはいけない。
|
|
104
104
|
*/
|
|
105
105
|
const DS_CSS_DIRS = ["src/styles", "src/themes"]
|
|
106
|
-
const DS_CSS_FILES = ["src/preset.css"]
|
|
106
|
+
const DS_CSS_FILES = ["src/preset.css", "src/preset-core.css"]
|
|
107
107
|
|
|
108
108
|
/** DS 配布物のヘッダコメントに必ず入る署名(ベンダリングされたコピーにも残る) */
|
|
109
109
|
const DS_CSS_SIGNATURE = /KSK Design System/
|
|
@@ -30,7 +30,7 @@ const DECLARATION = /(^|[;{}\s])(--[A-Za-z0-9_-]+)\s*:/g
|
|
|
30
30
|
* 生成ファイルを増やさずに実行時へ集めるので、DS 側の CSS を足してもドリフトしない。
|
|
31
31
|
*/
|
|
32
32
|
const DS_CSS_DIRS = ["src/styles", "src/themes"]
|
|
33
|
-
const DS_CSS_FILES = ["src/preset.css"]
|
|
33
|
+
const DS_CSS_FILES = ["src/preset.css", "src/preset-core.css"]
|
|
34
34
|
|
|
35
35
|
/** CSS コメントを、行数を保ったまま空白に置き換える */
|
|
36
36
|
function stripCssComments(source) {
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "迷いやすい部品の使い分け。基本用途とルールはcomponents.jsonを参照する。",
|
|
3
|
+
"groups": [
|
|
4
|
+
{
|
|
5
|
+
"names": [
|
|
6
|
+
"Sheet",
|
|
7
|
+
"ResponsiveOverlayFrame",
|
|
8
|
+
"ResponsiveDialog"
|
|
9
|
+
],
|
|
10
|
+
"difference": "Sheetは幅に追従するシート。ResponsiveDialogとResponsiveOverlayFrameの組み合わせはモバイルのシートをPCでは中央ダイアログに切り替える。シートのままでよい場合はSheetを選ぶ。",
|
|
11
|
+
"avoid": "削除など取り消せない操作の確認にはAlertDialogを使う。"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"names": [
|
|
15
|
+
"ChipSelector",
|
|
16
|
+
"PillToggle",
|
|
17
|
+
"Select",
|
|
18
|
+
"FilterPill",
|
|
19
|
+
"FilterChip"
|
|
20
|
+
],
|
|
21
|
+
"difference": "ChipSelectorは複数または単一の選択肢を並べる。PillToggleは少数の値を単一選択する。Selectは候補を開いて選ぶ。FilterPillは条件設定パネルを開く操作と解除、FilterChipは適用中の条件の表示に使う。",
|
|
22
|
+
"avoid": "選択と画面遷移を混ぜない。画面の切り替えにはTabs、ページ移動にはナビゲーションを使う。"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"names": [
|
|
26
|
+
"FormField",
|
|
27
|
+
"RhfFormField"
|
|
28
|
+
],
|
|
29
|
+
"difference": "patterns/form-fieldのFormFieldはラベル・説明・エラーを入力に関連付ける。RhfFormFieldはreact-hook-formのController連携用。単純なフォームでは前者を使う。",
|
|
30
|
+
"avoid": "react-hook-formを使わないフォームにRhfFormFieldを導入しない。"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"names": [
|
|
34
|
+
"Button",
|
|
35
|
+
"IconButton",
|
|
36
|
+
"ActionTile",
|
|
37
|
+
"QuickActionGrid"
|
|
38
|
+
],
|
|
39
|
+
"difference": "Buttonは文言で操作を示す。IconButtonは意味が明確な短い操作に使いアクセシブルな名前を付ける。ActionTileは説明や選択状態を持つタイル、QuickActionGridはその配置に使う。",
|
|
40
|
+
"avoid": "単なる説明を押せるボタンにしない。複数の値選択は専用の選択コンポーネントを使う。"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"names": [
|
|
44
|
+
"EmptyState",
|
|
45
|
+
"ErrorState",
|
|
46
|
+
"Skeleton",
|
|
47
|
+
"Spinner"
|
|
48
|
+
],
|
|
49
|
+
"difference": "取得成功で0件ならEmptyState、取得失敗ならErrorStateと再試行。Skeletonは内容の形が分かる読み込み、Spinnerは処理の進行中を示す。",
|
|
50
|
+
"avoid": "取得に失敗した状態を「0件」と表示しない。"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"names": [
|
|
54
|
+
"Input",
|
|
55
|
+
"Textarea",
|
|
56
|
+
"AutoGrowTextarea",
|
|
57
|
+
"NumberInput",
|
|
58
|
+
"DateField"
|
|
59
|
+
],
|
|
60
|
+
"difference": "Inputは短い自由入力、Textareaは複数行、AutoGrowTextareaは内容に応じて高さが伸びる複数行入力です。数値の増減にはNumberInput、日付にはDateFieldを使います。ラベル・説明・エラーはFormFieldで関連付けます。",
|
|
61
|
+
"avoid": "決まった候補から選ぶ場合はSelectやRadioGroupを使います。長い文章の入力を1行のInputに押し込めず、複数行の入力欄を使います。"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"names": [
|
|
65
|
+
"SubNav",
|
|
66
|
+
"SectionNav",
|
|
67
|
+
"Tabs"
|
|
68
|
+
],
|
|
69
|
+
"difference": "TabsとSubNavは同じ画面内の表示内容を切り替えるための部品です。SubNavは横スクロールする項目列、Tabsは項目と対応する表示領域を組み合わせます。SectionNavは同じページ内の見出しへ移動する目次です。",
|
|
70
|
+
"avoid": "ページ内の見出しへスクロールするだけの操作をタブ切り替えとして実装しないでください。別ページへ移動する場合はリンクを使います。"
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"name": "KSK Design System — Component Contracts",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.7.0",
|
|
5
5
|
"description": "全コンポーネントの構造化定義。バリアント・アクセシビリティ要件・使用ルールを機械可読形式で管理。",
|
|
6
6
|
"counts": {
|
|
7
|
-
"ui":
|
|
7
|
+
"ui": 69,
|
|
8
8
|
"patterns": 61,
|
|
9
9
|
"commerce": 12,
|
|
10
10
|
"admin": 8,
|
|
11
11
|
"shells": 3,
|
|
12
|
-
"total":
|
|
12
|
+
"total": 153
|
|
13
13
|
},
|
|
14
14
|
"exportNaming": {
|
|
15
15
|
"_doc": "contracts の name が `import { name } from \"ksk-design-system\"` で解決できるかを示す。__tests__/contracts-export-integrity.test.ts が src/index.ts の実 export と突き合わせて固定する。",
|
|
@@ -1220,6 +1220,29 @@
|
|
|
1220
1220
|
"最大幅・中央寄せ・左右 gutter は内側の Container に委ねる",
|
|
1221
1221
|
"footer の全幅背景帯には as=\"footer\" を使える"
|
|
1222
1222
|
]
|
|
1223
|
+
},
|
|
1224
|
+
{
|
|
1225
|
+
"name": "SemanticIcon",
|
|
1226
|
+
"description": "用途から選ぶ装飾アイコン。情報i・警告!・枠なし選択tickを区別。NativeはSVG依存なしのView描画で同じ意味を提供。",
|
|
1227
|
+
"variants": [
|
|
1228
|
+
"selected",
|
|
1229
|
+
"selectedSquare",
|
|
1230
|
+
"success",
|
|
1231
|
+
"close",
|
|
1232
|
+
"info",
|
|
1233
|
+
"warning"
|
|
1234
|
+
],
|
|
1235
|
+
"rules": [
|
|
1236
|
+
"装飾は既定で読み上げない。単独の情報画像にはaria-labelを指定する。",
|
|
1237
|
+
"アイコンのみの操作はButton / native IconButtonに操作名を付ける。",
|
|
1238
|
+
"Nativeの警告は円形の感嘆符、Webはiconsax Danger。意味は同一だが描画素材に合わせて器の形が異なる。"
|
|
1239
|
+
],
|
|
1240
|
+
"path": "src/components/ui/semantic-icon.tsx",
|
|
1241
|
+
"props": {
|
|
1242
|
+
"name": "selected | selectedSquare | success | close | info | warning — 意味を必ず指定",
|
|
1243
|
+
"size": "number | string (Web), number (Native) — 既定24",
|
|
1244
|
+
"accessibilityLabel": "string — 単独の情報画像に付ける名前。Webはaria-labelを優先"
|
|
1245
|
+
}
|
|
1223
1246
|
}
|
|
1224
1247
|
],
|
|
1225
1248
|
"patterns": [
|
|
@@ -20,6 +20,26 @@
|
|
|
20
20
|
"dsIssue": 573,
|
|
21
21
|
"consumerIssue": "https://github.com/ekusiek716/exam-kit/issues/1089",
|
|
22
22
|
"fixPr": 574
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"dsIssue": 580,
|
|
26
|
+
"consumerIssue": "https://github.com/ekusiek716/camera-app/issues/239",
|
|
27
|
+
"fixPr": 581
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"dsIssue": 582,
|
|
31
|
+
"consumerIssue": "https://github.com/ekusiek716/camera-app/issues/241",
|
|
32
|
+
"fixPr": 583
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"dsIssue": 584,
|
|
36
|
+
"consumerIssue": "https://github.com/ekusiek716/camera-app/issues/242",
|
|
37
|
+
"fixPr": 585
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"dsIssue": 586,
|
|
41
|
+
"consumerIssue": "https://github.com/ekusiek716/camera-app/issues/248",
|
|
42
|
+
"fixPr": 587
|
|
23
43
|
}
|
|
24
44
|
]
|
|
25
45
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"policy": "Record only observations actually performed on the exact revision and stated OS, including failed checks. Bundling, typechecks and React Native Web are not device verification.",
|
|
4
|
+
"checks": [
|
|
5
|
+
{ "id": "safe-area", "components": ["Sheet", "Screen"], "procedure": "Open sheet at both snap points; rotate; confirm title and footer avoid notch and home indicator." },
|
|
6
|
+
{ "id": "keyboard", "components": ["Input", "KeyboardAwareSheetFooter", "Sheet"], "procedure": "Focus first/last input, enter Japanese, scroll and dismiss keyboard; verify focused field and submit remain reachable, no double inset." },
|
|
7
|
+
{ "id": "font-scale", "components": ["Text", "Button", "Input", "Sheet"], "procedure": "Set OS accessibility text size to largest, reopen app; verify full labels wrap and controls remain reachable." },
|
|
8
|
+
{ "id": "sheet-gesture", "components": ["Sheet"], "procedure": "Drag handle between 0.5 and 0.9, scroll inner content, dismiss and reopen five times; ensure no invisible input-blocking modal." },
|
|
9
|
+
{ "id": "screen-reader", "components": ["Button", "Input", "Sheet"], "procedure": "Enable VoiceOver/TalkBack; verify names, modal focus, field labels and close action." }
|
|
10
|
+
],
|
|
11
|
+
"observations": [
|
|
12
|
+
{
|
|
13
|
+
"checkId": "keyboard",
|
|
14
|
+
"components": [
|
|
15
|
+
"Input",
|
|
16
|
+
"KeyboardAwareSheetFooter",
|
|
17
|
+
"Sheet"
|
|
18
|
+
],
|
|
19
|
+
"platform": "ios",
|
|
20
|
+
"os": "26.5",
|
|
21
|
+
"device": "iPhone 17 Pro Simulator",
|
|
22
|
+
"revision": "906f830c278bcef8703bcc2f4179139eec9b58bb",
|
|
23
|
+
"checkedAt": "2026-09-25T05:12:00Z",
|
|
24
|
+
"status": "failed",
|
|
25
|
+
"evidence": "docs/native-review-2026-09-25.md",
|
|
26
|
+
"notes": "項目1への日本語入力後、ソフトキーボードで保存フッターが隠れた。"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -149,7 +149,8 @@
|
|
|
149
149
|
"--Space-Section-2xl"
|
|
150
150
|
],
|
|
151
151
|
"chip": [
|
|
152
|
-
"--Chip-Radius"
|
|
152
|
+
"--Chip-Radius",
|
|
153
|
+
"--Chip-Remove-Width"
|
|
153
154
|
],
|
|
154
155
|
"productTypography": [
|
|
155
156
|
"--Product-Type-Scale"
|
|
@@ -185,6 +186,12 @@
|
|
|
185
186
|
],
|
|
186
187
|
"toast": [
|
|
187
188
|
"--Toast-Viewport-Offset-Bottom"
|
|
189
|
+
],
|
|
190
|
+
"settingsRow": [
|
|
191
|
+
"--Settings-Row-Min-Height",
|
|
192
|
+
"--Settings-Row-Gap",
|
|
193
|
+
"--Settings-Row-Padding-X",
|
|
194
|
+
"--Settings-Row-Padding-Y"
|
|
188
195
|
]
|
|
189
196
|
},
|
|
190
197
|
"dsVariableNamespaces": [
|
|
@@ -212,6 +219,7 @@
|
|
|
212
219
|
"--Field-",
|
|
213
220
|
"--Product-",
|
|
214
221
|
"--Chip-",
|
|
222
|
+
"--Settings-",
|
|
215
223
|
"--glass-",
|
|
216
224
|
"--card-surface",
|
|
217
225
|
"--Nav-",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"name": "KSK Design System — Semantic Token Hex Cache",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.7.0",
|
|
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",
|