ksk-design-system 2.3.0 → 2.5.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 +3 -3
- package/README.md +6 -0
- package/contracts/components.json +1 -1
- package/contracts/token-hex-cache.json +1 -1
- package/dist/index.js +56 -27
- package/dist/native/ui.js +1778 -1662
- package/dist/{native-E7YOVABy.js → native-BsJ3ntN3.js} +8 -8
- package/dist/native.js +1 -1
- package/dist/types/components/patterns/search-bar.d.ts +1 -1
- package/dist/types/native/components/ProgressRing.d.ts +7 -2
- package/dist/types/native/components/Scrim.d.ts +40 -0
- package/dist/types/native/components/index.d.ts +1 -0
- package/dist/types/native/index.d.ts +1 -0
- package/dist/types/native/progress-ring-geometry.d.ts +32 -0
- package/dist/types/native/scrim-layout.d.ts +26 -0
- package/dist/types/tokens/native/scales.d.ts +8 -8
- package/package.json +5 -1
- package/src/native/COMPONENT_LOOKUP.md +2 -1
- package/src/preset.css +5 -9
- package/src/styles/product-theme.css +6 -0
- package/src/styles/radius.css +23 -0
- package/src/styles/typography.css +6 -6
- package/tokens.json +5 -5
package/DESIGN.md
CHANGED
|
@@ -34,9 +34,9 @@ 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
42
|
surface: "14px" # Card / Input / Popover → var(--Radius-Surface)
|
|
@@ -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
|
@@ -88,6 +88,12 @@ DS のルールが適用されません。既存ファイルはスキップさ
|
|
|
88
88
|
|
|
89
89
|
独自ブランドのテーマを使う場合は、この後にテーマCSSをimportしてください。
|
|
90
90
|
|
|
91
|
+
`preset` を使わずトークン CSS を個別 subpath で import する構成では、角丸トークン
|
|
92
|
+
(`--Radius-Surface` / `--Radius-Modal` / `--Radius-Sheet`)は
|
|
93
|
+
`ksk-design-system/tokens/product-theme` に含まれます(issue #553)。
|
|
94
|
+
product-theme を読まず Radius だけが欲しい場合は
|
|
95
|
+
`@import "ksk-design-system/tokens/radius";` を使ってください。
|
|
96
|
+
|
|
91
97
|
Tailwind CSS v4 は `node_modules` を既定では走査しません。`@source` がないと、
|
|
92
98
|
DS 内部だけで使うレイアウト・サイズ・状態クラスが生成されず、コンポーネントの表示や操作が崩れます。
|
|
93
99
|
consumer 側の Tailwind と DS を同じビルドで処理するため、上記の設定をセットで使用してください。
|
|
@@ -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.5.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/dist/index.js
CHANGED
|
@@ -7619,7 +7619,16 @@ function Yl({ value: e, onChange: t, placeholder: n, minRows: r = 3, density: i
|
|
|
7619
7619
|
d();
|
|
7620
7620
|
}, [e, d]), u.useEffect(() => {
|
|
7621
7621
|
let e = () => d();
|
|
7622
|
-
|
|
7622
|
+
window.addEventListener("resize", e);
|
|
7623
|
+
let t = l.current, n = t?.getBoundingClientRect().width, r = null, i = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => {
|
|
7624
|
+
let e = t?.getBoundingClientRect().width;
|
|
7625
|
+
e !== n && (n = e, r !== null && cancelAnimationFrame(r), r = requestAnimationFrame(() => {
|
|
7626
|
+
r = null, d();
|
|
7627
|
+
}));
|
|
7628
|
+
});
|
|
7629
|
+
return t && i?.observe(t), () => {
|
|
7630
|
+
window.removeEventListener("resize", e), i?.disconnect(), r !== null && cancelAnimationFrame(r);
|
|
7631
|
+
};
|
|
7623
7632
|
}, [d]);
|
|
7624
7633
|
let f = a != null && a > 0 ? e.length / a : 0, p = a == null ? "" : e.length >= a ? "text-[var(--Text-Caution)]" : f >= .7 ? "text-[var(--Text-Warning)]" : "text-[var(--Text-Low-Emphasis)]", m = o === void 0 ? a != null : o;
|
|
7625
7634
|
return /* @__PURE__ */ V("div", {
|
|
@@ -14231,12 +14240,24 @@ function sp({ className: e, steps: t, currentStep: n, ...r }) {
|
|
|
14231
14240
|
}
|
|
14232
14241
|
//#endregion
|
|
14233
14242
|
//#region src/components/patterns/search-bar.tsx
|
|
14234
|
-
function cp({ className: e, onSearch: t, asForm: n = !1,
|
|
14235
|
-
let
|
|
14236
|
-
|
|
14237
|
-
|
|
14238
|
-
|
|
14239
|
-
|
|
14243
|
+
function cp({ className: e, onSearch: t, asForm: n = !1, onKeyDown: r, onCompositionStart: i, onCompositionEnd: a, ...o }) {
|
|
14244
|
+
let s = u.useRef(!1), c = u.useRef(!1), l = u.useRef(null);
|
|
14245
|
+
u.useEffect(() => () => {
|
|
14246
|
+
l.current !== null && clearTimeout(l.current);
|
|
14247
|
+
}, []);
|
|
14248
|
+
let d = (e) => {
|
|
14249
|
+
if (r?.(e), !(e.defaultPrevented || e.key !== "Enter")) {
|
|
14250
|
+
if (s.current || su(e)) {
|
|
14251
|
+
c.current = !0, l.current !== null && clearTimeout(l.current), l.current = setTimeout(() => {
|
|
14252
|
+
c.current = !1, l.current = null;
|
|
14253
|
+
}, 0);
|
|
14254
|
+
return;
|
|
14255
|
+
}
|
|
14256
|
+
c.current = !1, l.current !== null && (clearTimeout(l.current), l.current = null), n || t?.(e.currentTarget.value);
|
|
14257
|
+
}
|
|
14258
|
+
}, f = (e) => {
|
|
14259
|
+
e.preventDefault(), !s.current && !c.current && t && t(e.currentTarget.elements.namedItem("search")?.value ?? "");
|
|
14260
|
+
}, p = /* @__PURE__ */ V("svg", {
|
|
14240
14261
|
width: "20",
|
|
14241
14262
|
height: "20",
|
|
14242
14263
|
viewBox: "0 0 20 20",
|
|
@@ -14255,25 +14276,31 @@ function cp({ className: e, onSearch: t, asForm: n = !1, ...r }) {
|
|
|
14255
14276
|
strokeWidth: "2",
|
|
14256
14277
|
strokeLinecap: "round"
|
|
14257
14278
|
})]
|
|
14258
|
-
}),
|
|
14279
|
+
}), m = /* @__PURE__ */ B("input", {
|
|
14259
14280
|
type: "search",
|
|
14260
14281
|
name: "search",
|
|
14261
14282
|
"data-slot": "input",
|
|
14262
14283
|
enterKeyHint: "search",
|
|
14263
14284
|
className: G("flex h-12 w-full rounded-full border border-[var(--Border-Medium-Emphasis)] bg-[var(--Surface-Primary)] pl-10 pr-4 typo-body-md text-[var(--Text-High-Emphasis)]", "placeholder:text-[var(--Text-Low-Emphasis)]", "focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-[var(--Focus-High-Emphasis)]/50 focus-visible:border-[var(--Border-Accent-Primary)]", "disabled:cursor-not-allowed disabled:opacity-50"),
|
|
14264
|
-
onKeyDown:
|
|
14265
|
-
|
|
14285
|
+
onKeyDown: d,
|
|
14286
|
+
onCompositionStart: (e) => {
|
|
14287
|
+
s.current = !0, i?.(e);
|
|
14288
|
+
},
|
|
14289
|
+
onCompositionEnd: (e) => {
|
|
14290
|
+
s.current = !1, a?.(e);
|
|
14291
|
+
},
|
|
14292
|
+
...o
|
|
14266
14293
|
});
|
|
14267
14294
|
return n ? /* @__PURE__ */ V("form", {
|
|
14268
14295
|
"data-slot": "search-bar",
|
|
14269
14296
|
role: "search",
|
|
14270
14297
|
className: G("relative w-full", e),
|
|
14271
|
-
onSubmit:
|
|
14272
|
-
children: [
|
|
14298
|
+
onSubmit: f,
|
|
14299
|
+
children: [p, m]
|
|
14273
14300
|
}) : /* @__PURE__ */ V("div", {
|
|
14274
14301
|
"data-slot": "search-bar",
|
|
14275
14302
|
className: G("relative w-full", e),
|
|
14276
|
-
children: [
|
|
14303
|
+
children: [p, m]
|
|
14277
14304
|
});
|
|
14278
14305
|
}
|
|
14279
14306
|
//#endregion
|
|
@@ -18191,27 +18218,29 @@ var _g = {
|
|
|
18191
18218
|
}
|
|
18192
18219
|
};
|
|
18193
18220
|
function vg({ url: e, title: t, providers: n, region: r = "global", layout: i = "circle", className: a, onShare: o, onCopy: s, copiedLabel: c = "コピーしました", copyErrorLabel: l = "コピーできませんでした", feedbackDuration: d = 2e3, groupLabel: f = "シェア" }) {
|
|
18194
|
-
let [p, m] = u.useState(null), h = u.useRef(null), g = n ?? hg[r];
|
|
18221
|
+
let [p, m] = u.useState(null), h = u.useRef(null), g = u.useRef(0), _ = n ?? hg[r];
|
|
18195
18222
|
u.useEffect(() => () => {
|
|
18196
|
-
h.current && clearTimeout(h.current);
|
|
18223
|
+
g.current += 1, h.current && clearTimeout(h.current);
|
|
18197
18224
|
}, []);
|
|
18198
|
-
let
|
|
18225
|
+
let v = (e, t) => {
|
|
18199
18226
|
h.current && clearTimeout(h.current), m({
|
|
18200
18227
|
provider: e,
|
|
18201
18228
|
result: t
|
|
18202
|
-
}),
|
|
18229
|
+
}), h.current = setTimeout(() => {
|
|
18203
18230
|
m(null), h.current = null;
|
|
18204
18231
|
}, d);
|
|
18205
|
-
},
|
|
18232
|
+
}, y = async (t) => {
|
|
18233
|
+
let n = ++g.current, r = "success";
|
|
18206
18234
|
try {
|
|
18207
18235
|
if (typeof navigator > "u" || !navigator.clipboard?.writeText) throw Error("Clipboard API is unavailable");
|
|
18208
|
-
await navigator.clipboard.writeText(e)
|
|
18236
|
+
await navigator.clipboard.writeText(e);
|
|
18209
18237
|
} catch {
|
|
18210
|
-
|
|
18238
|
+
r = "error";
|
|
18211
18239
|
}
|
|
18212
|
-
|
|
18240
|
+
n === g.current && v(t, r), s?.(r);
|
|
18241
|
+
}, b = async (n) => {
|
|
18213
18242
|
if (o?.(n), n === "copy") {
|
|
18214
|
-
await
|
|
18243
|
+
await y(n);
|
|
18215
18244
|
return;
|
|
18216
18245
|
}
|
|
18217
18246
|
let r = _g[n];
|
|
@@ -18225,7 +18254,7 @@ function vg({ url: e, title: t, providers: n, region: r = "global", layout: i =
|
|
|
18225
18254
|
return;
|
|
18226
18255
|
}
|
|
18227
18256
|
if (r.webShare) {
|
|
18228
|
-
await
|
|
18257
|
+
await y(n);
|
|
18229
18258
|
return;
|
|
18230
18259
|
}
|
|
18231
18260
|
r.buildUrl && window.open(r.buildUrl(e, t), "_blank", "noopener,noreferrer,width=600,height=500");
|
|
@@ -18237,11 +18266,11 @@ function vg({ url: e, title: t, providers: n, region: r = "global", layout: i =
|
|
|
18237
18266
|
role: "group",
|
|
18238
18267
|
"aria-label": f,
|
|
18239
18268
|
"data-region": r,
|
|
18240
|
-
children:
|
|
18269
|
+
children: _.map((e) => {
|
|
18241
18270
|
let t = _g[e], n = p?.provider === e ? p.result : null, r = n === "success" ? c : n === "error" ? l : t.label;
|
|
18242
18271
|
return /* @__PURE__ */ V("button", {
|
|
18243
18272
|
type: "button",
|
|
18244
|
-
onClick: () => void
|
|
18273
|
+
onClick: () => void b(e),
|
|
18245
18274
|
"aria-label": t.label,
|
|
18246
18275
|
className: "flex min-h-11 shrink-0 flex-col items-center gap-2 rounded-lg cursor-pointer focus-visible:ring-[3px] focus-visible:ring-[var(--Focus-High-Emphasis)]/50",
|
|
18247
18276
|
children: [/* @__PURE__ */ V("span", {
|
|
@@ -18272,11 +18301,11 @@ function vg({ url: e, title: t, providers: n, region: r = "global", layout: i =
|
|
|
18272
18301
|
role: "group",
|
|
18273
18302
|
"aria-label": f,
|
|
18274
18303
|
"data-region": r,
|
|
18275
|
-
children:
|
|
18304
|
+
children: _.map((e) => {
|
|
18276
18305
|
let t = _g[e], n = p?.provider === e ? p.result : null, r = n === "success" ? c : n === "error" ? l : t.label;
|
|
18277
18306
|
return /* @__PURE__ */ V("button", {
|
|
18278
18307
|
type: "button",
|
|
18279
|
-
onClick: () => void
|
|
18308
|
+
onClick: () => void b(e),
|
|
18280
18309
|
"aria-label": t.label,
|
|
18281
18310
|
className: G("inline-flex min-h-11 items-center gap-2 px-3 py-2 rounded-full border border-[var(--Border-Medium-Emphasis)] typo-label-xs transition-colors focus-visible:ring-[3px] focus-visible:ring-[var(--Focus-High-Emphasis)]/50", t.inlineClass),
|
|
18282
18311
|
children: [/* @__PURE__ */ V("span", {
|