ksk-design-system 2.6.4 → 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/components.json +1 -1
- package/contracts/consumer-requests.json +20 -0
- package/contracts/token-hex-cache.json +1 -1
- package/dist/native/ui.js +530 -509
- package/dist/types/native/components/Alert.d.ts +4 -1
- package/dist/types/native/components/StatCard.d.ts +8 -1
- package/dist/types/native/components/index.d.ts +1 -1
- package/dist/types/native/sheet-snap-gesture.d.ts +2 -0
- package/package.json +10 -1
- package/src/preset-core.css +252 -0
- package/src/preset.css +7 -232
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export type AlertTone = "info" | "success" | "warning" | "caution";
|
|
3
|
+
export type AlertVariant = "inline-info" | "inline-warning" | "inline-caution";
|
|
3
4
|
export interface AlertProps {
|
|
5
|
+
/** Borderless inline presentation, matching the Web Alert variants. Overrides tone. */
|
|
6
|
+
variant?: AlertVariant;
|
|
4
7
|
tone?: AlertTone;
|
|
5
8
|
title?: string;
|
|
6
9
|
description?: string;
|
|
7
10
|
children?: React.ReactNode;
|
|
8
11
|
}
|
|
9
|
-
export declare function Alert({ tone, title, description, children }: AlertProps): React.JSX.Element;
|
|
12
|
+
export declare function Alert({ tone, variant, title, description, children }: AlertProps): React.JSX.Element;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { type StyleProp, type ViewStyle, type TextProps } from "react-native";
|
|
2
3
|
export interface StatCardProps {
|
|
4
|
+
/** Card surface layout, including stretch within an equal-height row. */
|
|
5
|
+
style?: StyleProp<ViewStyle>;
|
|
6
|
+
/** Minimum label slot height; grows naturally when Dynamic Type needs more space. */
|
|
7
|
+
labelMinHeight?: number;
|
|
8
|
+
/** Reports natural label layout, independently of the label slot minimum. */
|
|
9
|
+
onLabelLayout?: TextProps["onLayout"];
|
|
3
10
|
label: string;
|
|
4
11
|
value: string | number;
|
|
5
12
|
delta?: string;
|
|
6
13
|
trend?: "up" | "down" | "neutral";
|
|
7
14
|
}
|
|
8
|
-
export declare function StatCard({ label, value, delta, trend }: StatCardProps): React.JSX.Element;
|
|
15
|
+
export declare function StatCard({ label, value, delta, trend, style, labelMinHeight, onLabelLayout }: StatCardProps): React.JSX.Element;
|
|
@@ -41,7 +41,7 @@ export { Slider, type SliderProps } from "./Slider";
|
|
|
41
41
|
export { NumberInput, type NumberInputProps } from "./NumberInput";
|
|
42
42
|
export { FormField, type FormFieldProps } from "./FormField";
|
|
43
43
|
export { FormRoot, FormSection, FormActions, type FormRootProps, type FormSectionProps, type FormActionsProps, } from "./Form";
|
|
44
|
-
export { Alert, type AlertProps, type AlertTone } from "./Alert";
|
|
44
|
+
export { Alert, type AlertProps, type AlertTone, type AlertVariant } from "./Alert";
|
|
45
45
|
export { Dialog, type DialogProps, type DialogPosition } from "./Dialog";
|
|
46
46
|
export { Scrim, type ScrimProps, type ScrimAlign } from "./Scrim";
|
|
47
47
|
export { AlertDialog, type AlertDialogProps } from "./AlertDialog";
|
|
@@ -51,3 +51,5 @@ export type ReleaseAction = {
|
|
|
51
51
|
};
|
|
52
52
|
/** 指を離した時の着地先。close は dismissible のときだけ返す。 */
|
|
53
53
|
export declare function resolveRelease(startTY: number, dy: number, startActive: number, config: SnapGestureConfig): ReleaseAction;
|
|
54
|
+
/** The dedicated handle is draggable even when body content is scrolled. */
|
|
55
|
+
export declare function shouldStartHandleDrag(animating: boolean, keyboardReducedViewport: boolean): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ksk-design-system",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "KSK Design System — フリーランス向けマルチテーマ対応デザインシステム",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"CLAUDE.md",
|
|
27
27
|
"DESIGN.md",
|
|
28
28
|
"src/preset.css",
|
|
29
|
+
"src/preset-core.css",
|
|
29
30
|
"src/styles",
|
|
30
31
|
"src/themes",
|
|
31
32
|
"src/components/COMPONENT_LOOKUP.md",
|
|
@@ -65,6 +66,14 @@
|
|
|
65
66
|
"import": "./src/preset.css",
|
|
66
67
|
"default": "./src/preset.css"
|
|
67
68
|
},
|
|
69
|
+
"./preset-core": {
|
|
70
|
+
"import": "./src/preset-core.css",
|
|
71
|
+
"default": "./src/preset-core.css"
|
|
72
|
+
},
|
|
73
|
+
"./safelist": {
|
|
74
|
+
"import": "./src/styles/source-safelist.css",
|
|
75
|
+
"default": "./src/styles/source-safelist.css"
|
|
76
|
+
},
|
|
68
77
|
"./styles": {
|
|
69
78
|
"import": "./src/preset.css",
|
|
70
79
|
"default": "./src/preset.css"
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/* =============================================================
|
|
2
|
+
KSK Design System — Preset Core CSS
|
|
3
|
+
|
|
4
|
+
preset から「DS 部品用の safelist(styles/source-safelist.css)」だけを
|
|
5
|
+
除いたもの。トークン・shadcn 互換ブリッジ・アニメーション・
|
|
6
|
+
container 幅・scrollbar-hide・base layer の保険はすべて含む。
|
|
7
|
+
|
|
8
|
+
使い方(DS 部品を使わないページだけの consumer):
|
|
9
|
+
@import "tailwindcss";
|
|
10
|
+
@import "ksk-design-system/preset-core";
|
|
11
|
+
@import "ksk-design-system/themes/default";
|
|
12
|
+
|
|
13
|
+
DS 部品(Button 等)を使う consumer は従来どおり
|
|
14
|
+
`ksk-design-system/preset`(= preset-core + safelist)を使うこと。
|
|
15
|
+
safelist が無いと、DS 部品内部でしか使わないユーティリティは
|
|
16
|
+
consumer の @source が DS の dist を走査したときにしか生成されない。
|
|
17
|
+
|
|
18
|
+
preset.css はこのファイルと safelist を読み込むだけの薄い入口。
|
|
19
|
+
トークンや base layer を足すときはこのファイルに書く。
|
|
20
|
+
============================================================= */
|
|
21
|
+
|
|
22
|
+
@import "./styles/primitive.css";
|
|
23
|
+
/* 角丸の意味別トークン(issue #553)。定義元は styles/radius.css の1箇所で、
|
|
24
|
+
product-theme.css からも読み込まれる(個別 subpath 構成の消費側対策)。 */
|
|
25
|
+
@import "./styles/radius.css";
|
|
26
|
+
/* ページセクション間の縦リズム(issue #560)。定義元は
|
|
27
|
+
styles/section-spacing.css の1箇所で、product-theme.css からも読み込まれる
|
|
28
|
+
(個別 subpath 構成の消費側対策)。 */
|
|
29
|
+
@import "./styles/section-spacing.css";
|
|
30
|
+
/* 重なり順(issue #563)。定義元は styles/z-index.css の1箇所で、
|
|
31
|
+
product-theme.css からも読み込まれる(個別 subpath 構成の消費側対策)。 */
|
|
32
|
+
@import "./styles/z-index.css";
|
|
33
|
+
/* 影(issue #563)。定義元は styles/shadow.css の1箇所で、
|
|
34
|
+
product-theme.css からも読み込まれる(個別 subpath 構成の消費側対策)。 */
|
|
35
|
+
@import "./styles/shadow.css";
|
|
36
|
+
@import "./styles/semantic.css";
|
|
37
|
+
@import "./styles/categorical.css";
|
|
38
|
+
@import "./styles/typography.css";
|
|
39
|
+
@import "./styles/glass.css";
|
|
40
|
+
@import "./styles/bottom-nav.css";
|
|
41
|
+
@import "./styles/motion.css";
|
|
42
|
+
@import "./styles/sheet-keyboard.css";
|
|
43
|
+
/* プロダクト単位で上書きしてよい寸法・面の公開変数(issue #364)。
|
|
44
|
+
許可リストの正本は contracts/product-theme-overrides.json。 */
|
|
45
|
+
@import "./styles/product-theme.css";
|
|
46
|
+
|
|
47
|
+
/* ─── Bridge Layer: shadcn/ui 互換マッピング ───
|
|
48
|
+
|
|
49
|
+
命名が 2 系統あるのは意図的な設計。統一しない。
|
|
50
|
+
|
|
51
|
+
- `--Surface-Primary` のような **PascalCase-ケバブ** は KSK の semantic 層。
|
|
52
|
+
UI を書くときに参照するのは常にこちら(CLAUDE.md のセルフチェック参照)。
|
|
53
|
+
- `--primary` / `--muted-foreground` のような **小文字ケバブ** は shadcn/ui
|
|
54
|
+
(および Radix ベースの外部コンポーネント)が決め打ちで参照する名前。
|
|
55
|
+
shadcn の CLI で追加したコンポーネントや、consumer が別途入れた
|
|
56
|
+
shadcn 資産をそのまま動かすための互換レイヤーであり、名前は
|
|
57
|
+
shadcn 側の仕様なので KSK 側では変えられない。
|
|
58
|
+
|
|
59
|
+
つまり小文字ケバブ側は「外部規約への適合」であって命名の揺れではない。
|
|
60
|
+
新しいトークンを増やすときは PascalCase 側(semantic.css)に足し、
|
|
61
|
+
shadcn 互換名が必要な場合だけここで var() でエイリアスすること。 */
|
|
62
|
+
:root {
|
|
63
|
+
--radius: 0.5rem;
|
|
64
|
+
|
|
65
|
+
--background: var(--Surface-Primary);
|
|
66
|
+
--foreground: var(--Text-High-Emphasis);
|
|
67
|
+
|
|
68
|
+
--card: var(--Surface-Primary);
|
|
69
|
+
--card-foreground: var(--Text-High-Emphasis);
|
|
70
|
+
|
|
71
|
+
--popover: var(--Surface-Primary);
|
|
72
|
+
--popover-foreground: var(--Text-High-Emphasis);
|
|
73
|
+
|
|
74
|
+
--primary: var(--Brand-Primary);
|
|
75
|
+
--primary-foreground: var(--Text-on-Inverse);
|
|
76
|
+
|
|
77
|
+
--secondary: var(--Surface-Secondary);
|
|
78
|
+
--secondary-foreground: var(--Text-High-Emphasis);
|
|
79
|
+
|
|
80
|
+
--muted: var(--Surface-Tertiary);
|
|
81
|
+
--muted-foreground: var(--Text-Low-Emphasis);
|
|
82
|
+
|
|
83
|
+
--accent: var(--Surface-Secondary);
|
|
84
|
+
--accent-foreground: var(--Text-High-Emphasis);
|
|
85
|
+
|
|
86
|
+
--destructive: var(--Caution-Base);
|
|
87
|
+
--destructive-foreground: var(--Text-on-Inverse);
|
|
88
|
+
|
|
89
|
+
--border: var(--Border-Medium-Emphasis);
|
|
90
|
+
--input: var(--Border-Medium-Emphasis);
|
|
91
|
+
--ring: var(--Focus-High-Emphasis);
|
|
92
|
+
|
|
93
|
+
--sidebar-background: var(--Surface-Primary);
|
|
94
|
+
--sidebar-foreground: var(--Text-High-Emphasis);
|
|
95
|
+
--sidebar-primary: var(--Brand-Primary);
|
|
96
|
+
--sidebar-primary-foreground: var(--Text-on-Inverse);
|
|
97
|
+
--sidebar-accent: var(--Surface-Accent-Primary-Light);
|
|
98
|
+
--sidebar-accent-foreground: var(--Text-Accent-Primary);
|
|
99
|
+
--sidebar-border: var(--Border-Low-Emphasis);
|
|
100
|
+
--sidebar-ring: var(--Focus-High-Emphasis);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.dark {
|
|
104
|
+
--background: var(--Surface-Primary);
|
|
105
|
+
--foreground: var(--Text-High-Emphasis);
|
|
106
|
+
--card: var(--Surface-Secondary);
|
|
107
|
+
--card-foreground: var(--Text-High-Emphasis);
|
|
108
|
+
--popover: var(--Surface-Secondary);
|
|
109
|
+
--popover-foreground: var(--Text-High-Emphasis);
|
|
110
|
+
--primary: var(--Brand-Primary);
|
|
111
|
+
--primary-foreground: var(--Text-on-Inverse);
|
|
112
|
+
--secondary: var(--Surface-Tertiary);
|
|
113
|
+
--secondary-foreground: var(--Text-High-Emphasis);
|
|
114
|
+
--muted: var(--Surface-Tertiary);
|
|
115
|
+
--muted-foreground: var(--Text-Low-Emphasis);
|
|
116
|
+
--accent: var(--Surface-Tertiary);
|
|
117
|
+
--accent-foreground: var(--Text-High-Emphasis);
|
|
118
|
+
--destructive: var(--Caution-Base);
|
|
119
|
+
--destructive-foreground: var(--Text-on-Inverse);
|
|
120
|
+
--border: var(--Border-Medium-Emphasis);
|
|
121
|
+
--input: var(--Border-Medium-Emphasis);
|
|
122
|
+
--ring: var(--Focus-High-Emphasis);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* ─── Radius Tokens ───
|
|
126
|
+
定義はこのファイルから styles/radius.css へ切り出した(issue #553)。
|
|
127
|
+
ファイル先頭の @import 群で読み込んでいる。 */
|
|
128
|
+
|
|
129
|
+
/* ─── Section Spacing Tokens ───
|
|
130
|
+
定義はこのファイルから styles/section-spacing.css へ切り出した(issue #560)。
|
|
131
|
+
ファイル先頭の @import 群で読み込んでいる。 */
|
|
132
|
+
|
|
133
|
+
/* ─── Z-Index Scale ───
|
|
134
|
+
定義はこのファイルから styles/z-index.css へ切り出した(issue #563)。
|
|
135
|
+
ファイル先頭の @import 群で読み込んでいる。 */
|
|
136
|
+
|
|
137
|
+
/* ─── Shadow Tokens ───
|
|
138
|
+
定義はこのファイルから styles/shadow.css へ切り出した(issue #563)。
|
|
139
|
+
ファイル先頭の @import 群で読み込んでいる。 */
|
|
140
|
+
|
|
141
|
+
/* ─── Animation ─── */
|
|
142
|
+
@keyframes slide-in-right {
|
|
143
|
+
from { transform: translateX(100%); opacity: 0; }
|
|
144
|
+
to { transform: translateX(0); opacity: 1; }
|
|
145
|
+
}
|
|
146
|
+
@keyframes slide-in-left {
|
|
147
|
+
from { transform: translateX(-100%); opacity: 0; }
|
|
148
|
+
to { transform: translateX(0); opacity: 1; }
|
|
149
|
+
}
|
|
150
|
+
@keyframes fade-in {
|
|
151
|
+
from { opacity: 0; }
|
|
152
|
+
to { opacity: 1; }
|
|
153
|
+
}
|
|
154
|
+
@keyframes fade-in-up {
|
|
155
|
+
from { opacity: 0; transform: translateY(8px); }
|
|
156
|
+
to { opacity: 1; transform: translateY(0); }
|
|
157
|
+
}
|
|
158
|
+
@keyframes scale-in {
|
|
159
|
+
from { opacity: 0; transform: scale(0.95); }
|
|
160
|
+
to { opacity: 1; transform: scale(1); }
|
|
161
|
+
}
|
|
162
|
+
@keyframes celebration-confetti-fall {
|
|
163
|
+
from {
|
|
164
|
+
opacity: 1;
|
|
165
|
+
transform: translate3d(0, -16px, 0) rotate(0deg);
|
|
166
|
+
}
|
|
167
|
+
to {
|
|
168
|
+
opacity: 0;
|
|
169
|
+
transform: translate3d(var(--celebration-drift, 0), 110vh, 0) rotate(var(--celebration-rotate, 360deg));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
@keyframes celebration-confetti-burst {
|
|
173
|
+
0% {
|
|
174
|
+
opacity: 1;
|
|
175
|
+
transform: translate3d(0, 0, 0) rotate(0deg) scale(0.7);
|
|
176
|
+
}
|
|
177
|
+
60% {
|
|
178
|
+
opacity: 1;
|
|
179
|
+
transform: translate3d(var(--celebration-burst-mid-x, 0), var(--celebration-burst-mid-y, 0), 0)
|
|
180
|
+
rotate(calc(var(--celebration-rotate, 360deg) * 0.75)) scale(1);
|
|
181
|
+
}
|
|
182
|
+
80% {
|
|
183
|
+
opacity: 0.9;
|
|
184
|
+
}
|
|
185
|
+
100% {
|
|
186
|
+
opacity: 0;
|
|
187
|
+
transform: translate3d(var(--celebration-burst-x, 0), var(--celebration-burst-y, 0), 0)
|
|
188
|
+
rotate(var(--celebration-rotate, 360deg)) scale(1);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
@keyframes celebration-pop {
|
|
192
|
+
from { opacity: 0; transform: translateY(8px) scale(0.94); }
|
|
193
|
+
to { opacity: 1; transform: translateY(0) scale(1); }
|
|
194
|
+
}
|
|
195
|
+
@keyframes celebration-emoji-pop {
|
|
196
|
+
0% { transform: scale(0); }
|
|
197
|
+
50% { transform: scale(1.4); }
|
|
198
|
+
70% { transform: scale(0.9); }
|
|
199
|
+
100% { transform: scale(1); }
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
@theme inline {
|
|
203
|
+
/* duration / easing は src/styles/motion.css のトークンを参照する
|
|
204
|
+
(値は従来どおり slide/fade-up=200ms・fade/scale=150ms の ease-out)。 */
|
|
205
|
+
--animate-slide-in-right: slide-in-right var(--Motion-Duration-Base) var(--Motion-Easing-Standard);
|
|
206
|
+
--animate-slide-in-left: slide-in-left var(--Motion-Duration-Base) var(--Motion-Easing-Standard);
|
|
207
|
+
--animate-fade-in: fade-in var(--Motion-Duration-Fast) var(--Motion-Easing-Standard);
|
|
208
|
+
--animate-fade-in-up: fade-in-up var(--Motion-Duration-Base) var(--Motion-Easing-Standard);
|
|
209
|
+
--animate-scale-in: scale-in var(--Motion-Duration-Fast) var(--Motion-Easing-Standard);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* ─── Container Query Breakpoints ───
|
|
213
|
+
@sm: / @md: などは viewport の sm: / md: と別スケール。
|
|
214
|
+
tokens.json の breakpoints.container と同じ値を publish 側にも固定し、
|
|
215
|
+
Tailwind の既定値変更や consumer 側設定に依存させない。 */
|
|
216
|
+
@theme {
|
|
217
|
+
--container-sm: 24rem; /* 384px */
|
|
218
|
+
--container-md: 28rem; /* 448px */
|
|
219
|
+
--container-xl: 36rem; /* 576px */
|
|
220
|
+
--container-2xl: 42rem; /* 672px */
|
|
221
|
+
--container-3xl: 48rem; /* 768px */
|
|
222
|
+
--container-4xl: 56rem; /* 896px */
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/* ─── Scrollbar Hide Utility ─── */
|
|
226
|
+
@utility scrollbar-hide {
|
|
227
|
+
-ms-overflow-style: none;
|
|
228
|
+
scrollbar-width: none;
|
|
229
|
+
&::-webkit-scrollbar {
|
|
230
|
+
display: none;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/* ─── Base Layer: ボーダー / アウトライン色のセーフティネット ───
|
|
235
|
+
Tailwind CSS v4 の破壊的変更で、border / outline の既定色は
|
|
236
|
+
gray-200 ではなく `currentColor`(=要素の文字色)になった。
|
|
237
|
+
そのため `border` `border-b` のように「幅だけで色を指定しない」
|
|
238
|
+
クラスは、消費側が親に濃い文字色(例: --Text-High-Emphasis = #1C1A1A)
|
|
239
|
+
を敷くと枠線が黒ずむ。これを防ぐため、shadcn / 多くの DS と同じく
|
|
240
|
+
全要素のフォールバック色をテーマ追従の --border / --ring に固定する。
|
|
241
|
+
|
|
242
|
+
※ これは「保険」。コンポーネント側は引き続き
|
|
243
|
+
border-[var(--Border-Low-Emphasis)] のように明示色を指定すること
|
|
244
|
+
(明示色を持つ要素は utilities レイヤが base を上書きするため不変)。 */
|
|
245
|
+
@layer base {
|
|
246
|
+
*,
|
|
247
|
+
::after,
|
|
248
|
+
::before {
|
|
249
|
+
border-color: var(--border);
|
|
250
|
+
outline-color: var(--ring);
|
|
251
|
+
}
|
|
252
|
+
}
|
package/src/preset.css
CHANGED
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
使い方:
|
|
8
8
|
@import "ksk-design-system/preset";
|
|
9
9
|
|
|
10
|
+
中身は preset-core.css(トークン・ブリッジ・base layer 等)と
|
|
11
|
+
DS 内部ユーティリティの safelist の 2 つ。DS 部品を 1 つも使わない
|
|
12
|
+
consumer は safelist を除いた `ksk-design-system/preset-core` を使える。
|
|
13
|
+
|
|
10
14
|
─── Tailwind CSS v4 の @source 設定(重要) ───────────────────
|
|
11
15
|
Tailwind v4 はデフォルトで node_modules を走査しません。
|
|
12
16
|
コンポーネントの Tailwind クラスを検出するため、CSS ファイルに
|
|
@@ -14,237 +18,8 @@
|
|
|
14
18
|
詳細は CLAUDE.md / README を参照。
|
|
15
19
|
============================================================= */
|
|
16
20
|
|
|
17
|
-
@import "./
|
|
18
|
-
/* 角丸の意味別トークン(issue #553)。定義元は styles/radius.css の1箇所で、
|
|
19
|
-
product-theme.css からも読み込まれる(個別 subpath 構成の消費側対策)。 */
|
|
20
|
-
@import "./styles/radius.css";
|
|
21
|
-
/* ページセクション間の縦リズム(issue #560)。定義元は
|
|
22
|
-
styles/section-spacing.css の1箇所で、product-theme.css からも読み込まれる
|
|
23
|
-
(個別 subpath 構成の消費側対策)。 */
|
|
24
|
-
@import "./styles/section-spacing.css";
|
|
25
|
-
/* 重なり順(issue #563)。定義元は styles/z-index.css の1箇所で、
|
|
26
|
-
product-theme.css からも読み込まれる(個別 subpath 構成の消費側対策)。 */
|
|
27
|
-
@import "./styles/z-index.css";
|
|
28
|
-
/* 影(issue #563)。定義元は styles/shadow.css の1箇所で、
|
|
29
|
-
product-theme.css からも読み込まれる(個別 subpath 構成の消費側対策)。 */
|
|
30
|
-
@import "./styles/shadow.css";
|
|
31
|
-
@import "./styles/semantic.css";
|
|
32
|
-
@import "./styles/categorical.css";
|
|
33
|
-
@import "./styles/typography.css";
|
|
34
|
-
@import "./styles/glass.css";
|
|
35
|
-
@import "./styles/bottom-nav.css";
|
|
36
|
-
@import "./styles/motion.css";
|
|
37
|
-
@import "./styles/sheet-keyboard.css";
|
|
38
|
-
/* プロダクト単位で上書きしてよい寸法・面の公開変数(issue #364)。
|
|
39
|
-
許可リストの正本は contracts/product-theme-overrides.json。 */
|
|
40
|
-
@import "./styles/product-theme.css";
|
|
21
|
+
@import "./preset-core.css";
|
|
41
22
|
/* DS 内部ユーティリティの safelist(自動生成 / issue #258)。
|
|
42
|
-
消費側の @source が無い・パスがずれていても DS のクラス CSS が生成される保険。
|
|
23
|
+
消費側の @source が無い・パスがずれていても DS のクラス CSS が生成される保険。
|
|
24
|
+
単体では `ksk-design-system/safelist` として読める。 */
|
|
43
25
|
@import "./styles/source-safelist.css";
|
|
44
|
-
|
|
45
|
-
/* ─── Bridge Layer: shadcn/ui 互換マッピング ───
|
|
46
|
-
|
|
47
|
-
命名が 2 系統あるのは意図的な設計。統一しない。
|
|
48
|
-
|
|
49
|
-
- `--Surface-Primary` のような **PascalCase-ケバブ** は KSK の semantic 層。
|
|
50
|
-
UI を書くときに参照するのは常にこちら(CLAUDE.md のセルフチェック参照)。
|
|
51
|
-
- `--primary` / `--muted-foreground` のような **小文字ケバブ** は shadcn/ui
|
|
52
|
-
(および Radix ベースの外部コンポーネント)が決め打ちで参照する名前。
|
|
53
|
-
shadcn の CLI で追加したコンポーネントや、consumer が別途入れた
|
|
54
|
-
shadcn 資産をそのまま動かすための互換レイヤーであり、名前は
|
|
55
|
-
shadcn 側の仕様なので KSK 側では変えられない。
|
|
56
|
-
|
|
57
|
-
つまり小文字ケバブ側は「外部規約への適合」であって命名の揺れではない。
|
|
58
|
-
新しいトークンを増やすときは PascalCase 側(semantic.css)に足し、
|
|
59
|
-
shadcn 互換名が必要な場合だけここで var() でエイリアスすること。 */
|
|
60
|
-
:root {
|
|
61
|
-
--radius: 0.5rem;
|
|
62
|
-
|
|
63
|
-
--background: var(--Surface-Primary);
|
|
64
|
-
--foreground: var(--Text-High-Emphasis);
|
|
65
|
-
|
|
66
|
-
--card: var(--Surface-Primary);
|
|
67
|
-
--card-foreground: var(--Text-High-Emphasis);
|
|
68
|
-
|
|
69
|
-
--popover: var(--Surface-Primary);
|
|
70
|
-
--popover-foreground: var(--Text-High-Emphasis);
|
|
71
|
-
|
|
72
|
-
--primary: var(--Brand-Primary);
|
|
73
|
-
--primary-foreground: var(--Text-on-Inverse);
|
|
74
|
-
|
|
75
|
-
--secondary: var(--Surface-Secondary);
|
|
76
|
-
--secondary-foreground: var(--Text-High-Emphasis);
|
|
77
|
-
|
|
78
|
-
--muted: var(--Surface-Tertiary);
|
|
79
|
-
--muted-foreground: var(--Text-Low-Emphasis);
|
|
80
|
-
|
|
81
|
-
--accent: var(--Surface-Secondary);
|
|
82
|
-
--accent-foreground: var(--Text-High-Emphasis);
|
|
83
|
-
|
|
84
|
-
--destructive: var(--Caution-Base);
|
|
85
|
-
--destructive-foreground: var(--Text-on-Inverse);
|
|
86
|
-
|
|
87
|
-
--border: var(--Border-Medium-Emphasis);
|
|
88
|
-
--input: var(--Border-Medium-Emphasis);
|
|
89
|
-
--ring: var(--Focus-High-Emphasis);
|
|
90
|
-
|
|
91
|
-
--sidebar-background: var(--Surface-Primary);
|
|
92
|
-
--sidebar-foreground: var(--Text-High-Emphasis);
|
|
93
|
-
--sidebar-primary: var(--Brand-Primary);
|
|
94
|
-
--sidebar-primary-foreground: var(--Text-on-Inverse);
|
|
95
|
-
--sidebar-accent: var(--Surface-Accent-Primary-Light);
|
|
96
|
-
--sidebar-accent-foreground: var(--Text-Accent-Primary);
|
|
97
|
-
--sidebar-border: var(--Border-Low-Emphasis);
|
|
98
|
-
--sidebar-ring: var(--Focus-High-Emphasis);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.dark {
|
|
102
|
-
--background: var(--Surface-Primary);
|
|
103
|
-
--foreground: var(--Text-High-Emphasis);
|
|
104
|
-
--card: var(--Surface-Secondary);
|
|
105
|
-
--card-foreground: var(--Text-High-Emphasis);
|
|
106
|
-
--popover: var(--Surface-Secondary);
|
|
107
|
-
--popover-foreground: var(--Text-High-Emphasis);
|
|
108
|
-
--primary: var(--Brand-Primary);
|
|
109
|
-
--primary-foreground: var(--Text-on-Inverse);
|
|
110
|
-
--secondary: var(--Surface-Tertiary);
|
|
111
|
-
--secondary-foreground: var(--Text-High-Emphasis);
|
|
112
|
-
--muted: var(--Surface-Tertiary);
|
|
113
|
-
--muted-foreground: var(--Text-Low-Emphasis);
|
|
114
|
-
--accent: var(--Surface-Tertiary);
|
|
115
|
-
--accent-foreground: var(--Text-High-Emphasis);
|
|
116
|
-
--destructive: var(--Caution-Base);
|
|
117
|
-
--destructive-foreground: var(--Text-on-Inverse);
|
|
118
|
-
--border: var(--Border-Medium-Emphasis);
|
|
119
|
-
--input: var(--Border-Medium-Emphasis);
|
|
120
|
-
--ring: var(--Focus-High-Emphasis);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/* ─── Radius Tokens ───
|
|
124
|
-
定義はこのファイルから styles/radius.css へ切り出した(issue #553)。
|
|
125
|
-
ファイル先頭の @import 群で読み込んでいる。 */
|
|
126
|
-
|
|
127
|
-
/* ─── Section Spacing Tokens ───
|
|
128
|
-
定義はこのファイルから styles/section-spacing.css へ切り出した(issue #560)。
|
|
129
|
-
ファイル先頭の @import 群で読み込んでいる。 */
|
|
130
|
-
|
|
131
|
-
/* ─── Z-Index Scale ───
|
|
132
|
-
定義はこのファイルから styles/z-index.css へ切り出した(issue #563)。
|
|
133
|
-
ファイル先頭の @import 群で読み込んでいる。 */
|
|
134
|
-
|
|
135
|
-
/* ─── Shadow Tokens ───
|
|
136
|
-
定義はこのファイルから styles/shadow.css へ切り出した(issue #563)。
|
|
137
|
-
ファイル先頭の @import 群で読み込んでいる。 */
|
|
138
|
-
|
|
139
|
-
/* ─── Animation ─── */
|
|
140
|
-
@keyframes slide-in-right {
|
|
141
|
-
from { transform: translateX(100%); opacity: 0; }
|
|
142
|
-
to { transform: translateX(0); opacity: 1; }
|
|
143
|
-
}
|
|
144
|
-
@keyframes slide-in-left {
|
|
145
|
-
from { transform: translateX(-100%); opacity: 0; }
|
|
146
|
-
to { transform: translateX(0); opacity: 1; }
|
|
147
|
-
}
|
|
148
|
-
@keyframes fade-in {
|
|
149
|
-
from { opacity: 0; }
|
|
150
|
-
to { opacity: 1; }
|
|
151
|
-
}
|
|
152
|
-
@keyframes fade-in-up {
|
|
153
|
-
from { opacity: 0; transform: translateY(8px); }
|
|
154
|
-
to { opacity: 1; transform: translateY(0); }
|
|
155
|
-
}
|
|
156
|
-
@keyframes scale-in {
|
|
157
|
-
from { opacity: 0; transform: scale(0.95); }
|
|
158
|
-
to { opacity: 1; transform: scale(1); }
|
|
159
|
-
}
|
|
160
|
-
@keyframes celebration-confetti-fall {
|
|
161
|
-
from {
|
|
162
|
-
opacity: 1;
|
|
163
|
-
transform: translate3d(0, -16px, 0) rotate(0deg);
|
|
164
|
-
}
|
|
165
|
-
to {
|
|
166
|
-
opacity: 0;
|
|
167
|
-
transform: translate3d(var(--celebration-drift, 0), 110vh, 0) rotate(var(--celebration-rotate, 360deg));
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
@keyframes celebration-confetti-burst {
|
|
171
|
-
0% {
|
|
172
|
-
opacity: 1;
|
|
173
|
-
transform: translate3d(0, 0, 0) rotate(0deg) scale(0.7);
|
|
174
|
-
}
|
|
175
|
-
60% {
|
|
176
|
-
opacity: 1;
|
|
177
|
-
transform: translate3d(var(--celebration-burst-mid-x, 0), var(--celebration-burst-mid-y, 0), 0)
|
|
178
|
-
rotate(calc(var(--celebration-rotate, 360deg) * 0.75)) scale(1);
|
|
179
|
-
}
|
|
180
|
-
80% {
|
|
181
|
-
opacity: 0.9;
|
|
182
|
-
}
|
|
183
|
-
100% {
|
|
184
|
-
opacity: 0;
|
|
185
|
-
transform: translate3d(var(--celebration-burst-x, 0), var(--celebration-burst-y, 0), 0)
|
|
186
|
-
rotate(var(--celebration-rotate, 360deg)) scale(1);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
@keyframes celebration-pop {
|
|
190
|
-
from { opacity: 0; transform: translateY(8px) scale(0.94); }
|
|
191
|
-
to { opacity: 1; transform: translateY(0) scale(1); }
|
|
192
|
-
}
|
|
193
|
-
@keyframes celebration-emoji-pop {
|
|
194
|
-
0% { transform: scale(0); }
|
|
195
|
-
50% { transform: scale(1.4); }
|
|
196
|
-
70% { transform: scale(0.9); }
|
|
197
|
-
100% { transform: scale(1); }
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
@theme inline {
|
|
201
|
-
/* duration / easing は src/styles/motion.css のトークンを参照する
|
|
202
|
-
(値は従来どおり slide/fade-up=200ms・fade/scale=150ms の ease-out)。 */
|
|
203
|
-
--animate-slide-in-right: slide-in-right var(--Motion-Duration-Base) var(--Motion-Easing-Standard);
|
|
204
|
-
--animate-slide-in-left: slide-in-left var(--Motion-Duration-Base) var(--Motion-Easing-Standard);
|
|
205
|
-
--animate-fade-in: fade-in var(--Motion-Duration-Fast) var(--Motion-Easing-Standard);
|
|
206
|
-
--animate-fade-in-up: fade-in-up var(--Motion-Duration-Base) var(--Motion-Easing-Standard);
|
|
207
|
-
--animate-scale-in: scale-in var(--Motion-Duration-Fast) var(--Motion-Easing-Standard);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/* ─── Container Query Breakpoints ───
|
|
211
|
-
@sm: / @md: などは viewport の sm: / md: と別スケール。
|
|
212
|
-
tokens.json の breakpoints.container と同じ値を publish 側にも固定し、
|
|
213
|
-
Tailwind の既定値変更や consumer 側設定に依存させない。 */
|
|
214
|
-
@theme {
|
|
215
|
-
--container-sm: 24rem; /* 384px */
|
|
216
|
-
--container-md: 28rem; /* 448px */
|
|
217
|
-
--container-xl: 36rem; /* 576px */
|
|
218
|
-
--container-2xl: 42rem; /* 672px */
|
|
219
|
-
--container-3xl: 48rem; /* 768px */
|
|
220
|
-
--container-4xl: 56rem; /* 896px */
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
/* ─── Scrollbar Hide Utility ─── */
|
|
224
|
-
@utility scrollbar-hide {
|
|
225
|
-
-ms-overflow-style: none;
|
|
226
|
-
scrollbar-width: none;
|
|
227
|
-
&::-webkit-scrollbar {
|
|
228
|
-
display: none;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
/* ─── Base Layer: ボーダー / アウトライン色のセーフティネット ───
|
|
233
|
-
Tailwind CSS v4 の破壊的変更で、border / outline の既定色は
|
|
234
|
-
gray-200 ではなく `currentColor`(=要素の文字色)になった。
|
|
235
|
-
そのため `border` `border-b` のように「幅だけで色を指定しない」
|
|
236
|
-
クラスは、消費側が親に濃い文字色(例: --Text-High-Emphasis = #1C1A1A)
|
|
237
|
-
を敷くと枠線が黒ずむ。これを防ぐため、shadcn / 多くの DS と同じく
|
|
238
|
-
全要素のフォールバック色をテーマ追従の --border / --ring に固定する。
|
|
239
|
-
|
|
240
|
-
※ これは「保険」。コンポーネント側は引き続き
|
|
241
|
-
border-[var(--Border-Low-Emphasis)] のように明示色を指定すること
|
|
242
|
-
(明示色を持つ要素は utilities レイヤが base を上書きするため不変)。 */
|
|
243
|
-
@layer base {
|
|
244
|
-
*,
|
|
245
|
-
::after,
|
|
246
|
-
::before {
|
|
247
|
-
border-color: var(--border);
|
|
248
|
-
outline-color: var(--ring);
|
|
249
|
-
}
|
|
250
|
-
}
|