ksk-design-system 2.2.0 → 2.4.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/DESIGN.md +19 -19
- package/README.md +20 -3
- package/contracts/components.json +1 -1
- package/contracts/token-hex-cache.json +28 -28
- package/dist/native/ui.js +1 -1
- package/dist/{native-DlR32_Lk.js → native-BsJ3ntN3.js} +235 -235
- package/dist/native.js +1 -1
- package/dist/types/tokens/native/primitives.d.ts +21 -21
- package/dist/types/tokens/native/scales.d.ts +16 -16
- package/dist/types/tokens/native/themes.d.ts +198 -198
- package/package.json +1 -1
- package/src/components/COMPONENT_LOOKUP.md +1 -1
- package/src/preset.css +1 -1
- package/src/styles/primitive.css +21 -21
- package/src/styles/typography.css +6 -6
- package/tokens.json +39 -29
package/DESIGN.md
CHANGED
|
@@ -12,18 +12,18 @@ colors:
|
|
|
12
12
|
onPrimary: "#FFFFFF"
|
|
13
13
|
# --- Neutral scale ---
|
|
14
14
|
neutral0: "#FFFFFF"
|
|
15
|
-
neutral50: "#
|
|
16
|
-
neutral100: "#
|
|
17
|
-
neutral200: "#
|
|
18
|
-
neutral500: "#
|
|
19
|
-
neutral900: "#
|
|
15
|
+
neutral50: "#FAFAFA"
|
|
16
|
+
neutral100: "#F4F4F5"
|
|
17
|
+
neutral200: "#E4E4E7"
|
|
18
|
+
neutral500: "#71717A"
|
|
19
|
+
neutral900: "#18181B"
|
|
20
20
|
# --- Surface / Text / Border(semantic) ---
|
|
21
21
|
surface: "#FFFFFF" # var(--Surface-Primary)
|
|
22
|
-
surfaceMuted: "#
|
|
23
|
-
textHigh: "#
|
|
24
|
-
textMedium: "#
|
|
25
|
-
textLow: "#
|
|
26
|
-
border: "#
|
|
22
|
+
surfaceMuted: "#FAFAFA" # var(--Surface-Secondary)
|
|
23
|
+
textHigh: "#18181B" # var(--Text-High-Emphasis)
|
|
24
|
+
textMedium: "#3F3F46" # var(--Text-Medium-Emphasis)
|
|
25
|
+
textLow: "#52525B" # var(--Text-Low-Emphasis)
|
|
26
|
+
border: "#E4E4E7" # var(--Border-Low-Emphasis)
|
|
27
27
|
focus: "#60A5FA" # var(--Focus-High-Emphasis)
|
|
28
28
|
# --- Semantic(status) ---
|
|
29
29
|
success: "#15803D"
|
|
@@ -34,12 +34,12 @@ typography:
|
|
|
34
34
|
fontFamily: "system-ui, -apple-system, 'Hiragino Sans', 'Noto Sans JP', sans-serif"
|
|
35
35
|
display: { fontSize: "48px", lineHeight: "1.25", fontWeight: 700 } # typo-display-xl
|
|
36
36
|
heading: { fontSize: "18px", lineHeight: "1.5", fontWeight: 700 } # typo-heading-lg(基準)
|
|
37
|
-
body: { fontSize: "
|
|
37
|
+
body: { fontSize: "16px", lineHeight: "1.75", fontWeight: 400 } # typo-body-md(基準)
|
|
38
38
|
label: { fontSize: "12px", lineHeight: "1.5", fontWeight: 500 } # typo-label-sm
|
|
39
|
-
caption: { fontSize: "11px", lineHeight: "1.5", fontWeight: 400 } # typo-caption(注釈/法的表記専用。本文の下限は body=12px
|
|
39
|
+
caption: { fontSize: "11px", lineHeight: "1.5", fontWeight: 400 } # typo-caption(注釈/法的表記専用。本文の下限は body=14px。12px の typo-body-xs は補助ラベル専用で本文禁止)
|
|
40
40
|
rounded:
|
|
41
41
|
sm: "4px"
|
|
42
|
-
surface: "
|
|
42
|
+
surface: "14px" # Card / Input / Popover → var(--Radius-Surface)
|
|
43
43
|
modal: "24px" # 中央 Dialog / AlertDialog → var(--Radius-Modal)
|
|
44
44
|
sheet: "32px" # bottom / float Sheet → var(--Radius-Sheet)
|
|
45
45
|
full: "9999px" # Button / Chip
|
|
@@ -50,8 +50,8 @@ spacing:
|
|
|
50
50
|
elevation: # 影色は neutral(Gray-900 ベース rgba(17,24,39,…))でテーマ非依存
|
|
51
51
|
sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)"
|
|
52
52
|
md: "0 0 8px rgba(20, 20, 20, 0.08)"
|
|
53
|
-
lg: "0px 12px 32px -4px rgba(
|
|
54
|
-
dialog: "0px 12px 32px -4px rgba(
|
|
53
|
+
lg: "0px 12px 32px -4px rgba(24, 24, 27, 0.12), 0px 8px 16px -6px rgba(24, 24, 27, 0.12)"
|
|
54
|
+
dialog: "0px 12px 32px -4px rgba(24, 24, 27, 0.12), 0px 8px 16px -6px rgba(24, 24, 27, 0.12), 0px 1px 4px 1px rgba(0, 0, 0, 0.2)"
|
|
55
55
|
motion: # 実体は var(--Motion-*)(src/styles/motion.css)
|
|
56
56
|
microIn: "150ms ease-out" # --Motion-Duration-Fast / fade-in / scale-in
|
|
57
57
|
enter: "200ms ease-out" # --Motion-Duration-Base / fade-in-up / slide-in
|
|
@@ -135,9 +135,9 @@ KSK の必須正本・publish 依存にせず、KSK 固有の multi-theme / nati
|
|
|
135
135
|
| 用途 | トークン | 既定値(Blue) |
|
|
136
136
|
|---|---|---|
|
|
137
137
|
| ブランド | `var(--Brand-Primary)` | `#2563EB` |
|
|
138
|
-
| 背景(白/薄灰) | `var(--Surface-Primary)` / `-Secondary` | `#FFFFFF` / `#
|
|
139
|
-
| 文字(強/中/弱) | `var(--Text-High/Medium/Low-Emphasis)` <!-- docs-drift-ignore: --Text-High/Medium/Low-Emphasis --> | `#
|
|
140
|
-
| 罫線 | `var(--Border-Low-Emphasis)` | `#
|
|
138
|
+
| 背景(白/薄灰) | `var(--Surface-Primary)` / `-Secondary` | `#FFFFFF` / `#FAFAFA` |
|
|
139
|
+
| 文字(強/中/弱) | `var(--Text-High/Medium/Low-Emphasis)` <!-- docs-drift-ignore: --Text-High/Medium/Low-Emphasis --> | `#18181B` / `#3F3F46` / `#52525B` |
|
|
140
|
+
| 罫線 | `var(--Border-Low-Emphasis)` | `#E4E4E7` |
|
|
141
141
|
| 状態 | `--Success/Warning/Caution/Info-Base` <!-- docs-drift-ignore: --Success/Warning/Caution/Info-Base --> | `#15803D` / `#C2410C` / `#DC2626` / `#2563EB` |
|
|
142
142
|
|
|
143
143
|
- **状態色の正本**: 上記は `*-Base`。Caution/Info は Primitive **600**、Success/Warning は白文字 AA(4.5:1) 確保のため Primitive **700**(600 だと 3.3〜3.6:1)。`tokens.json` を正本とし、本表はその要約。
|
|
@@ -153,7 +153,7 @@ KSK の必須正本・publish 依存にせず、KSK 固有の multi-theme / nati
|
|
|
153
153
|
`typo-*` ユーティリティ1クラスに size/line-height/weight/tracking を集約。`text-sm`/`font-bold` 等の個別指定は禁止。
|
|
154
154
|
|
|
155
155
|
- 見出し: `typo-heading-{sm..3xl}`(14→28px, line-height 1.5, 700)
|
|
156
|
-
- 本文: `typo-body-{xs..lg}`(
|
|
156
|
+
- 本文: `typo-body-{xs..lg}`(12→18px, line-height 1.75 系)
|
|
157
157
|
- ラベル: `typo-label-{xs..lg}`(10→16px, 500)/ 特大: `typo-display-xl`(48px)
|
|
158
158
|
- 色は別指定: `className="typo-body-sm text-[var(--Text-Low-Emphasis)]"`
|
|
159
159
|
|
package/README.md
CHANGED
|
@@ -76,14 +76,17 @@ DS のルールが適用されません。既存ファイルはスキップさ
|
|
|
76
76
|
> として Critical 判定されるためです(LPM Firewall が 1.49.2 / 1.51.1 をこの理由でブロック判定)。
|
|
77
77
|
> v1.59.0 以前から更新する場合、既に設置済みのファイルはそのまま使えます。
|
|
78
78
|
|
|
79
|
+
<!-- consumer-example:css:start -->
|
|
79
80
|
```css
|
|
80
|
-
/*
|
|
81
|
+
/* src/styles/app.css(アプリのルートで一度だけ読み込む) */
|
|
81
82
|
@import "tailwindcss";
|
|
82
83
|
@import "ksk-design-system/preset";
|
|
83
84
|
@import "ksk-design-system/themes/default";
|
|
84
|
-
@import "./themes/my-client.css"; /* Brand 色を差し替えたテーマ */
|
|
85
85
|
@source "../../node_modules/ksk-design-system/dist";
|
|
86
86
|
```
|
|
87
|
+
<!-- consumer-example:css:end -->
|
|
88
|
+
|
|
89
|
+
独自ブランドのテーマを使う場合は、この後にテーマCSSをimportしてください。
|
|
87
90
|
|
|
88
91
|
Tailwind CSS v4 は `node_modules` を既定では走査しません。`@source` がないと、
|
|
89
92
|
DS 内部だけで使うレイアウト・サイズ・状態クラスが生成されず、コンポーネントの表示や操作が崩れます。
|
|
@@ -94,9 +97,23 @@ consumer 側の Tailwind と DS を同じビルドで処理するため、上記
|
|
|
94
97
|
DS のクラス CSS は生成されます(issue #258)。ただし consumer 自身のコードは
|
|
95
98
|
consumer 側の走査対象なので、`@source` は引き続き推奨構成です。
|
|
96
99
|
|
|
100
|
+
<!-- consumer-example:tsx:start -->
|
|
97
101
|
```tsx
|
|
98
|
-
import { Button,
|
|
102
|
+
import { Button, Input, Label } from "ksk-design-system"
|
|
103
|
+
|
|
104
|
+
export function Example() {
|
|
105
|
+
return (
|
|
106
|
+
<form>
|
|
107
|
+
<Label htmlFor="company">会社名</Label>
|
|
108
|
+
<Input id="company" name="company" defaultValue="サンプル株式会社" />
|
|
109
|
+
<Button type="submit">保存</Button>
|
|
110
|
+
</form>
|
|
111
|
+
)
|
|
112
|
+
}
|
|
99
113
|
```
|
|
114
|
+
<!-- consumer-example:tsx:end -->
|
|
115
|
+
|
|
116
|
+
DSリポジトリの開発者向け検査として、`npm run test:consumer:web` は、配布READMEの上記例を空consumerで型検査・CSSビルドし、Node SSRからChromiumへのhydrationと操作を検査します。初回は `npx playwright install chromium` が必要です。
|
|
100
117
|
|
|
101
118
|
新規クライアント案件では、テーマファイルで `--Primitive-Brand-500` などブランドカラーの 10 行を定義するだけで、全コンポーネントがそのブランドカラーで動作します。
|
|
102
119
|
|
|
@@ -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.4.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",
|
|
@@ -288,10 +288,10 @@
|
|
|
288
288
|
},
|
|
289
289
|
"semantic": {
|
|
290
290
|
"surface.primary": "#FFFFFF",
|
|
291
|
-
"surface.secondary": "#
|
|
292
|
-
"surface.tertiary": "#
|
|
293
|
-
"surface.quaternary": "#
|
|
294
|
-
"surface.inverse": "#
|
|
291
|
+
"surface.secondary": "#FAFAFA",
|
|
292
|
+
"surface.tertiary": "#F4F4F5",
|
|
293
|
+
"surface.quaternary": "#E4E4E7",
|
|
294
|
+
"surface.inverse": "#18181B",
|
|
295
295
|
"surface.accent-primary": "#3B82F6",
|
|
296
296
|
"surface.accent-primary-light": "#EFF6FF",
|
|
297
297
|
"surface.caution": "#FEF2F2",
|
|
@@ -299,11 +299,11 @@
|
|
|
299
299
|
"surface.warning": "#FFFBEB",
|
|
300
300
|
"surface.info": "#EFF6FF",
|
|
301
301
|
"surface.caution-strong": "#EF4444",
|
|
302
|
-
"surface.disable": "#
|
|
303
|
-
"text.high-emphasis": "#
|
|
304
|
-
"text.medium-emphasis": "#
|
|
305
|
-
"text.low-emphasis": "#
|
|
306
|
-
"text.disable": "#
|
|
302
|
+
"surface.disable": "#F4F4F5",
|
|
303
|
+
"text.high-emphasis": "#18181B",
|
|
304
|
+
"text.medium-emphasis": "#3F3F46",
|
|
305
|
+
"text.low-emphasis": "#52525B",
|
|
306
|
+
"text.disable": "#A1A1AA",
|
|
307
307
|
"text.on-inverse": "#FFFFFF",
|
|
308
308
|
"text.on-media": "#FFFFFF",
|
|
309
309
|
"text.accent-primary": "#2563EB",
|
|
@@ -312,10 +312,10 @@
|
|
|
312
312
|
"text.warning": "#C2410C",
|
|
313
313
|
"text.info": "#2563EB",
|
|
314
314
|
"text.caution-on-inverse": "#F87171",
|
|
315
|
-
"object.high-emphasis": "#
|
|
316
|
-
"object.medium-emphasis": "#
|
|
317
|
-
"object.low-emphasis": "#
|
|
318
|
-
"object.disable": "#
|
|
315
|
+
"object.high-emphasis": "#18181B",
|
|
316
|
+
"object.medium-emphasis": "#52525B",
|
|
317
|
+
"object.low-emphasis": "#A1A1AA",
|
|
318
|
+
"object.disable": "#D4D4D8",
|
|
319
319
|
"object.on-inverse": "#FFFFFF",
|
|
320
320
|
"object.accent-primary": "#3B82F6",
|
|
321
321
|
"object.caution": "#EF4444",
|
|
@@ -323,9 +323,9 @@
|
|
|
323
323
|
"object.warning": "#F97316",
|
|
324
324
|
"object.info": "#3B82F6",
|
|
325
325
|
"object.rating": "#F59E0B",
|
|
326
|
-
"border.high-emphasis": "#
|
|
327
|
-
"border.medium-emphasis": "#
|
|
328
|
-
"border.low-emphasis": "#
|
|
326
|
+
"border.high-emphasis": "#3F3F46",
|
|
327
|
+
"border.medium-emphasis": "#D4D4D8",
|
|
328
|
+
"border.low-emphasis": "#E4E4E7",
|
|
329
329
|
"border.accent-primary": "#3B82F6",
|
|
330
330
|
"border.caution": "#EF4444",
|
|
331
331
|
"border.success": "#22C55E",
|
|
@@ -341,13 +341,13 @@
|
|
|
341
341
|
"brand.amazon": "#232F3E",
|
|
342
342
|
"hover.primary-button": "#1D4ED8",
|
|
343
343
|
"hover.secondary-button": "#EFF6FF",
|
|
344
|
-
"hover.tertiary-button": "#
|
|
345
|
-
"hover.ghost-button": "#
|
|
344
|
+
"hover.tertiary-button": "#F4F4F5",
|
|
345
|
+
"hover.ghost-button": "#F4F4F5",
|
|
346
346
|
"hover.destructive-button": "#B91C1C",
|
|
347
347
|
"active.primary-button": "#1E40AF",
|
|
348
348
|
"active.destructive-button": "#991B1B",
|
|
349
349
|
"active.secondary-button": "#DBEAFE",
|
|
350
|
-
"active.tertiary-button": "#
|
|
350
|
+
"active.tertiary-button": "#E4E4E7",
|
|
351
351
|
"focus.high-emphasis": "#60A5FA",
|
|
352
352
|
"caution.base": "#DC2626",
|
|
353
353
|
"caution.action": "#B91C1C",
|
|
@@ -408,10 +408,10 @@
|
|
|
408
408
|
"categorical.16.bold": "#6D28D9"
|
|
409
409
|
},
|
|
410
410
|
"semanticDark": {
|
|
411
|
-
"surface.primary": "#
|
|
412
|
-
"surface.secondary": "#
|
|
413
|
-
"surface.tertiary": "#
|
|
414
|
-
"surface.quaternary": "#
|
|
411
|
+
"surface.primary": "#18181B",
|
|
412
|
+
"surface.secondary": "#27272A",
|
|
413
|
+
"surface.tertiary": "#3F3F46",
|
|
414
|
+
"surface.quaternary": "#52525B",
|
|
415
415
|
"surface.inverse": "#FFFFFF",
|
|
416
416
|
"surface.accent-primary": "#3B82F6",
|
|
417
417
|
"surface.accent-primary-light": "#1E3A8A",
|
|
@@ -420,8 +420,8 @@
|
|
|
420
420
|
"surface.warning": "#78350F",
|
|
421
421
|
"surface.info": "#1E3A8A",
|
|
422
422
|
"surface.caution-strong": "#EF4444",
|
|
423
|
-
"surface.disable": "#
|
|
424
|
-
"text.on-inverse": "#
|
|
423
|
+
"surface.disable": "#27272A",
|
|
424
|
+
"text.on-inverse": "#18181B",
|
|
425
425
|
"text.on-media": "#FFFFFF",
|
|
426
426
|
"text.accent-primary": "#60A5FA",
|
|
427
427
|
"text.success": "#4ADE80",
|
|
@@ -429,8 +429,8 @@
|
|
|
429
429
|
"text.warning": "#FB923C",
|
|
430
430
|
"text.info": "#60A5FA",
|
|
431
431
|
"text.caution-on-inverse": "#B91C1C",
|
|
432
|
-
"text.on-inverse-secondary": "#
|
|
433
|
-
"object.on-inverse": "#
|
|
432
|
+
"text.on-inverse-secondary": "#3F3F46",
|
|
433
|
+
"object.on-inverse": "#18181B",
|
|
434
434
|
"object.accent-primary": "#60A5FA",
|
|
435
435
|
"object.caution": "#F87171",
|
|
436
436
|
"object.success": "#4ADE80",
|
package/dist/native/ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "../prompt-coordinator-sBFZKQIX.js";
|
|
2
|
-
import { a as u, i as d, n as f, r as p, t as m } from "../native-
|
|
2
|
+
import { a as u, i as d, n as f, r as p, t as m } from "../native-BsJ3ntN3.js";
|
|
3
3
|
import * as h from "react";
|
|
4
4
|
import g, { createContext as _, useCallback as v, useContext as y, useEffect as b, useId as x, useMemo as S, useRef as C, useState as w } from "react";
|
|
5
5
|
import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|