ksk-design-system 1.58.0 → 1.59.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 +7 -0
- package/contracts/components.json +1 -1
- package/contracts/product-theme-overrides.json +5 -1
- package/contracts/rules.json +1 -1
- package/contracts/token-hex-cache.json +1 -1
- package/package.json +1 -1
- package/src/styles/product-theme.css +15 -0
- package/src/styles/typography.css +23 -17
package/DESIGN.md
CHANGED
|
@@ -292,6 +292,7 @@ Portal に載る要素(Dialog / Sheet / Popover / Toast 等)は DOM 上の
|
|
|
292
292
|
| Product | `--Product-Page-Padding-Y` | 24px | AdminShell の `<main>` 縦 padding |
|
|
293
293
|
| Chip | `--Chip-Radius` | ピル | Chip の pill 角丸 |
|
|
294
294
|
| Tabs | `--Control-Height-Md` / `--Control-Padding-X-{Sm,Md}` / `--Control-Radius` / `--Field-Radius` | 40px / 12・16px / ピル / 8px | TabsList / TabsTrigger(Control・Field を再利用) |
|
|
295
|
+
| Typography | `--Product-Type-Scale` | 1 | `typo-*`(`src/styles/typography.css`)の font-size 全体 |
|
|
295
296
|
|
|
296
297
|
- **Control と Field はスケールが別**。ksk のフィールドは元々ボタンより背が高く(Input は 48px、
|
|
297
298
|
Button の既定は 40px)、横 padding も狭い。片方に畳むとどちらかの実寸が変わるので分けている。
|
|
@@ -310,6 +311,12 @@ Portal に載る要素(Dialog / Sheet / Popover / Toast 等)は DOM 上の
|
|
|
310
311
|
`AdminShell` の `<main>` だけが `--Product-Page-Padding-Y` を持つ。
|
|
311
312
|
- 色は従来どおり semantic トークン(`--Surface-*` / `--Text-*` / `--Brand-*`)と Brand ランプの
|
|
312
313
|
上書きで調整する。カードの面は `--card-surface`、角丸は `--Radius-Surface` が既存の公開シーム。
|
|
314
|
+
- **`--Product-Type-Scale`**(issue #371/#372 の stract-ui からの逆輸入)は `typo-*` の font-size に
|
|
315
|
+
`calc(<px> * var(--Product-Type-Scale, 1))` として一律で掛かる乗数。line-height は unitless、
|
|
316
|
+
letter-spacing は em のため font-size の変化に自動で連動し、別途スケールしない。
|
|
317
|
+
**Control / Field の高さ・padding には掛からない**(意図的な分離。文字だけ拡大して枠が追従しないと
|
|
318
|
+
窮屈になるため、拡大するプロダクトは `--Control-Height-*` / `--Field-Height-*` も別途上げる契約)。
|
|
319
|
+
Web のみが対象で、React Native(`src/tokens/native/scales.ts`)には効かない。
|
|
313
320
|
|
|
314
321
|
## Components
|
|
315
322
|
|
|
@@ -96,6 +96,9 @@
|
|
|
96
96
|
"chip": [
|
|
97
97
|
"--Chip-Radius"
|
|
98
98
|
],
|
|
99
|
+
"productTypography": [
|
|
100
|
+
"--Product-Type-Scale"
|
|
101
|
+
],
|
|
99
102
|
"motion": [
|
|
100
103
|
"--Motion-Duration-Fast",
|
|
101
104
|
"--Motion-Duration-Base",
|
|
@@ -166,6 +169,7 @@
|
|
|
166
169
|
"色は semantic トークン経由でのみ上書きする。Primitive を直接参照するのは Brand ランプ(--Primitive-Brand-*)だけが例外。",
|
|
167
170
|
"Checkbox / RadioGroup / Switch(20px の size-5 トグル)は意図的にこの契約の対象外。「コントロールの高さ」という概念が当てはまらない固定サイズのため、Control 変数を当てると意味が壊れる。",
|
|
168
171
|
"Chip は角丸(--Chip-Radius)だけを配線し、高さ・横 padding は配線しない。sm/md/lg の縦 margin(my-*)は「44px タッチターゲット - 本体高さ」ちょうどの手計算値で、height を変数化すると当たり判定の math が壊れる。",
|
|
169
|
-
"AppShell / MarketingShell / MobileAppShell はページ本文の padding をシェル自身が持たない(Container の gutter か呼び出し側の contentClassName に委ねている)ため product theme の対象外。AdminShell の <main> だけが --Product-Page-Padding-Y を持つ。"
|
|
172
|
+
"AppShell / MarketingShell / MobileAppShell はページ本文の padding をシェル自身が持たない(Container の gutter か呼び出し側の contentClassName に委ねている)ため product theme の対象外。AdminShell の <main> だけが --Product-Page-Padding-Y を持つ。",
|
|
173
|
+
"--Product-Type-Scale は typo-* の font-size に一律で掛かる乗数(既定 1)。文字倍率を上げたら Control(Button)/ Field(Input 等)の高さ・padding も --Control-Height-* / --Field-Height-* 等で別途上げること。この変数はコントロールの寸法には自動連動しない(文字だけ大きくして枠が追従しないと窮屈になるため、意図的に分離してある)。Web のみが対象で React Native(native/scales.ts)には効かない。"
|
|
170
174
|
]
|
|
171
175
|
}
|
package/contracts/rules.json
CHANGED
|
@@ -286,7 +286,7 @@
|
|
|
286
286
|
"id": "P032",
|
|
287
287
|
"severity": "warning",
|
|
288
288
|
"category": "token",
|
|
289
|
-
"pattern": "\\bborder(-[tblrxy])
|
|
289
|
+
"pattern": "\\bborder(-[tblrxy])?(?![-\\w\\[])(?![^\"']*(border-(\\[|transparent)|:border-))",
|
|
290
290
|
"excludes": [".stories.", "border-0", "border-2", "border-4", "border-collapse", "border-separate", "border-spacing", "border-solid", "border-dashed", "border-dotted", "border-none"],
|
|
291
291
|
"message": "色を併記しないボーダー幅クラス(border / border-b 等)は避ける。Tailwind v4 では border-color の既定が currentColor になったため、色を書かないと要素の文字色が透けて出て、消費側が濃色テキストを敷くと枠線が黒ずむ(job board で実際に発生)。preset.css の base layer が --border にフォールバックする保険を張るが、コンポーネントは明示が原則。",
|
|
292
292
|
"fix": "border-[var(--Border-Low-Emphasis)](区切り線・淡いカード)/ border-[var(--Border-Medium-Emphasis)](入力・強調)を併記する。状態で出し分けるタブ/バッジ/チップは border-transparent を初期色に置き、data-[state=active]:border-[var(--Brand-Primary)] 等のペア状態クラスで色を上書きする。"
|
|
@@ -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.59.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",
|
package/package.json
CHANGED
|
@@ -87,4 +87,19 @@
|
|
|
87
87
|
プロダクトによってはボタンを角ばらせつつチップだけピルのまま、といった
|
|
88
88
|
組み合わせがあり得るため(issue #364 追補)。 */
|
|
89
89
|
--Chip-Radius: 9999px; /* rounded-full 相当 */
|
|
90
|
+
|
|
91
|
+
/* ─── Product: 画面全体の文字サイズ倍率(issue #371/#372 の逆輸入) ───
|
|
92
|
+
`typo-*` の font-size に一律で掛かる乗数。line-height は unitless
|
|
93
|
+
(行間比率)なので font-size の変化に自動で追従し、letter-spacing は
|
|
94
|
+
em 指定なので同様に font-size に連動する。どちらも別途変数化しない。
|
|
95
|
+
|
|
96
|
+
Web 専用。React Native は CSS カスタムプロパティを解決できないため、
|
|
97
|
+
native 側のトークン(src/tokens/native/scales.ts の typography)は
|
|
98
|
+
この変数と独立に管理する。
|
|
99
|
+
|
|
100
|
+
Control(Button)/ Field(Input 等)の高さ・padding には**意図的に
|
|
101
|
+
掛けない**。文字だけ拡大して枠が追従しないと窮屈になるため、消費側は
|
|
102
|
+
文字を拡大するときは --Control-Height-* / --Field-Height-* も
|
|
103
|
+
別途上げる契約にしてある(stract-ui と同じ判断)。 */
|
|
104
|
+
--Product-Type-Scale: 1;
|
|
90
105
|
}
|
|
@@ -11,47 +11,53 @@
|
|
|
11
11
|
3. カラーは別途指定: className="typo-body-sm text-[var(--Text-Low-Emphasis)]"
|
|
12
12
|
4. レスポンシブ対応可: md:typo-heading-xl
|
|
13
13
|
5. CVA 内でも typo-* を使用する
|
|
14
|
+
|
|
15
|
+
font-size は calc(<px> * var(--Product-Type-Scale, 1)) 形式で書く
|
|
16
|
+
(既定 1 = 現行と同一px。src/styles/product-theme.css の
|
|
17
|
+
--Product-Type-Scale を参照。プロダクト単位の文字サイズ倍率、issue #371/#372)。
|
|
18
|
+
line-height は unitless(比率)、letter-spacing は em のためどちらも
|
|
19
|
+
font-size の変化に自動連動する。別途スケールしない。
|
|
14
20
|
============================================================= */
|
|
15
21
|
|
|
16
22
|
/* ─── Heading(見出し) ─── */
|
|
17
23
|
|
|
18
24
|
@utility typo-heading-3xl {
|
|
19
|
-
font-size: 28px;
|
|
25
|
+
font-size: calc(28px * var(--Product-Type-Scale, 1));
|
|
20
26
|
line-height: 1.5;
|
|
21
27
|
font-weight: 700;
|
|
22
28
|
letter-spacing: 0.04em;
|
|
23
29
|
}
|
|
24
30
|
|
|
25
31
|
@utility typo-heading-2xl {
|
|
26
|
-
font-size: 24px;
|
|
32
|
+
font-size: calc(24px * var(--Product-Type-Scale, 1));
|
|
27
33
|
line-height: 1.5;
|
|
28
34
|
font-weight: 700;
|
|
29
35
|
letter-spacing: 0.04em;
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
@utility typo-heading-xl {
|
|
33
|
-
font-size: 21px;
|
|
39
|
+
font-size: calc(21px * var(--Product-Type-Scale, 1));
|
|
34
40
|
line-height: 1.5;
|
|
35
41
|
font-weight: 700;
|
|
36
42
|
letter-spacing: 0.04em;
|
|
37
43
|
}
|
|
38
44
|
|
|
39
45
|
@utility typo-heading-lg {
|
|
40
|
-
font-size: 18px;
|
|
46
|
+
font-size: calc(18px * var(--Product-Type-Scale, 1));
|
|
41
47
|
line-height: 1.5;
|
|
42
48
|
font-weight: 700;
|
|
43
49
|
letter-spacing: 0.04em;
|
|
44
50
|
}
|
|
45
51
|
|
|
46
52
|
@utility typo-heading-md {
|
|
47
|
-
font-size: 16px;
|
|
53
|
+
font-size: calc(16px * var(--Product-Type-Scale, 1));
|
|
48
54
|
line-height: 1.5;
|
|
49
55
|
font-weight: 700;
|
|
50
56
|
letter-spacing: 0.04em;
|
|
51
57
|
}
|
|
52
58
|
|
|
53
59
|
@utility typo-heading-sm {
|
|
54
|
-
font-size: 14px;
|
|
60
|
+
font-size: calc(14px * var(--Product-Type-Scale, 1));
|
|
55
61
|
line-height: 1.5;
|
|
56
62
|
font-weight: 700;
|
|
57
63
|
letter-spacing: 0.04em;
|
|
@@ -60,19 +66,19 @@
|
|
|
60
66
|
/* ─── Body(本文) ─── */
|
|
61
67
|
|
|
62
68
|
@utility typo-body-lg {
|
|
63
|
-
font-size: 16px;
|
|
69
|
+
font-size: calc(16px * var(--Product-Type-Scale, 1));
|
|
64
70
|
line-height: 1.75;
|
|
65
71
|
font-weight: 400;
|
|
66
72
|
}
|
|
67
73
|
|
|
68
74
|
@utility typo-body-md {
|
|
69
|
-
font-size: 14px;
|
|
75
|
+
font-size: calc(14px * var(--Product-Type-Scale, 1));
|
|
70
76
|
line-height: 1.75;
|
|
71
77
|
font-weight: 400;
|
|
72
78
|
}
|
|
73
79
|
|
|
74
80
|
@utility typo-body-sm {
|
|
75
|
-
font-size: 12px;
|
|
81
|
+
font-size: calc(12px * var(--Product-Type-Scale, 1));
|
|
76
82
|
line-height: 1.5;
|
|
77
83
|
font-weight: 400;
|
|
78
84
|
}
|
|
@@ -81,7 +87,7 @@
|
|
|
81
87
|
本文の最小は typo-body-sm(12px)。10px を本文に使うとモバイル可読性の
|
|
82
88
|
下限(iOS HIG ~11pt / WCAG 観点)を割る。 */
|
|
83
89
|
@utility typo-body-xs {
|
|
84
|
-
font-size: 10px;
|
|
90
|
+
font-size: calc(10px * var(--Product-Type-Scale, 1));
|
|
85
91
|
line-height: 1.5;
|
|
86
92
|
font-weight: 400;
|
|
87
93
|
}
|
|
@@ -89,27 +95,27 @@
|
|
|
89
95
|
/* ─── Label(ボタン・ナビ・タグ) ─── */
|
|
90
96
|
|
|
91
97
|
@utility typo-label-lg {
|
|
92
|
-
font-size: 16px;
|
|
98
|
+
font-size: calc(16px * var(--Product-Type-Scale, 1));
|
|
93
99
|
line-height: 1.5;
|
|
94
100
|
font-weight: 700;
|
|
95
101
|
letter-spacing: 0.04em;
|
|
96
102
|
}
|
|
97
103
|
|
|
98
104
|
@utility typo-label-md {
|
|
99
|
-
font-size: 14px;
|
|
105
|
+
font-size: calc(14px * var(--Product-Type-Scale, 1));
|
|
100
106
|
line-height: 1.5;
|
|
101
107
|
font-weight: 700;
|
|
102
108
|
letter-spacing: 0.04em;
|
|
103
109
|
}
|
|
104
110
|
|
|
105
111
|
@utility typo-label-sm {
|
|
106
|
-
font-size: 12px;
|
|
112
|
+
font-size: calc(12px * var(--Product-Type-Scale, 1));
|
|
107
113
|
line-height: 1.5;
|
|
108
114
|
font-weight: 500;
|
|
109
115
|
}
|
|
110
116
|
|
|
111
117
|
@utility typo-label-xs {
|
|
112
|
-
font-size: 10px;
|
|
118
|
+
font-size: calc(10px * var(--Product-Type-Scale, 1));
|
|
113
119
|
line-height: 1.5;
|
|
114
120
|
font-weight: 500;
|
|
115
121
|
}
|
|
@@ -117,14 +123,14 @@
|
|
|
117
123
|
/* ─── Display(ヒーロー・ランディング用) ─── */
|
|
118
124
|
|
|
119
125
|
@utility typo-display-xl {
|
|
120
|
-
font-size: 48px;
|
|
126
|
+
font-size: calc(48px * var(--Product-Type-Scale, 1));
|
|
121
127
|
line-height: 1.25;
|
|
122
128
|
font-weight: 700;
|
|
123
129
|
letter-spacing: -0.02em;
|
|
124
130
|
}
|
|
125
131
|
|
|
126
132
|
@utility typo-display-lg {
|
|
127
|
-
font-size: 36px;
|
|
133
|
+
font-size: calc(36px * var(--Product-Type-Scale, 1));
|
|
128
134
|
line-height: 1.3;
|
|
129
135
|
font-weight: 700;
|
|
130
136
|
letter-spacing: -0.01em;
|
|
@@ -134,7 +140,7 @@
|
|
|
134
140
|
caption(11px) は非必須の注釈・法的表記のみ。本文には使わない(本文下限は body-sm=12px)。 */
|
|
135
141
|
|
|
136
142
|
@utility typo-caption {
|
|
137
|
-
font-size: 11px;
|
|
143
|
+
font-size: calc(11px * var(--Product-Type-Scale, 1));
|
|
138
144
|
line-height: 1.5;
|
|
139
145
|
font-weight: 400;
|
|
140
146
|
}
|